@nuxt/ui 4.8.2 → 4.10.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 (588) hide show
  1. package/dist/module.d.mts +7 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +7 -2
  4. package/dist/runtime/components/Accordion.d.vue.ts +2 -2
  5. package/dist/runtime/components/Accordion.vue +1 -1
  6. package/dist/runtime/components/Accordion.vue.d.ts +2 -2
  7. package/dist/runtime/components/Alert.d.vue.ts +4 -1
  8. package/dist/runtime/components/Alert.vue +1 -1
  9. package/dist/runtime/components/Alert.vue.d.ts +4 -1
  10. package/dist/runtime/components/App.d.vue.ts +3 -3
  11. package/dist/runtime/components/App.vue.d.ts +3 -3
  12. package/dist/runtime/components/AuthForm.d.vue.ts +11 -2
  13. package/dist/runtime/components/AuthForm.vue +22 -13
  14. package/dist/runtime/components/AuthForm.vue.d.ts +11 -2
  15. package/dist/runtime/components/Avatar.d.vue.ts +2 -1
  16. package/dist/runtime/components/Avatar.vue +4 -4
  17. package/dist/runtime/components/Avatar.vue.d.ts +2 -1
  18. package/dist/runtime/components/AvatarGroup.vue +1 -1
  19. package/dist/runtime/components/Badge.vue +1 -1
  20. package/dist/runtime/components/Banner.d.vue.ts +3 -1
  21. package/dist/runtime/components/Banner.vue +4 -4
  22. package/dist/runtime/components/Banner.vue.d.ts +3 -1
  23. package/dist/runtime/components/BlogPost.d.vue.ts +5 -3
  24. package/dist/runtime/components/BlogPost.vue +18 -13
  25. package/dist/runtime/components/BlogPost.vue.d.ts +5 -3
  26. package/dist/runtime/components/BlogPosts.d.vue.ts +2 -2
  27. package/dist/runtime/components/BlogPosts.vue +1 -1
  28. package/dist/runtime/components/BlogPosts.vue.d.ts +2 -2
  29. package/dist/runtime/components/Breadcrumb.d.vue.ts +4 -2
  30. package/dist/runtime/components/Breadcrumb.vue +1 -1
  31. package/dist/runtime/components/Breadcrumb.vue.d.ts +4 -2
  32. package/dist/runtime/components/Button.d.vue.ts +2 -2
  33. package/dist/runtime/components/Button.vue +2 -2
  34. package/dist/runtime/components/Button.vue.d.ts +2 -2
  35. package/dist/runtime/components/Calendar.d.vue.ts +44 -6
  36. package/dist/runtime/components/Calendar.vue +180 -62
  37. package/dist/runtime/components/Calendar.vue.d.ts +44 -6
  38. package/dist/runtime/components/Card.vue +1 -1
  39. package/dist/runtime/components/Carousel.d.vue.ts +4 -2
  40. package/dist/runtime/components/Carousel.vue +2 -5
  41. package/dist/runtime/components/Carousel.vue.d.ts +4 -2
  42. package/dist/runtime/components/ChangelogVersion.d.vue.ts +4 -2
  43. package/dist/runtime/components/ChangelogVersion.vue +4 -4
  44. package/dist/runtime/components/ChangelogVersion.vue.d.ts +4 -2
  45. package/dist/runtime/components/ChangelogVersions.d.vue.ts +2 -2
  46. package/dist/runtime/components/ChangelogVersions.vue +1 -1
  47. package/dist/runtime/components/ChangelogVersions.vue.d.ts +2 -2
  48. package/dist/runtime/components/ChatMessage.d.vue.ts +4 -2
  49. package/dist/runtime/components/ChatMessage.vue +1 -1
  50. package/dist/runtime/components/ChatMessage.vue.d.ts +4 -2
  51. package/dist/runtime/components/ChatMessages.d.vue.ts +12 -5
  52. package/dist/runtime/components/ChatMessages.vue +8 -5
  53. package/dist/runtime/components/ChatMessages.vue.d.ts +12 -5
  54. package/dist/runtime/components/ChatPalette.vue +1 -1
  55. package/dist/runtime/components/ChatPrompt.d.vue.ts +15 -1
  56. package/dist/runtime/components/ChatPrompt.vue +38 -21
  57. package/dist/runtime/components/ChatPrompt.vue.d.ts +15 -1
  58. package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +8 -6
  59. package/dist/runtime/components/ChatPromptSubmit.vue +3 -3
  60. package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +8 -6
  61. package/dist/runtime/components/ChatReasoning.d.vue.ts +2 -2
  62. package/dist/runtime/components/ChatReasoning.vue +1 -1
  63. package/dist/runtime/components/ChatReasoning.vue.d.ts +2 -2
  64. package/dist/runtime/components/ChatShimmer.vue +1 -1
  65. package/dist/runtime/components/ChatTool.d.vue.ts +9 -2
  66. package/dist/runtime/components/ChatTool.vue +20 -2
  67. package/dist/runtime/components/ChatTool.vue.d.ts +9 -2
  68. package/dist/runtime/components/Checkbox.d.vue.ts +2 -2
  69. package/dist/runtime/components/Checkbox.vue +2 -2
  70. package/dist/runtime/components/Checkbox.vue.d.ts +2 -2
  71. package/dist/runtime/components/CheckboxGroup.d.vue.ts +2 -2
  72. package/dist/runtime/components/CheckboxGroup.vue.d.ts +2 -2
  73. package/dist/runtime/components/Chip.vue +3 -3
  74. package/dist/runtime/components/Collapsible.vue +1 -1
  75. package/dist/runtime/components/ColorPicker.vue +1 -1
  76. package/dist/runtime/components/CommandPalette.d.vue.ts +15 -9
  77. package/dist/runtime/components/CommandPalette.vue +12 -6
  78. package/dist/runtime/components/CommandPalette.vue.d.ts +15 -9
  79. package/dist/runtime/components/Container.vue +1 -1
  80. package/dist/runtime/components/ContextMenu.d.vue.ts +5 -2
  81. package/dist/runtime/components/ContextMenu.vue +1 -1
  82. package/dist/runtime/components/ContextMenu.vue.d.ts +5 -2
  83. package/dist/runtime/components/ContextMenuContent.d.vue.ts +3 -2
  84. package/dist/runtime/components/ContextMenuContent.vue +1 -0
  85. package/dist/runtime/components/ContextMenuContent.vue.d.ts +3 -2
  86. package/dist/runtime/components/DashboardGroup.d.vue.ts +1 -1
  87. package/dist/runtime/components/DashboardGroup.vue +1 -1
  88. package/dist/runtime/components/DashboardGroup.vue.d.ts +1 -1
  89. package/dist/runtime/components/DashboardNavbar.d.vue.ts +3 -1
  90. package/dist/runtime/components/DashboardNavbar.vue +2 -2
  91. package/dist/runtime/components/DashboardNavbar.vue.d.ts +3 -1
  92. package/dist/runtime/components/DashboardPanel.vue +2 -2
  93. package/dist/runtime/components/DashboardResizeHandle.vue +1 -1
  94. package/dist/runtime/components/DashboardSearch.d.vue.ts +14 -4
  95. package/dist/runtime/components/DashboardSearch.vue +12 -4
  96. package/dist/runtime/components/DashboardSearch.vue.d.ts +14 -4
  97. package/dist/runtime/components/DashboardSearchButton.d.vue.ts +9 -5
  98. package/dist/runtime/components/DashboardSearchButton.vue +3 -3
  99. package/dist/runtime/components/DashboardSearchButton.vue.d.ts +9 -5
  100. package/dist/runtime/components/DashboardSidebar.d.vue.ts +6 -2
  101. package/dist/runtime/components/DashboardSidebar.vue +2 -2
  102. package/dist/runtime/components/DashboardSidebar.vue.d.ts +6 -2
  103. package/dist/runtime/components/DashboardSidebarCollapse.d.vue.ts +3 -2
  104. package/dist/runtime/components/DashboardSidebarCollapse.vue +1 -1
  105. package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +3 -2
  106. package/dist/runtime/components/DashboardSidebarToggle.d.vue.ts +3 -2
  107. package/dist/runtime/components/DashboardSidebarToggle.vue +1 -1
  108. package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +3 -2
  109. package/dist/runtime/components/DashboardToolbar.vue +1 -1
  110. package/dist/runtime/components/Drawer.d.vue.ts +23 -4
  111. package/dist/runtime/components/Drawer.vue +39 -13
  112. package/dist/runtime/components/Drawer.vue.d.ts +23 -4
  113. package/dist/runtime/components/DropdownMenu.d.vue.ts +6 -2
  114. package/dist/runtime/components/DropdownMenu.vue +1 -1
  115. package/dist/runtime/components/DropdownMenu.vue.d.ts +6 -2
  116. package/dist/runtime/components/DropdownMenuContent.d.vue.ts +6 -4
  117. package/dist/runtime/components/DropdownMenuContent.vue +1 -0
  118. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +6 -4
  119. package/dist/runtime/components/Editor.d.vue.ts +3 -2
  120. package/dist/runtime/components/Editor.vue +40 -17
  121. package/dist/runtime/components/Editor.vue.d.ts +3 -2
  122. package/dist/runtime/components/EditorDragHandle.d.vue.ts +5 -3
  123. package/dist/runtime/components/EditorDragHandle.vue +2 -2
  124. package/dist/runtime/components/EditorDragHandle.vue.d.ts +5 -3
  125. package/dist/runtime/components/EditorEmojiMenu.d.vue.ts +1 -1
  126. package/dist/runtime/components/EditorEmojiMenu.vue +1 -1
  127. package/dist/runtime/components/EditorEmojiMenu.vue.d.ts +1 -1
  128. package/dist/runtime/components/EditorMentionMenu.d.vue.ts +3 -2
  129. package/dist/runtime/components/EditorMentionMenu.vue +1 -1
  130. package/dist/runtime/components/EditorMentionMenu.vue.d.ts +3 -2
  131. package/dist/runtime/components/EditorSuggestionMenu.d.vue.ts +2 -2
  132. package/dist/runtime/components/EditorSuggestionMenu.vue +1 -1
  133. package/dist/runtime/components/EditorSuggestionMenu.vue.d.ts +2 -2
  134. package/dist/runtime/components/EditorToolbar.d.vue.ts +5 -2
  135. package/dist/runtime/components/EditorToolbar.vue +1 -1
  136. package/dist/runtime/components/EditorToolbar.vue.d.ts +5 -2
  137. package/dist/runtime/components/Empty.d.vue.ts +11 -1
  138. package/dist/runtime/components/Empty.vue +9 -5
  139. package/dist/runtime/components/Empty.vue.d.ts +11 -1
  140. package/dist/runtime/components/Error.d.vue.ts +2 -1
  141. package/dist/runtime/components/Error.vue +1 -1
  142. package/dist/runtime/components/Error.vue.d.ts +2 -1
  143. package/dist/runtime/components/FieldGroup.vue +1 -1
  144. package/dist/runtime/components/FileUpload.d.vue.ts +9 -4
  145. package/dist/runtime/components/FileUpload.vue +12 -9
  146. package/dist/runtime/components/FileUpload.vue.d.ts +9 -4
  147. package/dist/runtime/components/Footer.vue +1 -1
  148. package/dist/runtime/components/FooterColumns.d.vue.ts +3 -2
  149. package/dist/runtime/components/FooterColumns.vue +1 -1
  150. package/dist/runtime/components/FooterColumns.vue.d.ts +3 -2
  151. package/dist/runtime/components/Form.d.vue.ts +2 -2
  152. package/dist/runtime/components/Form.vue +1 -1
  153. package/dist/runtime/components/Form.vue.d.ts +2 -2
  154. package/dist/runtime/components/FormField.vue +1 -1
  155. package/dist/runtime/components/Header.d.vue.ts +6 -2
  156. package/dist/runtime/components/Header.vue +2 -2
  157. package/dist/runtime/components/Header.vue.d.ts +6 -2
  158. package/dist/runtime/components/Input.d.vue.ts +1 -1
  159. package/dist/runtime/components/Input.vue +3 -3
  160. package/dist/runtime/components/Input.vue.d.ts +1 -1
  161. package/dist/runtime/components/InputDate.d.vue.ts +2 -2
  162. package/dist/runtime/components/InputDate.vue +4 -3
  163. package/dist/runtime/components/InputDate.vue.d.ts +2 -2
  164. package/dist/runtime/components/InputMenu.d.vue.ts +49 -45
  165. package/dist/runtime/components/InputMenu.vue +8 -5
  166. package/dist/runtime/components/InputMenu.vue.d.ts +49 -45
  167. package/dist/runtime/components/InputNumber.d.vue.ts +4 -2
  168. package/dist/runtime/components/InputNumber.vue +2 -2
  169. package/dist/runtime/components/InputNumber.vue.d.ts +4 -2
  170. package/dist/runtime/components/InputRating.d.vue.ts +79 -0
  171. package/dist/runtime/components/InputRating.vue +109 -0
  172. package/dist/runtime/components/InputRating.vue.d.ts +79 -0
  173. package/dist/runtime/components/InputTags.d.vue.ts +2 -2
  174. package/dist/runtime/components/InputTags.vue +2 -2
  175. package/dist/runtime/components/InputTags.vue.d.ts +2 -2
  176. package/dist/runtime/components/InputTime.d.vue.ts +2 -2
  177. package/dist/runtime/components/InputTime.vue +3 -3
  178. package/dist/runtime/components/InputTime.vue.d.ts +2 -2
  179. package/dist/runtime/components/Kbd.vue +1 -1
  180. package/dist/runtime/components/Link.d.vue.ts +3 -2
  181. package/dist/runtime/components/Link.vue +19 -11
  182. package/dist/runtime/components/Link.vue.d.ts +3 -2
  183. package/dist/runtime/components/LinkBase.d.vue.ts +3 -3
  184. package/dist/runtime/components/LinkBase.vue.d.ts +3 -3
  185. package/dist/runtime/components/Listbox.d.vue.ts +16 -13
  186. package/dist/runtime/components/Listbox.vue +2 -2
  187. package/dist/runtime/components/Listbox.vue.d.ts +16 -13
  188. package/dist/runtime/components/Main.vue +1 -1
  189. package/dist/runtime/components/Marquee.vue +1 -1
  190. package/dist/runtime/components/Modal.d.vue.ts +12 -4
  191. package/dist/runtime/components/Modal.vue +8 -5
  192. package/dist/runtime/components/Modal.vue.d.ts +12 -4
  193. package/dist/runtime/components/NavigationMenu.d.vue.ts +8 -2
  194. package/dist/runtime/components/NavigationMenu.vue +2 -2
  195. package/dist/runtime/components/NavigationMenu.vue.d.ts +8 -2
  196. package/dist/runtime/components/Page.vue +1 -1
  197. package/dist/runtime/components/PageAnchors.d.vue.ts +3 -2
  198. package/dist/runtime/components/PageAnchors.vue +1 -1
  199. package/dist/runtime/components/PageAnchors.vue.d.ts +3 -2
  200. package/dist/runtime/components/PageAside.vue +1 -1
  201. package/dist/runtime/components/PageBody.vue +1 -1
  202. package/dist/runtime/components/PageCTA.d.vue.ts +1 -1
  203. package/dist/runtime/components/PageCTA.vue +1 -1
  204. package/dist/runtime/components/PageCTA.vue.d.ts +1 -1
  205. package/dist/runtime/components/PageCard.d.vue.ts +3 -2
  206. package/dist/runtime/components/PageCard.vue +4 -3
  207. package/dist/runtime/components/PageCard.vue.d.ts +3 -2
  208. package/dist/runtime/components/PageColumns.vue +1 -1
  209. package/dist/runtime/components/PageFeature.d.vue.ts +3 -2
  210. package/dist/runtime/components/PageFeature.vue +10 -3
  211. package/dist/runtime/components/PageFeature.vue.d.ts +3 -2
  212. package/dist/runtime/components/PageGrid.vue +1 -1
  213. package/dist/runtime/components/PageHeader.d.vue.ts +1 -1
  214. package/dist/runtime/components/PageHeader.vue +1 -1
  215. package/dist/runtime/components/PageHeader.vue.d.ts +1 -1
  216. package/dist/runtime/components/PageHero.d.vue.ts +1 -1
  217. package/dist/runtime/components/PageHero.vue +1 -1
  218. package/dist/runtime/components/PageHero.vue.d.ts +1 -1
  219. package/dist/runtime/components/PageLinks.d.vue.ts +3 -2
  220. package/dist/runtime/components/PageLinks.vue +1 -1
  221. package/dist/runtime/components/PageLinks.vue.d.ts +3 -2
  222. package/dist/runtime/components/PageList.vue +1 -1
  223. package/dist/runtime/components/PageLogos.d.vue.ts +1 -1
  224. package/dist/runtime/components/PageLogos.vue +2 -2
  225. package/dist/runtime/components/PageLogos.vue.d.ts +1 -1
  226. package/dist/runtime/components/PageSection.d.vue.ts +4 -2
  227. package/dist/runtime/components/PageSection.vue +1 -1
  228. package/dist/runtime/components/PageSection.vue.d.ts +4 -2
  229. package/dist/runtime/components/Pagination.d.vue.ts +4 -3
  230. package/dist/runtime/components/Pagination.vue +1 -1
  231. package/dist/runtime/components/Pagination.vue.d.ts +4 -3
  232. package/dist/runtime/components/PinInput.d.vue.ts +15 -3
  233. package/dist/runtime/components/PinInput.vue +37 -12
  234. package/dist/runtime/components/PinInput.vue.d.ts +15 -3
  235. package/dist/runtime/components/Popover.d.vue.ts +6 -4
  236. package/dist/runtime/components/Popover.vue +6 -5
  237. package/dist/runtime/components/Popover.vue.d.ts +6 -4
  238. package/dist/runtime/components/PricingPlan.d.vue.ts +3 -1
  239. package/dist/runtime/components/PricingPlan.vue +2 -2
  240. package/dist/runtime/components/PricingPlan.vue.d.ts +3 -1
  241. package/dist/runtime/components/PricingPlans.d.vue.ts +2 -2
  242. package/dist/runtime/components/PricingPlans.vue +1 -1
  243. package/dist/runtime/components/PricingPlans.vue.d.ts +2 -2
  244. package/dist/runtime/components/PricingTable.d.vue.ts +2 -2
  245. package/dist/runtime/components/PricingTable.vue +2 -2
  246. package/dist/runtime/components/PricingTable.vue.d.ts +2 -2
  247. package/dist/runtime/components/Progress.vue +1 -1
  248. package/dist/runtime/components/RadioGroup.d.vue.ts +1 -1
  249. package/dist/runtime/components/RadioGroup.vue +1 -1
  250. package/dist/runtime/components/RadioGroup.vue.d.ts +1 -1
  251. package/dist/runtime/components/ScrollArea.d.vue.ts +16 -2
  252. package/dist/runtime/components/ScrollArea.vue +35 -19
  253. package/dist/runtime/components/ScrollArea.vue.d.ts +16 -2
  254. package/dist/runtime/components/Select.d.vue.ts +4 -2
  255. package/dist/runtime/components/Select.vue +11 -3
  256. package/dist/runtime/components/Select.vue.d.ts +4 -2
  257. package/dist/runtime/components/SelectMenu.d.vue.ts +50 -45
  258. package/dist/runtime/components/SelectMenu.vue +13 -6
  259. package/dist/runtime/components/SelectMenu.vue.d.ts +50 -45
  260. package/dist/runtime/components/Separator.d.vue.ts +3 -2
  261. package/dist/runtime/components/Separator.vue +3 -2
  262. package/dist/runtime/components/Separator.vue.d.ts +3 -2
  263. package/dist/runtime/components/Sidebar.d.vue.ts +12 -2
  264. package/dist/runtime/components/Sidebar.vue +6 -4
  265. package/dist/runtime/components/Sidebar.vue.d.ts +12 -2
  266. package/dist/runtime/components/Skeleton.vue +1 -1
  267. package/dist/runtime/components/Slideover.d.vue.ts +13 -5
  268. package/dist/runtime/components/Slideover.vue +8 -5
  269. package/dist/runtime/components/Slideover.vue.d.ts +13 -5
  270. package/dist/runtime/components/Slider.d.vue.ts +2 -2
  271. package/dist/runtime/components/Slider.vue +1 -1
  272. package/dist/runtime/components/Slider.vue.d.ts +2 -2
  273. package/dist/runtime/components/Stepper.d.vue.ts +2 -2
  274. package/dist/runtime/components/Stepper.vue +1 -1
  275. package/dist/runtime/components/Stepper.vue.d.ts +2 -2
  276. package/dist/runtime/components/Switch.d.vue.ts +2 -2
  277. package/dist/runtime/components/Switch.vue +2 -2
  278. package/dist/runtime/components/Switch.vue.d.ts +2 -2
  279. package/dist/runtime/components/Table.d.vue.ts +8 -2
  280. package/dist/runtime/components/Table.vue +13 -6
  281. package/dist/runtime/components/Table.vue.d.ts +8 -2
  282. package/dist/runtime/components/Tabs.d.vue.ts +4 -2
  283. package/dist/runtime/components/Tabs.vue +1 -1
  284. package/dist/runtime/components/Tabs.vue.d.ts +4 -2
  285. package/dist/runtime/components/Textarea.d.vue.ts +1 -1
  286. package/dist/runtime/components/Textarea.vue +3 -3
  287. package/dist/runtime/components/Textarea.vue.d.ts +1 -1
  288. package/dist/runtime/components/Theme.d.vue.ts +1 -1
  289. package/dist/runtime/components/Theme.vue.d.ts +1 -1
  290. package/dist/runtime/components/Timeline.d.vue.ts +3 -2
  291. package/dist/runtime/components/Timeline.vue +1 -1
  292. package/dist/runtime/components/Timeline.vue.d.ts +3 -2
  293. package/dist/runtime/components/Toast.d.vue.ts +7 -3
  294. package/dist/runtime/components/Toast.vue +1 -1
  295. package/dist/runtime/components/Toast.vue.d.ts +7 -3
  296. package/dist/runtime/components/Toaster.d.vue.ts +1 -1
  297. package/dist/runtime/components/Toaster.vue +1 -1
  298. package/dist/runtime/components/Toaster.vue.d.ts +1 -1
  299. package/dist/runtime/components/Tooltip.d.vue.ts +1 -1
  300. package/dist/runtime/components/Tooltip.vue +1 -1
  301. package/dist/runtime/components/Tooltip.vue.d.ts +1 -1
  302. package/dist/runtime/components/Tree.d.vue.ts +2 -2
  303. package/dist/runtime/components/Tree.vue +2 -2
  304. package/dist/runtime/components/Tree.vue.d.ts +2 -2
  305. package/dist/runtime/components/User.d.vue.ts +4 -2
  306. package/dist/runtime/components/User.vue +10 -3
  307. package/dist/runtime/components/User.vue.d.ts +4 -2
  308. package/dist/runtime/components/color-mode/ColorModeAvatar.d.vue.ts +1 -1
  309. package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +1 -1
  310. package/dist/runtime/components/color-mode/ColorModeButton.d.vue.ts +3 -2
  311. package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +3 -2
  312. package/dist/runtime/components/color-mode/ColorModeSelect.d.vue.ts +1 -1
  313. package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +1 -1
  314. package/dist/runtime/components/color-mode/ColorModeSwitch.d.vue.ts +1 -1
  315. package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
  316. package/dist/runtime/components/content/ContentNavigation.d.vue.ts +4 -2
  317. package/dist/runtime/components/content/ContentNavigation.vue +3 -3
  318. package/dist/runtime/components/content/ContentNavigation.vue.d.ts +4 -2
  319. package/dist/runtime/components/content/ContentSearch.d.vue.ts +14 -3
  320. package/dist/runtime/components/content/ContentSearch.vue +12 -4
  321. package/dist/runtime/components/content/ContentSearch.vue.d.ts +14 -3
  322. package/dist/runtime/components/content/ContentSearchButton.d.vue.ts +9 -5
  323. package/dist/runtime/components/content/ContentSearchButton.vue +3 -3
  324. package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +9 -5
  325. package/dist/runtime/components/content/ContentSurround.d.vue.ts +2 -2
  326. package/dist/runtime/components/content/ContentSurround.vue +2 -2
  327. package/dist/runtime/components/content/ContentSurround.vue.d.ts +2 -2
  328. package/dist/runtime/components/content/ContentToc.d.vue.ts +2 -2
  329. package/dist/runtime/components/content/ContentToc.vue +33 -7
  330. package/dist/runtime/components/content/ContentToc.vue.d.ts +2 -2
  331. package/dist/runtime/components/locale/LocaleSelect.d.vue.ts +1 -1
  332. package/dist/runtime/components/locale/LocaleSelect.vue +8 -0
  333. package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +1 -1
  334. package/dist/runtime/components/prose/A.vue +1 -1
  335. package/dist/runtime/components/prose/Accordion.d.vue.ts +1 -1
  336. package/dist/runtime/components/prose/Accordion.vue +1 -1
  337. package/dist/runtime/components/prose/Accordion.vue.d.ts +1 -1
  338. package/dist/runtime/components/prose/AccordionItem.vue +1 -1
  339. package/dist/runtime/components/prose/Badge.vue +1 -1
  340. package/dist/runtime/components/prose/Blockquote.vue +1 -1
  341. package/dist/runtime/components/prose/Callout.d.vue.ts +2 -1
  342. package/dist/runtime/components/prose/Callout.vue +2 -2
  343. package/dist/runtime/components/prose/Callout.vue.d.ts +2 -1
  344. package/dist/runtime/components/prose/Card.d.vue.ts +2 -1
  345. package/dist/runtime/components/prose/Card.vue +2 -2
  346. package/dist/runtime/components/prose/Card.vue.d.ts +2 -1
  347. package/dist/runtime/components/prose/CardGroup.vue +1 -1
  348. package/dist/runtime/components/prose/Code.vue +1 -1
  349. package/dist/runtime/components/prose/CodeCollapse.d.vue.ts +1 -1
  350. package/dist/runtime/components/prose/CodeCollapse.vue +1 -1
  351. package/dist/runtime/components/prose/CodeCollapse.vue.d.ts +1 -1
  352. package/dist/runtime/components/prose/CodeGroup.vue +1 -1
  353. package/dist/runtime/components/prose/CodeIcon.d.vue.ts +1 -1
  354. package/dist/runtime/components/prose/CodeIcon.vue.d.ts +1 -1
  355. package/dist/runtime/components/prose/CodePreview.vue +1 -1
  356. package/dist/runtime/components/prose/CodeTree.vue +1 -1
  357. package/dist/runtime/components/prose/Collapsible.d.vue.ts +2 -1
  358. package/dist/runtime/components/prose/Collapsible.vue +1 -1
  359. package/dist/runtime/components/prose/Collapsible.vue.d.ts +2 -1
  360. package/dist/runtime/components/prose/Em.vue +1 -1
  361. package/dist/runtime/components/prose/Field.vue +1 -1
  362. package/dist/runtime/components/prose/FieldGroup.vue +1 -1
  363. package/dist/runtime/components/prose/H1.d.vue.ts +5 -0
  364. package/dist/runtime/components/prose/H1.vue +3 -2
  365. package/dist/runtime/components/prose/H1.vue.d.ts +5 -0
  366. package/dist/runtime/components/prose/H2.d.vue.ts +6 -0
  367. package/dist/runtime/components/prose/H2.vue +3 -2
  368. package/dist/runtime/components/prose/H2.vue.d.ts +6 -0
  369. package/dist/runtime/components/prose/H3.d.vue.ts +6 -0
  370. package/dist/runtime/components/prose/H3.vue +3 -2
  371. package/dist/runtime/components/prose/H3.vue.d.ts +6 -0
  372. package/dist/runtime/components/prose/H4.d.vue.ts +6 -0
  373. package/dist/runtime/components/prose/H4.vue +3 -2
  374. package/dist/runtime/components/prose/H4.vue.d.ts +6 -0
  375. package/dist/runtime/components/prose/Hr.vue +1 -1
  376. package/dist/runtime/components/prose/Icon.vue +1 -1
  377. package/dist/runtime/components/prose/Img.vue +1 -1
  378. package/dist/runtime/components/prose/Kbd.d.vue.ts +2 -1
  379. package/dist/runtime/components/prose/Kbd.vue +1 -1
  380. package/dist/runtime/components/prose/Kbd.vue.d.ts +2 -1
  381. package/dist/runtime/components/prose/Li.vue +1 -1
  382. package/dist/runtime/components/prose/Ol.vue +1 -1
  383. package/dist/runtime/components/prose/P.vue +1 -1
  384. package/dist/runtime/components/prose/Pre.d.vue.ts +12 -2
  385. package/dist/runtime/components/prose/Pre.vue +6 -4
  386. package/dist/runtime/components/prose/Pre.vue.d.ts +12 -2
  387. package/dist/runtime/components/prose/Prompt.d.vue.ts +4 -3
  388. package/dist/runtime/components/prose/Prompt.vue +21 -11
  389. package/dist/runtime/components/prose/Prompt.vue.d.ts +4 -3
  390. package/dist/runtime/components/prose/Steps.vue +1 -1
  391. package/dist/runtime/components/prose/Strong.vue +1 -1
  392. package/dist/runtime/components/prose/Table.vue +1 -1
  393. package/dist/runtime/components/prose/Tabs.d.vue.ts +1 -1
  394. package/dist/runtime/components/prose/Tabs.vue +1 -1
  395. package/dist/runtime/components/prose/Tabs.vue.d.ts +1 -1
  396. package/dist/runtime/components/prose/TabsItem.vue +1 -1
  397. package/dist/runtime/components/prose/Tbody.vue +1 -1
  398. package/dist/runtime/components/prose/Td.vue +1 -1
  399. package/dist/runtime/components/prose/Th.vue +1 -1
  400. package/dist/runtime/components/prose/Thead.vue +1 -1
  401. package/dist/runtime/components/prose/Tr.vue +1 -1
  402. package/dist/runtime/components/prose/Ul.vue +1 -1
  403. package/dist/runtime/composables/defineShortcuts.js +42 -5
  404. package/dist/runtime/composables/index.d.ts +1 -0
  405. package/dist/runtime/composables/index.js +1 -0
  406. package/dist/runtime/composables/useAvatarGroup.d.ts +3 -3
  407. package/dist/runtime/composables/useComponentIcons.d.ts +2 -1
  408. package/dist/runtime/composables/useComponentProps.d.ts +3 -157
  409. package/dist/runtime/composables/useComponentProps.js +4 -2
  410. package/dist/runtime/composables/useEditorMenu.d.ts +2 -1
  411. package/dist/runtime/composables/useEditorMenu.js +8 -2
  412. package/dist/runtime/composables/useFieldGroup.d.ts +1 -1
  413. package/dist/runtime/composables/useFileUpload.js +3 -4
  414. package/dist/runtime/composables/useFormField.d.ts +2 -2
  415. package/dist/runtime/composables/useResizable.js +24 -43
  416. package/dist/runtime/composables/useScrollspy.js +20 -12
  417. package/dist/runtime/composables/useToast.d.ts +1 -1
  418. package/dist/runtime/composables/useToast.js +22 -7
  419. package/dist/runtime/composables/useTour.d.ts +80 -0
  420. package/dist/runtime/composables/useTour.js +102 -0
  421. package/dist/runtime/index.css +1 -1
  422. package/dist/runtime/keyframes.css +1 -1
  423. package/dist/runtime/locale/ar.d.ts +1 -1
  424. package/dist/runtime/locale/ar.js +3 -0
  425. package/dist/runtime/locale/az.d.ts +1 -1
  426. package/dist/runtime/locale/az.js +3 -0
  427. package/dist/runtime/locale/be.d.ts +1 -1
  428. package/dist/runtime/locale/be.js +3 -0
  429. package/dist/runtime/locale/bg.d.ts +1 -1
  430. package/dist/runtime/locale/bg.js +3 -0
  431. package/dist/runtime/locale/bn.d.ts +1 -1
  432. package/dist/runtime/locale/bn.js +3 -0
  433. package/dist/runtime/locale/ca.d.ts +1 -1
  434. package/dist/runtime/locale/ca.js +3 -0
  435. package/dist/runtime/locale/ckb.d.ts +1 -1
  436. package/dist/runtime/locale/ckb.js +3 -0
  437. package/dist/runtime/locale/cs.d.ts +1 -1
  438. package/dist/runtime/locale/cs.js +3 -0
  439. package/dist/runtime/locale/da.d.ts +1 -1
  440. package/dist/runtime/locale/da.js +3 -0
  441. package/dist/runtime/locale/de.d.ts +1 -1
  442. package/dist/runtime/locale/de.js +3 -0
  443. package/dist/runtime/locale/de_ch.d.ts +1 -1
  444. package/dist/runtime/locale/de_ch.js +3 -0
  445. package/dist/runtime/locale/el.d.ts +1 -1
  446. package/dist/runtime/locale/el.js +3 -0
  447. package/dist/runtime/locale/en.d.ts +1 -1
  448. package/dist/runtime/locale/en.js +3 -0
  449. package/dist/runtime/locale/en_gb.d.ts +1 -1
  450. package/dist/runtime/locale/es.d.ts +1 -1
  451. package/dist/runtime/locale/es.js +3 -0
  452. package/dist/runtime/locale/et.d.ts +1 -1
  453. package/dist/runtime/locale/et.js +3 -0
  454. package/dist/runtime/locale/eu.d.ts +1 -1
  455. package/dist/runtime/locale/eu.js +3 -0
  456. package/dist/runtime/locale/fa_ir.d.ts +1 -1
  457. package/dist/runtime/locale/fa_ir.js +3 -0
  458. package/dist/runtime/locale/fi.d.ts +1 -1
  459. package/dist/runtime/locale/fi.js +3 -0
  460. package/dist/runtime/locale/fr.d.ts +1 -1
  461. package/dist/runtime/locale/fr.js +3 -0
  462. package/dist/runtime/locale/gl.d.ts +1 -1
  463. package/dist/runtime/locale/gl.js +3 -0
  464. package/dist/runtime/locale/he.d.ts +1 -1
  465. package/dist/runtime/locale/he.js +3 -0
  466. package/dist/runtime/locale/hi.d.ts +1 -1
  467. package/dist/runtime/locale/hi.js +3 -0
  468. package/dist/runtime/locale/hr.d.ts +1 -1
  469. package/dist/runtime/locale/hr.js +3 -0
  470. package/dist/runtime/locale/hu.d.ts +1 -1
  471. package/dist/runtime/locale/hu.js +3 -0
  472. package/dist/runtime/locale/hy.d.ts +1 -1
  473. package/dist/runtime/locale/hy.js +3 -0
  474. package/dist/runtime/locale/id.d.ts +1 -1
  475. package/dist/runtime/locale/id.js +3 -0
  476. package/dist/runtime/locale/index.d.ts +1 -0
  477. package/dist/runtime/locale/index.js +1 -0
  478. package/dist/runtime/locale/is.d.ts +1 -1
  479. package/dist/runtime/locale/is.js +3 -0
  480. package/dist/runtime/locale/it.d.ts +1 -1
  481. package/dist/runtime/locale/it.js +3 -0
  482. package/dist/runtime/locale/ja.d.ts +1 -1
  483. package/dist/runtime/locale/ja.js +3 -0
  484. package/dist/runtime/locale/ka.d.ts +1 -1
  485. package/dist/runtime/locale/ka.js +3 -0
  486. package/dist/runtime/locale/kk.d.ts +1 -1
  487. package/dist/runtime/locale/kk.js +3 -0
  488. package/dist/runtime/locale/km.d.ts +1 -1
  489. package/dist/runtime/locale/km.js +3 -0
  490. package/dist/runtime/locale/ko.d.ts +1 -1
  491. package/dist/runtime/locale/ko.js +3 -0
  492. package/dist/runtime/locale/ky.d.ts +1 -1
  493. package/dist/runtime/locale/ky.js +3 -0
  494. package/dist/runtime/locale/lb.d.ts +1 -1
  495. package/dist/runtime/locale/lb.js +3 -0
  496. package/dist/runtime/locale/lo.d.ts +1 -1
  497. package/dist/runtime/locale/lo.js +3 -0
  498. package/dist/runtime/locale/lt.d.ts +1 -1
  499. package/dist/runtime/locale/lt.js +3 -0
  500. package/dist/runtime/locale/lv.d.ts +3 -0
  501. package/dist/runtime/locale/lv.js +155 -0
  502. package/dist/runtime/locale/mn.d.ts +1 -1
  503. package/dist/runtime/locale/mn.js +3 -0
  504. package/dist/runtime/locale/ms.d.ts +1 -1
  505. package/dist/runtime/locale/ms.js +3 -0
  506. package/dist/runtime/locale/nb_no.d.ts +1 -1
  507. package/dist/runtime/locale/nb_no.js +3 -0
  508. package/dist/runtime/locale/nl.d.ts +1 -1
  509. package/dist/runtime/locale/nl.js +3 -0
  510. package/dist/runtime/locale/pl.d.ts +1 -1
  511. package/dist/runtime/locale/pl.js +3 -0
  512. package/dist/runtime/locale/pt.d.ts +1 -1
  513. package/dist/runtime/locale/pt.js +3 -0
  514. package/dist/runtime/locale/pt_br.d.ts +1 -1
  515. package/dist/runtime/locale/pt_br.js +3 -0
  516. package/dist/runtime/locale/ro.d.ts +1 -1
  517. package/dist/runtime/locale/ro.js +3 -0
  518. package/dist/runtime/locale/ru.d.ts +1 -1
  519. package/dist/runtime/locale/ru.js +3 -0
  520. package/dist/runtime/locale/sk.d.ts +1 -1
  521. package/dist/runtime/locale/sk.js +3 -0
  522. package/dist/runtime/locale/sl.d.ts +1 -1
  523. package/dist/runtime/locale/sl.js +3 -0
  524. package/dist/runtime/locale/sq.d.ts +1 -1
  525. package/dist/runtime/locale/sq.js +3 -0
  526. package/dist/runtime/locale/sv.d.ts +1 -1
  527. package/dist/runtime/locale/sv.js +3 -0
  528. package/dist/runtime/locale/th.d.ts +1 -1
  529. package/dist/runtime/locale/th.js +3 -0
  530. package/dist/runtime/locale/tj.d.ts +1 -1
  531. package/dist/runtime/locale/tj.js +3 -0
  532. package/dist/runtime/locale/tr.d.ts +1 -1
  533. package/dist/runtime/locale/tr.js +3 -0
  534. package/dist/runtime/locale/ug_cn.d.ts +1 -1
  535. package/dist/runtime/locale/ug_cn.js +3 -0
  536. package/dist/runtime/locale/uk.d.ts +1 -1
  537. package/dist/runtime/locale/uk.js +3 -0
  538. package/dist/runtime/locale/ur.d.ts +1 -1
  539. package/dist/runtime/locale/ur.js +3 -0
  540. package/dist/runtime/locale/uz.d.ts +1 -1
  541. package/dist/runtime/locale/uz.js +3 -0
  542. package/dist/runtime/locale/vi.d.ts +1 -1
  543. package/dist/runtime/locale/vi.js +3 -0
  544. package/dist/runtime/locale/zh_cn.d.ts +1 -1
  545. package/dist/runtime/locale/zh_cn.js +3 -0
  546. package/dist/runtime/locale/zh_tw.d.ts +1 -1
  547. package/dist/runtime/locale/zh_tw.js +3 -0
  548. package/dist/runtime/plugins/colors.js +9 -4
  549. package/dist/runtime/types/icons.d.ts +5 -0
  550. package/dist/runtime/types/index.d.ts +2 -0
  551. package/dist/runtime/types/index.js +2 -0
  552. package/dist/runtime/types/locale.d.ts +3 -0
  553. package/dist/runtime/types/theme.d.ts +187 -0
  554. package/dist/runtime/types/theme.js +0 -0
  555. package/dist/runtime/types/tv.d.ts +17 -5
  556. package/dist/runtime/utils/ai.d.ts +10 -2
  557. package/dist/runtime/utils/ai.js +4 -1
  558. package/dist/runtime/utils/link.d.ts +1 -1
  559. package/dist/runtime/utils/tv.d.ts +41 -1
  560. package/dist/runtime/utils/tv.js +91 -2
  561. package/dist/runtime/vue/components/Icon.d.vue.ts +1 -1
  562. package/dist/runtime/vue/components/Icon.vue.d.ts +1 -1
  563. package/dist/runtime/vue/components/color-mode/ColorModeSelect.d.vue.ts +1 -1
  564. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue.d.ts +1 -1
  565. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.d.vue.ts +1 -1
  566. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
  567. package/dist/runtime/vue/overrides/inertia/Link.d.vue.ts +2 -2
  568. package/dist/runtime/vue/overrides/inertia/Link.vue +2 -2
  569. package/dist/runtime/vue/overrides/inertia/Link.vue.d.ts +2 -2
  570. package/dist/runtime/vue/overrides/inertia/LinkBase.d.vue.ts +3 -3
  571. package/dist/runtime/vue/overrides/inertia/LinkBase.vue.d.ts +3 -3
  572. package/dist/runtime/vue/overrides/none/Link.d.vue.ts +2 -2
  573. package/dist/runtime/vue/overrides/none/Link.vue +8 -7
  574. package/dist/runtime/vue/overrides/none/Link.vue.d.ts +2 -2
  575. package/dist/runtime/vue/overrides/vue-router/Link.d.vue.ts +2 -2
  576. package/dist/runtime/vue/overrides/vue-router/Link.vue +2 -2
  577. package/dist/runtime/vue/overrides/vue-router/Link.vue.d.ts +2 -2
  578. package/dist/runtime/vue/plugins/icons.d.ts +4 -0
  579. package/dist/runtime/vue/plugins/icons.js +13 -0
  580. package/dist/runtime/vue/stubs/base.d.ts +1 -1
  581. package/dist/runtime/vue/stubs/base.js +1 -1
  582. package/dist/runtime/vue/stubs/inertia.d.ts +1 -1
  583. package/dist/runtime/vue/stubs/inertia.js +3 -1
  584. package/dist/shared/{ui.C-lVg1QQ.mjs → ui.XkBrgXFP.mjs} +600 -296
  585. package/dist/unplugin.d.mts +18 -3
  586. package/dist/unplugin.mjs +119 -7
  587. package/dist/vite.mjs +3 -1
  588. package/package.json +69 -44
@@ -29,7 +29,7 @@ const props = useComponentProps("breadcrumb", _props);
29
29
  const { dir } = useLocale();
30
30
  const appConfig = useAppConfig();
31
31
  const separatorIcon = computed(() => props.separatorIcon || (dir.value === "rtl" ? appConfig.ui.icons.chevronLeft : appConfig.ui.icons.chevronRight));
32
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.breadcrumb || {} })({
32
+ const ui = computed(() => tv({ extend: theme, ...appConfig.ui?.breadcrumb || {} })({
33
33
  color: props.color
34
34
  }));
35
35
  </script>
@@ -1,7 +1,9 @@
1
1
  import type { VNode } from 'vue';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import theme from '#build/ui/breadcrumb';
4
- import type { AvatarProps, IconProps, LinkProps } from '../types';
4
+ import type { AvatarProps } from './Avatar.vue';
5
+ import type { IconProps } from './Icon.vue';
6
+ import type { LinkProps } from './Link.vue';
5
7
  import type { DynamicSlots, GetItemKeys } from '../types/utils';
6
8
  import type { ComponentConfig } from '../types/tv';
7
9
  type Breadcrumb = ComponentConfig<typeof theme, AppConfig, 'breadcrumb'>;
@@ -83,7 +85,7 @@ declare const __VLS_export: <T extends BreadcrumbItem>(__VLS_props: NonNullable<
83
85
  slots: BreadcrumbSlots<T>;
84
86
  emit: {};
85
87
  }>) => import("vue").VNode & {
86
- __ctx?: Awaited<typeof __VLS_setup>;
88
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
87
89
  };
88
90
  type __VLS_PrettifyLocal<T> = (T extends any ? {
89
91
  [K in keyof T]: T[K];
@@ -2,7 +2,7 @@ import type { VNode } from 'vue';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import theme from '#build/ui/button';
4
4
  import type { UseComponentIconsProps } from '../composables/useComponentIcons';
5
- import type { LinkProps } from '../types';
5
+ import type { LinkProps } from './Link.vue';
6
6
  import type { ComponentConfig } from '../types/tv';
7
7
  type Button = ComponentConfig<typeof theme, AppConfig, 'button'>;
8
8
  export interface ButtonProps extends UseComponentIconsProps, Omit<LinkProps, 'raw' | 'custom'> {
@@ -27,7 +27,7 @@ export interface ButtonProps extends UseComponentIconsProps, Omit<LinkProps, 'ra
27
27
  block?: boolean;
28
28
  /** Set loading state automatically based on the `@click` promise state */
29
29
  loadingAuto?: boolean;
30
- onClick?: ((event: MouseEvent) => void | Promise<void>) | Array<((event: MouseEvent) => void | Promise<void>)>;
30
+ onClick?: ((event: MouseEvent) => void) | Array<((event: MouseEvent) => void)>;
31
31
  class?: any;
32
32
  ui?: Button['slots'];
33
33
  }
@@ -88,7 +88,7 @@ const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponen
88
88
  computed(() => ({ ...props, loading: isLoading.value }))
89
89
  );
90
90
  const ui = computed(() => tv({
91
- extend: tv(theme),
91
+ extend: theme,
92
92
  ...defu({
93
93
  variants: {
94
94
  active: {
@@ -123,8 +123,8 @@ const ui = computed(() => tv({
123
123
  custom
124
124
  >
125
125
  <ULinkBase
126
- v-bind="slotProps"
127
126
  data-slot="base"
127
+ v-bind="slotProps"
128
128
  :class="ui.base({
129
129
  class: [props.ui?.base, props.class],
130
130
  active,
@@ -2,7 +2,7 @@ import type { VNode } from 'vue';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import theme from '#build/ui/button';
4
4
  import type { UseComponentIconsProps } from '../composables/useComponentIcons';
5
- import type { LinkProps } from '../types';
5
+ import type { LinkProps } from './Link.vue';
6
6
  import type { ComponentConfig } from '../types/tv';
7
7
  type Button = ComponentConfig<typeof theme, AppConfig, 'button'>;
8
8
  export interface ButtonProps extends UseComponentIconsProps, Omit<LinkProps, 'raw' | 'custom'> {
@@ -27,7 +27,7 @@ export interface ButtonProps extends UseComponentIconsProps, Omit<LinkProps, 'ra
27
27
  block?: boolean;
28
28
  /** Set loading state automatically based on the `@click` promise state */
29
29
  loadingAuto?: boolean;
30
- onClick?: ((event: MouseEvent) => void | Promise<void>) | Array<((event: MouseEvent) => void | Promise<void>)>;
30
+ onClick?: ((event: MouseEvent) => void) | Array<((event: MouseEvent) => void)>;
31
31
  class?: any;
32
32
  ui?: Button['slots'];
33
33
  }
@@ -1,21 +1,35 @@
1
- import type { CalendarRootProps, CalendarRootEmits, RangeCalendarRootProps, RangeCalendarRootEmits, DateRange, CalendarCellTriggerProps } from 'reka-ui';
1
+ import type { CalendarRootProps, CalendarRootEmits, RangeCalendarRootProps, RangeCalendarRootEmits, MonthPickerRootProps, YearPickerRootProps, DateRange, CalendarCellTriggerProps } from 'reka-ui';
2
2
  import type { VNode } from 'vue';
3
3
  import type { DateValue } from '@internationalized/date';
4
4
  import type { AppConfig } from '@nuxt/schema';
5
5
  import theme from '#build/ui/calendar';
6
- import type { ButtonProps, IconProps, LinkPropsKeys } from '../types';
6
+ import type { ButtonProps } from './Button.vue';
7
+ import type { IconProps } from './Icon.vue';
8
+ import type { LinkPropsKeys } from './Link.vue';
7
9
  import type { ComponentConfig } from '../types/tv';
8
10
  type Calendar = ComponentConfig<typeof theme, AppConfig, 'calendar'>;
11
+ export type CalendarType = 'date' | 'month' | 'year';
12
+ export type CalendarView = 'day' | 'month' | 'year';
9
13
  type CalendarDefaultValue<R extends boolean = false, M extends boolean = false> = R extends true ? DateRange : M extends true ? DateValue[] : DateValue;
10
14
  type CalendarModelValue<R extends boolean = false, M extends boolean = false> = R extends true ? (DateRange | null) : M extends true ? (DateValue[] | undefined) : (DateValue | undefined);
11
15
  type _CalendarRootProps = Omit<CalendarRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir' | 'calendarLabel' | 'multiple'>;
12
16
  type _RangeCalendarRootProps = Omit<RangeCalendarRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir' | 'calendarLabel' | 'multiple'>;
13
- export interface CalendarProps<R extends boolean = false, M extends boolean = false> extends _RangeCalendarRootProps, _CalendarRootProps {
17
+ type _MonthPickerRootProps = Pick<MonthPickerRootProps, 'isMonthDisabled' | 'isMonthUnavailable'>;
18
+ type _YearPickerRootProps = Pick<YearPickerRootProps, 'isYearDisabled' | 'isYearUnavailable'>;
19
+ export interface CalendarProps<R extends boolean = false, M extends boolean = false> extends _RangeCalendarRootProps, _CalendarRootProps, _MonthPickerRootProps, _YearPickerRootProps {
14
20
  /**
15
21
  * The element or component this component should render as.
16
22
  * @defaultValue 'div'
17
23
  */
18
24
  as?: any;
25
+ /**
26
+ * The type of picker.
27
+ * - `date` renders a day calendar whose heading can switch to a month then year view.
28
+ * - `month` renders a standalone month picker.
29
+ * - `year` renders a standalone year picker.
30
+ * @defaultValue 'date'
31
+ */
32
+ type?: CalendarType;
19
33
  /**
20
34
  * The icon to use for the next year control.
21
35
  * @defaultValue appConfig.ui.icons.chevronDoubleRight
@@ -60,6 +74,13 @@ export interface CalendarProps<R extends boolean = false, M extends boolean = fa
60
74
  * `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
61
75
  */
62
76
  prevMonth?: Omit<ButtonProps, LinkPropsKeys>;
77
+ /**
78
+ * Whether to make the heading a button that switches between the day, month and year views.
79
+ * Has no effect when `type` is `year`. Can be an object to override the button props.
80
+ * `{ color: 'neutral', variant: 'ghost', block: true }`{lang="ts-type"}
81
+ * @defaultValue true
82
+ */
83
+ viewControl?: boolean | Omit<ButtonProps, LinkPropsKeys>;
63
84
  /**
64
85
  * @defaultValue 'primary'
65
86
  */
@@ -88,22 +109,39 @@ export interface CalendarProps<R extends boolean = false, M extends boolean = fa
88
109
  }
89
110
  export interface CalendarEmits<R extends boolean = false, M extends boolean = false> extends Omit<CalendarRootEmits & RangeCalendarRootEmits, 'update:modelValue'> {
90
111
  'update:modelValue': [value: CalendarModelValue<R, M>];
112
+ 'update:placeholder': [date: DateValue];
113
+ 'update:startValue': [date: DateValue | undefined];
114
+ 'update:validModelValue': [date: DateRange];
91
115
  }
92
116
  export interface CalendarSlots {
93
117
  'heading'?: (props: {
94
118
  value: string;
119
+ view: CalendarView;
120
+ date: DateValue;
121
+ setView: (view: CalendarView) => void;
122
+ setPlaceholder: (date: DateValue) => void;
95
123
  }) => VNode[];
96
124
  'day'?: (props: Pick<CalendarCellTriggerProps, 'day'>) => VNode[];
97
125
  'week-day'?: (props: {
98
126
  day: string;
99
127
  }) => VNode[];
128
+ 'month-cell'?: (props: {
129
+ month: DateValue;
130
+ selected: boolean;
131
+ disabled: boolean;
132
+ }) => VNode[];
133
+ 'year-cell'?: (props: {
134
+ year: DateValue;
135
+ selected: boolean;
136
+ disabled: boolean;
137
+ }) => VNode[];
100
138
  }
101
139
  declare const _default: typeof __VLS_export;
102
140
  export default _default;
103
141
  declare const __VLS_export: <R extends boolean, M extends boolean>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
104
142
  props: import("vue").PublicProps & __VLS_PrettifyLocal<CalendarProps<R, M> & {
105
143
  "onUpdate:modelValue"?: ((value: CalendarModelValue<R, M>) => any) | undefined;
106
- "onUpdate:placeholder"?: ((...args: DateValue[]) => any) | undefined;
144
+ "onUpdate:placeholder"?: ((date: DateValue) => any) | undefined;
107
145
  "onUpdate:validModelValue"?: ((date: DateRange) => any) | undefined;
108
146
  "onUpdate:startValue"?: ((date: DateValue | undefined) => any) | undefined;
109
147
  }> & (typeof globalThis extends {
@@ -112,9 +150,9 @@ declare const __VLS_export: <R extends boolean, M extends boolean>(__VLS_props:
112
150
  expose: (exposed: {}) => void;
113
151
  attrs: any;
114
152
  slots: CalendarSlots;
115
- emit: ((evt: "update:modelValue", value: CalendarModelValue<R, M>) => void) & ((evt: "update:placeholder", ...args: [date: DateValue] & [date: DateValue]) => void) & ((evt: "update:validModelValue", date: DateRange) => void) & ((evt: "update:startValue", date: DateValue | undefined) => void);
153
+ emit: ((evt: "update:modelValue", value: CalendarModelValue<R, M>) => void) & ((evt: "update:placeholder", date: DateValue) => void) & ((evt: "update:validModelValue", date: DateRange) => void) & ((evt: "update:startValue", date: DateValue | undefined) => void);
116
154
  }>) => import("vue").VNode & {
117
- __ctx?: Awaited<typeof __VLS_setup>;
155
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
118
156
  };
119
157
  type __VLS_PrettifyLocal<T> = (T extends any ? {
120
158
  [K in keyof T]: T[K];
@@ -1,13 +1,13 @@
1
1
  <script>
2
2
  import { getWeekNumber } from "reka-ui/date";
3
+ import { getLocalTimeZone, today } from "@internationalized/date";
3
4
  import theme from "#build/ui/calendar";
4
5
  </script>
5
6
 
6
7
  <script setup>
7
- import { computed } from "vue";
8
- import {} from "reka-ui";
8
+ import { computed, ref, shallowRef, watch } from "vue";
9
9
  import { useForwardProps } from "../composables/useForwardProps";
10
- import { Calendar as SingleCalendar, RangeCalendar } from "reka-ui/namespaced";
10
+ import { Calendar as SingleCalendar, RangeCalendar, MonthPicker, MonthRangePicker, YearPicker, YearRangePicker } from "reka-ui/namespaced";
11
11
  import { reactiveOmit } from "@vueuse/core";
12
12
  import { useAppConfig } from "#imports";
13
13
  import { useComponentProps } from "../composables/useComponentProps";
@@ -16,6 +16,7 @@ import { tv } from "../utils/tv";
16
16
  import UButton from "./Button.vue";
17
17
  const _props = defineProps({
18
18
  as: { type: null, required: false },
19
+ type: { type: String, required: false, default: "date" },
19
20
  nextYearIcon: { type: null, required: false },
20
21
  nextYear: { type: Object, required: false },
21
22
  nextMonthIcon: { type: null, required: false },
@@ -24,6 +25,7 @@ const _props = defineProps({
24
25
  prevYear: { type: Object, required: false },
25
26
  prevMonthIcon: { type: null, required: false },
26
27
  prevMonth: { type: Object, required: false },
28
+ viewControl: { type: [Boolean, Object], required: false, default: true },
27
29
  color: { type: null, required: false },
28
30
  variant: { type: null, required: false },
29
31
  size: { type: null, required: false },
@@ -58,71 +60,181 @@ const _props = defineProps({
58
60
  nextPage: { type: Function, required: false },
59
61
  prevPage: { type: Function, required: false },
60
62
  disableDaysOutsideCurrentView: { type: Boolean, required: false },
61
- fixedDate: { type: String, required: false }
63
+ fixedDate: { type: String, required: false },
64
+ isMonthDisabled: { type: Function, required: false },
65
+ isMonthUnavailable: { type: Function, required: false },
66
+ isYearDisabled: { type: Function, required: false },
67
+ isYearUnavailable: { type: Function, required: false }
62
68
  });
63
- const emits = defineEmits(["update:modelValue", "update:placeholder", "update:validModelValue", "update:startValue"]);
69
+ const emits = defineEmits(["update:modelValue", "update:placeholder", "update:startValue", "update:validModelValue"]);
64
70
  defineSlots();
65
71
  const props = useComponentProps("calendar", _props);
66
72
  const { dir, t, locale } = useLocale();
67
73
  const appConfig = useAppConfig();
68
- const rootProps = useForwardProps(reactiveOmit(props, "range", "modelValue", "defaultValue", "color", "variant", "size", "monthControls", "yearControls", "class", "ui"), emits);
74
+ const VIEWS = ["day", "month", "year"];
75
+ const minView = computed(() => props.type === "year" ? "year" : props.type === "month" ? "month" : "day");
76
+ const maxView = "year";
77
+ const view = ref(minView.value);
78
+ watch(() => props.type, () => {
79
+ view.value = minView.value;
80
+ });
81
+ const switchable = computed(() => minView.value !== maxView);
82
+ const isMinView = computed(() => view.value === minView.value);
83
+ function clampView(value) {
84
+ const min = VIEWS.indexOf(minView.value);
85
+ const max = VIEWS.indexOf(maxView);
86
+ return VIEWS[Math.min(Math.max(VIEWS.indexOf(value), min), max)];
87
+ }
88
+ function setView(value) {
89
+ view.value = clampView(value);
90
+ }
91
+ function cycleView() {
92
+ const max = VIEWS.indexOf(maxView);
93
+ const next = VIEWS.indexOf(view.value) >= max ? minView.value : VIEWS[VIEWS.indexOf(view.value) + 1];
94
+ view.value = next;
95
+ }
96
+ function resolveDateValue(value) {
97
+ if (Array.isArray(value)) {
98
+ return value[0];
99
+ }
100
+ if (!value) {
101
+ return void 0;
102
+ }
103
+ if ("start" in value || "end" in value) {
104
+ const range = value;
105
+ return range.start ?? range.end ?? void 0;
106
+ }
107
+ return value;
108
+ }
109
+ const placeholder = shallowRef(
110
+ props.placeholder ?? resolveDateValue(props.modelValue) ?? resolveDateValue(props.defaultValue) ?? today(getLocalTimeZone())
111
+ );
112
+ watch(() => props.placeholder, (value) => {
113
+ if (value) {
114
+ placeholder.value = value;
115
+ }
116
+ });
117
+ function setPlaceholder(date) {
118
+ placeholder.value = date;
119
+ emits("update:placeholder", date);
120
+ }
121
+ function onSelect(value) {
122
+ if (isMinView.value) {
123
+ emits("update:modelValue", value);
124
+ return;
125
+ }
126
+ const resolved = resolveDateValue(value);
127
+ if (resolved) {
128
+ setPlaceholder(resolved);
129
+ }
130
+ setView(VIEWS[VIEWS.indexOf(view.value) - 1]);
131
+ }
132
+ function paginateYear(date, sign) {
133
+ return sign === -1 ? date.subtract({ years: 1 }) : date.add({ years: 1 });
134
+ }
135
+ const Picker = computed(() => {
136
+ const range = props.range && isMinView.value;
137
+ if (view.value === "year") {
138
+ return range ? YearRangePicker : YearPicker;
139
+ }
140
+ if (view.value === "month") {
141
+ return range ? MonthRangePicker : MonthPicker;
142
+ }
143
+ return props.range ? RangeCalendar : SingleCalendar;
144
+ });
145
+ const omittedProps = ["type", "placeholder", "range", "modelValue", "defaultValue", "color", "variant", "size", "monthControls", "yearControls", "viewControl", "class", "ui"];
146
+ const dayOnlyProps = ["pagedNavigation", "weekStartsOn", "weekdayFormat", "fixedWeeks", "numberOfMonths", "isDateDisabled", "isDateUnavailable", "isDateHighlightable", "disableDaysOutsideCurrentView", "maximumDays"];
147
+ const monthOnlyProps = ["isMonthDisabled", "isMonthUnavailable"];
148
+ const yearOnlyProps = ["isYearDisabled", "isYearUnavailable"];
149
+ const rangeOnlyProps = ["allowNonContiguousRanges", "fixedDate"];
150
+ const rootProps = useForwardProps(reactiveOmit(
151
+ props,
152
+ (_, key) => omittedProps.includes(key) || view.value !== "day" && dayOnlyProps.includes(key) || view.value !== "month" && monthOnlyProps.includes(key) || view.value !== "year" && yearOnlyProps.includes(key) || !isMinView.value && rangeOnlyProps.includes(key)
153
+ ));
154
+ function cellProps(cellDate, monthValue) {
155
+ if (view.value === "month") {
156
+ return { month: cellDate };
157
+ }
158
+ if (view.value === "year") {
159
+ return { year: cellDate };
160
+ }
161
+ return { day: cellDate, month: monthValue };
162
+ }
69
163
  const nextYearIcon = computed(() => props.nextYearIcon || (dir.value === "rtl" ? appConfig.ui.icons.chevronDoubleLeft : appConfig.ui.icons.chevronDoubleRight));
70
164
  const nextMonthIcon = computed(() => props.nextMonthIcon || (dir.value === "rtl" ? appConfig.ui.icons.chevronLeft : appConfig.ui.icons.chevronRight));
71
165
  const prevYearIcon = computed(() => props.prevYearIcon || (dir.value === "rtl" ? appConfig.ui.icons.chevronDoubleRight : appConfig.ui.icons.chevronDoubleLeft));
72
166
  const prevMonthIcon = computed(() => props.prevMonthIcon || (dir.value === "rtl" ? appConfig.ui.icons.chevronRight : appConfig.ui.icons.chevronLeft));
73
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.calendar || {} })({
167
+ const prevLabel = computed(() => view.value === "day" ? t("calendar.prevMonth") : t("calendar.prevYear"));
168
+ const nextLabel = computed(() => view.value === "day" ? t("calendar.nextMonth") : t("calendar.nextYear"));
169
+ const ui = computed(() => tv({ extend: theme, ...appConfig.ui?.calendar || {} })({
74
170
  color: props.color,
75
171
  size: props.size,
76
172
  variant: props.variant,
77
- weekNumbers: props.weekNumbers
173
+ weekNumbers: props.weekNumbers,
174
+ view: view.value
78
175
  }));
79
- function paginateYear(date, sign) {
80
- if (sign === -1) {
81
- return date.subtract({ years: 1 });
82
- }
83
- return date.add({ years: 1 });
84
- }
85
- const Calendar = computed(() => props.range ? RangeCalendar : SingleCalendar);
86
176
  </script>
87
177
 
88
178
  <template>
89
- <Calendar.Root
90
- v-slot="{ weekDays, grid }"
179
+ <Picker.Root
180
+ v-slot="{ weekDays, grid, date }"
91
181
  v-bind="rootProps"
92
- :model-value="props.modelValue"
93
- :default-value="props.defaultValue"
182
+ :model-value="isMinView ? props.modelValue : void 0"
183
+ :default-value="isMinView ? props.defaultValue : void 0"
184
+ :placeholder="placeholder"
94
185
  data-slot="root"
95
186
  :class="ui.root({ class: [props.ui?.root, props.class] })"
187
+ @update:placeholder="setPlaceholder"
188
+ @update:model-value="onSelect"
189
+ @update:start-value="(value) => emits('update:startValue', value)"
190
+ @update:valid-model-value="(value) => emits('update:validModelValue', value)"
96
191
  >
97
- <Calendar.Header data-slot="header" :class="ui.header({ class: props.ui?.header })">
98
- <Calendar.Prev v-if="props.yearControls" :prev-page="(date) => paginateYear(date, -1)" :aria-label="t('calendar.prevYear')" as-child>
192
+ <Picker.Header data-slot="header" :class="ui.header({ class: props.ui?.header })">
193
+ <Picker.Prev v-if="view === 'day' && props.yearControls" :prev-page="(date) => paginateYear(date, -1)" :aria-label="t('calendar.prevYear')" as-child>
99
194
  <UButton :icon="prevYearIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.prevYear" />
100
- </Calendar.Prev>
101
- <Calendar.Prev v-if="props.monthControls" :aria-label="t('calendar.prevMonth')" as-child>
195
+ </Picker.Prev>
196
+ <Picker.Prev v-if="view !== 'day' || props.monthControls" :aria-label="prevLabel" as-child>
102
197
  <UButton :icon="prevMonthIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.prevMonth" />
103
- </Calendar.Prev>
104
- <Calendar.Heading v-slot="{ headingValue }" data-slot="heading" :class="ui.heading({ class: props.ui?.heading })">
105
- <slot name="heading" :value="headingValue">
106
- {{ headingValue }}
198
+ </Picker.Prev>
199
+ <Picker.Heading v-slot="{ headingValue }" data-slot="heading" :class="ui.heading({ class: props.ui?.heading })">
200
+ <slot
201
+ name="heading"
202
+ :value="headingValue"
203
+ :view="view"
204
+ :date="date"
205
+ :set-view="setView"
206
+ :set-placeholder="setPlaceholder"
207
+ >
208
+ <UButton
209
+ v-if="switchable && props.viewControl"
210
+ :label="headingValue"
211
+ :size="props.size"
212
+ color="neutral"
213
+ variant="ghost"
214
+ block
215
+ v-bind="typeof props.viewControl === 'object' ? props.viewControl : {}"
216
+ @click="cycleView"
217
+ />
218
+ <span v-else data-slot="headingLabel" :class="ui.headingLabel({ class: props.ui?.headingLabel })">{{ headingValue }}</span>
107
219
  </slot>
108
- </Calendar.Heading>
109
- <Calendar.Next v-if="props.monthControls" :aria-label="t('calendar.nextMonth')" as-child>
220
+ </Picker.Heading>
221
+ <Picker.Next v-if="view !== 'day' || props.monthControls" :aria-label="nextLabel" as-child>
110
222
  <UButton :icon="nextMonthIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.nextMonth" />
111
- </Calendar.Next>
112
- <Calendar.Next v-if="props.yearControls" :next-page="(date) => paginateYear(date, 1)" :aria-label="t('calendar.nextYear')" as-child>
223
+ </Picker.Next>
224
+ <Picker.Next v-if="view === 'day' && props.yearControls" :next-page="(date) => paginateYear(date, 1)" :aria-label="t('calendar.nextYear')" as-child>
113
225
  <UButton :icon="nextYearIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.nextYear" />
114
- </Calendar.Next>
115
- </Calendar.Header>
226
+ </Picker.Next>
227
+ </Picker.Header>
116
228
  <div data-slot="body" :class="ui.body({ class: props.ui?.body })">
117
- <Calendar.Grid
118
- v-for="month in grid"
229
+ <Picker.Grid
230
+ v-for="month in Array.isArray(grid) ? grid : [grid]"
119
231
  :key="month.value.toString()"
120
232
  data-slot="grid"
121
233
  :class="ui.grid({ class: props.ui?.grid })"
122
234
  >
123
- <Calendar.GridHead>
124
- <Calendar.GridRow data-slot="gridWeekDaysRow" :class="ui.gridWeekDaysRow({ class: props.ui?.gridWeekDaysRow })">
125
- <Calendar.HeadCell
235
+ <Picker.GridHead v-if="'GridHead' in Picker">
236
+ <Picker.GridRow data-slot="gridWeekDaysRow" :class="ui.gridWeekDaysRow({ class: props.ui?.gridWeekDaysRow })">
237
+ <Picker.HeadCell
126
238
  v-for="day in weekDays"
127
239
  :key="day"
128
240
  data-slot="headCell"
@@ -131,45 +243,51 @@ const Calendar = computed(() => props.range ? RangeCalendar : SingleCalendar);
131
243
  <slot name="week-day" :day="day">
132
244
  {{ day }}
133
245
  </slot>
134
- </Calendar.HeadCell>
135
- </Calendar.GridRow>
136
- </Calendar.GridHead>
137
- <Calendar.GridBody data-slot="gridBody" :class="ui.gridBody({ class: props.ui?.gridBody })">
138
- <Calendar.GridRow
139
- v-for="(weekDates, index) in month.rows"
140
- :key="`weekDate-${index}`"
246
+ </Picker.HeadCell>
247
+ </Picker.GridRow>
248
+ </Picker.GridHead>
249
+ <Picker.GridBody data-slot="gridBody" :class="ui.gridBody({ class: props.ui?.gridBody })">
250
+ <Picker.GridRow
251
+ v-for="(row, index) in month.rows"
252
+ :key="`row-${index}`"
141
253
  data-slot="gridRow"
142
254
  :class="ui.gridRow({ class: props.ui?.gridRow })"
143
255
  >
144
256
  <td
145
- v-if="props.weekNumbers && weekDates[0]"
257
+ v-if="view === 'day' && props.weekNumbers && row[0]"
146
258
  role="gridcell"
147
259
  data-slot="cellWeek"
148
260
  :class="ui.cellWeek({ class: props.ui?.cellWeek })"
149
261
  >
150
- {{ getWeekNumber(weekDates[0], props.locale ?? locale.code) }}
262
+ {{ getWeekNumber(row[0], props.locale ?? locale.code) }}
151
263
  </td>
152
- <Calendar.Cell
153
- v-for="weekDate in weekDates"
154
- :key="weekDate.toString()"
155
- :date="weekDate"
264
+ <Picker.Cell
265
+ v-for="cellDate in row"
266
+ :key="cellDate.toString()"
267
+ :date="cellDate"
156
268
  data-slot="cell"
157
269
  :class="ui.cell({ class: props.ui?.cell })"
158
270
  >
159
- <Calendar.CellTrigger
160
- :day="weekDate"
161
- :month="month.value"
271
+ <Picker.CellTrigger
272
+ v-slot="cell"
273
+ v-bind="cellProps(cellDate, month.value)"
162
274
  data-slot="cellTrigger"
163
275
  :class="ui.cellTrigger({ class: props.ui?.cellTrigger })"
164
276
  >
165
- <slot name="day" :day="weekDate">
166
- {{ weekDate.day }}
277
+ <slot v-if="view === 'day'" name="day" :day="cellDate">
278
+ {{ cellDate.day }}
279
+ </slot>
280
+ <slot v-else-if="view === 'month'" name="month-cell" :month="cellDate" :selected="cell.selected" :disabled="cell.disabled">
281
+ {{ cell.monthValue }}
282
+ </slot>
283
+ <slot v-else name="year-cell" :year="cellDate" :selected="cell.selected" :disabled="cell.disabled">
284
+ {{ cell.yearValue }}
167
285
  </slot>
168
- </Calendar.CellTrigger>
169
- </Calendar.Cell>
170
- </Calendar.GridRow>
171
- </Calendar.GridBody>
172
- </Calendar.Grid>
286
+ </Picker.CellTrigger>
287
+ </Picker.Cell>
288
+ </Picker.GridRow>
289
+ </Picker.GridBody>
290
+ </Picker.Grid>
173
291
  </div>
174
- </Calendar.Root>
292
+ </Picker.Root>
175
293
  </template>
@@ -1,21 +1,35 @@
1
- import type { CalendarRootProps, CalendarRootEmits, RangeCalendarRootProps, RangeCalendarRootEmits, DateRange, CalendarCellTriggerProps } from 'reka-ui';
1
+ import type { CalendarRootProps, CalendarRootEmits, RangeCalendarRootProps, RangeCalendarRootEmits, MonthPickerRootProps, YearPickerRootProps, DateRange, CalendarCellTriggerProps } from 'reka-ui';
2
2
  import type { VNode } from 'vue';
3
3
  import type { DateValue } from '@internationalized/date';
4
4
  import type { AppConfig } from '@nuxt/schema';
5
5
  import theme from '#build/ui/calendar';
6
- import type { ButtonProps, IconProps, LinkPropsKeys } from '../types';
6
+ import type { ButtonProps } from './Button.vue';
7
+ import type { IconProps } from './Icon.vue';
8
+ import type { LinkPropsKeys } from './Link.vue';
7
9
  import type { ComponentConfig } from '../types/tv';
8
10
  type Calendar = ComponentConfig<typeof theme, AppConfig, 'calendar'>;
11
+ export type CalendarType = 'date' | 'month' | 'year';
12
+ export type CalendarView = 'day' | 'month' | 'year';
9
13
  type CalendarDefaultValue<R extends boolean = false, M extends boolean = false> = R extends true ? DateRange : M extends true ? DateValue[] : DateValue;
10
14
  type CalendarModelValue<R extends boolean = false, M extends boolean = false> = R extends true ? (DateRange | null) : M extends true ? (DateValue[] | undefined) : (DateValue | undefined);
11
15
  type _CalendarRootProps = Omit<CalendarRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir' | 'calendarLabel' | 'multiple'>;
12
16
  type _RangeCalendarRootProps = Omit<RangeCalendarRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir' | 'calendarLabel' | 'multiple'>;
13
- export interface CalendarProps<R extends boolean = false, M extends boolean = false> extends _RangeCalendarRootProps, _CalendarRootProps {
17
+ type _MonthPickerRootProps = Pick<MonthPickerRootProps, 'isMonthDisabled' | 'isMonthUnavailable'>;
18
+ type _YearPickerRootProps = Pick<YearPickerRootProps, 'isYearDisabled' | 'isYearUnavailable'>;
19
+ export interface CalendarProps<R extends boolean = false, M extends boolean = false> extends _RangeCalendarRootProps, _CalendarRootProps, _MonthPickerRootProps, _YearPickerRootProps {
14
20
  /**
15
21
  * The element or component this component should render as.
16
22
  * @defaultValue 'div'
17
23
  */
18
24
  as?: any;
25
+ /**
26
+ * The type of picker.
27
+ * - `date` renders a day calendar whose heading can switch to a month then year view.
28
+ * - `month` renders a standalone month picker.
29
+ * - `year` renders a standalone year picker.
30
+ * @defaultValue 'date'
31
+ */
32
+ type?: CalendarType;
19
33
  /**
20
34
  * The icon to use for the next year control.
21
35
  * @defaultValue appConfig.ui.icons.chevronDoubleRight
@@ -60,6 +74,13 @@ export interface CalendarProps<R extends boolean = false, M extends boolean = fa
60
74
  * `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
61
75
  */
62
76
  prevMonth?: Omit<ButtonProps, LinkPropsKeys>;
77
+ /**
78
+ * Whether to make the heading a button that switches between the day, month and year views.
79
+ * Has no effect when `type` is `year`. Can be an object to override the button props.
80
+ * `{ color: 'neutral', variant: 'ghost', block: true }`{lang="ts-type"}
81
+ * @defaultValue true
82
+ */
83
+ viewControl?: boolean | Omit<ButtonProps, LinkPropsKeys>;
63
84
  /**
64
85
  * @defaultValue 'primary'
65
86
  */
@@ -88,22 +109,39 @@ export interface CalendarProps<R extends boolean = false, M extends boolean = fa
88
109
  }
89
110
  export interface CalendarEmits<R extends boolean = false, M extends boolean = false> extends Omit<CalendarRootEmits & RangeCalendarRootEmits, 'update:modelValue'> {
90
111
  'update:modelValue': [value: CalendarModelValue<R, M>];
112
+ 'update:placeholder': [date: DateValue];
113
+ 'update:startValue': [date: DateValue | undefined];
114
+ 'update:validModelValue': [date: DateRange];
91
115
  }
92
116
  export interface CalendarSlots {
93
117
  'heading'?: (props: {
94
118
  value: string;
119
+ view: CalendarView;
120
+ date: DateValue;
121
+ setView: (view: CalendarView) => void;
122
+ setPlaceholder: (date: DateValue) => void;
95
123
  }) => VNode[];
96
124
  'day'?: (props: Pick<CalendarCellTriggerProps, 'day'>) => VNode[];
97
125
  'week-day'?: (props: {
98
126
  day: string;
99
127
  }) => VNode[];
128
+ 'month-cell'?: (props: {
129
+ month: DateValue;
130
+ selected: boolean;
131
+ disabled: boolean;
132
+ }) => VNode[];
133
+ 'year-cell'?: (props: {
134
+ year: DateValue;
135
+ selected: boolean;
136
+ disabled: boolean;
137
+ }) => VNode[];
100
138
  }
101
139
  declare const _default: typeof __VLS_export;
102
140
  export default _default;
103
141
  declare const __VLS_export: <R extends boolean, M extends boolean>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
104
142
  props: import("vue").PublicProps & __VLS_PrettifyLocal<CalendarProps<R, M> & {
105
143
  "onUpdate:modelValue"?: ((value: CalendarModelValue<R, M>) => any) | undefined;
106
- "onUpdate:placeholder"?: ((...args: DateValue[]) => any) | undefined;
144
+ "onUpdate:placeholder"?: ((date: DateValue) => any) | undefined;
107
145
  "onUpdate:validModelValue"?: ((date: DateRange) => any) | undefined;
108
146
  "onUpdate:startValue"?: ((date: DateValue | undefined) => any) | undefined;
109
147
  }> & (typeof globalThis extends {
@@ -112,9 +150,9 @@ declare const __VLS_export: <R extends boolean, M extends boolean>(__VLS_props:
112
150
  expose: (exposed: {}) => void;
113
151
  attrs: any;
114
152
  slots: CalendarSlots;
115
- emit: ((evt: "update:modelValue", value: CalendarModelValue<R, M>) => void) & ((evt: "update:placeholder", ...args: [date: DateValue] & [date: DateValue]) => void) & ((evt: "update:validModelValue", date: DateRange) => void) & ((evt: "update:startValue", date: DateValue | undefined) => void);
153
+ emit: ((evt: "update:modelValue", value: CalendarModelValue<R, M>) => void) & ((evt: "update:placeholder", date: DateValue) => void) & ((evt: "update:validModelValue", date: DateRange) => void) & ((evt: "update:startValue", date: DateValue | undefined) => void);
116
154
  }>) => import("vue").VNode & {
117
- __ctx?: Awaited<typeof __VLS_setup>;
155
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
118
156
  };
119
157
  type __VLS_PrettifyLocal<T> = (T extends any ? {
120
158
  [K in keyof T]: T[K];
@@ -19,7 +19,7 @@ const _props = defineProps({
19
19
  const slots = defineSlots();
20
20
  const props = useComponentProps("card", _props);
21
21
  const appConfig = useAppConfig();
22
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.card || {} })({
22
+ const ui = computed(() => tv({ extend: theme, ...appConfig.ui?.card || {} })({
23
23
  variant: props.variant
24
24
  }));
25
25
  </script>