@nuxt/ui 3.0.2 → 3.1.1

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 (221) hide show
  1. package/.nuxt/ui/accordion.ts +2 -2
  2. package/.nuxt/ui/alert.ts +29 -29
  3. package/.nuxt/ui/avatar-group.ts +1 -1
  4. package/.nuxt/ui/avatar.ts +3 -3
  5. package/.nuxt/ui/badge.ts +33 -33
  6. package/.nuxt/ui/breadcrumb.ts +5 -5
  7. package/.nuxt/ui/button.ts +43 -43
  8. package/.nuxt/ui/calendar.ts +17 -17
  9. package/.nuxt/ui/card.ts +5 -5
  10. package/.nuxt/ui/carousel.ts +6 -6
  11. package/.nuxt/ui/checkbox-group.ts +61 -0
  12. package/.nuxt/ui/checkbox.ts +140 -27
  13. package/.nuxt/ui/chip.ts +8 -8
  14. package/.nuxt/ui/color-picker.ts +3 -3
  15. package/.nuxt/ui/command-palette.ts +14 -14
  16. package/.nuxt/ui/context-menu.ts +33 -33
  17. package/.nuxt/ui/drawer.ts +10 -10
  18. package/.nuxt/ui/dropdown-menu.ts +34 -34
  19. package/.nuxt/ui/form-field.ts +6 -6
  20. package/.nuxt/ui/index.ts +1 -0
  21. package/.nuxt/ui/input-menu.ts +42 -42
  22. package/.nuxt/ui/input-number.ts +20 -20
  23. package/.nuxt/ui/input.ts +23 -23
  24. package/.nuxt/ui/kbd.ts +4 -4
  25. package/.nuxt/ui/link.ts +3 -3
  26. package/.nuxt/ui/modal.ts +5 -5
  27. package/.nuxt/ui/navigation-menu.ts +78 -80
  28. package/.nuxt/ui/pin-input.ts +20 -20
  29. package/.nuxt/ui/popover.ts +2 -2
  30. package/.nuxt/ui/progress.ts +17 -17
  31. package/.nuxt/ui/radio-group.ts +250 -35
  32. package/.nuxt/ui/select-menu.ts +36 -33
  33. package/.nuxt/ui/select.ts +32 -32
  34. package/.nuxt/ui/separator.ts +8 -8
  35. package/.nuxt/ui/skeleton.ts +1 -1
  36. package/.nuxt/ui/slideover.ts +4 -4
  37. package/.nuxt/ui/slider.ts +16 -16
  38. package/.nuxt/ui/stepper.ts +18 -18
  39. package/.nuxt/ui/switch.ts +20 -20
  40. package/.nuxt/ui/table.ts +15 -15
  41. package/.nuxt/ui/tabs.ts +32 -32
  42. package/.nuxt/ui/textarea.ts +40 -35
  43. package/.nuxt/ui/toast.ts +24 -24
  44. package/.nuxt/ui/tooltip.ts +2 -2
  45. package/.nuxt/ui/tree.ts +18 -18
  46. package/.nuxt/ui.css +63 -12
  47. package/README.md +15 -0
  48. package/cli/templates.mjs +18 -17
  49. package/dist/module.json +5 -5
  50. package/dist/module.mjs +12 -7
  51. package/dist/runtime/components/Accordion.vue +36 -93
  52. package/dist/runtime/components/Accordion.vue.d.ts +75 -0
  53. package/dist/runtime/components/Alert.vue +37 -100
  54. package/dist/runtime/components/Alert.vue.d.ts +81 -0
  55. package/dist/runtime/components/App.vue +28 -34
  56. package/dist/runtime/components/App.vue.d.ts +24 -0
  57. package/dist/runtime/components/Avatar.vue +42 -75
  58. package/dist/runtime/components/Avatar.vue.d.ts +39 -0
  59. package/dist/runtime/components/AvatarGroup.vue +40 -77
  60. package/dist/runtime/components/AvatarGroup.vue.d.ts +31 -0
  61. package/dist/runtime/components/Badge.vue +33 -62
  62. package/dist/runtime/components/Badge.vue.d.ts +41 -0
  63. package/dist/runtime/components/Breadcrumb.vue +37 -90
  64. package/dist/runtime/components/Breadcrumb.vue.d.ts +64 -0
  65. package/dist/runtime/components/Button.vue +95 -104
  66. package/dist/runtime/components/Button.vue.d.ts +48 -0
  67. package/dist/runtime/components/ButtonGroup.vue +20 -46
  68. package/dist/runtime/components/ButtonGroup.vue.d.ts +34 -0
  69. package/dist/runtime/components/Calendar.vue +67 -150
  70. package/dist/runtime/components/Calendar.vue.d.ts +111 -0
  71. package/dist/runtime/components/Card.vue +18 -40
  72. package/dist/runtime/components/Card.vue.d.ts +29 -0
  73. package/dist/runtime/components/Carousel.vue +112 -234
  74. package/dist/runtime/components/Carousel.vue.d.ts +122 -0
  75. package/dist/runtime/components/Checkbox.vue +52 -93
  76. package/dist/runtime/components/Checkbox.vue.d.ts +73 -0
  77. package/dist/runtime/components/CheckboxGroup.vue +121 -0
  78. package/dist/runtime/components/CheckboxGroup.vue.d.ts +78 -0
  79. package/dist/runtime/components/Chip.vue +26 -69
  80. package/dist/runtime/components/Chip.vue.d.ts +57 -0
  81. package/dist/runtime/components/Collapsible.vue +22 -41
  82. package/dist/runtime/components/Collapsible.vue.d.ts +35 -0
  83. package/dist/runtime/components/ColorPicker.vue +111 -197
  84. package/dist/runtime/components/ColorPicker.vue.d.ts +48 -0
  85. package/dist/runtime/components/CommandPalette.vue +96 -237
  86. package/dist/runtime/components/CommandPalette.vue.d.ts +161 -0
  87. package/dist/runtime/components/Container.vue +15 -28
  88. package/dist/runtime/components/Container.vue.d.ts +18 -0
  89. package/dist/runtime/components/ContextMenu.vue +34 -133
  90. package/dist/runtime/components/ContextMenu.vue.d.ts +107 -0
  91. package/dist/runtime/components/ContextMenuContent.vue +73 -81
  92. package/dist/runtime/components/ContextMenuContent.vue.d.ts +65 -0
  93. package/dist/runtime/components/Drawer.vue +49 -83
  94. package/dist/runtime/components/Drawer.vue.d.ts +78 -0
  95. package/dist/runtime/components/DropdownMenu.vue +39 -142
  96. package/dist/runtime/components/DropdownMenu.vue.d.ts +117 -0
  97. package/dist/runtime/components/DropdownMenuContent.vue +78 -88
  98. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +68 -0
  99. package/dist/runtime/components/Form.vue +135 -220
  100. package/dist/runtime/components/Form.vue.d.ts +69 -0
  101. package/dist/runtime/components/FormField.vue +35 -77
  102. package/dist/runtime/components/FormField.vue.d.ts +61 -0
  103. package/dist/runtime/components/Icon.vue +12 -19
  104. package/dist/runtime/components/Icon.vue.d.ts +8 -0
  105. package/dist/runtime/components/Input.vue +82 -140
  106. package/dist/runtime/components/Input.vue.d.ts +76 -0
  107. package/dist/runtime/components/InputMenu.vue +185 -332
  108. package/dist/runtime/components/InputMenu.vue.d.ts +324 -0
  109. package/dist/runtime/components/InputNumber.vue +71 -133
  110. package/dist/runtime/components/InputNumber.vue.d.ts +182 -0
  111. package/dist/runtime/components/Kbd.vue +20 -46
  112. package/dist/runtime/components/Kbd.vue.d.ts +34 -0
  113. package/dist/runtime/components/Link.vue +98 -176
  114. package/dist/runtime/components/Link.vue.d.ts +93 -0
  115. package/dist/runtime/components/LinkBase.vue +33 -42
  116. package/dist/runtime/components/LinkBase.vue.d.ts +25 -0
  117. package/dist/runtime/components/Modal.vue +53 -116
  118. package/dist/runtime/components/Modal.vue.d.ts +93 -0
  119. package/dist/runtime/components/NavigationMenu.vue +77 -209
  120. package/dist/runtime/components/NavigationMenu.vue.d.ts +139 -0
  121. package/dist/runtime/components/OverlayProvider.vue +14 -18
  122. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
  123. package/dist/runtime/components/Pagination.vue +46 -140
  124. package/dist/runtime/components/Pagination.vue.d.ts +119 -0
  125. package/dist/runtime/components/PinInput.vue +61 -78
  126. package/dist/runtime/components/PinInput.vue.d.ts +57 -0
  127. package/dist/runtime/components/Popover.vue +47 -84
  128. package/dist/runtime/components/Popover.vue.d.ts +63 -0
  129. package/dist/runtime/components/Progress.vue +70 -131
  130. package/dist/runtime/components/Progress.vue.d.ts +66 -0
  131. package/dist/runtime/components/RadioGroup.vue +70 -132
  132. package/dist/runtime/components/RadioGroup.vue.d.ts +91 -0
  133. package/dist/runtime/components/Select.vue +110 -224
  134. package/dist/runtime/components/Select.vue.d.ts +145 -0
  135. package/dist/runtime/components/SelectMenu.vue +161 -310
  136. package/dist/runtime/components/SelectMenu.vue.d.ts +196 -0
  137. package/dist/runtime/components/Separator.vue +29 -71
  138. package/dist/runtime/components/Separator.vue.d.ts +54 -0
  139. package/dist/runtime/components/Skeleton.vue +21 -23
  140. package/dist/runtime/components/Skeleton.vue.d.ts +17 -0
  141. package/dist/runtime/components/Slideover.vue +53 -120
  142. package/dist/runtime/components/Slideover.vue.d.ts +94 -0
  143. package/dist/runtime/components/Slider.vue +46 -84
  144. package/dist/runtime/components/Slider.vue.d.ts +52 -0
  145. package/dist/runtime/components/Stepper.vue +45 -115
  146. package/dist/runtime/components/Stepper.vue.d.ts +83 -0
  147. package/dist/runtime/components/Switch.vue +45 -93
  148. package/dist/runtime/components/Switch.vue.d.ts +70 -0
  149. package/dist/runtime/components/Table.vue +163 -267
  150. package/dist/runtime/components/Table.vue.d.ts +183 -0
  151. package/dist/runtime/components/Tabs.vue +41 -107
  152. package/dist/runtime/components/Tabs.vue.d.ts +88 -0
  153. package/dist/runtime/components/Textarea.vue +113 -158
  154. package/dist/runtime/components/Textarea.vue.d.ts +78 -0
  155. package/dist/runtime/components/Toast.vue +49 -110
  156. package/dist/runtime/components/Toast.vue.d.ts +157 -0
  157. package/dist/runtime/components/Toaster.vue +70 -107
  158. package/dist/runtime/components/Toaster.vue.d.ts +38 -0
  159. package/dist/runtime/components/Tooltip.vue +38 -65
  160. package/dist/runtime/components/Tooltip.vue.d.ts +50 -0
  161. package/dist/runtime/components/Tree.vue +59 -166
  162. package/dist/runtime/components/Tree.vue.d.ts +111 -0
  163. package/dist/runtime/composables/defineShortcuts.d.ts +1 -1
  164. package/dist/runtime/composables/defineShortcuts.js +6 -0
  165. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  166. package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
  167. package/dist/runtime/composables/useFormField.d.ts +2 -2
  168. package/dist/runtime/composables/useKbd.d.ts +1 -0
  169. package/dist/runtime/composables/useKbd.js +4 -3
  170. package/dist/runtime/composables/useOverlay.d.ts +14 -8
  171. package/dist/runtime/composables/useOverlay.js +20 -7
  172. package/dist/runtime/composables/usePortal.d.ts +6 -0
  173. package/dist/runtime/composables/usePortal.js +17 -0
  174. package/dist/runtime/index.css +1 -1
  175. package/dist/runtime/inertia/components/Link.vue +146 -0
  176. package/dist/runtime/inertia/components/Link.vue.d.ts +63 -0
  177. package/dist/runtime/inertia/stubs.d.ts +43 -0
  178. package/dist/runtime/inertia/stubs.js +82 -0
  179. package/dist/runtime/locale/bg.d.ts +3 -0
  180. package/dist/runtime/locale/bg.js +54 -0
  181. package/dist/runtime/locale/index.d.ts +5 -1
  182. package/dist/runtime/locale/index.js +5 -1
  183. package/dist/runtime/locale/kk.d.ts +3 -0
  184. package/dist/runtime/locale/kk.js +54 -0
  185. package/dist/runtime/locale/tj.d.ts +3 -0
  186. package/dist/runtime/locale/tj.js +54 -0
  187. package/dist/runtime/locale/ug_cn.d.ts +3 -0
  188. package/dist/runtime/locale/ug_cn.js +55 -0
  189. package/dist/runtime/types/form.d.ts +4 -1
  190. package/dist/runtime/types/index.d.ts +1 -0
  191. package/dist/runtime/types/index.js +1 -0
  192. package/dist/runtime/types/tv.d.ts +53 -0
  193. package/dist/runtime/types/tv.js +0 -0
  194. package/dist/runtime/types/utils.d.ts +7 -17
  195. package/dist/runtime/types/utils.js +1 -0
  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 +5 -0
  201. package/dist/runtime/vue/components/Link.vue +118 -202
  202. package/dist/runtime/vue/components/Link.vue.d.ts +93 -0
  203. package/dist/runtime/vue/stubs.d.ts +2 -2
  204. package/dist/shared/{ui.BkNUP964.mjs → ui.CbtTMMzt.mjs} +631 -366
  205. package/dist/types.d.mts +3 -5
  206. package/dist/unplugin.d.mts +6 -2
  207. package/dist/unplugin.mjs +25 -4
  208. package/dist/vite.d.mts +1 -1
  209. package/dist/vite.mjs +2 -2
  210. package/package.json +96 -54
  211. package/dist/module.cjs +0 -62
  212. package/dist/module.d.cts +0 -45
  213. package/dist/module.d.ts +0 -45
  214. package/dist/shared/ui.BL-XB3u1.cjs +0 -3555
  215. package/dist/types.d.ts +0 -7
  216. package/dist/unplugin.cjs +0 -232
  217. package/dist/unplugin.d.cts +0 -62
  218. package/dist/unplugin.d.ts +0 -62
  219. package/dist/vite.cjs +0 -23
  220. package/dist/vite.d.cts +0 -15
  221. package/dist/vite.d.ts +0 -15
