@byyuurin/ui 0.1.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 +75 -77
- 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 +85 -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 +131 -0
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +93 -0
- 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 +48 -50
- package/dist/runtime/components/InputNumber.vue.d.ts +128 -129
- package/dist/runtime/components/InputTags.vue +156 -0
- package/dist/runtime/components/InputTags.vue.d.ts +90 -0
- 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 +38 -0
- package/dist/runtime/components/Marquee.vue.d.ts +54 -0
- package/dist/runtime/components/Modal.vue +74 -74
- package/dist/runtime/components/Modal.vue.d.ts +6 -6
- package/dist/runtime/components/NavigationMenu.vue +243 -234
- package/dist/runtime/components/NavigationMenu.vue.d.ts +53 -14
- 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 +13 -9
- 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 +188 -166
- package/dist/runtime/components/Table.vue.d.ts +27 -22
- 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 +102 -0
- package/dist/runtime/components/Timeline.vue.d.ts +78 -0
- 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 +7 -0
- package/dist/runtime/types/index.js +7 -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 +9 -6
- 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.DSyJHSTk.mjs → ui.DpkP12cX.mjs} +784 -84
- 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
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Yuurin<https://github.com/byyuurin>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Yuurin<https://github.com/byyuurin>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -98,13 +98,13 @@ export default setup({
|
|
|
98
98
|
},
|
|
99
99
|
ui: {
|
|
100
100
|
colors: {
|
|
101
|
-
primary: '
|
|
102
|
-
secondary: '
|
|
101
|
+
primary: 'orange',
|
|
102
|
+
secondary: 'teal',
|
|
103
103
|
success: 'green',
|
|
104
104
|
info: 'blue',
|
|
105
105
|
warning: 'yellow',
|
|
106
106
|
error: 'red',
|
|
107
|
-
neutral: '
|
|
107
|
+
neutral: 'stone',
|
|
108
108
|
},
|
|
109
109
|
icons: {
|
|
110
110
|
close: 'i-lucide-x',
|
|
@@ -117,6 +117,8 @@ export default setup({
|
|
|
117
117
|
chevronDoubleLeft: 'i-lucide-chevrons-left',
|
|
118
118
|
chevronDoubleRight: 'i-lucide-chevrons-right',
|
|
119
119
|
ellipsis: 'i-lucide-ellipsis',
|
|
120
|
+
folder: 'i-lucide-folder',
|
|
121
|
+
folderOpen: 'i-lucide-folder-open',
|
|
120
122
|
plus: 'i-lucide-plus',
|
|
121
123
|
minus: 'i-lucide-minus',
|
|
122
124
|
external: 'i-lucide-arrow-up-right',
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineNuxtModule, createResolver, addPlugin, addComponentsDir, addImportsDir, hasNuxtModule, installModule } from '@nuxt/kit';
|
|
2
2
|
import { defu } from 'defu';
|
|
3
|
-
import { v as version, n as name, a as addTemplates } from './shared/ui.
|
|
4
|
-
import { d as defaultOptions, r as resolveColors, g as getDefaultUIConfig } from './shared/ui.
|
|
3
|
+
import { v as version, n as name, a as addTemplates } from './shared/ui.DpkP12cX.mjs';
|
|
4
|
+
import { d as defaultOptions, r as resolveColors, g as getDefaultUIConfig } from './shared/ui.9kQouwss.mjs';
|
|
5
5
|
import 'node:process';
|
|
6
6
|
import 'node:url';
|
|
7
7
|
import '@unocss/config';
|
|
@@ -35,47 +35,47 @@ const ui = computed(() => {
|
|
|
35
35
|
</script>
|
|
36
36
|
|
|
37
37
|
<template>
|
|
38
|
-
<AccordionRoot v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
39
|
-
<AccordionItem
|
|
40
|
-
v-for="(item, index) in props.items"
|
|
41
|
-
v-slot="{ open }"
|
|
42
|
-
:key="index"
|
|
43
|
-
:value="item.value || String(index)"
|
|
44
|
-
:disabled="item.disabled"
|
|
45
|
-
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
46
|
-
data-part="item"
|
|
47
|
-
>
|
|
48
|
-
<AccordionHeader as="div" :class="ui.header({ class: [props.ui?.header, item.ui?.header] })" data-part="header">
|
|
49
|
-
<AccordionTrigger :class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger], disabled: item.disabled })" data-part="trigger">
|
|
50
|
-
<slot name="leading" v-bind="{ item, index, open, ui }">
|
|
51
|
-
<Icon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })" data-part="
|
|
52
|
-
</slot>
|
|
53
|
-
|
|
54
|
-
<span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })" data-part="label">
|
|
55
|
-
<slot v-bind="{ item, index, open }">{{ get(item, props.labelKey) }}</slot>
|
|
56
|
-
</span>
|
|
57
|
-
|
|
58
|
-
<slot name="trailing" v-bind="{ item, index, open, ui }">
|
|
59
|
-
<Icon :name="item.trailingIcon || props.trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.trailingIcon({ class: [props.ui?.trailingIcon, item.ui?.trailingIcon] })" data-part="
|
|
60
|
-
</slot>
|
|
61
|
-
</AccordionTrigger>
|
|
62
|
-
</AccordionHeader>
|
|
63
|
-
|
|
64
|
-
<AccordionContent
|
|
65
|
-
v-if="item.content || !!slots.content || item.slot && slots[item.slot] || !!slots.body || item.slot && slots[`${item.slot}-body`]"
|
|
66
|
-
:class="ui.content({ class: [props.ui?.content, item.ui?.content] })"
|
|
67
|
-
data-part="content"
|
|
68
|
-
>
|
|
69
|
-
<slot :name="item.slot || 'content'" :item="item" :index="index" :open="open" :ui="ui">
|
|
70
|
-
<div :class="ui.body({ class: [props.ui?.body, item.ui?.body] })" data-part="body">
|
|
71
|
-
<slot :name="item.slot ? `${item.slot}-body` : 'body'" :item="item" :index="index" :open="open" :ui="ui">
|
|
72
|
-
{{ item.content }}
|
|
73
|
-
</slot>
|
|
74
|
-
</div>
|
|
75
|
-
</slot>
|
|
76
|
-
</AccordionContent>
|
|
77
|
-
</AccordionItem>
|
|
78
|
-
</AccordionRoot>
|
|
38
|
+
<AccordionRoot v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
39
|
+
<AccordionItem
|
|
40
|
+
v-for="(item, index) in props.items"
|
|
41
|
+
v-slot="{ open }"
|
|
42
|
+
:key="index"
|
|
43
|
+
:value="item.value || String(index)"
|
|
44
|
+
:disabled="item.disabled"
|
|
45
|
+
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
46
|
+
data-part="item"
|
|
47
|
+
>
|
|
48
|
+
<AccordionHeader as="div" :class="ui.header({ class: [props.ui?.header, item.ui?.header] })" data-part="header">
|
|
49
|
+
<AccordionTrigger :class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger], disabled: item.disabled })" data-part="trigger">
|
|
50
|
+
<slot name="leading" v-bind="{ item, index, open, ui }">
|
|
51
|
+
<Icon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })" data-part="leadingIcon" />
|
|
52
|
+
</slot>
|
|
53
|
+
|
|
54
|
+
<span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })" data-part="label">
|
|
55
|
+
<slot v-bind="{ item, index, open }">{{ get(item, props.labelKey) }}</slot>
|
|
56
|
+
</span>
|
|
57
|
+
|
|
58
|
+
<slot name="trailing" v-bind="{ item, index, open, ui }">
|
|
59
|
+
<Icon :name="item.trailingIcon || props.trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.trailingIcon({ class: [props.ui?.trailingIcon, item.ui?.trailingIcon] })" data-part="trailingIcon" />
|
|
60
|
+
</slot>
|
|
61
|
+
</AccordionTrigger>
|
|
62
|
+
</AccordionHeader>
|
|
63
|
+
|
|
64
|
+
<AccordionContent
|
|
65
|
+
v-if="item.content || !!slots.content || item.slot && slots[item.slot] || !!slots.body || item.slot && slots[`${item.slot}-body`]"
|
|
66
|
+
:class="ui.content({ class: [props.ui?.content, item.ui?.content] })"
|
|
67
|
+
data-part="content"
|
|
68
|
+
>
|
|
69
|
+
<slot :name="item.slot || 'content'" :item="item" :index="index" :open="open" :ui="ui">
|
|
70
|
+
<div :class="ui.body({ class: [props.ui?.body, item.ui?.body] })" data-part="body">
|
|
71
|
+
<slot :name="item.slot ? `${item.slot}-body` : 'body'" :item="item" :index="index" :open="open" :ui="ui">
|
|
72
|
+
{{ item.content }}
|
|
73
|
+
</slot>
|
|
74
|
+
</div>
|
|
75
|
+
</slot>
|
|
76
|
+
</AccordionContent>
|
|
77
|
+
</AccordionItem>
|
|
78
|
+
</AccordionRoot>
|
|
79
79
|
</template>
|
|
80
80
|
|
|
81
81
|
<style>
|
|
@@ -56,10 +56,14 @@ export type AccordionSlots<T extends AccordionItem = AccordionItem> = {
|
|
|
56
56
|
open: boolean;
|
|
57
57
|
ui: ComponentStyler<typeof theme>;
|
|
58
58
|
}>;
|
|
59
|
-
declare const
|
|
60
|
-
|
|
59
|
+
declare const _default: typeof __VLS_export;
|
|
60
|
+
export default _default;
|
|
61
|
+
declare const __VLS_export: <T extends AccordionItem>(__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<{
|
|
62
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<AccordionProps<T> & {
|
|
61
63
|
"onUpdate:modelValue"?: ((value: string | string[] | undefined) => any) | undefined;
|
|
62
|
-
}> &
|
|
64
|
+
}> & (typeof globalThis extends {
|
|
65
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
66
|
+
} ? P : {});
|
|
63
67
|
expose: (exposed: {}) => void;
|
|
64
68
|
attrs: any;
|
|
65
69
|
slots: AccordionSlots<T>;
|
|
@@ -67,8 +71,8 @@ declare const __VLS_export: <T extends AccordionItem>(__VLS_props: NonNullable<A
|
|
|
67
71
|
}>) => import("vue").VNode & {
|
|
68
72
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
69
73
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
75
|
+
[K in keyof T]: T[K];
|
|
76
|
+
} : {
|
|
73
77
|
[K in keyof T as K]: T[K];
|
|
74
|
-
} & {};
|
|
78
|
+
}) & {};
|
|
@@ -40,67 +40,67 @@ const ui = computed(() => {
|
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
42
|
<template>
|
|
43
|
-
<Primitive
|
|
44
|
-
:as="props.as"
|
|
45
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
46
|
-
:data-orientation="props.orientation"
|
|
47
|
-
data-part="root"
|
|
48
|
-
>
|
|
49
|
-
<slot name="leading" :ui="ui">
|
|
50
|
-
<Avatar
|
|
51
|
-
v-if="props.avatar"
|
|
52
|
-
:size="props.ui?.avatarSize || ui.avatarSize()"
|
|
53
|
-
v-bind="props.avatar"
|
|
54
|
-
:class="ui.avatar({ class: props.ui?.avatar })"
|
|
55
|
-
data-part="avatar"
|
|
56
|
-
/>
|
|
57
|
-
<Icon
|
|
58
|
-
v-else-if="props.icon"
|
|
59
|
-
:name="props.icon"
|
|
60
|
-
:class="ui.icon({ class: props.ui?.icon })"
|
|
61
|
-
data-part="icon"
|
|
62
|
-
/>
|
|
63
|
-
</slot>
|
|
64
|
-
|
|
65
|
-
<div :class="ui.wrapper({ class: props.ui?.wrapper })" data-part="wrapper">
|
|
66
|
-
<div v-if="props.title || slots.title" :class="ui.title({ class: props.ui?.title })" data-part="title">
|
|
67
|
-
<slot name="title">
|
|
68
|
-
{{ props.title }}
|
|
69
|
-
</slot>
|
|
70
|
-
</div>
|
|
71
|
-
<div v-if="props.description || slots.description" :class="ui.description({ class: props.ui?.description })" data-part="description">
|
|
72
|
-
<slot name="description">
|
|
73
|
-
{{ props.description }}
|
|
74
|
-
</slot>
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<div v-if="props.orientation === 'vertical' && (props.actions?.length || slots.actions)" :class="ui.actions({ class: props.ui?.actions })" data-part="actions">
|
|
78
|
-
<slot name="actions">
|
|
79
|
-
<Button v-for="(action, index) in props.actions" :key="index" size="xs" v-bind="action" />
|
|
80
|
-
</slot>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
|
|
84
|
-
<div v-if="props.orientation === 'horizontal' && (props.actions?.length || slots.actions) || props.close" :class="ui.actions({ class: props.ui?.actions, orientation: 'horizontal' })" data-part="actions">
|
|
85
|
-
<template v-if="props.orientation === 'horizontal' && (props.actions?.length || slots.actions)">
|
|
86
|
-
<slot name="actions">
|
|
87
|
-
<Button v-for="(action, index) in props.actions" :key="index" size="xs" v-bind="action" />
|
|
88
|
-
</slot>
|
|
89
|
-
</template>
|
|
90
|
-
|
|
91
|
-
<slot name="close" :ui="ui">
|
|
92
|
-
<Button
|
|
93
|
-
v-if="props.close"
|
|
94
|
-
:icon="props.closeIcon || appConfig.ui.icons.close"
|
|
95
|
-
color="neutral"
|
|
96
|
-
variant="link"
|
|
97
|
-
:aria-label="t('alert.close')"
|
|
98
|
-
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
99
|
-
:class="ui.close({ class: props.ui?.close })"
|
|
100
|
-
data-part="close"
|
|
101
|
-
@click="emit('update:open', false)"
|
|
102
|
-
/>
|
|
103
|
-
</slot>
|
|
104
|
-
</div>
|
|
105
|
-
</Primitive>
|
|
43
|
+
<Primitive
|
|
44
|
+
:as="props.as"
|
|
45
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
46
|
+
:data-orientation="props.orientation"
|
|
47
|
+
data-part="root"
|
|
48
|
+
>
|
|
49
|
+
<slot name="leading" :ui="ui">
|
|
50
|
+
<Avatar
|
|
51
|
+
v-if="props.avatar"
|
|
52
|
+
:size="props.ui?.avatarSize || ui.avatarSize()"
|
|
53
|
+
v-bind="props.avatar"
|
|
54
|
+
:class="ui.avatar({ class: props.ui?.avatar })"
|
|
55
|
+
data-part="avatar"
|
|
56
|
+
/>
|
|
57
|
+
<Icon
|
|
58
|
+
v-else-if="props.icon"
|
|
59
|
+
:name="props.icon"
|
|
60
|
+
:class="ui.icon({ class: props.ui?.icon })"
|
|
61
|
+
data-part="icon"
|
|
62
|
+
/>
|
|
63
|
+
</slot>
|
|
64
|
+
|
|
65
|
+
<div :class="ui.wrapper({ class: props.ui?.wrapper })" data-part="wrapper">
|
|
66
|
+
<div v-if="props.title || slots.title" :class="ui.title({ class: props.ui?.title })" data-part="title">
|
|
67
|
+
<slot name="title">
|
|
68
|
+
{{ props.title }}
|
|
69
|
+
</slot>
|
|
70
|
+
</div>
|
|
71
|
+
<div v-if="props.description || slots.description" :class="ui.description({ class: props.ui?.description })" data-part="description">
|
|
72
|
+
<slot name="description">
|
|
73
|
+
{{ props.description }}
|
|
74
|
+
</slot>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div v-if="props.orientation === 'vertical' && (props.actions?.length || slots.actions)" :class="ui.actions({ class: props.ui?.actions })" data-part="actions">
|
|
78
|
+
<slot name="actions">
|
|
79
|
+
<Button v-for="(action, index) in props.actions" :key="index" size="xs" v-bind="action" />
|
|
80
|
+
</slot>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div v-if="props.orientation === 'horizontal' && (props.actions?.length || slots.actions) || props.close" :class="ui.actions({ class: props.ui?.actions, orientation: 'horizontal' })" data-part="actions">
|
|
85
|
+
<template v-if="props.orientation === 'horizontal' && (props.actions?.length || slots.actions)">
|
|
86
|
+
<slot name="actions">
|
|
87
|
+
<Button v-for="(action, index) in props.actions" :key="index" size="xs" v-bind="action" />
|
|
88
|
+
</slot>
|
|
89
|
+
</template>
|
|
90
|
+
|
|
91
|
+
<slot name="close" :ui="ui">
|
|
92
|
+
<Button
|
|
93
|
+
v-if="props.close"
|
|
94
|
+
:icon="props.closeIcon || appConfig.ui.icons.close"
|
|
95
|
+
color="neutral"
|
|
96
|
+
variant="link"
|
|
97
|
+
:aria-label="t('alert.close')"
|
|
98
|
+
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
99
|
+
:class="ui.close({ class: props.ui?.close })"
|
|
100
|
+
data-part="close"
|
|
101
|
+
@click="emit('update:open', false)"
|
|
102
|
+
/>
|
|
103
|
+
</slot>
|
|
104
|
+
</div>
|
|
105
|
+
</Primitive>
|
|
106
106
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { VariantProps } from '@byyuurin/ui-kit';
|
|
2
2
|
import type { PrimitiveProps } from 'reka-ui';
|
|
3
3
|
import theme from '#build/ui/alert';
|
|
4
|
-
import type { AvatarProps, ButtonProps, ComponentBaseProps, ComponentStyler, ComponentUIProps, IconProps } from '../types';
|
|
4
|
+
import type { AvatarProps, ButtonProps, ComponentBaseProps, ComponentStyler, ComponentUIProps, IconProps, LinkPropsKeys } from '../types';
|
|
5
5
|
import type { StaticSlot } from '../types/utils';
|
|
6
6
|
type ThemeVariants = VariantProps<typeof theme>;
|
|
7
7
|
export interface AlertProps extends ComponentBaseProps {
|
|
@@ -33,7 +33,7 @@ export interface AlertProps extends ComponentBaseProps {
|
|
|
33
33
|
* Display a close button to dismiss the alert.
|
|
34
34
|
* @default false
|
|
35
35
|
*/
|
|
36
|
-
close?: boolean |
|
|
36
|
+
close?: boolean | Omit<ButtonProps, LinkPropsKeys>;
|
|
37
37
|
/**
|
|
38
38
|
* The icon displayed in the close button.
|
|
39
39
|
* @default app.icons.close
|
|
@@ -55,6 +55,8 @@ export interface AlertSlots {
|
|
|
55
55
|
ui: ComponentStyler<typeof theme>;
|
|
56
56
|
}>;
|
|
57
57
|
}
|
|
58
|
+
declare const _default: typeof __VLS_export;
|
|
59
|
+
export default _default;
|
|
58
60
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<AlertProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
59
61
|
"update:open": (open: boolean) => any;
|
|
60
62
|
}, string, import("vue").PublicProps, Readonly<AlertProps> & Readonly<{
|
|
@@ -62,8 +64,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<AlertP
|
|
|
62
64
|
}>, {
|
|
63
65
|
orientation: "horizontal" | "vertical";
|
|
64
66
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, AlertSlots>;
|
|
65
|
-
declare const _default: typeof __VLS_export;
|
|
66
|
-
export default _default;
|
|
67
67
|
type __VLS_WithSlots<T, S> = T & {
|
|
68
68
|
new (): {
|
|
69
69
|
$slots: S;
|
|
@@ -15,6 +15,7 @@ const props = defineProps({
|
|
|
15
15
|
tooltip: { type: Object, required: false },
|
|
16
16
|
locale: { type: Object, required: false },
|
|
17
17
|
portal: { type: [Boolean, String], required: false, skipCheck: true, default: "body" },
|
|
18
|
+
dir: { type: String, required: false },
|
|
18
19
|
scrollBody: { type: [Boolean, Object], required: false },
|
|
19
20
|
nonce: { type: String, required: false }
|
|
20
21
|
});
|
|
@@ -29,14 +30,14 @@ providePortalTarget(portal);
|
|
|
29
30
|
</script>
|
|
30
31
|
|
|
31
32
|
<template>
|
|
32
|
-
<ConfigProvider :use-id="() => useId()" :dir="locale?.dir" :locale="locale?.code" v-bind="configProviderProps">
|
|
33
|
-
<TooltipProvider v-bind="tooltipProps">
|
|
34
|
-
<ToastProvider v-if="props.toaster !== null" v-bind="toastProviderProps">
|
|
35
|
-
<slot></slot>
|
|
36
|
-
</ToastProvider>
|
|
37
|
-
<slot v-else></slot>
|
|
38
|
-
|
|
39
|
-
<OverlayProvider />
|
|
40
|
-
</TooltipProvider>
|
|
41
|
-
</ConfigProvider>
|
|
33
|
+
<ConfigProvider :use-id="() => useId()" :dir="props.dir || locale?.dir" :locale="locale?.code" v-bind="configProviderProps">
|
|
34
|
+
<TooltipProvider v-bind="tooltipProps">
|
|
35
|
+
<ToastProvider v-if="props.toaster !== null" v-bind="toastProviderProps">
|
|
36
|
+
<slot></slot>
|
|
37
|
+
</ToastProvider>
|
|
38
|
+
<slot v-else></slot>
|
|
39
|
+
|
|
40
|
+
<OverlayProvider />
|
|
41
|
+
</TooltipProvider>
|
|
42
|
+
</ConfigProvider>
|
|
42
43
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ConfigProviderProps, TooltipProviderProps } from 'reka-ui';
|
|
2
2
|
import type { Locale, Messages, ToastProviderProps } from '../types';
|
|
3
3
|
import type { MaybeNull, StaticSlot } from '../types/utils';
|
|
4
|
-
export interface AppProps<T extends Messages = Messages> extends Omit<ConfigProviderProps, 'useId' | '
|
|
4
|
+
export interface AppProps<T extends Messages = Messages> extends Omit<ConfigProviderProps, 'useId' | 'locale'> {
|
|
5
5
|
toaster?: MaybeNull<ToastProviderProps>;
|
|
6
6
|
tooltip?: TooltipProviderProps;
|
|
7
7
|
locale?: Locale<T>;
|
|
@@ -10,8 +10,12 @@ export interface AppProps<T extends Messages = Messages> extends Omit<ConfigProv
|
|
|
10
10
|
export interface AppSlots {
|
|
11
11
|
default: StaticSlot;
|
|
12
12
|
}
|
|
13
|
-
declare const
|
|
14
|
-
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
declare const __VLS_export: <T extends Messages>(__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<{
|
|
16
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<AppProps<T>> & (typeof globalThis extends {
|
|
17
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
18
|
+
} ? P : {});
|
|
15
19
|
expose: (exposed: {}) => void;
|
|
16
20
|
attrs: any;
|
|
17
21
|
slots: AppSlots;
|
|
@@ -19,8 +23,8 @@ declare const __VLS_export: <T extends Messages>(__VLS_props: NonNullable<Awaite
|
|
|
19
23
|
}>) => import("vue").VNode & {
|
|
20
24
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
21
25
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
27
|
+
[K in keyof T]: T[K];
|
|
28
|
+
} : {
|
|
25
29
|
[K in keyof T as K]: T[K];
|
|
26
|
-
} & {};
|
|
30
|
+
}) & {};
|
|
@@ -62,33 +62,33 @@ function onError() {
|
|
|
62
62
|
</script>
|
|
63
63
|
|
|
64
64
|
<template>
|
|
65
|
-
<component
|
|
66
|
-
:is="props.chip ? Chip : Primitive"
|
|
67
|
-
:as="as.root"
|
|
68
|
-
v-bind="props.chip ? typeof props.chip === 'object' ? { inset: true, ...props.chip } : { inset: true } : {}"
|
|
69
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
70
|
-
data-part="root"
|
|
71
|
-
:style="props.style"
|
|
72
|
-
>
|
|
73
|
-
<component
|
|
74
|
-
:is="as.img || ImageComponent"
|
|
75
|
-
v-if="props.src && !error"
|
|
76
|
-
:src="props.src"
|
|
77
|
-
:alt="props.alt"
|
|
78
|
-
:width="sizePx"
|
|
79
|
-
:height="sizePx"
|
|
80
|
-
v-bind="$attrs"
|
|
81
|
-
:class="ui.image({ class: props.ui?.image })"
|
|
82
|
-
data-part="image"
|
|
83
|
-
@error="onError"
|
|
84
|
-
/>
|
|
85
|
-
|
|
86
|
-
<slot v-else v-bind="$attrs">
|
|
87
|
-
<Icon v-if="props.icon" :name="props.icon" :class="ui.icon({ class: props.ui?.icon })" data-part="icon" />
|
|
88
|
-
<span v-else :class="ui.fallback({ class: props.ui?.fallback })" data-part="fallback">
|
|
89
|
-
<template v-if="fallback">{{ fallback }}</template>
|
|
90
|
-
<template v-else> </template>
|
|
91
|
-
</span>
|
|
92
|
-
</slot>
|
|
93
|
-
</component>
|
|
65
|
+
<component
|
|
66
|
+
:is="props.chip ? Chip : Primitive"
|
|
67
|
+
:as="as.root"
|
|
68
|
+
v-bind="props.chip ? typeof props.chip === 'object' ? { inset: true, ...props.chip } : { inset: true } : {}"
|
|
69
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
70
|
+
data-part="root"
|
|
71
|
+
:style="props.style"
|
|
72
|
+
>
|
|
73
|
+
<component
|
|
74
|
+
:is="as.img || ImageComponent"
|
|
75
|
+
v-if="props.src && !error"
|
|
76
|
+
:src="props.src"
|
|
77
|
+
:alt="props.alt"
|
|
78
|
+
:width="sizePx"
|
|
79
|
+
:height="sizePx"
|
|
80
|
+
v-bind="$attrs"
|
|
81
|
+
:class="ui.image({ class: props.ui?.image })"
|
|
82
|
+
data-part="image"
|
|
83
|
+
@error="onError"
|
|
84
|
+
/>
|
|
85
|
+
|
|
86
|
+
<slot v-else v-bind="$attrs">
|
|
87
|
+
<Icon v-if="props.icon" :name="props.icon" :class="ui.icon({ class: props.ui?.icon })" data-part="icon" />
|
|
88
|
+
<span v-else :class="ui.fallback({ class: props.ui?.fallback })" data-part="fallback">
|
|
89
|
+
<template v-if="fallback">{{ fallback }}</template>
|
|
90
|
+
<template v-else> </template>
|
|
91
|
+
</span>
|
|
92
|
+
</slot>
|
|
93
|
+
</component>
|
|
94
94
|
</template>
|
|
@@ -2,13 +2,14 @@ import type { VariantProps } from '@byyuurin/ui-kit';
|
|
|
2
2
|
import type { PrimitiveProps } from 'reka-ui';
|
|
3
3
|
import theme from '#build/ui/avatar';
|
|
4
4
|
import type { ChipProps, ComponentBaseProps, ComponentUIProps, IconProps } from '../types';
|
|
5
|
+
import type { ImgHTMLAttributes } from '../types/html';
|
|
5
6
|
import type { StaticSlot } from '../types/utils';
|
|
6
7
|
type ThemeVariants = VariantProps<typeof theme>;
|
|
7
8
|
interface InnerAs {
|
|
8
9
|
root?: PrimitiveProps['as'];
|
|
9
10
|
img?: PrimitiveProps['as'];
|
|
10
11
|
}
|
|
11
|
-
export interface AvatarProps extends ComponentBaseProps {
|
|
12
|
+
export interface AvatarProps extends ComponentBaseProps, /** @vue-ignore */ Omit<ImgHTMLAttributes, 'src' | 'alt'> {
|
|
12
13
|
/**
|
|
13
14
|
* The element or component this component should render as.
|
|
14
15
|
* @default "span"
|
|
@@ -27,11 +28,11 @@ export interface AvatarProps extends ComponentBaseProps {
|
|
|
27
28
|
export interface AvatarSlots {
|
|
28
29
|
default: StaticSlot;
|
|
29
30
|
}
|
|
31
|
+
declare const _default: typeof __VLS_export;
|
|
32
|
+
export default _default;
|
|
30
33
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<AvatarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
31
34
|
default?: (props: {}) => any;
|
|
32
35
|
}>;
|
|
33
|
-
declare const _default: typeof __VLS_export;
|
|
34
|
-
export default _default;
|
|
35
36
|
type __VLS_WithSlots<T, S> = T & {
|
|
36
37
|
new (): {
|
|
37
38
|
$slots: S;
|
|
@@ -53,8 +53,8 @@ provideAvatarGroup(computed(() => props));
|
|
|
53
53
|
</script>
|
|
54
54
|
|
|
55
55
|
<template>
|
|
56
|
-
<Primitive :as="props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
57
|
-
<Avatar v-if="hiddenCount > 0" :text="`+${hiddenCount}`" :class="ui.base({ class: props.ui?.base })" data-part="base" />
|
|
58
|
-
<component :is="avatar" v-for="(avatar, index) in visibleAvatars" :key="index" :class="ui.base({ class: props.ui?.base })" data-part="base" />
|
|
59
|
-
</Primitive>
|
|
56
|
+
<Primitive :as="props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
57
|
+
<Avatar v-if="hiddenCount > 0" :text="`+${hiddenCount}`" :class="ui.base({ class: props.ui?.base })" data-part="base" />
|
|
58
|
+
<component :is="avatar" v-for="(avatar, index) in visibleAvatars" :key="index" :class="ui.base({ class: props.ui?.base })" data-part="base" />
|
|
59
|
+
</Primitive>
|
|
60
60
|
</template>
|
|
@@ -20,9 +20,9 @@ export interface AvatarGroupProps extends ComponentBaseProps {
|
|
|
20
20
|
export interface AvatarGroupSlots {
|
|
21
21
|
default: StaticSlot;
|
|
22
22
|
}
|
|
23
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<AvatarGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarGroupProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, AvatarGroupSlots>;
|
|
24
23
|
declare const _default: typeof __VLS_export;
|
|
25
24
|
export default _default;
|
|
25
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<AvatarGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarGroupProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, AvatarGroupSlots>;
|
|
26
26
|
type __VLS_WithSlots<T, S> = T & {
|
|
27
27
|
new (): {
|
|
28
28
|
$slots: S;
|