GithubHelp home page GithubHelp logo

kelvincs / rock-ui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vinixgonzalez/rock-ui

0.0 1.0 0.0 591 KB

Rock Content Design System component kit in React. Based out on Chakra-UI.

Home Page: https://design.rockcontent.com

License: MIT License

JavaScript 0.64% TypeScript 98.89% CSS 0.48%

rock-ui's Introduction

Rock UI

Rock Content Design System component kit in React

Using Rockr UI in a react project

Install the kit package in your react project

yarn add @rockr/rock-ui

or, with npm:

npm i -S @rockr/rock-ui

In your entry file (e.g app.tsx) use the theme provider

# app.tsx

import * as React from "react"
import { ThemeProvider, CSSReset, RockUITheme } from "@rockr/rock-ui"

// Use at the root of your app
function App() {
  return (
    <ThemeProvider theme={RockUITheme}>
      <CSSReset />
      <App />
    </ThemeProvider>
  )
}

Use any component from the library

# MyComponent.tsx
import React from 'react'
import { Button } from '@rockr/rock-ui'

const MyComponent = () => <Button colorScheme="blue">Foobar</Button>

Development

npm start # or yarn start

This builds to /dist and runs the project in watch mode so any edits you save inside src causes a rebuild to /dist.

Storybook

Run inside another terminal:

yarn storybook

This loads the stories from ./src/components/**/stories/*.stories.tsx.

NOTE: Stories should reference the components as if using the library, similar to the example playground. This means importing from the root project directory. This has been aliased in the tsconfig and the storybook webpack config as a helper.

Configuration

Code quality is set up with prettier, husky, and lint-staged. Adjust the respective fields in package.json accordingly.

Jest

Jest tests are set up to run with npm test or yarn test. This runs the test watcher (Jest) in an interactive mode. By default, runs tests related to files changed since the last commit.

Rollup

RockUI uses Rollup v1.x as a bundler and generates multiple rollup configs for various module formats and build settings. See Optimizations for details.

TypeScript

tsconfig.json is set up to interpret dom and esnext types, as well as react for jsx. Adjust according to your needs.

Named Exports

Per Palmer Group guidelines, always use named exports. Code split inside your React app instead of your React library.

Publishing to NPM

We use https://github.com/sindresorhus/np to publish to NPM

Known Issues

  1. The progress component preview doesn't seem to work in the official docs examples https://next.chakra-ui.com/docs/components/progress however, it works fine for us.

  2. The checkbox and radio border color is inherited. So if it is not set on a parent, it will be white. And chances are high for the background to be white as well, so it will seem that the property is not set.

rock-ui's People

Watchers

 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.