Giter Site home page Giter Site logo

radius's Introduction

Radius Design System Kit

This is 1 of 3 repos that is part of an ecosystem of open-source tools and libraries that allow you to accelerate your design system! This repository contains several branches that enable the boilerplate creation of design system instances for React.

rangle.io/radius

Figma File

Storybook Docs

Chromatic

See also: Radius Angular Radius Workspace

Contribution

We are currently working to make Radius for React more flexible with regards to accelerating the creation of design systems for integrating with vanilla css, css modules, emotion and styled-components.

Respective versions of such design systems can be found in the following branches:

basic-css     - CSS modules
basic-emotion - the emotion library, has theme
basic-styled  - the styled-components library, has theme

Please create pull requests against the branches above to contribute.

What's Inside

.
├── README.md
├── demo/
├── dist/
├── docs/
├── example/
├── jest.config.js
├── package.json
├── src/
└── tsconfig.json

Are you using Radius?

We would love to hear about how you are using Radius or any feedback or feature requests. Open an issue.

🚀 Quick start

To get started you can just clone the repository.


TSDX React w/ Storybook User Guide

Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.

This TSDX setup is meant for developing React component libraries (not apps!) that can be published to NPM. If you’re looking to build a React-based app, you should use create-react-app, razzle, nextjs, gatsby, or react-static.

If you’re new to TypeScript and React, checkout this handy cheatsheet

Commands

TSDX scaffolds your new library inside /src, and also sets up a Parcel-based playground for it inside /example.

The recommended workflow is to run TSDX in one terminal:

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.

Then run either Storybook or the example playground:

Storybook

Run inside another terminal:

yarn storybook

This loads the stories from ./stories.

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.

Example

Then run the example inside another:

cd example
npm i # or yarn to install dependencies
npm start # or yarn start

The default example imports and live reloads whatever is in /dist, so if you are seeing an out of date component, make sure TSDX is running in watch mode like we recommend above. No symlinking required, we use Parcel's aliasing.

To do a one-off build, use npm run build or yarn build.

To run tests, use npm test or yarn test.

Configuration

Code quality is set up for you 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.

Bundle analysis

Calculates the real cost of your library using size-limit with npm run size and visulize it with npm run analyze.

React Testing Library

We do not set up react-testing-library for you yet, we welcome contributions and documentation on this.

Rollup

TSDX uses Rollup 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.

Continuous Integration

GitHub Actions

Two actions are added by default:

  • main which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
  • size which comments cost comparison of your library on every pull request using size-limit

Optimizations

Please see the main tsdx optimizations docs. In particular, know that you can take advantage of development-only optimizations:

// ./types/index.d.ts
declare var __DEV__: boolean;

// inside your code...
if (__DEV__) {
  console.log('foo');
}

You can also choose to install and use invariant and warning functions.

Module Formats

CJS, ESModules, and UMD module formats are supported.

The appropriate paths are configured in package.json and dist/index.js accordingly. Please report if any issues are found.

Deploying the Example Playground

The Playground is just a simple Parcel app, you can deploy it anywhere you would normally deploy that. Here are some guidelines for manually deploying with the Netlify CLI (npm i -g netlify-cli):

cd example # if not already in the example folder
npm run build # builds to dist
netlify deploy # deploy the dist folder

Alternatively, if you already have a git repo connected, you can set up continuous deployment with Netlify:

netlify init
# build command: yarn build && cd example && yarn && yarn build
# directory to deploy: example/dist
# pick yes for netlify.toml

Named Exports

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

Including Styles

There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like.

For vanilla CSS, you can include it at the root directory and add it to the files section in your package.json, so that it can be imported separately by your users and run through their bundler's loader.

Publishing to NPM

We recommend using np.

Usage with Lerna

When creating a new package with TSDX within a project set up with Lerna, you might encounter a Cannot resolve dependency error when trying to run the example project. To fix that you will need to make changes to the package.json file inside the example directory.

The problem is that due to the nature of how dependencies are installed in Lerna projects, the aliases in the example project's package.json might not point to the right place, as those dependencies might have been installed in the root of your Lerna project.

