@eslamdevui/ui 3.3.0 → 3.3.2-beta.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 (288) hide show
  1. package/.nuxt/ui/button.ts +42 -42
  2. package/.nuxt/ui/command-palette.ts +2 -1
  3. package/.nuxt/ui/file-upload.ts +295 -0
  4. package/.nuxt/ui/index.ts +2 -0
  5. package/.nuxt/ui/kbd.ts +167 -3
  6. package/.nuxt/ui/scroll-to-section.ts +3 -0
  7. package/.nuxt/ui/table.ts +14 -0
  8. package/.nuxt/ui/tabs.ts +4 -2
  9. package/.nuxt/ui/toast.ts +8 -15
  10. package/.nuxt/ui/tooltip.ts +1 -1
  11. package/cli/templates.mjs +4 -3
  12. package/dist/module.d.mts +15 -1
  13. package/dist/module.json +2 -2
  14. package/dist/module.mjs +3 -3
  15. package/dist/runtime/components/Accordion.vue.d.ts +1 -1
  16. package/dist/runtime/components/Alert.vue.d.ts +2 -2
  17. package/dist/runtime/components/App.vue.d.ts +1 -1
  18. package/dist/runtime/components/Avatar.vue.d.ts +1 -1
  19. package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
  20. package/dist/runtime/components/Badge.vue.d.ts +1 -1
  21. package/dist/runtime/components/Banner.vue.d.ts +1 -5
  22. package/dist/runtime/components/BlogPost.vue.d.ts +1 -1
  23. package/dist/runtime/components/BlogPosts.vue.d.ts +1 -1
  24. package/dist/runtime/components/Breadcrumb.vue.d.ts +1 -1
  25. package/dist/runtime/components/Button.vue +6 -6
  26. package/dist/runtime/components/Button.vue.d.ts +1 -5
  27. package/dist/runtime/components/ButtonGroup.vue.d.ts +1 -1
  28. package/dist/runtime/components/Calendar.vue.d.ts +1 -1
  29. package/dist/runtime/components/Card.vue.d.ts +1 -1
  30. package/dist/runtime/components/Carousel.vue +18 -14
  31. package/dist/runtime/components/Carousel.vue.d.ts +1 -1
  32. package/dist/runtime/components/ChangelogVersion.vue.d.ts +1 -1
  33. package/dist/runtime/components/ChangelogVersions.vue.d.ts +1 -1
  34. package/dist/runtime/components/ChatMessage.vue.d.ts +4 -8
  35. package/dist/runtime/components/ChatMessages.vue.d.ts +1 -1
  36. package/dist/runtime/components/ChatPalette.vue.d.ts +1 -1
  37. package/dist/runtime/components/ChatPrompt.vue.d.ts +1 -1
  38. package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +1 -1
  39. package/dist/runtime/components/Checkbox.vue.d.ts +1 -1
  40. package/dist/runtime/components/CheckboxGroup.vue.d.ts +1 -1
  41. package/dist/runtime/components/Chip.vue.d.ts +2 -2
  42. package/dist/runtime/components/Collapsible.vue.d.ts +1 -1
  43. package/dist/runtime/components/ColorPicker.vue +1 -2
  44. package/dist/runtime/components/ColorPicker.vue.d.ts +1 -1
  45. package/dist/runtime/components/CommandPalette.vue +4 -0
  46. package/dist/runtime/components/CommandPalette.vue.d.ts +9 -4
  47. package/dist/runtime/components/Container.vue.d.ts +1 -1
  48. package/dist/runtime/components/ContextMenu.vue.d.ts +1 -1
  49. package/dist/runtime/components/ContextMenuContent.vue.d.ts +1 -1
  50. package/dist/runtime/components/DashboardGroup.vue.d.ts +1 -1
  51. package/dist/runtime/components/DashboardNavbar.vue.d.ts +1 -1
  52. package/dist/runtime/components/DashboardPanel.vue.d.ts +1 -1
  53. package/dist/runtime/components/DashboardResizeHandle.vue.d.ts +1 -1
  54. package/dist/runtime/components/DashboardSearchButton.vue.d.ts +1 -1
  55. package/dist/runtime/components/DashboardSidebar.vue.d.ts +1 -1
  56. package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +1 -1
  57. package/dist/runtime/components/DashboardSidebarToggle.vue +5 -2
  58. package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +1 -1
  59. package/dist/runtime/components/DashboardToolbar.vue.d.ts +3 -3
  60. package/dist/runtime/components/Drawer.vue +4 -4
  61. package/dist/runtime/components/Drawer.vue.d.ts +6 -1
  62. package/dist/runtime/components/DropdownMenu.vue.d.ts +1 -1
  63. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +8 -5
  64. package/dist/runtime/components/Error.vue.d.ts +1 -1
  65. package/dist/runtime/components/FileUpload.vue +242 -0
  66. package/dist/runtime/components/FileUpload.vue.d.ts +167 -0
  67. package/dist/runtime/components/Footer.vue.d.ts +1 -1
  68. package/dist/runtime/components/FooterColumns.vue.d.ts +1 -1
  69. package/dist/runtime/components/Form.vue.d.ts +5 -4
  70. package/dist/runtime/components/FormField.vue +2 -2
  71. package/dist/runtime/components/FormField.vue.d.ts +4 -4
  72. package/dist/runtime/components/Header.vue.d.ts +1 -1
  73. package/dist/runtime/components/Icon.vue.d.ts +1 -1
  74. package/dist/runtime/components/Input.vue +10 -7
  75. package/dist/runtime/components/Input.vue.d.ts +9 -9
  76. package/dist/runtime/components/InputMenu.vue +17 -10
  77. package/dist/runtime/components/InputMenu.vue.d.ts +17 -14
  78. package/dist/runtime/components/InputNumber.vue.d.ts +4 -4
  79. package/dist/runtime/components/InputTags.vue +2 -0
  80. package/dist/runtime/components/InputTags.vue.d.ts +5 -3
  81. package/dist/runtime/components/Kbd.vue +2 -1
  82. package/dist/runtime/components/Kbd.vue.d.ts +5 -1
  83. package/dist/runtime/components/Link.vue +6 -5
  84. package/dist/runtime/components/Link.vue.d.ts +1 -3
  85. package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
  86. package/dist/runtime/components/Main.vue.d.ts +1 -1
  87. package/dist/runtime/components/Modal.vue.d.ts +2 -2
  88. package/dist/runtime/components/NavigationMenu.vue +3 -2
  89. package/dist/runtime/components/NavigationMenu.vue.d.ts +1 -1
  90. package/dist/runtime/components/OverlayProvider.vue.d.ts +1 -1
  91. package/dist/runtime/components/Page.vue.d.ts +1 -1
  92. package/dist/runtime/components/PageAccordion.vue.d.ts +1 -1
  93. package/dist/runtime/components/PageAnchors.vue.d.ts +1 -1
  94. package/dist/runtime/components/PageAside.vue.d.ts +1 -1
  95. package/dist/runtime/components/PageBody.vue.d.ts +1 -1
  96. package/dist/runtime/components/PageCTA.vue.d.ts +1 -1
  97. package/dist/runtime/components/PageCard.vue.d.ts +1 -1
  98. package/dist/runtime/components/PageColumns.vue.d.ts +1 -1
  99. package/dist/runtime/components/PageFeature.vue.d.ts +1 -1
  100. package/dist/runtime/components/PageGrid.vue.d.ts +1 -1
  101. package/dist/runtime/components/PageHeader.vue.d.ts +1 -1
  102. package/dist/runtime/components/PageHero.vue.d.ts +1 -1
  103. package/dist/runtime/components/PageLinks.vue.d.ts +1 -1
  104. package/dist/runtime/components/PageList.vue.d.ts +1 -1
  105. package/dist/runtime/components/PageLogos.vue.d.ts +1 -1
  106. package/dist/runtime/components/PageMarquee.vue.d.ts +1 -1
  107. package/dist/runtime/components/PageSection.vue.d.ts +1 -1
  108. package/dist/runtime/components/Pagination.vue.d.ts +1 -1
  109. package/dist/runtime/components/PinInput.vue.d.ts +1 -1
  110. package/dist/runtime/components/Popover.vue +2 -1
  111. package/dist/runtime/components/Popover.vue.d.ts +8 -2
  112. package/dist/runtime/components/PricingPlan.vue.d.ts +1 -1
  113. package/dist/runtime/components/PricingPlans.vue.d.ts +1 -1
  114. package/dist/runtime/components/PricingTable.vue +90 -33
  115. package/dist/runtime/components/PricingTable.vue.d.ts +1 -1
  116. package/dist/runtime/components/Progress.vue.d.ts +1 -1
  117. package/dist/runtime/components/RadioGroup.vue +1 -1
  118. package/dist/runtime/components/RadioGroup.vue.d.ts +5 -4
  119. package/dist/runtime/components/ScrollToSection.vue +62 -0
  120. package/dist/runtime/components/ScrollToSection.vue.d.ts +36 -0
  121. package/dist/runtime/components/Select.vue.d.ts +1 -1
  122. package/dist/runtime/components/SelectMenu.vue +9 -6
  123. package/dist/runtime/components/SelectMenu.vue.d.ts +4 -4
  124. package/dist/runtime/components/Separator.vue.d.ts +1 -1
  125. package/dist/runtime/components/Skeleton.vue.d.ts +1 -1
  126. package/dist/runtime/components/Slideover.vue.d.ts +2 -2
  127. package/dist/runtime/components/Slider.vue.d.ts +5 -5
  128. package/dist/runtime/components/Stepper.vue.d.ts +1 -1
  129. package/dist/runtime/components/Switch.vue.d.ts +1 -1
  130. package/dist/runtime/components/Table.vue +83 -8
  131. package/dist/runtime/components/Table.vue.d.ts +20 -4
  132. package/dist/runtime/components/Tabs.vue +26 -5
  133. package/dist/runtime/components/Tabs.vue.d.ts +8 -3
  134. package/dist/runtime/components/Textarea.vue +10 -7
  135. package/dist/runtime/components/Textarea.vue.d.ts +10 -9
  136. package/dist/runtime/components/Timeline.vue.d.ts +1 -1
  137. package/dist/runtime/components/Toast.vue +12 -4
  138. package/dist/runtime/components/Toast.vue.d.ts +14 -13
  139. package/dist/runtime/components/Toaster.vue.d.ts +1 -1
  140. package/dist/runtime/components/Tooltip.vue +2 -1
  141. package/dist/runtime/components/Tooltip.vue.d.ts +8 -2
  142. package/dist/runtime/components/Tree.vue +3 -2
  143. package/dist/runtime/components/Tree.vue.d.ts +1 -1
  144. package/dist/runtime/components/User.vue.d.ts +1 -1
  145. package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +1 -1
  146. package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +1 -1
  147. package/dist/runtime/components/color-mode/ColorModeImage.vue.d.ts +1 -1
  148. package/dist/runtime/components/color-mode/ColorModeSelect.vue +1 -1
  149. package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +1 -1
  150. package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
  151. package/dist/runtime/components/content/ContentNavigation.vue.d.ts +1 -1
  152. package/dist/runtime/components/content/ContentSearch.vue +17 -7
  153. package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +1 -1
  154. package/dist/runtime/components/content/ContentSurround.vue +10 -4
  155. package/dist/runtime/components/content/ContentSurround.vue.d.ts +1 -1
  156. package/dist/runtime/components/content/ContentToc.vue.d.ts +1 -1
  157. package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +1 -1
  158. package/dist/runtime/components/prose/A.vue.d.ts +1 -1
  159. package/dist/runtime/components/prose/Accordion.vue.d.ts +1 -1
  160. package/dist/runtime/components/prose/AccordionItem.vue.d.ts +1 -1
  161. package/dist/runtime/components/prose/Badge.vue.d.ts +1 -1
  162. package/dist/runtime/components/prose/Blockquote.vue.d.ts +1 -1
  163. package/dist/runtime/components/prose/Callout.vue.d.ts +1 -1
  164. package/dist/runtime/components/prose/Card.vue.d.ts +1 -1
  165. package/dist/runtime/components/prose/CardGroup.vue.d.ts +1 -1
  166. package/dist/runtime/components/prose/Code.vue.d.ts +1 -1
  167. package/dist/runtime/components/prose/CodeCollapse.vue.d.ts +1 -1
  168. package/dist/runtime/components/prose/CodeGroup.vue.d.ts +1 -1
  169. package/dist/runtime/components/prose/CodeIcon.vue.d.ts +1 -1
  170. package/dist/runtime/components/prose/CodePreview.vue.d.ts +1 -1
  171. package/dist/runtime/components/prose/CodeTree.vue.d.ts +1 -1
  172. package/dist/runtime/components/prose/Collapsible.vue.d.ts +1 -1
  173. package/dist/runtime/components/prose/Em.vue.d.ts +1 -1
  174. package/dist/runtime/components/prose/Field.vue.d.ts +1 -1
  175. package/dist/runtime/components/prose/FieldGroup.vue.d.ts +1 -1
  176. package/dist/runtime/components/prose/H1.vue.d.ts +1 -1
  177. package/dist/runtime/components/prose/H2.vue.d.ts +1 -1
  178. package/dist/runtime/components/prose/H3.vue.d.ts +1 -1
  179. package/dist/runtime/components/prose/H4.vue.d.ts +1 -1
  180. package/dist/runtime/components/prose/Hr.vue.d.ts +1 -1
  181. package/dist/runtime/components/prose/Icon.vue.d.ts +1 -1
  182. package/dist/runtime/components/prose/Img.vue.d.ts +1 -1
  183. package/dist/runtime/components/prose/Kbd.vue.d.ts +1 -1
  184. package/dist/runtime/components/prose/Li.vue.d.ts +1 -1
  185. package/dist/runtime/components/prose/Ol.vue.d.ts +1 -1
  186. package/dist/runtime/components/prose/P.vue.d.ts +1 -1
  187. package/dist/runtime/components/prose/Pre.vue.d.ts +1 -1
  188. package/dist/runtime/components/prose/Script.vue.d.ts +1 -1
  189. package/dist/runtime/components/prose/Steps.vue.d.ts +1 -1
  190. package/dist/runtime/components/prose/Strong.vue.d.ts +1 -1
  191. package/dist/runtime/components/prose/Table.vue.d.ts +1 -1
  192. package/dist/runtime/components/prose/Tabs.vue.d.ts +1 -1
  193. package/dist/runtime/components/prose/TabsItem.vue.d.ts +1 -1
  194. package/dist/runtime/components/prose/Tbody.vue.d.ts +1 -1
  195. package/dist/runtime/components/prose/Td.vue.d.ts +1 -1
  196. package/dist/runtime/components/prose/Th.vue.d.ts +1 -1
  197. package/dist/runtime/components/prose/Thead.vue.d.ts +1 -1
  198. package/dist/runtime/components/prose/Tr.vue.d.ts +1 -1
  199. package/dist/runtime/components/prose/Ul.vue.d.ts +1 -1
  200. package/dist/runtime/components/prose/callout/Caution.vue.d.ts +3 -3
  201. package/dist/runtime/components/prose/callout/Note.vue.d.ts +3 -3
  202. package/dist/runtime/components/prose/callout/Tip.vue.d.ts +3 -3
  203. package/dist/runtime/components/prose/callout/Warning.vue.d.ts +3 -3
  204. package/dist/runtime/composables/defineShortcuts.js +5 -3
  205. package/dist/runtime/composables/useBreakpoint.js +8 -8
  206. package/dist/runtime/composables/useFileUpload.d.ts +19 -0
  207. package/dist/runtime/composables/useFileUpload.js +63 -0
  208. package/dist/runtime/composables/useFormField.d.ts +1 -4
  209. package/dist/runtime/composables/useFormField.js +5 -2
  210. package/dist/runtime/composables/useKbd.d.ts +1 -1
  211. package/dist/runtime/composables/useLocale.js +2 -2
  212. package/dist/runtime/composables/useOverlay.d.ts +28 -1
  213. package/dist/runtime/composables/useOverlay.js +4 -4
  214. package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
  215. package/dist/runtime/inertia/components/LinkBase.vue.d.ts +1 -1
  216. package/dist/runtime/inertia/stubs.d.ts +1 -0
  217. package/dist/runtime/inertia/stubs.js +4 -2
  218. package/dist/runtime/locale/ar.js +2 -1
  219. package/dist/runtime/locale/az.js +1 -0
  220. package/dist/runtime/locale/bg.js +1 -0
  221. package/dist/runtime/locale/bn.js +1 -0
  222. package/dist/runtime/locale/ca.js +1 -0
  223. package/dist/runtime/locale/ckb.js +2 -1
  224. package/dist/runtime/locale/cs.js +1 -0
  225. package/dist/runtime/locale/da.js +1 -0
  226. package/dist/runtime/locale/de.js +1 -0
  227. package/dist/runtime/locale/el.js +1 -0
  228. package/dist/runtime/locale/en.js +1 -0
  229. package/dist/runtime/locale/es.js +1 -0
  230. package/dist/runtime/locale/et.js +1 -0
  231. package/dist/runtime/locale/fa_ir.js +1 -0
  232. package/dist/runtime/locale/fi.js +1 -0
  233. package/dist/runtime/locale/fr.js +1 -0
  234. package/dist/runtime/locale/he.js +1 -0
  235. package/dist/runtime/locale/hi.js +2 -1
  236. package/dist/runtime/locale/hu.js +1 -0
  237. package/dist/runtime/locale/hy.js +1 -0
  238. package/dist/runtime/locale/id.js +1 -0
  239. package/dist/runtime/locale/it.js +1 -0
  240. package/dist/runtime/locale/ja.js +1 -0
  241. package/dist/runtime/locale/kk.js +1 -0
  242. package/dist/runtime/locale/km.js +2 -1
  243. package/dist/runtime/locale/ko.js +1 -0
  244. package/dist/runtime/locale/ky.js +1 -0
  245. package/dist/runtime/locale/lb.js +1 -0
  246. package/dist/runtime/locale/lt.js +1 -0
  247. package/dist/runtime/locale/mn.js +1 -0
  248. package/dist/runtime/locale/ms.js +1 -0
  249. package/dist/runtime/locale/nb_no.js +1 -0
  250. package/dist/runtime/locale/nl.js +1 -0
  251. package/dist/runtime/locale/pl.js +1 -0
  252. package/dist/runtime/locale/pt.js +1 -0
  253. package/dist/runtime/locale/pt_br.js +1 -0
  254. package/dist/runtime/locale/ro.js +1 -0
  255. package/dist/runtime/locale/ru.js +1 -0
  256. package/dist/runtime/locale/sk.js +1 -0
  257. package/dist/runtime/locale/sl.js +1 -0
  258. package/dist/runtime/locale/sv.js +1 -0
  259. package/dist/runtime/locale/th.js +1 -0
  260. package/dist/runtime/locale/tj.js +1 -0
  261. package/dist/runtime/locale/tr.js +1 -0
  262. package/dist/runtime/locale/ug_cn.js +1 -0
  263. package/dist/runtime/locale/uk.js +1 -0
  264. package/dist/runtime/locale/ur.js +1 -0
  265. package/dist/runtime/locale/uz.js +1 -0
  266. package/dist/runtime/locale/vi.js +1 -0
  267. package/dist/runtime/locale/zh_cn.js +1 -0
  268. package/dist/runtime/locale/zh_tw.js +1 -0
  269. package/dist/runtime/types/index.d.ts +2 -0
  270. package/dist/runtime/types/index.js +2 -0
  271. package/dist/runtime/types/locale.d.ts +1 -0
  272. package/dist/runtime/utils/content.d.ts +18 -6
  273. package/dist/runtime/utils/content.js +51 -25
  274. package/dist/runtime/utils/index.d.ts +1 -0
  275. package/dist/runtime/utils/index.js +9 -0
  276. package/dist/runtime/vue/components/Icon.vue.d.ts +1 -1
  277. package/dist/runtime/vue/components/Link.vue.d.ts +1 -1
  278. package/dist/runtime/vue/components/color-mode/ColorModeButton.vue.d.ts +1 -1
  279. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +1 -1
  280. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue.d.ts +1 -1
  281. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
  282. package/dist/runtime/vue/stubs.d.ts +1 -0
  283. package/dist/runtime/vue/stubs.js +3 -1
  284. package/dist/shared/{ui.i6pGHFq6.mjs → ui.CgUuvRXi.mjs} +282 -29
  285. package/dist/unplugin.d.mts +2 -1
  286. package/dist/unplugin.mjs +6 -3
  287. package/dist/vite.mjs +1 -1
  288. package/package.json +57 -41
