Closed Robbert closed 1 year ago
.md
), in plaats van in MDX of JSDoc. Markdown kun je als string importeren in TypeScript, als je het hebt ingesteld, en daarna tonen als HTML met componenten van Storybook.tsx
). Twee voordelen: 1) je test gelijk de TypeScript annotaties van de component, en 2) TypeScript warnings dat stories aangepast moeten worden na de wijziging van een component zijn een indicatie dat het misschien een breaking change is.default
export: How to write stories — Default exportid
van Stories niet zomaar aan: ze worden gebruikt om stories op andere plekken te tonen. ("Cool URI's don't change")id
: gebruik react
als prefix, en gebruik dezelfde slug voor een component als in andere Storybook frameworks. Bijvoorbeeld: react-button
, css-button
en angular-button
.argTypes
duidelijk welke argumenten echt bestaan als Component Prop in React, welke bestaan als HTML attribute of DOM property, en welke argument alleen bestaan voor de Story:
table: { category: 'API' } }
table: { category: 'Story' } }
table: { category: 'HTML attribute' } }
export const Lead
voor <Paragraph lead />
, of export const AppearanceSubtle
voor <Button appearance="subtle" />
Finished all component upgrades, created a new issue for the markdown-only story: https://github.com/nl-design-system/utrecht/issues/1707
.tsx
in plaats van.mdx
Alert
AlertDialog
AlternateLangNav
Article
Backdrop
BreadcrumbNav
Button
ButtonGroup
ButtonLink
Checkbox
Code
CodeBlock
DataBadge
DataList
DataListValue
Document
Emphasis
Figure
FormField
FormFieldCheckbox
FormFieldCheckboxGroup
FormFieldRadioGroup
FormFieldText
FormLabel
Heading
Heading1
Heading2
Heading3
Heading4
Heading5
Heading6
HeadingGroup
HTMLContent
Icon
Image
Mark
NumberValue
Paragraph
PreHeading
Separator
Strong
Calendar
Introduction
Link
LinkSocial
ListSocial
OrderedList
OrderedListItem
Page
PageContent
PageFooter
PageHeader
ProcessSteps
RadioButton
Select
SkipLink
SpotlightSection
Surface
Table