Change the alias to point to where those packages are actually installed. This depends on the directory structure of your Lerna project, so the actual path might be different from the diff below.

   "alias": {
-    "react": "../node_modules/react",
-    "react-dom": "../node_modules/react-dom"
+    "react": "../../../node_modules/react",
+    "react-dom": "../../../node_modules/react-dom"
   },

An alternative to fixing this problem would be to remove aliases altogether and define the dependencies referenced as aliases as dev dependencies instead. However, that might cause other problems.

radius's People

Contributors

alaboudi avatar dependabot[bot] avatar nataliamalysh avatar rangle-meltemkilic avatar sachasayan avatar snyk-bot avatar sumitarora avatar t-schemmer avatar turquoisemelon avatar usrrname avatar winkervsbecks 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  avatar  avatar  avatar

radius's Issues

Prop Bleeding to HTML attribs.

In some cases when providing props to components, there is some non-compliant html attribute bleeding.
e.g.
display is passed to the html node because it's not destructured from the props before being passed to children.

Perhaps making use of shouldForwardProp will remedy this, and keep the HTML compliant.

Figma File has non-working/incorrect links

In the Figma File, under: Getting Started with Radius, the first paragraph has a link that does not go to the correct URL.

Steps

  • Log-in to Figma
  • Click on the community page link

Expected

Link opens to https://www.figma.com/community/file/831997833675385869

Actual Result

Link opens to https://radius-ds.netlify.app/

Notes

  • In view-only mode (not logged in), these links do not seem to be clickable at all (intentional?)
  • The Following are also not clickable: Best Practices, Templates, Video tutorials.

Storybook duo-theme preview adds accessibility violations

Storybook's preview contains blocks to show both themes (light and dark) at the same time. If a developer creates a component with an IDREF, they will be duplicated, which the accessibility-plugin will detect as a violation.

Thoughts

  • Create a theme toggle plugin (on a Storybook Panel)
  • Use an existing plugin to toggle the theme
  • Create a toggle as a knob

Notes

  • Sometimes it necessary to implement static or dynamic IDREF's for Accessibility purposes (e.g. using aria-labelledby or aria-describedby). Even generated IDREF's within the component can still contribute to issue described above.

Getting error that ./icons is missing on install

Hello, I'm testing your component, but when I tried to yarn install, it gave me this error

(typescript) Error: /radius/packages/ds/src/components/index.ts(7,15): semantic error TS2307: Cannot find module './icons'.

Looks like it's missing the component files?

Refactor: Storybook React for 6.4.22

  • update CSF (Component Story Format) to CSF 4
  • remove deprecated addons or params in Storybook config
  • convert config files in .storybook/ to .ts from .js
  • updates README.md with file structure

Branches for maintenance:

  • basic-css
  • basic-styled
  • basic-emotion

on build, styled-components and typescript breaks on `defaultProps` after yarn upgrade

Hello all, new to Rangle but exploring radius for an upcoming project.

I noticed that when I try to start a newly cloned ds package with yarn start I'll get the following complaint, especially if I attempt to upgrade the dependencies to newer versions of Storybook. I have since downgraded.

@rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.

