@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,80 @@
1
+ export const doc = {
2
+ name: 'RadioGroup',
3
+ purpose: 'Lets users pick exactly one option from a small, visible set of mutually exclusive choices.',
4
+ contract: 'contracts/components/RadioGroup.json',
5
+ a11y: [
6
+ 'Renders a real `<fieldset>`/`<legend>` — the group `label` is the legend, not a per-option label.',
7
+ 'Pair `invalid` with `errorMessage` so screen readers get a clear validation message.',
8
+ 'Each option is a real `<input type="radio">` sharing one `name`, so arrow-key navigation works natively.',
9
+ ],
10
+ variants: [
11
+ { name: 'vertical', description: 'Default orientation — options stack top to bottom.' },
12
+ { name: 'horizontal', description: 'Options lay out left to right. Use for short option sets only.' },
13
+ ],
14
+ sizes: [],
15
+ tokens: [
16
+ { part: 'radio-control', label: 'Default fill', token: '--helix-radio-fill-default', kind: 'color' },
17
+ { part: 'radio-control', label: 'Checked fill', token: '--helix-radio-fill-checked', kind: 'color' },
18
+ { part: 'radio-control', label: 'Checked fill', token: '--helix-radio-fill-checked-hover', kind: 'color', state: 'hover', meta: 'Hover while checked' },
19
+ { part: 'radio-control', label: 'Default border', token: '--helix-radio-border-default', kind: 'color' },
20
+ { part: 'radio-control', label: 'Default border', token: '--helix-radio-border-hover', kind: 'color', state: 'hover', meta: 'Hover while unchecked' },
21
+ { part: 'radio-control', label: 'Checked border', token: '--helix-radio-border-checked', kind: 'color' },
22
+ { part: 'radio-control', label: 'Focus border', token: '--helix-radio-border-focus', kind: 'color' },
23
+ { part: 'radio-control', label: 'Invalid border', token: '--helix-radio-border-invalid', kind: 'color' },
24
+ { part: 'radio-dot', label: 'Selected dot color', token: '--helix-radio-dot', kind: 'color' },
25
+ { part: 'radio-legend', label: 'Group label text', token: '--helix-radio-text-label', kind: 'color' },
26
+ { part: 'radio-item-label', label: 'Option label text', token: '--helix-radio-text-label', kind: 'color' },
27
+ { part: 'radio-item-description', label: 'Option description text', token: '--helix-radio-text-description', kind: 'color' },
28
+ { part: 'radio-error', label: 'Error text', token: '--helix-radio-text-error', kind: 'color' },
29
+ { part: 'radio-legend', label: 'legend', token: '--helix-primitive-fontSize-s', kind: 'typography', meta: 'Label' },
30
+ { part: 'radio-legend', label: 'legend.weight', token: '--helix-primitive-fontWeight-medium', kind: 'typography', meta: 'Medium' },
31
+ { part: 'radio-item-label', label: 'item.label', token: '--helix-primitive-fontSize-s', kind: 'typography', meta: 'Body small' },
32
+ { part: 'radio-item-label', label: 'item.label.weight', token: '--helix-primitive-fontWeight-medium', kind: 'typography', meta: 'Medium' },
33
+ { part: 'radio-item-description', label: 'item.description', token: '--helix-primitive-fontSize-s', kind: 'typography', meta: 'Body xsmall' },
34
+ { part: 'radio-control', label: 'control.size', token: '--helix-radio-size', kind: 'space' },
35
+ { part: 'radio-options', label: 'gap.options', token: '--helix-primitive-spacing-75', kind: 'space', axis: 'vertical' },
36
+ { part: 'radio-item', label: 'gap.control.content', token: '--helix-primitive-spacing-50', kind: 'space', axis: 'horizontal' },
37
+ { part: 'radio-item-content', label: 'gap.label.description', token: '--helix-primitive-spacing-25', kind: 'space', axis: 'vertical' },
38
+ { part: 'radio-legend', label: 'gap.legend.options', token: '--helix-primitive-spacing-25', kind: 'space', axis: 'vertical' },
39
+ { part: 'radio-control', label: 'radio.control', value: '9999px', kind: 'radius', meta: 'Always a full circle — no semantic.radius token, radios are round by definition' },
40
+ { part: 'radio-group', label: 'display', value: 'block' },
41
+ { part: 'radio-options', label: 'display', value: 'flex' },
42
+ { part: 'radio-options', label: 'flex-direction', value: 'column' },
43
+ { part: 'radio-item', label: 'display', value: 'flex' },
44
+ { part: 'radio-item', label: 'align-items', value: 'flex-start' },
45
+ { part: 'radio-item', label: 'cursor', value: 'pointer' },
46
+ { part: 'radio-input', label: 'position', value: 'absolute' },
47
+ { part: 'radio-input', label: 'opacity', value: '0' },
48
+ { part: 'radio-control', label: 'display', value: 'inline-flex' },
49
+ { part: 'radio-control', label: 'align-items', value: 'center' },
50
+ { part: 'radio-control', label: 'justify-content', value: 'center' },
51
+ { part: 'radio-control', label: 'flex-shrink', value: '0' },
52
+ ],
53
+ features: [
54
+ 'label — required legend for the whole group',
55
+ 'options — array of { value, label, description?, disabled? }',
56
+ 'orientation — vertical (default) or horizontal layout',
57
+ 'value / defaultValue — controlled or uncontrolled selection',
58
+ 'invalid / errorMessage — group-level validation state and helper copy',
59
+ 'disabled — disables the whole group; individual options can also disable themselves',
60
+ ],
61
+ examples: [
62
+ {
63
+ label: 'Default',
64
+ code: `<RadioGroup label="Plan" options={[{ value: 'free', label: 'Free' }, { value: 'pro', label: 'Pro' }]} />`,
65
+ },
66
+ {
67
+ label: 'With descriptions',
68
+ code: `<RadioGroup label="Plan" options={[{ value: 'free', label: 'Free', description: 'Basic features' }, { value: 'pro', label: 'Pro', description: 'Everything, unlimited' }]} />`,
69
+ },
70
+ {
71
+ label: 'Horizontal',
72
+ code: `<RadioGroup label="Size" orientation="horizontal" options={[{ value: 's', label: 'S' }, { value: 'm', label: 'M' }, { value: 'l', label: 'L' }]} />`,
73
+ },
74
+ {
75
+ label: 'Invalid',
76
+ code: `<RadioGroup label="Plan" options={options} invalid errorMessage="Choose a plan to continue" />`,
77
+ },
78
+ ],
79
+ };
80
+ //# sourceMappingURL=RadioGroup.doc.js.map
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ let idCounter = 0;
3
+ export function RadioGroup({ label, options, value, defaultValue, onChange, orientation = 'vertical', description, errorMessage, invalid = false, disabled = false, required = false, name: nameProp, }) {
4
+ const uid = `helix-radio-${++idCounter}`;
5
+ const name = nameProp ?? uid;
6
+ const descId = description ? `${uid}-desc` : undefined;
7
+ const errId = errorMessage ? `${uid}-err` : undefined;
8
+ const describedby = [descId, errId].filter(Boolean).join(' ') || undefined;
9
+ return (_jsxs("fieldset", { "data-helix-part": "radio-group",
10
+ // radiogroup, as the contract states — a bare fieldset is role "group", which doesn't allow the
11
+ // aria-required below.
12
+ role: "radiogroup", "data-orientation": orientation, ...(disabled ? { 'data-disabled': '' } : {}), ...(invalid ? { 'data-invalid': '' } : {}), "aria-describedby": describedby, "aria-required": required || undefined, children: [_jsxs("legend", { "data-helix-part": "radio-legend", children: [label, required && _jsx("span", { "data-helix-part": "radio-required", "aria-hidden": "true", children: "*" })] }), _jsx("div", { "data-helix-part": "radio-options", "data-orientation": orientation, children: options.map(opt => {
13
+ const itemId = `${uid}-${opt.value}`;
14
+ const isChecked = value !== undefined ? value === opt.value : undefined;
15
+ return (_jsxs("label", { "data-helix-part": "radio-item", htmlFor: itemId, ...(opt.disabled || disabled ? { 'data-disabled': '' } : {}), children: [_jsx("input", { id: itemId, type: "radio", name: name, value: opt.value, checked: isChecked, defaultChecked: isChecked === undefined && defaultValue === opt.value ? true : undefined, disabled: opt.disabled || disabled, required: required, "aria-invalid": invalid || undefined, "data-helix-part": "radio-input", onChange: () => onChange?.(opt.value) }), _jsx("span", { "data-helix-part": "radio-control", "aria-hidden": "true", children: _jsx("span", { "data-helix-part": "radio-dot" }) }), _jsxs("span", { "data-helix-part": "radio-item-content", children: [_jsx("span", { "data-helix-part": "radio-item-label", children: opt.label }), opt.description && (_jsx("span", { "data-helix-part": "radio-item-description", children: opt.description }))] })] }, opt.value));
16
+ }) }), description && !errorMessage && (_jsx("span", { id: descId, "data-helix-part": "radio-description", children: description })), errorMessage && (_jsx("span", { id: errId, "data-helix-part": "radio-error", role: "alert", children: errorMessage }))] }));
17
+ }
18
+ RadioGroup.displayName = 'RadioGroup';
19
+ //# sourceMappingURL=RadioGroup.js.map
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @helixds/react — agent note
3
+ * Before using RadioGroup, read its contract: node_modules/@helixds/react/dist/contracts/RadioGroup.json
4
+ * (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
5
+ * Guide: node_modules/@helixds/react/AGENTS.md
6
+ */
7
+ export type RadioOrientation = 'vertical' | 'horizontal';
8
+ export interface RadioOption {
9
+ value: string;
10
+ label: string;
11
+ description?: string;
12
+ disabled?: boolean;
13
+ }
14
+ export interface RadioGroupProps {
15
+ label: string;
16
+ options: RadioOption[];
17
+ value?: string;
18
+ defaultValue?: string;
19
+ onChange?: (value: string) => void;
20
+ orientation?: RadioOrientation;
21
+ description?: string;
22
+ errorMessage?: string;
23
+ invalid?: boolean;
24
+ disabled?: boolean;
25
+ required?: boolean;
26
+ name?: string;
27
+ }
28
+ //# sourceMappingURL=RadioGroup.types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RadioGroup.types.js.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @helixds/react — agent note
3
+ * Before using RadioGroup, read its contract: node_modules/@helixds/react/dist/contracts/RadioGroup.json
4
+ * (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
5
+ * Guide: node_modules/@helixds/react/AGENTS.md
6
+ */
7
+ export { RadioGroup } from './RadioGroup.js';
8
+ export type { RadioGroupProps, RadioOption, RadioOrientation } from './RadioGroup.types.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { RadioGroup } from './RadioGroup.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @helixds/react — agent note
3
+ * Before using SegmentedControl, read its contract: node_modules/@helixds/react/dist/contracts/SegmentedControl.json
4
+ * (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
5
+ * Guide: node_modules/@helixds/react/AGENTS.md
6
+ */
7
+ import * as React from 'react';
8
+ import type { SegmentedControlProps } from './SegmentedControl.types.js';
9
+ export declare function SegmentedControl({ label, options, value, defaultValue, onChange, disabled, name: nameProp, className, }: SegmentedControlProps): React.JSX.Element;
10
+ export declare namespace SegmentedControl {
11
+ var displayName: string;
12
+ }
13
+ //# sourceMappingURL=SegmentedControl.d.ts.map
@@ -0,0 +1,4 @@
1
+ /** Machine-readable component documentation for the Helix SegmentedControl. */
2
+ import type { ComponentDoc } from '../../lib/component-doc.js';
3
+ export declare const doc: ComponentDoc;
4
+ //# sourceMappingURL=SegmentedControl.doc.d.ts.map
@@ -0,0 +1,50 @@
1
+ export const doc = {
2
+ name: 'SegmentedControl',
3
+ purpose: 'Lets users switch between a small, fixed set of mutually exclusive modes or views, with no associated content panel.',
4
+ contract: 'contracts/components/SegmentedControl.json',
5
+ a11y: [
6
+ '`role="radiogroup"` on the root, `role="radio"` + `aria-checked` on each option — not `tablist`/`tab`, since there is no associated panel that changes content (see ADR-012).',
7
+ 'Roving `tabIndex` — only the checked option is in the Tab order; arrow keys move both focus and selection between options.',
8
+ '`label` is required and becomes the group\'s `aria-label` — this control has no visible legend.',
9
+ ],
10
+ variants: [],
11
+ sizes: [],
12
+ tokens: [
13
+ { part: 'segmented-control-root', label: 'Track background', token: '--helix-segmentedControl-fill-track', kind: 'color' },
14
+ { part: 'segmented-control-pill', label: 'Pill background', token: '--helix-segmentedControl-fill-pill', kind: 'color' },
15
+ { part: 'segmented-control-item-label', label: 'Default text', token: '--helix-segmentedControl-text-default', kind: 'color' },
16
+ { part: 'segmented-control-item-label', label: 'Checked text', token: '--helix-segmentedControl-text-checked', kind: 'color', meta: 'aria-checked="true"' },
17
+ { part: 'segmented-control-root', label: 'root.radius', token: '--helix-segmentedControl-radius', kind: 'radius' },
18
+ { part: 'segmented-control-item', label: 'item.height', token: '--helix-segmentedControl-height', kind: 'space', meta: 'semantic.size.s' },
19
+ { part: 'segmented-control-root', label: 'root.padding', token: '--helix-segmentedControl-padding', kind: 'space' },
20
+ { part: 'segmented-control-item', label: 'item.paddingX', token: '--helix-segmentedControl-paddingX', kind: 'space', axis: 'horizontal' },
21
+ { part: 'segmented-control-item', label: 'item.fontSize', token: '--helix-segmentedControl-fontSize', kind: 'typography' },
22
+ { part: 'segmented-control-item', label: 'item.fontWeight', token: '--helix-segmentedControl-fontWeight', kind: 'typography' },
23
+ { part: 'segmented-control-root', label: 'display', value: 'inline-flex' },
24
+ { part: 'segmented-control-item', label: 'position', value: 'relative' },
25
+ { part: 'segmented-control-pill', label: 'position', value: 'absolute (inset: 0, behind label — same layering NavItem\'s indicator uses)' },
26
+ ],
27
+ features: [
28
+ 'label — required, becomes the group\'s accessible name',
29
+ 'options — array of { value, label, icon?, disabled? }; an option with icon is icon-only, its label kept as its accessible name',
30
+ 'value / defaultValue — controlled or uncontrolled selection',
31
+ 'onChange — selection change handler',
32
+ 'disabled — disables the whole group; individual options can also disable themselves',
33
+ 'The sliding pill reuses NavItem/Switch\'s Motion layoutId + SPRING_SNAPPY pattern — see ADR-012.',
34
+ ],
35
+ examples: [
36
+ {
37
+ label: 'Default',
38
+ code: `<SegmentedControl label="Mode" options={[{ value: 'plan', label: 'Plan' }, { value: 'debug', label: 'Debug' }, { value: 'ask', label: 'Ask' }]} />`,
39
+ },
40
+ {
41
+ label: 'Controlled',
42
+ code: `<SegmentedControl label="Mode" options={options} value={mode} onChange={setMode} />`,
43
+ },
44
+ {
45
+ label: 'With a disabled option',
46
+ code: `<SegmentedControl label="Mode" options={[{ value: 'plan', label: 'Plan' }, { value: 'debug', label: 'Debug', disabled: true }, { value: 'ask', label: 'Ask' }]} />`,
47
+ },
48
+ ],
49
+ };
50
+ //# sourceMappingURL=SegmentedControl.doc.js.map
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { motion, MotionConfig } from 'motion/react';
4
+ import { cn } from '../../lib/utils.js';
5
+ import { Icon } from '../Icon/index.js';
6
+ import { SPRING_SNAPPY } from '../../lib/motionPresets.js';
7
+ let idCounter = 0;
8
+ export function SegmentedControl({ label, options, value, defaultValue, onChange, disabled = false, name: nameProp, className, }) {
9
+ // One layoutId per instance — otherwise two SegmentedControls on the same page would share Motion's
10
+ // FLIP animation and the pill would jump between them instead of staying scoped to its own group.
11
+ const uid = React.useRef(`helix-segmented-control-${++idCounter}`).current;
12
+ const layoutId = `${uid}-pill`;
13
+ const name = nameProp ?? uid;
14
+ const isControlled = value !== undefined;
15
+ const [internalValue, setInternalValue] = React.useState(defaultValue ?? options[0]?.value);
16
+ const current = isControlled ? value : internalValue;
17
+ const itemRefs = React.useRef(new Map());
18
+ const select = (optionValue) => {
19
+ if (!isControlled)
20
+ setInternalValue(optionValue);
21
+ onChange?.(optionValue);
22
+ };
23
+ // Roving tabindex + arrow-key navigation, hand-rolled — these are buttons, not native radio inputs,
24
+ // so the browser doesn't give this behavior away for free the way it does for RadioGroup (ADR-012).
25
+ const handleKeyDown = (e, index) => {
26
+ const enabled = options.filter(o => !(o.disabled || disabled));
27
+ if (enabled.length === 0)
28
+ return;
29
+ const currentEnabledIndex = enabled.findIndex(o => o.value === options[index].value);
30
+ let nextIndex = -1;
31
+ if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
32
+ nextIndex = (currentEnabledIndex + 1) % enabled.length;
33
+ }
34
+ else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {
35
+ nextIndex = (currentEnabledIndex - 1 + enabled.length) % enabled.length;
36
+ }
37
+ else if (e.key === 'Home') {
38
+ nextIndex = 0;
39
+ }
40
+ else if (e.key === 'End') {
41
+ nextIndex = enabled.length - 1;
42
+ }
43
+ else {
44
+ return;
45
+ }
46
+ e.preventDefault();
47
+ const next = enabled[nextIndex];
48
+ select(next.value);
49
+ itemRefs.current.get(next.value)?.focus();
50
+ };
51
+ // MotionConfig scoped locally — Motion doesn't honor prefers-reduced-motion on its own (ADR-007).
52
+ return (_jsx(MotionConfig, { reducedMotion: "user", children: _jsxs("div", { "data-helix-part": "segmented-control-root", role: "radiogroup", "aria-label": label, ...(disabled ? { 'data-disabled': '' } : {}), className: cn(className), children: [_jsx("input", { type: "hidden", name: name, value: current ?? '' }), options.map((opt, index) => {
53
+ const isChecked = opt.value === current;
54
+ const isDisabled = opt.disabled || disabled;
55
+ return (_jsxs("button", { ref: el => {
56
+ if (el)
57
+ itemRefs.current.set(opt.value, el);
58
+ else
59
+ itemRefs.current.delete(opt.value);
60
+ }, type: "button", role: "radio", "aria-checked": isChecked, tabIndex: isChecked ? 0 : -1, disabled: isDisabled, "data-helix-part": "segmented-control-item", ...(opt.icon ? { 'data-icon-only': '' } : {}), onClick: () => select(opt.value), onKeyDown: e => handleKeyDown(e, index), children: [isChecked && (_jsx(motion.span, { "data-helix-part": "segmented-control-pill", layoutId: layoutId, "aria-hidden": "true", transition: SPRING_SNAPPY })), opt.icon && (_jsx("span", { "data-helix-part": "segmented-control-item-icon", children: _jsx(Icon, { icon: opt.icon, size: 16 }) })), _jsx("span", { "data-helix-part": "segmented-control-item-label", children: opt.label })] }, opt.value));
61
+ })] }) }));
62
+ }
63
+ SegmentedControl.displayName = 'SegmentedControl';
64
+ //# sourceMappingURL=SegmentedControl.js.map
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @helixds/react — agent note
3
+ * Before using SegmentedControl, read its contract: node_modules/@helixds/react/dist/contracts/SegmentedControl.json
4
+ * (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
5
+ * Guide: node_modules/@helixds/react/AGENTS.md
6
+ */
7
+ import type { HelixIconComponent } from '../Icon/index.js';
8
+ export interface SegmentedControlOption {
9
+ value: string;
10
+ /** Always required: the visible text — or, with `icon`, the option's accessible name. */
11
+ label: string;
12
+ /** Makes the option icon-only: the Tabler icon component (not an element), rendered through Icon. */
13
+ icon?: HelixIconComponent;
14
+ disabled?: boolean;
15
+ }
16
+ export interface SegmentedControlProps {
17
+ label: string;
18
+ options: SegmentedControlOption[];
19
+ value?: string;
20
+ defaultValue?: string;
21
+ onChange?: (value: string) => void;
22
+ disabled?: boolean;
23
+ name?: string;
24
+ className?: string;
25
+ }
26
+ //# sourceMappingURL=SegmentedControl.types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=SegmentedControl.types.js.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @helixds/react — agent note
3
+ * Before using SegmentedControl, read its contract: node_modules/@helixds/react/dist/contracts/SegmentedControl.json
4
+ * (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
5
+ * Guide: node_modules/@helixds/react/AGENTS.md
6
+ */
7
+ export { SegmentedControl } from './SegmentedControl.js';
8
+ export type { SegmentedControlProps, SegmentedControlOption } from './SegmentedControl.types.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { SegmentedControl } from './SegmentedControl.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @helixds/react — agent note
3
+ * Before using Select, read its contract: node_modules/@helixds/react/dist/contracts/Select.json
4
+ * (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
5
+ * Guide: node_modules/@helixds/react/AGENTS.md
6
+ */
7
+ import * as React from 'react';
8
+ import type { SelectProps } from './Select.types.js';
9
+ export declare function Select({ label, options, value, defaultValue, onChange, placeholder, description, errorMessage, invalid, disabled, required, fullWidth, hideLabel, id: idProp, name, className, }: SelectProps): React.JSX.Element;
10
+ export declare namespace Select {
11
+ var displayName: string;
12
+ }
13
+ //# sourceMappingURL=Select.d.ts.map
@@ -0,0 +1,4 @@
1
+ /** Machine-readable component documentation for the Helix Select. */
2
+ import type { ComponentDoc } from '../../lib/component-doc.js';
3
+ export declare const doc: ComponentDoc;
4
+ //# sourceMappingURL=Select.doc.d.ts.map
@@ -0,0 +1,66 @@
1
+ export const doc = {
2
+ name: 'Select',
3
+ purpose: 'Lets users choose a single value from a predefined list.',
4
+ contract: 'contracts/components/Select.json',
5
+ a11y: [
6
+ 'The `label` prop is required. Use `placeholder` as a prompt, not as the selected value.',
7
+ 'The trigger is a real `<button>`, not a native `<select>` — the dropdown is Helix\'s own `Menu` primitive (ADR-013), keeping real DOM focus on the button and driving the popup via `aria-haspopup`/`aria-expanded`/`aria-controls`/`aria-activedescendant`.',
8
+ 'Keyboard nav (Arrow Up/Down, Home/End, Enter/Space, Escape) is hand-rolled on the trigger, not native — see the contract\'s own keyboardNav list.',
9
+ ],
10
+ variants: [],
11
+ sizes: [],
12
+ tokens: [
13
+ { part: 'select-trigger', label: 'Default fill', token: '--helix-select-fill-default', kind: 'color' },
14
+ { part: 'select-trigger', label: 'Default border', token: '--helix-select-border-default', kind: 'color' },
15
+ { part: 'select-trigger', label: 'Default border', token: '--helix-select-border-hover', kind: 'color', state: 'hover' },
16
+ { part: 'select-trigger', label: 'Focus border', token: '--helix-select-border-focus', kind: 'color' },
17
+ { part: 'select-trigger', label: 'Disabled fill', token: '--helix-select-fill-disabled', kind: 'color', state: 'disabled' },
18
+ { part: 'select-trigger', label: 'Disabled border', token: '--helix-select-border-disabled', kind: 'color', state: 'disabled' },
19
+ { part: 'select-trigger', label: 'Disabled text', token: '--helix-select-text-disabled', kind: 'color', state: 'disabled' },
20
+ { part: 'select-trigger', label: 'Value text', token: '--helix-select-text-value', kind: 'color' },
21
+ { part: 'select-trigger', label: 'Placeholder text', token: '--helix-select-text-placeholder', kind: 'color' },
22
+ { part: 'select-root', label: 'gap', token: '--helix-select-gap', kind: 'space', axis: 'vertical', meta: '8px, label↔trigger and trigger↔description/error alike — see .ai/maps/patterns/form-field-spacing.md' },
23
+ { part: 'select-label', label: 'label', token: '--helix-select-text-labelFontSize', kind: 'typography', meta: 'body-m-medium, 14px' },
24
+ { part: 'select-label', label: 'label.weight', token: '--helix-select-text-labelFontWeight', kind: 'typography' },
25
+ { part: 'select-trigger', label: 'value', token: '--helix-select-text-valueFontSize', kind: 'typography', meta: 'body-m-regular, 14px' },
26
+ { part: 'select-description', label: 'description', token: '--helix-select-text-descriptionFontSize', kind: 'typography', meta: 'body-s-regular, 12px' },
27
+ { part: 'select-error', label: 'error', token: '--helix-select-text-errorFontSize', kind: 'typography', meta: 'body-s-regular, 12px' },
28
+ { part: 'select-trigger', label: 'field.height', token: '--helix-select-height', kind: 'space', meta: 'One fixed size (semantic.size.m, 32px) — no size prop, matches Menu item height and Input/Textarea\'s own "m"' },
29
+ { part: 'select-chevron', label: 'padding.end', token: '--helix-primitive-spacing-75', kind: 'space', axis: 'horizontal', meta: 'Chevron to trigger edge' },
30
+ { part: 'select-trigger', label: 'select.root', token: '--helix-select-radius', kind: 'radius' },
31
+ { part: 'select-root', label: 'display', value: 'flex' },
32
+ { part: 'select-root', label: 'flex-direction', value: 'column' },
33
+ { part: 'select-root', label: 'width', value: 'fit-content' },
34
+ { part: 'select-wrapper', label: 'position.wrapper', value: 'relative' },
35
+ { part: 'select-wrapper', label: 'display.wrapper', value: 'flex' },
36
+ { part: 'select-trigger', label: 'appearance', value: 'none' },
37
+ { part: 'select-trigger', label: '-webkit-appearance', value: 'none' },
38
+ { part: 'select-trigger', label: 'cursor', value: 'pointer' },
39
+ { part: 'select-trigger', label: 'outline', value: 'none' },
40
+ { part: 'select-trigger', label: 'cursor.disabled', value: 'not-allowed' },
41
+ { part: 'select-trigger-label', label: 'overflow', value: 'hidden, ellipsis, nowrap', meta: 'Truncates a label that doesn\'t fit a fixed-width trigger instead of overflowing or growing the box' },
42
+ { part: 'select-chevron', label: 'pointer-events', value: 'none' },
43
+ { part: 'select-chevron', label: 'display.chevron', value: 'flex' },
44
+ { part: 'select-chevron', label: 'position.chevron', value: 'absolute' },
45
+ { part: 'select-chevron', label: 'top.chevron', value: '50%' },
46
+ { part: 'select-chevron', label: 'flip.duration', token: '--helix-select-duration-chevron', kind: 'space', meta: 'Same expand-collapse-chevron pattern as Accordion' },
47
+ { part: 'select-chevron', label: 'flip.easing', token: '--helix-select-easing', kind: 'space' },
48
+ { part: 'select-chevron', label: 'flip.easing.collapse', token: '--helix-select-easing-collapse', kind: 'space' },
49
+ ],
50
+ features: [
51
+ 'Button trigger + Helix-styled Menu popup (ADR-013) — no native OS dropdown chrome, matches Helix\'s own visual language',
52
+ 'One fixed size, deliberately — no size prop. 32px (semantic.size.m), the same height Menu items and Input/Textarea\'s own default use, so nothing needs picking.',
53
+ 'fullWidth — stretches to container width',
54
+ 'labelEnd on an option — short secondary text (a value, count or percentage) on the end edge of that option in the list; the trigger shows only the label',
55
+ 'className — set a fixed width so the trigger never visibly resizes as a shorter/longer option is selected (it truncates with an ellipsis instead of growing)',
56
+ 'placeholder option — optional prompt before selection',
57
+ 'option groups — supports grouped option sets',
58
+ 'Chevron flips on open, same treatment as Accordion (.ai/maps/patterns/expand-collapse-chevron.md) — now real, driven by the trigger\'s own aria-expanded',
59
+ ],
60
+ examples: [
61
+ { label: 'Default', code: `<Select label="Status" options={options} />` },
62
+ { label: 'With placeholder', code: `<Select label="Country" placeholder="Choose a country" options={options} />` },
63
+ { label: 'Invalid', code: `<Select label="Role" invalid errorMessage="Pick a role" options={options} />` },
64
+ ],
65
+ };
66
+ //# sourceMappingURL=Select.doc.js.map
@@ -0,0 +1,138 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { IconChevronDown } from '@tabler/icons-react';
4
+ import { cn } from '../../lib/utils.js';
5
+ import { Icon } from '../Icon/index.js';
6
+ import { Menu, optionId } from '../Menu/index.js';
7
+ let idCounter = 0;
8
+ function isGroup(opt) {
9
+ return 'options' in opt;
10
+ }
11
+ function flattenOptions(options) {
12
+ return options.flatMap(opt => (isGroup(opt) ? opt.options : [opt]));
13
+ }
14
+ export function Select({ label, options, value, defaultValue, onChange, placeholder, description, errorMessage, invalid = false, disabled = false, required = false, fullWidth = false, hideLabel = false, id: idProp, name, className, }) {
15
+ const uid = React.useRef(`helix-select-${++idCounter}`).current;
16
+ const id = idProp ?? uid;
17
+ const menuId = `${id}-menu`;
18
+ const descId = description && !invalid ? `${id}-desc` : undefined;
19
+ const errId = invalid && errorMessage ? `${id}-err` : undefined;
20
+ const describedby = [descId, errId].filter(Boolean).join(' ') || undefined;
21
+ const isControlled = value !== undefined;
22
+ const [internalValue, setInternalValue] = React.useState(defaultValue);
23
+ const current = isControlled ? value : internalValue;
24
+ const [open, setOpen] = React.useState(false);
25
+ const [activeValue, setActiveValue] = React.useState(current);
26
+ const triggerRef = React.useRef(null);
27
+ const flatOptions = React.useMemo(() => flattenOptions(options), [options]);
28
+ const selectedOption = flatOptions.find(o => o.value === current);
29
+ const commit = (next) => {
30
+ if (!isControlled)
31
+ setInternalValue(next);
32
+ onChange?.(next);
33
+ setOpen(false);
34
+ triggerRef.current?.focus();
35
+ };
36
+ // A pointer open highlights only the selected option (if any), never a fallback first option — the
37
+ // gray keyboard highlight on an option the pointer isn't on reads as a stray hover.
38
+ const openMenu = (initialActive, via = 'keyboard') => {
39
+ if (disabled)
40
+ return;
41
+ // Highlight the selected option if it's a real, enabled one — not just `current ?? first`: a
42
+ // controlled "nothing selected" value of '' isn't nullish, and would open with no highlight at all.
43
+ const selected = flatOptions.find(o => o.value === current && !o.disabled)?.value;
44
+ setActiveValue(initialActive ?? selected ?? (via === 'keyboard' ? flatOptions.find(o => !o.disabled)?.value : undefined));
45
+ setOpen(true);
46
+ };
47
+ const closeMenu = () => setOpen(false);
48
+ const moveActive = (dir) => {
49
+ const enabled = flatOptions.filter(o => !o.disabled);
50
+ if (enabled.length === 0)
51
+ return;
52
+ const currentIndex = enabled.findIndex(o => o.value === activeValue);
53
+ const nextIndex = currentIndex === -1
54
+ ? (dir === 1 ? 0 : enabled.length - 1)
55
+ : (currentIndex + dir + enabled.length) % enabled.length;
56
+ setActiveValue(enabled[nextIndex].value);
57
+ };
58
+ // Hand-rolled roving keyboard nav on the trigger — Menu itself is deliberately non-focusable
59
+ // (real DOM focus stays on this button throughout, aria-activedescendant tracks the highlighted
60
+ // option), the same interaction model a native <select> gives away for free. See ADR-013.
61
+ const handleTriggerKeyDown = (e) => {
62
+ if (disabled)
63
+ return;
64
+ switch (e.key) {
65
+ case 'ArrowDown':
66
+ e.preventDefault();
67
+ open ? moveActive(1) : openMenu();
68
+ break;
69
+ case 'ArrowUp':
70
+ e.preventDefault();
71
+ open ? moveActive(-1) : openMenu();
72
+ break;
73
+ case 'Home': {
74
+ if (!open)
75
+ break;
76
+ e.preventDefault();
77
+ const enabled = flatOptions.filter(o => !o.disabled);
78
+ if (enabled[0])
79
+ setActiveValue(enabled[0].value);
80
+ break;
81
+ }
82
+ case 'End': {
83
+ if (!open)
84
+ break;
85
+ e.preventDefault();
86
+ const enabled = flatOptions.filter(o => !o.disabled);
87
+ if (enabled.length)
88
+ setActiveValue(enabled[enabled.length - 1].value);
89
+ break;
90
+ }
91
+ case 'Enter':
92
+ case ' ':
93
+ e.preventDefault();
94
+ if (open) {
95
+ if (activeValue)
96
+ commit(activeValue);
97
+ }
98
+ else
99
+ openMenu();
100
+ break;
101
+ case 'Escape':
102
+ if (open) {
103
+ e.preventDefault();
104
+ closeMenu();
105
+ }
106
+ break;
107
+ case 'Tab':
108
+ // Close first, then let focus move on as usual (no preventDefault) — contract a11y.keyboardNav.
109
+ if (open)
110
+ closeMenu();
111
+ break;
112
+ default:
113
+ break;
114
+ }
115
+ };
116
+ // Click-outside — closes when a pointer lands outside both the trigger and the portaled menu.
117
+ React.useEffect(() => {
118
+ if (!open)
119
+ return;
120
+ const handlePointerDown = (e) => {
121
+ const target = e.target;
122
+ if (triggerRef.current?.contains(target))
123
+ return;
124
+ if (document.getElementById(menuId)?.contains(target))
125
+ return;
126
+ setOpen(false);
127
+ };
128
+ document.addEventListener('pointerdown', handlePointerDown);
129
+ return () => document.removeEventListener('pointerdown', handlePointerDown);
130
+ }, [open, menuId]);
131
+ return (_jsxs("div", { "data-helix-part": "select-root", ...(fullWidth ? { 'data-full-width': '' } : {}), ...(disabled ? { 'data-disabled': '' } : {}), ...(invalid ? { 'data-invalid': '' } : {}), className: cn(className), children: [_jsxs("label", { "data-helix-part": "select-label", htmlFor: id, style: hideLabel ? { position: 'absolute', width: 1, height: 1, overflow: 'hidden', clip: 'rect(0,0,0,0)' } : undefined, children: [label, required && _jsx("span", { "data-helix-part": "select-required", "aria-hidden": "true", children: " *" })] }), _jsxs("div", { "data-helix-part": "select-wrapper", ...(disabled ? { 'data-disabled': '' } : {}), ...(invalid ? { 'data-invalid': '' } : {}), children: [_jsx("button", { ref: triggerRef, type: "button", id: id, "data-helix-part": "select-trigger", ...(!selectedOption ? { 'data-placeholder': '' } : {}), disabled: disabled,
132
+ // role="combobox" — the WAI-ARIA select-only combobox pattern. A plain button role doesn't
133
+ // allow aria-required or aria-activedescendant (axe aria-allowed-attr); combobox allows both
134
+ // and is a permitted role on <button> (ARIA in HTML).
135
+ role: "combobox", "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": open ? menuId : undefined, "aria-invalid": invalid || undefined, "aria-describedby": describedby, "aria-required": required || undefined, "aria-activedescendant": open && activeValue ? optionId(menuId, activeValue) : undefined, onClick: () => (open ? closeMenu() : openMenu(undefined, 'pointer')), onKeyDown: handleTriggerKeyDown, children: _jsx("span", { "data-helix-part": "select-trigger-label", children: selectedOption?.label ?? placeholder ?? '' }) }), _jsx("span", { "data-helix-part": "select-chevron", "aria-hidden": "true", children: _jsx(Icon, { icon: IconChevronDown, size: 16 }) }), _jsx(Menu, { id: menuId, expanded: open, anchorRef: triggerRef, options: options, onSelect: commit, ...(current !== undefined ? { value: current } : {}), ...(activeValue !== undefined ? { activeValue } : {}) }), (name || required) && (_jsx("input", { "data-helix-part": "select-native", type: "text", tabIndex: -1, "aria-hidden": "true", name: name, value: current ?? '', required: required, disabled: disabled, onChange: () => { }, onFocus: () => triggerRef.current?.focus() }))] }), description && !invalid && (_jsx("span", { id: descId, "data-helix-part": "select-description", children: description })), invalid && errorMessage && (_jsx("span", { id: errId, "data-helix-part": "select-error", role: "alert", children: errorMessage }))] }));
136
+ }
137
+ Select.displayName = 'Select';
138
+ //# sourceMappingURL=Select.js.map
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @helixds/react — agent note
3
+ * Before using Select, read its contract: node_modules/@helixds/react/dist/contracts/Select.json
4
+ * (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
5
+ * Guide: node_modules/@helixds/react/AGENTS.md
6
+ */
7
+ export interface SelectOption {
8
+ value: string;
9
+ label: string;
10
+ /** Short secondary text aligned to the end of the option in the list — a value, count or percentage. */
11
+ labelEnd?: string;
12
+ disabled?: boolean;
13
+ }
14
+ export interface SelectOptionGroup {
15
+ label: string;
16
+ options: SelectOption[];
17
+ }
18
+ export interface SelectProps {
19
+ label: string;
20
+ options: (SelectOption | SelectOptionGroup)[];
21
+ value?: string;
22
+ defaultValue?: string;
23
+ onChange?: (value: string) => void;
24
+ placeholder?: string;
25
+ description?: string;
26
+ errorMessage?: string;
27
+ invalid?: boolean;
28
+ disabled?: boolean;
29
+ required?: boolean;
30
+ fullWidth?: boolean;
31
+ hideLabel?: boolean;
32
+ id?: string;
33
+ name?: string;
34
+ className?: string;
35
+ }
36
+ //# sourceMappingURL=Select.types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Select.types.js.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @helixds/react — agent note
3
+ * Before using Select, read its contract: node_modules/@helixds/react/dist/contracts/Select.json
4
+ * (every prop, which are required, when not to use it, the import line). Do not guess Helix props.
5
+ * Guide: node_modules/@helixds/react/AGENTS.md
6
+ */
7
+ export { Select } from './Select.js';
8
+ export type { SelectProps, SelectOption, SelectOptionGroup } from './Select.types.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { Select } from './Select.js';
2
+ //# sourceMappingURL=index.js.map