Giter Site home page Giter Site logo

tgr-wizards's Introduction

TGR-Wizards

Compilation of example wizards made with prototype of `tr-wizard` module


Getting Started

git clone https://github.com/Falieson/tgr-wizards.git
npm i -D
nps

Usage

(copy/pasted from src/modules/wizard/README.md)

// WB: default values
interface IWizBuilderProps {
  id?: string,
  Container?: JSX.Element,
  Page?: JSX.Element,
  Stepper?: JSX.Element,
  theme?: any,    // tslint:disable-line no-any
}
function WizardBuilder({
  id = sid,
  Container = SimpleContainer,
  Page = SimplePage,
  Stepper = SimpleStepper,
  theme = T,
}: IWizBuilderProps
// WB: instantiate
const Wizard = WizardBuilder({
  Stepper: BetterStepper,
  id: 'betterSimple',
})

// WB: usage
export default function() {
  return <Wizard>
    {...pages}
  </Wizard>
}

File Structure

src/
├── app/          - global app stuff
├── components/   - the pieces used in the routes, abstracts modules
├── helpers/      - useful functions
├── middlewares/  - third-party HOC functionality (apollo, router)
├── modules/      - first-party modules
    ├── gx        - author hasn't published rc4 which fixes a broken package
    ├── wizard    - prototyping the module before extracting it to its own module
├── routes/       - define page for a route
├── types/        - ts modules, common, interfaces

Notable Features

  • the module's theme.scss set vars that define the UI's palette
  • the wizard is controlled by UrlSearchParams, can link to a page of the wizard
  • the module is a WizardBuilder
    • a HOC that makes composing different Wizard UIs easy
    • while coordinating logic between the Wizard's parts
    • can pass themes to the Builder too
  • React16 Context to pass data to components while skipping intermediary components

TL;DR;

  • The #1 LI in the "Docs" list below has lots of info about the underlying stack
  • the only thing you really need to know to get started are 2 commands: npm i -D && nps

A bit more...

  • s?css.d.ts is generated by the webpack watcher

The base stack isn't ready for prod

  • the stack is made for app development
  • it uses webpack-dev-server to deliver a standard development environment
  • production stage for the tgr-app isn't done yet, which means the goal of being able to run nps build.prod and get a dist/ that can be consumed by tgr-mono(monolith) or tgr-fullstack(prototyping) apps.
  • this app does't include an express-server so running build.prod doesn't give you something easily useable.

Docs

tgr-wizards's People

Contributors

falieson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.