@sixthshift/design-system 0.2.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (604) hide show
  1. package/README.md +242 -33
  2. package/dist/components/Badge/Badge.d.ts +65 -7
  3. package/dist/components/Badge/Badge.d.ts.map +1 -1
  4. package/dist/components/Badge/Badge.js +56 -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 +20 -2
  11. package/dist/components/BarChart/BarChart.d.ts.map +1 -1
  12. package/dist/components/BarChart/BarChart.js +17 -3
  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 +31 -1
  23. package/dist/components/Calendar/Calendar.d.ts.map +1 -1
  24. package/dist/components/Calendar/Calendar.js +94 -225
  25. package/dist/components/Calendar/Calendar.js.map +1 -1
  26. package/dist/components/Calendar/CalendarView.d.ts +15 -0
  27. package/dist/components/Calendar/CalendarView.d.ts.map +1 -0
  28. package/dist/components/Calendar/CalendarView.js +263 -0
  29. package/dist/components/Calendar/CalendarView.js.map +1 -0
  30. package/dist/components/Calendar/calendar.types.d.ts +87 -27
  31. package/dist/components/Calendar/calendar.types.d.ts.map +1 -1
  32. package/dist/components/Calendar/calendar.types.js +10 -3
  33. package/dist/components/Calendar/calendar.types.js.map +1 -1
  34. package/dist/components/Calendar/index.d.ts +16 -2
  35. package/dist/components/Calendar/index.d.ts.map +1 -1
  36. package/dist/components/Calendar/index.js +15 -1
  37. package/dist/components/Calendar/index.js.map +1 -1
  38. package/dist/components/Card/Card.d.ts +13 -0
  39. package/dist/components/Card/Card.d.ts.map +1 -1
  40. package/dist/components/Card/Card.js +15 -2
  41. package/dist/components/Card/Card.js.map +1 -1
  42. package/dist/components/Checkbox/Checkbox.d.ts +21 -0
  43. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  44. package/dist/components/Checkbox/Checkbox.js +22 -1
  45. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  46. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +22 -0
  47. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
  48. package/dist/components/CheckboxGroup/CheckboxGroup.js +22 -0
  49. package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
  50. package/dist/components/Code/Editor/Editor.js +2 -2
  51. package/dist/components/Code/Editor/Editor.js.map +1 -1
  52. package/dist/components/Code/Editor/themes.d.ts +2 -2
  53. package/dist/components/Code/Editor/themes.d.ts.map +1 -1
  54. package/dist/components/Code/Editor/themes.js +50 -32
  55. package/dist/components/Code/Editor/themes.js.map +1 -1
  56. package/dist/components/Code/ValidationStatus/ValidationStatus.d.ts.map +1 -1
  57. package/dist/components/Code/ValidationStatus/ValidationStatus.js.map +1 -1
  58. package/dist/components/DatePicker/DatePicker.d.ts +45 -2
  59. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  60. package/dist/components/DatePicker/DatePicker.js +228 -11
  61. package/dist/components/DatePicker/DatePicker.js.map +1 -1
  62. package/dist/components/DatePicker/DateSegments.d.ts +60 -0
  63. package/dist/components/DatePicker/DateSegments.d.ts.map +1 -0
  64. package/dist/components/DatePicker/DateSegments.js +80 -0
  65. package/dist/components/DatePicker/DateSegments.js.map +1 -0
  66. package/dist/components/DatePicker/datepicker.types.d.ts +53 -37
  67. package/dist/components/DatePicker/datepicker.types.d.ts.map +1 -1
  68. package/dist/components/DatePicker/datepicker.types.js +5 -3
  69. package/dist/components/DatePicker/datepicker.types.js.map +1 -1
  70. package/dist/components/DatePicker/index.d.ts +10 -1
  71. package/dist/components/DatePicker/index.d.ts.map +1 -1
  72. package/dist/components/DatePicker/index.js +8 -0
  73. package/dist/components/DatePicker/index.js.map +1 -1
  74. package/dist/components/DateRangePicker/DateRangePicker.d.ts +22 -3
  75. package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  76. package/dist/components/DateRangePicker/DateRangePicker.js +38 -24
  77. package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
  78. package/dist/components/DateRangePicker/daterangepicker.types.d.ts +26 -21
  79. package/dist/components/DateRangePicker/daterangepicker.types.d.ts.map +1 -1
  80. package/dist/components/DateRangePicker/daterangepicker.types.js +6 -0
  81. package/dist/components/DateRangePicker/daterangepicker.types.js.map +1 -1
  82. package/dist/components/DateRangePicker/index.d.ts +8 -1
  83. package/dist/components/DateRangePicker/index.d.ts.map +1 -1
  84. package/dist/components/DateRangePicker/index.js +6 -0
  85. package/dist/components/DateRangePicker/index.js.map +1 -1
  86. package/dist/components/DateTimePicker/DateTimePicker.d.ts +32 -4
  87. package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  88. package/dist/components/DateTimePicker/DateTimePicker.js +133 -42
  89. package/dist/components/DateTimePicker/DateTimePicker.js.map +1 -1
  90. package/dist/components/DateTimePicker/DateTimeSegments.d.ts +41 -0
  91. package/dist/components/DateTimePicker/DateTimeSegments.d.ts.map +1 -0
  92. package/dist/components/DateTimePicker/DateTimeSegments.js +67 -0
  93. package/dist/components/DateTimePicker/DateTimeSegments.js.map +1 -0
  94. package/dist/components/DateTimePicker/datetimepicker.types.d.ts +26 -18
  95. package/dist/components/DateTimePicker/datetimepicker.types.d.ts.map +1 -1
  96. package/dist/components/DateTimePicker/datetimepicker.types.js +10 -0
  97. package/dist/components/DateTimePicker/datetimepicker.types.js.map +1 -1
  98. package/dist/components/DateTimePicker/index.d.ts +8 -1
  99. package/dist/components/DateTimePicker/index.d.ts.map +1 -1
  100. package/dist/components/DateTimePicker/index.js +6 -0
  101. package/dist/components/DateTimePicker/index.js.map +1 -1
  102. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +30 -4
  103. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
  104. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js +171 -72
  105. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
  106. package/dist/components/DateTimeRangePicker/datetimerangepicker.types.d.ts +28 -19
  107. package/dist/components/DateTimeRangePicker/datetimerangepicker.types.d.ts.map +1 -1
  108. package/dist/components/DateTimeRangePicker/datetimerangepicker.types.js +8 -0
  109. package/dist/components/DateTimeRangePicker/datetimerangepicker.types.js.map +1 -1
  110. package/dist/components/DateTimeRangePicker/index.d.ts +8 -0
  111. package/dist/components/DateTimeRangePicker/index.d.ts.map +1 -1
  112. package/dist/components/DateTimeRangePicker/index.js +7 -0
  113. package/dist/components/DateTimeRangePicker/index.js.map +1 -1
  114. package/dist/components/Field/Field.d.ts +18 -20
  115. package/dist/components/Field/Field.d.ts.map +1 -1
  116. package/dist/components/Field/Field.js +22 -5
  117. package/dist/components/Field/Field.js.map +1 -1
  118. package/dist/components/FormField/FormField.d.ts +15 -0
  119. package/dist/components/FormField/FormField.d.ts.map +1 -1
  120. package/dist/components/FormField/FormField.js +15 -0
  121. package/dist/components/FormField/FormField.js.map +1 -1
  122. package/dist/components/HoverCard/HoverCard.d.ts +6 -0
  123. package/dist/components/HoverCard/HoverCard.d.ts.map +1 -1
  124. package/dist/components/HoverCard/HoverCard.js +6 -0
  125. package/dist/components/HoverCard/HoverCard.js.map +1 -1
  126. package/dist/components/Input/Input.d.ts +15 -0
  127. package/dist/components/Input/Input.d.ts.map +1 -1
  128. package/dist/components/Input/Input.js +18 -3
  129. package/dist/components/Input/Input.js.map +1 -1
  130. package/dist/components/LineChart/LineChart.d.ts +35 -2
  131. package/dist/components/LineChart/LineChart.d.ts.map +1 -1
  132. package/dist/components/LineChart/LineChart.js +22 -3
  133. package/dist/components/LineChart/LineChart.js.map +1 -1
  134. package/dist/components/Markdown/Markdown.d.ts +19 -4
  135. package/dist/components/Markdown/Markdown.d.ts.map +1 -1
  136. package/dist/components/Markdown/Markdown.js +20 -2
  137. package/dist/components/Markdown/Markdown.js.map +1 -1
  138. package/dist/components/Message/Message.d.ts +49 -4
  139. package/dist/components/Message/Message.d.ts.map +1 -1
  140. package/dist/components/Message/Message.js +62 -11
  141. package/dist/components/Message/Message.js.map +1 -1
  142. package/dist/components/Message/index.d.ts +1 -1
  143. package/dist/components/Message/index.d.ts.map +1 -1
  144. package/dist/components/Modal/Modal.d.ts +60 -5
  145. package/dist/components/Modal/Modal.d.ts.map +1 -1
  146. package/dist/components/Modal/Modal.js +52 -6
  147. package/dist/components/Modal/Modal.js.map +1 -1
  148. package/dist/components/Modal/components/ModalContext.d.ts +14 -0
  149. package/dist/components/Modal/components/ModalContext.d.ts.map +1 -1
  150. package/dist/components/Modal/components/ModalContext.js.map +1 -1
  151. package/dist/components/Modal/components/ModalHeader.d.ts.map +1 -1
  152. package/dist/components/Modal/components/ModalHeader.js +13 -2
  153. package/dist/components/Modal/components/ModalHeader.js.map +1 -1
  154. package/dist/components/Popover/Popover.d.ts +29 -0
  155. package/dist/components/Popover/Popover.d.ts.map +1 -1
  156. package/dist/components/Popover/Popover.js +36 -0
  157. package/dist/components/Popover/Popover.js.map +1 -1
  158. package/dist/components/Popover/components/PopoverBody.d.ts.map +1 -1
  159. package/dist/components/Popover/components/PopoverBody.js +5 -2
  160. package/dist/components/Popover/components/PopoverBody.js.map +1 -1
  161. package/dist/components/Popover/components/PopoverContext.d.ts +1 -0
  162. package/dist/components/Popover/components/PopoverContext.d.ts.map +1 -1
  163. package/dist/components/Popover/components/PopoverContext.js.map +1 -1
  164. package/dist/components/Popover/components/PopoverTrigger.d.ts.map +1 -1
  165. package/dist/components/Popover/components/PopoverTrigger.js +2 -2
  166. package/dist/components/Popover/components/PopoverTrigger.js.map +1 -1
  167. package/dist/components/ProgressBar/ProgressBar.d.ts +16 -1
  168. package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -1
  169. package/dist/components/ProgressBar/ProgressBar.js +19 -3
  170. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  171. package/dist/components/RadioButton/RadioButton.d.ts +26 -0
  172. package/dist/components/RadioButton/RadioButton.d.ts.map +1 -1
  173. package/dist/components/RadioButton/RadioButton.js +35 -1
  174. package/dist/components/RadioButton/RadioButton.js.map +1 -1
  175. package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts +26 -0
  176. package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts.map +1 -1
  177. package/dist/components/RadioButtonGroup/RadioButtonGroup.js +33 -0
  178. package/dist/components/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
  179. package/dist/components/SearchInput/SearchInput.d.ts +10 -0
  180. package/dist/components/SearchInput/SearchInput.d.ts.map +1 -1
  181. package/dist/components/SearchInput/SearchInput.js +12 -1
  182. package/dist/components/SearchInput/SearchInput.js.map +1 -1
  183. package/dist/components/Select/Select.d.ts +10 -2
  184. package/dist/components/Select/Select.d.ts.map +1 -1
  185. package/dist/components/Select/Select.js +63 -18
  186. package/dist/components/Select/Select.js.map +1 -1
  187. package/dist/components/Select/SelectDropdown.d.ts +14 -2
  188. package/dist/components/Select/SelectDropdown.d.ts.map +1 -1
  189. package/dist/components/Select/SelectDropdown.js +20 -4
  190. package/dist/components/Select/SelectDropdown.js.map +1 -1
  191. package/dist/components/Select/SelectTrigger.d.ts +10 -3
  192. package/dist/components/Select/SelectTrigger.d.ts.map +1 -1
  193. package/dist/components/Select/SelectTrigger.js +12 -3
  194. package/dist/components/Select/SelectTrigger.js.map +1 -1
  195. package/dist/components/Select/useSelectKeyboard.d.ts +15 -1
  196. package/dist/components/Select/useSelectKeyboard.d.ts.map +1 -1
  197. package/dist/components/Select/useSelectKeyboard.js +73 -65
  198. package/dist/components/Select/useSelectKeyboard.js.map +1 -1
  199. package/dist/components/Separator/Separator.d.ts +10 -0
  200. package/dist/components/Separator/Separator.d.ts.map +1 -1
  201. package/dist/components/Separator/Separator.js +10 -0
  202. package/dist/components/Separator/Separator.js.map +1 -1
  203. package/dist/components/Sheet/Sheet.d.ts +25 -5
  204. package/dist/components/Sheet/Sheet.d.ts.map +1 -1
  205. package/dist/components/Sheet/Sheet.js +24 -6
  206. package/dist/components/Sheet/Sheet.js.map +1 -1
  207. package/dist/components/Sheet/components/SheetContext.d.ts +10 -0
  208. package/dist/components/Sheet/components/SheetContext.d.ts.map +1 -1
  209. package/dist/components/Sheet/components/SheetContext.js.map +1 -1
  210. package/dist/components/Sheet/components/SheetFooter.js +1 -1
  211. package/dist/components/Sheet/components/SheetFooter.js.map +1 -1
  212. package/dist/components/Sheet/components/SheetHeader.d.ts.map +1 -1
  213. package/dist/components/Sheet/components/SheetHeader.js +11 -2
  214. package/dist/components/Sheet/components/SheetHeader.js.map +1 -1
  215. package/dist/components/Sparkline/Sparkline.d.ts +21 -2
  216. package/dist/components/Sparkline/Sparkline.d.ts.map +1 -1
  217. package/dist/components/Sparkline/Sparkline.js +16 -3
  218. package/dist/components/Sparkline/Sparkline.js.map +1 -1
  219. package/dist/components/Spinner/Spinner.d.ts +27 -2
  220. package/dist/components/Spinner/Spinner.d.ts.map +1 -1
  221. package/dist/components/Spinner/Spinner.js +28 -3
  222. package/dist/components/Spinner/Spinner.js.map +1 -1
  223. package/dist/components/Switch/Switch.d.ts +18 -0
  224. package/dist/components/Switch/Switch.d.ts.map +1 -1
  225. package/dist/components/Switch/Switch.js +19 -1
  226. package/dist/components/Switch/Switch.js.map +1 -1
  227. package/dist/components/Tabs/Tabs.d.ts +8 -2
  228. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  229. package/dist/components/Tabs/Tabs.js +6 -0
  230. package/dist/components/Tabs/Tabs.js.map +1 -1
  231. package/dist/components/Tabs/components/TabsList.d.ts +1 -1
  232. package/dist/components/Tabs/components/TabsList.d.ts.map +1 -1
  233. package/dist/components/Tabs/components/TabsList.js +5 -4
  234. package/dist/components/Tabs/components/TabsList.js.map +1 -1
  235. package/dist/components/Tabs/components/TabsPanels.d.ts +1 -1
  236. package/dist/components/Tabs/components/TabsPanels.d.ts.map +1 -1
  237. package/dist/components/Tabs/components/TabsPanels.js +5 -3
  238. package/dist/components/Tabs/components/TabsPanels.js.map +1 -1
  239. package/dist/components/Tabs/components/TabsTrigger.d.ts.map +1 -1
  240. package/dist/components/Tabs/components/TabsTrigger.js +22 -6
  241. package/dist/components/Tabs/components/TabsTrigger.js.map +1 -1
  242. package/dist/components/TagChip/TagChip.d.ts +16 -13
  243. package/dist/components/TagChip/TagChip.d.ts.map +1 -1
  244. package/dist/components/TagChip/TagChip.js +18 -3
  245. package/dist/components/TagChip/TagChip.js.map +1 -1
  246. package/dist/components/TagInput/TagInput.d.ts +12 -9
  247. package/dist/components/TagInput/TagInput.d.ts.map +1 -1
  248. package/dist/components/TagInput/TagInput.js +16 -4
  249. package/dist/components/TagInput/TagInput.js.map +1 -1
  250. package/dist/components/Text/Text.d.ts +9 -0
  251. package/dist/components/Text/Text.d.ts.map +1 -1
  252. package/dist/components/Text/Text.js +9 -0
  253. package/dist/components/Text/Text.js.map +1 -1
  254. package/dist/components/TextInline/TextInline.d.ts +15 -4
  255. package/dist/components/TextInline/TextInline.d.ts.map +1 -1
  256. package/dist/components/TextInline/TextInline.js +11 -0
  257. package/dist/components/TextInline/TextInline.js.map +1 -1
  258. package/dist/components/Textarea/Textarea.d.ts +12 -0
  259. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  260. package/dist/components/Textarea/Textarea.js +13 -1
  261. package/dist/components/Textarea/Textarea.js.map +1 -1
  262. package/dist/components/TimePicker/TimeColumn.d.ts +10 -1
  263. package/dist/components/TimePicker/TimeColumn.d.ts.map +1 -1
  264. package/dist/components/TimePicker/TimeColumn.js +8 -1
  265. package/dist/components/TimePicker/TimeColumn.js.map +1 -1
  266. package/dist/components/TimePicker/TimePicker.d.ts +34 -2
  267. package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
  268. package/dist/components/TimePicker/TimePicker.js +118 -15
  269. package/dist/components/TimePicker/TimePicker.js.map +1 -1
  270. package/dist/components/TimePicker/TimeSegments.d.ts +50 -0
  271. package/dist/components/TimePicker/TimeSegments.d.ts.map +1 -0
  272. package/dist/components/TimePicker/TimeSegments.js +93 -0
  273. package/dist/components/TimePicker/TimeSegments.js.map +1 -0
  274. package/dist/components/TimePicker/timepicker.hooks.d.ts +0 -4
  275. package/dist/components/TimePicker/timepicker.hooks.d.ts.map +1 -1
  276. package/dist/components/TimePicker/timepicker.hooks.js +1 -23
  277. package/dist/components/TimePicker/timepicker.hooks.js.map +1 -1
  278. package/dist/components/TimePicker/timepicker.types.d.ts +14 -15
  279. package/dist/components/TimePicker/timepicker.types.d.ts.map +1 -1
  280. package/dist/components/TimePicker/timepicker.types.js +4 -3
  281. package/dist/components/TimePicker/timepicker.types.js.map +1 -1
  282. package/dist/components/Toast/Toast.d.ts +27 -0
  283. package/dist/components/Toast/Toast.d.ts.map +1 -1
  284. package/dist/components/Toast/Toast.js +28 -1
  285. package/dist/components/Toast/Toast.js.map +1 -1
  286. package/dist/components/Toggle/Toggle.d.ts +31 -12
  287. package/dist/components/Toggle/Toggle.d.ts.map +1 -1
  288. package/dist/components/Toggle/Toggle.js +19 -31
  289. package/dist/components/Toggle/Toggle.js.map +1 -1
  290. package/dist/components/Toggle/index.d.ts +1 -1
  291. package/dist/components/Toggle/index.d.ts.map +1 -1
  292. package/dist/components/Toggle/index.js +1 -1
  293. package/dist/components/Toggle/index.js.map +1 -1
  294. package/dist/components/ToggleGroup/ToggleGroup.d.ts +17 -0
  295. package/dist/components/ToggleGroup/ToggleGroup.d.ts.map +1 -1
  296. package/dist/components/ToggleGroup/ToggleGroup.js +17 -0
  297. package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -1
  298. package/dist/components/ToggleGroup/ToggleGroupItem.d.ts +1 -1
  299. package/dist/components/ToggleGroup/ToggleGroupItem.d.ts.map +1 -1
  300. package/dist/components/ToggleGroup/ToggleGroupItem.js +7 -6
  301. package/dist/components/ToggleGroup/ToggleGroupItem.js.map +1 -1
  302. package/dist/components/ToggleGroup/ToggleGroupMultiple.d.ts +4 -3
  303. package/dist/components/ToggleGroup/ToggleGroupMultiple.d.ts.map +1 -1
  304. package/dist/components/ToggleGroup/ToggleGroupMultiple.js +2 -2
  305. package/dist/components/ToggleGroup/ToggleGroupMultiple.js.map +1 -1
  306. package/dist/components/ToggleGroup/ToggleGroupSingle.d.ts +4 -3
  307. package/dist/components/ToggleGroup/ToggleGroupSingle.d.ts.map +1 -1
  308. package/dist/components/ToggleGroup/ToggleGroupSingle.js +2 -2
  309. package/dist/components/ToggleGroup/ToggleGroupSingle.js.map +1 -1
  310. package/dist/components/ToggleGroup/toggleGroup.types.d.ts +12 -3
  311. package/dist/components/ToggleGroup/toggleGroup.types.d.ts.map +1 -1
  312. package/dist/components/Tooltip/Tooltip.d.ts +6 -0
  313. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  314. package/dist/components/Tooltip/Tooltip.js +6 -0
  315. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  316. package/dist/date-time/index.d.ts +2 -0
  317. package/dist/date-time/index.d.ts.map +1 -1
  318. package/dist/date-time/index.js +9 -1
  319. package/dist/date-time/index.js.map +1 -1
  320. package/dist/date-time/iso.d.ts +261 -0
  321. package/dist/date-time/iso.d.ts.map +1 -0
  322. package/dist/date-time/iso.js +358 -0
  323. package/dist/date-time/iso.js.map +1 -0
  324. package/dist/date-time/now.d.ts +7 -6
  325. package/dist/date-time/now.d.ts.map +1 -1
  326. package/dist/date-time/now.js +3 -3
  327. package/dist/date-time/now.js.map +1 -1
  328. package/dist/internal/PickerField.d.ts +45 -0
  329. package/dist/internal/PickerField.d.ts.map +1 -0
  330. package/dist/internal/PickerField.js +24 -0
  331. package/dist/internal/PickerField.js.map +1 -0
  332. package/dist/internal/SegmentedField.d.ts +98 -0
  333. package/dist/internal/SegmentedField.d.ts.map +1 -0
  334. package/dist/internal/SegmentedField.js +315 -0
  335. package/dist/internal/SegmentedField.js.map +1 -0
  336. package/dist/internal/index.d.ts +2 -0
  337. package/dist/internal/index.d.ts.map +1 -1
  338. package/dist/internal/index.js +2 -0
  339. package/dist/internal/index.js.map +1 -1
  340. package/dist/theme/index.d.ts +4 -3
  341. package/dist/theme/index.d.ts.map +1 -1
  342. package/dist/theme/index.js +3 -2
  343. package/dist/theme/index.js.map +1 -1
  344. package/dist/theme/schema.d.ts +49 -33
  345. package/dist/theme/schema.d.ts.map +1 -1
  346. package/dist/theme/schema.js +30 -21
  347. package/dist/theme/schema.js.map +1 -1
  348. package/package.json +11 -59
  349. package/src/components/Badge/Badge.tsx +87 -49
  350. package/src/components/Badge/index.ts +10 -1
  351. package/src/components/BarChart/BarChart.tsx +37 -30
  352. package/src/components/Button/Button.tsx +129 -106
  353. package/src/components/Button/index.ts +10 -1
  354. package/src/components/Calendar/Calendar.tsx +104 -401
  355. package/src/components/Calendar/CalendarView.tsx +454 -0
  356. package/src/components/Calendar/calendar.types.ts +104 -29
  357. package/src/components/Calendar/index.ts +16 -17
  358. package/src/components/Card/Card.tsx +15 -2
  359. package/src/components/Checkbox/Checkbox.tsx +22 -2
  360. package/src/components/CheckboxGroup/CheckboxGroup.tsx +22 -0
  361. package/src/components/Code/Editor/Editor.tsx +2 -2
  362. package/src/components/Code/Editor/themes.ts +50 -32
  363. package/src/components/Code/ValidationStatus/ValidationStatus.tsx +6 -3
  364. package/src/components/DatePicker/DatePicker.tsx +369 -42
  365. package/src/components/DatePicker/DateSegments.tsx +125 -0
  366. package/src/components/DatePicker/datepicker.types.ts +58 -39
  367. package/src/components/DatePicker/index.ts +11 -3
  368. package/src/components/DateRangePicker/DateRangePicker.tsx +38 -24
  369. package/src/components/DateRangePicker/daterangepicker.types.ts +29 -23
  370. package/src/components/DateRangePicker/index.ts +9 -1
  371. package/src/components/DateTimePicker/DateTimePicker.tsx +189 -88
  372. package/src/components/DateTimePicker/DateTimeSegments.tsx +113 -0
  373. package/src/components/DateTimePicker/datetimepicker.types.ts +29 -19
  374. package/src/components/DateTimePicker/index.ts +9 -1
  375. package/src/components/DateTimeRangePicker/DateTimeRangePicker.tsx +251 -126
  376. package/src/components/DateTimeRangePicker/datetimerangepicker.types.ts +31 -20
  377. package/src/components/DateTimeRangePicker/index.ts +9 -0
  378. package/src/components/Field/Field.tsx +25 -26
  379. package/src/components/FormField/FormField.tsx +15 -0
  380. package/src/components/HoverCard/HoverCard.tsx +6 -0
  381. package/src/components/Input/Input.tsx +19 -4
  382. package/src/components/LineChart/LineChart.tsx +164 -141
  383. package/src/components/Markdown/Markdown.tsx +21 -3
  384. package/src/components/Message/Message.tsx +83 -17
  385. package/src/components/Message/index.ts +1 -1
  386. package/src/components/Modal/Modal.tsx +157 -86
  387. package/src/components/Modal/components/ModalContext.tsx +14 -0
  388. package/src/components/Modal/components/ModalHeader.tsx +15 -3
  389. package/src/components/Popover/Popover.tsx +36 -0
  390. package/src/components/Popover/components/PopoverBody.tsx +6 -1
  391. package/src/components/Popover/components/PopoverContext.tsx +1 -0
  392. package/src/components/Popover/components/PopoverTrigger.tsx +2 -1
  393. package/src/components/ProgressBar/ProgressBar.tsx +46 -28
  394. package/src/components/RadioButton/RadioButton.tsx +34 -3
  395. package/src/components/RadioButtonGroup/RadioButtonGroup.tsx +32 -0
  396. package/src/components/SearchInput/SearchInput.tsx +13 -2
  397. package/src/components/Select/Select.tsx +75 -19
  398. package/src/components/Select/SelectDropdown.tsx +45 -12
  399. package/src/components/Select/SelectTrigger.tsx +31 -8
  400. package/src/components/Select/useSelectKeyboard.ts +20 -10
  401. package/src/components/Separator/Separator.tsx +10 -0
  402. package/src/components/Sheet/Sheet.tsx +114 -83
  403. package/src/components/Sheet/components/SheetContext.tsx +10 -0
  404. package/src/components/Sheet/components/SheetFooter.tsx +1 -1
  405. package/src/components/Sheet/components/SheetHeader.tsx +18 -3
  406. package/src/components/Sparkline/Sparkline.tsx +40 -36
  407. package/src/components/Spinner/Spinner.tsx +28 -3
  408. package/src/components/Switch/Switch.tsx +27 -4
  409. package/src/components/Tabs/Tabs.tsx +6 -0
  410. package/src/components/Tabs/components/TabsList.tsx +5 -3
  411. package/src/components/Tabs/components/TabsPanels.tsx +5 -3
  412. package/src/components/Tabs/components/TabsTrigger.tsx +22 -5
  413. package/src/components/TagChip/TagChip.tsx +27 -18
  414. package/src/components/TagInput/TagInput.tsx +16 -11
  415. package/src/components/Text/Text.tsx +9 -0
  416. package/src/components/TextInline/TextInline.tsx +11 -0
  417. package/src/components/Textarea/Textarea.tsx +13 -1
  418. package/src/components/TimePicker/TimeColumn.tsx +24 -1
  419. package/src/components/TimePicker/TimePicker.tsx +157 -51
  420. package/src/components/TimePicker/TimeSegments.tsx +131 -0
  421. package/src/components/TimePicker/timepicker.hooks.ts +1 -24
  422. package/src/components/TimePicker/timepicker.types.ts +14 -16
  423. package/src/components/Toast/Toast.tsx +28 -1
  424. package/src/components/Toggle/Toggle.tsx +34 -32
  425. package/src/components/Toggle/index.ts +1 -1
  426. package/src/components/ToggleGroup/ToggleGroup.tsx +17 -0
  427. package/src/components/ToggleGroup/ToggleGroupItem.tsx +13 -8
  428. package/src/components/ToggleGroup/ToggleGroupMultiple.tsx +3 -1
  429. package/src/components/ToggleGroup/ToggleGroupSingle.tsx +3 -1
  430. package/src/components/ToggleGroup/toggleGroup.types.ts +12 -3
  431. package/src/components/Tooltip/Tooltip.tsx +6 -0
  432. package/src/date-time/index.ts +61 -1
  433. package/src/date-time/iso.ts +511 -0
  434. package/src/date-time/now.ts +10 -9
  435. package/src/internal/PickerField.tsx +90 -0
  436. package/src/internal/SegmentedField.tsx +445 -0
  437. package/src/internal/index.ts +2 -0
  438. package/src/theme/index.ts +11 -9
  439. package/src/theme/recipes/badge.css +140 -0
  440. package/src/theme/recipes/button.css +167 -0
  441. package/src/theme/recipes/card.css +26 -0
  442. package/src/theme/recipes/checkbox.css +44 -0
  443. package/src/theme/recipes/field.css +14 -0
  444. package/src/theme/recipes/index.css +28 -0
  445. package/src/theme/recipes/input.css +29 -0
  446. package/src/theme/recipes/message.css +47 -0
  447. package/src/theme/recipes/modal.css +31 -0
  448. package/src/theme/recipes/radio-button.css +42 -0
  449. package/src/theme/recipes/search-input.css +16 -0
  450. package/src/theme/recipes/select.css +105 -0
  451. package/src/theme/recipes/sheet.css +34 -0
  452. package/src/theme/recipes/spinner.css +17 -0
  453. package/src/theme/recipes/switch.css +39 -0
  454. package/src/theme/recipes/tabs.css +41 -0
  455. package/src/theme/recipes/tag-chip.css +27 -0
  456. package/src/theme/recipes/textarea.css +20 -0
  457. package/src/theme/recipes/toggle.css +92 -0
  458. package/src/theme/schema.ts +59 -58
  459. package/src/theme/tokens.css +824 -0
  460. package/dist/components/Avatar/Avatar.d.ts +0 -6
  461. package/dist/components/Avatar/Avatar.d.ts.map +0 -1
  462. package/dist/components/Avatar/Avatar.js +0 -11
  463. package/dist/components/Avatar/Avatar.js.map +0 -1
  464. package/dist/components/Avatar/index.d.ts +0 -2
  465. package/dist/components/Avatar/index.d.ts.map +0 -1
  466. package/dist/components/Avatar/index.js +0 -2
  467. package/dist/components/Avatar/index.js.map +0 -1
  468. package/dist/components/Breadcrumb/Breadcrumb.d.ts +0 -12
  469. package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +0 -1
  470. package/dist/components/Breadcrumb/Breadcrumb.js +0 -19
  471. package/dist/components/Breadcrumb/Breadcrumb.js.map +0 -1
  472. package/dist/components/Breadcrumb/index.d.ts +0 -2
  473. package/dist/components/Breadcrumb/index.d.ts.map +0 -1
  474. package/dist/components/Breadcrumb/index.js +0 -2
  475. package/dist/components/Breadcrumb/index.js.map +0 -1
  476. package/dist/components/ColorDot/ColorDot.d.ts +0 -13
  477. package/dist/components/ColorDot/ColorDot.d.ts.map +0 -1
  478. package/dist/components/ColorDot/ColorDot.js +0 -34
  479. package/dist/components/ColorDot/ColorDot.js.map +0 -1
  480. package/dist/components/ColorDot/index.d.ts +0 -2
  481. package/dist/components/ColorDot/index.d.ts.map +0 -1
  482. package/dist/components/ColorDot/index.js +0 -2
  483. package/dist/components/ColorDot/index.js.map +0 -1
  484. package/dist/components/EmptyState/EmptyState.d.ts +0 -15
  485. package/dist/components/EmptyState/EmptyState.d.ts.map +0 -1
  486. package/dist/components/EmptyState/EmptyState.js +0 -7
  487. package/dist/components/EmptyState/EmptyState.js.map +0 -1
  488. package/dist/components/EmptyState/index.d.ts +0 -2
  489. package/dist/components/EmptyState/index.d.ts.map +0 -1
  490. package/dist/components/EmptyState/index.js +0 -2
  491. package/dist/components/EmptyState/index.js.map +0 -1
  492. package/dist/components/HeatMap/HeatMapCalendar.d.ts +0 -11
  493. package/dist/components/HeatMap/HeatMapCalendar.d.ts.map +0 -1
  494. package/dist/components/HeatMap/HeatMapCalendar.js +0 -68
  495. package/dist/components/HeatMap/HeatMapCalendar.js.map +0 -1
  496. package/dist/components/HeatMap/HeatMapMatrix.d.ts +0 -12
  497. package/dist/components/HeatMap/HeatMapMatrix.d.ts.map +0 -1
  498. package/dist/components/HeatMap/HeatMapMatrix.js +0 -35
  499. package/dist/components/HeatMap/HeatMapMatrix.js.map +0 -1
  500. package/dist/components/HeatMap/heat-map.utils.d.ts +0 -10
  501. package/dist/components/HeatMap/heat-map.utils.d.ts.map +0 -1
  502. package/dist/components/HeatMap/heat-map.utils.js +0 -10
  503. package/dist/components/HeatMap/heat-map.utils.js.map +0 -1
  504. package/dist/components/HeatMap/index.d.ts +0 -4
  505. package/dist/components/HeatMap/index.d.ts.map +0 -1
  506. package/dist/components/HeatMap/index.js +0 -3
  507. package/dist/components/HeatMap/index.js.map +0 -1
  508. package/dist/components/MetricList/MetricList.d.ts +0 -9
  509. package/dist/components/MetricList/MetricList.d.ts.map +0 -1
  510. package/dist/components/MetricList/MetricList.js +0 -6
  511. package/dist/components/MetricList/MetricList.js.map +0 -1
  512. package/dist/components/MetricList/MetricRow.d.ts +0 -13
  513. package/dist/components/MetricList/MetricRow.d.ts.map +0 -1
  514. package/dist/components/MetricList/MetricRow.js +0 -13
  515. package/dist/components/MetricList/MetricRow.js.map +0 -1
  516. package/dist/components/MetricList/index.d.ts +0 -3
  517. package/dist/components/MetricList/index.d.ts.map +0 -1
  518. package/dist/components/MetricList/index.js +0 -3
  519. package/dist/components/MetricList/index.js.map +0 -1
  520. package/dist/components/NavBottom/NavBottom.d.ts +0 -15
  521. package/dist/components/NavBottom/NavBottom.d.ts.map +0 -1
  522. package/dist/components/NavBottom/NavBottom.js +0 -19
  523. package/dist/components/NavBottom/NavBottom.js.map +0 -1
  524. package/dist/components/NavBottom/index.d.ts +0 -3
  525. package/dist/components/NavBottom/index.d.ts.map +0 -1
  526. package/dist/components/NavBottom/index.js +0 -2
  527. package/dist/components/NavBottom/index.js.map +0 -1
  528. package/dist/components/NavSide/NavItem.d.ts +0 -9
  529. package/dist/components/NavSide/NavItem.d.ts.map +0 -1
  530. package/dist/components/NavSide/NavItem.js +0 -13
  531. package/dist/components/NavSide/NavItem.js.map +0 -1
  532. package/dist/components/NavSide/NavSide.d.ts +0 -15
  533. package/dist/components/NavSide/NavSide.d.ts.map +0 -1
  534. package/dist/components/NavSide/NavSide.js +0 -10
  535. package/dist/components/NavSide/NavSide.js.map +0 -1
  536. package/dist/components/NavSide/index.d.ts +0 -3
  537. package/dist/components/NavSide/index.d.ts.map +0 -1
  538. package/dist/components/NavSide/index.js +0 -2
  539. package/dist/components/NavSide/index.js.map +0 -1
  540. package/dist/components/NavSide/types.d.ts +0 -38
  541. package/dist/components/NavSide/types.d.ts.map +0 -1
  542. package/dist/components/NavSide/types.js +0 -2
  543. package/dist/components/NavSide/types.js.map +0 -1
  544. package/dist/components/Pagination/Pagination.d.ts +0 -35
  545. package/dist/components/Pagination/Pagination.d.ts.map +0 -1
  546. package/dist/components/Pagination/Pagination.js +0 -26
  547. package/dist/components/Pagination/Pagination.js.map +0 -1
  548. package/dist/components/Pagination/index.d.ts +0 -3
  549. package/dist/components/Pagination/index.d.ts.map +0 -1
  550. package/dist/components/Pagination/index.js +0 -2
  551. package/dist/components/Pagination/index.js.map +0 -1
  552. package/dist/components/Skeleton/Skeleton.d.ts +0 -3
  553. package/dist/components/Skeleton/Skeleton.d.ts.map +0 -1
  554. package/dist/components/Skeleton/Skeleton.js +0 -7
  555. package/dist/components/Skeleton/Skeleton.js.map +0 -1
  556. package/dist/components/Skeleton/index.d.ts +0 -2
  557. package/dist/components/Skeleton/index.d.ts.map +0 -1
  558. package/dist/components/Skeleton/index.js +0 -2
  559. package/dist/components/Skeleton/index.js.map +0 -1
  560. package/dist/components/StatsCard/StatsCard.d.ts +0 -17
  561. package/dist/components/StatsCard/StatsCard.d.ts.map +0 -1
  562. package/dist/components/StatsCard/StatsCard.js +0 -13
  563. package/dist/components/StatsCard/StatsCard.js.map +0 -1
  564. package/dist/components/StatsCard/index.d.ts +0 -2
  565. package/dist/components/StatsCard/index.d.ts.map +0 -1
  566. package/dist/components/StatsCard/index.js +0 -2
  567. package/dist/components/StatsCard/index.js.map +0 -1
  568. package/dist/styles.css +0 -2
  569. package/dist/theme.generated.css +0 -438
  570. package/src/components/Avatar/Avatar.tsx +0 -19
  571. package/src/components/Avatar/index.ts +0 -1
  572. package/src/components/Breadcrumb/Breadcrumb.tsx +0 -47
  573. package/src/components/Breadcrumb/index.ts +0 -5
  574. package/src/components/ColorDot/ColorDot.tsx +0 -50
  575. package/src/components/ColorDot/index.ts +0 -1
  576. package/src/components/EmptyState/EmptyState.tsx +0 -29
  577. package/src/components/EmptyState/index.ts +0 -1
  578. package/src/components/HeatMap/HeatMapCalendar.tsx +0 -127
  579. package/src/components/HeatMap/HeatMapMatrix.tsx +0 -75
  580. package/src/components/HeatMap/heat-map.utils.ts +0 -15
  581. package/src/components/HeatMap/index.ts +0 -3
  582. package/src/components/MetricList/MetricList.tsx +0 -13
  583. package/src/components/MetricList/MetricRow.tsx +0 -30
  584. package/src/components/MetricList/index.ts +0 -2
  585. package/src/components/NavBottom/NavBottom.tsx +0 -53
  586. package/src/components/NavBottom/index.ts +0 -3
  587. package/src/components/NavSide/NavItem.tsx +0 -39
  588. package/src/components/NavSide/NavSide.tsx +0 -40
  589. package/src/components/NavSide/index.ts +0 -2
  590. package/src/components/NavSide/types.ts +0 -36
  591. package/src/components/Pagination/Pagination.tsx +0 -86
  592. package/src/components/Pagination/index.ts +0 -2
  593. package/src/components/Skeleton/Skeleton.tsx +0 -7
  594. package/src/components/Skeleton/index.ts +0 -1
  595. package/src/components/StatsCard/StatsCard.tsx +0 -40
  596. package/src/components/StatsCard/index.ts +0 -1
  597. package/src/styles/base.css +0 -41
  598. package/src/theme/palette.json +0 -100
  599. package/src/theme/palette.schema.json +0 -40
  600. package/src/theme/theme.json +0 -349
  601. package/src/theme/theme.schema.json +0 -876
  602. package/src/theme/typography.json +0 -7
  603. package/src/theme/typography.schema.json +0 -36
  604. package/tailwind.config.ts +0 -261
