@nuxt/ui 4.8.2 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.d.mts +7 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/Avatar.vue +1 -1
- package/dist/runtime/components/Banner.vue +0 -1
- package/dist/runtime/components/BlogPost.vue +8 -10
- package/dist/runtime/components/Calendar.d.vue.ts +40 -4
- package/dist/runtime/components/Calendar.vue +179 -61
- package/dist/runtime/components/Calendar.vue.d.ts +40 -4
- package/dist/runtime/components/ChatMessages.d.vue.ts +7 -3
- package/dist/runtime/components/ChatMessages.vue +4 -1
- package/dist/runtime/components/ChatMessages.vue.d.ts +7 -3
- package/dist/runtime/components/ChatPrompt.vue +8 -2
- package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +2 -2
- package/dist/runtime/components/ChatPromptSubmit.vue +2 -2
- package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +2 -2
- package/dist/runtime/components/CommandPalette.d.vue.ts +2 -2
- package/dist/runtime/components/CommandPalette.vue +10 -4
- package/dist/runtime/components/CommandPalette.vue.d.ts +2 -2
- package/dist/runtime/components/DashboardSearch.d.vue.ts +7 -1
- package/dist/runtime/components/DashboardSearch.vue +9 -2
- package/dist/runtime/components/DashboardSearch.vue.d.ts +7 -1
- package/dist/runtime/components/DashboardSearchButton.d.vue.ts +2 -2
- package/dist/runtime/components/DashboardSearchButton.vue +2 -2
- package/dist/runtime/components/DashboardSearchButton.vue.d.ts +2 -2
- package/dist/runtime/components/FileUpload.d.vue.ts +5 -2
- package/dist/runtime/components/FileUpload.vue +8 -6
- package/dist/runtime/components/FileUpload.vue.d.ts +5 -2
- package/dist/runtime/components/Link.d.vue.ts +1 -0
- package/dist/runtime/components/Link.vue +1 -1
- package/dist/runtime/components/Link.vue.d.ts +1 -0
- package/dist/runtime/components/Modal.d.vue.ts +6 -0
- package/dist/runtime/components/Modal.vue +3 -1
- package/dist/runtime/components/Modal.vue.d.ts +6 -0
- package/dist/runtime/components/PinInput.d.vue.ts +14 -2
- package/dist/runtime/components/PinInput.vue +36 -11
- package/dist/runtime/components/PinInput.vue.d.ts +14 -2
- package/dist/runtime/components/Popover.d.vue.ts +2 -0
- package/dist/runtime/components/Popover.vue +2 -2
- package/dist/runtime/components/Popover.vue.d.ts +2 -0
- package/dist/runtime/components/ScrollArea.d.vue.ts +8 -0
- package/dist/runtime/components/ScrollArea.vue +10 -0
- package/dist/runtime/components/ScrollArea.vue.d.ts +8 -0
- package/dist/runtime/components/Select.vue +8 -1
- package/dist/runtime/components/SelectMenu.vue +11 -4
- package/dist/runtime/components/Sidebar.d.vue.ts +5 -0
- package/dist/runtime/components/Sidebar.vue +3 -1
- package/dist/runtime/components/Sidebar.vue.d.ts +5 -0
- package/dist/runtime/components/Slideover.d.vue.ts +6 -0
- package/dist/runtime/components/Slideover.vue +3 -1
- package/dist/runtime/components/Slideover.vue.d.ts +6 -0
- package/dist/runtime/components/content/ContentSearch.d.vue.ts +7 -1
- package/dist/runtime/components/content/ContentSearch.vue +9 -2
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +7 -1
- package/dist/runtime/components/content/ContentSearchButton.d.vue.ts +2 -2
- package/dist/runtime/components/content/ContentSearchButton.vue +2 -2
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +2 -2
- package/dist/runtime/components/prose/Kbd.d.vue.ts +2 -1
- package/dist/runtime/components/prose/Kbd.vue.d.ts +2 -1
- package/dist/runtime/components/prose/Pre.vue +0 -1
- package/dist/runtime/composables/index.d.ts +1 -0
- package/dist/runtime/composables/index.js +1 -0
- package/dist/runtime/composables/useComponentProps.d.ts +3 -3
- package/dist/runtime/composables/useTour.d.ts +80 -0
- package/dist/runtime/composables/useTour.js +102 -0
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/keyframes.css +1 -1
- package/dist/runtime/locale/index.d.ts +1 -0
- package/dist/runtime/locale/index.js +1 -0
- package/dist/runtime/locale/lv.d.ts +3 -0
- package/dist/runtime/locale/lv.js +152 -0
- package/dist/runtime/plugins/colors.js +5 -4
- package/dist/runtime/types/tv.d.ts +15 -3
- package/dist/runtime/utils/tv.d.ts +41 -1
- package/dist/runtime/utils/tv.js +91 -2
- package/dist/runtime/vue/stubs/base.d.ts +1 -1
- package/dist/runtime/vue/stubs/base.js +1 -1
- package/dist/shared/{ui.C-lVg1QQ.mjs → ui.BfHSFiIO.mjs} +375 -232
- package/dist/unplugin.d.mts +8 -0
- package/dist/unplugin.mjs +2 -2
- package/dist/vite.mjs +1 -1
- package/package.json +57 -40
|
@@ -22,6 +22,7 @@ const _props = defineProps({
|
|
|
22
22
|
autofocusDelay: { type: Number, required: false, default: 0 },
|
|
23
23
|
highlight: { type: Boolean, required: false },
|
|
24
24
|
fixed: { type: Boolean, required: false },
|
|
25
|
+
separator: { type: [Number, Array], required: false },
|
|
25
26
|
class: { type: null, required: false },
|
|
26
27
|
ui: { type: Object, required: false },
|
|
27
28
|
defaultValue: { type: null, required: false },
|
|
@@ -36,6 +37,7 @@ const _props = defineProps({
|
|
|
36
37
|
type: { type: null, required: false, default: "text" }
|
|
37
38
|
});
|
|
38
39
|
const emits = defineEmits(["update:modelValue", "complete", "change", "blur"]);
|
|
40
|
+
defineSlots();
|
|
39
41
|
const props = useComponentProps("pinInput", _props);
|
|
40
42
|
const appConfig = useAppConfig();
|
|
41
43
|
const rootProps = useForwardProps(reactivePick(props, "disabled", "id", "mask", "name", "otp", "required", "type"), emits);
|
|
@@ -68,6 +70,20 @@ function autoFocus() {
|
|
|
68
70
|
inputsRef.value[0]?.$el?.focus();
|
|
69
71
|
}
|
|
70
72
|
}
|
|
73
|
+
function shouldInsertSeparator(index) {
|
|
74
|
+
if (props.separator === void 0) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
const position = index + 1;
|
|
78
|
+
if (position >= looseToNumber(props.length)) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if (Array.isArray(props.separator)) {
|
|
82
|
+
return props.separator.includes(position);
|
|
83
|
+
}
|
|
84
|
+
const separator = looseToNumber(props.separator);
|
|
85
|
+
return Number.isInteger(separator) && separator > 0 && position % separator === 0;
|
|
86
|
+
}
|
|
71
87
|
onMounted(() => {
|
|
72
88
|
setTimeout(() => {
|
|
73
89
|
autoFocus();
|
|
@@ -91,16 +107,25 @@ defineExpose({
|
|
|
91
107
|
@update:model-value="emitFormInput()"
|
|
92
108
|
@complete="onComplete"
|
|
93
109
|
>
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
<template v-for="(ids, index) in looseToNumber(props.length)" :key="ids">
|
|
111
|
+
<PinInputInput
|
|
112
|
+
:ref="(el) => setInputRef(index, el)"
|
|
113
|
+
:index="index"
|
|
114
|
+
data-slot="base"
|
|
115
|
+
:class="ui.base({ class: props.ui?.base })"
|
|
116
|
+
:disabled="disabled"
|
|
117
|
+
@blur="onBlur"
|
|
118
|
+
@focus="emitFormFocus"
|
|
119
|
+
/>
|
|
120
|
+
<span
|
|
121
|
+
v-if="shouldInsertSeparator(index)"
|
|
122
|
+
data-slot="separator"
|
|
123
|
+
role="presentation"
|
|
124
|
+
aria-hidden="true"
|
|
125
|
+
:class="ui.separator({ class: props.ui?.separator })"
|
|
126
|
+
>
|
|
127
|
+
<slot name="separator" :index="index">•</slot>
|
|
128
|
+
</span>
|
|
129
|
+
</template>
|
|
105
130
|
</PinInputRoot>
|
|
106
131
|
</template>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPublicInstance } from 'vue';
|
|
1
|
+
import type { ComponentPublicInstance, VNode } from 'vue';
|
|
2
2
|
import type { PinInputRootEmits, PinInputRootProps } from 'reka-ui';
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema';
|
|
4
4
|
import theme from '#build/ui/pin-input';
|
|
@@ -33,6 +33,13 @@ export interface PinInputProps<T extends PinInputType = 'text'> extends Pick<Pin
|
|
|
33
33
|
highlight?: boolean;
|
|
34
34
|
/** Keep the mobile text size on all breakpoints. */
|
|
35
35
|
fixed?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Group inputs by inserting a separator between them.
|
|
38
|
+
* Pass a number to insert one after every Nth input, or an array of positions to insert after specific inputs.
|
|
39
|
+
* @example 3 // after every 3rd input → [X][X][X] • [X][X][X]
|
|
40
|
+
* @example [3, 4] // after the 3rd and 4th inputs → [X][X][X] • [X] • [X][X][X]
|
|
41
|
+
*/
|
|
42
|
+
separator?: number | number[];
|
|
36
43
|
class?: any;
|
|
37
44
|
ui?: PinInput['slots'];
|
|
38
45
|
}
|
|
@@ -40,6 +47,11 @@ export type PinInputEmits<T extends PinInputType = 'text'> = PinInputRootEmits<T
|
|
|
40
47
|
change: [event: Event];
|
|
41
48
|
blur: [event: Event];
|
|
42
49
|
};
|
|
50
|
+
export interface PinInputSlots {
|
|
51
|
+
separator?(props: {
|
|
52
|
+
index: number;
|
|
53
|
+
}): VNode[];
|
|
54
|
+
}
|
|
43
55
|
declare const _default: typeof __VLS_export;
|
|
44
56
|
export default _default;
|
|
45
57
|
declare const __VLS_export: <T extends PinInputType>(__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<{
|
|
@@ -55,7 +67,7 @@ declare const __VLS_export: <T extends PinInputType>(__VLS_props: NonNullable<Aw
|
|
|
55
67
|
inputsRef: import("vue").Ref<ComponentPublicInstance[], ComponentPublicInstance[]>;
|
|
56
68
|
}>) => void;
|
|
57
69
|
attrs: any;
|
|
58
|
-
slots:
|
|
70
|
+
slots: PinInputSlots;
|
|
59
71
|
emit: ((evt: "blur", event: Event) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: [T] extends ["number"] ? number[] : string[]) => void) & ((evt: "complete", value: [T] extends ["number"] ? number[] : string[]) => void);
|
|
60
72
|
}>) => import("vue").VNode & {
|
|
61
73
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
@@ -32,6 +32,8 @@ export interface PopoverProps<M extends PopoverMode = PopoverMode> extends Popov
|
|
|
32
32
|
/**
|
|
33
33
|
* The reference (or anchor) element that is being referred to for positioning.
|
|
34
34
|
*
|
|
35
|
+
* Accepts an element or a virtual element (anything with `getBoundingClientRect`),
|
|
36
|
+
* and can be changed reactively to re-anchor the popover (e.g. for a guided tour).
|
|
35
37
|
* If not provided will use the current component as anchor.
|
|
36
38
|
*/
|
|
37
39
|
reference?: HoverCardTriggerProps['reference'];
|
|
@@ -62,7 +62,7 @@ const Component = computed(() => props.mode === "hover" ? HoverCard : Popover);
|
|
|
62
62
|
|
|
63
63
|
<template>
|
|
64
64
|
<Component.Root v-slot="{ open, close }" v-bind="rootProps">
|
|
65
|
-
<Component.Trigger v-if="!!slots.default
|
|
65
|
+
<Component.Trigger v-if="!!slots.default" as-child :class="props.class">
|
|
66
66
|
<slot :open="open" />
|
|
67
67
|
</Component.Trigger>
|
|
68
68
|
|
|
@@ -72,7 +72,7 @@ const Component = computed(() => props.mode === "hover" ? HoverCard : Popover);
|
|
|
72
72
|
|
|
73
73
|
<Component.Portal v-bind="portalProps">
|
|
74
74
|
<FieldGroupReset>
|
|
75
|
-
<Component.Content v-bind="contentProps" data-slot="content" :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })" v-on="contentEvents">
|
|
75
|
+
<Component.Content v-bind="contentProps" :reference="props.reference ?? props.content?.reference" data-slot="content" :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })" v-on="contentEvents">
|
|
76
76
|
<slot name="content" v-bind="close ? { close } : {}" />
|
|
77
77
|
|
|
78
78
|
<Component.Arrow v-if="!!props.arrow" v-bind="arrowProps" data-slot="arrow" :class="ui.arrow({ class: props.ui?.arrow })" />
|
|
@@ -32,6 +32,8 @@ export interface PopoverProps<M extends PopoverMode = PopoverMode> extends Popov
|
|
|
32
32
|
/**
|
|
33
33
|
* The reference (or anchor) element that is being referred to for positioning.
|
|
34
34
|
*
|
|
35
|
+
* Accepts an element or a virtual element (anything with `getBoundingClientRect`),
|
|
36
|
+
* and can be changed reactively to re-anchor the popover (e.g. for a guided tour).
|
|
35
37
|
* If not provided will use the current component as anchor.
|
|
36
38
|
*/
|
|
37
39
|
reference?: HoverCardTriggerProps['reference'];
|
|
@@ -51,6 +51,14 @@ export interface ScrollAreaProps<T extends ScrollAreaItem = ScrollAreaItem> {
|
|
|
51
51
|
* @defaultValue false
|
|
52
52
|
*/
|
|
53
53
|
virtualize?: boolean | ScrollAreaVirtualizeOptions;
|
|
54
|
+
/**
|
|
55
|
+
* Display fade shadows on the scrollable edges to indicate more content.
|
|
56
|
+
* Pass an object to configure the shadow size (in px).
|
|
57
|
+
* @defaultValue false
|
|
58
|
+
*/
|
|
59
|
+
shadow?: boolean | {
|
|
60
|
+
size?: number;
|
|
61
|
+
};
|
|
54
62
|
class?: any;
|
|
55
63
|
ui?: ScrollArea['slots'];
|
|
56
64
|
}
|
|
@@ -11,11 +11,13 @@ import { useAppConfig } from "#imports";
|
|
|
11
11
|
import { useComponentProps } from "../composables/useComponentProps";
|
|
12
12
|
import { tv } from "../utils/tv";
|
|
13
13
|
import { useLocale } from "../composables/useLocale";
|
|
14
|
+
import { useScrollShadow } from "../composables/useScrollShadow";
|
|
14
15
|
const _props = defineProps({
|
|
15
16
|
as: { type: null, required: false },
|
|
16
17
|
orientation: { type: null, required: false, default: "vertical" },
|
|
17
18
|
items: { type: Array, required: false },
|
|
18
19
|
virtualize: { type: [Boolean, Object], required: false, default: false },
|
|
20
|
+
shadow: { type: [Boolean, Object], required: false, default: false },
|
|
19
21
|
class: { type: null, required: false },
|
|
20
22
|
ui: { type: Object, required: false }
|
|
21
23
|
});
|
|
@@ -28,6 +30,13 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.scrollArea ||
|
|
|
28
30
|
orientation: props.orientation
|
|
29
31
|
}));
|
|
30
32
|
const rootRef = useTemplateRef("rootRef");
|
|
33
|
+
const scrollShadowStyle = props.shadow ? useScrollShadow(
|
|
34
|
+
computed(() => rootRef.value?.$el),
|
|
35
|
+
{
|
|
36
|
+
orientation: () => props.orientation ?? "vertical",
|
|
37
|
+
size: typeof props.shadow === "object" ? props.shadow.size : void 0
|
|
38
|
+
}
|
|
39
|
+
).style : void 0;
|
|
31
40
|
const isRtl = computed(() => dir.value === "rtl");
|
|
32
41
|
const isHorizontal = computed(() => props.orientation === "horizontal");
|
|
33
42
|
const isVertical = computed(() => !isHorizontal.value);
|
|
@@ -164,6 +173,7 @@ defineExpose({
|
|
|
164
173
|
data-slot="root"
|
|
165
174
|
:data-orientation="props.orientation"
|
|
166
175
|
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
176
|
+
:style="scrollShadowStyle"
|
|
167
177
|
>
|
|
168
178
|
<template v-if="virtualizer">
|
|
169
179
|
<div
|
|
@@ -51,6 +51,14 @@ export interface ScrollAreaProps<T extends ScrollAreaItem = ScrollAreaItem> {
|
|
|
51
51
|
* @defaultValue false
|
|
52
52
|
*/
|
|
53
53
|
virtualize?: boolean | ScrollAreaVirtualizeOptions;
|
|
54
|
+
/**
|
|
55
|
+
* Display fade shadows on the scrollable edges to indicate more content.
|
|
56
|
+
* Pass an object to configure the shadow size (in px).
|
|
57
|
+
* @defaultValue false
|
|
58
|
+
*/
|
|
59
|
+
shadow?: boolean | {
|
|
60
|
+
size?: number;
|
|
61
|
+
};
|
|
54
62
|
class?: any;
|
|
55
63
|
ui?: ScrollArea['slots'];
|
|
56
64
|
}
|
|
@@ -81,7 +81,8 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.select || {}
|
|
|
81
81
|
leading: isLeading.value || !!props.avatar || !!slots.leading,
|
|
82
82
|
trailing: isTrailing.value || !!slots.trailing,
|
|
83
83
|
fieldGroup: orientation.value,
|
|
84
|
-
position: position.value
|
|
84
|
+
position: position.value,
|
|
85
|
+
multiple: props.multiple
|
|
85
86
|
}));
|
|
86
87
|
const groups = computed(
|
|
87
88
|
() => props.items?.length ? isArrayOfArray(props.items) ? props.items : [props.items] : []
|
|
@@ -145,6 +146,11 @@ function onUpdateOpen(value) {
|
|
|
145
146
|
function isSelectItem(item) {
|
|
146
147
|
return typeof item === "object" && item !== null;
|
|
147
148
|
}
|
|
149
|
+
function onTriggerClick(open) {
|
|
150
|
+
if (!open) {
|
|
151
|
+
triggerRef.value?.$el?.dispatchEvent(new PointerEvent("pointerdown", { bubbles: true, button: 0 }));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
148
154
|
const viewportRef = useTemplateRef("viewportRef");
|
|
149
155
|
defineExpose({
|
|
150
156
|
triggerRef: toRef(() => triggerRef.value?.$el),
|
|
@@ -173,6 +179,7 @@ defineExpose({
|
|
|
173
179
|
data-slot="base"
|
|
174
180
|
:class="ui.base({ class: [props.ui?.base, props.class] })"
|
|
175
181
|
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
182
|
+
@click="onTriggerClick(open)"
|
|
176
183
|
>
|
|
177
184
|
<span v-if="isLeading || !!props.avatar || !!slots.leading" data-slot="leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
178
185
|
<slot name="leading" :model-value="modelValue" :open="open" :ui="ui">
|
|
@@ -119,7 +119,8 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.selectMenu ||
|
|
|
119
119
|
leading: isLeading.value || !!props.avatar || !!slots.leading,
|
|
120
120
|
trailing: isTrailing.value || !!slots.trailing,
|
|
121
121
|
fieldGroup: orientation.value,
|
|
122
|
-
virtualize: !!props.virtualize
|
|
122
|
+
virtualize: !!props.virtualize,
|
|
123
|
+
multiple: props.multiple
|
|
123
124
|
}));
|
|
124
125
|
function displayValue(value) {
|
|
125
126
|
if (props.multiple && Array.isArray(value)) {
|
|
@@ -334,10 +335,9 @@ defineExpose({
|
|
|
334
335
|
</DefineItemTemplate>
|
|
335
336
|
|
|
336
337
|
<ComboboxRoot
|
|
337
|
-
:id="id"
|
|
338
338
|
ref="comboboxRootRef"
|
|
339
339
|
v-slot="{ modelValue, open }"
|
|
340
|
-
v-bind="
|
|
340
|
+
v-bind="rootProps"
|
|
341
341
|
ignore-filter
|
|
342
342
|
as-child
|
|
343
343
|
:name="name"
|
|
@@ -346,7 +346,14 @@ defineExpose({
|
|
|
346
346
|
@update:open="onUpdateOpen"
|
|
347
347
|
>
|
|
348
348
|
<ComboboxAnchor as-child>
|
|
349
|
-
<ComboboxTrigger
|
|
349
|
+
<ComboboxTrigger
|
|
350
|
+
:id="id"
|
|
351
|
+
ref="triggerRef"
|
|
352
|
+
data-slot="base"
|
|
353
|
+
:class="ui.base({ class: [props.ui?.base, props.class] })"
|
|
354
|
+
tabindex="0"
|
|
355
|
+
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
356
|
+
>
|
|
350
357
|
<span v-if="isLeading || !!props.avatar || !!slots.leading" data-slot="leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
351
358
|
<slot name="leading" :model-value="modelValue" :open="open" :ui="ui">
|
|
352
359
|
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" data-slot="leadingIcon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
@@ -58,6 +58,11 @@ export interface SidebarProps<T extends SidebarMode = SidebarMode> {
|
|
|
58
58
|
* @defaultValue false
|
|
59
59
|
*/
|
|
60
60
|
rail?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Animate the sidebar when collapsing or expanding.
|
|
63
|
+
* @defaultValue true
|
|
64
|
+
*/
|
|
65
|
+
transition?: boolean;
|
|
61
66
|
/**
|
|
62
67
|
* The mode of the sidebar menu on mobile.
|
|
63
68
|
* @defaultValue 'slideover'
|
|
@@ -26,6 +26,7 @@ const _props = defineProps({
|
|
|
26
26
|
close: { type: [Boolean, Object], required: false, default: false },
|
|
27
27
|
closeIcon: { type: null, required: false },
|
|
28
28
|
rail: { type: Boolean, required: false, default: false },
|
|
29
|
+
transition: { type: Boolean, required: false, default: true },
|
|
29
30
|
mode: { type: null, required: false, default: "slideover" },
|
|
30
31
|
menu: { type: null, required: false },
|
|
31
32
|
class: { type: null, required: false },
|
|
@@ -83,7 +84,8 @@ const hasHeader = computed(() => !!slots.header || props.title || !!slots.title
|
|
|
83
84
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.sidebar || {} })({
|
|
84
85
|
side: props.side,
|
|
85
86
|
variant: props.variant,
|
|
86
|
-
collapsible: props.collapsible
|
|
87
|
+
collapsible: props.collapsible,
|
|
88
|
+
transition: props.transition
|
|
87
89
|
}));
|
|
88
90
|
const Menu = computed(() => ({
|
|
89
91
|
slideover: USlideover,
|
|
@@ -58,6 +58,11 @@ export interface SidebarProps<T extends SidebarMode = SidebarMode> {
|
|
|
58
58
|
* @defaultValue false
|
|
59
59
|
*/
|
|
60
60
|
rail?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Animate the sidebar when collapsing or expanding.
|
|
63
|
+
* @defaultValue true
|
|
64
|
+
*/
|
|
65
|
+
transition?: boolean;
|
|
61
66
|
/**
|
|
62
67
|
* The mode of the sidebar menu on mobile.
|
|
63
68
|
* @defaultValue 'slideover'
|
|
@@ -57,7 +57,9 @@ export interface SlideoverProps extends DialogRootProps {
|
|
|
57
57
|
ui?: Slideover['slots'];
|
|
58
58
|
}
|
|
59
59
|
export interface SlideoverEmits extends DialogRootEmits {
|
|
60
|
+
'leave': [];
|
|
60
61
|
'after:leave': [];
|
|
62
|
+
'enter': [];
|
|
61
63
|
'after:enter': [];
|
|
62
64
|
'close:prevent': [];
|
|
63
65
|
}
|
|
@@ -87,13 +89,17 @@ export interface SlideoverSlots {
|
|
|
87
89
|
declare const _default: typeof __VLS_export;
|
|
88
90
|
export default _default;
|
|
89
91
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<SlideoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
92
|
+
enter: () => any;
|
|
90
93
|
"update:open": (value: boolean) => any;
|
|
91
94
|
"after:leave": () => any;
|
|
95
|
+
leave: () => any;
|
|
92
96
|
"after:enter": () => any;
|
|
93
97
|
"close:prevent": () => any;
|
|
94
98
|
}, string, import("vue").PublicProps, Readonly<SlideoverProps> & Readonly<{
|
|
99
|
+
onEnter?: (() => any) | undefined;
|
|
95
100
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
96
101
|
"onAfter:leave"?: (() => any) | undefined;
|
|
102
|
+
onLeave?: (() => any) | undefined;
|
|
97
103
|
"onAfter:enter"?: (() => any) | undefined;
|
|
98
104
|
"onClose:prevent"?: (() => any) | undefined;
|
|
99
105
|
}>, {
|
|
@@ -33,7 +33,7 @@ const _props = defineProps({
|
|
|
33
33
|
defaultOpen: { type: Boolean, required: false },
|
|
34
34
|
modal: { type: Boolean, required: false, default: true }
|
|
35
35
|
});
|
|
36
|
-
const emits = defineEmits(["after:leave", "after:enter", "close:prevent", "update:open"]);
|
|
36
|
+
const emits = defineEmits(["leave", "after:leave", "enter", "after:enter", "close:prevent", "update:open"]);
|
|
37
37
|
const slots = defineSlots();
|
|
38
38
|
const props = useComponentProps("slideover", _props);
|
|
39
39
|
const { t } = useLocale();
|
|
@@ -78,7 +78,9 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.slideover ||
|
|
|
78
78
|
data-slot="content"
|
|
79
79
|
:class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })"
|
|
80
80
|
v-bind="contentProps"
|
|
81
|
+
@enter="emits('enter')"
|
|
81
82
|
@after-enter="emits('after:enter')"
|
|
83
|
+
@leave="emits('leave')"
|
|
82
84
|
@after-leave="emits('after:leave')"
|
|
83
85
|
v-on="contentEvents"
|
|
84
86
|
>
|
|
@@ -57,7 +57,9 @@ export interface SlideoverProps extends DialogRootProps {
|
|
|
57
57
|
ui?: Slideover['slots'];
|
|
58
58
|
}
|
|
59
59
|
export interface SlideoverEmits extends DialogRootEmits {
|
|
60
|
+
'leave': [];
|
|
60
61
|
'after:leave': [];
|
|
62
|
+
'enter': [];
|
|
61
63
|
'after:enter': [];
|
|
62
64
|
'close:prevent': [];
|
|
63
65
|
}
|
|
@@ -87,13 +89,17 @@ export interface SlideoverSlots {
|
|
|
87
89
|
declare const _default: typeof __VLS_export;
|
|
88
90
|
export default _default;
|
|
89
91
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<SlideoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
92
|
+
enter: () => any;
|
|
90
93
|
"update:open": (value: boolean) => any;
|
|
91
94
|
"after:leave": () => any;
|
|
95
|
+
leave: () => any;
|
|
92
96
|
"after:enter": () => any;
|
|
93
97
|
"close:prevent": () => any;
|
|
94
98
|
}, string, import("vue").PublicProps, Readonly<SlideoverProps> & Readonly<{
|
|
99
|
+
onEnter?: (() => any) | undefined;
|
|
95
100
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
96
101
|
"onAfter:leave"?: (() => any) | undefined;
|
|
102
|
+
onLeave?: (() => any) | undefined;
|
|
97
103
|
"onAfter:enter"?: (() => any) | undefined;
|
|
98
104
|
"onClose:prevent"?: (() => any) | undefined;
|
|
99
105
|
}>, {
|
|
@@ -3,7 +3,7 @@ import type { ContentNavigationItem } from '@nuxt/content';
|
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema';
|
|
4
4
|
import type { UseFuseOptions } from '@vueuse/integrations/useFuse';
|
|
5
5
|
import theme from '#build/ui/content/content-search';
|
|
6
|
-
import type { ButtonProps, LinkProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, IconProps, LinkPropsKeys } from '../../types';
|
|
6
|
+
import type { ButtonProps, LinkProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, IconProps, InputProps, LinkPropsKeys } from '../../types';
|
|
7
7
|
import type { ComponentConfig } from '../../types/tv';
|
|
8
8
|
type ContentSearch = ComponentConfig<typeof theme, AppConfig, 'contentSearch'>;
|
|
9
9
|
export interface ContentSearchLink extends Omit<LinkProps, 'custom'> {
|
|
@@ -56,6 +56,12 @@ export interface ContentSearchProps<T extends ContentSearchLink = ContentSearchL
|
|
|
56
56
|
* @defaultValue true
|
|
57
57
|
*/
|
|
58
58
|
close?: boolean | Omit<ButtonProps, LinkPropsKeys>;
|
|
59
|
+
/**
|
|
60
|
+
* Configure the input or hide it with `false`.
|
|
61
|
+
* `{ fixed: true }`{lang="ts-type"}
|
|
62
|
+
* @defaultValue true
|
|
63
|
+
*/
|
|
64
|
+
input?: boolean | Omit<InputProps, 'modelValue' | 'defaultValue'>;
|
|
59
65
|
/**
|
|
60
66
|
* Keyboard shortcut to open the search (used by [`defineShortcuts`](https://ui.nuxt.com/docs/composables/define-shortcuts))
|
|
61
67
|
* @defaultValue 'meta_k'
|
|
@@ -18,6 +18,7 @@ import UCommandPalette from "../CommandPalette.vue";
|
|
|
18
18
|
const _props = defineProps({
|
|
19
19
|
size: { type: null, required: false },
|
|
20
20
|
close: { type: [Boolean, Object], required: false, default: true },
|
|
21
|
+
input: { type: [Boolean, Object], required: false },
|
|
21
22
|
shortcut: { type: String, required: false, default: "meta_k" },
|
|
22
23
|
links: { type: Array, required: false },
|
|
23
24
|
navigation: { type: Array, required: false },
|
|
@@ -38,7 +39,7 @@ const _props = defineProps({
|
|
|
38
39
|
fullscreen: { type: Boolean, required: false, default: false },
|
|
39
40
|
modal: { type: Boolean, required: false },
|
|
40
41
|
portal: { type: [Boolean, String], required: false, skipCheck: true },
|
|
41
|
-
icon: { type:
|
|
42
|
+
icon: { type: [String, Boolean], required: false, skipCheck: true },
|
|
42
43
|
trailingIcon: { type: null, required: false },
|
|
43
44
|
selectedIcon: { type: null, required: false },
|
|
44
45
|
childrenIcon: { type: null, required: false },
|
|
@@ -66,6 +67,12 @@ const colorMode = useColorMode();
|
|
|
66
67
|
const appConfig = useAppConfig();
|
|
67
68
|
const commandPaletteProps = useForwardProps(reactivePick(props, "size", "icon", "trailingIcon", "selectedIcon", "childrenIcon", "placeholder", "autofocus", "loading", "loadingIcon", "close", "closeIcon", "back", "backIcon", "disabled", "highlightOnHover", "labelKey", "descriptionKey", "preserveGroupOrder", "virtualize", "searchDelay"));
|
|
68
69
|
const modalProps = useForwardProps(reactivePick(props, "overlay", "transition", "content", "dismissible", "fullscreen", "modal", "portal"));
|
|
70
|
+
const inputProps = computed(() => {
|
|
71
|
+
if (props.input === false) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
return defu(typeof props.input === "object" ? props.input : {}, { fixed: true });
|
|
75
|
+
});
|
|
69
76
|
const getProxySlots = () => omit(slots, ["content"]);
|
|
70
77
|
const fuse = computed(() => defu({}, props.fuse, {
|
|
71
78
|
fuseOptions: {
|
|
@@ -220,7 +227,7 @@ defineExpose({
|
|
|
220
227
|
v-bind="commandPaletteProps"
|
|
221
228
|
:groups="groups"
|
|
222
229
|
:fuse="fuse"
|
|
223
|
-
:input="
|
|
230
|
+
:input="inputProps"
|
|
224
231
|
:ui="transformUI(omit(ui, ['modal']), props.ui)"
|
|
225
232
|
@update:model-value="onSelect"
|
|
226
233
|
@update:open="open = $event"
|
|
@@ -3,7 +3,7 @@ import type { ContentNavigationItem } from '@nuxt/content';
|
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema';
|
|
4
4
|
import type { UseFuseOptions } from '@vueuse/integrations/useFuse';
|
|
5
5
|
import theme from '#build/ui/content/content-search';
|
|
6
|
-
import type { ButtonProps, LinkProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, IconProps, LinkPropsKeys } from '../../types';
|
|
6
|
+
import type { ButtonProps, LinkProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, IconProps, InputProps, LinkPropsKeys } from '../../types';
|
|
7
7
|
import type { ComponentConfig } from '../../types/tv';
|
|
8
8
|
type ContentSearch = ComponentConfig<typeof theme, AppConfig, 'contentSearch'>;
|
|
9
9
|
export interface ContentSearchLink extends Omit<LinkProps, 'custom'> {
|
|
@@ -56,6 +56,12 @@ export interface ContentSearchProps<T extends ContentSearchLink = ContentSearchL
|
|
|
56
56
|
* @defaultValue true
|
|
57
57
|
*/
|
|
58
58
|
close?: boolean | Omit<ButtonProps, LinkPropsKeys>;
|
|
59
|
+
/**
|
|
60
|
+
* Configure the input or hide it with `false`.
|
|
61
|
+
* `{ fixed: true }`{lang="ts-type"}
|
|
62
|
+
* @defaultValue true
|
|
63
|
+
*/
|
|
64
|
+
input?: boolean | Omit<InputProps, 'modelValue' | 'defaultValue'>;
|
|
59
65
|
/**
|
|
60
66
|
* Keyboard shortcut to open the search (used by [`defineShortcuts`](https://ui.nuxt.com/docs/composables/define-shortcuts))
|
|
61
67
|
* @defaultValue 'meta_k'
|
|
@@ -5,11 +5,11 @@ import type { ComponentConfig } from '../../types/tv';
|
|
|
5
5
|
type ContentSearchButton = ComponentConfig<typeof theme, AppConfig, 'contentSearchButton'>;
|
|
6
6
|
export interface ContentSearchButtonProps extends Omit<ButtonProps, LinkPropsKeys | 'icon' | 'label' | 'color' | 'variant'> {
|
|
7
7
|
/**
|
|
8
|
-
* The icon displayed in the button.
|
|
8
|
+
* The icon displayed in the button. Set to `false` to hide the icon.
|
|
9
9
|
* @defaultValue appConfig.ui.icons.search
|
|
10
10
|
* @IconifyIcon
|
|
11
11
|
*/
|
|
12
|
-
icon?: IconProps['name'];
|
|
12
|
+
icon?: IconProps['name'] | false;
|
|
13
13
|
/**
|
|
14
14
|
* The label displayed in the button.
|
|
15
15
|
* @defaultValue t('contentSearchButton.label')
|
|
@@ -18,7 +18,7 @@ import UKbd from "../Kbd.vue";
|
|
|
18
18
|
import UTooltip from "../Tooltip.vue";
|
|
19
19
|
defineOptions({ inheritAttrs: false });
|
|
20
20
|
const _props = defineProps({
|
|
21
|
-
icon: { type:
|
|
21
|
+
icon: { type: [String, Boolean], required: false, skipCheck: true },
|
|
22
22
|
label: { type: String, required: false },
|
|
23
23
|
color: { type: null, required: false, default: "neutral" },
|
|
24
24
|
variant: { type: null, required: false },
|
|
@@ -64,7 +64,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.contentSearch
|
|
|
64
64
|
<template>
|
|
65
65
|
<DefineButtonTemplate>
|
|
66
66
|
<UButton
|
|
67
|
-
:icon="props.icon
|
|
67
|
+
:icon="props.icon === false ? void 0 : props.icon ?? appConfig.ui.icons.search"
|
|
68
68
|
:label="props.label || t('contentSearchButton.label')"
|
|
69
69
|
:variant="props.variant || (props.collapsed ? 'ghost' : 'outline')"
|
|
70
70
|
v-bind="{
|
|
@@ -5,11 +5,11 @@ import type { ComponentConfig } from '../../types/tv';
|
|
|
5
5
|
type ContentSearchButton = ComponentConfig<typeof theme, AppConfig, 'contentSearchButton'>;
|
|
6
6
|
export interface ContentSearchButtonProps extends Omit<ButtonProps, LinkPropsKeys | 'icon' | 'label' | 'color' | 'variant'> {
|
|
7
7
|
/**
|
|
8
|
-
* The icon displayed in the button.
|
|
8
|
+
* The icon displayed in the button. Set to `false` to hide the icon.
|
|
9
9
|
* @defaultValue appConfig.ui.icons.search
|
|
10
10
|
* @IconifyIcon
|
|
11
11
|
*/
|
|
12
|
-
icon?: IconProps['name'];
|
|
12
|
+
icon?: IconProps['name'] | false;
|
|
13
13
|
/**
|
|
14
14
|
* The label displayed in the button.
|
|
15
15
|
* @defaultValue t('contentSearchButton.label')
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
1
2
|
export interface ProseKbdProps {
|
|
2
3
|
value?: string;
|
|
3
4
|
class?: any;
|
|
@@ -6,7 +7,7 @@ export interface ProseKbdProps {
|
|
|
6
7
|
};
|
|
7
8
|
}
|
|
8
9
|
export interface ProseKbdSlots {
|
|
9
|
-
default?(props?: {}):
|
|
10
|
+
default?(props?: {}): VNode[];
|
|
10
11
|
}
|
|
11
12
|
declare const _default: typeof __VLS_export;
|
|
12
13
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
1
2
|
export interface ProseKbdProps {
|
|
2
3
|
value?: string;
|
|
3
4
|
class?: any;
|
|
@@ -6,7 +7,7 @@ export interface ProseKbdProps {
|
|
|
6
7
|
};
|
|
7
8
|
}
|
|
8
9
|
export interface ProseKbdSlots {
|
|
9
|
-
default?(props?: {}):
|
|
10
|
+
default?(props?: {}): VNode[];
|
|
10
11
|
}
|
|
11
12
|
declare const _default: typeof __VLS_export;
|
|
12
13
|
export default _default;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ComputedRef } from 'vue';
|
|
2
|
-
import type { ClassValue } from 'tailwind-variants';
|
|
3
2
|
import type * as ComponentTypes from '../types';
|
|
3
|
+
import type { SlotClass } from '../types/tv';
|
|
4
4
|
import type * as ui from '#build/ui';
|
|
5
5
|
type ThemeSlotOverrides<T> = T extends {
|
|
6
6
|
slots: infer S extends Record<string, any>;
|
|
7
7
|
} ? {
|
|
8
|
-
[K in keyof S]?:
|
|
8
|
+
[K in keyof S]?: SlotClass;
|
|
9
9
|
} : {
|
|
10
|
-
[K in keyof T]?: T[K] extends any[] ?
|
|
10
|
+
[K in keyof T]?: T[K] extends any[] ? SlotClass : T[K] extends Record<string, any> ? ThemeSlotOverrides<T[K]> : SlotClass;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Flat slot-class override shape: `{ button: { base: '...' }, modal: {...} }`.
|