@nuxt/ui 3.0.2 → 3.1.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 (220) hide show
  1. package/.nuxt/ui/accordion.ts +25 -4
  2. package/.nuxt/ui/alert.ts +52 -31
  3. package/.nuxt/ui/avatar-group.ts +24 -3
  4. package/.nuxt/ui/avatar.ts +26 -5
  5. package/.nuxt/ui/badge.ts +56 -35
  6. package/.nuxt/ui/breadcrumb.ts +28 -7
  7. package/.nuxt/ui/button-group.ts +23 -2
  8. package/.nuxt/ui/button.ts +66 -45
  9. package/.nuxt/ui/calendar.ts +39 -18
  10. package/.nuxt/ui/card.ts +28 -7
  11. package/.nuxt/ui/carousel.ts +29 -8
  12. package/.nuxt/ui/checkbox-group.ts +82 -0
  13. package/.nuxt/ui/checkbox.ts +163 -29
  14. package/.nuxt/ui/chip.ts +31 -10
  15. package/.nuxt/ui/collapsible.ts +23 -2
  16. package/.nuxt/ui/color-picker.ts +26 -5
  17. package/.nuxt/ui/command-palette.ts +37 -16
  18. package/.nuxt/ui/container.ts +23 -2
  19. package/.nuxt/ui/context-menu.ts +56 -35
  20. package/.nuxt/ui/drawer.ts +33 -12
  21. package/.nuxt/ui/dropdown-menu.ts +57 -36
  22. package/.nuxt/ui/form-field.ts +29 -8
  23. package/.nuxt/ui/form.ts +23 -2
  24. package/.nuxt/ui/index.ts +1 -0
  25. package/.nuxt/ui/input-menu.ts +65 -44
  26. package/.nuxt/ui/input-number.ts +43 -22
  27. package/.nuxt/ui/input.ts +46 -25
  28. package/.nuxt/ui/kbd.ts +27 -6
  29. package/.nuxt/ui/link.ts +26 -5
  30. package/.nuxt/ui/modal.ts +28 -7
  31. package/.nuxt/ui/navigation-menu.ts +102 -83
  32. package/.nuxt/ui/pagination.ts +23 -2
  33. package/.nuxt/ui/pin-input.ts +43 -22
  34. package/.nuxt/ui/popover.ts +25 -4
  35. package/.nuxt/ui/progress.ts +40 -19
  36. package/.nuxt/ui/radio-group.ts +273 -37
  37. package/.nuxt/ui/select-menu.ts +59 -35
  38. package/.nuxt/ui/select.ts +55 -34
  39. package/.nuxt/ui/separator.ts +31 -10
  40. package/.nuxt/ui/skeleton.ts +24 -3
  41. package/.nuxt/ui/slideover.ts +27 -6
  42. package/.nuxt/ui/slider.ts +39 -18
  43. package/.nuxt/ui/stepper.ts +41 -20
  44. package/.nuxt/ui/switch.ts +43 -22
  45. package/.nuxt/ui/table.ts +38 -17
  46. package/.nuxt/ui/tabs.ts +55 -34
  47. package/.nuxt/ui/textarea.ts +63 -37
  48. package/.nuxt/ui/toast.ts +47 -26
  49. package/.nuxt/ui/toaster.ts +23 -2
  50. package/.nuxt/ui/tooltip.ts +25 -4
  51. package/.nuxt/ui/tree.ts +41 -20
  52. package/.nuxt/ui.css +56 -12
  53. package/README.md +11 -0
  54. package/cli/templates.mjs +18 -17
  55. package/dist/module.json +5 -5
  56. package/dist/module.mjs +11 -7
  57. package/dist/runtime/components/Accordion.vue +36 -93
  58. package/dist/runtime/components/Accordion.vue.d.ts +91 -0
  59. package/dist/runtime/components/Alert.vue +37 -100
  60. package/dist/runtime/components/Alert.vue.d.ts +96 -0
  61. package/dist/runtime/components/App.vue +28 -34
  62. package/dist/runtime/components/App.vue.d.ts +24 -0
  63. package/dist/runtime/components/Avatar.vue +42 -75
  64. package/dist/runtime/components/Avatar.vue.d.ts +60 -0
  65. package/dist/runtime/components/AvatarGroup.vue +40 -77
  66. package/dist/runtime/components/AvatarGroup.vue.d.ts +40 -0
  67. package/dist/runtime/components/Badge.vue +33 -62
  68. package/dist/runtime/components/Badge.vue.d.ts +62 -0
  69. package/dist/runtime/components/Breadcrumb.vue +37 -90
  70. package/dist/runtime/components/Breadcrumb.vue.d.ts +82 -0
  71. package/dist/runtime/components/Button.vue +95 -104
  72. package/dist/runtime/components/Button.vue.d.ts +73 -0
  73. package/dist/runtime/components/ButtonGroup.vue +20 -46
  74. package/dist/runtime/components/ButtonGroup.vue.d.ts +55 -0
  75. package/dist/runtime/components/Calendar.vue +67 -150
  76. package/dist/runtime/components/Calendar.vue.d.ts +107 -0
  77. package/dist/runtime/components/Card.vue +18 -40
  78. package/dist/runtime/components/Card.vue.d.ts +38 -0
  79. package/dist/runtime/components/Carousel.vue +112 -234
  80. package/dist/runtime/components/Carousel.vue.d.ts +120 -0
  81. package/dist/runtime/components/Checkbox.vue +52 -93
  82. package/dist/runtime/components/Checkbox.vue.d.ts +76 -0
  83. package/dist/runtime/components/CheckboxGroup.vue +121 -0
  84. package/dist/runtime/components/CheckboxGroup.vue.d.ts +75 -0
  85. package/dist/runtime/components/Chip.vue +26 -69
  86. package/dist/runtime/components/Chip.vue.d.ts +71 -0
  87. package/dist/runtime/components/Collapsible.vue +22 -41
  88. package/dist/runtime/components/Collapsible.vue.d.ts +50 -0
  89. package/dist/runtime/components/ColorPicker.vue +111 -197
  90. package/dist/runtime/components/ColorPicker.vue.d.ts +63 -0
  91. package/dist/runtime/components/CommandPalette.vue +96 -237
  92. package/dist/runtime/components/CommandPalette.vue.d.ts +173 -0
  93. package/dist/runtime/components/Container.vue +15 -28
  94. package/dist/runtime/components/Container.vue.d.ts +27 -0
  95. package/dist/runtime/components/ContextMenu.vue +34 -133
  96. package/dist/runtime/components/ContextMenu.vue.d.ts +127 -0
  97. package/dist/runtime/components/ContextMenuContent.vue +73 -81
  98. package/dist/runtime/components/ContextMenuContent.vue.d.ts +105 -0
  99. package/dist/runtime/components/Drawer.vue +49 -83
  100. package/dist/runtime/components/Drawer.vue.d.ts +88 -0
  101. package/dist/runtime/components/DropdownMenu.vue +39 -142
  102. package/dist/runtime/components/DropdownMenu.vue.d.ts +141 -0
  103. package/dist/runtime/components/DropdownMenuContent.vue +78 -88
  104. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +55 -0
  105. package/dist/runtime/components/Form.vue +135 -220
  106. package/dist/runtime/components/Form.vue.d.ts +66 -0
  107. package/dist/runtime/components/FormField.vue +35 -77
  108. package/dist/runtime/components/FormField.vue.d.ts +70 -0
  109. package/dist/runtime/components/Icon.vue +12 -19
  110. package/dist/runtime/components/Icon.vue.d.ts +17 -0
  111. package/dist/runtime/components/Input.vue +82 -140
  112. package/dist/runtime/components/Input.vue.d.ts +91 -0
  113. package/dist/runtime/components/InputMenu.vue +185 -332
  114. package/dist/runtime/components/InputMenu.vue.d.ts +312 -0
  115. package/dist/runtime/components/InputNumber.vue +71 -133
  116. package/dist/runtime/components/InputNumber.vue.d.ts +193 -0
  117. package/dist/runtime/components/Kbd.vue +20 -46
  118. package/dist/runtime/components/Kbd.vue.d.ts +55 -0
  119. package/dist/runtime/components/Link.vue +98 -176
  120. package/dist/runtime/components/Link.vue.d.ts +124 -0
  121. package/dist/runtime/components/LinkBase.vue +33 -42
  122. package/dist/runtime/components/LinkBase.vue.d.ts +48 -0
  123. package/dist/runtime/components/Modal.vue +53 -116
  124. package/dist/runtime/components/Modal.vue.d.ts +109 -0
  125. package/dist/runtime/components/NavigationMenu.vue +77 -209
  126. package/dist/runtime/components/NavigationMenu.vue.d.ts +159 -0
  127. package/dist/runtime/components/OverlayProvider.vue +14 -18
  128. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
  129. package/dist/runtime/components/Pagination.vue +46 -140
  130. package/dist/runtime/components/Pagination.vue.d.ts +143 -0
  131. package/dist/runtime/components/PinInput.vue +61 -78
  132. package/dist/runtime/components/PinInput.vue.d.ts +68 -0
  133. package/dist/runtime/components/Popover.vue +47 -84
  134. package/dist/runtime/components/Popover.vue.d.ts +80 -0
  135. package/dist/runtime/components/Progress.vue +70 -131
  136. package/dist/runtime/components/Progress.vue.d.ts +97 -0
  137. package/dist/runtime/components/RadioGroup.vue +70 -132
  138. package/dist/runtime/components/RadioGroup.vue.d.ts +88 -0
  139. package/dist/runtime/components/Select.vue +110 -224
  140. package/dist/runtime/components/Select.vue.d.ts +139 -0
  141. package/dist/runtime/components/SelectMenu.vue +161 -310
  142. package/dist/runtime/components/SelectMenu.vue.d.ts +184 -0
  143. package/dist/runtime/components/Separator.vue +29 -71
  144. package/dist/runtime/components/Separator.vue.d.ts +75 -0
  145. package/dist/runtime/components/Skeleton.vue +21 -23
  146. package/dist/runtime/components/Skeleton.vue.d.ts +26 -0
  147. package/dist/runtime/components/Slideover.vue +53 -120
  148. package/dist/runtime/components/Slideover.vue.d.ts +111 -0
  149. package/dist/runtime/components/Slider.vue +46 -84
  150. package/dist/runtime/components/Slider.vue.d.ts +71 -0
  151. package/dist/runtime/components/Stepper.vue +45 -115
  152. package/dist/runtime/components/Stepper.vue.d.ts +89 -0
  153. package/dist/runtime/components/Switch.vue +45 -93
  154. package/dist/runtime/components/Switch.vue.d.ts +73 -0
  155. package/dist/runtime/components/Table.vue +163 -267
  156. package/dist/runtime/components/Table.vue.d.ts +183 -0
  157. package/dist/runtime/components/Tabs.vue +41 -107
  158. package/dist/runtime/components/Tabs.vue.d.ts +104 -0
  159. package/dist/runtime/components/Textarea.vue +113 -158
  160. package/dist/runtime/components/Textarea.vue.d.ts +95 -0
  161. package/dist/runtime/components/Toast.vue +49 -110
  162. package/dist/runtime/components/Toast.vue.d.ts +95 -0
  163. package/dist/runtime/components/Toaster.vue +70 -107
  164. package/dist/runtime/components/Toaster.vue.d.ts +63 -0
  165. package/dist/runtime/components/Tooltip.vue +38 -65
  166. package/dist/runtime/components/Tooltip.vue.d.ts +65 -0
  167. package/dist/runtime/components/Tree.vue +59 -166
  168. package/dist/runtime/components/Tree.vue.d.ts +128 -0
  169. package/dist/runtime/composables/defineShortcuts.d.ts +1 -1
  170. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  171. package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
  172. package/dist/runtime/composables/useFormField.d.ts +2 -2
  173. package/dist/runtime/composables/useOverlay.d.ts +14 -7
  174. package/dist/runtime/composables/useOverlay.js +14 -6
  175. package/dist/runtime/composables/usePortal.d.ts +6 -0
  176. package/dist/runtime/composables/usePortal.js +17 -0
  177. package/dist/runtime/index.css +1 -1
  178. package/dist/runtime/inertia/components/Link.vue +146 -0
  179. package/dist/runtime/inertia/components/Link.vue.d.ts +92 -0
  180. package/dist/runtime/inertia/stubs.d.ts +43 -0
  181. package/dist/runtime/inertia/stubs.js +82 -0
  182. package/dist/runtime/locale/bg.d.ts +3 -0
  183. package/dist/runtime/locale/bg.js +54 -0
  184. package/dist/runtime/locale/index.d.ts +5 -1
  185. package/dist/runtime/locale/index.js +5 -1
  186. package/dist/runtime/locale/kk.d.ts +3 -0
  187. package/dist/runtime/locale/kk.js +54 -0
  188. package/dist/runtime/locale/tj.d.ts +3 -0
  189. package/dist/runtime/locale/tj.js +54 -0
  190. package/dist/runtime/locale/ug_cn.d.ts +3 -0
  191. package/dist/runtime/locale/ug_cn.js +55 -0
  192. package/dist/runtime/types/form.d.ts +4 -1
  193. package/dist/runtime/types/index.d.ts +1 -0
  194. package/dist/runtime/types/index.js +1 -0
  195. package/dist/runtime/types/utils.d.ts +47 -7
  196. package/dist/runtime/utils/link.d.ts +3 -3
  197. package/dist/runtime/utils/link.js +1 -0
  198. package/dist/runtime/utils/tv.js +2 -2
  199. package/dist/runtime/vue/components/Icon.vue +7 -8
  200. package/dist/runtime/vue/components/Icon.vue.d.ts +14 -0
  201. package/dist/runtime/vue/components/Link.vue +118 -202
  202. package/dist/runtime/vue/components/Link.vue.d.ts +124 -0
  203. package/dist/runtime/vue/stubs.d.ts +2 -2
  204. package/dist/shared/{ui.BkNUP964.mjs → ui.D7lOOabO.mjs} +621 -362
  205. package/dist/types.d.mts +3 -5
  206. package/dist/unplugin.d.mts +4 -0
  207. package/dist/unplugin.mjs +25 -4
  208. package/dist/vite.mjs +1 -1
  209. package/package.json +94 -53
  210. package/dist/module.cjs +0 -62
  211. package/dist/module.d.cts +0 -45
  212. package/dist/module.d.ts +0 -45
  213. package/dist/shared/ui.BL-XB3u1.cjs +0 -3555
  214. package/dist/types.d.ts +0 -7
  215. package/dist/unplugin.cjs +0 -232
  216. package/dist/unplugin.d.cts +0 -62
  217. package/dist/unplugin.d.ts +0 -62
  218. package/dist/vite.cjs +0 -23
  219. package/dist/vite.d.cts +0 -15
  220. package/dist/vite.d.ts +0 -15
