@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
@@ -3,12 +3,67 @@ import { autoUpdate, FloatingPortal, flip, offset, shift, useClick, useDismiss,
3
3
  import { useControllableState } from "@sixthshift/design-system/hooks";
4
4
  import { cn } from "@sixthshift/design-system/utils";
5
5
  import { Calendar as CalendarIcon, X } from "lucide-react";
6
- import { useCallback, useId, useState } from "react";
7
- import { isPlainDate, today } from "../../date-time/index.js";
8
- import { Calendar } from "../Calendar/index.js";
6
+ import * as React from "react";
7
+ import { useCallback, useId, useMemo, useRef, useState } from "react";
8
+ import { adaptDisabledDates, fromISODate, fromISODateOrUndefined, fromISODateRange, isPlainDate, today, toISODate, toISODateOrUndefined, toISODateRange, } from "../../date-time/index.js";
9
+ import { PickerField } from "../../internal/index.js";
10
+ import { CalendarView } from "../Calendar/CalendarView.js";
11
+ import { isDateDisabled } from "../Calendar/calendar.hooks.js";
12
+ import { DateSegments } from "./DateSegments.js";
9
13
  import { defaultFormatDisplay, getDisplayValue, temporalToISO } from "./datepicker.hooks.js";
10
- export const DatePicker = (props) => {
11
- const { mode = "single", weekStartsOn = 0, minDate, maxDate, disabled, presets, placeholder = "Select date", isDisabled = false, isInvalid = false, name, className, align = "end", clearable = true, } = props;
14
+ /** Widen a public, mode-appropriate ISO value to {@link InternalValue}. */
15
+ function toTemporal(mode, value) {
16
+ if (mode === "multiple")
17
+ return (value ?? []).map(fromISODate);
18
+ if (mode === "range")
19
+ return fromISODateRange(value);
20
+ return fromISODateOrUndefined(value);
21
+ }
22
+ /**
23
+ * A typeable date field and a `Calendar` popover, as one control. `mode`
24
+ * (`"single" | "range" | "multiple"`, default `"single"`) decides the shape of
25
+ * `value`/`defaultValue`/`onChange`: an `ISODate` string, an `ISODateRange`
26
+ * (`{ from?, to? }`), or an `ISODate[]`.
27
+ *
28
+ * In `single` mode the field is three `role="spinbutton"` segments rather than a
29
+ * text box. It is built to be typed straight through: `152026` is January the
30
+ * 5th 2026, because a digit that cannot extend the segment being typed rolls
31
+ * into the next one instead of restarting it. Separators (`/`, `-`, `.`) say
32
+ * done-with-this-one, arrows step a segment, `Backspace` takes back one digit
33
+ * (then clears, then steps back), `Alt+ArrowDown` opens the grid and moves focus
34
+ * there, and a paste fills all three. Segments rather than free
35
+ * text because `08/09` cannot be read without knowing the order: `segmentOrder`
36
+ * (default `mdy`) says which, the labels say it to a screen reader, and no
37
+ * parser has to guess. `range` and `multiple` keep the read-only text trigger —
38
+ * a list of dates has no sensible typed form.
39
+ *
40
+ * Typing and picking move one value. The segments show the draft while the
41
+ * popover is open and the committed value while it is closed, so typing a date
42
+ * moves the grid to it and picking a day shows up in the segments. The commit
43
+ * contract stays single: while the popover is open its Apply/Cancel owns the
44
+ * value (`Enter` in a segment is Apply); while it is closed, a date commits as
45
+ * soon as all three segments describe one. A partial date is never reported —
46
+ * clearing a segment reports `undefined`.
47
+ *
48
+ * Supports both controlled (`value`/`onChange`) and uncontrolled
49
+ * (`defaultValue`) use. Opening the popover seeds a draft from the committed
50
+ * value; picking a date only updates the draft; the footer's Apply commits it
51
+ * and closes, Cancel discards it and reverts to the last committed value. The
52
+ * clear button (hidden when `clearable={false}`) bypasses the draft and
53
+ * commits immediately.
54
+ *
55
+ * `minDate`/`maxDate` bound selectable dates inclusively; `disabled` accepts a
56
+ * single date, a list, or a declarative matcher (before/after/range/weekday)
57
+ * or predicate — see `DisabledDates`. `presets` renders a sidebar of quick
58
+ * picks whose values must match `mode`. When `name` is set, the committed
59
+ * value is mirrored into hidden `<input>`s for native form submission
60
+ * (`name.from`/`name.to` in range mode, `name[]` per entry in multiple mode).
61
+ *
62
+ * Keyboard interaction — arrow keys/Home/End/PageUp/PageDown on the day
63
+ * grid — is inherited from `Calendar`.
64
+ */
65
+ export const DatePicker = React.forwardRef((props, ref) => {
66
+ const { mode = "single", weekStartsOn = 0, minDate, maxDate, disabled, presets, placeholder = "Select date", isDisabled = false, isInvalid = false, name, className, align = "end", clearable = true, segmentOrder = "mdy", } = props;
12
67
  // Get mode-specific props
13
68
  const value = "value" in props ? props.value : undefined;
14
69
  const defaultValue = "defaultValue" in props ? props.defaultValue : undefined;
@@ -16,11 +71,59 @@ export const DatePicker = (props) => {
16
71
  const max = mode === "multiple" && "max" in props ? props.max : undefined;
17
72
  // Open state
18
73
  const [open, setOpen] = useState(false);
74
+ // Whether the day grid should take focus when the popover mounts — true only
75
+ // when the popover was opened from the keyboard. See `openWithGridFocus`.
76
+ const [autoFocusDay, setAutoFocusDay] = useState(false);
77
+ // ---------------------------------------------------------------------------
78
+ // The ISO boundary.
79
+ //
80
+ // Props arrive as canonical ISO strings and callbacks emit them; everything
81
+ // below this block — state, the calendar grid, display formatting — works in
82
+ // Temporal, exactly as before.
83
+ //
84
+ // Each conversion is memoised on the string it derives from. Temporal values
85
+ // have no value identity, so converting unmemoised would hand CalendarView a
86
+ // fresh object every render and invalidate its grid memos. Strings compare by
87
+ // value, which makes this strictly more stable than passing Temporal in.
88
+ // ---------------------------------------------------------------------------
89
+ const temporalMinDate = useMemo(() => fromISODateOrUndefined(minDate), [minDate]);
90
+ const temporalMaxDate = useMemo(() => fromISODateOrUndefined(maxDate), [maxDate]);
91
+ const temporalDisabled = useMemo(() => adaptDisabledDates(disabled), [disabled]);
92
+ const temporalPresets = useMemo(() => {
93
+ if (!presets)
94
+ return undefined;
95
+ if (mode === "single") {
96
+ return presets.map((preset) => ({ label: preset.label, value: fromISODate(preset.value) }));
97
+ }
98
+ if (mode === "multiple") {
99
+ return presets.map((preset) => ({ label: preset.label, value: preset.value.map(fromISODate) }));
100
+ }
101
+ return presets.map((preset) => ({
102
+ label: preset.label,
103
+ value: fromISODateRange(preset.value) ?? { from: undefined, to: undefined },
104
+ }));
105
+ }, [mode, presets]);
106
+ const temporalValue = useMemo(() => toTemporal(mode, value), [mode, value]);
107
+ // Read once, on mount, by useControllableState's useState initialiser.
108
+ const temporalDefaultValue = useMemo(() => toTemporal(mode, defaultValue), [mode, defaultValue]);
109
+ const handleChange = useCallback((next) => {
110
+ if (!onChange)
111
+ return;
112
+ if (mode === "single") {
113
+ onChange(toISODateOrUndefined(next));
114
+ return;
115
+ }
116
+ if (mode === "multiple") {
117
+ onChange((next ?? []).map(toISODate));
118
+ return;
119
+ }
120
+ onChange(toISODateRange(next));
121
+ }, [mode, onChange]);
19
122
  // Controllable value state (external/committed value)
20
123
  const [committedValue, setCommittedValue] = useControllableState({
21
- value: value,
22
- defaultValue: defaultValue,
23
- onChange: onChange,
124
+ value: temporalValue,
125
+ defaultValue: temporalDefaultValue,
126
+ onChange: handleChange,
24
127
  });
25
128
  // Draft value (internal state while popup is open)
26
129
  const [draftValue, setDraftValue] = useState(committedValue);
@@ -29,6 +132,9 @@ export const DatePicker = (props) => {
29
132
  if (newOpen) {
30
133
  setDraftValue(committedValue);
31
134
  }
135
+ else {
136
+ setAutoFocusDay(false);
137
+ }
32
138
  setOpen(newOpen);
33
139
  }, [committedValue]);
34
140
  // Month navigation state (uses Temporal.PlainDate for calendar grid)
@@ -101,10 +207,121 @@ export const DatePicker = (props) => {
101
207
  return { from: undefined, to: undefined };
102
208
  };
103
209
  const rangeFormValues = getRangeFormValues();
104
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cn("relative flex items-center", mode === "range" && "min-w-91.25", mode !== "range" && "min-w-65"), children: [_jsx(CalendarIcon, { className: "pointer-events-none absolute left-3 h-4 w-4 text-fg-subtle" }), _jsx("input", { ref: refs.setReference, id: inputId, type: "text", readOnly: true, value: displayValue, placeholder: placeholder, disabled: isDisabled, role: "combobox", "aria-invalid": isInvalid, "aria-haspopup": "dialog", "aria-expanded": open, "aria-controls": open ? contentId : undefined, className: cn(`flex h-9 w-full cursor-pointer rounded-md border border-border-normal bg-transparent py-1 pl-9 text-sm shadow-xs transition-colors placeholder:text-fg-subtle focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-focus-ring disabled:cursor-not-allowed disabled:opacity-50`, mode === "range" && "min-w-91.25", mode !== "range" && "min-w-65", clearable && hasValue ? "pr-9" : "pr-3", isInvalid && "border-border-danger", className), ...getReferenceProps() }), clearable && hasValue && !isDisabled && (_jsx("button", { type: "button", onClick: handleClear, className: "absolute right-3 rounded-sm p-0.5 text-fg-subtle hover:bg-bg-subtle hover:text-fg-normal focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-focus-ring", "aria-label": "Clear date", children: _jsx(X, { className: "h-3.5 w-3.5" }) })), name && mode === "single" && committedValue && _jsx("input", { type: "hidden", name: name, value: getFormValue() }), name && mode === "range" && committedValue && (_jsxs(_Fragment, { children: [rangeFormValues.from && _jsx("input", { type: "hidden", name: `${name}.from`, value: rangeFormValues.from }), rangeFormValues.to && _jsx("input", { type: "hidden", name: `${name}.to`, value: rangeFormValues.to })] })), name &&
210
+ // ---------------------------------------------------------------------------
211
+ // The typeable field (single mode).
212
+ //
213
+ // One value, two ways to move it. The segments show the draft while the
214
+ // popover is open and the committed value while it is closed, which is what
215
+ // makes typing and clicking feel like one control: type a date and the grid
216
+ // follows it, click a day and the segments follow that. The commit contract
217
+ // stays single — open means the popover's Apply/Cancel owns it, closed means a
218
+ // complete date commits as soon as it is complete.
219
+ // ---------------------------------------------------------------------------
220
+ const segmentSource = open ? draftValue : committedValue;
221
+ const segmentValue = isPlainDate(segmentSource) ? segmentSource : undefined;
222
+ /**
223
+ * A typed date can be one the grid would refuse — nothing stops you typing
224
+ * past `maxDate`. Rather than silently clamping it (which loses what was
225
+ * typed) or refusing it (which strands the field mid-edit), the field says so:
226
+ * `aria-invalid` and the danger border, with the value still reported so the
227
+ * caller's own validation sees the attempt.
228
+ */
229
+ const outOfBounds = useCallback((date) => date !== undefined && isDateDisabled(date, temporalDisabled, temporalMinDate, temporalMaxDate), [temporalDisabled, temporalMaxDate, temporalMinDate]);
230
+ const handleSegmentsChange = useCallback((date) => {
231
+ // Keep the grid on the month being typed, so opening it lands where the
232
+ // user already is rather than on today.
233
+ if (date)
234
+ setMonth(date);
235
+ if (open) {
236
+ setDraftValue(date);
237
+ return;
238
+ }
239
+ setCommittedValue(date);
240
+ }, [open, setCommittedValue]);
241
+ /** `Alt+ArrowDown` from a segment: open the grid *and* go there. */
242
+ const openWithGridFocus = useCallback(() => {
243
+ setAutoFocusDay(true);
244
+ handleOpenChange(true);
245
+ }, [handleOpenChange]);
246
+ /** `Enter` in a segment commits the draft, matching the popover's Apply. */
247
+ const handleFieldSubmit = useCallback(() => {
248
+ if (open)
249
+ handleApply();
250
+ }, [handleApply, open]);
251
+ // ---------------------------------------------------------------------------
252
+ // Range mode: two fields, not one.
253
+ //
254
+ // A range is two dates, and typing one of them should not require knowing
255
+ // where the other ends. Each half is its own segmented field with its own
256
+ // clear button; they share the one popover, which anchors to whichever half
257
+ // you are in so it opens under the date you are editing.
258
+ // ---------------------------------------------------------------------------
259
+ const rangeSource = (open ? draftValue : committedValue);
260
+ const setRangeEnd = useCallback((end, date) => {
261
+ if (date)
262
+ setMonth(date);
263
+ const current = (open ? draftValue : committedValue);
264
+ const next = { from: current?.from, to: current?.to, [end]: date };
265
+ if (open) {
266
+ setDraftValue(next);
267
+ return;
268
+ }
269
+ setCommittedValue(next);
270
+ }, [committedValue, draftValue, open, setCommittedValue]);
271
+ const clearRangeEnd = useCallback((end) => (event) => {
272
+ event.stopPropagation();
273
+ event.preventDefault();
274
+ const existing = committedValue;
275
+ const next = {
276
+ from: end === "from" ? undefined : existing?.from,
277
+ to: end === "to" ? undefined : existing?.to,
278
+ };
279
+ // Clearing the last remaining end clears the range itself, so a consumer
280
+ // gets `undefined` rather than a husk with two empty ends.
281
+ const cleared = !next.from && !next.to;
282
+ setCommittedValue((cleared ? undefined : next));
283
+ }, [committedValue, setCommittedValue]);
284
+ // The popover anchors to the half being edited, so it opens under the date in
285
+ // question rather than under the middle of a wide trigger.
286
+ const rangeHalves = useRef({ from: null, to: null });
287
+ const anchorToHalf = useCallback((end) => {
288
+ const node = rangeHalves.current[end];
289
+ if (node)
290
+ refs.setPositionReference(node);
291
+ }, [refs]);
292
+ /**
293
+ * One end of the range. A render function rather than a component so the
294
+ * fields are not remounted — and so focus is not dropped — on every keystroke.
295
+ */
296
+ const renderRangeHalf = (end, label) => {
297
+ const shown = end === "from" ? rangeSource?.from : rangeSource?.to;
298
+ const settled = end === "from" ? committedValue?.from : committedValue?.to;
299
+ return (_jsx(PickerField, { ref: (node) => {
300
+ rangeHalves.current[end] = node;
301
+ }, onFocusCapture: () => anchorToHalf(end), className: "min-w-45 flex-1", icon: _jsx(CalendarIcon, { className: "h-4 w-4" }), toggleLabel: `Open calendar for ${label.toLowerCase()}`,
302
+ // Both handlers have to run: Floating UI's opens the popover, and ours
303
+ // points it at this half. Spreading after `onClick` would drop ours on
304
+ // the floor, which is how the popover ended up anchored to the whole
305
+ // trigger.
306
+ toggleProps: getReferenceProps({ onClick: () => anchorToHalf(end) }), isOpen: open, contentId: contentId, isDisabled: isDisabled, isInvalid: isInvalid || outOfBounds(shown), onClear: clearable && settled && !isDisabled ? clearRangeEnd(end) : undefined, clearLabel: `Clear ${label.toLowerCase()}`, children: _jsx(DateSegments, { className: "h-full flex-1", label: label, value: shown, onChange: (date) => setRangeEnd(end, date), order: segmentOrder, isDisabled: isDisabled, isInvalid: isInvalid || outOfBounds(shown), onOpenRequest: () => {
307
+ anchorToHalf(end);
308
+ openWithGridFocus();
309
+ }, onSubmit: handleFieldSubmit }) }));
310
+ };
311
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: (node) => {
312
+ // The container is the interaction reference, so a click in either
313
+ // range half counts as inside; range mode then re-points the
314
+ // *position* reference at the half being edited.
315
+ refs.setReference(node);
316
+ if (typeof ref === "function")
317
+ ref(node);
318
+ else if (ref)
319
+ ref.current = node;
320
+ }, className: cn("relative flex items-center gap-2", mode === "range" && "min-w-91.25", mode !== "range" && "min-w-65"), children: [mode === "range" ? (_jsxs(_Fragment, { children: [renderRangeHalf("from", "Start date"), _jsx("span", { "aria-hidden": "true", className: "text-fg-subtle", children: "\u2013" }), renderRangeHalf("to", "End date")] })) : mode === "single" ? (_jsx(PickerField, { className: cn("w-full min-w-65", className), icon: _jsx(CalendarIcon, { className: "h-4 w-4" }), toggleLabel: "Open calendar", toggleProps: getReferenceProps(), isOpen: open, contentId: contentId, isDisabled: isDisabled, isInvalid: isInvalid || outOfBounds(segmentValue), onClear: clearable && hasValue && !isDisabled ? handleClear : undefined, clearLabel: "Clear date", children: _jsx(DateSegments, { className: "h-full flex-1", id: inputId, value: segmentValue, onChange: handleSegmentsChange, order: segmentOrder, isDisabled: isDisabled, isInvalid: isInvalid || outOfBounds(segmentValue), onOpenRequest: openWithGridFocus, onSubmit: handleFieldSubmit }) })) : (_jsxs(_Fragment, { children: [_jsx(CalendarIcon, { className: "pointer-events-none absolute left-3 h-4 w-4 text-fg-subtle" }), _jsx("input", { id: inputId, type: "text", readOnly: true, value: displayValue, placeholder: placeholder, disabled: isDisabled, role: "combobox", "aria-invalid": isInvalid, "aria-haspopup": "dialog", "aria-expanded": open, "aria-controls": open ? contentId : undefined, className: cn(`flex h-9 w-full cursor-pointer rounded-md border border-border-normal bg-transparent py-1 pl-9 text-sm shadow-xs transition-colors placeholder:text-fg-subtle focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-focus-ring disabled:cursor-not-allowed disabled:opacity-50`, "min-w-65", clearable && hasValue ? "pr-9" : "pr-3", isInvalid && "border-border-danger", className), ...getReferenceProps() })] })), clearable && hasValue && !isDisabled && mode === "multiple" && (_jsx("button", { type: "button", onClick: handleClear, className: "absolute right-3 rounded-sm p-0.5 text-fg-subtle hover:bg-bg-subtle hover:text-fg-normal focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-focus-ring", "aria-label": "Clear date", children: _jsx(X, { className: "h-3.5 w-3.5" }) })), name && mode === "single" && committedValue && _jsx("input", { type: "hidden", name: name, value: getFormValue() }), name && mode === "range" && committedValue && (_jsxs(_Fragment, { children: [rangeFormValues.from && _jsx("input", { type: "hidden", name: `${name}.from`, value: rangeFormValues.from }), rangeFormValues.to && _jsx("input", { type: "hidden", name: `${name}.to`, value: rangeFormValues.to })] })), name &&
105
321
  mode === "multiple" &&
106
322
  Array.isArray(committedValue) &&
107
323
  // biome-ignore lint/suspicious/noArrayIndexKey: Hidden form inputs for stable date array
108
- committedValue.map((date, i) => _jsx("input", { type: "hidden", name: `${name}[]`, value: temporalToISO(date) }, i))] }), open && (_jsx(FloatingPortal, { children: _jsx("div", { ref: refs.setFloating, id: contentId, role: "dialog", "aria-modal": "true", style: floatingStyles, className: "z-popover rounded-xl border border-border-normal bg-bg-normal p-4 shadow-lg", ...getFloatingProps(), children: _jsx(Calendar, { mode: mode, value: draftValue, onSelect: setDraftValue, month: month, onMonthChange: setMonth, minDate: minDate, maxDate: maxDate, disabled: disabled, weekStartsOn: weekStartsOn, presets: presets, showFooter: true, showToday: mode !== "range", onApply: handleApply, onCancel: handleCancel, ...(mode === "multiple" && max ? { max } : {}) }) }) }))] }));
109
- };
324
+ committedValue.map((date, i) => _jsx("input", { type: "hidden", name: `${name}[]`, value: temporalToISO(date) }, i))] }), open && (_jsx(FloatingPortal, { children: _jsx("div", { ref: refs.setFloating, id: contentId, role: "dialog", "aria-label": "Choose date", style: floatingStyles, className: "z-popover rounded-xl border border-border-normal bg-bg-normal p-4 shadow-lg", ...getFloatingProps(), children: _jsx(CalendarView, { mode: mode, value: draftValue, onSelect: setDraftValue, month: month, onMonthChange: setMonth, minDate: temporalMinDate, maxDate: temporalMaxDate, disabled: temporalDisabled, weekStartsOn: weekStartsOn, presets: temporalPresets, showFooter: true, showToday: mode !== "range", onApply: handleApply, onCancel: handleCancel, autoFocusDay: autoFocusDay, ...(mode === "multiple" && max ? { max } : {}) }) }) }))] }));
325
+ });
326
+ DatePicker.displayName = "DatePicker";
110
327
  //# sourceMappingURL=DatePicker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACzI,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,WAAW,EAAiB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAK1F,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAA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,EAAE,IAAI,EACV,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,QAAQ,EACvB,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,gBAAgB,EAC1B,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,eAAe,EACxB,UAAU,QACV,SAAS,EAAE,IAAI,KAAK,OAAO,EAC3B,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE,YAAY,KACtB,CAAC,IAAI,KAAK,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAC/C,GACE,GACS,CAClB,IACA,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { type Temporal } from "../../date-time/index.js";
