@sixthshift/design-system 0.3.0 → 0.4.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 (508) hide show
  1. package/README.md +114 -12
  2. package/dist/components/Badge/Badge.d.ts +64 -9
  3. package/dist/components/Badge/Badge.d.ts.map +1 -1
  4. package/dist/components/Badge/Badge.js +54 -46
  5. package/dist/components/Badge/Badge.js.map +1 -1
  6. package/dist/components/Badge/index.d.ts +1 -1
  7. package/dist/components/Badge/index.d.ts.map +1 -1
  8. package/dist/components/Badge/index.js +1 -1
  9. package/dist/components/Badge/index.js.map +1 -1
  10. package/dist/components/BarChart/BarChart.d.ts +12 -0
  11. package/dist/components/BarChart/BarChart.d.ts.map +1 -1
  12. package/dist/components/BarChart/BarChart.js +12 -0
  13. package/dist/components/BarChart/BarChart.js.map +1 -1
  14. package/dist/components/Button/Button.d.ts +85 -6
  15. package/dist/components/Button/Button.d.ts.map +1 -1
  16. package/dist/components/Button/Button.js +97 -106
  17. package/dist/components/Button/Button.js.map +1 -1
  18. package/dist/components/Button/index.d.ts +1 -1
  19. package/dist/components/Button/index.d.ts.map +1 -1
  20. package/dist/components/Button/index.js +1 -1
  21. package/dist/components/Button/index.js.map +1 -1
  22. package/dist/components/Calendar/Calendar.d.ts +18 -4
  23. package/dist/components/Calendar/Calendar.d.ts.map +1 -1
  24. package/dist/components/Calendar/Calendar.js +19 -5
  25. package/dist/components/Calendar/Calendar.js.map +1 -1
  26. package/dist/components/Calendar/CalendarView.d.ts.map +1 -1
  27. package/dist/components/Calendar/CalendarView.js +10 -2
  28. package/dist/components/Calendar/CalendarView.js.map +1 -1
  29. package/dist/components/Calendar/calendar.types.d.ts +9 -0
  30. package/dist/components/Calendar/calendar.types.d.ts.map +1 -1
  31. package/dist/components/Card/Card.d.ts +13 -0
  32. package/dist/components/Card/Card.d.ts.map +1 -1
  33. package/dist/components/Card/Card.js +15 -2
  34. package/dist/components/Card/Card.js.map +1 -1
  35. package/dist/components/Checkbox/Checkbox.d.ts +21 -0
  36. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  37. package/dist/components/Checkbox/Checkbox.js +22 -1
  38. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  39. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +22 -0
  40. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
  41. package/dist/components/CheckboxGroup/CheckboxGroup.js +22 -0
  42. package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
  43. package/dist/components/Code/Editor/Editor.js +2 -2
  44. package/dist/components/Code/Editor/Editor.js.map +1 -1
  45. package/dist/components/Code/Editor/themes.d.ts +2 -2
  46. package/dist/components/Code/Editor/themes.d.ts.map +1 -1
  47. package/dist/components/Code/Editor/themes.js +50 -32
  48. package/dist/components/Code/Editor/themes.js.map +1 -1
  49. package/dist/components/Code/ValidationStatus/ValidationStatus.d.ts.map +1 -1
  50. package/dist/components/Code/ValidationStatus/ValidationStatus.js.map +1 -1
  51. package/dist/components/DatePicker/DatePicker.d.ts +43 -0
  52. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  53. package/dist/components/DatePicker/DatePicker.js +166 -4
  54. package/dist/components/DatePicker/DatePicker.js.map +1 -1
  55. package/dist/components/DatePicker/DateSegments.d.ts +60 -0
  56. package/dist/components/DatePicker/DateSegments.d.ts.map +1 -0
  57. package/dist/components/DatePicker/DateSegments.js +80 -0
  58. package/dist/components/DatePicker/DateSegments.js.map +1 -0
  59. package/dist/components/DatePicker/datepicker.types.d.ts +19 -1
  60. package/dist/components/DatePicker/datepicker.types.d.ts.map +1 -1
  61. package/dist/components/DatePicker/index.d.ts +1 -1
  62. package/dist/components/DatePicker/index.d.ts.map +1 -1
  63. package/dist/components/DateRangePicker/DateRangePicker.d.ts +20 -2
  64. package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  65. package/dist/components/DateRangePicker/DateRangePicker.js +22 -4
  66. package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
  67. package/dist/components/DateRangePicker/daterangepicker.types.d.ts +6 -1
  68. package/dist/components/DateRangePicker/daterangepicker.types.d.ts.map +1 -1
  69. package/dist/components/DateTimePicker/DateTimePicker.d.ts +30 -2
  70. package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  71. package/dist/components/DateTimePicker/DateTimePicker.js +105 -32
  72. package/dist/components/DateTimePicker/DateTimePicker.js.map +1 -1
  73. package/dist/components/DateTimePicker/DateTimeSegments.d.ts +41 -0
  74. package/dist/components/DateTimePicker/DateTimeSegments.d.ts.map +1 -0
  75. package/dist/components/DateTimePicker/DateTimeSegments.js +67 -0
  76. package/dist/components/DateTimePicker/DateTimeSegments.js.map +1 -0
  77. package/dist/components/DateTimePicker/datetimepicker.types.d.ts +6 -1
  78. package/dist/components/DateTimePicker/datetimepicker.types.d.ts.map +1 -1
  79. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +28 -2
  80. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
  81. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js +136 -58
  82. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
  83. package/dist/components/DateTimeRangePicker/datetimerangepicker.types.d.ts +6 -1
  84. package/dist/components/DateTimeRangePicker/datetimerangepicker.types.d.ts.map +1 -1
  85. package/dist/components/Field/Field.d.ts +15 -17
  86. package/dist/components/Field/Field.d.ts.map +1 -1
  87. package/dist/components/Field/Field.js +18 -3
  88. package/dist/components/Field/Field.js.map +1 -1
  89. package/dist/components/FormField/FormField.d.ts +15 -0
  90. package/dist/components/FormField/FormField.d.ts.map +1 -1
  91. package/dist/components/FormField/FormField.js +15 -0
  92. package/dist/components/FormField/FormField.js.map +1 -1
  93. package/dist/components/HoverCard/HoverCard.d.ts +6 -0
  94. package/dist/components/HoverCard/HoverCard.d.ts.map +1 -1
  95. package/dist/components/HoverCard/HoverCard.js +6 -0
  96. package/dist/components/HoverCard/HoverCard.js.map +1 -1
  97. package/dist/components/Input/Input.d.ts +15 -0
  98. package/dist/components/Input/Input.d.ts.map +1 -1
  99. package/dist/components/Input/Input.js +18 -3
  100. package/dist/components/Input/Input.js.map +1 -1
  101. package/dist/components/LineChart/LineChart.d.ts +17 -0
  102. package/dist/components/LineChart/LineChart.d.ts.map +1 -1
  103. package/dist/components/LineChart/LineChart.js +17 -0
  104. package/dist/components/LineChart/LineChart.js.map +1 -1
  105. package/dist/components/Markdown/Markdown.d.ts +17 -0
  106. package/dist/components/Markdown/Markdown.d.ts.map +1 -1
  107. package/dist/components/Markdown/Markdown.js +17 -0
  108. package/dist/components/Markdown/Markdown.js.map +1 -1
  109. package/dist/components/Message/Message.d.ts +49 -4
  110. package/dist/components/Message/Message.d.ts.map +1 -1
  111. package/dist/components/Message/Message.js +53 -17
  112. package/dist/components/Message/Message.js.map +1 -1
  113. package/dist/components/Message/index.d.ts +1 -1
  114. package/dist/components/Message/index.d.ts.map +1 -1
  115. package/dist/components/Modal/Modal.d.ts +36 -0
  116. package/dist/components/Modal/Modal.d.ts.map +1 -1
  117. package/dist/components/Modal/Modal.js +37 -1
  118. package/dist/components/Modal/Modal.js.map +1 -1
  119. package/dist/components/Modal/components/ModalHeader.js +1 -1
  120. package/dist/components/Modal/components/ModalHeader.js.map +1 -1
  121. package/dist/components/Popover/Popover.d.ts +29 -0
  122. package/dist/components/Popover/Popover.d.ts.map +1 -1
  123. package/dist/components/Popover/Popover.js +29 -0
  124. package/dist/components/Popover/Popover.js.map +1 -1
  125. package/dist/components/ProgressBar/ProgressBar.d.ts +14 -0
  126. package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -1
  127. package/dist/components/ProgressBar/ProgressBar.js +14 -0
  128. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  129. package/dist/components/RadioButton/RadioButton.d.ts +26 -0
  130. package/dist/components/RadioButton/RadioButton.d.ts.map +1 -1
  131. package/dist/components/RadioButton/RadioButton.js +35 -1
  132. package/dist/components/RadioButton/RadioButton.js.map +1 -1
  133. package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts +26 -0
  134. package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts.map +1 -1
  135. package/dist/components/RadioButtonGroup/RadioButtonGroup.js +33 -0
  136. package/dist/components/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
  137. package/dist/components/SearchInput/SearchInput.d.ts +10 -0
  138. package/dist/components/SearchInput/SearchInput.d.ts.map +1 -1
  139. package/dist/components/SearchInput/SearchInput.js +12 -1
  140. package/dist/components/SearchInput/SearchInput.js.map +1 -1
  141. package/dist/components/Select/Select.d.ts +4 -5
  142. package/dist/components/Select/Select.d.ts.map +1 -1
  143. package/dist/components/Select/Select.js +4 -5
  144. package/dist/components/Select/Select.js.map +1 -1
  145. package/dist/components/Select/SelectDropdown.d.ts.map +1 -1
  146. package/dist/components/Select/SelectDropdown.js +4 -3
  147. package/dist/components/Select/SelectDropdown.js.map +1 -1
  148. package/dist/components/Select/SelectTrigger.js +2 -2
  149. package/dist/components/Select/SelectTrigger.js.map +1 -1
  150. package/dist/components/Separator/Separator.d.ts +10 -0
  151. package/dist/components/Separator/Separator.d.ts.map +1 -1
  152. package/dist/components/Separator/Separator.js +10 -0
  153. package/dist/components/Separator/Separator.js.map +1 -1
  154. package/dist/components/Sheet/Sheet.d.ts +6 -0
  155. package/dist/components/Sheet/Sheet.d.ts.map +1 -1
  156. package/dist/components/Sheet/Sheet.js +7 -1
  157. package/dist/components/Sheet/Sheet.js.map +1 -1
  158. package/dist/components/Sheet/components/SheetFooter.js +1 -1
  159. package/dist/components/Sheet/components/SheetFooter.js.map +1 -1
  160. package/dist/components/Sheet/components/SheetHeader.js +1 -1
  161. package/dist/components/Sheet/components/SheetHeader.js.map +1 -1
  162. package/dist/components/Sparkline/Sparkline.d.ts +11 -0
  163. package/dist/components/Sparkline/Sparkline.d.ts.map +1 -1
  164. package/dist/components/Sparkline/Sparkline.js +11 -0
  165. package/dist/components/Sparkline/Sparkline.js.map +1 -1
  166. package/dist/components/Spinner/Spinner.d.ts +27 -2
  167. package/dist/components/Spinner/Spinner.d.ts.map +1 -1
  168. package/dist/components/Spinner/Spinner.js +28 -3
  169. package/dist/components/Spinner/Spinner.js.map +1 -1
  170. package/dist/components/Switch/Switch.d.ts +18 -0
  171. package/dist/components/Switch/Switch.d.ts.map +1 -1
  172. package/dist/components/Switch/Switch.js +19 -1
  173. package/dist/components/Switch/Switch.js.map +1 -1
  174. package/dist/components/Tabs/Tabs.d.ts +6 -0
  175. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  176. package/dist/components/Tabs/Tabs.js +6 -0
  177. package/dist/components/Tabs/Tabs.js.map +1 -1
  178. package/dist/components/Tabs/components/TabsTrigger.d.ts.map +1 -1
  179. package/dist/components/Tabs/components/TabsTrigger.js +22 -6
  180. package/dist/components/Tabs/components/TabsTrigger.js.map +1 -1
  181. package/dist/components/TagChip/TagChip.d.ts +14 -12
  182. package/dist/components/TagChip/TagChip.d.ts.map +1 -1
  183. package/dist/components/TagChip/TagChip.js +14 -1
  184. package/dist/components/TagChip/TagChip.js.map +1 -1
  185. package/dist/components/TagInput/TagInput.d.ts +11 -8
  186. package/dist/components/TagInput/TagInput.d.ts.map +1 -1
  187. package/dist/components/TagInput/TagInput.js +11 -0
  188. package/dist/components/TagInput/TagInput.js.map +1 -1
  189. package/dist/components/Text/Text.d.ts +9 -0
  190. package/dist/components/Text/Text.d.ts.map +1 -1
  191. package/dist/components/Text/Text.js +9 -0
  192. package/dist/components/Text/Text.js.map +1 -1
  193. package/dist/components/TextInline/TextInline.d.ts +15 -4
  194. package/dist/components/TextInline/TextInline.d.ts.map +1 -1
  195. package/dist/components/TextInline/TextInline.js +11 -0
  196. package/dist/components/TextInline/TextInline.js.map +1 -1
  197. package/dist/components/Textarea/Textarea.d.ts +12 -0
  198. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  199. package/dist/components/Textarea/Textarea.js +13 -1
  200. package/dist/components/Textarea/Textarea.js.map +1 -1
  201. package/dist/components/TimePicker/TimeColumn.d.ts +10 -1
  202. package/dist/components/TimePicker/TimeColumn.d.ts.map +1 -1
  203. package/dist/components/TimePicker/TimeColumn.js +8 -1
  204. package/dist/components/TimePicker/TimeColumn.js.map +1 -1
  205. package/dist/components/TimePicker/TimePicker.d.ts +32 -0
  206. package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
  207. package/dist/components/TimePicker/TimePicker.js +93 -6
  208. package/dist/components/TimePicker/TimePicker.js.map +1 -1
  209. package/dist/components/TimePicker/TimeSegments.d.ts +50 -0
  210. package/dist/components/TimePicker/TimeSegments.d.ts.map +1 -0
  211. package/dist/components/TimePicker/TimeSegments.js +93 -0
  212. package/dist/components/TimePicker/TimeSegments.js.map +1 -0
  213. package/dist/components/TimePicker/timepicker.hooks.d.ts +0 -4
  214. package/dist/components/TimePicker/timepicker.hooks.d.ts.map +1 -1
  215. package/dist/components/TimePicker/timepicker.hooks.js +1 -23
  216. package/dist/components/TimePicker/timepicker.hooks.js.map +1 -1
  217. package/dist/components/TimePicker/timepicker.types.d.ts +0 -2
  218. package/dist/components/TimePicker/timepicker.types.d.ts.map +1 -1
  219. package/dist/components/Toast/Toast.d.ts +27 -0
  220. package/dist/components/Toast/Toast.d.ts.map +1 -1
  221. package/dist/components/Toast/Toast.js +28 -1
  222. package/dist/components/Toast/Toast.js.map +1 -1
  223. package/dist/components/Toggle/Toggle.d.ts +31 -12
  224. package/dist/components/Toggle/Toggle.d.ts.map +1 -1
  225. package/dist/components/Toggle/Toggle.js +19 -31
  226. package/dist/components/Toggle/Toggle.js.map +1 -1
  227. package/dist/components/Toggle/index.d.ts +1 -1
  228. package/dist/components/Toggle/index.d.ts.map +1 -1
  229. package/dist/components/Toggle/index.js +1 -1
  230. package/dist/components/Toggle/index.js.map +1 -1
  231. package/dist/components/ToggleGroup/ToggleGroup.d.ts +17 -0
  232. package/dist/components/ToggleGroup/ToggleGroup.d.ts.map +1 -1
  233. package/dist/components/ToggleGroup/ToggleGroup.js +17 -0
  234. package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -1
  235. package/dist/components/ToggleGroup/ToggleGroupItem.d.ts +1 -1
  236. package/dist/components/ToggleGroup/ToggleGroupItem.d.ts.map +1 -1
  237. package/dist/components/ToggleGroup/ToggleGroupItem.js +7 -6
  238. package/dist/components/ToggleGroup/ToggleGroupItem.js.map +1 -1
  239. package/dist/components/ToggleGroup/ToggleGroupMultiple.d.ts +4 -3
  240. package/dist/components/ToggleGroup/ToggleGroupMultiple.d.ts.map +1 -1
  241. package/dist/components/ToggleGroup/ToggleGroupMultiple.js +2 -2
  242. package/dist/components/ToggleGroup/ToggleGroupMultiple.js.map +1 -1
  243. package/dist/components/ToggleGroup/ToggleGroupSingle.d.ts +4 -3
  244. package/dist/components/ToggleGroup/ToggleGroupSingle.d.ts.map +1 -1
  245. package/dist/components/ToggleGroup/ToggleGroupSingle.js +2 -2
  246. package/dist/components/ToggleGroup/ToggleGroupSingle.js.map +1 -1
  247. package/dist/components/ToggleGroup/toggleGroup.types.d.ts +12 -3
  248. package/dist/components/ToggleGroup/toggleGroup.types.d.ts.map +1 -1
  249. package/dist/components/Tooltip/Tooltip.d.ts +6 -0
  250. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  251. package/dist/components/Tooltip/Tooltip.js +6 -0
  252. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  253. package/dist/date-time/index.d.ts.map +1 -1
  254. package/dist/date-time/index.js +0 -1
  255. package/dist/date-time/index.js.map +1 -1
  256. package/dist/internal/PickerField.d.ts +45 -0
  257. package/dist/internal/PickerField.d.ts.map +1 -0
  258. package/dist/internal/PickerField.js +24 -0
  259. package/dist/internal/PickerField.js.map +1 -0
  260. package/dist/internal/SegmentedField.d.ts +98 -0
  261. package/dist/internal/SegmentedField.d.ts.map +1 -0
  262. package/dist/internal/SegmentedField.js +315 -0
  263. package/dist/internal/SegmentedField.js.map +1 -0
  264. package/dist/internal/index.d.ts +2 -0
  265. package/dist/internal/index.d.ts.map +1 -1
  266. package/dist/internal/index.js +2 -0
  267. package/dist/internal/index.js.map +1 -1
  268. package/dist/theme/index.d.ts +2 -2
  269. package/dist/theme/index.d.ts.map +1 -1
  270. package/dist/theme/index.js +1 -1
  271. package/dist/theme/index.js.map +1 -1
  272. package/dist/theme/schema.d.ts +0 -22
  273. package/dist/theme/schema.d.ts.map +1 -1
  274. package/dist/theme/schema.js +0 -9
  275. package/dist/theme/schema.js.map +1 -1
  276. package/package.json +3 -45
  277. package/src/components/Badge/Badge.tsx +85 -48
  278. package/src/components/Badge/index.ts +10 -1
  279. package/src/components/BarChart/BarChart.tsx +12 -0
  280. package/src/components/Button/Button.tsx +129 -106
  281. package/src/components/Button/index.ts +10 -1
  282. package/src/components/Calendar/Calendar.tsx +29 -16
  283. package/src/components/Calendar/CalendarView.tsx +10 -1
  284. package/src/components/Calendar/calendar.types.ts +10 -0
  285. package/src/components/Card/Card.tsx +15 -2
  286. package/src/components/Checkbox/Checkbox.tsx +22 -2
  287. package/src/components/CheckboxGroup/CheckboxGroup.tsx +22 -0
  288. package/src/components/Code/Editor/Editor.tsx +2 -2
  289. package/src/components/Code/Editor/themes.ts +50 -32
  290. package/src/components/Code/ValidationStatus/ValidationStatus.tsx +6 -3
  291. package/src/components/DatePicker/DatePicker.tsx +279 -28
  292. package/src/components/DatePicker/DateSegments.tsx +125 -0
  293. package/src/components/DatePicker/datepicker.types.ts +21 -1
  294. package/src/components/DatePicker/index.ts +8 -1
  295. package/src/components/DateRangePicker/DateRangePicker.tsx +22 -4
  296. package/src/components/DateRangePicker/daterangepicker.types.ts +7 -1
  297. package/src/components/DateTimePicker/DateTimePicker.tsx +143 -70
  298. package/src/components/DateTimePicker/DateTimeSegments.tsx +113 -0
  299. package/src/components/DateTimePicker/datetimepicker.types.ts +7 -1
  300. package/src/components/DateTimeRangePicker/DateTimeRangePicker.tsx +195 -104
  301. package/src/components/DateTimeRangePicker/datetimerangepicker.types.ts +7 -1
  302. package/src/components/Field/Field.tsx +20 -22
  303. package/src/components/FormField/FormField.tsx +15 -0
  304. package/src/components/HoverCard/HoverCard.tsx +6 -0
  305. package/src/components/Input/Input.tsx +19 -4
  306. package/src/components/LineChart/LineChart.tsx +17 -0
  307. package/src/components/Markdown/Markdown.tsx +17 -0
  308. package/src/components/Message/Message.tsx +73 -23
  309. package/src/components/Message/index.ts +1 -1
  310. package/src/components/Modal/Modal.tsx +42 -3
  311. package/src/components/Modal/components/ModalHeader.tsx +1 -1
  312. package/src/components/Popover/Popover.tsx +29 -0
  313. package/src/components/ProgressBar/ProgressBar.tsx +14 -0
  314. package/src/components/RadioButton/RadioButton.tsx +34 -3
  315. package/src/components/RadioButtonGroup/RadioButtonGroup.tsx +32 -0
  316. package/src/components/SearchInput/SearchInput.tsx +13 -2
  317. package/src/components/Select/Select.tsx +4 -5
  318. package/src/components/Select/SelectDropdown.tsx +13 -9
  319. package/src/components/Select/SelectTrigger.tsx +7 -7
  320. package/src/components/Separator/Separator.tsx +10 -0
  321. package/src/components/Sheet/Sheet.tsx +8 -2
  322. package/src/components/Sheet/components/SheetFooter.tsx +1 -1
  323. package/src/components/Sheet/components/SheetHeader.tsx +2 -2
  324. package/src/components/Sparkline/Sparkline.tsx +11 -0
  325. package/src/components/Spinner/Spinner.tsx +28 -3
  326. package/src/components/Switch/Switch.tsx +27 -4
  327. package/src/components/Tabs/Tabs.tsx +6 -0
  328. package/src/components/Tabs/components/TabsTrigger.tsx +22 -5
  329. package/src/components/TagChip/TagChip.tsx +18 -16
  330. package/src/components/TagInput/TagInput.tsx +11 -8
  331. package/src/components/Text/Text.tsx +9 -0
  332. package/src/components/TextInline/TextInline.tsx +11 -0
  333. package/src/components/Textarea/Textarea.tsx +13 -1
  334. package/src/components/TimePicker/TimeColumn.tsx +24 -1
  335. package/src/components/TimePicker/TimePicker.tsx +127 -39
  336. package/src/components/TimePicker/TimeSegments.tsx +131 -0
  337. package/src/components/TimePicker/timepicker.hooks.ts +1 -24
  338. package/src/components/TimePicker/timepicker.types.ts +0 -3
  339. package/src/components/Toast/Toast.tsx +28 -1
  340. package/src/components/Toggle/Toggle.tsx +34 -32
  341. package/src/components/Toggle/index.ts +1 -1
  342. package/src/components/ToggleGroup/ToggleGroup.tsx +17 -0
  343. package/src/components/ToggleGroup/ToggleGroupItem.tsx +13 -8
  344. package/src/components/ToggleGroup/ToggleGroupMultiple.tsx +3 -1
  345. package/src/components/ToggleGroup/ToggleGroupSingle.tsx +3 -1
  346. package/src/components/ToggleGroup/toggleGroup.types.ts +12 -3
  347. package/src/components/Tooltip/Tooltip.tsx +6 -0
  348. package/src/date-time/index.ts +0 -1
  349. package/src/internal/PickerField.tsx +90 -0
  350. package/src/internal/SegmentedField.tsx +445 -0
  351. package/src/internal/index.ts +2 -0
  352. package/src/theme/index.ts +0 -6
  353. package/src/theme/recipes/badge.css +140 -0
  354. package/src/theme/recipes/button.css +167 -0
  355. package/src/theme/recipes/card.css +26 -0
  356. package/src/theme/recipes/checkbox.css +44 -0
  357. package/src/theme/recipes/field.css +14 -0
  358. package/src/theme/recipes/index.css +28 -0
  359. package/src/theme/recipes/input.css +29 -0
  360. package/src/theme/recipes/message.css +47 -0
  361. package/src/theme/recipes/modal.css +31 -0
  362. package/src/theme/recipes/radio-button.css +42 -0
  363. package/src/theme/recipes/search-input.css +16 -0
  364. package/src/theme/recipes/select.css +105 -0
  365. package/src/theme/recipes/sheet.css +34 -0
  366. package/src/theme/recipes/spinner.css +17 -0
  367. package/src/theme/recipes/switch.css +39 -0
  368. package/src/theme/recipes/tabs.css +41 -0
  369. package/src/theme/recipes/tag-chip.css +27 -0
  370. package/src/theme/recipes/textarea.css +20 -0
  371. package/src/theme/recipes/toggle.css +92 -0
  372. package/src/theme/schema.ts +0 -27
  373. package/src/theme/tokens.css +26 -9
  374. package/dist/components/Avatar/Avatar.d.ts +0 -6
  375. package/dist/components/Avatar/Avatar.d.ts.map +0 -1
  376. package/dist/components/Avatar/Avatar.js +0 -11
  377. package/dist/components/Avatar/Avatar.js.map +0 -1
  378. package/dist/components/Avatar/index.d.ts +0 -2
  379. package/dist/components/Avatar/index.d.ts.map +0 -1
  380. package/dist/components/Avatar/index.js +0 -2
  381. package/dist/components/Avatar/index.js.map +0 -1
  382. package/dist/components/Breadcrumb/Breadcrumb.d.ts +0 -12
  383. package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +0 -1
  384. package/dist/components/Breadcrumb/Breadcrumb.js +0 -19
  385. package/dist/components/Breadcrumb/Breadcrumb.js.map +0 -1
  386. package/dist/components/Breadcrumb/index.d.ts +0 -2
  387. package/dist/components/Breadcrumb/index.d.ts.map +0 -1
  388. package/dist/components/Breadcrumb/index.js +0 -2
  389. package/dist/components/Breadcrumb/index.js.map +0 -1
  390. package/dist/components/ColorDot/ColorDot.d.ts +0 -19
  391. package/dist/components/ColorDot/ColorDot.d.ts.map +0 -1
  392. package/dist/components/ColorDot/ColorDot.js +0 -36
  393. package/dist/components/ColorDot/ColorDot.js.map +0 -1
  394. package/dist/components/ColorDot/index.d.ts +0 -2
  395. package/dist/components/ColorDot/index.d.ts.map +0 -1
  396. package/dist/components/ColorDot/index.js +0 -2
  397. package/dist/components/ColorDot/index.js.map +0 -1
  398. package/dist/components/EmptyState/EmptyState.d.ts +0 -26
  399. package/dist/components/EmptyState/EmptyState.d.ts.map +0 -1
  400. package/dist/components/EmptyState/EmptyState.js +0 -9
  401. package/dist/components/EmptyState/EmptyState.js.map +0 -1
  402. package/dist/components/EmptyState/index.d.ts +0 -2
  403. package/dist/components/EmptyState/index.d.ts.map +0 -1
  404. package/dist/components/EmptyState/index.js +0 -2
  405. package/dist/components/EmptyState/index.js.map +0 -1
  406. package/dist/components/HeatMap/HeatMapCalendar.d.ts +0 -11
  407. package/dist/components/HeatMap/HeatMapCalendar.d.ts.map +0 -1
  408. package/dist/components/HeatMap/HeatMapCalendar.js +0 -68
  409. package/dist/components/HeatMap/HeatMapCalendar.js.map +0 -1
  410. package/dist/components/HeatMap/HeatMapMatrix.d.ts +0 -12
  411. package/dist/components/HeatMap/HeatMapMatrix.d.ts.map +0 -1
  412. package/dist/components/HeatMap/HeatMapMatrix.js +0 -35
  413. package/dist/components/HeatMap/HeatMapMatrix.js.map +0 -1
  414. package/dist/components/HeatMap/heat-map.utils.d.ts +0 -10
  415. package/dist/components/HeatMap/heat-map.utils.d.ts.map +0 -1
  416. package/dist/components/HeatMap/heat-map.utils.js +0 -10
  417. package/dist/components/HeatMap/heat-map.utils.js.map +0 -1
  418. package/dist/components/HeatMap/index.d.ts +0 -4
  419. package/dist/components/HeatMap/index.d.ts.map +0 -1
  420. package/dist/components/HeatMap/index.js +0 -3
  421. package/dist/components/HeatMap/index.js.map +0 -1
  422. package/dist/components/MetricList/MetricList.d.ts +0 -9
  423. package/dist/components/MetricList/MetricList.d.ts.map +0 -1
  424. package/dist/components/MetricList/MetricList.js +0 -8
  425. package/dist/components/MetricList/MetricList.js.map +0 -1
  426. package/dist/components/MetricList/MetricRow.d.ts +0 -13
  427. package/dist/components/MetricList/MetricRow.d.ts.map +0 -1
  428. package/dist/components/MetricList/MetricRow.js +0 -13
  429. package/dist/components/MetricList/MetricRow.js.map +0 -1
  430. package/dist/components/MetricList/index.d.ts +0 -3
  431. package/dist/components/MetricList/index.d.ts.map +0 -1
  432. package/dist/components/MetricList/index.js +0 -3
  433. package/dist/components/MetricList/index.js.map +0 -1
  434. package/dist/components/NavBottom/NavBottom.d.ts +0 -16
  435. package/dist/components/NavBottom/NavBottom.d.ts.map +0 -1
  436. package/dist/components/NavBottom/NavBottom.js +0 -21
  437. package/dist/components/NavBottom/NavBottom.js.map +0 -1
  438. package/dist/components/NavBottom/index.d.ts +0 -3
  439. package/dist/components/NavBottom/index.d.ts.map +0 -1
  440. package/dist/components/NavBottom/index.js +0 -2
  441. package/dist/components/NavBottom/index.js.map +0 -1
  442. package/dist/components/NavSide/NavItem.d.ts +0 -9
  443. package/dist/components/NavSide/NavItem.d.ts.map +0 -1
  444. package/dist/components/NavSide/NavItem.js +0 -13
  445. package/dist/components/NavSide/NavItem.js.map +0 -1
  446. package/dist/components/NavSide/NavSide.d.ts +0 -16
  447. package/dist/components/NavSide/NavSide.d.ts.map +0 -1
  448. package/dist/components/NavSide/NavSide.js +0 -12
  449. package/dist/components/NavSide/NavSide.js.map +0 -1
  450. package/dist/components/NavSide/index.d.ts +0 -3
  451. package/dist/components/NavSide/index.d.ts.map +0 -1
  452. package/dist/components/NavSide/index.js +0 -2
  453. package/dist/components/NavSide/index.js.map +0 -1
  454. package/dist/components/NavSide/types.d.ts +0 -38
  455. package/dist/components/NavSide/types.d.ts.map +0 -1
  456. package/dist/components/NavSide/types.js +0 -2
  457. package/dist/components/NavSide/types.js.map +0 -1
  458. package/dist/components/Pagination/Pagination.d.ts +0 -35
  459. package/dist/components/Pagination/Pagination.d.ts.map +0 -1
  460. package/dist/components/Pagination/Pagination.js +0 -26
  461. package/dist/components/Pagination/Pagination.js.map +0 -1
  462. package/dist/components/Pagination/index.d.ts +0 -3
  463. package/dist/components/Pagination/index.d.ts.map +0 -1
  464. package/dist/components/Pagination/index.js +0 -2
  465. package/dist/components/Pagination/index.js.map +0 -1
  466. package/dist/components/Skeleton/Skeleton.d.ts +0 -4
  467. package/dist/components/Skeleton/Skeleton.d.ts.map +0 -1
  468. package/dist/components/Skeleton/Skeleton.js +0 -9
  469. package/dist/components/Skeleton/Skeleton.js.map +0 -1
  470. package/dist/components/Skeleton/index.d.ts +0 -2
  471. package/dist/components/Skeleton/index.d.ts.map +0 -1
  472. package/dist/components/Skeleton/index.js +0 -2
  473. package/dist/components/Skeleton/index.js.map +0 -1
  474. package/dist/components/StatsCard/StatsCard.d.ts +0 -17
  475. package/dist/components/StatsCard/StatsCard.d.ts.map +0 -1
  476. package/dist/components/StatsCard/StatsCard.js +0 -15
  477. package/dist/components/StatsCard/StatsCard.js.map +0 -1
  478. package/dist/components/StatsCard/index.d.ts +0 -2
  479. package/dist/components/StatsCard/index.d.ts.map +0 -1
  480. package/dist/components/StatsCard/index.js +0 -2
  481. package/dist/components/StatsCard/index.js.map +0 -1
  482. package/src/components/Avatar/Avatar.tsx +0 -19
  483. package/src/components/Avatar/index.ts +0 -1
  484. package/src/components/Breadcrumb/Breadcrumb.tsx +0 -47
  485. package/src/components/Breadcrumb/index.ts +0 -5
  486. package/src/components/ColorDot/ColorDot.tsx +0 -52
  487. package/src/components/ColorDot/index.ts +0 -1
  488. package/src/components/EmptyState/EmptyState.tsx +0 -30
  489. package/src/components/EmptyState/index.ts +0 -1
  490. package/src/components/HeatMap/HeatMapCalendar.tsx +0 -127
  491. package/src/components/HeatMap/HeatMapMatrix.tsx +0 -75
  492. package/src/components/HeatMap/heat-map.utils.ts +0 -15
  493. package/src/components/HeatMap/index.ts +0 -3
  494. package/src/components/MetricList/MetricList.tsx +0 -18
  495. package/src/components/MetricList/MetricRow.tsx +0 -30
  496. package/src/components/MetricList/index.ts +0 -2
  497. package/src/components/NavBottom/NavBottom.tsx +0 -55
  498. package/src/components/NavBottom/index.ts +0 -3
  499. package/src/components/NavSide/NavItem.tsx +0 -39
  500. package/src/components/NavSide/NavSide.tsx +0 -42
  501. package/src/components/NavSide/index.ts +0 -2
  502. package/src/components/NavSide/types.ts +0 -36
  503. package/src/components/Pagination/Pagination.tsx +0 -86
  504. package/src/components/Pagination/index.ts +0 -2
  505. package/src/components/Skeleton/Skeleton.tsx +0 -9
  506. package/src/components/Skeleton/index.ts +0 -1
  507. package/src/components/StatsCard/StatsCard.tsx +0 -41
  508. package/src/components/StatsCard/index.ts +0 -1
