@nuxt/ui 3.0.0-alpha.0 → 3.0.0-alpha.2

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 (173) hide show
  1. package/README.md +1 -1
  2. package/cli/node_modules/.ignored/citty/LICENSE +36 -0
  3. package/cli/node_modules/.ignored/citty/README.md +134 -0
  4. package/cli/node_modules/.ignored/citty/dist/index.cjs +475 -0
  5. package/cli/node_modules/.ignored/citty/dist/index.d.cts +80 -0
  6. package/cli/node_modules/.ignored/citty/dist/index.d.mts +80 -0
  7. package/cli/node_modules/.ignored/citty/dist/index.d.ts +80 -0
  8. package/cli/node_modules/.ignored/citty/dist/index.mjs +463 -0
  9. package/cli/node_modules/.ignored/citty/package.json +49 -0
  10. package/cli/node_modules/.ignored/consola/LICENSE +47 -0
  11. package/cli/node_modules/.ignored/consola/README.md +318 -0
  12. package/cli/node_modules/.ignored/consola/core.d.ts +1 -0
  13. package/cli/node_modules/.ignored/consola/dist/basic.cjs +32 -0
  14. package/cli/node_modules/.ignored/consola/dist/basic.d.ts +9 -0
  15. package/cli/node_modules/.ignored/consola/dist/basic.mjs +24 -0
  16. package/cli/node_modules/.ignored/consola/dist/browser.cjs +80 -0
  17. package/cli/node_modules/.ignored/consola/dist/browser.d.ts +7 -0
  18. package/cli/node_modules/.ignored/consola/dist/browser.mjs +72 -0
  19. package/cli/node_modules/.ignored/consola/dist/chunks/prompt.cjs +436 -0
  20. package/cli/node_modules/.ignored/consola/dist/chunks/prompt.mjs +429 -0
  21. package/cli/node_modules/.ignored/consola/dist/core.cjs +415 -0
  22. package/cli/node_modules/.ignored/consola/dist/core.d.ts +124 -0
  23. package/cli/node_modules/.ignored/consola/dist/core.mjs +410 -0
  24. package/cli/node_modules/.ignored/consola/dist/index.cjs +21 -0
  25. package/cli/node_modules/.ignored/consola/dist/index.d.ts +9 -0
  26. package/cli/node_modules/.ignored/consola/dist/index.mjs +8 -0
  27. package/cli/node_modules/.ignored/consola/dist/shared/consola.06ad8a64.mjs +62 -0
  28. package/cli/node_modules/.ignored/consola/dist/shared/consola.36c0034f.mjs +636 -0
  29. package/cli/node_modules/.ignored/consola/dist/shared/consola.4bbae468.cjs +645 -0
  30. package/cli/node_modules/.ignored/consola/dist/shared/consola.deac7d5a.cjs +65 -0
  31. package/cli/node_modules/.ignored/consola/dist/utils.cjs +308 -0
  32. package/cli/node_modules/.ignored/consola/dist/utils.d.ts +169 -0
  33. package/cli/node_modules/.ignored/consola/dist/utils.mjs +284 -0
  34. package/cli/node_modules/.ignored/consola/lib/index.cjs +9 -0
  35. package/cli/node_modules/.ignored/consola/package.json +101 -0
  36. package/cli/node_modules/.ignored/consola/utils.d.ts +1 -0
  37. package/cli/node_modules/.ignored/pathe/LICENSE +44 -0
  38. package/cli/node_modules/.ignored/pathe/README.md +69 -0
  39. package/cli/node_modules/.ignored/pathe/dist/index.cjs +23 -0
  40. package/cli/node_modules/.ignored/pathe/dist/index.d.cts +36 -0
  41. package/cli/node_modules/.ignored/pathe/dist/index.d.mts +36 -0
  42. package/cli/node_modules/.ignored/pathe/dist/index.d.ts +36 -0
  43. package/cli/node_modules/.ignored/pathe/dist/index.mjs +1 -0
  44. package/cli/node_modules/.ignored/pathe/dist/shared/pathe.1f0a373c.cjs +238 -0
  45. package/cli/node_modules/.ignored/pathe/dist/shared/pathe.ff20891b.mjs +221 -0
  46. package/cli/node_modules/.ignored/pathe/dist/utils.cjs +58 -0
  47. package/cli/node_modules/.ignored/pathe/dist/utils.d.cts +5 -0
  48. package/cli/node_modules/.ignored/pathe/dist/utils.d.mts +5 -0
  49. package/cli/node_modules/.ignored/pathe/dist/utils.d.ts +5 -0
  50. package/cli/node_modules/.ignored/pathe/dist/utils.mjs +54 -0
  51. package/cli/node_modules/.ignored/pathe/package.json +48 -0
  52. package/cli/node_modules/.ignored/pathe/utils.d.ts +1 -0
  53. package/cli/node_modules/.ignored/scule/LICENSE +21 -0
  54. package/cli/node_modules/.ignored/scule/README.md +149 -0
  55. package/cli/node_modules/.ignored/scule/dist/index.cjs +92 -0
  56. package/cli/node_modules/.ignored/scule/dist/index.d.cts +57 -0
  57. package/cli/node_modules/.ignored/scule/dist/index.d.mts +57 -0
  58. package/cli/node_modules/.ignored/scule/dist/index.d.ts +57 -0
  59. package/cli/node_modules/.ignored/scule/dist/index.mjs +80 -0
  60. package/cli/node_modules/.ignored/scule/package.json +43 -0
  61. package/cli/node_modules/.package-lock.json +33 -0
  62. package/dist/module.d.mts +9 -2
  63. package/dist/module.d.ts +9 -2
  64. package/dist/module.json +3 -3
  65. package/dist/module.mjs +62 -103
  66. package/dist/runtime/components/Accordion.vue +49 -6
  67. package/dist/runtime/components/Alert.vue +58 -6
  68. package/dist/runtime/components/App.vue +12 -2
  69. package/dist/runtime/components/Avatar.vue +27 -6
  70. package/dist/runtime/components/AvatarGroup.vue +30 -6
  71. package/dist/runtime/components/Badge.vue +28 -6
  72. package/dist/runtime/components/Breadcrumb.vue +44 -6
  73. package/dist/runtime/components/Button.vue +68 -10
  74. package/dist/runtime/components/ButtonGroup.vue +30 -6
  75. package/dist/runtime/components/Card.vue +25 -6
  76. package/dist/runtime/components/Checkbox.vue +45 -6
  77. package/dist/runtime/components/Chip.vue +39 -6
  78. package/dist/runtime/components/Collapsible.vue +27 -6
  79. package/dist/runtime/components/CommandPalette.vue +100 -7
  80. package/dist/runtime/components/Container.vue +22 -6
  81. package/dist/runtime/components/ContextMenu.vue +58 -6
  82. package/dist/runtime/components/ContextMenuContent.vue +18 -4
  83. package/dist/runtime/components/Drawer.vue +48 -6
  84. package/dist/runtime/components/DropdownMenu.vue +66 -6
  85. package/dist/runtime/components/DropdownMenuContent.vue +22 -4
  86. package/dist/runtime/components/Form.vue +58 -26
  87. package/dist/runtime/components/FormField.vue +41 -16
  88. package/dist/runtime/components/Icon.vue +12 -2
  89. package/dist/runtime/components/Input.vue +46 -6
  90. package/dist/runtime/components/InputMenu.vue +113 -6
  91. package/dist/runtime/components/Kbd.vue +28 -6
  92. package/dist/runtime/components/Link.vue +81 -17
  93. package/dist/runtime/components/LinkBase.vue +18 -7
  94. package/dist/runtime/components/Modal.vue +69 -6
  95. package/dist/runtime/components/NavigationMenu.vue +76 -6
  96. package/dist/runtime/components/Pagination.vue +99 -6
  97. package/dist/runtime/components/Popover.vue +42 -6
  98. package/dist/runtime/components/Progress.vue +44 -6
  99. package/dist/runtime/components/RadioGroup.vue +55 -7
  100. package/dist/runtime/components/Select.vue +89 -7
  101. package/dist/runtime/components/SelectMenu.vue +105 -7
  102. package/dist/runtime/components/Separator.vue +41 -6
  103. package/dist/runtime/components/Skeleton.vue +18 -6
  104. package/dist/runtime/components/Slideover.vue +67 -6
  105. package/dist/runtime/components/Slider.vue +36 -6
  106. package/dist/runtime/components/Switch.vue +50 -6
  107. package/dist/runtime/components/Tabs.vue +59 -6
  108. package/dist/runtime/components/Textarea.vue +46 -6
  109. package/dist/runtime/components/Toast.vue +55 -6
  110. package/dist/runtime/components/Toaster.vue +28 -7
  111. package/dist/runtime/components/Tooltip.vue +42 -6
  112. package/dist/runtime/composables/useAvatarGroup.d.ts +2 -2
  113. package/dist/runtime/composables/useButtonGroup.d.ts +3 -3
  114. package/dist/runtime/composables/useFormField.d.ts +7 -3
  115. package/dist/runtime/composables/useFormField.js +12 -7
  116. package/dist/runtime/composables/useModal.d.ts +1 -1
  117. package/dist/runtime/composables/useSlideover.d.ts +1 -1
  118. package/dist/runtime/composables/useToast.d.ts +2 -2
  119. package/dist/runtime/index.css +1 -0
  120. package/dist/runtime/plugins/colors.d.ts +2 -0
  121. package/dist/runtime/plugins/modal.d.ts +2 -0
  122. package/dist/runtime/plugins/slideover.d.ts +2 -0
  123. package/dist/runtime/types/form.d.ts +1 -2
  124. package/dist/runtime/utils/index.d.ts +1 -1
  125. package/dist/runtime/utils/link.d.ts +23 -55
  126. package/package.json +26 -25
  127. package/dist/runtime/assets/css/animations.css +0 -1
  128. package/dist/runtime/components/Accordion.vue.d.ts +0 -492
  129. package/dist/runtime/components/Alert.vue.d.ts +0 -548
  130. package/dist/runtime/components/App.vue.d.ts +0 -25
  131. package/dist/runtime/components/Avatar.vue.d.ts +0 -384
  132. package/dist/runtime/components/AvatarGroup.vue.d.ts +0 -381
  133. package/dist/runtime/components/Badge.vue.d.ts +0 -422
  134. package/dist/runtime/components/Breadcrumb.vue.d.ts +0 -307
  135. package/dist/runtime/components/Button.vue.d.ts +0 -949
  136. package/dist/runtime/components/ButtonGroup.vue.d.ts +0 -182
  137. package/dist/runtime/components/Card.vue.d.ts +0 -191
  138. package/dist/runtime/components/Checkbox.vue.d.ts +0 -819
  139. package/dist/runtime/components/Chip.vue.d.ts +0 -590
  140. package/dist/runtime/components/Collapsible.vue.d.ts +0 -159
  141. package/dist/runtime/components/CommandPalette.vue.d.ts +0 -684
  142. package/dist/runtime/components/Container.vue.d.ts +0 -27
  143. package/dist/runtime/components/ContextMenu.vue.d.ts +0 -796
  144. package/dist/runtime/components/ContextMenuContent.vue.d.ts +0 -0
  145. package/dist/runtime/components/Drawer.vue.d.ts +0 -343
  146. package/dist/runtime/components/DropdownMenu.vue.d.ts +0 -815
  147. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +0 -0
  148. package/dist/runtime/components/Form.vue.d.ts +0 -39
  149. package/dist/runtime/components/FormField.vue.d.ts +0 -356
  150. package/dist/runtime/components/Icon.vue.d.ts +0 -17
  151. package/dist/runtime/components/Input.vue.d.ts +0 -1137
  152. package/dist/runtime/components/InputMenu.vue.d.ts +0 -2121
  153. package/dist/runtime/components/Kbd.vue.d.ts +0 -169
  154. package/dist/runtime/components/Link.vue.d.ts +0 -76
  155. package/dist/runtime/components/LinkBase.vue.d.ts +0 -49
  156. package/dist/runtime/components/Modal.vue.d.ts +0 -319
  157. package/dist/runtime/components/NavigationMenu.vue.d.ts +0 -1789
  158. package/dist/runtime/components/Pagination.vue.d.ts +0 -295
  159. package/dist/runtime/components/Popover.vue.d.ts +0 -197
  160. package/dist/runtime/components/Progress.vue.d.ts +0 -1781
  161. package/dist/runtime/components/RadioGroup.vue.d.ts +0 -1715
  162. package/dist/runtime/components/Select.vue.d.ts +0 -1569
  163. package/dist/runtime/components/SelectMenu.vue.d.ts +0 -1661
  164. package/dist/runtime/components/Separator.vue.d.ts +0 -0
  165. package/dist/runtime/components/Skeleton.vue.d.ts +0 -26
  166. package/dist/runtime/components/Slideover.vue.d.ts +0 -375
  167. package/dist/runtime/components/Slider.vue.d.ts +0 -0
  168. package/dist/runtime/components/Switch.vue.d.ts +0 -1676
  169. package/dist/runtime/components/Tabs.vue.d.ts +0 -934
  170. package/dist/runtime/components/Textarea.vue.d.ts +0 -1133
  171. package/dist/runtime/components/Toast.vue.d.ts +0 -0
  172. package/dist/runtime/components/Toaster.vue.d.ts +0 -362
  173. package/dist/runtime/components/Tooltip.vue.d.ts +0 -248
