Royal-Navy / design-system

Build web applications that meet the Royal Navy service standards
https://storybook.design-system.navy.digital.mod.uk
Apache License 2.0
103 stars 32 forks source link

Allow arbitrary content in Alert #3734

Closed jpveooys closed 1 month ago

jpveooys commented 1 month ago

Description

Currently children in Alert is typed as string:

https://github.com/Royal-Navy/design-system/blob/ab175e02beaa4e7e6fea7992766f5dbab620cbd4/packages/react-component-library/src/components/Alert/Alert.tsx#L40

If there isn't a reason for that, it'd be helpful to allow arbitrary content. (The design for our app currently has alerts with more complex content.)

Note also that children is currently placed inside a p element. A p element only allows phrasing content as children, so some elements (div, ul, dl etc) are not valid children of p.