GithubHelp home page GithubHelp logo

c8r / kit Goto Github PK

View Code? Open in Web Editor NEW
1.2K 15.0 35.0 35.58 MB

Tools for developing, documenting, and testing React component libraries

Home Page: https://compositor.io/kit

License: MIT License

JavaScript 98.29% CSS 0.13% HTML 1.58%
react components cli development documentation testing ui design-systems styleguide library

kit's People

Contributors

corygibbons avatar danielruf avatar johno avatar jxnblk avatar lachlanjc avatar tbroadley avatar vinspee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kit's Issues

Introduce an optional Preview component

Currently this works, however the preview is understandably a bit broken. I'm wondering if perhaps we offer an optional Preview component?:

import {
  Provider,
  Library,
  Example,
  Preview,
  Knobs
} from '@compositor/kit'

import Doc from '../docs/components/Button.md'
import { Button } from './ui'

export default () =>
  <Provider>
    <Library>
      <Library.Nav />
      <Example name='Button'>
        <Preview>
          <Button>Button</Button>
        </Preview>

        <Doc />

        <Knobs>
          <Button size='normal'>Hello</Button>
          <Knobs.Input name='children' />
          <Knobs.Select name='size'>
            <option></option>
            <option>small</option>
            <option>normal</option>
            <option>large</option>
          </Knobs.Select>
        </Knobs>
      </Example>
    </Library>
   </Provider>

In this example, only Preview is rendered in the library view, and the remainder is rendered in the component view.

HTML/Atomic CSS mode

Option to output a cut and paste-able version with html + atomic css based on the theme.

CLI

For more in-depth discussion around #73 and subsequent CLI PRs:

Features

  • scaffolding (with template support for libraries/tests/components/theme)
  • dev server
  • static building
  • publishing
  • design system linting
  • snapshot/render diffing
  • image publishing
  • svg publishing

Arch

The heavy lifting of the CLI should live in logical, separate packages in the packages dir. This will allow for the libraries to be used for other usecases and app contexts. The cli dir in root will server more as the UI for the CLI itself.

Fix css errors

~/c/c8r/styleguide rewrite* 1m 30s
❯ rm -rf out && ./dist/cli.js docs/components -d out && superstatic out
 styleguide  @compositor/styleguide
Error parsing component metadata for docs/components/Box.md
Processed docs/components/Box.md
Error parsing component metadata for docs/components/Flex.md
Processed docs/components/Flex.md
Warning: Unsupported vendor-prefixed style property webkitTextDecoration. Did you mean WebkitTextDecoration?
Warning: Unsupported vendor-prefixed style property webkitAppearance. Did you mean WebkitAppearance?
Warning: Unsupported vendor-prefixed style property mozAppearance. Did you mean MozAppearance?
Warning: Unsupported vendor-prefixed style property webkitTextTransform. Did you mean WebkitTextTransform?

./library/NavLink.js:    webkitTextDecoration: 'none',
./library/Button.js:    webkitTextDecoration: 'none',
./library/FormButton.js:    webkitTextDecoration: 'none',

Combine styleguide and devkit components into a single library

As discussed, it might make sense for styleguide and my idea for a devkit to be combined into a single library of components for development, documentation, and demos.
Some of the components below would also be useful for building features into the apps and for other potential libraries, like an automatic style guide generator.

Some of the potential components I was thinking of include:

  • XRay
  • Library: some storybook like grid of components with detail view
  • Knobs: form for editing props
  • Fetch: render-prop based fetch for prototyping
  • Frame: iframe for actual isolation (should be zoomable)
  • Responsive: multiple iframes at different sizes
  • Matrix: TBD - shows a grid of the same component with different combinations of props
  • Example/LiveEditor*: live-editable code block
  • Docgen*: list out propTypes and description for a component (would need raw source code)
  • ColorPalette*: displays a color palette from a color object or array
  • ColorContrast: display color contrast between two colors
  • Markdown: already exists in markdown
  • Stateful: like refunk but with a render prop
  • Diff: overlays one component on top of the other and uses CSS blend modes to make a sort of visual diff

* already in styleguide

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.