@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
|
@@ -8,6 +8,7 @@ import { PaginationEllipsis, PaginationFirst, PaginationLast, PaginationList, Pa
|
|
|
8
8
|
import { computed } from "vue";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useLocale } from "../composables/useLocale";
|
|
11
|
+
import { pick } from "../utils";
|
|
11
12
|
import { cv, merge } from "../utils/style";
|
|
12
13
|
import Button from "./Button.vue";
|
|
13
14
|
const props = defineProps({
|
|
@@ -41,7 +42,7 @@ const { dir } = useLocale();
|
|
|
41
42
|
const appConfig = useAppConfig();
|
|
42
43
|
const ui = computed(() => {
|
|
43
44
|
const styler = cv(merge(theme, appConfig.ui.pagination));
|
|
44
|
-
return styler(props);
|
|
45
|
+
return styler(pick(props, []));
|
|
45
46
|
});
|
|
46
47
|
const firstIcon = computed(() => props.firstIcon || (dir.value === "rtl" ? appConfig.ui.icons.chevronDoubleRight : appConfig.ui.icons.chevronDoubleLeft));
|
|
47
48
|
const prevIcon = computed(() => props.prevIcon || (dir.value === "rtl" ? appConfig.ui.icons.chevronRight : appConfig.ui.icons.chevronLeft));
|
|
@@ -50,51 +51,51 @@ const lastIcon = computed(() => props.lastIcon || (dir.value === "rtl" ? appConf
|
|
|
50
51
|
</script>
|
|
51
52
|
|
|
52
53
|
<template>
|
|
53
|
-
<PaginationRoot v-slot="{ page, pageCount }" v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
54
|
-
<PaginationList v-slot="{ items }" :class="ui.list({ class: props.ui?.list })" data-part="list">
|
|
55
|
-
<PaginationFirst v-if="props.showControls || !!slots.first" :class="ui.first({ class: props.ui?.first })" as-child data-part="first">
|
|
56
|
-
<slot name="first">
|
|
57
|
-
<Button :color="props.color" :variant="props.variant" :size="props.size" :icon="firstIcon" :to="props.to?.(1)" />
|
|
58
|
-
</slot>
|
|
59
|
-
</PaginationFirst>
|
|
60
|
-
<PaginationPrev v-if="props.showControls || !!slots.prev" :class="ui.prev({ class: props.ui?.prev })" as-child data-part="perv">
|
|
61
|
-
<slot name="prev">
|
|
62
|
-
<Button :color="props.color" :variant="props.variant" :size="props.size" :icon="prevIcon" :to="page > 1 ? props.to?.(page - 1) : void 0" />
|
|
63
|
-
</slot>
|
|
64
|
-
</PaginationPrev>
|
|
65
|
-
|
|
66
|
-
<template v-for="(item, index) in items" :key="index">
|
|
67
|
-
<PaginationListItem v-if="item.type === 'page'" :value="item.value" :class="ui.item({ class: props.ui?.item })" as-child data-part="item">
|
|
68
|
-
<slot name="item" v-bind="{ item, index, page, pageCount }">
|
|
69
|
-
<Button
|
|
70
|
-
:color="props.page === item.value ? props.activeColor : props.color"
|
|
71
|
-
:variant="props.page === item.value ? props.activeVariant : props.variant"
|
|
72
|
-
:size="props.size"
|
|
73
|
-
:label="String(item.value)"
|
|
74
|
-
:to="props.to?.(item.value)"
|
|
75
|
-
:ui="{ label: ui.label({ class: props.ui?.label }) }"
|
|
76
|
-
square
|
|
77
|
-
/>
|
|
78
|
-
</slot>
|
|
79
|
-
</PaginationListItem>
|
|
80
|
-
|
|
81
|
-
<PaginationEllipsis v-else :class="ui.ellipsis({ class: props.ui?.ellipsis })" as-child data-part="ellipsis">
|
|
82
|
-
<slot name="ellipsis" :ui="ui">
|
|
83
|
-
<Button as="div" :color="props.color" :variant="props.variant" :size="props.size" :icon="ellipsisIcon || appConfig.ui.icons.ellipsis" />
|
|
84
|
-
</slot>
|
|
85
|
-
</PaginationEllipsis>
|
|
86
|
-
</template>
|
|
87
|
-
|
|
88
|
-
<PaginationNext v-if="props.showControls || !!slots.next" :class="ui.next({ class: props.ui?.next })" as-child data-part="next">
|
|
89
|
-
<slot name="next">
|
|
90
|
-
<Button :color="props.color" :variant="props.variant" :size="props.size" :icon="nextIcon" :to="page < pageCount ? props.to?.(page + 1) : void 0" />
|
|
91
|
-
</slot>
|
|
92
|
-
</PaginationNext>
|
|
93
|
-
<PaginationLast v-if="props.showControls || !!slots.last" :class="ui.last({ class: props.ui?.last })" as-child data-part="last">
|
|
94
|
-
<slot name="last">
|
|
95
|
-
<Button :color="props.color" :variant="props.variant" :size="props.size" :icon="lastIcon" :to="props.to?.(pageCount)" />
|
|
96
|
-
</slot>
|
|
97
|
-
</PaginationLast>
|
|
98
|
-
</PaginationList>
|
|
99
|
-
</PaginationRoot>
|
|
54
|
+
<PaginationRoot v-slot="{ page, pageCount }" v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
|
|
55
|
+
<PaginationList v-slot="{ items }" :class="ui.list({ class: props.ui?.list })" data-part="list">
|
|
56
|
+
<PaginationFirst v-if="props.showControls || !!slots.first" :class="ui.first({ class: props.ui?.first })" as-child data-part="first">
|
|
57
|
+
<slot name="first">
|
|
58
|
+
<Button :color="props.color" :variant="props.variant" :size="props.size" :icon="firstIcon" :to="props.to?.(1)" />
|
|
59
|
+
</slot>
|
|
60
|
+
</PaginationFirst>
|
|
61
|
+
<PaginationPrev v-if="props.showControls || !!slots.prev" :class="ui.prev({ class: props.ui?.prev })" as-child data-part="perv">
|
|
62
|
+
<slot name="prev">
|
|
63
|
+
<Button :color="props.color" :variant="props.variant" :size="props.size" :icon="prevIcon" :to="page > 1 ? props.to?.(page - 1) : void 0" />
|
|
64
|
+
</slot>
|
|
65
|
+
</PaginationPrev>
|
|
66
|
+
|
|
67
|
+
<template v-for="(item, index) in items" :key="index">
|
|
68
|
+
<PaginationListItem v-if="item.type === 'page'" :value="item.value" :class="ui.item({ class: props.ui?.item })" as-child data-part="item">
|
|
69
|
+
<slot name="item" v-bind="{ item, index, page, pageCount }">
|
|
70
|
+
<Button
|
|
71
|
+
:color="props.page === item.value ? props.activeColor : props.color"
|
|
72
|
+
:variant="props.page === item.value ? props.activeVariant : props.variant"
|
|
73
|
+
:size="props.size"
|
|
74
|
+
:label="String(item.value)"
|
|
75
|
+
:to="props.to?.(item.value)"
|
|
76
|
+
:ui="{ label: ui.label({ class: props.ui?.label }) }"
|
|
77
|
+
square
|
|
78
|
+
/>
|
|
79
|
+
</slot>
|
|
80
|
+
</PaginationListItem>
|
|
81
|
+
|
|
82
|
+
<PaginationEllipsis v-else :class="ui.ellipsis({ class: props.ui?.ellipsis })" as-child data-part="ellipsis">
|
|
83
|
+
<slot name="ellipsis" :ui="ui">
|
|
84
|
+
<Button as="div" :color="props.color" :variant="props.variant" :size="props.size" :icon="ellipsisIcon || appConfig.ui.icons.ellipsis" />
|
|
85
|
+
</slot>
|
|
86
|
+
</PaginationEllipsis>
|
|
87
|
+
</template>
|
|
88
|
+
|
|
89
|
+
<PaginationNext v-if="props.showControls || !!slots.next" :class="ui.next({ class: props.ui?.next })" as-child data-part="next">
|
|
90
|
+
<slot name="next">
|
|
91
|
+
<Button :color="props.color" :variant="props.variant" :size="props.size" :icon="nextIcon" :to="page < pageCount ? props.to?.(page + 1) : void 0" />
|
|
92
|
+
</slot>
|
|
93
|
+
</PaginationNext>
|
|
94
|
+
<PaginationLast v-if="props.showControls || !!slots.last" :class="ui.last({ class: props.ui?.last })" as-child data-part="last">
|
|
95
|
+
<slot name="last">
|
|
96
|
+
<Button :color="props.color" :variant="props.variant" :size="props.size" :icon="lastIcon" :to="props.to?.(pageCount)" />
|
|
97
|
+
</slot>
|
|
98
|
+
</PaginationLast>
|
|
99
|
+
</PaginationList>
|
|
100
|
+
</PaginationRoot>
|
|
100
101
|
</template>
|
|
@@ -8,7 +8,7 @@ import { PinInputInput, PinInputRoot, useForwardPropsEmits } from "reka-ui";
|
|
|
8
8
|
import { computed, onMounted, ref } from "vue";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useFormField } from "../composables/useFormField";
|
|
11
|
-
import { looseToNumber } from "../utils";
|
|
11
|
+
import { looseToNumber, pick } from "../utils";
|
|
12
12
|
import { cv, merge } from "../utils/style";
|
|
13
13
|
const props = defineProps({
|
|
14
14
|
as: { type: null, required: false },
|
|
@@ -39,9 +39,9 @@ const appConfig = useAppConfig();
|
|
|
39
39
|
const ui = computed(() => {
|
|
40
40
|
const styler = cv(merge(theme, appConfig.ui.pinInput));
|
|
41
41
|
return styler({
|
|
42
|
-
...props,
|
|
43
|
-
size: size.value,
|
|
42
|
+
...pick(props, ["variant"]),
|
|
44
43
|
color: color.value,
|
|
44
|
+
size: size.value,
|
|
45
45
|
highlight: highlight.value
|
|
46
46
|
});
|
|
47
47
|
});
|
|
@@ -71,26 +71,26 @@ defineExpose({
|
|
|
71
71
|
</script>
|
|
72
72
|
|
|
73
73
|
<template>
|
|
74
|
-
<PinInputRoot
|
|
75
|
-
v-bind="{ ...rootProps, ...ariaAttrs, id, name }"
|
|
76
|
-
:placeholder="props.placeholder"
|
|
77
|
-
:model-value="modelValue"
|
|
78
|
-
:default-value="props.defaultValue"
|
|
79
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
80
|
-
data-part="root"
|
|
81
|
-
@update:model-value="emitFormInput"
|
|
82
|
-
@complete="onComplete"
|
|
83
|
-
>
|
|
84
|
-
<PinInputInput
|
|
85
|
-
v-for="(ids, index) in looseToNumber(props.length)"
|
|
86
|
-
:key="ids"
|
|
87
|
-
:ref="(el) => inputsRef[index] = el"
|
|
88
|
-
:index="index"
|
|
89
|
-
:disabled="disabled"
|
|
90
|
-
:class="ui.base({ class: props.ui?.base })"
|
|
91
|
-
data-part="base"
|
|
92
|
-
@blur="onBlur"
|
|
93
|
-
@focus="emitFormFocus"
|
|
94
|
-
/>
|
|
95
|
-
</PinInputRoot>
|
|
74
|
+
<PinInputRoot
|
|
75
|
+
v-bind="{ ...rootProps, ...ariaAttrs, id, name }"
|
|
76
|
+
:placeholder="props.placeholder"
|
|
77
|
+
:model-value="modelValue"
|
|
78
|
+
:default-value="props.defaultValue"
|
|
79
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
80
|
+
data-part="root"
|
|
81
|
+
@update:model-value="emitFormInput"
|
|
82
|
+
@complete="onComplete"
|
|
83
|
+
>
|
|
84
|
+
<PinInputInput
|
|
85
|
+
v-for="(ids, index) in looseToNumber(props.length)"
|
|
86
|
+
:key="ids"
|
|
87
|
+
:ref="(el) => inputsRef[index] = el"
|
|
88
|
+
:index="index"
|
|
89
|
+
:disabled="disabled"
|
|
90
|
+
:class="ui.base({ class: props.ui?.base })"
|
|
91
|
+
data-part="base"
|
|
92
|
+
@blur="onBlur"
|
|
93
|
+
@focus="emitFormFocus"
|
|
94
|
+
/>
|
|
95
|
+
</PinInputRoot>
|
|
96
96
|
</template>
|
|
@@ -49,31 +49,31 @@ const Component = computed(() => props.mode === "hover" ? HoverCard : Popover);
|
|
|
49
49
|
const appConfig = useAppConfig();
|
|
50
50
|
const ui = computed(() => {
|
|
51
51
|
const styler = cv(merge(theme, appConfig.ui.popover));
|
|
52
|
-
return styler(
|
|
52
|
+
return styler();
|
|
53
53
|
});
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
56
|
<template>
|
|
57
|
-
<Component.Root v-slot="{ open, close }" v-bind="rootProps">
|
|
58
|
-
<Component.Trigger v-if="!!slots.default || !!props.reference" :reference="props.reference" as-child :class="props.class">
|
|
59
|
-
<slot :open="open"></slot>
|
|
60
|
-
</Component.Trigger>
|
|
61
|
-
|
|
62
|
-
<Component.Anchor v-if="'Anchor' in Component && !!slots.anchor" as-child>
|
|
63
|
-
<slot name="anchor" v-bind="close ? { close } : {}"></slot>
|
|
64
|
-
</Component.Anchor>
|
|
65
|
-
|
|
66
|
-
<Component.Portal v-bind="portalProps">
|
|
67
|
-
<Component.Content
|
|
68
|
-
v-bind="contentProps"
|
|
69
|
-
:class="ui.content({ class: [props.ui?.content, !slots.default && props.class] })"
|
|
70
|
-
data-part="content"
|
|
71
|
-
v-on="contentEvents"
|
|
72
|
-
>
|
|
73
|
-
<slot name="content" v-bind="close ? { close } : {}"></slot>
|
|
74
|
-
|
|
75
|
-
<Component.Arrow v-if="!!props.arrow" v-bind="arrowProps" :class="ui.arrow({ class: props.ui?.arrow })" data-part="arrow" />
|
|
76
|
-
</Component.Content>
|
|
77
|
-
</Component.Portal>
|
|
78
|
-
</Component.Root>
|
|
57
|
+
<Component.Root v-slot="{ open, close }" v-bind="rootProps">
|
|
58
|
+
<Component.Trigger v-if="!!slots.default || !!props.reference" :reference="props.reference" as-child :class="props.class">
|
|
59
|
+
<slot :open="open"></slot>
|
|
60
|
+
</Component.Trigger>
|
|
61
|
+
|
|
62
|
+
<Component.Anchor v-if="'Anchor' in Component && !!slots.anchor" as-child>
|
|
63
|
+
<slot name="anchor" v-bind="close ? { close } : {}"></slot>
|
|
64
|
+
</Component.Anchor>
|
|
65
|
+
|
|
66
|
+
<Component.Portal v-bind="portalProps">
|
|
67
|
+
<Component.Content
|
|
68
|
+
v-bind="contentProps"
|
|
69
|
+
:class="ui.content({ class: [props.ui?.content, !slots.default && props.class] })"
|
|
70
|
+
data-part="content"
|
|
71
|
+
v-on="contentEvents"
|
|
72
|
+
>
|
|
73
|
+
<slot name="content" v-bind="close ? { close } : {}"></slot>
|
|
74
|
+
|
|
75
|
+
<Component.Arrow v-if="!!props.arrow" v-bind="arrowProps" :class="ui.arrow({ class: props.ui?.arrow })" data-part="arrow" />
|
|
76
|
+
</Component.Content>
|
|
77
|
+
</Component.Portal>
|
|
78
|
+
</Component.Root>
|
|
79
79
|
</template>
|
|
@@ -8,6 +8,7 @@ import { Primitive, ProgressIndicator, ProgressRoot, useForwardPropsEmits } from
|
|
|
8
8
|
import { computed } from "vue";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useLocale } from "../composables/useLocale";
|
|
11
|
+
import { pick } from "../utils";
|
|
11
12
|
import { cv, merge } from "../utils/style";
|
|
12
13
|
const props = defineProps({
|
|
13
14
|
as: { type: null, required: false },
|
|
@@ -82,34 +83,34 @@ function stepVariant(index) {
|
|
|
82
83
|
const appConfig = useAppConfig();
|
|
83
84
|
const ui = computed(() => {
|
|
84
85
|
const styler = cv(merge(theme, appConfig.ui.progress));
|
|
85
|
-
return styler(props);
|
|
86
|
+
return styler(pick(props, ["animation", "size", "color", "orientation", "inverted"]));
|
|
86
87
|
});
|
|
87
88
|
</script>
|
|
88
89
|
|
|
89
90
|
<template>
|
|
90
|
-
<Primitive :as="props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" :data-orientation="orientation" data-part="root">
|
|
91
|
-
<div v-if="!isIndeterminate && (props.status || !!slots.status)" :class="ui.status({ class: props.ui?.status })" data-part="status" :style="statusStyle">
|
|
92
|
-
<slot name="status" :percent="percent">
|
|
93
|
-
{{ percent }}%
|
|
94
|
-
</slot>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
<ProgressRoot
|
|
98
|
-
v-bind="rootProps"
|
|
99
|
-
:max="realMax"
|
|
100
|
-
:class="ui.base({ class: props.ui?.base })"
|
|
101
|
-
data-part="base"
|
|
102
|
-
style="transform: translateZ(0)"
|
|
103
|
-
>
|
|
104
|
-
<ProgressIndicator :class="ui.indicator({ class: props.ui?.indicator })" data-part="indicator" :style="indicatorStyle" />
|
|
105
|
-
</ProgressRoot>
|
|
106
|
-
|
|
107
|
-
<div v-if="hasSteps" :class="ui.steps({ class: props.ui?.steps })" data-part="steps">
|
|
108
|
-
<div v-for="(step, index) in props.max" :key="index" :class="ui.step({ class: props.ui?.step, step: stepVariant(index) })" data-part="step">
|
|
109
|
-
<slot :name="`step-${index}`" :step="step">
|
|
110
|
-
{{ step }}
|
|
111
|
-
</slot>
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
</Primitive>
|
|
91
|
+
<Primitive :as="props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" :data-orientation="orientation" data-part="root">
|
|
92
|
+
<div v-if="!isIndeterminate && (props.status || !!slots.status)" :class="ui.status({ class: props.ui?.status })" data-part="status" :style="statusStyle">
|
|
93
|
+
<slot name="status" :percent="percent">
|
|
94
|
+
{{ percent }}%
|
|
95
|
+
</slot>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<ProgressRoot
|
|
99
|
+
v-bind="rootProps"
|
|
100
|
+
:max="realMax"
|
|
101
|
+
:class="ui.base({ class: props.ui?.base })"
|
|
102
|
+
data-part="base"
|
|
103
|
+
style="transform: translateZ(0)"
|
|
104
|
+
>
|
|
105
|
+
<ProgressIndicator :class="ui.indicator({ class: props.ui?.indicator })" data-part="indicator" :style="indicatorStyle" />
|
|
106
|
+
</ProgressRoot>
|
|
107
|
+
|
|
108
|
+
<div v-if="hasSteps" :class="ui.steps({ class: props.ui?.steps })" data-part="steps">
|
|
109
|
+
<div v-for="(step, index) in props.max" :key="index" :class="ui.step({ class: props.ui?.step, step: stepVariant(index) })" data-part="step">
|
|
110
|
+
<slot :name="`step-${index}`" :step="step">
|
|
111
|
+
{{ step }}
|
|
112
|
+
</slot>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</Primitive>
|
|
115
116
|
</template>
|
|
@@ -8,7 +8,7 @@ import { Label, RadioGroupIndicator, RadioGroupItem as RekaRadioGroupItem, Radio
|
|
|
8
8
|
import { computed, useId } from "vue";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useFormField } from "../composables/useFormField";
|
|
11
|
-
import { get } from "../utils";
|
|
11
|
+
import { get, pick } from "../utils";
|
|
12
12
|
import { cv, merge } from "../utils/style";
|
|
13
13
|
const props = defineProps({
|
|
14
14
|
as: { type: null, required: false },
|
|
@@ -40,9 +40,9 @@ const appConfig = useAppConfig();
|
|
|
40
40
|
const ui = computed(() => {
|
|
41
41
|
const styler = cv(merge(theme, appConfig.ui.radioGroup));
|
|
42
42
|
return styler({
|
|
43
|
-
...props,
|
|
44
|
-
color: color.value,
|
|
43
|
+
...pick(props, ["required", "orientation", "variant", "indicator"]),
|
|
45
44
|
size: size.value,
|
|
45
|
+
color: color.value,
|
|
46
46
|
disabled: disabled.value
|
|
47
47
|
});
|
|
48
48
|
});
|
|
@@ -96,54 +96,54 @@ function onUpdate(value) {
|
|
|
96
96
|
</script>
|
|
97
97
|
|
|
98
98
|
<template>
|
|
99
|
-
<RadioGroupRoot
|
|
100
|
-
v-bind="{ id, ...rootProps, name, disabled }"
|
|
101
|
-
:model-value="props.modelValue"
|
|
102
|
-
:default-value="props.defaultValue"
|
|
103
|
-
:orientation="props.orientation"
|
|
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
|
-
<component
|
|
115
|
-
:is="!props.variant || props.variant === 'list' ? 'div' : Label"
|
|
116
|
-
v-for="item in normalizedItems"
|
|
117
|
-
:key="item.value"
|
|
118
|
-
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class], disabled: item.disabled })"
|
|
119
|
-
data-part="item"
|
|
120
|
-
>
|
|
121
|
-
<div :class="ui.container({ class: [props.ui?.container, item.ui?.container], disabled: item.disabled })" data-part="container">
|
|
122
|
-
<RekaRadioGroupItem
|
|
123
|
-
:id="item.id"
|
|
124
|
-
:value="item.value"
|
|
125
|
-
:disabled="item.disabled"
|
|
126
|
-
:class="ui.base({ class: [props.ui?.base, item.ui?.base], disabled: item.disabled, indicator: props.indicator })"
|
|
127
|
-
data-part="base"
|
|
128
|
-
:data-indicator="props.indicator"
|
|
129
|
-
>
|
|
130
|
-
<RadioGroupIndicator :class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator], disabled: item.disabled })" data-part="indicator" force-mount />
|
|
131
|
-
</RekaRadioGroupItem>
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
<div v-if="item.label || !!slots.label || (item.description || !!slots.description)" :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper], disabled: item.disabled })" data-part="wrapper">
|
|
135
|
-
<component :is="!props.variant || props.variant === 'list' ? Label : 'p'" :for="item.id" :class="ui.label({ class: [props.ui?.label, item.ui?.label], disabled: item.disabled })" data-part="label">
|
|
136
|
-
<slot name="label" :item="item" :model-value="modelValue">
|
|
137
|
-
{{ item.label }}
|
|
138
|
-
</slot>
|
|
139
|
-
</component>
|
|
140
|
-
<p v-if="item.description || !!slots.description" :class="ui.description({ class: [props.ui?.description, item.ui?.description], disabled: item.disabled })" data-part="description">
|
|
141
|
-
<slot name="description" :item="item" :model-value="modelValue">
|
|
142
|
-
{{ item.description }}
|
|
143
|
-
</slot>
|
|
144
|
-
</p>
|
|
145
|
-
</div>
|
|
146
|
-
</component>
|
|
147
|
-
</fieldset>
|
|
148
|
-
</RadioGroupRoot>
|
|
99
|
+
<RadioGroupRoot
|
|
100
|
+
v-bind="{ id, ...rootProps, name, disabled }"
|
|
101
|
+
:model-value="props.modelValue"
|
|
102
|
+
:default-value="props.defaultValue"
|
|
103
|
+
:orientation="props.orientation"
|
|
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
|
+
<component
|
|
115
|
+
:is="!props.variant || props.variant === 'list' ? 'div' : Label"
|
|
116
|
+
v-for="item in normalizedItems"
|
|
117
|
+
:key="item.value"
|
|
118
|
+
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class], disabled: item.disabled })"
|
|
119
|
+
data-part="item"
|
|
120
|
+
>
|
|
121
|
+
<div :class="ui.container({ class: [props.ui?.container, item.ui?.container], disabled: item.disabled })" data-part="container">
|
|
122
|
+
<RekaRadioGroupItem
|
|
123
|
+
:id="item.id"
|
|
124
|
+
:value="item.value"
|
|
125
|
+
:disabled="item.disabled"
|
|
126
|
+
:class="ui.base({ class: [props.ui?.base, item.ui?.base], disabled: item.disabled, indicator: props.indicator })"
|
|
127
|
+
data-part="base"
|
|
128
|
+
:data-indicator="props.indicator"
|
|
129
|
+
>
|
|
130
|
+
<RadioGroupIndicator :class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator], disabled: item.disabled })" data-part="indicator" force-mount />
|
|
131
|
+
</RekaRadioGroupItem>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<div v-if="item.label || !!slots.label || (item.description || !!slots.description)" :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper], disabled: item.disabled })" data-part="wrapper">
|
|
135
|
+
<component :is="!props.variant || props.variant === 'list' ? Label : 'p'" :for="item.id" :class="ui.label({ class: [props.ui?.label, item.ui?.label], disabled: item.disabled })" data-part="label">
|
|
136
|
+
<slot name="label" :item="item" :model-value="modelValue">
|
|
137
|
+
{{ item.label }}
|
|
138
|
+
</slot>
|
|
139
|
+
</component>
|
|
140
|
+
<p v-if="item.description || !!slots.description" :class="ui.description({ class: [props.ui?.description, item.ui?.description], disabled: item.disabled })" data-part="description">
|
|
141
|
+
<slot name="description" :item="item" :model-value="modelValue">
|
|
142
|
+
{{ item.description }}
|
|
143
|
+
</slot>
|
|
144
|
+
</p>
|
|
145
|
+
</div>
|
|
146
|
+
</component>
|
|
147
|
+
</fieldset>
|
|
148
|
+
</RadioGroupRoot>
|
|
149
149
|
</template>
|
|
@@ -7,6 +7,7 @@ import { reactivePick } from "@vueuse/core";
|
|
|
7
7
|
import { ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport } from "reka-ui";
|
|
8
8
|
import { computed, ref } 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
|
ui: { type: null, required: false },
|
|
@@ -20,7 +21,7 @@ const rootProps = reactivePick(props, "type", "dir", "scrollHideDelay");
|
|
|
20
21
|
const appConfig = useAppConfig();
|
|
21
22
|
const ui = computed(() => {
|
|
22
23
|
const styler = cv(merge(theme, appConfig.ui.scrollArea));
|
|
23
|
-
return styler(props);
|
|
24
|
+
return styler(pick(props, []));
|
|
24
25
|
});
|
|
25
26
|
defineExpose({
|
|
26
27
|
scrollTop,
|
|
@@ -35,36 +36,36 @@ function scrollTopLeft() {
|
|
|
35
36
|
</script>
|
|
36
37
|
|
|
37
38
|
<template>
|
|
38
|
-
<ScrollAreaRoot
|
|
39
|
-
ref="rootRef"
|
|
40
|
-
v-bind="rootProps"
|
|
41
|
-
:class="ui.root({ class: [props.class, props.ui?.root] })"
|
|
42
|
-
data-part="root"
|
|
43
|
-
>
|
|
44
|
-
<ScrollAreaViewport :class="ui.viewport({ class: props.ui?.viewport })" data-part="viewport">
|
|
45
|
-
<slot></slot>
|
|
46
|
-
</ScrollAreaViewport>
|
|
47
|
-
|
|
48
|
-
<ScrollAreaScrollbar
|
|
49
|
-
key="scrollbar-horizontal"
|
|
50
|
-
orientation="horizontal"
|
|
51
|
-
:class="ui.scrollbar({ class: props.ui?.scrollbar })"
|
|
52
|
-
data-part="scrollbar"
|
|
53
|
-
>
|
|
54
|
-
<ScrollAreaThumb :class="ui.thumb({ class: props.ui?.thumb })" data-part="thumb" />
|
|
55
|
-
</ScrollAreaScrollbar>
|
|
56
|
-
<ScrollAreaScrollbar
|
|
57
|
-
key="scrollbar-vertical"
|
|
58
|
-
orientation="vertical"
|
|
59
|
-
:class="ui.scrollbar({ class: props.ui?.scrollbar })"
|
|
60
|
-
data-part="scrollbar"
|
|
61
|
-
>
|
|
62
|
-
<ScrollAreaThumb :class="ui.thumb({ class: props.ui?.thumb })" data-part="thumb" />
|
|
63
|
-
</ScrollAreaScrollbar>
|
|
64
|
-
<ScrollAreaCorner
|
|
65
|
-
key="corner"
|
|
66
|
-
:class="ui.corner({ class: props.ui?.corner })"
|
|
67
|
-
data-part="corner"
|
|
68
|
-
/>
|
|
69
|
-
</ScrollAreaRoot>
|
|
39
|
+
<ScrollAreaRoot
|
|
40
|
+
ref="rootRef"
|
|
41
|
+
v-bind="rootProps"
|
|
42
|
+
:class="ui.root({ class: [props.class, props.ui?.root] })"
|
|
43
|
+
data-part="root"
|
|
44
|
+
>
|
|
45
|
+
<ScrollAreaViewport :class="ui.viewport({ class: props.ui?.viewport })" data-part="viewport">
|
|
46
|
+
<slot></slot>
|
|
47
|
+
</ScrollAreaViewport>
|
|
48
|
+
|
|
49
|
+
<ScrollAreaScrollbar
|
|
50
|
+
key="scrollbar-horizontal"
|
|
51
|
+
orientation="horizontal"
|
|
52
|
+
:class="ui.scrollbar({ class: props.ui?.scrollbar })"
|
|
53
|
+
data-part="scrollbar"
|
|
54
|
+
>
|
|
55
|
+
<ScrollAreaThumb :class="ui.thumb({ class: props.ui?.thumb })" data-part="thumb" />
|
|
56
|
+
</ScrollAreaScrollbar>
|
|
57
|
+
<ScrollAreaScrollbar
|
|
58
|
+
key="scrollbar-vertical"
|
|
59
|
+
orientation="vertical"
|
|
60
|
+
:class="ui.scrollbar({ class: props.ui?.scrollbar })"
|
|
61
|
+
data-part="scrollbar"
|
|
62
|
+
>
|
|
63
|
+
<ScrollAreaThumb :class="ui.thumb({ class: props.ui?.thumb })" data-part="thumb" />
|
|
64
|
+
</ScrollAreaScrollbar>
|
|
65
|
+
<ScrollAreaCorner
|
|
66
|
+
key="corner"
|
|
67
|
+
:class="ui.corner({ class: props.ui?.corner })"
|
|
68
|
+
data-part="corner"
|
|
69
|
+
/>
|
|
70
|
+
</ScrollAreaRoot>
|
|
70
71
|
</template>
|