@@ -0,0 +1,182 @@
1
+ import type { NumberFieldRootProps } from 'reka-ui';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import theme from '#build/ui/input-number';
4
+ import type { ButtonProps } from '../types';
5
+ import type { ComponentConfig } from '../types/utils';
6
+ type InputNumber = ComponentConfig<typeof theme, AppConfig, 'inputNumber'>;
7
+ export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange'> {
8
+ /**
9
+ * The element or component this component should render as.
10
+ * @defaultValue 'div'
11
+ */
12
+ as?: any;
13
+ /** The placeholder text when the input is empty. */
14
+ placeholder?: string;
15
+ color?: InputNumber['variants']['color'];
16
+ variant?: InputNumber['variants']['variant'];
17
+ size?: InputNumber['variants']['size'];
18
+ /** Highlight the ring color like a focus state. */
19
+ highlight?: boolean;
20
+ /**
21
+ * The orientation of the input menu.
22
+ * @defaultValue 'horizontal'
23
+ */
24
+ orientation?: 'vertical' | 'horizontal';
25
+ /**
26
+ * Configure the increment button. The `color` and `size` are inherited.
27
+ * @defaultValue { variant: 'link' }
28
+ */
29
+ increment?: ButtonProps;
30
+ /**
31
+ * The icon displayed to increment the value.
32
+ * @defaultValue appConfig.ui.icons.plus
33
+ * @IconifyIcon
34
+ */
35
+ incrementIcon?: string;
36
+ /**
37
+ * Configure the decrement button. The `color` and `size` are inherited.
38
+ * @defaultValue { variant: 'link' }
39
+ */
40
+ decrement?: ButtonProps;
41
+ /**
42
+ * The icon displayed to decrement the value.
43
+ * @defaultValue appConfig.ui.icons.minus
44
+ * @IconifyIcon
45
+ */
46
+ decrementIcon?: string;
47
+ autofocus?: boolean;
48
+ autofocusDelay?: number;
49
+ /**
50
+ * The locale to use for formatting and parsing numbers.
51
+ * @defaultValue UApp.locale.code
52
+ */
53
+ locale?: string;
54
+ class?: any;
55
+ ui?: InputNumber['slots'];
56
+ }
57
+ export interface InputNumberEmits {
58
+ (e: 'update:modelValue', payload: number): void;
59
+ (e: 'blur', event: FocusEvent): void;
60
+ (e: 'change', payload: Event): void;
61
+ }
62
+ export interface InputNumberSlots {
63
+ increment(props?: {}): any;
64
+ decrement(props?: {}): any;
65
+ }
66
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<InputNumberProps, {
67
+ inputRef: import("vue").Ref<({
68
+ $: import("vue").ComponentInternalInstance;
69
+ $data: {};
70
+ $props: {
71
+ readonly asChild?: boolean | undefined;
72
+ readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
73
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
74
+ $attrs: {
75
+ [x: string]: unknown;
76
+ };
77
+ $refs: {
78
+ [x: string]: unknown;
79
+ };
80
+ $slots: Readonly<{
81
+ [name: string]: import("vue").Slot<any> | undefined;
82
+ }>;
83
+ $root: import("vue").ComponentPublicInstance | null;
84
+ $parent: import("vue").ComponentPublicInstance | null;
85
+ $host: Element | null;
86
+ $emit: (event: string, ...args: any[]) => void;
87
+ $el: any;
88
+ $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
89
+ as: import("reka-ui").AsTag | import("vue").Component;
90
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
91
+ beforeCreate?: (() => void) | (() => void)[];
92
+ created?: (() => void) | (() => void)[];
93
+ beforeMount?: (() => void) | (() => void)[];
94
+ mounted?: (() => void) | (() => void)[];
95
+ beforeUpdate?: (() => void) | (() => void)[];
96
+ updated?: (() => void) | (() => void)[];
97
+ activated?: (() => void) | (() => void)[];
98
+ deactivated?: (() => void) | (() => void)[];
99
+ beforeDestroy?: (() => void) | (() => void)[];
100
+ beforeUnmount?: (() => void) | (() => void)[];
101
+ destroyed?: (() => void) | (() => void)[];
102
+ unmounted?: (() => void) | (() => void)[];
103
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
104
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
105
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
106
+ };
107
+ $forceUpdate: () => void;
108
+ $nextTick: typeof import("vue").nextTick;
109
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
110
+ } & Readonly<{
111
+ as: import("reka-ui").AsTag | import("vue").Component;
112
+ }> & Omit<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
113
+ $slots: {
114
+ default?(_: {}): any;
115
+ };
116
+ }) | null, ({
117
+ $: import("vue").ComponentInternalInstance;
118
+ $data: {};
119
+ $props: {
120
+ readonly asChild?: boolean | undefined;
121
+ readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
122
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
123
+ $attrs: {
124
+ [x: string]: unknown;
125
+ };
126
+ $refs: {
127
+ [x: string]: unknown;
128
+ };
129
+ $slots: Readonly<{
130
+ [name: string]: import("vue").Slot<any> | undefined;
131
+ }>;
132
+ $root: import("vue").ComponentPublicInstance | null;
133
+ $parent: import("vue").ComponentPublicInstance | null;
134
+ $host: Element | null;
135
+ $emit: (event: string, ...args: any[]) => void;
136
+ $el: any;
137
+ $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
138
+ as: import("reka-ui").AsTag | import("vue").Component;
139
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
140
+ beforeCreate?: (() => void) | (() => void)[];
141
+ created?: (() => void) | (() => void)[];
142
+ beforeMount?: (() => void) | (() => void)[];
143
+ mounted?: (() => void) | (() => void)[];
144
+ beforeUpdate?: (() => void) | (() => void)[];
145
+ updated?: (() => void) | (() => void)[];
146
+ activated?: (() => void) | (() => void)[];
147
+ deactivated?: (() => void) | (() => void)[];
148
+ beforeDestroy?: (() => void) | (() => void)[];
149
+ beforeUnmount?: (() => void) | (() => void)[];
150
+ destroyed?: (() => void) | (() => void)[];
151
+ unmounted?: (() => void) | (() => void)[];
152
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
153
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
154
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
155
+ };
156
+ $forceUpdate: () => void;
157
+ $nextTick: typeof import("vue").nextTick;
158
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
159
+ } & Readonly<{
160
+ as: import("reka-ui").AsTag | import("vue").Component;
161
+ }> & Omit<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
162
+ $slots: {
163
+ default?(_: {}): any;
164
+ };
165
+ }) | null>;
166
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
167
+ blur: (event: FocusEvent) => any;
168
+ change: (payload: Event) => any;
169
+ "update:modelValue": (payload: number) => any;
170
+ }, string, import("vue").PublicProps, Readonly<InputNumberProps> & Readonly<{
171
+ onBlur?: ((event: FocusEvent) => any) | undefined;
172
+ onChange?: ((payload: Event) => any) | undefined;
173
+ "onUpdate:modelValue"?: ((payload: number) => any) | undefined;
174
+ }>, {
175
+ orientation: "vertical" | "horizontal";
176
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, InputNumberSlots>;
177
+ export default _default;
178
+ type __VLS_WithSlots<T, S> = T & {
179
+ new (): {
180
+ $slots: S;
181
+ };
182
+ };
@@ -1,54 +1,28 @@
1
- <script lang="ts">
2
- import type { VariantProps } from 'tailwind-variants'
3
- import type { AppConfig } from '@nuxt/schema'
4
- import _appConfig from '#build/app.config'
5
- import theme from '#build/ui/kbd'
6
- import type { KbdKey } from '../composables/useKbd'
7
- import { tv } from '../utils/tv'
8
-
9
- const appConfigKbd = _appConfig as AppConfig & { ui: { kbd: Partial<typeof theme> } }
10
-
11
- const kbd = tv({ extend: tv(theme), ...(appConfigKbd.ui?.kbd || {}) })
12
-
13
- type KbdVariants = VariantProps<typeof kbd>
14
-
15
- export interface KbdProps {
16
- /**
17
- * The element or component this component should render as.
18
- * @defaultValue 'kbd'
19
- */
20
- as?: any
21
- value?: KbdKey | string
22
- /**
23
- * @defaultValue 'outline'
24
- */
25
- variant?: KbdVariants['variant']
26
- /**
27
- * @defaultValue 'md'
28
- */
29
- size?: KbdVariants['size']
30
- class?: any
31
- }
32
-
33
- export interface KbdSlots {
34
- default(props?: {}): any
35
- }
1
+ <script>
2
+ import theme from "#build/ui/kbd";
36
3
  </script>
37
4
 
38
- <script setup lang="ts">
39
- import { Primitive } from 'reka-ui'
40
- import { useKbd } from '../composables/useKbd'
41
-
42
- const props = withDefaults(defineProps<KbdProps>(), {
43
- as: 'kbd'
44
- })
45
- defineSlots<KbdSlots>()
46
-
47
- const { getKbdKey } = useKbd()
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { Primitive } from "reka-ui";
8
+ import { useAppConfig } from "#imports";
9
+ import { useKbd } from "../composables/useKbd";
10
+ import { tv } from "../utils/tv";
11
+ const props = defineProps({
12
+ as: { type: null, required: false, default: "kbd" },
13
+ value: { type: null, required: false },
14
+ variant: { type: null, required: false },
15
+ size: { type: null, required: false },
16
+ class: { type: null, required: false }
17
+ });
18
+ defineSlots();
19
+ const { getKbdKey } = useKbd();
20
+ const appConfig = useAppConfig();
21
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.kbd || {} }));
48
22
  </script>
