@byyuurin/ui 0.3.0 → 0.4.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/dist/module.json +1 -1
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/Accordion.vue +43 -43
- package/dist/runtime/components/Alert.vue +65 -64
- package/dist/runtime/components/App.vue +10 -10
- package/dist/runtime/components/Avatar.vue +31 -30
- package/dist/runtime/components/AvatarGroup.vue +6 -5
- package/dist/runtime/components/Badge.vue +36 -35
- package/dist/runtime/components/Breadcrumb.vue +51 -51
- package/dist/runtime/components/Button.vue +54 -55
- package/dist/runtime/components/Calendar.vue +76 -75
- package/dist/runtime/components/Card.vue +43 -42
- package/dist/runtime/components/Carousel.vue +68 -67
- package/dist/runtime/components/Checkbox.vue +50 -48
- package/dist/runtime/components/CheckboxGroup.vue +33 -32
- package/dist/runtime/components/Chip.vue +20 -16
- package/dist/runtime/components/Collapsible.vue +16 -15
- package/dist/runtime/components/Drawer.vue +78 -77
- package/dist/runtime/components/DropdownMenu.vue +29 -29
- package/dist/runtime/components/DropdownMenuContent.vue +152 -152
- package/dist/runtime/components/FieldGroup.vue +5 -4
- package/dist/runtime/components/FileUpload.vue +267 -0
- package/dist/runtime/components/FileUpload.vue.d.ts +178 -0
- package/dist/runtime/components/Form.vue +11 -10
- package/dist/runtime/components/FormField.vue +39 -38
- package/dist/runtime/components/Icon.vue +2 -2
- package/dist/runtime/components/Input.vue +52 -52
- package/dist/runtime/components/InputNumber.vue +50 -49
- package/dist/runtime/components/InputTags.vue +55 -55
- package/dist/runtime/components/Kbd.vue +5 -4
- package/dist/runtime/components/Link.vue +25 -24
- package/dist/runtime/components/LinkBase.vue +3 -3
- package/dist/runtime/components/Marquee.vue +7 -6
- package/dist/runtime/components/Modal.vue +76 -75
- package/dist/runtime/components/NavigationMenu.vue +230 -230
- package/dist/runtime/components/OverlayProvider.vue +9 -9
- package/dist/runtime/components/Pagination.vue +49 -48
- package/dist/runtime/components/PinInput.vue +25 -25
- package/dist/runtime/components/Popover.vue +23 -23
- package/dist/runtime/components/Progress.vue +27 -26
- package/dist/runtime/components/RadioGroup.vue +53 -53
- package/dist/runtime/components/ScrollArea.vue +34 -33
- package/dist/runtime/components/Select.vue +203 -203
- package/dist/runtime/components/Separator.vue +32 -31
- package/dist/runtime/components/Skeleton.vue +13 -12
- package/dist/runtime/components/Slider.vue +27 -26
- package/dist/runtime/components/Stepper.vue +53 -52
- package/dist/runtime/components/Stepper.vue.d.ts +2 -2
- package/dist/runtime/components/Switch.vue +33 -34
- package/dist/runtime/components/Table.vue +139 -138
- package/dist/runtime/components/Tabs.vue +76 -76
- package/dist/runtime/components/Textarea.vue +50 -50
- package/dist/runtime/components/Timeline.vue +49 -48
- package/dist/runtime/components/Toast.vue +95 -94
- package/dist/runtime/components/ToastProvider.vue +31 -31
- package/dist/runtime/components/Tooltip.vue +26 -25
- package/dist/runtime/components/Tree.vue +133 -133
- package/dist/runtime/composables/useFileUpload.d.ts +19 -0
- package/dist/runtime/composables/useFileUpload.js +79 -0
- package/dist/runtime/composables/useLocale.d.ts +6 -0
- package/dist/runtime/locale/en.d.ts +3 -0
- package/dist/runtime/locale/en.js +3 -0
- package/dist/runtime/locale/zh_tw.d.ts +3 -0
- package/dist/runtime/locale/zh_tw.js +3 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/locale.d.ts +3 -0
- package/dist/runtime/types/unocss.d.ts +4 -4
- package/dist/runtime/types/utils.d.ts +1 -1
- package/dist/runtime/vue/components/Icon.vue +2 -2
- package/dist/setup.d.mts +1 -1
- package/dist/shared/{ui.D8Bg1HWt.d.mts → ui.CGCKYv7g.d.mts} +4 -2
- package/dist/shared/{ui.9kQouwss.mjs → ui.DYMXCXO6.mjs} +4 -2
- package/dist/shared/{ui.DpkP12cX.mjs → ui.DcEKQd0n.mjs} +230 -5
- 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 +10 -10
- package/vue-plugin.d.ts +5 -5
|
@@ -10,7 +10,7 @@ import { useAppConfig } from "#imports";
|
|
|
10
10
|
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
11
11
|
import { useFieldGroup } from "../composables/useFieldGroup";
|
|
12
12
|
import { useFormField } from "../composables/useFormField";
|
|
13
|
-
import { looseToNumber } from "../utils";
|
|
13
|
+
import { looseToNumber, pick } from "../utils";
|
|
14
14
|
import { cv, merge } from "../utils/style";
|
|
15
15
|
import Avatar from "./Avatar.vue";
|
|
16
16
|
import Icon from "./Icon.vue";
|
|
@@ -54,14 +54,14 @@ const appConfig = useAppConfig();
|
|
|
54
54
|
const ui = computed(() => {
|
|
55
55
|
const styler = cv(merge(theme, appConfig.ui.input));
|
|
56
56
|
return styler({
|
|
57
|
-
...props,
|
|
57
|
+
...pick(props, ["variant", "loading"]),
|
|
58
58
|
type: props.type,
|
|
59
59
|
color: color.value,
|
|
60
60
|
size: fieldGroupSize.value || formFieldSize.value,
|
|
61
61
|
highlight: highlight.value,
|
|
62
|
-
fieldGroup: orientation.value,
|
|
63
62
|
leading: isLeading.value || !!props.avatar || !!slots.leading,
|
|
64
|
-
trailing: isTrailing.value || !!slots.trailing
|
|
63
|
+
trailing: isTrailing.value || !!slots.trailing,
|
|
64
|
+
fieldGroup: orientation.value
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
67
|
const inputRef = ref(null);
|
|
@@ -107,52 +107,52 @@ defineExpose({
|
|
|
107
107
|
</script>
|
|
108
108
|
|
|
109
109
|
<template>
|
|
110
|
-
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
111
|
-
<span v-if="isLeading || !!props.avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })" data-part="leading">
|
|
112
|
-
<slot name="leading" :ui="ui">
|
|
113
|
-
<Icon
|
|
114
|
-
v-if="isLeading && leadingIconName"
|
|
115
|
-
:name="leadingIconName"
|
|
116
|
-
:class="ui.leadingIcon({ class: props.ui?.leadingIcon })"
|
|
117
|
-
data-part="leadingIcon"
|
|
118
|
-
/>
|
|
119
|
-
<Avatar
|
|
120
|
-
v-else-if="props.avatar"
|
|
121
|
-
:size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
|
|
122
|
-
v-bind="props.avatar"
|
|
123
|
-
:class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })"
|
|
124
|
-
data-part="leadingAvatar"
|
|
125
|
-
/>
|
|
126
|
-
</slot>
|
|
127
|
-
</span>
|
|
128
|
-
|
|
129
|
-
<input
|
|
130
|
-
ref="inputRef"
|
|
131
|
-
:type="props.type"
|
|
132
|
-
:value="modelValue"
|
|
133
|
-
:placeholder="props.placeholder"
|
|
134
|
-
:required="props.required"
|
|
135
|
-
:autocomplete="props.autocomplete"
|
|
136
|
-
v-bind="{ id, name, disabled, ...$attrs, ...ariaAttrs }"
|
|
137
|
-
:class="ui.base({ class: props.ui?.base })"
|
|
138
|
-
data-part="base"
|
|
139
|
-
@input="onInput"
|
|
140
|
-
@blur="onBlur"
|
|
141
|
-
@change="onChange"
|
|
142
|
-
@focus="emitFormFocus"
|
|
143
|
-
/>
|
|
144
|
-
|
|
145
|
-
<slot :ui="ui"></slot>
|
|
146
|
-
|
|
147
|
-
<span v-if="isTrailing || slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })" data-part="trailing">
|
|
148
|
-
<slot name="trailing" :ui="ui">
|
|
149
|
-
<Icon
|
|
150
|
-
v-if="trailingIconName"
|
|
151
|
-
:name="trailingIconName"
|
|
152
|
-
:class="ui.trailingIcon({ class: props.ui?.trailingIcon })"
|
|
153
|
-
data-part="trailingIcon"
|
|
154
|
-
/>
|
|
155
|
-
</slot>
|
|
156
|
-
</span>
|
|
157
|
-
</Primitive>
|
|
110
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
111
|
+
<span v-if="isLeading || !!props.avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })" data-part="leading">
|
|
112
|
+
<slot name="leading" :ui="ui">
|
|
113
|
+
<Icon
|
|
114
|
+
v-if="isLeading && leadingIconName"
|
|
115
|
+
:name="leadingIconName"
|
|
116
|
+
:class="ui.leadingIcon({ class: props.ui?.leadingIcon })"
|
|
117
|
+
data-part="leadingIcon"
|
|
118
|
+
/>
|
|
119
|
+
<Avatar
|
|
120
|
+
v-else-if="props.avatar"
|
|
121
|
+
:size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
|
|
122
|
+
v-bind="props.avatar"
|
|
123
|
+
:class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })"
|
|
124
|
+
data-part="leadingAvatar"
|
|
125
|
+
/>
|
|
126
|
+
</slot>
|
|
127
|
+
</span>
|
|
128
|
+
|
|
129
|
+
<input
|
|
130
|
+
ref="inputRef"
|
|
131
|
+
:type="props.type"
|
|
132
|
+
:value="modelValue"
|
|
133
|
+
:placeholder="props.placeholder"
|
|
134
|
+
:required="props.required"
|
|
135
|
+
:autocomplete="props.autocomplete"
|
|
136
|
+
v-bind="{ id, name, disabled, ...$attrs, ...ariaAttrs }"
|
|
137
|
+
:class="ui.base({ class: props.ui?.base })"
|
|
138
|
+
data-part="base"
|
|
139
|
+
@input="onInput"
|
|
140
|
+
@blur="onBlur"
|
|
141
|
+
@change="onChange"
|
|
142
|
+
@focus="emitFormFocus"
|
|
143
|
+
/>
|
|
144
|
+
|
|
145
|
+
<slot :ui="ui"></slot>
|
|
146
|
+
|
|
147
|
+
<span v-if="isTrailing || slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })" data-part="trailing">
|
|
148
|
+
<slot name="trailing" :ui="ui">
|
|
149
|
+
<Icon
|
|
150
|
+
v-if="trailingIconName"
|
|
151
|
+
:name="trailingIconName"
|
|
152
|
+
:class="ui.trailingIcon({ class: props.ui?.trailingIcon })"
|
|
153
|
+
data-part="trailingIcon"
|
|
154
|
+
/>
|
|
155
|
+
</slot>
|
|
156
|
+
</span>
|
|
157
|
+
</Primitive>
|
|
158
158
|
</template>
|
|
@@ -10,6 +10,7 @@ import { useAppConfig } from "#imports";
|
|
|
10
10
|
import { useFieldGroup } from "../composables/useFieldGroup";
|
|
11
11
|
import { useFormField } from "../composables/useFormField";
|
|
12
12
|
import { useLocale } from "../composables/useLocale";
|
|
13
|
+
import { pick } from "../utils";
|
|
13
14
|
import { cv, merge } from "../utils/style";
|
|
14
15
|
import Button from "./Button.vue";
|
|
15
16
|
defineOptions({ inheritAttrs: false });
|
|
@@ -58,9 +59,9 @@ const appConfig = useAppConfig();
|
|
|
58
59
|
const ui = computed(() => {
|
|
59
60
|
const styler = cv(merge(theme, appConfig.ui.inputNumber));
|
|
60
61
|
return styler({
|
|
61
|
-
...props,
|
|
62
|
-
size: fieldGroupSize.value || formFieldSize.value,
|
|
62
|
+
...pick(props, ["variant", "orientation", "disabled"]),
|
|
63
63
|
color: color.value,
|
|
64
|
+
size: fieldGroupSize.value || formFieldSize.value,
|
|
64
65
|
highlight: highlight.value,
|
|
65
66
|
fieldGroup: orientation.value,
|
|
66
67
|
increment: props.orientation === "vertical" ? !!props.increment || !!props.decrement : !!props.increment,
|
|
@@ -95,51 +96,51 @@ defineExpose({
|
|
|
95
96
|
</script>
|
|
96
97
|
|
|
97
98
|
<template>
|
|
98
|
-
<NumberFieldRoot
|
|
99
|
-
v-bind="{ ...rootProps, id, name, disabled, modelValue }"
|
|
100
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
101
|
-
data-part="root"
|
|
102
|
-
@update:model-value="onUpdate"
|
|
103
|
-
>
|
|
104
|
-
<NumberFieldInput
|
|
105
|
-
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
106
|
-
ref="inputRef"
|
|
107
|
-
:placeholder="props.placeholder"
|
|
108
|
-
:required="props.required"
|
|
109
|
-
:class="ui.base({ class: props.ui?.base })"
|
|
110
|
-
data-part="base"
|
|
111
|
-
@blur="onBlur"
|
|
112
|
-
@focus="emitFormFocus"
|
|
113
|
-
/>
|
|
114
|
-
|
|
115
|
-
<div v-if="props.increment" :class="ui.increment({ class: props.ui?.increment })" data-part="increment">
|
|
116
|
-
<NumberFieldIncrement :disabled="disabled || incrementDisabled" as-child>
|
|
117
|
-
<slot name="increment">
|
|
118
|
-
<Button
|
|
119
|
-
:icon="incrementIcon"
|
|
120
|
-
:size="props.size"
|
|
121
|
-
:color="color"
|
|
122
|
-
variant="link"
|
|
123
|
-
:aria-label="t('inputNumber.increment')"
|
|
124
|
-
v-bind="typeof props.increment === 'object' ? props.increment : void 0"
|
|
125
|
-
/>
|
|
126
|
-
</slot>
|
|
127
|
-
</NumberFieldIncrement>
|
|
128
|
-
</div>
|
|
129
|
-
|
|
130
|
-
<div v-if="props.decrement" :class="ui.decrement({ class: props.ui?.decrement })" data-part="decrement">
|
|
131
|
-
<NumberFieldDecrement :disabled="disabled || decrementDisabled" as-child>
|
|
132
|
-
<slot name="decrement">
|
|
133
|
-
<Button
|
|
134
|
-
:icon="decrementIcon"
|
|
135
|
-
:size="props.size"
|
|
136
|
-
:color="color"
|
|
137
|
-
variant="link"
|
|
138
|
-
:aria-label="t('inputNumber.decrement')"
|
|
139
|
-
v-bind="typeof props.decrement === 'object' ? props.decrement : void 0"
|
|
140
|
-
/>
|
|
141
|
-
</slot>
|
|
142
|
-
</NumberFieldDecrement>
|
|
143
|
-
</div>
|
|
144
|
-
</NumberFieldRoot>
|
|
99
|
+
<NumberFieldRoot
|
|
100
|
+
v-bind="{ ...rootProps, id, name, disabled, modelValue }"
|
|
101
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
102
|
+
data-part="root"
|
|
103
|
+
@update:model-value="onUpdate"
|
|
104
|
+
>
|
|
105
|
+
<NumberFieldInput
|
|
106
|
+
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
107
|
+
ref="inputRef"
|
|
108
|
+
:placeholder="props.placeholder"
|
|
109
|
+
:required="props.required"
|
|
110
|
+
:class="ui.base({ class: props.ui?.base })"
|
|
111
|
+
data-part="base"
|
|
112
|
+
@blur="onBlur"
|
|
113
|
+
@focus="emitFormFocus"
|
|
114
|
+
/>
|
|
115
|
+
|
|
116
|
+
<div v-if="props.increment" :class="ui.increment({ class: props.ui?.increment })" data-part="increment">
|
|
117
|
+
<NumberFieldIncrement :disabled="disabled || incrementDisabled" as-child>
|
|
118
|
+
<slot name="increment">
|
|
119
|
+
<Button
|
|
120
|
+
:icon="incrementIcon"
|
|
121
|
+
:size="props.size"
|
|
122
|
+
:color="color"
|
|
123
|
+
variant="link"
|
|
124
|
+
:aria-label="t('inputNumber.increment')"
|
|
125
|
+
v-bind="typeof props.increment === 'object' ? props.increment : void 0"
|
|
126
|
+
/>
|
|
127
|
+
</slot>
|
|
128
|
+
</NumberFieldIncrement>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div v-if="props.decrement" :class="ui.decrement({ class: props.ui?.decrement })" data-part="decrement">
|
|
132
|
+
<NumberFieldDecrement :disabled="disabled || decrementDisabled" as-child>
|
|
133
|
+
<slot name="decrement">
|
|
134
|
+
<Button
|
|
135
|
+
:icon="decrementIcon"
|
|
136
|
+
:size="props.size"
|
|
137
|
+
:color="color"
|
|
138
|
+
variant="link"
|
|
139
|
+
:aria-label="t('inputNumber.decrement')"
|
|
140
|
+
v-bind="typeof props.decrement === 'object' ? props.decrement : void 0"
|
|
141
|
+
/>
|
|
142
|
+
</slot>
|
|
143
|
+
</NumberFieldDecrement>
|
|
144
|
+
</div>
|
|
145
|
+
</NumberFieldRoot>
|
|
145
146
|
</template>
|
|
@@ -10,6 +10,7 @@ import { useAppConfig } from "#imports";
|
|
|
10
10
|
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
11
11
|
import { useFieldGroup } from "../composables/useFieldGroup";
|
|
12
12
|
import { useFormField } from "../composables/useFormField";
|
|
13
|
+
import { pick } from "../utils";
|
|
13
14
|
import { cv, merge } from "../utils/style";
|
|
14
15
|
import Avatar from "./Avatar.vue";
|
|
15
16
|
import Icon from "./Icon.vue";
|
|
@@ -60,8 +61,7 @@ const appConfig = useAppConfig();
|
|
|
60
61
|
const ui = computed(() => {
|
|
61
62
|
const styler = cv(merge(theme, appConfig.ui.inputTags));
|
|
62
63
|
return styler({
|
|
63
|
-
...props,
|
|
64
|
-
type: void 0,
|
|
64
|
+
...pick(props, ["variant", "loading"]),
|
|
65
65
|
color: color.value,
|
|
66
66
|
size: fieldGroupSize.value || formFieldSize.value,
|
|
67
67
|
highlight: highlight.value,
|
|
@@ -100,57 +100,57 @@ defineExpose({
|
|
|
100
100
|
</script>
|
|
101
101
|
|
|
102
102
|
<template>
|
|
103
|
-
<TagsInputRoot
|
|
104
|
-
v-slot="{ modelValue: tags }"
|
|
105
|
-
:model-value="props.modelValue"
|
|
106
|
-
:default-value="props.defaultValue"
|
|
107
|
-
:class="ui.root({ class: [ui.base({ class: props.ui?.base }), props.ui?.root, props.class] })"
|
|
108
|
-
v-bind="{ ...rootProps, id, name, disabled }"
|
|
109
|
-
data-part="root"
|
|
110
|
-
@update:model-value="onUpdate"
|
|
111
|
-
>
|
|
112
|
-
<TagsInputItem
|
|
113
|
-
v-for="(item, index) in tags"
|
|
114
|
-
:key="index"
|
|
115
|
-
:value="item"
|
|
116
|
-
:class="ui.item({ class: props.ui?.item })"
|
|
117
|
-
data-part="item"
|
|
118
|
-
>
|
|
119
|
-
<TagsInputItemText :class="ui.itemText({ class: props.ui?.itemText })" data-part="itemText">
|
|
120
|
-
<slot name="item-text" :item="item" :index="index" :ui="ui"></slot>
|
|
121
|
-
</TagsInputItemText>
|
|
122
|
-
|
|
123
|
-
<TagsInputItemDelete :disabled="disabled" :class="ui.itemDelete({ class: props.ui?.itemDelete })" data-part="itemDelete">
|
|
124
|
-
<slot name="item-delete" :item="item" :index="index" :ui="ui">
|
|
125
|
-
<Icon :name="props.deleteIcon || appConfig.ui.icons.close" :class="ui.itemDeleteIcon({ class: props.ui?.itemDeleteIcon })" data-part="itemDeleteIcon" />
|
|
126
|
-
</slot>
|
|
127
|
-
</TagsInputItemDelete>
|
|
128
|
-
</TagsInputItem>
|
|
129
|
-
|
|
130
|
-
<TagsInputInput
|
|
131
|
-
ref="inputRef"
|
|
132
|
-
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
133
|
-
:placeholder="props.placeholder"
|
|
134
|
-
:max-length="props.maxLength"
|
|
135
|
-
:class="ui.input({ class: props.ui?.input })"
|
|
136
|
-
data-part="input"
|
|
137
|
-
@blur="onBlur"
|
|
138
|
-
@focus="onFocus"
|
|
139
|
-
/>
|
|
140
|
-
|
|
141
|
-
<span v-if="isLeading || props.avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })" data-part="leading">
|
|
142
|
-
<slot name="leading" :ui="ui">
|
|
143
|
-
<Icon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" data-part="leadingIcon" />
|
|
144
|
-
<Avatar v-else-if="props.avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="props.avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" data-part="leadingAvatar" />
|
|
145
|
-
</slot>
|
|
146
|
-
</span>
|
|
147
|
-
|
|
148
|
-
<slot :ui="ui"></slot>
|
|
149
|
-
|
|
150
|
-
<span v-if="isTrailing || !!slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })" data-part="trailing">
|
|
151
|
-
<slot name="trailing" :ui="ui">
|
|
152
|
-
<Icon v-if="trailingIconName" :name="trailingIconName" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" data-part="trailingIcon" />
|
|
153
|
-
</slot>
|
|
154
|
-
</span>
|
|
155
|
-
</TagsInputRoot>
|
|
103
|
+
<TagsInputRoot
|
|
104
|
+
v-slot="{ modelValue: tags }"
|
|
105
|
+
:model-value="props.modelValue"
|
|
106
|
+
:default-value="props.defaultValue"
|
|
107
|
+
:class="ui.root({ class: [ui.base({ class: props.ui?.base }), props.ui?.root, props.class] })"
|
|
108
|
+
v-bind="{ ...rootProps, id, name, disabled }"
|
|
109
|
+
data-part="root"
|
|
110
|
+
@update:model-value="onUpdate"
|
|
111
|
+
>
|
|
112
|
+
<TagsInputItem
|
|
113
|
+
v-for="(item, index) in tags"
|
|
114
|
+
:key="index"
|
|
115
|
+
:value="item"
|
|
116
|
+
:class="ui.item({ class: props.ui?.item })"
|
|
117
|
+
data-part="item"
|
|
118
|
+
>
|
|
119
|
+
<TagsInputItemText :class="ui.itemText({ class: props.ui?.itemText })" data-part="itemText">
|
|
120
|
+
<slot name="item-text" :item="item" :index="index" :ui="ui"></slot>
|
|
121
|
+
</TagsInputItemText>
|
|
122
|
+
|
|
123
|
+
<TagsInputItemDelete :disabled="disabled" :class="ui.itemDelete({ class: props.ui?.itemDelete })" data-part="itemDelete">
|
|
124
|
+
<slot name="item-delete" :item="item" :index="index" :ui="ui">
|
|
125
|
+
<Icon :name="props.deleteIcon || appConfig.ui.icons.close" :class="ui.itemDeleteIcon({ class: props.ui?.itemDeleteIcon })" data-part="itemDeleteIcon" />
|
|
126
|
+
</slot>
|
|
127
|
+
</TagsInputItemDelete>
|
|
128
|
+
</TagsInputItem>
|
|
129
|
+
|
|
130
|
+
<TagsInputInput
|
|
131
|
+
ref="inputRef"
|
|
132
|
+
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
133
|
+
:placeholder="props.placeholder"
|
|
134
|
+
:max-length="props.maxLength"
|
|
135
|
+
:class="ui.input({ class: props.ui?.input })"
|
|
136
|
+
data-part="input"
|
|
137
|
+
@blur="onBlur"
|
|
138
|
+
@focus="onFocus"
|
|
139
|
+
/>
|
|
140
|
+
|
|
141
|
+
<span v-if="isLeading || props.avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })" data-part="leading">
|
|
142
|
+
<slot name="leading" :ui="ui">
|
|
143
|
+
<Icon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" data-part="leadingIcon" />
|
|
144
|
+
<Avatar v-else-if="props.avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="props.avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" data-part="leadingAvatar" />
|
|
145
|
+
</slot>
|
|
146
|
+
</span>
|
|
147
|
+
|
|
148
|
+
<slot :ui="ui"></slot>
|
|
149
|
+
|
|
150
|
+
<span v-if="isTrailing || !!slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })" data-part="trailing">
|
|
151
|
+
<slot name="trailing" :ui="ui">
|
|
152
|
+
<Icon v-if="trailingIconName" :name="trailingIconName" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" data-part="trailingIcon" />
|
|
153
|
+
</slot>
|
|
154
|
+
</span>
|
|
155
|
+
</TagsInputRoot>
|
|
156
156
|
</template>
|
|
@@ -7,6 +7,7 @@ import theme from "#build/ui/kbd";
|
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
9
|
import { useKbd } from "../composables/useKbd";
|
|
10
|
+
import { pick } from "../utils";
|
|
10
11
|
import { cv, merge } from "../utils/style";
|
|
11
12
|
const props = defineProps({
|
|
12
13
|
as: { type: null, required: false, default: "kbd" },
|
|
@@ -21,12 +22,12 @@ const { getKbdKey } = useKbd();
|
|
|
21
22
|
const appConfig = useAppConfig();
|
|
22
23
|
const ui = computed(() => {
|
|
23
24
|
const styler = cv(merge(theme, appConfig.ui.kbd));
|
|
24
|
-
return styler(props);
|
|
25
|
+
return styler(pick(props, ["color", "variant", "size"]));
|
|
25
26
|
});
|
|
26
27
|
</script>
|
|
27
28
|
|
|
28
29
|
<template>
|
|
29
|
-
<Primitive :as="props.as" :class="ui.base({ class: props.class })" data-part="base">
|
|
30
|
-
<slot>{{ getKbdKey(props.value) }}</slot>
|
|
31
|
-
</Primitive>
|
|
30
|
+
<Primitive :as="props.as" :class="ui.base({ class: props.class })" data-part="base">
|
|
31
|
+
<slot>{{ getKbdKey(props.value) }}</slot>
|
|
32
|
+
</Primitive>
|
|
32
33
|
</template>
|
|
@@ -9,6 +9,7 @@ import { useForwardProps } from "reka-ui";
|
|
|
9
9
|
import { computed } from "vue";
|
|
10
10
|
import theme from "#build/ui/link";
|
|
11
11
|
import { useAppConfig, useRoute } from "#imports";
|
|
12
|
+
import { pick } from "../utils";
|
|
12
13
|
import { isPartiallyEqual } from "../utils/link";
|
|
13
14
|
import { cv, merge } from "../utils/style";
|
|
14
15
|
import LinkBase from "./LinkBase.vue";
|
|
@@ -83,19 +84,19 @@ function resolveLinkClass({ route: route2, isActive, isExactActive }) {
|
|
|
83
84
|
const active = isLinkActive({ route: route2, isActive, isExactActive });
|
|
84
85
|
if (props.raw)
|
|
85
86
|
return [props.class, active ? props.activeClass : props.inactiveClass];
|
|
86
|
-
return ui.value.base({ ...props, active });
|
|
87
|
+
return ui.value.base({ ...pick(props, ["class", "disabled"]), active });
|
|
87
88
|
}
|
|
88
89
|
</script>
|
|
89
90
|
|
|
90
91
|
<template>
|
|
91
|
-
<NuxtLink
|
|
92
|
-
v-slot="{ href, navigate, route: linkRoute, rel, target, isExternal, isActive, isExactActive }"
|
|
93
|
-
v-bind="nuxtLinkProps"
|
|
94
|
-
:to="to"
|
|
95
|
-
custom
|
|
96
|
-
>
|
|
97
|
-
<template v-if="custom">
|
|
98
|
-
<slot
|
|
92
|
+
<NuxtLink
|
|
93
|
+
v-slot="{ href, navigate, route: linkRoute, rel, target, isExternal, isActive, isExactActive }"
|
|
94
|
+
v-bind="nuxtLinkProps"
|
|
95
|
+
:to="to"
|
|
96
|
+
custom
|
|
97
|
+
>
|
|
98
|
+
<template v-if="custom">
|
|
99
|
+
<slot
|
|
99
100
|
v-bind="{
|
|
100
101
|
...$attrs,
|
|
101
102
|
...props.exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {},
|
|
@@ -106,13 +107,13 @@ function resolveLinkClass({ route: route2, isActive, isExactActive }) {
|
|
|
106
107
|
target,
|
|
107
108
|
isExternal,
|
|
108
109
|
active: isLinkActive({ route: linkRoute, isActive, isExactActive })
|
|
109
|
-
}"
|
|
110
|
-
>
|
|
111
|
-
{{ props.label }}
|
|
112
|
-
</slot>
|
|
113
|
-
</template>
|
|
114
|
-
<LinkBase
|
|
115
|
-
v-else
|
|
110
|
+
}"
|
|
111
|
+
>
|
|
112
|
+
{{ props.label }}
|
|
113
|
+
</slot>
|
|
114
|
+
</template>
|
|
115
|
+
<LinkBase
|
|
116
|
+
v-else
|
|
116
117
|
v-bind="{
|
|
117
118
|
...$attrs,
|
|
118
119
|
...props.exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {},
|
|
@@ -122,12 +123,12 @@ function resolveLinkClass({ route: route2, isActive, isExactActive }) {
|
|
|
122
123
|
rel,
|
|
123
124
|
target,
|
|
124
125
|
isExternal
|
|
125
|
-
}"
|
|
126
|
-
:class="resolveLinkClass({ route: linkRoute, isActive, isExactActive })"
|
|
127
|
-
>
|
|
128
|
-
<slot :active="isLinkActive({ route: linkRoute, isActive, isExactActive })">
|
|
129
|
-
{{ props.label }}
|
|
130
|
-
</slot>
|
|
131
|
-
</LinkBase>
|
|
132
|
-
</NuxtLink>
|
|
126
|
+
}"
|
|
127
|
+
:class="resolveLinkClass({ route: linkRoute, isActive, isExactActive })"
|
|
128
|
+
>
|
|
129
|
+
<slot :active="isLinkActive({ route: linkRoute, isActive, isExactActive })">
|
|
130
|
+
{{ props.label }}
|
|
131
|
+
</slot>
|
|
132
|
+
</LinkBase>
|
|
133
|
+
</NuxtLink>
|
|
133
134
|
</template>
|
|
@@ -6,6 +6,7 @@ import theme from "#build/ui/marquee";
|
|
|
6
6
|
import { Primitive } from "reka-ui";
|
|
7
7
|
import { computed } from "vue";
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
|
+
import { pick } from "../utils";
|
|
9
10
|
import { cv, merge } from "../utils/style";
|
|
10
11
|
const props = defineProps({
|
|
11
12
|
as: { type: null, required: false },
|
|
@@ -21,16 +22,16 @@ defineSlots();
|
|
|
21
22
|
const appConfig = useAppConfig();
|
|
22
23
|
const ui = computed(() => {
|
|
23
24
|
const styler = cv(merge(theme, appConfig.ui.marquee));
|
|
24
|
-
return styler(props);
|
|
25
|
+
return styler(pick(props, ["pauseOnHover", "orientation", "reverse", "overlay"]));
|
|
25
26
|
});
|
|
26
27
|
</script>
|
|
27
28
|
|
|
28
29
|
<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>
|
|
30
|
+
<Primitive :as="props.as" :data-orientation="props.orientation" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
31
|
+
<div v-for="i in props.repeat" :key="i" :class="ui.content({ class: props.ui?.content })" data-part="content">
|
|
32
|
+
<slot></slot>
|
|
33
|
+
</div>
|
|
34
|
+
</Primitive>
|
|
34
35
|
</template>
|
|
35
36
|
|
|
36
37
|
<style>
|