@helixds/react 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +292 -0
- package/LICENSE +21 -0
- package/README.md +49 -2
- package/dist/components/Accordion/Accordion.d.ts +14 -0
- package/dist/components/Accordion/Accordion.doc.d.ts +4 -0
- package/dist/components/Accordion/Accordion.doc.js +27 -0
- package/dist/components/Accordion/Accordion.js +76 -0
- package/dist/components/Accordion/Accordion.types.d.ts +24 -0
- package/dist/components/Accordion/Accordion.types.js +2 -0
- package/dist/components/Accordion/index.d.ts +9 -0
- package/dist/components/Accordion/index.js +2 -0
- package/dist/components/Avatar/Avatar.d.ts +14 -0
- package/dist/components/Avatar/Avatar.doc.d.ts +4 -0
- package/dist/components/Avatar/Avatar.doc.js +34 -0
- package/dist/components/Avatar/Avatar.js +14 -0
- package/dist/components/Avatar/Avatar.types.d.ts +20 -0
- package/dist/components/Avatar/Avatar.types.js +2 -0
- package/dist/components/Avatar/index.d.ts +9 -0
- package/dist/components/Avatar/index.js +2 -0
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +14 -0
- package/dist/components/AvatarGroup/AvatarGroup.doc.d.ts +4 -0
- package/dist/components/AvatarGroup/AvatarGroup.doc.js +30 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +15 -0
- package/dist/components/AvatarGroup/AvatarGroup.types.d.ts +21 -0
- package/dist/components/AvatarGroup/AvatarGroup.types.js +2 -0
- package/dist/components/AvatarGroup/index.d.ts +9 -0
- package/dist/components/AvatarGroup/index.js +2 -0
- package/dist/components/Badge/Badge.d.ts +16 -0
- package/dist/components/Badge/Badge.doc.d.ts +4 -0
- package/dist/components/Badge/Badge.doc.js +69 -0
- package/dist/components/Badge/Badge.js +23 -0
- package/dist/components/Badge/Badge.types.d.ts +22 -0
- package/dist/components/Badge/Badge.types.js +2 -0
- package/dist/components/Badge/index.d.ts +9 -0
- package/dist/components/Badge/index.js +2 -0
- package/dist/components/Button/Button.d.ts +11 -0
- package/dist/components/Button/Button.doc.d.ts +4 -0
- package/dist/components/Button/Button.doc.js +98 -0
- package/dist/components/Button/Button.js +80 -0
- package/dist/components/Button/Button.types.d.ts +29 -0
- package/dist/components/Button/Button.types.js +2 -0
- package/dist/components/Button/index.d.ts +9 -0
- package/dist/components/Button/index.js +2 -0
- package/dist/components/Card/Card.d.ts +14 -0
- package/dist/components/Card/Card.doc.d.ts +4 -0
- package/dist/components/Card/Card.doc.js +44 -0
- package/dist/components/Card/Card.js +9 -0
- package/dist/components/Card/Card.types.d.ts +19 -0
- package/dist/components/Card/Card.types.js +2 -0
- package/dist/components/Card/index.d.ts +9 -0
- package/dist/components/Card/index.js +2 -0
- package/dist/components/Chart/Chart.d.ts +14 -0
- package/dist/components/Chart/Chart.doc.d.ts +4 -0
- package/dist/components/Chart/Chart.doc.js +49 -0
- package/dist/components/Chart/Chart.js +184 -0
- package/dist/components/Chart/Chart.types.d.ts +21 -0
- package/dist/components/Chart/Chart.types.js +2 -0
- package/dist/components/Chart/index.d.ts +9 -0
- package/dist/components/Chart/index.js +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +12 -0
- package/dist/components/Checkbox/Checkbox.doc.d.ts +4 -0
- package/dist/components/Checkbox/Checkbox.doc.js +54 -0
- package/dist/components/Checkbox/Checkbox.js +23 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +22 -0
- package/dist/components/Checkbox/Checkbox.types.js +2 -0
- package/dist/components/Checkbox/index.d.ts +9 -0
- package/dist/components/Checkbox/index.js +2 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +13 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.doc.d.ts +4 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.doc.js +56 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.js +27 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.types.d.ts +28 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.types.js +2 -0
- package/dist/components/CheckboxGroup/index.d.ts +9 -0
- package/dist/components/CheckboxGroup/index.js +2 -0
- package/dist/components/Chip/Chip.d.ts +11 -0
- package/dist/components/Chip/Chip.doc.d.ts +4 -0
- package/dist/components/Chip/Chip.doc.js +105 -0
- package/dist/components/Chip/Chip.js +30 -0
- package/dist/components/Chip/Chip.types.d.ts +31 -0
- package/dist/components/Chip/Chip.types.js +2 -0
- package/dist/components/Chip/index.d.ts +9 -0
- package/dist/components/Chip/index.js +2 -0
- package/dist/components/ChipGroup/ChipGroup.d.ts +12 -0
- package/dist/components/ChipGroup/ChipGroup.doc.d.ts +4 -0
- package/dist/components/ChipGroup/ChipGroup.doc.js +31 -0
- package/dist/components/ChipGroup/ChipGroup.js +9 -0
- package/dist/components/ChipGroup/ChipGroup.types.d.ts +27 -0
- package/dist/components/ChipGroup/ChipGroup.types.js +2 -0
- package/dist/components/ChipGroup/index.d.ts +9 -0
- package/dist/components/ChipGroup/index.js +2 -0
- package/dist/components/FAB/FAB.d.ts +11 -0
- package/dist/components/FAB/FAB.doc.d.ts +4 -0
- package/dist/components/FAB/FAB.doc.js +52 -0
- package/dist/components/FAB/FAB.js +133 -0
- package/dist/components/FAB/FAB.types.d.ts +37 -0
- package/dist/components/FAB/FAB.types.js +2 -0
- package/dist/components/FAB/index.d.ts +9 -0
- package/dist/components/FAB/index.js +2 -0
- package/dist/components/Icon/Icon.d.ts +14 -0
- package/dist/components/Icon/Icon.doc.d.ts +4 -0
- package/dist/components/Icon/Icon.doc.js +38 -0
- package/dist/components/Icon/Icon.js +15 -0
- package/dist/components/Icon/Icon.types.d.ts +47 -0
- package/dist/components/Icon/Icon.types.js +2 -0
- package/dist/components/Icon/createIconAdapter.d.ts +24 -0
- package/dist/components/Icon/createIconAdapter.js +28 -0
- package/dist/components/Icon/iconStroke.d.ts +20 -0
- package/dist/components/Icon/iconStroke.js +54 -0
- package/dist/components/Icon/index.d.ts +12 -0
- package/dist/components/Icon/index.js +4 -0
- package/dist/components/IconButton/IconButton.d.ts +11 -0
- package/dist/components/IconButton/IconButton.doc.d.ts +4 -0
- package/dist/components/IconButton/IconButton.doc.js +76 -0
- package/dist/components/IconButton/IconButton.js +20 -0
- package/dist/components/IconButton/IconButton.types.d.ts +25 -0
- package/dist/components/IconButton/IconButton.types.js +2 -0
- package/dist/components/IconButton/index.d.ts +9 -0
- package/dist/components/IconButton/index.js +2 -0
- package/dist/components/Input/Input.d.ts +11 -0
- package/dist/components/Input/Input.doc.d.ts +4 -0
- package/dist/components/Input/Input.doc.js +68 -0
- package/dist/components/Input/Input.js +48 -0
- package/dist/components/Input/Input.types.d.ts +36 -0
- package/dist/components/Input/Input.types.js +2 -0
- package/dist/components/Input/index.d.ts +9 -0
- package/dist/components/Input/index.js +2 -0
- package/dist/components/Menu/Menu.d.ts +14 -0
- package/dist/components/Menu/Menu.doc.d.ts +4 -0
- package/dist/components/Menu/Menu.doc.js +46 -0
- package/dist/components/Menu/Menu.js +105 -0
- package/dist/components/Menu/Menu.types.d.ts +34 -0
- package/dist/components/Menu/Menu.types.js +2 -0
- package/dist/components/Menu/index.d.ts +9 -0
- package/dist/components/Menu/index.js +2 -0
- package/dist/components/Modal/Modal.d.ts +14 -0
- package/dist/components/Modal/Modal.doc.d.ts +4 -0
- package/dist/components/Modal/Modal.doc.js +52 -0
- package/dist/components/Modal/Modal.js +30 -0
- package/dist/components/Modal/Modal.types.d.ts +36 -0
- package/dist/components/Modal/Modal.types.js +2 -0
- package/dist/components/Modal/index.d.ts +9 -0
- package/dist/components/Modal/index.js +2 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +17 -0
- package/dist/components/MultiSelect/MultiSelect.doc.d.ts +4 -0
- package/dist/components/MultiSelect/MultiSelect.doc.js +37 -0
- package/dist/components/MultiSelect/MultiSelect.js +165 -0
- package/dist/components/MultiSelect/MultiSelect.types.d.ts +50 -0
- package/dist/components/MultiSelect/MultiSelect.types.js +2 -0
- package/dist/components/MultiSelect/index.d.ts +9 -0
- package/dist/components/MultiSelect/index.js +2 -0
- package/dist/components/NavItem/NavItem.d.ts +14 -0
- package/dist/components/NavItem/NavItem.doc.d.ts +4 -0
- package/dist/components/NavItem/NavItem.doc.js +31 -0
- package/dist/components/NavItem/NavItem.js +21 -0
- package/dist/components/NavItem/NavItem.types.d.ts +20 -0
- package/dist/components/NavItem/NavItem.types.js +2 -0
- package/dist/components/NavItem/index.d.ts +9 -0
- package/dist/components/NavItem/index.js +2 -0
- package/dist/components/RadioButton/RadioButton.d.ts +14 -0
- package/dist/components/RadioButton/RadioButton.doc.d.ts +4 -0
- package/dist/components/RadioButton/RadioButton.doc.js +35 -0
- package/dist/components/RadioButton/RadioButton.js +15 -0
- package/dist/components/RadioButton/RadioButton.types.d.ts +33 -0
- package/dist/components/RadioButton/RadioButton.types.js +2 -0
- package/dist/components/RadioButton/index.d.ts +9 -0
- package/dist/components/RadioButton/index.js +2 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +12 -0
- package/dist/components/RadioGroup/RadioGroup.doc.d.ts +4 -0
- package/dist/components/RadioGroup/RadioGroup.doc.js +80 -0
- package/dist/components/RadioGroup/RadioGroup.js +19 -0
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +28 -0
- package/dist/components/RadioGroup/RadioGroup.types.js +2 -0
- package/dist/components/RadioGroup/index.d.ts +9 -0
- package/dist/components/RadioGroup/index.js +2 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +13 -0
- package/dist/components/SegmentedControl/SegmentedControl.doc.d.ts +4 -0
- package/dist/components/SegmentedControl/SegmentedControl.doc.js +50 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +64 -0
- package/dist/components/SegmentedControl/SegmentedControl.types.d.ts +26 -0
- package/dist/components/SegmentedControl/SegmentedControl.types.js +2 -0
- package/dist/components/SegmentedControl/index.d.ts +9 -0
- package/dist/components/SegmentedControl/index.js +2 -0
- package/dist/components/Select/Select.d.ts +13 -0
- package/dist/components/Select/Select.doc.d.ts +4 -0
- package/dist/components/Select/Select.doc.js +66 -0
- package/dist/components/Select/Select.js +138 -0
- package/dist/components/Select/Select.types.d.ts +36 -0
- package/dist/components/Select/Select.types.js +2 -0
- package/dist/components/Select/index.d.ts +9 -0
- package/dist/components/Select/index.js +2 -0
- package/dist/components/SidePanel/SidePanel.d.ts +14 -0
- package/dist/components/SidePanel/SidePanel.doc.d.ts +4 -0
- package/dist/components/SidePanel/SidePanel.doc.js +29 -0
- package/dist/components/SidePanel/SidePanel.js +19 -0
- package/dist/components/SidePanel/SidePanel.types.d.ts +28 -0
- package/dist/components/SidePanel/SidePanel.types.js +2 -0
- package/dist/components/SidePanel/index.d.ts +9 -0
- package/dist/components/SidePanel/index.js +2 -0
- package/dist/components/Switch/Switch.d.ts +13 -0
- package/dist/components/Switch/Switch.doc.d.ts +4 -0
- package/dist/components/Switch/Switch.doc.js +56 -0
- package/dist/components/Switch/Switch.js +45 -0
- package/dist/components/Switch/Switch.types.d.ts +21 -0
- package/dist/components/Switch/Switch.types.js +2 -0
- package/dist/components/Switch/index.d.ts +9 -0
- package/dist/components/Switch/index.js +2 -0
- package/dist/components/Table/Table.d.ts +34 -0
- package/dist/components/Table/Table.doc.d.ts +4 -0
- package/dist/components/Table/Table.doc.js +48 -0
- package/dist/components/Table/Table.js +17 -0
- package/dist/components/Table/Table.types.d.ts +30 -0
- package/dist/components/Table/Table.types.js +2 -0
- package/dist/components/Table/index.d.ts +9 -0
- package/dist/components/Table/index.js +2 -0
- package/dist/components/Textarea/Textarea.d.ts +9 -0
- package/dist/components/Textarea/Textarea.doc.d.ts +4 -0
- package/dist/components/Textarea/Textarea.doc.js +60 -0
- package/dist/components/Textarea/Textarea.js +24 -0
- package/dist/components/Textarea/Textarea.types.d.ts +22 -0
- package/dist/components/Textarea/Textarea.types.js +2 -0
- package/dist/components/Textarea/index.d.ts +9 -0
- package/dist/components/Textarea/index.js +2 -0
- package/dist/components/Toast/Toast.d.ts +16 -0
- package/dist/components/Toast/Toast.doc.d.ts +4 -0
- package/dist/components/Toast/Toast.doc.js +37 -0
- package/dist/components/Toast/Toast.js +134 -0
- package/dist/components/Toast/Toast.types.d.ts +11 -0
- package/dist/components/Toast/Toast.types.js +2 -0
- package/dist/components/Toast/index.d.ts +10 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/components/Toast/toastStore.d.ts +36 -0
- package/dist/components/Toast/toastStore.js +57 -0
- package/dist/components/Tooltip/Tooltip.d.ts +14 -0
- package/dist/components/Tooltip/Tooltip.doc.d.ts +4 -0
- package/dist/components/Tooltip/Tooltip.doc.js +33 -0
- package/dist/components/Tooltip/Tooltip.js +105 -0
- package/dist/components/Tooltip/Tooltip.types.d.ts +21 -0
- package/dist/components/Tooltip/Tooltip.types.js +2 -0
- package/dist/components/Tooltip/index.d.ts +9 -0
- package/dist/components/Tooltip/index.js +2 -0
- package/dist/contracts/Accordion.json +174 -0
- package/dist/contracts/AppShell.json +118 -0
- package/dist/contracts/Avatar.json +157 -0
- package/dist/contracts/AvatarGroup.json +169 -0
- package/dist/contracts/Badge.json +212 -0
- package/dist/contracts/Button.json +295 -0
- package/dist/contracts/Card.json +125 -0
- package/dist/contracts/Chart.json +167 -0
- package/dist/contracts/Checkbox.json +333 -0
- package/dist/contracts/CheckboxGroup.json +200 -0
- package/dist/contracts/Chip.json +320 -0
- package/dist/contracts/ChipGroup.json +182 -0
- package/dist/contracts/FAB.json +215 -0
- package/dist/contracts/Icon.json +306 -0
- package/dist/contracts/IconButton.json +213 -0
- package/dist/contracts/Input.json +400 -0
- package/dist/contracts/Menu.json +197 -0
- package/dist/contracts/Modal.json +192 -0
- package/dist/contracts/MultiSelect.json +244 -0
- package/dist/contracts/NavItem.json +148 -0
- package/dist/contracts/PageHeader.json +134 -0
- package/dist/contracts/RadioButton.json +202 -0
- package/dist/contracts/RadioGroup.json +228 -0
- package/dist/contracts/SegmentedControl.json +193 -0
- package/dist/contracts/Select.json +241 -0
- package/dist/contracts/SideNav.json +138 -0
- package/dist/contracts/SidePanel.json +153 -0
- package/dist/contracts/Switch.json +201 -0
- package/dist/contracts/Table.json +130 -0
- package/dist/contracts/Textarea.json +353 -0
- package/dist/contracts/Toast.json +186 -0
- package/dist/contracts/Tooltip.json +168 -0
- package/dist/contracts/TopBar.json +127 -0
- package/dist/contracts/manifest.json +675 -0
- package/dist/index.d.ts +109 -0
- package/dist/index.js +73 -0
- package/dist/layout/AppShell/AppShell.d.ts +14 -0
- package/dist/layout/AppShell/AppShell.doc.d.ts +4 -0
- package/dist/layout/AppShell/AppShell.doc.js +27 -0
- package/dist/layout/AppShell/AppShell.js +9 -0
- package/dist/layout/AppShell/AppShell.types.d.ts +18 -0
- package/dist/layout/AppShell/AppShell.types.js +2 -0
- package/dist/layout/AppShell/index.d.ts +9 -0
- package/dist/layout/AppShell/index.js +2 -0
- package/dist/layout/PageHeader/PageHeader.d.ts +14 -0
- package/dist/layout/PageHeader/PageHeader.doc.d.ts +4 -0
- package/dist/layout/PageHeader/PageHeader.doc.js +30 -0
- package/dist/layout/PageHeader/PageHeader.js +10 -0
- package/dist/layout/PageHeader/PageHeader.types.d.ts +21 -0
- package/dist/layout/PageHeader/PageHeader.types.js +2 -0
- package/dist/layout/PageHeader/index.d.ts +9 -0
- package/dist/layout/PageHeader/index.js +2 -0
- package/dist/layout/SideNav/SideNav.d.ts +14 -0
- package/dist/layout/SideNav/SideNav.doc.d.ts +4 -0
- package/dist/layout/SideNav/SideNav.doc.js +32 -0
- package/dist/layout/SideNav/SideNav.js +9 -0
- package/dist/layout/SideNav/SideNav.types.d.ts +18 -0
- package/dist/layout/SideNav/SideNav.types.js +2 -0
- package/dist/layout/SideNav/index.d.ts +9 -0
- package/dist/layout/SideNav/index.js +2 -0
- package/dist/layout/TopBar/TopBar.d.ts +14 -0
- package/dist/layout/TopBar/TopBar.doc.d.ts +4 -0
- package/dist/layout/TopBar/TopBar.doc.js +28 -0
- package/dist/layout/TopBar/TopBar.js +9 -0
- package/dist/layout/TopBar/TopBar.types.d.ts +16 -0
- package/dist/layout/TopBar/TopBar.types.js +2 -0
- package/dist/layout/TopBar/index.d.ts +9 -0
- package/dist/layout/TopBar/index.js +2 -0
- package/dist/lib/component-doc.d.ts +34 -0
- package/dist/lib/component-doc.js +2 -0
- package/dist/lib/motionPresets.d.ts +37 -0
- package/dist/lib/motionPresets.js +35 -0
- package/dist/lib/resolveTokenPx.d.ts +11 -0
- package/dist/lib/resolveTokenPx.js +17 -0
- package/dist/lib/useDialogTransition.d.ts +21 -0
- package/dist/lib/useDialogTransition.js +86 -0
- package/dist/lib/useDisclosureTransition.d.ts +19 -0
- package/dist/lib/useDisclosureTransition.js +41 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.js +6 -0
- package/dist/patterns/action-bar.md +127 -0
- package/dist/patterns/border-always.md +40 -0
- package/dist/patterns/data-analytics.md +15 -0
- package/dist/patterns/disabled-state.md +80 -0
- package/dist/patterns/empty-state.md +130 -0
- package/dist/patterns/expand-collapse-chevron.md +101 -0
- package/dist/patterns/form-field-group.md +139 -0
- package/dist/patterns/form-field-spacing.md +99 -0
- package/dist/patterns/group-spacing.md +54 -0
- package/dist/patterns/motion-effects.md +100 -0
- package/dist/patterns/same-row-sizing.md +52 -0
- package/dist/patterns/search-filter.md +118 -0
- package/dist/patterns/show-hide-parts.md +53 -0
- package/dist/patterns/stat-card.md +105 -0
- package/dist/patterns/status-row.md +130 -0
- package/dist/patterns/view-toggle.md +81 -0
- package/dist/prop-map.md +80 -0
- package/package.json +70 -3
- package/src/globals.css +3195 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../component.schema.json",
|
|
3
|
+
"name": "Accordion",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"status": "stable",
|
|
6
|
+
|
|
7
|
+
"purpose": "A single collapsible disclosure — a header that expands/collapses a panel of content, with no JS height measurement needed.",
|
|
8
|
+
"import": "import { Accordion } from '@helixds/react';",
|
|
9
|
+
|
|
10
|
+
"neverUseFor": [
|
|
11
|
+
"A single always-visible section — just render the content directly",
|
|
12
|
+
"Primary page navigation — use SideNav/NavItem instead",
|
|
13
|
+
"Hiding required/critical content the user must always see"
|
|
14
|
+
],
|
|
15
|
+
|
|
16
|
+
"rationale": "Accordion is built on native <details>/<summary> (ADR-001) so toggling, keyboard activation and the expanded state are announced by the browser with no hand-rolled ARIA. The panel animates through a CSS grid row transition instead of JS height measurement, and the open/close timing is fixed by ADR-016 so every disclosure in the system feels the same.",
|
|
17
|
+
|
|
18
|
+
"governance": {
|
|
19
|
+
"mayExtendLocally": [
|
|
20
|
+
"Compose any Helix content (forms, lists, Tables) inside the panel",
|
|
21
|
+
"Stack several Accordions to build an FAQ or settings list",
|
|
22
|
+
"Control the open state from product logic via the documented props"
|
|
23
|
+
],
|
|
24
|
+
"mustEscalateToDS": [
|
|
25
|
+
"Replacing <details>/<summary> with a div + button disclosure",
|
|
26
|
+
"Changing the open/close animation timing or easing (ADR-016)",
|
|
27
|
+
"Adding exclusive 'only one open' group behavior or new visual variants"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
"states": {
|
|
32
|
+
"intrinsic": ["hover", "focus"],
|
|
33
|
+
"authored": [
|
|
34
|
+
{ "name": "expanded", "description": "Whether the panel is expanded. Uncontrolled via `defaultExpanded`, or controlled via `expanded`/`onExpandedChange` — mirrors Switch's controlled/uncontrolled pattern. The native toggle is intercepted (see useDisclosureTransition) so collapsing can animate before `open` is actually removed — an explicit aria-expanded on the header reflects the target state during that transition.", "aria": "aria-expanded on the header, explicit (not left to the browser's own <details> mapping) since `open` and the visually-settled state briefly diverge during a collapse" },
|
|
35
|
+
{ "name": "disabled", "description": "Prevents toggling.", "aria": "aria-disabled on the header" }
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
"anatomy": [
|
|
40
|
+
{ "part": "accordion-root", "element": "details", "description": "Native disclosure element — provides the open/closed state, keyboard support, and implicit ARIA for free (see ADR-001: wraps a native element directly, no hand-rolled ARIA pattern needed)." },
|
|
41
|
+
{ "part": "accordion-header", "element": "summary", "description": "The clickable header. Native focus/keyboard (Enter/Space) support." },
|
|
42
|
+
{ "part": "accordion-title", "element": "span", "description": "The header's text label." },
|
|
43
|
+
{ "part": "accordion-chevron", "element": "span", "description": "Wraps a Tabler chevron-down icon (via the Icon component) — flips vertically (scaleY) between closed (v) and open (^). This is the canonical Helix expand/collapse chevron treatment — see .ai/maps/patterns/expand-collapse-chevron.md before adding a chevron to any other hand-rolled disclosure component." },
|
|
44
|
+
{ "part": "accordion-panel", "element": "div", "description": "JS-measured explicit pixel height on open/close, not grid-template-rows 0fr/1fr — 'fr' unit interpolation didn't track the same visual pace in both directions, which read as a laggy collapse." },
|
|
45
|
+
{ "part": "accordion-panel-inner", "element": "div", "description": "Clips overflow during the grid-row animation and cross-fades/blurs its content in." }
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
"props": [
|
|
49
|
+
{ "name": "label", "type": "string", "required": true, "description": "The header's text label." },
|
|
50
|
+
{ "name": "children", "type": "React.ReactNode", "required": true, "description": "The panel's content." },
|
|
51
|
+
{ "name": "expanded", "type": "boolean | undefined", "description": "Controlled open state. Leave unset for uncontrolled (see `defaultExpanded`)." },
|
|
52
|
+
{ "name": "defaultExpanded", "type": "boolean", "default": "false", "description": "Initial open state for uncontrolled usage." },
|
|
53
|
+
{ "name": "onExpandedChange", "type": "(expanded: boolean) => void", "description": "Fires whenever the disclosure toggles, controlled or not." },
|
|
54
|
+
{ "name": "disabled", "type": "boolean", "default": "false", "description": "Prevents toggling." },
|
|
55
|
+
{ "name": "className", "type": "string | undefined", "description": "Additional className for the root." }
|
|
56
|
+
],
|
|
57
|
+
|
|
58
|
+
"sizing": {
|
|
59
|
+
"width": { "default": "fill", "note": "Fills its container width, matching Card." },
|
|
60
|
+
"height": { "mode": "content-driven", "note": "Header height is content-driven; panel height animates via CSS grid, no fixed rung." }
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
"tokenPolicy": {
|
|
64
|
+
"allowed": ["color.fill", "color.text", "color.border", "color.icon", "spacing", "radius", "fontSize", "fontWeight"],
|
|
65
|
+
"forbidden": ["primitive.color", "shadow"]
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
"a11y": {
|
|
69
|
+
"role": "native <details>/<summary> disclosure — no hand-rolled role needed",
|
|
70
|
+
"announces": ["group"],
|
|
71
|
+
"keyboardNav": ["Enter / Space on the header — toggles (native <summary> behavior)"],
|
|
72
|
+
"wcag": ["4.1.2 Name, Role, Value", "2.1.1 Keyboard"],
|
|
73
|
+
"applied": {
|
|
74
|
+
"nativeElement": "details",
|
|
75
|
+
"focus": [
|
|
76
|
+
{
|
|
77
|
+
"part": "(any focusable element)",
|
|
78
|
+
"when": ":focus-visible",
|
|
79
|
+
"inherited": "global rule",
|
|
80
|
+
"outline": "2px solid var(--helix-color-border-focus)",
|
|
81
|
+
"outline-offset": "2px"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"aria": {
|
|
85
|
+
"accordion-header": {
|
|
86
|
+
"aria-expanded": [
|
|
87
|
+
"true",
|
|
88
|
+
"false"
|
|
89
|
+
],
|
|
90
|
+
"aria-disabled": [
|
|
91
|
+
"true"
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
"accordion-chevron": {
|
|
95
|
+
"aria-hidden": [
|
|
96
|
+
"true"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"announced": [],
|
|
101
|
+
"contrast": {
|
|
102
|
+
"accordion-title": {
|
|
103
|
+
"light": "17.85:1 — #0f172a on #ffffff",
|
|
104
|
+
"dark": "16.29:1 — #f1f5f9 on #0f172a"
|
|
105
|
+
},
|
|
106
|
+
"accordion-panel-inner": {
|
|
107
|
+
"light": "17.85:1 — #0f172a on #ffffff",
|
|
108
|
+
"dark": "16.29:1 — #f1f5f9 on #0f172a"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"targetSize": {
|
|
112
|
+
"accordion-header": "smallest 418×45 px"
|
|
113
|
+
},
|
|
114
|
+
"motion": [
|
|
115
|
+
"CSS transitions/animations: neutralised by the global prefers-reduced-motion rule"
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
"results": {
|
|
119
|
+
"score": 100,
|
|
120
|
+
"meetsMinimum": true,
|
|
121
|
+
"checks": {
|
|
122
|
+
"contract": "pass",
|
|
123
|
+
"keys": "pass",
|
|
124
|
+
"focus-return": "n/a",
|
|
125
|
+
"keyboard": "pass",
|
|
126
|
+
"axe": "pass",
|
|
127
|
+
"contrast": "pass",
|
|
128
|
+
"focus-visible": "pass",
|
|
129
|
+
"target-size": "pass",
|
|
130
|
+
"reflow": "n/a",
|
|
131
|
+
"screen-reader": "pass",
|
|
132
|
+
"ai-visual": "pass",
|
|
133
|
+
"human": "pending"
|
|
134
|
+
},
|
|
135
|
+
"notScored": [
|
|
136
|
+
"ai-visual",
|
|
137
|
+
"human"
|
|
138
|
+
],
|
|
139
|
+
"changed": "2026-10-12"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
"figma": {
|
|
144
|
+
"states": ["default", "focus", "disabled"],
|
|
145
|
+
"properties": [
|
|
146
|
+
{
|
|
147
|
+
"name": "expanded",
|
|
148
|
+
"type": "VARIANT",
|
|
149
|
+
"values": ["false", "true"],
|
|
150
|
+
"codeProp": "expanded",
|
|
151
|
+
"description": "Shows the panel; the chevron flips (scaleY(-1) in code)."
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "state",
|
|
155
|
+
"type": "VARIANT",
|
|
156
|
+
"values": ["default", "focus", "disabled"],
|
|
157
|
+
"figmaOnly": true,
|
|
158
|
+
"description": "focus = the header's focus ring (global :focus-visible); disabled = the `disabled` prop — fill/disabled, border/neutral/light, text/disabled, icon/disabled on the header (the open panel's content keeps its color, like code). No hover style exists in code."
|
|
159
|
+
},
|
|
160
|
+
{ "name": "label", "type": "TEXT", "codeProp": "label" },
|
|
161
|
+
{ "name": "content", "type": "TEXT", "codeProp": "children" }
|
|
162
|
+
],
|
|
163
|
+
"structure": "Bordered box (radius/l, border in the layout) > accordion-header (12/16 padding, Body / m / Medium, 16px ChevronDown) + accordion-panel-inner (0/16/12, Body / m / Regular).",
|
|
164
|
+
"variantCombinations": "6 variants (2026-10-21): expanded × state default/focus = 4, plus disabled per expanded (state default) = 2. label and children are TEXT.",
|
|
165
|
+
"stories": {
|
|
166
|
+
"Default": "expanded=false",
|
|
167
|
+
"OpenByDefault": "expanded=true",
|
|
168
|
+
"Disabled": "disabled=true",
|
|
169
|
+
"Stack": "layout",
|
|
170
|
+
"Controlled": {"figma": null, "reason": "controlled-state demo — behaviour only, same look as another story", "approved": "2026-10-21"},
|
|
171
|
+
"KeyboardToggle": {"figma": "state=focus", "reason": "keyboard focus — the focus ring is drawn in Figma (owner 2026-10-21: focus states are drawn)"}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../component.schema.json",
|
|
3
|
+
"name": "AppShell",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"status": "stable",
|
|
6
|
+
|
|
7
|
+
"purpose": "The top-level page shell — composes a SideNav, a TopBar, and the scrollable main content into one consistent full-height layout. Never write `display: flex; min-height: 100vh` by hand again.",
|
|
8
|
+
"import": "import { AppShell } from '@helixds/react';",
|
|
9
|
+
|
|
10
|
+
"neverUseFor": [
|
|
11
|
+
"A single content section inside an already-shelled page — AppShell is used once, at the page root",
|
|
12
|
+
"Auth/marketing pages with no persistent nav — a page with no SideNav should just render its content directly, not force an empty shell"
|
|
13
|
+
],
|
|
14
|
+
|
|
15
|
+
"rationale": "AppShell exists so no page hand-writes `display: flex; min-height: 100vh` again: it fixes one composition of SideNav, TopBar and a single scrollable <main>, which guarantees exactly one main landmark per page (WCAG 2.4.1 Bypass Blocks) and a consistent scroll container across every product screen.",
|
|
16
|
+
|
|
17
|
+
"governance": {
|
|
18
|
+
"mayExtendLocally": [
|
|
19
|
+
"Choose which SideNav entries and TopBar actions a product renders",
|
|
20
|
+
"Compose any page content inside the main slot",
|
|
21
|
+
"Omit the shell entirely on auth/marketing pages with no persistent nav"
|
|
22
|
+
],
|
|
23
|
+
"mustEscalateToDS": [
|
|
24
|
+
"Adding new shell regions (e.g. a right rail or a footer bar)",
|
|
25
|
+
"Changing which element scrolls or rendering more than one <main>",
|
|
26
|
+
"Nesting AppShell inside another layout or page"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
"states": {
|
|
31
|
+
"intrinsic": [],
|
|
32
|
+
"authored": []
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
"anatomy": [
|
|
36
|
+
{ "part": "app-shell-root", "element": "div", "description": "Root — full-viewport-height flex row." },
|
|
37
|
+
{ "part": "app-shell-content", "element": "div", "description": "Flex column beside the sidenav — wraps the topbar and main." },
|
|
38
|
+
{ "part": "app-shell-main", "element": "main", "description": "Scrollable main content region." }
|
|
39
|
+
],
|
|
40
|
+
|
|
41
|
+
"props": [
|
|
42
|
+
{ "name": "sidenav", "type": "React.ReactNode | undefined", "description": "A SideNav instance, rendered to the left." },
|
|
43
|
+
{ "name": "topbar", "type": "React.ReactNode | undefined", "description": "A TopBar instance, rendered above the main content." },
|
|
44
|
+
{ "name": "children", "type": "React.ReactNode", "required": true, "description": "The page's main content." },
|
|
45
|
+
{ "name": "className", "type": "string | undefined", "description": "Additional className for the root." }
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
"tokenPolicy": {
|
|
49
|
+
"allowed": ["color.fill"],
|
|
50
|
+
"forbidden": ["primitive.color"]
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
"a11y": {
|
|
54
|
+
"role": "main (implicit from <main> on app-shell-main — exactly one per page)",
|
|
55
|
+
"wcag": ["1.3.1 Info and Relationships", "2.4.1 Bypass Blocks"],
|
|
56
|
+
"applied": {
|
|
57
|
+
"nativeElement": "div",
|
|
58
|
+
"innerComponents": [
|
|
59
|
+
"IconButton",
|
|
60
|
+
"Input",
|
|
61
|
+
"NavItem"
|
|
62
|
+
],
|
|
63
|
+
"focus": [
|
|
64
|
+
{
|
|
65
|
+
"part": "(its inner controls)",
|
|
66
|
+
"delegatedTo": [
|
|
67
|
+
"IconButton",
|
|
68
|
+
"Input",
|
|
69
|
+
"NavItem"
|
|
70
|
+
],
|
|
71
|
+
"note": "focus is drawn by IconButton, Input, NavItem — see their a11y.applied.focus"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"aria": {},
|
|
75
|
+
"announced": [
|
|
76
|
+
"main"
|
|
77
|
+
],
|
|
78
|
+
"contrast": {},
|
|
79
|
+
"targetSize": {},
|
|
80
|
+
"motion": [
|
|
81
|
+
"CSS transitions/animations: neutralised by the global prefers-reduced-motion rule"
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
"results": {
|
|
85
|
+
"score": 100,
|
|
86
|
+
"meetsMinimum": true,
|
|
87
|
+
"checks": {
|
|
88
|
+
"contract": "pass",
|
|
89
|
+
"keys": "n/a",
|
|
90
|
+
"focus-return": "n/a",
|
|
91
|
+
"keyboard": "n/a",
|
|
92
|
+
"axe": "pass",
|
|
93
|
+
"contrast": "pass",
|
|
94
|
+
"focus-visible": "pass",
|
|
95
|
+
"target-size": "pass",
|
|
96
|
+
"reflow": "pass",
|
|
97
|
+
"screen-reader": "pass",
|
|
98
|
+
"ai-visual": "fail",
|
|
99
|
+
"human": "pending"
|
|
100
|
+
},
|
|
101
|
+
"notScored": [
|
|
102
|
+
"ai-visual",
|
|
103
|
+
"human"
|
|
104
|
+
],
|
|
105
|
+
"changed": "2026-10-12"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
"figma": {
|
|
110
|
+
"childProps": {"sidenav": [{"component": "SideNav", "property": null, "note": "the side navigation"}], "topbar": [{"component": "TopBar", "property": null, "note": "the top bar"}]},
|
|
111
|
+
"states": ["default"],
|
|
112
|
+
"properties": [],
|
|
113
|
+
"structure": "No variants or props of its own — app-shell-root (fill/page) > SideNav instance + app-shell-content (TopBar instance + app-shell-main, 24px padding = spacing/l). Main holds sample content (PageHeader + Card instances).",
|
|
114
|
+
"stories": {
|
|
115
|
+
"Default": "sidenav=true, topbar=true"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../component.schema.json",
|
|
3
|
+
"name": "Avatar",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"status": "stable",
|
|
6
|
+
|
|
7
|
+
"purpose": "Represents a person or entity as a small circular image or initials indicator — a table row, a nav footer, a comment author.",
|
|
8
|
+
"import": "import { Avatar } from '@helixds/react';",
|
|
9
|
+
|
|
10
|
+
"neverUseFor": [
|
|
11
|
+
"Brand logomarks — use Image or a dedicated Logo component",
|
|
12
|
+
"Status indication — use StatusDot/Badge; Avatar communicates identity, not state",
|
|
13
|
+
"Large hero imagery — Avatar is capped at the field/control size scale, never a feature image"
|
|
14
|
+
],
|
|
15
|
+
|
|
16
|
+
"rationale": "Avatar reuses the field scale's semantic.size.{s,m,l} rungs (24/32/40px) instead of a local scale, so it lines up with Inputs, table rows and nav footers without per-use tweaks. It is always a circle and carries identity only — never state — so the accessible name comes from alt/name exactly once and status stays the job of Badge/StatusDot.",
|
|
17
|
+
|
|
18
|
+
"governance": {
|
|
19
|
+
"mayExtendLocally": [
|
|
20
|
+
"Supply any image source or initials fallback per product",
|
|
21
|
+
"Wrap an Avatar in a Tooltip or link at the usage site"
|
|
22
|
+
],
|
|
23
|
+
"mustEscalateToDS": [
|
|
24
|
+
"Adding new sizes beyond s/m/l or non-circular shapes",
|
|
25
|
+
"Overlaying status indicators or borders onto the Avatar itself",
|
|
26
|
+
"Using Avatar for logos or hero imagery"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
"states": {
|
|
31
|
+
"intrinsic": [],
|
|
32
|
+
"authored": []
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
"anatomy": [
|
|
36
|
+
{ "part": "avatar-root", "element": "span", "description": "Root circular container." },
|
|
37
|
+
{ "part": "avatar-image", "element": "img", "description": "Rendered when src is provided.", "optional": true },
|
|
38
|
+
{ "part": "avatar-initials", "element": "span", "description": "Fallback — the first letter of label, rendered when src is absent.", "optional": true }
|
|
39
|
+
],
|
|
40
|
+
|
|
41
|
+
"props": [
|
|
42
|
+
{ "name": "label", "type": "string", "required": true, "description": "The person's full name — source for the initials fallback, and the accessible name (image alt / aria-label)." },
|
|
43
|
+
{ "name": "src", "type": "string | undefined", "description": "Image URL. When present, renders avatar-image; falls back to initials on load error." },
|
|
44
|
+
{ "name": "aria-describedby", "type": "string | undefined", "description": "Forwarded to the root — set by Tooltip when Avatar is its trigger (e.g. inside AvatarGroup). Screen-reader only." },
|
|
45
|
+
{ "name": "size", "type": "'s' | 'm' | 'l'", "default": "m", "description": "Physical size. Shares the field scale with Input/Select (s=24, m=32, l=40)." },
|
|
46
|
+
{ "name": "className", "type": "string | undefined", "description": "Additional className for the root." }
|
|
47
|
+
],
|
|
48
|
+
|
|
49
|
+
"sizing": {
|
|
50
|
+
"height": {
|
|
51
|
+
"mode": "fixed",
|
|
52
|
+
"values": { "s": 24, "m": 32, "l": 40 },
|
|
53
|
+
"unit": "px",
|
|
54
|
+
"note": "Shares tokens with the Field scale (Input/Select) — same semantic.size.{s,m,l} rungs, not a new local scale."
|
|
55
|
+
},
|
|
56
|
+
"width": {
|
|
57
|
+
"default": "fixed",
|
|
58
|
+
"note": "Always a circle — width equals height at every size, no consumer override."
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
"tokenPolicy": {
|
|
63
|
+
"allowed": ["color.fill", "color.text", "fontSize", "fontWeight"],
|
|
64
|
+
"forbidden": ["primitive.color", "color.border"]
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
"a11y": {
|
|
68
|
+
"role": "img (implicit via <img>) when src is set; presentation otherwise — the accessible name comes from the alt/name, never announced twice",
|
|
69
|
+
"wcag": ["1.1.1 Non-text Content"],
|
|
70
|
+
"applied": {
|
|
71
|
+
"nativeElement": "span",
|
|
72
|
+
"focus": [],
|
|
73
|
+
"aria": {
|
|
74
|
+
"avatar-initials": {
|
|
75
|
+
"aria-label": [
|
|
76
|
+
"Sara Navarro",
|
|
77
|
+
"Ana García",
|
|
78
|
+
"Pau Torres",
|
|
79
|
+
"Marta Conde"
|
|
80
|
+
],
|
|
81
|
+
"role": [
|
|
82
|
+
"img"
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"announced": [
|
|
87
|
+
"img \"Sara Navarro\": S",
|
|
88
|
+
"img \"Ana García\": A",
|
|
89
|
+
"img \"Pau Torres\": P",
|
|
90
|
+
"img \"Marta Conde\": M",
|
|
91
|
+
"img \"Jordi Puig\": J"
|
|
92
|
+
],
|
|
93
|
+
"contrast": {
|
|
94
|
+
"avatar-initials (m)": {
|
|
95
|
+
"light": "4.74:1 — #2563eb on #eff6ff",
|
|
96
|
+
"dark": "5.74:1 — #93c5fd on #1e3a8a"
|
|
97
|
+
},
|
|
98
|
+
"avatar-initials (s)": {
|
|
99
|
+
"light": "4.74:1 — #2563eb on #eff6ff",
|
|
100
|
+
"dark": "5.74:1 — #93c5fd on #1e3a8a"
|
|
101
|
+
},
|
|
102
|
+
"avatar-initials (l)": {
|
|
103
|
+
"light": "4.74:1 — #2563eb on #eff6ff",
|
|
104
|
+
"dark": "5.74:1 — #93c5fd on #1e3a8a"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"targetSize": {},
|
|
108
|
+
"motion": [
|
|
109
|
+
"CSS transitions/animations: neutralised by the global prefers-reduced-motion rule"
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"results": {
|
|
113
|
+
"score": 100,
|
|
114
|
+
"meetsMinimum": true,
|
|
115
|
+
"checks": {
|
|
116
|
+
"contract": "pass",
|
|
117
|
+
"keys": "n/a",
|
|
118
|
+
"focus-return": "n/a",
|
|
119
|
+
"keyboard": "n/a",
|
|
120
|
+
"axe": "pass",
|
|
121
|
+
"contrast": "pass",
|
|
122
|
+
"focus-visible": "pass",
|
|
123
|
+
"target-size": "pass",
|
|
124
|
+
"reflow": "n/a",
|
|
125
|
+
"screen-reader": "pass",
|
|
126
|
+
"ai-visual": "pass",
|
|
127
|
+
"human": "pending"
|
|
128
|
+
},
|
|
129
|
+
"notScored": [
|
|
130
|
+
"ai-visual",
|
|
131
|
+
"human"
|
|
132
|
+
],
|
|
133
|
+
"changed": "2026-10-12"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
"figma": {
|
|
138
|
+
"states": ["default"],
|
|
139
|
+
"variantCombinations": "6 variants (2026-10-21): src. false/true × size s/m/l.",
|
|
140
|
+
"noProperty": "aria-describedby has no Figma property (owner's decision 2026-10-21, contracts/figma-conversion.json → skip.why): screen-reader only, set by Tooltip when Avatar is its trigger.",
|
|
141
|
+
"propertyMap": {
|
|
142
|
+
"src": { "codeType": "string | undefined", "figma": [{ "name": "src.", "type": "VARIANT", "values": ["false", "true"] }], "approved": "2026-10-21", "reason": "Figma can't load a photo from a URL: src.=true draws the photo (Storybook's With image story — change its image fill per instance), false the initials (Initials story). A variant, not two booleans: code shows one or the other, never both" }
|
|
143
|
+
},
|
|
144
|
+
"properties": [
|
|
145
|
+
{ "name": "size", "type": "VARIANT", "values": ["s", "m", "l"], "codeProp": "size" },
|
|
146
|
+
{ "name": "label", "type": "TEXT", "codeProp": "label", "description": "Type the initial here — code derives it from the full name in `label` (the layer is avatar-initials)." },
|
|
147
|
+
{ "name": "src.", "type": "VARIANT", "values": ["false", "true"], "codeProp": "src", "description": "false = initials, true = the photo (avatar-image)." }
|
|
148
|
+
],
|
|
149
|
+
"stories": {
|
|
150
|
+
"Default": "src.=false",
|
|
151
|
+
"Sizes": "layout",
|
|
152
|
+
"WithImage": "src.=true",
|
|
153
|
+
"BrokenImageFallsBackToInitials": "src.=false",
|
|
154
|
+
"MemberList": "layout"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../component.schema.json",
|
|
3
|
+
"name": "AvatarGroup",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"status": "stable",
|
|
6
|
+
|
|
7
|
+
"purpose": "Shows several people or entities associated with the same record as a compact overlapping stack of Avatars, collapsing whatever doesn't fit into a '+N' count.",
|
|
8
|
+
"import": "import { AvatarGroup } from '@helixds/react';",
|
|
9
|
+
|
|
10
|
+
"neverUseFor": [
|
|
11
|
+
"A single person — use Avatar directly",
|
|
12
|
+
"A full member/roster list where every name matters — use Table or List with one Avatar per row, not a collapsed stack",
|
|
13
|
+
"Decorative clusters not tied to real people/entities on the record"
|
|
14
|
+
],
|
|
15
|
+
|
|
16
|
+
"rationale": "AvatarGroup collapses several people tied to one record into a compact overlapping stack with a '+N' overflow, so tables and cards stay scannable. Every child is an Avatar at the group's size, so heights stay on the same semantic.size rungs; names are exposed through per-avatar Tooltips and a labelled group rather than extra focus stops. Hovering an avatar lifts and scales only that avatar (component.avatarGroup.hover-lift/hover-scale, aliasing the generic semantic.transform.lift.s and scale.s — approved 2026-09-24); its neighbours never move, and under prefers-reduced-motion nothing moves at all.",
|
|
17
|
+
|
|
18
|
+
"governance": {
|
|
19
|
+
"mayExtendLocally": [
|
|
20
|
+
"Choose how many avatars are visible before collapsing into '+N'",
|
|
21
|
+
"Link the '+N' count or the group to a full roster view at the usage site"
|
|
22
|
+
],
|
|
23
|
+
"mustEscalateToDS": [
|
|
24
|
+
"Changing the overlap distance, ring border or overflow treatment",
|
|
25
|
+
"Making individual avatars focusable or interactive",
|
|
26
|
+
"Mixing avatar sizes inside one group"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
"states": {
|
|
31
|
+
"intrinsic": ["hover", "focus"],
|
|
32
|
+
"authored": []
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
"anatomy": [
|
|
36
|
+
{ "part": "avatar-group-root", "element": "div", "description": "Root flex container. Stacks child avatars with a negative overlap and renders them in reverse DOM order so the first item in `avatars` sits visually on top." },
|
|
37
|
+
{ "part": "avatar-group-item", "element": "span", "description": "Wraps each rendered Avatar to apply the overlap offset and the page-color separation ring." },
|
|
38
|
+
{ "part": "avatar-group-overflow", "element": "span", "description": "The '+N' indicator for avatars beyond `max`. Rendered only when `avatars.length` exceeds `max`, always last — rightmost, on top of the stack, overlapping the last visible avatar. Neutral gray, never Avatar's tinted fill/text.", "optional": true }
|
|
39
|
+
],
|
|
40
|
+
|
|
41
|
+
"props": [
|
|
42
|
+
{ "name": "avatars", "type": "{ label: string; src?: string }[]", "required": true, "description": "The people/entities to display, in the order they should stack — first entry renders on top. Each item maps 1:1 to Avatar's `label`/`src`." },
|
|
43
|
+
{ "name": "max", "type": "number | undefined", "description": "Maximum number of avatars to render before collapsing the rest into a '+N' overflow indicator. Unset shows every avatar." },
|
|
44
|
+
{ "name": "size", "type": "'s' | 'm' | 'l'", "default": "m", "description": "Physical size applied to every avatar and the overflow indicator. Shares Avatar's field scale (s=24, m=32, l=40)." },
|
|
45
|
+
{ "name": "className", "type": "string | undefined", "description": "Additional className for the root." }
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
"sizing": {
|
|
49
|
+
"height": {
|
|
50
|
+
"mode": "fixed",
|
|
51
|
+
"values": { "s": 24, "m": 32, "l": 40 },
|
|
52
|
+
"unit": "px",
|
|
53
|
+
"note": "Matches Avatar's height exactly — same semantic.size.{s,m,l} rungs, since every child is an Avatar at the group's size."
|
|
54
|
+
},
|
|
55
|
+
"width": {
|
|
56
|
+
"default": "hug",
|
|
57
|
+
"note": "Width hugs content: (visible avatar count) x size, minus the overlap between each pair. Not fixed — driven by `avatars.length` and `max`."
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
"tokenPolicy": {
|
|
62
|
+
"allowed": ["color.fill", "color.text", "color.border", "spacing", "radius", "fontSize", "fontWeight"],
|
|
63
|
+
"forbidden": ["primitive.color", "shadow"]
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
"a11y": {
|
|
67
|
+
"role": "group",
|
|
68
|
+
"keyboardNav": [],
|
|
69
|
+
"wcag": ["1.1.1 Non-text Content", "4.1.2 Name, Role, Value", "1.4.13 Content on Hover or Focus"],
|
|
70
|
+
"notes": [
|
|
71
|
+
"Each avatar is wrapped in Tooltip (see contracts/components/Tooltip.json), showing that person's name on hover — mouse only, since individual avatars carry no tabindex/focus behavior (keyboardNav stays []).",
|
|
72
|
+
"The '+N' overflow indicator is also wrapped in Tooltip, listing the hidden names (comma-separated) — no longer presentational-only."
|
|
73
|
+
],
|
|
74
|
+
"applied": {
|
|
75
|
+
"nativeElement": "div",
|
|
76
|
+
"focus": [],
|
|
77
|
+
"aria": {
|
|
78
|
+
"avatar-group-root": {
|
|
79
|
+
"role": [
|
|
80
|
+
"group"
|
|
81
|
+
],
|
|
82
|
+
"aria-label": [
|
|
83
|
+
"3 people",
|
|
84
|
+
"4 people",
|
|
85
|
+
"5 people"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
"avatar-group-overflow": {
|
|
89
|
+
"aria-describedby": [
|
|
90
|
+
"(id)"
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"announced": [
|
|
95
|
+
"group \"3 people\"",
|
|
96
|
+
"group \"4 people\"",
|
|
97
|
+
"group \"5 people\""
|
|
98
|
+
],
|
|
99
|
+
"contrast": {
|
|
100
|
+
"avatar-group-overflow (s)": {
|
|
101
|
+
"light": "6.91:1 — #475569 on #f1f5f9",
|
|
102
|
+
"dark": "5.7:1 — #94a3b8 on #1e293b"
|
|
103
|
+
},
|
|
104
|
+
"avatar-group-overflow (m)": {
|
|
105
|
+
"light": "6.91:1 — #475569 on #f1f5f9",
|
|
106
|
+
"dark": "5.7:1 — #94a3b8 on #1e293b"
|
|
107
|
+
},
|
|
108
|
+
"avatar-group-overflow (l)": {
|
|
109
|
+
"light": "6.91:1 — #475569 on #f1f5f9",
|
|
110
|
+
"dark": "5.7:1 — #94a3b8 on #1e293b"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"targetSize": {},
|
|
114
|
+
"motion": [
|
|
115
|
+
"CSS transitions/animations: neutralised by the global prefers-reduced-motion rule"
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
"results": {
|
|
119
|
+
"score": 100,
|
|
120
|
+
"meetsMinimum": true,
|
|
121
|
+
"checks": {
|
|
122
|
+
"contract": "pass",
|
|
123
|
+
"keys": "n/a",
|
|
124
|
+
"focus-return": "n/a",
|
|
125
|
+
"keyboard": "n/a",
|
|
126
|
+
"axe": "pass",
|
|
127
|
+
"contrast": "pass",
|
|
128
|
+
"focus-visible": "pass",
|
|
129
|
+
"target-size": "pass",
|
|
130
|
+
"reflow": "n/a",
|
|
131
|
+
"screen-reader": "pass",
|
|
132
|
+
"ai-visual": "pass",
|
|
133
|
+
"human": "pending"
|
|
134
|
+
},
|
|
135
|
+
"notScored": [
|
|
136
|
+
"ai-visual",
|
|
137
|
+
"human"
|
|
138
|
+
],
|
|
139
|
+
"changed": "2026-10-12"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
"figma": {
|
|
144
|
+
"childProps": {"avatars": [{"component": "Avatar", "property": "label", "note": "each avatar's label (and its src. photo)"}]},
|
|
145
|
+
"states": ["default"],
|
|
146
|
+
"properties": [
|
|
147
|
+
{ "name": "size", "type": "VARIANT", "values": ["s", "m", "l"], "codeProp": "size" },
|
|
148
|
+
{ "name": "avatars", "type": "VARIANT", "values": ["1", "2", "3", "4", "5", "6", "7"], "codeProp": "avatars", "description": "How many avatars the group draws — code draws one per entry in avatars." },
|
|
149
|
+
{ "name": "src.", "type": "VARIANT", "values": ["false", "true"], "description": "false = initials, true = photos, in every item — a different portrait per avatar (the 6 Pexels samples in apps/storybook/public/avatars, in order: pau, ana, jordi, leo, marta, sara)." },
|
|
150
|
+
{ "name": "withOverflow", "type": "BOOLEAN", "codeProp": "max", "description": "Shows the +N item (code renders it when avatars exceed max)." },
|
|
151
|
+
{ "name": "max", "type": "TEXT", "codeProp": "max", "description": "The +N text — code computes it from avatars and max." }
|
|
152
|
+
],
|
|
153
|
+
"propertyMap": {
|
|
154
|
+
"avatars": { "codeType": "{ label: string; src?: string }[]", "figma": [{ "name": "avatars", "type": "VARIANT", "values": ["1", "2", "3", "4", "5", "6", "7"] }], "approved": "2026-10-21", "reason": "code takes the list of people; Figma draws how many there are — 1 to 7, like Storybook's examples (owner's request)" },
|
|
155
|
+
"max": { "codeType": "number | undefined", "figma": [{ "name": "max", "type": "TEXT" }], "approved": "2026-10-21", "reason": "code takes a number (how many avatars show before +N); Figma can't count, so max holds the +N text it produces" }
|
|
156
|
+
},
|
|
157
|
+
"figmaOnly": {
|
|
158
|
+
"src.": { "approved": "2026-10-21", "reason": "like Avatar's src.: false = every avatar shows initials, true = every avatar shows its photo (code: each entry's src) — change a photo per instance through the nested Avatar" },
|
|
159
|
+
"withOverflow": { "approved": "2026-10-21", "reason": "shows or hides the +N item — in code it appears on its own when avatars exceed max, so there is no prop to name it after" }
|
|
160
|
+
},
|
|
161
|
+
"variantCombinations": "42 variants (2026-10-21): avatars 1–7 × src. false/true × size s/m/l. withOverflow and max are toggled per instance.",
|
|
162
|
+
"structure": "Avatar instances in avatar-group-item rings (2px, fill/page). The 8px overlap (avatarGroup.overlap) is modeled without a negative gap: every item after the first sits in a slot 8px narrower than itself, offset 8px left, so it paints over the previous one and the group's width matches code (m, 3 avatars: 92px). The hover lift is a motion effect, not modeled.",
|
|
163
|
+
"stories": {
|
|
164
|
+
"Default": "default",
|
|
165
|
+
"WithOverflow": "withOverflow=true, src.=true",
|
|
166
|
+
"Sizes": "layout"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|