@sixthshift/design-system 0.3.0 → 0.5.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 (518) hide show
  1. package/README.md +116 -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 +61 -2
  32. package/dist/components/Card/Card.d.ts.map +1 -1
  33. package/dist/components/Card/Card.js +99 -3
  34. package/dist/components/Card/Card.js.map +1 -1
  35. package/dist/components/Card/index.d.ts +1 -1
  36. package/dist/components/Card/index.d.ts.map +1 -1
  37. package/dist/components/Card/index.js +1 -1
  38. package/dist/components/Card/index.js.map +1 -1
  39. package/dist/components/Checkbox/Checkbox.d.ts +21 -0
  40. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  41. package/dist/components/Checkbox/Checkbox.js +22 -1
  42. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  43. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +22 -0
  44. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
  45. package/dist/components/CheckboxGroup/CheckboxGroup.js +22 -0
  46. package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
  47. package/dist/components/Code/Editor/Editor.js +2 -2
  48. package/dist/components/Code/Editor/Editor.js.map +1 -1
  49. package/dist/components/Code/Editor/themes.d.ts +2 -2
  50. package/dist/components/Code/Editor/themes.d.ts.map +1 -1
  51. package/dist/components/Code/Editor/themes.js +50 -32
  52. package/dist/components/Code/Editor/themes.js.map +1 -1
  53. package/dist/components/Code/ValidationStatus/ValidationStatus.d.ts.map +1 -1
  54. package/dist/components/Code/ValidationStatus/ValidationStatus.js.map +1 -1
  55. package/dist/components/DatePicker/DatePicker.d.ts +43 -0
  56. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  57. package/dist/components/DatePicker/DatePicker.js +166 -4
  58. package/dist/components/DatePicker/DatePicker.js.map +1 -1
  59. package/dist/components/DatePicker/DateSegments.d.ts +60 -0
  60. package/dist/components/DatePicker/DateSegments.d.ts.map +1 -0
  61. package/dist/components/DatePicker/DateSegments.js +80 -0
  62. package/dist/components/DatePicker/DateSegments.js.map +1 -0
  63. package/dist/components/DatePicker/datepicker.types.d.ts +19 -1
  64. package/dist/components/DatePicker/datepicker.types.d.ts.map +1 -1
  65. package/dist/components/DatePicker/index.d.ts +1 -1
  66. package/dist/components/DatePicker/index.d.ts.map +1 -1
  67. package/dist/components/DateRangePicker/DateRangePicker.d.ts +20 -2
  68. package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  69. package/dist/components/DateRangePicker/DateRangePicker.js +22 -4
  70. package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
  71. package/dist/components/DateRangePicker/daterangepicker.types.d.ts +6 -1
  72. package/dist/components/DateRangePicker/daterangepicker.types.d.ts.map +1 -1
  73. package/dist/components/DateTimePicker/DateTimePicker.d.ts +30 -2
  74. package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  75. package/dist/components/DateTimePicker/DateTimePicker.js +105 -32
  76. package/dist/components/DateTimePicker/DateTimePicker.js.map +1 -1
  77. package/dist/components/DateTimePicker/DateTimeSegments.d.ts +41 -0
  78. package/dist/components/DateTimePicker/DateTimeSegments.d.ts.map +1 -0
  79. package/dist/components/DateTimePicker/DateTimeSegments.js +67 -0
  80. package/dist/components/DateTimePicker/DateTimeSegments.js.map +1 -0
  81. package/dist/components/DateTimePicker/datetimepicker.types.d.ts +6 -1
  82. package/dist/components/DateTimePicker/datetimepicker.types.d.ts.map +1 -1
  83. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +28 -2
  84. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
  85. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js +136 -58
  86. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
  87. package/dist/components/DateTimeRangePicker/datetimerangepicker.types.d.ts +6 -1
  88. package/dist/components/DateTimeRangePicker/datetimerangepicker.types.d.ts.map +1 -1
  89. package/dist/components/Field/Field.d.ts +15 -17
  90. package/dist/components/Field/Field.d.ts.map +1 -1
  91. package/dist/components/Field/Field.js +18 -3
  92. package/dist/components/Field/Field.js.map +1 -1
  93. package/dist/components/FormField/FormField.d.ts +15 -0
  94. package/dist/components/FormField/FormField.d.ts.map +1 -1
  95. package/dist/components/FormField/FormField.js +15 -0
  96. package/dist/components/FormField/FormField.js.map +1 -1
  97. package/dist/components/HoverCard/HoverCard.d.ts +6 -0
  98. package/dist/components/HoverCard/HoverCard.d.ts.map +1 -1
  99. package/dist/components/HoverCard/HoverCard.js +6 -0
  100. package/dist/components/HoverCard/HoverCard.js.map +1 -1
  101. package/dist/components/Input/Input.d.ts +15 -0
  102. package/dist/components/Input/Input.d.ts.map +1 -1
  103. package/dist/components/Input/Input.js +18 -3
  104. package/dist/components/Input/Input.js.map +1 -1
  105. package/dist/components/LineChart/LineChart.d.ts +17 -0
  106. package/dist/components/LineChart/LineChart.d.ts.map +1 -1
  107. package/dist/components/LineChart/LineChart.js +17 -0
  108. package/dist/components/LineChart/LineChart.js.map +1 -1
  109. package/dist/components/Markdown/Markdown.d.ts +17 -0
  110. package/dist/components/Markdown/Markdown.d.ts.map +1 -1
  111. package/dist/components/Markdown/Markdown.js +17 -0
  112. package/dist/components/Markdown/Markdown.js.map +1 -1
  113. package/dist/components/Message/Message.d.ts +49 -4
  114. package/dist/components/Message/Message.d.ts.map +1 -1
  115. package/dist/components/Message/Message.js +53 -17
  116. package/dist/components/Message/Message.js.map +1 -1
  117. package/dist/components/Message/index.d.ts +1 -1
  118. package/dist/components/Message/index.d.ts.map +1 -1
  119. package/dist/components/Modal/Modal.d.ts +36 -0
  120. package/dist/components/Modal/Modal.d.ts.map +1 -1
  121. package/dist/components/Modal/Modal.js +37 -1
  122. package/dist/components/Modal/Modal.js.map +1 -1
  123. package/dist/components/Modal/components/ModalHeader.js +1 -1
  124. package/dist/components/Modal/components/ModalHeader.js.map +1 -1
  125. package/dist/components/Popover/Popover.d.ts +29 -0
  126. package/dist/components/Popover/Popover.d.ts.map +1 -1
  127. package/dist/components/Popover/Popover.js +29 -0
  128. package/dist/components/Popover/Popover.js.map +1 -1
  129. package/dist/components/ProgressBar/ProgressBar.d.ts +14 -0
  130. package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -1
  131. package/dist/components/ProgressBar/ProgressBar.js +14 -0
  132. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  133. package/dist/components/RadioButton/RadioButton.d.ts +26 -0
  134. package/dist/components/RadioButton/RadioButton.d.ts.map +1 -1
  135. package/dist/components/RadioButton/RadioButton.js +35 -1
  136. package/dist/components/RadioButton/RadioButton.js.map +1 -1
  137. package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts +26 -0
  138. package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts.map +1 -1
  139. package/dist/components/RadioButtonGroup/RadioButtonGroup.js +33 -0
  140. package/dist/components/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
  141. package/dist/components/SearchInput/SearchInput.d.ts +10 -0
  142. package/dist/components/SearchInput/SearchInput.d.ts.map +1 -1
  143. package/dist/components/SearchInput/SearchInput.js +12 -1
  144. package/dist/components/SearchInput/SearchInput.js.map +1 -1
  145. package/dist/components/Select/Select.d.ts +4 -5
  146. package/dist/components/Select/Select.d.ts.map +1 -1
  147. package/dist/components/Select/Select.js +4 -5
  148. package/dist/components/Select/Select.js.map +1 -1
  149. package/dist/components/Select/SelectDropdown.d.ts.map +1 -1
  150. package/dist/components/Select/SelectDropdown.js +4 -3
  151. package/dist/components/Select/SelectDropdown.js.map +1 -1
  152. package/dist/components/Select/SelectTrigger.js +2 -2
  153. package/dist/components/Select/SelectTrigger.js.map +1 -1
  154. package/dist/components/Separator/Separator.d.ts +10 -0
  155. package/dist/components/Separator/Separator.d.ts.map +1 -1
  156. package/dist/components/Separator/Separator.js +10 -0
  157. package/dist/components/Separator/Separator.js.map +1 -1
  158. package/dist/components/Sheet/Sheet.d.ts +6 -0
  159. package/dist/components/Sheet/Sheet.d.ts.map +1 -1
  160. package/dist/components/Sheet/Sheet.js +7 -1
  161. package/dist/components/Sheet/Sheet.js.map +1 -1
  162. package/dist/components/Sheet/components/SheetFooter.js +1 -1
  163. package/dist/components/Sheet/components/SheetFooter.js.map +1 -1
  164. package/dist/components/Sheet/components/SheetHeader.js +1 -1
  165. package/dist/components/Sheet/components/SheetHeader.js.map +1 -1
  166. package/dist/components/Sparkline/Sparkline.d.ts +11 -0
  167. package/dist/components/Sparkline/Sparkline.d.ts.map +1 -1
  168. package/dist/components/Sparkline/Sparkline.js +11 -0
  169. package/dist/components/Sparkline/Sparkline.js.map +1 -1
  170. package/dist/components/Spinner/Spinner.d.ts +27 -2
  171. package/dist/components/Spinner/Spinner.d.ts.map +1 -1
  172. package/dist/components/Spinner/Spinner.js +28 -3
  173. package/dist/components/Spinner/Spinner.js.map +1 -1
  174. package/dist/components/Switch/Switch.d.ts +18 -0
  175. package/dist/components/Switch/Switch.d.ts.map +1 -1
  176. package/dist/components/Switch/Switch.js +19 -1
  177. package/dist/components/Switch/Switch.js.map +1 -1
  178. package/dist/components/Tabs/Tabs.d.ts +6 -0
  179. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  180. package/dist/components/Tabs/Tabs.js +6 -0
  181. package/dist/components/Tabs/Tabs.js.map +1 -1
  182. package/dist/components/Tabs/components/TabsTrigger.d.ts.map +1 -1
  183. package/dist/components/Tabs/components/TabsTrigger.js +22 -6
  184. package/dist/components/Tabs/components/TabsTrigger.js.map +1 -1
  185. package/dist/components/TagChip/TagChip.d.ts +14 -12
  186. package/dist/components/TagChip/TagChip.d.ts.map +1 -1
  187. package/dist/components/TagChip/TagChip.js +14 -1
  188. package/dist/components/TagChip/TagChip.js.map +1 -1
  189. package/dist/components/TagInput/TagInput.d.ts +11 -8
  190. package/dist/components/TagInput/TagInput.d.ts.map +1 -1
  191. package/dist/components/TagInput/TagInput.js +11 -0
  192. package/dist/components/TagInput/TagInput.js.map +1 -1
  193. package/dist/components/Text/Text.d.ts +9 -0
  194. package/dist/components/Text/Text.d.ts.map +1 -1
  195. package/dist/components/Text/Text.js +9 -0
  196. package/dist/components/Text/Text.js.map +1 -1
  197. package/dist/components/TextInline/TextInline.d.ts +15 -4
  198. package/dist/components/TextInline/TextInline.d.ts.map +1 -1
  199. package/dist/components/TextInline/TextInline.js +11 -0
  200. package/dist/components/TextInline/TextInline.js.map +1 -1
  201. package/dist/components/Textarea/Textarea.d.ts +12 -0
  202. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  203. package/dist/components/Textarea/Textarea.js +13 -1
  204. package/dist/components/Textarea/Textarea.js.map +1 -1
  205. package/dist/components/TimePicker/TimeColumn.d.ts +10 -1
  206. package/dist/components/TimePicker/TimeColumn.d.ts.map +1 -1
  207. package/dist/components/TimePicker/TimeColumn.js +8 -1
  208. package/dist/components/TimePicker/TimeColumn.js.map +1 -1
  209. package/dist/components/TimePicker/TimePicker.d.ts +32 -0
  210. package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
  211. package/dist/components/TimePicker/TimePicker.js +93 -6
  212. package/dist/components/TimePicker/TimePicker.js.map +1 -1
  213. package/dist/components/TimePicker/TimeSegments.d.ts +50 -0
  214. package/dist/components/TimePicker/TimeSegments.d.ts.map +1 -0
  215. package/dist/components/TimePicker/TimeSegments.js +93 -0
  216. package/dist/components/TimePicker/TimeSegments.js.map +1 -0
  217. package/dist/components/TimePicker/timepicker.hooks.d.ts +0 -4
  218. package/dist/components/TimePicker/timepicker.hooks.d.ts.map +1 -1
  219. package/dist/components/TimePicker/timepicker.hooks.js +1 -23
  220. package/dist/components/TimePicker/timepicker.hooks.js.map +1 -1
  221. package/dist/components/TimePicker/timepicker.types.d.ts +0 -2
  222. package/dist/components/TimePicker/timepicker.types.d.ts.map +1 -1
  223. package/dist/components/Toast/Toast.d.ts +27 -0
  224. package/dist/components/Toast/Toast.d.ts.map +1 -1
  225. package/dist/components/Toast/Toast.js +28 -1
  226. package/dist/components/Toast/Toast.js.map +1 -1
  227. package/dist/components/Toggle/Toggle.d.ts +31 -12
  228. package/dist/components/Toggle/Toggle.d.ts.map +1 -1
  229. package/dist/components/Toggle/Toggle.js +19 -31
  230. package/dist/components/Toggle/Toggle.js.map +1 -1
  231. package/dist/components/Toggle/index.d.ts +1 -1
  232. package/dist/components/Toggle/index.d.ts.map +1 -1
  233. package/dist/components/Toggle/index.js +1 -1
  234. package/dist/components/Toggle/index.js.map +1 -1
  235. package/dist/components/ToggleGroup/ToggleGroup.d.ts +17 -0
  236. package/dist/components/ToggleGroup/ToggleGroup.d.ts.map +1 -1
  237. package/dist/components/ToggleGroup/ToggleGroup.js +17 -0
  238. package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -1
  239. package/dist/components/ToggleGroup/ToggleGroupItem.d.ts +1 -1
  240. package/dist/components/ToggleGroup/ToggleGroupItem.d.ts.map +1 -1
  241. package/dist/components/ToggleGroup/ToggleGroupItem.js +7 -6
  242. package/dist/components/ToggleGroup/ToggleGroupItem.js.map +1 -1
  243. package/dist/components/ToggleGroup/ToggleGroupMultiple.d.ts +4 -3
  244. package/dist/components/ToggleGroup/ToggleGroupMultiple.d.ts.map +1 -1
  245. package/dist/components/ToggleGroup/ToggleGroupMultiple.js +2 -2
  246. package/dist/components/ToggleGroup/ToggleGroupMultiple.js.map +1 -1
  247. package/dist/components/ToggleGroup/ToggleGroupSingle.d.ts +4 -3
  248. package/dist/components/ToggleGroup/ToggleGroupSingle.d.ts.map +1 -1
  249. package/dist/components/ToggleGroup/ToggleGroupSingle.js +2 -2
  250. package/dist/components/ToggleGroup/ToggleGroupSingle.js.map +1 -1
  251. package/dist/components/ToggleGroup/toggleGroup.types.d.ts +12 -3
  252. package/dist/components/ToggleGroup/toggleGroup.types.d.ts.map +1 -1
  253. package/dist/components/Tooltip/Tooltip.d.ts +6 -0
  254. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  255. package/dist/components/Tooltip/Tooltip.js +6 -0
  256. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  257. package/dist/date-time/index.d.ts.map +1 -1
  258. package/dist/date-time/index.js +0 -1
  259. package/dist/date-time/index.js.map +1 -1
  260. package/dist/internal/PickerField.d.ts +45 -0
  261. package/dist/internal/PickerField.d.ts.map +1 -0
  262. package/dist/internal/PickerField.js +24 -0
  263. package/dist/internal/PickerField.js.map +1 -0
  264. package/dist/internal/SegmentedField.d.ts +98 -0
  265. package/dist/internal/SegmentedField.d.ts.map +1 -0
  266. package/dist/internal/SegmentedField.js +315 -0
  267. package/dist/internal/SegmentedField.js.map +1 -0
  268. package/dist/internal/index.d.ts +2 -0
  269. package/dist/internal/index.d.ts.map +1 -1
  270. package/dist/internal/index.js +2 -0
  271. package/dist/internal/index.js.map +1 -1
  272. package/dist/lib/contexts/OverlayContext/OverlayContext.d.ts +2 -2
  273. package/dist/lib/contexts/OverlayContext/OverlayContext.d.ts.map +1 -1
  274. package/dist/lib/contexts/OverlayContext/OverlayContext.js +17 -6
  275. package/dist/lib/contexts/OverlayContext/OverlayContext.js.map +1 -1
  276. package/dist/theme/index.d.ts +2 -2
  277. package/dist/theme/index.d.ts.map +1 -1
  278. package/dist/theme/index.js +1 -1
  279. package/dist/theme/index.js.map +1 -1
  280. package/dist/theme/schema.d.ts +0 -22
  281. package/dist/theme/schema.d.ts.map +1 -1
  282. package/dist/theme/schema.js +0 -9
  283. package/dist/theme/schema.js.map +1 -1
  284. package/package.json +7 -48
  285. package/src/components/Badge/Badge.tsx +85 -48
  286. package/src/components/Badge/index.ts +10 -1
  287. package/src/components/BarChart/BarChart.tsx +12 -0
  288. package/src/components/Button/Button.tsx +129 -106
  289. package/src/components/Button/index.ts +10 -1
  290. package/src/components/Calendar/Calendar.tsx +29 -16
  291. package/src/components/Calendar/CalendarView.tsx +10 -1
  292. package/src/components/Calendar/calendar.types.ts +10 -0
  293. package/src/components/Card/Card.tsx +114 -15
  294. package/src/components/Card/index.ts +1 -1
  295. package/src/components/Checkbox/Checkbox.tsx +22 -2
  296. package/src/components/CheckboxGroup/CheckboxGroup.tsx +22 -0
  297. package/src/components/Code/Editor/Editor.tsx +2 -2
  298. package/src/components/Code/Editor/themes.ts +50 -32
  299. package/src/components/Code/ValidationStatus/ValidationStatus.tsx +6 -3
  300. package/src/components/DatePicker/DatePicker.tsx +279 -28
  301. package/src/components/DatePicker/DateSegments.tsx +125 -0
  302. package/src/components/DatePicker/datepicker.types.ts +21 -1
  303. package/src/components/DatePicker/index.ts +8 -1
  304. package/src/components/DateRangePicker/DateRangePicker.tsx +22 -4
  305. package/src/components/DateRangePicker/daterangepicker.types.ts +7 -1
  306. package/src/components/DateTimePicker/DateTimePicker.tsx +143 -70
  307. package/src/components/DateTimePicker/DateTimeSegments.tsx +113 -0
  308. package/src/components/DateTimePicker/datetimepicker.types.ts +7 -1
  309. package/src/components/DateTimeRangePicker/DateTimeRangePicker.tsx +195 -104
  310. package/src/components/DateTimeRangePicker/datetimerangepicker.types.ts +7 -1
  311. package/src/components/Field/Field.tsx +20 -22
  312. package/src/components/FormField/FormField.tsx +15 -0
  313. package/src/components/HoverCard/HoverCard.tsx +6 -0
  314. package/src/components/Input/Input.tsx +19 -4
  315. package/src/components/LineChart/LineChart.tsx +17 -0
  316. package/src/components/Markdown/Markdown.tsx +17 -0
  317. package/src/components/Message/Message.tsx +73 -23
  318. package/src/components/Message/index.ts +1 -1
  319. package/src/components/Modal/Modal.tsx +42 -3
  320. package/src/components/Modal/components/ModalHeader.tsx +1 -1
  321. package/src/components/Popover/Popover.tsx +29 -0
  322. package/src/components/ProgressBar/ProgressBar.tsx +14 -0
  323. package/src/components/RadioButton/RadioButton.tsx +34 -3
  324. package/src/components/RadioButtonGroup/RadioButtonGroup.tsx +32 -0
  325. package/src/components/SearchInput/SearchInput.tsx +13 -2
  326. package/src/components/Select/Select.tsx +4 -5
  327. package/src/components/Select/SelectDropdown.tsx +13 -9
  328. package/src/components/Select/SelectTrigger.tsx +7 -7
  329. package/src/components/Separator/Separator.tsx +10 -0
  330. package/src/components/Sheet/Sheet.tsx +8 -2
  331. package/src/components/Sheet/components/SheetFooter.tsx +1 -1
  332. package/src/components/Sheet/components/SheetHeader.tsx +2 -2
  333. package/src/components/Sparkline/Sparkline.tsx +11 -0
  334. package/src/components/Spinner/Spinner.tsx +28 -3
  335. package/src/components/Switch/Switch.tsx +27 -4
  336. package/src/components/Tabs/Tabs.tsx +6 -0
  337. package/src/components/Tabs/components/TabsTrigger.tsx +22 -5
  338. package/src/components/TagChip/TagChip.tsx +18 -16
  339. package/src/components/TagInput/TagInput.tsx +11 -8
  340. package/src/components/Text/Text.tsx +9 -0
  341. package/src/components/TextInline/TextInline.tsx +11 -0
  342. package/src/components/Textarea/Textarea.tsx +13 -1
  343. package/src/components/TimePicker/TimeColumn.tsx +24 -1
  344. package/src/components/TimePicker/TimePicker.tsx +127 -39
  345. package/src/components/TimePicker/TimeSegments.tsx +131 -0
  346. package/src/components/TimePicker/timepicker.hooks.ts +1 -24
  347. package/src/components/TimePicker/timepicker.types.ts +0 -3
  348. package/src/components/Toast/Toast.tsx +28 -1
  349. package/src/components/Toggle/Toggle.tsx +34 -32
  350. package/src/components/Toggle/index.ts +1 -1
  351. package/src/components/ToggleGroup/ToggleGroup.tsx +17 -0
  352. package/src/components/ToggleGroup/ToggleGroupItem.tsx +13 -8
  353. package/src/components/ToggleGroup/ToggleGroupMultiple.tsx +3 -1
  354. package/src/components/ToggleGroup/ToggleGroupSingle.tsx +3 -1
  355. package/src/components/ToggleGroup/toggleGroup.types.ts +12 -3
  356. package/src/components/Tooltip/Tooltip.tsx +6 -0
  357. package/src/date-time/index.ts +0 -1
  358. package/src/internal/PickerField.tsx +90 -0
  359. package/src/internal/SegmentedField.tsx +445 -0
  360. package/src/internal/index.ts +2 -0
  361. package/src/lib/contexts/OverlayContext/OverlayContext.tsx +21 -10
  362. package/src/theme/index.ts +0 -6
  363. package/src/theme/recipes/badge.css +140 -0
  364. package/src/theme/recipes/button.css +167 -0
  365. package/src/theme/recipes/card.css +31 -0
  366. package/src/theme/recipes/checkbox.css +44 -0
  367. package/src/theme/recipes/field.css +14 -0
  368. package/src/theme/recipes/index.css +28 -0
  369. package/src/theme/recipes/input.css +29 -0
  370. package/src/theme/recipes/message.css +47 -0
  371. package/src/theme/recipes/modal.css +31 -0
  372. package/src/theme/recipes/radio-button.css +42 -0
  373. package/src/theme/recipes/search-input.css +16 -0
  374. package/src/theme/recipes/select.css +105 -0
  375. package/src/theme/recipes/sheet.css +34 -0
  376. package/src/theme/recipes/spinner.css +17 -0
  377. package/src/theme/recipes/switch.css +39 -0
  378. package/src/theme/recipes/tabs.css +41 -0
  379. package/src/theme/recipes/tag-chip.css +27 -0
  380. package/src/theme/recipes/textarea.css +20 -0
  381. package/src/theme/recipes/toggle.css +92 -0
  382. package/src/theme/schema.ts +0 -27
  383. package/src/theme/tokens.css +26 -9
  384. package/dist/components/Avatar/Avatar.d.ts +0 -6
  385. package/dist/components/Avatar/Avatar.d.ts.map +0 -1
  386. package/dist/components/Avatar/Avatar.js +0 -11
  387. package/dist/components/Avatar/Avatar.js.map +0 -1
  388. package/dist/components/Avatar/index.d.ts +0 -2
  389. package/dist/components/Avatar/index.d.ts.map +0 -1
  390. package/dist/components/Avatar/index.js +0 -2
  391. package/dist/components/Avatar/index.js.map +0 -1
  392. package/dist/components/Breadcrumb/Breadcrumb.d.ts +0 -12
  393. package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +0 -1
  394. package/dist/components/Breadcrumb/Breadcrumb.js +0 -19
  395. package/dist/components/Breadcrumb/Breadcrumb.js.map +0 -1
  396. package/dist/components/Breadcrumb/index.d.ts +0 -2
  397. package/dist/components/Breadcrumb/index.d.ts.map +0 -1
  398. package/dist/components/Breadcrumb/index.js +0 -2
  399. package/dist/components/Breadcrumb/index.js.map +0 -1
  400. package/dist/components/ColorDot/ColorDot.d.ts +0 -19
  401. package/dist/components/ColorDot/ColorDot.d.ts.map +0 -1
  402. package/dist/components/ColorDot/ColorDot.js +0 -36
  403. package/dist/components/ColorDot/ColorDot.js.map +0 -1
  404. package/dist/components/ColorDot/index.d.ts +0 -2
  405. package/dist/components/ColorDot/index.d.ts.map +0 -1
  406. package/dist/components/ColorDot/index.js +0 -2
  407. package/dist/components/ColorDot/index.js.map +0 -1
  408. package/dist/components/EmptyState/EmptyState.d.ts +0 -26
  409. package/dist/components/EmptyState/EmptyState.d.ts.map +0 -1
  410. package/dist/components/EmptyState/EmptyState.js +0 -9
  411. package/dist/components/EmptyState/EmptyState.js.map +0 -1
  412. package/dist/components/EmptyState/index.d.ts +0 -2
  413. package/dist/components/EmptyState/index.d.ts.map +0 -1
  414. package/dist/components/EmptyState/index.js +0 -2
  415. package/dist/components/EmptyState/index.js.map +0 -1
  416. package/dist/components/HeatMap/HeatMapCalendar.d.ts +0 -11
  417. package/dist/components/HeatMap/HeatMapCalendar.d.ts.map +0 -1
  418. package/dist/components/HeatMap/HeatMapCalendar.js +0 -68
  419. package/dist/components/HeatMap/HeatMapCalendar.js.map +0 -1
  420. package/dist/components/HeatMap/HeatMapMatrix.d.ts +0 -12
  421. package/dist/components/HeatMap/HeatMapMatrix.d.ts.map +0 -1
  422. package/dist/components/HeatMap/HeatMapMatrix.js +0 -35
  423. package/dist/components/HeatMap/HeatMapMatrix.js.map +0 -1
  424. package/dist/components/HeatMap/heat-map.utils.d.ts +0 -10
  425. package/dist/components/HeatMap/heat-map.utils.d.ts.map +0 -1
  426. package/dist/components/HeatMap/heat-map.utils.js +0 -10
  427. package/dist/components/HeatMap/heat-map.utils.js.map +0 -1
  428. package/dist/components/HeatMap/index.d.ts +0 -4
  429. package/dist/components/HeatMap/index.d.ts.map +0 -1
  430. package/dist/components/HeatMap/index.js +0 -3
  431. package/dist/components/HeatMap/index.js.map +0 -1
  432. package/dist/components/MetricList/MetricList.d.ts +0 -9
  433. package/dist/components/MetricList/MetricList.d.ts.map +0 -1
  434. package/dist/components/MetricList/MetricList.js +0 -8
  435. package/dist/components/MetricList/MetricList.js.map +0 -1
  436. package/dist/components/MetricList/MetricRow.d.ts +0 -13
  437. package/dist/components/MetricList/MetricRow.d.ts.map +0 -1
  438. package/dist/components/MetricList/MetricRow.js +0 -13
  439. package/dist/components/MetricList/MetricRow.js.map +0 -1
  440. package/dist/components/MetricList/index.d.ts +0 -3
  441. package/dist/components/MetricList/index.d.ts.map +0 -1
  442. package/dist/components/MetricList/index.js +0 -3
  443. package/dist/components/MetricList/index.js.map +0 -1
  444. package/dist/components/NavBottom/NavBottom.d.ts +0 -16
  445. package/dist/components/NavBottom/NavBottom.d.ts.map +0 -1
  446. package/dist/components/NavBottom/NavBottom.js +0 -21
  447. package/dist/components/NavBottom/NavBottom.js.map +0 -1
  448. package/dist/components/NavBottom/index.d.ts +0 -3
  449. package/dist/components/NavBottom/index.d.ts.map +0 -1
  450. package/dist/components/NavBottom/index.js +0 -2
  451. package/dist/components/NavBottom/index.js.map +0 -1
  452. package/dist/components/NavSide/NavItem.d.ts +0 -9
  453. package/dist/components/NavSide/NavItem.d.ts.map +0 -1
  454. package/dist/components/NavSide/NavItem.js +0 -13
  455. package/dist/components/NavSide/NavItem.js.map +0 -1
  456. package/dist/components/NavSide/NavSide.d.ts +0 -16
  457. package/dist/components/NavSide/NavSide.d.ts.map +0 -1
  458. package/dist/components/NavSide/NavSide.js +0 -12
  459. package/dist/components/NavSide/NavSide.js.map +0 -1
  460. package/dist/components/NavSide/index.d.ts +0 -3
  461. package/dist/components/NavSide/index.d.ts.map +0 -1
  462. package/dist/components/NavSide/index.js +0 -2
  463. package/dist/components/NavSide/index.js.map +0 -1
  464. package/dist/components/NavSide/types.d.ts +0 -38
  465. package/dist/components/NavSide/types.d.ts.map +0 -1
  466. package/dist/components/NavSide/types.js +0 -2
  467. package/dist/components/NavSide/types.js.map +0 -1
  468. package/dist/components/Pagination/Pagination.d.ts +0 -35
  469. package/dist/components/Pagination/Pagination.d.ts.map +0 -1
  470. package/dist/components/Pagination/Pagination.js +0 -26
  471. package/dist/components/Pagination/Pagination.js.map +0 -1
  472. package/dist/components/Pagination/index.d.ts +0 -3
  473. package/dist/components/Pagination/index.d.ts.map +0 -1
  474. package/dist/components/Pagination/index.js +0 -2
  475. package/dist/components/Pagination/index.js.map +0 -1
  476. package/dist/components/Skeleton/Skeleton.d.ts +0 -4
  477. package/dist/components/Skeleton/Skeleton.d.ts.map +0 -1
  478. package/dist/components/Skeleton/Skeleton.js +0 -9
  479. package/dist/components/Skeleton/Skeleton.js.map +0 -1
  480. package/dist/components/Skeleton/index.d.ts +0 -2
  481. package/dist/components/Skeleton/index.d.ts.map +0 -1
  482. package/dist/components/Skeleton/index.js +0 -2
  483. package/dist/components/Skeleton/index.js.map +0 -1
  484. package/dist/components/StatsCard/StatsCard.d.ts +0 -17
  485. package/dist/components/StatsCard/StatsCard.d.ts.map +0 -1
  486. package/dist/components/StatsCard/StatsCard.js +0 -15
  487. package/dist/components/StatsCard/StatsCard.js.map +0 -1
  488. package/dist/components/StatsCard/index.d.ts +0 -2
  489. package/dist/components/StatsCard/index.d.ts.map +0 -1
  490. package/dist/components/StatsCard/index.js +0 -2
  491. package/dist/components/StatsCard/index.js.map +0 -1
  492. package/src/components/Avatar/Avatar.tsx +0 -19
  493. package/src/components/Avatar/index.ts +0 -1
  494. package/src/components/Breadcrumb/Breadcrumb.tsx +0 -47
  495. package/src/components/Breadcrumb/index.ts +0 -5
  496. package/src/components/ColorDot/ColorDot.tsx +0 -52
  497. package/src/components/ColorDot/index.ts +0 -1
  498. package/src/components/EmptyState/EmptyState.tsx +0 -30
  499. package/src/components/EmptyState/index.ts +0 -1
  500. package/src/components/HeatMap/HeatMapCalendar.tsx +0 -127
  501. package/src/components/HeatMap/HeatMapMatrix.tsx +0 -75
  502. package/src/components/HeatMap/heat-map.utils.ts +0 -15
  503. package/src/components/HeatMap/index.ts +0 -3
  504. package/src/components/MetricList/MetricList.tsx +0 -18
  505. package/src/components/MetricList/MetricRow.tsx +0 -30
  506. package/src/components/MetricList/index.ts +0 -2
  507. package/src/components/NavBottom/NavBottom.tsx +0 -55
  508. package/src/components/NavBottom/index.ts +0 -3
  509. package/src/components/NavSide/NavItem.tsx +0 -39
  510. package/src/components/NavSide/NavSide.tsx +0 -42
  511. package/src/components/NavSide/index.ts +0 -2
  512. package/src/components/NavSide/types.ts +0 -36
  513. package/src/components/Pagination/Pagination.tsx +0 -86
  514. package/src/components/Pagination/index.ts +0 -2
  515. package/src/components/Skeleton/Skeleton.tsx +0 -9
  516. package/src/components/Skeleton/index.ts +0 -1
  517. package/src/components/StatsCard/StatsCard.tsx +0 -41
  518. package/src/components/StatsCard/index.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixthshift/design-system",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Personal design system - tokens, theme, and component library",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -103,10 +103,6 @@
