@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
|
@@ -9,6 +9,7 @@ import { Primitive, useForwardProps } from "reka-ui";
|
|
|
9
9
|
import { computed, onBeforeMount, onMounted, ref, watch } from "vue";
|
|
10
10
|
import { useAppConfig } from "#imports";
|
|
11
11
|
import { useLocale } from "../composables/useLocale";
|
|
12
|
+
import { pick } from "../utils";
|
|
12
13
|
import { cv, merge } from "../utils/style";
|
|
13
14
|
import Button from "./Button.vue";
|
|
14
15
|
const props = defineProps({
|
|
@@ -52,7 +53,7 @@ const { t, dir } = useLocale();
|
|
|
52
53
|
const appConfig = useAppConfig();
|
|
53
54
|
const ui = computed(() => {
|
|
54
55
|
const styler = cv(merge(theme, appConfig.ui.carousel));
|
|
55
|
-
return styler(props);
|
|
56
|
+
return styler(pick(props, ["orientation"]));
|
|
56
57
|
});
|
|
57
58
|
const rootProps = useForwardProps(reactivePick(props, "active", "align", "breakpoints", "containScroll", "dragFree", "dragThreshold", "duration", "inViewThreshold", "loop", "skipSnaps", "slidesToScroll", "startIndex", "watchDrag", "watchResize", "watchSlides", "watchFocus"));
|
|
58
59
|
const prevIcon = computed(() => props.prevIcon || (dir.value === "rtl" ? appConfig.ui.icons.chevronRight : appConfig.ui.icons.chevronLeft));
|
|
@@ -189,70 +190,70 @@ defineExpose({
|
|
|
189
190
|
</script>
|
|
190
191
|
|
|
191
192
|
<template>
|
|
192
|
-
<Primitive
|
|
193
|
-
:as="props.as"
|
|
194
|
-
role="region"
|
|
195
|
-
tabindex="0"
|
|
196
|
-
:class="ui.root({ class: [props.class, props.ui?.root] })"
|
|
197
|
-
aria-roledescription="carousel"
|
|
198
|
-
:data-orientation="props.orientation"
|
|
199
|
-
data-part="root"
|
|
200
|
-
@keydown="onKeyDown"
|
|
201
|
-
>
|
|
202
|
-
<div ref="emblaRef" :class="ui.viewport({ class: props.ui?.viewport })" data-part="viewport">
|
|
203
|
-
<div :class="ui.container({ class: props.ui?.container })" data-part="container">
|
|
204
|
-
<div
|
|
205
|
-
v-for="(item, index) in props.items"
|
|
206
|
-
:key="index"
|
|
207
|
-
v-bind="props.dots ? { role: 'tabpanel' } : { 'role': 'group', 'aria-roledescription': 'slide' }"
|
|
208
|
-
:class="ui.item({ class: [props.ui?.item, ...isCarouselItem(item) ? [item.ui?.item, item.class] : []] })"
|
|
209
|
-
data-part="item"
|
|
210
|
-
>
|
|
211
|
-
<slot :item="item" :index="index"></slot>
|
|
212
|
-
</div>
|
|
213
|
-
</div>
|
|
214
|
-
</div>
|
|
215
|
-
|
|
216
|
-
<div v-if="props.arrows || props.dots" :class="ui.controls({ class: props.ui?.controls })" data-part="controls">
|
|
217
|
-
<div v-if="props.arrows" :class="ui.arrows({ class: props.ui?.arrows })" data-part="arrows">
|
|
218
|
-
<Button
|
|
219
|
-
:disabled="!canScrollPrev"
|
|
220
|
-
:icon="prevIcon"
|
|
221
|
-
color="neutral"
|
|
222
|
-
variant="outline"
|
|
223
|
-
:aria-label="t('carousel.prev')"
|
|
224
|
-
v-bind="typeof props.prev === 'object' ? props.prev : void 0"
|
|
225
|
-
:class="ui.prev({ class: props.ui?.prev })"
|
|
226
|
-
data-part="prev"
|
|
227
|
-
@click="scrollPrev"
|
|
228
|
-
/>
|
|
229
|
-
<Button
|
|
230
|
-
:disabled="!canScrollNext"
|
|
231
|
-
:icon="nextIcon"
|
|
232
|
-
color="neutral"
|
|
233
|
-
variant="outline"
|
|
234
|
-
:aria-label="t('carousel.next')"
|
|
235
|
-
v-bind="typeof props.next === 'object' ? props.next : void 0"
|
|
236
|
-
:class="ui.next({ class: props.ui?.next })"
|
|
237
|
-
data-part="next"
|
|
238
|
-
@click="scrollNext"
|
|
239
|
-
/>
|
|
240
|
-
</div>
|
|
241
|
-
|
|
242
|
-
<div v-if="props.dots" role="tablist" :aria-label="t('carousel.dots')" :class="ui.dots({ class: props.ui?.dots })" data-part="dots">
|
|
243
|
-
<template v-for="(_, index) in scrollSnaps" :key="index">
|
|
244
|
-
<button
|
|
245
|
-
type="button"
|
|
246
|
-
role="tab"
|
|
247
|
-
:aria-label="t('carousel.goto', { page: index + 1 })"
|
|
248
|
-
:aria-selected="selectedIndex === index"
|
|
249
|
-
:class="ui.dot({ class: props.ui?.dot, active: selectedIndex === index })"
|
|
250
|
-
data-part="dot"
|
|
251
|
-
:data-state="selectedIndex === index ? 'active' : void 0"
|
|
252
|
-
@click="scrollTo(index)"
|
|
253
|
-
></button>
|
|
254
|
-
</template>
|
|
255
|
-
</div>
|
|
256
|
-
</div>
|
|
257
|
-
</Primitive>
|
|
193
|
+
<Primitive
|
|
194
|
+
:as="props.as"
|
|
195
|
+
role="region"
|
|
196
|
+
tabindex="0"
|
|
197
|
+
:class="ui.root({ class: [props.class, props.ui?.root] })"
|
|
198
|
+
aria-roledescription="carousel"
|
|
199
|
+
:data-orientation="props.orientation"
|
|
200
|
+
data-part="root"
|
|
201
|
+
@keydown="onKeyDown"
|
|
202
|
+
>
|
|
203
|
+
<div ref="emblaRef" :class="ui.viewport({ class: props.ui?.viewport })" data-part="viewport">
|
|
204
|
+
<div :class="ui.container({ class: props.ui?.container })" data-part="container">
|
|
205
|
+
<div
|
|
206
|
+
v-for="(item, index) in props.items"
|
|
207
|
+
:key="index"
|
|
208
|
+
v-bind="props.dots ? { role: 'tabpanel' } : { 'role': 'group', 'aria-roledescription': 'slide' }"
|
|
209
|
+
:class="ui.item({ class: [props.ui?.item, ...isCarouselItem(item) ? [item.ui?.item, item.class] : []] })"
|
|
210
|
+
data-part="item"
|
|
211
|
+
>
|
|
212
|
+
<slot :item="item" :index="index"></slot>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
<div v-if="props.arrows || props.dots" :class="ui.controls({ class: props.ui?.controls })" data-part="controls">
|
|
218
|
+
<div v-if="props.arrows" :class="ui.arrows({ class: props.ui?.arrows })" data-part="arrows">
|
|
219
|
+
<Button
|
|
220
|
+
:disabled="!canScrollPrev"
|
|
221
|
+
:icon="prevIcon"
|
|
222
|
+
color="neutral"
|
|
223
|
+
variant="outline"
|
|
224
|
+
:aria-label="t('carousel.prev')"
|
|
225
|
+
v-bind="typeof props.prev === 'object' ? props.prev : void 0"
|
|
226
|
+
:class="ui.prev({ class: props.ui?.prev })"
|
|
227
|
+
data-part="prev"
|
|
228
|
+
@click="scrollPrev"
|
|
229
|
+
/>
|
|
230
|
+
<Button
|
|
231
|
+
:disabled="!canScrollNext"
|
|
232
|
+
:icon="nextIcon"
|
|
233
|
+
color="neutral"
|
|
234
|
+
variant="outline"
|
|
235
|
+
:aria-label="t('carousel.next')"
|
|
236
|
+
v-bind="typeof props.next === 'object' ? props.next : void 0"
|
|
237
|
+
:class="ui.next({ class: props.ui?.next })"
|
|
238
|
+
data-part="next"
|
|
239
|
+
@click="scrollNext"
|
|
240
|
+
/>
|
|
241
|
+
</div>
|
|
242
|
+
|
|
243
|
+
<div v-if="props.dots" role="tablist" :aria-label="t('carousel.dots')" :class="ui.dots({ class: props.ui?.dots })" data-part="dots">
|
|
244
|
+
<template v-for="(_, index) in scrollSnaps" :key="index">
|
|
245
|
+
<button
|
|
246
|
+
type="button"
|
|
247
|
+
role="tab"
|
|
248
|
+
:aria-label="t('carousel.goto', { page: index + 1 })"
|
|
249
|
+
:aria-selected="selectedIndex === index"
|
|
250
|
+
:class="ui.dot({ class: props.ui?.dot, active: selectedIndex === index })"
|
|
251
|
+
data-part="dot"
|
|
252
|
+
:data-state="selectedIndex === index ? 'active' : void 0"
|
|
253
|
+
@click="scrollTo(index)"
|
|
254
|
+
></button>
|
|
255
|
+
</template>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
</Primitive>
|
|
258
259
|
</template>
|
|
@@ -8,6 +8,7 @@ import { CheckboxIndicator, CheckboxRoot, Label, Primitive, useForwardProps } fr
|
|
|
8
8
|
import { computed, useId } from "vue";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useFormField } from "../composables/useFormField";
|
|
11
|
+
import { pick } from "../utils";
|
|
11
12
|
import { cv, merge } from "../utils/style";
|
|
12
13
|
import Icon from "./Icon.vue";
|
|
13
14
|
defineOptions({ inheritAttrs: false });
|
|
@@ -35,14 +36,15 @@ const emit = defineEmits(["update:modelValue", "change"]);
|
|
|
35
36
|
const slots = defineSlots();
|
|
36
37
|
const modelValue = useVModel(props, "modelValue", emit);
|
|
37
38
|
const rootProps = useForwardProps(reactivePick(props, "required", "value", "defaultValue"));
|
|
38
|
-
const { id: _id, size,
|
|
39
|
+
const { id: _id, name, size, color, disabled, ariaAttrs, emitFormChange, emitFormInput } = useFormField(props);
|
|
39
40
|
const id = _id.value ?? useId();
|
|
40
41
|
const appConfig = useAppConfig();
|
|
41
42
|
const ui = computed(() => {
|
|
42
43
|
const styler = cv(merge(theme, appConfig.ui.checkbox));
|
|
43
44
|
return styler({
|
|
44
|
-
...props,
|
|
45
|
+
...pick(props, ["variant", "indicator", "required"]),
|
|
45
46
|
size: size.value,
|
|
47
|
+
color: color.value,
|
|
46
48
|
disabled: disabled.value
|
|
47
49
|
});
|
|
48
50
|
});
|
|
@@ -55,50 +57,50 @@ function onUpdate(value) {
|
|
|
55
57
|
</script>
|
|
56
58
|
|
|
57
59
|
<template>
|
|
58
|
-
<Primitive :as="props.variant && props.variant !== 'list' ? Label : props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
59
|
-
<div :class="ui.container({ class: props.ui?.container })" data-part="container">
|
|
60
|
-
<CheckboxRoot
|
|
61
|
-
v-bind="{ id, ...rootProps, ...$attrs, ...ariaAttrs, name, disabled }"
|
|
62
|
-
v-model="modelValue"
|
|
63
|
-
:class="ui.base({ class: props.ui?.base })"
|
|
64
|
-
data-part="base"
|
|
65
|
-
@update:model-value="onUpdate"
|
|
66
|
-
>
|
|
67
|
-
<template #default="{ modelValue }">
|
|
68
|
-
<CheckboxIndicator :class="ui.indicator({ class: props.ui?.indicator })" data-part="indicator">
|
|
69
|
-
<Icon
|
|
70
|
-
v-if="modelValue === 'indeterminate'"
|
|
71
|
-
:name="props.indeterminateIcon || appConfig.ui.icons.minus"
|
|
72
|
-
:class="ui.icon({ class: props.ui?.icon })"
|
|
73
|
-
data-part="icon"
|
|
74
|
-
/>
|
|
75
|
-
<Icon
|
|
76
|
-
v-else
|
|
77
|
-
:name="props.icon || appConfig.ui.icons.check"
|
|
78
|
-
:class="ui.icon({ class: props.ui?.icon })"
|
|
79
|
-
data-part="icon"
|
|
80
|
-
/>
|
|
81
|
-
</CheckboxIndicator>
|
|
82
|
-
</template>
|
|
83
|
-
</CheckboxRoot>
|
|
84
|
-
</div>
|
|
85
|
-
<div v-if="props.label || !!slots.label || props.description || !!slots.description" :class="ui.wrapper({ class: props.ui?.wrapper })" data-part="wrapper">
|
|
86
|
-
<component
|
|
87
|
-
:is="!props.variant || props.variant === 'list' ? Label : 'p'"
|
|
88
|
-
v-if="props.label || !!slots.label"
|
|
89
|
-
:for="id"
|
|
90
|
-
:class="ui.label({ class: props.ui?.label })"
|
|
91
|
-
data-part="label"
|
|
92
|
-
>
|
|
93
|
-
<slot name="label" :label="props.label">
|
|
94
|
-
{{ props.label }}
|
|
95
|
-
</slot>
|
|
96
|
-
</component>
|
|
97
|
-
<p v-if="props.description || !!slots.description" :class="ui.description({ class: props.ui?.description })" data-part="description">
|
|
98
|
-
<slot name="description" :description="props.description">
|
|
99
|
-
{{ props.description }}
|
|
100
|
-
</slot>
|
|
101
|
-
</p>
|
|
102
|
-
</div>
|
|
103
|
-
</Primitive>
|
|
60
|
+
<Primitive :as="props.variant && props.variant !== 'list' ? Label : props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
61
|
+
<div :class="ui.container({ class: props.ui?.container })" data-part="container">
|
|
62
|
+
<CheckboxRoot
|
|
63
|
+
v-bind="{ id, ...rootProps, ...$attrs, ...ariaAttrs, name, disabled }"
|
|
64
|
+
v-model="modelValue"
|
|
65
|
+
:class="ui.base({ class: props.ui?.base })"
|
|
66
|
+
data-part="base"
|
|
67
|
+
@update:model-value="onUpdate"
|
|
68
|
+
>
|
|
69
|
+
<template #default="{ modelValue }">
|
|
70
|
+
<CheckboxIndicator :class="ui.indicator({ class: props.ui?.indicator })" data-part="indicator">
|
|
71
|
+
<Icon
|
|
72
|
+
v-if="modelValue === 'indeterminate'"
|
|
73
|
+
:name="props.indeterminateIcon || appConfig.ui.icons.minus"
|
|
74
|
+
:class="ui.icon({ class: props.ui?.icon })"
|
|
75
|
+
data-part="icon"
|
|
76
|
+
/>
|
|
77
|
+
<Icon
|
|
78
|
+
v-else
|
|
79
|
+
:name="props.icon || appConfig.ui.icons.check"
|
|
80
|
+
:class="ui.icon({ class: props.ui?.icon })"
|
|
81
|
+
data-part="icon"
|
|
82
|
+
/>
|
|
83
|
+
</CheckboxIndicator>
|
|
84
|
+
</template>
|
|
85
|
+
</CheckboxRoot>
|
|
86
|
+
</div>
|
|
87
|
+
<div v-if="props.label || !!slots.label || props.description || !!slots.description" :class="ui.wrapper({ class: props.ui?.wrapper })" data-part="wrapper">
|
|
88
|
+
<component
|
|
89
|
+
:is="!props.variant || props.variant === 'list' ? Label : 'p'"
|
|
90
|
+
v-if="props.label || !!slots.label"
|
|
91
|
+
:for="id"
|
|
92
|
+
:class="ui.label({ class: props.ui?.label })"
|
|
93
|
+
data-part="label"
|
|
94
|
+
>
|
|
95
|
+
<slot name="label" :label="props.label">
|
|
96
|
+
{{ props.label }}
|
|
97
|
+
</slot>
|
|
98
|
+
</component>
|
|
99
|
+
<p v-if="props.description || !!slots.description" :class="ui.description({ class: props.ui?.description })" data-part="description">
|
|
100
|
+
<slot name="description" :description="props.description">
|
|
101
|
+
{{ props.description }}
|
|
102
|
+
</slot>
|
|
103
|
+
</p>
|
|
104
|
+
</div>
|
|
105
|
+
</Primitive>
|
|
104
106
|
</template>
|
|
@@ -8,7 +8,7 @@ import { CheckboxGroupRoot, useForwardProps, useForwardPropsEmits } from "reka-u
|
|
|
8
8
|
import { computed, useId } from "vue";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useFormField } from "../composables/useFormField";
|
|
11
|
-
import { get, omit } from "../utils";
|
|
11
|
+
import { get, omit, pick } from "../utils";
|
|
12
12
|
import { cv, merge } from "../utils/style";
|
|
13
13
|
import Checkbox from "./Checkbox.vue";
|
|
14
14
|
const props = defineProps({
|
|
@@ -91,41 +91,42 @@ const appConfig = useAppConfig();
|
|
|
91
91
|
const ui = computed(() => {
|
|
92
92
|
const styler = cv(merge(theme, appConfig.ui.checkboxGroup));
|
|
93
93
|
return styler({
|
|
94
|
-
...props,
|
|
94
|
+
...pick(props, ["required", "orientation", "variant"]),
|
|
95
95
|
size: size.value,
|
|
96
|
-
color: color.value
|
|
96
|
+
color: color.value,
|
|
97
|
+
disabled: disabled.value
|
|
97
98
|
});
|
|
98
99
|
});
|
|
99
100
|
</script>
|
|
100
101
|
|
|
101
102
|
<template>
|
|
102
|
-
<CheckboxGroupRoot
|
|
103
|
-
v-bind="{ ...rootProps, id, name, disabled }"
|
|
104
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
105
|
-
data-part="root"
|
|
106
|
-
@update:model-value="onUpdate"
|
|
107
|
-
>
|
|
108
|
-
<fieldset v-bind="ariaAttrs" :class="ui.fieldset({ class: props.ui?.fieldset })" data-part="fieldset">
|
|
109
|
-
<legend v-if="props.legend || !!slots.legend" :class="ui.legend({ class: props.ui?.legend })" data-part="legend">
|
|
110
|
-
<slot name="legend">
|
|
111
|
-
{{ props.legend }}
|
|
112
|
-
</slot>
|
|
113
|
-
</legend>
|
|
114
|
-
|
|
115
|
-
<Checkbox
|
|
116
|
-
v-for="item in normalizedItems"
|
|
117
|
-
:key="item.id"
|
|
118
|
-
v-bind="{ ...item, ...checkboxProps, color, size, name }"
|
|
119
|
-
:variant="props.variant"
|
|
120
|
-
:disabled="item.disabled || disabled"
|
|
121
|
-
:ui="{ ...props.ui ? omit(props.ui, ['root']) : void 0, ...item.ui || {} }"
|
|
122
|
-
:class="ui.item({ disabled: item.disabled || disabled, class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
123
|
-
data-part="item"
|
|
124
|
-
>
|
|
125
|
-
<template v-for="(_, name) in getProxySlots()" #[name]>
|
|
126
|
-
<slot :name="name" :item="item"></slot>
|
|
127
|
-
</template>
|
|
128
|
-
</Checkbox>
|
|
129
|
-
</fieldset>
|
|
130
|
-
</CheckboxGroupRoot>
|
|
103
|
+
<CheckboxGroupRoot
|
|
104
|
+
v-bind="{ ...rootProps, id, name, disabled }"
|
|
105
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
106
|
+
data-part="root"
|
|
107
|
+
@update:model-value="onUpdate"
|
|
108
|
+
>
|
|
109
|
+
<fieldset v-bind="ariaAttrs" :class="ui.fieldset({ class: props.ui?.fieldset })" data-part="fieldset">
|
|
110
|
+
<legend v-if="props.legend || !!slots.legend" :class="ui.legend({ class: props.ui?.legend })" data-part="legend">
|
|
111
|
+
<slot name="legend">
|
|
112
|
+
{{ props.legend }}
|
|
113
|
+
</slot>
|
|
114
|
+
</legend>
|
|
115
|
+
|
|
116
|
+
<Checkbox
|
|
117
|
+
v-for="item in normalizedItems"
|
|
118
|
+
:key="item.id"
|
|
119
|
+
v-bind="{ ...item, ...checkboxProps, color, size, name }"
|
|
120
|
+
:variant="props.variant"
|
|
121
|
+
:disabled="item.disabled || disabled"
|
|
122
|
+
:ui="{ ...props.ui ? omit(props.ui, ['root']) : void 0, ...item.ui || {} }"
|
|
123
|
+
:class="ui.item({ disabled: item.disabled || disabled, class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
124
|
+
data-part="item"
|
|
125
|
+
>
|
|
126
|
+
<template v-for="(_, name) in getProxySlots()" #[name]>
|
|
127
|
+
<slot :name="name" :item="item"></slot>
|
|
128
|
+
</template>
|
|
129
|
+
</Checkbox>
|
|
130
|
+
</fieldset>
|
|
131
|
+
</CheckboxGroupRoot>
|
|
131
132
|
</template>
|
|
@@ -8,6 +8,7 @@ import { Primitive, Slot } from "reka-ui";
|
|
|
8
8
|
import { computed } from "vue";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useAvatarGroup } from "../composables/useAvatarGroup";
|
|
11
|
+
import { pick } from "../utils";
|
|
11
12
|
import { cv, merge } from "../utils/style";
|
|
12
13
|
defineOptions({ inheritAttrs: false });
|
|
13
14
|
const props = defineProps({
|
|
@@ -29,24 +30,27 @@ const { size } = useAvatarGroup(props);
|
|
|
29
30
|
const appConfig = useAppConfig();
|
|
30
31
|
const ui = computed(() => {
|
|
31
32
|
const styler = cv(merge(theme, appConfig.ui.chip));
|
|
32
|
-
return styler({
|
|
33
|
+
return styler({
|
|
34
|
+
...pick(props, ["color", "position", "inset", "standalone"]),
|
|
35
|
+
size: size.value
|
|
36
|
+
});
|
|
33
37
|
});
|
|
34
38
|
</script>
|
|
35
39
|
|
|
36
40
|
<template>
|
|
37
|
-
<Primitive
|
|
38
|
-
:as="props.as"
|
|
39
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
40
|
-
data-part="root"
|
|
41
|
-
>
|
|
42
|
-
<Slot v-bind="$attrs">
|
|
43
|
-
<slot></slot>
|
|
44
|
-
</Slot>
|
|
45
|
-
|
|
46
|
-
<span v-if="show" :class="ui.base({ class: props.ui?.base })" data-part="base">
|
|
47
|
-
<slot name="content">
|
|
48
|
-
{{ props.text }}
|
|
49
|
-
</slot>
|
|
50
|
-
</span>
|
|
51
|
-
</Primitive>
|
|
41
|
+
<Primitive
|
|
42
|
+
:as="props.as"
|
|
43
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
44
|
+
data-part="root"
|
|
45
|
+
>
|
|
46
|
+
<Slot v-bind="$attrs">
|
|
47
|
+
<slot></slot>
|
|
48
|
+
</Slot>
|
|
49
|
+
|
|
50
|
+
<span v-if="show" :class="ui.base({ class: props.ui?.base })" data-part="base">
|
|
51
|
+
<slot name="content">
|
|
52
|
+
{{ props.text }}
|
|
53
|
+
</slot>
|
|
54
|
+
</span>
|
|
55
|
+
</Primitive>
|
|
52
56
|
</template>
|
|
@@ -7,6 +7,7 @@ import { reactivePick } from "@vueuse/core";
|
|
|
7
7
|
import { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, useForwardPropsEmits } from "reka-ui";
|
|
8
8
|
import { computed } from "vue";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
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 },
|
|
@@ -23,25 +24,25 @@ const rootProps = useForwardPropsEmits(reactivePick(props, "as", "defaultOpen",
|
|
|
23
24
|
const appConfig = useAppConfig();
|
|
24
25
|
const ui = computed(() => {
|
|
25
26
|
const styler = cv(merge(theme, appConfig.ui.collapsible));
|
|
26
|
-
return styler(props);
|
|
27
|
+
return styler(pick(props, []));
|
|
27
28
|
});
|
|
28
29
|
</script>
|
|
29
30
|
|
|
30
31
|
<template>
|
|
31
|
-
<CollapsibleRoot
|
|
32
|
-
v-slot="{ open }"
|
|
33
|
-
v-bind="rootProps"
|
|
34
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
35
|
-
data-part="root"
|
|
36
|
-
>
|
|
37
|
-
<CollapsibleTrigger v-if="!!slots.default" as-child>
|
|
38
|
-
<slot :open="open"></slot>
|
|
39
|
-
</CollapsibleTrigger>
|
|
40
|
-
|
|
41
|
-
<CollapsibleContent :class="ui.content({ class: props.ui?.content })" data-part="content">
|
|
42
|
-
<slot name="content"></slot>
|
|
43
|
-
</CollapsibleContent>
|
|
44
|
-
</CollapsibleRoot>
|
|
32
|
+
<CollapsibleRoot
|
|
33
|
+
v-slot="{ open }"
|
|
34
|
+
v-bind="rootProps"
|
|
35
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
36
|
+
data-part="root"
|
|
37
|
+
>
|
|
38
|
+
<CollapsibleTrigger v-if="!!slots.default" as-child>
|
|
39
|
+
<slot :open="open"></slot>
|
|
40
|
+
</CollapsibleTrigger>
|
|
41
|
+
|
|
42
|
+
<CollapsibleContent :class="ui.content({ class: props.ui?.content })" data-part="content">
|
|
43
|
+
<slot name="content"></slot>
|
|
44
|
+
</CollapsibleContent>
|
|
45
|
+
</CollapsibleRoot>
|
|
45
46
|
</template>
|
|
46
47
|
|
|
47
48
|
<style>
|
|
@@ -9,6 +9,7 @@ import { computed, toRef } from "vue";
|
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useLocale } from "../composables/useLocale";
|
|
11
11
|
import { usePortal } from "../composables/usePortal";
|
|
12
|
+
import { pick } from "../utils";
|
|
12
13
|
import { cv, merge } from "../utils/style";
|
|
13
14
|
import Button from "./Button.vue";
|
|
14
15
|
const props = defineProps({
|
|
@@ -53,85 +54,85 @@ const { t } = useLocale();
|
|
|
53
54
|
const appConfig = useAppConfig();
|
|
54
55
|
const ui = computed(() => {
|
|
55
56
|
const styler = cv(merge(theme, appConfig.ui.drawer));
|
|
56
|
-
return styler(props);
|
|
57
|
+
return styler(pick(props, ["transition", "direction", "inset"]));
|
|
57
58
|
});
|
|
58
59
|
</script>
|
|
59
60
|
|
|
60
61
|
<template>
|
|
61
|
-
<DialogRoot v-slot="{ open, close }" v-bind="rootProps">
|
|
62
|
-
<DialogTrigger v-if="!!slots.default" as-child :class="props.class">
|
|
63
|
-
<slot :open="open"></slot>
|
|
64
|
-
</DialogTrigger>
|
|
65
|
-
|
|
66
|
-
<DialogPortal v-bind="portalProps">
|
|
67
|
-
<DialogOverlay v-if="props.overlay" :class="ui.overlay({ class: props.ui?.overlay })" data-part="overlay" />
|
|
68
|
-
|
|
69
|
-
<DialogContent
|
|
70
|
-
:class="ui.content({ class: [props.ui?.content, !slots.default && props.class] })"
|
|
71
|
-
v-bind="contentProps"
|
|
72
|
-
:data-direction="props.direction"
|
|
73
|
-
data-part="content"
|
|
74
|
-
@after-enter="emit('after-enter')"
|
|
75
|
-
@after-leave="emit('after-leave')"
|
|
76
|
-
v-on="contentEvents"
|
|
77
|
-
>
|
|
78
|
-
<VisuallyHidden v-if="!!slots.content || !!slots.header || !props.title && !slots.title">
|
|
79
|
-
<DialogTitle />
|
|
80
|
-
</VisuallyHidden>
|
|
81
|
-
|
|
82
|
-
<slot name="content" :close="close">
|
|
83
|
-
<div
|
|
84
|
-
v-if="slots.header || (props.title || !!slots.title) || (props.description || !!slots.description) || (props.close || !!slots.close)"
|
|
85
|
-
:class="ui.header({ class: props.ui?.header })"
|
|
86
|
-
data-part="header"
|
|
87
|
-
>
|
|
88
|
-
<slot name="header" :close="close">
|
|
89
|
-
<DialogTitle
|
|
90
|
-
v-if="props.title || slots.title"
|
|
91
|
-
:class="ui.title({ class: props.ui?.title })"
|
|
92
|
-
data-part="title"
|
|
93
|
-
>
|
|
94
|
-
<slot name="title">
|
|
95
|
-
{{ props.title }}
|
|
96
|
-
</slot>
|
|
97
|
-
</DialogTitle>
|
|
98
|
-
|
|
99
|
-
<DialogClose v-if="props.close || !!slots.close" as-child>
|
|
100
|
-
<slot name="close" :close="close" :ui="ui">
|
|
101
|
-
<Button
|
|
102
|
-
v-if="props.close"
|
|
103
|
-
color="neutral"
|
|
104
|
-
variant="ghost"
|
|
105
|
-
:icon="props.closeIcon || appConfig.ui.icons.close"
|
|
106
|
-
:aria-label="t('modal.close')"
|
|
107
|
-
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
108
|
-
:class="ui.close({ class: props.ui?.close })"
|
|
109
|
-
data-part="close"
|
|
110
|
-
/>
|
|
111
|
-
</slot>
|
|
112
|
-
</DialogClose>
|
|
113
|
-
|
|
114
|
-
<DialogDescription
|
|
115
|
-
v-if="props.description || !!slots.description"
|
|
116
|
-
:class="ui.description({ class: props.ui?.description })"
|
|
117
|
-
data-part="description"
|
|
118
|
-
>
|
|
119
|
-
<slot name="description">
|
|
120
|
-
{{ props.description }}
|
|
121
|
-
</slot>
|
|
122
|
-
</DialogDescription>
|
|
123
|
-
</slot>
|
|
124
|
-
</div>
|
|
125
|
-
|
|
126
|
-
<div v-if="slots.body" :class="ui.body({ class: props.ui?.body })" data-part="body">
|
|
127
|
-
<slot name="body" :close="close"></slot>
|
|
128
|
-
</div>
|
|
129
|
-
|
|
130
|
-
<div v-if="slots.footer" :class="ui.footer({ class: props.ui?.footer })" data-part="footer">
|
|
131
|
-
<slot name="footer" :close="close"></slot>
|
|
132
|
-
</div>
|
|
133
|
-
</slot>
|
|
134
|
-
</DialogContent>
|
|
135
|
-
</DialogPortal>
|
|
136
|
-
</DialogRoot>
|
|
62
|
+
<DialogRoot v-slot="{ open, close }" v-bind="rootProps">
|
|
63
|
+
<DialogTrigger v-if="!!slots.default" as-child :class="props.class">
|
|
64
|
+
<slot :open="open"></slot>
|
|
65
|
+
</DialogTrigger>
|
|
66
|
+
|
|
67
|
+
<DialogPortal v-bind="portalProps">
|
|
68
|
+
<DialogOverlay v-if="props.overlay" :class="ui.overlay({ class: props.ui?.overlay })" data-part="overlay" />
|
|
69
|
+
|
|
70
|
+
<DialogContent
|
|
71
|
+
:class="ui.content({ class: [props.ui?.content, !slots.default && props.class] })"
|
|
72
|
+
v-bind="contentProps"
|
|
73
|
+
:data-direction="props.direction"
|
|
74
|
+
data-part="content"
|
|
75
|
+
@after-enter="emit('after-enter')"
|
|
76
|
+
@after-leave="emit('after-leave')"
|
|
77
|
+
v-on="contentEvents"
|
|
78
|
+
>
|
|
79
|
+
<VisuallyHidden v-if="!!slots.content || !!slots.header || !props.title && !slots.title">
|
|
80
|
+
<DialogTitle />
|
|
81
|
+
</VisuallyHidden>
|
|
82
|
+
|
|
83
|
+
<slot name="content" :close="close">
|
|
84
|
+
<div
|
|
85
|
+
v-if="slots.header || (props.title || !!slots.title) || (props.description || !!slots.description) || (props.close || !!slots.close)"
|
|
86
|
+
:class="ui.header({ class: props.ui?.header })"
|
|
87
|
+
data-part="header"
|
|
88
|
+
>
|
|
89
|
+
<slot name="header" :close="close">
|
|
90
|
+
<DialogTitle
|
|
91
|
+
v-if="props.title || slots.title"
|
|
92
|
+
:class="ui.title({ class: props.ui?.title })"
|
|
93
|
+
data-part="title"
|
|
94
|
+
>
|
|
95
|
+
<slot name="title">
|
|
96
|
+
{{ props.title }}
|
|
97
|
+
</slot>
|
|
98
|
+
</DialogTitle>
|
|
99
|
+
|
|
100
|
+
<DialogClose v-if="props.close || !!slots.close" as-child>
|
|
101
|
+
<slot name="close" :close="close" :ui="ui">
|
|
102
|
+
<Button
|
|
103
|
+
v-if="props.close"
|
|
104
|
+
color="neutral"
|
|
105
|
+
variant="ghost"
|
|
106
|
+
:icon="props.closeIcon || appConfig.ui.icons.close"
|
|
107
|
+
:aria-label="t('modal.close')"
|
|
108
|
+
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
109
|
+
:class="ui.close({ class: props.ui?.close })"
|
|
110
|
+
data-part="close"
|
|
111
|
+
/>
|
|
112
|
+
</slot>
|
|
113
|
+
</DialogClose>
|
|
114
|
+
|
|
115
|
+
<DialogDescription
|
|
116
|
+
v-if="props.description || !!slots.description"
|
|
117
|
+
:class="ui.description({ class: props.ui?.description })"
|
|
118
|
+
data-part="description"
|
|
119
|
+
>
|
|
120
|
+
<slot name="description">
|
|
121
|
+
{{ props.description }}
|
|
122
|
+
</slot>
|
|
123
|
+
</DialogDescription>
|
|
124
|
+
</slot>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div v-if="slots.body" :class="ui.body({ class: props.ui?.body })" data-part="body">
|
|
128
|
+
<slot name="body" :close="close"></slot>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div v-if="slots.footer" :class="ui.footer({ class: props.ui?.footer })" data-part="footer">
|
|
132
|
+
<slot name="footer" :close="close"></slot>
|
|
133
|
+
</div>
|
|
134
|
+
</slot>
|
|
135
|
+
</DialogContent>
|
|
136
|
+
</DialogPortal>
|
|
137
|
+
</DialogRoot>
|
|
137
138
|
</template>
|