@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
|
@@ -43,78 +43,78 @@ defineExpose({
|
|
|
43
43
|
</script>
|
|
44
44
|
|
|
45
45
|
<template>
|
|
46
|
-
<TabsRoot
|
|
47
|
-
v-bind="rootProps"
|
|
48
|
-
:model-value="props.modelValue"
|
|
49
|
-
:default-value="props.defaultValue"
|
|
50
|
-
:orientation="props.orientation"
|
|
51
|
-
:activation-mode="props.activationMode"
|
|
52
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
53
|
-
data-part="root"
|
|
54
|
-
>
|
|
55
|
-
<TabsList :class="ui.list({ class: props.ui?.list })" data-part="list">
|
|
56
|
-
<TabsIndicator :class="ui.indicator({ class: props.ui?.indicator })" data-part="indicator" />
|
|
57
|
-
|
|
58
|
-
<slot name="list-leading">
|
|
59
|
-
</slot>
|
|
60
|
-
|
|
61
|
-
<TabsTrigger
|
|
62
|
-
v-for="(item, index) of items"
|
|
63
|
-
:ref="(el) => triggersRef[index] = el"
|
|
64
|
-
:key="index"
|
|
65
|
-
:value="item.value ?? String(index)"
|
|
66
|
-
:disabled="item.disabled"
|
|
67
|
-
:class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger] })"
|
|
68
|
-
data-part="trigger"
|
|
69
|
-
>
|
|
70
|
-
<slot name="leading" :item="item" :index="index" :ui="ui">
|
|
71
|
-
<Icon
|
|
72
|
-
v-if="item.icon"
|
|
73
|
-
:name="item.icon"
|
|
74
|
-
:class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })"
|
|
75
|
-
data-part="leadingIcon"
|
|
76
|
-
/>
|
|
77
|
-
<Avatar
|
|
78
|
-
v-else-if="item.avatar"
|
|
79
|
-
:size="item.ui?.leadingAvatarSize || props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
|
|
80
|
-
v-bind="item.avatar"
|
|
81
|
-
:class="ui.leadingAvatar({ class: [props.ui?.leadingAvatar, item.ui?.leadingAvatar] })"
|
|
82
|
-
data-part="leadingAvatar"
|
|
83
|
-
/>
|
|
84
|
-
</slot>
|
|
85
|
-
|
|
86
|
-
<span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })" data-part="label">
|
|
87
|
-
<slot :item="item" :index="index">{{ get(item, props.labelKey) }}</slot>
|
|
88
|
-
</span>
|
|
89
|
-
|
|
90
|
-
<slot name="trailing" :item="item" :index="index" :ui="ui">
|
|
91
|
-
<Badge
|
|
92
|
-
v-if="item.badge !== void 0"
|
|
93
|
-
color="neutral"
|
|
94
|
-
variant="outline"
|
|
95
|
-
:size="item.ui?.trailingBadgeSize || props.ui?.trailingBadgeSize || ui.trailingBadgeSize()"
|
|
96
|
-
v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
|
|
97
|
-
:class="ui.trailingBadge({ class: [props.ui?.trailingBadge, item.ui?.trailingBadge] })"
|
|
98
|
-
data-part="trailingBadge"
|
|
99
|
-
/>
|
|
100
|
-
</slot>
|
|
101
|
-
</TabsTrigger>
|
|
102
|
-
|
|
103
|
-
<slot name="list-trailing"></slot>
|
|
104
|
-
</TabsList>
|
|
105
|
-
|
|
106
|
-
<template v-if="props.content">
|
|
107
|
-
<TabsContent
|
|
108
|
-
v-for="(item, index) of items"
|
|
109
|
-
:key="index"
|
|
110
|
-
:value="item.value ?? String(index)"
|
|
111
|
-
:class="ui.content({ class: [props.ui?.content, item.ui?.content] })"
|
|
112
|
-
data-part="content"
|
|
113
|
-
>
|
|
114
|
-
<slot :name="item.slot || 'content'" :item="item" :index="index" :ui="ui">
|
|
115
|
-
{{ item.content }}
|
|
116
|
-
</slot>
|
|
117
|
-
</TabsContent>
|
|
118
|
-
</template>
|
|
119
|
-
</TabsRoot>
|
|
46
|
+
<TabsRoot
|
|
47
|
+
v-bind="rootProps"
|
|
48
|
+
:model-value="props.modelValue"
|
|
49
|
+
:default-value="props.defaultValue"
|
|
50
|
+
:orientation="props.orientation"
|
|
51
|
+
:activation-mode="props.activationMode"
|
|
52
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
53
|
+
data-part="root"
|
|
54
|
+
>
|
|
55
|
+
<TabsList :class="ui.list({ class: props.ui?.list })" data-part="list">
|
|
56
|
+
<TabsIndicator :class="ui.indicator({ class: props.ui?.indicator })" data-part="indicator" />
|
|
57
|
+
|
|
58
|
+
<slot name="list-leading">
|
|
59
|
+
</slot>
|
|
60
|
+
|
|
61
|
+
<TabsTrigger
|
|
62
|
+
v-for="(item, index) of items"
|
|
63
|
+
:ref="(el) => triggersRef[index] = el"
|
|
64
|
+
:key="index"
|
|
65
|
+
:value="item.value ?? String(index)"
|
|
66
|
+
:disabled="item.disabled"
|
|
67
|
+
:class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger] })"
|
|
68
|
+
data-part="trigger"
|
|
69
|
+
>
|
|
70
|
+
<slot name="leading" :item="item" :index="index" :ui="ui">
|
|
71
|
+
<Icon
|
|
72
|
+
v-if="item.icon"
|
|
73
|
+
:name="item.icon"
|
|
74
|
+
:class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })"
|
|
75
|
+
data-part="leadingIcon"
|
|
76
|
+
/>
|
|
77
|
+
<Avatar
|
|
78
|
+
v-else-if="item.avatar"
|
|
79
|
+
:size="item.ui?.leadingAvatarSize || props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
|
|
80
|
+
v-bind="item.avatar"
|
|
81
|
+
:class="ui.leadingAvatar({ class: [props.ui?.leadingAvatar, item.ui?.leadingAvatar] })"
|
|
82
|
+
data-part="leadingAvatar"
|
|
83
|
+
/>
|
|
84
|
+
</slot>
|
|
85
|
+
|
|
86
|
+
<span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })" data-part="label">
|
|
87
|
+
<slot :item="item" :index="index">{{ get(item, props.labelKey) }}</slot>
|
|
88
|
+
</span>
|
|
89
|
+
|
|
90
|
+
<slot name="trailing" :item="item" :index="index" :ui="ui">
|
|
91
|
+
<Badge
|
|
92
|
+
v-if="item.badge !== void 0"
|
|
93
|
+
color="neutral"
|
|
94
|
+
variant="outline"
|
|
95
|
+
:size="item.ui?.trailingBadgeSize || props.ui?.trailingBadgeSize || ui.trailingBadgeSize()"
|
|
96
|
+
v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
|
|
97
|
+
:class="ui.trailingBadge({ class: [props.ui?.trailingBadge, item.ui?.trailingBadge] })"
|
|
98
|
+
data-part="trailingBadge"
|
|
99
|
+
/>
|
|
100
|
+
</slot>
|
|
101
|
+
</TabsTrigger>
|
|
102
|
+
|
|
103
|
+
<slot name="list-trailing"></slot>
|
|
104
|
+
</TabsList>
|
|
105
|
+
|
|
106
|
+
<template v-if="props.content">
|
|
107
|
+
<TabsContent
|
|
108
|
+
v-for="(item, index) of items"
|
|
109
|
+
:key="index"
|
|
110
|
+
:value="item.value ?? String(index)"
|
|
111
|
+
:class="ui.content({ class: [props.ui?.content, item.ui?.content] })"
|
|
112
|
+
data-part="content"
|
|
113
|
+
>
|
|
114
|
+
<slot :name="item.slot || 'content'" :item="item" :index="index" :ui="ui">
|
|
115
|
+
{{ item.content }}
|
|
116
|
+
</slot>
|
|
117
|
+
</TabsContent>
|
|
118
|
+
</template>
|
|
119
|
+
</TabsRoot>
|
|
120
120
|
</template>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentPublicInstance } from 'vue';
|
|
2
1
|
import type { VariantProps } from '@byyuurin/ui-kit';
|
|
3
2
|
import type { TabsRootEmits, TabsRootProps } from 'reka-ui';
|
|
3
|
+
import type { ComponentPublicInstance } from 'vue';
|
|
4
4
|
import theme from '#build/ui/tabs';
|
|
5
5
|
import type { AvatarProps, BadgeProps, ComponentBaseProps, ComponentStyler, ComponentUIProps, IconProps } from '../types';
|
|
6
6
|
import type { DynamicSlots, GetItemKeys, StaticSlot } from '../types/utils';
|
|
@@ -77,10 +77,14 @@ export type TabsSlots<T extends TabsItem = TabsItem> = {
|
|
|
77
77
|
index: number;
|
|
78
78
|
ui: ComponentStyler<typeof theme>;
|
|
79
79
|
}>;
|
|
80
|
-
declare const
|
|
81
|
-
|
|
80
|
+
declare const _default: typeof __VLS_export;
|
|
81
|
+
export default _default;
|
|
82
|
+
declare const __VLS_export: <T extends TabsItem>(__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<{
|
|
83
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<TabsProps<T> & {
|
|
82
84
|
"onUpdate:modelValue"?: ((payload: string | number) => any) | undefined;
|
|
83
|
-
}> &
|
|
85
|
+
}> & (typeof globalThis extends {
|
|
86
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
87
|
+
} ? P : {});
|
|
84
88
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
85
89
|
triggersRef: import("vue").Ref<ComponentPublicInstance[], ComponentPublicInstance[]>;
|
|
86
90
|
}>) => void;
|
|
@@ -90,8 +94,8 @@ declare const __VLS_export: <T extends TabsItem>(__VLS_props: NonNullable<Awaite
|
|
|
90
94
|
}>) => import("vue").VNode & {
|
|
91
95
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
92
96
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
98
|
+
[K in keyof T]: T[K];
|
|
99
|
+
} : {
|
|
96
100
|
[K in keyof T as K]: T[K];
|
|
97
|
-
} & {};
|
|
101
|
+
}) & {};
|
|
@@ -125,51 +125,51 @@ defineExpose({
|
|
|
125
125
|
</script>
|
|
126
126
|
|
|
127
127
|
<template>
|
|
128
|
-
<Primitive :as="props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
129
|
-
<span v-if="isLeading || props.avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })" data-part="leading">
|
|
130
|
-
<slot name="leading" :ui="ui">
|
|
131
|
-
<Icon
|
|
132
|
-
v-if="isLeading && leadingIconName"
|
|
133
|
-
:name="leadingIconName"
|
|
134
|
-
:class="ui.leadingIcon({ class: props.ui?.leadingIcon })"
|
|
135
|
-
data-part="leadingIcon"
|
|
136
|
-
/>
|
|
137
|
-
<Avatar
|
|
138
|
-
v-else-if="props.avatar"
|
|
139
|
-
:size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
|
|
140
|
-
v-bind="props.avatar"
|
|
141
|
-
:class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })"
|
|
142
|
-
data-part="leadingAvatar"
|
|
143
|
-
/>
|
|
144
|
-
</slot>
|
|
145
|
-
</span>
|
|
146
|
-
|
|
147
|
-
<textarea
|
|
148
|
-
ref="textareaRef"
|
|
149
|
-
:value="modelValue"
|
|
150
|
-
:rows="props.rows"
|
|
151
|
-
:placeholder="props.placeholder"
|
|
152
|
-
:required="props.required"
|
|
153
|
-
v-bind="{ id, name, disabled, ...$attrs, ...ariaAttrs }"
|
|
154
|
-
:class="ui.base({ class: props.ui?.base })"
|
|
155
|
-
data-part="base"
|
|
156
|
-
@input="onInput"
|
|
157
|
-
@blur="onBlur"
|
|
158
|
-
@change="onChange"
|
|
159
|
-
@focus="emitFormFocus"
|
|
160
|
-
></textarea>
|
|
161
|
-
|
|
162
|
-
<slot :ui="ui"></slot>
|
|
163
|
-
|
|
164
|
-
<span v-if="isTrailing || !!slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })" data-part="trailing">
|
|
165
|
-
<slot name="trailing" :ui="ui">
|
|
166
|
-
<Icon
|
|
167
|
-
v-if="trailingIconName"
|
|
168
|
-
:name="trailingIconName"
|
|
169
|
-
:class="ui.trailingIcon({ class: props.ui?.trailingIcon })"
|
|
170
|
-
data-part="trailingIcon"
|
|
171
|
-
/>
|
|
172
|
-
</slot>
|
|
173
|
-
</span>
|
|
174
|
-
</Primitive>
|
|
128
|
+
<Primitive :as="props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
129
|
+
<span v-if="isLeading || props.avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })" data-part="leading">
|
|
130
|
+
<slot name="leading" :ui="ui">
|
|
131
|
+
<Icon
|
|
132
|
+
v-if="isLeading && leadingIconName"
|
|
133
|
+
:name="leadingIconName"
|
|
134
|
+
:class="ui.leadingIcon({ class: props.ui?.leadingIcon })"
|
|
135
|
+
data-part="leadingIcon"
|
|
136
|
+
/>
|
|
137
|
+
<Avatar
|
|
138
|
+
v-else-if="props.avatar"
|
|
139
|
+
:size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
|
|
140
|
+
v-bind="props.avatar"
|
|
141
|
+
:class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })"
|
|
142
|
+
data-part="leadingAvatar"
|
|
143
|
+
/>
|
|
144
|
+
</slot>
|
|
145
|
+
</span>
|
|
146
|
+
|
|
147
|
+
<textarea
|
|
148
|
+
ref="textareaRef"
|
|
149
|
+
:value="modelValue"
|
|
150
|
+
:rows="props.rows"
|
|
151
|
+
:placeholder="props.placeholder"
|
|
152
|
+
:required="props.required"
|
|
153
|
+
v-bind="{ id, name, disabled, ...$attrs, ...ariaAttrs }"
|
|
154
|
+
:class="ui.base({ class: props.ui?.base })"
|
|
155
|
+
data-part="base"
|
|
156
|
+
@input="onInput"
|
|
157
|
+
@blur="onBlur"
|
|
158
|
+
@change="onChange"
|
|
159
|
+
@focus="emitFormFocus"
|
|
160
|
+
></textarea>
|
|
161
|
+
|
|
162
|
+
<slot :ui="ui"></slot>
|
|
163
|
+
|
|
164
|
+
<span v-if="isTrailing || !!slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })" data-part="trailing">
|
|
165
|
+
<slot name="trailing" :ui="ui">
|
|
166
|
+
<Icon
|
|
167
|
+
v-if="trailingIconName"
|
|
168
|
+
:name="trailingIconName"
|
|
169
|
+
:class="ui.trailingIcon({ class: props.ui?.trailingIcon })"
|
|
170
|
+
data-part="trailingIcon"
|
|
171
|
+
/>
|
|
172
|
+
</slot>
|
|
173
|
+
</span>
|
|
174
|
+
</Primitive>
|
|
175
175
|
</template>
|
|
@@ -3,11 +3,12 @@ import type { PrimitiveProps } from 'reka-ui';
|
|
|
3
3
|
import theme from '#build/ui/textarea';
|
|
4
4
|
import type { UseComponentIconsProps } from '../composables/useComponentIcons';
|
|
5
5
|
import type { ComponentBaseProps, ComponentStyler, ComponentUIProps } from '../types';
|
|
6
|
+
import type { TextareaHTMLAttributes } from '../types/html';
|
|
6
7
|
import type { ModelModifiers } from '../types/input';
|
|
7
8
|
import type { MaybeNull, StaticSlot } from '../types/utils';
|
|
8
9
|
type TextareaValue = MaybeNull<string | number>;
|
|
9
10
|
type ThemeVariants = VariantProps<typeof theme>;
|
|
10
|
-
export interface TextareaProps<T extends TextareaValue = TextareaValue> extends ComponentBaseProps, UseComponentIconsProps {
|
|
11
|
+
export interface TextareaProps<T extends TextareaValue = TextareaValue> extends ComponentBaseProps, UseComponentIconsProps, /** @vue-ignore */ Omit<TextareaHTMLAttributes, 'name' | 'placeholder' | 'required' | 'autofocus' | 'disabled' | 'rows'> {
|
|
11
12
|
/**
|
|
12
13
|
* The element or component this component should render as.
|
|
13
14
|
* @default "div"
|
|
@@ -35,7 +36,7 @@ export interface TextareaProps<T extends TextareaValue = TextareaValue> extends
|
|
|
35
36
|
autoresizeDelay?: number;
|
|
36
37
|
modelValue?: T;
|
|
37
38
|
defaultValue?: T;
|
|
38
|
-
modelModifiers?: ModelModifiers
|
|
39
|
+
modelModifiers?: ModelModifiers<T>;
|
|
39
40
|
ui?: ComponentUIProps<typeof theme>;
|
|
40
41
|
}
|
|
41
42
|
export interface TextareaEmits<T extends TextareaValue = TextareaValue> {
|
|
@@ -54,23 +55,27 @@ export interface TextareaSlots {
|
|
|
54
55
|
ui: ComponentStyler<typeof theme>;
|
|
55
56
|
}>;
|
|
56
57
|
}
|
|
57
|
-
declare const
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
declare const _default: typeof __VLS_export;
|
|
59
|
+
export default _default;
|
|
60
|
+
declare const __VLS_export: <T extends TextareaValue>(__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<{
|
|
61
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<TextareaProps<T> & {
|
|
60
62
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
63
|
+
onChange?: ((event: Event) => any) | undefined;
|
|
61
64
|
"onUpdate:modelValue"?: ((payload: TextareaValue) => any) | undefined;
|
|
62
|
-
}> &
|
|
65
|
+
}> & (typeof globalThis extends {
|
|
66
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
67
|
+
} ? P : {});
|
|
63
68
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
64
69
|
textareaRef: import("vue").ShallowRef<MaybeNull<HTMLTextAreaElement>, MaybeNull<HTMLTextAreaElement>>;
|
|
65
70
|
}>) => void;
|
|
66
71
|
attrs: any;
|
|
67
72
|
slots: TextareaSlots;
|
|
68
|
-
emit: ((evt: "
|
|
73
|
+
emit: ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", payload: TextareaValue) => void);
|
|
69
74
|
}>) => import("vue").VNode & {
|
|
70
75
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
71
76
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
78
|
+
[K in keyof T]: T[K];
|
|
79
|
+
} : {
|
|
75
80
|
[K in keyof T as K]: T[K];
|
|
76
|
-
} & {};
|
|
81
|
+
}) & {};
|
|
@@ -49,54 +49,54 @@ const ui = computed(() => {
|
|
|
49
49
|
</script>
|
|
50
50
|
|
|
51
51
|
<template>
|
|
52
|
-
<Primitive :as="props.as" :data-orientation="props.orientation" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
53
|
-
<div
|
|
54
|
-
v-for="(item, index) in props.items"
|
|
55
|
-
:key="item.value ?? index"
|
|
56
|
-
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
57
|
-
data-part="item"
|
|
58
|
-
:data-state="getItemState(index)"
|
|
59
|
-
>
|
|
60
|
-
<div :class="ui.container({ class: [props.ui?.container, item.ui?.container] })" data-part="container">
|
|
61
|
-
<Avatar
|
|
62
|
-
:size="props.size"
|
|
63
|
-
:icon="item.icon"
|
|
64
|
-
v-bind="typeof item.avatar === 'object' ? item.avatar : {}"
|
|
52
|
+
<Primitive :as="props.as" :data-orientation="props.orientation" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
53
|
+
<div
|
|
54
|
+
v-for="(item, index) in props.items"
|
|
55
|
+
:key="item.value ?? index"
|
|
56
|
+
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
57
|
+
data-part="item"
|
|
58
|
+
:data-state="getItemState(index)"
|
|
59
|
+
>
|
|
60
|
+
<div :class="ui.container({ class: [props.ui?.container, item.ui?.container] })" data-part="container">
|
|
61
|
+
<Avatar
|
|
62
|
+
:size="props.size"
|
|
63
|
+
:icon="item.icon"
|
|
64
|
+
v-bind="typeof item.avatar === 'object' ? item.avatar : {}"
|
|
65
65
|
:ui="{
|
|
66
66
|
icon: ui.indicatorIcon({ class: props.ui?.indicatorIcon }),
|
|
67
67
|
fallback: ui.indicatorFallback({ class: props.ui?.indicatorFallback })
|
|
68
|
-
}"
|
|
69
|
-
:class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator] })"
|
|
70
|
-
data-part="indicator"
|
|
71
|
-
>
|
|
72
|
-
<slot :name="item.slot ? `${item.slot}-indicator` : 'indicator'" :item="item"></slot>
|
|
73
|
-
</Avatar>
|
|
74
|
-
|
|
75
|
-
<Separator
|
|
76
|
-
v-if="index < items.length - 1"
|
|
77
|
-
:orientation="props.orientation"
|
|
78
|
-
:class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })"
|
|
79
|
-
data-part="separator"
|
|
80
|
-
/>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<div :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper] })" data-part="wrapper">
|
|
84
|
-
<div v-if="item.date" :class="ui.date({ class: [props.ui?.date, item.ui?.date] })" data-part="date">
|
|
85
|
-
<slot :name="item.slot ? `${item.slot}-date` : 'date'" :item="item">
|
|
86
|
-
{{ item.date }}
|
|
87
|
-
</slot>
|
|
88
|
-
</div>
|
|
89
|
-
<div v-if="item.title || !!slots.title" :class="ui.title({ class: [props.ui?.title, item.ui?.title] })" data-part="title">
|
|
90
|
-
<slot :name="item.slot ? `${item.slot}-title` : 'title'" :item="item">
|
|
91
|
-
{{ item.title }}
|
|
92
|
-
</slot>
|
|
93
|
-
</div>
|
|
94
|
-
<div v-if="item.description || !!slots.description" :class="ui.description({ class: [props.ui?.description, item.ui?.description] })" data-part="description">
|
|
95
|
-
<slot :name="item.slot ? `${item.slot}-description` : 'description'" :item="item">
|
|
96
|
-
{{ item.description }}
|
|
97
|
-
</slot>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
</Primitive>
|
|
68
|
+
}"
|
|
69
|
+
:class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator] })"
|
|
70
|
+
data-part="indicator"
|
|
71
|
+
>
|
|
72
|
+
<slot :name="item.slot ? `${item.slot}-indicator` : 'indicator'" :item="item"></slot>
|
|
73
|
+
</Avatar>
|
|
74
|
+
|
|
75
|
+
<Separator
|
|
76
|
+
v-if="index < items.length - 1"
|
|
77
|
+
:orientation="props.orientation"
|
|
78
|
+
:class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })"
|
|
79
|
+
data-part="separator"
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<div :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper] })" data-part="wrapper">
|
|
84
|
+
<div v-if="item.date" :class="ui.date({ class: [props.ui?.date, item.ui?.date] })" data-part="date">
|
|
85
|
+
<slot :name="item.slot ? `${item.slot}-date` : 'date'" :item="item">
|
|
86
|
+
{{ item.date }}
|
|
87
|
+
</slot>
|
|
88
|
+
</div>
|
|
89
|
+
<div v-if="item.title || !!slots.title" :class="ui.title({ class: [props.ui?.title, item.ui?.title] })" data-part="title">
|
|
90
|
+
<slot :name="item.slot ? `${item.slot}-title` : 'title'" :item="item">
|
|
91
|
+
{{ item.title }}
|
|
92
|
+
</slot>
|
|
93
|
+
</div>
|
|
94
|
+
<div v-if="item.description || !!slots.description" :class="ui.description({ class: [props.ui?.description, item.ui?.description] })" data-part="description">
|
|
95
|
+
<slot :name="item.slot ? `${item.slot}-description` : 'description'" :item="item">
|
|
96
|
+
{{ item.description }}
|
|
97
|
+
</slot>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</Primitive>
|
|
102
102
|
</template>
|
|
@@ -56,10 +56,14 @@ export type TimelineSlots<T extends TimelineItem = TimelineItem> = {
|
|
|
56
56
|
} & DynamicSlots<T, 'indicator' | 'date' | 'title' | 'description', {
|
|
57
57
|
item: T;
|
|
58
58
|
}, false>;
|
|
59
|
-
declare const
|
|
60
|
-
|
|
59
|
+
declare const _default: typeof __VLS_export;
|
|
60
|
+
export default _default;
|
|
61
|
+
declare const __VLS_export: <T extends TimelineItem>(__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<TimelineProps<T> & {
|
|
61
63
|
"onUpdate:model-value"?: ((value: string | number) => 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: TimelineSlots<T>;
|
|
@@ -67,8 +71,8 @@ declare const __VLS_export: <T extends TimelineItem>(__VLS_props: NonNullable<Aw
|
|
|
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
|
+
}) & {};
|