@@ -0,0 +1,183 @@
1
+ import type { Ref, WatchOptions } from 'vue';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import type { Cell, Header, RowData, TableMeta } from '@tanstack/table-core';
4
+ import type { CellContext, ColumnDef, ColumnFiltersOptions, ColumnFiltersState, ColumnOrderState, ColumnPinningOptions, ColumnPinningState, ColumnSizingInfoState, ColumnSizingOptions, ColumnSizingState, CoreOptions, ExpandedOptions, ExpandedState, FacetedOptions, GlobalFilterOptions, GroupingOptions, GroupingState, HeaderContext, PaginationOptions, PaginationState, Row, RowPinningOptions, RowPinningState, RowSelectionOptions, RowSelectionState, SortingOptions, SortingState, VisibilityOptions, VisibilityState } from '@tanstack/vue-table';
5
+ import theme from '#build/ui/table';
6
+ import type { ComponentConfig } from '../types/utils';
7
+ declare module '@tanstack/table-core' {
8
+ interface ColumnMeta<TData extends RowData, TValue> {
9
+ class?: {
10
+ th?: string | ((cell: Header<TData, TValue>) => string);
11
+ td?: string | ((cell: Cell<TData, TValue>) => string);
12
+ };
13
+ }
14
+ interface TableMeta<TData> {
15
+ class?: {
16
+ tr?: string | ((row: Row<TData>) => string);
17
+ };
18
+ }
19
+ }
20
+ type Table = ComponentConfig<typeof theme, AppConfig, 'table'>;
21
+ export type TableRow<T> = Row<T>;
22
+ export type TableData = RowData;
23
+ export type TableColumn<T extends TableData, D = unknown> = ColumnDef<T, D>;
24
+ export interface TableOptions<T extends TableData> extends Omit<CoreOptions<T>, 'data' | 'columns' | 'getCoreRowModel' | 'state' | 'onStateChange' | 'renderFallbackValue'> {
25
+ state?: CoreOptions<T>['state'];
26
+ onStateChange?: CoreOptions<T>['onStateChange'];
27
+ renderFallbackValue?: CoreOptions<T>['renderFallbackValue'];
28
+ }
29
+ export interface TableProps<T extends TableData> extends TableOptions<T> {
30
+ /**
31
+ * The element or component this component should render as.
32
+ * @defaultValue 'div'
33
+ */
34
+ as?: any;
35
+ data?: T[];
36
+ columns?: TableColumn<T>[];
37
+ caption?: string;
38
+ meta?: TableMeta<T>;
39
+ /**
40
+ * The text to display when the table is empty.
41
+ * @defaultValue t('table.noData')
42
+ */
43
+ empty?: string;
44
+ /**
45
+ * Whether the table should have a sticky header.
46
+ * @defaultValue false
47
+ */
48
+ sticky?: boolean;
49
+ /** Whether the table should be in loading state. */
50
+ loading?: boolean;
51
+ /**
52
+ * @defaultValue 'primary'
53
+ */
54
+ loadingColor?: Table['variants']['loadingColor'];
55
+ /**
56
+ * @defaultValue 'carousel'
57
+ */
58
+ loadingAnimation?: Table['variants']['loadingAnimation'];
59
+ /**
60
+ * Use the `watchOptions` prop to customize reactivity (for ex: disable deep watching for changes in your data or limiting the max traversal depth). This can improve performance by reducing unnecessary re-renders, but it should be used with caution as it may lead to unexpected behavior if not managed properly.
61
+ * @link [API Docs](https://vuejs.org/api/options-state.html#watch)
62
+ * @link [Guide](https://vuejs.org/guide/essentials/watchers.html)
63
+ * @defaultValue { deep: true }
64
+ */
65
+ watchOptions?: WatchOptions;
66
+ /**
67
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/global-filtering#table-options)
68
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/global-filtering)
69
+ */
70
+ globalFilterOptions?: Omit<GlobalFilterOptions<T>, 'onGlobalFilterChange'>;
71
+ /**
72
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#table-options)
73
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)
74
+ */
75
+ columnFiltersOptions?: Omit<ColumnFiltersOptions<T>, 'getFilteredRowModel' | 'onColumnFiltersChange'>;
76
+ /**
77
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-pinning#table-options)
78
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-pinning)
79
+ */
80
+ columnPinningOptions?: Omit<ColumnPinningOptions, 'onColumnPinningChange'>;
81
+ /**
82
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#table-options)
83
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing)
84
+ */
85
+ columnSizingOptions?: Omit<ColumnSizingOptions, 'onColumnSizingChange' | 'onColumnSizingInfoChange'>;
86
+ /**
87
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#table-options)
88
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility)
89
+ */
90
+ visibilityOptions?: Omit<VisibilityOptions, 'onColumnVisibilityChange'>;
91
+ /**
92
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#table-options)
93
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting)
94
+ */
95
+ sortingOptions?: Omit<SortingOptions<T>, 'getSortedRowModel' | 'onSortingChange'>;
96
+ /**
97
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#table-options)
98
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping)
99
+ */
100
+ groupingOptions?: Omit<GroupingOptions, 'onGroupingChange'>;
101
+ /**
102
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#table-options)
103
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding)
104
+ */
105
+ expandedOptions?: Omit<ExpandedOptions<T>, 'getExpandedRowModel' | 'onExpandedChange'>;
106
+ /**
107
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#table-options)
108
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection)
109
+ */
110
+ rowSelectionOptions?: Omit<RowSelectionOptions<T>, 'onRowSelectionChange'>;
111
+ /**
112
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-pinning#table-options)
113
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/row-pinning)
114
+ */
115
+ rowPinningOptions?: Omit<RowPinningOptions<T>, 'onRowPinningChange'>;
116
+ /**
117
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#table-options)
118
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)
119
+ */
120
+ paginationOptions?: Omit<PaginationOptions, 'onPaginationChange'>;
121
+ /**
122
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-faceting#table-options)
123
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-faceting)
124
+ */
125
+ facetedOptions?: FacetedOptions<T>;
126
+ onSelect?: (row: TableRow<T>, e?: Event) => void;
127
+ class?: any;
128
+ ui?: Table['slots'];
129
+ }
130
+ 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>;
131
+ 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
+ export type TableSlots<T> = {
133
+ expanded: (props: {
134
+ row: Row<T>;
135
+ }) => any;
136
+ empty: (props?: {}) => any;
137
+ loading: (props?: {}) => any;
138
+ caption: (props?: {}) => any;
139
+ } & DynamicHeaderSlots<T> & DynamicCellSlots<T>;
140
+ 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<{
141
+ props: __VLS_PrettifyLocal<any & ({
142
+ globalFilter?: string;
143
+ columnFilters?: ColumnFiltersState;
144
+ columnOrder?: ColumnOrderState;
145
+ columnVisibility?: VisibilityState;
146
+ columnPinning?: ColumnPinningState;
147
+ columnSizing?: ColumnSizingState;
148
+ columnSizingInfo?: ColumnSizingInfoState;
149
+ rowSelection?: RowSelectionState;
150
+ rowPinning?: RowPinningState;
151
+ sorting?: SortingState;
152
+ grouping?: GroupingState;
153
+ expanded?: ExpandedState;
154
+ pagination?: PaginationState;
155
+ } & TableProps<T>) & Partial<{}>> & (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps);
156
+ expose(exposed: import("vue").ShallowUnwrapRef<{
157
+ tableRef: Ref<HTMLTableElement | undefined, HTMLTableElement | undefined>;
158
+ tableApi: import("@tanstack/table-core").Table<T>;
159
+ }>): void;
160
+ attrs: any;
161
+ slots: Readonly<{
162
+ expanded: (props: {
163
+ row: Row<T>;
164
+ }) => any;
165
+ empty: (props?: {}) => any;
166
+ loading: (props?: {}) => any;
167
+ caption: (props?: {}) => any;
168
+ } & Record<string, (props: HeaderContext<T, unknown>) => any> & Record<`${keyof T extends infer T_1 ? T_1 extends keyof T ? T_1 extends string ? T_1 : never : never : never}-header`, (props: HeaderContext<T, unknown>) => any> & Record<string, (props: CellContext<T, unknown>) => any> & Record<`${keyof T extends infer T_2 ? T_2 extends keyof T ? T_2 extends string ? T_2 : never : never : never}-cell`, (props: CellContext<T, unknown>) => any>> & {
169
+ expanded: (props: {
170
+ row: Row<T>;
171
+ }) => any;
172
+ empty: (props?: {}) => any;
173
+ loading: (props?: {}) => any;
174
+ caption: (props?: {}) => any;
175
+ } & Record<string, (props: HeaderContext<T, unknown>) => any> & Record<`${keyof T extends infer T_3 ? T_3 extends keyof T ? T_3 extends string ? T_3 : never : never : never}-header`, (props: HeaderContext<T, unknown>) => any> & Record<string, (props: CellContext<T, unknown>) => any> & Record<`${keyof T extends infer T_4 ? T_4 extends keyof T ? T_4 extends string ? T_4 : never : never : never}-cell`, (props: CellContext<T, unknown>) => any>;
176
+ emit: ((evt: "update:globalFilter", value: string) => void) & ((evt: "update:columnFilters", value: ColumnFiltersState) => void) & ((evt: "update:columnOrder", value: ColumnOrderState) => void) & ((evt: "update:columnVisibility", value: VisibilityState) => void) & ((evt: "update:columnPinning", value: ColumnPinningState) => void) & ((evt: "update:columnSizing", value: ColumnSizingState) => void) & ((evt: "update:columnSizingInfo", value: ColumnSizingInfoState) => void) & ((evt: "update:rowSelection", value: RowSelectionState) => void) & ((evt: "update:rowPinning", value: RowPinningState) => void) & ((evt: "update:sorting", value: SortingState) => void) & ((evt: "update:grouping", value: GroupingState) => void) & ((evt: "update:expanded", value: ExpandedState) => void) & ((evt: "update:pagination", value: PaginationState) => void);
177
+ }>) => import("vue").VNode & {
178
+ __ctx?: Awaited<typeof __VLS_setup>;
179
+ };
180
+ export default _default;
181
+ type __VLS_PrettifyLocal<T> = {
182
+ [K in keyof T]: T[K];
183
+ } & {};
@@ -1,112 +1,42 @@
1
- <!-- eslint-disable vue/block-tag-newline -->
2
- <script lang="ts">
3
- import type { VariantProps } from 'tailwind-variants'
4
- import type { TabsRootProps, TabsRootEmits } from 'reka-ui'
5
- import type { AppConfig } from '@nuxt/schema'
6
- import _appConfig from '#build/app.config'
7
- import theme from '#build/ui/tabs'
8
- import { tv } from '../utils/tv'
9
- import type { AvatarProps } from '../types'
10
- import type { DynamicSlots, PartialString } from '../types/utils'
11
-
12
- const appConfigTabs = _appConfig as AppConfig & { ui: { tabs: Partial<typeof theme> } }
13
-
14
- const tabs = tv({ extend: tv(theme), ...(appConfigTabs.ui?.tabs || {}) })
15
-
16
- export interface TabsItem {
17
- label?: string
18
- /**
19
- * @IconifyIcon
20
- */
21
- icon?: string
22
- avatar?: AvatarProps
23
- slot?: string
24
- content?: string
25
- /** A unique value for the tab item. Defaults to the index. */
26
- value?: string | number
27
- disabled?: boolean
28
- [key: string]: any
29
- }
30
-
31
- type TabsVariants = VariantProps<typeof tabs>
32
-
33
- export interface TabsProps<T extends TabsItem = TabsItem> extends Pick<TabsRootProps<string | number>, 'defaultValue' | 'modelValue' | 'activationMode' | 'unmountOnHide'> {
34
- /**
35
- * The element or component this component should render as.
36
- * @defaultValue 'div'
37
- */
38
- as?: any
39
- items?: T[]
40
- /**
41
- * @defaultValue 'primary'
42
- */
43
- color?: TabsVariants['color']
44
- /**
45
- * @defaultValue 'pill'
46
- */
47
- variant?: TabsVariants['variant']
48
- /**
49
- * @defaultValue 'md'
50
- */
51
- size?: TabsVariants['size']
52
- /**
53
- * The orientation of the tabs.
54
- * @defaultValue 'horizontal'
55
- */
56
- orientation?: TabsRootProps['orientation']
57
- /**
58
- * The content of the tabs, can be disabled to prevent rendering the content.
59
- * @defaultValue true
60
- */
61
- content?: boolean
62
- /**
63
- * The key used to get the label from the item.
64
- * @defaultValue 'label'
65
- */
66
- labelKey?: string
67
- class?: any
68
- ui?: PartialString<typeof tabs.slots>
69
- }
70
-
71
- export interface TabsEmits extends TabsRootEmits<string | number> {}
72
-
73
- type SlotProps<T extends TabsItem> = (props: { item: T, index: number }) => any
74
-
75
- export type TabsSlots<T extends TabsItem = TabsItem> = {
76
- leading: SlotProps<T>
77
- default: SlotProps<T>
78
- trailing: SlotProps<T>
79
- content: SlotProps<T>
80
- } & DynamicSlots<T, undefined, { index: number }>
81
-
1
+ <script>
2
+ import theme from "#build/ui/tabs";
82
3
  </script>
