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

feat: add storybook #19

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Conversation

DavideMininni-Fincons
Copy link
Contributor

Some open points and notes:

  • using compodoc allows to not specify the argTypes in every story; when the storybook script is launched, a documentation.json file is created with the information about stories parameters;
  • since we have directives, we need the render function in the meta object, while for components it would not be strictly needed;
  • binding functions seems to work and there's anything in the documentation that explains how to use it; also using the mock fn function doesn't work
args: { onCLick: fn() }
  • apparently is not possibile to use the Story typing:
type Story = StoryObj<SbbButton>;
export const Primary: Story = {...}

because arguments in kebab-case are marked as error, and if passed in camelCase they don't work; this is possibly related to our underlying web-components, because in a 'normal' Angular project the (typing + camelCase) works;

  • for the same reason the built-in argsToTemplate function doesn't work and i added a improvable spreadArgs function;
  • the showcase project has been reused by removing the Angular basic code and adding the storybook configuration; this has been done because when launching storybook init the CLI requires an Angular project to start with; if we want to have the stories at the same level of TS components, a different configuration needs to be set to 'merge' the two storybook (angular and angular-experimental) in a single one
  • a decorator can be setup in preview.ts, as in the lyne-components library, to handle the dark/negative variants
  • readmes are supported but not sure if they are needed

@DavideMininni-Fincons DavideMininni-Fincons linked an issue Jan 22, 2025 that may be closed by this pull request
9 tasks
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.

story: Angular wrapper demo page
1 participant