@nuxt/ui 2.13.0 → 2.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/module.d.mts +61 -2
- package/dist/module.d.ts +61 -2
- package/dist/module.json +2 -2
- package/dist/module.mjs +27 -23
- package/dist/runtime/components/data/Table.vue +16 -4
- package/dist/runtime/components/data/Table.vue.d.ts +21 -3
- package/dist/runtime/components/elements/Accordion.vue +11 -2
- package/dist/runtime/components/elements/Accordion.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Alert.vue +2 -2
- package/dist/runtime/components/elements/Alert.vue.d.ts +4 -3
- package/dist/runtime/components/elements/Avatar.vue.d.ts +1 -1
- package/dist/runtime/components/elements/AvatarGroup.d.ts +1 -1
- package/dist/runtime/components/elements/Badge.vue.d.ts +2 -2
- package/dist/runtime/components/elements/Button.vue.d.ts +62 -36
- package/dist/runtime/components/elements/ButtonGroup.d.ts +1 -1
- package/dist/runtime/components/elements/Carousel.vue +19 -12
- package/dist/runtime/components/elements/Carousel.vue.d.ts +4 -4
- package/dist/runtime/components/elements/Chip.vue.d.ts +2 -2
- package/dist/runtime/components/elements/Dropdown.vue +3 -1
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +3 -3
- package/dist/runtime/components/elements/Icon.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Kbd.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Link.vue +1 -1
- package/dist/runtime/components/elements/Link.vue.d.ts +61 -35
- package/dist/runtime/components/elements/Meter.vue +4 -0
- package/dist/runtime/components/elements/Meter.vue.d.ts +1 -1
- package/dist/runtime/components/elements/MeterGroup.d.ts +1 -1
- package/dist/runtime/components/elements/Progress.vue +4 -1
- package/dist/runtime/components/elements/Progress.vue.d.ts +5 -5
- package/dist/runtime/components/forms/Checkbox.vue +1 -6
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +5 -14
- package/dist/runtime/components/forms/Form.vue +6 -3
- package/dist/runtime/components/forms/Form.vue.d.ts +1 -1
- package/dist/runtime/components/forms/FormGroup.vue +20 -17
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +2 -2
- package/dist/runtime/components/forms/Input.vue +1 -0
- package/dist/runtime/components/forms/Input.vue.d.ts +5 -5
- package/dist/runtime/components/forms/InputMenu.vue +4 -1
- package/dist/runtime/components/forms/InputMenu.vue.d.ts +6 -6
- package/dist/runtime/components/forms/Radio.vue +5 -11
- package/dist/runtime/components/forms/Radio.vue.d.ts +5 -5
- package/dist/runtime/components/forms/RadioGroup.vue +1 -0
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +3 -3
- package/dist/runtime/components/forms/Range.vue.d.ts +3 -3
- package/dist/runtime/components/forms/Select.vue.d.ts +5 -5
- package/dist/runtime/components/forms/SelectMenu.vue +4 -1
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +6 -6
- package/dist/runtime/components/forms/Textarea.vue +5 -1
- package/dist/runtime/components/forms/Textarea.vue.d.ts +14 -5
- package/dist/runtime/components/forms/Toggle.vue +3 -1
- package/dist/runtime/components/forms/Toggle.vue.d.ts +3 -3
- package/dist/runtime/components/layout/Card.vue +1 -1
- package/dist/runtime/components/layout/Card.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Container.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Divider.vue +8 -1
- package/dist/runtime/components/layout/Divider.vue.d.ts +15 -4
- package/dist/runtime/components/layout/Skeleton.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/CommandPalette.vue +3 -1
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +2 -2
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue +3 -1
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Tabs.vue +8 -8
- package/dist/runtime/components/navigation/Tabs.vue.d.ts +10 -1
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +3 -3
- package/dist/runtime/components/overlays/Modal.vue +3 -1
- package/dist/runtime/components/overlays/Modal.vue.d.ts +5 -5
- package/dist/runtime/components/overlays/Modals.client.vue +12 -0
- package/dist/runtime/components/overlays/Notification.vue +2 -2
- package/dist/runtime/components/overlays/Notification.vue.d.ts +4 -3
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Popover.vue +3 -1
- package/dist/runtime/components/overlays/Popover.vue.d.ts +3 -3
- package/dist/runtime/components/overlays/Slideover.vue +3 -1
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +5 -5
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +2 -2
- package/dist/runtime/composables/useFormGroup.d.ts +1 -1
- package/dist/runtime/composables/useFormGroup.mjs +9 -12
- package/dist/runtime/composables/useModal.d.ts +12 -0
- package/dist/runtime/composables/useModal.mjs +37 -0
- package/dist/runtime/plugins/modals.d.ts +2 -0
- package/dist/runtime/plugins/modals.mjs +10 -0
- package/dist/runtime/types/component.d.ts +14 -0
- package/dist/runtime/types/divider.d.ts +3 -0
- package/dist/runtime/types/form.d.ts +2 -1
- package/dist/runtime/types/index.d.ts +2 -0
- package/dist/runtime/types/modal.d.ts +18 -0
- package/dist/runtime/types/progress.d.ts +2 -0
- package/dist/runtime/types/range.d.ts +2 -0
- package/dist/runtime/types/toggle.d.ts +2 -0
- package/dist/runtime/ui.config/data/table.d.ts +7 -0
- package/dist/runtime/ui.config/data/table.mjs +10 -3
- package/dist/runtime/ui.config/elements/accordion.d.ts +1 -0
- package/dist/runtime/ui.config/elements/accordion.mjs +1 -0
- package/dist/runtime/ui.config/forms/formGroup.d.ts +1 -0
- package/dist/runtime/ui.config/forms/formGroup.mjs +1 -0
- package/dist/runtime/ui.config/forms/input.d.ts +11 -0
- package/dist/runtime/ui.config/forms/input.mjs +11 -0
- package/dist/runtime/ui.config/forms/select.d.ts +11 -0
- package/dist/runtime/ui.config/forms/textarea.d.ts +11 -0
- package/dist/runtime/ui.config/layout/divider.d.ts +19 -2
- package/dist/runtime/ui.config/layout/divider.mjs +20 -3
- package/dist/runtime/utils/index.mjs +9 -0
- package/dist/runtime/utils/link.d.ts +24 -11
- package/dist/runtime/utils/link.mjs +26 -13
- package/package.json +21 -19
- package/dist/runtime/utils/uid.d.ts +0 -1
- package/dist/runtime/utils/uid.mjs +0 -5
|
@@ -37,12 +37,13 @@
|
|
|
37
37
|
<script>
|
|
38
38
|
import { computed, ref, toRef, onMounted, defineComponent, watch } from "vue";
|
|
39
39
|
import { defu } from "defu";
|
|
40
|
-
import { Popover as HPopover, PopoverButton as HPopoverButton, PopoverPanel as HPopoverPanel } from "@headlessui/vue";
|
|
40
|
+
import { Popover as HPopover, PopoverButton as HPopoverButton, PopoverPanel as HPopoverPanel, provideUseId } from "@headlessui/vue";
|
|
41
41
|
import { useUI } from "../../composables/useUI";
|
|
42
42
|
import { usePopper } from "../../composables/usePopper";
|
|
43
43
|
import { mergeConfig } from "../../utils";
|
|
44
44
|
import appConfig from "#build/app.config";
|
|
45
45
|
import { popover } from "#ui/ui.config";
|
|
46
|
+
import { useId } from "#imports";
|
|
46
47
|
const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.popover, popover);
|
|
47
48
|
export default defineComponent({
|
|
48
49
|
components: {
|
|
@@ -184,6 +185,7 @@ export default defineComponent({
|
|
|
184
185
|
return;
|
|
185
186
|
emit("update:open", newValue === 0);
|
|
186
187
|
});
|
|
188
|
+
provideUseId(() => useId());
|
|
187
189
|
return {
|
|
188
190
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
189
191
|
ui,
|
|
@@ -70,7 +70,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
70
70
|
}>;
|
|
71
71
|
onMouseOver: () => void;
|
|
72
72
|
onMouseLeave: () => void;
|
|
73
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:open"[], "update:open", import("vue").
|
|
73
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:open"[], "update:open", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
74
74
|
mode: {
|
|
75
75
|
type: PropType<"click" | "hover">;
|
|
76
76
|
default: string;
|
|
@@ -112,13 +112,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
112
112
|
"onUpdate:open"?: ((...args: any[]) => any) | undefined;
|
|
113
113
|
}, {
|
|
114
114
|
ui: any;
|
|
115
|
-
|
|
115
|
+
overlay: boolean;
|
|
116
116
|
class: any;
|
|
117
|
+
popper: PopperOptions;
|
|
117
118
|
disabled: boolean;
|
|
118
119
|
open: boolean;
|
|
119
120
|
mode: "click" | "hover";
|
|
120
121
|
openDelay: number;
|
|
121
122
|
closeDelay: number;
|
|
122
|
-
overlay: boolean;
|
|
123
123
|
}, {}>;
|
|
124
124
|
export default _default;
|
|
@@ -16,11 +16,12 @@
|
|
|
16
16
|
|
|
17
17
|
<script>
|
|
18
18
|
import { computed, toRef, defineComponent } from "vue";
|
|
19
|
-
import { Dialog as HDialog, DialogPanel as HDialogPanel, TransitionRoot, TransitionChild } from "@headlessui/vue";
|
|
19
|
+
import { Dialog as HDialog, DialogPanel as HDialogPanel, TransitionRoot, TransitionChild, provideUseId } from "@headlessui/vue";
|
|
20
20
|
import { useUI } from "../../composables/useUI";
|
|
21
21
|
import { mergeConfig } from "../../utils";
|
|
22
22
|
import appConfig from "#build/app.config";
|
|
23
23
|
import { slideover } from "#ui/ui.config";
|
|
24
|
+
import { useId } from "#imports";
|
|
24
25
|
const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.slideover, slideover);
|
|
25
26
|
export default defineComponent({
|
|
26
27
|
components: {
|
|
@@ -96,6 +97,7 @@ export default defineComponent({
|
|
|
96
97
|
isOpen.value = value;
|
|
97
98
|
emit("close");
|
|
98
99
|
}
|
|
100
|
+
provideUseId(() => useId());
|
|
99
101
|
return {
|
|
100
102
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
101
103
|
ui,
|
|
@@ -41,7 +41,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
41
41
|
isOpen: WritableComputedRef<boolean>;
|
|
42
42
|
transitionClass: import("vue").ComputedRef<any>;
|
|
43
43
|
close: (value: boolean) => void;
|
|
44
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "update:modelValue" | "close-prevented")[], "close" | "update:modelValue" | "close-prevented", import("vue").
|
|
44
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "update:modelValue" | "close-prevented")[], "close" | "update:modelValue" | "close-prevented", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
45
45
|
modelValue: {
|
|
46
46
|
type: PropType<boolean>;
|
|
47
47
|
default: boolean;
|
|
@@ -76,17 +76,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
76
76
|
default: () => {};
|
|
77
77
|
};
|
|
78
78
|
}>> & {
|
|
79
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
80
79
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
80
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
81
81
|
"onClose-prevented"?: ((...args: any[]) => any) | undefined;
|
|
82
82
|
}, {
|
|
83
83
|
ui: any;
|
|
84
|
-
transition: boolean;
|
|
85
|
-
class: any;
|
|
86
|
-
modelValue: boolean;
|
|
87
84
|
appear: boolean;
|
|
88
85
|
overlay: boolean;
|
|
86
|
+
transition: boolean;
|
|
89
87
|
preventClose: boolean;
|
|
88
|
+
class: any;
|
|
89
|
+
modelValue: boolean;
|
|
90
90
|
side: "right" | "left";
|
|
91
91
|
}, {}>;
|
|
92
92
|
export default _default;
|
|
@@ -44,7 +44,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
44
44
|
open: import("vue").Ref<boolean>;
|
|
45
45
|
onMouseOver: () => void;
|
|
46
46
|
onMouseLeave: () => void;
|
|
47
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
47
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
48
48
|
text: {
|
|
49
49
|
type: StringConstructor;
|
|
50
50
|
default: null;
|
|
@@ -79,8 +79,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
79
79
|
};
|
|
80
80
|
}>>, {
|
|
81
81
|
ui: any;
|
|
82
|
-
popper: PopperOptions;
|
|
83
82
|
class: any;
|
|
83
|
+
popper: PopperOptions;
|
|
84
84
|
text: string;
|
|
85
85
|
openDelay: number;
|
|
86
86
|
closeDelay: number;
|
|
@@ -7,7 +7,7 @@ type InputProps = {
|
|
|
7
7
|
legend?: string | null;
|
|
8
8
|
};
|
|
9
9
|
export declare const useFormGroup: (inputProps?: InputProps, config?: any) => {
|
|
10
|
-
inputId: import("vue").
|
|
10
|
+
inputId: import("vue").ComputedRef<string | undefined>;
|
|
11
11
|
name: import("vue").ComputedRef<string | undefined>;
|
|
12
12
|
size: import("vue").ComputedRef<any>;
|
|
13
13
|
color: import("vue").ComputedRef<string | undefined>;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { inject, ref, computed
|
|
1
|
+
import { inject, ref, computed } from "vue";
|
|
2
2
|
import { useDebounceFn } from "@vueuse/core";
|
|
3
|
-
import { uid } from "../utils/uid.mjs";
|
|
4
3
|
export const useFormGroup = (inputProps, config) => {
|
|
5
4
|
const formBus = inject("form-events", void 0);
|
|
6
5
|
const formGroup = inject("form-group", void 0);
|
|
7
6
|
const formInputs = inject("form-inputs", void 0);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (formGroup) {
|
|
12
|
-
formGroup.inputId.value = inputId.value;
|
|
13
|
-
if (formInputs) {
|
|
14
|
-
formInputs.value[formGroup.name.value] = inputId;
|
|
15
|
-
}
|
|
7
|
+
if (formGroup) {
|
|
8
|
+
if (inputProps?.id) {
|
|
9
|
+
formGroup.inputId.value = inputProps?.id;
|
|
16
10
|
}
|
|
17
|
-
|
|
11
|
+
if (formInputs) {
|
|
12
|
+
formInputs.value[formGroup.name.value] = formGroup.inputId.value;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
18
15
|
const blurred = ref(false);
|
|
19
16
|
function emitFormEvent(type, path) {
|
|
20
17
|
if (formBus) {
|
|
@@ -34,7 +31,7 @@ export const useFormGroup = (inputProps, config) => {
|
|
|
34
31
|
}
|
|
35
32
|
}, 300);
|
|
36
33
|
return {
|
|
37
|
-
inputId,
|
|
34
|
+
inputId: computed(() => inputProps?.id ?? formGroup?.inputId.value),
|
|
38
35
|
name: computed(() => inputProps?.name ?? formGroup?.name.value),
|
|
39
36
|
size: computed(() => {
|
|
40
37
|
const formGroupSize = config.size[formGroup?.size.value] ? formGroup?.size.value : null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ShallowRef, Component, InjectionKey } from 'vue';
|
|
2
|
+
import type { ComponentProps } from '../types/component';
|
|
3
|
+
import type { Modal, ModalState } from '../types/modal';
|
|
4
|
+
export declare const modalInjectionKey: InjectionKey<ShallowRef<ModalState>>;
|
|
5
|
+
declare function _useModal(): {
|
|
6
|
+
isOpen: import("vue").Ref<boolean>;
|
|
7
|
+
open: <T extends Component>(component: T, props?: (Modal & ComponentProps<T>) | undefined) => void;
|
|
8
|
+
close: () => void;
|
|
9
|
+
patch: <T_1 extends Component = {}>(props: Partial<Modal & ComponentProps<T_1>>) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const useModal: typeof _useModal;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ref, inject } from "vue";
|
|
2
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
3
|
+
export const modalInjectionKey = Symbol("nuxt-ui.modal");
|
|
4
|
+
function _useModal() {
|
|
5
|
+
const modalState = inject(modalInjectionKey);
|
|
6
|
+
const isOpen = ref(false);
|
|
7
|
+
function open(component, props) {
|
|
8
|
+
modalState.value = {
|
|
9
|
+
component,
|
|
10
|
+
props: props ?? {}
|
|
11
|
+
};
|
|
12
|
+
isOpen.value = true;
|
|
13
|
+
}
|
|
14
|
+
function close() {
|
|
15
|
+
isOpen.value = false;
|
|
16
|
+
modalState.value = {
|
|
17
|
+
component: "div",
|
|
18
|
+
props: {}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function patch(props) {
|
|
22
|
+
modalState.value = {
|
|
23
|
+
...modalState.value,
|
|
24
|
+
props: {
|
|
25
|
+
...modalState.value.props,
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
isOpen,
|
|
32
|
+
open,
|
|
33
|
+
close,
|
|
34
|
+
patch
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export const useModal = createSharedComposable(_useModal);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from "#imports";
|
|
2
|
+
import { shallowRef } from "vue";
|
|
3
|
+
import { modalInjectionKey } from "../composables/useModal.mjs";
|
|
4
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
|
+
const modalState = shallowRef({
|
|
6
|
+
component: "div",
|
|
7
|
+
props: {}
|
|
8
|
+
});
|
|
9
|
+
nuxtApp.vueApp.provide(modalInjectionKey, modalState);
|
|
10
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type ComponentProps<T> =
|
|
2
|
+
T extends new () => { $props: infer P } ? NonNullable<P> :
|
|
3
|
+
T extends (props: infer P, ...args: any) => any ? P :
|
|
4
|
+
{}
|
|
5
|
+
|
|
6
|
+
export type ComponentSlots<T> =
|
|
7
|
+
T extends new () => { $slots: infer S } ? NonNullable<S> :
|
|
8
|
+
T extends (props: any, ctx: { slots: infer S; attrs: any; emit: any }, ...args: any) => any ? NonNullable<S> :
|
|
9
|
+
{}
|
|
10
|
+
|
|
11
|
+
export type ComponentEmit<T> =
|
|
12
|
+
T extends new () => { $emit: infer E } ? NonNullable<E> :
|
|
13
|
+
T extends (props: any, ctx: { slots: any; attrs: any; emit: infer E }, ...args: any) => any ? NonNullable<E> :
|
|
14
|
+
{}
|
|
@@ -10,7 +10,8 @@ export interface FormErrorWithId extends FormError {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export interface Form<T> {
|
|
13
|
-
validate(path?: string, opts?: { silent?:
|
|
13
|
+
validate(path?: string | string[], opts?: { silent?: true }): Promise<T | false>;
|
|
14
|
+
validate(path?: string | string[], opts?: { silent?: false }): Promise<T>;
|
|
14
15
|
clear(path?: string): void
|
|
15
16
|
errors: Ref<FormError[]>
|
|
16
17
|
setErrors(errs: FormError[], path?: string): void
|
|
@@ -7,6 +7,7 @@ export * from './button'
|
|
|
7
7
|
export * from './chip'
|
|
8
8
|
export * from './clipboard'
|
|
9
9
|
export * from './command-palette'
|
|
10
|
+
export * from './divider'
|
|
10
11
|
export * from './dropdown'
|
|
11
12
|
export * from './form-group'
|
|
12
13
|
export * from './form'
|
|
@@ -15,6 +16,7 @@ export * from './input'
|
|
|
15
16
|
export * from './kbd'
|
|
16
17
|
export * from './link'
|
|
17
18
|
export * from './meter'
|
|
19
|
+
export * from './modal'
|
|
18
20
|
export * from './notification'
|
|
19
21
|
export * from './popper'
|
|
20
22
|
export * from './progress'
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Component } from 'vue'
|
|
2
|
+
|
|
3
|
+
export interface Modal {
|
|
4
|
+
appear?: boolean
|
|
5
|
+
overlay?: boolean
|
|
6
|
+
transition?: boolean
|
|
7
|
+
preventClose?: boolean
|
|
8
|
+
fullscreen?: boolean
|
|
9
|
+
class?: string | Object | string[]
|
|
10
|
+
ui?: any
|
|
11
|
+
onClose?: () => void
|
|
12
|
+
onClosePrevented?: () => void
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ModalState {
|
|
16
|
+
component: Component | string
|
|
17
|
+
props: Modal
|
|
18
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { range } from '../ui.config'
|
|
2
2
|
import type { ExtractDeepKey } from '.'
|
|
3
3
|
import type { AppConfig } from 'nuxt/schema'
|
|
4
|
+
import colors from '#ui-colors'
|
|
4
5
|
|
|
5
6
|
export type RangeSize = keyof typeof range.size | ExtractDeepKey<AppConfig, ['ui', 'range', 'size']>
|
|
7
|
+
export type RangeColor = typeof colors[number]
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { toggle } from '../ui.config'
|
|
2
2
|
import type { ExtractDeepKey } from '.'
|
|
3
3
|
import type { AppConfig } from 'nuxt/schema'
|
|
4
|
+
import colors from '#ui-colors'
|
|
4
5
|
|
|
5
6
|
export type ToggleSize = keyof typeof toggle.size | ExtractDeepKey<AppConfig, ['ui', 'toggle', 'size']>
|
|
7
|
+
export type ToggleColor = typeof colors[number]
|
|
@@ -36,6 +36,9 @@ declare const _default: {
|
|
|
36
36
|
label: string;
|
|
37
37
|
icon: string;
|
|
38
38
|
};
|
|
39
|
+
progress: {
|
|
40
|
+
wrapper: string;
|
|
41
|
+
};
|
|
39
42
|
default: {
|
|
40
43
|
sortAscIcon: string;
|
|
41
44
|
sortDescIcon: string;
|
|
@@ -47,6 +50,10 @@ declare const _default: {
|
|
|
47
50
|
variant: "ghost";
|
|
48
51
|
class: string;
|
|
49
52
|
};
|
|
53
|
+
progress: {
|
|
54
|
+
color: "primary";
|
|
55
|
+
animation: "carousel";
|
|
56
|
+
};
|
|
50
57
|
loadingState: {
|
|
51
58
|
icon: string;
|
|
52
59
|
label: string;
|
|
@@ -2,7 +2,7 @@ export default {
|
|
|
2
2
|
wrapper: "relative overflow-x-auto",
|
|
3
3
|
base: "min-w-full table-fixed",
|
|
4
4
|
divide: "divide-y divide-gray-300 dark:divide-gray-700",
|
|
5
|
-
thead: "",
|
|
5
|
+
thead: "relative",
|
|
6
6
|
tbody: "divide-y divide-gray-200 dark:divide-gray-800",
|
|
7
7
|
tr: {
|
|
8
8
|
base: "",
|
|
@@ -11,14 +11,14 @@ export default {
|
|
|
11
11
|
},
|
|
12
12
|
th: {
|
|
13
13
|
base: "text-left rtl:text-right",
|
|
14
|
-
padding: "px-
|
|
14
|
+
padding: "px-4 py-3.5",
|
|
15
15
|
color: "text-gray-900 dark:text-white",
|
|
16
16
|
font: "font-semibold",
|
|
17
17
|
size: "text-sm"
|
|
18
18
|
},
|
|
19
19
|
td: {
|
|
20
20
|
base: "whitespace-nowrap",
|
|
21
|
-
padding: "px-
|
|
21
|
+
padding: "px-4 py-4",
|
|
22
22
|
color: "text-gray-500 dark:text-gray-400",
|
|
23
23
|
font: "",
|
|
24
24
|
size: "text-sm"
|
|
@@ -36,6 +36,9 @@ export default {
|
|
|
36
36
|
label: "text-sm text-center text-gray-900 dark:text-white",
|
|
37
37
|
icon: "w-6 h-6 mx-auto text-gray-400 dark:text-gray-500 mb-4"
|
|
38
38
|
},
|
|
39
|
+
progress: {
|
|
40
|
+
wrapper: "absolute inset-x-0 -bottom-[0.5px] p-0"
|
|
41
|
+
},
|
|
39
42
|
default: {
|
|
40
43
|
sortAscIcon: "i-heroicons-bars-arrow-up-20-solid",
|
|
41
44
|
sortDescIcon: "i-heroicons-bars-arrow-down-20-solid",
|
|
@@ -47,6 +50,10 @@ export default {
|
|
|
47
50
|
variant: "ghost",
|
|
48
51
|
class: "-m-1.5"
|
|
49
52
|
},
|
|
53
|
+
progress: {
|
|
54
|
+
color: "primary",
|
|
55
|
+
animation: "carousel"
|
|
56
|
+
},
|
|
50
57
|
loadingState: {
|
|
51
58
|
icon: "i-heroicons-arrow-path-20-solid",
|
|
52
59
|
label: "Loading..."
|
|
@@ -4,6 +4,17 @@ declare const _default: {
|
|
|
4
4
|
form: string;
|
|
5
5
|
rounded: string;
|
|
6
6
|
placeholder: string;
|
|
7
|
+
file: {
|
|
8
|
+
base: string;
|
|
9
|
+
padding: {
|
|
10
|
+
'2xs': string;
|
|
11
|
+
xs: string;
|
|
12
|
+
sm: string;
|
|
13
|
+
md: string;
|
|
14
|
+
lg: string;
|
|
15
|
+
xl: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
7
18
|
size: {
|
|
8
19
|
'2xs': string;
|
|
9
20
|
xs: string;
|
|
@@ -4,6 +4,17 @@ export default {
|
|
|
4
4
|
form: "form-input",
|
|
5
5
|
rounded: "rounded-md",
|
|
6
6
|
placeholder: "placeholder-gray-400 dark:placeholder-gray-500",
|
|
7
|
+
file: {
|
|
8
|
+
base: "file:cursor-pointer file:rounded-l-md file:absolute file:left-0 file:inset-y-0 file:font-medium file:m-0 file:border-0 file:ring-1 file:ring-gray-300 dark:file:ring-gray-700 file:text-gray-900 dark:file:text-white file:bg-gray-50 hover:file:bg-gray-100 dark:file:bg-gray-800 dark:hover:file:bg-gray-700/50",
|
|
9
|
+
padding: {
|
|
10
|
+
"2xs": "ps-[85px]",
|
|
11
|
+
xs: "ps-[87px]",
|
|
12
|
+
sm: "ps-[96px]",
|
|
13
|
+
md: "ps-[98px]",
|
|
14
|
+
lg: "ps-[100px]",
|
|
15
|
+
xl: "ps-[109px]"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
7
18
|
size: {
|
|
8
19
|
"2xs": "text-xs",
|
|
9
20
|
xs: "text-xs",
|
|
@@ -11,6 +11,17 @@ declare const _default: {
|
|
|
11
11
|
wrapper: string;
|
|
12
12
|
base: string;
|
|
13
13
|
rounded: string;
|
|
14
|
+
file: {
|
|
15
|
+
base: string;
|
|
16
|
+
padding: {
|
|
17
|
+
'2xs': string;
|
|
18
|
+
xs: string;
|
|
19
|
+
sm: string;
|
|
20
|
+
md: string;
|
|
21
|
+
lg: string;
|
|
22
|
+
xl: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
14
25
|
size: {
|
|
15
26
|
'2xs': string;
|
|
16
27
|
xs: string;
|
|
@@ -9,6 +9,17 @@ declare const _default: {
|
|
|
9
9
|
base: string;
|
|
10
10
|
rounded: string;
|
|
11
11
|
placeholder: string;
|
|
12
|
+
file: {
|
|
13
|
+
base: string;
|
|
14
|
+
padding: {
|
|
15
|
+
'2xs': string;
|
|
16
|
+
xs: string;
|
|
17
|
+
sm: string;
|
|
18
|
+
md: string;
|
|
19
|
+
lg: string;
|
|
20
|
+
xl: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
12
23
|
size: {
|
|
13
24
|
'2xs': string;
|
|
14
25
|
xs: string;
|
|
@@ -14,8 +14,22 @@ declare const _default: {
|
|
|
14
14
|
horizontal: string;
|
|
15
15
|
vertical: string;
|
|
16
16
|
size: {
|
|
17
|
-
horizontal:
|
|
18
|
-
|
|
17
|
+
horizontal: {
|
|
18
|
+
'2xs': string;
|
|
19
|
+
xs: string;
|
|
20
|
+
sm: string;
|
|
21
|
+
md: string;
|
|
22
|
+
lg: string;
|
|
23
|
+
xl: string;
|
|
24
|
+
};
|
|
25
|
+
vertical: {
|
|
26
|
+
'2xs': string;
|
|
27
|
+
xs: string;
|
|
28
|
+
sm: string;
|
|
29
|
+
md: string;
|
|
30
|
+
lg: string;
|
|
31
|
+
xl: string;
|
|
32
|
+
};
|
|
19
33
|
};
|
|
20
34
|
type: {
|
|
21
35
|
solid: string;
|
|
@@ -31,5 +45,8 @@ declare const _default: {
|
|
|
31
45
|
size: "2xs";
|
|
32
46
|
};
|
|
33
47
|
label: string;
|
|
48
|
+
default: {
|
|
49
|
+
size: "2xs";
|
|
50
|
+
};
|
|
34
51
|
};
|
|
35
52
|
export default _default;
|
|
@@ -14,8 +14,22 @@ export default {
|
|
|
14
14
|
horizontal: "w-full",
|
|
15
15
|
vertical: "h-full",
|
|
16
16
|
size: {
|
|
17
|
-
horizontal:
|
|
18
|
-
|
|
17
|
+
horizontal: {
|
|
18
|
+
"2xs": "border-t",
|
|
19
|
+
xs: "border-t-[2px]",
|
|
20
|
+
sm: "border-t-[3px]",
|
|
21
|
+
md: "border-t-[4px]",
|
|
22
|
+
lg: "border-t-[5px]",
|
|
23
|
+
xl: "border-t-[6px]"
|
|
24
|
+
},
|
|
25
|
+
vertical: {
|
|
26
|
+
"2xs": "border-s",
|
|
27
|
+
xs: "border-s-[2px]",
|
|
28
|
+
sm: "border-s-[3px]",
|
|
29
|
+
md: "border-s-[4px]",
|
|
30
|
+
lg: "border-s-[5px]",
|
|
31
|
+
xl: "border-s-[6px]"
|
|
32
|
+
}
|
|
19
33
|
},
|
|
20
34
|
type: {
|
|
21
35
|
solid: "border-solid",
|
|
@@ -30,5 +44,8 @@ export default {
|
|
|
30
44
|
base: "flex-shrink-0",
|
|
31
45
|
size: "2xs"
|
|
32
46
|
},
|
|
33
|
-
label: "text-sm"
|
|
47
|
+
label: "text-sm",
|
|
48
|
+
default: {
|
|
49
|
+
size: "2xs"
|
|
50
|
+
}
|
|
34
51
|
};
|
|
@@ -11,9 +11,18 @@ const defuTwMerge = createDefu((obj, key, value, namespace) => {
|
|
|
11
11
|
if (namespace === "default" || namespace.startsWith("default.")) {
|
|
12
12
|
return false;
|
|
13
13
|
}
|
|
14
|
+
if (namespace === "popper" || namespace.startsWith("popper.")) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
14
17
|
if (namespace.endsWith("avatar") && key === "size") {
|
|
15
18
|
return false;
|
|
16
19
|
}
|
|
20
|
+
if (namespace.endsWith("chip") && key === "size") {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
if (namespace.endsWith("badge") && key === "size" || key === "color" || key === "variant") {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
17
26
|
if (typeof obj[key] === "string" && typeof value === "string" && obj[key] && value) {
|
|
18
27
|
obj[key] = customTwMerge(obj[key], value);
|
|
19
28
|
return true;
|