@@ -2,58 +2,95 @@ import { cn } from "@sixthshift/design-system/utils";
2
2
  import { cva, type VariantProps } from "class-variance-authority";
3
3
  import * as React from "react";
4
4
 
5
+ /**
6
+ * Geometry and behaviour only.
7
+ *
8
+ * Every colour reads a `--badge-*` component token whose value is decided by
9
+ * src/theme/recipes/badge.css. That file is the mapping from
10
+ * `(variant, intent)` to a semantic token — the layer that used to be
11
+ * `compoundVariants` here, where it was compiled into class-name literals and
12
+ * unreachable from outside. Nothing in this file names a colour, which is the
13
+ * point: the semantics are now configurable without a release.
14
+ */
5
15
  const badgeVariants = cva(
6
- "inline-flex items-center rounded-md border px-2.5 py-0.5 font-semibold text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-border-brand focus:ring-offset-2",
7
- {
8
- variants: {
9
- variant: {
10
- solid: "border-transparent shadow",
11
- soft: "border-transparent",
12
- outline: "",
13
- },
14
- intent: {
15
- neutral: "",
16
- primary: "",
17
- danger: "",
18
- success: "",
19
- warning: "",
20
- muted: "",
21
- },
22
- },
23
- compoundVariants: [
24
- // Solid variants
25
- { variant: "solid", intent: "neutral", className: "bg-bg-strong text-fg-on-strong" },
26
- { variant: "solid", intent: "primary", className: "bg-bg-brand text-fg-on-brand" },
27
- { variant: "solid", intent: "danger", className: "bg-bg-danger text-fg-on-danger" },
28
- { variant: "solid", intent: "success", className: "bg-bg-success text-fg-on-success" },
29
- { variant: "solid", intent: "warning", className: "bg-bg-warning text-fg-on-warning" },
30
- { variant: "solid", intent: "muted", className: "bg-bg-subtle text-fg-subtle" },
31
- // Soft variants
32
- { variant: "soft", intent: "neutral", className: "bg-bg-subtle text-fg-normal" },
33
- { variant: "soft", intent: "primary", className: "bg-bg-brand-subtle text-fg-on-brand-subtle" },
34
- { variant: "soft", intent: "danger", className: "bg-bg-danger-subtle text-fg-on-danger-subtle" },
35
- { variant: "soft", intent: "success", className: "bg-bg-success-subtle text-fg-on-success-subtle" },
36
- { variant: "soft", intent: "warning", className: "bg-bg-warning-subtle text-fg-on-warning-subtle" },
37
- { variant: "soft", intent: "muted", className: "bg-bg-subtle text-fg-subtle" },
38
- // Outline variants
39
- { variant: "outline", intent: "neutral", className: "border-border-normal bg-bg-normal text-fg-normal" },
40
- { variant: "outline", intent: "primary", className: "border-border-brand bg-bg-normal text-fg-brand" },
41
- { variant: "outline", intent: "danger", className: "border-border-danger bg-bg-normal text-fg-danger" },
42
- { variant: "outline", intent: "success", className: "border-border-success bg-bg-normal text-fg-success" },
43
- { variant: "outline", intent: "warning", className: "border-border-warning bg-bg-normal text-fg-warning" },
44
- { variant: "outline", intent: "muted", className: "border-border-normal bg-bg-normal text-fg-subtle" },
45
- ],
46
- defaultVariants: {
47
- variant: "solid",
48
- intent: "primary",
49
- },
50
- }
16
+ // One literal, deliberately: `useSortedClasses --unsafe` strips the trailing
17
+ // space before a `+`, silently welding the last class of one fragment to the
18
+ // first of the next. The screenshots catch it, but a single string means the
19
+ // sorter has nothing to break.
20
+ "badge border-(color:--badge-border) focus:ring-(color:--badge-ring) inline-flex items-center rounded-md border bg-(--badge-bg) px-2.5 py-0.5 font-semibold text-(--badge-fg) text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-offset-2",
21
+ { variants: {} }
51
22
  );
