Closed snowystinger closed 1 year ago
@devongovett @snowystinger is this one free for grab ?
FYI...I am planning to start development of this component soon based on previous conversations with @matthewdeutsch.
Basic Usage
<InLineAlert>
<Header>I'm a title</Header>
<Content>I'm the content</Content>
</InLineAlert>
The optional button group area was removed from the Spectrum design but is still present in the spectrum-css implementation. Should we also remove support for a button group in RSP?
That's correct, the button group should not be included. Spectrum design removed it from the design guidelines on 6/27/2022, however CSS has not been updated yet to reflect the change
๐ Feature Request
https://spectrum.adobe.com/page/in-line-alert/
In-line alerts display a non-modal alert message associated with objects in a view. These are often used in form validation, where they can provide a place to aggregate feedback related to multiple fields.
๐ Possible Solution
The API should be something like the following.
Example usage:
Note, icon is not supplied, it is internal to the Alert component and based on the variant.
Aria/Stately hooks
In general, we should follow the WAI Alert example. We should only need the role, aria-live and aria-atomic should be implicit on role="alert".
DOM structure
This is a rough outline of what might be rendered for an Alert.
Styling
The Alert css classes from spectrum-css can be used to implement this. In order to apply them, we can use the SlotProvider. Alert will need to provide a Slot context in the same way Dialog does. This way the children can receive props sent from the Alert to apply class names and other props. The CSS for Alert will need a little rework, as it should be moved over to use
display: grid
using a grid similar to this:๐งข Your Company/Team
RSP