@@ -1,9 +1,20 @@
1
1
  import type React from "react";
2
2
  import type { WritableRefObject } from "../../internal/types.js";
3
+ /**
4
+ * Options are addressed by id, not by focus: the listbox (or the search input)
5
+ * keeps focus and points `aria-activedescendant` at the highlighted option, so
6
+ * both sides need to agree on the id.
7
+ */
8
+ export declare const selectOptionId: (listboxId: string, index: number) => string;
3
9
  interface SelectDropdownProps<T extends string> {
4
10
  setFloating: (node: HTMLElement | null) => void;
5
11
  listboxId: string;
6
- listboxRef: WritableRefObject<HTMLDivElement | null>;
12
+ /** Publishes the listbox node upward — Select focuses it and scrolls it. */
13
+ setListbox: (node: HTMLDivElement | null) => void;
14
+ /** Names the listbox — a bare `role="listbox"` has no accessible name. */
15
+ label: string;
16
+ /** The highlighted option's id, or undefined when nothing is highlighted. */
17
+ activeOptionId: string | undefined;
7
18
  floatingStyles: React.CSSProperties;
8
19
  displayOptions: readonly {
9
20
  value: T;
@@ -16,7 +27,8 @@ interface SelectDropdownProps<T extends string> {
16
27
  multiple: boolean;
17
28
  onSelect: (value: T) => void;
18
29
  onHighlight: (index: number) => void;
30
+ onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
19
31
  }
20
- export declare const SelectDropdown: <T extends string>({ setFloating, listboxId, listboxRef, floatingStyles, displayOptions, highlightedIndex, selectedValues, searchValue, optionRefs, multiple, onSelect, onHighlight, }: SelectDropdownProps<T>) => React.JSX.Element;
32
+ export declare const SelectDropdown: <T extends string>({ setFloating, listboxId, setListbox, label, activeOptionId, floatingStyles, displayOptions, highlightedIndex, selectedValues, searchValue, optionRefs, multiple, onSelect, onHighlight, onKeyDown, }: SelectDropdownProps<T>) => React.JSX.Element;
21
33
  export {};
22
34
  //# sourceMappingURL=SelectDropdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/Select/SelectDropdown.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,UAAU,mBAAmB,CAAC,CAAC,SAAS,MAAM;IAC5C,WAAW,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,iBAAiB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACrD,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,cAAc,EAAE,SAAS;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvD,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,iBA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AM,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAC9D,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CAC9D;AAED,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,yMAgB5C,mBAAmB,CAAC,CAAC,CAAC,sBAwExB,CAAC"}
@@ -2,16 +2,32 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { FloatingPortal } from "@floating-ui/react";
3
3
  import { cn } from "@sixthshift/design-system/utils";
4
4
  import { Check } from "lucide-react";
5
- export const SelectDropdown = ({ setFloating, listboxId, listboxRef, floatingStyles, displayOptions, highlightedIndex, selectedValues, searchValue, optionRefs, multiple, onSelect, onHighlight, }) => (_jsx(FloatingPortal, { children: _jsx("div", { ref: (node) => {
5
+ /**
6
+ * Options are addressed by id, not by focus: the listbox (or the search input)
7
+ * keeps focus and points `aria-activedescendant` at the highlighted option, so
8
+ * both sides need to agree on the id.
9
+ */
10
+ export const selectOptionId = (listboxId, index) => `${listboxId}-option-${index}`;
11
+ export const SelectDropdown = ({ setFloating, listboxId, setListbox, label, activeOptionId, floatingStyles, displayOptions, highlightedIndex, selectedValues, searchValue, optionRefs, multiple, onSelect, onHighlight, onKeyDown, }) => (_jsx(FloatingPortal, { children: _jsx("div", { ref: (node) => {
6
12
  setFloating(node);
7
- listboxRef.current = node;
8
- }, id: listboxId, role: "listbox", "aria-multiselectable": multiple || undefined, tabIndex: -1, style: floatingStyles, className: "z-popover max-h-60 overflow-y-auto rounded-md border border-border-normal bg-bg-normal shadow-lg", children: displayOptions.length === 0 ? (_jsx("div", { className: "px-3 py-2 text-center text-fg-subtle text-sm", children: searchValue ? `No results for "${searchValue}"` : "No options available" })) : (displayOptions.map((option, index) => {
13
+ setListbox(node);
14
+ }, id: listboxId, role: "listbox", "aria-label": label, "aria-multiselectable": multiple || undefined, "aria-activedescendant": activeOptionId,
15
+ // Focus lands here when the dropdown opens (the searchable variant keeps
16
+ // it in the input instead), which is what makes `aria-activedescendant`
17
+ // and the scoped keydown handler work.
18
+ tabIndex: -1, onKeyDown: onKeyDown, style: floatingStyles, className: "select-dropdown border-(color:--select-dropdown-border) z-popover max-h-60 overflow-y-auto rounded-md border bg-(--select-dropdown-bg) shadow-lg", children: displayOptions.length === 0 ? (_jsx("div", { className: "px-3 py-2 text-center text-(--select-dropdown-empty-fg) text-sm", children: searchValue ? `No results for "${searchValue}"` : "No options available" })) : (displayOptions.map((option, index) => {
9
19
  const isSelected = selectedValues.has(option.value);
20
+ const isHighlighted = highlightedIndex === index;
10
21
  return (_jsxs("button", { ref: (el) => {
11
22
  if (el)
12
23
  optionRefs.current.set(index, el);
13
24
  else
14
25
  optionRefs.current.delete(index);
15
- }, type: "button", role: "option", "aria-selected": isSelected, onClick: () => onSelect(option.value), onMouseEnter: () => onHighlight(index), className: cn(`flex w-full cursor-pointer items-center px-3 py-2 text-fg-normal text-sm transition-colors`, multiple && "gap-2", highlightedIndex === index && "bg-bg-subtle", isSelected ? "font-medium text-fg-normal" : "text-fg-subtle"), children: [multiple && (_jsx("span", { className: cn("flex h-4 w-4 shrink-0 items-center justify-center rounded-xs border", isSelected ? "border-border-brand bg-bg-brand text-fg-on-brand" : "border-border-normal"), children: isSelected && _jsx(Check, { className: "h-3 w-3" }) })), option.label] }, option.value));
26
+ }, type: "button", id: selectOptionId(listboxId, index), role: "option", "aria-selected": isSelected, "data-highlighted": isHighlighted ? "true" : undefined,
27
+ // The options are not tab stops and must not steal focus: the
28
+ // listbox holds it and delegates via aria-activedescendant, so a
29
+ // click that moved focus onto the option would strand the keyboard
30
+ // handler with nothing listening.
31
+ tabIndex: -1, onMouseDown: (event) => event.preventDefault(), onClick: () => onSelect(option.value), onMouseEnter: () => onHighlight(index), className: cn(`select-option flex w-full cursor-pointer items-center bg-(--select-option-bg) px-3 py-2 text-(--select-option-fg) text-sm transition-colors`, multiple && "gap-2", isSelected && "font-medium"), children: [multiple && (_jsx("span", { "data-selected": isSelected ? "true" : undefined, className: "select-option-indicator border-(color:--select-option-indicator-border) flex h-4 w-4 shrink-0 items-center justify-center rounded-xs border bg-(--select-option-indicator-bg) text-(--select-option-indicator-fg)", children: isSelected && _jsx(Check, { className: "h-3 w-3" }) })), option.label] }, option.value));
16
32
  })) }) }));
17
33
  //# sourceMappingURL=SelectDropdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectDropdown.js","sourceRoot":"","sources":["../../../src/components/Select/SelectDropdown.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAmBrC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAmB,EAC/C,WAAW,EACX,SAAS,EACT,UAAU,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,WAAW,GACY,EAAE,EAAE,CAAC,CAC5B,KAAC,cAAc,cACb,cACE,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;YACZ,WAAW,CAAC,IAAI,CAAC,CAAC;YAClB,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;QAC5B,CAAC,EACD,EAAE,EAAE,SAAS,EACb,IAAI,EAAC,SAAS,0BACQ,QAAQ,IAAI,SAAS,EAC3C,QAAQ,EAAE,CAAC,CAAC,EACZ,KAAK,EAAE,cAAc,EACrB,SAAS,EAAC,kGAAkG,YAE3G,cAAc,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAC7B,cAAK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
- import type { HTMLAttributes } from "react";
1
+ import type { HTMLAttributes, Ref } from "react";
2
2
  interface SelectTriggerButtonProps {
3
3
  setReference: (node: HTMLElement | null) => void;
4
+ /** Consumer ref from Select, attached to this trigger's root element. */
5
+ rootRef?: Ref<HTMLDivElement>;
4
6
  listboxId: string;
5
7
  open: boolean;
6
8
  disabled: boolean;
@@ -13,10 +15,14 @@ interface SelectTriggerButtonProps {
13
15
  onClear: (e: React.MouseEvent) => void;
14
16
  props: HTMLAttributes<HTMLElement>;
15
17
  }
16
- export declare const SelectTriggerButton: ({ setReference, listboxId, open, disabled, collapsed, displayLabel, showClearButton, className, onToggle, onKeyDown, onClear, props, }: SelectTriggerButtonProps) => import("react").JSX.Element;
18
+ export declare const SelectTriggerButton: ({ setReference, rootRef, listboxId, open, disabled, collapsed, displayLabel, showClearButton, className, onToggle, onKeyDown, onClear, props, }: SelectTriggerButtonProps) => import("react").JSX.Element;
17
19
  interface SelectTriggerSearchProps {
18
20
  setReference: (node: HTMLElement | null) => void;
21
+ /** Consumer ref from Select, attached to this trigger's root element. */
22
+ rootRef?: Ref<HTMLDivElement>;
19
23
  listboxId: string;
24
+ /** Id of the highlighted option — the input keeps focus and delegates to it. */
25
+ activeOptionId: string | undefined;
20
26
  inputRef: React.RefObject<HTMLInputElement | null>;
21
27
  searchValue: string;
22
28
  disabled: boolean;
@@ -24,8 +30,9 @@ interface SelectTriggerSearchProps {
24
30
  open: boolean;
25
31
  className: string | undefined;
26
32
  onSearchChange: (value: string) => void;
33
+ onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
27
34
  props: React.InputHTMLAttributes<HTMLInputElement>;
28
35
  }
29
- export declare const SelectTriggerSearch: ({ setReference, listboxId, inputRef, searchValue, disabled, displayLabel, open, className, onSearchChange, props, }: SelectTriggerSearchProps) => import("react").JSX.Element;
36
+ export declare const SelectTriggerSearch: ({ setReference, rootRef, listboxId, activeOptionId, inputRef, searchValue, disabled, displayLabel, open, className, onSearchChange, onKeyDown, props, }: SelectTriggerSearchProps) => import("react").JSX.Element;
30
37
  export {};
31
38
  //# sourceMappingURL=SelectTrigger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectTrigger.d.ts","sourceRoot":"","sources":["../../../src/components/Select/SelectTrigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,UAAU,wBAAwB;IAChC,YAAY,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACnE,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACvC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,mBAAmB,2IAa7B,wBAAwB,gCAmD1B,CAAC;AAEF,UAAU,wBAAwB;IAChC,YAAY,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC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AAM,CAAC;IAClB,gFAAgF;IAChF,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC7D,KAAK,EAAE,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,mBAAmB,4JAc7B,wBAAwB,gCA+B1B,CAAC"}
@@ -1,12 +1,21 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn } from "@sixthshift/design-system/utils";
3
3
  import { ChevronDown, X } from "lucide-react";
4
- export const SelectTriggerButton = ({ setReference, listboxId, open, disabled, collapsed, displayLabel, showClearButton, className, onToggle, onKeyDown, onClear, props, }) => {
4
+ export const SelectTriggerButton = ({ setReference, rootRef, listboxId, open, disabled, collapsed, displayLabel, showClearButton, className, onToggle, onKeyDown, onClear, props, }) => {
5
5
  // The clear button must be a sibling of the trigger, not a descendant: nesting
6
6
  // one interactive control inside another is invalid HTML and leaves assistive
7
7
  // tech unable to reach the inner control (axe: nested-interactive).
8
8
  const showClear = showClearButton && !collapsed;
9
- return (_jsxs("div", { className: "relative w-full", children: [_jsx("button", { ref: setReference, type: "button", onClick: onToggle, onKeyDown: onKeyDown, disabled: disabled, className: cn(`flex w-full cursor-pointer items-center gap-2 rounded-md border border-border-normal bg-bg-normal px-3 py-2 font-medium text-fg-normal text-sm transition-colors hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring disabled:cursor-not-allowed disabled:opacity-50`, collapsed ? "justify-center" : "justify-between", showClear && "pr-9", className), title: collapsed ? displayLabel : undefined, "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": open ? listboxId : undefined, ...props, children: collapsed ? (_jsx("span", { className: "font-bold text-xs", children: displayLabel.charAt(0) })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "truncate", children: displayLabel }), _jsx("span", { className: "flex shrink-0 items-center gap-1", children: _jsx(ChevronDown, { className: cn("h-4 w-4 text-fg-subtle transition-transform", open && "rotate-180") }) })] })) }), showClear && (_jsx("button", { type: "button", onClick: onClear, disabled: disabled, className: "absolute top-1/2 right-8 -translate-y-1/2 rounded-sm p-0.5 text-fg-subtle hover:bg-bg-subtle hover:text-fg-normal focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring", "aria-label": "Clear selection", children: _jsx(X, { className: "h-3.5 w-3.5" }) }))] }));
9
+ return (_jsxs("div", { ref: rootRef, className: "select-trigger relative w-full", children: [_jsx("button", { ref: setReference, type: "button", onClick: onToggle, onKeyDown: onKeyDown, disabled: disabled, className: cn(`border-(color:--select-trigger-border) focus-visible:ring-(color:--select-trigger-ring) flex w-full cursor-pointer items-center gap-2 rounded-md border bg-(--select-trigger-bg) px-3 py-2 font-medium text-(--select-trigger-fg) text-sm transition-colors hover:bg-(--select-trigger-bg-hovered) focus-visible:outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50`, collapsed ? "justify-center" : "justify-between", showClear && "pr-9", className), title: collapsed ? displayLabel : undefined, "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": open ? listboxId : undefined, ...props, children: collapsed ? (_jsx("span", { className: "font-bold text-xs", children: displayLabel.charAt(0) })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "truncate", children: displayLabel }), _jsx("span", { className: "flex shrink-0 items-center gap-1", children: _jsx(ChevronDown, { className: cn("h-4 w-4 text-(--select-trigger-icon-fg) transition-transform", open && "rotate-180") }) })] })) }), showClear && (_jsx("button", { type: "button", onClick: onClear, disabled: disabled, className: "select-trigger-clear focus-visible:ring-(color:--select-trigger-ring) absolute top-1/2 right-8 -translate-y-1/2 rounded-sm p-0.5 text-(--select-trigger-clear-fg) hover:bg-(--select-trigger-clear-bg-hovered) hover:text-(--select-trigger-clear-fg-hovered) focus-visible:outline-none focus-visible:ring-2", "aria-label": "Clear selection", children: _jsx(X, { className: "h-3.5 w-3.5" }) }))] }));
10
10
  };
