@nuxt/ui 4.10.0 → 4.11.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 (97) hide show
  1. package/.nuxt/ui.static.css +11 -11
  2. package/README.md +1 -0
  3. package/cli/commands/make/locale.mjs +40 -11
  4. package/cli/templates.mjs +2 -2
  5. package/dist/module.d.mts +1 -1
  6. package/dist/module.json +2 -2
  7. package/dist/module.mjs +5 -2
  8. package/dist/runtime/components/AuthForm.d.vue.ts +7 -7
  9. package/dist/runtime/components/AuthForm.vue.d.ts +7 -7
  10. package/dist/runtime/components/Button.vue +11 -2
  11. package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +2 -2
  12. package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +2 -2
  13. package/dist/runtime/components/Checkbox.d.vue.ts +1 -1
  14. package/dist/runtime/components/Checkbox.vue +12 -6
  15. package/dist/runtime/components/Checkbox.vue.d.ts +1 -1
  16. package/dist/runtime/components/CheckboxGroup.d.vue.ts +6 -0
  17. package/dist/runtime/components/CheckboxGroup.vue +10 -4
  18. package/dist/runtime/components/CheckboxGroup.vue.d.ts +6 -0
  19. package/dist/runtime/components/Editor.vue +4 -1
  20. package/dist/runtime/components/Error.d.vue.ts +1 -1
  21. package/dist/runtime/components/Error.vue.d.ts +1 -1
  22. package/dist/runtime/components/FileUpload.vue +17 -10
  23. package/dist/runtime/components/Input.vue +12 -7
  24. package/dist/runtime/components/InputDate.vue +12 -8
  25. package/dist/runtime/components/InputMenu.vue +25 -11
  26. package/dist/runtime/components/InputNumber.vue +14 -9
  27. package/dist/runtime/components/InputRating.vue +10 -7
  28. package/dist/runtime/components/InputTags.vue +12 -7
  29. package/dist/runtime/components/InputTime.vue +12 -7
  30. package/dist/runtime/components/Listbox.vue +10 -6
  31. package/dist/runtime/components/Modal.vue +12 -5
  32. package/dist/runtime/components/PinInput.vue +13 -8
  33. package/dist/runtime/components/Popover.vue +0 -1
  34. package/dist/runtime/components/PricingTable.d.vue.ts +1 -1
  35. package/dist/runtime/components/PricingTable.vue.d.ts +1 -1
  36. package/dist/runtime/components/Progress.d.vue.ts +2 -1
  37. package/dist/runtime/components/Progress.vue +5 -6
  38. package/dist/runtime/components/Progress.vue.d.ts +2 -1
  39. package/dist/runtime/components/ProgressGroup.d.vue.ts +91 -0
  40. package/dist/runtime/components/ProgressGroup.vue +99 -0
  41. package/dist/runtime/components/ProgressGroup.vue.d.ts +91 -0
  42. package/dist/runtime/components/RadioGroup.d.vue.ts +7 -1
  43. package/dist/runtime/components/RadioGroup.vue +14 -5
  44. package/dist/runtime/components/RadioGroup.vue.d.ts +7 -1
  45. package/dist/runtime/components/Select.vue +21 -8
  46. package/dist/runtime/components/SelectMenu.vue +26 -12
  47. package/dist/runtime/components/Slider.vue +14 -7
  48. package/dist/runtime/components/Splitter.d.vue.ts +266 -0
  49. package/dist/runtime/components/Splitter.vue +99 -0
  50. package/dist/runtime/components/Splitter.vue.d.ts +266 -0
  51. package/dist/runtime/components/Switch.vue +8 -4
  52. package/dist/runtime/components/Textarea.vue +17 -7
  53. package/dist/runtime/components/Theme.d.vue.ts +1 -1
  54. package/dist/runtime/components/Theme.vue +4 -3
  55. package/dist/runtime/components/Theme.vue.d.ts +1 -1
  56. package/dist/runtime/components/Tree.vue +1 -1
  57. package/dist/runtime/components/content/ContentNavigation.vue +8 -1
  58. package/dist/runtime/components/content/ContentToc.vue +4 -1
  59. package/dist/runtime/composables/useComponentProps.d.ts +1 -1
  60. package/dist/runtime/composables/useComponentProps.js +6 -0
  61. package/dist/runtime/composables/useFormField.d.ts +10 -4
  62. package/dist/runtime/composables/useFormField.js +10 -3
  63. package/dist/runtime/keyframes.css +1 -1
  64. package/dist/runtime/locale/da.js +1 -1
  65. package/dist/runtime/locale/de_at.js +7 -0
  66. package/dist/runtime/locale/de_ch.js +1 -1
  67. package/dist/runtime/locale/eu.js +1 -1
  68. package/dist/runtime/locale/fi.js +1 -1
  69. package/dist/runtime/locale/he.js +1 -1
  70. package/dist/runtime/locale/hi.js +1 -1
  71. package/dist/runtime/locale/index.d.ts +2 -1
  72. package/dist/runtime/locale/index.js +2 -1
  73. package/dist/runtime/locale/is.js +1 -1
  74. package/dist/runtime/locale/lb.js +1 -1
  75. package/dist/runtime/locale/tg.d.ts +3 -0
  76. package/dist/runtime/locale/{tj.js → tg.js} +1 -1
  77. package/dist/runtime/locale/ur.js +1 -1
  78. package/dist/runtime/types/form.d.ts +1 -1
  79. package/dist/runtime/types/html.d.ts +3 -1
  80. package/dist/runtime/types/index.d.ts +2 -0
  81. package/dist/runtime/types/index.js +2 -0
  82. package/dist/runtime/types/theme.d.ts +2 -0
  83. package/dist/runtime/types/tv.d.ts +6 -2
  84. package/dist/runtime/utils/link-keys.d.ts +1 -0
  85. package/dist/runtime/utils/link-keys.js +40 -0
  86. package/dist/runtime/utils/link.d.ts +2 -1
  87. package/dist/runtime/utils/link.js +2 -40
  88. package/dist/runtime/utils/search.js +3 -12
  89. package/dist/runtime/utils/tv.d.ts +1 -1
  90. package/dist/runtime/utils/tv.js +103 -25
  91. package/dist/runtime/vue/components/Icon.vue +5 -2
  92. package/dist/shared/{ui.XkBrgXFP.mjs → ui.DNq7CNkE.mjs} +589 -213
  93. package/dist/unplugin.d.mts +1 -1
  94. package/dist/unplugin.mjs +22 -6
  95. package/dist/vite.mjs +4 -4
  96. package/package.json +51 -50
  97. /package/dist/runtime/locale/{tj.d.ts → de_at.d.ts} +0 -0