83
4
 
84
- <script setup lang="ts" generic="T extends TabsItem">
85
- import { computed } from 'vue'
86
- import { TabsRoot, TabsList, TabsIndicator, TabsTrigger, TabsContent, useForwardPropsEmits } from 'reka-ui'
87
- import { reactivePick } from '@vueuse/core'
88
- import { get } from '../utils'
89
- import UIcon from './Icon.vue'
90
- import UAvatar from './Avatar.vue'
91
-
92
- const props = withDefaults(defineProps<TabsProps<T>>(), {
93
- content: true,
94
- defaultValue: '0',
95
- orientation: 'horizontal',
96
- unmountOnHide: true,
97
- labelKey: 'label'
98
- })
99
- const emits = defineEmits<TabsEmits>()
100
- const slots = defineSlots<TabsSlots<T>>()
101
-
102
- const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'orientation', 'activationMode', 'unmountOnHide'), emits)
103
-
104
- const ui = computed(() => tabs({
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { TabsRoot, TabsList, TabsIndicator, TabsTrigger, TabsContent, useForwardPropsEmits } from "reka-ui";
8
+ import { reactivePick } from "@vueuse/core";
9
+ import { useAppConfig } from "#imports";
10
+ import { get } from "../utils";
11
+ import { tv } from "../utils/tv";
12
+ import UIcon from "./Icon.vue";
13
+ import UAvatar from "./Avatar.vue";
14
+ const props = defineProps({
15
+ as: { type: null, required: false },
16
+ items: { type: Array, required: false },
17
+ color: { type: null, required: false },
18
+ variant: { type: null, required: false },
19
+ size: { type: null, required: false },
20
+ orientation: { type: null, required: false, default: "horizontal" },
21
+ content: { type: Boolean, required: false, default: true },
22
+ labelKey: { type: String, required: false, default: "label" },
23
+ class: { type: null, required: false },
24
+ ui: { type: null, required: false },
25
+ defaultValue: { type: null, required: false, default: "0" },
26
+ modelValue: { type: null, required: false },
27
+ activationMode: { type: String, required: false },
28
+ unmountOnHide: { type: Boolean, required: false, default: true }
29
+ });
30
+ const emits = defineEmits(["update:modelValue"]);
31
+ const slots = defineSlots();
32
+ const appConfig = useAppConfig();
33
+ const rootProps = useForwardPropsEmits(reactivePick(props, "as", "modelValue", "defaultValue", "orientation", "activationMode", "unmountOnHide"), emits);
34
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.tabs || {} })({
105
35
  color: props.color,
106
36
  variant: props.variant,
107
37
  size: props.size,
108
38
  orientation: props.orientation
109
- }))
39
+ }));
110
40
  </script>