49
23
 
50
24
  <template>
51
- <Primitive :as="as" :class="kbd({ variant, size, class: props.class })">
25
+ <Primitive :as="as" :class="ui({ variant, size, class: props.class })">
52
26
  <slot>
53
27
  {{ getKbdKey(value) }}
54
28
  </slot>
@@ -0,0 +1,34 @@
1
+ import type { AppConfig } from '@nuxt/schema';
2
+ import theme from '#build/ui/kbd';
3
+ import type { KbdKey } from '../composables/useKbd';
4
+ import type { ComponentConfig } from '../types/utils';
5
+ type Kbd = ComponentConfig<typeof theme, AppConfig, 'kbd'>;
6
+ export interface KbdProps {
7
+ /**
8
+ * The element or component this component should render as.
9
+ * @defaultValue 'kbd'
10
+ */
11
+ as?: any;
12
+ value?: KbdKey | string;
13
+ /**
14
+ * @defaultValue 'outline'
15
+ */
16
+ variant?: Kbd['variants']['variant'];
17
+ /**
18
+ * @defaultValue 'md'
19
+ */
20
+ size?: Kbd['variants']['size'];
21
+ class?: any;
22
+ }
23
+ export interface KbdSlots {
24
+ default(props?: {}): any;
25
+ }
26
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<KbdProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KbdProps> & Readonly<{}>, {
27
+ as: any;
28
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, KbdSlots>;
29
+ export default _default;
30
+ type __VLS_WithSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -1,175 +1,97 @@
1
- <script lang="ts">
2
- import type { ButtonHTMLAttributes } from 'vue'
3
- import type { AppConfig } from '@nuxt/schema'
4
- import _appConfig from '#build/app.config'
5
- import type { RouterLinkProps, RouteLocationRaw } from 'vue-router'
6
- import theme from '#build/ui/link'
7
- import { tv } from '../utils/tv'
8
-
9
- interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
10
- /**
11
- * Route Location the link should navigate to when clicked on.
12
- */
13
- to?: RouteLocationRaw // need to manually type to avoid breaking typedPages
14
- /**
15
- * An alias for `to`. If used with `to`, `href` will be ignored
16
- */
17
- href?: NuxtLinkProps['to']
18
- /**
19
- * Forces the link to be considered as external (true) or internal (false). This is helpful to handle edge-cases
20
- */
21
- external?: boolean
22
- /**
23
- * Where to display the linked URL, as the name for a browsing context.
24
- */
25
- target?: '_blank' | '_parent' | '_self' | '_top' | (string & {}) | null
26
- /**
27
- * A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
28
- */
29
- rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null
30
- /**
31
- * If set to true, no rel attribute will be added to the link
32
- */
33
- noRel?: boolean
34
- /**
35
- * A class to apply to links that have been prefetched.
36
- */
37
- prefetchedClass?: string
38
- /**
39
- * When enabled will prefetch middleware, layouts and payloads of links in the viewport.
40
- */
41
- prefetch?: boolean
42
- /**
43
- * Allows controlling when to prefetch links. By default, prefetch is triggered only on visibility.
44
- */
45
- prefetchOn?: 'visibility' | 'interaction' | Partial<{
46
- visibility: boolean
47
- interaction: boolean
48
- }>
49
- /**
50
- * Escape hatch to disable `prefetch` attribute.
51
- */
52
- noPrefetch?: boolean
53
- }
54
-
55
- const appConfigLink = _appConfig as AppConfig & { ui: { link: Partial<typeof theme> } }
56
-
57
- const link = tv({ extend: tv(theme), ...(appConfigLink.ui?.link || {}) })
58
-
59
- export interface LinkProps extends NuxtLinkProps {
60
- /**
61
- * The element or component this component should render as when not a link.
62
- * @defaultValue 'button'
63
- */
64
- as?: any
65
- /**
66
- * The type of the button when not a link.
67
- * @defaultValue 'button'
68
- */
69
- type?: ButtonHTMLAttributes['type']
70
- disabled?: boolean
71
- /** Force the link to be active independent of the current route. */
72
- active?: boolean
73
- /** Will only be active if the current route is an exact match. */
74
- exact?: boolean
75
- /** Allows controlling how the current route query sets the link as active. */
76
- exactQuery?: boolean | 'partial'
77
- /** Will only be active if the current route hash is an exact match. */
78
- exactHash?: boolean
79
- /** The class to apply when the link is inactive. */
80
- inactiveClass?: string
81
- custom?: boolean
82
- /** When `true`, only styles from `class`, `activeClass`, and `inactiveClass` will be applied. */
83
- raw?: boolean
84
- class?: any
85
- }
86
-
87
- export interface LinkSlots {
88
- default(props: { active: boolean }): any
89
- }
1
+ <script>
2
+ import theme from "#build/ui/link";
90
3
  </script>
91
4
 
92
- <script setup lang="ts">
93
- import { computed } from 'vue'
94
- import { isEqual, diff } from 'ohash/utils'
95
- import { useForwardProps } from 'reka-ui'
96
- import { reactiveOmit } from '@vueuse/core'
97
- import { useRoute } from '#imports'
98
- import ULinkBase from './LinkBase.vue'
99
-
100
- defineOptions({ inheritAttrs: false })
101
-
102
- const props = withDefaults(defineProps<LinkProps>(), {
103
- as: 'button',
104
- type: 'button',
105
- ariaCurrentValue: 'page',
106
- active: undefined,
107
- activeClass: '',
108
- inactiveClass: ''
109
- })
110
- defineSlots<LinkSlots>()
111
-
112
- const route = useRoute()
113
- const nuxtLinkProps = useForwardProps(reactiveOmit(props, 'as', 'type', 'disabled', 'active', 'exact', 'exactQuery', 'exactHash', 'activeClass', 'inactiveClass', 'raw', 'class'))
114
-
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { defu } from "defu";
8
+ import { isEqual, diff } from "ohash/utils";
9
+ import { useForwardProps } from "reka-ui";
10
+ import { reactiveOmit } from "@vueuse/core";
11
+ import { useRoute, useAppConfig } from "#imports";
12
+ import { tv } from "../utils/tv";
13
+ import ULinkBase from "./LinkBase.vue";
14
+ defineOptions({ inheritAttrs: false });
15
+ const props = defineProps({
16
+ as: { type: null, required: false, default: "button" },
17
+ type: { type: null, required: false, default: "button" },
18
+ disabled: { type: Boolean, required: false },
19
+ active: { type: Boolean, required: false, default: void 0 },
20
+ exact: { type: Boolean, required: false },
21
+ exactQuery: { type: [Boolean, String], required: false },
22
+ exactHash: { type: Boolean, required: false },
23
+ inactiveClass: { type: String, required: false, default: "" },
24
+ custom: { type: Boolean, required: false },
25
+ raw: { type: Boolean, required: false },
26
+ class: { type: null, required: false },
27
+ to: { type: null, required: false },
28
+ href: { type: null, required: false },
29
+ external: { type: Boolean, required: false },
30
+ target: { type: [String, Object, null], required: false },
31
+ rel: { type: [String, Object, null], required: false },
32
+ noRel: { type: Boolean, required: false },
33
+ prefetchedClass: { type: String, required: false },
34
+ prefetch: { type: Boolean, required: false },
35
+ prefetchOn: { type: [String, Object], required: false },
36
+ noPrefetch: { type: Boolean, required: false },
37
+ activeClass: { type: String, required: false, default: "" },
38
+ exactActiveClass: { type: String, required: false },
39
+ ariaCurrentValue: { type: String, required: false, default: "page" },
40
+ viewTransition: { type: Boolean, required: false },
41
+ replace: { type: Boolean, required: false }
42
+ });
43
+ defineSlots();
44
+ const route = useRoute();
45
+ const appConfig = useAppConfig();
46
+ const nuxtLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "exactQuery", "exactHash", "activeClass", "inactiveClass", "raw", "class"));
115
47
  const ui = computed(() => tv({
116
- extend: link,
117
- variants: {
118
- active: {
119
- true: props.activeClass,
120
- false: props.inactiveClass
48
+ extend: tv(theme),
49
+ ...defu({
50
+ variants: {
51
+ active: {
52
+ true: props.activeClass,
53
+ false: props.inactiveClass
54
+ }
121
55
  }
122
- }
123
- }))
124
-
125
- function isPartiallyEqual(item1: any, item2: any) {
56
+ }, appConfig.ui?.link || {})
57
+ }));
58
+ function isPartiallyEqual(item1, item2) {
126
59
  const diffedKeys = diff(item1, item2).reduce((filtered, q) => {
127
- if (q.type === 'added') {
128
- filtered.add(q.key)
60
+ if (q.type === "added") {
61
+ filtered.add(q.key);
129
62
  }
130
- return filtered
131
- }, new Set<string>())
132
-
133
- const item1Filtered = Object.fromEntries(Object.entries(item1).filter(([key]) => !diffedKeys.has(key)))
134
- const item2Filtered = Object.fromEntries(Object.entries(item2).filter(([key]) => !diffedKeys.has(key)))
135
-
136
- return isEqual(item1Filtered, item2Filtered)
63
+ return filtered;
64
+ }, /* @__PURE__ */ new Set());
65
+ const item1Filtered = Object.fromEntries(Object.entries(item1).filter(([key]) => !diffedKeys.has(key)));
66
+ const item2Filtered = Object.fromEntries(Object.entries(item2).filter(([key]) => !diffedKeys.has(key)));
67
+ return isEqual(item1Filtered, item2Filtered);
137
68
  }