@@ -1,9 +1,58 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/toast";
5
- const appConfig = _appConfig;
6
- const toast = tv({ extend: tv(theme), ...appConfig.ui?.toast || {} });
1
+ <script lang="ts">
2
+ import { tv, type VariantProps } from 'tailwind-variants'
3
+ import type { ToastRootProps, ToastRootEmits } from 'radix-vue'
4
+ import type { AppConfig } from '@nuxt/schema'
5
+ import _appConfig from '#build/app.config'
6
+ import theme from '#build/ui/toast'
7
+ import type { AvatarProps, ButtonProps } from '../types'
8
+
9
+ const appConfig = _appConfig as AppConfig & { ui: { toast: Partial<typeof theme> } }
10
+
11
+ const toast = tv({ extend: tv(theme), ...(appConfig.ui?.toast || {}) })
12
+
13
+ type ToastVariants = VariantProps<typeof toast>
14
+
15
+ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open' | 'type' | 'duration'> {
16
+ /**
17
+ * The element or component this component should render as.
18
+ * @defaultValue 'li'
19
+ */
20
+ as?: any
21
+ title?: string
22
+ description?: string
23
+ icon?: string
24
+ avatar?: AvatarProps
25
+ color?: ToastVariants['color']
26
+ /**
27
+ * Display a list of actions:
28
+ * - under the title and description if multiline
29
+ * - next to the close button if not multiline
30
+ */
31
+ actions?: ButtonProps[]
32
+ /**
33
+ * Display a close button to dismiss the toast.
34
+ * `{ size: 'md', color: 'gray', variant: 'link' }`{lang="ts-type"}
35
+ * @defaultValue true
36
+ */
37
+ close?: ButtonProps | boolean
38
+ /**
39
+ * The icon displayed in the close button.
40
+ * @defaultValue appConfig.ui.icons.close
41
+ */
42
+ closeIcon?: string
43
+ class?: any
44
+ ui?: Partial<typeof toast.slots>
45
+ }
46
+
47
+ export interface ToastEmits extends ToastRootEmits {}
48
+
49
+ export interface ToastSlots {
50
+ leading(props?: {}): any
51
+ title(props?: {}): any
52
+ description(props?: {}): any
53
+ actions(props?: {}): any
54
+ close(props: { ui: any }): any
55
+ }
7
56
  </script>