@@ -1,15 +1,15 @@
1
1
  @theme static {
2
- --color-old-neutral-50: oklch(98.5% 0 0);
3
- --color-old-neutral-100: oklch(97% 0 0);
4
- --color-old-neutral-200: oklch(92.2% 0 0);
5
- --color-old-neutral-300: oklch(87% 0 0);
6
- --color-old-neutral-400: oklch(70.8% 0 0);
7
- --color-old-neutral-500: oklch(55.6% 0 0);
8
- --color-old-neutral-600: oklch(43.9% 0 0);
9
- --color-old-neutral-700: oklch(37.1% 0 0);
10
- --color-old-neutral-800: oklch(26.9% 0 0);
11
- --color-old-neutral-900: oklch(20.5% 0 0);
12
- --color-old-neutral-950: oklch(14.5% 0 0);
2
+ --color-old-neutral-50: oklch(98.5% 0 none);
3
+ --color-old-neutral-100: oklch(97% 0 none);
4
+ --color-old-neutral-200: oklch(92.2% 0 none);
5
+ --color-old-neutral-300: oklch(87% 0 none);
6
+ --color-old-neutral-400: oklch(70.8% 0 none);
7
+ --color-old-neutral-500: oklch(55.6% 0 none);
8
+ --color-old-neutral-600: oklch(43.9% 0 none);
9
+ --color-old-neutral-700: oklch(37.1% 0 none);
10
+ --color-old-neutral-800: oklch(26.9% 0 none);
11
+ --color-old-neutral-900: oklch(20.5% 0 none);
12
+ --color-old-neutral-950: oklch(14.5% 0 none);
13
13
  }
14
14
 
