-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup the foundation for Twenty UI library. #4423
Conversation
…nent with hard-coded theme values into it, and use the component inside twenty-front to complete the setup
…the AppThemeProvider component inside twenty-front to consume themes from twenty-ui
… to storybook development server
…nvention for theme declarations
…lve imports for theme type within the package
…th the story for it
…ommand for storybook init
…d starting the storybook development server
…ont to complete front-jest job
Nice ! Thank you @mabdullahabaid I just copied the preview-head so that it renders correctly as in the twenty-front storybooks, we'll see later how we can fix that if we can get the font-family from theme instead of preview head. |
- Added theme addon for light/dark switch - Added ComponentDecorator
Also added what's needed for light/dark theme switch and ComponentDecorator we use everywhere. |
Sounds amazing! Thank you for making the setup more complete, @lucasbordeau - just learned how to add a theme switch to storybook by revisiting your changes. Time for me to extract more components! 😃 |
* feat: create a separate package for twenty-ui, extract the pill component with hard-coded theme values into it, and use the component inside twenty-front to complete the setup * feat: extract the light and the dark theme into twenty-ui and update the AppThemeProvider component inside twenty-front to consume themes from twenty-ui * fix: create a decorator inside preview.tsx to provide a default theme to storybook development server * fix: remove redundant type declarations and revert back the naming convention for theme declarations * fix: introduce a default value for pill label within the story for development server * fix: introduce the nx script into package.json for twenty-ui and resolve imports for theme type within the package * fix: remove the pill component from the twenty-front package along with the story for it * fix: revert the package versions to those before running the nx cli command for storybook init * feat: update readme to include details for building the ui library and starting the storybook development server * fix: include details about twenty-ui inside jest.config for twenty-front to complete front-jest job * - Added preview head for font - Added theme addon for light/dark switch - Added ComponentDecorator --------- Co-authored-by: Lucas Bordeau <[email protected]>
Creating this PR to get the package for
twenty-ui
up and running. The following list contains the step-by-step details for changes in this PR.nx g @nx/storybook:configuration twenty-ui
. This command updated the root level nx.json and added packages to the root level package.json (which we might be able to move to package level package.json - need to experiment, not messing with the setup for now).twenty-front
intotwenty-ui
and updated AppThemeProvider insidetwenty-front
to use the theme withintwenty-ui
. Have not removed the theme fromtwenty-front
altogether due to dependencies, which we can resolve as the next step (or delay till we have extracted all the components).twenty-front
without any changes to the component code.twenty-front
imports fromtwenty-ui
instead ofmodules/ui
.twenty-ui
for anyone planning to play around with the library on their local machine.Have not updated
twenty-docs
in this PR - need a little experimentation to get started with Docusaurus and MDX.