@sewadah/selaras 0.1.1 → 0.2.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 (379) hide show
  1. package/README.md +31 -13
  2. package/dist/module.d.mts +10 -0
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +120 -36
  5. package/dist/runtime/components/Accordion.d.vue.ts +3 -0
  6. package/dist/runtime/components/Accordion.vue +5 -1
  7. package/dist/runtime/components/Accordion.vue.d.ts +3 -0
  8. package/dist/runtime/components/Alert.d.vue.ts +2 -1
  9. package/dist/runtime/components/Alert.vue +6 -3
  10. package/dist/runtime/components/Alert.vue.d.ts +2 -1
  11. package/dist/runtime/components/AlertDialog.d.vue.ts +2 -0
  12. package/dist/runtime/components/AlertDialog.vue +21 -8
  13. package/dist/runtime/components/AlertDialog.vue.d.ts +2 -0
  14. package/dist/runtime/components/App.vue +9 -2
  15. package/dist/runtime/components/Autocomplete.d.vue.ts +22 -58
  16. package/dist/runtime/components/Autocomplete.vue +50 -11
  17. package/dist/runtime/components/Autocomplete.vue.d.ts +22 -58
  18. package/dist/runtime/components/Avatar.d.vue.ts +2 -1
  19. package/dist/runtime/components/Avatar.vue +4 -2
  20. package/dist/runtime/components/Avatar.vue.d.ts +2 -1
  21. package/dist/runtime/components/Badge.d.vue.ts +3 -2
  22. package/dist/runtime/components/Badge.vue +8 -5
  23. package/dist/runtime/components/Badge.vue.d.ts +3 -2
  24. package/dist/runtime/components/Breadcrumb.d.vue.ts +3 -0
  25. package/dist/runtime/components/Breadcrumb.vue +5 -2
  26. package/dist/runtime/components/Breadcrumb.vue.d.ts +3 -0
  27. package/dist/runtime/components/Button.d.vue.ts +5 -2
  28. package/dist/runtime/components/Button.vue +5 -2
  29. package/dist/runtime/components/Button.vue.d.ts +5 -2
  30. package/dist/runtime/components/Checkbox.d.vue.ts +2 -1
  31. package/dist/runtime/components/Checkbox.vue +4 -2
  32. package/dist/runtime/components/Checkbox.vue.d.ts +2 -1
  33. package/dist/runtime/components/Chip.d.vue.ts +2 -1
  34. package/dist/runtime/components/Chip.vue +4 -2
  35. package/dist/runtime/components/Chip.vue.d.ts +2 -1
  36. package/dist/runtime/components/Collapsible.d.vue.ts +3 -0
  37. package/dist/runtime/components/Collapsible.vue +11 -6
  38. package/dist/runtime/components/Collapsible.vue.d.ts +3 -0
  39. package/dist/runtime/components/ColorPicker.d.vue.ts +13 -3
  40. package/dist/runtime/components/ColorPicker.vue +60 -14
  41. package/dist/runtime/components/ColorPicker.vue.d.ts +13 -3
  42. package/dist/runtime/components/Column.d.ts +1 -1
  43. package/dist/runtime/components/CommandPalette.vue +18 -16
  44. package/dist/runtime/components/ContentNavigation.d.vue.ts +3 -0
  45. package/dist/runtime/components/ContentNavigation.vue +6 -3
  46. package/dist/runtime/components/ContentNavigation.vue.d.ts +3 -0
  47. package/dist/runtime/components/ContentSurround.d.vue.ts +3 -0
  48. package/dist/runtime/components/ContentSurround.vue +7 -4
  49. package/dist/runtime/components/ContentSurround.vue.d.ts +3 -0
  50. package/dist/runtime/components/ContentToc.d.vue.ts +3 -0
  51. package/dist/runtime/components/ContentToc.vue +8 -5
  52. package/dist/runtime/components/ContentToc.vue.d.ts +3 -0
  53. package/dist/runtime/components/ContextMenu.vue +3 -2
  54. package/dist/runtime/components/DashboardSidebar.vue +1 -1
  55. package/dist/runtime/components/DashboardSidebarToggle.d.vue.ts +1 -0
  56. package/dist/runtime/components/DashboardSidebarToggle.vue +3 -1
  57. package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +1 -0
  58. package/dist/runtime/components/DatePicker.d.vue.ts +32 -23
  59. package/dist/runtime/components/DatePicker.vue +130 -60
  60. package/dist/runtime/components/DatePicker.vue.d.ts +32 -23
  61. package/dist/runtime/components/Drawer.d.vue.ts +2 -0
  62. package/dist/runtime/components/Drawer.vue +21 -8
  63. package/dist/runtime/components/Drawer.vue.d.ts +2 -0
  64. package/dist/runtime/components/DrawerRenderer.vue +28 -21
  65. package/dist/runtime/components/Dropdown.d.vue.ts +14 -4
  66. package/dist/runtime/components/Dropdown.vue +19 -4
  67. package/dist/runtime/components/Dropdown.vue.d.ts +14 -4
  68. package/dist/runtime/components/FileTree.d.vue.ts +3 -0
  69. package/dist/runtime/components/FileTree.vue +7 -3
  70. package/dist/runtime/components/FileTree.vue.d.ts +3 -0
  71. package/dist/runtime/components/FileUpload.d.vue.ts +2 -1
  72. package/dist/runtime/components/FileUpload.vue +75 -32
  73. package/dist/runtime/components/FileUpload.vue.d.ts +2 -1
  74. package/dist/runtime/components/FormField.d.vue.ts +2 -0
  75. package/dist/runtime/components/FormField.vue +12 -9
  76. package/dist/runtime/components/FormField.vue.d.ts +2 -0
  77. package/dist/runtime/components/Icon.d.vue.ts +2 -4
  78. package/dist/runtime/components/Icon.vue +7 -2
  79. package/dist/runtime/components/Icon.vue.d.ts +2 -4
  80. package/dist/runtime/components/Input.d.vue.ts +2 -1
  81. package/dist/runtime/components/Input.vue +12 -6
  82. package/dist/runtime/components/Input.vue.d.ts +2 -1
  83. package/dist/runtime/components/InputNumber.d.vue.ts +4 -1
  84. package/dist/runtime/components/InputNumber.vue +21 -8
  85. package/dist/runtime/components/InputNumber.vue.d.ts +4 -1
  86. package/dist/runtime/components/Modal.d.vue.ts +2 -0
  87. package/dist/runtime/components/Modal.vue +21 -8
  88. package/dist/runtime/components/Modal.vue.d.ts +2 -0
  89. package/dist/runtime/components/ModalRenderer.vue +23 -16
  90. package/dist/runtime/components/NavigationMenu.d.vue.ts +2 -4
  91. package/dist/runtime/components/NavigationMenu.vue +6 -4
  92. package/dist/runtime/components/NavigationMenu.vue.d.ts +2 -4
  93. package/dist/runtime/components/NavigationMenuAccordionItem.d.vue.ts +2 -4
  94. package/dist/runtime/components/NavigationMenuAccordionItem.vue +5 -3
  95. package/dist/runtime/components/NavigationMenuAccordionItem.vue.d.ts +2 -4
  96. package/dist/runtime/components/NavigationMenuFlyoutList.d.vue.ts +2 -4
  97. package/dist/runtime/components/NavigationMenuFlyoutList.vue +7 -4
  98. package/dist/runtime/components/NavigationMenuFlyoutList.vue.d.ts +2 -4
  99. package/dist/runtime/components/NavigationMenuFlyoutTrigger.d.vue.ts +2 -4
  100. package/dist/runtime/components/NavigationMenuFlyoutTrigger.vue +9 -2
  101. package/dist/runtime/components/NavigationMenuFlyoutTrigger.vue.d.ts +2 -4
  102. package/dist/runtime/components/Pagination.d.vue.ts +3 -2
  103. package/dist/runtime/components/Pagination.vue.d.ts +3 -2
  104. package/dist/runtime/components/PinInput.d.vue.ts +2 -1
  105. package/dist/runtime/components/PinInput.vue +17 -6
  106. package/dist/runtime/components/PinInput.vue.d.ts +2 -1
  107. package/dist/runtime/components/Popover.d.vue.ts +2 -0
  108. package/dist/runtime/components/Popover.vue +14 -7
  109. package/dist/runtime/components/Popover.vue.d.ts +2 -0
  110. package/dist/runtime/components/Progress.d.vue.ts +2 -1
  111. package/dist/runtime/components/Progress.vue +6 -4
  112. package/dist/runtime/components/Progress.vue.d.ts +2 -1
  113. package/dist/runtime/components/ProseH1.d.vue.ts +2 -0
  114. package/dist/runtime/components/ProseH1.vue +7 -4
  115. package/dist/runtime/components/ProseH1.vue.d.ts +2 -0
  116. package/dist/runtime/components/ProseH2.d.vue.ts +2 -0
  117. package/dist/runtime/components/ProseH2.vue +7 -4
  118. package/dist/runtime/components/ProseH2.vue.d.ts +2 -0
  119. package/dist/runtime/components/ProseH3.d.vue.ts +2 -0
  120. package/dist/runtime/components/ProseH3.vue +7 -4
  121. package/dist/runtime/components/ProseH3.vue.d.ts +2 -0
  122. package/dist/runtime/components/ProseH4.d.vue.ts +2 -0
  123. package/dist/runtime/components/ProseH4.vue +7 -4
  124. package/dist/runtime/components/ProseH4.vue.d.ts +2 -0
  125. package/dist/runtime/components/ProseH5.d.vue.ts +2 -0
  126. package/dist/runtime/components/ProseH5.vue +7 -4
  127. package/dist/runtime/components/ProseH5.vue.d.ts +2 -0
  128. package/dist/runtime/components/ProseH6.d.vue.ts +2 -0
  129. package/dist/runtime/components/ProseH6.vue +7 -4
  130. package/dist/runtime/components/ProseH6.vue.d.ts +2 -0
  131. package/dist/runtime/components/RadioGroup.d.vue.ts +2 -1
  132. package/dist/runtime/components/RadioGroup.vue +9 -5
  133. package/dist/runtime/components/RadioGroup.vue.d.ts +2 -1
  134. package/dist/runtime/components/Rating.d.vue.ts +2 -1
  135. package/dist/runtime/components/Rating.vue +4 -1
  136. package/dist/runtime/components/Rating.vue.d.ts +2 -1
  137. package/dist/runtime/components/ReadMore.d.vue.ts +3 -0
  138. package/dist/runtime/components/ReadMore.vue +24 -6
  139. package/dist/runtime/components/ReadMore.vue.d.ts +3 -0
  140. package/dist/runtime/components/Select.d.vue.ts +21 -57
  141. package/dist/runtime/components/Select.vue +58 -9
  142. package/dist/runtime/components/Select.vue.d.ts +21 -57
  143. package/dist/runtime/components/Separator.d.vue.ts +2 -1
  144. package/dist/runtime/components/Separator.vue +4 -2
  145. package/dist/runtime/components/Separator.vue.d.ts +2 -1
  146. package/dist/runtime/components/Slideover.d.vue.ts +2 -0
  147. package/dist/runtime/components/Slideover.vue +21 -8
  148. package/dist/runtime/components/Slideover.vue.d.ts +2 -0
  149. package/dist/runtime/components/SlideoverRenderer.vue +25 -18
  150. package/dist/runtime/components/Slider.d.vue.ts +2 -1
  151. package/dist/runtime/components/Slider.vue +4 -1
  152. package/dist/runtime/components/Slider.vue.d.ts +2 -1
  153. package/dist/runtime/components/SplitterResizeHandle.d.vue.ts +3 -0
  154. package/dist/runtime/components/SplitterResizeHandle.vue +5 -2
  155. package/dist/runtime/components/SplitterResizeHandle.vue.d.ts +3 -0
  156. package/dist/runtime/components/Stepper.d.vue.ts +2 -1
  157. package/dist/runtime/components/Stepper.vue +4 -1
  158. package/dist/runtime/components/Stepper.vue.d.ts +2 -1
  159. package/dist/runtime/components/Switch.d.vue.ts +2 -1
  160. package/dist/runtime/components/Switch.vue +4 -2
  161. package/dist/runtime/components/Switch.vue.d.ts +2 -1
  162. package/dist/runtime/components/Table.d.vue.ts +28 -80
  163. package/dist/runtime/components/Table.vue +25 -13
  164. package/dist/runtime/components/Table.vue.d.ts +28 -80
  165. package/dist/runtime/components/Tabs.d.vue.ts +3 -0
  166. package/dist/runtime/components/Tabs.vue +5 -1
  167. package/dist/runtime/components/Tabs.vue.d.ts +3 -0
  168. package/dist/runtime/components/Textarea.d.vue.ts +2 -1
  169. package/dist/runtime/components/Textarea.vue +11 -6
  170. package/dist/runtime/components/Textarea.vue.d.ts +2 -1
  171. package/dist/runtime/components/Theme.d.vue.ts +16 -5
  172. package/dist/runtime/components/Theme.vue +30 -5
  173. package/dist/runtime/components/Theme.vue.d.ts +16 -5
  174. package/dist/runtime/components/Toast.vue +11 -39
  175. package/dist/runtime/components/Toggle.d.vue.ts +2 -1
  176. package/dist/runtime/components/Toggle.vue +4 -1
  177. package/dist/runtime/components/Toggle.vue.d.ts +2 -1
  178. package/dist/runtime/components/ToggleGroup.d.vue.ts +2 -1
  179. package/dist/runtime/components/ToggleGroup.vue +4 -1
  180. package/dist/runtime/components/ToggleGroup.vue.d.ts +2 -1
  181. package/dist/runtime/components/Tooltip.vue +3 -2
  182. package/dist/runtime/components/Tree.d.vue.ts +5 -2
  183. package/dist/runtime/components/Tree.vue +5 -1
  184. package/dist/runtime/components/Tree.vue.d.ts +5 -2
  185. package/dist/runtime/composables/use-drawer.d.ts +1 -22
  186. package/dist/runtime/composables/use-drawer.js +12 -18
  187. package/dist/runtime/composables/use-form-field.d.ts +1 -0
  188. package/dist/runtime/composables/use-icons.d.ts +2 -2
  189. package/dist/runtime/composables/use-icons.js +1 -1
  190. package/dist/runtime/composables/use-locale.d.ts +2 -2
  191. package/dist/runtime/composables/use-locale.js +1 -1
  192. package/dist/runtime/composables/use-media-query.d.ts +6 -8
  193. package/dist/runtime/composables/use-media-query.js +7 -2
  194. package/dist/runtime/composables/use-messages.d.ts +2 -2
  195. package/dist/runtime/composables/use-messages.js +1 -1
  196. package/dist/runtime/composables/use-modal.d.ts +1 -17
  197. package/dist/runtime/composables/use-modal.js +12 -18
  198. package/dist/runtime/composables/use-ripple.d.ts +2 -2
  199. package/dist/runtime/composables/use-ripple.js +1 -1
  200. package/dist/runtime/composables/use-slideover.d.ts +1 -19
  201. package/dist/runtime/composables/use-slideover.js +12 -18
  202. package/dist/runtime/composables/use-table.d.ts +74 -17
  203. package/dist/runtime/composables/use-table.js +4 -1
  204. package/dist/runtime/composables/use-toast.d.ts +8 -8
  205. package/dist/runtime/composables/use-toast.js +9 -11
  206. package/dist/runtime/default-color-metadata.d.ts +4 -0
  207. package/dist/runtime/default-color-metadata.js +4 -0
  208. package/dist/runtime/default-colors.css +1 -0
  209. package/dist/runtime/internal/ColorPickerBody.d.vue.ts +1 -0
  210. package/dist/runtime/internal/ColorPickerBody.vue +24 -1
  211. package/dist/runtime/internal/ColorPickerBody.vue.d.ts +1 -0
  212. package/dist/runtime/internal/ComboboxSelectBase.d.vue.ts +50 -46
  213. package/dist/runtime/internal/ComboboxSelectBase.vue +340 -93
  214. package/dist/runtime/internal/ComboboxSelectBase.vue.d.ts +50 -46
  215. package/dist/runtime/internal/ComboboxSelectBody.d.vue.ts +29 -23
  216. package/dist/runtime/internal/ComboboxSelectBody.vue +74 -40
  217. package/dist/runtime/internal/ComboboxSelectBody.vue.d.ts +29 -23
  218. package/dist/runtime/internal/DatePickerCalendarBody.d.vue.ts +3 -5
  219. package/dist/runtime/internal/DatePickerCalendarBody.vue +2 -2
  220. package/dist/runtime/internal/DatePickerCalendarBody.vue.d.ts +3 -5
  221. package/dist/runtime/internal/DatePickerRangeCalendarBody.d.vue.ts +3 -5
  222. package/dist/runtime/internal/DatePickerRangeCalendarBody.vue +1 -1
  223. package/dist/runtime/internal/DatePickerRangeCalendarBody.vue.d.ts +3 -5
  224. package/dist/runtime/internal/DatePickerTimeBody.d.vue.ts +2 -4
  225. package/dist/runtime/internal/DatePickerTimeBody.vue.d.ts +2 -4
  226. package/dist/runtime/internal/ProgrammaticTheme.d.vue.ts +17 -0
  227. package/dist/runtime/internal/ProgrammaticTheme.vue +41 -0
  228. package/dist/runtime/internal/ProgrammaticTheme.vue.d.ts +17 -0
  229. package/dist/runtime/internal/TimeStepper.vue +1 -1
  230. package/dist/runtime/internal/ToastItemRenderer.d.vue.ts +14 -0
  231. package/dist/runtime/internal/ToastItemRenderer.vue +54 -0
  232. package/dist/runtime/internal/ToastItemRenderer.vue.d.ts +14 -0
  233. package/dist/runtime/internal/combobox-select.d.ts +52 -0
  234. package/dist/runtime/{composables/use-combobox-select.js → internal/combobox-select.js} +26 -11
  235. package/dist/runtime/internal/programmatic-services.d.ts +71 -0
  236. package/dist/runtime/internal/programmatic-services.js +61 -0
  237. package/dist/runtime/prose.css +1 -1
  238. package/dist/runtime/structural.css +1 -0
  239. package/dist/runtime/table.d.ts +3 -0
  240. package/dist/runtime/table.js +1 -0
  241. package/dist/runtime/theme/accordion.d.ts +27 -0
  242. package/dist/runtime/theme/accordion.js +15 -6
  243. package/dist/runtime/theme/alert-dialog.js +5 -5
  244. package/dist/runtime/theme/alert.js +6 -15
  245. package/dist/runtime/theme/avatar-group.js +2 -2
  246. package/dist/runtime/theme/avatar.js +12 -18
  247. package/dist/runtime/theme/badge.d.ts +39 -9
  248. package/dist/runtime/theme/badge.js +11 -40
  249. package/dist/runtime/theme/breadcrumb.d.ts +29 -47
  250. package/dist/runtime/theme/breadcrumb.js +16 -5
  251. package/dist/runtime/theme/button.d.ts +45 -15
  252. package/dist/runtime/theme/button.js +10 -57
  253. package/dist/runtime/theme/callout.js +7 -7
  254. package/dist/runtime/theme/card.js +7 -7
  255. package/dist/runtime/theme/checkbox.d.ts +21 -84
  256. package/dist/runtime/theme/checkbox.js +15 -36
  257. package/dist/runtime/theme/chip.js +4 -22
  258. package/dist/runtime/theme/code-button.js +2 -2
  259. package/dist/runtime/theme/code-tree.d.ts +3 -3
  260. package/dist/runtime/theme/code-tree.js +4 -4
  261. package/dist/runtime/theme/collapsible.d.ts +27 -0
  262. package/dist/runtime/theme/collapsible.js +12 -3
  263. package/dist/runtime/theme/color-picker.d.ts +18 -54
  264. package/dist/runtime/theme/color-picker.js +19 -18
  265. package/dist/runtime/theme/command-palette.d.ts +6 -6
  266. package/dist/runtime/theme/command-palette.js +12 -10
  267. package/dist/runtime/theme/content-navigation.d.ts +27 -0
  268. package/dist/runtime/theme/content-navigation.js +14 -5
  269. package/dist/runtime/theme/content-surround.d.ts +27 -0
  270. package/dist/runtime/theme/content-surround.js +13 -4
  271. package/dist/runtime/theme/content-toc.d.ts +27 -0
  272. package/dist/runtime/theme/content-toc.js +14 -5
  273. package/dist/runtime/theme/context-menu.js +7 -7
  274. package/dist/runtime/theme/dashboard-navbar.d.ts +6 -6
  275. package/dist/runtime/theme/dashboard-navbar.js +2 -2
  276. package/dist/runtime/theme/dashboard-resize-handle.js +3 -3
  277. package/dist/runtime/theme/dashboard-sidebar.js +3 -3
  278. package/dist/runtime/theme/date-picker.js +10 -10
  279. package/dist/runtime/theme/drawer.js +9 -9
  280. package/dist/runtime/theme/dropdown.js +7 -7
  281. package/dist/runtime/theme/file-tree.d.ts +27 -0
  282. package/dist/runtime/theme/file-tree.js +12 -3
  283. package/dist/runtime/theme/file-upload.d.ts +18 -72
  284. package/dist/runtime/theme/file-upload.js +20 -19
  285. package/dist/runtime/theme/form-field.js +5 -5
  286. package/dist/runtime/theme/header.d.ts +3 -3
  287. package/dist/runtime/theme/header.js +1 -1
  288. package/dist/runtime/theme/icon.d.ts +30 -57
  289. package/dist/runtime/theme/icon.js +19 -9
  290. package/dist/runtime/theme/input-number.d.ts +21 -63
  291. package/dist/runtime/theme/input-number.js +12 -12
  292. package/dist/runtime/theme/input.d.ts +21 -63
  293. package/dist/runtime/theme/input.js +12 -12
  294. package/dist/runtime/theme/kbd.js +1 -1
  295. package/dist/runtime/theme/modal.js +4 -4
  296. package/dist/runtime/theme/navigation-menu.d.ts +2 -0
  297. package/dist/runtime/theme/navigation-menu.js +17 -28
  298. package/dist/runtime/theme/page-header.js +3 -3
  299. package/dist/runtime/theme/pagination.js +1 -1
  300. package/dist/runtime/theme/pin-input.d.ts +21 -63
  301. package/dist/runtime/theme/pin-input.js +13 -11
  302. package/dist/runtime/theme/popover.js +2 -2
  303. package/dist/runtime/theme/progress.d.ts +21 -84
  304. package/dist/runtime/theme/progress.js +12 -12
  305. package/dist/runtime/theme/prose.d.ts +29 -50
  306. package/dist/runtime/theme/prose.js +22 -11
  307. package/dist/runtime/theme/radio-group.d.ts +21 -84
  308. package/dist/runtime/theme/radio-group.js +16 -22
  309. package/dist/runtime/theme/rating.d.ts +21 -63
  310. package/dist/runtime/theme/rating.js +10 -10
  311. package/dist/runtime/theme/read-more.d.ts +27 -0
  312. package/dist/runtime/theme/read-more.js +13 -4
  313. package/dist/runtime/theme/scroll-area.d.ts +3 -3
  314. package/dist/runtime/theme/scroll-area.js +2 -2
  315. package/dist/runtime/theme/select.d.ts +21 -54
  316. package/dist/runtime/theme/select.js +32 -24
  317. package/dist/runtime/theme/separator.d.ts +18 -54
  318. package/dist/runtime/theme/separator.js +16 -12
  319. package/dist/runtime/theme/skeleton.js +4 -4
  320. package/dist/runtime/theme/slideover.js +5 -5
  321. package/dist/runtime/theme/slider.d.ts +21 -84
  322. package/dist/runtime/theme/slider.js +14 -14
  323. package/dist/runtime/theme/splitter-resize-handle.d.ts +27 -0
  324. package/dist/runtime/theme/splitter-resize-handle.js +11 -1
  325. package/dist/runtime/theme/stepper.d.ts +21 -84
  326. package/dist/runtime/theme/stepper.js +12 -33
  327. package/dist/runtime/theme/switch.d.ts +21 -84
  328. package/dist/runtime/theme/switch.js +13 -13
  329. package/dist/runtime/theme/table.d.ts +27 -0
  330. package/dist/runtime/theme/table.js +31 -21
  331. package/dist/runtime/theme/tabs.d.ts +27 -0
  332. package/dist/runtime/theme/tabs.js +17 -7
  333. package/dist/runtime/theme/textarea.d.ts +21 -63
  334. package/dist/runtime/theme/textarea.js +12 -12
  335. package/dist/runtime/theme/toast.d.ts +12 -48
  336. package/dist/runtime/theme/toast.js +9 -9
  337. package/dist/runtime/theme/toggle-group.js +5 -11
  338. package/dist/runtime/theme/toggle.js +2 -12
  339. package/dist/runtime/theme/tooltip.d.ts +3 -3
  340. package/dist/runtime/theme/tooltip.js +3 -3
  341. package/dist/runtime/theme/tree.d.ts +27 -0
  342. package/dist/runtime/theme/tree.js +13 -3
  343. package/dist/runtime/theme-api.d.ts +15 -0
  344. package/dist/runtime/theme-api.js +12 -0
  345. package/dist/runtime/theme-config.d.ts +470 -0
  346. package/dist/runtime/theme-config.js +0 -0
  347. package/dist/runtime/theme.css +1 -1
  348. package/dist/runtime/types/app-config.d.ts +11 -8
  349. package/dist/runtime/types/index.d.ts +19 -1
  350. package/dist/runtime/utils/app-scoped-state.d.ts +2 -0
  351. package/dist/runtime/utils/app-scoped-state.js +13 -0
  352. package/dist/runtime/utils/autocomplete-contracts.d.ts +24 -0
  353. package/dist/runtime/utils/autocomplete-contracts.js +0 -0
  354. package/dist/runtime/utils/color-registry.d.ts +60 -0
  355. package/dist/runtime/utils/color-registry.js +187 -0
  356. package/dist/runtime/utils/dtcg-colors.d.ts +25 -0
  357. package/dist/runtime/utils/dtcg-colors.js +40 -0
  358. package/dist/runtime/utils/functional-tokens.d.ts +26 -0
  359. package/dist/runtime/utils/functional-tokens.js +54 -0
  360. package/dist/runtime/utils/icons.d.ts +3 -0
  361. package/dist/runtime/utils/icons.js +4 -0
  362. package/dist/runtime/utils/injection-keys.d.ts +12 -3
  363. package/dist/runtime/utils/native-input.d.ts +5 -0
  364. package/dist/runtime/utils/native-input.js +32 -0
  365. package/dist/runtime/utils/programmatic-theme.d.ts +17 -0
  366. package/dist/runtime/utils/programmatic-theme.js +59 -0
  367. package/dist/runtime/utils/registered-colors.d.ts +3 -0
  368. package/dist/runtime/utils/registered-colors.js +14 -0
  369. package/dist/runtime/utils/seed-colors.d.ts +18 -0
  370. package/dist/runtime/utils/seed-colors.js +199 -0
  371. package/dist/runtime/utils/select-contracts.d.ts +101 -0
  372. package/dist/runtime/utils/select-contracts.js +0 -0
  373. package/dist/runtime/utils/table-contracts.d.ts +60 -0
  374. package/dist/runtime/utils/table-contracts.js +0 -0
  375. package/dist/runtime/utils/ui.d.ts +26 -4
  376. package/dist/runtime/utils/ui.js +38 -5
  377. package/dist/tokens/default-colors.tokens.json +879 -0
  378. package/package.json +66 -10
  379. package/dist/runtime/composables/use-combobox-select.d.ts +0 -45
