nuance-ui 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -1
- 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/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-root.d.vue.ts +1 -1
- package/dist/runtime/components/dialog/ui/dialog-root.vue +1 -1
- package/dist/runtime/components/dialog/ui/dialog-root.vue.d.ts +1 -1
- package/dist/runtime/components/index.d.ts +5 -3
- package/dist/runtime/components/index.js +2 -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/kbd.d.vue.ts +25 -0
- package/dist/runtime/components/kbd.vue +28 -0
- package/dist/runtime/components/kbd.vue.d.ts +25 -0
- package/dist/runtime/components/link/lib.d.ts +2 -2
- package/dist/runtime/components/notification.d.vue.ts +82 -0
- package/dist/runtime/components/notification.vue +144 -0
- package/dist/runtime/components/notification.vue.d.ts +82 -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/transition/index.d.ts +2 -0
- package/dist/runtime/components/transition/index.js +0 -0
- package/dist/runtime/components/transition/transition-group.d.vue.ts +35 -0
- package/dist/runtime/components/transition/transition-group.vue +32 -0
- package/dist/runtime/components/transition/transition-group.vue.d.ts +35 -0
- package/dist/runtime/components/transition/transition.vue +33 -0
- package/dist/runtime/components/tree/_ui/tree-item.vue +3 -3
- package/dist/runtime/composables/index.d.ts +1 -0
- package/dist/runtime/composables/index.js +1 -0
- package/dist/runtime/composables/use-countdown.d.ts +19 -0
- package/dist/runtime/composables/use-countdown.js +30 -0
- package/dist/runtime/notifications/index.d.ts +4 -0
- package/dist/runtime/notifications/index.js +3 -0
- package/dist/runtime/notifications/lib.d.ts +4 -0
- package/dist/runtime/notifications/lib.js +14 -0
- package/dist/runtime/notifications/notification-container.d.vue.ts +20 -0
- package/dist/runtime/notifications/notification-container.vue +35 -0
- package/dist/runtime/notifications/notification-container.vue.d.ts +20 -0
- package/dist/runtime/notifications/notifications-provider.d.vue.ts +22 -0
- package/dist/runtime/notifications/notifications-provider.vue +117 -0
- package/dist/runtime/notifications/notifications-provider.vue.d.ts +22 -0
- package/dist/runtime/notifications/notifications-store.d.ts +25 -0
- package/dist/runtime/notifications/notifications-store.js +80 -0
- package/dist/runtime/notifications/types.d.ts +50 -0
- package/dist/runtime/notifications/types.js +0 -0
- package/dist/runtime/notifications/use-notifications.d.ts +7 -0
- package/dist/runtime/notifications/use-notifications.js +10 -0
- package/dist/runtime/styles/global.css +1 -1
- package/dist/runtime/styles/transitions.css +1 -0
- package/dist/runtime/types/index.d.ts +2 -0
- package/package.json +10 -6
- 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
- package/dist/runtime/components/transition.vue +0 -42
- /package/dist/runtime/components/{transition.d.vue.ts → transition/transition.d.vue.ts} +0 -0
- /package/dist/runtime/components/{transition.vue.d.ts → transition/transition.vue.d.ts} +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Classes } from '@nui/types';
|
|
2
|
+
import type { BoxProps } from './box.vue.js';
|
|
3
|
+
export type CollapseClasses = 'root' | 'trigger' | 'content';
|
|
4
|
+
/** Props passed to the trigger slot, spread onto a custom toggle element for a11y. */
|
|
5
|
+
export interface CollapseTriggerProps {
|
|
6
|
+
'aria-controls': string;
|
|
7
|
+
'aria-expanded': boolean;
|
|
8
|
+
'disabled': boolean | undefined;
|
|
9
|
+
'data-state': 'open' | 'closed';
|
|
10
|
+
'data-disabled': '' | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface CollapseProps {
|
|
13
|
+
/**
|
|
14
|
+
* The open state of the collapsible when it is initially rendered.
|
|
15
|
+
* Use when you do not need to control its open state.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
defaultOpen?: boolean;
|
|
19
|
+
/** Disables the component */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* If set, the content stays mounted when collapsed.
|
|
23
|
+
* When `false`, content is unmounted after the exit transition.
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
keepMounted?: boolean;
|
|
27
|
+
/** Transition duration in ms @default 200 */
|
|
28
|
+
transitionDuration?: number;
|
|
29
|
+
/** Transition timing function @default 'ease' */
|
|
30
|
+
transitionTimingFunction?: string;
|
|
31
|
+
/** If set, opacity is animated alongside height @default true */
|
|
32
|
+
animateOpacity?: boolean;
|
|
33
|
+
/** Element modifiers transformed into `data-` attributes, falsy values are removed */
|
|
34
|
+
mod?: BoxProps['mod'];
|
|
35
|
+
/** Styles API */
|
|
36
|
+
classes?: Classes<CollapseClasses>;
|
|
37
|
+
}
|
|
38
|
+
export interface CollapseSlots {
|
|
39
|
+
/** Collapsible content */
|
|
40
|
+
default?: (props: {
|
|
41
|
+
open: boolean;
|
|
42
|
+
}) => any;
|
|
43
|
+
/** Toggle control. Spread `props` onto a button to get a11y wiring. */
|
|
44
|
+
trigger?: (props: {
|
|
45
|
+
open: boolean;
|
|
46
|
+
toggle: () => void;
|
|
47
|
+
props: CollapseTriggerProps;
|
|
48
|
+
}) => any;
|
|
49
|
+
}
|
|
50
|
+
declare const _default: typeof __VLS_export;
|
|
51
|
+
export default _default;
|
|
52
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CollapseProps & {
|
|
53
|
+
open?: boolean;
|
|
54
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
55
|
+
"update:open": (value: boolean) => any;
|
|
56
|
+
}, string, import("vue").PublicProps, Readonly<CollapseProps & {
|
|
57
|
+
open?: boolean;
|
|
58
|
+
}> & Readonly<{
|
|
59
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
60
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, CollapseSlots>;
|
|
61
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
62
|
+
new (): {
|
|
63
|
+
$slots: S;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Box from "./box.vue";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { unrefElement, usePreferredReducedMotion } from "@vueuse/core";
|
|
7
|
+
import { computed, nextTick, onMounted, ref, useId, useTemplateRef, watch } from "vue";
|
|
8
|
+
const {
|
|
9
|
+
disabled,
|
|
10
|
+
keepMounted = true,
|
|
11
|
+
transitionDuration = 200,
|
|
12
|
+
transitionTimingFunction = "ease",
|
|
13
|
+
animateOpacity = true,
|
|
14
|
+
mod,
|
|
15
|
+
classes
|
|
16
|
+
} = defineProps({
|
|
17
|
+
defaultOpen: { type: Boolean, required: false },
|
|
18
|
+
disabled: { type: Boolean, required: false },
|
|
19
|
+
keepMounted: { type: Boolean, required: false },
|
|
20
|
+
transitionDuration: { type: Number, required: false },
|
|
21
|
+
transitionTimingFunction: { type: String, required: false },
|
|
22
|
+
animateOpacity: { type: Boolean, required: false },
|
|
23
|
+
mod: { type: [Object, Array, null], required: false },
|
|
24
|
+
classes: { type: Object, required: false }
|
|
25
|
+
});
|
|
26
|
+
defineSlots();
|
|
27
|
+
const opened = defineModel("open", { type: Boolean, ...{ default: (p) => p.defaultOpen } });
|
|
28
|
+
const contentId = useId();
|
|
29
|
+
const reducedMotion = usePreferredReducedMotion();
|
|
30
|
+
const duration = computed(() => reducedMotion.value === "reduce" ? 0 : transitionDuration);
|
|
31
|
+
function toggle() {
|
|
32
|
+
if (disabled)
|
|
33
|
+
return;
|
|
34
|
+
opened.value = !opened.value;
|
|
35
|
+
}
|
|
36
|
+
const dataState = computed(() => opened.value ? "open" : "closed");
|
|
37
|
+
const triggerProps = computed(() => ({
|
|
38
|
+
"aria-controls": contentId,
|
|
39
|
+
"aria-expanded": opened.value,
|
|
40
|
+
"disabled": disabled || void 0,
|
|
41
|
+
"data-state": dataState.value,
|
|
42
|
+
"data-disabled": disabled ? "" : void 0
|
|
43
|
+
}));
|
|
44
|
+
const el = useTemplateRef("content");
|
|
45
|
+
const mounted = ref(keepMounted || opened.value);
|
|
46
|
+
let timer;
|
|
47
|
+
function transitionStyle() {
|
|
48
|
+
const opacity = animateOpacity ? `, opacity ${duration.value}ms ${transitionTimingFunction}` : "";
|
|
49
|
+
return `height ${duration.value}ms ${transitionTimingFunction}${opacity}`;
|
|
50
|
+
}
|
|
51
|
+
function expand(node, instant) {
|
|
52
|
+
clearTimeout(timer);
|
|
53
|
+
node.style.overflow = "hidden";
|
|
54
|
+
if (instant) {
|
|
55
|
+
node.style.height = "";
|
|
56
|
+
node.style.opacity = "";
|
|
57
|
+
node.style.transition = "";
|
|
58
|
+
node.style.overflow = "";
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
node.style.height = "0px";
|
|
62
|
+
if (animateOpacity)
|
|
63
|
+
node.style.opacity = "0";
|
|
64
|
+
void node.offsetHeight;
|
|
65
|
+
node.style.transition = transitionStyle();
|
|
66
|
+
node.style.height = `${node.scrollHeight}px`;
|
|
67
|
+
if (animateOpacity)
|
|
68
|
+
node.style.opacity = "1";
|
|
69
|
+
timer = setTimeout(() => {
|
|
70
|
+
node.style.transition = "";
|
|
71
|
+
node.style.height = "";
|
|
72
|
+
node.style.overflow = "";
|
|
73
|
+
node.style.opacity = "";
|
|
74
|
+
}, duration.value);
|
|
75
|
+
}
|
|
76
|
+
function collapse(node, instant) {
|
|
77
|
+
clearTimeout(timer);
|
|
78
|
+
node.style.overflow = "hidden";
|
|
79
|
+
node.style.height = `${node.scrollHeight}px`;
|
|
80
|
+
void node.offsetHeight;
|
|
81
|
+
if (instant) {
|
|
82
|
+
node.style.transition = "";
|
|
83
|
+
node.style.height = "0px";
|
|
84
|
+
if (animateOpacity)
|
|
85
|
+
node.style.opacity = "0";
|
|
86
|
+
if (!keepMounted)
|
|
87
|
+
mounted.value = false;
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
node.style.transition = transitionStyle();
|
|
91
|
+
node.style.height = "0px";
|
|
92
|
+
if (animateOpacity)
|
|
93
|
+
node.style.opacity = "0";
|
|
94
|
+
timer = setTimeout(() => {
|
|
95
|
+
if (!keepMounted)
|
|
96
|
+
mounted.value = false;
|
|
97
|
+
}, duration.value);
|
|
98
|
+
}
|
|
99
|
+
onMounted(() => {
|
|
100
|
+
const node = unrefElement(el);
|
|
101
|
+
if (!node || opened.value)
|
|
102
|
+
return;
|
|
103
|
+
node.style.height = "0px";
|
|
104
|
+
node.style.overflow = "hidden";
|
|
105
|
+
if (animateOpacity)
|
|
106
|
+
node.style.opacity = "0";
|
|
107
|
+
});
|
|
108
|
+
watch(opened, async (value) => {
|
|
109
|
+
if (value) {
|
|
110
|
+
if (!mounted.value) {
|
|
111
|
+
mounted.value = true;
|
|
112
|
+
await nextTick();
|
|
113
|
+
}
|
|
114
|
+
if (el.value)
|
|
115
|
+
expand(unrefElement(el), duration.value === 0);
|
|
116
|
+
} else if (el.value) {
|
|
117
|
+
collapse(unrefElement(el), duration.value === 0);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
</script>
|
|
121
|
+
|
|
122
|
+
<template>
|
|
123
|
+
<Box
|
|
124
|
+
:mod='[{ disabled, state: dataState }, mod]'
|
|
125
|
+
:class='classes?.root'
|
|
126
|
+
>
|
|
127
|
+
<slot
|
|
128
|
+
name='trigger'
|
|
129
|
+
:open='opened'
|
|
130
|
+
:toggle='toggle'
|
|
131
|
+
:props='triggerProps'
|
|
132
|
+
/>
|
|
133
|
+
|
|
134
|
+
<Box
|
|
135
|
+
v-if='mounted'
|
|
136
|
+
:id='contentId'
|
|
137
|
+
ref='content'
|
|
138
|
+
:class='classes?.content'
|
|
139
|
+
:mod='{ disabled, open: opened }'
|
|
140
|
+
>
|
|
141
|
+
<slot :open='opened' />
|
|
142
|
+
</Box>
|
|
143
|
+
</box>
|
|
144
|
+
</template>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Classes } from '@nui/types';
|
|
2
|
+
import type { BoxProps } from './box.vue.js';
|
|
3
|
+
export type CollapseClasses = 'root' | 'trigger' | 'content';
|
|
4
|
+
/** Props passed to the trigger slot, spread onto a custom toggle element for a11y. */
|
|
5
|
+
export interface CollapseTriggerProps {
|
|
6
|
+
'aria-controls': string;
|
|
7
|
+
'aria-expanded': boolean;
|
|
8
|
+
'disabled': boolean | undefined;
|
|
9
|
+
'data-state': 'open' | 'closed';
|
|
10
|
+
'data-disabled': '' | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface CollapseProps {
|
|
13
|
+
/**
|
|
14
|
+
* The open state of the collapsible when it is initially rendered.
|
|
15
|
+
* Use when you do not need to control its open state.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
defaultOpen?: boolean;
|
|
19
|
+
/** Disables the component */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* If set, the content stays mounted when collapsed.
|
|
23
|
+
* When `false`, content is unmounted after the exit transition.
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
keepMounted?: boolean;
|
|
27
|
+
/** Transition duration in ms @default 200 */
|
|
28
|
+
transitionDuration?: number;
|
|
29
|
+
/** Transition timing function @default 'ease' */
|
|
30
|
+
transitionTimingFunction?: string;
|
|
31
|
+
/** If set, opacity is animated alongside height @default true */
|
|
32
|
+
animateOpacity?: boolean;
|
|
33
|
+
/** Element modifiers transformed into `data-` attributes, falsy values are removed */
|
|
34
|
+
mod?: BoxProps['mod'];
|
|
35
|
+
/** Styles API */
|
|
36
|
+
classes?: Classes<CollapseClasses>;
|
|
37
|
+
}
|
|
38
|
+
export interface CollapseSlots {
|
|
39
|
+
/** Collapsible content */
|
|
40
|
+
default?: (props: {
|
|
41
|
+
open: boolean;
|
|
42
|
+
}) => any;
|
|
43
|
+
/** Toggle control. Spread `props` onto a button to get a11y wiring. */
|
|
44
|
+
trigger?: (props: {
|
|
45
|
+
open: boolean;
|
|
46
|
+
toggle: () => void;
|
|
47
|
+
props: CollapseTriggerProps;
|
|
48
|
+
}) => any;
|
|
49
|
+
}
|
|
50
|
+
declare const _default: typeof __VLS_export;
|
|
51
|
+
export default _default;
|
|
52
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CollapseProps & {
|
|
53
|
+
open?: boolean;
|
|
54
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
55
|
+
"update:open": (value: boolean) => any;
|
|
56
|
+
}, string, import("vue").PublicProps, Readonly<CollapseProps & {
|
|
57
|
+
open?: boolean;
|
|
58
|
+
}> & Readonly<{
|
|
59
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
60
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, CollapseSlots>;
|
|
61
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
62
|
+
new (): {
|
|
63
|
+
$slots: S;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -41,16 +41,16 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
41
41
|
next: () => any;
|
|
42
42
|
"update:modelValue": (value: string | Date | null | undefined) => any;
|
|
43
43
|
prev: () => any;
|
|
44
|
-
level: () => any;
|
|
45
44
|
open: () => any;
|
|
45
|
+
level: () => any;
|
|
46
46
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
47
47
|
onSelect?: ((date: import("./calendar/index.js").Selection) => any) | undefined;
|
|
48
48
|
onClose?: (() => any) | undefined;
|
|
49
49
|
onNext?: (() => any) | undefined;
|
|
50
50
|
"onUpdate:modelValue"?: ((value: string | Date | null | undefined) => any) | undefined;
|
|
51
51
|
onPrev?: (() => any) | undefined;
|
|
52
|
-
onLevel?: (() => any) | undefined;
|
|
53
52
|
onOpen?: (() => any) | undefined;
|
|
53
|
+
onLevel?: (() => any) | undefined;
|
|
54
54
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
55
55
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
56
56
|
declare const _default: typeof __VLS_export;
|
|
@@ -41,16 +41,16 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
41
41
|
next: () => any;
|
|
42
42
|
"update:modelValue": (value: string | Date | null | undefined) => any;
|
|
43
43
|
prev: () => any;
|
|
44
|
-
level: () => any;
|
|
45
44
|
open: () => any;
|
|
45
|
+
level: () => any;
|
|
46
46
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
47
47
|
onSelect?: ((date: import("./calendar/index.js").Selection) => any) | undefined;
|
|
48
48
|
onClose?: (() => any) | undefined;
|
|
49
49
|
onNext?: (() => any) | undefined;
|
|
50
50
|
"onUpdate:modelValue"?: ((value: string | Date | null | undefined) => any) | undefined;
|
|
51
51
|
onPrev?: (() => any) | undefined;
|
|
52
|
-
onLevel?: (() => any) | undefined;
|
|
53
52
|
onOpen?: (() => any) | undefined;
|
|
53
|
+
onLevel?: (() => any) | undefined;
|
|
54
54
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
55
55
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
56
56
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Classes, NuanceRadius, NuanceShadow, NuanceSize, NuanceSpacing } from '@nui/types';
|
|
2
2
|
import type { CSSProperties, RendererElement } from 'vue';
|
|
3
3
|
import type { BoxProps } from '../../box.vue.js';
|
|
4
|
-
import type { TransitionName } from '../../transition.vue.js';
|
|
4
|
+
import type { TransitionName } from '../../transition/transition.vue.js';
|
|
5
5
|
import type { DialogModel } from '../types.js';
|
|
6
6
|
interface StyleProps {
|
|
7
7
|
/** Top/bottom modal offset @default `5dvh` */
|
|
@@ -3,7 +3,7 @@ import { getRadius, getShadow, getSize, getSpacing, rem } from "@nui/utils";
|
|
|
3
3
|
import { unrefElement } from "@vueuse/core";
|
|
4
4
|
import { computed, shallowRef, watch } from "vue";
|
|
5
5
|
import Box from "../../box.vue";
|
|
6
|
-
import NTransition from "../../transition.vue";
|
|
6
|
+
import NTransition from "../../transition/transition.vue";
|
|
7
7
|
import { useProvideDialogState } from "../lib";
|
|
8
8
|
import css from "./dialog.module.css";
|
|
9
9
|
defineOptions({ inheritAttrs: false });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Classes, NuanceRadius, NuanceShadow, NuanceSize, NuanceSpacing } from '@nui/types';
|
|
2
2
|
import type { CSSProperties, RendererElement } from 'vue';
|
|
3
3
|
import type { BoxProps } from '../../box.vue.js';
|
|
4
|
-
import type { TransitionName } from '../../transition.vue.js';
|
|
4
|
+
import type { TransitionName } from '../../transition/transition.vue.js';
|
|
5
5
|
import type { DialogModel } from '../types.js';
|
|
6
6
|
interface StyleProps {
|
|
7
7
|
/** Top/bottom modal offset @default `5dvh` */
|
|
@@ -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';
|
|
@@ -21,10 +21,12 @@ export * from './drawer/index.js';
|
|
|
21
21
|
export * from './files/index.js';
|
|
22
22
|
export type * from './floating-indicator.vue';
|
|
23
23
|
export * from './input/index.js';
|
|
24
|
+
export type * from './kbd.vue';
|
|
24
25
|
export * from './link/index.js';
|
|
25
26
|
export * from './loader/index.js';
|
|
26
27
|
export * from './modal/index.js';
|
|
27
28
|
export * from './nav-link/index.js';
|
|
29
|
+
export type * from './notification.vue';
|
|
28
30
|
export type * from './paper.vue';
|
|
29
31
|
export * from './popover/index.js';
|
|
30
32
|
export * from './progress/index.js';
|
|
@@ -39,6 +41,6 @@ export type * from './textarea.vue';
|
|
|
39
41
|
export * from './time-picker/index.js';
|
|
40
42
|
export type * from './timeline.vue';
|
|
41
43
|
export type * from './title.vue';
|
|
42
|
-
export
|
|
44
|
+
export * from './transition/index.js';
|
|
43
45
|
export * from './tree/index.js';
|
|
44
46
|
export * from './visually-hidden/index.js';
|
|
@@ -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";
|
|
@@ -23,5 +23,6 @@ export * from "./switch/index.js";
|
|
|
23
23
|
export * from "./table/index.js";
|
|
24
24
|
export * from "./tabs/index.js";
|
|
25
25
|
export * from "./time-picker/index.js";
|
|
26
|
+
export * from "./transition/index.js";
|
|
26
27
|
export * from "./tree/index.js";
|
|
27
28
|
export * from "./visually-hidden/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
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AnyString, NuanceSize } from '@nui/types';
|
|
2
|
+
import type { BoxProps } from './box.vue.js';
|
|
3
|
+
export interface KbdVars {
|
|
4
|
+
root: '--kbd-fz';
|
|
5
|
+
}
|
|
6
|
+
export interface KbdProps extends BoxProps {
|
|
7
|
+
/**
|
|
8
|
+
* Controls `font-size` and `padding`
|
|
9
|
+
* @default `'sm'`
|
|
10
|
+
*/
|
|
11
|
+
size?: NuanceSize | AnyString;
|
|
12
|
+
}
|
|
13
|
+
declare var __VLS_8: {};
|
|
14
|
+
type __VLS_Slots = {} & {
|
|
15
|
+
default?: (props: typeof __VLS_8) => any;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<KbdProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KbdProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useVarsResolver } from "@nui/composables";
|
|
3
|
+
import { getSize } from "@nui/utils";
|
|
4
|
+
import Box from "./box.vue";
|
|
5
|
+
const { size } = defineProps({
|
|
6
|
+
size: { type: [String, Object], required: false },
|
|
7
|
+
is: { type: null, required: false },
|
|
8
|
+
mod: { type: [Object, Array, null], required: false }
|
|
9
|
+
});
|
|
10
|
+
const style = useVarsResolver(() => ({
|
|
11
|
+
root: { "--kbd-fz": getSize(size, "kbd-fz") }
|
|
12
|
+
}));
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<Box
|
|
17
|
+
is='kbd'
|
|
18
|
+
:style='style.root'
|
|
19
|
+
:class='$style.root'
|
|
20
|
+
:mod
|
|
21
|
+
>
|
|
22
|
+
<slot />
|
|
23
|
+
</Box>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<style module>
|
|
27
|
+
.root{--kbd-fz-xs:10px;--kbd-fz-sm:12px;--kbd-fz-md:14px;--kbd-fz-lg:16px;--kbd-fz-xl:20px;--kbd-fz:var(--kbd-fz-sm);border:solid;border-radius:var(--radius-sm);border-width:1px 1px 3px;font-family:var(--font-family-monospace);font-size:var(--kbd-fz);font-weight:var(--font-weight-bold);line-height:var(--line-height);padding:.12em .45em;text-align:center;unicode-bidi:embed;@mixin where-light{background-color:var(--color-gray-0);border-color:var(--color-gray-3);color:var(--color-gray-7)}@mixin where-dark{background-color:var(--color-dark-6);border-color:var(--color-dark-4);color:var(--color-dark-0)}}
|
|
28
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AnyString, NuanceSize } from '@nui/types';
|
|
2
|
+
import type { BoxProps } from './box.vue.js';
|
|
3
|
+
export interface KbdVars {
|
|
4
|
+
root: '--kbd-fz';
|
|
5
|
+
}
|
|
6
|
+
export interface KbdProps extends BoxProps {
|
|
7
|
+
/**
|
|
8
|
+
* Controls `font-size` and `padding`
|
|
9
|
+
* @default `'sm'`
|
|
10
|
+
*/
|
|
11
|
+
size?: NuanceSize | AnyString;
|
|
12
|
+
}
|
|
13
|
+
declare var __VLS_8: {};
|
|
14
|
+
type __VLS_Slots = {} & {
|
|
15
|
+
default?: (props: typeof __VLS_8) => any;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<KbdProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KbdProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -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
|
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
import type { Classes, NuanceColor, NuanceRadius, StringOrVNode } from '../types/index.js';
|
|
3
|
+
import type { ActionIconProps } from './action-icon/action-icon.vue.js';
|
|
4
|
+
import type { BoxProps } from './box.vue.js';
|
|
5
|
+
import type { ButtonProps } from './button/button.vue.js';
|
|
6
|
+
import type { LoaderProps } from './loader/index.js';
|
|
7
|
+
export type NotificationOrientation = 'vertical' | 'horizontal';
|
|
8
|
+
export interface NotificationAction extends ButtonProps {
|
|
9
|
+
/** Button label */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Click handler */
|
|
12
|
+
onClick?: (event: MouseEvent) => void;
|
|
13
|
+
}
|
|
14
|
+
type NotificationClasses = 'root' | 'icon' | 'loader' | 'body' | 'title' | 'description' | 'actions' | 'closeButton';
|
|
15
|
+
export interface NotificationProps extends BoxProps {
|
|
16
|
+
/**
|
|
17
|
+
* Controls icon background color or notification accent line color, key of `theme.colors` or any valid CSS color.
|
|
18
|
+
* When `icon` is provided, sets the icon background color.
|
|
19
|
+
* When no icon is provided, sets the colored accent line on the left.
|
|
20
|
+
* @default theme.primaryColor
|
|
21
|
+
*/
|
|
22
|
+
color?: NuanceColor;
|
|
23
|
+
/**
|
|
24
|
+
* Key of `theme.radius` or any valid CSS value to set `border-radius`
|
|
25
|
+
* @default theme.defaultRadius
|
|
26
|
+
*/
|
|
27
|
+
radius?: NuanceRadius;
|
|
28
|
+
/** Notification icon, replaces color line */
|
|
29
|
+
icon?: string;
|
|
30
|
+
/** Notification title, displayed above the message body */
|
|
31
|
+
title?: StringOrVNode;
|
|
32
|
+
/** Notification body. When no title is provided, this is the main message. */
|
|
33
|
+
message?: StringOrVNode;
|
|
34
|
+
/** Action buttons */
|
|
35
|
+
actions?: NotificationAction[];
|
|
36
|
+
/** Actions/close layout @default 'vertical' */
|
|
37
|
+
orientation?: NotificationOrientation;
|
|
38
|
+
/** If set, displays a `Loader` component instead of the icon. Takes precedence over the `icon` prop if both are provided. */
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
/** Shows the auto-close progress bar @default false */
|
|
41
|
+
withProgress?: boolean;
|
|
42
|
+
/** Adds border to the root element */
|
|
43
|
+
withBorder?: boolean;
|
|
44
|
+
/** If set, the close button is visible @default true */
|
|
45
|
+
withCloseButton?: boolean;
|
|
46
|
+
/** Props passed down to the close button */
|
|
47
|
+
closeButtonProps?: ActionIconProps;
|
|
48
|
+
/** Props passed down to the `Loader` component */
|
|
49
|
+
loaderProps?: LoaderProps & HTMLAttributes;
|
|
50
|
+
role?: string;
|
|
51
|
+
classes?: Classes<NotificationClasses>;
|
|
52
|
+
}
|
|
53
|
+
type __VLS_Props = NotificationProps;
|
|
54
|
+
type __VLS_ModelProps = {
|
|
55
|
+
'progress'?: number;
|
|
56
|
+
};
|
|
57
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
58
|
+
declare var __VLS_8: {}, __VLS_20: {}, __VLS_38: {}, __VLS_61: {};
|
|
59
|
+
type __VLS_Slots = {} & {
|
|
60
|
+
icon?: (props: typeof __VLS_8) => any;
|
|
61
|
+
} & {
|
|
62
|
+
title?: (props: typeof __VLS_20) => any;
|
|
63
|
+
} & {
|
|
64
|
+
default?: (props: typeof __VLS_38) => any;
|
|
65
|
+
} & {
|
|
66
|
+
actions?: (props: typeof __VLS_61) => any;
|
|
67
|
+
};
|
|
68
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
69
|
+
close: () => any;
|
|
70
|
+
"update:progress": (value: number) => any;
|
|
71
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
72
|
+
onClose?: (() => any) | undefined;
|
|
73
|
+
"onUpdate:progress"?: ((value: number) => any) | undefined;
|
|
74
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
75
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
76
|
+
declare const _default: typeof __VLS_export;
|
|
77
|
+
export default _default;
|
|
78
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
79
|
+
new (): {
|
|
80
|
+
$slots: S;
|
|
81
|
+
};
|
|
82
|
+
};
|