8
57
 
9
58
  <script setup lang="ts">
@@ -1,9 +1,30 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/toaster";
5
- const appConfig = _appConfig;
6
- const toaster = tv({ extend: tv(theme), ...appConfig.ui?.toaster || {} });
1
+ <script lang="ts">
2
+ import { tv, type VariantProps } from 'tailwind-variants'
3
+ import type { ToastProviderProps } from 'radix-vue'
4
+ import type { AppConfig } from '@nuxt/schema'
5
+ import _appConfig from '#build/app.config'
6
+ import theme from '#build/ui/toaster'
7
+
8
+ const appConfig = _appConfig as AppConfig & { ui: { toaster: Partial<typeof theme> } }
9
+
10
+ const toaster = tv({ extend: tv(theme), ...(appConfig.ui?.toaster || {}) })
11
+
12
+ type ToasterVariants = VariantProps<typeof toaster>
13
+
14
+ export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'> {
15
+ position?: ToasterVariants['position']
16
+ /**
17
+ * Expand the toasts to show multiple toasts at once.
18
+ * @defaultValue true
19
+ */
20
+ expand?: boolean
21
+ class?: any
22
+ ui?: Partial<typeof toaster.slots>
23
+ }
24
+
25
+ export interface ToasterSlots {
26
+ default(props?: {}): any
27
+ }
7
28
  </script>
