@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.
Files changed (340) hide show
  1. package/AGENTS.md +292 -0
  2. package/LICENSE +21 -0
  3. package/README.md +49 -2
  4. package/dist/components/Accordion/Accordion.d.ts +14 -0
  5. package/dist/components/Accordion/Accordion.doc.d.ts +4 -0
  6. package/dist/components/Accordion/Accordion.doc.js +27 -0
  7. package/dist/components/Accordion/Accordion.js +76 -0
  8. package/dist/components/Accordion/Accordion.types.d.ts +24 -0
  9. package/dist/components/Accordion/Accordion.types.js +2 -0
  10. package/dist/components/Accordion/index.d.ts +9 -0
  11. package/dist/components/Accordion/index.js +2 -0
  12. package/dist/components/Avatar/Avatar.d.ts +14 -0
  13. package/dist/components/Avatar/Avatar.doc.d.ts +4 -0
  14. package/dist/components/Avatar/Avatar.doc.js +34 -0
  15. package/dist/components/Avatar/Avatar.js +14 -0
  16. package/dist/components/Avatar/Avatar.types.d.ts +20 -0
  17. package/dist/components/Avatar/Avatar.types.js +2 -0
  18. package/dist/components/Avatar/index.d.ts +9 -0
  19. package/dist/components/Avatar/index.js +2 -0
  20. package/dist/components/AvatarGroup/AvatarGroup.d.ts +14 -0
  21. package/dist/components/AvatarGroup/AvatarGroup.doc.d.ts +4 -0
  22. package/dist/components/AvatarGroup/AvatarGroup.doc.js +30 -0
  23. package/dist/components/AvatarGroup/AvatarGroup.js +15 -0
  24. package/dist/components/AvatarGroup/AvatarGroup.types.d.ts +21 -0
  25. package/dist/components/AvatarGroup/AvatarGroup.types.js +2 -0
  26. package/dist/components/AvatarGroup/index.d.ts +9 -0
  27. package/dist/components/AvatarGroup/index.js +2 -0
  28. package/dist/components/Badge/Badge.d.ts +16 -0
  29. package/dist/components/Badge/Badge.doc.d.ts +4 -0
  30. package/dist/components/Badge/Badge.doc.js +69 -0
  31. package/dist/components/Badge/Badge.js +23 -0
  32. package/dist/components/Badge/Badge.types.d.ts +22 -0
  33. package/dist/components/Badge/Badge.types.js +2 -0
  34. package/dist/components/Badge/index.d.ts +9 -0
  35. package/dist/components/Badge/index.js +2 -0
  36. package/dist/components/Button/Button.d.ts +11 -0
  37. package/dist/components/Button/Button.doc.d.ts +4 -0
  38. package/dist/components/Button/Button.doc.js +98 -0
  39. package/dist/components/Button/Button.js +80 -0
  40. package/dist/components/Button/Button.types.d.ts +29 -0
  41. package/dist/components/Button/Button.types.js +2 -0
  42. package/dist/components/Button/index.d.ts +9 -0
  43. package/dist/components/Button/index.js +2 -0
  44. package/dist/components/Card/Card.d.ts +14 -0
  45. package/dist/components/Card/Card.doc.d.ts +4 -0
  46. package/dist/components/Card/Card.doc.js +44 -0
  47. package/dist/components/Card/Card.js +9 -0
  48. package/dist/components/Card/Card.types.d.ts +19 -0
  49. package/dist/components/Card/Card.types.js +2 -0
  50. package/dist/components/Card/index.d.ts +9 -0
  51. package/dist/components/Card/index.js +2 -0
  52. package/dist/components/Chart/Chart.d.ts +14 -0
  53. package/dist/components/Chart/Chart.doc.d.ts +4 -0
  54. package/dist/components/Chart/Chart.doc.js +49 -0
  55. package/dist/components/Chart/Chart.js +184 -0
  56. package/dist/components/Chart/Chart.types.d.ts +21 -0
  57. package/dist/components/Chart/Chart.types.js +2 -0
  58. package/dist/components/Chart/index.d.ts +9 -0
  59. package/dist/components/Chart/index.js +2 -0
  60. package/dist/components/Checkbox/Checkbox.d.ts +12 -0
  61. package/dist/components/Checkbox/Checkbox.doc.d.ts +4 -0
  62. package/dist/components/Checkbox/Checkbox.doc.js +54 -0
  63. package/dist/components/Checkbox/Checkbox.js +23 -0
  64. package/dist/components/Checkbox/Checkbox.types.d.ts +22 -0
  65. package/dist/components/Checkbox/Checkbox.types.js +2 -0
  66. package/dist/components/Checkbox/index.d.ts +9 -0
  67. package/dist/components/Checkbox/index.js +2 -0
  68. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +13 -0
  69. package/dist/components/CheckboxGroup/CheckboxGroup.doc.d.ts +4 -0
  70. package/dist/components/CheckboxGroup/CheckboxGroup.doc.js +56 -0
  71. package/dist/components/CheckboxGroup/CheckboxGroup.js +27 -0
  72. package/dist/components/CheckboxGroup/CheckboxGroup.types.d.ts +28 -0
  73. package/dist/components/CheckboxGroup/CheckboxGroup.types.js +2 -0
  74. package/dist/components/CheckboxGroup/index.d.ts +9 -0
  75. package/dist/components/CheckboxGroup/index.js +2 -0
  76. package/dist/components/Chip/Chip.d.ts +11 -0
  77. package/dist/components/Chip/Chip.doc.d.ts +4 -0
  78. package/dist/components/Chip/Chip.doc.js +105 -0
  79. package/dist/components/Chip/Chip.js +30 -0
  80. package/dist/components/Chip/Chip.types.d.ts +31 -0
  81. package/dist/components/Chip/Chip.types.js +2 -0
  82. package/dist/components/Chip/index.d.ts +9 -0
  83. package/dist/components/Chip/index.js +2 -0
  84. package/dist/components/ChipGroup/ChipGroup.d.ts +12 -0
  85. package/dist/components/ChipGroup/ChipGroup.doc.d.ts +4 -0
  86. package/dist/components/ChipGroup/ChipGroup.doc.js +31 -0
  87. package/dist/components/ChipGroup/ChipGroup.js +9 -0
  88. package/dist/components/ChipGroup/ChipGroup.types.d.ts +27 -0
  89. package/dist/components/ChipGroup/ChipGroup.types.js +2 -0
  90. package/dist/components/ChipGroup/index.d.ts +9 -0
  91. package/dist/components/ChipGroup/index.js +2 -0
  92. package/dist/components/FAB/FAB.d.ts +11 -0
  93. package/dist/components/FAB/FAB.doc.d.ts +4 -0
  94. package/dist/components/FAB/FAB.doc.js +52 -0
  95. package/dist/components/FAB/FAB.js +133 -0
  96. package/dist/components/FAB/FAB.types.d.ts +37 -0
  97. package/dist/components/FAB/FAB.types.js +2 -0
  98. package/dist/components/FAB/index.d.ts +9 -0
  99. package/dist/components/FAB/index.js +2 -0
  100. package/dist/components/Icon/Icon.d.ts +14 -0
  101. package/dist/components/Icon/Icon.doc.d.ts +4 -0
  102. package/dist/components/Icon/Icon.doc.js +38 -0
  103. package/dist/components/Icon/Icon.js +15 -0
  104. package/dist/components/Icon/Icon.types.d.ts +47 -0
  105. package/dist/components/Icon/Icon.types.js +2 -0
  106. package/dist/components/Icon/createIconAdapter.d.ts +24 -0
  107. package/dist/components/Icon/createIconAdapter.js +28 -0
  108. package/dist/components/Icon/iconStroke.d.ts +20 -0
  109. package/dist/components/Icon/iconStroke.js +54 -0
  110. package/dist/components/Icon/index.d.ts +12 -0
  111. package/dist/components/Icon/index.js +4 -0
  112. package/dist/components/IconButton/IconButton.d.ts +11 -0
  113. package/dist/components/IconButton/IconButton.doc.d.ts +4 -0
  114. package/dist/components/IconButton/IconButton.doc.js +76 -0
  115. package/dist/components/IconButton/IconButton.js +20 -0
  116. package/dist/components/IconButton/IconButton.types.d.ts +25 -0
  117. package/dist/components/IconButton/IconButton.types.js +2 -0
  118. package/dist/components/IconButton/index.d.ts +9 -0
  119. package/dist/components/IconButton/index.js +2 -0
  120. package/dist/components/Input/Input.d.ts +11 -0
  121. package/dist/components/Input/Input.doc.d.ts +4 -0
  122. package/dist/components/Input/Input.doc.js +68 -0
  123. package/dist/components/Input/Input.js +48 -0
  124. package/dist/components/Input/Input.types.d.ts +36 -0
  125. package/dist/components/Input/Input.types.js +2 -0
  126. package/dist/components/Input/index.d.ts +9 -0
  127. package/dist/components/Input/index.js +2 -0
  128. package/dist/components/Menu/Menu.d.ts +14 -0
  129. package/dist/components/Menu/Menu.doc.d.ts +4 -0
  130. package/dist/components/Menu/Menu.doc.js +46 -0
  131. package/dist/components/Menu/Menu.js +105 -0
  132. package/dist/components/Menu/Menu.types.d.ts +34 -0
  133. package/dist/components/Menu/Menu.types.js +2 -0
  134. package/dist/components/Menu/index.d.ts +9 -0
  135. package/dist/components/Menu/index.js +2 -0
  136. package/dist/components/Modal/Modal.d.ts +14 -0
  137. package/dist/components/Modal/Modal.doc.d.ts +4 -0
  138. package/dist/components/Modal/Modal.doc.js +52 -0
  139. package/dist/components/Modal/Modal.js +30 -0
  140. package/dist/components/Modal/Modal.types.d.ts +36 -0
  141. package/dist/components/Modal/Modal.types.js +2 -0
  142. package/dist/components/Modal/index.d.ts +9 -0
  143. package/dist/components/Modal/index.js +2 -0
  144. package/dist/components/MultiSelect/MultiSelect.d.ts +17 -0
  145. package/dist/components/MultiSelect/MultiSelect.doc.d.ts +4 -0
  146. package/dist/components/MultiSelect/MultiSelect.doc.js +37 -0
  147. package/dist/components/MultiSelect/MultiSelect.js +165 -0
  148. package/dist/components/MultiSelect/MultiSelect.types.d.ts +50 -0
  149. package/dist/components/MultiSelect/MultiSelect.types.js +2 -0
  150. package/dist/components/MultiSelect/index.d.ts +9 -0
  151. package/dist/components/MultiSelect/index.js +2 -0
  152. package/dist/components/NavItem/NavItem.d.ts +14 -0
  153. package/dist/components/NavItem/NavItem.doc.d.ts +4 -0
  154. package/dist/components/NavItem/NavItem.doc.js +31 -0
  155. package/dist/components/NavItem/NavItem.js +21 -0
  156. package/dist/components/NavItem/NavItem.types.d.ts +20 -0
  157. package/dist/components/NavItem/NavItem.types.js +2 -0
  158. package/dist/components/NavItem/index.d.ts +9 -0
  159. package/dist/components/NavItem/index.js +2 -0
  160. package/dist/components/RadioButton/RadioButton.d.ts +14 -0
  161. package/dist/components/RadioButton/RadioButton.doc.d.ts +4 -0
  162. package/dist/components/RadioButton/RadioButton.doc.js +35 -0
  163. package/dist/components/RadioButton/RadioButton.js +15 -0
  164. package/dist/components/RadioButton/RadioButton.types.d.ts +33 -0
  165. package/dist/components/RadioButton/RadioButton.types.js +2 -0
  166. package/dist/components/RadioButton/index.d.ts +9 -0
  167. package/dist/components/RadioButton/index.js +2 -0
  168. package/dist/components/RadioGroup/RadioGroup.d.ts +12 -0
  169. package/dist/components/RadioGroup/RadioGroup.doc.d.ts +4 -0
  170. package/dist/components/RadioGroup/RadioGroup.doc.js +80 -0
  171. package/dist/components/RadioGroup/RadioGroup.js +19 -0
  172. package/dist/components/RadioGroup/RadioGroup.types.d.ts +28 -0
  173. package/dist/components/RadioGroup/RadioGroup.types.js +2 -0
  174. package/dist/components/RadioGroup/index.d.ts +9 -0
  175. package/dist/components/RadioGroup/index.js +2 -0
  176. package/dist/components/SegmentedControl/SegmentedControl.d.ts +13 -0
  177. package/dist/components/SegmentedControl/SegmentedControl.doc.d.ts +4 -0
  178. package/dist/components/SegmentedControl/SegmentedControl.doc.js +50 -0
  179. package/dist/components/SegmentedControl/SegmentedControl.js +64 -0
  180. package/dist/components/SegmentedControl/SegmentedControl.types.d.ts +26 -0
  181. package/dist/components/SegmentedControl/SegmentedControl.types.js +2 -0
  182. package/dist/components/SegmentedControl/index.d.ts +9 -0
  183. package/dist/components/SegmentedControl/index.js +2 -0
  184. package/dist/components/Select/Select.d.ts +13 -0
  185. package/dist/components/Select/Select.doc.d.ts +4 -0
  186. package/dist/components/Select/Select.doc.js +66 -0
  187. package/dist/components/Select/Select.js +138 -0
  188. package/dist/components/Select/Select.types.d.ts +36 -0
  189. package/dist/components/Select/Select.types.js +2 -0
  190. package/dist/components/Select/index.d.ts +9 -0
  191. package/dist/components/Select/index.js +2 -0
  192. package/dist/components/SidePanel/SidePanel.d.ts +14 -0
  193. package/dist/components/SidePanel/SidePanel.doc.d.ts +4 -0
  194. package/dist/components/SidePanel/SidePanel.doc.js +29 -0
  195. package/dist/components/SidePanel/SidePanel.js +19 -0
  196. package/dist/components/SidePanel/SidePanel.types.d.ts +28 -0
  197. package/dist/components/SidePanel/SidePanel.types.js +2 -0
  198. package/dist/components/SidePanel/index.d.ts +9 -0
  199. package/dist/components/SidePanel/index.js +2 -0
  200. package/dist/components/Switch/Switch.d.ts +13 -0
  201. package/dist/components/Switch/Switch.doc.d.ts +4 -0
  202. package/dist/components/Switch/Switch.doc.js +56 -0
  203. package/dist/components/Switch/Switch.js +45 -0
  204. package/dist/components/Switch/Switch.types.d.ts +21 -0
  205. package/dist/components/Switch/Switch.types.js +2 -0
  206. package/dist/components/Switch/index.d.ts +9 -0
  207. package/dist/components/Switch/index.js +2 -0
  208. package/dist/components/Table/Table.d.ts +34 -0
  209. package/dist/components/Table/Table.doc.d.ts +4 -0
  210. package/dist/components/Table/Table.doc.js +48 -0
  211. package/dist/components/Table/Table.js +17 -0
  212. package/dist/components/Table/Table.types.d.ts +30 -0
  213. package/dist/components/Table/Table.types.js +2 -0
  214. package/dist/components/Table/index.d.ts +9 -0
  215. package/dist/components/Table/index.js +2 -0
  216. package/dist/components/Textarea/Textarea.d.ts +9 -0
  217. package/dist/components/Textarea/Textarea.doc.d.ts +4 -0
  218. package/dist/components/Textarea/Textarea.doc.js +60 -0
  219. package/dist/components/Textarea/Textarea.js +24 -0
  220. package/dist/components/Textarea/Textarea.types.d.ts +22 -0
  221. package/dist/components/Textarea/Textarea.types.js +2 -0
  222. package/dist/components/Textarea/index.d.ts +9 -0
  223. package/dist/components/Textarea/index.js +2 -0
  224. package/dist/components/Toast/Toast.d.ts +16 -0
  225. package/dist/components/Toast/Toast.doc.d.ts +4 -0
  226. package/dist/components/Toast/Toast.doc.js +37 -0
  227. package/dist/components/Toast/Toast.js +134 -0
  228. package/dist/components/Toast/Toast.types.d.ts +11 -0
  229. package/dist/components/Toast/Toast.types.js +2 -0
  230. package/dist/components/Toast/index.d.ts +10 -0
  231. package/dist/components/Toast/index.js +2 -0
  232. package/dist/components/Toast/toastStore.d.ts +36 -0
  233. package/dist/components/Toast/toastStore.js +57 -0
  234. package/dist/components/Tooltip/Tooltip.d.ts +14 -0
  235. package/dist/components/Tooltip/Tooltip.doc.d.ts +4 -0
  236. package/dist/components/Tooltip/Tooltip.doc.js +33 -0
  237. package/dist/components/Tooltip/Tooltip.js +105 -0
  238. package/dist/components/Tooltip/Tooltip.types.d.ts +21 -0
  239. package/dist/components/Tooltip/Tooltip.types.js +2 -0
  240. package/dist/components/Tooltip/index.d.ts +9 -0
  241. package/dist/components/Tooltip/index.js +2 -0
  242. package/dist/contracts/Accordion.json +174 -0
  243. package/dist/contracts/AppShell.json +118 -0
  244. package/dist/contracts/Avatar.json +157 -0
  245. package/dist/contracts/AvatarGroup.json +169 -0
  246. package/dist/contracts/Badge.json +212 -0
  247. package/dist/contracts/Button.json +295 -0
  248. package/dist/contracts/Card.json +125 -0
  249. package/dist/contracts/Chart.json +167 -0
  250. package/dist/contracts/Checkbox.json +333 -0
  251. package/dist/contracts/CheckboxGroup.json +200 -0
  252. package/dist/contracts/Chip.json +320 -0
  253. package/dist/contracts/ChipGroup.json +182 -0
  254. package/dist/contracts/FAB.json +215 -0
  255. package/dist/contracts/Icon.json +306 -0
  256. package/dist/contracts/IconButton.json +213 -0
  257. package/dist/contracts/Input.json +400 -0
  258. package/dist/contracts/Menu.json +197 -0
  259. package/dist/contracts/Modal.json +192 -0
  260. package/dist/contracts/MultiSelect.json +244 -0
  261. package/dist/contracts/NavItem.json +148 -0
  262. package/dist/contracts/PageHeader.json +134 -0
  263. package/dist/contracts/RadioButton.json +202 -0
  264. package/dist/contracts/RadioGroup.json +228 -0
  265. package/dist/contracts/SegmentedControl.json +193 -0
  266. package/dist/contracts/Select.json +241 -0
  267. package/dist/contracts/SideNav.json +138 -0
  268. package/dist/contracts/SidePanel.json +153 -0
  269. package/dist/contracts/Switch.json +201 -0
  270. package/dist/contracts/Table.json +130 -0
  271. package/dist/contracts/Textarea.json +353 -0
  272. package/dist/contracts/Toast.json +186 -0
  273. package/dist/contracts/Tooltip.json +168 -0
  274. package/dist/contracts/TopBar.json +127 -0
  275. package/dist/contracts/manifest.json +675 -0
  276. package/dist/index.d.ts +109 -0
  277. package/dist/index.js +73 -0
  278. package/dist/layout/AppShell/AppShell.d.ts +14 -0
  279. package/dist/layout/AppShell/AppShell.doc.d.ts +4 -0
  280. package/dist/layout/AppShell/AppShell.doc.js +27 -0
  281. package/dist/layout/AppShell/AppShell.js +9 -0
  282. package/dist/layout/AppShell/AppShell.types.d.ts +18 -0
  283. package/dist/layout/AppShell/AppShell.types.js +2 -0
  284. package/dist/layout/AppShell/index.d.ts +9 -0
  285. package/dist/layout/AppShell/index.js +2 -0
  286. package/dist/layout/PageHeader/PageHeader.d.ts +14 -0
  287. package/dist/layout/PageHeader/PageHeader.doc.d.ts +4 -0
  288. package/dist/layout/PageHeader/PageHeader.doc.js +30 -0
  289. package/dist/layout/PageHeader/PageHeader.js +10 -0
  290. package/dist/layout/PageHeader/PageHeader.types.d.ts +21 -0
  291. package/dist/layout/PageHeader/PageHeader.types.js +2 -0
  292. package/dist/layout/PageHeader/index.d.ts +9 -0
  293. package/dist/layout/PageHeader/index.js +2 -0
  294. package/dist/layout/SideNav/SideNav.d.ts +14 -0
  295. package/dist/layout/SideNav/SideNav.doc.d.ts +4 -0
  296. package/dist/layout/SideNav/SideNav.doc.js +32 -0
  297. package/dist/layout/SideNav/SideNav.js +9 -0
  298. package/dist/layout/SideNav/SideNav.types.d.ts +18 -0
  299. package/dist/layout/SideNav/SideNav.types.js +2 -0
  300. package/dist/layout/SideNav/index.d.ts +9 -0
  301. package/dist/layout/SideNav/index.js +2 -0
  302. package/dist/layout/TopBar/TopBar.d.ts +14 -0
  303. package/dist/layout/TopBar/TopBar.doc.d.ts +4 -0
  304. package/dist/layout/TopBar/TopBar.doc.js +28 -0
  305. package/dist/layout/TopBar/TopBar.js +9 -0
  306. package/dist/layout/TopBar/TopBar.types.d.ts +16 -0
  307. package/dist/layout/TopBar/TopBar.types.js +2 -0
  308. package/dist/layout/TopBar/index.d.ts +9 -0
  309. package/dist/layout/TopBar/index.js +2 -0
  310. package/dist/lib/component-doc.d.ts +34 -0
  311. package/dist/lib/component-doc.js +2 -0
  312. package/dist/lib/motionPresets.d.ts +37 -0
  313. package/dist/lib/motionPresets.js +35 -0
  314. package/dist/lib/resolveTokenPx.d.ts +11 -0
  315. package/dist/lib/resolveTokenPx.js +17 -0
  316. package/dist/lib/useDialogTransition.d.ts +21 -0
  317. package/dist/lib/useDialogTransition.js +86 -0
  318. package/dist/lib/useDisclosureTransition.d.ts +19 -0
  319. package/dist/lib/useDisclosureTransition.js +41 -0
  320. package/dist/lib/utils.d.ts +3 -0
  321. package/dist/lib/utils.js +6 -0
  322. package/dist/patterns/action-bar.md +127 -0
  323. package/dist/patterns/border-always.md +40 -0
  324. package/dist/patterns/data-analytics.md +15 -0
  325. package/dist/patterns/disabled-state.md +80 -0
  326. package/dist/patterns/empty-state.md +130 -0
  327. package/dist/patterns/expand-collapse-chevron.md +101 -0
  328. package/dist/patterns/form-field-group.md +139 -0
  329. package/dist/patterns/form-field-spacing.md +99 -0
  330. package/dist/patterns/group-spacing.md +54 -0
  331. package/dist/patterns/motion-effects.md +100 -0
  332. package/dist/patterns/same-row-sizing.md +52 -0
  333. package/dist/patterns/search-filter.md +118 -0
  334. package/dist/patterns/show-hide-parts.md +53 -0
  335. package/dist/patterns/stat-card.md +105 -0
  336. package/dist/patterns/status-row.md +130 -0
  337. package/dist/patterns/view-toggle.md +81 -0
  338. package/dist/prop-map.md +80 -0
  339. package/package.json +70 -3
  340. package/src/globals.css +3195 -0