11
- export const SelectTriggerSearch = ({ setReference, listboxId, inputRef, searchValue, disabled, displayLabel, open, className, onSearchChange, props, }) => (_jsxs("div", { ref: setReference, className: cn("relative flex w-full items-center", className), children: [_jsx("input", { ref: inputRef, type: "text", value: searchValue, onChange: (e) => onSearchChange(e.target.value), placeholder: displayLabel, disabled: disabled, className: cn(`flex-1 rounded-md border border-border-normal bg-bg-normal px-3 py-2 font-medium text-fg-normal text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring disabled:cursor-not-allowed disabled:opacity-50`), role: "combobox", "aria-expanded": open, "aria-controls": listboxId, "aria-autocomplete": "list", ...props }), _jsx(ChevronDown, { className: "pointer-events-none absolute right-3 h-4 w-4 text-fg-subtle" })] }));
11
+ export const SelectTriggerSearch = ({ setReference, rootRef, listboxId, activeOptionId, inputRef, searchValue, disabled, displayLabel, open, className, onSearchChange, onKeyDown, props, }) => (
12
+ // floating-ui anchors to this element and the consumer may also want it, so
13
+ // both refs run off one callback rather than one silently winning.
14
+ _jsxs("div", { ref: (node) => {
15
+ setReference(node);
16
+ if (typeof rootRef === "function")
17
+ rootRef(node);
18
+ else if (rootRef)
19
+ rootRef.current = node;
20
+ }, className: cn("select-trigger relative flex w-full items-center", className), children: [_jsx("input", { ref: inputRef, type: "text", value: searchValue, onChange: (e) => onSearchChange(e.target.value), onKeyDown: onKeyDown, placeholder: displayLabel, disabled: disabled, className: cn(`border-(color:--select-trigger-border) focus-visible:ring-(color:--select-trigger-ring) flex-1 rounded-md border bg-(--select-trigger-bg) px-3 py-2 font-medium text-(--select-trigger-fg) text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50`), role: "combobox", "aria-expanded": open, "aria-controls": listboxId, "aria-activedescendant": activeOptionId, "aria-autocomplete": "list", ...props }), _jsx(ChevronDown, { className: "pointer-events-none absolute right-3 h-4 w-4 text-(--select-trigger-icon-fg)" })] }));
12
21
  //# sourceMappingURL=SelectTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectTrigger.js","sourceRoot":"","sources":["../../../src/components/Select/SelectTrigger.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAkB9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,YAAY,EACZ,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,eAAe,EACf,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,GACoB,EAAE,EAAE;IAC7B,+EAA+E;IAC/E,8EAA8E;IAC9E,oEAAoE;IACpE,MAAM,SAAS,GAAG,eAAe,IAAI,CAAC,SAAS,CAAC;IAEhD,OAAO,CACL,eAAK,SAAS,EAAC,iBAAiB,aAC9B,iBACE,GAAG,EAAE,YAAY,EACjB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,mTAAmT,EACnT,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,iBAAiB,EAChD,SAAS,IAAI,MAAM,EACnB,SAAS,CACV,EACD,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,YAA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,CAC1P,EACD,IAAI,EAAC,UAAU,mBACA,IAAI,mBACJ,SAAS,uBACN,MAAM,KACpB,KAAK,GACT,EACF,KAAC,WAAW,IAAC,SAAS,EAAC,6DAA6D,GAAG,IACnF,CACP,CAAC"}
