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

story: Convert stories to tsx #1323

Closed
kyubisation opened this issue Jul 29, 2022 · 2 comments
Closed

story: Convert stories to tsx #1323

kyubisation opened this issue Jul 29, 2022 · 2 comments
Assignees
Labels
effort: days team: ESTA Web Will be done by team ESTA Web

Comments

@kyubisation
Copy link
Contributor

We would like to convert our stories to tsx.

@kyubisation kyubisation added the team: ESTA Web Will be done by team ESTA Web label Jul 29, 2022
@DavideMininni-Fincons DavideMininni-Fincons self-assigned this Nov 28, 2022
@DavideMininni-Fincons
Copy link
Contributor

Hello guys @kyubisation @jeripeierSBB
some notes and possible blockers about this story (see: master...chore/story-convert-stories-to-tsx):

  • storybook.js has very poor documentation about writing stories in Typescript using web components; in many pages in 'Write stories', 'Write docs' etc. the snippets are missing ('This snippet doesnt exist for Web Components yet. Contribute it in a PR now. In the meantime, here’s the React snippet.').
    I found this https://storybook.js.org/blog/writing-stories-in-typescript/ but it's related to frameworks.

  • about story's templates: it seems I can't use the JSX syntax, because the 'sbb-button' type is not recognized (see image); I also try the import as done here https://webcomponents.dev/docs/component-story-format (Stencil bullet point) with no success.
    So I changed to string, but this way I still can't set attributes by spreading the args variable; I have to set them manually one by one, or better, I used the newly created spreadAttribute function.
    I see some downside here, e.g. the ${text ?? ''} check for the button label.

image

Thoughts/ideas/suggestions?

@kyubisation
Copy link
Contributor Author

Closed via #1792

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: days team: ESTA Web Will be done by team ESTA Web
Projects
None yet
Development

No branches or pull requests

2 participants