15
15
  @theme default inline {
package/README.md CHANGED
@@ -33,6 +33,7 @@ Kickstart your project with one of our ready-to-use Nuxt UI templates or follow
33
33
  - [Portfolio](https://github.com/nuxt-ui-templates/portfolio) — A sleek portfolio template to showcase your work, skills and blog powered by Nuxt Content.
34
34
  - [Changelog](https://github.com/nuxt-ui-templates/changelog) — A changelog template to display your repository releases notes from GitHub powered by Nuxt MDC.
35
35
  - [Editor](https://github.com/nuxt-ui-templates/editor) — A rich text editor template powered by TipTap with support for markdown, HTML, and JSON content types.
36
+ - [Calendar](https://github.com/nuxt-ui-templates/calendar) — An Apple Calendar-inspired template with day, week and month views, drag and drop and optimistic updates.
36
37
 
37
38
  ## Installation
38
39
 
@@ -11,16 +11,14 @@ export default defineCommand({
11
11
  },
12
12
  args: {
13
13
  code: {
14
- description: 'Locale code to create. For example: en.',
14
+ description: 'Locale code to create. For example: en or en_gb.',
15
15
  required: true
16
16
  },
17
17
  name: {
18
- description: 'Locale name to create. For example: English.',
19
- required: true
18
+ description: 'Locale name in its own language. Defaults to the CLDR name for the code.'
20
19
  },
21
20
  dir: {
22
- description: 'Locale direction. For example: rtl.',
23
- default: 'ltr'
21
+ description: 'Locale direction. Defaults to the CLDR direction for the code.'
24
22
  }
25
23
  },
26
24
  async setup({ args }) {
@@ -36,13 +34,44 @@ export default defineCommand({
36
34
  process.exit(1)
37
35
  }
38
36
 
39
- if (!['ltr', 'rtl'].includes(args.dir)) {
40
- consola.error(`🚨 Direction ${args.dir} not supported!`)
37
+ if (!args.code.match(/^[a-z]{2,3}(?:_(?:[a-z]{2}|\d{3}))?$/)) {
38
+ consola.error(`🚨 ${args.code} is not a valid locale code!\nExample: en, en_gb or es_419`)
39
+ process.exit(1)
40
+ }
41
+
42
+ const code = normalizeLocale(args.code)
43
+ const language = code.split('-')[0]
44
+
45
+ // `Intl.DisplayNames` echoes the input back when the code is unknown to CLDR
46
+ if (new Intl.DisplayNames(['en'], { type: 'language' }).of(language) === language) {
47
+ consola.error(`🚨 ${language} is not a known ISO 639 language code!\nFor example, the code for Tajik is tg, not tj.`)
48
+ process.exit(1)
49
+ }
50
+
51
+ const region = code.split('-')[1]
52
+ if (region && new Intl.DisplayNames(['en'], { type: 'region' }).of(region) === region) {
53
+ consola.error(`🚨 ${region} is not a known region code!\nExample: en_gb or pt_br`)
41
54
  process.exit(1)
42
55
  }
43
56
 
44
- if (!args.code.match(/^[a-z]{2}(?:_[a-z]{2,4})?$/)) {
45
- consola.error(`🚨 ${args.code} is not a valid locale code!\nExample: en or en_us`)
57
+ let name = args.name
58
+ if (!name) {
59
+ const cldrName = new Intl.DisplayNames([code], { type: 'language', languageDisplay: 'standard' }).of(code)
60
+ name = cldrName.charAt(0).toLocaleUpperCase(code) + cldrName.slice(1)
61
+ consola.info(`🌍 Using CLDR name for ${code}: ${name}`)
62
+ }
63
+
64
+ let dir = args.dir
65
+ if (!dir) {
66
+ const intlLocale = new Intl.Locale(code)
67
+ dir = (intlLocale.getTextInfo?.() ?? intlLocale.textInfo)?.direction ?? 'ltr'
68
+ if (dir === 'rtl') {
69
+ consola.info(`🌍 Using CLDR direction for ${code}: ${dir}`)
70
+ }
71
+ }
72
+
73
+ if (!['ltr', 'rtl'].includes(dir)) {
74
+ consola.error(`🚨 Direction ${dir} not supported!`)
46
75
  process.exit(1)
47
76
  }
48
77
 
@@ -55,8 +84,8 @@ export default defineCommand({
55
84
  await fsp.copyFile(originLocaleFilePath, newLocaleFilePath)
56
85
  const localeFile = await fsp.readFile(newLocaleFilePath, 'utf-8')
57
86
  const rewrittenLocaleFile = localeFile
58
- .replace(/name: '(.*)',/, `name: '${args.name}',`)
59
- .replace(/code: '(.*)',/, `code: '${normalizeLocale(args.code)}',${(args.dir && args.dir !== 'ltr') ? `\n dir: '${args.dir}',` : ''}`)
87
+ .replace(/name: '(.*)',/, `name: '${name}',`)
88
+ .replace(/code: '(.*)',/, `code: '${code}',${dir !== 'ltr' ? `\n dir: '${dir}',` : ''}`)
60
89
  await fsp.writeFile(newLocaleFilePath, rewrittenLocaleFile)
61
90
 
62
91
  consola.success(`🪄 Generated ${newLocaleFilePath}`)
package/cli/templates.mjs CHANGED
@@ -73,7 +73,7 @@ const props = useComponentProps('${componentKey}', _props)
73
73
  const appConfig = useAppConfig() as ${upperName}['AppConfig']
74
74
 
75
75
  // eslint-disable-next-line vue/no-dupe-keys
76
- const ui = computed(() => tv({ extend: tv(theme), ...(${appConfigLookup} || {}) })())
76
+ const ui = computed(() => tv({ extend: theme, ...(${appConfigLookup} || {}) })())
77
77
  </script>
78
78
 
79
79
  <template>
@@ -126,7 +126,7 @@ const appConfig = useAppConfig() as ${upperName}['AppConfig']
126
126
  const rootProps = useForwardProps(reactivePick(props, 'as'), emits)
127
127
 
128
128
  // eslint-disable-next-line vue/no-dupe-keys
129
- const ui = computed(() => tv({ extend: tv(theme), ...(${appConfigLookup} || {}) })())
129
+ const ui = computed(() => tv({ extend: theme, ...(${appConfigLookup} || {}) })())
130
130
  </script>
131
131
 
132
132
  <template>
package/dist/module.d.mts CHANGED
@@ -98,7 +98,7 @@ interface ModuleOptions {
98
98
  * - `string[]`: Enable detection and include additional components (useful for dynamic components)
99
99
  * @defaultValue false
100
100
  * @example true
101
- * @example ['Modal', 'Dropdown']
101
+ * @example ['Modal', 'DropdownMenu']
102
102
  */
103
103
  componentDetection?: boolean | string[];
104
104
  };
package/dist/module.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nuxt/ui",
3
- "version": "4.10.0",
3
+ "version": "4.11.0",
4
4
  "docs": "https://ui.nuxt.com/docs/getting-started/installation/nuxt",
5
5
  "configKey": "ui",
6
6
  "compatibility": {
7
7
  "nuxt": ">=4.1.0"
8
8
  },
9
9
  "builder": {
10
- "@nuxt/module-builder": "1.0.2",
10
+ "@nuxt/module-builder": "1.0.3",
11
11
  "unbuild": "3.6.1"
12
12
  }
13
13
  }
package/dist/module.mjs CHANGED
@@ -1,17 +1,20 @@
1
1
  import { defu } from 'defu';
2
2
  import { defineNuxtModule, createResolver, addPlugin, hasNuxtModule, addComponentsDir, addImportsDir, addImports } from '@nuxt/kit';
3
- import { d as defaultOptions, r as resolveColors, b as getDefaultConfig, g as getClientBundleIcons, e as publicComposables, a as addTemplates } from './shared/ui.XkBrgXFP.mjs';
3
+ import { d as defaultOptions, r as resolveColors, c as getDefaultConfig, g as getClientBundleIcons, f as publicComposables, a as addTemplates } from './shared/ui.DNq7CNkE.mjs';
4
4
  import '../dist/runtime/utils/index.js';
5
5
  import 'node:url';
6
6
  import 'scule';
7
7
  import 'knitwork';
8
8
  import 'tailwindcss/colors';
9
+ import 'node:fs';
9
10
  import 'node:fs/promises';
11
+ import 'consola';
10
12
  import 'pathe';
11
13
  import 'tinyglobby';
14
+ import 'mlly';
12
15
 
13
16
  const name = "@nuxt/ui";
14
- const version = "4.10.0";
17
+ const version = "4.11.0";
15
18
 
16
19
  const module$1 = defineNuxtModule({
17
20
  meta: {
@@ -11,7 +11,7 @@ import type { SelectMenuProps } from './SelectMenu.vue';
11
11
  import type { PinInputProps } from './PinInput.vue';
12
12
  import type { IconProps } from './Icon.vue';
13
13
  import type { LinkPropsKeys } from './Link.vue';
14
- import type { FormSchema, FormSubmitEvent, InferInput } from '../types/form';
14
+ import type { FormData, FormSchema, FormSubmitEvent, InferInput } from '../types/form';
15
15
  import type { FormHTMLAttributes } from '../types/html';
16
16
  import type { NonUnion } from '../types/utils';
17
17
  import type { ComponentConfig } from '../types/tv';
@@ -107,7 +107,7 @@ declare const _default: typeof __VLS_export;
107
107
  export default _default;
108
108
  declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
109
109
  props: import("vue").PublicProps & __VLS_PrettifyLocal<AuthFormProps<T, F> & {
110
- onSubmit?: ((payload: FormSubmitEvent<import("vue").Reactive<InferInput<T>>>) => any) | undefined;
110
+ onSubmit?: ((payload: FormSubmitEvent<import("../types").InferOutput<T>>) => any) | undefined;
111
111
  }> & (typeof globalThis extends {
112
112
  __VLS_PROPS_FALLBACK: infer P;
113
113
  } ? P : {});
@@ -119,13 +119,13 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
119
119
  silent?: false | undefined;
120
120
  nested?: boolean;
121
121
  transform?: T_1 | undefined;
122
- }): Promise<import("../types").FormData<T, T_1>>;
122
+ }): Promise<FormData<T, T_1>>;
123
123
  <T_1 extends boolean>(opts: {
124
124
  name?: keyof InferInput<T> | (keyof InferInput<T>)[] | undefined;
125
125
  silent?: true | undefined;
126
126
  nested?: boolean;
127
127
  transform?: T_1 | undefined;
128
- }): Promise<false | import("../types").FormData<T, T_1>>;
128
+ }): Promise<false | FormData<T, T_1>>;
129
129
  };
130
130
  errors: {
131
131
  id?: string | undefined;
@@ -153,13 +153,13 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
153
153
  silent?: false | undefined;
154
154
  nested?: boolean;
155
155
  transform?: T_1 | undefined;
156
- }): Promise<import("../types").FormData<T, T_1>>;
156
+ }): Promise<FormData<T, T_1>>;
157
157
  <T_1 extends boolean>(opts: {
158
158
  name?: keyof InferInput<T> | (keyof InferInput<T>)[] | undefined;
159
159
  silent?: true | undefined;
160
160
  nested?: boolean;
161
161
  transform?: T_1 | undefined;
162
- }): Promise<false | import("../types").FormData<T, T_1>>;
162
+ }): Promise<false | FormData<T, T_1>>;
163
163
  };
164
164
  errors: {
165
165
  id?: string | undefined;
@@ -185,7 +185,7 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
185
185
  }>) => void;
