Skip to content
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

I5 setup storybook js #9

Merged
merged 7 commits into from
Feb 22, 2023
Merged

I5 setup storybook js #9

merged 7 commits into from
Feb 22, 2023

Conversation

ThePhisch
Copy link
Collaborator

@ThePhisch ThePhisch commented Feb 15, 2023

Installed storybook and ported the first story components. Installed further dependencies including @primer/css, bulma, sass, sass-loader as needed.

@ThePhisch ThePhisch requested a review from maany February 15, 2023 17:36
Copy link
Owner

@maany maany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! If we can avoid using legacy-peer-deps it would be best. But for some packages, it is unavoidable.
Also, can we move the stories inside the src directory? and rename it to component-library?

.npmrc Show resolved Hide resolved
@ThePhisch
Copy link
Collaborator Author

Also, can we move the stories inside the src directory? and rename it to component-library?

I will rename src/stories to src/component-library, as discussed.

@ThePhisch ThePhisch force-pushed the i5-setup-storybook-js branch from 2af8efe to 4a5be75 Compare February 16, 2023 09:23
@ThePhisch ThePhisch requested a review from maany February 16, 2023 09:24
@ThePhisch ThePhisch force-pushed the i5-setup-storybook-js branch 2 times, most recently from b0f5063 to 35f4ef9 Compare February 16, 2023 11:58
Copy link
Owner

@maany maany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we already migrate to Storybook 7
https://chromatic-ui.notion.site/Storybook-7-migration-guide-dbf41fa347304eb2a5e9c69b34503937

Also, can you refactor the component-library directory to have 2 sub-directories, one for components and one for sass/scss

The components can import from the sass/scss

@maany
Copy link
Owner

maany commented Feb 22, 2023

can you rebase?

Anton Schwarz added 7 commits February 22, 2023 11:25
Installed Storybook with webpack5 as builder. Also added `eslint-plugin`
and did the `npm7` migration (generating the `.npmrc`-file), as
recommended by the storybook installer.

Deleted the contents of `src/stories`, meaning that Storybook has no
stories it can display. The server starts up though.
The stories were ported from the old webui. The stories were chosen
since they only rely on the `primer` CSS-library. Also ported the
`rucio.d.ts` file containing the rucio webui story components proptype
definitions.

In the process, sass support was activated for the Storybook server. In
addition, `@primer/css` was installed (as a depency for the story).
Ported components (stories) into `src/component-library`. These
components are called *simple* because they use Bulma CSS (and related
dependencies) but do not rely on other components. In addition, if a
component requires the handling of images, it is omitted in this commit.

Added Components:

* Checkbox (requires `bulma-checkradio`)
* Dropdown
* Form
* Input
* Modal
* ProgressBar
* Steps (requires `bulma-steps`)
* Table
* Tabs
* ToggleSwitch (requires `bulma-switch`)
Switched to a system in which `src/component-library` has contents:

* `components` which are the story components that were previously
  directly under `component-library`
* `scss` containing stylesheets important for the stories. The stories
  import the `main.scss`-file.

The reasoning behind this is that each component should work in
isolation and its styles should not depend on globally imported
stylesheets.
Moved to Storybook `7.0.0-beta.49`. Had to add `util` to `resolve.fallback`, installed `util`.

In upgrading, accepted all suggested migrations except for `autodocs:
true`. These are:
* `storybook-binary`
* `sb-scripts`
* `newFrameworks` (which removes webpack5)
* `nextjsFramework` (which replaces `newFrameworks` with one specific to
  `nextjs`
* `bare-mdx-stories-glob`
After deciding to not follow up on using PrimerCSS for many of the
designs (due to the persisting issue of not being able to compile the
SCSS files), the components taking style directions from PrimerCSS were
redone to make use of TailwindCSS.

In redoing the components, the interfaces found under `rucio.d.ts` were
also changed. These changes primarily consisted of simpifying the
interfaces to a minimum. In some cases, such as `CheckboxProps`, new
parameters were added (`CheckboxProps` now has the optional attribute
`disabled` so that the behaviour of other buttons is matched).

The rework touched the Javascript logic in some cases, but mainly tried
to port the designs from PrimerCSS into TailwindCSS. The components
redone are:

* Alert (split into Standard, Warning, Success and Error)
* Box (split into Condensed, Spacious, Blue, Danger)
* Button (Button, Checkbox, Radiobutton) (Switch remains unchanged)
Ported the `input` component into tailwind. Split into two components
for numeric and text input.

Also removed unnecessary scss files and moved `rucio.d.ts` to
`src/component-library/components.d.ts` to reflect that this file only
provides the interfaces for the components.
@ThePhisch ThePhisch force-pushed the i5-setup-storybook-js branch from d385e45 to bda5dbe Compare February 22, 2023 10:29
@maany maany merged commit f449e03 into maany:main Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants