@byyuurin/ui 0.0.7 → 0.0.8
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/dist/module.json +1 -1
- package/dist/module.mjs +5 -5
- package/dist/module.mjs.map +1 -1
- package/dist/runtime/app/injections.d.ts +16 -0
- package/dist/runtime/app/injections.js +31 -0
- package/dist/runtime/components/Accordion.vue +20 -20
- package/dist/runtime/components/Alert.vue +22 -15
- package/dist/runtime/components/App.vue +15 -15
- package/dist/runtime/components/Avatar.vue +73 -0
- package/dist/runtime/components/AvatarGroup.vue +90 -0
- package/dist/runtime/components/Badge.vue +15 -10
- package/dist/runtime/components/Breadcrumb.vue +105 -0
- package/dist/runtime/components/Button.vue +13 -13
- package/dist/runtime/components/ButtonGroup.vue +12 -10
- package/dist/runtime/components/Card.vue +7 -2
- package/dist/runtime/components/Carousel.vue +19 -12
- package/dist/runtime/components/Checkbox.vue +13 -9
- package/dist/runtime/components/Chip.vue +17 -12
- package/dist/runtime/components/Collapsible.vue +3 -3
- package/dist/runtime/components/Drawer.vue +14 -15
- package/dist/runtime/components/Input.vue +24 -24
- package/dist/runtime/components/InputNumber.vue +7 -5
- package/dist/runtime/components/Kbd.vue +51 -0
- package/dist/runtime/components/Link.vue +10 -10
- package/dist/runtime/components/LinkBase.vue +1 -1
- package/dist/runtime/components/Modal.vue +11 -8
- package/dist/runtime/components/ModalProvider.vue +2 -1
- package/dist/runtime/components/Pagination.vue +30 -30
- package/dist/runtime/components/PinInput.vue +7 -7
- package/dist/runtime/components/Popover.vue +7 -7
- package/dist/runtime/components/Progress.vue +165 -0
- package/dist/runtime/components/RadioGroup.vue +33 -29
- package/dist/runtime/components/Select.vue +40 -40
- package/dist/runtime/components/Skeleton.vue +33 -0
- package/dist/runtime/components/Slider.vue +6 -6
- package/dist/runtime/components/Switch.vue +11 -12
- package/dist/runtime/components/Table.vue +19 -11
- package/dist/runtime/components/Tabs.vue +22 -18
- package/dist/runtime/components/Textarea.vue +11 -11
- package/dist/runtime/components/Toast.vue +14 -13
- package/dist/runtime/components/Toaster.vue +4 -4
- package/dist/runtime/components/Tooltip.vue +7 -7
- package/dist/runtime/composables/useAvatarGroup.d.ts +4 -0
- package/dist/runtime/composables/useAvatarGroup.js +8 -0
- package/dist/runtime/composables/useButtonGroup.d.ts +4 -12
- package/dist/runtime/composables/useButtonGroup.js +1 -6
- package/dist/runtime/composables/useComponentIcons.d.ts +9 -9
- package/dist/runtime/composables/useComponentIcons.js +11 -11
- package/dist/runtime/composables/useKbd.d.ts +35 -0
- package/dist/runtime/composables/useKbd.js +49 -0
- package/dist/runtime/composables/useLocale.d.ts +8 -0
- package/dist/runtime/composables/useLocale.js +22 -0
- package/dist/runtime/composables/useModal.d.ts +1 -6
- package/dist/runtime/composables/useModal.js +1 -6
- package/dist/runtime/composables/useTheme.d.ts +0 -4
- package/dist/runtime/composables/useTheme.js +2 -12
- package/dist/runtime/index.d.ts +6 -0
- package/dist/runtime/index.js +6 -0
- package/dist/runtime/locale/en.d.ts +2 -0
- package/dist/runtime/locale/en.js +28 -0
- package/dist/runtime/locale/index.d.ts +2 -0
- package/dist/runtime/locale/index.js +2 -0
- package/dist/runtime/locale/zh-tw.d.ts +2 -0
- package/dist/runtime/locale/zh-tw.js +28 -0
- package/dist/runtime/theme/accordion.d.ts +6 -6
- package/dist/runtime/theme/accordion.js +2 -2
- package/dist/runtime/theme/app.d.ts +6 -6
- package/dist/runtime/theme/app.js +7 -7
- package/dist/runtime/theme/avatar-group.d.ts +52 -0
- package/dist/runtime/theme/avatar-group.js +32 -0
- package/dist/runtime/theme/avatar.d.ts +56 -0
- package/dist/runtime/theme/avatar.js +34 -0
- package/dist/runtime/theme/breadcrumb.d.ts +67 -0
- package/dist/runtime/theme/breadcrumb.js +44 -0
- package/dist/runtime/theme/button.d.ts +8 -8
- package/dist/runtime/theme/button.js +9 -9
- package/dist/runtime/theme/chip.d.ts +4 -4
- package/dist/runtime/theme/chip.js +2 -2
- package/dist/runtime/theme/drawer.js +2 -2
- package/dist/runtime/theme/index.d.ts +6 -0
- package/dist/runtime/theme/index.js +6 -0
- package/dist/runtime/theme/input-number.d.ts +6 -0
- package/dist/runtime/theme/input-number.js +5 -2
- package/dist/runtime/theme/input.d.ts +12 -12
- package/dist/runtime/theme/input.js +12 -12
- package/dist/runtime/theme/kbd.d.ts +39 -0
- package/dist/runtime/theme/kbd.js +26 -0
- package/dist/runtime/theme/modal.js +2 -2
- package/dist/runtime/theme/popover.js +1 -1
- package/dist/runtime/theme/progress.d.ts +122 -0
- package/dist/runtime/theme/progress.js +95 -0
- package/dist/runtime/theme/select.d.ts +18 -18
- package/dist/runtime/theme/select.js +16 -16
- package/dist/runtime/theme/skeleton.d.ts +8 -0
- package/dist/runtime/theme/skeleton.js +7 -0
- package/dist/runtime/theme/switch.js +1 -1
- package/dist/runtime/theme/tabs.d.ts +2 -2
- package/dist/runtime/theme/tabs.js +1 -1
- package/dist/runtime/theme/toast.js +2 -2
- package/dist/runtime/theme/tooltip.js +1 -1
- package/dist/runtime/types/components.d.ts +6 -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 +23 -0
- package/dist/runtime/types/locale.js +0 -0
- package/dist/runtime/types/utils.d.ts +1 -1
- package/dist/runtime/utils/index.d.ts +6 -1
- package/dist/runtime/utils/index.js +6 -4
- package/dist/runtime/utils/link.d.ts +1 -1
- package/dist/runtime/utils/translator.d.ts +18 -0
- package/dist/runtime/utils/translator.js +8 -0
- package/dist/shared/ui.ba24b380.mjs +4 -0
- package/dist/shared/ui.ba24b380.mjs.map +1 -0
- package/dist/unplugin.mjs +3 -12
- package/dist/unplugin.mjs.map +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +24 -13
- package/dist/shared/ui.d1728164.mjs +0 -4
- package/dist/shared/ui.d1728164.mjs.map +0 -1
- /package/dist/runtime/{composables/defineInjection.d.ts → utils/vue.d.ts} +0 -0
- /package/dist/runtime/{composables/defineInjection.js → utils/vue.js} +0 -0
|
@@ -6,14 +6,14 @@ import type { ComponentAttrs } from '../types'
|
|
|
6
6
|
import type { LinkProps } from './Link.vue'
|
|
7
7
|
|
|
8
8
|
export interface ButtonSlots {
|
|
9
|
-
default?: (props?:
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
default?: (props?: {}) => any
|
|
10
|
+
leading?: (props?: {}) => any
|
|
11
|
+
trailing?: (props?: {}) => any
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
type ButtonVariants = VariantProps<typeof button>
|
|
15
15
|
|
|
16
|
-
export interface ButtonProps extends ComponentAttrs<typeof button>, UseComponentIconsProps, Omit<LinkProps, 'raw' | 'custom'> {
|
|
16
|
+
export interface ButtonProps extends ComponentAttrs<typeof button>, UseComponentIconsProps, Omit<LinkProps, 'raw' | 'custom' | 'underline'> {
|
|
17
17
|
icon?: string
|
|
18
18
|
label?: string
|
|
19
19
|
variant?: ButtonVariants['variant']
|
|
@@ -40,7 +40,7 @@ const props = withDefaults(defineProps<ButtonProps>(), {
|
|
|
40
40
|
const slots = defineSlots<ButtonSlots>()
|
|
41
41
|
|
|
42
42
|
const { size, orientation } = useButtonGroup(props)
|
|
43
|
-
const {
|
|
43
|
+
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(
|
|
44
44
|
computed(() => ({ ...props, loading: props.loading })),
|
|
45
45
|
)
|
|
46
46
|
|
|
@@ -54,8 +54,8 @@ const style = computed(() => {
|
|
|
54
54
|
...props,
|
|
55
55
|
size: size.value,
|
|
56
56
|
groupOrientation: orientation.value,
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
leading: isLeading.value,
|
|
58
|
+
trailing: isTrailing.value,
|
|
59
59
|
class: [
|
|
60
60
|
props.class,
|
|
61
61
|
props.active ? props.activeClass : props.inactiveClass,
|
|
@@ -73,10 +73,10 @@ const style = computed(() => {
|
|
|
73
73
|
v-bind="omit(linkProps, ['type', 'disabled', 'activeClass', 'inactiveClass', 'disableClass'])"
|
|
74
74
|
raw
|
|
75
75
|
>
|
|
76
|
-
<slot name="
|
|
76
|
+
<slot name="leading">
|
|
77
77
|
<span
|
|
78
|
-
v-if="
|
|
79
|
-
:class="style.
|
|
78
|
+
v-if="isLeading && leadingIconName"
|
|
79
|
+
:class="style.leadingIcon({ class: [leadingIconName, props.ui?.leadingIcon] })"
|
|
80
80
|
></span>
|
|
81
81
|
</slot>
|
|
82
82
|
<span
|
|
@@ -85,10 +85,10 @@ const style = computed(() => {
|
|
|
85
85
|
>
|
|
86
86
|
<slot>{{ label }}</slot>
|
|
87
87
|
</span>
|
|
88
|
-
<slot name="
|
|
88
|
+
<slot name="trailing">
|
|
89
89
|
<span
|
|
90
|
-
v-if="
|
|
91
|
-
:class="style.
|
|
90
|
+
v-if="isTrailing && trailingIconName"
|
|
91
|
+
:class="style.trailingIcon({ class: [trailingIconName, props.ui?.trailingIcon] })"
|
|
92
92
|
></span>
|
|
93
93
|
</slot>
|
|
94
94
|
</Link>
|
|
@@ -4,22 +4,27 @@ import type { PrimitiveProps } from 'reka-ui'
|
|
|
4
4
|
import type { buttonGroup } from '../theme'
|
|
5
5
|
import type { ComponentAttrs } from '../types'
|
|
6
6
|
|
|
7
|
+
export interface ButtonGroupSlots {
|
|
8
|
+
default?: (props?: {}) => any
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
type ButtonGroupVariant = VariantProps<typeof buttonGroup>
|
|
8
12
|
|
|
9
|
-
export interface ButtonGroupProps extends Omit<ComponentAttrs<typeof buttonGroup>, 'ui'
|
|
13
|
+
export interface ButtonGroupProps extends Omit<ComponentAttrs<typeof buttonGroup>, 'ui'> {
|
|
14
|
+
/**
|
|
15
|
+
* The element or component this component should render as.
|
|
16
|
+
* @default "div"
|
|
17
|
+
*/
|
|
18
|
+
as?: PrimitiveProps['as']
|
|
10
19
|
size?: ButtonGroupVariant['size']
|
|
11
20
|
orientation?: ButtonGroupVariant['orientation']
|
|
12
21
|
}
|
|
13
|
-
|
|
14
|
-
export interface ButtonGroupSlots {
|
|
15
|
-
default?: (props?: any) => any
|
|
16
|
-
}
|
|
17
22
|
</script>
|
|
18
23
|
|
|
19
24
|
<script setup lang="ts">
|
|
20
25
|
import { Primitive } from 'reka-ui'
|
|
21
26
|
import { computed } from 'vue'
|
|
22
|
-
import { provideButtonGroup } from '../
|
|
27
|
+
import { provideButtonGroup } from '../app/injections'
|
|
23
28
|
import { useTheme } from '../composables/useTheme'
|
|
24
29
|
|
|
25
30
|
const props = withDefaults(defineProps<ButtonGroupProps>(), {
|
|
@@ -28,10 +33,7 @@ const props = withDefaults(defineProps<ButtonGroupProps>(), {
|
|
|
28
33
|
|
|
29
34
|
defineSlots<ButtonGroupSlots>()
|
|
30
35
|
|
|
31
|
-
provideButtonGroup(computed(() =>
|
|
32
|
-
size: props.size,
|
|
33
|
-
orientation: props.orientation,
|
|
34
|
-
})))
|
|
36
|
+
provideButtonGroup(computed(() => props))
|
|
35
37
|
|
|
36
38
|
const { theme, createStyler } = useTheme()
|
|
37
39
|
const style = computed(() => {
|
|
@@ -8,13 +8,18 @@ export interface CardSlots {
|
|
|
8
8
|
default?: (props?: {}) => any
|
|
9
9
|
content?: (props?: {}) => any
|
|
10
10
|
header?: (props?: {}) => any
|
|
11
|
-
title?: (props?:
|
|
12
|
-
description?: (props?:
|
|
11
|
+
title?: (props?: {}) => any
|
|
12
|
+
description?: (props?: {}) => any
|
|
13
13
|
footer?: (props?: {}) => any
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
type CardVariants = VariantProps<typeof card>
|
|
17
|
+
|
|
17
18
|
export interface CardProps extends ComponentAttrs<typeof card> {
|
|
19
|
+
/**
|
|
20
|
+
* The element or component this component should render as.
|
|
21
|
+
* @default "div"
|
|
22
|
+
*/
|
|
18
23
|
as?: PrimitiveProps['as']
|
|
19
24
|
variant?: CardVariants['variant']
|
|
20
25
|
title?: string
|
|
@@ -11,9 +11,18 @@ import type { AcceptableValue, PrimitiveProps } from 'reka-ui'
|
|
|
11
11
|
import type { carousel } from '../theme'
|
|
12
12
|
import type { ButtonProps, ComponentAttrs } from '../types'
|
|
13
13
|
|
|
14
|
+
export interface CarouselSlots<T> {
|
|
15
|
+
default?: (props: { item: T, index: number }) => any
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
type CarouselVariants = VariantProps<typeof carousel>
|
|
15
19
|
|
|
16
|
-
export interface CarouselProps<T> extends ComponentAttrs<typeof carousel>,
|
|
20
|
+
export interface CarouselProps<T> extends ComponentAttrs<typeof carousel>, Omit<EmblaOptionsType, 'axis' | 'container' | 'slides' | 'direction'> {
|
|
21
|
+
/**
|
|
22
|
+
* The element or component this component should render as.
|
|
23
|
+
* @default "div"
|
|
24
|
+
*/
|
|
25
|
+
as?: PrimitiveProps['as']
|
|
17
26
|
/**
|
|
18
27
|
* Configure the prev button when arrows are enabled.
|
|
19
28
|
* @default { size: 'md', variant: 'link' }
|
|
@@ -21,7 +30,7 @@ export interface CarouselProps<T> extends ComponentAttrs<typeof carousel>, Pick<
|
|
|
21
30
|
prev?: ButtonProps
|
|
22
31
|
/**
|
|
23
32
|
* The icon displayed in the prev button.
|
|
24
|
-
* @default
|
|
33
|
+
* @default app.icons.chevronLeft
|
|
25
34
|
*/
|
|
26
35
|
prevIcon?: string
|
|
27
36
|
/**
|
|
@@ -31,7 +40,7 @@ export interface CarouselProps<T> extends ComponentAttrs<typeof carousel>, Pick<
|
|
|
31
40
|
next?: ButtonProps
|
|
32
41
|
/**
|
|
33
42
|
* The icon displayed in the next button.
|
|
34
|
-
* @default
|
|
43
|
+
* @default app.icons.chevronRight
|
|
35
44
|
*/
|
|
36
45
|
nextIcon?: string
|
|
37
46
|
/**
|
|
@@ -78,10 +87,6 @@ export interface CarouselProps<T> extends ComponentAttrs<typeof carousel>, Pick<
|
|
|
78
87
|
*/
|
|
79
88
|
wheelGestures?: boolean | WheelGesturesPluginOptions
|
|
80
89
|
}
|
|
81
|
-
|
|
82
|
-
export interface CarouselSlots<T> {
|
|
83
|
-
default?: (props: { item: T, index: number }) => any
|
|
84
|
-
}
|
|
85
90
|
</script>
|
|
86
91
|
|
|
87
92
|
<script setup lang="ts" generic="T extends AcceptableValue">
|
|
@@ -89,6 +94,7 @@ import { computedAsync, reactivePick } from '@vueuse/core'
|
|
|
89
94
|
import useEmblaCarousel from 'embla-carousel-vue'
|
|
90
95
|
import { Primitive, useForwardProps } from 'reka-ui'
|
|
91
96
|
import { computed, onMounted, ref, watch } from 'vue'
|
|
97
|
+
import { useLocale } from '../composables/useLocale'
|
|
92
98
|
import { useTheme } from '../composables/useTheme'
|
|
93
99
|
import Button from './Button.vue'
|
|
94
100
|
|
|
@@ -129,14 +135,15 @@ defineSlots<CarouselSlots<T>>()
|
|
|
129
135
|
|
|
130
136
|
const rootProps = useForwardProps(reactivePick(props, 'active', 'align', 'breakpoints', 'containScroll', 'dragFree', 'dragThreshold', 'duration', 'inViewThreshold', 'loop', 'skipSnaps', 'slidesToScroll', 'startIndex', 'watchDrag', 'watchResize', 'watchSlides', 'watchFocus'))
|
|
131
137
|
|
|
138
|
+
const { t } = useLocale()
|
|
132
139
|
const { theme, createStyler } = useTheme()
|
|
133
140
|
const style = computed(() => {
|
|
134
141
|
const styler = createStyler(theme.value.carousel)
|
|
135
142
|
return styler(props)
|
|
136
143
|
})
|
|
137
144
|
|
|
138
|
-
const prevIcon = computed(() => props.prevIcon || (props.dir === 'rtl' ? theme.value.app.icons.
|
|
139
|
-
const nextIcon = computed(() => props.nextIcon || (props.dir === 'rtl' ? theme.value.app.icons.
|
|
145
|
+
const prevIcon = computed(() => props.prevIcon || (props.dir === 'rtl' ? theme.value.app.icons.chevronRight : theme.value.app.icons.chevronLeft))
|
|
146
|
+
const nextIcon = computed(() => props.nextIcon || (props.dir === 'rtl' ? theme.value.app.icons.chevronLeft : theme.value.app.icons.chevronRight))
|
|
140
147
|
|
|
141
148
|
const options = computed<EmblaOptionsType>(() => ({
|
|
142
149
|
...(props.fade ? { align: 'center', containScroll: false } : {}),
|
|
@@ -279,7 +286,7 @@ defineExpose({
|
|
|
279
286
|
:icon="prevIcon"
|
|
280
287
|
size="md"
|
|
281
288
|
variant="outline"
|
|
282
|
-
aria-label="prev"
|
|
289
|
+
:aria-label="t('carousel.prev')"
|
|
283
290
|
v-bind="typeof props.prev === 'object' ? props.prev : undefined"
|
|
284
291
|
:class="style.prev({ class: props.ui?.prev })"
|
|
285
292
|
@click="scrollPrev"
|
|
@@ -289,7 +296,7 @@ defineExpose({
|
|
|
289
296
|
:icon="nextIcon"
|
|
290
297
|
size="md"
|
|
291
298
|
variant="outline"
|
|
292
|
-
aria-label="next"
|
|
299
|
+
:aria-label="t('carousel.next')"
|
|
293
300
|
v-bind="typeof props.next === 'object' ? props.next : undefined"
|
|
294
301
|
:class="style.next({ class: props.ui?.next })"
|
|
295
302
|
@click="scrollNext"
|
|
@@ -299,7 +306,7 @@ defineExpose({
|
|
|
299
306
|
<div v-if="props.dots" :class="style.dots({ class: props.ui?.dots })">
|
|
300
307
|
<template v-for="(_, index) in scrollSnaps" :key="index">
|
|
301
308
|
<button
|
|
302
|
-
:aria-label="
|
|
309
|
+
:aria-label="t('carousel.goto', { page: index + 1 })"
|
|
303
310
|
:class="style.dot({ class: props.ui?.dot, active: selectedIndex === index })"
|
|
304
311
|
@click="scrollTo(index)"
|
|
305
312
|
></button>
|
|
@@ -4,9 +4,22 @@ import type { CheckboxRootProps, PrimitiveProps } from 'reka-ui'
|
|
|
4
4
|
import type { checkbox } from '../theme'
|
|
5
5
|
import type { ComponentAttrs } from '../types'
|
|
6
6
|
|
|
7
|
+
export interface CheckboxEmits {
|
|
8
|
+
(event: 'change', payload: Event): void
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface CheckboxSlots {
|
|
12
|
+
label?: (props: { label?: string }) => any
|
|
13
|
+
description?: (props: { description?: string }) => any
|
|
14
|
+
}
|
|
15
|
+
|
|
7
16
|
type CheckboxVariants = VariantProps<typeof checkbox>
|
|
8
17
|
|
|
9
18
|
export interface CheckboxProps extends ComponentAttrs<typeof checkbox>, Pick<CheckboxRootProps, 'disabled' | 'required' | 'name' | 'value' | 'id' | 'defaultValue'> {
|
|
19
|
+
/**
|
|
20
|
+
* The element or component this component should render as.
|
|
21
|
+
* @default "div"
|
|
22
|
+
*/
|
|
10
23
|
as?: PrimitiveProps['as']
|
|
11
24
|
label?: string
|
|
12
25
|
description?: string
|
|
@@ -22,15 +35,6 @@ export interface CheckboxProps extends ComponentAttrs<typeof checkbox>, Pick<Che
|
|
|
22
35
|
*/
|
|
23
36
|
indeterminateIcon?: string
|
|
24
37
|
}
|
|
25
|
-
|
|
26
|
-
export interface CheckboxEmits {
|
|
27
|
-
(event: 'change', payload: Event): void
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface CheckboxSlots {
|
|
31
|
-
label?: (props: { label?: string }) => any
|
|
32
|
-
description?: (props: { description?: string }) => any
|
|
33
|
-
}
|
|
34
38
|
</script>
|
|
35
39
|
|
|
36
40
|
<script lang="ts" setup>
|
|
@@ -5,19 +5,24 @@ import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
|
|
5
5
|
import type { chip } from '../theme'
|
|
6
6
|
import type { ComponentAttrs } from '../types'
|
|
7
7
|
|
|
8
|
+
export interface ChipSlots {
|
|
9
|
+
leading?: (props?: {}) => any
|
|
10
|
+
default?: (props?: {}) => any
|
|
11
|
+
trailing?: (props?: {}) => any
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
type ChipVariants = VariantProps<typeof chip>
|
|
9
15
|
|
|
10
|
-
export interface ChipProps extends ComponentAttrs<typeof chip>,
|
|
16
|
+
export interface ChipProps extends ComponentAttrs<typeof chip>, Omit<UseComponentIconsProps, 'loading' | 'loadingIcon'> {
|
|
17
|
+
/**
|
|
18
|
+
* The element or component this component should render as.
|
|
19
|
+
* @default "div"
|
|
20
|
+
*/
|
|
21
|
+
as?: PrimitiveProps['as']
|
|
11
22
|
variant?: ChipVariants['variant']
|
|
12
23
|
size?: ChipVariants['size']
|
|
13
24
|
label?: string
|
|
14
25
|
}
|
|
15
|
-
|
|
16
|
-
export interface ChipSlots {
|
|
17
|
-
prefix?: (props?: {}) => any
|
|
18
|
-
default?: (props?: {}) => any
|
|
19
|
-
suffix?: (props?: {}) => any
|
|
20
|
-
}
|
|
21
26
|
</script>
|
|
22
27
|
|
|
23
28
|
<script setup lang="ts">
|
|
@@ -34,7 +39,7 @@ const props = withDefaults(defineProps<ChipProps>(), {
|
|
|
34
39
|
const slots = defineSlots<ChipSlots>()
|
|
35
40
|
|
|
36
41
|
const { size, orientation } = useButtonGroup(props)
|
|
37
|
-
const {
|
|
42
|
+
const { isLeading, leadingIconName, isTrailing, trailingIconName } = useComponentIcons(props)
|
|
38
43
|
|
|
39
44
|
const { theme, createStyler } = useTheme()
|
|
40
45
|
const style = computed(() => {
|
|
@@ -49,16 +54,16 @@ const style = computed(() => {
|
|
|
49
54
|
|
|
50
55
|
<template>
|
|
51
56
|
<Primitive :as="props.as" :class="style.base({ class: [props.class, props.ui?.base] })">
|
|
52
|
-
<slot name="
|
|
53
|
-
<span v-if="
|
|
57
|
+
<slot name="leading">
|
|
58
|
+
<span v-if="isLeading && leadingIconName" :class="style.leadingIcon({ class: [leadingIconName, props.ui?.leadingIcon] })"></span>
|
|
54
59
|
</slot>
|
|
55
60
|
|
|
56
61
|
<span v-if="props.label || slots.default" :class="style.label({ class: props.ui?.label })">
|
|
57
62
|
<slot>{{ props.label }}</slot>
|
|
58
63
|
</span>
|
|
59
64
|
|
|
60
|
-
<slot name="
|
|
61
|
-
<span v-if="
|
|
65
|
+
<slot name="trailing">
|
|
66
|
+
<span v-if="isTrailing && trailingIconName" :class="style.trailingIcon({ class: [trailingIconName, props.ui?.trailingIcon] })"></span>
|
|
62
67
|
</slot>
|
|
63
68
|
</Primitive>
|
|
64
69
|
</template>
|
|
@@ -3,15 +3,15 @@ import type { CollapsibleRootEmits, CollapsibleRootProps } from 'reka-ui'
|
|
|
3
3
|
import type { collapsible } from '../theme'
|
|
4
4
|
import type { ComponentAttrs } from '../types'
|
|
5
5
|
|
|
6
|
-
export interface CollapsibleProps extends ComponentAttrs<typeof collapsible>, Pick<CollapsibleRootProps, 'as' | 'defaultOpen' | 'open' | 'disabled' | 'unmountOnHide'> {
|
|
7
|
-
}
|
|
8
|
-
|
|
9
6
|
export interface CollapsibleEmits extends CollapsibleRootEmits {}
|
|
10
7
|
|
|
11
8
|
export interface CollapsibleSlots {
|
|
12
9
|
default?: (props: { open: boolean }) => any
|
|
13
10
|
content?: (props?: {}) => any
|
|
14
11
|
}
|
|
12
|
+
|
|
13
|
+
export interface CollapsibleProps extends ComponentAttrs<typeof collapsible>, Pick<CollapsibleRootProps, 'as' | 'defaultOpen' | 'open' | 'disabled' | 'unmountOnHide'> {
|
|
14
|
+
}
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<script setup lang="ts">
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { DialogContentProps
|
|
2
|
+
import type { DialogContentProps } from 'reka-ui'
|
|
3
3
|
import type { DrawerRootEmits, DrawerRootProps } from 'vaul-vue'
|
|
4
4
|
import type { drawer } from '../theme'
|
|
5
5
|
import type { ComponentAttrs } from '../types'
|
|
6
6
|
|
|
7
|
+
export interface DrawerEmits extends DrawerRootEmits {}
|
|
8
|
+
|
|
9
|
+
export interface DrawerSlots {
|
|
10
|
+
default?: (props?: {}) => any
|
|
11
|
+
handle?: (props?: {}) => any
|
|
12
|
+
content?: (props?: {}) => any
|
|
13
|
+
header?: (props?: {}) => any
|
|
14
|
+
title?: (props?: {}) => any
|
|
15
|
+
description?: (props?: {}) => any
|
|
16
|
+
body?: (props?: {}) => any
|
|
17
|
+
footer?: (props?: {}) => any
|
|
18
|
+
}
|
|
19
|
+
|
|
7
20
|
export interface DrawerProps extends ComponentAttrs<typeof drawer>, Pick<DrawerRootProps, 'activeSnapPoint' | 'closeThreshold' | 'defaultOpen' | 'direction' | 'fadeFromIndex' | 'fixed' | 'modal' | 'nested' | 'direction' | 'open' | 'scrollLockTimeout' | 'shouldScaleBackground' | 'snapPoints'> {
|
|
8
|
-
as?: PrimitiveProps['as']
|
|
9
21
|
title?: string
|
|
10
22
|
description?: string
|
|
11
23
|
/** The content of the drawer. */
|
|
@@ -35,19 +47,6 @@ export interface DrawerProps extends ComponentAttrs<typeof drawer>, Pick<DrawerR
|
|
|
35
47
|
*/
|
|
36
48
|
dismissible?: boolean
|
|
37
49
|
}
|
|
38
|
-
|
|
39
|
-
export interface DrawerEmits extends DrawerRootEmits {}
|
|
40
|
-
|
|
41
|
-
export interface DrawerSlots {
|
|
42
|
-
default?: (props?: {}) => any
|
|
43
|
-
handle?: (props?: {}) => any
|
|
44
|
-
content?: (props?: {}) => any
|
|
45
|
-
header?: (props?: {}) => any
|
|
46
|
-
title?: (props?: {}) => any
|
|
47
|
-
description?: (props?: {}) => any
|
|
48
|
-
body?: (props?: {}) => any
|
|
49
|
-
footer?: (props?: {}) => any
|
|
50
|
-
}
|
|
51
50
|
</script>
|
|
52
51
|
|
|
53
52
|
<script setup lang="ts">
|
|
@@ -6,12 +6,24 @@ import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
|
|
6
6
|
import type { input } from '../theme'
|
|
7
7
|
import type { ComponentAttrs } from '../types'
|
|
8
8
|
|
|
9
|
+
export interface InputEmits {
|
|
10
|
+
(e: 'update:modelValue', payload: string | number): void
|
|
11
|
+
(e: 'blur', event: FocusEvent): void
|
|
12
|
+
(e: 'change', event: Event): void
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface InputSlots {
|
|
16
|
+
leading?: (props?: {}) => any
|
|
17
|
+
default?: (props?: {}) => any
|
|
18
|
+
trailing?: (props?: {}) => any
|
|
19
|
+
}
|
|
20
|
+
|
|
9
21
|
type InputVariants = VariantProps<typeof input>
|
|
10
22
|
|
|
11
23
|
export interface InputProps extends ComponentAttrs<typeof input>, UseComponentIconsProps {
|
|
12
24
|
/**
|
|
13
25
|
* The element or component this component should render as.
|
|
14
|
-
* @
|
|
26
|
+
* @default "div"
|
|
15
27
|
*/
|
|
16
28
|
as?: PrimitiveProps['as']
|
|
17
29
|
id?: string
|
|
@@ -29,18 +41,6 @@ export interface InputProps extends ComponentAttrs<typeof input>, UseComponentIc
|
|
|
29
41
|
autofocusDelay?: number
|
|
30
42
|
disabled?: boolean
|
|
31
43
|
}
|
|
32
|
-
|
|
33
|
-
export interface InputEmits {
|
|
34
|
-
(e: 'update:modelValue', payload: string | number): void
|
|
35
|
-
(e: 'blur', event: FocusEvent): void
|
|
36
|
-
(e: 'change', event: Event): void
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface InputSlots {
|
|
40
|
-
prefix?: (props?: {}) => any
|
|
41
|
-
default?: (props?: {}) => any
|
|
42
|
-
suffix?: (props?: {}) => any
|
|
43
|
-
}
|
|
44
44
|
</script>
|
|
45
45
|
|
|
46
46
|
<script setup lang="ts">
|
|
@@ -69,7 +69,7 @@ const [modelValue, modelModifiers] = defineModel<string | number>()
|
|
|
69
69
|
const inputRef = ref<HTMLInputElement | null>(null)
|
|
70
70
|
|
|
71
71
|
const { size, orientation } = useButtonGroup(props)
|
|
72
|
-
const {
|
|
72
|
+
const { isLeading, leadingIconName, isTrailing, trailingIconName } = useComponentIcons(props)
|
|
73
73
|
|
|
74
74
|
const { theme, createStyler } = useTheme()
|
|
75
75
|
const style = computed(() => {
|
|
@@ -80,8 +80,8 @@ const style = computed(() => {
|
|
|
80
80
|
type: props.type,
|
|
81
81
|
size: size.value,
|
|
82
82
|
groupOrientation: orientation.value,
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
leading: isLeading.value || !!slots.leading,
|
|
84
|
+
trailing: isTrailing.value || !!slots.trailing,
|
|
85
85
|
})
|
|
86
86
|
})
|
|
87
87
|
|
|
@@ -138,11 +138,11 @@ onMounted(() => {
|
|
|
138
138
|
:class="style.base({ class: [props.class, props.ui?.base] })"
|
|
139
139
|
:aria-disabled="props.disabled ? true : undefined"
|
|
140
140
|
>
|
|
141
|
-
<span v-if="
|
|
142
|
-
<slot name="
|
|
141
|
+
<span v-if="isLeading || slots.leading" :class="style.leading({ class: props.ui?.leading })">
|
|
142
|
+
<slot name="leading">
|
|
143
143
|
<span
|
|
144
|
-
v-if="
|
|
145
|
-
:class="style.
|
|
144
|
+
v-if="isLeading && leadingIconName"
|
|
145
|
+
:class="style.leadingIcon({ class: [leadingIconName, props.ui?.leadingIcon] })"
|
|
146
146
|
></span>
|
|
147
147
|
</slot>
|
|
148
148
|
</span>
|
|
@@ -166,11 +166,11 @@ onMounted(() => {
|
|
|
166
166
|
|
|
167
167
|
<slot></slot>
|
|
168
168
|
|
|
169
|
-
<span v-if="
|
|
170
|
-
<slot name="
|
|
169
|
+
<span v-if="isTrailing || slots.trailing" :class="style.trailing({ class: props.ui?.trailing })">
|
|
170
|
+
<slot name="trailing">
|
|
171
171
|
<span
|
|
172
|
-
v-if="
|
|
173
|
-
:class="style.
|
|
172
|
+
v-if="isTrailing && trailingIconName"
|
|
173
|
+
:class="style.trailingIcon({ class: [trailingIconName, props.ui?.trailingIcon] })"
|
|
174
174
|
></span>
|
|
175
175
|
</slot>
|
|
176
176
|
</span>
|
|
@@ -27,7 +27,7 @@ export interface InputNumberProps extends ComponentAttrs<typeof inputNumber>, Pi
|
|
|
27
27
|
highlight?: boolean
|
|
28
28
|
/**
|
|
29
29
|
* The orientation of the input menu.
|
|
30
|
-
* @default
|
|
30
|
+
* @default "horizontal"
|
|
31
31
|
*/
|
|
32
32
|
orientation?: InputNumberVariants['orientation']
|
|
33
33
|
/**
|
|
@@ -63,6 +63,7 @@ export interface InputNumberProps extends ComponentAttrs<typeof inputNumber>, Pi
|
|
|
63
63
|
import { reactivePick } from '@vueuse/core'
|
|
64
64
|
import { NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput, NumberFieldRoot, useForwardPropsEmits } from 'reka-ui'
|
|
65
65
|
import { computed, onMounted, ref } from 'vue'
|
|
66
|
+
import { useLocale } from '../composables/useLocale'
|
|
66
67
|
import { useTheme } from '../composables/useTheme'
|
|
67
68
|
import Button from './Button.vue'
|
|
68
69
|
|
|
@@ -81,9 +82,10 @@ const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', '
|
|
|
81
82
|
|
|
82
83
|
const inputRef = ref<InstanceType<typeof NumberFieldInput> | null>(null)
|
|
83
84
|
|
|
85
|
+
const { t } = useLocale()
|
|
84
86
|
const { theme, createStyler } = useTheme()
|
|
85
|
-
const incrementIcon = computed(() => props.incrementIcon || (props.orientation === 'horizontal' ? theme.value.app.icons.plus : theme.value.app.icons.
|
|
86
|
-
const decrementIcon = computed(() => props.decrementIcon || (props.orientation === 'horizontal' ? theme.value.app.icons.minus : theme.value.app.icons.
|
|
87
|
+
const incrementIcon = computed(() => props.incrementIcon || (props.orientation === 'horizontal' ? theme.value.app.icons.plus : theme.value.app.icons.chevronUp))
|
|
88
|
+
const decrementIcon = computed(() => props.decrementIcon || (props.orientation === 'horizontal' ? theme.value.app.icons.minus : theme.value.app.icons.chevronDown))
|
|
87
89
|
|
|
88
90
|
const style = computed(() => {
|
|
89
91
|
const styler = createStyler(theme.value.inputNumber)
|
|
@@ -143,7 +145,7 @@ function onBlur(event: FocusEvent) {
|
|
|
143
145
|
:icon="incrementIcon"
|
|
144
146
|
:size="props.size"
|
|
145
147
|
variant="link"
|
|
146
|
-
aria-label="increment"
|
|
148
|
+
:aria-label="t('inputNumber.increment')"
|
|
147
149
|
v-bind="typeof props.increment === 'object' ? props.increment : undefined"
|
|
148
150
|
/>
|
|
149
151
|
</slot>
|
|
@@ -157,7 +159,7 @@ function onBlur(event: FocusEvent) {
|
|
|
157
159
|
:icon="decrementIcon"
|
|
158
160
|
:size="props.size"
|
|
159
161
|
variant="link"
|
|
160
|
-
aria-label="decrement"
|
|
162
|
+
:aria-label="t('inputNumber.decrement')"
|
|
161
163
|
v-bind="typeof props.decrement === 'object' ? props.decrement : undefined"
|
|
162
164
|
/>
|
|
163
165
|
</slot>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { VariantProps } from '@byyuurin/ui-kit'
|
|
3
|
+
import type { PrimitiveProps } from 'reka-ui'
|
|
4
|
+
import { computed } from 'vue'
|
|
5
|
+
import type { KbdKey } from '../composables/useKbd'
|
|
6
|
+
import type { kbd } from '../theme'
|
|
7
|
+
import type { ComponentAttrs } from '../types'
|
|
8
|
+
|
|
9
|
+
export interface KbdSlots {
|
|
10
|
+
default?: (props?: {}) => any
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type KbdVariants = VariantProps<typeof kbd>
|
|
14
|
+
|
|
15
|
+
export interface KbdProps extends Omit<ComponentAttrs<typeof kbd>, 'ui'> {
|
|
16
|
+
/**
|
|
17
|
+
* The element or component this component should render as.
|
|
18
|
+
* @default "kbd"
|
|
19
|
+
*/
|
|
20
|
+
as?: PrimitiveProps['as']
|
|
21
|
+
variant?: KbdVariants['variant']
|
|
22
|
+
size?: KbdVariants['size']
|
|
23
|
+
value?: KbdKey | (string & {})
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import { Primitive } from 'reka-ui'
|
|
29
|
+
import { useKbd } from '../composables/useKbd'
|
|
30
|
+
import { useTheme } from '../composables/useTheme'
|
|
31
|
+
|
|
32
|
+
const props = withDefaults(defineProps<KbdProps>(), {
|
|
33
|
+
as: 'kbd',
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
defineSlots<KbdSlots>()
|
|
37
|
+
|
|
38
|
+
const { getKbdKey } = useKbd()
|
|
39
|
+
|
|
40
|
+
const { theme, createStyler } = useTheme()
|
|
41
|
+
const style = computed(() => {
|
|
42
|
+
const styler = createStyler(theme.value.kbd)
|
|
43
|
+
return styler(props)
|
|
44
|
+
})
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<template>
|
|
48
|
+
<Primitive :as="props.as" :class="style">
|
|
49
|
+
<slot>{{ getKbdKey(props.value) }}</slot>
|
|
50
|
+
</Primitive>
|
|
51
|
+
</template>
|
|
@@ -5,6 +5,10 @@ import type { RouteLocationRaw, RouterLinkProps } from 'vue-router'
|
|
|
5
5
|
import type { link } from '../theme'
|
|
6
6
|
import type { ComponentAttrs } from '../types'
|
|
7
7
|
|
|
8
|
+
export interface LinkSlots {
|
|
9
|
+
default?: (props: { active: boolean }) => any
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
|
|
9
13
|
/**
|
|
10
14
|
* Route Location the link should navigate to when clicked on.
|
|
@@ -54,12 +58,12 @@ interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
|
|
|
54
58
|
export interface LinkProps extends Omit<ComponentAttrs<typeof link>, 'ui'>, NuxtLinkProps {
|
|
55
59
|
/**
|
|
56
60
|
* The element or component this component should render as when not a link.
|
|
57
|
-
* @default
|
|
61
|
+
* @default "button"
|
|
58
62
|
*/
|
|
59
63
|
as?: PrimitiveProps['as']
|
|
60
64
|
/**
|
|
61
65
|
* The type of the button when not a link.
|
|
62
|
-
* @default
|
|
66
|
+
* @default "button"
|
|
63
67
|
*/
|
|
64
68
|
type?: ButtonHTMLAttributes['type']
|
|
65
69
|
label?: string
|
|
@@ -81,10 +85,6 @@ export interface LinkProps extends Omit<ComponentAttrs<typeof link>, 'ui'>, Nuxt
|
|
|
81
85
|
/** When `true`, only styles from `class`, `ui.active`, and `ui.inactive` will be applied. */
|
|
82
86
|
raw?: boolean
|
|
83
87
|
}
|
|
84
|
-
|
|
85
|
-
export interface LinkSlots {
|
|
86
|
-
default?: (props: { active: boolean }) => any
|
|
87
|
-
}
|
|
88
88
|
</script>
|
|
89
89
|
|
|
90
90
|
<script setup lang="ts">
|
|
@@ -317,8 +317,8 @@ function resolveLinkClass({ route, isActive, isExactActive }: any = {}) {
|
|
|
317
317
|
as,
|
|
318
318
|
type,
|
|
319
319
|
disabled,
|
|
320
|
-
href: to,
|
|
321
|
-
target: isExternalLink ? '_blank' : undefined,
|
|
320
|
+
href: to || href,
|
|
321
|
+
target: isExternalLink ? '_blank' : target || undefined,
|
|
322
322
|
active: false,
|
|
323
323
|
}"
|
|
324
324
|
>
|
|
@@ -332,8 +332,8 @@ function resolveLinkClass({ route, isActive, isExactActive }: any = {}) {
|
|
|
332
332
|
as,
|
|
333
333
|
type,
|
|
334
334
|
disabled,
|
|
335
|
-
href: (to as string),
|
|
336
|
-
target: isExternalLink ? '_blank' : undefined,
|
|
335
|
+
href: ((to || href) as string),
|
|
336
|
+
target: isExternalLink ? '_blank' : target || undefined,
|
|
337
337
|
}"
|
|
338
338
|
:is-external="isExternalLink"
|
|
339
339
|
:class="resolveLinkClass()"
|