103
103
  "types": "./dist/components/Badge/index.d.ts",
104
104
  "import": "./dist/components/Badge/index.js"
105
105
  },
106
- "./color-dot": {
107
- "types": "./dist/components/ColorDot/index.d.ts",
108
- "import": "./dist/components/ColorDot/index.js"
109
- },
110
106
  "./tag-chip": {
111
107
  "types": "./dist/components/TagChip/index.d.ts",
112
108
  "import": "./dist/components/TagChip/index.js"
@@ -119,42 +115,18 @@
119
115
  "types": "./dist/components/Field/index.d.ts",
120
116
  "import": "./dist/components/Field/index.js"
121
117
  },
122
- "./breadcrumb": {
123
- "types": "./dist/components/Breadcrumb/index.d.ts",
124
- "import": "./dist/components/Breadcrumb/index.js"
125
- },
126
118
  "./card": {
127
119
  "types": "./dist/components/Card/index.d.ts",
128
120
  "import": "./dist/components/Card/index.js"
129
121
  },
130
- "./avatar": {
131
- "types": "./dist/components/Avatar/index.d.ts",
132
- "import": "./dist/components/Avatar/index.js"
133
- },
134
122
  "./separator": {
135
123
  "types": "./dist/components/Separator/index.d.ts",
136
124
  "import": "./dist/components/Separator/index.js"
137
125
  },
