@byyuurin/ui 0.2.0 → 0.3.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/LICENSE +20 -20
- package/README.md +5 -3
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/Accordion.vue +41 -41
- package/dist/runtime/components/Accordion.vue.d.ts +11 -7
- package/dist/runtime/components/Alert.vue +63 -63
- package/dist/runtime/components/Alert.vue.d.ts +4 -4
- package/dist/runtime/components/App.vue +11 -10
- package/dist/runtime/components/App.vue.d.ts +11 -7
- package/dist/runtime/components/Avatar.vue +29 -29
- package/dist/runtime/components/Avatar.vue.d.ts +4 -3
- package/dist/runtime/components/AvatarGroup.vue +4 -4
- package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Badge.vue +32 -32
- package/dist/runtime/components/Badge.vue.d.ts +2 -2
- package/dist/runtime/components/Breadcrumb.vue +49 -49
- package/dist/runtime/components/Breadcrumb.vue.d.ts +10 -6
- package/dist/runtime/components/Button.vue +52 -51
- package/dist/runtime/components/Button.vue.d.ts +1 -1
- package/dist/runtime/components/Calendar.vue +74 -74
- package/dist/runtime/components/Calendar.vue.d.ts +16 -12
- package/dist/runtime/components/Card.vue +41 -41
- package/dist/runtime/components/Card.vue.d.ts +1 -1
- package/dist/runtime/components/Carousel.vue +66 -66
- package/dist/runtime/components/Carousel.vue.d.ts +14 -10
- package/dist/runtime/components/Checkbox.vue +46 -46
- package/dist/runtime/components/Checkbox.vue.d.ts +4 -3
- package/dist/runtime/components/CheckboxGroup.vue +29 -29
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +11 -7
- package/dist/runtime/components/Chip.vue +15 -15
- package/dist/runtime/components/Chip.vue.d.ts +2 -2
- package/dist/runtime/components/Collapsible.vue +14 -14
- package/dist/runtime/components/Collapsible.vue.d.ts +2 -2
- package/dist/runtime/components/Drawer.vue +76 -76
- package/dist/runtime/components/Drawer.vue.d.ts +6 -6
- package/dist/runtime/components/DropdownMenu.vue +28 -28
- package/dist/runtime/components/DropdownMenu.vue.d.ts +17 -9
- package/dist/runtime/components/DropdownMenuContent.vue +152 -153
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +11 -7
- package/dist/runtime/components/FieldGroup.vue +3 -3
- package/dist/runtime/components/FieldGroup.vue.d.ts +2 -2
- package/dist/runtime/components/Form.vue +9 -9
- package/dist/runtime/components/Form.vue.d.ts +13 -8
- package/dist/runtime/components/FormField.vue +39 -38
- package/dist/runtime/components/FormField.vue.d.ts +7 -2
- package/dist/runtime/components/Icon.vue +2 -2
- package/dist/runtime/components/Icon.vue.d.ts +1 -1
- package/dist/runtime/components/Input.vue +48 -48
- package/dist/runtime/components/Input.vue.d.ts +16 -12
- package/dist/runtime/components/InputNumber.vue +47 -47
- package/dist/runtime/components/InputNumber.vue.d.ts +128 -124
- package/dist/runtime/components/InputTags.vue +54 -53
- package/dist/runtime/components/InputTags.vue.d.ts +16 -11
- package/dist/runtime/components/Kbd.vue +3 -3
- package/dist/runtime/components/Kbd.vue.d.ts +2 -2
- package/dist/runtime/components/Link.vue +26 -25
- package/dist/runtime/components/Link.vue.d.ts +16 -6
- package/dist/runtime/components/LinkBase.vue +3 -3
- package/dist/runtime/components/LinkBase.vue.d.ts +2 -2
- package/dist/runtime/components/Marquee.vue +5 -5
- package/dist/runtime/components/Marquee.vue.d.ts +3 -3
- package/dist/runtime/components/Modal.vue +74 -74
- package/dist/runtime/components/Modal.vue.d.ts +6 -6
- package/dist/runtime/components/NavigationMenu.vue +228 -228
- package/dist/runtime/components/NavigationMenu.vue.d.ts +11 -7
- package/dist/runtime/components/OverlayProvider.vue +9 -9
- package/dist/runtime/components/Pagination.vue +47 -47
- package/dist/runtime/components/Pagination.vue.d.ts +4 -4
- package/dist/runtime/components/PinInput.vue +23 -23
- package/dist/runtime/components/PinInput.vue.d.ts +14 -10
- package/dist/runtime/components/Popover.vue +22 -22
- package/dist/runtime/components/Popover.vue.d.ts +11 -7
- package/dist/runtime/components/Progress.vue +25 -25
- package/dist/runtime/components/Progress.vue.d.ts +2 -2
- package/dist/runtime/components/RadioGroup.vue +50 -50
- package/dist/runtime/components/RadioGroup.vue.d.ts +11 -7
- package/dist/runtime/components/ScrollArea.vue +32 -32
- package/dist/runtime/components/ScrollArea.vue.d.ts +2 -2
- package/dist/runtime/components/Select.vue +299 -148
- package/dist/runtime/components/Select.vue.d.ts +103 -123
- package/dist/runtime/components/Separator.vue +30 -30
- package/dist/runtime/components/Separator.vue.d.ts +2 -2
- package/dist/runtime/components/Skeleton.vue +11 -11
- package/dist/runtime/components/Skeleton.vue.d.ts +2 -2
- package/dist/runtime/components/Slider.vue +25 -25
- package/dist/runtime/components/Slider.vue.d.ts +11 -7
- package/dist/runtime/components/Stepper.vue +116 -0
- package/dist/runtime/components/Stepper.vue.d.ts +83 -0
- package/dist/runtime/components/Switch.vue +30 -30
- package/dist/runtime/components/Switch.vue.d.ts +4 -3
- package/dist/runtime/components/Table.vue +137 -137
- package/dist/runtime/components/Table.vue.d.ts +13 -8
- package/dist/runtime/components/Tabs.vue +74 -74
- package/dist/runtime/components/Tabs.vue.d.ts +12 -8
- package/dist/runtime/components/Textarea.vue +47 -47
- package/dist/runtime/components/Textarea.vue.d.ts +16 -11
- package/dist/runtime/components/Timeline.vue +47 -47
- package/dist/runtime/components/Timeline.vue.d.ts +11 -7
- package/dist/runtime/components/Toast.vue +93 -93
- package/dist/runtime/components/Toast.vue.d.ts +5 -5
- package/dist/runtime/components/ToastProvider.vue +29 -29
- package/dist/runtime/components/ToastProvider.vue.d.ts +3 -3
- package/dist/runtime/components/Tooltip.vue +24 -25
- package/dist/runtime/components/Tooltip.vue.d.ts +2 -2
- package/dist/runtime/components/Tree.vue +241 -0
- package/dist/runtime/components/Tree.vue.d.ts +121 -0
- package/dist/runtime/composables/defineShortcuts.d.ts +1 -0
- package/dist/runtime/composables/defineShortcuts.js +44 -8
- package/dist/runtime/composables/useLocale.d.ts +12 -0
- package/dist/runtime/locale/en.d.ts +6 -0
- package/dist/runtime/locale/en.js +6 -0
- package/dist/runtime/locale/zh_tw.d.ts +6 -0
- package/dist/runtime/locale/zh_tw.js +6 -0
- package/dist/runtime/types/html.d.ts +8 -0
- package/dist/runtime/types/html.js +0 -0
- package/dist/runtime/types/index.d.ts +2 -0
- package/dist/runtime/types/index.js +2 -0
- package/dist/runtime/types/input.d.ts +5 -5
- package/dist/runtime/types/locale.d.ts +6 -0
- package/dist/runtime/types/unocss.d.ts +4 -4
- package/dist/runtime/types/utils.d.ts +3 -3
- package/dist/runtime/utils/index.d.ts +3 -3
- package/dist/runtime/utils/link.d.ts +2 -1
- package/dist/runtime/utils/link.js +40 -29
- package/dist/runtime/vue/components/Icon.vue +2 -2
- package/dist/runtime/vue/components/Icon.vue.d.ts +1 -1
- package/dist/runtime/vue/components/Link.vue +7 -12
- package/dist/runtime/vue/components/Link.vue.d.ts +11 -40
- package/dist/setup.d.mts +1 -1
- package/dist/shared/{ui.CzIlLITK.mjs → ui.9kQouwss.mjs} +5 -3
- package/dist/shared/{ui.DpbffTXs.d.mts → ui.D8Bg1HWt.d.mts} +2 -0
- package/dist/shared/{ui.DLOxhmP0.mjs → ui.DpkP12cX.mjs} +262 -17
- package/dist/unocss.mjs +1 -1
- package/dist/unplugin.d.mts +1 -1
- package/dist/unplugin.mjs +2 -2
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +2 -2
- package/package.json +29 -29
- package/vue-plugin.d.ts +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PrimitiveProps } from 'reka-ui';
|
|
2
|
-
import type { ButtonHTMLAttributes } from 'vue';
|
|
3
2
|
import type { RouteLocationRaw, RouterLinkProps } from 'vue-router';
|
|
4
3
|
import type { ComponentBaseProps } from '../types';
|
|
4
|
+
import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from '../types/html';
|
|
5
5
|
import type { StaticSlot } from '../types/utils';
|
|
6
6
|
interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
|
|
7
7
|
/**
|
|
@@ -19,11 +19,11 @@ interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
|
|
|
19
19
|
/**
|
|
20
20
|
* Where to display the linked URL, as the name for a browsing context.
|
|
21
21
|
*/
|
|
22
|
-
target?: '_blank' | '_parent' | '_self' | '_top' | (string & {});
|
|
22
|
+
target?: '_blank' | '_parent' | '_self' | '_top' | (string & {}) | null;
|
|
23
23
|
/**
|
|
24
24
|
* A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
|
|
25
25
|
*/
|
|
26
|
-
rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {});
|
|
26
|
+
rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null;
|
|
27
27
|
/**
|
|
28
28
|
* If set to true, no rel attribute will be added to the link
|
|
29
29
|
*/
|
|
@@ -47,8 +47,13 @@ interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
|
|
|
47
47
|
* Escape hatch to disable `prefetch` attribute.
|
|
48
48
|
*/
|
|
49
49
|
noPrefetch?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* An option to either add or remove trailing slashes in the `href` for this specific link.
|
|
52
|
+
* Overrides the global `trailingSlash` option if provided.
|
|
53
|
+
*/
|
|
54
|
+
trailingSlash?: 'append' | 'remove';
|
|
50
55
|
}
|
|
51
|
-
export interface LinkProps extends ComponentBaseProps, NuxtLinkProps {
|
|
56
|
+
export interface LinkProps extends ComponentBaseProps, Omit<NuxtLinkProps, 'custom'>, /** @vue-ignore */ Omit<ButtonHTMLAttributes, 'type' | 'disabled'>, /** @vue-ignore */ Omit<AnchorHTMLAttributes, 'href' | 'target' | 'rel' | 'type'> {
|
|
52
57
|
/**
|
|
53
58
|
* The element or component this component should render as when not a link.
|
|
54
59
|
* @default "button"
|
|
@@ -75,19 +80,24 @@ export interface LinkProps extends ComponentBaseProps, NuxtLinkProps {
|
|
|
75
80
|
/** When `true`, only styles from `class`, `activeClass`, and `inactiveClass` will be applied. */
|
|
76
81
|
raw?: boolean;
|
|
77
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Link-related props that can be omitted from ButtonProps when link functionality is not needed.
|
|
85
|
+
* Use this with `Omit<ButtonProps, LinkPropsKeys>` in components where buttons should not act as links.
|
|
86
|
+
*/
|
|
87
|
+
export type LinkPropsKeys = 'to' | 'href' | 'target' | 'rel' | 'noRel' | 'external' | 'prefetch' | 'prefetchOn' | 'prefetchedClass' | 'noPrefetch' | 'trailingSlash' | 'replace' | 'ariaCurrentValue' | 'active' | 'activeClass' | 'exact' | 'exactQuery' | 'exactHash' | 'inactiveClass' | 'download' | 'ping' | 'referrerpolicy' | 'hreflang' | 'media';
|
|
78
88
|
export interface LinkSlots {
|
|
79
89
|
default: StaticSlot<{
|
|
80
90
|
active: boolean;
|
|
81
91
|
}>;
|
|
82
92
|
}
|
|
93
|
+
declare const _default: typeof __VLS_export;
|
|
94
|
+
export default _default;
|
|
83
95
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkProps> & Readonly<{}>, {
|
|
84
96
|
active: boolean;
|
|
85
97
|
type: "reset" | "submit" | "button";
|
|
86
98
|
ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
|
|
87
99
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
88
100
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
|
|
89
|
-
declare const _default: typeof __VLS_export;
|
|
90
|
-
export default _default;
|
|
91
101
|
type __VLS_WithSlots<T, S> = T & {
|
|
92
102
|
new (): {
|
|
93
103
|
$slots: S;
|
|
@@ -18,14 +18,14 @@ export interface LinkBaseProps {
|
|
|
18
18
|
active?: boolean;
|
|
19
19
|
isExternal?: boolean;
|
|
20
20
|
}
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
21
23
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkBaseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkBaseProps> & Readonly<{}>, {
|
|
22
24
|
type: string;
|
|
23
25
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
24
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
25
27
|
default?: (props: {}) => any;
|
|
26
28
|
}>;
|
|
27
|
-
declare const _default: typeof __VLS_export;
|
|
28
|
-
export default _default;
|
|
29
29
|
type __VLS_WithSlots<T, S> = T & {
|
|
30
30
|
new (): {
|
|
31
31
|
$slots: S;
|
|
@@ -26,11 +26,11 @@ const ui = computed(() => {
|
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
28
|
<template>
|
|
29
|
-
<Primitive :as="props.as" :data-orientation="props.orientation" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
30
|
-
<div v-for="i in props.repeat" :key="i" :class="ui.content({ class: props.ui?.content })" data-part="content">
|
|
31
|
-
<slot></slot>
|
|
32
|
-
</div>
|
|
33
|
-
</Primitive>
|
|
29
|
+
<Primitive :as="props.as" :data-orientation="props.orientation" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
30
|
+
<div v-for="i in props.repeat" :key="i" :class="ui.content({ class: props.ui?.content })" data-part="content">
|
|
31
|
+
<slot></slot>
|
|
32
|
+
</div>
|
|
33
|
+
</Primitive>
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<style>
|
|
@@ -40,13 +40,13 @@ export interface MarqueeProps extends ComponentBaseProps {
|
|
|
40
40
|
export interface MarqueeSlots {
|
|
41
41
|
default: StaticSlot;
|
|
42
42
|
}
|
|
43
|
+
declare const _default: typeof __VLS_export;
|
|
44
|
+
export default _default;
|
|
43
45
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<MarqueeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MarqueeProps> & Readonly<{}>, {
|
|
44
|
-
overlay: boolean;
|
|
45
46
|
repeat: number;
|
|
46
47
|
orientation: "horizontal" | "vertical";
|
|
48
|
+
overlay: boolean;
|
|
47
49
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, MarqueeSlots>;
|
|
48
|
-
declare const _default: typeof __VLS_export;
|
|
49
|
-
export default _default;
|
|
50
50
|
type __VLS_WithSlots<T, S> = T & {
|
|
51
51
|
new (): {
|
|
52
52
|
$slots: S;
|
|
@@ -57,78 +57,78 @@ const ui = computed(() => {
|
|
|
57
57
|
</script>
|
|
58
58
|
|
|
59
59
|
<template>
|
|
60
|
-
<DialogRoot v-slot="{ open, close }" v-bind="rootProps">
|
|
61
|
-
<DialogTrigger v-if="!!slots.default" as-child :class="props.class">
|
|
62
|
-
<slot :open="open"></slot>
|
|
63
|
-
</DialogTrigger>
|
|
64
|
-
|
|
65
|
-
<DialogPortal v-bind="portalProps">
|
|
66
|
-
<DialogOverlay v-if="props.overlay" :class="ui.overlay({ class: props.ui?.overlay })" data-part="overlay" />
|
|
67
|
-
|
|
68
|
-
<DialogContent
|
|
69
|
-
:class="ui.content({ class: [props.ui?.content, !slots.default && props.class] })"
|
|
70
|
-
v-bind="contentProps"
|
|
71
|
-
data-part="content"
|
|
72
|
-
@after-enter="emit('after-enter')"
|
|
73
|
-
@after-leave="emit('after-leave')"
|
|
74
|
-
v-on="contentEvents"
|
|
75
|
-
>
|
|
76
|
-
<VisuallyHidden v-if="!!slots.content || !!slots.header || !props.title && !slots.title">
|
|
77
|
-
<DialogTitle />
|
|
78
|
-
</VisuallyHidden>
|
|
79
|
-
|
|
80
|
-
<slot name="content" :close="close">
|
|
81
|
-
<div
|
|
82
|
-
v-if="slots.header || props.title || slots.title || props.description || slots.description || props.close || slots.close"
|
|
83
|
-
:class="ui.header({ class: props.ui?.header })"
|
|
84
|
-
data-part="header"
|
|
85
|
-
>
|
|
86
|
-
<slot name="header" :close="close">
|
|
87
|
-
<DialogTitle
|
|
88
|
-
v-if="props.title || slots.title"
|
|
89
|
-
:class="ui.title({ class: props.ui?.title })"
|
|
90
|
-
data-part="title"
|
|
91
|
-
>
|
|
92
|
-
<slot name="title">
|
|
93
|
-
{{ props.title }}
|
|
94
|
-
</slot>
|
|
95
|
-
</DialogTitle>
|
|
96
|
-
|
|
97
|
-
<DialogClose v-if="props.close || slots.close" as-child>
|
|
98
|
-
<slot name="close" :close="close" :ui="ui">
|
|
99
|
-
<Button
|
|
100
|
-
variant="ghost"
|
|
101
|
-
color="neutral"
|
|
102
|
-
:icon="props.closeIcon || appConfig.ui.icons.close"
|
|
103
|
-
v-bind="typeof props.close === '
|
|
104
|
-
:aria-label="t('modal.close')"
|
|
105
|
-
:class="ui.close({ class: props.ui?.close })"
|
|
106
|
-
data-part="close"
|
|
107
|
-
/>
|
|
108
|
-
</slot>
|
|
109
|
-
</DialogClose>
|
|
110
|
-
|
|
111
|
-
<DialogDescription
|
|
112
|
-
v-if="props.description || slots.description"
|
|
113
|
-
:class="ui.description({ class: props.ui?.description })"
|
|
114
|
-
data-part="description"
|
|
115
|
-
>
|
|
116
|
-
<slot name="description">
|
|
117
|
-
{{ props.description }}
|
|
118
|
-
</slot>
|
|
119
|
-
</DialogDescription>
|
|
120
|
-
</slot>
|
|
121
|
-
</div>
|
|
122
|
-
|
|
123
|
-
<div v-if="slots.body" :class="ui.body({ class: props.ui?.body })" data-part="body">
|
|
124
|
-
<slot name="body" :close="close"></slot>
|
|
125
|
-
</div>
|
|
126
|
-
|
|
127
|
-
<div v-if="slots.footer" :class="ui.footer({ class: props.ui?.footer })" data-part="footer">
|
|
128
|
-
<slot name="footer" :close="close"></slot>
|
|
129
|
-
</div>
|
|
130
|
-
</slot>
|
|
131
|
-
</DialogContent>
|
|
132
|
-
</DialogPortal>
|
|
133
|
-
</DialogRoot>
|
|
60
|
+
<DialogRoot v-slot="{ open, close }" v-bind="rootProps">
|
|
61
|
+
<DialogTrigger v-if="!!slots.default" as-child :class="props.class">
|
|
62
|
+
<slot :open="open"></slot>
|
|
63
|
+
</DialogTrigger>
|
|
64
|
+
|
|
65
|
+
<DialogPortal v-bind="portalProps">
|
|
66
|
+
<DialogOverlay v-if="props.overlay" :class="ui.overlay({ class: props.ui?.overlay })" data-part="overlay" />
|
|
67
|
+
|
|
68
|
+
<DialogContent
|
|
69
|
+
:class="ui.content({ class: [props.ui?.content, !slots.default && props.class] })"
|
|
70
|
+
v-bind="contentProps"
|
|
71
|
+
data-part="content"
|
|
72
|
+
@after-enter="emit('after-enter')"
|
|
73
|
+
@after-leave="emit('after-leave')"
|
|
74
|
+
v-on="contentEvents"
|
|
75
|
+
>
|
|
76
|
+
<VisuallyHidden v-if="!!slots.content || !!slots.header || !props.title && !slots.title">
|
|
77
|
+
<DialogTitle />
|
|
78
|
+
</VisuallyHidden>
|
|
79
|
+
|
|
80
|
+
<slot name="content" :close="close">
|
|
81
|
+
<div
|
|
82
|
+
v-if="slots.header || props.title || slots.title || props.description || slots.description || props.close || slots.close"
|
|
83
|
+
:class="ui.header({ class: props.ui?.header })"
|
|
84
|
+
data-part="header"
|
|
85
|
+
>
|
|
86
|
+
<slot name="header" :close="close">
|
|
87
|
+
<DialogTitle
|
|
88
|
+
v-if="props.title || slots.title"
|
|
89
|
+
:class="ui.title({ class: props.ui?.title })"
|
|
90
|
+
data-part="title"
|
|
91
|
+
>
|
|
92
|
+
<slot name="title">
|
|
93
|
+
{{ props.title }}
|
|
94
|
+
</slot>
|
|
95
|
+
</DialogTitle>
|
|
96
|
+
|
|
97
|
+
<DialogClose v-if="props.close || slots.close" as-child>
|
|
98
|
+
<slot name="close" :close="close" :ui="ui">
|
|
99
|
+
<Button
|
|
100
|
+
variant="ghost"
|
|
101
|
+
color="neutral"
|
|
102
|
+
:icon="props.closeIcon || appConfig.ui.icons.close"
|
|
103
|
+
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
104
|
+
:aria-label="t('modal.close')"
|
|
105
|
+
:class="ui.close({ class: props.ui?.close })"
|
|
106
|
+
data-part="close"
|
|
107
|
+
/>
|
|
108
|
+
</slot>
|
|
109
|
+
</DialogClose>
|
|
110
|
+
|
|
111
|
+
<DialogDescription
|
|
112
|
+
v-if="props.description || slots.description"
|
|
113
|
+
:class="ui.description({ class: props.ui?.description })"
|
|
114
|
+
data-part="description"
|
|
115
|
+
>
|
|
116
|
+
<slot name="description">
|
|
117
|
+
{{ props.description }}
|
|
118
|
+
</slot>
|
|
119
|
+
</DialogDescription>
|
|
120
|
+
</slot>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<div v-if="slots.body" :class="ui.body({ class: props.ui?.body })" data-part="body">
|
|
124
|
+
<slot name="body" :close="close"></slot>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div v-if="slots.footer" :class="ui.footer({ class: props.ui?.footer })" data-part="footer">
|
|
128
|
+
<slot name="footer" :close="close"></slot>
|
|
129
|
+
</div>
|
|
130
|
+
</slot>
|
|
131
|
+
</DialogContent>
|
|
132
|
+
</DialogPortal>
|
|
133
|
+
</DialogRoot>
|
|
134
134
|
</template>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DialogContentEmits, DialogContentProps, DialogRootEmits, DialogRootProps } from 'reka-ui';
|
|
2
2
|
import theme from '#build/ui/modal';
|
|
3
|
-
import type { ButtonProps, ComponentBaseProps, ComponentStyler, ComponentUIProps, IconProps } from '../types';
|
|
3
|
+
import type { ButtonProps, ComponentBaseProps, ComponentStyler, ComponentUIProps, IconProps, LinkPropsKeys } from '../types';
|
|
4
4
|
import type { EmitsToProps, StaticSlot } from '../types/utils';
|
|
5
5
|
export interface ModalProps extends ComponentBaseProps, DialogRootProps {
|
|
6
6
|
title?: string;
|
|
@@ -31,7 +31,7 @@ export interface ModalProps extends ComponentBaseProps, DialogRootProps {
|
|
|
31
31
|
* Display a close button to dismiss the modal.
|
|
32
32
|
* @default true
|
|
33
33
|
*/
|
|
34
|
-
close?: boolean |
|
|
34
|
+
close?: boolean | Omit<ButtonProps, LinkPropsKeys>;
|
|
35
35
|
/** @default app.icons.close */
|
|
36
36
|
closeIcon?: IconProps['name'];
|
|
37
37
|
/**
|
|
@@ -69,6 +69,8 @@ export interface ModalSlots {
|
|
|
69
69
|
close: () => void;
|
|
70
70
|
}>;
|
|
71
71
|
}
|
|
72
|
+
declare const _default: typeof __VLS_export;
|
|
73
|
+
export default _default;
|
|
72
74
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ModalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
73
75
|
"update:open": (value: boolean) => any;
|
|
74
76
|
"after-leave": () => any;
|
|
@@ -80,15 +82,13 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ModalP
|
|
|
80
82
|
"onAfter-enter"?: (() => any) | undefined;
|
|
81
83
|
"onClose-prevent"?: (() => any) | undefined;
|
|
82
84
|
}>, {
|
|
83
|
-
|
|
84
|
-
close: boolean | Partial<ButtonProps>;
|
|
85
|
+
close: boolean | Omit<ButtonProps, LinkPropsKeys>;
|
|
85
86
|
transition: boolean;
|
|
87
|
+
overlay: boolean;
|
|
86
88
|
modal: boolean;
|
|
87
89
|
portal: boolean | string | HTMLElement;
|
|
88
90
|
dismissible: boolean;
|
|
89
91
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ModalSlots>;
|
|
90
|
-
declare const _default: typeof __VLS_export;
|
|
91
|
-
export default _default;
|
|
92
92
|
type __VLS_WithSlots<T, S> = T & {
|
|
93
93
|
new (): {
|
|
94
94
|
$slots: S;
|