1
+ {"version":3,"file":"SelectTrigger.js","sourceRoot":"","sources":["../../../src/components/Select/SelectTrigger.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAqB9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,YAAY,EACZ,OAAO,EACP,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,eAAe,EACf,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,GACoB,EAAE,EAAE;IAC7B,+EAA+E;IAC/E,8EAA8E;IAC9E,oEAAoE;IACpE,MAAM,SAAS,GAAG,eAAe,IAAI,CAAC,SAAS,CAAC;IAEhD,OAAO,CACL,eAAK,GAAG,EAAE,OAAO,EAAE,SAAS,EAAC,gCAAgC,aAC3D,iBACE,GAAG,EAAE,YAAY,EACjB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,oYAAoY,EACpY,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,iBAAiB,EAChD,SAAS,IAAI,MAAM,EACnB,SAAS,CACV,EACD,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,mBAC7B,SAAS,mBACR,IAAI,mBAEJ,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,KACvC,KAAK,YAER,SAAS,CAAC,CAAC,CAAC,CACX,eAAM,SAAS,EAAC,m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/C,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,YAAY,EACzB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,sTAAsT,CACvT,EACD,IAAI,EAAC,UAAU,mBACA,IAAI,mBACJ,SAAS,2BACD,cAAc,uBACnB,MAAM,KACpB,KAAK,GACT,EACF,KAAC,WAAW,IAAC,SAAS,EAAC,8EAA8E,GAAG,IACpG,CACP,CAAC"}
@@ -11,6 +11,20 @@ interface UseSelectKeyboardOptions<T extends string> {
11
11
  handleSelect: (value: T) => void;
12
12
  focusTrigger: () => void;
13
13
  }
14
- export declare function useSelectKeyboard<T extends string>({ open, searchable, searchValue, highlightedIndex, displayOptions, setOpen, setHighlightedIndex, setSearchValue, handleSelect, focusTrigger, }: UseSelectKeyboardOptions<T>): void;
14
+ /**
15
+ * Returns the keydown handler for an open Select. It is attached to the element
16
+ * that actually holds focus — the listbox, or the search input in searchable
17
+ * mode — rather than to `document`.
18
+ *
19
+ * A document-level listener fired for every keystroke on the page while any
20
+ * Select was open, which meant a Select could swallow Escape or an arrow key
21
+ * from an overlay stacked above it, and two open Selects raced each other. It
22
+ * also decoupled key handling from focus, so nothing guaranteed the element the
23
+ * user was typing into was the one being navigated. Scoping the handler to the
24
+ * focused element makes both problems structurally impossible and is what lets
25
+ * `aria-activedescendant` mean something: the focused element owns the active
26
+ * option.
27
+ */
28
+ export declare function useSelectKeyboard<T extends string>({ open, searchable, searchValue, highlightedIndex, displayOptions, setOpen, setHighlightedIndex, setSearchValue, handleSelect, focusTrigger, }: UseSelectKeyboardOptions<T>): (event: React.KeyboardEvent<HTMLElement>) => void;
15
29
  export {};
16
30
  //# sourceMappingURL=useSelectKeyboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSelectKeyboard.d.ts","sourceRoot":"","sources":["../../../src/components/Select/useSelectKeyboard.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,UAA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C,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAClE,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,YAAY,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IACjC,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,EAClD,IAAI,EACJ,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,YAAY,GACb,EAAE,wBAAwB,CAAC,CAAC,CAAC,WAElB,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,UA6E3C"}
@@ -1,77 +1,85 @@
1
- import { useEffect } from "react";
1
+ import { useCallback } from "react";
2
+ /**
3
+ * Returns the keydown handler for an open Select. It is attached to the element
4
+ * that actually holds focus — the listbox, or the search input in searchable
5
+ * mode — rather than to `document`.
6
+ *
7
+ * A document-level listener fired for every keystroke on the page while any
8
+ * Select was open, which meant a Select could swallow Escape or an arrow key
9
+ * from an overlay stacked above it, and two open Selects raced each other. It
10
+ * also decoupled key handling from focus, so nothing guaranteed the element the
11
+ * user was typing into was the one being navigated. Scoping the handler to the
12
+ * focused element makes both problems structurally impossible and is what lets
13
+ * `aria-activedescendant` mean something: the focused element owns the active
14
+ * option.
15
+ */
2
16
  export function useSelectKeyboard({ open, searchable, searchValue, highlightedIndex, displayOptions, setOpen, setHighlightedIndex, setSearchValue, handleSelect, focusTrigger, }) {
3
- useEffect(() => {
4
- const handleKeyDown = (event) => {
5
- if (!open)
6
- return;
7
- const isTyping = searchable && event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;
8
- if (isTyping)
9
- return;
10
- switch (event.key) {
11
- case "Escape":
12
- event.preventDefault();
13
- if (searchable && searchValue) {
14
- setSearchValue("");
15
- setHighlightedIndex(0);
16
- }
17
- else {
18
- setOpen(false);
19
- focusTrigger();
20
- }
21
- break;
22
- case "ArrowDown":
23
- event.preventDefault();
24
- setHighlightedIndex((prev) => (prev < displayOptions.length - 1 ? prev + 1 : prev));
25
- break;
26
- case "ArrowUp":
27
- event.preventDefault();
28
- setHighlightedIndex((prev) => (prev > 0 ? prev - 1 : prev));
29
- break;
30
- case "Home":
31
- event.preventDefault();
17
+ return useCallback((event) => {
18
+ if (!open)
19
+ return;
20
+ const isTyping = searchable && event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;
21
+ if (isTyping)
22
+ return;
23
+ switch (event.key) {
24
+ case "Escape":
25
+ event.preventDefault();
26
+ if (searchable && searchValue) {
27
+ setSearchValue("");
32
28
  setHighlightedIndex(0);
33
- break;
34
- case "End":
35
- event.preventDefault();
36
- setHighlightedIndex(displayOptions.length - 1);
37
- break;
38
- case "Enter":
29
+ }
30
+ else {
31
+ setOpen(false);
32
+ focusTrigger();
33
+ }
34
+ break;
35
+ case "ArrowDown":
36
+ event.preventDefault();
37
+ setHighlightedIndex((prev) => (prev < displayOptions.length - 1 ? prev + 1 : prev));
38
+ break;
39
+ case "ArrowUp":
40
+ event.preventDefault();
41
+ setHighlightedIndex((prev) => (prev > 0 ? prev - 1 : prev));
42
+ break;
43
+ case "Home":
44
+ event.preventDefault();
45
+ setHighlightedIndex(0);
46
+ break;
47
+ case "End":
48
+ event.preventDefault();
49
+ setHighlightedIndex(displayOptions.length - 1);
50
+ break;
51
+ case "Enter":
52
+ event.preventDefault();
53
+ if (highlightedIndex >= 0 && highlightedIndex < displayOptions.length) {
54
+ handleSelect(displayOptions[highlightedIndex].value);
55
+ }
56
+ break;
57
+ case " ":
58
+ if (!searchable) {
39
59
  event.preventDefault();
40
60
  if (highlightedIndex >= 0 && highlightedIndex < displayOptions.length) {
41
61
  handleSelect(displayOptions[highlightedIndex].value);
42
62
  }
43
- break;
44
- case " ":
45
- if (!searchable) {
46
- event.preventDefault();
47
- if (highlightedIndex >= 0 && highlightedIndex < displayOptions.length) {
48
- handleSelect(displayOptions[highlightedIndex].value);
49
- }
63
+ }
64
+ break;
65
+ case "Tab":
66
+ setOpen(false);
67
+ break;
68
+ default:
69
+ if (!searchable && event.key.length === 1) {
70
+ const letter = event.key.toLowerCase();
71
+ const startIndex = highlightedIndex + 1;
72
+ const matchIndex = displayOptions.findIndex((opt, idx) => idx >= startIndex && opt.label.toLowerCase().startsWith(letter));
73
+ if (matchIndex >= 0) {
74
+ setHighlightedIndex(matchIndex);
50
75
  }
51
- break;
52
- case "Tab":
53
- setOpen(false);
54
- break;
55
- default:
56
- if (!searchable && event.key.length === 1) {
57
- const letter = event.key.toLowerCase();
58
- const startIndex = highlightedIndex + 1;
59
- const matchIndex = displayOptions.findIndex((opt, idx) => idx >= startIndex && opt.label.toLowerCase().startsWith(letter));
60
- if (matchIndex >= 0) {
61
- setHighlightedIndex(matchIndex);
62
- }
63
- else {
64
- const wrapMatchIndex = displayOptions.findIndex((opt) => opt.label.toLowerCase().startsWith(letter));
65
- if (wrapMatchIndex >= 0) {
66
- setHighlightedIndex(wrapMatchIndex);
67
- }
76
+ else {
77
+ const wrapMatchIndex = displayOptions.findIndex((opt) => opt.label.toLowerCase().startsWith(letter));
78
+ if (wrapMatchIndex >= 0) {
79
+ setHighlightedIndex(wrapMatchIndex);
68
80
  }
69
81
  }
70
- }
71
- };
72
- if (open) {
73
- document.addEventListener("keydown", handleKeyDown);
74
- return () => document.removeEventListener("keydown", handleKeyDown);
82
+ }
75
83
  }
76
84
  }, [open, searchable, searchValue, highlightedIndex, displayOptions, setOpen, setHighlightedIndex, setSearchValue, handleSelect, focusTrigger]);
77
85
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useSelectKeyboard.js","sourceRoot":"","sources":["../../../src/components/Select/useSelectKeyboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAgBlC,MAAM,UAAU,iBAAiB,CAAmB,EACl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AAC;wBACrG,IAAI,cAAc,IAAI,CAAC,EAAE,CAAC;4BACxB,mBAAmB,CAAC,cAAc,CAAC,CAAC;wBACtC,CAAC;oBACH,CAAC;gBACH,CAAC;QACL,CAAC;IACH,CAAC,EACD,CAAC,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,CAAC,CAC5I,CAAC;AACJ,CAAC"}
@@ -3,6 +3,16 @@ export type SeparatorProps = React.HTMLAttributes<HTMLDivElement> & {
3
3
  orientation?: "horizontal" | "vertical";
4
4
  decorative?: boolean;
5
5
  };
6
+ /**
7
+ * Thin dividing line, horizontal or vertical (`orientation`, default
8
+ * `"horizontal"`). Renders a `<div>`, not `<hr>`.
9
+ *
10
+ * `decorative` (default `true`) controls whether it is exposed to assistive
11
+ * tech: decorative renders `role="none"` and no `aria-orientation`, so it is
12
+ * invisible to a screen reader; set `decorative={false}` for a divider that
13
+ * is actually part of the content's structure (e.g. between menu sections),
14
+ * which renders `role="separator"` and `aria-orientation` instead.
15
+ */
6
16
  declare const Separator: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
7
17
  orientation?: "horizontal" | "vertical";
8
18
  decorative?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Separator.d.ts","sourceRoot":"","sources":["../../../src/components/Separator/Separator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IAClE,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,QAAA,MAAM,SAAS;kBAJC,YAAY,GAAG,UAAU;iBAC1B,OAAO;wCAWpB,CAAC;AAGH,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"Separator.d.ts","sourceRoot":"","sources":["../../../src/components/Separator/Separator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IAClE,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;;;GASG;AACH,QAAA,MAAM,SAAS;kBAdC,YAAY,GAAG,UAAU;iBAC1B,OAAO;wCAqBpB,CAAC;AAGH,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,6 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cn } from "@sixthshift/design-system/utils";
3
3
  import * as React from "react";
4
+ /**
5
+ * Thin dividing line, horizontal or vertical (`orientation`, default
6
+ * `"horizontal"`). Renders a `<div>`, not `<hr>`.
7
+ *
8
+ * `decorative` (default `true`) controls whether it is exposed to assistive
9
+ * tech: decorative renders `role="none"` and no `aria-orientation`, so it is
10
+ * invisible to a screen reader; set `decorative={false}` for a divider that
11
+ * is actually part of the content's structure (e.g. between menu sections),
12
+ * which renders `role="separator"` and `aria-orientation` instead.
13
+ */
4
14
  const Separator = React.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => (_jsx("div", { ref: ref, role: decorative ? "none" : "separator", ...(!decorative && { "aria-orientation": orientation }), className: cn("shrink-0 bg-border-normal", orientation === "horizontal" ? "h-px w-full" : "h-full w-px", className), ...props })));
5
15
  Separator.displayName = "Separator";
6
16
  export { Separator };
@@ -1 +1 @@
1
- {"version":3,"file":"Separator.js","sourceRoot":"","sources":["../../../src/components/Separator/Separator.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,SAAS,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AAK,GACT,CACH,CAAC,CAAC;AACH,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { type HTMLAttributes, type ReactNode } from "react";
2
- export type SheetProps = Pick<HTMLAttributes<HTMLDivElement>, "className" | "style"> & {
2
+ export type SheetProps = Pick<HTMLAttributes<HTMLDivElement>, "className" | "style" | "aria-label" | "aria-labelledby" | "aria-describedby"> & {
3
3
  /** Whether the sheet is open. Sheet owns its own mount lifecycle so exit animations can play. */
4
4
  open: boolean;
5
5
  /** Called when the sheet requests a state change (Esc, outside press, X button). */
@@ -17,10 +17,30 @@ export type SheetProps = Pick<HTMLAttributes<HTMLDivElement>, "className" | "sty
17
17
  /** Children — use Sheet.Header, Sheet.Body, Sheet.Footer */
18
18
  children: ReactNode;
19
19
  };
20
- export declare const Sheet: {
21
- ({ open, onOpenChange, side, size, dismissable, dismissOnOutsidePress, closable, className, style, children, }: SheetProps): import("react").JSX.Element | null;
22
- displayName: string;
23
- } & {
20
+ /**
21
+ * NOTE: Storybook shows the copy in Sheet.stories.tsx
22
+ * (`parameters.docs.description.component`), not this comment. react-docgen
23
+ * cannot extract a description from this declaration shape, so keeping a
24
+ * second copy here would only drift. Edit the stories file.
25
+ */
26
+ export declare const Sheet: import("react").ForwardRefExoticComponent<Pick<HTMLAttributes<HTMLDivElement>, "className" | "style" | "aria-describedby" | "aria-label" | "aria-labelledby"> & {
27
+ /** Whether the sheet is open. Sheet owns its own mount lifecycle so exit animations can play. */
28
+ open: boolean;
29
+ /** Called when the sheet requests a state change (Esc, outside press, X button). */
30
+ onOpenChange: (open: boolean) => void;
31
+ /** Which edge the sheet slides in from */
32
+ side?: "right" | "left";
33
+ /** Sheet width on desktop — mobile is always full width */
34
+ size?: "sm" | "md" | "lg";
35
+ /** When true (default), Esc closes the sheet. */
36
+ dismissable?: boolean;
37
+ /** When true, clicking outside the sheet closes it. Defaults to false — Sheet is a persistent workspace, not a transient popover. */
38
+ dismissOnOutsidePress?: boolean;
39
+ /** When true, shows a close (X) button in the header */
40
+ closable?: boolean;
41
+ /** Children — use Sheet.Header, Sheet.Body, Sheet.Footer */
42
+ children: ReactNode;
43
+ } & import("react").RefAttributes<HTMLDivElement>> & {
24
44
  Header: import("react").ForwardRefExoticComponent<import("./components/index.js").SheetHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
25
45
  Body: import("react").ForwardRefExoticComponent<import("./components/index.js").SheetBodyProps & import("react").RefAttributes<HTMLDivElement>>;
26
46
  Footer: import("react").ForwardRefExoticComponent<import("./components/index.js").SheetFooterProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAmC,MAAM,OAAO,CAAC;AAO7F,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG;IACrF,iGAAiG;IACjG,IAAI,EAAE,OAAO,CAAC;IACd,oFAAoF;IACpF,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,0CAA0C;IAC1C,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qIAAqI;IACrI,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4DAA4D;IAC5D,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAwGF,eAAO,MAAM,KAAK;oHA7Ef,UAAU;;;;;;CAiFX,CAAC"}
1
+ {"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAoD,MAAM,OAAO,CAAC;AAO1H,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,YAAY,GAAG,iBAAiB,GAAG,kBAAkB,CAAC,GAAG;IAC7I,iGAAiG;IACjG,IAAI,EAAE,OAAO,CAAC;IACd,oFAAoF;IACpF,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,0CAA0C;IAC1C,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qIAAqI;IACrI,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4DAA4D;IAC5D,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAiIF;;;;;GAKG;AACH,eAAO,MAAM,KAAK;IAvJhB,iGAAiG;UAC3F,OAAO;IACb,oFAAoF;kBACtE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI;IACrC,0CAA0C;WACnC,OAAO,GAAG,MAAM;IACvB,2DAA2D;WACpD,IAAI,GAAG,IAAI,GAAG,IAAI;IACzB,iDAAiD;kBACnC,OAAO;IACrB,qIAAqI;4BAC7G,OAAO;IAC/B,wDAAwD;eAC7C,OAAO;IAClB,4DAA4D;cAClD,SAAS;;;;;CA4InB,CAAC"}
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { FloatingFocusManager, useDismiss, useFloating, useInteractions, useRole } from "@floating-ui/react";
3
3
  import { useMergedFloatingRef, usePresence } from "@sixthshift/design-system/hooks";
4
4
  import { cn } from "@sixthshift/design-system/utils";
5
- import { useCallback, useEffect, useMemo } from "react";
5
+ import { forwardRef, useCallback, useEffect, useId, useMemo, useState } from "react";
6
6
  import { SheetBody, SheetContext, SheetFooter, SheetHeader } from "./components/index.js";
7
7
  // =============================================================================
8
8
  // Size classes
@@ -15,7 +15,7 @@ const sizeClasses = {
15
15
  // =============================================================================
16
16
  // Sheet
17
17
  // =============================================================================
18
- const SheetRoot = ({ open, onOpenChange, side = "right", size = "md", dismissable = true, dismissOnOutsidePress = false, closable, className, style, children, }) => {
18
+ const SheetRoot = forwardRef(({ open, onOpenChange, side = "right", size = "md", dismissable = true, dismissOnOutsidePress = false, closable, className, style, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, }, ref) => {
19
19
  const { ref: presenceRef, state, isMounted, show, hide } = usePresence();
20
20
  // Drive presence from the controlled `open` prop.
21
21
  // When `open` flips to false, we play the exit animation, then unmount.
@@ -37,7 +37,7 @@ const SheetRoot = ({ open, onOpenChange, side = "right", size = "md", dismissabl
37
37
  requestClose();
38
38
  },
39
39
  });
40
- const mergedRef = useMergedFloatingRef(refs, presenceRef);
40
+ const mergedRef = useMergedFloatingRef(refs, presenceRef, ref);
41
41
  const dismiss = useDismiss(context, {
42
42
  enabled: dismissable,
43
43
  escapeKey: true,
@@ -46,17 +46,35 @@ const SheetRoot = ({ open, onOpenChange, side = "right", size = "md", dismissabl
46
46
  });
47
47
  const role = useRole(context, { role: "dialog" });
48
48
  const { getFloatingProps } = useInteractions([dismiss, role]);
49
- const sheetContextValue = useMemo(() => ({ onClose: requestClose, closable }), [requestClose, closable]);
49
+ // Named from its header, same contract as Modal — see SheetContext.
50
+ const titleId = useId();
51
+ const [hasTitle, setHasTitle] = useState(false);
52
+ const registerTitle = useCallback((present) => setHasTitle(present), []);
53
+ // `aria-labelledby` beats `aria-label` in the name computation, so a caller
54
+ // who passes a label must not also be pointed at the header — they would
55
+ // never see their own string win.
56
+ const labelledBy = ariaLabelledBy ?? (ariaLabel || !hasTitle ? undefined : titleId);
57
+ const sheetContextValue = useMemo(() => ({ onClose: requestClose, closable, titleId, registerTitle }), [requestClose, closable, titleId, registerTitle]);
50
58
  if (!isMounted)
51
59
  return null;
52
60
  const isEntering = state === "entering";
53
61
  const isExiting = state === "exiting";
54
- return (_jsx(FloatingFocusManager, { context: context, modal: false, children: _jsx("div", { ref: mergedRef, tabIndex: -1, "data-state": state, "data-side": side, className: cn("fixed top-0 bottom-0 z-sheet flex flex-col overflow-hidden bg-bg-normal outline-hidden", "border-border-normal shadow-lg", side === "right" ? "right-0 border-l" : "left-0 border-r", sizeClasses[size], "max-sm:inset-x-0", isEntering && side === "right" && "animate-slide-right-in", isExiting && side === "right" && "animate-slide-right-out", isEntering && side === "left" && "animate-slide-left-in", isExiting && side === "left" && "animate-slide-left-out", className), style: style, ...getFloatingProps({}), children: _jsx(SheetContext.Provider, { value: sheetContextValue, children: children }) }) }));
55
- };
62
+ return (_jsx(FloatingFocusManager, { context: context, modal: false, children: _jsx("div", { ref: mergedRef,
63
+ // Explicit, though `getFloatingProps` also supplies it from `useRole`:
64
+ // the ARIA attributes below are only valid on a dialog, and static
65
+ // analysis cannot see a role that arrives through a spread. Matches Modal.
66
+ role: "dialog", "aria-label": ariaLabel, "aria-labelledby": labelledBy, "aria-describedby": ariaDescribedBy, tabIndex: -1, "data-state": state, "data-side": side, className: cn("sheet fixed top-0 bottom-0 z-sheet flex flex-col overflow-hidden bg-(--sheet-bg) outline-hidden", "border-(color:--sheet-border) shadow-lg", side === "right" ? "right-0 border-l" : "left-0 border-r", sizeClasses[size], "max-sm:inset-x-0", isEntering && side === "right" && "animate-slide-right-in", isExiting && side === "right" && "animate-slide-right-out", isEntering && side === "left" && "animate-slide-left-in", isExiting && side === "left" && "animate-slide-left-out", className), style: style, ...getFloatingProps({}), children: _jsx(SheetContext.Provider, { value: sheetContextValue, children: children }) }) }));
67
+ });
56
68
  SheetRoot.displayName = "Sheet";
57
69
  // =============================================================================
58
70
  // Compound Component Export
59
71
  // =============================================================================
72
+ /**
73
+ * NOTE: Storybook shows the copy in Sheet.stories.tsx
74
+ * (`parameters.docs.description.component`), not this comment. react-docgen
75
+ * cannot extract a description from this declaration shape, so keeping a
76
+ * second copy here would only drift. Edit the stories file.
77
+ */
60
78
  export const Sheet = Object.assign(SheetRoot, {
61
79
  Header: SheetHeader,
62
80
  Body: SheetBody,
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet.js","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAuC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAyBjF,gFAAgF;AAChF,eAAe;AACf,gFAAgF;AAEhF,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,cAAc;IAClB,EAAE,EAAE,cAAc;IAClB,EAAE,EAAE,cAAc;CACnB,CAAC;AAEF,gFAAgF;AAChF,QAAQ;AACR,gFAAgF;AAEhF,MAAM,SAAS,GAAG,CAAC,EACjB,IAAI,EACJ,YAAY,EACZ,IAAI,GAAG,OAAO,EACd,IAAI,GAAG,IAAI,EACX,WAAW,GAAG,IAAI,EAClB,qBAAqB,GAAG,KAAK,EAC7B,QAAQ,EACR,SAAS,EACT,KAAK,EACL,QAAQ,GACG,EAAE,EAAE;IACf,MAAM,EAAE,GAAG,EAAE,W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ACF,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC;AAEhC,gFAAgF;AAChF,4BAA4B;AAC5B,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE;IAC5C,MAAM,EAAE,WAAW;IACnB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,WAAW;CACpB,CAAC,CAAC"}
@@ -3,6 +3,16 @@ export type OnClose = (event?: MouseEvent<Element> | KeyboardEvent<Element>) =>
3
3
  interface SheetContextValue {
4
4
  onClose: OnClose;
5
5
  closable?: boolean | undefined;
6
+ /**
7
+ * The id `Sheet.Header` stamps on itself so the dialog can name itself from
8
+ * its own title instead of being announced as a bare "dialog".
9
+ */
10
+ titleId?: string;
11
+ /**
12
+ * The header reports its presence — a headerless sheet must not point
13
+ * `aria-labelledby` at an element that never rendered.
14
+ */
15
+ registerTitle?: (present: boolean) => void;
6
16
  }
7
17
  export declare const SheetContext: import("react").Context<SheetContextValue | null>;
8
18
  export declare function useSheetContext(): SheetContextValue;