@g123jp/g123-ui
TypeScript icon, indicating that this package has built-in type declarations

2.5.13 • Public • Published

g123-ui

Reuseable UI based on G123 Design System and Atomic Design

image

📦 Install

yarn add @g123jp/g123-ui

🔨 Usage

  • make sure Tailwind's default style has been loaded correctly.

    expand details

    # in your root css
    @tailwind base;
    @tailwind components;
    @tailwind utilities;
  • make sure postcss has been configured correctly(if you use TailwindCSS as a PostCSS plugin).

  • import g123-ui's config as default(use tailwindcss's presents)

    import { g123TailwindPresets } from '@g123jp/g123-ui';
    
    const TailwindConfig = {
      // use g123-ui's presets as default
      presets: [g123TailwindPresets],
      content: [
        // ... put your content here
        './node_modules/@g123jp/g123-ui/dist/components/**/*.js',
        './node_modules/@g123jp/g123-ui/dist/utils/**/*.js',
      ],
      // ... your other configs
    };
  • use g123-ui's component:

    import { Button, ButtonType, Logo } from '@g123jp/g123-ui';
    
    const App = () => (
      <>
        <Logo />
        <Button type={ButtonType.primay}>Submit</Button>
      </>
    );

🌛 Dark Mode:

  • g123-ui supports the system's dark mode by default(uses the prefers-color-scheme CSS media feature).

  • But you can also build sites that support toggling dark mode manually using the ‘class’ strategy.

  • Or use your own customize the dark mode selector, for example, add the following code in your tailwind.config.js and control dark mode by adding data-mode="g123-dark" to your <html> tag:

darkMode: ['class', '[data-mode="g123-dark"]'];

image

⌨️ Development

  • install

    yarn
  • build

    ⛑: Make sure to run build before publishing it.

    yarn build
  • 🤹🏼 check with storybook

    yarn storybook
    image
  • bundle visualize and analyze with rollup-plugin-visualizer

    yarn build

    then open stats/network/index.html or stats/treemap/index.html in your browser.

Readme

Keywords

none

Package Sidebar

Install

npm i @g123jp/g123-ui

Weekly Downloads

49

Version

2.5.13

License

MIT

Unpacked Size

1.71 MB

Total Files

855

Last publish

Collaborators

  • lukaszmoskwactw
  • chinterry
  • huli-ctw
  • hydranger
  • kouhin