@helixds/react 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +292 -0
- package/LICENSE +21 -0
- package/README.md +49 -2
- package/dist/components/Accordion/Accordion.d.ts +14 -0
- package/dist/components/Accordion/Accordion.doc.d.ts +4 -0
- package/dist/components/Accordion/Accordion.doc.js +27 -0
- package/dist/components/Accordion/Accordion.js +76 -0
- package/dist/components/Accordion/Accordion.types.d.ts +24 -0
- package/dist/components/Accordion/Accordion.types.js +2 -0
- package/dist/components/Accordion/index.d.ts +9 -0
- package/dist/components/Accordion/index.js +2 -0
- package/dist/components/Avatar/Avatar.d.ts +14 -0
- package/dist/components/Avatar/Avatar.doc.d.ts +4 -0
- package/dist/components/Avatar/Avatar.doc.js +34 -0
- package/dist/components/Avatar/Avatar.js +14 -0
- package/dist/components/Avatar/Avatar.types.d.ts +20 -0
- package/dist/components/Avatar/Avatar.types.js +2 -0
- package/dist/components/Avatar/index.d.ts +9 -0
- package/dist/components/Avatar/index.js +2 -0
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +14 -0
- package/dist/components/AvatarGroup/AvatarGroup.doc.d.ts +4 -0
- package/dist/components/AvatarGroup/AvatarGroup.doc.js +30 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +15 -0
- package/dist/components/AvatarGroup/AvatarGroup.types.d.ts +21 -0
- package/dist/components/AvatarGroup/AvatarGroup.types.js +2 -0
- package/dist/components/AvatarGroup/index.d.ts +9 -0
- package/dist/components/AvatarGroup/index.js +2 -0
- package/dist/components/Badge/Badge.d.ts +16 -0
- package/dist/components/Badge/Badge.doc.d.ts +4 -0
- package/dist/components/Badge/Badge.doc.js +69 -0
- package/dist/components/Badge/Badge.js +23 -0
- package/dist/components/Badge/Badge.types.d.ts +22 -0
- package/dist/components/Badge/Badge.types.js +2 -0
- package/dist/components/Badge/index.d.ts +9 -0
- package/dist/components/Badge/index.js +2 -0
- package/dist/components/Button/Button.d.ts +11 -0
- package/dist/components/Button/Button.doc.d.ts +4 -0
- package/dist/components/Button/Button.doc.js +98 -0
- package/dist/components/Button/Button.js +80 -0
- package/dist/components/Button/Button.types.d.ts +29 -0
- package/dist/components/Button/Button.types.js +2 -0
- package/dist/components/Button/index.d.ts +9 -0
- package/dist/components/Button/index.js +2 -0
- package/dist/components/Card/Card.d.ts +14 -0
- package/dist/components/Card/Card.doc.d.ts +4 -0
- package/dist/components/Card/Card.doc.js +44 -0
- package/dist/components/Card/Card.js +9 -0
- package/dist/components/Card/Card.types.d.ts +19 -0
- package/dist/components/Card/Card.types.js +2 -0
- package/dist/components/Card/index.d.ts +9 -0
- package/dist/components/Card/index.js +2 -0
- package/dist/components/Chart/Chart.d.ts +14 -0
- package/dist/components/Chart/Chart.doc.d.ts +4 -0
- package/dist/components/Chart/Chart.doc.js +49 -0
- package/dist/components/Chart/Chart.js +184 -0
- package/dist/components/Chart/Chart.types.d.ts +21 -0
- package/dist/components/Chart/Chart.types.js +2 -0
- package/dist/components/Chart/index.d.ts +9 -0
- package/dist/components/Chart/index.js +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +12 -0
- package/dist/components/Checkbox/Checkbox.doc.d.ts +4 -0
- package/dist/components/Checkbox/Checkbox.doc.js +54 -0
- package/dist/components/Checkbox/Checkbox.js +23 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +22 -0
- package/dist/components/Checkbox/Checkbox.types.js +2 -0
- package/dist/components/Checkbox/index.d.ts +9 -0
- package/dist/components/Checkbox/index.js +2 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +13 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.doc.d.ts +4 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.doc.js +56 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.js +27 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.types.d.ts +28 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.types.js +2 -0
- package/dist/components/CheckboxGroup/index.d.ts +9 -0
- package/dist/components/CheckboxGroup/index.js +2 -0
- package/dist/components/Chip/Chip.d.ts +11 -0
- package/dist/components/Chip/Chip.doc.d.ts +4 -0
- package/dist/components/Chip/Chip.doc.js +105 -0
- package/dist/components/Chip/Chip.js +30 -0
- package/dist/components/Chip/Chip.types.d.ts +31 -0
- package/dist/components/Chip/Chip.types.js +2 -0
- package/dist/components/Chip/index.d.ts +9 -0
- package/dist/components/Chip/index.js +2 -0
- package/dist/components/ChipGroup/ChipGroup.d.ts +12 -0
- package/dist/components/ChipGroup/ChipGroup.doc.d.ts +4 -0
- package/dist/components/ChipGroup/ChipGroup.doc.js +31 -0
- package/dist/components/ChipGroup/ChipGroup.js +9 -0
- package/dist/components/ChipGroup/ChipGroup.types.d.ts +27 -0
- package/dist/components/ChipGroup/ChipGroup.types.js +2 -0
- package/dist/components/ChipGroup/index.d.ts +9 -0
- package/dist/components/ChipGroup/index.js +2 -0
- package/dist/components/FAB/FAB.d.ts +11 -0
- package/dist/components/FAB/FAB.doc.d.ts +4 -0
- package/dist/components/FAB/FAB.doc.js +52 -0
- package/dist/components/FAB/FAB.js +133 -0
- package/dist/components/FAB/FAB.types.d.ts +37 -0
- package/dist/components/FAB/FAB.types.js +2 -0
- package/dist/components/FAB/index.d.ts +9 -0
- package/dist/components/FAB/index.js +2 -0
- package/dist/components/Icon/Icon.d.ts +14 -0
- package/dist/components/Icon/Icon.doc.d.ts +4 -0
- package/dist/components/Icon/Icon.doc.js +38 -0
- package/dist/components/Icon/Icon.js +15 -0
- package/dist/components/Icon/Icon.types.d.ts +47 -0
- package/dist/components/Icon/Icon.types.js +2 -0
- package/dist/components/Icon/createIconAdapter.d.ts +24 -0
- package/dist/components/Icon/createIconAdapter.js +28 -0
- package/dist/components/Icon/iconStroke.d.ts +20 -0
- package/dist/components/Icon/iconStroke.js +54 -0
- package/dist/components/Icon/index.d.ts +12 -0
- package/dist/components/Icon/index.js +4 -0
- package/dist/components/IconButton/IconButton.d.ts +11 -0
- package/dist/components/IconButton/IconButton.doc.d.ts +4 -0
- package/dist/components/IconButton/IconButton.doc.js +76 -0
- package/dist/components/IconButton/IconButton.js +20 -0
- package/dist/components/IconButton/IconButton.types.d.ts +25 -0
- package/dist/components/IconButton/IconButton.types.js +2 -0
- package/dist/components/IconButton/index.d.ts +9 -0
- package/dist/components/IconButton/index.js +2 -0
- package/dist/components/Input/Input.d.ts +11 -0
- package/dist/components/Input/Input.doc.d.ts +4 -0
- package/dist/components/Input/Input.doc.js +68 -0
- package/dist/components/Input/Input.js +48 -0
- package/dist/components/Input/Input.types.d.ts +36 -0
- package/dist/components/Input/Input.types.js +2 -0
- package/dist/components/Input/index.d.ts +9 -0
- package/dist/components/Input/index.js +2 -0
- package/dist/components/Menu/Menu.d.ts +14 -0
- package/dist/components/Menu/Menu.doc.d.ts +4 -0
- package/dist/components/Menu/Menu.doc.js +46 -0
- package/dist/components/Menu/Menu.js +105 -0
- package/dist/components/Menu/Menu.types.d.ts +34 -0
- package/dist/components/Menu/Menu.types.js +2 -0
- package/dist/components/Menu/index.d.ts +9 -0
- package/dist/components/Menu/index.js +2 -0
- package/dist/components/Modal/Modal.d.ts +14 -0
- package/dist/components/Modal/Modal.doc.d.ts +4 -0
- package/dist/components/Modal/Modal.doc.js +52 -0
- package/dist/components/Modal/Modal.js +30 -0
- package/dist/components/Modal/Modal.types.d.ts +36 -0
- package/dist/components/Modal/Modal.types.js +2 -0
- package/dist/components/Modal/index.d.ts +9 -0
- package/dist/components/Modal/index.js +2 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +17 -0
- package/dist/components/MultiSelect/MultiSelect.doc.d.ts +4 -0
- package/dist/components/MultiSelect/MultiSelect.doc.js +37 -0
- package/dist/components/MultiSelect/MultiSelect.js +165 -0
- package/dist/components/MultiSelect/MultiSelect.types.d.ts +50 -0
- package/dist/components/MultiSelect/MultiSelect.types.js +2 -0
- package/dist/components/MultiSelect/index.d.ts +9 -0
- package/dist/components/MultiSelect/index.js +2 -0
- package/dist/components/NavItem/NavItem.d.ts +14 -0
- package/dist/components/NavItem/NavItem.doc.d.ts +4 -0
- package/dist/components/NavItem/NavItem.doc.js +31 -0
- package/dist/components/NavItem/NavItem.js +21 -0
- package/dist/components/NavItem/NavItem.types.d.ts +20 -0
- package/dist/components/NavItem/NavItem.types.js +2 -0
- package/dist/components/NavItem/index.d.ts +9 -0
- package/dist/components/NavItem/index.js +2 -0
- package/dist/components/RadioButton/RadioButton.d.ts +14 -0
- package/dist/components/RadioButton/RadioButton.doc.d.ts +4 -0
- package/dist/components/RadioButton/RadioButton.doc.js +35 -0
- package/dist/components/RadioButton/RadioButton.js +15 -0
- package/dist/components/RadioButton/RadioButton.types.d.ts +33 -0
- package/dist/components/RadioButton/RadioButton.types.js +2 -0
- package/dist/components/RadioButton/index.d.ts +9 -0
- package/dist/components/RadioButton/index.js +2 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +12 -0
- package/dist/components/RadioGroup/RadioGroup.doc.d.ts +4 -0
- package/dist/components/RadioGroup/RadioGroup.doc.js +80 -0
- package/dist/components/RadioGroup/RadioGroup.js +19 -0
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +28 -0
- package/dist/components/RadioGroup/RadioGroup.types.js +2 -0
- package/dist/components/RadioGroup/index.d.ts +9 -0
- package/dist/components/RadioGroup/index.js +2 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +13 -0
- package/dist/components/SegmentedControl/SegmentedControl.doc.d.ts +4 -0
- package/dist/components/SegmentedControl/SegmentedControl.doc.js +50 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +64 -0
- package/dist/components/SegmentedControl/SegmentedControl.types.d.ts +26 -0
- package/dist/components/SegmentedControl/SegmentedControl.types.js +2 -0
- package/dist/components/SegmentedControl/index.d.ts +9 -0
- package/dist/components/SegmentedControl/index.js +2 -0
- package/dist/components/Select/Select.d.ts +13 -0
- package/dist/components/Select/Select.doc.d.ts +4 -0
- package/dist/components/Select/Select.doc.js +66 -0
- package/dist/components/Select/Select.js +138 -0
- package/dist/components/Select/Select.types.d.ts +36 -0
- package/dist/components/Select/Select.types.js +2 -0
- package/dist/components/Select/index.d.ts +9 -0
- package/dist/components/Select/index.js +2 -0
- package/dist/components/SidePanel/SidePanel.d.ts +14 -0
- package/dist/components/SidePanel/SidePanel.doc.d.ts +4 -0
- package/dist/components/SidePanel/SidePanel.doc.js +29 -0
- package/dist/components/SidePanel/SidePanel.js +19 -0
- package/dist/components/SidePanel/SidePanel.types.d.ts +28 -0
- package/dist/components/SidePanel/SidePanel.types.js +2 -0
- package/dist/components/SidePanel/index.d.ts +9 -0
- package/dist/components/SidePanel/index.js +2 -0
- package/dist/components/Switch/Switch.d.ts +13 -0
- package/dist/components/Switch/Switch.doc.d.ts +4 -0
- package/dist/components/Switch/Switch.doc.js +56 -0
- package/dist/components/Switch/Switch.js +45 -0
- package/dist/components/Switch/Switch.types.d.ts +21 -0
- package/dist/components/Switch/Switch.types.js +2 -0
- package/dist/components/Switch/index.d.ts +9 -0
- package/dist/components/Switch/index.js +2 -0
- package/dist/components/Table/Table.d.ts +34 -0
- package/dist/components/Table/Table.doc.d.ts +4 -0
- package/dist/components/Table/Table.doc.js +48 -0
- package/dist/components/Table/Table.js +17 -0
- package/dist/components/Table/Table.types.d.ts +30 -0
- package/dist/components/Table/Table.types.js +2 -0
- package/dist/components/Table/index.d.ts +9 -0
- package/dist/components/Table/index.js +2 -0
- package/dist/components/Textarea/Textarea.d.ts +9 -0
- package/dist/components/Textarea/Textarea.doc.d.ts +4 -0
- package/dist/components/Textarea/Textarea.doc.js +60 -0
- package/dist/components/Textarea/Textarea.js +24 -0
- package/dist/components/Textarea/Textarea.types.d.ts +22 -0
- package/dist/components/Textarea/Textarea.types.js +2 -0
- package/dist/components/Textarea/index.d.ts +9 -0
- package/dist/components/Textarea/index.js +2 -0
- package/dist/components/Toast/Toast.d.ts +16 -0
- package/dist/components/Toast/Toast.doc.d.ts +4 -0
- package/dist/components/Toast/Toast.doc.js +37 -0
- package/dist/components/Toast/Toast.js +134 -0
- package/dist/components/Toast/Toast.types.d.ts +11 -0
- package/dist/components/Toast/Toast.types.js +2 -0
- package/dist/components/Toast/index.d.ts +10 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/components/Toast/toastStore.d.ts +36 -0
- package/dist/components/Toast/toastStore.js +57 -0
- package/dist/components/Tooltip/Tooltip.d.ts +14 -0
- package/dist/components/Tooltip/Tooltip.doc.d.ts +4 -0
- package/dist/components/Tooltip/Tooltip.doc.js +33 -0
- package/dist/components/Tooltip/Tooltip.js +105 -0
- package/dist/components/Tooltip/Tooltip.types.d.ts +21 -0
- package/dist/components/Tooltip/Tooltip.types.js +2 -0
- package/dist/components/Tooltip/index.d.ts +9 -0
- package/dist/components/Tooltip/index.js +2 -0
- package/dist/contracts/Accordion.json +174 -0
- package/dist/contracts/AppShell.json +118 -0
- package/dist/contracts/Avatar.json +157 -0
- package/dist/contracts/AvatarGroup.json +169 -0
- package/dist/contracts/Badge.json +212 -0
- package/dist/contracts/Button.json +295 -0
- package/dist/contracts/Card.json +125 -0
- package/dist/contracts/Chart.json +167 -0
- package/dist/contracts/Checkbox.json +333 -0
- package/dist/contracts/CheckboxGroup.json +200 -0
- package/dist/contracts/Chip.json +320 -0
- package/dist/contracts/ChipGroup.json +182 -0
- package/dist/contracts/FAB.json +215 -0
- package/dist/contracts/Icon.json +306 -0
- package/dist/contracts/IconButton.json +213 -0
- package/dist/contracts/Input.json +400 -0
- package/dist/contracts/Menu.json +197 -0
- package/dist/contracts/Modal.json +192 -0
- package/dist/contracts/MultiSelect.json +244 -0
- package/dist/contracts/NavItem.json +148 -0
- package/dist/contracts/PageHeader.json +134 -0
- package/dist/contracts/RadioButton.json +202 -0
- package/dist/contracts/RadioGroup.json +228 -0
- package/dist/contracts/SegmentedControl.json +193 -0
- package/dist/contracts/Select.json +241 -0
- package/dist/contracts/SideNav.json +138 -0
- package/dist/contracts/SidePanel.json +153 -0
- package/dist/contracts/Switch.json +201 -0
- package/dist/contracts/Table.json +130 -0
- package/dist/contracts/Textarea.json +353 -0
- package/dist/contracts/Toast.json +186 -0
- package/dist/contracts/Tooltip.json +168 -0
- package/dist/contracts/TopBar.json +127 -0
- package/dist/contracts/manifest.json +675 -0
- package/dist/index.d.ts +109 -0
- package/dist/index.js +73 -0
- package/dist/layout/AppShell/AppShell.d.ts +14 -0
- package/dist/layout/AppShell/AppShell.doc.d.ts +4 -0
- package/dist/layout/AppShell/AppShell.doc.js +27 -0
- package/dist/layout/AppShell/AppShell.js +9 -0
- package/dist/layout/AppShell/AppShell.types.d.ts +18 -0
- package/dist/layout/AppShell/AppShell.types.js +2 -0
- package/dist/layout/AppShell/index.d.ts +9 -0
- package/dist/layout/AppShell/index.js +2 -0
- package/dist/layout/PageHeader/PageHeader.d.ts +14 -0
- package/dist/layout/PageHeader/PageHeader.doc.d.ts +4 -0
- package/dist/layout/PageHeader/PageHeader.doc.js +30 -0
- package/dist/layout/PageHeader/PageHeader.js +10 -0
- package/dist/layout/PageHeader/PageHeader.types.d.ts +21 -0
- package/dist/layout/PageHeader/PageHeader.types.js +2 -0
- package/dist/layout/PageHeader/index.d.ts +9 -0
- package/dist/layout/PageHeader/index.js +2 -0
- package/dist/layout/SideNav/SideNav.d.ts +14 -0
- package/dist/layout/SideNav/SideNav.doc.d.ts +4 -0
- package/dist/layout/SideNav/SideNav.doc.js +32 -0
- package/dist/layout/SideNav/SideNav.js +9 -0
- package/dist/layout/SideNav/SideNav.types.d.ts +18 -0
- package/dist/layout/SideNav/SideNav.types.js +2 -0
- package/dist/layout/SideNav/index.d.ts +9 -0
- package/dist/layout/SideNav/index.js +2 -0
- package/dist/layout/TopBar/TopBar.d.ts +14 -0
- package/dist/layout/TopBar/TopBar.doc.d.ts +4 -0
- package/dist/layout/TopBar/TopBar.doc.js +28 -0
- package/dist/layout/TopBar/TopBar.js +9 -0
- package/dist/layout/TopBar/TopBar.types.d.ts +16 -0
- package/dist/layout/TopBar/TopBar.types.js +2 -0
- package/dist/layout/TopBar/index.d.ts +9 -0
- package/dist/layout/TopBar/index.js +2 -0
- package/dist/lib/component-doc.d.ts +34 -0
- package/dist/lib/component-doc.js +2 -0
- package/dist/lib/motionPresets.d.ts +37 -0
- package/dist/lib/motionPresets.js +35 -0
- package/dist/lib/resolveTokenPx.d.ts +11 -0
- package/dist/lib/resolveTokenPx.js +17 -0
- package/dist/lib/useDialogTransition.d.ts +21 -0
- package/dist/lib/useDialogTransition.js +86 -0
- package/dist/lib/useDisclosureTransition.d.ts +19 -0
- package/dist/lib/useDisclosureTransition.js +41 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.js +6 -0
- package/dist/patterns/action-bar.md +127 -0
- package/dist/patterns/border-always.md +40 -0
- package/dist/patterns/data-analytics.md +15 -0
- package/dist/patterns/disabled-state.md +80 -0
- package/dist/patterns/empty-state.md +130 -0
- package/dist/patterns/expand-collapse-chevron.md +101 -0
- package/dist/patterns/form-field-group.md +139 -0
- package/dist/patterns/form-field-spacing.md +99 -0
- package/dist/patterns/group-spacing.md +54 -0
- package/dist/patterns/motion-effects.md +100 -0
- package/dist/patterns/same-row-sizing.md +52 -0
- package/dist/patterns/search-filter.md +118 -0
- package/dist/patterns/show-hide-parts.md +53 -0
- package/dist/patterns/stat-card.md +105 -0
- package/dist/patterns/status-row.md +130 -0
- package/dist/patterns/view-toggle.md +81 -0
- package/dist/prop-map.md +80 -0
- package/package.json +70 -3
- package/src/globals.css +3195 -0
|
@@ -0,0 +1,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
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using Badge, read its contract: node_modules/@helixds/react/dist/contracts/Badge.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 { HelixIconComponent } from '../Icon/index.js';
|
|
9
|
+
import type { BadgeProps, BadgeVariant } from './Badge.types.js';
|
|
10
|
+
export declare const BADGE_ICON_BY_VARIANT: Record<BadgeVariant, HelixIconComponent>;
|
|
11
|
+
declare const Badge: {
|
|
12
|
+
({ variant, size, label, icon, className }: BadgeProps): React.JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export { Badge };
|
|
16
|
+
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export const doc = {
|
|
2
|
+
name: 'Badge',
|
|
3
|
+
purpose: 'Communicates status, category labels, or counts in a compact capsule.',
|
|
4
|
+
contract: 'contracts/components/Badge.json',
|
|
5
|
+
a11y: [
|
|
6
|
+
'Keep the label meaningful; never rely on color alone to communicate status.',
|
|
7
|
+
'If an icon is present, treat it as decorative and keep the text readable on its own.',
|
|
8
|
+
],
|
|
9
|
+
variants: [
|
|
10
|
+
{ name: 'neutral', description: 'Default neutral badge for generic labels and counts.' },
|
|
11
|
+
{ name: 'info', description: 'Blue semantic badge for informational categories.' },
|
|
12
|
+
{ name: 'success', description: 'Green semantic badge for positive or active states.' },
|
|
13
|
+
{ name: 'warning', description: 'Orange semantic badge for caution or pending states.' },
|
|
14
|
+
{ name: 'danger', description: 'Red semantic badge for destructive or error-related states.' },
|
|
15
|
+
],
|
|
16
|
+
sizes: ['xs', 's'],
|
|
17
|
+
tokens: [
|
|
18
|
+
{ part: 'badge', label: 'fill.neutral', token: '--helix-badge-fill-neutral', kind: 'color', variant: 'neutral' },
|
|
19
|
+
{ part: 'badge', label: 'fill.info', token: '--helix-badge-fill-info', kind: 'color', variant: 'info' },
|
|
20
|
+
{ part: 'badge', label: 'fill.success', token: '--helix-badge-fill-success', kind: 'color', variant: 'success' },
|
|
21
|
+
{ part: 'badge', label: 'fill.warning', token: '--helix-badge-fill-warning', kind: 'color', variant: 'warning' },
|
|
22
|
+
{ part: 'badge', label: 'fill.danger', token: '--helix-badge-fill-danger', kind: 'color', variant: 'danger' },
|
|
23
|
+
{ part: 'badge', label: 'text.neutral', token: '--helix-badge-text-neutral', kind: 'color', variant: 'neutral' },
|
|
24
|
+
{ part: 'badge', label: 'text.info', token: '--helix-badge-text-info', kind: 'color', variant: 'info' },
|
|
25
|
+
{ part: 'badge', label: 'text.success', token: '--helix-badge-text-success', kind: 'color', variant: 'success' },
|
|
26
|
+
{ part: 'badge', label: 'text.warning', token: '--helix-badge-text-warning', kind: 'color', variant: 'warning' },
|
|
27
|
+
{ part: 'badge', label: 'text.danger', token: '--helix-badge-text-danger', kind: 'color', variant: 'danger' },
|
|
28
|
+
{ part: 'badge', label: 'border.neutral', token: '--helix-badge-border-neutral', kind: 'color', variant: 'neutral' },
|
|
29
|
+
{ part: 'badge', label: 'border.info', token: '--helix-badge-border-info', kind: 'color', variant: 'info' },
|
|
30
|
+
{ part: 'badge', label: 'border.success', token: '--helix-badge-border-success', kind: 'color', variant: 'success' },
|
|
31
|
+
{ part: 'badge', label: 'border.warning', token: '--helix-badge-border-warning', kind: 'color', variant: 'warning' },
|
|
32
|
+
{ part: 'badge', label: 'border.danger', token: '--helix-badge-border-danger', kind: 'color', variant: 'danger' },
|
|
33
|
+
{ part: 'badge', label: 'badge.root', token: '--helix-badge-radius', kind: 'radius' },
|
|
34
|
+
{ part: 'badge', label: 'gap.icon.text', token: '--helix-primitive-spacing-25', kind: 'space', axis: 'horizontal' },
|
|
35
|
+
{ part: 'badge', label: 'fontFamily', token: '--helix-badge-fontFamily', kind: 'typography', meta: 'Caption / Semibold' },
|
|
36
|
+
{ part: 'badge', label: 'fontSize', token: '--helix-badge-fontSize', kind: 'typography', meta: 'Caption / Semibold' },
|
|
37
|
+
{ part: 'badge', label: 'fontWeight', token: '--helix-badge-fontWeight', kind: 'typography', meta: 'Caption / Semibold' },
|
|
38
|
+
{ part: 'badge', label: 'lineHeight', token: '--helix-badge-lineHeight', kind: 'typography', meta: 'Caption / Semibold' },
|
|
39
|
+
{ part: 'badge', label: 'badge.height', token: '--helix-badge-height-xs', kind: 'space', size: 'xs' },
|
|
40
|
+
{ part: 'badge', label: 'badge.height', token: '--helix-badge-height-s', kind: 'space', size: 's' },
|
|
41
|
+
{ part: 'badge', label: 'padding.top', value: '2px', kind: 'space', axis: 'vertical', size: 'xs', meta: 'No token — literal per-size density value' },
|
|
42
|
+
{ part: 'badge', label: 'padding.bottom', value: '2px', kind: 'space', axis: 'vertical', size: 'xs', meta: 'No token — literal per-size density value' },
|
|
43
|
+
{ part: 'badge', label: 'padding.start', value: '6px', kind: 'space', axis: 'horizontal', size: 'xs', meta: 'No token — literal per-size density value' },
|
|
44
|
+
{ part: 'badge', label: 'padding.end', value: '6px', kind: 'space', axis: 'horizontal', size: 'xs', meta: 'No token — literal per-size density value' },
|
|
45
|
+
{ part: 'badge', label: 'padding.top', value: '3px', kind: 'space', axis: 'vertical', size: 's', meta: 'No token — literal per-size density value' },
|
|
46
|
+
{ part: 'badge', label: 'padding.bottom', value: '3px', kind: 'space', axis: 'vertical', size: 's', meta: 'No token — literal per-size density value' },
|
|
47
|
+
{ part: 'badge', label: 'padding.start', value: '10px', kind: 'space', axis: 'horizontal', size: 's', meta: 'No token — literal per-size density value' },
|
|
48
|
+
{ part: 'badge', label: 'padding.end', value: '10px', kind: 'space', axis: 'horizontal', size: 's', meta: 'No token — literal per-size density value' },
|
|
49
|
+
{ part: 'badge', label: 'display', value: 'inline-flex' },
|
|
50
|
+
{ part: 'badge', label: 'align-items', value: 'center' },
|
|
51
|
+
{ part: 'badge', label: 'box-sizing', value: 'border-box' },
|
|
52
|
+
{ part: 'badge', label: 'white-space', value: 'nowrap' },
|
|
53
|
+
{ part: 'badge', label: 'line-height', value: '1' },
|
|
54
|
+
{ part: 'badge', label: 'border', value: '1px solid transparent' },
|
|
55
|
+
{ part: 'badge', label: 'display.icon', value: 'flex' },
|
|
56
|
+
],
|
|
57
|
+
features: [
|
|
58
|
+
'size — horizontal density preset (documented exception to the global scale)',
|
|
59
|
+
'icon — optional leading 12px icon, fully opt-in (nothing renders unless a caller passes one)',
|
|
60
|
+
'BADGE_ICON_BY_VARIANT — canonical icon shape per variant (info-circle / circle-check / alert-triangle / alert-hexagon, Outline build), matching Toast\'s own icon shapes one-for-one (Toast uses the Filled build of the same four). A convenience mapping, not an automatic default — pass it explicitly when you want the matching shape.',
|
|
61
|
+
],
|
|
62
|
+
examples: [
|
|
63
|
+
{ label: 'Default', code: `<Badge label="Draft" />` },
|
|
64
|
+
{ label: 'XS', code: `<Badge size="xs" label="Draft" />` },
|
|
65
|
+
{ label: 'With icon', code: `<Badge icon={IconClock} label="Queued" />` },
|
|
66
|
+
{ label: 'With the canonical variant icon', code: `<Badge variant="danger" icon={BADGE_ICON_BY_VARIANT.danger} label="Failed" />` },
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=Badge.doc.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { IconInfoCircle, IconCircleCheck, IconAlertTriangle, IconAlertHexagon, } from '@tabler/icons-react';
|
|
4
|
+
import { cn } from '../../lib/utils.js';
|
|
5
|
+
import { Icon } from '../Icon/index.js';
|
|
6
|
+
// The canonical icon shape per variant, matching Toast's own ICON_BY_VARIANT one-for-one — same
|
|
7
|
+
// shape family (info-circle / circle-check / alert-triangle / alert-hexagon), Outline build instead
|
|
8
|
+
// of Toast's Filled build. Badge's `icon` prop stays fully opt-in (nothing renders unless a caller
|
|
9
|
+
// passes one) — this is a convenience mapping for callers who want the matching shape, not an
|
|
10
|
+
// automatic default, so no existing Badge usage changes visually just by this existing.
|
|
11
|
+
export const BADGE_ICON_BY_VARIANT = {
|
|
12
|
+
neutral: IconInfoCircle,
|
|
13
|
+
info: IconInfoCircle,
|
|
14
|
+
success: IconCircleCheck,
|
|
15
|
+
warning: IconAlertTriangle,
|
|
16
|
+
danger: IconAlertHexagon,
|
|
17
|
+
};
|
|
18
|
+
const Badge = ({ variant = 'neutral', size = 's', label, icon, className }) => {
|
|
19
|
+
return (_jsx("span", { "data-helix-part": "badge", "data-variant": variant, "data-size": size, className: cn(className), children: _jsxs("span", { "data-helix-part": "badge-content", children: [icon && (_jsx("span", { "data-helix-part": "badge-icon", children: _jsx(Icon, { icon: icon, size: 12 }) })), _jsx("span", { "data-helix-part": "badge-label", children: label })] }) }));
|
|
20
|
+
};
|
|
21
|
+
Badge.displayName = 'Badge';
|
|
22
|
+
export { Badge };
|
|
23
|
+
//# sourceMappingURL=Badge.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using Badge, read its contract: node_modules/@helixds/react/dist/contracts/Badge.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 { HelixIconComponent } from '../Icon/index.js';
|
|
8
|
+
export type BadgeVariant = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
9
|
+
export type BadgeSize = 'xs' | 's';
|
|
10
|
+
export interface BadgeProps {
|
|
11
|
+
/** Semantic color variant. Default: 'neutral' */
|
|
12
|
+
variant?: BadgeVariant;
|
|
13
|
+
/** Visual size. Default: 's' */
|
|
14
|
+
size?: BadgeSize;
|
|
15
|
+
/** Text content — required. Max 24 characters recommended. */
|
|
16
|
+
label: string;
|
|
17
|
+
/** Leading icon — a Tabler icon component, passed by reference (e.g. IconClock). Always rendered at size=12 (stroke follows the ADR-017 rule via Icon). */
|
|
18
|
+
icon?: HelixIconComponent;
|
|
19
|
+
/** Additional className for container. */
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=Badge.types.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using Badge, read its contract: node_modules/@helixds/react/dist/contracts/Badge.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 { Badge, BADGE_ICON_BY_VARIANT } from './Badge.js';
|
|
8
|
+
export type { BadgeProps, BadgeVariant, BadgeSize } from './Badge.types.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using Button, read its contract: node_modules/@helixds/react/dist/contracts/Button.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 { ButtonProps } from './Button.types.js';
|
|
9
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export { Button };
|
|
11
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export const doc = {
|
|
2
|
+
name: 'Button',
|
|
3
|
+
purpose: 'Triggers an action or navigates to a destination when pressed.',
|
|
4
|
+
contract: 'contracts/components/Button.json',
|
|
5
|
+
a11y: [
|
|
6
|
+
'Use `onClick` for actions. For navigation, use a real `<a>` styled separately — Button always renders a `<button>`.',
|
|
7
|
+
'Keep the label descriptive; icon-only buttons need an accessible name.',
|
|
8
|
+
],
|
|
9
|
+
variants: [
|
|
10
|
+
{ name: 'primary', description: 'Filled brand background. Use for the main CTA in a view.' },
|
|
11
|
+
{ name: 'secondary', description: 'Outlined, neutral. Use for secondary actions alongside a primary.' },
|
|
12
|
+
{ name: 'ghost', description: 'No background or border. Use inside toolbars and dense UI.' },
|
|
13
|
+
{ name: 'danger', description: 'Filled red. Use only for irreversible destructive actions.' },
|
|
14
|
+
],
|
|
15
|
+
sizes: ['s', 'm', 'l'],
|
|
16
|
+
tokens: [
|
|
17
|
+
{ part: 'button', label: 'fill.primary', token: '--helix-button-fill-primary-default', kind: 'color', variant: 'primary' },
|
|
18
|
+
{ part: 'button', label: 'fill.primary', token: '--helix-button-fill-primary-hover', kind: 'color', variant: 'primary', state: 'hover' },
|
|
19
|
+
{ part: 'button', label: 'fill.primary', token: '--helix-button-fill-primary-press', kind: 'color', variant: 'primary', state: 'press' },
|
|
20
|
+
{ part: 'button', label: 'fill.secondary', token: '--helix-button-fill-secondary-default', kind: 'color', variant: 'secondary' },
|
|
21
|
+
{ part: 'button', label: 'fill.secondary', token: '--helix-button-fill-secondary-hover', kind: 'color', variant: 'secondary', state: 'hover' },
|
|
22
|
+
{ part: 'button', label: 'fill.secondary', token: '--helix-button-fill-secondary-press', kind: 'color', variant: 'secondary', state: 'press' },
|
|
23
|
+
{ part: 'button', label: 'border.secondary', token: '--helix-button-border-secondary-default', kind: 'color', variant: 'secondary' },
|
|
24
|
+
{ part: 'button', label: 'border.secondary', token: '--helix-button-border-secondary-hover', kind: 'color', variant: 'secondary', state: 'hover' },
|
|
25
|
+
{ part: 'button', label: 'fill.ghost', token: '--helix-button-fill-ghost-hover', kind: 'color', variant: 'ghost', state: 'hover' },
|
|
26
|
+
{ part: 'button', label: 'fill.ghost', token: '--helix-button-fill-ghost-press', kind: 'color', variant: 'ghost', state: 'press' },
|
|
27
|
+
{ part: 'button', label: 'fill.danger', token: '--helix-button-fill-danger-default', kind: 'color', variant: 'danger' },
|
|
28
|
+
{ part: 'button', label: 'fill.danger', token: '--helix-button-fill-danger-hover', kind: 'color', variant: 'danger', state: 'hover' },
|
|
29
|
+
{ part: 'button', label: 'fill.danger', token: '--helix-button-fill-danger-press', kind: 'color', variant: 'danger', state: 'press' },
|
|
30
|
+
{ part: 'button', label: 'border.focus', token: '--helix-button-border-focus', kind: 'color' },
|
|
31
|
+
{ part: 'button', label: 'button.root', token: '--helix-button-radius', kind: 'radius' },
|
|
32
|
+
{ part: 'button', label: 'gap.icon.text', token: '--helix-primitive-spacing-50', kind: 'space', axis: 'horizontal' },
|
|
33
|
+
{ part: 'button', label: 'padding.top', value: '0', kind: 'space', axis: 'vertical' },
|
|
34
|
+
{ part: 'button', label: 'padding.bottom', value: '0', kind: 'space', axis: 'vertical' },
|
|
35
|
+
{ part: 'button', label: 'padding.start', token: '--helix-button-padding-x-s', kind: 'space', axis: 'horizontal', size: 's' },
|
|
36
|
+
{ part: 'button', label: 'padding.end', token: '--helix-button-padding-x-s', kind: 'space', axis: 'horizontal', size: 's' },
|
|
37
|
+
{ part: 'button', label: 'padding.start', token: '--helix-button-padding-x-m', kind: 'space', axis: 'horizontal', size: 'm' },
|
|
38
|
+
{ part: 'button', label: 'padding.end', token: '--helix-button-padding-x-m', kind: 'space', axis: 'horizontal', size: 'm' },
|
|
39
|
+
{ part: 'button', label: 'padding.start', token: '--helix-button-padding-x-l', kind: 'space', axis: 'horizontal', size: 'l' },
|
|
40
|
+
{ part: 'button', label: 'padding.end', token: '--helix-button-padding-x-l', kind: 'space', axis: 'horizontal', size: 'l' },
|
|
41
|
+
{ part: 'button-label', label: 'padding.x', token: '--helix-button-label-padding-x-l', kind: 'space', axis: 'horizontal', size: 'l', meta: '16px button padding + 4px label box = 20px per side at size l (ADR-004)' },
|
|
42
|
+
{ part: 'button', label: 'fontSize', token: '--helix-button-fontSize-s', kind: 'typography', meta: 'Caption / Semibold', size: 's' },
|
|
43
|
+
{ part: 'button', label: 'fontWeight', token: '--helix-button-fontWeight-s', kind: 'typography', meta: 'Caption / Semibold', size: 's' },
|
|
44
|
+
{ part: 'button', label: 'fontSize', token: '--helix-button-fontSize-m', kind: 'typography', meta: 'Caption / Semibold', size: 'm' },
|
|
45
|
+
{ part: 'button', label: 'fontWeight', token: '--helix-button-fontWeight-m', kind: 'typography', meta: 'Caption / Semibold', size: 'm' },
|
|
46
|
+
{ part: 'button', label: 'fontSize', token: '--helix-button-fontSize-l', kind: 'typography', meta: 'Body / m / Semibold', size: 'l' },
|
|
47
|
+
{ part: 'button', label: 'fontWeight', token: '--helix-button-fontWeight-l', kind: 'typography', meta: 'Body / m / Semibold', size: 'l' },
|
|
48
|
+
{ part: 'button', label: 'display', value: 'inline-flex' },
|
|
49
|
+
{ part: 'button', label: 'align-items', value: 'center' },
|
|
50
|
+
{ part: 'button', label: 'justify-content', value: 'center' },
|
|
51
|
+
{ part: 'button', label: 'font-family', value: 'inherit' },
|
|
52
|
+
{ part: 'button', label: 'border', value: '1px solid transparent' },
|
|
53
|
+
{ part: 'button', label: 'cursor', value: 'pointer' },
|
|
54
|
+
{ part: 'button', label: 'white-space', value: 'nowrap' },
|
|
55
|
+
{ part: 'button', label: 'user-select', value: 'none' },
|
|
56
|
+
{ part: 'button', label: 'text-decoration', value: 'none' },
|
|
57
|
+
{ part: 'button', label: 'outline', value: 'none' },
|
|
58
|
+
{ part: 'button', label: 'flex-shrink', value: '0' },
|
|
59
|
+
{ part: 'button', label: 'position', value: 'relative' },
|
|
60
|
+
{ part: 'button', label: '-webkit-appearance', value: 'none' },
|
|
61
|
+
{ part: 'button', label: 'background-color', value: 'transparent' },
|
|
62
|
+
{ part: 'button', label: 'border-color', value: 'transparent' },
|
|
63
|
+
{ part: 'button', label: 'opacity', value: '0.5' },
|
|
64
|
+
{ part: 'button', label: 'cursor.disabled', value: 'not-allowed' },
|
|
65
|
+
{ part: 'button', label: 'pointer-events', value: 'none' },
|
|
66
|
+
],
|
|
67
|
+
features: [
|
|
68
|
+
'forwardRef — accepts a ref to the underlying <button> element',
|
|
69
|
+
"size — s=24px, m=32px (default, use unless there's a specific reason to deviate), l=40px",
|
|
70
|
+
'isLoading — shows spinner, disables interaction, sets aria-busy',
|
|
71
|
+
'icon / iconEnd — Tabler icon slots with aria-hidden',
|
|
72
|
+
'fullWidth — stretches to container width',
|
|
73
|
+
'onClick — canonical handler (React\'s own; onClick is an anti-synonym, ADR-022)',
|
|
74
|
+
],
|
|
75
|
+
examples: [
|
|
76
|
+
{
|
|
77
|
+
label: 'Primary',
|
|
78
|
+
code: `<Button>Save changes</Button>`,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
label: 'With leading icon',
|
|
82
|
+
code: `<Button icon={IconPlus}>New item</Button>`,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: 'With trailing icon',
|
|
86
|
+
code: `<Button iconEnd={IconArrowRight}>Continue</Button>`,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: 'Loading state',
|
|
90
|
+
code: `<Button isLoading>Saving…</Button>`,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
label: 'Danger',
|
|
94
|
+
code: `<Button variant="danger">Delete account</Button>`,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=Button.doc.js.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { motion } from 'motion/react';
|
|
4
|
+
import { cn } from '../../lib/utils.js';
|
|
5
|
+
import { PRESS_SCALE_DEFAULT } from '../../lib/motionPresets.js';
|
|
6
|
+
import { resolveTokenPx } from '../../lib/resolveTokenPx.js';
|
|
7
|
+
import { Icon } from '../Icon/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Swap-in-place (transitions.dev "icon swap" + "text morph"): when `value` changes (compared with ===:
|
|
10
|
+
* an icon component, the string 'loading', a label string), the previous one is kept for
|
|
11
|
+
* `durationToken` so the old and new can cross-fade in the same slot, then dropped. Decided during render
|
|
12
|
+
* (not in an effect) so the old content never disappears for a frame first. Under reduced motion there is
|
|
13
|
+
* nothing to cross-fade — it swaps straight away.
|
|
14
|
+
*/
|
|
15
|
+
function useSwap(value, durationToken, ref) {
|
|
16
|
+
const [state, setState] = React.useState({ current: value, previous: null, turn: 0 });
|
|
17
|
+
if (value !== state.current) {
|
|
18
|
+
const reduced = typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
19
|
+
setState({ current: value, previous: reduced ? null : state.current, turn: state.turn + 1 });
|
|
20
|
+
}
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
if (state.previous === null)
|
|
23
|
+
return;
|
|
24
|
+
const timer = window.setTimeout(() => setState(s => ({ ...s, previous: null })), resolveTokenPx(durationToken, ref.current));
|
|
25
|
+
return () => window.clearTimeout(timer);
|
|
26
|
+
}, [state.turn, state.previous, durationToken, ref]);
|
|
27
|
+
return state;
|
|
28
|
+
}
|
|
29
|
+
const Spinner = () => (_jsx("svg", { "data-helix-part": "button-spinner", xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": "true", children: _jsx("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }));
|
|
30
|
+
const Button = React.forwardRef(({ variant = 'primary', size = 'm', isLoading = false, icon, iconEnd, fullWidth = false, className, disabled, children, onClick,
|
|
31
|
+
// Not forwarded to motion.button: Motion's HTMLMotionProps redefines these native names (style,
|
|
32
|
+
// onDrag and its siblings) with incompatible signatures for its own gesture/animation system —
|
|
33
|
+
// same reason FAB (ADR-007) doesn't spread them either. Everything else in ...props still passes
|
|
34
|
+
// through untouched (type, form, name, title, data-*, aria-*, ...).
|
|
35
|
+
style: _style, onDrag: _onDrag, onDragStart: _onDragStart, onDragEnd: _onDragEnd, onAnimationStart: _onAnimationStart, onAnimationEnd: _onAnimationEnd, onAnimationIteration: _onAnimationIteration, ...props }, ref) => {
|
|
36
|
+
const isDisabled = disabled || isLoading;
|
|
37
|
+
// Icon slot: with an `icon`, the icon ↔ spinner (loading) and icon A ↔ icon B changes cross-fade in
|
|
38
|
+
// place. Without one, the spinner still just appears, as before — there's no slot to swap within.
|
|
39
|
+
const iconRef = React.useRef(null);
|
|
40
|
+
const iconSwap = useSwap(icon ? (isLoading ? 'loading' : icon) : null, '--helix-button-swap-duration-icon', iconRef);
|
|
41
|
+
const renderIcon = (value) => (value === 'loading' ? _jsx(Spinner, {}) : _jsx(Icon, { icon: value, size: 16 }));
|
|
42
|
+
// Label: a plain-text label that changes ("Copy link" → "Copied") cross-blurs in place while the
|
|
43
|
+
// label's width eases to the new text's.
|
|
44
|
+
const labelRef = React.useRef(null);
|
|
45
|
+
const labelText = typeof children === 'string' || typeof children === 'number' ? String(children) : null;
|
|
46
|
+
const labelSwap = useSwap(labelText, '--helix-button-swap-duration-label', labelRef);
|
|
47
|
+
const labelSwapping = labelSwap.previous !== null && labelText !== null;
|
|
48
|
+
// The label's resting width, remembered between swaps (nothing to remember while one is easing).
|
|
49
|
+
const labelWidth = React.useRef(0);
|
|
50
|
+
const widthEasing = React.useRef(false);
|
|
51
|
+
React.useLayoutEffect(() => {
|
|
52
|
+
if (labelRef.current && !widthEasing.current)
|
|
53
|
+
labelWidth.current = labelRef.current.getBoundingClientRect().width;
|
|
54
|
+
});
|
|
55
|
+
// Runs once per swap (keyed on its turn) — not on the swap ending, which comes sooner than the
|
|
56
|
+
// width ease and must not cut it short.
|
|
57
|
+
React.useLayoutEffect(() => {
|
|
58
|
+
const el = labelRef.current;
|
|
59
|
+
const incoming = el?.lastElementChild;
|
|
60
|
+
if (!el || !incoming || !labelSwapping)
|
|
61
|
+
return;
|
|
62
|
+
const padding = parseFloat(getComputedStyle(el).paddingLeft) + parseFloat(getComputedStyle(el).paddingRight);
|
|
63
|
+
widthEasing.current = true;
|
|
64
|
+
el.style.width = `${labelWidth.current}px`;
|
|
65
|
+
void el.offsetWidth; // commit the starting width so the change to the new one transitions
|
|
66
|
+
el.style.width = `${incoming.getBoundingClientRect().width + padding}px`;
|
|
67
|
+
const done = () => { el.style.width = ''; widthEasing.current = false; };
|
|
68
|
+
const timer = window.setTimeout(done, resolveTokenPx('--helix-button-swap-duration-width', el));
|
|
69
|
+
return () => { window.clearTimeout(timer); done(); };
|
|
70
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- once per swap: labelSwapping is read at that moment
|
|
71
|
+
}, [labelSwap.turn]);
|
|
72
|
+
return (_jsxs(motion.button, { ref: ref, "data-helix-part": "button", "data-variant": variant, "data-size": size, "data-loading": isLoading ? 'true' : undefined, "data-full-width": fullWidth ? 'true' : undefined, disabled: isDisabled, "aria-busy": isLoading ? 'true' : undefined, className: cn(className), onClick: onClick,
|
|
73
|
+
// Subtle press feedback — Motion, not CSS, so it composes with the loading/disabled states via
|
|
74
|
+
// the same isDisabled check rather than fighting a :active pseudo-class. See ADR-007 /
|
|
75
|
+
// .ai/maps/patterns/motion-effects.md.
|
|
76
|
+
transition: { duration: 0.1 }, ...(isDisabled ? {} : { whileTap: { scale: PRESS_SCALE_DEFAULT } }), ...props, children: [iconSwap.current !== null ? (_jsxs("span", { ref: iconRef, "data-helix-part": "button-icon", "data-swapping": iconSwap.previous !== null ? 'true' : undefined, children: [iconSwap.previous !== null && _jsx(React.Fragment, { children: renderIcon(iconSwap.previous) }, `out-${iconSwap.turn}`), _jsx(React.Fragment, { children: renderIcon(iconSwap.current) }, `in-${iconSwap.turn}`)] })) : isLoading ? (_jsx(Spinner, {})) : null, children && (_jsx("span", { ref: labelRef, "data-helix-part": "button-label", "data-swapping": labelSwapping ? 'true' : undefined, children: labelSwapping ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: labelSwap.previous }, `out-${labelSwap.turn}`), _jsx("span", { children: children }, `in-${labelSwap.turn}`)] })) : children })), !isLoading && iconEnd && (_jsx("span", { "data-helix-part": "button-icon-end", children: _jsx(Icon, { icon: iconEnd, size: 16 }) }))] }));
|
|
77
|
+
});
|
|
78
|
+
Button.displayName = 'Button';
|
|
79
|
+
export { Button };
|
|
80
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using Button, read its contract: node_modules/@helixds/react/dist/contracts/Button.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
|
+
import type { HelixIconComponent } from '../Icon/index.js';
|
|
9
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
10
|
+
export type ButtonSize = 's' | 'm' | 'l';
|
|
11
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
12
|
+
/** Visual style. Default: 'primary' */
|
|
13
|
+
variant?: ButtonVariant;
|
|
14
|
+
/** Physical size. Default: 'm' */
|
|
15
|
+
size?: ButtonSize;
|
|
16
|
+
/** Async action in progress — shows spinner, disables interaction. */
|
|
17
|
+
isLoading?: boolean;
|
|
18
|
+
/** Leading icon — a Tabler icon component, passed by reference (e.g. IconPlus). Always rendered at size=16 (stroke scales automatically via Icon), regardless of button size. */
|
|
19
|
+
icon?: HelixIconComponent;
|
|
20
|
+
/** Trailing icon. Same fixed size as `icon`. */
|
|
21
|
+
iconEnd?: HelixIconComponent;
|
|
22
|
+
/** Expand to 100% of container width. */
|
|
23
|
+
fullWidth?: boolean;
|
|
24
|
+
/** Primary action handler — React's own `onClick` (ADR-022: names follow what agents expect). `onPress` is an anti-synonym. */
|
|
25
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
26
|
+
/** The button's text. Button has no `label` prop — its text is children; icon-only actions use IconButton. */
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=Button.types.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using Button, read its contract: node_modules/@helixds/react/dist/contracts/Button.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 { Button } from './Button.js';
|
|
8
|
+
export type { ButtonProps, ButtonVariant, ButtonSize } from './Button.types.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @helixds/react — agent note
|
|
3
|
+
* Before using Card, read its contract: node_modules/@helixds/react/dist/contracts/Card.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 { CardProps } from './Card.types.js';
|
|
9
|
+
declare const Card: {
|
|
10
|
+
({ header, children, padding, className }: CardProps): React.JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export { Card };
|
|
14
|
+
//# sourceMappingURL=Card.d.ts.map
|