2
+ import { type SegmentSpec, type SegmentValues } from "../../internal/index.js";
3
+ import type { DateSegmentOrder } from "./datepicker.types.js";
4
+ type SegmentName = "day" | "month" | "year";
5
+ export type DateSegmentsProps = {
6
+ /** The date the segments display. `undefined` leaves them empty. */
7
+ value: Temporal.PlainDate | undefined;
8
+ /**
9
+ * Fires with a complete date, or `undefined` the moment the segments stop
10
+ * describing one. Never fires a partial date.
11
+ */
12
+ onChange: (date: Temporal.PlainDate | undefined) => void;
13
+ order?: DateSegmentOrder | undefined;
14
+ isDisabled?: boolean | undefined;
15
+ isInvalid?: boolean | undefined;
16
+ /** Accessible name for the segment group. */
17
+ label?: string | undefined;
18
+ /** `Alt+ArrowDown` — the combobox convention for "open the popup". */
19
+ onOpenRequest?: (() => void) | undefined;
20
+ /** `Enter` — the caller decides whether that means commit, submit or nothing. */
21
+ onSubmit?: (() => void) | undefined;
22
+ id?: string | undefined;
23
+ className?: string | undefined;
24
+ };
25
+ export declare const DATE_ORDERS: Record<DateSegmentOrder, SegmentName[]>;
26
+ export declare const dateToSegments: (date: Temporal.PlainDate | undefined) => SegmentValues;
27
+ /**
28
+ * The day is clamped rather than rejected: typing `31` and then moving the month
29
+ * to February is a normal editing path, and snapping to the 28th keeps the field
30
+ * describing a date the user can see and correct. Nothing else can be out of
31
+ * range — the segments cap themselves as they are typed.
32
+ */
33
+ export declare const dateFromSegments: (values: Record<string, number>) => Temporal.PlainDate;
34
+ /**
35
+ * ISO is always accepted — it is unambiguous, and it is what the rest of the
36
+ * library speaks. Anything else is read in the field's own segment order, which
37
+ * is the only reading that cannot be wrong.
38
+ */
39
+ export declare function parseDatePasteIn(order: DateSegmentOrder): (text: string) => SegmentValues | null;
40
+ /**
41
+ * The typeable half of `DatePicker`: a date as three spinbutton segments.
42
+ *
43
+ * A thin spec over `SegmentedField`, which owns the keyboard model — digits
44
+ * rolling forward, separators, digit-aware `Backspace`, deferred `onChange`.
45
+ * What belongs to dates specifically lives here: the segment order (never
46
+ * inferred from the locale, because `08/09` is a different date under each),
47
+ * clamping the day to the month, and accepting a pasted ISO date.
48
+ *
49
+ * Internal to `DatePicker`; not exported from `./index.ts`.
50
+ */
51
+ /**
52
+ * The three date segments in the given order.
53
+ *
54
+ * Exported because `DateTimePicker` builds one field out of these plus the time
55
+ * segments, rather than two fields glued together.
56
+ */
57
+ export declare function dateSpec(order: DateSegmentOrder): SegmentSpec[];
58
+ export declare function DateSegments({ value, onChange, order, label, ...rest }: DateSegmentsProps): import("react").JSX.Element;
59
+ export {};
60
+ //# sourceMappingURL=DateSegments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateSegments.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DateSegments.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAoB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAkB,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,KAAK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,CAAC,KAAK,EAAE,gBAAgB,GAAG,WAAW,EAAE,CAW/D;AAED,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAa,EAAE,KAAc,EAAE,GAAG,IAAI,EAAE,EAAE,iBAAiB,+BAgB1G"}
@@ -0,0 +1,80 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { today, toISODate } from "../../date-time/index.js";
3
+ import { SegmentedField } from "../../internal/index.js";
4
+ export const DATE_ORDERS = {
5
+ mdy: ["month", "day", "year"],
6
+ dmy: ["day", "month", "year"],
7
+ ymd: ["year", "month", "day"],
8
+ };
9
+ const BASE = {
10
+ day: { name: "day", label: "Day", placeholder: "dd", digits: 2, min: 1, max: 31 },
11
+ month: { name: "month", label: "Month", placeholder: "mm", digits: 2, min: 1, max: 12 },
12
+ year: { name: "year", label: "Year", placeholder: "yyyy", digits: 4, min: 1, max: 9999 },
13
+ };
14
+ /** Days in a (year, month). `day: 1` keeps `with` from constraining a stale day. */
15
+ const daysInMonth = (year, month) => today().with({ year, month, day: 1 }).daysInMonth;
16
+ export const dateToSegments = (date) => date ? { day: date.day, month: date.month, year: date.year } : { day: null, month: null, year: null };
17
+ /**
18
+ * The day is clamped rather than rejected: typing `31` and then moving the month
19
+ * to February is a normal editing path, and snapping to the 28th keeps the field
20
+ * describing a date the user can see and correct. Nothing else can be out of
21
+ * range — the segments cap themselves as they are typed.
22
+ */
23
+ export const dateFromSegments = (values) => {
24
+ const year = values.year;
25
+ const month = values.month;
26
+ return today().with({ year, month, day: Math.min(values.day, daysInMonth(year, month)) });
27
+ };
28
+ /**
29
+ * ISO is always accepted — it is unambiguous, and it is what the rest of the
30
+ * library speaks. Anything else is read in the field's own segment order, which
31
+ * is the only reading that cannot be wrong.
32
+ */
33
+ export function parseDatePasteIn(order) {
34
+ return (text) => {
35
+ const iso = /^(\d{4})-(\d{2})-(\d{2})$/.exec(text);
36
+ const parts = iso ? [iso[1], iso[2], iso[3]] : text.split(/[/\-.\s]+/);
37
+ const names = iso ? DATE_ORDERS.ymd : DATE_ORDERS[order];
38
+ if (parts.length !== 3 || parts.some((part) => !/^\d+$/.test(part)))
39
+ return null;
40
+ const next = { day: null, month: null, year: null };
41
+ names.forEach((name, index) => {
42
+ const numeric = Number(parts[index]);
43
+ next[name] = numeric >= BASE[name].min && numeric <= BASE[name].max ? numeric : null;
44
+ });
45
+ return next;
46
+ };
47
+ }
48
+ /**
49
+ * The typeable half of `DatePicker`: a date as three spinbutton segments.
50
+ *
51
+ * A thin spec over `SegmentedField`, which owns the keyboard model — digits
52
+ * rolling forward, separators, digit-aware `Backspace`, deferred `onChange`.
53
+ * What belongs to dates specifically lives here: the segment order (never
54
+ * inferred from the locale, because `08/09` is a different date under each),
55
+ * clamping the day to the month, and accepting a pasted ISO date.
56
+ *
57
+ * Internal to `DatePicker`; not exported from `./index.ts`.
58
+ */
59
+ /**
60
+ * The three date segments in the given order.
61
+ *
62
+ * Exported because `DateTimePicker` builds one field out of these plus the time
63
+ * segments, rather than two fields glued together.
64
+ */
65
+ export function dateSpec(order) {
66
+ const separator = order === "ymd" ? "-" : "/";
67
+ const current = dateToSegments(today());
68
+ return DATE_ORDERS[order].map((name, index) => ({
69
+ ...BASE[name],
70
+ // An arrow key on an empty segment starts from today, not from 1: the year
71
+ // is the segment most likely to already be right.
72
+ stepFrom: current[name] ?? BASE[name].min,
73
+ separatorBefore: index > 0 ? separator : undefined,
74
+ }));
75
+ }
76
+ export function DateSegments({ value, onChange, order = "mdy", label = "Date", ...rest }) {
77
+ const spec = dateSpec(order);
78
+ return (_jsx(SegmentedField, { spec: spec, value: value, toSegments: dateToSegments, fromSegments: dateFromSegments, keyOf: toISODate, onChange: onChange, parsePaste: parseDatePasteIn(order), label: label, ...rest }));
79
+ }
80
+ //# sourceMappingURL=DateSegments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateSegments.js","sourceRoot":"","sources":["../../../src/components/DatePicker/DateSegments.tsx"],"names":[],"m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;IACzG,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE7B,OAAO,CACL,KAAC,cAAc,IACb,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,cAAc,EAC1B,YAAY,EAAE,gBAAgB,EAC9B,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,gBAAgB,CAAC,KAAK,CAAC,EACnC,KAAK,EAAE,KAAK,KACR,IAAI,GACR,CACH,CAAC;AACJ,CAAC"}
@@ -1,43 +1,54 @@
1
1
  /**
2
- * DatePicker types
2
+ * DatePicker types.
3
3
  *
4
- * All date values use Temporal.PlainDate at the component boundary.
5
- * This provides type safety and semantic clarity about what kind of date is expected.
4
+ * All date values at the public boundary are canonical ISO 8601 strings
5
+ * (`"2026-08-26"`). Temporal is an implementation detail of the calendar grid;
6
+ * the `*Internal` types below describe that layer and are not exported from
7
+ * `./index.ts`.
6
8
  */