111
41
 
112
42
  <template>
@@ -114,23 +44,27 @@ const ui = computed(() => tabs({
114
44
  <TabsList :class="ui.list({ class: props.ui?.list })">
115
45
  <TabsIndicator :class="ui.indicator({ class: props.ui?.indicator })" />
116
46
 
47
+ <slot name="list-leading" />
48
+
117
49
  <TabsTrigger v-for="(item, index) of items" :key="index" :value="item.value || String(index)" :disabled="item.disabled" :class="ui.trigger({ class: props.ui?.trigger })">
118
50
  <slot name="leading" :item="item" :index="index">
119
51
  <UIcon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
120
- <UAvatar v-else-if="item.avatar" :size="((props.ui?.leadingAvatarSize || ui.leadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
52
+ <UAvatar v-else-if="item.avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="item.avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
121
53
  </slot>
122
54
 
123
- <span v-if="get(item, props.labelKey as string) || !!slots.default" :class="ui.label({ class: props.ui?.label })">
124
- <slot :item="item" :index="index">{{ get(item, props.labelKey as string) }}</slot>
55
+ <span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: props.ui?.label })">
56
+ <slot :item="item" :index="index">{{ get(item, props.labelKey) }}</slot>
125
57
  </span>
126
58
 
127
59
  <slot name="trailing" :item="item" :index="index" />
128
60
  </TabsTrigger>
61
+
62
+ <slot name="list-trailing" />
129
63
  </TabsList>
130
64
 
131
65
  <template v-if="!!content">
132
66
  <TabsContent v-for="(item, index) of items" :key="index" :value="item.value || String(index)" :class="ui.content({ class: props.ui?.content })">
133
- <slot :name="((item.slot || 'content') as keyof TabsSlots<T>)" :item="(item as Extract<T, { slot: string; }>)" :index="index">
67
+ <slot :name="item.slot || 'content'" :item="item" :index="index">
134
68
  {{ item.content }}
135
69
  </slot>
136
70
  </TabsContent>
@@ -0,0 +1,104 @@
1
+ import type { TabsRootProps, TabsRootEmits } from 'reka-ui';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import theme from '#build/ui/tabs';
4
+ import type { AvatarProps } from '../types';
5
+ import type { DynamicSlots, ComponentConfig } from '../types/utils';
6
+ type Tabs = ComponentConfig<typeof theme, AppConfig, 'tabs'>;
7
+ export interface TabsItem {
8
+ label?: string;
9
+ /**
10
+ * @IconifyIcon
11
+ */
12
+ icon?: string;
13
+ avatar?: AvatarProps;
14
+ slot?: string;
15
+ content?: string;
16
+ /** A unique value for the tab item. Defaults to the index. */
17
+ value?: string | number;
18
+ disabled?: boolean;
19
+ [key: string]: any;
20
+ }
21
+ export interface TabsProps<T extends TabsItem = TabsItem> extends Pick<TabsRootProps<string | number>, 'defaultValue' | 'modelValue' | 'activationMode' | 'unmountOnHide'> {
22
+ /**
23
+ * The element or component this component should render as.
24
+ * @defaultValue 'div'
25
+ */
26
+ as?: any;
27
+ items?: T[];
28
+ /**
29
+ * @defaultValue 'primary'
30
+ */
31
+ color?: Tabs['variants']['color'];
32
+ /**
33
+ * @defaultValue 'pill'
34
+ */
35
+ variant?: Tabs['variants']['variant'];
36
+ /**
37
+ * @defaultValue 'md'
38
+ */
39
+ size?: Tabs['variants']['size'];
40
+ /**
41
+ * The orientation of the tabs.
42
+ * @defaultValue 'horizontal'
43
+ */
44
+ orientation?: TabsRootProps['orientation'];
45
+ /**
46
+ * The content of the tabs, can be disabled to prevent rendering the content.
47
+ * @defaultValue true
48
+ */
49
+ content?: boolean;
50
+ /**
51
+ * The key used to get the label from the item.
52
+ * @defaultValue 'label'
53
+ */
54
+ labelKey?: string;
55
+ class?: any;
56
+ ui?: Tabs['slots'];
57
+ }
58
+ export interface TabsEmits extends TabsRootEmits<string | number> {
59
+ }
60
+ type SlotProps<T extends TabsItem> = (props: {
61
+ item: T;
62
+ index: number;
63
+ }) => any;
64
+ export type TabsSlots<T extends TabsItem = TabsItem> = {
65
+ 'leading': SlotProps<T>;
66
+ 'default': SlotProps<T>;
67
+ 'trailing': SlotProps<T>;
68
+ 'content': SlotProps<T>;
69
+ 'list-leading': (props?: {}) => any;
70
+ 'list-trailing': (props?: {}) => any;
71
+ } & DynamicSlots<T, undefined, {
72
+ index: number;
73
+ }>;
74
+ declare const _default: <T extends TabsItem>(__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<{
75
+ props: __VLS_PrettifyLocal<any & TabsProps<T> & Partial<{}>> & (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps);
76
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
77
+ attrs: any;
78
+ slots: Readonly<{
79
+ leading: SlotProps<T>;
80
+ default: SlotProps<T>;
81
+ trailing: SlotProps<T>;
82
+ content: SlotProps<T>;
83
+ 'list-leading': (props?: {}) => any;
84
+ 'list-trailing': (props?: {}) => any;
85
+ } & DynamicSlots<T, undefined, {
86
+ index: number;
87
+ }>> & {
88
+ leading: SlotProps<T>;
89
+ default: SlotProps<T>;
90
+ trailing: SlotProps<T>;
91
+ content: SlotProps<T>;
92
+ 'list-leading': (props?: {}) => any;
93
+ 'list-trailing': (props?: {}) => any;
94
+ } & DynamicSlots<T, undefined, {
95
+ index: number;
96
+ }>;
97
+ emit: (evt: "update:modelValue", payload: string | number) => void;
98
+ }>) => import("vue").VNode & {
99
+ __ctx?: Awaited<typeof __VLS_setup>;
100
+ };
101
+ export default _default;
102
+ type __VLS_PrettifyLocal<T> = {
103
+ [K in keyof T]: T[K];
104
+ } & {};