✖ Failed to compile
(typescript) Error: /Users/jenc/radius-test/packages/ds/src/components/grid/grid.tsx(22,21): semantic error TS2615: Type of property 'defaultProps' circularly references itself in mapped type 'Pick<ForwardRefExoticComponent<Pick<Pick<any, Exclude<keyof ReactDefaultizedProps<StyledComponentInnerComponent<WithC>, ComponentPropsWithRef<StyledComponentInnerComponent<WithC>>>, StyledComponentInnerAttrs<...> | ... 1 more ... | StyledComponentInnerAttrs<...>> | Exclude<...> | Exclude<...> | Exclude<...>> & Parti...'.
Error: /Users/jenc/radius-test/packages/ds/src/components/grid/grid.tsx(22,21): semantic error TS2615: Type of property 'defaultProps' circularly references itself in mapped type 'Pick<ForwardRefExoticComponent<Pick<Pick<any, Exclude<keyof ReactDefaultizedProps<StyledComponentInnerComponent<WithC>, ComponentPropsWithRef<StyledComponentInnerComponent<WithC>>>, StyledComponentInnerAttrs<...> | ... 1 more ... | StyledComponentInnerAttrs<...>> | Exclude<...> | Exclude<...> | Exclude<...>> & Parti...'.
    at error (/Users/jenc/radius-test/node_modules/rollup/dist/shared/node-entry.js:5400:30)
    at throwPluginError (/Users/jenc/radius-test/node_modules/rollup/dist/shared/node-entry.js:11878:12)
    at Object.error (/Users/jenc/radius-test/node_modules/rollup/dist/shared/node-entry.js:12912:24)
    at Object.error (/Users/jenc/radius-test/node_modules/rollup/dist/shared/node-entry.js:12081:38)
    at RollupContext.error (/Users/jenc/radius-test/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:17194:30)
    at /Users/jenc/radius-test/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:24958:23
    at arrayEach (/Users/jenc/radius-test/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:534:11)
    at forEach (/Users/jenc/radius-test/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:9360:14)
    at printDiagnostics (/Users/jenc/radius-test/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:24931:5)
    at Object.transform (/Users/jenc/radius-test/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27374:17)

Reproduction:

  1. Clone the project by using git clone --depth=1 https://github.com/rangle/rangle-design-system.git my-tester-ds and cd into the directory.
  2. yarn to install all dependencies
  3. yarn upgrade <-- perhaps an incorrect step to take despite noticing some dependencies are old
  4. cd packages/ds
  5. run yarn start, which calls tsdx watch.

In fact, the same behaviour happens on yarn workspace ds build.

Inspecting the complaining line on the file property:
Screen Shot 2021-05-24 at 11 31 38 AM

Type of property 'defaultProps' circularly references itself in mapped type 'ForwardRefExoticBase<Omit<Omit<any, StyledComponentInnerAttrs<WithC> | StyledComponentInnerAttrs<WithC> | StyledComponentInnerAttrs<WithC>> & Partial<...>, "theme"> & { ...; } & WithChildrenIfReactComponentClass<...>>' 

I've seen this error appear on aspect-image.tsx line 29 as well.

This issue has been discussed here: microsoft/TypeScript#37597

This error is more of a hinderance to future development, but storybook still builds, locally.

UPDATE

Upgrading @types/styled-components to 5.1.7 will resolving this issue.

💡 Figma community

It would be nice to have the project shared via Figma community, because there it is possible to add the description of the project along with the related links.

Building Storybook on Ubuntu with node v13.12.0

OS: Ubuntu 18.04

Steps:

  • yarn
  • yarn workspace ds build
  • yarn workspace ds storybook

Error while running yarn workspace ds storybook

Versions:
yarn: 1.12.3
node: v13.12.0

Log