52
23
 
53
- export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & VariantProps<typeof badgeVariants>;
24
+ /**
25
+ * The non-colour half of `variant` — elevation only, for Badge. A plain
26
+ * lookup rather than a CVA variant so an unrecognised variant stays a legal
27
+ * value that contributes no structure, leaving a consumer's CSS free to
28
+ * define it. `intent` needs no equivalent: it was never anything but colour.
29
+ */
30
+ const variantStructure: Record<string, string> = {
31
+ solid: "shadow",
32
+ soft: "",
33
+ outline: "",
34
+ };
54
35
 
55
- export const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(({ className, variant, intent, ...props }, ref) => {
56
- return <span ref={ref} className={cn(badgeVariants({ variant, intent }), className)} {...props} />;
36
+ /**
37
+ * Widened deliberately. Adding a variant or an intent is a CSS change in the
38
+ * consuming app, not a release here — so the type has to admit values this
39
+ * file has never heard of, while still autocompleting the ones it ships.
40
+ */
41
+ type Loose<T extends string> = T | (string & {});
42
+
43
+ export type BadgeVariantName = "solid" | "soft" | "outline";
44
+ /**
45
+ * `primary` was this component's name for the brand colour, and nothing else in
46
+ * the system used it — the token is `--bg-brand`, and
47
+ * docs/modals.md already told callers to write `intent="brand"`. It is off the
48
+ * closed union as of this release but still resolves, via an aliased selector in
49
+ * badge.css; `BadgeIntent` is widened, so it also still type-checks.
50
+ */
51
+ export type BadgeIntentName = "neutral" | "brand" | "danger" | "success" | "warning" | "muted";
52
+ export type BadgeVariant = Loose<BadgeVariantName>;
53
+ export type BadgeIntent = Loose<BadgeIntentName>;
54
+
55
+ export type BadgeRecipeProps = VariantProps<typeof badgeVariants> & {
56
+ variant?: BadgeVariant | undefined;
57
+ intent?: BadgeIntent | undefined;
58
+ className?: string | undefined;
59
+ };
60
+
61
+ /**
62
+ * The class string plus the two attributes the recipe selects on.
63
+ */
64
+ export function badgeRecipe({ variant = "solid", intent = "brand", className }: BadgeRecipeProps) {
65
+ return {
66
+ className: cn(variantStructure[variant], badgeVariants({ className })),
67
+ "data-variant": variant,
68
+ "data-intent": intent,
69
+ };
70
+ }
71
+
72
+ export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & {
73
+ variant?: BadgeVariant | undefined;
74
+ intent?: BadgeIntent | undefined;
75
+ };
76
+
77
+ /**
78
+ * Small label for status, category, or count.
79
+ *
80
+ * Two independent axes, same split as Button: `variant` is the fill
81
+ * (`solid`, `soft`, `outline`), `intent` is what it signals (`neutral`,
82
+ * `brand`, `danger`, `success`, `warning`, `muted`) — `muted` has no
83
+ * Button equivalent, for de-emphasized metadata rather than a status.
84
+ * Renders a `<span>`; purely presentational, so give it visible text — it
85
+ * does not manage an accessible name of its own.
86
+ *
87
+ * Colour is not decided here: each `(variant, intent)` pairing resolves
88
+ * through a `--badge-*` component token (src/theme/recipes/badge.css), the
89
+ * same seam Button uses, so a consumer can re-point a cell without a
90
+ * release.
91
+ */
92
+ export const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(({ className, variant = "solid", intent = "brand", ...props }, ref) => {
93
+ return <span ref={ref} {...badgeRecipe({ variant, intent, className })} {...props} />;
57
94
  });
58
95
  Badge.displayName = "Badge";
59
96
 
@@ -1 +1,10 @@
1
- export { Badge, type BadgeProps, badgeVariants } from "./Badge";
1
+ export {
2
+ Badge,
3
+ type BadgeIntent,
4
+ type BadgeIntentName,
5
+ type BadgeProps,
6
+ type BadgeVariant,
7
+ type BadgeVariantName,
8
+ badgeRecipe,
9
+ badgeVariants,
10
+ } from "./Badge";
@@ -17,6 +17,18 @@ export type BarChartProps = React.HTMLAttributes<HTMLDivElement> & {
17
17
 
18
18
  const DEFAULT_COLORS = ["var(--fg-brand)", "var(--fg-success)", "var(--fg-warning)", "var(--fg-danger)", "var(--fg-subtle)"];
19
19
 
20
+ /**
21
+ * Horizontal bar chart, rendered as plain `<div>` bars rather than SVG — each
22
+ * row is a label, a track, and a colored fill sized to the item's percentage
23
+ * of `maxValue` (auto-detected from the data when omitted).
24
+ *
25
+ * Colour is per-item: pass a CSS color string via `color` on a
26
+ * `BarChartItem` (typically a `var(--fg-*)` token), or omit it to cycle
27
+ * through the built-in `DEFAULT_COLORS` list by index. There is no
28
+ * chart-level accessible name — the only text exposed to assistive tech is
29
+ * the visible label and, when `showValues` is true (the default), the
30
+ * formatted value next to each bar.
31
+ */
20
32
  export const BarChart = React.forwardRef<HTMLDivElement, BarChartProps>(
21
33
  ({ data, showValues = true, maxValue: maxValueProp, formatValue = (v) => String(v), barHeight = 24, className, ...rest }, ref) => {
22
34
  const maxValue = maxValueProp ?? Math.max(...data.map((d) => d.value), 1);
@@ -3,136 +3,159 @@ import { cva, type VariantProps } from "class-variance-authority";
3
3
  import * as React from "react";
4
4
  import { Slot } from "../../internal/Slot";
5
5
 
6
+ /**
7
+ * Geometry and behaviour only.
8
+ *
9
+ * Every colour reads a `--button-*` component token whose value is decided by
10
+ * src/theme/recipes/button.css. That file is the mapping from
11
+ * `(variant, intent, state)` to a semantic token — the layer that used to be
12
+ * `compoundVariants` here, where it was compiled into class-name literals and
13
+ * unreachable from outside. Nothing in this file names a colour, which is the
14
+ * point: the semantics are now configurable without a release.
15
+ */
6
16
  const buttonVariants = cva(
7
- "inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
17
+ // One literal, deliberately: `useSortedClasses --unsafe` strips the trailing
18
+ // space before a `+`, silently welding the last class of one fragment to the
19
+ // first of the next. The screenshots catch it, but a single string means the
20
+ // sorter has nothing to break.
21
+ "btn border-(color:--button-border) focus-visible:ring-(color:--button-ring) inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md bg-(--button-bg) font-medium text-(--button-fg) text-sm transition-colors hover:bg-(--button-bg-hovered) focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2 active:bg-(--button-bg-pressed) disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
8
22
  {
9
23
  variants: {
10
- variant: {
11
- solid: "shadow",
12
- outline: "border bg-bg-normal shadow-xs",
13
- ghost: "",
14
- link: "underline-offset-4 hover:underline",
15
- },
16
- intent: {
17
- neutral: "",
18
- danger: "",
19
- success: "",
20
- warning: "",
21
- },
22
24
  size: {
23
- default: "h-9 px-4 py-2",
24
25
  xs: "h-7 rounded-md px-2 text-xs",
25
26
  sm: "h-8 rounded-md px-3 text-xs",
27
+ md: "h-9 px-4 py-2",
26
28
  lg: "h-10 rounded-md px-8",
27
29
  xl: "h-12 rounded-md px-10 text-base",
28
- icon: "h-9 w-9",
29
30
  },
30
31
  },
31
- compoundVariants: [
32
- // Solid variants
33
- {
34
- variant: "solid",
35
- intent: "neutral",
36
- className: "bg-bg-brand text-fg-on-brand hover:bg-bg-brand-hovered active:bg-bg-brand-pressed",
37
- },
38
- {
39
- variant: "solid",
40
- intent: "danger",
41
- className: "bg-bg-danger text-fg-on-danger hover:bg-bg-danger-hovered active:bg-bg-danger-pressed",
42
- },
43
- {
44
- variant: "solid",
45
- intent: "success",
46
- className: "bg-bg-success text-fg-on-success hover:bg-bg-success-hovered active:bg-bg-success-pressed",
47
- },
48
- {
49
- variant: "solid",
50
- intent: "warning",
51
- className: "bg-bg-warning text-fg-on-warning hover:bg-bg-warning-hovered active:bg-bg-warning-pressed",
52
- },
53
- // Outline variants
54
- {
55
- variant: "outline",
56
- intent: "neutral",
57
- className: "border-border-normal text-fg-normal hover:bg-bg-subtle-hovered active:bg-bg-subtle-pressed",
58
- },
59
- {
60
- variant: "outline",
61
- intent: "danger",
62
- className: "border-border-danger text-fg-danger hover:bg-bg-danger-subtle-hovered active:bg-bg-danger-subtle-pressed",
63
- },
64
- {
65
- variant: "outline",
66
- intent: "success",
67
- className: "border-border-success text-fg-success hover:bg-bg-success-subtle-hovered active:bg-bg-success-subtle-pressed",
68
- },
69
- {
70
- variant: "outline",
71
- intent: "warning",
72
- className: "border-border-warning text-fg-warning hover:bg-bg-warning-subtle-hovered active:bg-bg-warning-subtle-pressed",
73
- },
74
- // Ghost variants
75
- {
76
- variant: "ghost",
77
- intent: "neutral",
78
- className: "text-fg-normal hover:bg-bg-subtle-hovered active:bg-bg-subtle-pressed",
79
- },
80
- {
81
- variant: "ghost",
82
- intent: "danger",
83
- className: "text-fg-danger hover:bg-bg-danger-subtle-hovered active:bg-bg-danger-subtle-pressed",
84
- },
85
- {
86
- variant: "ghost",
87
- intent: "success",
88
- className: "text-fg-success hover:bg-bg-success-subtle-hovered active:bg-bg-success-subtle-pressed",
89
- },
90
- {
91
- variant: "ghost",
92
- intent: "warning",
93
- className: "text-fg-warning hover:bg-bg-warning-subtle-hovered active:bg-bg-warning-subtle-pressed",
94
- },
95
- // Link variants
96
- {
97
- variant: "link",
98
- intent: "neutral",
99
- className: "text-fg-brand",
100
- },
101
- {
102
- variant: "link",
103
- intent: "danger",
104
- className: "text-fg-danger",
105
- },
106
- {
107
- variant: "link",
108
- intent: "success",
109
- className: "text-fg-success",
110
- },
111
- {
112
- variant: "link",
113
- intent: "warning",
114
- className: "text-fg-warning",
115
- },
116
- ],
117
32
  defaultVariants: {
118
- variant: "solid",
119
- intent: "neutral",
120
- size: "default",
33
+ size: "md",
121
34
  },
122
35
  }
123
36
  );
124
37
 
38
+ /**
39
+ * The non-colour half of `variant` — border width, elevation, underline.
40
+ *
41
+ * A plain lookup rather than a CVA variant so an unrecognised variant stays a
42
+ * legal value that contributes no structure, leaving a consumer's CSS free to
43
+ * define it. `intent` needs no equivalent: it was never anything but colour.
44
+ */
45
+ const variantStructure: Record<string, string> = {
46
+ solid: "shadow",
47
+ outline: "border shadow-xs",
48
+ ghost: "",
49
+ link: "underline-offset-4 hover:underline",
50
+ };
51
+
52
+ /**
53
+ * Squares the box at whatever size is set, and drops the horizontal padding.
54
+ *
55
+ * Shape, kept off the size union deliberately. A single axis carrying both a
56
+ * scale and a shape cannot express a *small* icon button, which is what a fixed
57
+ * `icon: "h-9 w-9"` size amounted to. Keyed by size rather than folded into the
58
+ * size classes so the two stay orthogonal; `cn` (tailwind-merge) resolves
59
+ * `px-0` against the size's own `px-*`, last write winning.
60
+ */
61
+ const iconOnlyGeometry: Record<string, string> = {
62
+ xs: "w-7 px-0",
63
+ sm: "w-8 px-0",
64
+ md: "w-9 px-0",
65
+ lg: "w-10 px-0",
66
+ xl: "w-12 px-0",
67
+ };
68
+
69
+ /**
70
+ * Widened deliberately. Adding a variant or an intent is a CSS change in the
71
+ * consuming app, not a release here — so the type has to admit values this file
72
+ * has never heard of, while still autocompleting the ones it ships.
73
+ *
74
+ * The closed unions are exported alongside, because widening a type gives up the
75
+ * ability to narrow it downstream: once `string` is in the union,
76
+ * `Exclude<ButtonVariant, "link">` can no longer remove `link`. ToggleGroup
77
+ * relies on exactly that exclusion, so it builds on the closed names.
78
+ */
79
+ type Loose<T extends string> = T | (string & {});
80
+
81
+ export type ButtonVariantName = "solid" | "outline" | "ghost" | "link";
82
+ export type ButtonIntentName = "neutral" | "brand" | "danger" | "success" | "warning";
83
+ export type ButtonVariant = Loose<ButtonVariantName>;
84
+ export type ButtonIntent = Loose<ButtonIntentName>;
85
+
86
+ export type ButtonRecipeProps = VariantProps<typeof buttonVariants> & {
87
+ variant?: ButtonVariant | undefined;
88
+ intent?: ButtonIntent | undefined;
89
+ iconOnly?: boolean | undefined;
90
+ className?: string | undefined;
91
+ };
92
+
93
+ /**
94
+ * The class string plus the two attributes the recipe selects on.
95
+ *
96
+ * Shared with Toggle and ToggleGroupItem, which are built on Button's look. The
97
+ * data attributes are half the contract now, so anything reusing that look has
98
+ * to emit them as well or it lands on the recipe's floor instead of a cell.
99
+ */
100
+ export function buttonRecipe({ variant = "solid", intent = "neutral", size, iconOnly = false, className }: ButtonRecipeProps) {
101
+ return {
102
+ className: cn(
103
+ variantStructure[variant],
104
+ // `className` stays last so a caller still outranks the icon geometry.
105
+ buttonVariants({ size, className: cn(iconOnly ? iconOnlyGeometry[size ?? "md"] : undefined, className) })
106
+ ),
107
+ "data-variant": variant,
108
+ "data-intent": intent,
109
+ };
110
+ }
111
+
125
112
  export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> &
126
113
  VariantProps<typeof buttonVariants> & {
114
+ variant?: ButtonVariant | undefined;
115
+ intent?: ButtonIntent | undefined;
116
+ /** Square the button at its current size, for an icon with no label. */
117
+ iconOnly?: boolean;
127
118
  asChild?: boolean;
128
119
  loading?: boolean;
129
120
  };
130
121
 
122
+ /**
123
+ * A single action the user can take.
124
+ *
125
+ * Appearance is three independent axes, so every combination is expressible:
126
+ * `variant` is the fill and shape (`solid`, `outline`, `ghost`, `link`),
127
+ * `intent` is what the action *means* (`brand` — the default — plus `neutral`,
128
+ * `danger`, `success`, `warning`), and `size` is the height scale. Reach for
129
+ * `intent="danger"` on a destructive action rather than a red `variant` — that
130
+ * is the distinction that keeps "outline danger" possible.
131
+ *
132
+ * `neutral` means *no colour family*: a grey button, the same thing the word
133
+ * means on Badge and Message. A brand-coloured button is
134
+ * `intent="brand"` — an affirmative choice, which is why `neutral` is the
135
+ * default: omitting the prop means "no particular meaning", so it should not
136
+ * quietly hand back the brand colour. Button used to spell brand as `neutral`
137
+ * for `solid` and `link` while `outline` and `ghost` were already grey, so a
138
+ * primary action now needs `intent="brand"` said out loud.
139
+ *
140
+ * Colour is not decided here. Each pairing resolves through a `--button-*`
141
+ * component token, so a consumer can re-point any cell — or add an intent this
142
+ * library never shipped — from their own stylesheet. See the Component tokens
143
+ * story below.
144
+ *
145
+ * `iconOnly` squares the box at whatever `size` is set and drops the
146
+ * horizontal padding, for a button whose whole content is an icon — give it an
147
+ * `aria-label`, since there is no text to name it. It is a separate prop rather
148
+ * than a size, so `size="sm" iconOnly` is expressible.
149
+ *
150
+ * `asChild` renders the child element with Button's styling instead of a
151
+ * `<button>`, for links that should look like buttons. `loading` shows a spinner
152
+ * and disables the control, so it does not need `disabled` as well.
153
+ */
131
154
  const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
132
- ({ className, variant, intent, size, asChild = false, loading = false, children, disabled, ...props }, ref) => {
155
+ ({ className, variant = "solid", intent = "neutral", size, iconOnly = false, asChild = false, loading = false, children, disabled, ...props }, ref) => {
133
156
  const Comp = asChild ? Slot : "button";
134
157
  return (
135
- <Comp className={cn(buttonVariants({ variant, intent, size, className }))} ref={ref} disabled={disabled || loading} {...props}>
158
+ <Comp {...buttonRecipe({ variant, intent, size, iconOnly, className })} ref={ref} disabled={disabled || loading} {...props}>
136
159
  {loading ? (
137
160
  <>
138
161
  <svg className="animate-spin" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true">
@@ -1 +1,10 @@
1
- export { Button, type ButtonProps, buttonVariants } from "./Button";
1
+ export {
2
+ Button,
3
+ type ButtonIntent,
4
+ type ButtonIntentName,
5
+ type ButtonProps,
6
+ type ButtonVariant,
7
+ type ButtonVariantName,
8
+ buttonRecipe,
9
+ buttonVariants,
10
+ } from "./Button";
@@ -1,19 +1,3 @@
1
- /**
2
- * Calendar — the public, ISO-string-typed calendar.
3
- *
4
- * A thin adapter over {@link CalendarView}: it parses incoming ISO strings and
5
- * serialises outgoing selections. All the behaviour lives in CalendarView.
6
- *
7
- * Every conversion is memoised on the string it came from, and every handler is
8
- * stable. Temporal objects have no value identity — `PlainDate.from("2026-08-26")`
9
- * is never `===` another PlainDate for the same day — and CalendarView keys
10
- * `useMemo`/`useCallback` on these values directly, so converting unmemoised
11
- * would invalidate the whole grid on every render.
12
- *
13
- * Props are read with `"key" in props` rather than destructured per mode,
14
- * because every hook here has to run unconditionally.
15
- */
16
-
17
1
  import * as React from "react";
18
2
  import { useCallback, useMemo } from "react";
19
3
  import {
@@ -33,6 +17,35 @@ import type { CalendarProps, CalendarViewProps, DateRangeValue, PresetOption } f
33
17
 
34
18
  export type { CalendarProps };
35
19
 
20
+ /**
21
+ * Inline month grid for picking one date, a range, or several dates — the
22
+ * building block `DatePicker` puts behind a popover trigger. Reach for
23
+ * `Calendar` directly when the grid should be always visible rather than
24
+ * opened on demand.
25
+ *
26
+ * `mode` (`"single" | "range" | "multiple"`) decides the shape of `value` and
27
+ * `onSelect`: an `ISODate` string, an `ISODateRange` (`{ from?, to? }`), or an
28
+ * `ISODate[]` respectively. There is no uncontrolled form — `value` and
29
+ * `onSelect` are both required, so the caller always owns the selection.
30
+ *
31
+ * `minDate`/`maxDate` bound the selectable range inclusively; `disabled` takes
32
+ * a single date, a list, or a declarative matcher (before/after/range/weekday)
33
+ * or predicate — see `DisabledDates`. Day cells form a roving-tabindex grid:
34
+ * arrow keys move by day, Home/End jump to the start/end of the week, and
35
+ * PageUp/PageDown request a month change.
36
+ *
37
+ * A thin adapter over {@link CalendarView}: it parses incoming ISO strings and
38
+ * serialises outgoing selections. All the behaviour lives in CalendarView.
39
+ *
40
+ * Every conversion is memoised on the string it came from, and every handler is
41
+ * stable. Temporal objects have no value identity — `PlainDate.from("2026-08-26")`
42
+ * is never `===` another PlainDate for the same day — and CalendarView keys
43
+ * `useMemo`/`useCallback` on these values directly, so converting unmemoised
44
+ * would invalidate the whole grid on every render.
45
+ *
46
+ * Props are read with `"key" in props` rather than destructured per mode,
47
+ * because every hook here has to run unconditionally.
48
+ */
36
49
  export const Calendar = React.forwardRef<HTMLDivElement, CalendarProps>((props, ref) => {
37
50
  const { mode, month, onMonthChange, minDate, maxDate, disabled, weekStartsOn, showFooter, showToday, onApply, onCancel, className } = props;
38
51
 
@@ -72,6 +72,7 @@ export const CalendarView = React.forwardRef<HTMLDivElement, CalendarViewProps>(
72
72
  maxDate,
73
73
  disabled,
74
74
  weekStartsOn = 0,
75
+ autoFocusDay = false,
75
76
  showFooter = false,
76
77
  showToday = true,
77
78
  onApply,
@@ -274,6 +275,14 @@ export const CalendarView = React.forwardRef<HTMLDivElement, CalendarViewProps>(
274
275
  gridRef.current?.querySelector<HTMLButtonElement>(`[data-date="${temporalToISO(focusedDate)}"]`)?.focus();
275
276
  }, [focusedDate]);
276
277
 
278
+ // Seed that focus once when the caller asked for it. Deliberately keyed on
279
+ // `autoFocusDay` alone: `activeDate` changes as the user navigates, and
280
+ // re-running then would drag focus back to where it started.
281
+ // biome-ignore lint/correctness/useExhaustiveDependencies: see above
282
+ useEffect(() => {
283
+ if (autoFocusDay) setFocusedDate((current) => current ?? activeDate);
284
+ }, [autoFocusDay]);
285
+
277
286
  // useCalendarDays always returns 42 days, so this is always 6 rows of 7.
278
287
  const weeks = useMemo(() => {
279
288
  const chunked: (typeof days)[] = [];
@@ -430,7 +439,7 @@ export const CalendarView = React.forwardRef<HTMLDivElement, CalendarViewProps>(
430
439
  </Button>
431
440
  )}
432
441
  {onApply && (
433
- <Button type="button" variant="solid" size="sm" onClick={onApply}>
442
+ <Button type="button" variant="solid" intent="brand" size="sm" onClick={onApply}>
434
443
  Apply
435
444
  </Button>
436
445
  )}
@@ -124,6 +124,16 @@ type CalendarViewBaseProps = {
124
124
  /** First day of week (0 = Sunday, 1 = Monday) */
125
125
  weekStartsOn?: WeekStartsOn | undefined;
126
126
 
127
+ /**
128
+ * Move DOM focus into the day grid on mount.
129
+ *
130
+ * Off by default: a grid that grabs focus when it appears is wrong for a
131
+ * pointer user who clicked a trigger. `DatePicker` turns it on only when the
132
+ * popover was opened from the keyboard (`Alt+ArrowDown`), where the whole
133
+ * point of opening it was to navigate days.
134
+ */
135
+ autoFocusDay?: boolean | undefined;
136
+
127
137
  /** Show footer with Today/Cancel/Apply buttons */
128
138
  showFooter?: boolean | undefined;
129
139
  /** Show Today button (only if showFooter=true) */
@@ -8,6 +8,19 @@ export type CardProps = Omit<React.HTMLAttributes<HTMLDivElement>, "title"> & {
8
8
  headerAction?: React.ReactNode;
9
9
  };
10
10
 
11
+ /**
12
+ * Bordered, elevated container — the "this contains data" building block
13
+ * (see docs/visual-hierarchy.md's Elevated tier). Renders a `<div>`, with an
14
+ * optional `<header>` when `title` and/or `headerAction` is passed.
15
+ *
16
+ * Passing `onClick` turns the whole card into a button: it gets
17
+ * `role="button"`, `tabIndex={0}`, and both Enter and Space activate it, not
18
+ * just a pointer click. Omit `onClick` for a purely presentational card.
19
+ *
20
+ * Colour reads `--card-*` component tokens (src/theme/recipes/card.css) —
21
+ * the same seam Button and Badge use — so a consumer can re-point them
22
+ * without a release.
23
+ */
11
24
  export const Card = React.forwardRef<HTMLDivElement, CardProps>(({ className, title, headerAction, children, onClick, onKeyDown, ...props }, ref) => {
12
25
  const isInteractive = !!onClick;
13
26
 
@@ -24,9 +37,9 @@ export const Card = React.forwardRef<HTMLDivElement, CardProps>(({ className, ti
24
37
  <div
25
38
  ref={ref}
26
39
  className={cn(
27
- "rounded-xl border border-border-normal bg-bg-normal p-6 text-fg-normal shadow",
40
+ "card border-(color:--card-border) rounded-xl border bg-(--card-bg) p-6 text-(--card-fg) shadow",
28
41
  isInteractive &&
29
- "cursor-pointer transition-colors hover:border-border-strong focus-visible:outline-2 focus-visible:outline-border-strong focus-visible:outline-offset-2",
42
+ "hover:border-(color:--card-border-hovered) focus-visible:outline-(color:--card-ring) cursor-pointer transition-colors focus-visible:outline-2 focus-visible:outline-offset-2",
30
43
  className
31
44
  )}
32
45
  onClick={onClick}
@@ -51,6 +51,27 @@ const IndeterminateIcon = () => (
51
51
  </svg>
52
52
  );
53
53
 
54
+ /**
55
+ * A single boolean, or tri-state, toggle — a custom button with
56
+ * `role="checkbox"` rather than a native `<input type="checkbox">`, so it
57
+ * can be styled without fighting native checkbox rendering.
58
+ *
59
+ * Controlled or uncontrolled via the `checked`/`defaultChecked`/
60
+ * `onCheckedChange` triad (`useControllableState`). `checked` also accepts
61
+ * `"indeterminate"`, which sets `aria-checked="mixed"` and swaps in a dash
62
+ * icon instead of the check — for a "select all" checkbox whose children are
63
+ * only partially selected. Clicking an indeterminate checkbox always
64
+ * resolves it to `true`, never back to indeterminate.
65
+ *
66
+ * Only participates in native form submission when `name` is set: a hidden
67
+ * native `<input type="checkbox">` is rendered alongside the button and
68
+ * kept in sync, carrying `value` (default `"on"`). Without `name`, state
69
+ * lives only in React and nothing is submitted.
70
+ *
71
+ * Passing `label` wraps the button and a `<Label>` together and wires
72
+ * `htmlFor`/`id` between them; without it, you get just the button and must
73
+ * supply your own accessible name.
74
+ */
54
75
  const Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(
55
76
  (
56
77
  {
@@ -93,8 +114,7 @@ const Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(
93
114
  ref={ref}
94
115
  onClick={() => setChecked(!isChecked)}
95
116
  className={cn(
96
- "peer h-4 w-4 shrink-0 cursor-pointer rounded-xs border border-border-brand shadow focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
97
- (isChecked || isIndeterminate) && "bg-bg-brand text-fg-on-brand",
117
+ "checkbox peer border-(color:--checkbox-border) focus-visible:ring-(color:--checkbox-ring) h-4 w-4 shrink-0 cursor-pointer rounded-xs border bg-(--checkbox-bg) text-(--checkbox-fg) shadow focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
98
118
  className
99
119
  )}
100
120
  {...props}
@@ -36,6 +36,28 @@ export type CheckboxGroupProps = Omit<React.HTMLAttributes<HTMLDivElement>, "onC
36
36
  onBlur?: () => void;
37
37
  };
38
38
 
39
+ /**
40
+ * A set of related checkboxes sharing one controlled/uncontrolled `string[]`
41
+ * selection, via the `value`/`defaultValue`/`onValueChange` triad
42
+ * (`useControllableState`).
43
+ *
44
+ * `variant="default"` (the default) renders one `Checkbox` per option, each
45
+ * with its own visible label, laid out in a column or row per
46
+ * `orientation`. `variant="button"` is a separate rendering path — not a
47
+ * re-skinned `Checkbox` — a row/column of plain buttons with
48
+ * `role="checkbox"` and no separate label; contiguous buttons touch and
49
+ * share borders (`appearance="segmented"`, the default) or sit apart with
50
+ * their own rounded corners (`appearance="separate"`).
51
+ *
52
+ * Form submission only happens when `name` is set. In the default variant
53
+ * that means each underlying `Checkbox` gets `name`, so one hidden native
54
+ * checkbox input is rendered per option; in the button variant the group
55
+ * itself renders one hidden `<input type="checkbox">` per *currently
56
+ * selected* value.
57
+ *
58
+ * Renders `role="group"`; focus leaving the whole group — not just moving
59
+ * between options — fires `onBlur`.
60
+ */
39
61
  const CheckboxGroup = React.forwardRef<HTMLDivElement, CheckboxGroupProps>(
40
62
  (
41
63
  {