7
- import type { Temporal, WeekStartsOn } from "../../date-time/index.js";
9
+ import type { DisabledDates, ISODate, ISODateRange, Temporal, TemporalDisabledMatcher, WeekStartsOn } from "../../date-time/index.js";
8
10
  import type { PresetOption as CalendarPresetOption } from "../Calendar/calendar.types.js";
9
11
  /**
10
- * Date range value for range mode
12
+ * Selection mode for the DatePicker
13
+ */
14
+ export type DatePickerMode = "single" | "range" | "multiple";
15
+ /**
16
+ * Which order the typeable segments read in.
17
+ *
18
+ * Explicit rather than inferred from the runtime locale: `08/09` is a different
19
+ * date under `mdy` than under `dmy`, and a component that guesses is wrong for
20
+ * half its users. Defaults to `mdy`, matching the `en-US` formatting the rest
21
+ * of the library's display helpers use.
22
+ */
23
+ export type DateSegmentOrder = "mdy" | "dmy" | "ymd";
24
+ /**
25
+ * Date range value in Temporal terms, used by `datepicker.hooks`.
26
+ *
27
+ * The public equivalent is `ISODateRange`.
11
28
  */
12
29
  export type DateRangeValue = {
13
30
  from: Temporal.PlainDate | undefined;
14
31
  to: Temporal.PlainDate | undefined;
15
32
  };