@@ -53,7 +53,7 @@ export interface SwitchSlots {
53
53
  }
54
54
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SwitchProps & {
55
55
  modelValue?: boolean;
56
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
56
+ }, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
57
57
  change: (payload: Event) => any;
58
58
  "update:modelValue": (value: boolean) => any;
59
59
  }, string, import("vue").PublicProps, Readonly<SwitchProps & {
@@ -18,7 +18,7 @@ const props = defineProps({
18
18
  caption: { type: String, required: false },
19
19
  meta: { type: Object, required: false },
20
20
  empty: { type: String, required: false },
21
- sticky: { type: Boolean, required: false },
21
+ sticky: { type: [Boolean, String], required: false },
22
22
  loading: { type: Boolean, required: false },
23
23
  loadingColor: { type: null, required: false },
24
24
  loadingAnimation: { type: null, required: false },
@@ -38,6 +38,8 @@ const props = defineProps({
38
38
  paginationOptions: { type: Object, required: false },
39
39
  facetedOptions: { type: Object, required: false },
40
40
  onSelect: { type: Function, required: false },
41
+ onHover: { type: Function, required: false },
42
+ onContextmenu: { type: [Function, Array], required: false },
41
43
  class: { type: null, required: false },
42
44
  ui: { type: null, required: false },
43
45
  state: { type: Object, required: false },
@@ -69,6 +71,20 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.table || {} }
69
71
  loadingColor: props.loadingColor,
70
72
  loadingAnimation: props.loadingAnimation
71
73
  }));
74
+ const hasFooter = computed(() => {
75
+ function hasFooterRecursive(columns2) {
76
+ for (const column of columns2) {
77
+ if ("footer" in column) {
78
+ return true;
79
+ }
80
+ if ("columns" in column && hasFooterRecursive(column.columns)) {
81
+ return true;
82
+ }
83
+ }
84
+ return false;
85
+ }
86
+ return hasFooterRecursive(columns.value);
87
+ });
72
88
  const globalFilterState = defineModel("globalFilter", { type: String, ...{ default: void 0 } });
73
89
  const columnFiltersState = defineModel("columnFilters", { type: Array, ...{ default: [] } });
74
90
  const columnOrderState = defineModel("columnOrder", { type: Array, ...{ default: [] } });
@@ -86,7 +102,9 @@ const tableRef = ref(null);
86
102
  const tableApi = useVueTable({
87
103
  ...reactiveOmit(props, "as", "data", "columns", "caption", "sticky", "loading", "loadingColor", "loadingAnimation", "class", "ui"),
88
104
  data,
89
- columns: columns.value,
105
+ get columns() {
106
+ return columns.value;
107
+ },
90
108
  meta: meta.value,
91
109
  getCoreRowModel: getCoreRowModel(),
92
110
  ...props.globalFilterOptions || {},
@@ -162,7 +180,7 @@ const tableApi = useVueTable({
162
180
  function valueUpdater(updaterOrValue, ref2) {
163
181
  ref2.value = typeof updaterOrValue === "function" ? updaterOrValue(ref2.value) : updaterOrValue;
164
182
  }
165
- function handleRowSelect(row, e) {
183
+ function onRowSelect(e, row) {
166
184
  if (!props.onSelect) {
167
185
  return;
168
186
  }
@@ -175,6 +193,28 @@ function handleRowSelect(row, e) {
175
193
  e.stopPropagation();
176
194
  props.onSelect(row, e);
177
195
  }
196
+ function onRowHover(e, row) {
197
+ if (!props.onHover) {
198
+ return;
199
+ }
200
+ props.onHover(e, row);
201
+ }
202
+ function onRowContextmenu(e, row) {
203
+ if (!props.onContextmenu) {
204
+ return;
205
+ }
206
+ if (Array.isArray(props.onContextmenu)) {
207
+ props.onContextmenu.forEach((fn) => fn(e, row));
208
+ } else {
209
+ props.onContextmenu(e, row);
210
+ }
211
+ }
212
+ function resolveValue(prop, arg) {
213
+ if (typeof prop === "function") {
214
+ return prop(arg);
215
+ }
216
+ return prop;
217
+ }
178
218
  watch(
179
219
  () => props.data,
180
220
  () => {
@@ -203,11 +243,13 @@ defineExpose({
203
243
  v-for="header in headerGroup.headers"
204
244
  :key="header.id"
205
245
  :data-pinned="header.column.getIsPinned()"
246
+ :scope="header.colSpan > 1 ? 'colgroup' : 'col'"
206
247
  :colspan="header.colSpan > 1 ? header.colSpan : void 0"
248
+ :rowspan="header.rowSpan > 1 ? header.rowSpan : void 0"
207
249
  :class="ui.th({
208
250
  class: [
209
251
  props.ui?.th,
210
- typeof header.column.columnDef.meta?.class?.th === 'function' ? header.column.columnDef.meta.class.th(header) : header.column.columnDef.meta?.class?.th
252
+ resolveValue(header.column.columnDef.meta?.class?.th, header)
211
253
  ],
212
254
  pinned: !!header.column.getIsPinned()
213
255
  })"
@@ -228,29 +270,36 @@ defineExpose({
228
270
  <template v-for="row in tableApi.getRowModel().rows" :key="row.id">
229
271
  <tr
230
272
  :data-selected="row.getIsSelected()"
231
- :data-selectable="!!props.onSelect"
273
+ :data-selectable="!!props.onSelect || !!props.onHover || !!props.onContextmenu"
232
274
  :data-expanded="row.getIsExpanded()"
233
275
  :role="props.onSelect ? 'button' : void 0"
234
276
  :tabindex="props.onSelect ? 0 : void 0"
235
277
  :class="ui.tr({
236
278
  class: [
237
279
  props.ui?.tr,
238
- typeof tableApi.options.meta?.class?.tr === 'function' ? tableApi.options.meta.class.tr(row) : tableApi.options.meta?.class?.tr
280
+ resolveValue(tableApi.options.meta?.class?.tr, row)
239
281
  ]
240
282
  })"
241
- @click="handleRowSelect(row, $event)"
283
+ :style="resolveValue(tableApi.options.meta?.style?.tr, row)"
284
+ @click="onRowSelect($event, row)"
285
+ @pointerenter="onRowHover($event, row)"
286
+ @pointerleave="onRowHover($event, null)"
287
+ @contextmenu="onRowContextmenu($event, row)"
242
288
  >
243
289
  <td
244
290
  v-for="cell in row.getVisibleCells()"
245
291
  :key="cell.id"
246
292
  :data-pinned="cell.column.getIsPinned()"
293
+ :colspan="resolveValue(cell.column.columnDef.meta?.colspan?.td, cell)"
294
+ :rowspan="resolveValue(cell.column.columnDef.meta?.rowspan?.td, cell)"
247
295
  :class="ui.td({
248
296
  class: [
249
297
  props.ui?.td,
250
- typeof cell.column.columnDef.meta?.class?.td === 'function' ? cell.column.columnDef.meta.class.td(cell) : cell.column.columnDef.meta?.class?.td
298
+ resolveValue(cell.column.columnDef.meta?.class?.td, cell)
251
299
  ],
252
300
  pinned: !!cell.column.getIsPinned()
253
301
  })"
302
+ :style="resolveValue(cell.column.columnDef.meta?.style?.td, cell)"
254
303
  >
255
304
  <slot :name="`${cell.column.id}-cell`" v-bind="cell.getContext()">
256
305
  <FlexRender :render="cell.column.columnDef.cell" :props="cell.getContext()" />
@@ -281,6 +330,32 @@ defineExpose({
281
330
 
282
331
  <slot name="body-bottom" />
283
332
  </tbody>
333
+
334
+ <tfoot v-if="hasFooter" :class="ui.tfoot({ class: [props.ui?.tfoot] })">
335
+ <tr :class="ui.separator({ class: [props.ui?.separator] })" />
336
+
337
+ <tr v-for="footerGroup in tableApi.getFooterGroups()" :key="footerGroup.id" :class="ui.tr({ class: [props.ui?.tr] })">
338
+ <th
339
+ v-for="header in footerGroup.headers"
340
+ :key="header.id"
341
+ :data-pinned="header.column.getIsPinned()"
342
+ :colspan="header.colSpan > 1 ? header.colSpan : void 0"
343
+ :rowspan="header.rowSpan > 1 ? header.rowSpan : void 0"
344
+ :class="ui.th({
345
+ class: [
346
+ props.ui?.th,
347
+ resolveValue(header.column.columnDef.meta?.class?.th, header)
348
+ ],
349
+ pinned: !!header.column.getIsPinned()
350
+ })"
351
+ :style="resolveValue(header.column.columnDef.meta?.style?.th, header)"
352
+ >
353
+ <slot :name="`${header.id}-footer`" v-bind="header.getContext()">
354
+ <FlexRender v-if="!header.isPlaceholder" :render="header.column.columnDef.footer" :props="header.getContext()" />
355
+ </slot>
356
+ </th>
357
+ </tr>
358
+ </tfoot>
284
359
  </table>
285
360
  </Primitive>
286
361
  </template>
@@ -10,11 +10,24 @@ declare module '@tanstack/table-core' {
10
10
  th?: string | ((cell: Header<TData, TValue>) => string);
11
11
  td?: string | ((cell: Cell<TData, TValue>) => string);
12
12
  };
13
+ style?: {
14
+ th?: string | Record<string, string> | ((cell: Header<TData, TValue>) => string | Record<string, string>);
15
+ td?: string | Record<string, string> | ((cell: Cell<TData, TValue>) => string | Record<string, string>);
16
+ };
17
+ colspan?: {
18
+ td?: string | ((cell: Cell<TData, TValue>) => string);
19
+ };
20
+ rowspan?: {
21
+ td?: string | ((cell: Cell<TData, TValue>) => string);
22
+ };
13
23
  }
14
24
  interface TableMeta<TData> {
15
25
  class?: {
16
26
  tr?: string | ((row: Row<TData>) => string);
17
27
  };
28
+ style?: {
29
+ tr?: string | Record<string, string> | ((row: Row<TData>) => string | Record<string, string>);
30
+ };
18
31
  }
19
32
  }
20
33
  type Table = ComponentConfig<typeof theme, AppConfig, 'table'>;
@@ -42,10 +55,10 @@ export interface TableProps<T extends TableData = TableData> extends TableOption
42
55
  */
43
56
  empty?: string;
44
57
  /**
45
- * Whether the table should have a sticky header.
58
+ * Whether the table should have a sticky header or footer. True for both, 'header' for header only, 'footer' for footer only.
46
59
  * @defaultValue false
47
60
  */
48
- sticky?: boolean;
61
+ sticky?: boolean | 'header' | 'footer';
49
62
  /** Whether the table should be in loading state. */
50
63
  loading?: boolean;
51
64
  /**
@@ -124,10 +137,13 @@ export interface TableProps<T extends TableData = TableData> extends TableOption
124
137
  */
125
138
  facetedOptions?: FacetedOptions<T>;
126
139
  onSelect?: (row: TableRow<T>, e?: Event) => void;
140
+ onHover?: (e: Event, row: TableRow<T> | null) => void;
141
+ onContextmenu?: ((e: Event, row: TableRow<T>) => void) | Array<((e: Event, row: TableRow<T>) => void)>;
127
142
  class?: any;
128
143
  ui?: Table['slots'];
129
144
  }
130
145
  type DynamicHeaderSlots<T, K = keyof T> = Record<string, (props: HeaderContext<T, unknown>) => any> & Record<`${K extends string ? K : never}-header`, (props: HeaderContext<T, unknown>) => any>;
146
+ type DynamicFooterSlots<T, K = keyof T> = Record<string, (props: HeaderContext<T, unknown>) => any> & Record<`${K extends string ? K : never}-footer`, (props: HeaderContext<T, unknown>) => any>;
131
147
  type DynamicCellSlots<T, K = keyof T> = Record<string, (props: CellContext<T, unknown>) => any> & Record<`${K extends string ? K : never}-cell`, (props: CellContext<T, unknown>) => any>;
132
148
  export type TableSlots<T extends TableData = TableData> = {
133
149
  'expanded': (props: {
@@ -138,7 +154,7 @@ export type TableSlots<T extends TableData = TableData> = {
138
154
  'caption': (props?: {}) => any;
139
155
  'body-top': (props?: {}) => any;
140
156
  'body-bottom': (props?: {}) => any;
141
- } & DynamicHeaderSlots<T> & DynamicCellSlots<T>;
157
+ } & DynamicHeaderSlots<T> & DynamicFooterSlots<T> & DynamicCellSlots<T>;
142
158
  declare const _default: <T extends TableData>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
143
159
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
144
160
  readonly "onUpdate:globalFilter"?: ((value: string) => any) | undefined;
@@ -181,5 +197,5 @@ declare const _default: <T extends TableData>(__VLS_props: NonNullable<Awaited<t
181
197
  };
182
198
  export default _default;
183
199
  type __VLS_PrettifyLocal<T> = {
184
- [K in keyof T]: T[K];
200
+ [K in keyof T as K]: T[K];
185
201
  } & {};
@@ -61,22 +61,43 @@ defineExpose({
61
61
  >
62
62
  <slot name="leading" :item="item" :index="index">
63
63
  <UIcon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })" />
64
- <UAvatar v-else-if="item.avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="item.avatar" :class="ui.leadingAvatar({ class: [props.ui?.leadingAvatar, item.ui?.leadingAvatar] })" />
64
+ <UAvatar v-else-if="item.avatar" :size="item.ui?.leadingAvatarSize || props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="item.avatar" :class="ui.leadingAvatar({ class: [props.ui?.leadingAvatar, item.ui?.leadingAvatar] })" />
65
65
  </slot>
66
66
 
67
- <span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })">
67
+ <span
68
+ v-if="get(item, props.labelKey) || !!slots.default"
69
+ :class="ui.label({ class: [props.ui?.label, item.ui?.label] })"
70
+ >
68
71
  <slot :item="item" :index="index">{{ get(item, props.labelKey) }}</slot>
69
72
  </span>
70
73
 
71
- <slot name="trailing" :item="item" :index="index" />
74
+ <slot name="trailing" :item="item" :index="index">
75
+ <UBadge
76
+ v-if="item.badge !== void 0"
77
+ color="neutral"
78
+ variant="outline"
79
+ :size="item.ui?.trailingBadgeSize || props.ui?.trailingBadgeSize || ui.trailingBadgeSize()"
80
+ v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
81
+ :class="ui.trailingBadge({ class: [props.ui?.trailingBadge, item.ui?.trailingBadge] })"
82
+ />
83
+ </slot>
72
84
  </TabsTrigger>
73
85
 
74
86
  <slot name="list-trailing" />
75
87
  </TabsList>
76
88
 
77
89
  <template v-if="!!content">
78
- <TabsContent v-for="(item, index) of items" :key="index" :value="item.value || String(index)" :class="ui.content({ class: [props.ui?.content, item.ui?.content, item.class] })">
79
- <slot :name="item.slot || 'content'" :item="item" :index="index">
90
+ <TabsContent
91
+ v-for="(item, index) of items || []"
92
+ :key="index"
93
+ :value="item.value || String(index)"
94
+ :class="ui.content({ class: [props.ui?.content, item.ui?.content, item.class] })"
95
+ >
96
+ <slot
97
+ :name="item.slot || 'content'"
98
+ :item="item"
99
+ :index="index"
100
+ >
80
101
  {{ item.content }}
81
102
  </slot>
82
103
  </TabsContent>
@@ -2,7 +2,7 @@ import type { ComponentPublicInstance } from 'vue';
2
2
  import type { TabsRootProps, TabsRootEmits } from 'reka-ui';
3
3
  import type { AppConfig } from '@nuxt/schema';
4
4
  import theme from '#build/ui/tabs';
5
- import type { AvatarProps } from '../types';
5
+ import type { AvatarProps, BadgeProps } from '../types';
6
6
  import type { DynamicSlots, ComponentConfig } from '../types/utils';
7
7
  type Tabs = ComponentConfig<typeof theme, AppConfig, 'tabs'>;
8
8
  export interface TabsItem {
@@ -12,13 +12,18 @@ export interface TabsItem {
12
12
  */
13
13
  icon?: string;
14
14
  avatar?: AvatarProps;
15
+ /**
16
+ * Display a badge on the item.
17
+ * `{ size: 'sm', color: 'neutral', variant: 'outline' }`{lang="ts-type"}
18
+ */
19
+ badge?: string | number | BadgeProps;
15
20
  slot?: string;
16
21
  content?: string;
17
22
  /** A unique value for the tab item. Defaults to the index. */
18
23
  value?: string | number;
19
24
  disabled?: boolean;
20
25
  class?: any;
21
- ui?: Pick<Tabs['slots'], 'trigger' | 'leadingIcon' | 'leadingAvatar' | 'label' | 'content'>;
26
+ ui?: Pick<Tabs['slots'], 'trigger' | 'leadingIcon' | 'leadingAvatar' | 'leadingAvatarSize' | 'label' | 'trailingBadge' | 'trailingBadgeSize' | 'content'>;
22
27
  [key: string]: any;
23
28
  }
24
29
  export interface TabsProps<T extends TabsItem = TabsItem> extends Pick<TabsRootProps<string | number>, 'defaultValue' | 'modelValue' | 'activationMode' | 'unmountOnHide'> {
@@ -89,5 +94,5 @@ declare const _default: <T extends TabsItem>(__VLS_props: NonNullable<Awaited<ty
89
94
  };
90
95
  export default _default;
91
96
  type __VLS_PrettifyLocal<T> = {
92
- [K in keyof T]: T[K];
97
+ [K in keyof T as K]: T[K];
93
98
  } & {};
@@ -5,6 +5,7 @@ import theme from "#build/ui/textarea";
5
5
  <script setup>
6
6
  import { ref, computed, onMounted, nextTick, watch } from "vue";
7
7
  import { Primitive } from "reka-ui";
8
+ import { useVModel } from "@vueuse/core";
8
9
  import { useAppConfig } from "#imports";
9
10
  import { useComponentIcons } from "../composables/useComponentIcons";
10
11
  import { useFormField } from "../composables/useFormField";
@@ -30,6 +31,8 @@ const props = defineProps({
30
31
  rows: { type: Number, required: false, default: 3 },
31
32
  maxrows: { type: Number, required: false, default: 0 },
32
33
  highlight: { type: Boolean, required: false },
34
+ modelValue: { type: null, required: false },
35
+ defaultValue: { type: null, required: false },
33
36
  modelModifiers: { type: Object, required: false },
34
37
  class: { type: null, required: false },
35
38
  ui: { type: null, required: false },
@@ -44,7 +47,7 @@ const props = defineProps({
44
47
  });
45
48
  const emits = defineEmits(["update:modelValue", "blur", "change"]);
46
49
  const slots = defineSlots();
47
- const [modelValue, modelModifiers] = defineModel({ type: null });
50
+ const modelValue = useVModel(props, "modelValue", emits, { defaultValue: props.defaultValue });
48
51
  const appConfig = useAppConfig();
49
52
  const { emitFormFocus, emitFormBlur, emitFormInput, emitFormChange, size, color, id, name, highlight, disabled, ariaAttrs } = useFormField(props, { deferInputValidation: true });
50
53
  const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props);
@@ -60,13 +63,13 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.textarea || {
60
63
  }));
61
64
  const textareaRef = ref(null);
62
65
  function updateInput(value) {
63
- if (modelModifiers.trim) {
66
+ if (props.modelModifiers?.trim) {
64
67
  value = value?.trim() ?? null;
65
68
  }
66
- if (modelModifiers.number) {
69
+ if (props.modelModifiers?.number) {
67
70
  value = looseToNumber(value);
68
71
  }
69
- if (modelModifiers.nullify) {
72
+ if (props.modelModifiers?.nullify) {
70
73
  value ||= null;
71
74
  }
72
75
  modelValue.value = value;
@@ -74,16 +77,16 @@ function updateInput(value) {
74
77
  }
75
78
  function onInput(event) {
76
79
  autoResize();
77
- if (!modelModifiers.lazy) {
80
+ if (!props.modelModifiers?.lazy) {
78
81
  updateInput(event.target.value);
79
82
  }
80
83
  }
81
84
  function onChange(event) {
82
85
  const value = event.target.value;
83
- if (modelModifiers.lazy) {
86
+ if (props.modelModifiers?.lazy) {
84
87
  updateInput(value);
85
88
  }
86
- if (modelModifiers.trim) {
89
+ if (props.modelModifiers?.trim) {
87
90
  event.target.value = value.trim();
88
91
  }
89
92
  emitFormChange();
@@ -4,7 +4,7 @@ import type { UseComponentIconsProps } from '../composables/useComponentIcons';
4
4
  import type { ComponentConfig } from '../types/utils';
5
5
  type Textarea = ComponentConfig<typeof theme, AppConfig, 'textarea'>;
6
6
  type TextareaValue = string | number | null;
7
- export interface TextareaProps extends UseComponentIconsProps {
7
+ export interface TextareaProps<T extends TextareaValue = TextareaValue> extends UseComponentIconsProps {
8
8
  /**
9
9
  * The element or component this component should render as.
10
10
  * @defaultValue 'div'
@@ -36,8 +36,11 @@ export interface TextareaProps extends UseComponentIconsProps {
36
36
  maxrows?: number;
37
37
  /** Highlight the ring color like a focus state. */
38
38
  highlight?: boolean;
39
+ modelValue?: T;
40
+ defaultValue?: T;
39
41
  modelModifiers?: {
40
42
  string?: boolean;
43
+ number?: boolean;
41
44
  trim?: boolean;
42
45
  lazy?: boolean;
43
46
  nullify?: boolean;
@@ -46,9 +49,9 @@ export interface TextareaProps extends UseComponentIconsProps {
46
49
  ui?: Textarea['slots'];
47
50
  }
48
51
  export interface TextareaEmits<T extends TextareaValue = TextareaValue> {
49
- (e: 'update:modelValue', payload: T): void;
50
- (e: 'blur', event: FocusEvent): void;
51
- (e: 'change', event: Event): void;
52
+ 'update:modelValue': [payload: T];
53
+ 'blur': [event: FocusEvent];
54
+ 'change': [event: Event];
52
55
  }
53
56
  export interface TextareaSlots {
54
57
  leading(props?: {}): any;
@@ -60,19 +63,17 @@ declare const _default: <T extends TextareaValue>(__VLS_props: NonNullable<Await
60
63
  readonly onBlur?: ((event: FocusEvent) => any) | undefined;
61
64
  readonly onChange?: ((event: Event) => any) | undefined;
62
65
  readonly "onUpdate:modelValue"?: ((payload: T) => any) | undefined;
63
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onChange" | "onUpdate:modelValue"> & (TextareaProps & {
64
- modelValue?: T;
65
- }) & Partial<{}>> & import("vue").PublicProps;
66
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onChange" | "onUpdate:modelValue"> & TextareaProps<T> & Partial<{}>> & import("vue").PublicProps;
66
67
  expose(exposed: import("vue").ShallowUnwrapRef<{
67
68
  textareaRef: import("vue").Ref<HTMLTextAreaElement | null, HTMLTextAreaElement | null>;
68
69
  }>): void;
69
70
  attrs: any;
70
71
  slots: TextareaSlots;
71
- emit: TextareaEmits<T> & ((evt: "update:modelValue", value: T | undefined) => void);
72
+ emit: ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", payload: T) => void);
72
73
  }>) => import("vue").VNode & {
73
74
  __ctx?: Awaited<typeof __VLS_setup>;
74
75
  };
75
76
  export default _default;
76
77
  type __VLS_PrettifyLocal<T> = {
77
- [K in keyof T]: T[K];
78
+ [K in keyof T as K]: T[K];
78
79
  } & {};
@@ -66,5 +66,5 @@ declare const _default: <T extends TimelineItem>(__VLS_props: NonNullable<Awaite
66
66
  };
67
67
  export default _default;
68
68
  type __VLS_PrettifyLocal<T> = {
69
- [K in keyof T]: T[K];
69
+ [K in keyof T as K]: T[K];
70
70
  } & {};
@@ -12,6 +12,7 @@ import { tv } from "../utils/tv";
12
12
  import UIcon from "./Icon.vue";
13
13
  import UAvatar from "./Avatar.vue";
14
14
  import UButton from "./Button.vue";
15
+ import UProgress from "./Progress.vue";
15
16
  const props = defineProps({
16
17
  as: { type: null, required: false },
17
18
  title: { type: [String, Object, Function], required: false },
@@ -20,10 +21,10 @@ const props = defineProps({
20
21
  avatar: { type: Object, required: false },
21
22
  color: { type: null, required: false },
22
23
  orientation: { type: null, required: false, default: "vertical" },
23
- progress: { type: Boolean, required: false, default: true },
24
- actions: { type: Array, required: false },
25
24
  close: { type: [Boolean, Object], required: false, default: true },
26
25
  closeIcon: { type: String, required: false },
26
+ actions: { type: Array, required: false },
27
+ progress: { type: [Boolean, Object], required: false, default: true },
27
28
  class: { type: null, required: false },
28
29
  ui: { type: null, required: false },
29
30
  defaultOpen: { type: Boolean, required: false },
@@ -59,7 +60,7 @@ defineExpose({
59
60
  <template>
60
61
  <ToastRoot
61
62
  ref="el"
62
- v-slot="{ remaining, duration }"
63
+ v-slot="{ remaining, duration, open }"
63
64
  v-bind="rootProps"
64
65
  :data-orientation="orientation"
65
66
  :class="ui.root({ class: [props.ui?.root, props.class] })"
@@ -124,6 +125,13 @@ defineExpose({
124
125
  </ToastClose>
125
126
  </div>
126
127
 
127
- <div v-if="progress && remaining > 0 && duration" :class="ui.progress({ class: props.ui?.progress })" :style="{ width: `${remaining / duration * 100}%` }" />
128
+ <UProgress
129
+ v-if="progress && open && remaining > 0 && duration"
130
+ :model-value="remaining / duration * 100"
131
+ :color="color"
132
+ v-bind="typeof progress === 'object' ? progress : {}"
133
+ size="sm"
134
+ :class="ui.progress({ class: props.ui?.progress })"
135
+ />
128
136
  </ToastRoot>
129
137
  </template>
@@ -1,7 +1,7 @@
1
1
  import type { ToastRootProps, ToastRootEmits } from 'reka-ui';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import theme from '#build/ui/toast';
4
- import type { AvatarProps, ButtonProps } from '../types';
4
+ import type { AvatarProps, ButtonProps, ProgressProps } from '../types';
5
5
  import type { StringOrVNode, ComponentConfig } from '../types/utils';
6
6
  type Toast = ComponentConfig<typeof theme, AppConfig, 'toast'>;
7
7
  export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open' | 'type' | 'duration'> {
@@ -27,10 +27,17 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
27
27
  */
28
28
  orientation?: Toast['variants']['orientation'];
29
29
  /**
30
- * Whether to show the progress bar.
30
+ * Display a close button to dismiss the toast.
31
+ * `{ size: 'md', color: 'neutral', variant: 'link' }`{lang="ts-type"}
31
32
  * @defaultValue true
32
33
  */
33
- progress?: boolean;
34
+ close?: boolean | Partial<ButtonProps>;
35
+ /**
36
+ * The icon displayed in the close button.
37
+ * @defaultValue appConfig.ui.icons.close
38
+ * @IconifyIcon
39
+ */
40
+ closeIcon?: string;
34
41
  /**
35
42
  * Display a list of actions:
36
43
  * - under the title and description when orientation is `vertical`
@@ -39,17 +46,11 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
39
46
  */
40
47
  actions?: ButtonProps[];
41
48
  /**
42
- * Display a close button to dismiss the toast.
43
- * `{ size: 'md', color: 'neutral', variant: 'link' }`{lang="ts-type"}
49
+ * Display a progress bar showing the toast's remaining duration.
50
+ * `{ size: 'sm' }`{lang="ts-type"}
44
51
  * @defaultValue true
45
52
  */
46
- close?: boolean | Partial<ButtonProps>;
47
- /**
48
- * The icon displayed in the close button.
49
- * @defaultValue appConfig.ui.icons.close
50
- * @IconifyIcon
51
- */
52
- closeIcon?: string;
53
+ progress?: boolean | Pick<ProgressProps, 'color'>;
53
54
  class?: any;
54
55
  ui?: Toast['slots'];
55
56
  }
@@ -152,7 +153,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToastProps
152
153
  }>, "currentTarget">) => any) | undefined;
153
154
  }>, {
154
155
  close: boolean | Partial<ButtonProps>;
155
- progress: boolean;
156
+ progress: boolean | Pick<ProgressProps, "color">;
156
157
  orientation: Toast["variants"]["orientation"];
157
158
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ToastSlots>;
158
159
  export default _default;
@@ -30,7 +30,7 @@ export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'>
30
30
  export interface ToasterSlots {
31
31
  default(props?: {}): any;
32
32
  }
33
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToasterProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
33
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToasterProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
34
34
  progress: boolean;
35
35
  expand: boolean;
36
36
  duration: number;
@@ -17,6 +17,7 @@ const props = defineProps({
17
17
  content: { type: Object, required: false },
18
18
  arrow: { type: [Boolean, Object], required: false },
19
19
  portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
20
+ reference: { type: null, required: false },
20
21
  class: { type: null, required: false },
21
22
  ui: { type: null, required: false },
22
23
  defaultOpen: { type: Boolean, required: false },
@@ -41,7 +42,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.tooltip || {}
41
42
 
42
43
  <template>
43
44
  <TooltipRoot v-slot="{ open }" v-bind="rootProps">
44
- <TooltipTrigger v-if="!!slots.default" v-bind="$attrs" as-child :class="props.class">
45
+ <TooltipTrigger v-if="!!slots.default || !!reference" v-bind="$attrs" as-child :reference="reference" :class="props.class">
45
46
  <slot :open="open" />
46
47
  </TooltipTrigger>
47
48
 
@@ -1,4 +1,4 @@
1
- import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipContentEmits, TooltipArrowProps } from 'reka-ui';
1
+ import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipContentEmits, TooltipArrowProps, TooltipTriggerProps } from 'reka-ui';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import theme from '#build/ui/tooltip';
4
4
  import type { KbdProps } from '../types';
@@ -24,6 +24,12 @@ export interface TooltipProps extends TooltipRootProps {
24
24
  * @defaultValue true
25
25
  */
26
26
  portal?: boolean | string | HTMLElement;
27
+ /**
28
+ * The reference (or anchor) element that is being referred to for positioning.
29
+ *
30
+ * If not provided will use the current component as anchor.
31
+ */
32
+ reference?: TooltipTriggerProps['reference'];
27
33
  class?: any;
28
34
  ui?: Tooltip['slots'];
29
35
  }
@@ -35,7 +41,7 @@ export interface TooltipSlots {
35
41
  }): any;
36
42
  content(props?: {}): any;
37
43
  }
38
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<TooltipProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
44
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<TooltipProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
39
45
  "update:open": (value: boolean) => any;
40
46
  }, string, import("vue").PublicProps, Readonly<TooltipProps> & Readonly<{
41
47
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
@@ -10,6 +10,7 @@ import { useAppConfig } from "#imports";
10
10
  import { get } from "../utils";
11
11
  import { tv } from "../utils/tv";
12
12
  import UIcon from "./Icon.vue";
13
+ defineOptions({ inheritAttrs: false });
13
14
  const props = defineProps({
14
15
  as: { type: null, required: false },
15
16
  color: { type: null, required: false },
@@ -72,7 +73,7 @@ const defaultExpanded = computed(
72
73
  @toggle="item.onToggle"
73
74
  @select="item.onSelect"
74
75
  >
75
- <button :disabled="item.disabled || disabled" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], selected: isSelected, disabled: item.disabled || disabled })">
76
+ <button type="button" :disabled="item.disabled || disabled" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], selected: isSelected, disabled: item.disabled || disabled })">
76
77
  <slot :name="item.slot || 'item'" v-bind="{ index, level, expanded: isExpanded, selected: isSelected }" :item="item">
77
78
  <slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" v-bind="{ index, level, expanded: isExpanded, selected: isSelected }" :item="item">
78
79
  <UIcon
@@ -110,7 +111,7 @@ const defaultExpanded = computed(
110
111
  </DefineTreeTemplate>
111
112
 
112
113
  <TreeRoot
113
- v-bind="rootProps"
114
+ v-bind="{ ...rootProps, ...$attrs }"
114
115
  :class="ui.root({ class: [props.ui?.root, props.class] })"
115
116
  :get-key="getItemValue"
116
117
  :default-expanded="defaultExpanded"