Replies: 2 comments
-
Answer to your open questions about If the popover is |
Beta Was this translation helpful? Give feedback.
-
Hi @castastrophe / @pfulton, I was looking for your input on the following thing: Looking at the Spectrum design documentation and Figma, this component's popover seems to always have a specific width set. |
Beta Was this translation helpful? Give feedback.
-
Contextual help
Working branch
Draft PR
Contextual help shows a user extra information about the state of either an adjacent component or an entire view. It explains a high-level topic about an experience and can point users to more information elsewhere.
Spectrum guidelines
Spectrum CSS
Usage
Adding your dependency:
Import and register the component
<sp-contextual-help>
:Importing the base class of the
ContextualHelp
component as a type or for extension purposes:Examples
Properties and attributes
Slots
link
: accessible link in the footer of the popoverEvents
N/A - open / close events will be the ones propagated from the sp-overlay:
https://opensource.adobe.com/spectrum-web-components/components/overlay/#events
Dependencies
To achieve the Contextual help design we will require the following SWC dependencies:
@spectrum-web-components/icons-workflow
-we need two icons from here:sp-icon-help-outline
andsp-icon-info-outline
@spectrum-web-components/action-button
- This is the trigger, extra-small, quiet, icon-only action button@spectrum-web-components/overlay
@spectrum-web-components/dialog
- lazy loaded? Would be needed on mobile@spectrum-web-components/popover
- lazy loaded? Would be needed on webBehavior
Mobile layout
On a mobile layout, the popover will be replaced with a dismissible dialog, similar with the example from here.
Users will be able to dismiss it by closing the “X” button in the dialog.
Accessibility
Keyboard navigation
Trigger will be a
sp-action-menu
, therefore will receive keyboard focus, and will be actionable on “Enter” / “Space”.On the “Enter” keypress on the button, the Contextual help opens.
Pressing “Esc” closes the popover and returns the focus to the action button.
Screen reader
Given that the trigger is an icon-only button, we need an accessible name for it. By default the component will provide
aria-label=”Informations”
oraria-label=”Help”
depending on the type property.Users will have the option to provide a custom accessible name for the button using the label property.
Open question: Based on the open/close state, should the button have an
aria-expanded
&aria-controls
property?Relation with other components
After discussions with Spectrum design: "contextual help can be used on it own paired with another component or as part of the field label itself for input components"
Open question: Should SWC support this component as a slot in
sp-field-label
, or should we let the consumers handle this?Beta Was this translation helpful? Give feedback.
All reactions