@sixthshift/design-system 0.4.0 → 0.6.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 (417) hide show
  1. package/README.md +134 -87
  2. package/dist/components/Badge/Badge.d.ts +2 -2
  3. package/dist/components/Badge/Badge.js +2 -2
  4. package/dist/components/Button/Button.d.ts +1 -1
  5. package/dist/components/Button/Button.js +1 -1
  6. package/dist/components/Calendar/Calendar.d.ts.map +1 -1
  7. package/dist/components/Calendar/Calendar.js +1 -0
  8. package/dist/components/Calendar/Calendar.js.map +1 -1
  9. package/dist/components/Calendar/CalendarView.d.ts +0 -11
  10. package/dist/components/Calendar/CalendarView.d.ts.map +1 -1
  11. package/dist/components/Calendar/CalendarView.js +1 -0
  12. package/dist/components/Calendar/CalendarView.js.map +1 -1
  13. package/dist/components/Calendar/calendar.hooks.d.ts.map +1 -1
  14. package/dist/components/Calendar/calendar.hooks.js +1 -0
  15. package/dist/components/Calendar/calendar.hooks.js.map +1 -1
  16. package/dist/components/Card/Card.d.ts +50 -4
  17. package/dist/components/Card/Card.d.ts.map +1 -1
  18. package/dist/components/Card/Card.js +89 -5
  19. package/dist/components/Card/Card.js.map +1 -1
  20. package/dist/components/Card/index.d.ts +1 -1
  21. package/dist/components/Card/index.d.ts.map +1 -1
  22. package/dist/components/Card/index.js +1 -1
  23. package/dist/components/Card/index.js.map +1 -1
  24. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  25. package/dist/components/Checkbox/Checkbox.js +1 -0
  26. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  27. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
  28. package/dist/components/CheckboxGroup/CheckboxGroup.js +1 -0
  29. package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
  30. package/dist/components/Code/Editor/Editor.d.ts.map +1 -1
  31. package/dist/components/Code/Editor/Editor.js +1 -0
  32. package/dist/components/Code/Editor/Editor.js.map +1 -1
  33. package/dist/components/Code/Workspace/StatusBar.d.ts.map +1 -1
  34. package/dist/components/Code/Workspace/StatusBar.js +1 -0
  35. package/dist/components/Code/Workspace/StatusBar.js.map +1 -1
  36. package/dist/components/Code/Workspace/Toolbar.d.ts.map +1 -1
  37. package/dist/components/Code/Workspace/Toolbar.js +1 -0
  38. package/dist/components/Code/Workspace/Toolbar.js.map +1 -1
  39. package/dist/components/Code/Workspace/Workspace.d.ts.map +1 -1
  40. package/dist/components/Code/Workspace/Workspace.js +1 -0
  41. package/dist/components/Code/Workspace/Workspace.js.map +1 -1
  42. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  43. package/dist/components/DatePicker/DatePicker.js +5 -0
  44. package/dist/components/DatePicker/DatePicker.js.map +1 -1
  45. package/dist/components/DatePicker/DateSegments.d.ts.map +1 -1
  46. package/dist/components/DatePicker/DateSegments.js +1 -0
  47. package/dist/components/DatePicker/DateSegments.js.map +1 -1
  48. package/dist/components/DatePicker/datepicker.hooks.d.ts.map +1 -1
  49. package/dist/components/DatePicker/datepicker.hooks.js +1 -0
  50. package/dist/components/DatePicker/datepicker.hooks.js.map +1 -1
  51. package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  52. package/dist/components/DateRangePicker/DateRangePicker.js +1 -0
  53. package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
  54. package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  55. package/dist/components/DateTimePicker/DateTimePicker.js +5 -0
  56. package/dist/components/DateTimePicker/DateTimePicker.js.map +1 -1
  57. package/dist/components/DateTimePicker/DateTimeSegments.d.ts.map +1 -1
  58. package/dist/components/DateTimePicker/DateTimeSegments.js +1 -0
  59. package/dist/components/DateTimePicker/DateTimeSegments.js.map +1 -1
  60. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
  61. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js +5 -0
  62. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
  63. package/dist/components/FormField/FormField.d.ts +31 -10
  64. package/dist/components/FormField/FormField.d.ts.map +1 -1
  65. package/dist/components/FormField/FormField.js +46 -17
  66. package/dist/components/FormField/FormField.js.map +1 -1
  67. package/dist/components/FormField/index.d.ts +2 -2
  68. package/dist/components/FormField/index.d.ts.map +1 -1
  69. package/dist/components/FormField/index.js +1 -1
  70. package/dist/components/FormField/index.js.map +1 -1
  71. package/dist/components/HoverCard/HoverCard.d.ts.map +1 -1
  72. package/dist/components/HoverCard/HoverCard.js +1 -0
  73. package/dist/components/HoverCard/HoverCard.js.map +1 -1
  74. package/dist/components/HoverCard/components/HoverCardContent.d.ts.map +1 -1
  75. package/dist/components/HoverCard/components/HoverCardContent.js +1 -0
  76. package/dist/components/HoverCard/components/HoverCardContent.js.map +1 -1
  77. package/dist/components/HoverCard/components/HoverCardContext.d.ts.map +1 -1
  78. package/dist/components/HoverCard/components/HoverCardContext.js +1 -0
  79. package/dist/components/HoverCard/components/HoverCardContext.js.map +1 -1
  80. package/dist/components/HoverCard/components/HoverCardTrigger.d.ts.map +1 -1
  81. package/dist/components/HoverCard/components/HoverCardTrigger.js +1 -0
  82. package/dist/components/HoverCard/components/HoverCardTrigger.js.map +1 -1
  83. package/dist/components/Message/Message.d.ts +1 -1
  84. package/dist/components/Message/Message.js +1 -1
  85. package/dist/components/Modal/Modal.d.ts +14 -9
  86. package/dist/components/Modal/Modal.d.ts.map +1 -1
  87. package/dist/components/Modal/Modal.js +42 -20
  88. package/dist/components/Modal/Modal.js.map +1 -1
  89. package/dist/components/Modal/components/ModalContext.d.ts.map +1 -1
  90. package/dist/components/Modal/components/ModalContext.js +1 -0
  91. package/dist/components/Modal/components/ModalContext.js.map +1 -1
  92. package/dist/components/Modal/components/ModalHeader.d.ts.map +1 -1
  93. package/dist/components/Modal/components/ModalHeader.js +1 -0
  94. package/dist/components/Modal/components/ModalHeader.js.map +1 -1
  95. package/dist/components/Popover/Popover.d.ts.map +1 -1
  96. package/dist/components/Popover/Popover.js +5 -0
  97. package/dist/components/Popover/Popover.js.map +1 -1
  98. package/dist/components/Popover/components/PopoverBody.d.ts.map +1 -1
  99. package/dist/components/Popover/components/PopoverBody.js +1 -0
  100. package/dist/components/Popover/components/PopoverBody.js.map +1 -1
  101. package/dist/components/Popover/components/PopoverClose.d.ts.map +1 -1
  102. package/dist/components/Popover/components/PopoverClose.js +1 -0
  103. package/dist/components/Popover/components/PopoverClose.js.map +1 -1
  104. package/dist/components/Popover/components/PopoverContext.d.ts.map +1 -1
  105. package/dist/components/Popover/components/PopoverContext.js +1 -0
  106. package/dist/components/Popover/components/PopoverContext.js.map +1 -1
  107. package/dist/components/Popover/components/PopoverTrigger.d.ts.map +1 -1
  108. package/dist/components/Popover/components/PopoverTrigger.js +1 -0
  109. package/dist/components/Popover/components/PopoverTrigger.js.map +1 -1
  110. package/dist/components/RadioButton/RadioButton.d.ts.map +1 -1
  111. package/dist/components/RadioButton/RadioButton.js +1 -0
  112. package/dist/components/RadioButton/RadioButton.js.map +1 -1
  113. package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts.map +1 -1
  114. package/dist/components/RadioButtonGroup/RadioButtonGroup.js +1 -0
  115. package/dist/components/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
  116. package/dist/components/SearchInput/SearchInput.d.ts +10 -7
  117. package/dist/components/SearchInput/SearchInput.d.ts.map +1 -1
  118. package/dist/components/SearchInput/SearchInput.js +11 -6
  119. package/dist/components/SearchInput/SearchInput.js.map +1 -1
  120. package/dist/components/Select/Select.d.ts +6 -0
  121. package/dist/components/Select/Select.d.ts.map +1 -1
  122. package/dist/components/Select/Select.js +9 -3
  123. package/dist/components/Select/Select.js.map +1 -1
  124. package/dist/components/Select/SelectDropdown.d.ts.map +1 -1
  125. package/dist/components/Select/SelectDropdown.js +1 -0
  126. package/dist/components/Select/SelectDropdown.js.map +1 -1
  127. package/dist/components/Select/SelectTrigger.d.ts.map +1 -1
  128. package/dist/components/Select/SelectTrigger.js +5 -1
  129. package/dist/components/Select/SelectTrigger.js.map +1 -1
  130. package/dist/components/Select/useSelectKeyboard.d.ts.map +1 -1
  131. package/dist/components/Select/useSelectKeyboard.js +1 -0
  132. package/dist/components/Select/useSelectKeyboard.js.map +1 -1
  133. package/dist/components/Sheet/Sheet.d.ts.map +1 -1
  134. package/dist/components/Sheet/Sheet.js +23 -9
  135. package/dist/components/Sheet/Sheet.js.map +1 -1
  136. package/dist/components/Sheet/components/SheetContext.d.ts.map +1 -1
  137. package/dist/components/Sheet/components/SheetContext.js +1 -0
  138. package/dist/components/Sheet/components/SheetContext.js.map +1 -1
  139. package/dist/components/Sheet/components/SheetHeader.d.ts.map +1 -1
  140. package/dist/components/Sheet/components/SheetHeader.js +1 -0
  141. package/dist/components/Sheet/components/SheetHeader.js.map +1 -1
  142. package/dist/components/Spinner/Spinner.d.ts +2 -2
  143. package/dist/components/Spinner/Spinner.js +2 -2
  144. package/dist/components/Switch/Switch.d.ts.map +1 -1
  145. package/dist/components/Switch/Switch.js +1 -0
  146. package/dist/components/Switch/Switch.js.map +1 -1
  147. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  148. package/dist/components/Tabs/Tabs.js +1 -0
  149. package/dist/components/Tabs/Tabs.js.map +1 -1
  150. package/dist/components/Tabs/components/TabsContext.d.ts.map +1 -1
  151. package/dist/components/Tabs/components/TabsContext.js +1 -0
  152. package/dist/components/Tabs/components/TabsContext.js.map +1 -1
  153. package/dist/components/Tabs/components/TabsList.d.ts.map +1 -1
  154. package/dist/components/Tabs/components/TabsList.js +1 -0
  155. package/dist/components/Tabs/components/TabsList.js.map +1 -1
  156. package/dist/components/Tabs/components/TabsPanels.d.ts.map +1 -1
  157. package/dist/components/Tabs/components/TabsPanels.js +1 -0
  158. package/dist/components/Tabs/components/TabsPanels.js.map +1 -1
  159. package/dist/components/Tabs/components/TabsTrigger.d.ts.map +1 -1
  160. package/dist/components/Tabs/components/TabsTrigger.js +2 -1
  161. package/dist/components/Tabs/components/TabsTrigger.js.map +1 -1
  162. package/dist/components/TagChip/TagChip.d.ts.map +1 -1
  163. package/dist/components/TagChip/TagChip.js +1 -0
  164. package/dist/components/TagChip/TagChip.js.map +1 -1
  165. package/dist/components/TagInput/TagInput.d.ts +8 -2
  166. package/dist/components/TagInput/TagInput.d.ts.map +1 -1
  167. package/dist/components/TagInput/TagInput.js +8 -5
  168. package/dist/components/TagInput/TagInput.js.map +1 -1
  169. package/dist/components/Textarea/Textarea.d.ts +21 -5
  170. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  171. package/dist/components/Textarea/Textarea.js +31 -5
  172. package/dist/components/Textarea/Textarea.js.map +1 -1
  173. package/dist/components/TimePicker/PeriodSelector.d.ts.map +1 -1
  174. package/dist/components/TimePicker/PeriodSelector.js +1 -0
  175. package/dist/components/TimePicker/PeriodSelector.js.map +1 -1
  176. package/dist/components/TimePicker/TimeColumn.d.ts.map +1 -1
  177. package/dist/components/TimePicker/TimeColumn.js +1 -0
  178. package/dist/components/TimePicker/TimeColumn.js.map +1 -1
  179. package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
  180. package/dist/components/TimePicker/TimePicker.js +5 -0
  181. package/dist/components/TimePicker/TimePicker.js.map +1 -1
  182. package/dist/components/TimePicker/TimeSegments.d.ts.map +1 -1
  183. package/dist/components/TimePicker/TimeSegments.js +1 -0
  184. package/dist/components/TimePicker/TimeSegments.js.map +1 -1
  185. package/dist/components/Toast/Toast.d.ts +16 -2
  186. package/dist/components/Toast/Toast.d.ts.map +1 -1
  187. package/dist/components/Toast/Toast.js +16 -6
  188. package/dist/components/Toast/Toast.js.map +1 -1
  189. package/dist/components/Toggle/Toggle.d.ts +1 -1
  190. package/dist/components/Toggle/Toggle.d.ts.map +1 -1
  191. package/dist/components/Toggle/Toggle.js +2 -1
  192. package/dist/components/Toggle/Toggle.js.map +1 -1
  193. package/dist/components/ToggleGroup/ToggleGroupMultiple.d.ts +2 -0
  194. package/dist/components/ToggleGroup/ToggleGroupMultiple.d.ts.map +1 -1
  195. package/dist/components/ToggleGroup/ToggleGroupMultiple.js +4 -3
  196. package/dist/components/ToggleGroup/ToggleGroupMultiple.js.map +1 -1
  197. package/dist/components/ToggleGroup/ToggleGroupSingle.d.ts +2 -0
  198. package/dist/components/ToggleGroup/ToggleGroupSingle.d.ts.map +1 -1
  199. package/dist/components/ToggleGroup/ToggleGroupSingle.js +4 -3
  200. package/dist/components/ToggleGroup/ToggleGroupSingle.js.map +1 -1
  201. package/dist/components/ToggleGroup/toggleGroup.types.d.ts +7 -0
  202. package/dist/components/ToggleGroup/toggleGroup.types.d.ts.map +1 -1
  203. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  204. package/dist/components/Tooltip/Tooltip.js +1 -0
  205. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  206. package/dist/components/Tooltip/components/TooltipBody.d.ts.map +1 -1
  207. package/dist/components/Tooltip/components/TooltipBody.js +1 -0
  208. package/dist/components/Tooltip/components/TooltipBody.js.map +1 -1
  209. package/dist/components/Tooltip/components/TooltipContext.d.ts.map +1 -1
  210. package/dist/components/Tooltip/components/TooltipContext.js +1 -0
  211. package/dist/components/Tooltip/components/TooltipContext.js.map +1 -1
  212. package/dist/components/Tooltip/components/TooltipTrigger.d.ts.map +1 -1
  213. package/dist/components/Tooltip/components/TooltipTrigger.js +1 -0
  214. package/dist/components/Tooltip/components/TooltipTrigger.js.map +1 -1
  215. package/dist/hooks/useCollapsible.d.ts.map +1 -1
  216. package/dist/hooks/useCollapsible.js +1 -0
  217. package/dist/hooks/useCollapsible.js.map +1 -1
  218. package/dist/hooks/useControllableState.d.ts.map +1 -1
  219. package/dist/hooks/useControllableState.js +1 -0
  220. package/dist/hooks/useControllableState.js.map +1 -1
  221. package/dist/hooks/useDebouncedCallback.d.ts.map +1 -1
  222. package/dist/hooks/useDebouncedCallback.js +1 -0
  223. package/dist/hooks/useDebouncedCallback.js.map +1 -1
  224. package/dist/hooks/useDebouncedState.d.ts.map +1 -1
  225. package/dist/hooks/useDebouncedState.js +1 -0
  226. package/dist/hooks/useDebouncedState.js.map +1 -1
  227. package/dist/hooks/useDeviceFormFactor.d.ts.map +1 -1
  228. package/dist/hooks/useDeviceFormFactor.js +1 -0
  229. package/dist/hooks/useDeviceFormFactor.js.map +1 -1
  230. package/dist/hooks/useLocalStorage.d.ts.map +1 -1
  231. package/dist/hooks/useLocalStorage.js +1 -0
  232. package/dist/hooks/useLocalStorage.js.map +1 -1
  233. package/dist/hooks/useMergedFloatingRef.d.ts.map +1 -1
  234. package/dist/hooks/useMergedFloatingRef.js +1 -0
  235. package/dist/hooks/useMergedFloatingRef.js.map +1 -1
  236. package/dist/hooks/usePresence.d.ts.map +1 -1
  237. package/dist/hooks/usePresence.js +1 -0
  238. package/dist/hooks/usePresence.js.map +1 -1
  239. package/dist/hooks/useStack.d.ts.map +1 -1
  240. package/dist/hooks/useStack.js +34 -10
  241. package/dist/hooks/useStack.js.map +1 -1
  242. package/dist/hooks/useTheme.d.ts.map +1 -1
  243. package/dist/hooks/useTheme.js +1 -0
  244. package/dist/hooks/useTheme.js.map +1 -1
  245. package/dist/internal/PickerField.d.ts.map +1 -1
  246. package/dist/internal/PickerField.js +1 -0
  247. package/dist/internal/PickerField.js.map +1 -1
  248. package/dist/internal/SegmentedField.d.ts.map +1 -1
  249. package/dist/internal/SegmentedField.js +1 -0
  250. package/dist/internal/SegmentedField.js.map +1 -1
  251. package/dist/internal/escapeLayers.d.ts +12 -0
  252. package/dist/internal/escapeLayers.d.ts.map +1 -0
  253. package/dist/internal/escapeLayers.js +48 -0
  254. package/dist/internal/escapeLayers.js.map +1 -0
  255. package/dist/lib/ErrorBoundary.d.ts.map +1 -1
  256. package/dist/lib/ErrorBoundary.js +1 -0
  257. package/dist/lib/ErrorBoundary.js.map +1 -1
  258. package/dist/lib/contexts/ComponentsContext/ComponentsContext.d.ts.map +1 -1
  259. package/dist/lib/contexts/ComponentsContext/ComponentsContext.js +1 -0
  260. package/dist/lib/contexts/ComponentsContext/ComponentsContext.js.map +1 -1
  261. package/dist/lib/contexts/OverlayContext/OverlayContext.d.ts +9 -4
  262. package/dist/lib/contexts/OverlayContext/OverlayContext.d.ts.map +1 -1
  263. package/dist/lib/contexts/OverlayContext/OverlayContext.js +34 -10
  264. package/dist/lib/contexts/OverlayContext/OverlayContext.js.map +1 -1
  265. package/dist/lib/contexts/OverlayContext/ToastStack.d.ts +20 -0
  266. package/dist/lib/contexts/OverlayContext/ToastStack.d.ts.map +1 -0
  267. package/dist/lib/contexts/OverlayContext/ToastStack.js +45 -0
  268. package/dist/lib/contexts/OverlayContext/ToastStack.js.map +1 -0
  269. package/dist/lib/contexts/OverlayContext/hooks/useModal.d.ts.map +1 -1
  270. package/dist/lib/contexts/OverlayContext/hooks/useModal.js +1 -0
  271. package/dist/lib/contexts/OverlayContext/hooks/useModal.js.map +1 -1
  272. package/dist/lib/contexts/OverlayContext/hooks/useToast.d.ts +27 -10
  273. package/dist/lib/contexts/OverlayContext/hooks/useToast.d.ts.map +1 -1
  274. package/dist/lib/contexts/OverlayContext/hooks/useToast.js +31 -49
  275. package/dist/lib/contexts/OverlayContext/hooks/useToast.js.map +1 -1
  276. package/dist/lib/contexts/OverlayContext/index.d.ts +2 -0
  277. package/dist/lib/contexts/OverlayContext/index.d.ts.map +1 -1
  278. package/dist/lib/contexts/OverlayContext/index.js +2 -0
  279. package/dist/lib/contexts/OverlayContext/index.js.map +1 -1
  280. package/dist/lib/contexts/OverlayContext/toastStore.d.ts +68 -0
  281. package/dist/lib/contexts/OverlayContext/toastStore.d.ts.map +1 -0
  282. package/dist/lib/contexts/OverlayContext/toastStore.js +69 -0
  283. package/dist/lib/contexts/OverlayContext/toastStore.js.map +1 -0
  284. package/dist/lib/withErrorBoundary.d.ts.map +1 -1
  285. package/dist/lib/withErrorBoundary.js +1 -0
  286. package/dist/lib/withErrorBoundary.js.map +1 -1
  287. package/dist/lib/withSuspenseAndErrorBoundary.d.ts.map +1 -1
  288. package/dist/lib/withSuspenseAndErrorBoundary.js +1 -0
  289. package/dist/lib/withSuspenseAndErrorBoundary.js.map +1 -1
  290. package/dist/{theme/schema.d.ts → theming/vocabulary.d.ts} +4 -4
  291. package/dist/theming/vocabulary.d.ts.map +1 -0
  292. package/dist/{theme/schema.js → theming/vocabulary.js} +4 -4
  293. package/dist/theming/vocabulary.js.map +1 -0
  294. package/package.json +22 -9
  295. package/src/components/Badge/Badge.tsx +2 -2
  296. package/src/components/Button/Button.tsx +1 -1
  297. package/src/{theme/recipes/button.css → components/Button/button.recipe.css} +2 -2
  298. package/src/components/Calendar/Calendar.tsx +2 -0
  299. package/src/components/Calendar/CalendarView.tsx +2 -0
  300. package/src/components/Calendar/calendar.hooks.ts +2 -0
  301. package/src/components/Card/Card.tsx +105 -17
  302. package/src/{theme/recipes/card.css → components/Card/card.recipe.css} +6 -1
  303. package/src/components/Card/index.ts +1 -1
  304. package/src/components/Checkbox/Checkbox.tsx +2 -0
  305. package/src/components/CheckboxGroup/CheckboxGroup.tsx +2 -0
  306. package/src/components/Code/Editor/Editor.tsx +2 -0
  307. package/src/components/Code/Workspace/StatusBar.tsx +2 -0
  308. package/src/components/Code/Workspace/Toolbar.tsx +2 -0
  309. package/src/components/Code/Workspace/Workspace.tsx +2 -0
  310. package/src/components/DatePicker/DatePicker.tsx +7 -0
  311. package/src/components/DatePicker/DateSegments.tsx +2 -0
  312. package/src/components/DatePicker/datepicker.hooks.ts +2 -0
  313. package/src/components/DateRangePicker/DateRangePicker.tsx +2 -0
  314. package/src/components/DateTimePicker/DateTimePicker.tsx +7 -1
  315. package/src/components/DateTimePicker/DateTimeSegments.tsx +2 -0
  316. package/src/components/DateTimeRangePicker/DateTimeRangePicker.tsx +7 -1
  317. package/src/components/FormField/FormField.tsx +94 -42
  318. package/src/components/FormField/index.ts +2 -2
  319. package/src/components/HoverCard/HoverCard.tsx +2 -0
  320. package/src/components/HoverCard/components/HoverCardContent.tsx +2 -0
  321. package/src/components/HoverCard/components/HoverCardContext.tsx +2 -0
  322. package/src/components/HoverCard/components/HoverCardTrigger.tsx +2 -0
  323. package/src/components/Message/Message.tsx +1 -1
  324. package/src/components/Modal/Modal.tsx +77 -51
  325. package/src/components/Modal/components/ModalContext.tsx +2 -0
  326. package/src/components/Modal/components/ModalHeader.tsx +2 -0
  327. package/src/components/Popover/Popover.tsx +7 -0
  328. package/src/components/Popover/components/PopoverBody.tsx +2 -0
  329. package/src/components/Popover/components/PopoverClose.tsx +2 -0
  330. package/src/components/Popover/components/PopoverContext.tsx +2 -0
  331. package/src/components/Popover/components/PopoverTrigger.tsx +2 -0
  332. package/src/components/RadioButton/RadioButton.tsx +2 -0
  333. package/src/components/RadioButtonGroup/RadioButtonGroup.tsx +2 -0
  334. package/src/components/SearchInput/SearchInput.tsx +15 -8
  335. package/src/components/Select/Select.tsx +24 -1
  336. package/src/components/Select/SelectDropdown.tsx +2 -0
  337. package/src/components/Select/SelectTrigger.tsx +5 -0
  338. package/src/components/Select/useSelectKeyboard.ts +2 -0
  339. package/src/components/Sheet/Sheet.tsx +49 -34
  340. package/src/components/Sheet/components/SheetContext.tsx +2 -0
  341. package/src/components/Sheet/components/SheetHeader.tsx +2 -0
  342. package/src/components/Spinner/Spinner.tsx +2 -2
  343. package/src/components/Switch/Switch.tsx +2 -0
  344. package/src/components/Tabs/Tabs.tsx +2 -0
  345. package/src/components/Tabs/components/TabsContext.tsx +2 -0
  346. package/src/components/Tabs/components/TabsList.tsx +2 -0
  347. package/src/components/Tabs/components/TabsPanels.tsx +2 -0
  348. package/src/components/Tabs/components/TabsTrigger.tsx +3 -1
  349. package/src/{theme/recipes/tabs.css → components/Tabs/tabs.recipe.css} +1 -1
  350. package/src/components/TagChip/TagChip.tsx +2 -0
  351. package/src/components/TagInput/TagInput.tsx +15 -6
  352. package/src/components/Textarea/Textarea.tsx +42 -6
  353. package/src/{theme/recipes/textarea.css → components/Textarea/textarea.recipe.css} +1 -1
  354. package/src/components/TimePicker/PeriodSelector.tsx +2 -0
  355. package/src/components/TimePicker/TimeColumn.tsx +2 -0
  356. package/src/components/TimePicker/TimePicker.tsx +7 -0
  357. package/src/components/TimePicker/TimeSegments.tsx +2 -0
  358. package/src/components/Toast/Toast.tsx +22 -6
  359. package/src/components/Toggle/Toggle.tsx +3 -1
  360. package/src/components/ToggleGroup/ToggleGroupMultiple.tsx +6 -0
  361. package/src/components/ToggleGroup/ToggleGroupSingle.tsx +6 -0
  362. package/src/components/ToggleGroup/toggleGroup.types.ts +7 -0
  363. package/src/components/Tooltip/Tooltip.tsx +2 -0
  364. package/src/components/Tooltip/components/TooltipBody.tsx +2 -0
  365. package/src/components/Tooltip/components/TooltipContext.tsx +2 -0
  366. package/src/components/Tooltip/components/TooltipTrigger.tsx +2 -0
  367. package/src/hooks/useCollapsible.ts +2 -0
  368. package/src/hooks/useControllableState.ts +2 -0
  369. package/src/hooks/useDebouncedCallback.ts +2 -0
  370. package/src/hooks/useDebouncedState.ts +2 -0
  371. package/src/hooks/useDeviceFormFactor.ts +2 -0
  372. package/src/hooks/useLocalStorage.ts +2 -0
  373. package/src/hooks/useMergedFloatingRef.ts +2 -0
  374. package/src/hooks/usePresence.ts +2 -0
  375. package/src/hooks/useStack.ts +35 -12
  376. package/src/hooks/useTheme.ts +2 -0
  377. package/src/internal/PickerField.tsx +2 -0
  378. package/src/internal/SegmentedField.tsx +2 -0
  379. package/src/internal/escapeLayers.ts +53 -0
  380. package/src/lib/ErrorBoundary.tsx +2 -0
  381. package/src/lib/contexts/ComponentsContext/ComponentsContext.tsx +2 -0
  382. package/src/lib/contexts/OverlayContext/OverlayContext.tsx +53 -26
  383. package/src/lib/contexts/OverlayContext/ToastStack.tsx +71 -0
  384. package/src/lib/contexts/OverlayContext/hooks/useModal.tsx +2 -0
  385. package/src/lib/contexts/OverlayContext/hooks/useToast.ts +30 -73
  386. package/src/lib/contexts/OverlayContext/index.ts +2 -0
  387. package/src/lib/contexts/OverlayContext/toastStore.ts +138 -0
  388. package/src/lib/withErrorBoundary.tsx +2 -0
  389. package/src/lib/withSuspenseAndErrorBoundary.tsx +2 -0
  390. package/src/theme/linen/index.css +11 -0
  391. package/src/theme/linen/palette.css +87 -0
  392. package/src/theme/linen/theme.css +371 -0
  393. package/src/theming/tailwind.css +356 -0
  394. package/src/{theme/schema.ts → theming/vocabulary.ts} +3 -3
  395. package/dist/theme/index.d.ts +0 -9
  396. package/dist/theme/index.d.ts.map +0 -1
  397. package/dist/theme/index.js +0 -8
  398. package/dist/theme/index.js.map +0 -1
  399. package/dist/theme/schema.d.ts.map +0 -1
  400. package/dist/theme/schema.js.map +0 -1
  401. package/src/theme/index.ts +0 -39
  402. package/src/theme/recipes/index.css +0 -28
  403. package/src/theme/tokens.css +0 -824
  404. /package/src/{theme/recipes/badge.css → components/Badge/badge.recipe.css} +0 -0
  405. /package/src/{theme/recipes/checkbox.css → components/Checkbox/checkbox.recipe.css} +0 -0
  406. /package/src/{theme/recipes/field.css → components/Field/field.recipe.css} +0 -0
  407. /package/src/{theme/recipes/input.css → components/Input/input.recipe.css} +0 -0
  408. /package/src/{theme/recipes/message.css → components/Message/message.recipe.css} +0 -0
  409. /package/src/{theme/recipes/modal.css → components/Modal/modal.recipe.css} +0 -0
  410. /package/src/{theme/recipes/radio-button.css → components/RadioButton/radio-button.recipe.css} +0 -0
  411. /package/src/{theme/recipes/search-input.css → components/SearchInput/search-input.recipe.css} +0 -0
  412. /package/src/{theme/recipes/select.css → components/Select/select.recipe.css} +0 -0
  413. /package/src/{theme/recipes/sheet.css → components/Sheet/sheet.recipe.css} +0 -0
  414. /package/src/{theme/recipes/spinner.css → components/Spinner/spinner.recipe.css} +0 -0
  415. /package/src/{theme/recipes/switch.css → components/Switch/switch.recipe.css} +0 -0
  416. /package/src/{theme/recipes/tag-chip.css → components/TagChip/tag-chip.recipe.css} +0 -0
  417. /package/src/{theme/recipes/toggle.css → components/Toggle/toggle.recipe.css} +0 -0