titan@titan:/opt/radius$ yarn
yarn install v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "react@>=16".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > app > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=5".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > ds > [email protected]" has unmet peer dependency "webpack@>=2".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > app > react-scripts > [email protected]" has unmet peer dependency "node-sass@^4.0.0".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > app > react-scripts > [email protected]" has unmet peer dependency "sass@^1.3.0".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > app > react-scripts > [email protected]" has unmet peer dependency "fibers@>= 3.1.0".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > ds > @storybook/addon-a11y > @storybook/[email protected]" has unmet peer dependency "regenerator-runtime@*".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > ds > @storybook/addon-docs > @egoist/[email protected]" has unmet peer dependency "vue@^2.6.10".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > ds > @storybook/addon-docs > [email protected]" has unmet peer dependency "webpack@>=4".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > ds > react-docgen-typescript-loader > @webpack-contrib/[email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > ds > storybook-chromatic > [email protected]" has unmet peer dependency "canvas@^2.5.0".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > ds > tsdx > [email protected]" has incorrect peer dependency "[email protected]".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > ds > @storybook/addon-actions > react-inspector > [email protected]" has unmet peer dependency "@storybook/core@3.* || 4.* || 5.*".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > ds > storybook-chromatic > jsdom > [email protected]" has unmet peer dependency "bufferutil@^4.0.1".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > ds > storybook-chromatic > jsdom > [email protected]" has unmet peer dependency "utf-8-validate@^5.0.2".
warning "workspace-aggregator-a8f17e6b-1ae5-486e-9930-cd87472d774e > ds > storybook-chromatic > jest > @jest/core > jest-config > jest-environment-jsdom > [email protected]" has unmet peer dependency "canvas@^2.5.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 16.98s.
titan@titan:/opt/radius$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic
titan@titan:/opt/radius$ yarn workspace ds build
yarn workspace v1.12.3
yarn run v1.12.3
$ yarn icons
$ svgr --template ./icon-template.js --index-template ./icon-index-template.js --ext tsx --icon --filename-case 'kebab' --title-prop --no-prettier --ref -d ./src/components/icons ./src/components/icons
src/components/icons/check-circle.svg -> src/components/icons/check-circle.tsx
src/components/icons/checkbox-blank.svg -> src/components/icons/checkbox-blank.tsx
src/components/icons/checkbox-checked.svg -> src/components/icons/checkbox-checked.tsx
src/components/icons/close.svg -> src/components/icons/close.tsx
src/components/icons/checkbox-indeterminate.svg -> src/components/icons/checkbox-indeterminate.tsx
src/components/icons/error.svg -> src/components/icons/error.tsx
src/components/icons/expand_more.svg -> src/components/icons/expand-more.tsx
src/components/icons/info.svg -> src/components/icons/info.tsx
src/components/icons/loader.svg -> src/components/icons/loader.tsx
src/components/icons/place.svg -> src/components/icons/place.tsx
src/components/icons/radio-unchecked.svg -> src/components/icons/radio-unchecked.tsx
src/components/icons/radio-checked.svg -> src/components/icons/radio-checked.tsx
src/components/icons/visibility.svg -> src/components/icons/visibility.tsx
src/components/icons/visibility_off.svg -> src/components/icons/visibility-off.tsx
src/components/icons/search.svg -> src/components/icons/search.tsx
$ tsdx build
✓ Creating entry file 3 secs
✓ Building modules 2.5 mins
Done in 155.91s.
Done in 156.14s.
titan@titan:/opt/radius$ yarn workspace ds storybook
yarn workspace v1.12.3
yarn run v1.12.3
$ start-storybook -p 6006
info @storybook/react v5.3.17
info 
info => Loading presets
info => Loading presets
info => Loading config/preview file in "./.storybook".
info => Adding stories defined in ".storybook/main.js".
info => Loading custom Webpack config (full-control mode).
info => Using base config because react-scripts is not installed.
webpack built 68f7c97655542548b2fd in 45140ms
✖ 「wdm」: Hash: 68f7c97655542548b2fd                                                                                                                                                                                                                                       
Version: webpack 4.41.5                                                                                                                                                                                                                                                   
Time: 45140ms                                                                                                                                                                                                                                                             
Built at: 03/27/2020 8:19:08 PM                                                                                                                                                                                                                                           
                                                                      Asset       Size        Chunks                                Chunk Names                                                                                                                           
                         ../../../../../packages/ds/.storybook/preview.d.ts   11 bytes                [emitted]                                                                                                                                                           
                 ../../../../../packages/ds/.storybook/theme-decorator.d.ts  124 bytes                [emitted]                                                                                                                                                           
   ../../../../../packages/ds/src/components/aspect-image/aspect-image.d.ts   28.5 KiB                [emitted]                                                                                                                                                           
          ../../../../../packages/ds/src/components/aspect-image/index.d.ts   46 bytes                [emitted]                                                                                                                                                           
   ../../../../../packages/ds/src/components/aspect-ratio/aspect-ratio.d.ts   28.2 KiB                [emitted]                                                                                                                                                           
          ../../../../../packages/ds/src/components/aspect-ratio/index.d.ts   32 bytes                [emitted]                                                                                                                                                           
                     ../../../../../packages/ds/src/components/box/box.d.ts  326 bytes                [emitted]                                                                                                                                                           
                   ../../../../../packages/ds/src/components/box/index.d.ts   23 bytes                [emitted]                                                                                                                                                           
               ../../../../../packages/ds/src/components/button/button.d.ts   29.3 KiB                [emitted]                                                                                                                                                           
                ../../../../../packages/ds/src/components/button/index.d.ts   26 bytes                [emitted]                                                                                                                                                           
           ../../../../../packages/ds/src/components/checkbox/checkbox.d.ts   30.2 KiB                [emitted]                                                                                                                                                           
              ../../../../../packages/ds/src/components/checkbox/index.d.ts   28 bytes                [emitted]                                                                                                                                                           
                   ../../../../../packages/ds/src/components/flex/flex.d.ts   1.18 KiB                [emitted]                                                                                                                                                           
                  ../../../../../packages/ds/src/components/flex/index.d.ts   31 bytes                [emitted]                                                                                                                                                           
          ../../../../../packages/ds/src/components/form-control/field.d.ts      3 KiB                [emitted]                                                                                                                                                           
          ../../../../../packages/ds/src/components/form-control/index.d.ts   4.91 KiB                [emitted]                                                                                                                                                           
       ../../../../../packages/ds/src/components/form-control/messages.d.ts   1.88 KiB                [emitted]                                                                                                                                                           
                   ../../../../../packages/ds/src/components/grid/grid.d.ts    1.4 KiB                [emitted]                                                                                                                                                              
                  ../../../../../packages/ds/src/components/grid/index.d.ts   24 bytes                [emitted]                                                                                                                                                              
             ../../../../../packages/ds/src/components/heading/heading.d.ts  328 bytes                [emitted]                                                                                                                                                                    
               ../../../../../packages/ds/src/components/heading/index.d.ts   27 bytes                [emitted]                                                                                                                                                                    
          ../../../../../packages/ds/src/components/icons/check-circle.d.ts   7.92 KiB                [emitted]                                                                                                                                                                    
        ../../../../../packages/ds/src/components/icons/checkbox-blank.d.ts   7.93 KiB                [emitted]                                                                                                                                                                    
      ../../../../../packages/ds/src/components/icons/checkbox-checked.d.ts   7.93 KiB                [emitted]                                                                                                                                                                          
../../../../../packages/ds/src/components/icons/checkbox-indeterminate.d.ts   7.94 KiB                [emitted]                                                                                                                                                                          
                 ../../../../../packages/ds/src/components/icons/close.d.ts   7.91 KiB                [emitted]                                                                                                                                                                          
                 ../../../../../packages/ds/src/components/icons/error.d.ts   7.91 KiB                [emitted]                                                                                                                                                                          
           ../../../../../packages/ds/src/components/icons/expand-more.d.ts   7.92 KiB                [emitted]                                                                                                                                                                          
                 ../../../../../packages/ds/src/components/icons/index.d.ts    116 KiB                [emitted]                                                                                                                                                                           
                  ../../../../../packages/ds/src/components/icons/info.d.ts   7.91 KiB                [emitted]                                                                                                                                                                           
                ../../../../../packages/ds/src/components/icons/loader.d.ts   7.91 KiB                [emitted]                                                                                                                                                                           
                 ../../../../../packages/ds/src/components/icons/place.d.ts   7.91 KiB                [emitted]                     
         ../../../../../packages/ds/src/components/icons/radio-checked.d.ts   7.92 KiB                [emitted]                     
       ../../../../../packages/ds/src/components/icons/radio-unchecked.d.ts   7.93 KiB                [emitted]                     
                ../../../../../packages/ds/src/components/icons/search.d.ts   7.91 KiB                [emitted]                     
                  ../../../../../packages/ds/src/components/icons/uuid.d.ts   40 bytes                [emitted]                     
        ../../../../../packages/ds/src/components/icons/visibility-off.d.ts   7.93 KiB                [emitted]                     
            ../../../../../packages/ds/src/components/icons/visibility.d.ts   7.92 KiB                [emitted]                     
                 ../../../../../packages/ds/src/components/image/image.d.ts  349 bytes                [emitted]                     
                 ../../../../../packages/ds/src/components/image/index.d.ts   25 bytes                [emitted]                     
                       ../../../../../packages/ds/src/components/index.d.ts  478 bytes                [emitted]                     
                 ../../../../../packages/ds/src/components/input/index.d.ts   25 bytes                [emitted]                     
                 ../../../../../packages/ds/src/components/input/input.d.ts   31.6 KiB                [emitted]                     
                 ../../../../../packages/ds/src/components/label/index.d.ts   25 bytes                [emitted]                     
                 ../../../../../packages/ds/src/components/label/label.d.ts   29.5 KiB                [emitted]                     
                  ../../../../../packages/ds/src/components/link/index.d.ts   24 bytes                [emitted]                     
                   ../../../../../packages/ds/src/components/link/link.d.ts  298 bytes                [emitted]                     
                ../../../../../packages/ds/src/components/select/index.d.ts   26 bytes                [emitted]                     
               ../../../../../packages/ds/src/components/select/select.d.ts   29.9 KiB                [emitted]                     
               ../../../../../packages/ds/src/components/shared-styles.d.ts  127 bytes                [emitted]                     
               ../../../../../packages/ds/src/components/spinner/index.d.ts   27 bytes                [emitted]                     
             ../../../../../packages/ds/src/components/spinner/spinner.d.ts   1.71 KiB                [emitted]                     
             ../../../../../packages/ds/src/components/text-area/index.d.ts   29 bytes                [emitted]                     
         ../../../../../packages/ds/src/components/text-area/text-area.d.ts   30.7 KiB                [emitted]                     
                  ../../../../../packages/ds/src/components/text/index.d.ts   24 bytes                [emitted]                     
                   ../../../../../packages/ds/src/components/text/text.d.ts  284 bytes                [emitted]                     
        ../../../../../packages/ds/src/components/typography-functions.d.ts  352 bytes                [emitted]                     
                                  ../../../../../packages/ds/src/index.d.ts   74 bytes                [emitted]                     
                                  ../../../../../packages/ds/src/theme.d.ts   3.58 KiB                [emitted]                     
                                                                iframe.html   2.99 KiB                [emitted]                     
                                        main.68f7c97655542548b2fd.bundle.js    510 KiB          main  [emitted] [immutable]  [big]  main
                                    main.68f7c97655542548b2fd.bundle.js.map    455 KiB          main  [emitted] [dev]               main
                                runtime~main.68f7c97655542548b2fd.bundle.js   31.2 KiB  runtime~main  [emitted] [immutable]         runtime~main
                            runtime~main.68f7c97655542548b2fd.bundle.js.map   32.3 KiB  runtime~main  [emitted] [dev]               runtime~main
                                vendors~main.68f7c97655542548b2fd.bundle.js   7.73 MiB  vendors~main  [emitted] [immutable]  [big]  vendors~main
                            vendors~main.68f7c97655542548b2fd.bundle.js.map   8.09 MiB  vendors~main  [emitted] [dev]               vendors~main
Entrypoint main [big] = runtime~main.68f7c97655542548b2fd.bundle.js runtime~main.68f7c97655542548b2fd.bundle.js.map vendors~main.68f7c97655542548b2fd.bundle.js vendors~main.68f7c97655542548b2fd.bundle.js.map main.68f7c97655542548b2fd.bundle.js main.68f7c97655542548b2fd.bundle.js.map
[0] multi /opt/radius/node_modules/@storybook/core/dist/server/common/polyfills.js /opt/radius/node_modules/@storybook/core/dist/server/preview/globals.js /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/common/config.js /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/react/config.js ./.storybook/preview.ts ./.storybook/generated-entry.js /opt/radius/node_modules/webpack-hot-middleware/client.js?reload=true&quiet=true 100 bytes {main} [built]
[../../node_modules/@storybook/addon-a11y/dist/index.js] /opt/radius/node_modules/@storybook/addon-a11y/dist/index.js 5.15 KiB {vendors~main} [built]
[../../node_modules/@storybook/addon-docs/blocks.js] /opt/radius/node_modules/@storybook/addon-docs/blocks.js 43 bytes {vendors~main} [built]
[../../node_modules/@storybook/addon-docs/dist/frameworks/common/config.js] /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/common/config.js 292 bytes {vendors~main} [built]
[../../node_modules/@storybook/addon-docs/dist/frameworks/react/config.js] /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/react/config.js 672 bytes {vendors~main} [built]
[../../node_modules/@storybook/addon-docs/dist/frameworks/react/extractProps.js] /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/react/extractProps.js 2.21 KiB {vendors~main} [built]
[../../node_modules/@storybook/addon-docs/dist/lib/docgen/index.js] /opt/radius/node_modules/@storybook/addon-docs/dist/lib/docgen/index.js 932 bytes {vendors~main} [built]
[../../node_modules/@storybook/addon-knobs/dist/index.js] /opt/radius/node_modules/@storybook/addon-knobs/dist/index.js 6.3 KiB {vendors~main} [built]
[../../node_modules/@storybook/client-api/dist/index.js] /opt/radius/node_modules/@storybook/client-api/dist/index.js 3.82 KiB {vendors~main} [built]
[../../node_modules/@storybook/core/dist/server/common/polyfills.js] /opt/radius/node_modules/@storybook/core/dist/server/common/polyfills.js 120 bytes {vendors~main} [built]
[../../node_modules/@storybook/core/dist/server/preview/globals.js] /opt/radius/node_modules/@storybook/core/dist/server/preview/globals.js 93 bytes {vendors~main} [built]
[../../node_modules/@storybook/core/node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {vendors~main} [built]
[../../node_modules/webpack-hot-middleware/client.js?reload=true&quiet=true] /opt/radius/node_modules/webpack-hot-middleware/client.js?reload=true&quiet=true 7.68 KiB {vendors~main} [built]
[./.storybook/generated-entry.js] 1.35 KiB {main} [built] [failed] [1 error]
[./.storybook/preview.ts] 1.24 KiB {main} [built]
    + 1398 hidden modules

ERROR in ./.storybook/generated-entry.js
Module build failed (from /opt/radius/node_modules/babel-loader/lib/index.js):
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in /opt/radius/node_modules/@babel/preset-env/node_modules/@babel/helper-compilation-targets/package.json
    at applyExports (internal/modules/cjs/loader.js:524:9)
    at resolveExports (internal/modules/cjs/loader.js:541:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:661:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:963:27)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/opt/radius/node_modules/@babel/preset-env/lib/debug.js:8:33)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/opt/radius/node_modules/@babel/preset-env/lib/index.js:11:14)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
 @ multi /opt/radius/node_modules/@storybook/core/dist/server/common/polyfills.js /opt/radius/node_modules/@storybook/core/dist/server/preview/globals.js /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/common/config.js /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/react/config.js ./.storybook/preview.ts ./.storybook/generated-entry.js /opt/radius/node_modules/webpack-hot-middleware/client.js?reload=true&quiet=true main[5]