@@ -0,0 +1,34 @@
1
+ /** Canonical shape for every component's machine-readable documentation (`*.doc.ts`). */
2
+ export interface ComponentDoc {
3
+ name: string;
4
+ purpose: string;
5
+ contract: string;
6
+ a11y: string[];
7
+ variants: {
8
+ name: string;
9
+ description: string;
10
+ }[];
11
+ sizes: string[];
12
+ tokens: {
13
+ part: string;
14
+ label: string;
15
+ token?: string;
16
+ value?: string;
17
+ kind?: 'color' | 'typography' | 'space' | 'radius' | 'shadow' | 'style' | 'other';
18
+ colorRole?: 'background' | 'text' | 'border' | 'icon' | 'asset';
19
+ padding?: 'all' | 'top' | 'right' | 'bottom' | 'left' | string;
20
+ paddingSides?: ('top' | 'end' | 'bottom' | 'start')[];
21
+ relationship?: string;
22
+ variant?: string;
23
+ size?: string;
24
+ state?: 'hover' | 'press' | 'disabled' | 'focus';
25
+ axis?: 'horizontal' | 'vertical';
26
+ meta?: string;
27
+ }[];
28
+ features: string[];
29
+ examples: {
30
+ label: string;
31
+ code: string;
32
+ }[];
33
+ }
34
+ //# sourceMappingURL=component-doc.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=component-doc.js.map
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Shared Motion (`motion/react`) presets — the JS-only half of Helix's motion vocabulary.
3
+ *
4
+ * Duration/easing that CSS can express live as real tokens (`semantic.duration.*`,
5
+ * `semantic.easing.*`, `semantic.transform.*` in tokens.json) and reach components as
6
+ * `var(--helix-*)`. Motion's spring physics (`stiffness`/`damping`) and cubic-bezier arrays have no
7
+ * `var()` equivalent — a CSS transition can't express a spring, and Motion doesn't accept a CSS
8
+ * custom property for `ease`. Those values live here instead: named, in one place, instead of typed
9
+ * inline per component. This is NOT a tokens.json entry (packages/tokens/CLAUDE.md's "What NOT to
10
+ * do" — "don't add JS-only constants that don't have a CSS counterpart" — is about keeping the token
11
+ * pipeline free of stuff that can't become a CSS var; this module is deliberately the other, JS-only
12
+ * home for exactly that category, not an exception to the rule).
13
+ *
14
+ * Where a value coincides with a real duration token (FAB_COLLAPSE_TRANSITION below), it's derived
15
+ * from `@helixds/tokens` rather than retyped — see packages/tokens/CLAUDE.md's "Motion naming
16
+ * vocabulary" section for the full reasoning, including why the other durations here stay bespoke
17
+ * literals instead of being forced onto the scale.
18
+ *
19
+ * See ADR-007 and .ai/maps/patterns/motion-effects.md.
20
+ */
21
+ import type { Transition } from 'motion/react';
22
+ export declare const SPRING_SNAPPY: Transition;
23
+ export declare const EASE_BACK: [number, number, number, number];
24
+ export declare const EASE_COLLAPSE: [number, number, number, number];
25
+ /** FAB speed-dial expand — overshoots outward; safe, nothing beyond the target to collide with. */
26
+ export declare const FAB_EXPAND_TRANSITION: Transition;
27
+ /**
28
+ * FAB speed-dial collapse — must never dip past y=0 (the trigger's own position), so this is a
29
+ * no-overshoot ease-out, not EASE_BACK run in reverse. Duration coincides with
30
+ * `semantic.duration.slower` (300ms) — derived from the real token rather than retyped as `0.3`.
31
+ */
32
+ export declare const FAB_COLLAPSE_TRANSITION: Transition;
33
+ /** FAB trigger's squish-and-release bounce, fired once when the actions collect back. */
34
+ export declare const FAB_TRIGGER_BOUNCE_TRANSITION: Transition;
35
+ export declare const PRESS_SCALE_DEFAULT = 0.97;
36
+ export declare const PRESS_SCALE_COMPACT = 0.94;
37
+ //# sourceMappingURL=motionPresets.d.ts.map
@@ -0,0 +1,35 @@
1
+ import { tokens } from '@helixds/tokens';
2
+ function msToSeconds(ms) {
3
+ return Number.parseFloat(ms) / 1000;
4
+ }
5
+ // ── Springs ──────────────────────────────────────────────────────────────────
6
+ // Physically modeled — no CSS equivalent exists. Switch's thumb and NavItem's sliding indicator are
7
+ // meant to feel identical (both a small element snapping to a new resting position) but had drifted
8
+ // to damping 32 vs 35 with no documented reason for the difference — consolidated to one value here.
9
+ export const SPRING_SNAPPY = { type: 'spring', stiffness: 500, damping: 32 };
10
+ // ── Cubic-bezier tweens ──────────────────────────────────────────────────────
11
+ // "Back"/overshoot curves — Helix's semantic.easing.{base,in,out} are all no-overshoot, so these have
12
+ // no matching token (see motion-effects.md's Input shake row for the same "bespoke, not on the
13
+ // scale" call). Named here instead of as inline arrays repeated across FAB's three transitions.
14
+ export const EASE_BACK = [0.34, 1.56, 0.64, 1];
15
+ export const EASE_COLLAPSE = [0.16, 1, 0.3, 1];
16
+ /** FAB speed-dial expand — overshoots outward; safe, nothing beyond the target to collide with. */
17
+ export const FAB_EXPAND_TRANSITION = { duration: 0.42, ease: EASE_BACK };
18
+ /**
19
+ * FAB speed-dial collapse — must never dip past y=0 (the trigger's own position), so this is a
20
+ * no-overshoot ease-out, not EASE_BACK run in reverse. Duration coincides with
21
+ * `semantic.duration.slower` (300ms) — derived from the real token rather than retyped as `0.3`.
22
+ */
23
+ export const FAB_COLLAPSE_TRANSITION = {
24
+ duration: msToSeconds(tokens.semantic.duration.slower),
25
+ ease: EASE_COLLAPSE,
26
+ };
27
+ /** FAB trigger's squish-and-release bounce, fired once when the actions collect back. */
28
+ export const FAB_TRIGGER_BOUNCE_TRANSITION = { duration: 0.24, ease: EASE_BACK };
29
+ // ── Press feedback (`whileTap`) ──────────────────────────────────────────────
30
+ // Same category as a CSS `:active` pseudo-class (motion-effects.md's Button/IconButton row) — brief,
31
+ // user-driven, not autoplaying, so it's exempt from the "reduced motion is not automatic" checklist
32
+ // item. No CSS equivalent either (Motion's `whileTap` target), so named here rather than inline.
33
+ export const PRESS_SCALE_DEFAULT = 0.97; // Button
34
+ export const PRESS_SCALE_COMPACT = 0.94; // IconButton — smaller hit target reads a firmer press
35
+ //# sourceMappingURL=motionPresets.js.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Resolves a `--helix-*` CSS custom property to a plain number, for the handful of places a Helix
3
+ * token has to cross into a JS-driven API that only accepts numbers — never a `var(...)` reference.
4
+ * Two call sites today: FAB's speed-dial offsets (Motion's `animate.y` is a numeric px) and Switch's
5
+ * thumb position (same reason). See ADR-007 and `.ai/maps/patterns/motion-effects.md`.
6
+ *
7
+ * Reads from `el` (defaults to the document root) so a component-scoped override (e.g. a themed subtree)
8
+ * resolves correctly, not just the global `:root` value.
9
+ */
10
+ export declare function resolveTokenPx(token: string, el?: HTMLElement | null): number;
11
+ //# sourceMappingURL=resolveTokenPx.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Resolves a `--helix-*` CSS custom property to a plain number, for the handful of places a Helix
3
+ * token has to cross into a JS-driven API that only accepts numbers — never a `var(...)` reference.
4
+ * Two call sites today: FAB's speed-dial offsets (Motion's `animate.y` is a numeric px) and Switch's
5
+ * thumb position (same reason). See ADR-007 and `.ai/maps/patterns/motion-effects.md`.
6
+ *
7
+ * Reads from `el` (defaults to the document root) so a component-scoped override (e.g. a themed subtree)
8
+ * resolves correctly, not just the global `:root` value.
9
+ */
10
+ export function resolveTokenPx(token, el = document.documentElement) {
11
+ if (!el)
12
+ return 0;
13
+ const raw = getComputedStyle(el).getPropertyValue(token).trim();
14
+ const value = Number.parseFloat(raw);
15
+ return Number.isNaN(value) ? 0 : value;
16
+ }
17
+ //# sourceMappingURL=resolveTokenPx.js.map
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ export type DialogTransitionState = 'closed' | 'open' | 'closing';
3
+ /**
4
+ * Shared open/close choreography for Modal and SidePanel — see ADR-010. Native `<dialog>` has no
5
+ * built-in "animate out, then actually close" behavior, so this orchestrates it in JS: `showModal()`
6
+ * immediately, then a `data-state="open"` flip one animation frame later (so the transition actually
7
+ * plays); on close, `data-state="closing"` first, then the real `.close()` after the component's own
8
+ * close-duration token has elapsed. Escape (native `cancel`) is redirected into the same path via
9
+ * `onDismiss`, so every dismissal — programmatic or native — animates identically.
10
+ *
11
+ * Backdrop-click dismissal: native `<dialog>` has no `::backdrop` click event to listen for — a click
12
+ * on the backdrop is dispatched as a click on the `<dialog>` element itself (it's the top-layer element
13
+ * covering the viewport while modal). The standard technique (used here) is geometric: on a click
14
+ * directly on the dialog element, check whether the pointer landed inside the dialog's own rendered
15
+ * box; if not, treat it as a backdrop click. `closeOnBackdropClick` (default true) gates this.
16
+ */
17
+ export declare function useDialogTransition(expanded: boolean, closeDurationToken: string, onDismiss?: () => void, closeOnBackdropClick?: boolean): {
18
+ ref: React.RefObject<HTMLDialogElement | null>;
19
+ state: DialogTransitionState;
20
+ };
21
+ //# sourceMappingURL=useDialogTransition.d.ts.map
@@ -0,0 +1,86 @@
1
+ import * as React from 'react';
2
+ import { resolveTokenPx } from './resolveTokenPx.js';
3
+ /**
4
+ * Shared open/close choreography for Modal and SidePanel — see ADR-010. Native `<dialog>` has no
5
+ * built-in "animate out, then actually close" behavior, so this orchestrates it in JS: `showModal()`
6
+ * immediately, then a `data-state="open"` flip one animation frame later (so the transition actually
7
+ * plays); on close, `data-state="closing"` first, then the real `.close()` after the component's own
8
+ * close-duration token has elapsed. Escape (native `cancel`) is redirected into the same path via
9
+ * `onDismiss`, so every dismissal — programmatic or native — animates identically.
10
+ *
11
+ * Backdrop-click dismissal: native `<dialog>` has no `::backdrop` click event to listen for — a click
12
+ * on the backdrop is dispatched as a click on the `<dialog>` element itself (it's the top-layer element
13
+ * covering the viewport while modal). The standard technique (used here) is geometric: on a click
14
+ * directly on the dialog element, check whether the pointer landed inside the dialog's own rendered
15
+ * box; if not, treat it as a backdrop click. `closeOnBackdropClick` (default true) gates this.
16
+ */
17
+ export function useDialogTransition(expanded, closeDurationToken, onDismiss, closeOnBackdropClick = true) {
18
+ const ref = React.useRef(null);
19
+ const [state, setState] = React.useState(expanded ? 'open' : 'closed');
20
+ React.useEffect(() => {
21
+ const el = ref.current;
22
+ if (!el)
23
+ return;
24
+ if (expanded) {
25
+ if (!el.open)
26
+ el.showModal();
27
+ const raf = requestAnimationFrame(() => setState('open'));
28
+ return () => cancelAnimationFrame(raf);
29
+ }
30
+ if (!el.open) {
31
+ setState('closed');
32
+ return;
33
+ }
34
+ setState('closing');
35
+ // resolveTokenPx is unit-agnostic (Number.parseFloat strips the trailing unit) — reused here for a
36
+ // duration in ms, not the px offset it was originally written for (FAB/Switch).
37
+ const closeMs = resolveTokenPx(closeDurationToken, el);
38
+ const timeout = window.setTimeout(() => {
39
+ el.close();
40
+ setState('closed');
41
+ }, closeMs);
42
+ return () => window.clearTimeout(timeout);
43
+ }, [expanded, closeDurationToken]);
44
+ React.useEffect(() => {
45
+ const el = ref.current;
46
+ if (!el)
47
+ return;
48
+ const handleCancel = (event) => {
49
+ // We own the close choreography above — don't let the browser remove the dialog instantly out
50
+ // from under it. `onDismiss` (not a direct state write) lets the consumer control `expanded`.
51
+ event.preventDefault();
52
+ onDismiss?.();
53
+ };
54
+ // Escape handled on keydown too, not only via the native `cancel` it would trigger:
55
+ // preventDefault here stops that close request, so a press dismisses exactly once — and Escape
56
+ // works the same for synthetic key events (tests), which never fire `cancel`.
57
+ const handleKeyDown = (event) => {
58
+ if (event.key !== 'Escape')
59
+ return;
60
+ event.preventDefault();
61
+ onDismiss?.();
62
+ };
63
+ el.addEventListener('cancel', handleCancel);
64
+ el.addEventListener('keydown', handleKeyDown);
65
+ return () => {
66
+ el.removeEventListener('cancel', handleCancel);
67
+ el.removeEventListener('keydown', handleKeyDown);
68
+ };
69
+ }, [onDismiss]);
70
+ React.useEffect(() => {
71
+ const el = ref.current;
72
+ if (!el || !closeOnBackdropClick)
73
+ return;
74
+ const handleClick = (event) => {
75
+ const rect = el.getBoundingClientRect();
76
+ const insideDialog = event.clientX >= rect.left && event.clientX <= rect.right &&
77
+ event.clientY >= rect.top && event.clientY <= rect.bottom;
78
+ if (!insideDialog)
79
+ onDismiss?.();
80
+ };
81
+ el.addEventListener('click', handleClick);
82
+ return () => el.removeEventListener('click', handleClick);
83
+ }, [onDismiss, closeOnBackdropClick]);
84
+ return { ref, state };
85
+ }
86
+ //# sourceMappingURL=useDialogTransition.js.map
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ export type DisclosureTransitionState = 'closed' | 'open' | 'closing';
3
+ /**
4
+ * Open/close choreography for Accordion's native <details> — sibling to useDialogTransition.ts
5
+ * (same shape, different element API: `el.open = true/false` here instead of `showModal()`/`close()`).
6
+ *
7
+ * Why this exists: naively binding `<details open={isExpanded}>` and letting the browser's own click
8
+ * toggle drive it looks fine expanding, but collapsing never animates — the browser removes the `open`
9
+ * attribute synchronously the instant a click fires, which hides the panel's content before any CSS
10
+ * transition on grid-template-rows/opacity/filter gets a chance to run (same root cause ADR-010 already
11
+ * solved for Modal/SidePanel's native <dialog>). The fix is the same shape: intercept the toggle, keep
12
+ * `open` true and drive a `data-state="closing"` attribute through the real collapse transition, and only
13
+ * flip `open` to false for real once the collapse duration token has elapsed.
14
+ */
15
+ export declare function useDisclosureTransition(expanded: boolean, closeDurationToken: string): {
16
+ ref: React.RefObject<HTMLDetailsElement | null>;
17
+ state: DisclosureTransitionState;
18
+ };
19
+ //# sourceMappingURL=useDisclosureTransition.d.ts.map
@@ -0,0 +1,41 @@
1
+ import * as React from 'react';
2
+ import { resolveTokenPx } from './resolveTokenPx.js';
3
+ /**
4
+ * Open/close choreography for Accordion's native <details> — sibling to useDialogTransition.ts
5
+ * (same shape, different element API: `el.open = true/false` here instead of `showModal()`/`close()`).
6
+ *
7
+ * Why this exists: naively binding `<details open={isExpanded}>` and letting the browser's own click
8
+ * toggle drive it looks fine expanding, but collapsing never animates — the browser removes the `open`
9
+ * attribute synchronously the instant a click fires, which hides the panel's content before any CSS
10
+ * transition on grid-template-rows/opacity/filter gets a chance to run (same root cause ADR-010 already
11
+ * solved for Modal/SidePanel's native <dialog>). The fix is the same shape: intercept the toggle, keep
12
+ * `open` true and drive a `data-state="closing"` attribute through the real collapse transition, and only
13
+ * flip `open` to false for real once the collapse duration token has elapsed.
14
+ */
15
+ export function useDisclosureTransition(expanded, closeDurationToken) {
16
+ const ref = React.useRef(null);
17
+ const [state, setState] = React.useState(expanded ? 'open' : 'closed');
18
+ React.useEffect(() => {
19
+ const el = ref.current;
20
+ if (!el)
21
+ return;
22
+ if (expanded) {
23
+ el.open = true;
24
+ const raf = requestAnimationFrame(() => setState('open'));
25
+ return () => cancelAnimationFrame(raf);
26
+ }
27
+ if (!el.open) {
28
+ setState('closed');
29
+ return;
30
+ }
31
+ setState('closing');
32
+ const closeMs = resolveTokenPx(closeDurationToken, el);
33
+ const timeout = window.setTimeout(() => {
34
+ el.open = false;
35
+ setState('closed');
36
+ }, closeMs);
37
+ return () => window.clearTimeout(timeout);
38
+ }, [expanded, closeDurationToken]);
39
+ return { ref, state };
40
+ }
41
+ //# sourceMappingURL=useDisclosureTransition.js.map
@@ -0,0 +1,3 @@
1
+ import { type ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { clsx } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
6
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: action-bar
3
+ category: navigation
4
+ components: [Button]
5
+ when: "A horizontal group of actions — page-level CTAs, toolbar, table batch actions."
6
+ ---
7
+
8
+ # Pattern: Action Bar
9
+
10
+ ## When to use
11
+
12
+ - Page header actions (Create, Export, Filter)
13
+ - Table batch-selection actions (Delete selected, Move to…)
14
+ - Toolbar in a rich editor or data grid
15
+ - Footer of a dialog/panel
16
+
17
+ ## Anatomy
18
+
19
+ ```
20
+ Page header:
21
+ ┌──────────────────────────────────────────────────────┐
22
+ │ Projects [Import] [New project ▸] │
23
+ └──────────────────────────────────────────────────────┘
24
+
25
+ Batch actions (appears when rows are selected):
26
+ ┌──────────────────────────────────────────────────────┐
27
+ │ 3 selected [Archive] [Move to…] [Delete] │
28
+ └──────────────────────────────────────────────────────┘
29
+ ```
30
+
31
+ ## Button role hierarchy (enforce this order)
32
+
33
+ | Position | Variant | Use case |
34
+ |----------|-------------|--------------------------------------|
35
+ | Last | `primary` | The main CTA — one per bar maximum |
36
+ | Middle | `secondary` | Secondary actions |
37
+ | Any | `ghost` | Tertiary, often icon-only |
38
+ | Isolated | `danger` | Destructive — separate from the rest by a gap |
39
+
40
+ ## Code
41
+
42
+ ```tsx
43
+ import { Button } from '@helixds/react';
44
+ import { IconPlus, IconUpload, IconTrash } from '@tabler/icons-react';
45
+
46
+ /* Page header action bar */
47
+ function PageActions({ onNew, onImport }: { onNew: () => void; onImport: () => void }) {
48
+ return (
49
+ <div
50
+ data-helix-pattern="action-bar"
51
+ style={{ display: 'flex', alignItems: 'center', gap: 'var(--helix-spacing-2xs)' }} // button group: 4px (group-spacing.md)
52
+ >
53
+ <Button variant="secondary" icon={IconUpload} onClick={onImport}>
54
+ Import
55
+ </Button>
56
+ <Button variant="primary" icon={IconPlus} onClick={onNew}>
57
+ New project
58
+ </Button>
59
+ </div>
60
+ );
61
+ }
62
+
63
+ /* Batch action bar with destructive action separated */
64
+ function BatchActions({
65
+ count,
66
+ onArchive,
67
+ onMove,
68
+ onDelete,
69
+ }: {
70
+ count: number;
71
+ onArchive: () => void;
72
+ onMove: () => void;
73
+ onDelete: () => void;
74
+ }) {
75
+ return (
76
+ <div
77
+ data-helix-pattern="action-bar"
78
+ role="toolbar"
79
+ aria-label="Batch actions"
80
+ style={{
81
+ display: 'flex',
82
+ alignItems: 'center',
83
+ gap: 'var(--helix-primitive-spacing-50)',
84
+ }}
85
+ >
86
+ <span style={{ fontSize: 'var(--helix-primitive-fontSize-s)', color: 'var(--helix-color-text-neutral-light)' }}>
87
+ {count} selected
88
+ </span>
89
+
90
+ <div style={{ display: 'flex', gap: 'var(--helix-spacing-2xs)' }}>
91
+ <Button variant="ghost" onClick={onArchive}>Archive</Button>
92
+ <Button variant="ghost" onClick={onMove}>Move to…</Button>
93
+ </div>
94
+
95
+ {/* Danger is separated by a larger gap */}
96
+ <div style={{ marginLeft: 'var(--helix-primitive-spacing-100)' }}>
97
+ <Button
98
+ variant="danger"
99
+ icon={IconTrash}
100
+ onClick={onDelete}
101
+ >
102
+ Delete
103
+ </Button>
104
+ </div>
105
+ </div>
106
+ );
107
+ }
108
+ ```
109
+
110
+ ## Rules
111
+
112
+ 1. Maximum one `primary` button per bar — it signals the most important action
113
+ 2. Danger button must be visually separated (extra margin, or positioned at the opposite end)
114
+ 3. Icon-only buttons must have `aria-label` on the Button element itself
115
+ 4. `role="toolbar"` when the bar contains 3+ interactive elements
116
+
117
+ ## Anti-patterns
118
+
119
+ - ❌ Two `primary` buttons side by side — one primary maximum
120
+ - ❌ `danger` button immediately adjacent to `primary` without a gap — users will misclick
121
+ - ❌ Putting destructive action first/leftmost — it's read last, not first
122
+ - ❌ `ghost` for the main CTA in a toolbar — it disappears visually
123
+
124
+ ## Tokens used
125
+
126
+ - `--helix-primitive-spacing-2` — default gap between buttons
127
+ - `--helix-primitive-spacing-4` — separation gap before danger button
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: border-always
3
+ category: foundation
4
+ components: [Badge, Button, Chip, IconButton, Input, Select, Textarea, Checkbox, RadioButton, Card]
5
+ when: "Building or changing any component that has a border in at least one of its variants or states."
6
+ ---
7
+
8
+ # Pattern: Border always
9
+
10
+ **A rule, not a component.** If a component has a border in any variant or state, it has that border in
11
+ **every** variant and state, at the same width. States and variants change the border's **color** only —
12
+ never whether it exists, never its width.
13
+
14
+ ## Why
15
+
16
+ A border takes up space. When it appears in one state and disappears in another, the component changes
17
+ size between them: the label shifts, the row reflows, a chip gets 2px narrower when it's toggled. That
18
+ happened in Figma (the old checked Chip lost its stroke, and with the stroke counted in the layout the chip
19
+ shrank). One border, always there, keeps every state the exact same size.
20
+
21
+ ## Rule
22
+
23
+ - **Code:** declare the border once on the base rule (`border: var(--helix-borderWidth-thin) solid …`).
24
+ State and variant rules only set `border-color`. When a state shouldn't show a border, set
25
+ `border-color` to the same color as the fill (or `transparent`) — never `border: none` / `border-width: 0`.
26
+ (Resetting the native border of an inner element — the `<input>` inside Input's wrapper, a bare icon
27
+ button — is not a state change and is fine.)
28
+ - **Figma:** every variant of the component carries the stroke, same weight, same alignment. The stroke **counts in the auto layout**
29
+ (`strokesIncludedInLayout = true`, "Include stroke in layout") — code is `border-box`, so the 1px border
30
+ sits between the edge and the padding; without it the Figma component is 2px narrower and its content
31
+ 1px closer to the edge. A state with
32
+ "no visible border" binds the stroke to the same Theme variable as the fill underneath — the stroke is
33
+ still there, so the frame keeps its size.
34
+ - **Checked by:** `scripts/figma/audit-component.js` (check 6, `border`) — fails when a layer has a stroke
35
+ in some variants and none, or a different weight, in others.
36
+
37
+ ## Applies to
38
+
39
+ Every bordered component: Badge, Button (ghost keeps a 1px transparent border), Chip, IconButton, Input,
40
+ Select, Textarea, MultiSelect, Checkbox, RadioButton, Card.
@@ -0,0 +1,15 @@
1
+ # Data Analytics
2
+
3
+ Use `Chart` from `@helixds/react`; it is the only approved renderer and applies the Helix ECharts theme.
4
+
5
+ - `line`: trend across ordered dates or sequence.
6
+ - `bar`: discrete-category comparison.
7
+ - `stacked-bar`: total and composition across categories.
8
+ - `donut`: a small part-to-whole distribution; no more than six meaningful slices.
9
+ - `timeline`: dated events or status periods.
10
+
11
+ Put a dashboard chart in `Card`. Pair it with its key takeaway in a card header or `PageHeader`, and use
12
+ `Table` for exact values. Use `Badge` for status, never custom legend pills.
13
+
14
+ Never import `echarts` in a product or pass raw ECharts options. Never invent chart colours, fonts,
15
+ margins, tooltip styles, shadows, or legends: `Chart` resolves Helix tokens.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: disabled-state
3
+ category: color
4
+ components: [Button, IconButton, Input, Select, MultiSelect, Textarea, Menu, Checkbox, CheckboxGroup, RadioButton, RadioGroup, Switch, SegmentedControl, Chip]
5
+ when: "Building or touching any interactive component's disabled state — the control itself, or a label/text sitting next to it."
6
+ ---
7
+
8
+ # Pattern: Disabled state
9
+
10
+ **Rule: disabled means a real, solid gray look built from dedicated `component.{name}.fill/text/icon/border.disabled`
11
+ tokens (aliasing `semantic.color.fill/text/icon/border.disabled`) — never `opacity`.** Decided 2026-09-13, after
12
+ Button's disabled state turned out to be sharing a bare `opacity: 0.5` rule with its own `loading` state (see
13
+ "Loading is not disabled" below for why that combination was itself wrong, independent of the opacity issue).
14
+
15
+ ## Why not opacity
16
+
17
+ `opacity` fades everything inside the element toward whatever's behind it — background, border, text, icon,
18
+ all at once, at whatever contrast ratio falls out of the underlying colors and the page behind them. That's
19
+ the right tool for a large surface or an image going translucent as a whole (an entire disabled table, a
20
+ preview thumbnail) — but for a compact control (a button, an input, a checkbox), it means the disabled look
21
+ is never actually authored: it's a mechanical dimming of whatever colors were already there, landing on a
22
+ different effective gray per variant and per theme instead of one deliberate, consistent look.
23
+
24
+ ## The rule
25
+
26
+ 1. **Background** → `component.{name}.fill.disabled` → `{semantic.color.fill.disabled}`
27
+ 2. **Text** → `component.{name}.text.disabled` → `{semantic.color.text.disabled}`
28
+ 3. **Icon** (if the component renders one) → `component.{name}.icon.disabled` → `{semantic.color.icon.disabled}`
29
+ 4. **Border** (if the component has one) → `component.{name}.border.disabled` → `{semantic.color.border.neutral-light}`
30
+ — the established convention across every compliant component so far, not a dedicated
31
+ `semantic.color.border.disabled` (no such token exists).
32
+
33
+ These semantic tokens are already documented as not-WCAG-compliant by design (see
34
+ `semantic.color.text.disabled`'s own `$description`) — a disabled control is expected to read as visibly
35
+ inert, not to pass 4.5:1. Don't chase a contrast fix here; that's the intended contrast.
36
+
37
+ ## Every text part dims — not only the control (owner's decision 2026-10-20)
38
+
39
+ When a component is disabled, **all of its text goes to `component.{name}.text.disabled`**: the label, the
40
+ description, the required `*`, a group's legend and description. A disabled field whose label or hint stays
41
+ dark reads as half-enabled. The required `*` is its own part (`{name}-required`, never an inline style) so the
42
+ rule can reach it. The error message keeps its danger color — it's still information the user needs.
43
+
44
+ - **Code:** one rule per component, `[...-root][data-disabled] [...-label | -required | -description]`
45
+ (a group: the `fieldset[data-disabled]` legend, its `*` and the group description).
46
+ - **Figma:** the same — every disabled variant binds those text layers to `text/disabled`. Disabled has **no**
47
+ hover / focus / invalid variants (`state` is default only): a disabled control doesn't react or validate.
48
+ - **Contrast:** exempt (WCAG 1.4.3, "part of an inactive user interface component"; root CLAUDE.md rule 9).
49
+ axe alone only knows that for a disabled control's own `<label>`, so the test-runner drops contrast nodes
50
+ inside `[disabled]` / `[data-disabled]` / `[aria-disabled="true"]` — a disabled story never lowers a
51
+ component's status.
52
+
53
+ ## Loading is not disabled — don't let them share CSS
54
+
55
+ A `loading` state is not a disabled state, even though the element commonly gets the native `disabled`
56
+ attribute in both cases so it can't be interacted with mid-request (see `Button.tsx`:
57
+ `disabled={disabled || loading}`). Visually they're opposites: loading keeps the component's normal variant
58
+ colors — the user should still see "this is the primary/danger action," just busy right now — the spinner in
59
+ front of the label is the only visible change. Disabled visually recedes. Because the native `disabled`
60
+ attribute is shared, every disabled-only CSS rule needs `:not([data-loading])` (or the component's own
61
+ loading attribute) so loading doesn't fall into the gray look by accident — see Button's
62
+ `[data-helix-part="button"]:disabled:not([data-loading])` rule.
63
+
64
+ ## Status (as of 2026-09-13)
65
+
66
+ Every component in the list above is compliant — no `opacity`-based disabled state left anywhere in
67
+ `globals.css`. Fixing the rest of the list turned up two components (`Checkbox`, `RadioButton`) whose
68
+ `fill.disabled`/`border.disabled` tokens already existed in `tokens.json` but were never wired into any CSS
69
+ rule — the control itself was fading via the same bare opacity as its label, silently ignoring its own
70
+ dedicated tokens. Both are now wired: `[data-helix-part="{checkbox,radio}-input"]:disabled + [...]-control`
71
+ sets the real disabled fill/border, placed after the `:checked` rule in source order so it wins when an item
72
+ is both checked and disabled.
73
+
74
+ ## Reference
75
+
76
+ - `packages/core/src/globals.css` — Button's `[data-helix-part="button"]:disabled:not([data-loading])` block
77
+ (plus its icon-color sibling rule) is the reference implementation.
78
+ - `packages/tokens/src/tokens.json` — `component.button.fill/text/icon/border.disabled`.
79
+ - [form-field-spacing.md](form-field-spacing.md) — the sibling pattern for how a cross-component rule gets
80
+ enforced here: one canonical approach, documented exceptions, a reference implementation named explicitly.