186
186
  attrs: any;
187
187
  slots: AuthFormSlots<import("vue").Reactive<InferInput<T>>, F>;
188
- emit: (evt: "submit", payload: FormSubmitEvent<import("vue").Reactive<InferInput<T>>>) => void;
188
+ emit: (evt: "submit", payload: FormSubmitEvent<import("../types").InferOutput<T>>) => void;
189
189
  }>) => import("vue").VNode & {
190
190
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
191
191
  };
@@ -11,7 +11,7 @@ import type { SelectMenuProps } from './SelectMenu.vue';
11
11
  import type { PinInputProps } from './PinInput.vue';
12
12
  import type { IconProps } from './Icon.vue';
13
13
  import type { LinkPropsKeys } from './Link.vue';
14
- import type { FormSchema, FormSubmitEvent, InferInput } from '../types/form';
14
+ import type { FormData, FormSchema, FormSubmitEvent, InferInput } from '../types/form';
15
15
  import type { FormHTMLAttributes } from '../types/html';
16
16
  import type { NonUnion } from '../types/utils';
17
17
  import type { ComponentConfig } from '../types/tv';
@@ -107,7 +107,7 @@ declare const _default: typeof __VLS_export;
107
107
  export default _default;
108
108
  declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
109
109
  props: import("vue").PublicProps & __VLS_PrettifyLocal<AuthFormProps<T, F> & {
110
- onSubmit?: ((payload: FormSubmitEvent<import("vue").Reactive<InferInput<T>>>) => any) | undefined;
110
+ onSubmit?: ((payload: FormSubmitEvent<import("../types").InferOutput<T>>) => any) | undefined;
111
111
  }> & (typeof globalThis extends {
112
112
  __VLS_PROPS_FALLBACK: infer P;
113
113
  } ? P : {});
@@ -119,13 +119,13 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
119
119
  silent?: false | undefined;
120
120
  nested?: boolean;
121
121
  transform?: T_1 | undefined;
122
- }): Promise<import("../types").FormData<T, T_1>>;
122
+ }): Promise<FormData<T, T_1>>;
123
123
  <T_1 extends boolean>(opts: {
124
124
  name?: keyof InferInput<T> | (keyof InferInput<T>)[] | undefined;
125
125
  silent?: true | undefined;
126
126
  nested?: boolean;
127
127
  transform?: T_1 | undefined;
128
- }): Promise<false | import("../types").FormData<T, T_1>>;
128
+ }): Promise<false | FormData<T, T_1>>;
129
129
  };
130
130
  errors: {
131
131
  id?: string | undefined;
@@ -153,13 +153,13 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
153
153
  silent?: false | undefined;
154
154
  nested?: boolean;
155
155
  transform?: T_1 | undefined;
156
- }): Promise<import("../types").FormData<T, T_1>>;
156
+ }): Promise<FormData<T, T_1>>;
157
157
  <T_1 extends boolean>(opts: {
158
158
  name?: keyof InferInput<T> | (keyof InferInput<T>)[] | undefined;
159
159
  silent?: true | undefined;
160
160
  nested?: boolean;
161
161
  transform?: T_1 | undefined;
162
- }): Promise<false | import("../types").FormData<T, T_1>>;
162
+ }): Promise<false | FormData<T, T_1>>;
163
163
  };
164
164
  errors: {
165
165
  id?: string | undefined;
@@ -185,7 +185,7 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
185
185
  }>) => void;
186
186
  attrs: any;
187
187
  slots: AuthFormSlots<import("vue").Reactive<InferInput<T>>, F>;
188
- emit: (evt: "submit", payload: FormSubmitEvent<import("vue").Reactive<InferInput<T>>>) => void;
188
+ emit: (evt: "submit", payload: FormSubmitEvent<import("../types").InferOutput<T>>) => void;
189
189
  }>) => import("vue").VNode & {
190
190
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
191
191
  };
@@ -70,6 +70,7 @@ const props = useComponentProps("button", _props);
70
70
  const appConfig = useAppConfig();
71
71
  const { orientation, size: buttonSize } = useFieldGroup(_props);
72
72
  const linkProps = useForwardProps(pickLinkProps(props));
73
+ const forwardedLinkProps = computed(() => omit(linkProps.value, ["type", "disabled", "onClick"]));
73
74
  const loadingAutoState = ref(false);
74
75
  const formLoading = inject(formLoadingInjectionKey, void 0);
75
76
  async function onClickWrapper(event) {
@@ -85,7 +86,15 @@ const isLoading = computed(() => {
85
86
  return props.loading || props.loadingAuto && (loadingAutoState.value || formLoading?.value && props.type === "submit");
86
87
  });
87
88
  const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(
88
- computed(() => ({ ...props, loading: isLoading.value }))
89
+ computed(() => ({
90
+ icon: props.icon,
91
+ leading: props.leading,
92
+ leadingIcon: props.leadingIcon,
93
+ trailing: props.trailing,
94
+ trailingIcon: props.trailingIcon,
95
+ loading: isLoading.value,
96
+ loadingIcon: props.loadingIcon
97
+ }))
89
98
  );
90
99
  const ui = computed(() => tv({
91
100
  extend: theme,
@@ -119,7 +128,7 @@ const ui = computed(() => tv({
119
128
  v-slot="{ active, ...slotProps }"
120
129
  :type="props.type"
121
130
  :disabled="props.disabled || isLoading"
122
- v-bind="omit(linkProps, ['type', 'disabled', 'onClick'])"
131
+ v-bind="forwardedLinkProps"
123
132
  custom
124
133
  >
125
134
  <ULinkBase
@@ -82,11 +82,11 @@ export interface ChatPromptSubmitEmits {
82
82
  declare const _default: typeof __VLS_export;
83
83
  export default _default;
84
84
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChatPromptSubmitProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
85
- stop: (event: MouseEvent) => any;
86
85
  reload: (event: MouseEvent) => any;
86
+ stop: (event: MouseEvent) => any;
87
87
  }, string, import("vue").PublicProps, Readonly<ChatPromptSubmitProps> & Readonly<{
88
- onStop?: ((event: MouseEvent) => any) | undefined;
89
88
  onReload?: ((event: MouseEvent) => any) | undefined;
89
+ onStop?: ((event: MouseEvent) => any) | undefined;
90
90
  }>, {
91
91
  status: ChatStatus;
92
92
  streamingColor: "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral";
@@ -82,11 +82,11 @@ export interface ChatPromptSubmitEmits {
82
82
  declare const _default: typeof __VLS_export;
83
83
  export default _default;
84
84
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChatPromptSubmitProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
85
- stop: (event: MouseEvent) => any;
86
85
  reload: (event: MouseEvent) => any;
86
+ stop: (event: MouseEvent) => any;
87
87
  }, string, import("vue").PublicProps, Readonly<ChatPromptSubmitProps> & Readonly<{
88
- onStop?: ((event: MouseEvent) => any) | undefined;
89
88
  onReload?: ((event: MouseEvent) => any) | undefined;
89
+ onStop?: ((event: MouseEvent) => any) | undefined;
90
90
  }>, {
91
91
  status: ChatStatus;
92
92
  streamingColor: "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral";
@@ -34,7 +34,7 @@ export interface CheckboxProps<T = boolean> extends Pick<CheckboxRootProps<T>, '
34
34
  /** Highlight the ring color like a focus state. */
35
35
  highlight?: boolean;
36
36
  /**
37
- * The icon displayed when checked.
37
+ * The icon displayed when checked, or above the label when `indicator` is `hidden`.
38
38
  * @defaultValue appConfig.ui.icons.check
39
39
  * @IconifyIcon
40
40
  */
@@ -41,19 +41,24 @@ const emits = defineEmits(["change", "update:modelValue"]);
41
41
  const props = useComponentProps("checkbox", _props);
42
42
  const appConfig = useAppConfig();
43
43
  const rootProps = useForwardProps(reactivePick(props, "required", "value", "defaultValue", "modelValue", "trueValue", "falseValue"), emits);
44
- const { id: _id, emitFormChange, emitFormInput, size, color, highlight, name, disabled, ariaAttrs } = useFormField(_props);
44
+ const { id: _id, emitFormChange, emitFormInput, size: formFieldSize, color: formFieldColor, highlight: formFieldHighlight, name, disabled: formFieldDisabled, ariaAttrs } = useFormField(_props);
45
45
  const id = _id.value ?? useId();
46
+ const color = computed(() => formFieldColor.value ?? props.color);
47
+ const highlight = computed(() => formFieldHighlight.value ?? props.highlight);
48
+ const size = computed(() => formFieldSize.value ?? props.size);
49
+ const disabled = computed(() => formFieldDisabled.value ?? props.disabled);
50
+ const labelIcon = computed(() => props.indicator === "hidden" ? props.icon : void 0);
46
51
  const attrs = useAttrs();
47
52
  const forwardedAttrs = computed(() => {
48
53
  const { "data-state": _, ...rest } = attrs;
49
54
  return rest;
50
55
  });
51
56
  const ui = computed(() => tv({ extend: theme, ...appConfig.ui?.checkbox || {} })({
52
- size: size.value ?? props.size,
53
- color: color.value ?? props.color,
57
+ size: size.value,
58
+ color: color.value,
54
59
  variant: props.variant,
55
60
  indicator: props.indicator,
56
- highlight: highlight.value ?? props.highlight,
61
+ highlight: highlight.value,
57
62
  required: props.required,
58
63
  disabled: disabled.value
59
64
  }));
@@ -78,7 +83,7 @@ function onUpdate(value) {
78
83
  @update:model-value="onUpdate"
79
84
  >
80
85
  <template #default="{ state }">
81
- <CheckboxIndicator data-slot="indicator" :class="ui.indicator({ class: props.ui?.indicator })">
86
+ <CheckboxIndicator v-if="props.indicator !== 'hidden'" data-slot="indicator" :class="ui.indicator({ class: props.ui?.indicator })">
82
87
  <UIcon v-if="state === 'indeterminate'" :name="props.indeterminateIcon || appConfig.ui.icons.minus" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
83
88
  <UIcon v-else :name="props.icon || appConfig.ui.icons.check" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
84
89
  </CheckboxIndicator>
@@ -86,7 +91,8 @@ function onUpdate(value) {
86
91
  </CheckboxRoot>
87
92
  </div>
88
93
 
89
- <div v-if="props.label || !!slots.label || (props.description || !!slots.description)" data-slot="wrapper" :class="ui.wrapper({ class: props.ui?.wrapper })">
94
+ <div v-if="labelIcon || (props.label || !!slots.label) || (props.description || !!slots.description)" data-slot="wrapper" :class="ui.wrapper({ class: props.ui?.wrapper })">
95
+ <UIcon v-if="labelIcon" :name="labelIcon" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
90
96
  <component :is="!props.variant || props.variant === 'list' ? Label : 'p'" v-if="props.label || !!slots.label" :for="id" data-slot="label" :class="ui.label({ class: props.ui?.label })">
91
97
  <slot name="label" :label="props.label">
92
98
  {{ props.label }}
@@ -34,7 +34,7 @@ export interface CheckboxProps<T = boolean> extends Pick<CheckboxRootProps<T>, '
34
34
  /** Highlight the ring color like a focus state. */
35
35
  highlight?: boolean;
36
36
  /**
37
- * The icon displayed when checked.
37
+ * The icon displayed when checked, or above the label when `indicator` is `hidden`.
38
38
  * @defaultValue appConfig.ui.icons.check
39
39
  * @IconifyIcon
40
40
  */
@@ -3,6 +3,7 @@ import type { VNode } from 'vue';
3
3
  import type { AppConfig } from '@nuxt/schema';
4
4
  import theme from '#build/ui/checkbox-group';
5
5
  import type { CheckboxProps } from './Checkbox.vue';
6
+ import type { IconProps } from './Icon.vue';
6
7
  import type { AcceptableValue, GetItemKeys, GetModelValue, GetModelValueEmits } from '../types/utils';
7
8
  import type { ComponentConfig } from '../types/tv';
8
9
  type CheckboxGroup = ComponentConfig<typeof theme, AppConfig, 'checkboxGroup'>;
@@ -12,6 +13,11 @@ export type CheckboxGroupItem = CheckboxGroupValue | {
12
13
  description?: string;
13
14
  disabled?: boolean;
14
15
  value?: string;
16
+ /**
17
+ * The icon displayed when checked, or above the label when `indicator` is `hidden`.
18
+ * @IconifyIcon
19
+ */
20
+ icon?: IconProps['name'];
15
21
  class?: any;
16
22
  ui?: Pick<CheckboxGroup['slots'], 'item'> & Omit<Required<CheckboxProps>['ui'], 'root'>;
17
23
  [key: string]: any;
@@ -41,16 +41,21 @@ const slots = defineSlots();
41
41
  const props = useComponentProps("checkboxGroup", _props);
42
42
  const appConfig = useAppConfig();
43
43
  const rootProps = useForwardProps(reactivePick(props, "as", "modelValue", "defaultValue", "orientation", "loop", "required"), emits);
44
- const checkboxProps = useForwardProps(reactivePick(props, "variant", "indicator", "icon"));
44
+ const checkboxProps = useForwardProps(reactivePick(props, "variant", "indicator"));
45
45
  const getProxySlots = () => omit(slots, ["legend"]);
46
- const { emitFormChange, emitFormInput, color, highlight, name, size, id: _id, disabled, ariaAttrs } = useFormField(_props, { bind: false });
46
+ const { emitFormChange, emitFormInput, color: formFieldColor, highlight: formFieldHighlight, name, size: formFieldSize, id: _id, disabled: formFieldDisabled, ariaAttrs } = useFormField(_props, { bind: false });
47
47
  const id = _id.value ?? useId();
48
+ const color = computed(() => formFieldColor.value ?? props.color);
49
+ const size = computed(() => formFieldSize.value ?? props.size);
50
+ const highlight = computed(() => formFieldHighlight.value ?? props.highlight);
51
+ const disabled = computed(() => formFieldDisabled.value ?? props.disabled);
48
52
  const ui = computed(() => tv({ extend: theme, ...appConfig.ui?.checkboxGroup || {} })({
49
- size: size.value ?? props.size,
53
+ size: size.value,
50
54
  required: props.required,
51
55
  orientation: props.orientation,
52
- color: color.value ?? props.color,
56
+ color: color.value,
53
57
  variant: props.variant,
58
+ highlight: highlight.value,
54
59
  disabled: disabled.value
55
60
  }));
56
61
  function normalizeItem(item) {
@@ -114,6 +119,7 @@ function onUpdate(value) {
114
119
  v-for="item in normalizedItems"
115
120
  :key="item.value"
116
121
  v-bind="{ ...item, ...checkboxProps }"
122
+ :icon="item.icon ?? props.icon"
117
123
  :color="color"
118
124
  :highlight="highlight"
119
125
  :size="size"
@@ -3,6 +3,7 @@ import type { VNode } from 'vue';
3
3
  import type { AppConfig } from '@nuxt/schema';
4
4
  import theme from '#build/ui/checkbox-group';
5
5
  import type { CheckboxProps } from './Checkbox.vue';
6
+ import type { IconProps } from './Icon.vue';
6
7
  import type { AcceptableValue, GetItemKeys, GetModelValue, GetModelValueEmits } from '../types/utils';
7
8
  import type { ComponentConfig } from '../types/tv';
8
9
  type CheckboxGroup = ComponentConfig<typeof theme, AppConfig, 'checkboxGroup'>;
@@ -12,6 +13,11 @@ export type CheckboxGroupItem = CheckboxGroupValue | {
12
13
  description?: string;
13
14
  disabled?: boolean;
14
15
  value?: string;
16
+ /**
17
+ * The icon displayed when checked, or above the label when `indicator` is `hidden`.
18
+ * @IconifyIcon
19
+ */
20
+ icon?: IconProps['name'];
15
21
  class?: any;
16
22
  ui?: Pick<CheckboxGroup['slots'], 'item'> & Omit<Required<CheckboxProps>['ui'], 'root'>;
17
23
  [key: string]: any;
@@ -177,7 +177,10 @@ const editor = useEditor({
177
177
  editor2.view.dispatch(editor2.state.tr);
178
178
  }
179
179
  },
180
- onUpdate: ({ editor: editor2 }) => {
180
+ onUpdate: ({ editor: editor2, transaction, appendedTransactions }) => {
181
+ if (!transaction.docChanged && !appendedTransactions.some((tr) => tr.docChanged)) {
182
+ return;
183
+ }
181
184
  let value;
182
185
  try {
183
186
  if (contentType.value === "html") {
@@ -47,9 +47,9 @@ export interface ErrorSlots {
47
47
  declare const _default: typeof __VLS_export;
48
48
  export default _default;
49
49
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ErrorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ErrorProps> & Readonly<{}>, {
50
+ redirect: string;
50
51
  clear: boolean | ButtonProps;
51
52
  as: any;
52
- redirect: string;
53
53
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ErrorSlots>;
54
54
  type __VLS_WithSlots<T, S> = T & {
55
55
  new (): {
@@ -47,9 +47,9 @@ export interface ErrorSlots {
47
47
  declare const _default: typeof __VLS_export;
48
48
  export default _default;
49
49
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ErrorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ErrorProps> & Readonly<{}>, {
50
+ redirect: string;
50
51
  clear: boolean | ButtonProps;
51
52
  as: any;
52
- redirect: string;
53
53
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ErrorSlots>;
54
54
  type __VLS_WithSlots<T, S> = T & {
55
55
  new (): {
@@ -59,7 +59,11 @@ const { isDragging, open, inputRef, dropzoneRef } = useFileUpload({
59
59
  dropzone: props.dropzone,
60
60
  onUpdate
61
61
  });
62
- const { emitFormInput, emitFormChange, id, name, color, highlight, disabled, ariaAttrs } = useFormField(_props);
62
+ const { emitFormInput, emitFormChange, id, name, size: formFieldSize, color: formFieldColor, highlight: formFieldHighlight, disabled: formFieldDisabled, ariaAttrs } = useFormField(_props);
63
+ const color = computed(() => formFieldColor.value ?? props.color);
64
+ const highlight = computed(() => formFieldHighlight.value ?? props.highlight);
65
+ const size = computed(() => formFieldSize.value ?? props.size);
66
+ const disabled = computed(() => formFieldDisabled.value ?? props.disabled);
63
67
  const variant = computed(() => props.multiple ? "area" : props.variant);
64
68
  const layout = computed(() => props.variant === "button" && !props.multiple ? "grid" : props.layout);
65
69
  const position = computed(() => {
@@ -74,14 +78,14 @@ const position = computed(() => {
74
78
  const ui = computed(() => tv({ extend: theme, ...appConfig.ui?.fileUpload || {} })({
75
79
  dropzone: props.dropzone,
76
80
  interactive: props.interactive,
77
- color: color.value ?? props.color,
78
- size: props.size,
81
+ color: color.value,
82
+ size: size.value,
79
83
  variant: variant.value,
80
84
  layout: layout.value,
81
85
  position: position.value,
82
86
  multiple: props.multiple,
83
- highlight: highlight.value ?? props.highlight,
84
- disabled: props.disabled
87
+ highlight: highlight.value,
88
+ disabled: disabled.value
85
89
  }));
86
90
  function createObjectUrl(file) {
87
91
  if (!props.fileImage) return void 0;
@@ -94,11 +98,14 @@ function formatFileSize(bytes) {
94
98
  const k = 1024;
95
99
  const sizes = ["B", "KB", "MB", "GB"];
96
100
  const i = Math.floor(Math.log(bytes) / Math.log(k));
97
- const size = bytes / Math.pow(k, i);
98
- const formattedSize = i === 0 ? size.toString() : size.toFixed(0);
101
+ const value = bytes / Math.pow(k, i);
102
+ const formattedSize = i === 0 ? value.toString() : value.toFixed(0);
99
103
  return `${formattedSize}${sizes[i]}`;
100
104
  }
101
105
  function onUpdate(files, reset2 = false) {
106
+ if (disabled.value) {
107
+ return;
108
+ }
102
109
  if (props.multiple) {
103
110
  if (reset2) {
104
111
  modelValue.value = files;
@@ -154,7 +161,7 @@ defineExpose({
154
161
  :as="{ img: 'img' }"
155
162
  :src="createObjectUrl(file)"
156
163
  :icon="props.fileIcon || appConfig.ui.icons.file"
157
- :size="props.size"
164
+ :size="size"
158
165
  data-slot="fileLeadingAvatar"
159
166
  :class="ui.fileLeadingAvatar({ class: props.ui?.fileLeadingAvatar })"
160
167
  />
@@ -184,7 +191,7 @@ defineExpose({
184
191
  size: 'xs'
185
192
  } : {
186
193
  variant: 'link',
187
- size: props.size
194
+ size
188
195
  },
189
196
  ...typeof props.fileDelete === 'object' ? props.fileDelete : void 0
190
197
  }"
@@ -227,7 +234,7 @@ defineExpose({
227
234
  <slot name="leading" :ui="ui">
228
235
  <template v-if="props.icon !== false">
229
236
  <UIcon v-if="variant === 'button'" :name="props.icon ?? appConfig.ui.icons.upload" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
230
- <UAvatar v-else :icon="props.icon ?? appConfig.ui.icons.upload" :size="props.size" data-slot="avatar" :class="ui.avatar({ class: props.ui?.avatar })" />
237
+ <UAvatar v-else :icon="props.icon ?? appConfig.ui.icons.upload" :size="size" data-slot="avatar" :class="ui.avatar({ class: props.ui?.avatar })" />
231
238
  </template>
232
239
  </slot>
233
240