ERROR in /opt/radius/node_modules/acorn-jsx/index.js
Module build failed (from /opt/radius/node_modules/babel-loader/lib/index.js):
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in /opt/radius/node_modules/@babel/preset-env/node_modules/@babel/helper-compilation-targets/package.json
    at applyExports (internal/modules/cjs/loader.js:524:9)
    at resolveExports (internal/modules/cjs/loader.js:541:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:661:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:963:27)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/opt/radius/node_modules/@babel/preset-env/lib/debug.js:8:33)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/opt/radius/node_modules/@babel/preset-env/lib/index.js:11:14)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
 @ /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/react/lib/inspection/acornParser.js 18:39-59
 @ /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/react/lib/inspection/inspectValue.js
 @ /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/react/lib/inspection/index.js
 @ /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/react/propTypes/createType.js
 @ /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/react/propTypes/handleProp.js
 @ /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/react/extractProps.js
 @ /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/react/config.js
 @ multi /opt/radius/node_modules/@storybook/core/dist/server/common/polyfills.js /opt/radius/node_modules/@storybook/core/dist/server/preview/globals.js /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/common/config.js /opt/radius/node_modules/@storybook/addon-docs/dist/frameworks/react/config.js ./.storybook/preview.ts ./.storybook/generated-entry.js /opt/radius/node_modules/webpack-hot-middleware/client.js?reload=true&quiet=true
