Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ActionListGroup component #1740

Open
Tracked by #1705
scurker opened this issue Oct 25, 2024 · 0 comments
Open
Tracked by #1705

Create ActionListGroup component #1740

scurker opened this issue Oct 25, 2024 · 0 comments

Comments

@scurker
Copy link
Member

scurker commented Oct 25, 2024

ActionListGroup is a primitive component that presents a list of ActionListItems as a semantic group with a label and optional description.

Related:

Props

type ActionListGroupProps = {

  /** Label for the group of action list items. */
  label: ContentNode;
  
  /** Description for the group */
  description?: ContentNode;

  /** Limits the amount of selections that can be made within an action list */
  selectionType?: 'single' | 'multiple'

  children: Array<ActionListItem | ActionListLinkItem | ActionListSeparatorProps>

} & React.HTMLAttributes<HTMLLIElement>

Implementation

The action list is a container element with no to primarily contain ActionListItem, ActionListLinkItem, ActionListSeparator or ActionListGroup components within a group.

This component should render as an as li element with a role of none with a ul element immediately nested with a role of group with the label rendered as role="presentation". If a description is provided, a similar pattern should be used with aria-describedby:

<li role="none">
  <div role="presentation" id={groupLabel}>{label}</div>
  <div role="presentation" id={groupDescription}>{description}</div>
  <ul role="group" aria-labelledby={groupLabel} aria-describedby={groupDescription}>
    ...
  </ul>
</li>

Context

This should utilize the same context provider from ActionList to allow for content authors to override any selection contexts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant