@nuxt/ui 3.0.0-beta.3 → 3.0.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.
- package/README.md +1 -1
- package/dist/module.cjs +2 -2
- package/dist/module.json +2 -2
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/App.vue +6 -6
- package/dist/runtime/components/Button.vue +1 -0
- package/dist/runtime/components/Form.vue +6 -6
- package/dist/runtime/components/FormField.vue +1 -1
- package/dist/runtime/components/Input.vue +7 -3
- package/dist/runtime/components/LinkBase.vue +4 -2
- package/dist/runtime/components/Pagination.vue +1 -2
- package/dist/runtime/components/Textarea.vue +7 -3
- package/dist/runtime/composables/defineLocale.d.ts +4 -4
- package/dist/runtime/composables/useLocale.d.ts +3 -3
- package/dist/runtime/composables/useLocale.js +3 -3
- package/dist/runtime/locale/ar.d.ts +2 -1
- package/dist/runtime/locale/az.d.ts +2 -1
- package/dist/runtime/locale/bn.d.ts +2 -1
- package/dist/runtime/locale/cs.d.ts +2 -1
- package/dist/runtime/locale/da.d.ts +2 -1
- package/dist/runtime/locale/de.d.ts +2 -1
- package/dist/runtime/locale/el.d.ts +2 -1
- package/dist/runtime/locale/en.d.ts +2 -1
- package/dist/runtime/locale/es.d.ts +2 -1
- package/dist/runtime/locale/et.d.ts +2 -1
- package/dist/runtime/locale/fa_ir.d.ts +2 -1
- package/dist/runtime/locale/fi.d.ts +2 -1
- package/dist/runtime/locale/fr.d.ts +2 -1
- package/dist/runtime/locale/he.d.ts +2 -1
- package/dist/runtime/locale/hi.d.ts +2 -1
- package/dist/runtime/locale/hu.d.ts +2 -1
- package/dist/runtime/locale/id.d.ts +2 -1
- package/dist/runtime/locale/index.d.ts +3 -2
- package/dist/runtime/locale/index.js +3 -2
- package/dist/runtime/locale/it.d.ts +2 -1
- package/dist/runtime/locale/ja.d.ts +2 -1
- package/dist/runtime/locale/km.d.ts +2 -1
- package/dist/runtime/locale/ko.d.ts +2 -1
- package/dist/runtime/locale/nb_no.d.ts +2 -1
- package/dist/runtime/locale/nl.d.ts +2 -1
- package/dist/runtime/locale/pl.d.ts +2 -1
- package/dist/runtime/locale/pt.d.ts +2 -1
- package/dist/runtime/locale/pt_br.d.ts +2 -1
- package/dist/runtime/locale/ru.d.ts +2 -1
- package/dist/runtime/locale/sk.d.ts +2 -1
- package/dist/runtime/locale/sv.d.ts +2 -1
- package/dist/runtime/locale/th.d.ts +2 -1
- package/dist/runtime/locale/tr.d.ts +2 -1
- package/dist/runtime/locale/uk.d.ts +2 -1
- package/dist/runtime/locale/vi.d.ts +2 -1
- package/dist/runtime/locale/zh_cn.d.ts +2 -1
- package/dist/runtime/locale/zh_tw.d.ts +2 -1
- package/dist/runtime/plugins/colors.js +3 -1
- package/dist/runtime/types/form.d.ts +1 -1
- package/dist/runtime/types/locale.d.ts +2 -2
- package/dist/runtime/utils/locale.d.ts +5 -5
- package/dist/runtime/utils/tv.d.ts +1 -1
- package/dist/runtime/vue/plugins/head.d.ts +1 -1
- package/dist/runtime/vue/plugins/head.js +4 -3
- package/dist/runtime/vue/stubs.d.ts +2 -0
- package/dist/runtime/vue/stubs.js +2 -0
- package/dist/shared/{ui.DG2iA__L.cjs → ui.COBs1u5H.cjs} +6 -2
- package/dist/shared/{ui.S-Be5Oao.mjs → ui.yjbGE7Dx.mjs} +6 -2
- package/dist/unplugin.cjs +1 -1
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +24 -25
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
We're thrilled to introduce Nuxt UI v3, a significant upgrade to our UI library that delivers extensive improvements and robust new capabilities. This major update harnesses the combined strengths of [Reka UI](https://reka-ui.com/), [Tailwind CSS v4](https://tailwindcss.com/), and [Tailwind Variants](https://www.tailwind-variants.org/) to offer developers an unparalleled set of tools for creating sophisticated, accessible, and highly performant user interfaces.
|
|
15
15
|
|
|
16
16
|
> [!NOTE]
|
|
17
|
-
> You are on the `v3` development branch, check out the [
|
|
17
|
+
> You are on the `v3` development branch, check out the [v2 branch](https://github.com/nuxt/ui/tree/v2) for Nuxt UI v2.
|
|
18
18
|
|
|
19
19
|
## Documentation
|
|
20
20
|
|
package/dist/module.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const defu = require('defu');
|
|
4
4
|
const kit = require('@nuxt/kit');
|
|
5
|
-
const templates = require('./shared/ui.
|
|
5
|
+
const templates = require('./shared/ui.COBs1u5H.cjs');
|
|
6
6
|
require('../dist/runtime/utils/index.js');
|
|
7
7
|
require('node:url');
|
|
8
8
|
require('scule');
|
|
@@ -14,7 +14,7 @@ const module$1 = kit.defineNuxtModule({
|
|
|
14
14
|
name: "ui",
|
|
15
15
|
configKey: "ui",
|
|
16
16
|
compatibility: {
|
|
17
|
-
nuxt: ">=3.
|
|
17
|
+
nuxt: ">=3.16.0"
|
|
18
18
|
},
|
|
19
19
|
docs: "https://ui3.nuxt.dev/getting-started/installation/nuxt"
|
|
20
20
|
},
|
package/dist/module.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"name": "ui",
|
|
3
3
|
"configKey": "ui",
|
|
4
4
|
"compatibility": {
|
|
5
|
-
"nuxt": ">=3.
|
|
5
|
+
"nuxt": ">=3.16.0"
|
|
6
6
|
},
|
|
7
7
|
"docs": "https://ui3.nuxt.dev/getting-started/installation/nuxt",
|
|
8
|
-
"version": "3.0.0
|
|
8
|
+
"version": "3.0.0",
|
|
9
9
|
"builder": {
|
|
10
10
|
"@nuxt/module-builder": "0.8.4",
|
|
11
11
|
"unbuild": "2.0.0"
|
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defu } from 'defu';
|
|
2
2
|
import { defineNuxtModule, createResolver, addVitePlugin, addPlugin, addComponentsDir, addImportsDir, hasNuxtModule, installModule } from '@nuxt/kit';
|
|
3
|
-
import { d as defaultOptions, r as resolveColors, a as getDefaultUiConfig, b as addTemplates } from './shared/ui.
|
|
3
|
+
import { d as defaultOptions, r as resolveColors, a as getDefaultUiConfig, b as addTemplates } from './shared/ui.yjbGE7Dx.mjs';
|
|
4
4
|
import '../dist/runtime/utils/index.js';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import 'scule';
|
|
@@ -11,7 +11,7 @@ const module = defineNuxtModule({
|
|
|
11
11
|
name: "ui",
|
|
12
12
|
configKey: "ui",
|
|
13
13
|
compatibility: {
|
|
14
|
-
nuxt: ">=3.
|
|
14
|
+
nuxt: ">=3.16.0"
|
|
15
15
|
},
|
|
16
16
|
docs: "https://ui3.nuxt.dev/getting-started/installation/nuxt"
|
|
17
17
|
},
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { ConfigProviderProps, TooltipProviderProps } from 'reka-ui'
|
|
3
|
-
import {
|
|
4
|
-
import type { ToasterProps, Locale } from '../types'
|
|
3
|
+
import type { ToasterProps, Locale, Messages } from '../types'
|
|
5
4
|
|
|
6
|
-
export interface AppProps extends Omit<ConfigProviderProps, 'useId' | 'dir' | 'locale'> {
|
|
5
|
+
export interface AppProps<T extends Messages = Messages> extends Omit<ConfigProviderProps, 'useId' | 'dir' | 'locale'> {
|
|
7
6
|
tooltip?: TooltipProviderProps
|
|
8
7
|
toaster?: ToasterProps | null
|
|
9
|
-
locale?: Locale
|
|
8
|
+
locale?: Locale<T>
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
export interface AppSlots {
|
|
@@ -18,14 +17,15 @@ export default {
|
|
|
18
17
|
}
|
|
19
18
|
</script>
|
|
20
19
|
|
|
21
|
-
<script setup lang="ts">
|
|
20
|
+
<script setup lang="ts" generic="T extends Messages = Messages">
|
|
22
21
|
import { toRef, useId, provide } from 'vue'
|
|
23
22
|
import { ConfigProvider, TooltipProvider, useForwardProps } from 'reka-ui'
|
|
24
23
|
import { reactivePick } from '@vueuse/core'
|
|
24
|
+
import { localeContextInjectionKey } from '../composables/useLocale'
|
|
25
25
|
import UToaster from './Toaster.vue'
|
|
26
26
|
import UOverlayProvider from './OverlayProvider.vue'
|
|
27
27
|
|
|
28
|
-
const props = defineProps<AppProps
|
|
28
|
+
const props = defineProps<AppProps<T>>()
|
|
29
29
|
defineSlots<AppSlots>()
|
|
30
30
|
|
|
31
31
|
const configProviderProps = useForwardProps(reactivePick(props, 'scrollBody'))
|
|
@@ -60,6 +60,7 @@ import { pickLinkProps } from '../utils/link'
|
|
|
60
60
|
import UIcon from './Icon.vue'
|
|
61
61
|
import UAvatar from './Avatar.vue'
|
|
62
62
|
import ULink from './Link.vue'
|
|
63
|
+
import ULinkBase from './LinkBase.vue'
|
|
63
64
|
|
|
64
65
|
const props = withDefaults(defineProps<ButtonProps>(), {
|
|
65
66
|
active: undefined,
|
|
@@ -29,7 +29,7 @@ export interface FormEmits<T extends object> {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export interface FormSlots {
|
|
32
|
-
default(props?: {}): any
|
|
32
|
+
default(props?: { errors: FormError[] }): any
|
|
33
33
|
}
|
|
34
34
|
</script>
|
|
35
35
|
|
|
@@ -69,7 +69,7 @@ onMounted(async () => {
|
|
|
69
69
|
nestedForms.value.set(event.formId, { validate: event.validate })
|
|
70
70
|
} else if (event.type === 'detach') {
|
|
71
71
|
nestedForms.value.delete(event.formId)
|
|
72
|
-
} else if (props.validateOn?.includes(event.type)) {
|
|
72
|
+
} else if (props.validateOn?.includes(event.type) && !loading.value) {
|
|
73
73
|
if (event.type !== 'input') {
|
|
74
74
|
await _validate({ name: event.name, silent: true, nested: false })
|
|
75
75
|
} else if (event.eager || blurredFields.has(event.name)) {
|
|
@@ -121,7 +121,7 @@ const blurredFields = new Set<keyof T>()
|
|
|
121
121
|
function resolveErrorIds(errs: FormError[]): FormErrorWithId[] {
|
|
122
122
|
return errs.map(err => ({
|
|
123
123
|
...err,
|
|
124
|
-
id: inputs.value[err.name]?.id
|
|
124
|
+
id: err?.name ? inputs.value[err.name]?.id : undefined
|
|
125
125
|
}))
|
|
126
126
|
}
|
|
127
127
|
|
|
@@ -159,12 +159,12 @@ async function _validate(opts: { name?: keyof T | (keyof T)[], silent?: boolean,
|
|
|
159
159
|
if (names) {
|
|
160
160
|
const otherErrors = errors.value.filter(error => !names.some((name) => {
|
|
161
161
|
const pattern = inputs.value?.[name]?.pattern
|
|
162
|
-
return name === error.name || (pattern && error.name
|
|
162
|
+
return name === error.name || (pattern && error.name?.match(pattern))
|
|
163
163
|
}))
|
|
164
164
|
|
|
165
165
|
const pathErrors = (await getErrors()).filter(error => names.some((name) => {
|
|
166
166
|
const pattern = inputs.value?.[name]?.pattern
|
|
167
|
-
return name === error.name || (pattern && error.name
|
|
167
|
+
return name === error.name || (pattern && error.name?.match(pattern))
|
|
168
168
|
}))
|
|
169
169
|
|
|
170
170
|
errors.value = otherErrors.concat(pathErrors)
|
|
@@ -269,6 +269,6 @@ defineExpose<Form<T>>({
|
|
|
269
269
|
:class="form({ class: props.class })"
|
|
270
270
|
@submit.prevent="onSubmitWrapper"
|
|
271
271
|
>
|
|
272
|
-
<slot />
|
|
272
|
+
<slot :errors="errors" />
|
|
273
273
|
</component>
|
|
274
274
|
</template>
|
|
@@ -63,7 +63,7 @@ const ui = computed(() => formField({
|
|
|
63
63
|
|
|
64
64
|
const formErrors = inject<Ref<FormError[]> | null>('form-errors', null)
|
|
65
65
|
|
|
66
|
-
const error = computed(() => props.error || formErrors?.value?.find(error => error.name === props.name || (props.errorPattern && error.name.match(props.errorPattern)))?.message)
|
|
66
|
+
const error = computed(() => props.error || formErrors?.value?.find(error => error.name && (error.name === props.name || (props.errorPattern && error.name.match(props.errorPattern))))?.message)
|
|
67
67
|
|
|
68
68
|
const id = ref(useId())
|
|
69
69
|
// Copies id's initial value to bind aria-attributes such as aria-describedby.
|
|
@@ -82,7 +82,7 @@ const props = withDefaults(defineProps<InputProps>(), {
|
|
|
82
82
|
const emits = defineEmits<InputEmits>()
|
|
83
83
|
const slots = defineSlots<InputSlots>()
|
|
84
84
|
|
|
85
|
-
const [modelValue, modelModifiers] = defineModel<string | number>()
|
|
85
|
+
const [modelValue, modelModifiers] = defineModel<string | number | null>()
|
|
86
86
|
|
|
87
87
|
const { emitFormBlur, emitFormInput, emitFormChange, size: formGroupSize, color, id, name, highlight, disabled, emitFormFocus, ariaAttrs } = useFormField<InputProps>(props, { deferInputValidation: true })
|
|
88
88
|
const { orientation, size: buttonGroupSize } = useButtonGroup<InputProps>(props)
|
|
@@ -111,15 +111,19 @@ function autoFocus() {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
// Custom function to handle the v-model properties
|
|
114
|
-
function updateInput(value: string) {
|
|
114
|
+
function updateInput(value: string | null) {
|
|
115
115
|
if (modelModifiers.trim) {
|
|
116
|
-
value = value
|
|
116
|
+
value = value?.trim() ?? null
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
if (modelModifiers.number || props.type === 'number') {
|
|
120
120
|
value = looseToNumber(value)
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
if (modelModifiers.nullify) {
|
|
124
|
+
value ||= null
|
|
125
|
+
}
|
|
126
|
+
|
|
123
127
|
modelValue.value = value
|
|
124
128
|
emitFormInput()
|
|
125
129
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { LinkProps } from '../types'
|
|
3
|
+
|
|
2
4
|
export interface LinkBaseProps {
|
|
3
5
|
as?: string
|
|
4
6
|
type?: string
|
|
@@ -6,8 +8,8 @@ export interface LinkBaseProps {
|
|
|
6
8
|
onClick?: ((e: MouseEvent) => void | Promise<void>) | Array<((e: MouseEvent) => void | Promise<void>)>
|
|
7
9
|
href?: string
|
|
8
10
|
navigate?: (e: MouseEvent) => void
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
target?: LinkProps['target']
|
|
12
|
+
rel?: LinkProps['rel']
|
|
11
13
|
isExternal?: boolean
|
|
12
14
|
}
|
|
13
15
|
</script>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { PaginationRootProps, PaginationRootEmits } from 'reka-ui'
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema'
|
|
4
|
-
import type { RouteLocationRaw } from '#vue-router'
|
|
5
4
|
import _appConfig from '#build/app.config'
|
|
6
5
|
import theme from '#build/ui/pagination'
|
|
7
6
|
import { tv } from '../utils/tv'
|
|
@@ -78,7 +77,7 @@ export interface PaginationProps extends Partial<Pick<PaginationRootProps, 'defa
|
|
|
78
77
|
* A function to render page controls as links.
|
|
79
78
|
* @param page The page number to navigate to.
|
|
80
79
|
*/
|
|
81
|
-
to?: (page: number) =>
|
|
80
|
+
to?: (page: number) => ButtonProps['to']
|
|
82
81
|
class?: any
|
|
83
82
|
ui?: Partial<typeof pagination.slots>
|
|
84
83
|
}
|
|
@@ -74,7 +74,7 @@ const props = withDefaults(defineProps<TextareaProps>(), {
|
|
|
74
74
|
defineSlots<TextareaSlots>()
|
|
75
75
|
const emits = defineEmits<TextareaEmits>()
|
|
76
76
|
|
|
77
|
-
const [modelValue, modelModifiers] = defineModel<string | number>()
|
|
77
|
+
const [modelValue, modelModifiers] = defineModel<string | number | null>()
|
|
78
78
|
|
|
79
79
|
const { emitFormFocus, emitFormBlur, emitFormInput, emitFormChange, size, color, id, name, highlight, disabled, ariaAttrs } = useFormField<TextareaProps>(props, { deferInputValidation: true })
|
|
80
80
|
|
|
@@ -94,15 +94,19 @@ function autoFocus() {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
// Custom function to handle the v-model properties
|
|
97
|
-
function updateInput(value: string) {
|
|
97
|
+
function updateInput(value: string | null) {
|
|
98
98
|
if (modelModifiers.trim) {
|
|
99
|
-
value = value
|
|
99
|
+
value = value?.trim() ?? null
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
if (modelModifiers.number) {
|
|
103
103
|
value = looseToNumber(value)
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
if (modelModifiers.nullify) {
|
|
107
|
+
value ||= null
|
|
108
|
+
}
|
|
109
|
+
|
|
106
110
|
modelValue.value = value
|
|
107
111
|
emitFormInput()
|
|
108
112
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Locale, Direction
|
|
2
|
-
interface DefineLocaleOptions {
|
|
1
|
+
import type { Locale, Direction } from '../types/locale';
|
|
2
|
+
interface DefineLocaleOptions<M> {
|
|
3
3
|
name: string;
|
|
4
4
|
code: string;
|
|
5
5
|
dir?: Direction;
|
|
6
|
-
messages:
|
|
6
|
+
messages: M;
|
|
7
7
|
}
|
|
8
|
-
export declare function defineLocale(options: DefineLocaleOptions): Locale
|
|
8
|
+
export declare function defineLocale<M>(options: DefineLocaleOptions<M>): Locale<M>;
|
|
9
9
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
-
import type { Locale } from '../types/locale';
|
|
3
|
-
export declare const localeContextInjectionKey: InjectionKey<Ref<Locale | undefined>>;
|
|
4
|
-
export declare const useLocale: (localeOverrides?: Ref<Locale | undefined>) => import("../utils/locale").LocaleContext
|
|
2
|
+
import type { Locale, Messages } from '../types/locale';
|
|
3
|
+
export declare const localeContextInjectionKey: InjectionKey<Ref<Locale<unknown> | undefined>>;
|
|
4
|
+
export declare const useLocale: (localeOverrides?: Ref<Locale<Messages> | undefined>) => import("../utils/locale").LocaleContext<Messages>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { computed, inject,
|
|
1
|
+
import { computed, inject, toRef } from "vue";
|
|
2
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
2
3
|
import { buildLocaleContext } from "../utils/locale.js";
|
|
3
4
|
import en from "../locale/en.js";
|
|
4
|
-
import { createSharedComposable } from "@vueuse/core";
|
|
5
5
|
export const localeContextInjectionKey = Symbol("nuxt-ui.locale-context");
|
|
6
6
|
const _useLocale = (localeOverrides) => {
|
|
7
|
-
const locale = localeOverrides || inject(localeContextInjectionKey
|
|
7
|
+
const locale = localeOverrides || toRef(inject(localeContextInjectionKey));
|
|
8
8
|
return buildLocaleContext(computed(() => locale.value || en));
|
|
9
9
|
};
|
|
10
10
|
export const useLocale = createSharedComposable(_useLocale);
|
|
@@ -5,13 +5,15 @@ export { default as cs } from './cs';
|
|
|
5
5
|
export { default as da } from './da';
|
|
6
6
|
export { default as de } from './de';
|
|
7
7
|
export { default as el } from './el';
|
|
8
|
-
export { default as et } from './et';
|
|
9
8
|
export { default as en } from './en';
|
|
10
9
|
export { default as es } from './es';
|
|
10
|
+
export { default as et } from './et';
|
|
11
11
|
export { default as fa_ir } from './fa_ir';
|
|
12
12
|
export { default as fi } from './fi';
|
|
13
13
|
export { default as fr } from './fr';
|
|
14
|
+
export { default as he } from './he';
|
|
14
15
|
export { default as hi } from './hi';
|
|
16
|
+
export { default as hu } from './hu';
|
|
15
17
|
export { default as id } from './id';
|
|
16
18
|
export { default as it } from './it';
|
|
17
19
|
export { default as ja } from './ja';
|
|
@@ -31,4 +33,3 @@ export { default as uk } from './uk';
|
|
|
31
33
|
export { default as vi } from './vi';
|
|
32
34
|
export { default as zh_cn } from './zh_cn';
|
|
33
35
|
export { default as zh_tw } from './zh_tw';
|
|
34
|
-
export { default as he } from './he';
|
|
@@ -5,13 +5,15 @@ export { default as cs } from "./cs.js";
|
|
|
5
5
|
export { default as da } from "./da.js";
|
|
6
6
|
export { default as de } from "./de.js";
|
|
7
7
|
export { default as el } from "./el.js";
|
|
8
|
-
export { default as et } from "./et.js";
|
|
9
8
|
export { default as en } from "./en.js";
|
|
10
9
|
export { default as es } from "./es.js";
|
|
10
|
+
export { default as et } from "./et.js";
|
|
11
11
|
export { default as fa_ir } from "./fa_ir.js";
|
|
12
12
|
export { default as fi } from "./fi.js";
|
|
13
13
|
export { default as fr } from "./fr.js";
|
|
14
|
+
export { default as he } from "./he.js";
|
|
14
15
|
export { default as hi } from "./hi.js";
|
|
16
|
+
export { default as hu } from "./hu.js";
|
|
15
17
|
export { default as id } from "./id.js";
|
|
16
18
|
export { default as it } from "./it.js";
|
|
17
19
|
export { default as ja } from "./ja.js";
|
|
@@ -31,4 +33,3 @@ export { default as uk } from "./uk.js";
|
|
|
31
33
|
export { default as vi } from "./vi.js";
|
|
32
34
|
export { default as zh_cn } from "./zh_cn.js";
|
|
33
35
|
export { default as zh_tw } from "./zh_tw.js";
|
|
34
|
-
export { default as he } from "./he.js";
|
|
@@ -27,7 +27,7 @@ export interface Form<T extends object> {
|
|
|
27
27
|
export type FormSchema<T extends object> = ZodSchema | YupObjectSchema<T> | ValibotSchema | ValibotSchemaAsync | ValibotSafeParser<any, any> | ValibotSafeParserAsync<any, any> | JoiSchema<T> | SuperstructSchema<any, any> | StandardSchemaV1;
|
|
28
28
|
export type FormInputEvents = 'input' | 'blur' | 'change' | 'focus';
|
|
29
29
|
export interface FormError<P extends string = string> {
|
|
30
|
-
name
|
|
30
|
+
name?: P;
|
|
31
31
|
message: string;
|
|
32
32
|
}
|
|
33
33
|
export interface FormErrorWithId extends FormError {
|
|
@@ -3,13 +3,13 @@ import type { Locale, Direction } from '../types/locale';
|
|
|
3
3
|
import type { MaybeRef } from '@vueuse/core';
|
|
4
4
|
export type TranslatorOption = Record<string, string | number>;
|
|
5
5
|
export type Translator = (path: string, option?: TranslatorOption) => string;
|
|
6
|
-
export type LocaleContext = {
|
|
7
|
-
locale: Ref<Locale
|
|
6
|
+
export type LocaleContext<M> = {
|
|
7
|
+
locale: Ref<Locale<M>>;
|
|
8
8
|
lang: Ref<string>;
|
|
9
9
|
dir: Ref<Direction>;
|
|
10
10
|
code: Ref<string>;
|
|
11
11
|
t: Translator;
|
|
12
12
|
};
|
|
13
|
-
export declare function buildTranslator(locale: MaybeRef<Locale
|
|
14
|
-
export declare function translate(path: string, option: undefined | TranslatorOption, locale: Locale): string;
|
|
15
|
-
export declare function buildLocaleContext(locale: MaybeRef<Locale
|
|
13
|
+
export declare function buildTranslator<M>(locale: MaybeRef<Locale<M>>): Translator;
|
|
14
|
+
export declare function translate<M>(path: string, option: undefined | TranslatorOption, locale: Locale<M>): string;
|
|
15
|
+
export declare function buildLocaleContext<M>(locale: MaybeRef<Locale<M>>): LocaleContext<M>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const tv: import("tailwind-variants").CreateTV
|
|
1
|
+
export declare const tv: import("tailwind-variants").CreateTV;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { createHead
|
|
1
|
+
import { createHead } from "@unhead/vue/client";
|
|
2
2
|
export default {
|
|
3
|
-
install() {
|
|
4
|
-
|
|
3
|
+
install(app) {
|
|
4
|
+
const head = createHead();
|
|
5
|
+
app.use(head);
|
|
5
6
|
}
|
|
6
7
|
};
|
|
@@ -3,6 +3,7 @@ import type { NuxtApp } from '#app';
|
|
|
3
3
|
export { useHead } from '@unhead/vue';
|
|
4
4
|
export { useRoute, useRouter } from 'vue-router';
|
|
5
5
|
export { defineShortcuts } from '../composables/defineShortcuts';
|
|
6
|
+
export { defineLocale } from '../composables/defineLocale';
|
|
6
7
|
export { useLocale } from '../composables/useLocale';
|
|
7
8
|
export declare const useColorMode: () => {
|
|
8
9
|
forced: boolean;
|
|
@@ -25,6 +26,7 @@ export declare const useCookie: <T = string>(_name: string, _options?: Record<st
|
|
|
25
26
|
export declare const useState: <T>(key: string, init: () => T) => Ref<T>;
|
|
26
27
|
export declare function useNuxtApp(): {
|
|
27
28
|
isHydrating: boolean;
|
|
29
|
+
isVue: boolean;
|
|
28
30
|
payload: {
|
|
29
31
|
serverRendered: boolean;
|
|
30
32
|
};
|
|
@@ -4,6 +4,7 @@ import { useColorMode as useColorModeVueUse } from "@vueuse/core";
|
|
|
4
4
|
export { useHead } from "@unhead/vue";
|
|
5
5
|
export { useRoute, useRouter } from "vue-router";
|
|
6
6
|
export { defineShortcuts } from "../composables/defineShortcuts.js";
|
|
7
|
+
export { defineLocale } from "../composables/defineLocale.js";
|
|
7
8
|
export { useLocale } from "../composables/useLocale.js";
|
|
8
9
|
export const useColorMode = () => {
|
|
9
10
|
if (!appConfig.colorMode) {
|
|
@@ -52,6 +53,7 @@ export const useState = (key, init) => {
|
|
|
52
53
|
export function useNuxtApp() {
|
|
53
54
|
return {
|
|
54
55
|
isHydrating: true,
|
|
56
|
+
isVue: true,
|
|
55
57
|
payload: { serverRendered: false }
|
|
56
58
|
};
|
|
57
59
|
}
|
|
@@ -49,7 +49,7 @@ const defaultOptions = {
|
|
|
49
49
|
fonts: true,
|
|
50
50
|
colorMode: true,
|
|
51
51
|
theme: {
|
|
52
|
-
colors:
|
|
52
|
+
colors: void 0,
|
|
53
53
|
transitions: true
|
|
54
54
|
}
|
|
55
55
|
};
|
|
@@ -2392,7 +2392,7 @@ const radioGroup = (options) => ({
|
|
|
2392
2392
|
const select = (options) => {
|
|
2393
2393
|
return defu.defuFn({
|
|
2394
2394
|
slots: {
|
|
2395
|
-
root: () =>
|
|
2395
|
+
root: () => void 0,
|
|
2396
2396
|
base: () => ["relative group rounded-[calc(var(--ui-radius)*1.5)] inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
2397
2397
|
value: "truncate pointer-events-none",
|
|
2398
2398
|
placeholder: "truncate text-(--ui-text-dimmed)",
|
|
@@ -3513,6 +3513,10 @@ type AppConfigUI = {
|
|
|
3513
3513
|
|
|
3514
3514
|
declare module '@nuxt/schema' {
|
|
3515
3515
|
interface AppConfigInput {
|
|
3516
|
+
/**
|
|
3517
|
+
* Nuxt UI theme configuration
|
|
3518
|
+
* @see https://ui3.nuxt.dev/getting-started/theme#customize-theme
|
|
3519
|
+
*/
|
|
3516
3520
|
ui?: AppConfigUI
|
|
3517
3521
|
}
|
|
3518
3522
|
}
|
|
@@ -43,7 +43,7 @@ const defaultOptions = {
|
|
|
43
43
|
fonts: true,
|
|
44
44
|
colorMode: true,
|
|
45
45
|
theme: {
|
|
46
|
-
colors:
|
|
46
|
+
colors: void 0,
|
|
47
47
|
transitions: true
|
|
48
48
|
}
|
|
49
49
|
};
|
|
@@ -2386,7 +2386,7 @@ const radioGroup = (options) => ({
|
|
|
2386
2386
|
const select = (options) => {
|
|
2387
2387
|
return defuFn({
|
|
2388
2388
|
slots: {
|
|
2389
|
-
root: () =>
|
|
2389
|
+
root: () => void 0,
|
|
2390
2390
|
base: () => ["relative group rounded-[calc(var(--ui-radius)*1.5)] inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
2391
2391
|
value: "truncate pointer-events-none",
|
|
2392
2392
|
placeholder: "truncate text-(--ui-text-dimmed)",
|
|
@@ -3507,6 +3507,10 @@ type AppConfigUI = {
|
|
|
3507
3507
|
|
|
3508
3508
|
declare module '@nuxt/schema' {
|
|
3509
3509
|
interface AppConfigInput {
|
|
3510
|
+
/**
|
|
3511
|
+
* Nuxt UI theme configuration
|
|
3512
|
+
* @see https://ui3.nuxt.dev/getting-started/theme#customize-theme
|
|
3513
|
+
*/
|
|
3510
3514
|
ui?: AppConfigUI
|
|
3511
3515
|
}
|
|
3512
3516
|
}
|
package/dist/unplugin.cjs
CHANGED
|
@@ -5,7 +5,7 @@ const pathe = require('pathe');
|
|
|
5
5
|
const unplugin = require('unplugin');
|
|
6
6
|
const defu = require('defu');
|
|
7
7
|
const tailwind = require('@tailwindcss/vite');
|
|
8
|
-
const templates = require('./shared/ui.
|
|
8
|
+
const templates = require('./shared/ui.COBs1u5H.cjs');
|
|
9
9
|
const tinyglobby = require('tinyglobby');
|
|
10
10
|
const knitwork = require('knitwork');
|
|
11
11
|
const MagicString = require('magic-string');
|
package/dist/unplugin.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { join, normalize } from 'pathe';
|
|
|
3
3
|
import { createUnplugin } from 'unplugin';
|
|
4
4
|
import { defu } from 'defu';
|
|
5
5
|
import tailwind from '@tailwindcss/vite';
|
|
6
|
-
import { g as getTemplates, d as defaultOptions, r as resolveColors, a as getDefaultUiConfig } from './shared/ui.
|
|
6
|
+
import { g as getTemplates, d as defaultOptions, r as resolveColors, a as getDefaultUiConfig } from './shared/ui.yjbGE7Dx.mjs';
|
|
7
7
|
import { globSync } from 'tinyglobby';
|
|
8
8
|
import { genSafeVariableName } from 'knitwork';
|
|
9
9
|
import MagicString from 'magic-string';
|
package/dist/vite.cjs
CHANGED
package/dist/vite.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/ui",
|
|
3
3
|
"description": "A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.",
|
|
4
|
-
"version": "3.0.0
|
|
5
|
-
"packageManager": "pnpm@10.6.
|
|
4
|
+
"version": "3.0.0",
|
|
5
|
+
"packageManager": "pnpm@10.6.2",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/nuxt/ui.git"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"dev:build": "nuxi build playground",
|
|
68
68
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground && nuxi prepare docs && vite build playground-vue",
|
|
69
69
|
"docs": "DEV=true nuxi dev docs",
|
|
70
|
-
"docs:build": "nuxi build docs",
|
|
70
|
+
"docs:build": "NODE_OPTIONS='--max-old-space-size=8192' nuxi build docs",
|
|
71
71
|
"docs:prepare": "nuxt-component-meta docs",
|
|
72
72
|
"lint": "eslint .",
|
|
73
73
|
"lint:fix": "eslint . --fix",
|
|
@@ -75,23 +75,23 @@
|
|
|
75
75
|
"test": "vitest",
|
|
76
76
|
"test:vue": "vitest -c vitest.vue.config.ts",
|
|
77
77
|
"test:vue:build": "vite build playground-vue",
|
|
78
|
-
"release": "release-it
|
|
78
|
+
"release": "release-it"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@iconify/vue": "^4.3.0",
|
|
82
82
|
"@internationalized/date": "^3.7.0",
|
|
83
83
|
"@internationalized/number": "^3.6.0",
|
|
84
|
-
"@nuxt/fonts": "^0.
|
|
85
|
-
"@nuxt/icon": "^1.
|
|
86
|
-
"@nuxt/kit": "^3.
|
|
87
|
-
"@nuxt/schema": "^3.
|
|
84
|
+
"@nuxt/fonts": "^0.11.0",
|
|
85
|
+
"@nuxt/icon": "^1.11.0",
|
|
86
|
+
"@nuxt/kit": "^3.16.0",
|
|
87
|
+
"@nuxt/schema": "^3.16.0",
|
|
88
88
|
"@nuxtjs/color-mode": "^3.5.2",
|
|
89
|
-
"@tailwindcss/postcss": "^4.0.
|
|
90
|
-
"@tailwindcss/vite": "^4.0.
|
|
89
|
+
"@tailwindcss/postcss": "^4.0.13",
|
|
90
|
+
"@tailwindcss/vite": "^4.0.13",
|
|
91
91
|
"@tanstack/vue-table": "^8.21.2",
|
|
92
|
-
"@unhead/vue": "^
|
|
93
|
-
"@vueuse/core": "^
|
|
94
|
-
"@vueuse/integrations": "^
|
|
92
|
+
"@unhead/vue": "^2.0.0-rc.10",
|
|
93
|
+
"@vueuse/core": "^13.0.0",
|
|
94
|
+
"@vueuse/integrations": "^13.0.0",
|
|
95
95
|
"colortranslator": "^4.1.0",
|
|
96
96
|
"consola": "^3.4.0",
|
|
97
97
|
"defu": "^6.1.4",
|
|
@@ -110,26 +110,28 @@
|
|
|
110
110
|
"pathe": "^2.0.3",
|
|
111
111
|
"reka-ui": "^2.0.2",
|
|
112
112
|
"scule": "^1.3.0",
|
|
113
|
-
"tailwind-variants": "^0.
|
|
114
|
-
"tailwindcss": "^4.0.
|
|
113
|
+
"tailwind-variants": "^1.0.0",
|
|
114
|
+
"tailwindcss": "^4.0.13",
|
|
115
115
|
"tinyglobby": "^0.2.12",
|
|
116
116
|
"unplugin": "^2.2.0",
|
|
117
117
|
"unplugin-auto-import": "^19.1.1",
|
|
118
118
|
"unplugin-vue-components": "^28.4.1",
|
|
119
|
-
"vaul-vue": "^0.3.0"
|
|
119
|
+
"vaul-vue": "^0.3.0",
|
|
120
|
+
"vue": "^3.5.13",
|
|
121
|
+
"vue-router": "^4.5.0"
|
|
120
122
|
},
|
|
121
123
|
"devDependencies": {
|
|
122
|
-
"@nuxt/eslint-config": "^1.
|
|
124
|
+
"@nuxt/eslint-config": "^1.2.0",
|
|
123
125
|
"@nuxt/module-builder": "^0.8.4",
|
|
124
|
-
"@nuxt/test-utils": "^3.17.
|
|
126
|
+
"@nuxt/test-utils": "^3.17.2",
|
|
125
127
|
"@release-it/conventional-changelog": "^10.0.0",
|
|
126
128
|
"@standard-schema/spec": "^1.0.0",
|
|
127
129
|
"@vue/test-utils": "^2.4.6",
|
|
128
130
|
"embla-carousel": "^8.5.2",
|
|
129
|
-
"eslint": "^9.
|
|
130
|
-
"happy-dom": "^17.
|
|
131
|
+
"eslint": "^9.22.0",
|
|
132
|
+
"happy-dom": "^17.4.4",
|
|
131
133
|
"joi": "^17.13.3",
|
|
132
|
-
"nuxt": "^3.
|
|
134
|
+
"nuxt": "^3.16.0",
|
|
133
135
|
"release-it": "^18.1.2",
|
|
134
136
|
"superstruct": "^2.0.2",
|
|
135
137
|
"valibot": "^0.42.1",
|
|
@@ -146,12 +148,9 @@
|
|
|
146
148
|
"@nuxt/ui": "workspace:*",
|
|
147
149
|
"chokidar": "3.6.0",
|
|
148
150
|
"debug": "4.3.7",
|
|
149
|
-
"
|
|
150
|
-
"rollup": "4.32.1",
|
|
151
|
+
"rollup": "4.34.9",
|
|
151
152
|
"typescript": "5.6.3",
|
|
152
|
-
"unimport": "3.14.5",
|
|
153
153
|
"unplugin": "^2.2.0",
|
|
154
|
-
"vue": "3.5.13",
|
|
155
154
|
"vue-tsc": "2.2.0"
|
|
156
155
|
},
|
|
157
156
|
"pnpm": {
|