@@ -0,0 +1,69 @@
1
+ // =============================================================================
2
+ // Defaults
3
+ // =============================================================================
4
+ export const DEFAULT_TOAST_DURATION = 5000;
5
+ export const DEFAULT_MAX_TOASTS = 3;
6
+ /** The lifetime an intent gets when none is given: failures stay, everything else expires. */
7
+ export function defaultToastDuration(intent) {
8
+ return intent === "danger" ? 0 : DEFAULT_TOAST_DURATION;
9
+ }
10
+ let opened = 0;
11
+ const nextId = () => `toast-${++opened}`;
12
+ // =============================================================================
13
+ // Store
14
+ // =============================================================================
15
+ const EMPTY = [];
16
+ export function createToastStore({ max = DEFAULT_MAX_TOASTS, newId = nextId } = {}) {
17
+ let toasts = EMPTY;
18
+ const listeners = new Set();
19
+ const set = (next) => {
20
+ toasts = next.length === 0 ? EMPTY : next;
21
+ for (const listener of [...listeners])
22
+ listener();
23
+ };
24
+ const close = (id) => {
25
+ const record = toasts.find((toast) => toast.id === id);
26
+ if (record === undefined || record.closing)
27
+ return;
28
+ set(toasts.map((toast) => (toast === record ? { ...toast, closing: true } : toast)));
29
+ };
30
+ return {
31
+ subscribe(listener) {
32
+ listeners.add(listener);
33
+ return () => void listeners.delete(listener);
34
+ },
35
+ snapshot: () => toasts,
36
+ open(options) {
37
+ const id = newId();
38
+ const record = { id, options, duration: options.duration ?? defaultToastDuration(options.intent), closing: false };
39
+ set([...toasts, record].slice(-max));
40
+ return { id, close: () => close(id) };
41
+ },
42
+ close,
43
+ remove(id) {
44
+ const next = toasts.filter((toast) => toast.id !== id);
45
+ if (next.length !== toasts.length)
46
+ set(next);
47
+ },
48
+ clear() {
49
+ if (toasts.every((toast) => toast.closing))
50
+ return;
51
+ set(toasts.map((toast) => ({ ...toast, closing: true })));
52
+ },
53
+ };
54
+ }
55
+ /** The app's one stack: what `OverlayProvider` renders unless handed another. */
56
+ export const toastStore = createToastStore();
57
+ /** Open a toast on the app's stack, from anywhere. Returns its id and a way to close it early. */
58
+ export function toast(options) {
59
+ return toastStore.open(options);
60
+ }
61
+ /** Begin a toast's exit on the app's stack. */
62
+ export function closeToast(id) {
63
+ toastStore.close(id);
64
+ }
65
+ /** Begin every toast's exit on the app's stack. */
66
+ export function closeAllToasts() {
67
+ toastStore.clear();
68
+ }
69
+ //# sourceMappingURL=toastStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toastStore.js","sourceRoot":"","sources":["../../../../src/lib/contexts/OverlayContext/toastStore.ts"],"names":[],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"withErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/lib/withErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEzE,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,kBAAkB,KAAK,SAAS,CAAC;YAC7G,CAAC;;EAWpC"}
1
+ {"version":3,"file":"withErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/lib/withErrorBoundary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEzE,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,kBAAkB,KAAK,SAAS,CAAC;YAC7G,CAAC;;EAWpC"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { ErrorBoundary } from "./ErrorBoundary.js";
3
4
  export function withErrorBoundary(Component, fallback) {
@@ -1 +1 @@
1
- {"version":3,"file":"withErrorBoundary.js","sourceRoot":"","sources":["../../src/lib/withErrorBoundary.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAA2B,MAAM,iBAAiB,CAAC;AAEzE,MAAM,UAAU,iBAAiB,CAAmB,SAA2B,EAAE,QAAgE;IAC/I,SAAS,iBAAiB,CAAC,KAAQ;QACjC,OAAO,CACL,KAAC,aAAa,IAAC,QAAQ,EAAE,QAAQ,YAC/B,KAAC,SAAS,OAAK,KAAK,GAAI,GACV,CACjB,CAAC;IACJ,CAAC;IAED,iBAAiB,CAAC,WAAW,GAAG,qBAAqB,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,WAAW,GAAG,CAAC;IAE/G,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
1
+ {"version":3,"file":"withErrorBoundary.js","sourceRoot":"","sources":["../../src/lib/withErrorBoundary.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,aAAa,EAA2B,MAAM,iBAAiB,CAAC;AAEzE,MAAM,UAAU,iBAAiB,CAAmB,SAA2B,EAAE,QAAgE;IAC/I,SAAS,iBAAiB,CAAC,KAAQ;QACjC,OAAO,CACL,KAAC,aAAa,IAAC,QAAQ,EAAE,QAAQ,YAC/B,KAAC,SAAS,OAAK,KAAK,GAAI,GACV,CACjB,CAAC;IACJ,CAAC;IAED,iBAAiB,CAAC,WAAW,GAAG,qBAAqB,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,WAAW,GAAG,CAAC;IAE/G,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"withSuspenseAndErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/lib/withSuspenseAndErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEzE,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,kBAAkB,KAAK,SAAS,CAAC,CAAC;CACvE,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO;YAG7D,CAAC;;EAa/C"}
1
+ {"version":3,"file":"withSuspenseAndErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/lib/withSuspenseAndErrorBoundary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEzE,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,kBAAkB,KAAK,SAAS,CAAC,CAAC;CACvE,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO;YAG7D,CAAC;;EAa/C"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { Suspense } from "react";
3
4
  import { ErrorBoundary } from "./ErrorBoundary.js";
@@ -1 +1 @@
1
- {"version":3,"file":"withSuspenseAndErrorBoundary.js","sourceRoot":"","sources":["../../src/lib/withSuspenseAndErrorBoundary.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,aAAa,EAA2B,MAAM,iBAAiB,CAAC;AAOzE,MAAM,UAAU,4BAA4B,CAAmB,SAA2B,EAAE,OAAgB;IAC1G,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAE5C,SAAS,4BAA4B,CAAC,KAAQ;QAC5C,OAAO,CACL,KAAC,aAAa,IAAC,QAAQ,EAAE,aAAa,YACpC,KAAC,QAAQ,IAAC,QAAQ,EAAE,QAAQ,YAC1B,KAAC,SAAS,OAAK,KAAK,GAAI,GACf,GACG,CACjB,CAAC;IACJ,CAAC;IAED,4BAA4B,CAAC,WAAW,GAAG,gCAAgC,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,WAAW,GAAG,CAAC;IAErI,OAAO,4BAA4B,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"withSuspenseAndErrorBoundary.js","sourceRoot":"","sources":["../../src/lib/withSuspenseAndErrorBoundary.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,aAAa,EAA2B,MAAM,iBAAiB,CAAC;AAOzE,MAAM,UAAU,4BAA4B,CAAmB,SAA2B,EAAE,OAAgB;IAC1G,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAE5C,SAAS,4BAA4B,CAAC,KAAQ;QAC5C,OAAO,CACL,KAAC,aAAa,IAAC,QAAQ,EAAE,aAAa,YACpC,KAAC,QAAQ,IAAC,QAAQ,EAAE,QAAQ,YAC1B,KAAC,SAAS,OAAK,KAAK,GAAI,GACf,GACG,CACjB,CAAC;IACJ,CAAC;IAED,4BAA4B,CAAC,WAAW,GAAG,gCAAgC,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,WAAW,GAAG,CAAC;IAErI,OAAO,4BAA4B,CAAC;AACtC,CAAC"}
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Theme Schema
2
+ * Token naming vocabulary
3
3
  *
4
4
  * The naming convention for design tokens, as types and as data:
5
5
  *
6
6
  * {context}-[on-]{intent}[-{weight}][-{state}]
7
7
  *
8
- * src/theme/tokens.css is the only place tokens are defined, and nothing derives
9
- * TypeScript from it. These types describe the *shape* a token name can take
8
+ * The theme sources (src/theme/<name>/ plus src/theming/tailwind.css) are the only place
9
+ * tokens are defined, and nothing derives TypeScript from them. These types describe the *shape* a token name can take
10
10
  * rather than enumerating the names that happen to exist today, which is why the
11
11
  * vocabulary below is the thing to edit when the system grows a new axis.
12
12
  *
@@ -78,4 +78,4 @@ export type ThemeSchema = {
78
78
  /** Type-safe CSS var reference */
79
79
  export declare function cssVar(token: ColorToken): string;
80
80
  export {};
81
- //# sourceMappingURL=schema.d.ts.map
81
+ //# sourceMappingURL=vocabulary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../../src/theming/vocabulary.ts"],"names":[],"mappings":"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"}
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Theme Schema
2
+ * Token naming vocabulary
3
3
  *
4
4
  * The naming convention for design tokens, as types and as data:
5
5
  *
6
6
  * {context}-[on-]{intent}[-{weight}][-{state}]
7
7
  *
8
- * src/theme/tokens.css is the only place tokens are defined, and nothing derives
9
- * TypeScript from it. These types describe the *shape* a token name can take
8
+ * The theme sources (src/theme/<name>/ plus src/theming/tailwind.css) are the only place
9
+ * tokens are defined, and nothing derives TypeScript from them. These types describe the *shape* a token name can take
10
10
  * rather than enumerating the names that happen to exist today, which is why the
11
11
  * vocabulary below is the thing to edit when the system grows a new axis.
12
12
  *
@@ -46,4 +46,4 @@ export const standaloneTokens = ["focus-ring"];
46
46
  export function cssVar(token) {
47
47
  return `var(--${token})`;
48
48
  }
49
- //# sourceMappingURL=schema.js.map
49
+ //# sourceMappingURL=vocabulary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../../src/theming/vocabulary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAYH,gFAAgF;AAChF,aAAa;AACb,gFAAgF;AAEhF,gDAAgD;AAChD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAU,CAAC;AAGxD,0CAA0C;AAC1C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAGjE,mCAAmC;AACnC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAGlE,oBAAoB;AACpB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAG,SAAS,EAAE,GAAG,QAAQ,CAAU,CAAC;AAG9D,gFAAgF;AAChF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,SAAS,CAAU,CAAC;AAGnE,8DAA8D;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAGrD,yBAAyB;AACzB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAGlE,0DAA0D;AAC1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,YAAY,CAAU,CAAC;AAiDxD,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,kCAAkC;AAClC,MAAM,UAAU,MAAM,CAAC,KAAiB;IACtC,OAAO,SAAS,KAAK,GAAG,CAAC;AAC3B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixthshift/design-system",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Personal design system - tokens, theme, and component library",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -38,10 +38,10 @@
38
38
  "!src/testing"
39
39
  ],
40
40
  "exports": {
41
- "./theme.css": "./src/theme/tokens.css",
42
- "./theme": {
43
- "types": "./dist/theme/index.d.ts",
44
- "import": "./dist/theme/index.js"
41
+ "./themes/linen.css": "./src/theme/linen/index.css",
42
+ "./theming": {
43
+ "types": "./dist/theming/vocabulary.d.ts",
44
+ "import": "./dist/theming/vocabulary.js"
45
45
  },
46
46
  "./utils": {
47
47
  "types": "./dist/lib/utils.d.ts",
@@ -318,13 +318,15 @@
318
318
  },
319
319
  "scripts": {
320
320
  "prepare": "bun run build",
321
- "build": "bun run clean:dist && bun run build:js && bun run scripts/check-exports.ts",
321
+ "build": "bun run clean:dist && bun run scripts/check-use-client.ts && bun run build:js && bun run scripts/check-exports.ts",
322
322
  "build:js": "tsc -p tsconfig.build.json && bun run scripts/fix-extensions.ts",
323
323
  "dev": "storybook dev -p 6006 --no-open",
324
324
  "build:storybook": "storybook build",
325
- "test": "vitest run --project unit --project date-time --reporter=dot",
326
- "test:verbose": "vitest run --project unit --project date-time",
327
- "test:watch": "vitest --project unit --project date-time",
325
+ "test": "vitest run --project unit --project date-time --project ssr --reporter=dot",
326
+ "test:coverage": "vitest run --project unit --project date-time --project ssr --coverage --reporter=dot",
327
+ "test:verbose": "vitest run --project unit --project date-time --project ssr",
328
+ "test:watch": "vitest --project unit --project date-time --project ssr",
329
+ "test:ssr": "vitest run --project ssr",
328
330
  "test:visual": "vitest run --project visual",
329
331
  "test:visual:update": "vitest run --project visual --update",
330
332
  "test:stories": "vitest run --project storybook --project storybook-dark",
@@ -339,6 +341,13 @@
339
341
  "check:fix": "biome check --write .",
340
342
  "check:recipes": "bun run scripts/check-recipes.ts",
341
343
  "check:contrast": "bun run scripts/check-contrast.ts",
344
+ "check:api": "bun run scripts/api-snapshot.ts --check",
345
+ "check:size": "bun run scripts/check-size.ts",
346
+ "api:update": "bun run scripts/api-snapshot.ts",
347
+ "check:published": "bun run scripts/check-published.ts",
348
+ "check:consumer-resolution": "bun run scripts/check-consumer-resolution.ts",
349
+ "check:use-client": "bun run scripts/check-use-client.ts",
350
+ "clean:artifacts": "rm -rf coverage .vitest-attachments",
342
351
  "clean": "rm -rf dist node_modules *.tsbuildinfo",
343
352
  "clean:dist": "rm -rf dist"
344
353
  },
@@ -351,6 +360,7 @@
351
360
  "tailwind-merge": "^3.4.0"
352
361
  },
353
362
  "devDependencies": {
363
+ "@arethetypeswrong/cli": "^0.18.5",
354
364
  "@biomejs/biome": "2.4.15",
355
365
  "@fontsource-variable/inter": "^5.2.8",
356
366
  "@fontsource-variable/jetbrains-mono": "^5.2.8",
@@ -373,12 +383,15 @@
373
383
  "@vitest/coverage-v8": "4.1.7",
374
384
  "@vitest/ui": "4.1.7",
375
385
  "commander": "^14.0.2",
386
+ "esbuild": "^0.28.2",
376
387
  "happy-dom": "^20.9.0",
377
388
  "monaco-editor": "^0.55.1",
378
389
  "playwright": "^1.57.0",
390
+ "publint": "^0.3.24",
379
391
  "react": "^18.2.0",
380
392
  "react-dom": "^18.2.0",
381
393
  "react-markdown": "^10.1.0",
394
+ "remark-gfm": "^4.0.1",
382
395
  "storybook": "^10.1.8",
383
396
  "tailwindcss": "^4",
384
397
  "typescript": "~5.7.2",
@@ -6,7 +6,7 @@ import * as React from "react";
6
6
  * Geometry and behaviour only.
7
7
  *
8
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
9
+ * src/components/Badge/badge.recipe.css. That file is the mapping from
10
10
  * `(variant, intent)` to a semantic token — the layer that used to be
11
11
  * `compoundVariants` here, where it was compiled into class-name literals and
12
12
  * unreachable from outside. Nothing in this file names a colour, which is the
@@ -85,7 +85,7 @@ export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & {
85
85
  * does not manage an accessible name of its own.
86
86
  *
87
87
  * Colour is not decided here: each `(variant, intent)` pairing resolves
88
- * through a `--badge-*` component token (src/theme/recipes/badge.css), the
88
+ * through a `--badge-*` component token (src/components/Badge/badge.recipe.css), the
89
89
  * same seam Button uses, so a consumer can re-point a cell without a
90
90
  * release.
91
91
  */
@@ -7,7 +7,7 @@ import { Slot } from "../../internal/Slot";
7
7
  * Geometry and behaviour only.
8
8
  *
9
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
10
+ * src/components/Button/button.recipe.css. That file is the mapping from
11
11
  * `(variant, intent, state)` to a semantic token — the layer that used to be
12
12
  * `compoundVariants` here, where it was compiled into class-name literals and
13
13
  * unreachable from outside. Nothing in this file names a colour, which is the
@@ -8,7 +8,7 @@
8
8
  * or intent the library never shipped.
9
9
  *
10
10
  * The grammar is `--button-{context}[-{state}]` — the same `context` and
11
- * `state` words the semantic layer uses (src/theme/schema.ts). Note what is
11
+ * `state` words the semantic layer uses (src/theming/vocabulary.ts). Note what is
12
12
  * deliberately *absent*: intent and weight never appear in a token name. They
13
13
  * select, via the `data-` attributes below. Putting them in the name
14
14
  * (`--button-bg-danger`) would restore the combinatorial explosion this layer
@@ -47,7 +47,7 @@
47
47
  --button-fg: var(--fg-on-brand);
48
48
  }
49
49
 
50
- /* `neutral` means *no colour family* — the grey tiers. It used to resolve to
50
+ /* `neutral` means *no colour family* — the grey ramp. It used to resolve to
51
51
  the brand fill, which made `intent="neutral"` mean one thing on Button and
52
52
  another on Badge and Message, where it was already grey. Button
53
53
  was the outlier; this is the cell that ends that. A brand-coloured button
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import * as React from "react";
2
4
  import { useCallback, useMemo } from "react";
3
5
  import {
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  /**
2
4
  * CalendarView — the Temporal-typed calendar grid.
3
5
  *
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import { useCallback, useMemo } from "react";
2
4
  import { addDays, formatDateMediumYear, isPlainDate, isSameDay, isSameMonth, startOfMonth, startOfWeek, Temporal, today } from "../../date-time";
3
5
  import type { DateRangeValue, DateSelectionState, DisabledDateMatcher, SelectionMode } from "./calendar.types";
@@ -1,27 +1,120 @@
1
+ "use client";
2
+
1
3
  import { cn } from "@sixthshift/design-system/utils";
4
+ import { cva, type VariantProps } from "class-variance-authority";
2
5
  import * as React from "react";
3
6
 
4
- export type CardProps = Omit<React.HTMLAttributes<HTMLDivElement>, "title"> & {
5
- /** Optional header title - string or ReactNode */
6
- title?: React.ReactNode;
7
- /** Optional action element displayed on the right side of the header */
8
- headerAction?: React.ReactNode;
9
- };
7
+ /**
8
+ * Geometry only, plus the five `--card-*` component tokens.
9
+ *
10
+ * Every colour reads a `--card-*` token whose value is decided by
11
+ * src/components/Card/card.recipe.css. `size` stays here: it is pure geometry
12
+ * (padding, header gap, corner radius), not colour, so it has no reason to
13
+ * move — the same split Message.tsx documents.
14
+ *
15
+ * The ramp is a density axis, not a padding setting. `md` is the middle and
16
+ * the default at 16px, which is also where MUI's `CardContent` and
17
+ * Bootstrap's `.card-body` sit; two steps exist below it for surfaces that
18
+ * repeat dozens of times, and two above for surfaces that are the page.
19
+ *
20
+ * xs 8px dense data — table-row cards, compact tiles, many at once
21
+ * sm 12px list rows and secondary cards; a line or two of content
22
+ * md 16px a standalone content card. The one to reach for by default
23
+ * lg 24px primary or feature cards — a main panel, a form container
24
+ * xl 32px hero, empty-state and marketing surfaces
25
+ *
26
+ * Steps are 8 · 12 · 16 · 24 · 32, alternating x1.5 and x1.33; 20px is
27
+ * skipped deliberately as the value that breaks that rhythm.
28
+ *
29
+ * Radius scales with padding and never exceeds it — at `xs` a 12px corner
30
+ * against 8px of padding visibly crowds the content. The header gap flattens
31
+ * at both ends instead of tracking padding: it separates a title from an
32
+ * action control, so it has a usability floor and nothing to gain above 16px.
33
+ *
34
+ * Type is deliberately absent from the ramp. Message's `size` carries
35
+ * `text-xs` because Message knows what it holds; Card is a container for
36
+ * arbitrary children, `Heading` and `Body` included, so setting type here
37
+ * would fight the typography ramp at every call site. Containers set
38
+ * spacing; content components set type.
39
+ */
40
+ export const cardVariants = cva(
41
+ // One literal, deliberately: `useSortedClasses --unsafe` strips the trailing
42
+ // space before a `+`, silently welding the last class of one fragment to the
43
+ // first of the next. A single string means the sorter has nothing to break.
44
+ "card border-(color:--card-border) border bg-(--card-bg) text-(--card-fg) shadow",
45
+ {
46
+ variants: {
47
+ size: {
48
+ xs: "rounded-md p-2",
49
+ sm: "rounded-lg p-3",
50
+ md: "rounded-xl p-4",
51
+ lg: "rounded-xl p-6",
52
+ xl: "rounded-2xl p-8",
53
+ },
54
+ interactive: {
55
+ true: "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",
56
+ false: "",
57
+ },
58
+ },
59
+ defaultVariants: {
60
+ size: "md",
61
+ interactive: false,
62
+ },
63
+ }
64
+ );
65
+
66
+ /**
67
+ * Header geometry per size: the gap between title and action, and the space
68
+ * below it.
69
+ *
70
+ * A `<div>`, not a `<header>`. A `<header>` whose nearest sectioning ancestor
71
+ * is the body becomes a `banner` landmark, so two titled cards on one page
72
+ * produced two banners — axe's `landmark-no-duplicate-banner`. A card's header
73
+ * is not the page's banner, and the element bought nothing else here.
74
+ */
75
+ const headerVariants = cva("flex items-start justify-between", {
76
+ variants: {
77
+ size: {
78
+ xs: "mb-2 gap-2",
79
+ sm: "mb-3 gap-2",
80
+ md: "mb-4 gap-3",
81
+ lg: "mb-4 gap-4",
82
+ xl: "mb-6 gap-4",
83
+ },
84
+ },
85
+ defaultVariants: {
86
+ size: "md",
87
+ },
88
+ });
89
+
90
+ export type CardSize = NonNullable<VariantProps<typeof cardVariants>["size"]>;
91
+
92
+ export type CardProps = Omit<React.HTMLAttributes<HTMLDivElement>, "title"> &
93
+ Pick<VariantProps<typeof cardVariants>, "size"> & {
94
+ /** Optional header title - string or ReactNode */
95
+ title?: React.ReactNode;
96
+ /** Optional action element displayed on the right side of the header */
97
+ headerAction?: React.ReactNode;
98
+ };
10
99
 
11
100
  /**
12
101
  * Bordered, elevated container — the "this contains data" building block
13
102
  * (see docs/visual-hierarchy.md's Elevated tier). Renders a `<div>`, with an
14
- * optional `<header>` when `title` and/or `headerAction` is passed.
103
+ * optional header row when `title` and/or `headerAction` is passed.
104
+ *
105
+ * `size` is a density axis covering padding, header spacing and corner
106
+ * radius; `md` (16px) is the default. See `cardVariants` above for what each
107
+ * step is for and why type is not part of it.
15
108
  *
16
109
  * Passing `onClick` turns the whole card into a button: it gets
17
110
  * `role="button"`, `tabIndex={0}`, and both Enter and Space activate it, not
18
111
  * just a pointer click. Omit `onClick` for a purely presentational card.
19
112
  *
20
- * Colour reads `--card-*` component tokens (src/theme/recipes/card.css) —
113
+ * Colour reads `--card-*` component tokens (src/components/Card/card.recipe.css) —
21
114
  * the same seam Button and Badge use — so a consumer can re-point them
22
115
  * without a release.
23
116
  */
24
- export const Card = React.forwardRef<HTMLDivElement, CardProps>(({ className, title, headerAction, children, onClick, onKeyDown, ...props }, ref) => {
117
+ export const Card = React.forwardRef<HTMLDivElement, CardProps>(({ className, size, title, headerAction, children, onClick, onKeyDown, ...props }, ref) => {
25
118
  const isInteractive = !!onClick;
26
119
 
27
120
  const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {
@@ -36,22 +129,17 @@ export const Card = React.forwardRef<HTMLDivElement, CardProps>(({ className, ti
36
129
  // biome-ignore lint/a11y/noStaticElementInteractions: role="button" + tabIndex are added dynamically when onClick is present
37
130
  <div
38
131
  ref={ref}
39
- className={cn(
40
- "card border-(color:--card-border) rounded-xl border bg-(--card-bg) p-6 text-(--card-fg) shadow",
41
- isInteractive &&
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",
43
- className
44
- )}
132
+ className={cn(cardVariants({ size, interactive: isInteractive }), className)}
45
133
  onClick={onClick}
46
134
  onKeyDown={handleKeyDown}
47
135
  {...(isInteractive && { role: "button", tabIndex: 0 })}
48
136
  {...props}
49
137
  >
50
138
  {(title || headerAction) && (
51
- <header className="mb-4 flex items-start justify-between gap-4">
139
+ <div className={headerVariants({ size })}>
52
140
  {title && <div className="font-semibold">{title}</div>}
53
141
  {headerAction && <div className="shrink-0">{headerAction}</div>}
54
- </header>
142
+ </div>
55
143
  )}
56
144
  {children}
57
145
  </div>
@@ -1,11 +1,16 @@
1
1
  /**
2
2
  * Card recipe — the component-token layer for Card.
3
3
  *
4
- * Card has no variant/intent axis — every instance uses the same fixed
4
+ * Card has no colour-bearing variant — every instance uses the same fixed
5
5
  * semantic tokens the old plain class string named directly. This file just
6
6
  * gives those tokens a name, so a consumer can re-point a cell or scope a
7
7
  * change to a subtree without a release.
8
8
  *
9
+ * Card's `size` axis is pure geometry (padding, header gap, radius) and stays
10
+ * in Card.tsx's `cva` call; nothing here concerns it. Same split as
11
+ * message.css — this layer is colour, and a consumer wanting a different
12
+ * spacing rhythm re-points Tailwind's `--spacing`, not a token here.
13
+ *
9
14
  * The grammar is `--card-{context}[-{state}]`, context in {bg, fg, border,
10
15
  * ring} — the same words the semantic layer uses. `--card-ring` backs the
11
16
  * `outline-*` utilities on the interactive (clickable) variant: it plays the
@@ -1 +1 @@
1
- export { Card, type CardProps } from "./Card";
1
+ export { Card, type CardProps, type CardSize, cardVariants } from "./Card";
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import { useControllableState } from "@sixthshift/design-system/hooks";
2
4
  import { Label } from "@sixthshift/design-system/label";
3
5
  import { cn } from "@sixthshift/design-system/utils";
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import { Checkbox } from "@sixthshift/design-system/checkbox";
2
4
  import { useControllableState } from "@sixthshift/design-system/hooks";
3
5
  import { cn } from "@sixthshift/design-system/utils";
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import MonacoEditor from "@monaco-editor/react";
2
4
  import type { editor } from "monaco-editor";
3
5
  import type { HTMLAttributes } from "react";
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import type { HTMLAttributes, ReactNode } from "react";
2
4
 
3
5
  export type StatusBarItem = {
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import type { HTMLAttributes, ReactNode } from "react";
2
4
  import { Button } from "../../Button";
3
5
 
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import type { HTMLAttributes, ReactNode } from "react";
2
4
  import { useState } from "react";
3
5
  import { Editor } from "../Editor";
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import { autoUpdate, FloatingPortal, flip, offset, shift, useClick, useDismiss, useFloating, useInteractions } from "@floating-ui/react";
2
4
  import { useControllableState } from "@sixthshift/design-system/hooks";
3
5
  import { cn } from "@sixthshift/design-system/utils";
@@ -19,6 +21,7 @@ import {
19
21
  toISODateRange,
20
22
  } from "../../date-time";
21
23
  import { PickerField } from "../../internal";
24
+ import { useEscapeLayer } from "../../internal/escapeLayers";
22
25
  import { CalendarView } from "../Calendar/CalendarView";
23
26
  import { isDateDisabled } from "../Calendar/calendar.hooks";
24
27
  import type { PresetOption } from "../Calendar/calendar.types";
@@ -236,6 +239,10 @@ export const DatePicker = React.forwardRef<HTMLDivElement, DatePickerProps>((pro
236
239
 
237
240
  const click = useClick(context);
238
241
  const dismiss = useDismiss(context);
242
+
243
+ // While open, an Escape press closes this picker's popover and must not
244
+ // also close a Modal/Sheet it is rendered inside.
245
+ useEscapeLayer(open);
239
246
  const { getReferenceProps, getFloatingProps } = useInteractions([click, dismiss]);
240
247
 
241
248
  // IDs for accessibility
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import { type Temporal, today, toISODate } from "../../date-time";
2
4
  import { SegmentedField, type SegmentSpec, type SegmentValues } from "../../internal";
3
5
  import type { DateSegmentOrder } from "./datepicker.types";
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import { useCallback } from "react";
2
4
  import { formatDateMediumYear, isPlainDate, Temporal } from "../../date-time";
3
5
  import type { DatePickerMode, DateRangeValue, DateSelectionState, DisabledDateMatcher } from "./datepicker.types";
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import * as React from "react";
2
4
  import { useMemo } from "react";
3
5
  import { addDaysISO, startOfMonthISO, todayISO } from "../../date-time";
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import { autoUpdate, FloatingPortal, flip, offset, shift, useClick, useDismiss, useFloating, useInteractions } from "@floating-ui/react";
2
4
  import { useControllableState } from "@sixthshift/design-system/hooks";
3
5
  import { cn } from "@sixthshift/design-system/utils";
@@ -13,8 +15,8 @@ import {
13
15
  today,
14
16
  toISOInstantOrUndefined,
15
17
  } from "../../date-time";
16
-
17
18
  import { PickerField } from "../../internal";
19
+ import { useEscapeLayer } from "../../internal/escapeLayers";
18
20
  import { Button } from "../Button";
19
21
  import { CalendarView } from "../Calendar/CalendarView";
20
22
  import { isDateDisabled } from "../Calendar/calendar.hooks";
@@ -251,6 +253,10 @@ export const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerPro
251
253
 
252
254
  const click = useClick(context);
253
255
  const dismiss = useDismiss(context);
256
+
257
+ // While open, an Escape press closes this picker's popover and must not
258
+ // also close a Modal/Sheet it is rendered inside.
259
+ useEscapeLayer(open);
254
260
  const { getReferenceProps, getFloatingProps } = useInteractions([click, dismiss]);
255
261
 
256
262
  // IDs for accessibility
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import { Temporal } from "../../date-time";
2
4
  import { SegmentedField, type SegmentSpec, type SegmentValues } from "../../internal";
3
5
  import { dateFromSegments, dateSpec, dateToSegments, parseDatePasteIn } from "../DatePicker/DateSegments";