8
29
 
9
30
  <script setup lang="ts">
@@ -94,7 +115,7 @@ function getOffset(index: number) {
94
115
 
95
116
  <ToastViewport
96
117
  :data-expanded="expanded"
97
- :class="ui.viewport({ class: props.class })"
118
+ :class="ui.viewport({ class: [props.class, props.ui?.viewport] })"
98
119
  :style="{
99
120
  '--scale-factor': '0.05',
100
121
  '--translate-factor': position?.startsWith('top') ? '1px' : '-1px',
@@ -1,9 +1,45 @@
1
- <script>
2
- import { tv } from "tailwind-variants";
3
- import _appConfig from "#build/app.config";
4
- import theme from "#build/ui/tooltip";
5
- const appConfig = _appConfig;
6
- const tooltip = tv({ extend: tv(theme), ...appConfig.ui?.tooltip || {} });
1
+ <script lang="ts">
2
+ import { tv } from 'tailwind-variants'
3
+ import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipArrowProps } from 'radix-vue'
4
+ import type { AppConfig } from '@nuxt/schema'
5
+ import _appConfig from '#build/app.config'
6
+ import theme from '#build/ui/tooltip'
7
+ import type { KbdProps } from '../types'
8
+
9
+ const appConfig = _appConfig as AppConfig & { ui: { tooltip: Partial<typeof theme> } }
10
+
11
+ const tooltip = tv({ extend: tv(theme), ...(appConfig.ui?.tooltip || {}) })
12
+
13
+ export interface TooltipProps extends TooltipRootProps {
14
+ /** The text content of the tooltip. */
15
+ text?: string
16
+ /** The keyboard keys to display in the tooltip. */
17
+ kbds?: KbdProps['value'][] | KbdProps[]
18
+ /**
19
+ * The content of the tooltip.
20
+ * @defaultValue { side: 'bottom', sideOffset: 8 }
21
+ */
22
+ content?: Omit<TooltipContentProps, 'as' | 'asChild'>
23
+ /**
24
+ * Display an arrow alongside the tooltip.
25
+ * @defaultValue false
26
+ */
27
+ arrow?: boolean | Omit<TooltipArrowProps, 'as' | 'asChild'>
28
+ /**
29
+ * Render the tooltip in a portal.
30
+ * @defaultValue true
31
+ */
32
+ portal?: boolean
33
+ class?: any
34
+ ui?: Partial<typeof tooltip.slots>
35
+ }
36
+
37
+ export interface TooltipEmits extends TooltipRootEmits {}
38
+
39
+ export interface TooltipSlots {
40
+ default(props: { open: boolean }): any
41
+ content(props?: {}): any
42
+ }
7
43
  </script>
8
44
 
9
45
  <script setup lang="ts">
@@ -1,10 +1,10 @@
1
1
  import { type ComputedRef, type InjectionKey } from 'vue';
2
- import type { AvatarGroupProps } from '../types.js';
2
+ import type { AvatarGroupProps } from '../types/index.js';
3
3
  export declare const avatarGroupInjectionKey: InjectionKey<ComputedRef<{
4
4
  size: AvatarGroupProps['size'];
5
5
  }>>;
6
6
  export declare function useAvatarGroup(props: {
7
7
  size: AvatarGroupProps['size'];
8
8
  }): {
9
- size: ComputedRef<"md" | "3xs" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl" | undefined>;
9
+ size: ComputedRef<any>;
10
10
  };
@@ -1,4 +1,4 @@
1
- import { type InjectionKey, type ComputedRef } from 'vue';
1
+ import type { InjectionKey, ComputedRef } from 'vue';
2
2
  import type { ButtonGroupProps } from '../components/ButtonGroup.vue.js';
3
3
  import type { GetObjectField } from '../types/utils.js';
