@helixds/react 0.0.0-stage → 0.2.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 +295 -0
- package/LICENSE +21 -0
- package/README.md +49 -2
- package/dist/archetypes/actions-navigation.md +62 -0
- package/dist/archetypes/data-display.md +68 -0
- package/dist/archetypes/feedback-status.md +54 -0
- package/dist/archetypes/form-selection.md +61 -0
- package/dist/archetypes/foundation.md +56 -0
- package/dist/archetypes/layout.md +53 -0
- package/dist/archetypes/overlays.md +54 -0
- package/dist/archetypes/text-input.md +58 -0
- 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/Combobox/Combobox.d.ts +17 -0
- package/dist/components/Combobox/Combobox.doc.d.ts +4 -0
- package/dist/components/Combobox/Combobox.doc.js +41 -0
- package/dist/components/Combobox/Combobox.js +141 -0
- package/dist/components/Combobox/Combobox.types.d.ts +31 -0
- package/dist/components/Combobox/Combobox.types.js +2 -0
- package/dist/components/Combobox/index.d.ts +9 -0
- package/dist/components/Combobox/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/Popover/Popover.d.ts +14 -0
- package/dist/components/Popover/Popover.doc.d.ts +4 -0
- package/dist/components/Popover/Popover.doc.js +47 -0
- package/dist/components/Popover/Popover.js +157 -0
- package/dist/components/Popover/Popover.types.d.ts +27 -0
- package/dist/components/Popover/Popover.types.js +2 -0
- package/dist/components/Popover/index.d.ts +9 -0
- package/dist/components/Popover/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/Tabs/Tabs.d.ts +13 -0
- package/dist/components/Tabs/Tabs.doc.d.ts +4 -0
- package/dist/components/Tabs/Tabs.doc.js +47 -0
- package/dist/components/Tabs/Tabs.js +61 -0
- package/dist/components/Tabs/Tabs.types.d.ts +33 -0
- package/dist/components/Tabs/Tabs.types.js +2 -0
- package/dist/components/Tabs/index.d.ts +9 -0
- package/dist/components/Tabs/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 +175 -0
- package/dist/contracts/AppShell.json +201 -0
- package/dist/contracts/Avatar.json +158 -0
- package/dist/contracts/AvatarGroup.json +170 -0
- package/dist/contracts/Badge.json +213 -0
- package/dist/contracts/Button.json +296 -0
- package/dist/contracts/Card.json +126 -0
- package/dist/contracts/Chart.json +168 -0
- package/dist/contracts/Checkbox.json +334 -0
- package/dist/contracts/CheckboxGroup.json +201 -0
- package/dist/contracts/Chip.json +321 -0
- package/dist/contracts/ChipGroup.json +183 -0
- package/dist/contracts/Combobox.json +431 -0
- package/dist/contracts/FAB.json +216 -0
- package/dist/contracts/Icon.json +307 -0
- package/dist/contracts/IconButton.json +214 -0
- package/dist/contracts/Input.json +401 -0
- package/dist/contracts/Menu.json +198 -0
- package/dist/contracts/Modal.json +193 -0
- package/dist/contracts/MultiSelect.json +245 -0
- package/dist/contracts/NavItem.json +149 -0
- package/dist/contracts/PageHeader.json +135 -0
- package/dist/contracts/Popover.json +322 -0
- package/dist/contracts/RadioButton.json +203 -0
- package/dist/contracts/RadioGroup.json +229 -0
- package/dist/contracts/SegmentedControl.json +194 -0
- package/dist/contracts/Select.json +241 -0
- package/dist/contracts/SideNav.json +139 -0
- package/dist/contracts/SidePanel.json +154 -0
- package/dist/contracts/Switch.json +202 -0
- package/dist/contracts/Table.json +131 -0
- package/dist/contracts/Tabs.json +353 -0
- package/dist/contracts/Textarea.json +354 -0
- package/dist/contracts/Toast.json +187 -0
- package/dist/contracts/Tooltip.json +169 -0
- package/dist/contracts/TopBar.json +129 -0
- package/dist/contracts/manifest.json +2170 -0
- package/dist/index.d.ts +118 -0
- package/dist/index.js +79 -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 +32 -0
- package/dist/layout/AppShell/AppShell.js +116 -0
- package/dist/layout/AppShell/AppShell.types.d.ts +24 -0
- package/dist/layout/AppShell/AppShell.types.js +2 -0
- package/dist/layout/AppShell/AppShellContext.d.ts +17 -0
- package/dist/layout/AppShell/AppShellContext.js +4 -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 +33 -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 +15 -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 +98 -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 +92 -3
- package/src/globals.css +3511 -0
|
@@ -0,0 +1,175 @@
|
|
|
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
|
+
"archetype": "data-display",
|
|
10
|
+
|
|
11
|
+
"neverUseFor": [
|
|
12
|
+
"A single always-visible section — just render the content directly",
|
|
13
|
+
"Primary page navigation — use SideNav/NavItem instead",
|
|
14
|
+
"Hiding required/critical content the user must always see"
|
|
15
|
+
],
|
|
16
|
+
|
|
17
|
+
"rationale": "Accordion is built on native <details>/<summary>, so toggling, keyboard activation and the expanded state come from the browser with no hand-rolled ARIA. The panel's height is measured in JS and animated as an explicit pixel height, not with a grid-template-rows 0fr/1fr transition, because fr interpolation didn't move at the same pace in both directions and the collapse looked laggy. The chevron and the panel share one duration by design: duration-expand, duration-collapse and duration-chevron are all 250ms, so the chevron finishes turning exactly when the panel finishes opening or closing. Change all three together, or the sync breaks. They stay three tokens rather than one because the panel and the chevron are separate parts that could diverge in a later redesign, and each token names the CSS property it drives. 250ms sits between semantic.duration slow (200ms) and slower (300ms) on purpose, quick enough for repeated toggling and slow enough to read as a reveal, not a snap. It stays a component literal: one component reusing a value doesn't meet the bar of 3+ components sharing it that would justify a new semantic rung.",
|
|
18
|
+
|
|
19
|
+
"governance": {
|
|
20
|
+
"mayExtendLocally": [
|
|
21
|
+
"Compose any Helix content (forms, lists, Tables) inside the panel",
|
|
22
|
+
"Stack several Accordions to build an FAQ or settings list",
|
|
23
|
+
"Control the open state from product logic via the documented props"
|
|
24
|
+
],
|
|
25
|
+
"mustEscalateToDS": [
|
|
26
|
+
"Replacing <details>/<summary> with a div + button disclosure",
|
|
27
|
+
"Changing the open/close animation timing or easing (see rationale)",
|
|
28
|
+
"Adding exclusive 'only one open' group behavior or new visual variants"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
"states": {
|
|
33
|
+
"intrinsic": ["hover", "focus"],
|
|
34
|
+
"authored": [
|
|
35
|
+
{ "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" },
|
|
36
|
+
{ "name": "disabled", "description": "Prevents toggling.", "aria": "aria-disabled on the header" }
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
"anatomy": [
|
|
41
|
+
{ "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)." },
|
|
42
|
+
{ "part": "accordion-header", "element": "summary", "description": "The clickable header. Native focus/keyboard (Enter/Space) support." },
|
|
43
|
+
{ "part": "accordion-title", "element": "span", "description": "The header's text label." },
|
|
44
|
+
{ "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." },
|
|
45
|
+
{ "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." },
|
|
46
|
+
{ "part": "accordion-panel-inner", "element": "div", "description": "Holds the content and its padding; fades and un-blurs it in on open and back out on close, on the same duration as the panel's height. The clipping is done by accordion-panel (overflow: hidden)." }
|
|
47
|
+
],
|
|
48
|
+
|
|
49
|
+
"props": [
|
|
50
|
+
{ "name": "label", "type": "string", "required": true, "description": "The header's text label." },
|
|
51
|
+
{ "name": "children", "type": "React.ReactNode", "required": true, "description": "The panel's content." },
|
|
52
|
+
{ "name": "expanded", "type": "boolean | undefined", "description": "Controlled open state. Leave unset for uncontrolled (see `defaultExpanded`)." },
|
|
53
|
+
{ "name": "defaultExpanded", "type": "boolean", "default": "false", "description": "Initial open state for uncontrolled usage." },
|
|
54
|
+
{ "name": "onExpandedChange", "type": "(expanded: boolean) => void", "description": "Fires whenever the disclosure toggles, controlled or not." },
|
|
55
|
+
{ "name": "disabled", "type": "boolean", "default": "false", "description": "Prevents toggling." },
|
|
56
|
+
{ "name": "className", "type": "string | undefined", "description": "Additional className for the root." }
|
|
57
|
+
],
|
|
58
|
+
|
|
59
|
+
"sizing": {
|
|
60
|
+
"width": { "default": "fill", "note": "Fills its container width, matching Card." },
|
|
61
|
+
"height": { "mode": "content-driven", "note": "Header height is content-driven; panel height is measured in JS and animated as an explicit pixel height, no fixed rung." }
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
"tokenPolicy": {
|
|
65
|
+
"allowed": ["color.fill", "color.text", "color.border", "color.icon", "spacing", "radius", "fontSize", "fontWeight"],
|
|
66
|
+
"forbidden": ["primitive.color", "shadow"]
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
"a11y": {
|
|
70
|
+
"role": "native <details>/<summary> disclosure — no hand-rolled role needed",
|
|
71
|
+
"announces": ["group"],
|
|
72
|
+
"keyboardNav": ["Enter / Space on the header — toggles (native <summary> behavior)"],
|
|
73
|
+
"wcag": ["4.1.2 Name, Role, Value", "2.1.1 Keyboard"],
|
|
74
|
+
"applied": {
|
|
75
|
+
"nativeElement": "details",
|
|
76
|
+
"focus": [
|
|
77
|
+
{
|
|
78
|
+
"part": "(any focusable element)",
|
|
79
|
+
"when": ":focus-visible",
|
|
80
|
+
"inherited": "global rule",
|
|
81
|
+
"outline": "2px solid var(--helix-color-border-focus)",
|
|
82
|
+
"outline-offset": "2px"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"aria": {
|
|
86
|
+
"accordion-header": {
|
|
87
|
+
"aria-expanded": [
|
|
88
|
+
"true",
|
|
89
|
+
"false"
|
|
90
|
+
],
|
|
91
|
+
"aria-disabled": [
|
|
92
|
+
"true"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"accordion-chevron": {
|
|
96
|
+
"aria-hidden": [
|
|
97
|
+
"true"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"announced": [],
|
|
102
|
+
"contrast": {
|
|
103
|
+
"accordion-title": {
|
|
104
|
+
"light": "17.85:1 — #0f172a on #ffffff",
|
|
105
|
+
"dark": "16.29:1 — #f1f5f9 on #0f172a"
|
|
106
|
+
},
|
|
107
|
+
"accordion-panel-inner": {
|
|
108
|
+
"light": "17.85:1 — #0f172a on #ffffff",
|
|
109
|
+
"dark": "16.29:1 — #f1f5f9 on #0f172a"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"targetSize": {
|
|
113
|
+
"accordion-header": "smallest 418×45 px"
|
|
114
|
+
},
|
|
115
|
+
"motion": [
|
|
116
|
+
"CSS transitions/animations: neutralised by the global prefers-reduced-motion rule"
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
"results": {
|
|
120
|
+
"score": 100,
|
|
121
|
+
"meetsMinimum": true,
|
|
122
|
+
"checks": {
|
|
123
|
+
"contract": "pass",
|
|
124
|
+
"keys": "pass",
|
|
125
|
+
"focus-return": "n/a",
|
|
126
|
+
"keyboard": "pass",
|
|
127
|
+
"axe": "pass",
|
|
128
|
+
"contrast": "pass",
|
|
129
|
+
"focus-visible": "pass",
|
|
130
|
+
"target-size": "pass",
|
|
131
|
+
"reflow": "n/a",
|
|
132
|
+
"screen-reader": "pass",
|
|
133
|
+
"ai-visual": "pass",
|
|
134
|
+
"human": "pending"
|
|
135
|
+
},
|
|
136
|
+
"notScored": [
|
|
137
|
+
"ai-visual",
|
|
138
|
+
"human"
|
|
139
|
+
],
|
|
140
|
+
"changed": "2026-10-12"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
"figma": {
|
|
145
|
+
"states": ["default", "focus", "disabled"],
|
|
146
|
+
"properties": [
|
|
147
|
+
{
|
|
148
|
+
"name": "expanded",
|
|
149
|
+
"type": "VARIANT",
|
|
150
|
+
"values": ["false", "true"],
|
|
151
|
+
"codeProp": "expanded",
|
|
152
|
+
"description": "Shows the panel; the chevron flips (scaleY(-1) in code)."
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "state",
|
|
156
|
+
"type": "VARIANT",
|
|
157
|
+
"values": ["default", "focus", "disabled"],
|
|
158
|
+
"figmaOnly": true,
|
|
159
|
+
"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."
|
|
160
|
+
},
|
|
161
|
+
{ "name": "label", "type": "TEXT", "codeProp": "label" },
|
|
162
|
+
{ "name": "content", "type": "TEXT", "codeProp": "children" }
|
|
163
|
+
],
|
|
164
|
+
"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).",
|
|
165
|
+
"variantCombinations": "6 variants (2026-10-21): expanded × state default/focus = 4, plus disabled per expanded (state default) = 2. label and children are TEXT.",
|
|
166
|
+
"stories": {
|
|
167
|
+
"Default": "expanded=false",
|
|
168
|
+
"OpenByDefault": "expanded=true",
|
|
169
|
+
"Disabled": "disabled=true",
|
|
170
|
+
"Stack": "layout",
|
|
171
|
+
"Controlled": {"figma": null, "reason": "controlled-state demo — behaviour only, same look as another story", "approved": "2026-10-21"},
|
|
172
|
+
"KeyboardToggle": {"figma": "state=focus", "reason": "keyboard focus — the focus ring is drawn in Figma (owner 2026-10-21: focus states are drawn)"}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../component.schema.json",
|
|
3
|
+
"name": "AppShell",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"status": "stable",
|
|
6
|
+
"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.",
|
|
7
|
+
"import": "import { AppShell } from '@helixds/react';",
|
|
8
|
+
"archetype": "layout",
|
|
9
|
+
"neverUseFor": [
|
|
10
|
+
"A single content section inside an already-shelled page — AppShell is used once, at the page root",
|
|
11
|
+
"Auth/marketing pages with no persistent nav — a page with no SideNav should just render its content directly, not force an empty shell"
|
|
12
|
+
],
|
|
13
|
+
"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.",
|
|
14
|
+
"governance": {
|
|
15
|
+
"mayExtendLocally": [
|
|
16
|
+
"Choose which SideNav entries and TopBar actions a product renders",
|
|
17
|
+
"Compose any page content inside the main slot",
|
|
18
|
+
"Omit the shell entirely on auth/marketing pages with no persistent nav"
|
|
19
|
+
],
|
|
20
|
+
"mustEscalateToDS": [
|
|
21
|
+
"Adding new shell regions (e.g. a right rail or a footer bar)",
|
|
22
|
+
"Changing which element scrolls or rendering more than one <main>",
|
|
23
|
+
"Nesting AppShell inside another layout or page",
|
|
24
|
+
"Changing the 768px collapse breakpoint or how the collapsed SideNav opens"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"states": {
|
|
28
|
+
"intrinsic": [],
|
|
29
|
+
"authored": [
|
|
30
|
+
{
|
|
31
|
+
"name": "sidenavExpanded",
|
|
32
|
+
"description": "Below primitive.breakpoint.tablet (768px of the shell's own width) the SideNav collapses out of view and the TopBar shows a menu IconButton (IconMenu2) that opens it over the content. Uncontrolled via `defaultSidenavExpanded`, or controlled via `sidenavExpanded`/`onSidenavExpandedChange` — same pattern as Accordion's `expanded`. At 768px and wider the SideNav is always shown and this state has no visible effect.",
|
|
33
|
+
"aria": "aria-expanded + aria-controls (the app-shell-nav id) on the TopBar's menu button"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"anatomy": [
|
|
38
|
+
{
|
|
39
|
+
"part": "app-shell-root",
|
|
40
|
+
"element": "div",
|
|
41
|
+
"description": "Root — full-viewport-height flex row, and the size container (`app-shell`) the collapse responds to."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"part": "app-shell-nav",
|
|
45
|
+
"element": "div",
|
|
46
|
+
"description": "Wraps the sidenav slot. Below 768px it's taken out of the flow and slides in over the content, under the TopBar, when sidenavExpanded is true; hidden (visibility) when collapsed so its links aren't tabbable.",
|
|
47
|
+
"optional": true
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"part": "app-shell-content",
|
|
51
|
+
"element": "div",
|
|
52
|
+
"description": "Flex column beside the sidenav — wraps the topbar and main."
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"part": "app-shell-main",
|
|
56
|
+
"element": "main",
|
|
57
|
+
"description": "Scrollable main content region."
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"props": [
|
|
61
|
+
{
|
|
62
|
+
"name": "sidenav",
|
|
63
|
+
"type": "React.ReactNode | undefined",
|
|
64
|
+
"description": "A SideNav instance, rendered to the left."
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "topbar",
|
|
68
|
+
"type": "React.ReactNode | undefined",
|
|
69
|
+
"description": "A TopBar instance, rendered above the main content."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "children",
|
|
73
|
+
"type": "React.ReactNode",
|
|
74
|
+
"required": true,
|
|
75
|
+
"description": "The page's main content."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "sidenavExpanded",
|
|
79
|
+
"type": "boolean | undefined",
|
|
80
|
+
"description": "Controlled: whether the collapsed SideNav is open (below 768px only). Leave unset for uncontrolled (see `defaultSidenavExpanded`)."
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "defaultSidenavExpanded",
|
|
84
|
+
"type": "boolean",
|
|
85
|
+
"default": "false",
|
|
86
|
+
"description": "Initial open state of the collapsed SideNav, for uncontrolled usage."
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "onSidenavExpandedChange",
|
|
90
|
+
"type": "(expanded: boolean) => void",
|
|
91
|
+
"description": "Fires whenever the collapsed SideNav opens or closes — the menu button, Escape, following a nav link or tabbing out of it."
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "className",
|
|
95
|
+
"type": "string | undefined",
|
|
96
|
+
"description": "Additional className for the root."
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"tokenPolicy": {
|
|
100
|
+
"allowed": [
|
|
101
|
+
"color.fill"
|
|
102
|
+
],
|
|
103
|
+
"forbidden": [
|
|
104
|
+
"primitive.color"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"a11y": {
|
|
108
|
+
"role": "main (implicit from <main> on app-shell-main — exactly one per page)",
|
|
109
|
+
"keyboardNav": [
|
|
110
|
+
"Enter / Space on the TopBar's menu button — opens/closes the collapsed SideNav (native <button>); opening moves focus to the nav's current (or first) link",
|
|
111
|
+
"Escape inside the open SideNav or on the menu button — closes it and returns focus to the menu button",
|
|
112
|
+
"Tab past the open SideNav's last link — closes it and lands on the menu button (focus leaving the nav closes it)"
|
|
113
|
+
],
|
|
114
|
+
"wcag": [
|
|
115
|
+
"1.3.1 Info and Relationships",
|
|
116
|
+
"2.4.1 Bypass Blocks",
|
|
117
|
+
"4.1.2 Name, Role, Value",
|
|
118
|
+
"2.1.1 Keyboard",
|
|
119
|
+
"1.4.10 Reflow"
|
|
120
|
+
],
|
|
121
|
+
"applied": {
|
|
122
|
+
"nativeElement": "div",
|
|
123
|
+
"innerComponents": [
|
|
124
|
+
"IconButton",
|
|
125
|
+
"Input",
|
|
126
|
+
"NavItem"
|
|
127
|
+
],
|
|
128
|
+
"focus": [
|
|
129
|
+
{
|
|
130
|
+
"part": "(its inner controls)",
|
|
131
|
+
"delegatedTo": [
|
|
132
|
+
"IconButton",
|
|
133
|
+
"Input",
|
|
134
|
+
"NavItem"
|
|
135
|
+
],
|
|
136
|
+
"note": "focus is drawn by IconButton, Input, NavItem — see their a11y.applied.focus"
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"aria": {},
|
|
140
|
+
"announced": [
|
|
141
|
+
"main"
|
|
142
|
+
],
|
|
143
|
+
"contrast": {},
|
|
144
|
+
"targetSize": {},
|
|
145
|
+
"motion": [
|
|
146
|
+
"CSS transitions/animations: neutralised by the global prefers-reduced-motion rule"
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
"results": {
|
|
150
|
+
"score": 100,
|
|
151
|
+
"meetsMinimum": true,
|
|
152
|
+
"checks": {
|
|
153
|
+
"contract": "pass",
|
|
154
|
+
"keys": "n/a",
|
|
155
|
+
"focus-return": "n/a",
|
|
156
|
+
"keyboard": "n/a",
|
|
157
|
+
"axe": "pass",
|
|
158
|
+
"contrast": "pass",
|
|
159
|
+
"focus-visible": "pass",
|
|
160
|
+
"target-size": "pass",
|
|
161
|
+
"reflow": "pass",
|
|
162
|
+
"screen-reader": "pass",
|
|
163
|
+
"ai-visual": "fail",
|
|
164
|
+
"human": "pending"
|
|
165
|
+
},
|
|
166
|
+
"notScored": [
|
|
167
|
+
"ai-visual",
|
|
168
|
+
"human"
|
|
169
|
+
],
|
|
170
|
+
"changed": "2026-12-05"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"figma": {
|
|
174
|
+
"childProps": {
|
|
175
|
+
"sidenav": [
|
|
176
|
+
{
|
|
177
|
+
"component": "SideNav",
|
|
178
|
+
"property": null,
|
|
179
|
+
"note": "the side navigation"
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"topbar": [
|
|
183
|
+
{
|
|
184
|
+
"component": "TopBar",
|
|
185
|
+
"property": null,
|
|
186
|
+
"note": "the top bar"
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
"states": [
|
|
191
|
+
"default"
|
|
192
|
+
],
|
|
193
|
+
"properties": [],
|
|
194
|
+
"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).",
|
|
195
|
+
"stories": {
|
|
196
|
+
"Default": "sidenav=true, topbar=true",
|
|
197
|
+
"Collapsed": "below 768px — SideNav hidden, menu button in the TopBar, sidenavExpanded=false",
|
|
198
|
+
"Expanded": "below 768px — SideNav open over the content, sidenavExpanded=true"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
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
|
+
"archetype": "data-display",
|
|
10
|
+
|
|
11
|
+
"neverUseFor": [
|
|
12
|
+
"Brand logomarks — use Image or a dedicated Logo component",
|
|
13
|
+
"Status indication — use Badge; Avatar communicates identity, not state",
|
|
14
|
+
"Large hero imagery — Avatar is capped at the field/control size scale, never a feature image"
|
|
15
|
+
],
|
|
16
|
+
|
|
17
|
+
"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.",
|
|
18
|
+
|
|
19
|
+
"governance": {
|
|
20
|
+
"mayExtendLocally": [
|
|
21
|
+
"Supply any image source or initials fallback per product",
|
|
22
|
+
"Wrap an Avatar in a Tooltip or link at the usage site"
|
|
23
|
+
],
|
|
24
|
+
"mustEscalateToDS": [
|
|
25
|
+
"Adding new sizes beyond s/m/l or non-circular shapes",
|
|
26
|
+
"Overlaying status indicators or borders onto the Avatar itself",
|
|
27
|
+
"Using Avatar for logos or hero imagery"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
"states": {
|
|
32
|
+
"intrinsic": [],
|
|
33
|
+
"authored": []
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
"anatomy": [
|
|
37
|
+
{ "part": "avatar-root", "element": "span", "description": "Root circular container." },
|
|
38
|
+
{ "part": "avatar-image", "element": "img", "description": "Rendered when src is provided.", "optional": true },
|
|
39
|
+
{ "part": "avatar-initials", "element": "span", "description": "Fallback — the first letter of label, rendered when src is absent.", "optional": true }
|
|
40
|
+
],
|
|
41
|
+
|
|
42
|
+
"props": [
|
|
43
|
+
{ "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)." },
|
|
44
|
+
{ "name": "src", "type": "string | undefined", "description": "Image URL. When present, renders avatar-image; falls back to initials on load error." },
|
|
45
|
+
{ "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." },
|
|
46
|
+
{ "name": "size", "type": "'s' | 'm' | 'l'", "default": "m", "description": "Physical size. Shares the field scale with Input/Select (s=24, m=32, l=40)." },
|
|
47
|
+
{ "name": "className", "type": "string | undefined", "description": "Additional className for the root." }
|
|
48
|
+
],
|
|
49
|
+
|
|
50
|
+
"sizing": {
|
|
51
|
+
"height": {
|
|
52
|
+
"mode": "fixed",
|
|
53
|
+
"values": { "s": 24, "m": 32, "l": 40 },
|
|
54
|
+
"unit": "px",
|
|
55
|
+
"note": "Shares tokens with the Field scale (Input/Select) — same semantic.size.{s,m,l} rungs, not a new local scale."
|
|
56
|
+
},
|
|
57
|
+
"width": {
|
|
58
|
+
"default": "fixed",
|
|
59
|
+
"note": "Always a circle — width equals height at every size, no consumer override."
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
"tokenPolicy": {
|
|
64
|
+
"allowed": ["color.fill", "color.text", "fontSize", "fontWeight"],
|
|
65
|
+
"forbidden": ["primitive.color", "color.border"]
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
"a11y": {
|
|
69
|
+
"role": "img (implicit via <img>) when src is set; presentation otherwise — the accessible name comes from the alt/name, never announced twice",
|
|
70
|
+
"wcag": ["1.1.1 Non-text Content"],
|
|
71
|
+
"applied": {
|
|
72
|
+
"nativeElement": "span",
|
|
73
|
+
"focus": [],
|
|
74
|
+
"aria": {
|
|
75
|
+
"avatar-initials": {
|
|
76
|
+
"aria-label": [
|
|
77
|
+
"Sara Navarro",
|
|
78
|
+
"Ana García",
|
|
79
|
+
"Pau Torres",
|
|
80
|
+
"Marta Conde"
|
|
81
|
+
],
|
|
82
|
+
"role": [
|
|
83
|
+
"img"
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"announced": [
|
|
88
|
+
"img \"Sara Navarro\": S",
|
|
89
|
+
"img \"Ana García\": A",
|
|
90
|
+
"img \"Pau Torres\": P",
|
|
91
|
+
"img \"Marta Conde\": M",
|
|
92
|
+
"img \"Jordi Puig\": J"
|
|
93
|
+
],
|
|
94
|
+
"contrast": {
|
|
95
|
+
"avatar-initials (m)": {
|
|
96
|
+
"light": "4.74:1 — #2563eb on #eff6ff",
|
|
97
|
+
"dark": "5.74:1 — #93c5fd on #1e3a8a"
|
|
98
|
+
},
|
|
99
|
+
"avatar-initials (s)": {
|
|
100
|
+
"light": "4.74:1 — #2563eb on #eff6ff",
|
|
101
|
+
"dark": "5.74:1 — #93c5fd on #1e3a8a"
|
|
102
|
+
},
|
|
103
|
+
"avatar-initials (l)": {
|
|
104
|
+
"light": "4.74:1 — #2563eb on #eff6ff",
|
|
105
|
+
"dark": "5.74:1 — #93c5fd on #1e3a8a"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"targetSize": {},
|
|
109
|
+
"motion": [
|
|
110
|
+
"CSS transitions/animations: neutralised by the global prefers-reduced-motion rule"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"results": {
|
|
114
|
+
"score": 100,
|
|
115
|
+
"meetsMinimum": true,
|
|
116
|
+
"checks": {
|
|
117
|
+
"contract": "pass",
|
|
118
|
+
"keys": "n/a",
|
|
119
|
+
"focus-return": "n/a",
|
|
120
|
+
"keyboard": "n/a",
|
|
121
|
+
"axe": "pass",
|
|
122
|
+
"contrast": "pass",
|
|
123
|
+
"focus-visible": "pass",
|
|
124
|
+
"target-size": "pass",
|
|
125
|
+
"reflow": "n/a",
|
|
126
|
+
"screen-reader": "pass",
|
|
127
|
+
"ai-visual": "pass",
|
|
128
|
+
"human": "pending"
|
|
129
|
+
},
|
|
130
|
+
"notScored": [
|
|
131
|
+
"ai-visual",
|
|
132
|
+
"human"
|
|
133
|
+
],
|
|
134
|
+
"changed": "2026-10-12"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
"figma": {
|
|
139
|
+
"states": ["default"],
|
|
140
|
+
"variantCombinations": "6 variants (2026-10-21): src. false/true × size s/m/l.",
|
|
141
|
+
"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.",
|
|
142
|
+
"propertyMap": {
|
|
143
|
+
"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" }
|
|
144
|
+
},
|
|
145
|
+
"properties": [
|
|
146
|
+
{ "name": "size", "type": "VARIANT", "values": ["s", "m", "l"], "codeProp": "size" },
|
|
147
|
+
{ "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)." },
|
|
148
|
+
{ "name": "src.", "type": "VARIANT", "values": ["false", "true"], "codeProp": "src", "description": "false = initials, true = the photo (avatar-image)." }
|
|
149
|
+
],
|
|
150
|
+
"stories": {
|
|
151
|
+
"Default": "src.=false",
|
|
152
|
+
"Sizes": "layout",
|
|
153
|
+
"WithImage": "src.=true",
|
|
154
|
+
"BrokenImageFallsBackToInitials": "src.=false",
|
|
155
|
+
"MemberList": "layout"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|