nuance-ui 0.2.36 → 0.3.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/dist/module.d.mts +3 -0
- package/dist/module.d.ts +3 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +5 -3
- package/dist/runtime/app-config.d.ts +4 -0
- package/dist/runtime/components/accordion/accordion-header.d.vue.ts +28 -0
- package/dist/runtime/components/accordion/accordion-header.vue +79 -0
- package/dist/runtime/components/accordion/accordion-header.vue.d.ts +28 -0
- package/dist/runtime/components/accordion/accordion-item.d.vue.ts +18 -0
- package/dist/runtime/components/accordion/accordion-item.vue +44 -0
- package/dist/runtime/components/accordion/accordion-item.vue.d.ts +18 -0
- package/dist/runtime/components/accordion/accordion-panel.d.vue.ts +18 -0
- package/dist/runtime/components/accordion/accordion-panel.vue +40 -0
- package/dist/runtime/components/accordion/accordion-panel.vue.d.ts +18 -0
- package/dist/runtime/components/accordion/accordion.d.vue.ts +61 -0
- package/dist/runtime/components/accordion/accordion.module.css +1 -0
- package/dist/runtime/components/accordion/accordion.vue +91 -0
- package/dist/runtime/components/accordion/accordion.vue.d.ts +61 -0
- package/dist/runtime/components/accordion/index.d.ts +6 -0
- package/dist/runtime/components/accordion/index.js +4 -0
- package/dist/runtime/components/accordion/lib/context.d.ts +34 -0
- package/dist/runtime/components/accordion/lib/context.js +9 -0
- package/dist/runtime/components/action-icon/action-icon.d.vue.ts +11 -1
- package/dist/runtime/components/action-icon/action-icon.module.css +1 -1
- package/dist/runtime/components/action-icon/action-icon.vue +20 -5
- package/dist/runtime/components/action-icon/action-icon.vue.d.ts +11 -1
- package/dist/runtime/components/button/button.d.vue.ts +8 -0
- package/dist/runtime/components/button/button.module.css +1 -1
- package/dist/runtime/components/button/button.vue +17 -4
- package/dist/runtime/components/button/button.vue.d.ts +8 -0
- package/dist/runtime/components/collapse.d.vue.ts +65 -0
- package/dist/runtime/components/collapse.vue +144 -0
- package/dist/runtime/components/collapse.vue.d.ts +65 -0
- package/dist/runtime/components/date-time-picker.d.vue.ts +2 -2
- package/dist/runtime/components/date-time-picker.vue.d.ts +2 -2
- package/dist/runtime/components/dialog/ui/dialog-close-button.vue +5 -0
- package/dist/runtime/components/drawer/drawer-close-button.vue +5 -0
- package/dist/runtime/components/files/file-upload-button.vue +4 -0
- package/dist/runtime/components/files/file-upload-icon.vue +5 -0
- package/dist/runtime/components/index.d.ts +2 -2
- package/dist/runtime/components/index.js +1 -1
- package/dist/runtime/components/input/date-picker.d.vue.ts +2 -2
- package/dist/runtime/components/input/date-picker.vue.d.ts +2 -2
- package/dist/runtime/components/link/lib.d.ts +2 -2
- package/dist/runtime/components/link/link-button.vue +4 -0
- package/dist/runtime/components/modal/modal-close-button.vue +5 -0
- package/dist/runtime/components/nav-link/nav-icon-link.d.vue.ts +5 -11
- package/dist/runtime/components/nav-link/nav-icon-link.vue +12 -8
- package/dist/runtime/components/nav-link/nav-icon-link.vue.d.ts +5 -11
- package/dist/runtime/components/table/ui/table-sortable-header.vue +4 -0
- package/dist/runtime/components/tabs/tabs-root.d.vue.ts +1 -1
- package/dist/runtime/components/tabs/tabs-root.vue.d.ts +1 -1
- package/dist/runtime/components/text.vue +1 -1
- package/dist/runtime/components/theme-toggle.vue +5 -0
- package/dist/runtime/composables/use-config.d.ts +1 -0
- package/dist/runtime/composables/use-config.js +2 -1
- package/dist/runtime/utils/const/active-variants.d.ts +11 -0
- package/dist/runtime/utils/const/active-variants.js +9 -0
- package/dist/runtime/utils/const/index.d.ts +1 -0
- package/dist/runtime/utils/const/index.js +1 -0
- package/package.json +1 -1
- package/dist/runtime/components/accordion.d.vue.ts +0 -79
- package/dist/runtime/components/accordion.vue +0 -44
- package/dist/runtime/components/accordion.vue.d.ts +0 -79
- package/dist/runtime/components/collapsible/collapsible-content.d.vue.ts +0 -18
- package/dist/runtime/components/collapsible/collapsible-content.vue +0 -76
- package/dist/runtime/components/collapsible/collapsible-content.vue.d.ts +0 -18
- package/dist/runtime/components/collapsible/collapsible-root.d.vue.ts +0 -42
- package/dist/runtime/components/collapsible/collapsible-root.vue +0 -41
- package/dist/runtime/components/collapsible/collapsible-root.vue.d.ts +0 -42
- package/dist/runtime/components/collapsible/collapsible-trigger.d.vue.ts +0 -13
- package/dist/runtime/components/collapsible/collapsible-trigger.vue +0 -20
- package/dist/runtime/components/collapsible/collapsible-trigger.vue.d.ts +0 -13
- package/dist/runtime/components/collapsible/index.d.ts +0 -3
- package/dist/runtime/components/collapsible/index.js +0 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import DialogCloseButton from "../dialog/ui/dialog-close-button.vue";
|
|
3
3
|
const props = defineProps({
|
|
4
4
|
size: { type: null, required: false },
|
|
5
|
+
iconSize: { type: [Number, String], required: false },
|
|
5
6
|
gradient: { type: Object, required: false },
|
|
6
7
|
color: { type: null, required: false },
|
|
7
8
|
radius: { type: [String, Number, Object], required: false },
|
|
@@ -10,6 +11,10 @@ const props = defineProps({
|
|
|
10
11
|
disabled: { type: Boolean, required: false },
|
|
11
12
|
mod: { type: [Object, Array, null], required: false },
|
|
12
13
|
variant: { type: String, required: false },
|
|
14
|
+
active: { type: Boolean, required: false },
|
|
15
|
+
activeMode: { type: String, required: false },
|
|
16
|
+
activeVariant: { type: String, required: false },
|
|
17
|
+
activeColor: { type: null, required: false },
|
|
13
18
|
classes: { type: Object, required: false }
|
|
14
19
|
});
|
|
15
20
|
</script>
|
|
@@ -28,6 +28,10 @@ const {
|
|
|
28
28
|
leftSectionProps: { type: Object, required: false },
|
|
29
29
|
rightSectionProps: { type: Object, required: false },
|
|
30
30
|
variant: { type: String, required: false },
|
|
31
|
+
active: { type: Boolean, required: false },
|
|
32
|
+
activeMode: { type: String, required: false },
|
|
33
|
+
activeVariant: { type: String, required: false },
|
|
34
|
+
activeColor: { type: null, required: false },
|
|
31
35
|
classes: { type: Object, required: false },
|
|
32
36
|
is: { type: null, required: false },
|
|
33
37
|
mod: { type: [Object, Array, null], required: false },
|
|
@@ -16,6 +16,7 @@ const {
|
|
|
16
16
|
reset: { type: null, required: false },
|
|
17
17
|
directory: { type: null, required: false },
|
|
18
18
|
size: { type: null, required: false },
|
|
19
|
+
iconSize: { type: [Number, String], required: false },
|
|
19
20
|
gradient: { type: Object, required: false },
|
|
20
21
|
color: { type: null, required: false },
|
|
21
22
|
radius: { type: [String, Number, Object], required: false },
|
|
@@ -24,6 +25,10 @@ const {
|
|
|
24
25
|
disabled: { type: Boolean, required: false },
|
|
25
26
|
mod: { type: [Object, Array, null], required: false },
|
|
26
27
|
variant: { type: String, required: false },
|
|
28
|
+
active: { type: Boolean, required: false },
|
|
29
|
+
activeMode: { type: String, required: false },
|
|
30
|
+
activeVariant: { type: String, required: false },
|
|
31
|
+
activeColor: { type: null, required: false },
|
|
27
32
|
classes: { type: Object, required: false },
|
|
28
33
|
capture: { type: null, required: false },
|
|
29
34
|
initialFiles: { type: null, required: false },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './accordion/index.js';
|
|
2
2
|
export * from './action-icon/index.js';
|
|
3
3
|
export * from './app-shell/index.js';
|
|
4
4
|
export * from './avatar/index.js';
|
|
@@ -11,7 +11,7 @@ export * from './calendar/index.js';
|
|
|
11
11
|
export * from './card/index.js';
|
|
12
12
|
export * from './checkbox/index.js';
|
|
13
13
|
export * from './chip/index.js';
|
|
14
|
-
export * from './
|
|
14
|
+
export type * from './collapse.vue';
|
|
15
15
|
export * from './combobox/index.js';
|
|
16
16
|
export type * from './container.vue';
|
|
17
17
|
export type * from './date-time-picker.vue';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./accordion/index.js";
|
|
1
2
|
export * from "./action-icon/index.js";
|
|
2
3
|
export * from "./app-shell/index.js";
|
|
3
4
|
export * from "./avatar/index.js";
|
|
@@ -6,7 +7,6 @@ export * from "./calendar/index.js";
|
|
|
6
7
|
export * from "./card/index.js";
|
|
7
8
|
export * from "./checkbox/index.js";
|
|
8
9
|
export * from "./chip/index.js";
|
|
9
|
-
export * from "./collapsible/index.js";
|
|
10
10
|
export * from "./combobox/index.js";
|
|
11
11
|
export * from "./dialog/index.js";
|
|
12
12
|
export * from "./drawer/index.js";
|
|
@@ -20,8 +20,8 @@ declare const __VLS_export: <Mode extends SelectionMode>(__VLS_props: NonNullabl
|
|
|
20
20
|
onNext?: (() => any) | undefined;
|
|
21
21
|
"onUpdate:modelValue"?: ((value: DateSelection<Mode> | undefined) => any) | undefined;
|
|
22
22
|
onPrev?: (() => any) | undefined;
|
|
23
|
-
onLevel?: (() => any) | undefined;
|
|
24
23
|
onOpen?: (() => any) | undefined;
|
|
24
|
+
onLevel?: (() => any) | undefined;
|
|
25
25
|
}> & (typeof globalThis extends {
|
|
26
26
|
__VLS_PROPS_FALLBACK: infer P;
|
|
27
27
|
} ? P : {});
|
|
@@ -38,7 +38,7 @@ declare const __VLS_export: <Mode extends SelectionMode>(__VLS_props: NonNullabl
|
|
|
38
38
|
} & {
|
|
39
39
|
description?: (props: {}) => any;
|
|
40
40
|
};
|
|
41
|
-
emit: (((evt: "select", date: DateSelection<Mode>) => void) & ((evt: "close") => void) & ((evt: "next") => void) & ((evt: "prev") => void) & ((evt: "
|
|
41
|
+
emit: (((evt: "select", date: DateSelection<Mode>) => void) & ((evt: "close") => void) & ((evt: "next") => void) & ((evt: "prev") => void) & ((evt: "open") => void) & ((evt: "level") => void)) & ((event: "update:modelValue", value: DateSelection<Mode> | undefined) => void);
|
|
42
42
|
}>) => import("vue").VNode & {
|
|
43
43
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
44
44
|
};
|
|
@@ -20,8 +20,8 @@ declare const __VLS_export: <Mode extends SelectionMode>(__VLS_props: NonNullabl
|
|
|
20
20
|
onNext?: (() => any) | undefined;
|
|
21
21
|
"onUpdate:modelValue"?: ((value: DateSelection<Mode> | undefined) => any) | undefined;
|
|
22
22
|
onPrev?: (() => any) | undefined;
|
|
23
|
-
onLevel?: (() => any) | undefined;
|
|
24
23
|
onOpen?: (() => any) | undefined;
|
|
24
|
+
onLevel?: (() => any) | undefined;
|
|
25
25
|
}> & (typeof globalThis extends {
|
|
26
26
|
__VLS_PROPS_FALLBACK: infer P;
|
|
27
27
|
} ? P : {});
|
|
@@ -38,7 +38,7 @@ declare const __VLS_export: <Mode extends SelectionMode>(__VLS_props: NonNullabl
|
|
|
38
38
|
} & {
|
|
39
39
|
description?: (props: {}) => any;
|
|
40
40
|
};
|
|
41
|
-
emit: (((evt: "select", date: DateSelection<Mode>) => void) & ((evt: "close") => void) & ((evt: "next") => void) & ((evt: "prev") => void) & ((evt: "
|
|
41
|
+
emit: (((evt: "select", date: DateSelection<Mode>) => void) & ((evt: "close") => void) & ((evt: "next") => void) & ((evt: "prev") => void) & ((evt: "open") => void) & ((evt: "level") => void)) & ((event: "update:modelValue", value: DateSelection<Mode> | undefined) => void);
|
|
42
42
|
}>) => import("vue").VNode & {
|
|
43
43
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
44
44
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NuxtLinkProps } from '#app';
|
|
2
2
|
export declare function pickLinkProps<T extends NuxtLinkProps>(props: T): {
|
|
3
|
-
link: Pick<T, "replace" | "
|
|
4
|
-
rest: Omit<T, "replace" | "
|
|
3
|
+
link: Pick<T, "replace" | "to" | "target" | "external" | "rel" | "noRel" | "prefetch" | "noPrefetch" | "prefetchOn" | "trailingSlash" | "activeClass" | "ariaCurrentValue" | "exactActiveClass" | "prefetchedClass" | "viewTransition">;
|
|
4
|
+
rest: Omit<T, "replace" | "to" | "target" | "external" | "rel" | "noRel" | "prefetch" | "noPrefetch" | "prefetchOn" | "trailingSlash" | "activeClass" | "ariaCurrentValue" | "exactActiveClass" | "prefetchedClass" | "viewTransition">;
|
|
5
5
|
};
|
|
@@ -30,6 +30,10 @@ const props = defineProps({
|
|
|
30
30
|
leftSectionProps: { type: Object, required: false },
|
|
31
31
|
rightSectionProps: { type: Object, required: false },
|
|
32
32
|
variant: { type: String, required: false },
|
|
33
|
+
active: { type: Boolean, required: false },
|
|
34
|
+
activeMode: { type: String, required: false },
|
|
35
|
+
activeVariant: { type: String, required: false },
|
|
36
|
+
activeColor: { type: null, required: false },
|
|
33
37
|
classes: { type: Object, required: false },
|
|
34
38
|
is: { type: null, required: false },
|
|
35
39
|
mod: { type: [Object, Array, null], required: false }
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import DialogCloseButton from "../dialog/ui/dialog-close-button.vue";
|
|
3
3
|
const props = defineProps({
|
|
4
4
|
size: { type: null, required: false },
|
|
5
|
+
iconSize: { type: [Number, String], required: false },
|
|
5
6
|
gradient: { type: Object, required: false },
|
|
6
7
|
color: { type: null, required: false },
|
|
7
8
|
radius: { type: [String, Number, Object], required: false },
|
|
@@ -10,6 +11,10 @@ const props = defineProps({
|
|
|
10
11
|
disabled: { type: Boolean, required: false },
|
|
11
12
|
mod: { type: [Object, Array, null], required: false },
|
|
12
13
|
variant: { type: String, required: false },
|
|
14
|
+
active: { type: Boolean, required: false },
|
|
15
|
+
activeMode: { type: String, required: false },
|
|
16
|
+
activeVariant: { type: String, required: false },
|
|
17
|
+
activeColor: { type: null, required: false },
|
|
13
18
|
classes: { type: Object, required: false }
|
|
14
19
|
});
|
|
15
20
|
</script>
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import type { ActionIconProps } from '@nui/components';
|
|
2
2
|
import type { NuanceColor } from '@nui/types';
|
|
3
3
|
import type { NuxtLinkProps } from 'nuxt/app';
|
|
4
|
-
export interface NavIconLinkProps extends ActionIconProps, Omit<NuxtLinkProps, 'href' | 'custom'> {
|
|
4
|
+
export interface NavIconLinkProps extends Omit<ActionIconProps, 'active'>, Omit<NuxtLinkProps, 'href' | 'custom'> {
|
|
5
5
|
/** Link target */
|
|
6
6
|
to: NuxtLinkProps['to'];
|
|
7
7
|
/** Color from theme */
|
|
8
8
|
color?: NuanceColor;
|
|
9
9
|
/** Icon name shorthand */
|
|
10
10
|
icon?: string;
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
active?: ActionIconProps['variant'];
|
|
16
|
-
/**
|
|
17
|
-
* Variant applied in inactive state
|
|
18
|
-
* @default `'default'`
|
|
19
|
-
*/
|
|
20
|
-
notActive?: ActionIconProps['variant'];
|
|
11
|
+
/** Variant applied in inactive state @default 'default' */
|
|
12
|
+
variant?: ActionIconProps['variant'];
|
|
13
|
+
/** Variant applied in active state @default 'filled' */
|
|
14
|
+
activeVariant?: ActionIconProps['variant'];
|
|
21
15
|
}
|
|
22
16
|
declare var __VLS_16: {};
|
|
23
17
|
type __VLS_Slots = {} & {
|
|
@@ -3,23 +3,25 @@ import ActionIcon from "../action-icon/action-icon.vue";
|
|
|
3
3
|
import { pickLinkProps } from "../link";
|
|
4
4
|
defineOptions({ inheritAttrs: false });
|
|
5
5
|
const {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
variant,
|
|
7
|
+
activeVariant,
|
|
8
8
|
mod,
|
|
9
9
|
...etc
|
|
10
10
|
} = defineProps({
|
|
11
11
|
to: { type: null, required: true },
|
|
12
12
|
color: { type: null, required: false },
|
|
13
13
|
icon: { type: String, required: false },
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
variant: { type: String, required: false },
|
|
15
|
+
activeVariant: { type: String, required: false },
|
|
16
16
|
size: { type: null, required: false },
|
|
17
|
+
iconSize: { type: [Number, String], required: false },
|
|
17
18
|
gradient: { type: Object, required: false },
|
|
18
19
|
radius: { type: [String, Number, Object], required: false },
|
|
19
20
|
loading: { type: Boolean, required: false },
|
|
20
21
|
disabled: { type: Boolean, required: false },
|
|
21
22
|
mod: { type: [Object, Array, null], required: false },
|
|
22
|
-
|
|
23
|
+
activeMode: { type: String, required: false },
|
|
24
|
+
activeColor: { type: null, required: false },
|
|
23
25
|
classes: { type: Object, required: false },
|
|
24
26
|
external: { type: Boolean, required: false },
|
|
25
27
|
target: { type: [String, Object, null], required: false },
|
|
@@ -45,9 +47,11 @@ const { link, rest } = pickLinkProps(etc);
|
|
|
45
47
|
is='a'
|
|
46
48
|
v-bind='{ ...rest, ...$attrs }'
|
|
47
49
|
:href
|
|
48
|
-
:variant
|
|
49
|
-
:
|
|
50
|
-
:
|
|
50
|
+
:variant
|
|
51
|
+
:active='isActive'
|
|
52
|
+
:active-variant
|
|
53
|
+
active-mode='current'
|
|
54
|
+
:mod
|
|
51
55
|
:rel='"rel" in linkProps ? linkProps?.rel : void 0'
|
|
52
56
|
:target='"target" in linkProps ? linkProps?.target : void 0'
|
|
53
57
|
@click='navigate'
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import type { ActionIconProps } from '@nui/components';
|
|
2
2
|
import type { NuanceColor } from '@nui/types';
|
|
3
3
|
import type { NuxtLinkProps } from 'nuxt/app';
|
|
4
|
-
export interface NavIconLinkProps extends ActionIconProps, Omit<NuxtLinkProps, 'href' | 'custom'> {
|
|
4
|
+
export interface NavIconLinkProps extends Omit<ActionIconProps, 'active'>, Omit<NuxtLinkProps, 'href' | 'custom'> {
|
|
5
5
|
/** Link target */
|
|
6
6
|
to: NuxtLinkProps['to'];
|
|
7
7
|
/** Color from theme */
|
|
8
8
|
color?: NuanceColor;
|
|
9
9
|
/** Icon name shorthand */
|
|
10
10
|
icon?: string;
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
active?: ActionIconProps['variant'];
|
|
16
|
-
/**
|
|
17
|
-
* Variant applied in inactive state
|
|
18
|
-
* @default `'default'`
|
|
19
|
-
*/
|
|
20
|
-
notActive?: ActionIconProps['variant'];
|
|
11
|
+
/** Variant applied in inactive state @default 'default' */
|
|
12
|
+
variant?: ActionIconProps['variant'];
|
|
13
|
+
/** Variant applied in active state @default 'filled' */
|
|
14
|
+
activeVariant?: ActionIconProps['variant'];
|
|
21
15
|
}
|
|
22
16
|
declare var __VLS_16: {};
|
|
23
17
|
type __VLS_Slots = {} & {
|
|
@@ -23,6 +23,10 @@ const {
|
|
|
23
23
|
leftSectionProps: { type: Object, required: false },
|
|
24
24
|
rightSectionProps: { type: Object, required: false },
|
|
25
25
|
variant: { type: String, required: false },
|
|
26
|
+
active: { type: Boolean, required: false },
|
|
27
|
+
activeMode: { type: String, required: false },
|
|
28
|
+
activeVariant: { type: String, required: false },
|
|
29
|
+
activeColor: { type: null, required: false },
|
|
26
30
|
classes: { type: Object, required: false },
|
|
27
31
|
is: { type: null, required: false },
|
|
28
32
|
mod: { type: [Object, Array, null], required: false },
|
|
@@ -62,8 +62,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
62
62
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
63
63
|
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
64
64
|
}>, {
|
|
65
|
-
orientation: "vertical" | "horizontal";
|
|
66
65
|
variant: TabsVariant;
|
|
66
|
+
orientation: "vertical" | "horizontal";
|
|
67
67
|
placement: "left" | "right";
|
|
68
68
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
69
69
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -62,8 +62,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
62
62
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
63
63
|
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
64
64
|
}>, {
|
|
65
|
-
orientation: "vertical" | "horizontal";
|
|
66
65
|
variant: TabsVariant;
|
|
66
|
+
orientation: "vertical" | "horizontal";
|
|
67
67
|
placement: "left" | "right";
|
|
68
68
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
69
69
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -45,7 +45,7 @@ const _mod = computed(() => [{
|
|
|
45
45
|
const style = useVarsResolver((theme) => ({
|
|
46
46
|
root: {
|
|
47
47
|
"--text-fz": getFontSize(fz || size),
|
|
48
|
-
"--text-ff": ff ? `var(--font-family
|
|
48
|
+
"--text-ff": ff ? `var(--font-family-${ff === "text" ? "" : ff})` : void 0,
|
|
49
49
|
"--text-fw": fw?.toString(),
|
|
50
50
|
"--text-lh": getLineHeight(lh || size),
|
|
51
51
|
"--text-gradient": variant === "gradient" ? getGradient(gradient, theme) : void 0,
|
|
@@ -3,6 +3,7 @@ import { useConfig, useTheme } from "@nui/composables";
|
|
|
3
3
|
import ActionIcon from "./action-icon/action-icon.vue";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
size: { type: null, required: false },
|
|
6
|
+
iconSize: { type: [Number, String], required: false },
|
|
6
7
|
gradient: { type: Object, required: false },
|
|
7
8
|
color: { type: null, required: false },
|
|
8
9
|
radius: { type: [String, Number, Object], required: false },
|
|
@@ -11,6 +12,10 @@ const props = defineProps({
|
|
|
11
12
|
disabled: { type: Boolean, required: false },
|
|
12
13
|
mod: { type: [Object, Array, null], required: false },
|
|
13
14
|
variant: { type: String, required: false },
|
|
15
|
+
active: { type: Boolean, required: false },
|
|
16
|
+
activeMode: { type: String, required: false },
|
|
17
|
+
activeVariant: { type: String, required: false },
|
|
18
|
+
activeColor: { type: null, required: false },
|
|
14
19
|
classes: { type: Object, required: false }
|
|
15
20
|
});
|
|
16
21
|
const theme = useTheme();
|
|
@@ -2,5 +2,6 @@ import type { VariantColorResolverOptions } from '@nui/utils';
|
|
|
2
2
|
/** Returns the configured icon registry merged with module defaults. */
|
|
3
3
|
export declare function useConfig(): {
|
|
4
4
|
icons: any;
|
|
5
|
+
activeVariants: any;
|
|
5
6
|
variantResolver: (options: VariantColorResolverOptions) => import("#imports").VariantColorResolverResult;
|
|
6
7
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createVariantColorResolver } from "@nui/utils";
|
|
2
2
|
import { useAppConfig } from "#imports";
|
|
3
3
|
export function useConfig() {
|
|
4
|
-
const { icons, gradient } = useAppConfig().nui;
|
|
4
|
+
const { icons, gradient, activeVariants } = useAppConfig().nui;
|
|
5
5
|
return {
|
|
6
6
|
icons,
|
|
7
|
+
activeVariants,
|
|
7
8
|
variantResolver: (options) => createVariantColorResolver({
|
|
8
9
|
...options,
|
|
9
10
|
gradient: options.gradient ?? gradient
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Variant an ActionIcon switches to when `active`, keyed by its base variant. */
|
|
2
|
+
export declare const DEFAULT_ACTIVE_VARIANTS: {
|
|
3
|
+
readonly default: "filled";
|
|
4
|
+
readonly light: "filled";
|
|
5
|
+
readonly outline: "filled";
|
|
6
|
+
readonly subtle: "light";
|
|
7
|
+
readonly filled: "filled";
|
|
8
|
+
readonly gradient: "gradient";
|
|
9
|
+
readonly 'gradient-outline': "gradient";
|
|
10
|
+
};
|
|
11
|
+
export type ActiveVariantsMap = Record<keyof typeof DEFAULT_ACTIVE_VARIANTS, string>;
|
package/package.json
CHANGED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type { Classes, NuanceRadius } from '@nui/types';
|
|
2
|
-
import type { TitleProps } from './title.vue.js';
|
|
3
|
-
export interface AccordionItem {
|
|
4
|
-
label?: string;
|
|
5
|
-
slot?: string;
|
|
6
|
-
content?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
/** Iconify icon */
|
|
9
|
-
icon?: string;
|
|
10
|
-
/** Iconify icon */
|
|
11
|
-
trailingIcon?: string;
|
|
12
|
-
/**
|
|
13
|
-
* A unique value for the accordion item. Defaults to the index.
|
|
14
|
-
* Also used as the Vue `key` for this item, so providing a stable value prevents
|
|
15
|
-
* accordion content (and its local state) from remounting when items are added, removed,
|
|
16
|
-
* or reordered.
|
|
17
|
-
*/
|
|
18
|
-
value?: string;
|
|
19
|
-
}
|
|
20
|
-
type AccordionVariant = 'default' | 'contained' | 'filled' | 'separated';
|
|
21
|
-
export interface AccordionProps<Multiple extends boolean = false> {
|
|
22
|
-
/** If set, multiple items can be opened at the same time @default false */
|
|
23
|
-
multiple?: Multiple;
|
|
24
|
-
/** If set, arrow keys loop through items (first to last and last to first) @default true */
|
|
25
|
-
loop?: boolean;
|
|
26
|
-
/** @default 'default' */
|
|
27
|
-
variant?: AccordionVariant;
|
|
28
|
-
/** Transition duration in ms @default 200 */
|
|
29
|
-
transitionDuration?: number;
|
|
30
|
-
/** If set, chevron rotation is disabled @default false */
|
|
31
|
-
disableChevronRotation?: boolean;
|
|
32
|
-
/** Position of the chevron relative to the item label @default right */
|
|
33
|
-
chevronPosition?: 'left' | 'right';
|
|
34
|
-
/** Size of the chevron icon container @default auto */
|
|
35
|
-
chevronSize?: number | string;
|
|
36
|
-
/**
|
|
37
|
-
* Size of the default chevron icon. Ignored when `chevron` prop is set.
|
|
38
|
-
* Use `chevronSize` instead when using custom chevron.
|
|
39
|
-
* @default 16
|
|
40
|
-
*/
|
|
41
|
-
chevronIconSize?: number | string;
|
|
42
|
-
/**
|
|
43
|
-
* Sets heading level (h2-h6) for `Accordion.Control` elements.
|
|
44
|
-
* Wraps each control in the corresponding heading tag, recommended to meet WAI-ARIA accessibility requirements.
|
|
45
|
-
* Has no visual effect.
|
|
46
|
-
*/
|
|
47
|
-
order?: TitleProps['order'];
|
|
48
|
-
/** Custom chevron icon */
|
|
49
|
-
chevron?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Key of `theme.radius` or any valid CSS value to set border-radius.
|
|
52
|
-
* Numbers are converted to rem.
|
|
53
|
-
* @default theme.defaultRadius */
|
|
54
|
-
radius?: NuanceRadius;
|
|
55
|
-
/**
|
|
56
|
-
* If set to `false`, panels are unmounted when collapsed.
|
|
57
|
-
* By default, panels stay mounted when collapsed. @default true
|
|
58
|
-
*/
|
|
59
|
-
keepMounted?: boolean;
|
|
60
|
-
classes?: Classes<'root' | 'content' | 'item' | 'panel' | 'icon' | 'chevron' | 'label' | 'itemTitle' | 'control'>;
|
|
61
|
-
}
|
|
62
|
-
declare const _default: typeof __VLS_export;
|
|
63
|
-
export default _default;
|
|
64
|
-
declare const __VLS_export: <Multiple extends boolean = false>(__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<{
|
|
65
|
-
props: import("vue").PublicProps & __VLS_PrettifyLocal<AccordionProps<Multiple>> & (typeof globalThis extends {
|
|
66
|
-
__VLS_PROPS_FALLBACK: infer P;
|
|
67
|
-
} ? P : {});
|
|
68
|
-
expose: (exposed: {}) => void;
|
|
69
|
-
attrs: any;
|
|
70
|
-
slots: {};
|
|
71
|
-
emit: {};
|
|
72
|
-
}>) => import("vue").VNode & {
|
|
73
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
74
|
-
};
|
|
75
|
-
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
76
|
-
[K in keyof T]: T[K];
|
|
77
|
-
} : {
|
|
78
|
-
[K in keyof T as K]: T[K];
|
|
79
|
-
}) & {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<script setup>
|
|
6
|
-
import { getRadius, getSize, useVarsResolver } from "#imports";
|
|
7
|
-
import Box from "./box.vue";
|
|
8
|
-
const {
|
|
9
|
-
transitionDuration,
|
|
10
|
-
chevronSize,
|
|
11
|
-
radius
|
|
12
|
-
} = defineProps({
|
|
13
|
-
multiple: { type: null, required: false },
|
|
14
|
-
loop: { type: Boolean, required: false },
|
|
15
|
-
variant: { type: String, required: false },
|
|
16
|
-
transitionDuration: { type: Number, required: false },
|
|
17
|
-
disableChevronRotation: { type: Boolean, required: false },
|
|
18
|
-
chevronPosition: { type: String, required: false },
|
|
19
|
-
chevronSize: { type: [Number, String], required: false },
|
|
20
|
-
chevronIconSize: { type: [Number, String], required: false },
|
|
21
|
-
order: { type: String, required: false },
|
|
22
|
-
chevron: { type: String, required: false },
|
|
23
|
-
radius: { type: [String, Number], required: false },
|
|
24
|
-
keepMounted: { type: Boolean, required: false },
|
|
25
|
-
classes: { type: Object, required: false }
|
|
26
|
-
});
|
|
27
|
-
const style = useVarsResolver(() => ({
|
|
28
|
-
root: {
|
|
29
|
-
"--accordion-transition-duration": transitionDuration === void 0 ? void 0 : `${transitionDuration}ms`,
|
|
30
|
-
"--accordion-chevron-size": chevronSize === void 0 ? void 0 : getSize(chevronSize),
|
|
31
|
-
"--accordion-radius": radius === void 0 ? void 0 : getRadius(radius)
|
|
32
|
-
}
|
|
33
|
-
}));
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<template>
|
|
37
|
-
<Box :style='style.root'>
|
|
38
|
-
accordion
|
|
39
|
-
</Box>
|
|
40
|
-
</template>
|
|
41
|
-
|
|
42
|
-
<style module>
|
|
43
|
-
.root{--accordion-radius:var(--radius-default)}.panel{overflow-wrap:break-word}.content{padding:var(--spacing-md);padding-top:calc(var(--spacing-xs)/2)}.itemTitle{margin:0;padding:0;width:100%}.control{align-items:center;background-color:transparent;color:var(--color-bright);cursor:pointer;display:flex;flex-direction:row-reverse;opacity:1;padding-inline:var(--spacing-md);width:100%}.control:where([data-chevron-position=left]){flex-direction:row;padding-inline-start:0}.control:where(:disabled,[data-disabled]){cursor:not-allowed;opacity:.4}.control--contained:where(:not(:disabled,[data-disabled])),.control--default:where(:not(:disabled,[data-disabled])){@mixin hover{@mixin where-light{background-color:var(--color-gray-0)}@mixin where-dark{background-color:var(--color-dark-6)}}}.label{color:inherit;flex:1;font-weight:var(--font-weight-regular);overflow:hidden;padding-bottom:var(--spacing-sm);padding-top:var(--spacing-sm);text-overflow:ellipsis}.chevron{align-items:center;display:flex;justify-content:flex-start;min-width:var(--accordion-chevron-size,rem(15px));transform:rotate(0deg);transition:transform var(--accordion-transition-duration,.2s) ease;width:var(--accordion-chevron-size,rem(15px))}.chevron:where([data-rotate]){transform:rotate(180deg)}.chevron:where([data-position=left]){margin-inline-end:var(--spacing-md);margin-inline-start:var(--spacing-md)}.icon{align-items:center;display:flex;justify-content:center;margin-inline-end:var(--spacing-sm)}.icon:where([data-chevron-position=left]){margin-inline-end:0;margin-inline-start:var(--spacing-lg)}.item{@mixin where-light{--item-border-color:var(--color-gray-3);--item-filled-color:var(--color-gray-0)}@mixin where-dark{--item-border-color:var(--color-dark-4);--item-filled-color:var(--color-dark-6)}}.item--default{border-bottom:1px solid var(--item-border-color)}.item--contained{border:1px solid var(--item-border-color);transition:background-color .15s ease}.item--contained:where([data-active]){background-color:var(--item-filled-color)}.item--contained:first-of-type,.item--contained:first-of-type>[data-accordion-control]{border-start-end-radius:var(--accordion-radius);border-start-start-radius:var(--accordion-radius)}.item--contained:last-of-type,.item--contained:last-of-type>[data-accordion-control]{border-end-end-radius:var(--accordion-radius);border-end-start-radius:var(--accordion-radius)}.item--contained+.item--contained{border-top:0}.item--filled{border-radius:var(--accordion-radius)}.item--filled:where([data-active]){background-color:var(--item-filled-color)}.item--separated{background-color:var(--item-filled-color);border:1px solid transparent;border-radius:var(--accordion-radius);transition:background-color .15s ease}.item--separated[data-active]{border-color:var(--item-border-color);@mixin where-light{background-color:var(--color-white)}@mixin where-dark{background-color:var(--color-dark-7)}}.item--separated+.item--separated{margin-top:var(--spacing-md)}
|
|
44
|
-
</style>
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type { Classes, NuanceRadius } from '@nui/types';
|
|
2
|
-
import type { TitleProps } from './title.vue.js';
|
|
3
|
-
export interface AccordionItem {
|
|
4
|
-
label?: string;
|
|
5
|
-
slot?: string;
|
|
6
|
-
content?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
/** Iconify icon */
|
|
9
|
-
icon?: string;
|
|
10
|
-
/** Iconify icon */
|
|
11
|
-
trailingIcon?: string;
|
|
12
|
-
/**
|
|
13
|
-
* A unique value for the accordion item. Defaults to the index.
|
|
14
|
-
* Also used as the Vue `key` for this item, so providing a stable value prevents
|
|
15
|
-
* accordion content (and its local state) from remounting when items are added, removed,
|
|
16
|
-
* or reordered.
|
|
17
|
-
*/
|
|
18
|
-
value?: string;
|
|
19
|
-
}
|
|
20
|
-
type AccordionVariant = 'default' | 'contained' | 'filled' | 'separated';
|
|
21
|
-
export interface AccordionProps<Multiple extends boolean = false> {
|
|
22
|
-
/** If set, multiple items can be opened at the same time @default false */
|
|
23
|
-
multiple?: Multiple;
|
|
24
|
-
/** If set, arrow keys loop through items (first to last and last to first) @default true */
|
|
25
|
-
loop?: boolean;
|
|
26
|
-
/** @default 'default' */
|
|
27
|
-
variant?: AccordionVariant;
|
|
28
|
-
/** Transition duration in ms @default 200 */
|
|
29
|
-
transitionDuration?: number;
|
|
30
|
-
/** If set, chevron rotation is disabled @default false */
|
|
31
|
-
disableChevronRotation?: boolean;
|
|
32
|
-
/** Position of the chevron relative to the item label @default right */
|
|
33
|
-
chevronPosition?: 'left' | 'right';
|
|
34
|
-
/** Size of the chevron icon container @default auto */
|
|
35
|
-
chevronSize?: number | string;
|
|
36
|
-
/**
|
|
37
|
-
* Size of the default chevron icon. Ignored when `chevron` prop is set.
|
|
38
|
-
* Use `chevronSize` instead when using custom chevron.
|
|
39
|
-
* @default 16
|
|
40
|
-
*/
|
|
41
|
-
chevronIconSize?: number | string;
|
|
42
|
-
/**
|
|
43
|
-
* Sets heading level (h2-h6) for `Accordion.Control` elements.
|
|
44
|
-
* Wraps each control in the corresponding heading tag, recommended to meet WAI-ARIA accessibility requirements.
|
|
45
|
-
* Has no visual effect.
|
|
46
|
-
*/
|
|
47
|
-
order?: TitleProps['order'];
|
|
48
|
-
/** Custom chevron icon */
|
|
49
|
-
chevron?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Key of `theme.radius` or any valid CSS value to set border-radius.
|
|
52
|
-
* Numbers are converted to rem.
|
|
53
|
-
* @default theme.defaultRadius */
|
|
54
|
-
radius?: NuanceRadius;
|
|
55
|
-
/**
|
|
56
|
-
* If set to `false`, panels are unmounted when collapsed.
|
|
57
|
-
* By default, panels stay mounted when collapsed. @default true
|
|
58
|
-
*/
|
|
59
|
-
keepMounted?: boolean;
|
|
60
|
-
classes?: Classes<'root' | 'content' | 'item' | 'panel' | 'icon' | 'chevron' | 'label' | 'itemTitle' | 'control'>;
|
|
61
|
-
}
|
|
62
|
-
declare const _default: typeof __VLS_export;
|
|
63
|
-
export default _default;
|
|
64
|
-
declare const __VLS_export: <Multiple extends boolean = false>(__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<{
|
|
65
|
-
props: import("vue").PublicProps & __VLS_PrettifyLocal<AccordionProps<Multiple>> & (typeof globalThis extends {
|
|
66
|
-
__VLS_PROPS_FALLBACK: infer P;
|
|
67
|
-
} ? P : {});
|
|
68
|
-
expose: (exposed: {}) => void;
|
|
69
|
-
attrs: any;
|
|
70
|
-
slots: {};
|
|
71
|
-
emit: {};
|
|
72
|
-
}>) => import("vue").VNode & {
|
|
73
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
74
|
-
};
|
|
75
|
-
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
76
|
-
[K in keyof T]: T[K];
|
|
77
|
-
} : {
|
|
78
|
-
[K in keyof T as K]: T[K];
|
|
79
|
-
}) & {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { BoxProps } from '../box.vue.js';
|
|
2
|
-
export interface CollapsibleContentProps extends BoxProps {
|
|
3
|
-
/**
|
|
4
|
-
* Used to force mounting when more control is needed. Useful when
|
|
5
|
-
* controlling animation with Vue animation libraries.
|
|
6
|
-
*/
|
|
7
|
-
forceMount?: boolean;
|
|
8
|
-
}
|
|
9
|
-
declare const _default: typeof __VLS_export;
|
|
10
|
-
export default _default;
|
|
11
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CollapsibleContentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CollapsibleContentProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
12
|
-
default?: (props: {}) => any;
|
|
13
|
-
}>;
|
|
14
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
-
new (): {
|
|
16
|
-
$slots: S;
|
|
17
|
-
};
|
|
18
|
-
};
|