Closed kyubisation closed 1 year ago
Hello guys @kyubisation @jeripeierSBB some notes and possible blockers about this story (see: https://github.com/lyne-design-system/lyne-components/compare/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.
Thoughts/ideas/suggestions?
Closed via #1792
We would like to convert our stories to tsx.