138
- "./skeleton": {
139
- "types": "./dist/components/Skeleton/index.d.ts",
140
- "import": "./dist/components/Skeleton/index.js"
141
- },
142
126
  "./spinner": {
143
127
  "types": "./dist/components/Spinner/index.d.ts",
144
128
  "import": "./dist/components/Spinner/index.js"
145
129
  },
146
- "./stats-card": {
147
- "types": "./dist/components/StatsCard/index.d.ts",
148
- "import": "./dist/components/StatsCard/index.js"
149
- },
150
- "./metric-list": {
151
- "types": "./dist/components/MetricList/index.d.ts",
152
- "import": "./dist/components/MetricList/index.js"
153
- },
154
- "./empty-state": {
155
- "types": "./dist/components/EmptyState/index.d.ts",
156
- "import": "./dist/components/EmptyState/index.js"
157
- },
158
130
  "./text": {
159
131
  "types": "./dist/components/Text/index.d.ts",
160
132
  "import": "./dist/components/Text/index.js"
@@ -231,10 +203,6 @@
231
203
  "types": "./dist/components/SearchInput/index.d.ts",
232
204
  "import": "./dist/components/SearchInput/index.js"
233
205
  },
234
- "./pagination": {
235
- "types": "./dist/components/Pagination/index.d.ts",
236
- "import": "./dist/components/Pagination/index.js"
237
- },
238
206
  "./code-editor": {
239
207
  "types": "./dist/components/Code/Editor/index.d.ts",
240
208
  "import": "./dist/components/Code/Editor/index.js"
@@ -243,14 +211,6 @@
243
211
  "types": "./dist/components/Code/Workspace/index.d.ts",
244
212
  "import": "./dist/components/Code/Workspace/index.js"
245
213
  },