Child HtmlWebpackCompiler:
                          Asset      Size               Chunks  Chunk Names
    __child-HtmlWebpackPlugin_0  6.52 KiB  HtmlWebpackPlugin_0  HtmlWebpackPlugin_0
    Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
    [../../node_modules/@storybook/core/node_modules/html-webpack-plugin/lib/loader.js!../../node_modules/@storybook/core/dist/server/templates/index.ejs] /opt/radius/node_modules/@storybook/core/node_modules/html-webpack-plugin/lib/loader.js!/opt/radius/node_modules/@storybook/core/dist/server/templates/index.ejs 2.1 KiB {HtmlWebpackPlugin_0} [built]

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

Hardcoded theme imports in Storybook makes adding a new theme difficult

When using this template for a project I noticed that the hardcoded theme imports in storybook makes updating the theme, particularly adding, removing, or editing the theme name a very manual process.

Proposal:

Dynamically generate previews based on number of themes

export const withTheme = (storyFn: any) => {
  const themes = Object.keys(theme);
  return (
    <>
      {themes.map((t) => (
        <ThemeProvider theme={theme[t]}>
          ...
        </ThemeProvider>
      ))}
    </>
  );
};

In the .stories.mdx where the theme is imported, we render the content using the useTheme hook instead:

export const Palette = () => {
  const theme = useTheme();

  const palette = Object.keys(theme.colors).map((colorKey) => ({
    title: colorKey,
    subtitle: `theme.colors.${colorKey}`,
    colors: Object.values(theme.colors[colorKey]),
  }));

  return (
    <ColorPalette>
      {palette.map((colorItem) => (
        <ColorItem key={colorItem.title} {...colorItem} />
      ))}
    </ColorPalette>
  );
};