138
-
139
- function isLinkActive({ route: linkRoute, isActive, isExactActive }: any) {
140
- if (props.active !== undefined) {
141
- return props.active
69
+ function isLinkActive({ route: linkRoute, isActive, isExactActive }) {
70
+ if (props.active !== void 0) {
71
+ return props.active;
142
72
  }
143
-
144
- if (props.exactQuery === 'partial') {
145
- if (!isPartiallyEqual(linkRoute.query, route.query)) return false
73
+ if (props.exactQuery === "partial") {
74
+ if (!isPartiallyEqual(linkRoute.query, route.query)) return false;
146
75
  } else if (props.exactQuery === true) {
147
- if (!isEqual(linkRoute.query, route.query)) return false
76
+ if (!isEqual(linkRoute.query, route.query)) return false;
148
77
  }
149
-
150
78
  if (props.exactHash && linkRoute.hash !== route.hash) {
151
- return false
79
+ return false;
152
80
  }
153
-
154
81
  if (props.exact && isExactActive) {
155
- return true
82
+ return true;
156
83
  }
157
-
158
84
  if (!props.exact && isActive) {
159
- return true
85
+ return true;
160
86
  }
161
-
162
- return false
87
+ return false;
163
88
  }
164
-
165
- function resolveLinkClass({ route, isActive, isExactActive }: any) {
166
- const active = isLinkActive({ route, isActive, isExactActive })
167
-
89
+ function resolveLinkClass({ route: route2, isActive, isExactActive }) {
90
+ const active = isLinkActive({ route: route2, isActive, isExactActive });
168
91
  if (props.raw) {
169
- return [props.class, active ? props.activeClass : props.inactiveClass]
92
+ return [props.class, active ? props.activeClass : props.inactiveClass];
170
93
  }
171
-
172
- return ui.value({ class: props.class, active, disabled: props.disabled })
94
+ return ui.value({ class: props.class, active, disabled: props.disabled });
173
95
  }
174
96
  </script>
175
97
 
@@ -178,34 +100,34 @@ function resolveLinkClass({ route, isActive, isExactActive }: any) {
178
100
  <template v-if="custom">
179
101
  <slot
180
102
  v-bind="{
181
- ...$attrs,
182
- ...(exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {}),
183
- as,
184
- type,
185
- disabled,
186
- href,
187
- navigate,
188
- rel,
189
- target,
190
- isExternal,
191
- active: isLinkActive({ route: linkRoute, isActive, isExactActive })
192
- }"
103
+ ...$attrs,
104
+ ...exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {},
105
+ as,
106
+ type,
107
+ disabled,
108
+ href,
109
+ navigate,
110
+ rel,
111
+ target,
112
+ isExternal,
113
+ active: isLinkActive({ route: linkRoute, isActive, isExactActive })
114
+ }"
193
115
  />
194
116
  </template>
195
117
  <ULinkBase
196
118
  v-else
197
119
  v-bind="{
198
- ...$attrs,
199
- ...(exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {}),
200
- as,
201
- type,
202
- disabled,
203
- href,
204
- navigate,
205
- rel,
206
- target,
207
- isExternal
208
- }"
120
+ ...$attrs,
121
+ ...exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {},
122
+ as,
123
+ type,
124
+ disabled,
125
+ href,
126
+ navigate,
127
+ rel,
128
+ target,
129
+ isExternal
130
+ }"
209
131
  :class="resolveLinkClass({ route: linkRoute, isActive, isExactActive })"
210
132
  >
211
133
  <slot :active="isLinkActive({ route: linkRoute, isActive, isExactActive })" />