@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,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
archetype: foundation
|
|
3
|
+
title: Icons and symbols
|
|
4
|
+
question: "I need a symbol. Is it an Icon, and how?"
|
|
5
|
+
components: [Icon]
|
|
6
|
+
boundary: [IconButton, Tooltip, Avatar, Button]
|
|
7
|
+
gaps: [Illustration, Image, Logo]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Archetype: Icons and symbols
|
|
11
|
+
|
|
12
|
+
The building block other components render through. There is one member today, `Icon`; the family is where
|
|
13
|
+
anything symbolic that isn't a control goes. Its contract says what it is; this playbook says where it stops.
|
|
14
|
+
|
|
15
|
+
**Evidence tags.** Every rule ends with where it comes from:
|
|
16
|
+
`[Name.neverUseFor]`, `[Name.purpose]`, `[Name.rationale]` = written in that component's approved contract ·
|
|
17
|
+
`[pattern: name]` = an approved `.ai/maps/patterns/` file ·
|
|
18
|
+
`[proposed]` = a cross-component rule no contract states yet — **needs the design-system owner's approval**
|
|
19
|
+
before anyone treats it as Helix's rule. `pnpm verify:archetypes` checks every tag.
|
|
20
|
+
|
|
21
|
+
## Decision tree
|
|
22
|
+
|
|
23
|
+
Ask in order; the first yes wins.
|
|
24
|
+
|
|
25
|
+
1. Is the symbol the only thing that says what something means? → add visible text or a label: an `Icon` is always supplemental. [Icon.purpose] [Icon.rationale]
|
|
26
|
+
2. Is it a control the user presses, with no visible text? → `IconButton` (label required), with a `Tooltip` for the hint. [IconButton.purpose] [Tooltip.purpose]
|
|
27
|
+
3. Is it a brand logo? → not an `Icon` (`Logo` / `Image` are gaps). [Icon.neverUseFor]
|
|
28
|
+
4. Is it a decorative illustration? → not an `Icon` (`Illustration` is a gap). [Icon.neverUseFor]
|
|
29
|
+
5. Is it a person or an entity? → `Avatar`. [Avatar.purpose]
|
|
30
|
+
6. Any other symbol → `Icon`, never a raw Tabler tag. [Icon.rationale]
|
|
31
|
+
|
|
32
|
+
## Side by side
|
|
33
|
+
|
|
34
|
+
| | `Icon` | `IconButton` | `Avatar` | Source |
|
|
35
|
+
|---|---|---|---|---|
|
|
36
|
+
| Is | A symbol next to text | An action | Identity | [Icon.purpose] [IconButton.purpose] [Avatar.purpose] |
|
|
37
|
+
| Accessible name | From the text beside it | Required by the type | From `label` | [Icon.rationale] [IconButton.rationale] [Avatar.rationale] |
|
|
38
|
+
| Stroke | Derived from size (ADR-014) | Through `Icon` | — | [Icon.rationale] |
|
|
39
|
+
|
|
40
|
+
## Don't use X — use Y
|
|
41
|
+
|
|
42
|
+
- Passing `stroke` to make an icon heavier or lighter → let `Icon` derive it from its size. [Icon.rationale]
|
|
43
|
+
- An animated icon → wrap the `Icon` in a motion component. [Icon.neverUseFor]
|
|
44
|
+
- A brand logo as an `Icon` → `Image` / `Logo` (gaps). [Icon.neverUseFor]
|
|
45
|
+
- An illustration as an `Icon` → `Illustration` (gap). [Icon.neverUseFor]
|
|
46
|
+
- An `Icon` alone conveying information → text or a label beside it. [Icon.purpose]
|
|
47
|
+
|
|
48
|
+
## Gaps — referenced by contracts, not in Helix
|
|
49
|
+
|
|
50
|
+
| Name | Cited by | What to use today |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| `Illustration` | `Icon` (neverUseFor) | An inline SVG or `<img>` |
|
|
53
|
+
| `Image` | `Icon`, `Avatar` (neverUseFor) | A plain `<img>` |
|
|
54
|
+
| `Logo` | `Icon`, `Avatar` (neverUseFor) | A plain `<img>` / inline SVG |
|
|
55
|
+
|
|
56
|
+
The owner decides for each one: build it, or correct the contracts that cite it.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
archetype: layout
|
|
3
|
+
title: Page structure
|
|
4
|
+
question: "Where does each part of the page go?"
|
|
5
|
+
components: [AppShell, PageHeader, SideNav, TopBar]
|
|
6
|
+
boundary: [NavItem, Card, Button, Tabs]
|
|
7
|
+
gaps: []
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Archetype: Page structure
|
|
11
|
+
|
|
12
|
+
The pieces every screen is built from: the shell, the navigation rail, the top bar and the header of each
|
|
13
|
+
view. Each component's contract says what it is on its own; this playbook puts them side by side. They live
|
|
14
|
+
in code and Storybook only — not in Figma, for now (CLAUDE.md rule 11b).
|
|
15
|
+
|
|
16
|
+
**Evidence tags.** Every rule ends with where it comes from:
|
|
17
|
+
`[Name.neverUseFor]`, `[Name.purpose]`, `[Name.rationale]` = written in that component's approved contract ·
|
|
18
|
+
`[pattern: name]` = an approved `.ai/maps/patterns/` file ·
|
|
19
|
+
`[proposed]` = a cross-component rule no contract states yet — **needs the design-system owner's approval**
|
|
20
|
+
before anyone treats it as Helix's rule. `pnpm verify:archetypes` checks every tag.
|
|
21
|
+
|
|
22
|
+
## Decision tree
|
|
23
|
+
|
|
24
|
+
Ask in order; the first yes wins.
|
|
25
|
+
|
|
26
|
+
1. Does the page have no persistent navigation (login, marketing)? → no shell: render the content directly. [AppShell.neverUseFor]
|
|
27
|
+
2. The outer structure of an app page (navigation, top bar, scrolling content)? → `AppShell`, once, at the root. [AppShell.purpose] [AppShell.neverUseFor]
|
|
28
|
+
3. The app's main navigation? → `SideNav`, with only `NavItem`s as entries. [SideNav.purpose] [SideNav.neverUseFor]
|
|
29
|
+
4. Search, global actions, the current user? → `TopBar`. [TopBar.purpose]
|
|
30
|
+
5. The title of the view, its description and its main actions? → `PageHeader`, once per view. [PageHeader.purpose] [PageHeader.neverUseFor]
|
|
31
|
+
6. Switching between sections inside one page? → `Tabs` (actions-navigation archetype), not the `SideNav`. [SideNav.neverUseFor] [Tabs.purpose]
|
|
32
|
+
7. The title of a card or a panel? → `Card`'s own header, not a `PageHeader`. [PageHeader.neverUseFor]
|
|
33
|
+
|
|
34
|
+
## Side by side
|
|
35
|
+
|
|
36
|
+
| | `AppShell` | `SideNav` | `TopBar` | `PageHeader` | Source |
|
|
37
|
+
|---|---|---|---|---|---|
|
|
38
|
+
| How many | One per page, at the root | One, inside the shell | One, inside the shell | One per view | [AppShell.neverUseFor] [SideNav.purpose] [TopBar.purpose] [PageHeader.neverUseFor] |
|
|
39
|
+
| Holds | Nav + top bar + the one `<main>` | Brand, `NavItem`s, user footer | Search, global actions, user | Title, description, actions | [AppShell.purpose] [SideNav.purpose] [TopBar.purpose] [PageHeader.purpose] |
|
|
40
|
+
| Scrolls | Owns the single scroll container | Persistent | Never — fixed chrome | — | [AppShell.rationale] [TopBar.neverUseFor] |
|
|
41
|
+
| Size | Full height | 224px wide | 56px tall | — | [SideNav.rationale] [TopBar.rationale] |
|
|
42
|
+
| Landmark | The page's only `<main>` | `<nav>` | — | — | [AppShell.rationale] [SideNav.rationale] |
|
|
43
|
+
|
|
44
|
+
## Don't use X — use Y
|
|
45
|
+
|
|
46
|
+
- `display: flex; min-height: 100vh` written by hand → `AppShell`. [AppShell.purpose]
|
|
47
|
+
- An `AppShell` inside a section of a page that already has one → one shell, at the root. [AppShell.neverUseFor]
|
|
48
|
+
- The page title in the `TopBar` → `PageHeader`, inside the main content. [TopBar.neverUseFor]
|
|
49
|
+
- Primary navigation in the `TopBar` → `SideNav`. [TopBar.neverUseFor]
|
|
50
|
+
- A `Button` or a plain `<a>` among `SideNav`'s entries → `NavItem`. [SideNav.neverUseFor]
|
|
51
|
+
- Breadcrumbs in the `SideNav` or the `PageHeader` → neither: they're per-page wayfinding. [SideNav.neverUseFor] [PageHeader.neverUseFor]
|
|
52
|
+
- A `PageHeader` repeated in a list → once per view. [PageHeader.neverUseFor]
|
|
53
|
+
- A `Card` as the page's structure → `AppShell`. [Card.neverUseFor]
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
archetype: overlays
|
|
3
|
+
title: Overlays
|
|
4
|
+
question: "Something has to appear on top of the page. Which surface?"
|
|
5
|
+
components: [Modal, SidePanel, Tooltip, Menu, Popover]
|
|
6
|
+
boundary: [Toast, Select, MultiSelect, IconButton, Avatar, Button]
|
|
7
|
+
gaps: []
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Archetype: Overlays
|
|
11
|
+
|
|
12
|
+
Every surface that floats above the page. Each component's contract says what it is on its own; this
|
|
13
|
+
playbook puts them side by side so an agent or a designer picks one by the problem, not by habit.
|
|
14
|
+
|
|
15
|
+
**Evidence tags.** Every rule ends with where it comes from:
|
|
16
|
+
`[Name.neverUseFor]`, `[Name.purpose]`, `[Name.rationale]` = written in that component's approved contract ·
|
|
17
|
+
`[pattern: name]` = an approved `.ai/maps/patterns/` file ·
|
|
18
|
+
`[proposed]` = a cross-component rule no contract states yet — **needs the design-system owner's approval**
|
|
19
|
+
before anyone treats it as Helix's rule. `pnpm verify:archetypes` checks every tag.
|
|
20
|
+
|
|
21
|
+
## Decision tree
|
|
22
|
+
|
|
23
|
+
Ask in order; the first yes wins.
|
|
24
|
+
|
|
25
|
+
1. Is it feedback about something that just happened, needing no answer? → not an overlay: `Toast` (feedback-status archetype). [Toast.purpose] [Toast.neverUseFor]
|
|
26
|
+
2. Must the user decide or complete something before going on? → `Modal`. [Modal.purpose] [Toast.neverUseFor]
|
|
27
|
+
3. Is it a longer secondary task (details, a form, a filter builder) that should keep the page visible beside it? → `SidePanel`. [SidePanel.purpose] [Modal.neverUseFor]
|
|
28
|
+
4. Is it a choice from a list of options anchored to a trigger? → `Menu` — in a form field, through `Select` or `MultiSelect`, never on its own. [Menu.purpose] [Menu.rationale]
|
|
29
|
+
5. Is it a short read-only label for a control that has no visible text (an `IconButton`, an `Avatar`)? → `Tooltip`. [Tooltip.purpose]
|
|
30
|
+
6. Does the floating content hold links, buttons or more than a short phrase, without blocking the page? → `Popover`, opened by a `Button` or `IconButton`; a real task → `SidePanel`. [Popover.purpose] [Popover.neverUseFor] [Tooltip.neverUseFor]
|
|
31
|
+
|
|
32
|
+
## Side by side
|
|
33
|
+
|
|
34
|
+
| | `Modal` | `SidePanel` | `Tooltip` | `Menu` | `Popover` | Source |
|
|
35
|
+
|---|---|---|---|---|---|---|
|
|
36
|
+
| Blocks the page | Yes | Yes | No | No | No | [Modal.purpose] [SidePanel.purpose] [Tooltip.purpose] [Popover.purpose] |
|
|
37
|
+
| Interactive content inside | Yes | Yes | Never | Options only | Yes — focus not trapped | [Tooltip.neverUseFor] [Menu.neverUseFor] [Popover.rationale] |
|
|
38
|
+
| Size | Centered, focused | 400px, full height, right edge | 240px max, a short phrase | 32px rows, matches the field | 320px max | [SidePanel.rationale] [Tooltip.rationale] [Menu.rationale] [Popover.neverUseFor] |
|
|
39
|
+
| Opens on | The consumer's state | The consumer's state | Hover or keyboard focus | Its trigger | A click on its trigger | [Toast.purpose] [Tooltip.purpose] [Menu.purpose] [Popover.purpose] |
|
|
40
|
+
| Can be missed | No | No | Yes — never the only way to learn something required | No | No | [Tooltip.neverUseFor] |
|
|
41
|
+
| Shadow | Yes, it floats (ADR-005) | Yes | Yes | Yes | Yes | [Tooltip.rationale] [Popover.rationale] |
|
|
42
|
+
|
|
43
|
+
## Don't use X — use Y
|
|
44
|
+
|
|
45
|
+
- A quick decision that must interrupt the whole page, inside a `SidePanel` → `Modal`. [SidePanel.neverUseFor]
|
|
46
|
+
- A persistent side task in a `Modal` → `SidePanel`. [Modal.neverUseFor]
|
|
47
|
+
- Non-blocking supplementary info in a `Modal` or `SidePanel` → `Tooltip` if it's a short phrase; `Popover` if it has actions or more text. [Modal.neverUseFor] [SidePanel.neverUseFor]
|
|
48
|
+
- Required information in a `Tooltip` → visible text on the page. [Tooltip.neverUseFor]
|
|
49
|
+
- Primary navigation in a `SidePanel` → `SideNav`. [SidePanel.neverUseFor]
|
|
50
|
+
- A confirmation that doesn't need to block everything → try inline UI before reaching for `Modal`. [Modal.neverUseFor]
|
|
51
|
+
- A `Menu` used as a generic popover for arbitrary content → `Popover`; `Menu` is a listbox. [Menu.neverUseFor]
|
|
52
|
+
- A list of actions in a `Popover` → `Menu`. [Popover.neverUseFor]
|
|
53
|
+
- A `Popover` that must be answered before going on → `Modal`. [Popover.neverUseFor]
|
|
54
|
+
- A long form in a `Popover` → `SidePanel`. [Popover.neverUseFor]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
archetype: text-input
|
|
3
|
+
title: Typing text
|
|
4
|
+
question: "The user has to type something. Which field?"
|
|
5
|
+
components: [Input, Textarea]
|
|
6
|
+
boundary: [Select, RadioGroup, CheckboxGroup, MultiSelect, Button, Chip]
|
|
7
|
+
gaps: [FileInput, DatePicker]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Archetype: Typing text
|
|
11
|
+
|
|
12
|
+
Every field where the user writes free-form text. Each component's contract says what it is on its own;
|
|
13
|
+
this playbook puts them side by side.
|
|
14
|
+
|
|
15
|
+
**Evidence tags.** Every rule ends with where it comes from:
|
|
16
|
+
`[Name.neverUseFor]`, `[Name.purpose]`, `[Name.rationale]` = written in that component's approved contract ·
|
|
17
|
+
`[pattern: name]` = an approved `.ai/maps/patterns/` file ·
|
|
18
|
+
`[proposed]` = a cross-component rule no contract states yet — **needs the design-system owner's approval**
|
|
19
|
+
before anyone treats it as Helix's rule. `pnpm verify:archetypes` checks every tag.
|
|
20
|
+
|
|
21
|
+
## Decision tree
|
|
22
|
+
|
|
23
|
+
Ask in order; the first yes wins.
|
|
24
|
+
|
|
25
|
+
1. Is the answer one of a set of known options? → not free text: `Select`, `RadioGroup` or `CheckboxGroup` (form-selection archetype). [Textarea.neverUseFor]
|
|
26
|
+
2. Is it a file? → **no Helix component yet** (`FileInput` is a gap). [Input.neverUseFor] [Textarea.neverUseFor]
|
|
27
|
+
3. Is it a date or a time? → **no Helix component yet** (`DatePicker` is a gap). [Input.neverUseFor]
|
|
28
|
+
4. One line of text (a name, an email, a search)? → `Input`. [Input.purpose]
|
|
29
|
+
5. Several lines (a comment, a description)? → `Textarea`. [Textarea.purpose] [Input.neverUseFor]
|
|
30
|
+
|
|
31
|
+
Several fields together → the form-field-group pattern; a search box over a list → the search-filter pattern. [pattern: form-field-group] [pattern: search-filter]
|
|
32
|
+
|
|
33
|
+
## Side by side
|
|
34
|
+
|
|
35
|
+
| | `Input` | `Textarea` | Source |
|
|
36
|
+
|---|---|---|---|
|
|
37
|
+
| Lines | One | Several | [Input.purpose] [Textarea.purpose] |
|
|
38
|
+
| Height | 32px, fixed | 32px minimum, grows with `rows` | [Input.rationale] [Textarea.rationale] |
|
|
39
|
+
| Sizes | One, `m` — the same as every form field | One, `m` — the same as every form field | [Input.rationale] [Textarea.rationale] |
|
|
40
|
+
| Width | Hug or fill, never a fixed token | Hug or fill | [Input.rationale] |
|
|
41
|
+
|
|
42
|
+
## Don't use X — use Y
|
|
43
|
+
|
|
44
|
+
- Multi-line text in an `Input` → `Textarea`. [Input.neverUseFor]
|
|
45
|
+
- Single-line text in a `Textarea` → `Input`. [Textarea.neverUseFor]
|
|
46
|
+
- Choosing from options in a `Textarea` → `Select`, `RadioGroup` or `CheckboxGroup`. [Textarea.neverUseFor]
|
|
47
|
+
- Free-form tags typed in a `MultiSelect` → `Input`. [MultiSelect.neverUseFor]
|
|
48
|
+
- One field taller or shorter than the others in a form → every field is size `m`. [Input.rationale] [Textarea.rationale]
|
|
49
|
+
- Spacing between fields picked by eye → the form-field-spacing pattern. [pattern: form-field-spacing]
|
|
50
|
+
|
|
51
|
+
## Gaps — referenced by contracts, not in Helix
|
|
52
|
+
|
|
53
|
+
| Name | Cited by | What to use today |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `FileInput` | `Input`, `Textarea` (neverUseFor) | Nothing in Helix — a local [CUSTOM] component |
|
|
56
|
+
| `DatePicker` | `Input` (neverUseFor), `Menu` (purpose) | Nothing in Helix — a local [CUSTOM] component |
|
|
57
|
+
|
|
58
|
+
The owner decides for each one: build it, or correct the contracts that cite it.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using Accordion, read its contract: node_modules/@helixds/react/dist/contracts/Accordion.json
|
|
4
|
+
* (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
|
|
5
|
+
* Guide: node_modules/@helixds/react/AGENTS.md
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import type { AccordionProps } from './Accordion.types.js';
|
|
9
|
+
declare const Accordion: {
|
|
10
|
+
({ label, children, expanded, defaultExpanded, onExpandedChange, disabled, className, }: AccordionProps): React.JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export { Accordion };
|
|
14
|
+
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const doc = {
|
|
2
|
+
name: 'Accordion',
|
|
3
|
+
purpose: 'A single collapsible disclosure — a header that expands/collapses a panel of content.',
|
|
4
|
+
contract: 'contracts/components/Accordion.json',
|
|
5
|
+
a11y: [
|
|
6
|
+
'Built on native <details>/<summary> — open/closed state, keyboard support (Enter/Space), and the implicit disclosure semantics all come from the element itself, no hand-rolled ARIA.',
|
|
7
|
+
'The chevron is aria-hidden — the open/closed state is already exposed by <details>, not by the icon.',
|
|
8
|
+
],
|
|
9
|
+
variants: [],
|
|
10
|
+
sizes: [],
|
|
11
|
+
tokens: [
|
|
12
|
+
{ part: 'accordion-root', label: 'fill', token: '--helix-accordion-fill', kind: 'color' },
|
|
13
|
+
{ part: 'accordion-root', label: 'border', token: '--helix-accordion-border', kind: 'color' },
|
|
14
|
+
{ part: 'accordion-header', label: 'text', token: '--helix-accordion-text', kind: 'color' },
|
|
15
|
+
{ part: 'accordion-chevron', label: 'chevron', token: '--helix-accordion-chevron', kind: 'color' },
|
|
16
|
+
],
|
|
17
|
+
features: [
|
|
18
|
+
'label — the header text',
|
|
19
|
+
'expanded / defaultExpanded / onExpandedChange — controlled or uncontrolled, same pattern as Switch',
|
|
20
|
+
'disabled — prevents toggling',
|
|
21
|
+
],
|
|
22
|
+
examples: [
|
|
23
|
+
{ label: 'Basic', code: `<Accordion label="Shipping details">Ships in 3-5 business days.</Accordion>` },
|
|
24
|
+
{ label: 'Controlled', code: `<Accordion label="Advanced" expanded={isExpanded} onExpandedChange={setIsExpanded}>...</Accordion>` },
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=Accordion.doc.js.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { IconChevronDown } from '@tabler/icons-react';
|
|
4
|
+
import { cn } from '../../lib/utils.js';
|
|
5
|
+
import { Icon } from '../Icon/index.js';
|
|
6
|
+
import { useDisclosureTransition } from '../../lib/useDisclosureTransition.js';
|
|
7
|
+
const Accordion = ({ label, children, expanded, defaultExpanded = false, onExpandedChange, disabled = false, className, }) => {
|
|
8
|
+
const [uncontrolledExpanded, setUncontrolledExpanded] = React.useState(defaultExpanded);
|
|
9
|
+
const isControlled = expanded !== undefined;
|
|
10
|
+
const isExpanded = isControlled ? expanded : uncontrolledExpanded;
|
|
11
|
+
const { ref, state } = useDisclosureTransition(isExpanded, '--helix-accordion-duration-collapse');
|
|
12
|
+
const panelRef = React.useRef(null);
|
|
13
|
+
const innerRef = React.useRef(null);
|
|
14
|
+
// Explicit pixel height, not grid-template-rows 0fr/1fr — see the conversation this shipped from:
|
|
15
|
+
// 'fr' unit interpolation doesn't track the same visual pace in both directions even with matched
|
|
16
|
+
// duration/easing, which read as a slow/laggy collapse. A measured, real height transitions
|
|
17
|
+
// identically regardless of direction.
|
|
18
|
+
React.useLayoutEffect(() => {
|
|
19
|
+
const panel = panelRef.current;
|
|
20
|
+
const inner = innerRef.current;
|
|
21
|
+
if (!panel || !inner)
|
|
22
|
+
return;
|
|
23
|
+
if (state === 'open') {
|
|
24
|
+
panel.style.height = `${inner.scrollHeight}px`;
|
|
25
|
+
}
|
|
26
|
+
else if (state === 'closing') {
|
|
27
|
+
// Coming from 'open', height is likely 'auto' (released once the expand settled, below) —
|
|
28
|
+
// 'auto' can't be transitioned, so lock in the current real height first, force the browser to
|
|
29
|
+
// register it (a read that triggers layout), then collapse to 0 on the next line. Without the
|
|
30
|
+
// forced read, the browser could coalesce both writes and jump straight to 0 with no transition.
|
|
31
|
+
panel.style.height = `${inner.scrollHeight}px`;
|
|
32
|
+
void panel.offsetHeight;
|
|
33
|
+
panel.style.height = '0px';
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
panel.style.height = '0px';
|
|
37
|
+
}
|
|
38
|
+
}, [state]);
|
|
39
|
+
// Once fully open, release the locked pixel height to `auto` so content that changes size while
|
|
40
|
+
// expanded (e.g. an image loading in) isn't clipped — re-locked to a real px value above the moment
|
|
41
|
+
// a close starts.
|
|
42
|
+
const handlePanelTransitionEnd = (event) => {
|
|
43
|
+
if (event.target !== event.currentTarget || event.propertyName !== 'height')
|
|
44
|
+
return;
|
|
45
|
+
if (state === 'open') {
|
|
46
|
+
event.currentTarget.style.height = 'auto';
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const toggle = () => {
|
|
50
|
+
if (disabled)
|
|
51
|
+
return;
|
|
52
|
+
const next = !isExpanded;
|
|
53
|
+
if (!isControlled)
|
|
54
|
+
setUncontrolledExpanded(next);
|
|
55
|
+
onExpandedChange?.(next);
|
|
56
|
+
};
|
|
57
|
+
const handleSummaryClick = (event) => {
|
|
58
|
+
// Always prevent the native instant toggle — see useDisclosureTransition's own comment for why:
|
|
59
|
+
// collapsing has to play the closing transition before `open` actually comes off.
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
toggle();
|
|
62
|
+
};
|
|
63
|
+
// Enter/Space handled here rather than left to <summary>'s native activation: preventDefault on the
|
|
64
|
+
// keydown cancels the native click, so each press toggles exactly once — and the behavior no longer
|
|
65
|
+
// depends on the browser's own summary activation, which synthetic key events (tests) don't trigger.
|
|
66
|
+
const handleSummaryKeyDown = (event) => {
|
|
67
|
+
if (event.key !== 'Enter' && event.key !== ' ')
|
|
68
|
+
return;
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
toggle();
|
|
71
|
+
};
|
|
72
|
+
return (_jsxs("details", { ref: ref, "data-helix-part": "accordion-root", "data-state": state, className: cn(className), children: [_jsxs("summary", { "data-helix-part": "accordion-header", "aria-disabled": disabled ? 'true' : undefined, "aria-expanded": isExpanded ? 'true' : 'false', onClick: handleSummaryClick, onKeyDown: handleSummaryKeyDown, children: [_jsx("span", { "data-helix-part": "accordion-title", children: label }), _jsx("span", { "data-helix-part": "accordion-chevron", "aria-hidden": "true", children: _jsx(Icon, { icon: IconChevronDown, size: 16 }) })] }), _jsx("div", { ref: panelRef, "data-helix-part": "accordion-panel", onTransitionEnd: handlePanelTransitionEnd, children: _jsx("div", { ref: innerRef, "data-helix-part": "accordion-panel-inner", children: children }) })] }));
|
|
73
|
+
};
|
|
74
|
+
Accordion.displayName = 'Accordion';
|
|
75
|
+
export { Accordion };
|
|
76
|
+
//# sourceMappingURL=Accordion.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using Accordion, read its contract: node_modules/@helixds/react/dist/contracts/Accordion.json
|
|
4
|
+
* (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
|
|
5
|
+
* Guide: node_modules/@helixds/react/AGENTS.md
|
|
6
|
+
*/
|
|
7
|
+
import type * as React from 'react';
|
|
8
|
+
export interface AccordionProps {
|
|
9
|
+
/** The header's text label. */
|
|
10
|
+
label: string;
|
|
11
|
+
/** The panel's content. */
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/** Controlled open state. Leave unset for uncontrolled (see `defaultExpanded`). */
|
|
14
|
+
expanded?: boolean;
|
|
15
|
+
/** Initial open state for uncontrolled usage. Default: false */
|
|
16
|
+
defaultExpanded?: boolean;
|
|
17
|
+
/** Fires whenever the disclosure toggles, controlled or not. */
|
|
18
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
19
|
+
/** Prevents toggling. Default: false */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Additional className for the root. */
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=Accordion.types.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using Accordion, read its contract: node_modules/@helixds/react/dist/contracts/Accordion.json
|
|
4
|
+
* (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
|
|
5
|
+
* Guide: node_modules/@helixds/react/AGENTS.md
|
|
6
|
+
*/
|
|
7
|
+
export { Accordion } from './Accordion.js';
|
|
8
|
+
export type { AccordionProps } from './Accordion.types.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using Avatar, read its contract: node_modules/@helixds/react/dist/contracts/Avatar.json
|
|
4
|
+
* (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
|
|
5
|
+
* Guide: node_modules/@helixds/react/AGENTS.md
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import type { AvatarProps } from './Avatar.types.js';
|
|
9
|
+
declare const Avatar: {
|
|
10
|
+
({ label, src, size, className, "aria-describedby": ariaDescribedBy }: AvatarProps): React.JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export { Avatar };
|
|
14
|
+
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const doc = {
|
|
2
|
+
name: 'Avatar',
|
|
3
|
+
purpose: 'Represents a person or entity as a small circular image or initials indicator.',
|
|
4
|
+
contract: 'contracts/components/Avatar.json',
|
|
5
|
+
a11y: [
|
|
6
|
+
'label is required — it drives both the initials fallback and the accessible name.',
|
|
7
|
+
'Falls back to initials automatically if the image fails to load (broken URL, offline).',
|
|
8
|
+
],
|
|
9
|
+
variants: [],
|
|
10
|
+
sizes: ['s', 'm', 'l'],
|
|
11
|
+
tokens: [
|
|
12
|
+
{ part: 'avatar-root', label: 'height.s', token: '--helix-avatar-height-s', kind: 'space', size: 's' },
|
|
13
|
+
{ part: 'avatar-root', label: 'height.m', token: '--helix-avatar-height-m', kind: 'space', size: 'm' },
|
|
14
|
+
{ part: 'avatar-root', label: 'height.l', token: '--helix-avatar-height-l', kind: 'space', size: 'l' },
|
|
15
|
+
{ part: 'avatar-root', label: 'fill', token: '--helix-avatar-fill', kind: 'color' },
|
|
16
|
+
{ part: 'avatar-initials', label: 'text', token: '--helix-avatar-text', kind: 'color' },
|
|
17
|
+
{ part: 'avatar-initials', label: 'fontSize', token: '--helix-avatar-fontSize-s', kind: 'typography', meta: 'Caption / Semibold', size: 's' },
|
|
18
|
+
{ part: 'avatar-initials', label: 'fontWeight', token: '--helix-avatar-fontWeight-s', kind: 'typography', meta: 'Caption / Semibold', size: 's' },
|
|
19
|
+
{ part: 'avatar-initials', label: 'fontSize', token: '--helix-avatar-fontSize-m', kind: 'typography', meta: 'Caption / Semibold', size: 'm' },
|
|
20
|
+
{ part: 'avatar-initials', label: 'fontWeight', token: '--helix-avatar-fontWeight-m', kind: 'typography', meta: 'Caption / Semibold', size: 'm' },
|
|
21
|
+
{ part: 'avatar-initials', label: 'fontSize', token: '--helix-avatar-fontSize-l', kind: 'typography', meta: 'Body / m / Semibold', size: 'l' },
|
|
22
|
+
{ part: 'avatar-initials', label: 'fontWeight', token: '--helix-avatar-fontWeight-l', kind: 'typography', meta: 'Body / m / Semibold', size: 'l' },
|
|
23
|
+
],
|
|
24
|
+
features: [
|
|
25
|
+
'src — renders an image, falling back to initials on load error',
|
|
26
|
+
'label — always required, source of truth for initials and accessible name',
|
|
27
|
+
],
|
|
28
|
+
examples: [
|
|
29
|
+
{ label: 'Initials', code: `<Avatar label="Ana García" />` },
|
|
30
|
+
{ label: 'Image', code: `<Avatar label="Ana García" src="/ana.jpg" />` },
|
|
31
|
+
{ label: 'Current user', code: `<Avatar label="Marta Conde" />` },
|
|
32
|
+
],
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=Avatar.doc.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from '../../lib/utils.js';
|
|
4
|
+
function getInitials(label) {
|
|
5
|
+
return (label.trim()[0] ?? '').toUpperCase();
|
|
6
|
+
}
|
|
7
|
+
const Avatar = ({ label, src, size = 'm', className, 'aria-describedby': ariaDescribedBy }) => {
|
|
8
|
+
const [imageFailed, setImageFailed] = React.useState(false);
|
|
9
|
+
const showImage = !!src && !imageFailed;
|
|
10
|
+
return (_jsx("span", { "data-helix-part": "avatar-root", "data-size": size, "aria-describedby": ariaDescribedBy, className: cn(className), children: showImage ? (_jsx("img", { "data-helix-part": "avatar-image", src: src, alt: label, onError: () => setImageFailed(true) })) : (_jsx("span", { "data-helix-part": "avatar-initials", "aria-label": label, role: "img", children: getInitials(label) })) }));
|
|
11
|
+
};
|
|
12
|
+
Avatar.displayName = 'Avatar';
|
|
13
|
+
export { Avatar };
|
|
14
|
+
//# sourceMappingURL=Avatar.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using Avatar, read its contract: node_modules/@helixds/react/dist/contracts/Avatar.json
|
|
4
|
+
* (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
|
|
5
|
+
* Guide: node_modules/@helixds/react/AGENTS.md
|
|
6
|
+
*/
|
|
7
|
+
export type AvatarSize = 's' | 'm' | 'l';
|
|
8
|
+
export interface AvatarProps {
|
|
9
|
+
/** The person's full name — source for the initials fallback, and the accessible name (image alt / aria-label). */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Image URL. Falls back to initials when absent or on load error. */
|
|
12
|
+
src?: string;
|
|
13
|
+
/** Physical size. Shares the field scale with Input/Select (s=24, m=32, l=40). Default: 'm' */
|
|
14
|
+
size?: AvatarSize;
|
|
15
|
+
/** Additional className for the root. */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Forwarded to the root — set by Tooltip when Avatar is used as its trigger (e.g. inside AvatarGroup). */
|
|
18
|
+
'aria-describedby'?: string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=Avatar.types.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using Avatar, read its contract: node_modules/@helixds/react/dist/contracts/Avatar.json
|
|
4
|
+
* (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
|
|
5
|
+
* Guide: node_modules/@helixds/react/AGENTS.md
|
|
6
|
+
*/
|
|
7
|
+
export { Avatar } from './Avatar.js';
|
|
8
|
+
export type { AvatarProps, AvatarSize } from './Avatar.types.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using AvatarGroup, read its contract: node_modules/@helixds/react/dist/contracts/AvatarGroup.json
|
|
4
|
+
* (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
|
|
5
|
+
* Guide: node_modules/@helixds/react/AGENTS.md
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import type { AvatarGroupProps } from './AvatarGroup.types.js';
|
|
9
|
+
declare const AvatarGroup: {
|
|
10
|
+
({ avatars, max, size, className }: AvatarGroupProps): React.JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export { AvatarGroup };
|
|
14
|
+
//# sourceMappingURL=AvatarGroup.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const doc = {
|
|
2
|
+
name: 'AvatarGroup',
|
|
3
|
+
purpose: 'Shows several people or entities on the same record as a compact overlapping stack of Avatars, collapsing overflow into a +N count.',
|
|
4
|
+
contract: 'contracts/components/AvatarGroup.json',
|
|
5
|
+
a11y: [
|
|
6
|
+
'Root carries role="group" with an aria-label summarizing the count (e.g. "4 people") — individual avatars still expose their own name via Avatar\'s built-in accessible name.',
|
|
7
|
+
'Each avatar is wrapped in Tooltip, showing that person\'s name on hover (mouse only — avatars have no tabindex/focus behavior of their own).',
|
|
8
|
+
'The +N overflow indicator is wrapped in Tooltip too, listing the hidden names comma-separated.',
|
|
9
|
+
],
|
|
10
|
+
variants: [],
|
|
11
|
+
sizes: ['s', 'm', 'l'],
|
|
12
|
+
tokens: [
|
|
13
|
+
{ part: 'avatar-group-item', label: 'ring', token: '--helix-avatarGroup-ring', kind: 'color' },
|
|
14
|
+
{ part: 'avatar-group-item', label: 'border-width', token: '--helix-avatarGroup-border-width', kind: 'space' },
|
|
15
|
+
{ part: 'avatar-group-item', label: 'overlap', token: '--helix-avatarGroup-overlap', kind: 'space' },
|
|
16
|
+
{ part: 'avatar-group-overflow', label: 'fill', token: '--helix-avatarGroup-overflow-fill', kind: 'color' },
|
|
17
|
+
{ part: 'avatar-group-overflow', label: 'text', token: '--helix-avatarGroup-overflow-text', kind: 'color' },
|
|
18
|
+
],
|
|
19
|
+
features: [
|
|
20
|
+
'avatars — the people/entities to render, first entry stacks on top',
|
|
21
|
+
'max — caps how many avatars render before collapsing the rest into a +N indicator, always rendered last (rightmost, on top), in a neutral gray distinct from Avatar\'s own tinted fill',
|
|
22
|
+
'size — shared s/m/l scale, applied to every avatar and the overflow indicator',
|
|
23
|
+
],
|
|
24
|
+
examples: [
|
|
25
|
+
{ label: 'Basic', code: `<AvatarGroup avatars={[{ label: 'Ana García' }, { label: 'Marta Conde' }, { label: 'Luis Pérez' }]} />` },
|
|
26
|
+
{ label: 'With overflow', code: `<AvatarGroup avatars={people} max={3} />` },
|
|
27
|
+
{ label: 'Small', code: `<AvatarGroup avatars={people} size="s" />` },
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=AvatarGroup.doc.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from '../../lib/utils.js';
|
|
4
|
+
import { Avatar } from '../Avatar/index.js';
|
|
5
|
+
import { Tooltip } from '../Tooltip/index.js';
|
|
6
|
+
const AvatarGroup = ({ avatars, max, size = 'm', className }) => {
|
|
7
|
+
const displayed = typeof max === 'number' ? avatars.slice(0, max) : avatars;
|
|
8
|
+
const hidden = avatars.slice(displayed.length);
|
|
9
|
+
const overflowCount = hidden.length;
|
|
10
|
+
const stacked = [...displayed].reverse();
|
|
11
|
+
return (_jsxs("div", { "data-helix-part": "avatar-group-root", "data-size": size, role: "group", "aria-label": `${avatars.length} ${avatars.length === 1 ? 'person' : 'people'}`, className: cn(className), children: [stacked.map((avatar, index) => (_jsx("span", { "data-helix-part": "avatar-group-item", children: _jsx(Tooltip, { label: avatar.label, children: _jsx(Avatar, { label: avatar.label, ...(avatar.src ? { src: avatar.src } : {}), size: size }) }) }, `${index}-${avatar.label}`))), overflowCount > 0 && (_jsx("span", { "data-helix-part": "avatar-group-item", children: _jsx(Tooltip, { label: hidden.map(a => a.label).join('\n'), children: _jsxs("span", { "data-helix-part": "avatar-group-overflow", children: ["+", overflowCount] }) }) }))] }));
|
|
12
|
+
};
|
|
13
|
+
AvatarGroup.displayName = 'AvatarGroup';
|
|
14
|
+
export { AvatarGroup };
|
|
15
|
+
//# sourceMappingURL=AvatarGroup.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using AvatarGroup, read its contract: node_modules/@helixds/react/dist/contracts/AvatarGroup.json
|
|
4
|
+
* (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
|
|
5
|
+
* Guide: node_modules/@helixds/react/AGENTS.md
|
|
6
|
+
*/
|
|
7
|
+
export type AvatarGroupSize = 's' | 'm' | 'l';
|
|
8
|
+
export interface AvatarGroupProps {
|
|
9
|
+
/** 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`. */
|
|
10
|
+
avatars: {
|
|
11
|
+
label: string;
|
|
12
|
+
src?: string;
|
|
13
|
+
}[];
|
|
14
|
+
/** Maximum number of avatars to render before collapsing the rest into a '+N' overflow indicator. Unset shows every avatar. */
|
|
15
|
+
max?: number;
|
|
16
|
+
/** Physical size applied to every avatar and the overflow indicator. Shares Avatar's field scale (s=24, m=32, l=40). Default: 'm' */
|
|
17
|
+
size?: AvatarGroupSize;
|
|
18
|
+
/** Additional className for the root. */
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=AvatarGroup.types.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using AvatarGroup, read its contract: node_modules/@helixds/react/dist/contracts/AvatarGroup.json
|
|
4
|
+
* (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
|
|
5
|
+
* Guide: node_modules/@helixds/react/AGENTS.md
|
|
6
|
+
*/
|
|
7
|
+
export { AvatarGroup } from './AvatarGroup.js';
|
|
8
|
+
export type { AvatarGroupProps, AvatarGroupSize } from './AvatarGroup.types.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|