braid-design-system@28.0.0
Major Changes
-
Alert, Notice: Support rich content (#647)
BREAKING CHANGE
Since
AlertandNoticeno longer render aTextcomponent for you, you'll need to ensure that you're providing an enclosingTextelement as a direct child.Alert:
<Alert tone="positive"> - Success! + <Text>Success!</Text> </Alert>
Notice:
<Notice tone="positive"> - Success! + <Text>Success!</Text> </Notice>
Why?
The Alert and Notice components were originally designed to render a single paragraph of text, but in practice we've found that there's a lot of demand for richer content, e.g. multiple paragraphs, bullet lists, etc.
In order to support this level of flexibility,
AlertandNoticeno longer render an enclosingTextcomponent for you. While this means you'll need a bit more boilerplate in simple cases, it also means you now have much more fine-grained control over the layout.For example, if you wanted to render an
Alertusing bothTextandBulletListwith"medium"space between them:<Alert tone="positive"> <Stack space="medium"> <Text>The quick brown fox jumps over the lazy dog.</Text> <BulletList space="small"> <Bullet>Bullet 1</Bullet> <Bullet>Bullet 2</Bullet> </BulletList> </Stack> </Alert>
This same pattern applies to
Notice:<Notice tone="positive"> <Stack space="medium"> <Text>The quick brown fox jumps over the lazy dog.</Text> <BulletList space="small"> <Bullet>Bullet 1</Bullet> <Bullet>Bullet 2</Bullet> </BulletList> </Stack> </Notice>
Patch Changes
-
MonthPicker: Fix internal
<Hidden screen>deprecation warning (#650)The
MonthPickercomponent was mistakenly using<Hidden screen>to provide labels to screen readers rather than the newHiddenVisuallycomponent. As a result, deprecation warnings were being logged in the console during development.