4
4
  export declare const buttonGroupInjectionKey: InjectionKey<ComputedRef<{
@@ -9,7 +9,7 @@ type Props<T> = {
9
9
  size?: GetObjectField<T, 'size'>;
10
10
  };
11
11
  export declare function useButtonGroup<T>(props: Props<T>): {
12
- orientation: ComputedRef<"horizontal" | "vertical" | undefined>;
13
- size: ComputedRef<"md" | "xs" | "sm" | "lg" | "xl" | NonNullable<GetObjectField<T, "size">> | undefined>;
12
+ orientation: ComputedRef<any>;
13
+ size: ComputedRef<any>;
14
14
  };
15
15
  export {};
@@ -1,6 +1,6 @@
1
1
  import { type InjectionKey, type Ref, type ComputedRef } from 'vue';
2
2
  import { type UseEventBusReturn } from '@vueuse/core';
3
- import type { FormFieldProps } from '../types.js';
3
+ import type { FormFieldProps } from '../types/index.js';
4
4
  import type { FormEvent, FormFieldInjectedOptions, FormInjectedOptions } from '../types/form.js';
5
5
  import type { GetObjectField } from '../types/utils.js';
6
6
  type Props<T> = {
@@ -16,11 +16,15 @@ type Props<T> = {
16
16
  export declare const formOptionsInjectionKey: InjectionKey<ComputedRef<FormInjectedOptions>>;
17
17
  export declare const formBusInjectionKey: InjectionKey<UseEventBusReturn<FormEvent, string>>;
18
18
  export declare const formFieldInjectionKey: InjectionKey<ComputedRef<FormFieldInjectedOptions<FormFieldProps>>>;
19
+ export declare const inputIdInjectionKey: InjectionKey<Ref<string | undefined>>;
19
20
  export declare const formInputsInjectionKey: InjectionKey<Ref<Record<string, string>>>;
20
- export declare function useFormField<T>(props?: Props<T>): {
21
+ export declare const formLoadingInjectionKey: InjectionKey<Readonly<Ref<boolean>>>;
22
+ export declare function useFormField<T>(props?: Props<T>, opts?: {
23
+ bind?: boolean;
24
+ }): {
21
25
  id: ComputedRef<string | undefined>;
22
26
  name: ComputedRef<string | undefined>;
23
- size: ComputedRef<"md" | "xs" | "sm" | "lg" | "xl" | NonNullable<GetObjectField<T, "size">> | undefined>;
27
+ size: ComputedRef<any>;
24
28
  color: ComputedRef<"error" | GetObjectField<T, "color"> | undefined>;
25
29
  highlight: ComputedRef<boolean | undefined>;
26
30
  disabled: ComputedRef<boolean | undefined>;
@@ -3,18 +3,23 @@ import { useDebounceFn } from "@vueuse/core";
3
3
  export const formOptionsInjectionKey = Symbol("nuxt-ui.form-options");
4
4
  export const formBusInjectionKey = Symbol("nuxt-ui.form-events");
5
5
  export const formFieldInjectionKey = Symbol("nuxt-ui.form-field");
6
+ export const inputIdInjectionKey = Symbol("nuxt-ui.input-id");
6
7
  export const formInputsInjectionKey = Symbol("nuxt-ui.form-inputs");
7
- export function useFormField(props) {
8
+ export const formLoadingInjectionKey = Symbol("nuxt-ui.form-loading");
9
+ export function useFormField(props, opts) {
8
10
  const formOptions = inject(formOptionsInjectionKey, void 0);
9
11
  const formBus = inject(formBusInjectionKey, void 0);
10
12
  const formField = inject(formFieldInjectionKey, void 0);
11
13
  const formInputs = inject(formInputsInjectionKey, void 0);
12
- if (formField) {
13
- if (props?.id) {
14
- formField.value.id = props?.id;
14
+ const inputId = inject(inputIdInjectionKey, void 0);
15
+ if (formField && inputId) {
16
+ if (opts?.bind === false || props?.legend) {
17
+ inputId.value = void 0;
18
+ } else if (props?.id) {
19
+ inputId.value = props?.id;
15
20
  }
16
- if (formInputs && formField.value.name) {
17
- formInputs.value[formField.value.name] = formField.value.id;
21
+ if (formInputs && formField.value.name && inputId.value) {
22
+ formInputs.value[formField.value.name] = inputId.value;
18
23
  }
19
24
  }
20
25
  const blurred = ref(false);
@@ -37,7 +42,7 @@ export function useFormField(props) {
37
42
  formField?.value.validateOnInputDelay ?? formOptions?.value.validateOnInputDelay ?? 0
38
43
  );
39
44
  return {
40
- id: computed(() => props?.id ?? formField?.value.id),
45
+ id: computed(() => props?.id ?? inputId?.value),
41
46
  name: computed(() => props?.name ?? formField?.value.name),
42
47
  size: computed(() => props?.size ?? formField?.value.size),
43
48
  color: computed(() => formField?.value.error ? "error" : props?.color),
@@ -1,5 +1,5 @@
1
1
  import type { ShallowRef, Component, InjectionKey } from 'vue';
2
- import type { ModalProps } from '../types.js';
2
+ import type { ModalProps } from '../types/index.js';
3
3
  import type { ComponentProps } from '../types/component.js';
4
4
  export interface ModalState {
5
5
  component: Component | string;
@@ -1,5 +1,5 @@
1
1
  import type { ShallowRef, Component, InjectionKey } from 'vue';
2
- import type { SlideoverProps } from '../types.js';
2
+ import type { SlideoverProps } from '../types/index.js';
3
3
  import type { ComponentProps } from '../types/component.js';
4
4
  export interface SlideoverState {
5
5
  component: Component | string;
@@ -1,4 +1,4 @@
1
- import type { ToastProps } from '../types.js';
1
+ import type { ToastProps } from '../types/index.js';
2
2
  export interface Toast extends Omit<ToastProps, 'defaultOpen'> {
3
3
  id: string | number;
4
4
  click?: (toast: Toast) => void;
@@ -6,7 +6,7 @@ export interface Toast extends Omit<ToastProps, 'defaultOpen'> {
6
6
  export declare function useToast(): {
7
7
  toasts: import("vue").Ref<Toast[], Toast[]>;
8
8
  add: (toast: Partial<Toast>) => Toast;
9
- update: (id: string | number, toast: Partial<Toast>) => void;
9
+ update: (id: string | number, toast: Omit<Partial<Toast>, "id">) => void;
10
10
  remove: (id: string | number) => void;
11
11
  clear: () => void;
12
12
  };
@@ -0,0 +1 @@
1
+ @theme{--color-gray-*:initial;--color-cool-50:#f9fafb;--color-cool-100:#f3f4f6;--color-cool-200:#e5e7eb;--color-cool-300:#d1d5db;--color-cool-400:#9ca3af;--color-cool-500:#6b7280;--color-cool-600:#4b5563;--color-cool-700:#374151;--color-cool-800:#1f2937;--color-cool-900:#111827;--color-cool-950:#030712;--spacing-4_5:1.125rem;--color-primary-50:var(--color-primary-50);--color-primary-100:var(--color-primary-100);--color-primary-200:var(--color-primary-200);--color-primary-300:var(--color-primary-300);--color-primary-400:var(--color-primary-400);--color-primary-500:var(--color-primary-500);--color-primary-600:var(--color-primary-600);--color-primary-700:var(--color-primary-700);--color-primary-800:var(--color-primary-800);--color-primary-900:var(--color-primary-900);--color-primary-950:var(--color-primary-950);--color-error-50:var(--color-error-50);--color-error-100:var(--color-error-100);--color-error-200:var(--color-error-200);--color-error-300:var(--color-error-300);--color-error-400:var(--color-error-400);--color-error-500:var(--color-error-500);--color-error-600:var(--color-error-600);--color-error-700:var(--color-error-700);--color-error-800:var(--color-error-800);--color-error-900:var(--color-error-900);--color-error-950:var(--color-error-950);--color-gray-50:var(--color-gray-50);--color-gray-100:var(--color-gray-100);--color-gray-200:var(--color-gray-200);--color-gray-300:var(--color-gray-300);--color-gray-400:var(--color-gray-400);--color-gray-500:var(--color-gray-500);--color-gray-600:var(--color-gray-600);--color-gray-700:var(--color-gray-700);--color-gray-800:var(--color-gray-800);--color-gray-900:var(--color-gray-900);--color-gray-950:var(--color-gray-950)}@layer base{:root{color-scheme:light dark}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}@keyframes collapsible-up{0%{height:var(--radix-collapsible-content-height)}to{height:0}}@keyframes collapsible-down{0%{height:0}to{height:var(--radix-collapsible-content-height)}}@keyframes toast-collapsed-closed{0%{transform:var(--transform)}to{transform:translateY(calc((var(--before) - var(--height))*var(--gap))) scale(var(--scale))}}@keyframes toast-closed{0%{transform:var(--transform)}to{transform:translateY(calc((var(--offset) - var(--height))*var(--translate-factor)))}}@keyframes toast-slide-left{0%{transform:translateX(0) translateY(var(--translate))}to{transform:translateX(-100%) translateY(var(--translate))}}@keyframes toast-slide-right{0%{transform:translateX(0) translateY(var(--translate))}to{transform:translateX(100%) translateY(var(--translate))}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}@keyframes scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes scale-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)}}@keyframes slide-in-from-top{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes slide-out-to-top{0%{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes slide-in-from-right{0%{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slide-out-to-right{0%{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes slide-in-from-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slide-out-to-bottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slide-in-from-left{0%{transform:translateX(-100%)}to{transform:translateX(0)}}@keyframes slide-out-to-left{0%{transform:translateX(0)}to{transform:translateX(-100%)}}@keyframes slide-in-from-top-and-fade{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-out-to-top-and-fade{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes slide-in-from-right-and-fade{0%{opacity:0;transform:translateX(4px)}to{opacity:1;transform:translateX(0)}}@keyframes slide-out-to-right-and-fade{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(4px)}}@keyframes slide-in-from-bottom-and-fade{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-out-to-bottom-and-fade{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}@keyframes slide-in-from-left-and-fade{0%{opacity:0;transform:translateX(-4px)}to{opacity:1;transform:translateX(0)}}@keyframes slide-out-to-left-and-fade{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-4px)}}@keyframes enter-from-right{0%{opacity:0;transform:translateX(200px)}to{opacity:1;transform:translateX(0)}}@keyframes enter-from-left{0%{opacity:0;transform:translateX(-200px)}to{opacity:1;transform:translateX(0)}}@keyframes exit-to-right{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(200px)}}@keyframes exit-to-left{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-200px)}}@keyframes carousel{0%,to{width:50%}0%{transform:translateX(-100%)}to{transform:translateX(200%)}}@keyframes carousel-vertical{0%,to{height:50%}0%{transform:translateY(-100%)}to{transform:translateY(200%)}}@keyframes carousel-inverse{0%,to{width:50%}0%{transform:translateX(200%)}to{transform:translateX(-100%)}}@keyframes carousel-inverse-vertical{0%,to{height:50%}0%{transform:translateY(200%)}to{transform:translateY(-100%)}}@keyframes swing{0%,to{width:50%}0%,to{transform:translateX(-25%)}50%{transform:translateX(125%)}}@keyframes swing-vertical{0%,to{height:50%}0%,to{transform:translateY(-25%)}50%{transform:translateY(125%)}}@keyframes elastic{0%,to{margin-left:25%;width:50%}50%{margin-left:5%;width:90%}}@keyframes elastic-vertical{0%,to{height:50%;margin-top:25%}50%{height:90%;margin-top:5%}}}
@@ -0,0 +1,2 @@
1
+ declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -24,7 +24,7 @@ export interface FormError<P extends string = string> {
24
24
  message: string;
25
25
  }
26
26
  export interface FormErrorWithId extends FormError {
27
- id: string;
27
+ id?: string;
28
28
  }
29
29
  export type FormSubmitEvent<T> = SubmitEvent & {
30
30
  data: T;
@@ -54,7 +54,6 @@ export interface FormInjectedOptions {
54
54
  validateOnInputDelay?: number;
55
55
  }
56
56
  export interface FormFieldInjectedOptions<T> {
57
- id: string;
58
57
  name?: string;
59
58
  size?: GetObjectField<T, 'size'>;
60
59
  error?: string | boolean;
@@ -1,5 +1,5 @@
1
1
  export declare function pick<Data extends object, Keys extends keyof Data>(data: Data, keys: Keys[]): Pick<Data, Keys>;
2
2
  export declare function omit<Data extends object, Keys extends keyof Data>(data: Data, keys: Keys[]): Omit<Data, Keys>;
3
- export declare function get(object: Record<string, any>, path: (string | number)[] | string, defaultValue?: any): any;
3
+ export declare function get(object: Record<string, any> | undefined, path: (string | number)[] | string, defaultValue?: any): any;
4
4
  export declare function set(object: Record<string, any>, path: (string | number)[] | string, value: any): void;
5
5
  export declare function looseToNumber(val: any): any;
@@ -1,59 +1,27 @@
1
- import type { LinkProps } from '../types.js';
1
+ import type { LinkProps } from '../types/index.js';
2
2
  export declare function pickLinkProps(link: LinkProps & {
3
3
  ariaLabel?: string;
4
4
  }): {
5
- type?: import("vue").ButtonHTMLAttributes["type"];
6
- as?: any;
7
- target?: ("_blank" | "_parent" | "_self" | "_top" | (string & {}) | null) | undefined;
8
- to?: string | {
9
- name?: import("vue-router").RouteRecordNameGeneric;
10
- params?: import("vue-router").RouteParamsRawGeneric | undefined;
11
- path?: undefined;
12
- query?: import("vue-router").LocationQueryRaw | undefined;
13
- hash?: string | undefined;
14
- replace?: boolean | undefined;
15
- force?: boolean | undefined;
16
- state?: import("vue-router").HistoryState | undefined;
17
- } | {
18
- path: string;
19
- query?: import("vue-router").LocationQueryRaw | undefined;
20
- hash?: string | undefined;
21
- replace?: boolean | undefined;
22
- force?: boolean | undefined;
23
- state?: import("vue-router").HistoryState | undefined;
24
- } | undefined;
25
- activeClass?: string | undefined;
26
- exactActiveClass?: string | undefined;
27
- ariaCurrentValue?: ("page" | "step" | "location" | "date" | "time" | "true" | "false") | undefined;
28
- replace?: boolean | undefined;
29
- disabled?: boolean | undefined;
30
- active?: boolean | undefined;
31
- exact?: boolean | undefined;
32
- exactQuery?: boolean | undefined;
33
- exactHash?: boolean | undefined;
34
- inactiveClass?: string | undefined;
35
- href?: string | {
36
- name?: import("vue-router").RouteRecordNameGeneric;
37
- params?: import("vue-router").RouteParamsRawGeneric | undefined;
38
- path?: undefined;
39
- query?: import("vue-router").LocationQueryRaw | undefined;
40
- hash?: string | undefined;
41
- replace?: boolean | undefined;
42
- force?: boolean | undefined;
43
- state?: import("vue-router").HistoryState | undefined;
44
- } | {
45
- path: string;
46
- query?: import("vue-router").LocationQueryRaw | undefined;
47
- hash?: string | undefined;
48
- replace?: boolean | undefined;
49
- force?: boolean | undefined;
50
- state?: import("vue-router").HistoryState | undefined;
51
- } | undefined;
52
- external?: boolean | undefined;
53
- rel?: ("noopener" | "noreferrer" | "nofollow" | "sponsored" | "ugc" | (string & {}) | null) | undefined;
54
- noRel?: boolean | undefined;
55
- prefetchedClass?: string | undefined;
56
- prefetch?: boolean | undefined;
57
- noPrefetch?: boolean | undefined;
58
- ariaLabel?: string | undefined;
5
+ type: any;
6
+ active: any;
7
+ activeClass: any;
8
+ ariaCurrentValue: any;
9
+ ariaLabel: any;
10
+ as: any;
11
+ disabled: any;
12
+ exact: any;
13
+ exactActiveClass: any;
14
+ exactHash: any;
15
+ exactQuery: any;
16
+ external: any;
17
+ href: any;
18
+ inactiveClass: any;
19
+ noPrefetch: any;
20
+ noRel: any;
21
+ prefetch: any;
22
+ prefetchedClass: any;
23
+ rel: any;
24
+ replace: any;
25
+ target: any;
26
+ to: any;
59
27
  };
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@nuxt/ui",
3
- "version": "3.0.0-alpha.0",
4
- "packageManager": "pnpm@9.9.0",
3
+ "description": "A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.",
4
+ "version": "3.0.0-alpha.2",
5
+ "packageManager": "pnpm@9.10.0",
5
6
  "repository": {
6
7
  "type": "git",
7
8
  "url": "git+https://github.com/nuxt/ui.git"
@@ -13,22 +14,21 @@
13
14
  ".": {
14
15
  "types": "./dist/module.d.ts",
15
16
  "import": "./dist/module.mjs",
16
- "require": "./dist/module.cjs"
17
+ "require": "./dist/module.cjs",
18
+ "style": "./dist/runtime/index.css"
17
19
  },
18
20
  "./runtime/*": "./dist/runtime/*"
19
21
  },
20
22
  "bin": {
21
23
  "nuxt-ui": "./cli/index.mjs"
22
24
  },
25
+ "style": "./dist/runtime/index.css",
23
26
  "main": "./dist/module.cjs",
24
27
  "types": "./dist/types.d.ts",
25
28
  "files": [
26
29
  "dist",
27
30
  "cli"
28
31
  ],
29
- "engines": {
30
- "node": ">=v16.20.2"
31
- },
32
32
  "scripts": {
33
33
  "build": "nuxt-module-build build",
34
34
  "prepack": "pnpm build",
@@ -42,39 +42,40 @@
42
42
  "lint:fix": "eslint . --fix",
43
43
  "typecheck": "vue-tsc --noEmit && nuxi typecheck playground && nuxi typecheck docs",
44
44
  "test": "vitest",
45
- "release": "release-it"
45
+ "release": "release-it --preRelease=alpha --npm.tag=next"
46
46
  },
47
47
  "dependencies": {
48
+ "@nuxt/fonts": "^0.8.0",
48
49
  "@nuxt/icon": "^1.5.1",
49
- "@nuxt/kit": "^3.13.1",
50
- "@nuxt/schema": "^3.13.1",
51
- "@nuxtjs/color-mode": "^3.4.4",
52
- "@tailwindcss/postcss": "4.0.0-alpha.22",
53
- "@tailwindcss/vite": "4.0.0-alpha.22",
54
- "@vueuse/core": "^11.0.3",
55
- "@vueuse/integrations": "^11.0.3",
50
+ "@nuxt/kit": "^3.13.2",
51
+ "@nuxt/schema": "^3.13.2",
52
+ "@nuxtjs/color-mode": "^3.5.1",
53
+ "@tailwindcss/postcss": "4.0.0-alpha.24",
54
+ "@tailwindcss/vite": "4.0.0-alpha.24",
55
+ "@vueuse/core": "^11.1.0",
56
+ "@vueuse/integrations": "^11.1.0",
56
57
  "defu": "^6.1.4",
57
58
  "fuse.js": "^7.0.0",
58
- "ohash": "^1.1.3",
59
+ "ohash": "^1.1.4",
59
60
  "radix-vue": "^1.9.5",
60
61
  "scule": "^1.3.0",
61
62
  "tailwind-variants": "^0.2.1",
62
- "tailwindcss": "4.0.0-alpha.22",
63
+ "tailwindcss": "4.0.0-alpha.24",
63
64
  "vaul-vue": "^0.2.0"
64
65
  },
65
66
  "devDependencies": {
66
- "@nuxt/eslint-config": "^0.5.5",
67
- "@nuxt/module-builder": "^0.8.3",
68
- "@nuxt/test-utils": "^3.14.1",
69
- "@release-it/conventional-changelog": "^8.0.1",
67
+ "@nuxt/eslint-config": "^0.5.7",
68
+ "@nuxt/module-builder": "^0.8.4",
69
+ "@nuxt/test-utils": "^3.14.2",
70
+ "@release-it/conventional-changelog": "^8.0.2",
70
71
  "@vue/test-utils": "^2.4.6",
71
- "eslint": "^9.9.1",
72
- "happy-dom": "^15.7.3",
72
+ "eslint": "^9.10.0",
73
+ "happy-dom": "^15.7.4",
73
74
  "joi": "^17.13.3",
74
- "nuxt": "^3.13.1",
75
+ "nuxt": "^3.13.2",
75
76
  "release-it": "^17.6.0",
76
- "valibot": "^0.41.0",
77
- "vitest": "^2.0.5",
77
+ "valibot": "^0.42.0",
78
+ "vitest": "^2.1.1",
78
79
  "vitest-environment-nuxt": "^1.0.1",
79
80
  "vue-tsc": "^2.1.6",
80
81
  "yup": "^1.4.0",
@@ -1 +0,0 @@
1
- @keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}@keyframes collapsible-up{0%{height:var(--radix-collapsible-content-height)}to{height:0}}@keyframes collapsible-down{0%{height:0}to{height:var(--radix-collapsible-content-height)}}@keyframes toast-collapsed-closed{0%{transform:var(--transform)}to{transform:translateY(calc((var(--before) - var(--height))*var(--gap))) scale(var(--scale))}}@keyframes toast-closed{0%{transform:var(--transform)}to{transform:translateY(calc((var(--offset) - var(--height))*var(--translate-factor)))}}@keyframes toast-slide-left{0%{transform:translateX(0) translateY(var(--translate))}to{transform:translateX(-100%) translateY(var(--translate))}}@keyframes toast-slide-right{0%{transform:translateX(0) translateY(var(--translate))}to{transform:translateX(100%) translateY(var(--translate))}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}@keyframes scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes scale-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)}}@keyframes slide-in-from-top{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes slide-out-to-top{0%{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes slide-in-from-right{0%{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slide-out-to-right{0%{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes slide-in-from-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slide-out-to-bottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slide-in-from-left{0%{transform:translateX(-100%)}to{transform:translateX(0)}}@keyframes slide-out-to-left{0%{transform:translateX(0)}to{transform:translateX(-100%)}}@keyframes slide-in-from-top-and-fade{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-out-to-top-and-fade{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes slide-in-from-right-and-fade{0%{opacity:0;transform:translateX(4px)}to{opacity:1;transform:translateX(0)}}@keyframes slide-out-to-right-and-fade{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(4px)}}@keyframes slide-in-from-bottom-and-fade{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-out-to-bottom-and-fade{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}@keyframes slide-in-from-left-and-fade{0%{opacity:0;transform:translateX(-4px)}to{opacity:1;transform:translateX(0)}}@keyframes slide-out-to-left-and-fade{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-4px)}}@keyframes enter-from-right{0%{opacity:0;transform:translateX(200px)}to{opacity:1;transform:translateX(0)}}@keyframes enter-from-left{0%{opacity:0;transform:translateX(-200px)}to{opacity:1;transform:translateX(0)}}@keyframes exit-to-right{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(200px)}}@keyframes exit-to-left{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-200px)}}@keyframes carousel{0%,to{width:50%}0%{transform:translateX(-100%)}to{transform:translateX(200%)}}@keyframes carousel-vertical{0%,to{height:50%}0%{transform:translateY(-100%)}to{transform:translateY(200%)}}@keyframes carousel-inverse{0%,to{width:50%}0%{transform:translateX(200%)}to{transform:translateX(-100%)}}@keyframes carousel-inverse-vertical{0%,to{height:50%}0%{transform:translateY(200%)}to{transform:translateY(-100%)}}@keyframes swing{0%,to{width:50%}0%,to{transform:translateX(-25%)}50%{transform:translateX(125%)}}@keyframes swing-vertical{0%,to{height:50%}0%,to{transform:translateY(-25%)}50%{transform:translateY(125%)}}@keyframes elastic{0%,to{margin-left:25%;width:50%}50%{margin-left:5%;width:90%}}@keyframes elastic-vertical{0%,to{height:50%;margin-top:25%}50%{height:90%;margin-top:5%}}