@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,130 @@
1
+ ---
2
+ name: empty-state
3
+ category: feedback
4
+ components: [Badge, Button]
5
+ when: "The view has no data to display — first use, zero results, or filtered to nothing."
6
+ ---
7
+
8
+ # Pattern: Empty State
9
+
10
+ ## When to use
11
+
12
+ - Table/list has zero rows
13
+ - Search returned no results
14
+ - First-use onboarding (before the user has created anything)
15
+ - Permission-denied placeholder
16
+
17
+ ## When NOT to use
18
+
19
+ - Loading state — use Skeleton instead
20
+ - Error state — use Error State pattern
21
+ - Single missing field — use inline field validation
22
+
23
+ ## Anatomy
24
+
25
+ ```
26
+ ┌─────────────────────────────┐
27
+ │ [Illustration] │ Optional: Tabler icon at 48px, color-icon-neutral-light
28
+ │ │
29
+ │ No projects yet │ font-size-xl, font-weight-semibold, text-neutral
30
+ │ Create your first project │ font-size-s, text-neutral-light, max-width 320px
31
+ │ │
32
+ │ [New project] [Import] │ Primary + Secondary buttons
33
+ └─────────────────────────────┘
34
+ ```
35
+
36
+ ## Components used
37
+
38
+ | Component | Role in pattern |
39
+ |-----------|-------------------------------------------|
40
+ | Button | Primary CTA + optional secondary action |
41
+ | Badge | Optional context label (e.g. "Beta") |
42
+
43
+ ## Code
44
+
45
+ ```tsx
46
+ import { Button } from '@helixds/react';
47
+ import { IconFolderOpen } from '@tabler/icons-react';
48
+
49
+ function EmptyState({
50
+ icon = <IconFolderOpen size={48} />,
51
+ title,
52
+ description,
53
+ action,
54
+ secondaryAction,
55
+ }: {
56
+ icon?: React.ReactNode;
57
+ title: string;
58
+ description?: string;
59
+ action?: { label: string; onClick: () => void };
60
+ secondaryAction?: { label: string; onClick: () => void };
61
+ }) {
62
+ return (
63
+ <div
64
+ data-helix-pattern="empty-state"
65
+ style={{
66
+ display: 'flex',
67
+ flexDirection: 'column',
68
+ alignItems: 'center',
69
+ gap: 'var(--helix-primitive-spacing-100)',
70
+ padding: 'var(--helix-primitive-spacing-12)',
71
+ textAlign: 'center',
72
+ }}
73
+ >
74
+ {icon && (
75
+ <span style={{ color: 'var(--helix-color-text-neutral-light)' }} aria-hidden="true">
76
+ {icon}
77
+ </span>
78
+ )}
79
+
80
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 'var(--helix-primitive-spacing-50)' }}>
81
+ <h3 style={{
82
+ fontSize: 'var(--helix-primitive-fontSize-xl)',
83
+ fontWeight: 'var(--helix-primitive-fontWeight-semibold)',
84
+ color: 'var(--helix-color-text-neutral)',
85
+ margin: 0,
86
+ }}>
87
+ {title}
88
+ </h3>
89
+ {description && (
90
+ <p style={{
91
+ fontSize: 'var(--helix-primitive-fontSize-s)',
92
+ color: 'var(--helix-color-text-neutral-light)',
93
+ maxWidth: '320px',
94
+ margin: 0,
95
+ }}>
96
+ {description}
97
+ </p>
98
+ )}
99
+ </div>
100
+
101
+ {(action || secondaryAction) && (
102
+ <div style={{ display: 'flex', gap: 'var(--helix-spacing-2xs)' }}>
103
+ {action && (
104
+ <Button variant="primary" onClick={action.onClick}>{action.label}</Button>
105
+ )}
106
+ {secondaryAction && (
107
+ <Button variant="secondary" onClick={secondaryAction.onClick}>
108
+ {secondaryAction.label}
109
+ </Button>
110
+ )}
111
+ </div>
112
+ )}
113
+ </div>
114
+ );
115
+ }
116
+ ```
117
+
118
+ ## Anti-patterns
119
+
120
+ - ❌ Using a custom `<div className="text-gray-400">` for text — use `--helix-color-text-neutral-light`
121
+ - ❌ Hardcoding the icon color — always use a semantic token
122
+ - ❌ Multiple primary buttons — one primary CTA maximum
123
+ - ❌ Adding a button just because the pattern has one — omit if there's no meaningful action
124
+
125
+ ## Tokens used
126
+
127
+ - `--helix-color-text-neutral-light` — icon and description text
128
+ - `--helix-color-text-neutral` — title text
129
+ - `--helix-primitive-spacing-*` — gap and padding
130
+ - `--helix-primitive-fontSize-xl` — title size
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: expand-collapse-chevron
3
+ category: motion
4
+ components: [Accordion, Select]
5
+ when: "Adding a chevron/caret indicator to any component that expands, collapses, opens, or closes."
6
+ ---
7
+
8
+ # Pattern: Expand/collapse chevron
9
+
10
+ **Rule: any hand-rolled component whose own code toggles an open/closed state — an accordion, a future
11
+ dropdown, a combobox, a collapsible tree row, anything in that shape — uses `IconChevronDown` (via the
12
+ `Icon` wrapper, never rendered raw) with a vertical scaleY flip between states, driven by that component's
13
+ own duration/easing tokens.** Do not invent a new rotation treatment (a different icon, `rotate(180deg)`,
14
+ a different easing curve) for a new disclosure component — reuse this one, the same way `SPRING_SNAPPY` is
15
+ reused for sliding indicators instead of a new spring being tuned per component (see
16
+ [motion-effects.md](motion-effects.md)).
17
+
18
+ This is **plain CSS**, not Motion — a transform transition tracking a `data-state`/`data-*` attribute the
19
+ component already sets, not a `motion.*` element. It does not belong in `motion-effects.md`'s Motion
20
+ effects table for that reason, but follows the same "one canonical treatment, reused" philosophy that file
21
+ establishes for Motion-based effects.
22
+
23
+ ## The pattern, concretely (from `Accordion`)
24
+
25
+ ```tsx
26
+ import { IconChevronDown } from '@tabler/icons-react';
27
+ import { Icon } from '../Icon';
28
+
29
+ <span data-helix-part="{component}-chevron" aria-hidden="true">
30
+ <Icon icon={IconChevronDown} size={16} />
31
+ </span>
32
+ ```
33
+
34
+ ```css
35
+ [data-helix-part="{component}-chevron"] {
36
+ display: inline-flex;
37
+ color: var(--helix-{component}-chevron);
38
+ transform: scaleY(1); /* closed — chevron points down */
39
+ transform-origin: center;
40
+ transition: transform var(--helix-{component}-duration-chevron) var(--helix-{component}-easing-collapse);
41
+ }
42
+ [data-helix-part="{component}-root"][data-state="open"] [data-helix-part="{component}-chevron"] {
43
+ transform: scaleY(-1); /* open — chevron points up */
44
+ transition: transform var(--helix-{component}-duration-chevron) var(--helix-{component}-easing);
45
+ }
46
+ ```
47
+
48
+ - **`scaleY(-1)`, not `rotate(180deg)`.** A vertical flip is the deliberate choice for a symmetric
49
+ chevron glyph — visually identical result, no diagonal artifact mid-transition the way a rotation
50
+ transform can read on some renderers.
51
+ - **Two token references, `easing` and `easing-collapse`** — kept as two separate component tokens even
52
+ though both currently alias the same `semantic.easing.base` value (see `Accordion`'s own tokens in
53
+ `tokens.json`). This is intentional headroom, not redundancy: `Accordion`'s collapse animation went
54
+ through several broken iterations before landing here (a laggy, asymmetric-feeling collapse traced to
55
+ `grid-template-rows: 0fr/1fr` interpolation, not the chevron itself — see the panel's own note in
56
+ `Accordion.tsx`) and having the two directions independently addressable in tokens is what made that
57
+ debugging possible. A new component adopting this pattern should still define both, even if they start
58
+ out equal.
59
+ - **`--helix-{component}-duration-chevron`** — its own token, not reused from a shared "chevron duration"
60
+ constant, so each component can retune independently if its container is a different size/weight than
61
+ Accordion's panel.
62
+
63
+ ## `Select`: real now, not the exception it used to be
64
+
65
+ Until 2026-09-12, `Select.json`'s `select-chevron` was documented here as the one static exception —
66
+ `Select` wrapped a real native `<select>` (ADR-001), and a native listbox's open/closed state was never
67
+ exposed to CSS, so there was nothing to hook a rotation to. That's no longer true: `Select` was rebuilt on
68
+ the new `Menu` primitive (ADR-013) — its trigger is a real `<button>` whose own React state (and
69
+ `aria-expanded`) knows exactly when the popup is open. The chevron now flips for real, using this exact
70
+ pattern, keyed off `[aria-expanded="true"]` on the trigger itself rather than a `data-state` attribute on a
71
+ separate `-root` part (see `globals.css`'s `[data-helix-part="select-trigger"][aria-expanded="true"] ~
72
+ [data-helix-part="select-chevron"]`) — a sibling-selector variant of the same rule, not a different one.
73
+
74
+ **The dividing line, updated:** does the component's own React state know whether it's open or closed right
75
+ now — whether that's exposed as `data-state` on a root (`Accordion`) or `aria-expanded` on a trigger
76
+ (`Select`)? If yes, this pattern applies, keyed off whichever attribute that component actually sets. If
77
+ the "open" state lives entirely inside the browser/OS with no hook back into the component at all (a raw
78
+ native `<details>`'s own marker triangle before it's replaced — see `Accordion.tsx`'s own
79
+ `::-webkit-details-marker { display: none }` override — or any future case of wrapping a native disclosure
80
+ element with truly no accessible state), it doesn't, and a static icon is correct there instead.
81
+
82
+ ## Applying this to a new component
83
+
84
+ 1. Render the chevron through `Icon` with `IconChevronDown` — never a raw Tabler import (`verify:icons`
85
+ enforces this regardless).
86
+ 2. Add `{component}.chevron` (color), `{component}.duration-chevron`, `{component}.easing`, and
87
+ `{component}.easing-collapse` to that component's `tokens.json` block, aliasing `semantic.*` values —
88
+ see `packages/tokens/CLAUDE.md`'s "Adding a token" steps.
89
+ 3. Copy the two CSS rules above verbatim, swapping in the real `data-helix-part` names.
90
+ 4. Add a row to this file's nothing-to-add-here table (there isn't one yet — if a second real consumer
91
+ ships, add a short table here the way `motion-effects.md` does for its own approved-effects list).
92
+ 5. Confirm the component's own root sets `data-state="open"`/`data-state="closed"` (or equivalent) so the
93
+ selector above has something real to match — this pattern assumes that attribute already exists as part
94
+ of the component's normal anatomy, it doesn't introduce it.
95
+
96
+ ## Reference
97
+
98
+ - `packages/core/src/components/Accordion/Accordion.tsx` / `Accordion.json` — the canonical
99
+ implementation and contract wording.
100
+ - [motion-effects.md](motion-effects.md) — the sibling pattern file for Motion-based (JS) effects; read
101
+ both before adding any new interactive animation.
@@ -0,0 +1,139 @@
1
+ ---
2
+ name: form-field-group
3
+ category: form
4
+ components: [Input, Button, Badge]
5
+ when: "A form with 2-6 fields, a submit action, and optional inline validation."
6
+ ---
7
+
8
+ # Pattern: Form Field Group
9
+
10
+ ## When to use
11
+
12
+ - Login, registration, settings, create/edit forms
13
+ - Up to ~6 fields visible at once (beyond that, consider multi-step)
14
+
15
+ ## Anatomy
16
+
17
+ ```
18
+ ┌─────────────────────────────────────────┐
19
+ │ [Badge variant="danger"] │ Auth error — only when submit fails
20
+ │ │
21
+ │ Email * │ Input, required
22
+ │ ┌─────────────────────────────────┐ │
23
+ │ │ you@example.com │ │
24
+ │ └─────────────────────────────────┘ │
25
+ │ │
26
+ │ Password * │ Input, required, type="password"
27
+ │ ┌─────────────────────────────────┐ │
28
+ │ │ •••••••• │ │
29
+ │ └─────────────────────────────────┘ │
30
+ │ Min. 8 characters │ description prop
31
+ │ │
32
+ │ [Cancel] [Sign in ↗] │ Button secondary + primary
33
+ └─────────────────────────────────────────┘
34
+ ```
35
+
36
+ ## Components used
37
+
38
+ | Component | Role |
39
+ |-----------|-----------------------------------------------|
40
+ | Input | All form fields |
41
+ | Button | Submit (primary) + Cancel/secondary (secondary)|
42
+ | Badge | Top-level form error after failed submit |
43
+
44
+ ## Code
45
+
46
+ ```tsx
47
+ import { useState } from 'react';
48
+ import { Input, Button, Badge } from '@helixds/react';
49
+ import { IconMail, IconLock } from '@tabler/icons-react';
50
+
51
+ function LoginForm({ onSubmit }: { onSubmit: (data: { email: string; password: string }) => Promise<void> }) {
52
+ const [email, setEmail] = useState('');
53
+ const [password, setPassword] = useState('');
54
+ const [emailInvalid, setEmailInvalid] = useState(false);
55
+ const [isLoading, setIsLoading] = useState(false);
56
+ const [formError, setFormError] = useState<string | null>(null);
57
+
58
+ async function handleSubmit(e: React.FormEvent) {
59
+ e.preventDefault();
60
+ setFormError(null);
61
+ setEmailInvalid(false);
62
+
63
+ if (!email.includes('@')) {
64
+ setEmailInvalid(true);
65
+ return;
66
+ }
67
+
68
+ setIsLoading(true);
69
+ try {
70
+ await onSubmit({ email, password });
71
+ } catch {
72
+ setFormError('Incorrect email or password. Please try again.');
73
+ } finally {
74
+ setIsLoading(false);
75
+ }
76
+ }
77
+
78
+ return (
79
+ <form onSubmit={handleSubmit} noValidate style={{ display: 'flex', flexDirection: 'column', gap: 'var(--helix-primitive-spacing-125)', maxWidth: '360px' }}>
80
+
81
+ {formError && (
82
+ <Badge variant="danger" label={formError} />
83
+ )}
84
+
85
+ <Input
86
+ label="Email"
87
+ type="email"
88
+ required
89
+ autoComplete="email"
90
+ icon={IconMail}
91
+ value={email}
92
+ onChange={e => setEmail(e.target.value)}
93
+ invalid={emailInvalid}
94
+ errorMessage="Enter a valid email address"
95
+ fullWidth
96
+ />
97
+
98
+ <Input
99
+ label="Password"
100
+ type="password"
101
+ required
102
+ autoComplete="current-password"
103
+ icon={IconLock}
104
+ description="Min. 8 characters"
105
+ value={password}
106
+ onChange={e => setPassword(e.target.value)}
107
+ fullWidth
108
+ />
109
+
110
+ <div style={{ display: 'flex', gap: 'var(--helix-spacing-2xs)', justifyContent: 'flex-end' }}>
111
+ <Button variant="secondary" type="button" onClick={() => {}}>Cancel</Button>
112
+ <Button variant="primary" type="submit" isLoading={loading}>Sign in</Button>
113
+ </div>
114
+ </form>
115
+ );
116
+ }
117
+ ```
118
+
119
+ ## Rules
120
+
121
+ 1. One primary button maximum per form
122
+ 2. Cancel is always `variant="secondary"`, not ghost (ghost is invisible in context)
123
+ 3. Form-level errors → `Badge variant="danger"` at top
124
+ 4. Field-level errors → `errorMessage` prop on Input with `invalid` state
125
+ 5. Always use `required` + `aria-required` via the Input's `required` prop
126
+ 6. Never disable the submit button to prevent submission — use `isLoading` + server validation
127
+
128
+ ## Anti-patterns
129
+
130
+ - ❌ `<input className="border border-red-500" />` — use `<Input invalid errorMessage="..." />`
131
+ - ❌ Generic `<div style={{ color: 'red' }}>Error</div>` — use `<Badge variant="danger" />`
132
+ - ❌ `loading` prop — use `isLoading`
133
+ - ❌ `onPress` on Button — use `onClick`
134
+ - ❌ `type="primary"` — use `variant="primary"`
135
+
136
+ ## Tokens used
137
+
138
+ - `--helix-primitive-spacing-5` — gap between fields
139
+ - `--helix-primitive-spacing-3` — gap between action buttons
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: form-field-spacing
3
+ category: spacing
4
+ components: [Input, Select, Textarea, Checkbox, CheckboxGroup, RadioGroup, RadioButton]
5
+ when: "Adding or touching the vertical spacing around any form field's label or description/error text."
6
+ ---
7
+
8
+ # Pattern: Form field spacing
9
+
10
+ **Rule: every form field's label-to-control gap, and its control-to-description/error gap, is
11
+ exactly `semantic.spacing.component-s` (8px) — the same value, everywhere, no per-component
12
+ exception.** This applies to `Input`, `Select`, `Textarea`, `Checkbox`, `CheckboxGroup`,
13
+ `RadioGroup`, and `RadioButton`. Decided after review found these had silently drifted — Select
14
+ briefly shipped a 16px label gap as a one-off before this rule replaced it, and every other
15
+ component here was hardcoding a raw `primitive.spacing.25` (4px, sometimes coincidentally
16
+ `primitive.spacing.50`/8px) with no component token backing it at all. Neither was a deliberate
17
+ exception; all are now 8px, tokenized properly.
18
+
19
+ ## The two gaps this covers
20
+
21
+ 1. **Label → control.** For `Input`/`Select`/`Textarea`, the space between the visible `*-label`
22
+ and the field itself. For `CheckboxGroup`/`RadioGroup`, the equivalent is their `*-legend` (a
23
+ fieldset's own stacked group label) to `*-options` — same concept, same 8px. The standalone
24
+ `Checkbox`/`RadioButton` don't have a separate stacked label at all — their label sits inline
25
+ beside the control, not above it — so this half of the rule doesn't apply to them structurally;
26
+ skip it, don't force a gap that doesn't correspond to anything in their anatomy.
27
+ 2. **Control → description/error.** The space between the field (or, for the group components, the
28
+ whole options block; for standalone Checkbox/RadioButton, the control+label row) and its own
29
+ `*-description`/`*-error` text below it. This half applies to **all seven** components — every
30
+ one of them can render a description or error line, and that gap is 8px everywhere.
31
+
32
+ ## The one documented exception: `Switch`
33
+
34
+ `Switch` does not follow this rule. Its own label sits **beside** the toggle in a horizontal row,
35
+ not above a stacked field — a different spatial relationship entirely, not a vertical "label above
36
+ control" gap this rule is about. Do not force `component-s` onto Switch's toggle↔label gap; that's
37
+ a different design question (horizontal control-to-label spacing), out of this rule's scope.
38
+
39
+ ## Implementation
40
+
41
+ Each component gets its own `gap` token under `component.{name}.gap`, aliasing
42
+ `semantic.spacing.component-s` — never a raw `primitive.spacing.*` reference and never a literal.
43
+ Since label→control and control→description want the same value everywhere today, one shared
44
+ token is enough — don't split into two identically-valued tokens purely for documentation's sake.
45
+ A plain flex `gap` on the root usually applies it to every in-flow child directly; a `*-legend`
46
+ using `float: left` (RadioGroup/CheckboxGroup) sits outside that flow and needs the same token
47
+ applied as its own explicit `margin-bottom` instead, since flex `gap` skips floated children.
48
+
49
+ ## Multi-field forms: fields, blocks, and section headers
50
+
51
+ A longer form (settings pages, onboarding flows — see `Pages/Form`) groups fields into
52
+ labeled **blocks** (e.g. "Personal info", "Workspace", "Preferences"). This is a page-level layout
53
+ pattern, not a single component, so there's no `component.*` token for it — these are `primitive.spacing.*`
54
+ values applied directly at the composition site, same as any other layout decision `CLAUDE.md`
55
+ leaves to the consumer/pattern. Three distinct gaps, not to be confused with each other:
56
+
57
+ 1. **Between fields within one block** — 16px (`primitive.spacing.100`). Note this is **double**
58
+ the 8px label/description gap above — that 8px is the *tight* gap around one field's own parts;
59
+ this 16px is the *looser* gap separating one whole field from the next.
60
+ 2. **Block header → its first field** — also 16px (`primitive.spacing.100`), the same value as #1.
61
+ A block's header behaves like just another sibling in that block's own field stack, not a
62
+ separately-spaced element.
63
+ 3. **Between blocks** (one labeled section's last field/divider to the next block's header) —
64
+ 24px (`primitive.spacing.150`), deliberately larger than #1/#2 so a scan of the page reads the
65
+ block boundaries before the field boundaries within them.
66
+
67
+ **Block header typography: `semantic.textStyle.heading-m-bold`** (14px, bold, normal case) —
68
+ not the smaller, muted, uppercase "eyebrow" treatment `Menu`'s own group label uses
69
+ (`label-uppercase`, a different, much quieter role for a popup listbox, not a full page section).
70
+ A form block header is a real heading; render it as one.
71
+
72
+ ```tsx
73
+ <form style={{ display: 'flex', flexDirection: 'column', gap: 'var(--helix-primitive-spacing-150)' }}>
74
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 'var(--helix-primitive-spacing-100)' }}>
75
+ <h3 style={{
76
+ margin: 0,
77
+ fontSize: 'var(--helix-textStyle-heading-m-bold-fontSize)',
78
+ fontWeight: 'var(--helix-textStyle-heading-m-bold-fontWeight)',
79
+ lineHeight: 'var(--helix-textStyle-heading-m-bold-lineHeight)',
80
+ color: 'var(--helix-color-text-neutral)',
81
+ }}>
82
+ Personal info
83
+ </h3>
84
+ <Input label="Full name" ... />
85
+ <Input label="Work email" ... />
86
+ </div>
87
+ {/* next block, 24px away */}
88
+ </form>
89
+ ```
90
+
91
+ ## Reference
92
+
93
+ - `packages/tokens/src/tokens.json` — `component.{input,select,textarea,checkbox,radio}.gap`;
94
+ `semantic.textStyle.heading-m-bold` for block headers.
95
+ - `apps/storybook/stories/ProductPage.stories.tsx` (`Pages/CreateWorkspace`) — the reference
96
+ implementation of the multi-block layout above.
97
+ - [expand-collapse-chevron.md](expand-collapse-chevron.md) — the sibling pattern for a cross-component
98
+ rule enforced the same way (one canonical value, documented exceptions called out explicitly,
99
+ not silently allowed to drift per component).
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: group-spacing
3
+ category: layout
4
+ components: [Button, IconButton, Chip, Badge]
5
+ when: "Placing several elements of the same kind one after another — a button group, a row of chips, a set of badges."
6
+ ---
7
+
8
+ # Pattern: Group spacing
9
+
10
+ **A rule, not a component.** Elements of the same kind placed one after another form a group, and the
11
+ elements inside a group are **4px apart** — `var(--helix-spacing-2xs)`.
12
+
13
+ ## Why
14
+
15
+ A group should read as one unit. At 8px or 12px, two buttons or a row of chips start to read as separate,
16
+ unrelated controls; 4px keeps them visibly together while each one is still distinct and easy to hit.
17
+ One value everywhere also means any group looks the same wherever it appears.
18
+
19
+ ## Rule
20
+
21
+ - **Same kind, one after another → 4px** (`--helix-spacing-2xs`):
22
+ - button groups — page header actions, a form's Cancel/Submit, a Modal footer, a toolbar
23
+ - icon-button groups — a view toggle, row actions
24
+ - chip groups — active filters, selected values
25
+ - badge groups — several statuses or tags on one item
26
+ - **Between different groups → more space** (8px or more), so the groups read apart. The one deliberate
27
+ case: a destructive action is set apart from the rest (see `action-bar.md` — Delete sits 16px away).
28
+ - **Not a group:** a control next to unrelated content (a search field and its Clear button are 4px apart
29
+ because they act as one control row, but a heading and its actions are not a group).
30
+
31
+ ## Code
32
+
33
+ ```tsx
34
+ <div style={{ display: 'flex', gap: 'var(--helix-spacing-2xs)' }}>
35
+ <Button variant="secondary">Cancel</Button>
36
+ <Button variant="primary">Save</Button>
37
+ </div>
38
+
39
+ <div aria-label="Active filters" style={{ display: 'flex', flexWrap: 'wrap', gap: 'var(--helix-spacing-2xs)' }}>
40
+ {filters.map(f => <Chip key={f.key} label={f.label} dismissible onDismiss={() => remove(f.key)} />)}
41
+ </div>
42
+ ```
43
+
44
+ ## Where it's applied
45
+
46
+ Search + Filter (chips, and field ↔ Clear), Empty State and Action Bar buttons, Batch actions, the view
47
+ toggle, Team Dashboard's Export + view toggle, Form Field Group's Cancel/Submit, Modal's footer
48
+ (`component.modal.footerGap` → `semantic.spacing.2xs`), and the selected chips inside MultiSelect.
49
+
50
+ ## Anti-patterns
51
+
52
+ - ❌ A hand-picked 6px / 8px / 12px between buttons of the same group
53
+ - ❌ The same gap between two different groups as inside one — they stop reading as separate
54
+ - ❌ A hardcoded `4px` instead of `var(--helix-spacing-2xs)`
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: motion-effects
3
+ category: motion
4
+ components: [FAB, Switch, Button, IconButton, Checkbox, RadioGroup, Chip, NavItem, Input, Menu, Toast, Chart]
5
+ when: "Deciding whether a component should use a Motion-based animation, and how."
6
+ ---
7
+
8
+ # Pattern: Motion effects
9
+
10
+ Governed by [ADR-007](../../docs/ADR/ADR-007-motion-engine.md) (supersedes
11
+ [ADR-006](../../docs/ADR/ADR-006-liquid-motion-effects.md), which adopted `liquid-gooey` — replaced the same
12
+ day after real debugging cost). Read ADR-007's two hard rules before using any of this — this file is the
13
+ day-to-day reference, the ADR is the reasoning.
14
+
15
+ ## What's available
16
+
17
+ | Need | Motion API | Import |
18
+ |------|-----------|--------|
19
+ | Simple position/scale/opacity animation | `motion.<element>` with `animate`/`initial`/`exit` + `transition` | `import { motion } from 'motion/react'` |
20
+ | Mount/unmount transitions | `AnimatePresence` wrapping conditionally-rendered `motion.*` children | `import { AnimatePresence } from 'motion/react'` |
21
+ | Drag-to-reorder a list | `Reorder.Group`/`Reorder.Item` — both take an `as` prop for real semantic elements (`as="tbody"`/`as="tr"`, not just the `ul`/`li` defaults) | `import { Reorder, useDragControls } from 'motion/react'` |
22
+
23
+ There is no gooey blob-merge equivalent — Motion animates individual elements' transform/opacity/color, it
24
+ doesn't blend SVG silhouettes into one shape. Don't reach for Motion expecting that specific look; that was
25
+ `liquid-gooey`'s one differentiator and it's gone with it (see ADR-007's Consequences).
26
+
27
+ ## Approved component ↔ effect table
28
+
29
+ | Component | What | Status |
30
+ |-----------|------|--------|
31
+ | `FAB` | Speed-dial expand/collapse — `AnimatePresence` + `motion.button` per action (fade/scale/slide, not a shape merge), plus a squish-and-release `animate={{ scale }}` bounce on the trigger when it collapses. | Shipped. |
32
+ | `Switch` | Thumb position — `motion.span` + spring `animate`/`transition`. | Shipped. |
33
+ | Table rows / Cards | Drag-reorder — `Reorder.Group`/`Reorder.Item`, `as="tbody"`/`as="tr"` for table rows. | **Storybook-only pattern**. Try it interactively in `Components/Table`'s `DragReorder` story (`apps/storybook/stories/Components/Table.stories.tsx`, `DragRow`), or in context in `apps/storybook/stories/Dashboard.stories.tsx` (`MemberRow`, `handleReorder`). Not a shipped Table/Card prop — do not wire this into the real contracts without a follow-up decision, same status the earlier Bend spike had. **Two things every drag row must do:** `e.preventDefault()` in the grip's `onPointerDown` before `dragControls.start(e)` (otherwise the browser selects the text of every row the pointer crosses), and `data-dragging` on the `Reorder.Item` via `onDragStart`/`onDragEnd` (Table's CSS then keeps that row highlighted and switches off the other rows' hover fill + transition — without it, rows sliding under the pointer flash). **And it must be accessible (WCAG 2.1.1 + 2.5.7) — drag alone fails both:** use `apps/storybook/stories/_shared/row-reorder.tsx`: `ReorderGrip` (the grip is a real IconButton that also works from the keyboard: Space picks up, ↑/↓ move, Space drops, Escape cancels), `RowMoveMenu` (the row's ⋯ menu: Move to top / up / down / to bottom — the no-drag alternative), `ReorderInstructions` + `useReorderAnnouncer` (polite live region with the new position). Focus returns to the moved row. Chosen 2026-10-11 (option C + A). |
34
+ | `Chip` (dismiss) | Merge-on-dismiss (blob fusing into a neighbor). | **Tried and removed** — was a `liquid-gooey` spike (`ChipGroup.tsx`, deleted); there's no Motion equivalent for the shape-merge look. What shipped instead: a plain fade+scale-down exit, `animate`/`onAnimationComplete` — the real `onDismiss()` callback fires only once the exit finishes, so the consumer's list update lands exactly as the chip is already invisible. |
35
+ | `Button` / `IconButton` | Press feedback — `whileTap={{ scale }}` (0.97 / 0.94). | Shipped. **No `MotionConfig` here** — `whileTap` only plays while the user is actively pressing, gated on `isDisabled`; it's the same category as a CSS `:active` pseudo-class, which `prefers-reduced-motion` doesn't suppress either. This is the one deliberate exception to checklist item 1 below — don't extend it to any *autoplaying* animation. |
36
+ | `Checkbox` / `RadioGroup` | Check/dot pop-in. | Shipped, but **not Motion** — plain CSS `transform: scale()` transition. The indicator's visibility already tracks the native input's `:checked` state directly, which is correct for both controlled and uncontrolled usage on its own; adding a JS-tracked boolean just to drive Motion here would reintroduce the exact class of controlled/uncontrolled bug found and fixed in Switch, for no visual benefit CSS doesn't already deliver. Left as a documented case of "the checklist says Motion, the right call here is plain CSS." |
37
+ | `NavItem` | Sliding "current" indicator between nav items. | Shipped — `motion.span` with a shared `layoutId` (`ACTIVE_INDICATOR_LAYOUT_ID` in `NavItem.tsx`) across every instance; Motion's layout system animates it moving from the previously-current item to the new one instead of the background just cutting over. |
38
+ | `AvatarGroup` | Hover lift — only the hovered avatar itself lifts/scales, no cascade to neighbors. | Shipped, but **not Motion** — plain CSS `[data-helix-part="avatar-group-item"]:hover`, no JS at all. Went through the preview-first process (`.ai/skills/ds-preview-before-ship.md`): an earlier version cascaded a distance-based falloff to neighboring avatars (JS-computed `data-hover-distance`, Motion-adjacent complexity) — cut after review feedback that only the hovered avatar should move, at which point the whole effect collapsed to a single `:hover` rule and the JS became unnecessary, same "plain CSS is the right call" reasoning as Checkbox/RadioGroup and Input's shake. Values are `component.avatarGroup.hover-lift`/`hover-scale`, aliasing the new generic `semantic.transform.lift.s`/`scale.s` scale (2px lift + 2% scale — the subtler option, chosen for a compact group) (not component-scoped — see `packages/tokens/CLAUDE.md`'s "Motion naming vocabulary" and `Foundation/Semantic`'s Motion story for the full `transform.lift`/`scale.{s,m,l}` scale, most of which no other component consumes yet). Approved 2026-09-24. Under `prefers-reduced-motion: reduce` the avatar doesn't move at all (no lift, scale or transition). |
39
+ | `Menu` (and so `Select`/`MultiSelect`) | Open/close — grows in from its trigger (`menu.scale-enter` 0.97 → 1, `duration.enter`), closes settling to `menu.scale-exit` 0.99 over the shorter `duration.exit`, `easing.gentle`. | Shipped 2026-10-13, **not Motion** — CSS `@keyframes` on mount, plus `Menu.tsx` keeping the list mounted (`data-state="closing"`, `inert`, `aria-hidden`) for the close. transitions.dev "menu dropdown", approved after the preview-first step. Reduced motion: appears and goes at once. |
40
+ | `Button` | Swap in place — with an `icon`, icon ↔ spinner (`isLoading`) and icon ↔ icon cross-fade with blur + scale (`button.swap-*-icon`); a plain-text label cross-blurs while its width eases to the new text (`button.swap-*-label`, `-width`). | Shipped 2026-10-13, **not Motion** — CSS `@keyframes` on the stacked outgoing/incoming children (`data-swapping`) and an inline width transition; `whileTap` press feedback above is unchanged. transitions.dev "icon swap" + "text morph". Only fires when the content actually changes — never on mount. Reduced motion: instant swap. |
41
+ | `Toast` | Stack depth blur — toasts further back soften (half of `toast.depthBlur` at depth 1, all of it at depth 2) and sharpen on spread. | Shipped 2026-10-13, plain CSS `filter`. Completes the transitions.dev "banner stacking" recipe the stack was already built on. |
42
+ | `Chart` (donut) | Data update — same categories, new values: slices ease to their new angles (`chart.duration-update` 400ms, `chart.easing-update`) instead of drawing in again. | Shipped 2026-10-13 — ECharts' own update animation (`animationDurationUpdate`/`animationEasingUpdate`, read from the tokens). transitions.dev "donut chart". Reduced motion: no animation (Chart already sets `animation: false`). |
43
+ | `Input` (invalid) | Error-state shake — plays once when `invalid` transitions false→true (not on initial mount, not repeatedly while it stays invalid). | Shipped, but **not Motion** — plain CSS `@keyframes` + a `data-shaking="true"` attribute toggled imperatively via ref (remove/reflow/reapply, so a second failed attempt while still invalid retriggers it). Bespoke per-segment easing authored in Figma, same "plain CSS is the right call" reasoning as Checkbox/RadioGroup below. This is the one exception to the "never on Input/Select/Textarea" rule underneath: it fires only on a genuine state transition (the field just became invalid), the same category of feedback as `aria-invalid`/the error message appearing, not ambient/decorative motion — see `.ai/skills/ds-preview-before-ship.md` for how this got approved (a throwaway Artifact preview, tried in both themes and with reduced motion, before touching `Input.tsx`). |
44
+
45
+ **Never use a motion effect on:** `Select`, `Textarea` (form fields — motion here reads as
46
+ instability, not delight, and neither has an approved exception yet — if one comes up, it goes through the
47
+ same preview-first process Input's shake did), `Table` itself as a dense-data surface (only the drag-reorder
48
+ pattern above is scoped, not decorative motion on every row by default), or any component whose whole job is
49
+ to be read quickly and factually (`Badge`, status indicators). `Input` itself stays off-limits for anything
50
+ beyond the one shipped shake above — a new effect there needs its own preview and sign-off, not a rider on
51
+ this exception.
52
+
53
+ ## Checklist before shipping a new Motion usage
54
+
55
+ 0. **Preview it before it touches a real contract — mandatory for any new effect, or any change to an
56
+ entry in the "never use" list above.** Follow [`.ai/skills/ds-preview-before-ship.md`](../../skills/ds-preview-before-ship.md):
57
+ build the effect against the component's real tokens/anatomy in a throwaway preview (a Storybook story
58
+ not wired into the exported component, or a published Artifact), get explicit sign-off, and only then
59
+ implement it for real — updating this file's table (and the "never use" list, if the effect overturns
60
+ one of its entries) in the same change, not after. This is how Input's error-state shake got approved;
61
+ see its row above.
62
+ 1. **Reduced motion is not automatic.** Verified against motion.dev's own accessibility docs, not assumed
63
+ — Motion needs an explicit `<MotionConfig reducedMotion="user">`. Scope it locally around the component's
64
+ own animated elements (see FAB/Switch) rather than relying on the consuming app having wrapped its root
65
+ in one; a shared component can't assume that setup exists. Exception: brief, user-driven `whileTap`
66
+ press feedback (Button/IconButton) — same category as CSS `:active`, not what reduced-motion targets.
67
+ 2. Verify in Storybook with `prefers-reduced-motion: reduce` on (devtools → Rendering tab) — confirm the
68
+ `MotionConfig` you added actually degrades this specific usage, not just that the prop is present.
69
+ 3. `fill`/`background`/`color` values inside `animate`/`initial`/`exit` are `--helix-*` token references
70
+ (`var(--helix-...)`), same rule as everywhere else in Helix — Motion can animate CSS custom properties
71
+ directly, no resolution hack needed (that hack was `liquid-gooey`-specific and is gone, see ADR-007).
72
+ 4. Expect `verify:props` to flag Motion's own object keys that collide with `prop-map.md` names by
73
+ coincidence — `type: 'spring'` (Transition), `scale` (animate/initial/exit target) are confirmed false
74
+ positives, report-only, not a Helix prop. Add a one-line comment at the call site when you hit a new one
75
+ rather than trying to rename Motion's own API.
76
+ 5. Verify dark mode — same as any other visual change.
77
+
78
+ ## Shared presets
79
+
80
+ Spring physics (`stiffness`/`damping`) and cubic-bezier `ease` arrays have no `var()` form — they can
81
+ never be `tokens.json` entries (see `packages/tokens/CLAUDE.md`'s "Motion naming vocabulary" and "What
82
+ NOT to do"). They're centralized in `packages/core/src/lib/motionPresets.ts` instead — `SPRING_SNAPPY`
83
+ (shared by Switch's thumb and NavItem's indicator; consolidates a previously undocumented `damping: 32`
84
+ vs `35` drift between the two), `EASE_BACK`/`EASE_COLLAPSE` and FAB's three named transitions, and
85
+ `PRESS_SCALE_DEFAULT`/`PRESS_SCALE_COMPACT` for Button/IconButton's `whileTap`. Import from there instead
86
+ of typing a new spring/easing literal inline — that inline-per-component pattern is exactly how the
87
+ Switch/NavItem drift happened.
88
+
89
+ ## Reference
90
+
91
+ - [expand-collapse-chevron.md](expand-collapse-chevron.md) — the sibling pattern for a disclosure
92
+ component's chevron icon (Accordion's `scaleY` flip). Plain CSS, not Motion, so it lives in its own
93
+ file rather than this table — read it before adding a chevron to any new expand/collapse component.
94
+ - [ADR-007](../../docs/ADR/ADR-007-motion-engine.md) — why Motion, what replaced `liquid-gooey` and why.
95
+ - [ADR-006](../../docs/ADR/ADR-006-liquid-motion-effects.md) — superseded, historical reasoning only.
96
+ - [ADR-005](../../docs/ADR/ADR-005-elevation-policy.md) — which components may ever carry a shadow (FAB's
97
+ `box-shadow` is now plain CSS, no special resolution needed).
98
+ - `packages/core/src/lib/resolveTokenPx.ts` — shared `getComputedStyle`-based numeric token resolver, used
99
+ by FAB's speed-dial offsets and Switch's thumb position (Motion's `animate.x`/`animate.y` are plain
100
+ numbers, tokens are CSS custom properties — something still has to bridge the two, engine-independent).