<Preview withSource="none">
  <Story name="Colors">
    <Palette />
  </Story>
</Preview>

Figma File contains invalid email-reference

In the Figma file, under Getting Started with Radius page; last section:

Are you using Radius? We would love to hear about how you
are using Radius or any feedback or feature requests.

Drop us an email at [email protected]

Varun's email is no longer valid (no longer working at Rangle)

Error: Unknown --filename-case 'kebab'

Hello everyone, I've discovered Radius recently and wanted to give it a try. I've ran into an error while installing:

OS: Windows 10 (version 1909)

Steps:

  • yarn
  • yarn workspace ds build
  • yarn workspace ds storybook

Error while running yarn workspace ds build

Versions:
yarn: 1.22.10
node: 14.16.1

Log:

C:\Users\user\Desktop\rangle-design-system>yarn workspace ds build
yarn workspace v1.22.10
yarn run v1.22.10
$ yarn icons
$ svgr --template ./icon-template.js --index-template ./icon-index-template.js --ext tsx --icon --filename-case 'kebab' --title-prop --no-prettier --ref -d ./src/components/icons ./src/components/icons
C:\Users\user\Desktop\rangle-design-system\node_modules\@svgr\cli\lib\index.js:162
    throw error;
    ^

Error: Unknown --filename-case 'kebab'
    at transformFilename (C:\Users\user\Desktop\rangle-design-system\node_modules\@svgr\cli\lib\util.js:57:13)
    at rename (C:\Users\user\Desktop\rangle-design-system\node_modules\@svgr\cli\lib\dirCommand.js:34:51)
    at write (C:\Users\user\Desktop\rangle-design-system\node_modules\@svgr\cli\lib\dirCommand.js:71:12)
    at handle (C:\Users\user\Desktop\rangle-design-system\node_modules\@svgr\cli\lib\dirCommand.js:137:12)
    at async Promise.all (index 1)
    at async handle (C:\Users\user\Desktop\rangle-design-system\node_modules\@svgr\cli\lib\dirCommand.js:114:23)
    at async C:\Users\user\Desktop\rangle-design-system\node_modules\@svgr\cli\lib\dirCommand.js:143:5
    at async Promise.all (index 0)
    at async dirCommand (C:\Users\user\Desktop\rangle-design-system\node_modules\@svgr\cli\lib\dirCommand.js:140:3)
    at async run (C:\Users\user\Desktop\rangle-design-system\node_modules\@svgr\cli\lib\index.js:157:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: C:\Program Files\nodejs\node.exe
Arguments: C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js build
Directory: C:\Users\user\Desktop\rangle-design-system\packages\ds
Output:

info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.```

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.