246
- "./nav-side": {
247
- "types": "./dist/components/NavSide/index.d.ts",
248
- "import": "./dist/components/NavSide/index.js"
249
- },
250
- "./nav-bottom": {
251
- "types": "./dist/components/NavBottom/index.d.ts",
252
- "import": "./dist/components/NavBottom/index.js"
253
- },
254
214
  "./heading": {
255
215
  "types": "./dist/typography/Heading.d.ts",
256
216
  "import": "./dist/typography/Heading.js"
@@ -354,10 +314,6 @@
354
314
  "./bar-chart": {
355
315
  "types": "./dist/components/BarChart/index.d.ts",
356
316
  "import": "./dist/components/BarChart/index.js"
357
- },
358
- "./heat-map": {
359
- "types": "./dist/components/HeatMap/index.d.ts",
360
- "import": "./dist/components/HeatMap/index.js"
361
317
  }
362
318
  },
363
319
  "scripts": {
@@ -366,9 +322,10 @@
366
322
  "build:js": "tsc -p tsconfig.build.json && bun run scripts/fix-extensions.ts",
367
323
  "dev": "storybook dev -p 6006 --no-open",
368
324
  "build:storybook": "storybook build",
369
- "test": "vitest run --project unit --project date-time --reporter=dot",
370
- "test:verbose": "vitest run --project unit --project date-time",
371
- "test:watch": "vitest --project unit --project date-time",
325
+ "test": "vitest run --project unit --project date-time --project ssr --reporter=dot",
326
+ "test:verbose": "vitest run --project unit --project date-time --project ssr",
327
+ "test:watch": "vitest --project unit --project date-time --project ssr",
328
+ "test:ssr": "vitest run --project ssr",
372
329
  "test:visual": "vitest run --project visual",
373
330
  "test:visual:update": "vitest run --project visual --update",
374
331
  "test:stories": "vitest run --project storybook --project storybook-dark",
@@ -381,6 +338,8 @@
381
338
  "format:check": "biome format .",
382
339
  "check": "biome check .",
383
340
  "check:fix": "biome check --write .",
341
+ "check:recipes": "bun run scripts/check-recipes.ts",
342
+ "check:contrast": "bun run scripts/check-contrast.ts",
384
343
  "clean": "rm -rf dist node_modules *.tsbuildinfo",
385
344
  "clean:dist": "rm -rf dist"
386
345
  },
@@ -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
  )}