@@ -24,7 +24,7 @@ import {
24
24
  TimeFieldInput,
25
25
  TimeFieldRoot
26
26
  } from "reka-ui";
27
- import { computed, ref, shallowRef, useId, watch } from "vue";
27
+ import { computed, getCurrentInstance, onMounted, onUnmounted, ref, shallowRef, useId, watch } from "vue";
28
28
  import { useFormField } from "../composables/use-form-field";
29
29
  import { useIcons } from "../composables/use-icons";
30
30
  import { useLocale } from "../composables/use-locale";
@@ -34,7 +34,8 @@ import DatePickerCalendarBody from "../internal/DatePickerCalendarBody.vue";
34
34
  import DatePickerRangeCalendarBody from "../internal/DatePickerRangeCalendarBody.vue";
35
35
  import DatePickerTimeBody from "../internal/DatePickerTimeBody.vue";
36
36
  import { datePickerTheme } from "../theme/date-picker";
37
- import { applyClassPrefix, resolveSlot, useComponentTheme, useRootProps } from "../utils/ui";
37
+ import { resolveRegisteredColorRole } from "../utils/registered-colors";
38
+ import { applyClassPrefix, resolveSlot, useComponentTheme, useRootProps, useThemeBindings } from "../utils/ui";
38
39
  import Button from "./Button.vue";