16
33
  /**
17
- * Selection mode for the DatePicker
18
- */
19
- export type DatePickerMode = "single" | "range" | "multiple";
20
- /**
21
- * Matchers for disabling dates
34
+ * Temporal-shaped disabled matchers, produced from the public
35
+ * {@link DisabledDates} by `adaptDisabledDates`.
22
36
  */
23
- export type DisabledDateMatcher = Temporal.PlainDate | Temporal.PlainDate[] | ((date: Temporal.PlainDate) => boolean) | {
24
- before: Temporal.PlainDate;
25
- } | {
26
- after: Temporal.PlainDate;
27
- } | {
28
- from: Temporal.PlainDate;
29
- to: Temporal.PlainDate;
30
- };
37
+ export type DisabledDateMatcher = TemporalDisabledMatcher;
31
38
  type DatePickerBaseProps = {
32
39
  /** First day of week (0 = Sunday, 1 = Monday) */
33
40
  weekStartsOn?: WeekStartsOn;
34
- /** Minimum selectable date */
35
- minDate?: Temporal.PlainDate;
36
- /** Maximum selectable date */
37
- maxDate?: Temporal.PlainDate;
38
- /** Disabled dates */
39
- disabled?: DisabledDateMatcher | DisabledDateMatcher[];
40
- /** Placeholder text */
41
+ /** Earliest selectable date, inclusive */
42
+ minDate?: ISODate;
43
+ /** Latest selectable date, inclusive */
44
+ maxDate?: ISODate;
45
+ /** Which dates to refuse. See `DisabledDates`. */
46
+ disabled?: DisabledDates | DisabledDates[];
47
+ /**
48
+ * Placeholder for the read-only text trigger, which only `multiple` mode
49
+ * still uses. `single` and `range` are typeable fields whose segments show
50
+ * their own placeholders (`mm/dd/yyyy`).
51
+ */
41
52
  placeholder?: string;
42
53
  /** Input name for form submission */
43
54
  name?: string;
@@ -51,41 +62,46 @@ type DatePickerBaseProps = {
51
62
  align?: "start" | "end";
52
63
  /** Whether the clear button is shown when a value is present (default: true) */
53
64
  clearable?: boolean;
65
+ /**
66
+ * Segment order for the typeable field (`single` mode only; default `mdy`).
67
+ * See {@link DateSegmentOrder}.
68
+ */
69
+ segmentOrder?: DateSegmentOrder;
54
70
  };
55
71
  export type DatePickerSingleProps = DatePickerBaseProps & {
56
72
  mode?: "single";
57
73
  /** Controlled value */
58
- value?: Temporal.PlainDate | undefined;
74
+ value?: ISODate | undefined;
59
75
  /** Default value for uncontrolled mode */
60
- defaultValue?: Temporal.PlainDate | undefined;
76
+ defaultValue?: ISODate | undefined;
61
77
  /** Called when date changes */
62
- onChange?: (date: Temporal.PlainDate | undefined) => void;
78
+ onChange?: (date: ISODate | undefined) => void;
63
79
  /** Preset options (shown in left sidebar) */
64
- presets?: CalendarPresetOption<Temporal.PlainDate>[];
80
+ presets?: CalendarPresetOption<ISODate>[];
65
81
  };
66
82
  export type DatePickerRangeProps = DatePickerBaseProps & {
67
83
  mode: "range";
68
84
  /** Controlled value */
69
- value?: DateRangeValue | undefined;
85
+ value?: ISODateRange | undefined;
70
86
  /** Default value for uncontrolled mode */
71
- defaultValue?: DateRangeValue | undefined;
87
+ defaultValue?: ISODateRange | undefined;
72
88
  /** Called when range changes */
73
- onChange?: (range: DateRangeValue | undefined) => void;
89
+ onChange?: (range: ISODateRange | undefined) => void;
74
90
  /** Preset options (shown in left sidebar) */
75
- presets?: CalendarPresetOption<DateRangeValue>[];
91
+ presets?: CalendarPresetOption<ISODateRange>[];
76
92
  };
77
93
  export type DatePickerMultipleProps = DatePickerBaseProps & {
78
94
  mode: "multiple";
79
95
  /** Controlled value (array of dates) */
80
- value?: Temporal.PlainDate[] | undefined;
96
+ value?: ISODate[] | undefined;
81
97
  /** Default value for uncontrolled mode */
82
- defaultValue?: Temporal.PlainDate[] | undefined;
98
+ defaultValue?: ISODate[] | undefined;
83
99
  /** Called when selection changes */
84
- onChange?: (dates: Temporal.PlainDate[]) => void;
100
+ onChange?: (dates: ISODate[]) => void;
85
101
  /** Maximum number of dates that can be selected */
86
102
  max?: number | undefined;
87
103
  /** Preset options (shown in left sidebar) */
88
- presets?: CalendarPresetOption<Temporal.PlainDate[]>[];
104
+ presets?: CalendarPresetOption<ISODate[]>[];
89
105
  };
90
106
  /**
91
107
  * DatePicker props - discriminated union based on mode