39
40
  import Icon from "./Icon.vue";
40
41
  import Modal from "./Modal.vue";
@@ -42,7 +43,11 @@ defineOptions({ inheritAttrs: false });
42
43
  const props = defineProps({
43
44
  id: { type: String, required: false },
44
45
  name: { type: String, required: false },
46
+ form: { type: String, required: false },
47
+ open: { type: Boolean, required: false },
48
+ defaultOpen: { type: Boolean, required: false },
45
49
  modelValue: { type: Object, required: false },
50
+ defaultValue: { type: Object, required: false },
46
51
  range: { type: Boolean, required: false },
47
52
  timeOnly: { type: Boolean, required: false },
48
53
  minValue: { type: Object, required: false },
@@ -77,11 +82,46 @@ const props = defineProps({
77
82
  activeColor: { type: null, required: false, default: "primary" },
78
83
  size: { type: null, required: false },
79
84
  arrow: { type: Boolean, required: false, default: false },
80
- mobileModal: { type: Boolean, required: false },
85
+ adaptive: { type: Boolean, required: false },
81
86
  ui: { type: Object, required: false }
82
87
  });
83
- const emit = defineEmits(["update:modelValue", "update:view"]);
88
+ const emit = defineEmits(["update:open", "update:modelValue", "update:view"]);
89
+ const themeBindings = useThemeBindings();
84
90
  const field = useFormField();
91
+ const instance = getCurrentInstance();
92
+ const initialValue = props.defaultValue;
93
+ const localValue = shallowRef(initialValue);
94
+ const isModelControlled = () => Object.hasOwn(instance.vnode.props ?? {}, "modelValue") || Object.hasOwn(instance.vnode.props ?? {}, "model-value");
95
+ const modelValue = computed(() => isModelControlled() ? props.modelValue : localValue.value);
96
+ function updateModelValue(value) {
97
+ if (!isModelControlled())
98
+ localValue.value = value;
99
+ emit("update:modelValue", value);
100
+ }
101
+ const formName = computed(() => props.name ?? field?.name);
102
+ const nativeFormValue = computed(() => {
103
+ const value = modelValue.value;
104
+ if (!value)
105
+ return "";
106
+ if ("start" in value)
107
+ return `${value.start?.toString() ?? ""} - ${value.end?.toString() ?? ""}`;
108
+ return value.toString();
109
+ });
110
+ const formAnchor = ref();
111
+ let ownerForm = null;
112
+ function resetDatePicker(event) {
113
+ queueMicrotask(() => {
114
+ if (event.defaultPrevented || isModelControlled())
115
+ return;
116
+ updateModelValue(initialValue);
117
+ onUpdateOpen(false);
118
+ });
119
+ }
120
+ onMounted(() => {
121
+ ownerForm = formAnchor.value?.form ?? null;
122
+ ownerForm?.addEventListener("reset", resetDatePicker);
123
+ });
124
+ onUnmounted(() => ownerForm?.removeEventListener("reset", resetDatePicker));
85
125
  const datePickerId = computed(() => props.id ?? field?.id);
86
126
  const hourInputId = useId();
87
127
  const minuteInputId = useId();
@@ -90,11 +130,11 @@ const describedBy = computed(() => field?.describedBy.value);
90
130
  const effectiveSize = computed(() => props.size ?? field?.size ?? "md");
91
131
  const iconButtonSize = computed(() => ({ sm: "sm", md: "sm", lg: "md" })[effectiveSize.value]);
92
132
  const effectiveNumberOfMonths = computed(() => props.numberOfMonths ?? (props.range ? 2 : 1));
93
- const singleModelValue = computed(() => props.range ? void 0 : props.modelValue);
94
- const rangeModelValue = computed(() => props.range ? props.modelValue : void 0);
95
- const hasValue = computed(() => props.range ? !!props.modelValue?.start : !!props.modelValue);
133
+ const singleModelValue = computed(() => props.range ? void 0 : modelValue.value);
134
+ const rangeModelValue = computed(() => props.range ? modelValue.value : void 0);
135
+ const hasValue = computed(() => props.range ? !!modelValue.value?.start : !!modelValue.value);
96
136
  function clear() {
97
- emit("update:modelValue", props.range ? { start: void 0, end: void 0 } : void 0);
137
+ updateModelValue(props.range ? { start: void 0, end: void 0 } : void 0);
98
138
  }
99
139
  const defaultView = computed(() => {
100
140
  if (props.granularity === "month" || props.granularity === "year")
@@ -137,15 +177,20 @@ const placeholder = shallowRef((() => {
137
177
  const seed = singleModelValue.value ?? today(getLocalTimeZone());
138
178
  return isTimeGranularity.value ? ensureTimeCapable(seed) : seed;
139
179
  })());
140
- const isOpen = ref(false);
141
- watch(isOpen, (open) => {
142
- if (!open)
180
+ const localOpen = ref(props.defaultOpen ?? false);
181
+ const isOpenControlled = () => Object.hasOwn(instance.vnode.props ?? {}, "open");
182
+ const open = computed(() => isOpenControlled() ? props.open ?? false : localOpen.value);
183
+ function onUpdateOpen(value) {
184
+ if (!isOpenControlled())
185
+ localOpen.value = value;
186
+ emit("update:open", value);
187
+ }
188
+ watch(open, (open2) => {
189
+ if (!open2)
143
190
  setView(defaultView.value);
144
191
  });
145
- const isRangeOpen = ref(false);
146
192
  const isMobile = useIsMobile();
147
- const showMobileModal = computed(() => props.mobileModal && isMobile.value);
148
- const mobileModalUi = { content: "rounded-[var(--ui-radius-md)]" };
193
+ const adaptiveUi = { content: "rounded-[var(--selaras-resolved-radius-md)]" };
149
194
  const effectiveLocale = computed(() => props.locale ?? useLocale().value);
150
195
  const monthFormatter = computed(() => new DateFormatter(effectiveLocale.value, { month: "short" }));
151
196
  const monthGridItems = computed(() => Array.from({ length: 12 }, (_, i) => {
@@ -186,9 +231,9 @@ function isYearDisabled(year) {
186
231
  function selectMonth(date) {
187
232
  placeholder.value = date;
188
233
  if (props.granularity === "month") {
189
- emit("update:modelValue", normalizeForGranularity(date));
234
+ updateModelValue(normalizeForGranularity(date));
190
235
  if (props.closeOnSelect)
191
- isOpen.value = false;
236
+ onUpdateOpen(false);
192
237
  return;
193
238
  }
194
239
  setView("date");
@@ -197,9 +242,9 @@ function selectYear(year) {
197
242
  const value = placeholder.value.set({ year });
198
243
  placeholder.value = value;
199
244
  if (props.granularity === "year") {
200
- emit("update:modelValue", normalizeForGranularity(value));
245
+ updateModelValue(normalizeForGranularity(value));
201
246
  if (props.closeOnSelect)
202
- isOpen.value = false;
247
+ onUpdateOpen(false);
203
248
  return;
204
249
  }
205
250
  setView("month");
@@ -221,32 +266,40 @@ const placeholderMinute = computed(() => "minute" in placeholder.value ? placeho
221
266
  function setHour(hour24) {
222
267
  const value = ensureTimeCapable(placeholder.value).set({ hour: hour24 });
223
268
  placeholder.value = value;
224
- emit("update:modelValue", normalizeForGranularity(value));
269
+ updateModelValue(normalizeForGranularity(value));
225
270
  }
226
271
  function setMinute(minute) {
227
272
  const value = ensureTimeCapable(placeholder.value).set({ minute });
228
273
  placeholder.value = value;
229
- emit("update:modelValue", normalizeForGranularity(value));
274
+ updateModelValue(normalizeForGranularity(value));
230
275
  }
231
276
  const timeOnlyGranularity = computed(() => props.granularity === "hour" ? "hour" : "minute");
232
- const timeOnlyValue = computed(() => props.timeOnly ? props.modelValue : void 0);
277
+ const timeOnlyValue = computed(() => props.timeOnly ? modelValue.value : void 0);
233
278
  const timePlaceholder = shallowRef(timeOnlyValue.value ?? (() => {
234
279
  const now = /* @__PURE__ */ new Date();
235
280
  return new Time(now.getHours(), now.getMinutes());
236
281
  })());
237
- const timeIsOpen = ref(false);
282
+ const mobilePresentation = ref(false);
283
+ watch(open, (value) => {
284
+ mobilePresentation.value = value && !!props.adaptive && isMobile.value;
285
+ });
286
+ onMounted(() => {
287
+ if (open.value)
288
+ mobilePresentation.value = !!props.adaptive && isMobile.value;
289
+ });
290
+ const showMobileModal = computed(() => mobilePresentation.value);
238
291
  function normalizeTimeOnly(value) {
239
292
  return timeOnlyGranularity.value === "hour" ? value.set({ minute: 0, second: 0, millisecond: 0 }) : value.set({ second: 0, millisecond: 0 });
240
293
  }
241
294
  function setTimeOnlyHour(hour24) {
242
295
  const value = timePlaceholder.value.set({ hour: hour24 });
243
296
  timePlaceholder.value = value;
244
- emit("update:modelValue", normalizeTimeOnly(value));
297
+ updateModelValue(normalizeTimeOnly(value));
245
298
  }
246
299
  function setTimeOnlyMinute(minute) {
247
300
  const value = timePlaceholder.value.set({ minute });
248
301
  timePlaceholder.value = value;
249
- emit("update:modelValue", normalizeTimeOnly(value));
302
+ updateModelValue(normalizeTimeOnly(value));
250
303
  }
251
304
  const timeOnlyFormatter = computed(() => new DateFormatter(effectiveLocale.value, props.format ?? (timeOnlyGranularity.value === "hour" ? { hour: "numeric" } : { timeStyle: "short" })));
252
305
  const formattedTimeValue = computed(() => {
@@ -255,6 +308,9 @@ const formattedTimeValue = computed(() => {
255
308
  const asDateTime = toCalendarDateTime(today(getLocalTimeZone()), timeOnlyValue.value);
256
309
  return timeOnlyFormatter.value.format(asDateTime.toDate(getLocalTimeZone()));
257
310
  });
311
+ function segmentText(segment) {
312
+ return segment.part === "literal" ? segment.value.replace(/[\u00A0\u202F]/g, " ") : segment.value;
313
+ }
258
314
  function visibleSegments(segments) {
259
315
  if (props.granularity === "day" || isTimeGranularity.value)
260
316
  return segments;
@@ -286,19 +342,20 @@ const defaultFormat = computed(() => {
286
342
  const dateFormatter = computed(() => new DateFormatter(effectiveLocale.value, props.format ?? defaultFormat.value));
287
343
  const formattedValue = computed(() => {
288
344
  if (props.range) {
289
- const range = props.modelValue;
345
+ const range = modelValue.value;
290
346
  if (!range?.start)
291
347
  return "";
292
348
  const startDate = range.start.toDate(getLocalTimeZone());
293
349
  return range.end ? dateFormatter.value.formatRange(startDate, range.end.toDate(getLocalTimeZone())) : dateFormatter.value.format(startDate);
294
350
  }
295
- const value = props.modelValue;
351
+ const value = modelValue.value;
296
352
  return value ? dateFormatter.value.format(value.toDate(getLocalTimeZone())) : "";
297
353
  });
298
354
  const icons = useIcons();
299
355
  const messages = useMessages();
300
356
  const theme = useComponentTheme("datePicker", datePickerTheme);
301
357
  const ui = computed(() => theme.value({ size: effectiveSize.value, invalid: datePickerInvalid.value, range: props.range }));
358
+ const fieldColor = computed(() => datePickerInvalid.value ? "danger" : resolveRegisteredColorRole(props.activeColor, "primary"));
302
359
  const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root);
303
360
  const fieldProps = computed(() => resolveSlot(ui.value.field, props.ui?.field));
304
361
  const segmentProps = computed(() => resolveSlot(ui.value.segment, props.ui?.segment));
@@ -356,7 +413,7 @@ const calendarBodyProps = computed(() => ({
356
413
  setMinute,
357
414
  closeOnSelect: props.closeOnSelect,
358
415
  close: () => {
359
- isOpen.value = false;
416
+ onUpdateOpen(false);
360
417
  },
361
418
  headerProps: headerProps.value,
362
419
  headingProps: headingProps.value,
@@ -382,14 +439,14 @@ const timeBodyProps = computed(() => ({
382
439
  closeOnSelect: props.closeOnSelect,
383
440
  activeColor: props.activeColor,
384
441
  close: () => {
385
- timeIsOpen.value = false;
442
+ onUpdateOpen(false);
386
443
  },
387
444
  timeSectionProps: timeSectionProps.value
388
445
  }));
389
446
  const buttonTriggerUi = computed(() => ({
390
447
  base: [
391
- "w-full justify-start rounded-[var(--ui-radius-md)] bg-[var(--ui-bg)] text-[var(--ui-text)] ring-1 ring-inset ring-[var(--ui-border)] hover:ring-[var(--ui-border-hover)] hover:bg-[var(--ui-bg-elevated)]",
392
- datePickerInvalid.value ? "ring-[var(--ui-danger)] hover:ring-[var(--ui-danger)]" : void 0,
448
+ "w-full justify-start rounded-[var(--selaras-resolved-radius-md)] bg-[var(--selaras-resolved-surface-default)] text-[var(--selaras-resolved-text-default)] ring-1 ring-inset ring-[var(--selaras-resolved-border-default)] hover:ring-[var(--selaras-resolved-border-hover)] hover:bg-[var(--selaras-resolved-surface-elevated)]",
449
+ datePickerInvalid.value ? "ring-[var(--_selaras-color-fill)] hover:ring-[var(--_selaras-color-fill)]" : void 0,
393
450
  // Room for the clear button, which sits absolutely positioned on top of
394
451
  // this same end edge - without it, a long formatted date can run under it.
395
452
  props.clearable && hasValue.value ? "pe-8" : void 0
@@ -407,8 +464,10 @@ const buttonTriggerUi = computed(() => ({
407
464
  <DateRangePickerRoot
408
465
  v-if="range"
409
466
  :id="datePickerId"
410
- v-model:open="isRangeOpen"
411
- :name="name ?? field?.name"
467
+ :default-open="defaultOpen"
468
+ :open="open"
469
+ v-bind="rootProps"
470
+ :name="undefined"
412
471
  :model-value="rangeModelValue"
413
472
  :min-value="minValue"
414
473
  :max-value="maxValue"
@@ -428,21 +487,22 @@ const buttonTriggerUi = computed(() => ({
428
487
  :disabled="disabled"
429
488
  :readonly="readonly"
430
489
  :prevent-deselect="preventDeselect"
431
- v-bind="rootProps"
432
- @update:model-value="(value) => emit('update:modelValue', value)"
490
+ :data-selaras-color="fieldColor"
491
+ @update:open="onUpdateOpen"
492
+ @update:model-value="(value) => updateModelValue(value)"
433
493
  >
434
494
  <DateRangePickerAnchor as-child>
435
- <div v-if="triggerMode === 'field'" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps">
436
- <DateRangePickerField v-slot="{ segments }">
495
+ <div v-if="triggerMode === 'field'" :data-selaras-color="fieldColor" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps" :aria-labelledby="field?.labelId">
496
+ <DateRangePickerField v-slot="{ segments }" :aria-labelledby="field?.labelId" :aria-describedby="describedBy" :aria-invalid="datePickerInvalid || void 0">
437
497
  <template v-for="segment in segments.start" :key="`start-${segment.part}`">
438
498
  <DateRangePickerInput as="span" type="start" :part="segment.part" v-bind="segmentProps">
439
- {{ segment.value }}
499
+ {{ segmentText(segment) }}
440
500
  </DateRangePickerInput>
441
501
  </template>
442
502
  <span v-bind="separatorProps">&ndash;</span>
443
503
  <template v-for="segment in segments.end" :key="`end-${segment.part}`">
444
504
  <DateRangePickerInput as="span" type="end" :part="segment.part" v-bind="segmentProps">
445
- {{ segment.value }}
505
+ {{ segmentText(segment) }}
446
506
  </DateRangePickerInput>
447
507
  </template>
448
508
  </DateRangePickerField>
@@ -481,6 +541,7 @@ const buttonTriggerUi = computed(() => ({
481
541
  :size="effectiveSize"
482
542
  :aria-invalid="datePickerInvalid || void 0"
483
543
  :aria-describedby="describedBy"
544
+ :aria-labelledby="field?.labelId"
484
545
  :ui="buttonTriggerUi"
485
546
  >
486
547
  {{ hasValue ? formattedValue : messages.pickDate }}
@@ -509,7 +570,7 @@ const buttonTriggerUi = computed(() => ({
509
570
  </div>
510
571
  </DateRangePickerAnchor>
511
572
 
512
- <DateRangePickerContent v-if="!showMobileModal" :side-offset="6" align="start" v-bind="contentProps">
573
+ <DateRangePickerContent v-if="!showMobileModal" :side-offset="6" align="start" :data-selaras-theme="themeBindings['data-selaras-theme']" :data-selaras-mode="themeBindings['data-selaras-mode']" :style="themeBindings.style" v-bind="contentProps">
513
574
  <DatePickerRangeCalendarBody v-bind="rangeBodyProps">
514
575
  <template #day="scope">
515
576
  <slot name="day" v-bind="scope" />
@@ -524,13 +585,13 @@ const buttonTriggerUi = computed(() => ({
524
585
  Below 768px, the exact same DatePickerRangeCalendarBody - the same
525
586
  Root-injected grid/selection state, unchanged - inside a centered
526
587
  Modal instead of the small anchored popover above. See
527
- ComboboxSelectBase.vue's own mobileModal branch for why there's no
588
+ ComboboxSelectBase.vue's own adaptive branch for why there's no
528
589
  extra portal here and why `title`/`description` are passed
529
590
  explicitly.
530
591
  -->
531
592
  <Modal
532
- v-else :open="isRangeOpen" :title="messages.dateRangePicker" :description="messages.dateRangePickerDescription"
533
- :ui="mobileModalUi" @update:open="isRangeOpen = $event"
593
+ v-else :open="open" :title="messages.dateRangePicker" :description="messages.dateRangePickerDescription"
594
+ :ui="adaptiveUi" @update:open="onUpdateOpen"
534
595
  >
535
596
  <template #content>
536
597
  <div v-bind="mobileContentProps">
@@ -547,25 +608,28 @@ const buttonTriggerUi = computed(() => ({
547
608
  </Modal>
548
609
  </DateRangePickerRoot>
549
610
 
550
- <PopoverRoot v-else-if="timeOnly" v-model:open="timeIsOpen">
611
+ <PopoverRoot v-else-if="timeOnly" :open="open" :data-selaras-color="fieldColor" @update:open="onUpdateOpen">
551
612
  <PopoverAnchor as-child>
552
- <div v-if="triggerMode === 'field'" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps">
613
+ <div v-if="triggerMode === 'field'" :data-selaras-color="fieldColor" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps" :aria-labelledby="field?.labelId">
553
614
  <TimeFieldRoot
554
615
  :id="datePickerId"
555
616
  v-slot="{ segments }"
556
617
  v-model:placeholder="timePlaceholder"
618
+ :aria-labelledby="field?.labelId"
619
+ :aria-describedby="describedBy"
620
+ :aria-invalid="datePickerInvalid || void 0"
557
621
  :model-value="timeOnlyValue"
558
- :name="name ?? field?.name"
622
+ :name="undefined"
559
623
  :locale="effectiveLocale"
560
624
  :hour-cycle="hourCycle"
561
625
  :granularity="timeOnlyGranularity"
562
626
  :disabled="disabled"
563
627
  :readonly="readonly"
564
- @update:model-value="(value) => emit('update:modelValue', value ? normalizeTimeOnly(value) : void 0)"
628
+ @update:model-value="(value) => updateModelValue(value ? normalizeTimeOnly(value) : void 0)"
565
629
  >
566
630
  <template v-for="segment in segments" :key="segment.part">
567
631
  <TimeFieldInput as="span" :part="segment.part" v-bind="segmentProps">
568
- {{ segment.value }}
632
+ {{ segmentText(segment) }}
569
633
  </TimeFieldInput>
570
634
  </template>
571
635
  </TimeFieldRoot>
@@ -604,6 +668,7 @@ const buttonTriggerUi = computed(() => ({
604
668
  :size="effectiveSize"
605
669
  :aria-invalid="datePickerInvalid || void 0"
606
670
  :aria-describedby="describedBy"
671
+ :aria-labelledby="field?.labelId"
607
672
  :ui="buttonTriggerUi"
608
673
  >
609
674
  {{ hasValue ? formattedTimeValue : messages.pickTime }}
@@ -633,7 +698,7 @@ const buttonTriggerUi = computed(() => ({
633
698
  </PopoverAnchor>
634
699
 
635
700
  <PopoverPortal v-if="!showMobileModal">
636
- <PopoverContent :side-offset="6" align="start" v-bind="contentProps">
701
+ <PopoverContent :side-offset="6" align="start" :data-selaras-theme="themeBindings['data-selaras-theme']" :data-selaras-mode="themeBindings['data-selaras-mode']" :style="themeBindings.style" v-bind="contentProps">
637
702
  <DatePickerTimeBody v-bind="timeBodyProps">
638
703
  <template #footer>
639
704
  <slot name="footer" />
@@ -644,8 +709,8 @@ const buttonTriggerUi = computed(() => ({
644
709
  </PopoverPortal>
645
710
  <!-- Below 768px - see the range branch's own identical note above. -->
646
711
  <Modal
647
- v-else :open="timeIsOpen" :title="messages.timePicker" :description="messages.timePickerDescription"
648
- :ui="mobileModalUi" @update:open="timeIsOpen = $event"
712
+ v-else :open="open" :title="messages.timePicker" :description="messages.timePickerDescription"
713
+ :ui="adaptiveUi" @update:open="onUpdateOpen"
649
714
  >
650
715
  <template #content>
651
716
  <div v-bind="mobileContentProps">
@@ -663,8 +728,10 @@ const buttonTriggerUi = computed(() => ({
663
728
  v-else
664
729
  :id="datePickerId"
665
730
  v-model:placeholder="placeholder"
666
- v-model:open="isOpen"
667
- :name="name ?? field?.name"
731
+ :default-open="defaultOpen"
732
+ :open="open"
733
+ v-bind="rootProps"
734
+ :name="undefined"
668
735
  :model-value="singleModelValue"
669
736
  :min-value="minValue"
670
737
  :max-value="maxValue"
@@ -681,15 +748,16 @@ const buttonTriggerUi = computed(() => ({
681
748
  :disabled="disabled"
682
749
  :readonly="readonly"
683
750
  :prevent-deselect="preventDeselect"
684
- v-bind="rootProps"
685
- @update:model-value="(value) => emit('update:modelValue', normalizeForGranularity(value))"
751
+ :data-selaras-color="fieldColor"
752
+ @update:open="onUpdateOpen"
753
+ @update:model-value="(value) => updateModelValue(normalizeForGranularity(value))"
686
754
  >
687
755
  <DatePickerAnchor as-child>
688
- <div v-if="triggerMode === 'field'" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps">
689
- <DatePickerField v-slot="{ segments }">
756
+ <div v-if="triggerMode === 'field'" :data-selaras-color="fieldColor" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps" :aria-labelledby="field?.labelId">
757
+ <DatePickerField v-slot="{ segments }" :aria-labelledby="field?.labelId" :aria-describedby="describedBy" :aria-invalid="datePickerInvalid || void 0">
690
758
  <template v-for="(segment, index) in visibleSegments(segments)" :key="`${segment.part}-${index}`">
691
759
  <DatePickerInput as="span" :part="segment.part" v-bind="segmentProps">
692
- {{ segment.value }}
760
+ {{ segmentText(segment) }}
693
761
  </DatePickerInput>
694
762
  </template>
695
763
  </DatePickerField>
@@ -728,6 +796,7 @@ const buttonTriggerUi = computed(() => ({
728
796
  :size="effectiveSize"
729
797
  :aria-invalid="datePickerInvalid || void 0"
730
798
  :aria-describedby="describedBy"
799
+ :aria-labelledby="field?.labelId"
731
800
  :ui="buttonTriggerUi"
732
801
  >
733
802
  {{ hasValue ? formattedValue : messages.pickDate }}
@@ -763,7 +832,7 @@ const buttonTriggerUi = computed(() => ({
763
832
  center without clipping, so it silently hides instead. Centering the
764
833
  panel on the trigger only when `arrow` is on sidesteps that without
765
834
  changing the default (start-aligned) layout everyone already sees. -->
766
- <DatePickerContent v-if="!showMobileModal" :side-offset="6" :align="arrow ? 'center' : 'start'" v-bind="contentProps">
835
+ <DatePickerContent v-if="!showMobileModal" :side-offset="6" :align="arrow ? 'center' : 'start'" :data-selaras-theme="themeBindings['data-selaras-theme']" :data-selaras-mode="themeBindings['data-selaras-mode']" :style="themeBindings.style" v-bind="contentProps">
767
836
  <DatePickerCalendarBody v-bind="calendarBodyProps">
768
837
  <template #day="scope">
769
838
  <slot name="day" v-bind="scope" />
@@ -776,8 +845,8 @@ const buttonTriggerUi = computed(() => ({
776
845
  </DatePickerContent>
777
846
  <!-- Below 768px - see the range branch's own identical note above. -->
778
847
  <Modal
779
- v-else :open="isOpen" :title="messages.datePicker" :description="messages.datePickerDescription"
780
- :ui="mobileModalUi" @update:open="isOpen = $event"
848
+ v-else :open="open" :title="messages.datePicker" :description="messages.datePickerDescription"
849
+ :ui="adaptiveUi" @update:open="onUpdateOpen"
781
850
  >
782
851
  <template #content>
783
852
  <div v-bind="mobileContentProps">
@@ -793,4 +862,5 @@ const buttonTriggerUi = computed(() => ({
793
862
  </template>
794
863
  </Modal>
795
864
  </DatePickerRoot>
865
+ <input ref="formAnchor" type="hidden" :name="formName" :form="form" :value="nativeFormValue">
796
866
  </template>
@@ -1,18 +1,24 @@
1
1
  import type { DateValue } from '@internationalized/date';
2
2
  import type { DateRange } from 'reka-ui';
3
3
  import type { VariantProps } from 'tailwind-variants';
4
- import type { buttonTheme } from '../theme/button.js';
5
4
  import type { DatePickerThemeSlots } from '../theme/date-picker.js';
5
+ import type { ColorRole } from '../utils/color-registry.js';
6
6
  import type { UiProp } from '../utils/ui.js';
7
7
  import { Time } from '@internationalized/date';
8
8
  import { datePickerTheme } from '../theme/date-picker.js';
9
9
  type DatePickerVariants = VariantProps<typeof datePickerTheme>;
10
- type ButtonVariants = VariantProps<typeof buttonTheme>;
11
10
  export interface DatePickerProps {
12
11
  id?: string;
13
12
  name?: string;
13
+ /** ID of an associated form outside the component's ancestors. */
14
+ form?: string;
15
+ open?: boolean;
16
+ /** Initial uncontrolled open state. */
17
+ defaultOpen?: boolean;
14
18
  /** A single DateValue, Reka's own `{ start?, end? }` DateRange shape when `range` is set, or a bare date-less Time when `timeOnly` is set - Vue props can't express a type that depends on a sibling prop's value, so this stays a plain union documented here rather than enforced by the type checker. */
15
19
  modelValue?: DateValue | DateRange | Time;
20
+ /** Initial uncontrolled value and native form-reset target. */
21
+ defaultValue?: DateValue | DateRange | Time;
16
22
  /** Switches to picking a start+end pair instead of one date - a real fork in which Reka primitive family renders (RangeCalendar/DateRangePicker vs Calendar/DatePicker), not just a different modelValue shape. */
17
23
  range?: boolean;
18
24
  /** Drops the date entirely - just a time-of-day picker. modelValue becomes a bare `Time` (no date component at all, not a DateValue). A third top-level mode alongside `range`; every date-grid-specific prop below (minValue/maxValue/isDateUnavailable/isDateDisabled/numberOfMonths/pagedNavigation/weekStartsOn/weekdayFormat/fixedWeeks/view) is simply inert here. `granularity` still applies ('hour'/'minute' only - defaults to 'minute' for a dedicated time picker). */
@@ -62,17 +68,18 @@ export interface DatePickerProps {
62
68
  invalid?: boolean;
63
69
  clearable?: boolean;
64
70
  /** Chrome color - the clear/trigger buttons and prev/next month nav. Only the color changes; each button keeps its own deliberately-different variant (icon-only buttons use `text`, nav arrows use `ghost`). */
65
- color?: ButtonVariants['color'];
71
+ color?: ColorRole;
66
72
  /** The color of whatever's currently "active" - the selected day/month/year cell and the Done button. */
67
- activeColor?: ButtonVariants['color'];
73
+ activeColor?: ColorRole;
68
74
  size?: DatePickerVariants['size'];
69
75
  /** Shows a small pointer triangle connecting the panel to its trigger. */
70
76
  arrow?: boolean;
71
- /** Below 768px viewport width, presents the calendar as a centered Modal instead of a small anchored panel - easier to tap with a finger. Opt-in (defaults `false`) rather than automatic, so an existing usage's look never changes without asking for it. */
72
- mobileModal?: boolean;
77
+ /** Opts into the calendar's accessible small-screen modal presentation. It is selected when the calendar opens and held until close. */
78
+ adaptive?: boolean;
73
79
  ui?: UiProp<DatePickerThemeSlots>;
74
80
  }
75
81
  export interface DatePickerEmits {
82
+ 'update:open': [value: boolean];
76
83
  'update:modelValue': [value: DateValue | DateRange | Time | undefined];
77
84
  'update:view': [view: 'date' | 'month' | 'year'];
78
85
  }
@@ -92,17 +99,17 @@ declare var __VLS_43: {}, __VLS_63: {}, __VLS_83: {}, __VLS_99: {}, __VLS_119: {
92
99
  selectionStart: boolean;
93
100
  selectionEnd: boolean;
94
101
  highlighted: boolean;
95
- }, __VLS_148: {}, __VLS_186: {}, __VLS_206: {}, __VLS_226: {}, __VLS_242: {}, __VLS_268: {}, __VLS_291: {}, __VLS_329: {}, __VLS_349: {}, __VLS_369: {}, __VLS_385: {}, __VLS_405: {
102
+ }, __VLS_148: {}, __VLS_187: {}, __VLS_207: {}, __VLS_227: {}, __VLS_243: {}, __VLS_269: {}, __VLS_292: {}, __VLS_330: {}, __VLS_350: {}, __VLS_370: {}, __VLS_386: {}, __VLS_406: {
96
103
  date: DateValue;
97
104
  dayValue: string;
98
105
  selected: boolean;
99
106
  disabled: boolean;
100
- }, __VLS_408: {}, __VLS_431: {
107
+ }, __VLS_409: {}, __VLS_432: {
101
108
  date: DateValue;
102
109
  dayValue: string;
103
110
  selected: boolean;
104
111
  disabled: boolean;
105
- }, __VLS_434: {};
112
+ }, __VLS_435: {};
106
113
  type __VLS_Slots = {} & {
107
114
  'clear-icon'?: (props: typeof __VLS_43) => any;
108
115
  } & {
@@ -120,39 +127,41 @@ type __VLS_Slots = {} & {
120
127
  } & {
121
128
  footer?: (props: typeof __VLS_148) => any;
122
129
  } & {
123
- 'clear-icon'?: (props: typeof __VLS_186) => any;
130
+ 'clear-icon'?: (props: typeof __VLS_187) => any;
124
131
  } & {
125
- 'trigger-icon'?: (props: typeof __VLS_206) => any;
132
+ 'trigger-icon'?: (props: typeof __VLS_207) => any;
126
133
  } & {
127
- 'trigger-icon'?: (props: typeof __VLS_226) => any;
134
+ 'trigger-icon'?: (props: typeof __VLS_227) => any;
128
135
  } & {
129
- 'clear-icon'?: (props: typeof __VLS_242) => any;
136
+ 'clear-icon'?: (props: typeof __VLS_243) => any;
130
137
  } & {
131
- footer?: (props: typeof __VLS_268) => any;
138
+ footer?: (props: typeof __VLS_269) => any;
132
139
  } & {
133
- footer?: (props: typeof __VLS_291) => any;
140
+ footer?: (props: typeof __VLS_292) => any;
134
141
  } & {
135
- 'clear-icon'?: (props: typeof __VLS_329) => any;
142
+ 'clear-icon'?: (props: typeof __VLS_330) => any;
136
143
  } & {
137
- 'trigger-icon'?: (props: typeof __VLS_349) => any;
144
+ 'trigger-icon'?: (props: typeof __VLS_350) => any;
138
145
  } & {
139
- 'trigger-icon'?: (props: typeof __VLS_369) => any;
146
+ 'trigger-icon'?: (props: typeof __VLS_370) => any;
140
147
  } & {
141
- 'clear-icon'?: (props: typeof __VLS_385) => any;
148
+ 'clear-icon'?: (props: typeof __VLS_386) => any;
142
149
  } & {
143
- day?: (props: typeof __VLS_405) => any;
150
+ day?: (props: typeof __VLS_406) => any;
144
151
  } & {
145
- footer?: (props: typeof __VLS_408) => any;
152
+ footer?: (props: typeof __VLS_409) => any;
146
153
  } & {
147
- day?: (props: typeof __VLS_431) => any;
154
+ day?: (props: typeof __VLS_432) => any;
148
155
  } & {
149
- footer?: (props: typeof __VLS_434) => any;
156
+ footer?: (props: typeof __VLS_435) => any;
150
157
  };
151
158
  declare const __VLS_base: import("vue").DefineComponent<DatePickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
152
159
  "update:modelValue": (value: DateValue | DateRange | Time | undefined) => any;
160
+ "update:open": (value: boolean) => any;
153
161
  "update:view": (view: "month" | "year" | "date") => any;
154
162
  }, string, import("vue").PublicProps, Readonly<DatePickerProps> & Readonly<{
155
163
  "onUpdate:modelValue"?: ((value: DateValue | DateRange | Time | undefined) => any) | undefined;
164
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
156
165
  "onUpdate:view"?: ((view: "month" | "year" | "date") => any) | undefined;
157
166
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
158
167
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -2,6 +2,8 @@ import type { DrawerThemeSlots } from '../theme/drawer.js';
2
2
  import type { UiProp } from '../utils/ui.js';
3
3
  export interface DrawerProps {
4
4
  open?: boolean;
5
+ /** Initial visibility for an uncontrolled drawer. Supplying `open` makes the parent authoritative. */
6
+ defaultOpen?: boolean;
5
7
  title?: string;
6
8
  description?: string;
7
9
  /** Which edge the panel slides in from - also the direction it's swiped toward to dismiss it. */