@youcan/celeste 0.13.0 → 0.13.1
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/ai/component-registry.json +2 -2
- package/ai/component-registry.md +1 -1
- package/ai/icons.md +1 -1
- package/ai/tokens.md +1 -1
- package/dist/celeste.css +86 -86
- package/dist/cjs/chunks/calendar.cjs +71 -72
- package/dist/cjs/chunks/combobox-root.cjs +6 -6
- package/dist/cjs/chunks/digit-input.cjs +13 -12
- package/dist/cjs/chunks/dropdown-menu.cjs +9 -6
- package/dist/cjs/chunks/radio-group.cjs +4 -8
- package/dist/cjs/chunks/range-calendar.cjs +71 -72
- package/dist/cjs/chunks/scroll-area.cjs +16 -17
- package/dist/cjs/chunks/segmented-control.cjs +20 -21
- package/dist/cjs/chunks/select.cjs +8 -5
- package/dist/cjs/chunks/slider.cjs +14 -15
- package/dist/cjs/chunks/tab-menu.cjs +8 -9
- package/dist/cjs/command-root.cjs +8 -5
- package/dist/cjs/use-direction.cjs +4 -4
- package/dist/components/radio-group/radio-group.d.ts +2 -2
- package/dist/components/scroll-area/scroll-area.d.ts +2 -2
- package/dist/components/segmented-control/segmented-control.d.ts +2 -2
- package/dist/components/tab-menu/tab-menu.d.ts +2 -2
- package/dist/composables/use-direction.d.ts +2 -2
- package/dist/es/chunks/calendar.js +71 -72
- package/dist/es/chunks/combobox-root.js +6 -6
- package/dist/es/chunks/digit-input.js +14 -13
- package/dist/es/chunks/dropdown-menu.js +9 -6
- package/dist/es/chunks/radio-group.js +5 -9
- package/dist/es/chunks/range-calendar.js +71 -72
- package/dist/es/chunks/scroll-area.js +16 -17
- package/dist/es/chunks/segmented-control.js +21 -22
- package/dist/es/chunks/select.js +8 -5
- package/dist/es/chunks/slider.js +14 -15
- package/dist/es/chunks/tab-menu.js +9 -10
- package/dist/es/command-root.js +8 -5
- package/dist/es/use-direction.js +5 -5
- package/package.json +3 -3
- package/src/components/calendar/calendar.vue +62 -64
- package/src/components/combobox/combobox-root.vue +9 -5
- package/src/components/command/command-root.vue +10 -9
- package/src/components/digit-input/digit-input.vue +10 -11
- package/src/components/dropdown-menu/dropdown-menu.vue +9 -8
- package/src/components/radio-group/radio-group.vue +9 -10
- package/src/components/range-calendar/range-calendar.vue +63 -65
- package/src/components/scroll-area/scroll-area.vue +14 -15
- package/src/components/segmented-control/segmented-control.vue +20 -21
- package/src/components/select/select.vue +9 -8
- package/src/components/slider/slider.vue +16 -17
- package/src/components/tab-menu/tab-menu.vue +9 -10
- package/src/composables/use-direction.ts +6 -6
|
@@ -8,15 +8,19 @@ const emits = defineEmits<ComboboxRootEmits>();
|
|
|
8
8
|
|
|
9
9
|
const forwarded = useForwardPropsEmits(props, emits);
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const dir = useDirection(() => props.dir);
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<template>
|
|
15
|
-
<
|
|
16
|
-
|
|
15
|
+
<ComboboxRoot
|
|
16
|
+
class="celeste-combobox-root"
|
|
17
|
+
v-bind="forwarded"
|
|
18
|
+
:dir="dir"
|
|
19
|
+
>
|
|
20
|
+
<ConfigProvider :dir="dir">
|
|
17
21
|
<slot />
|
|
18
|
-
</
|
|
19
|
-
</
|
|
22
|
+
</ConfigProvider>
|
|
23
|
+
</ComboboxRoot>
|
|
20
24
|
</template>
|
|
21
25
|
|
|
22
26
|
<style lang="scss" scoped>
|
|
@@ -20,19 +20,20 @@ const delegatedProps = computed(() => {
|
|
|
20
20
|
|
|
21
21
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
const dir = useDirection(() => props.dir);
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
<template>
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
<ComboboxRoot
|
|
28
|
+
v-bind="forwarded"
|
|
29
|
+
class="celeste-command-root"
|
|
30
|
+
:class="props.class"
|
|
31
|
+
:dir="dir"
|
|
32
|
+
>
|
|
33
|
+
<ConfigProvider :dir="dir">
|
|
33
34
|
<slot />
|
|
34
|
-
</
|
|
35
|
-
</
|
|
35
|
+
</ConfigProvider>
|
|
36
|
+
</ComboboxRoot>
|
|
36
37
|
</template>
|
|
37
38
|
|
|
38
39
|
<style>
|
|
@@ -3,7 +3,7 @@ import type { PinInputRootEmits, PinInputRootProps } from 'reka-ui';
|
|
|
3
3
|
import type { HTMLAttributes } from 'vue';
|
|
4
4
|
import { reactiveOmit } from '@vueuse/core';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import {
|
|
6
|
+
import { PinInputRoot, useForwardPropsEmits } from 'reka-ui';
|
|
7
7
|
import { useDirection } from '@/composables/use-direction';
|
|
8
8
|
|
|
9
9
|
export type PinInputType = 'text' | 'number';
|
|
@@ -21,19 +21,18 @@ const delegatedProps = reactiveOmit(props, 'class', 'hasError');
|
|
|
21
21
|
|
|
22
22
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
23
23
|
|
|
24
|
-
const
|
|
24
|
+
const dir = useDirection(() => props.dir);
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
27
|
<template>
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</ConfigProvider>
|
|
28
|
+
<PinInputRoot
|
|
29
|
+
v-bind="forwarded"
|
|
30
|
+
:class="clsx('celeste-digit-input', props.class)"
|
|
31
|
+
:data-error="hasError"
|
|
32
|
+
:dir="dir"
|
|
33
|
+
>
|
|
34
|
+
<slot />
|
|
35
|
+
</PinInputRoot>
|
|
37
36
|
</template>
|
|
38
37
|
|
|
39
38
|
<style scoped lang="scss">
|
|
@@ -12,18 +12,19 @@ const emits = defineEmits<DropdownMenuRootEmits>();
|
|
|
12
12
|
const delegatedProps = useDelegatedProps(props, 'class');
|
|
13
13
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const dir = useDirection(() => props.dir);
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<template>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
<DropdownMenuRoot
|
|
20
|
+
v-bind="forwarded"
|
|
21
|
+
:class="clsx('celeste-dropdown-menu', props.class)"
|
|
22
|
+
:dir="dir"
|
|
23
|
+
>
|
|
24
|
+
<ConfigProvider :dir="dir">
|
|
24
25
|
<slot />
|
|
25
|
-
</
|
|
26
|
-
</
|
|
26
|
+
</ConfigProvider>
|
|
27
|
+
</DropdownMenuRoot>
|
|
27
28
|
</template>
|
|
28
29
|
|
|
29
30
|
<style lang="scss" scoped>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { RadioGroupRootEmits, RadioGroupRootProps } from 'reka-ui';
|
|
3
3
|
import type { HTMLAttributes } from 'vue';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import {
|
|
5
|
+
import { RadioGroupRoot, useForwardPropsEmits } from 'reka-ui';
|
|
6
6
|
import { useDelegatedProps } from '@/composables/use-delegated-props';
|
|
7
7
|
import { useDirection } from '@/composables/use-direction';
|
|
8
8
|
|
|
@@ -12,18 +12,17 @@ const emits = defineEmits<RadioGroupRootEmits>();
|
|
|
12
12
|
const delegatedProps = useDelegatedProps(props, 'class');
|
|
13
13
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const dir = useDirection(() => props.dir);
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<template>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</ConfigProvider>
|
|
19
|
+
<RadioGroupRoot
|
|
20
|
+
:class="clsx('celeste-radio-wrapper', props.class)"
|
|
21
|
+
v-bind="forwarded"
|
|
22
|
+
:dir="dir"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</RadioGroupRoot>
|
|
27
26
|
</template>
|
|
28
27
|
|
|
29
28
|
<style lang="scss">
|
|
@@ -4,7 +4,6 @@ import type { HTMLAttributes } from 'vue';
|
|
|
4
4
|
import { DateFormatter, getLocalTimeZone, isEqualDay } from '@internationalized/date';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import {
|
|
7
|
-
ConfigProvider,
|
|
8
7
|
RangeCalendarCell,
|
|
9
8
|
RangeCalendarCellTrigger,
|
|
10
9
|
RangeCalendarGrid,
|
|
@@ -38,7 +37,7 @@ const emits = defineEmits<RangeCalendarRootEmits>();
|
|
|
38
37
|
const delegatedProps = useDelegatedProps(props, ['class', 'markedDates']);
|
|
39
38
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
40
39
|
|
|
41
|
-
const
|
|
40
|
+
const dir = useDirection(() => props.dir);
|
|
42
41
|
|
|
43
42
|
const monthFormatter = computed(
|
|
44
43
|
() => new DateFormatter(props.locale ?? 'en-US', { month: 'long', year: 'numeric' }),
|
|
@@ -58,72 +57,71 @@ function weekdayLabel(day: string): string {
|
|
|
58
57
|
</script>
|
|
59
58
|
|
|
60
59
|
<template>
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
>
|
|
95
|
-
{{ weekdayLabel(day) }}
|
|
96
|
-
</RangeCalendarHeadCell>
|
|
97
|
-
</RangeCalendarGridRow>
|
|
98
|
-
</RangeCalendarGridHead>
|
|
99
|
-
<RangeCalendarGridBody class="celeste-range-calendar-body">
|
|
100
|
-
<RangeCalendarGridRow
|
|
101
|
-
v-for="(weekDates, index) in month.rows"
|
|
102
|
-
:key="`week-${index}`"
|
|
103
|
-
class="celeste-range-calendar-week"
|
|
60
|
+
<RangeCalendarRoot
|
|
61
|
+
v-slot="{ weekDays, grid }"
|
|
62
|
+
v-bind="forwarded"
|
|
63
|
+
:class="clsx('celeste-range-calendar', props.class)"
|
|
64
|
+
:dir="dir"
|
|
65
|
+
>
|
|
66
|
+
<div class="celeste-range-calendar-months">
|
|
67
|
+
<div
|
|
68
|
+
v-for="month in grid"
|
|
69
|
+
:key="month.value.toString()"
|
|
70
|
+
class="celeste-range-calendar-month"
|
|
71
|
+
>
|
|
72
|
+
<div class="celeste-range-calendar-header">
|
|
73
|
+
<RangeCalendarPrev as-child>
|
|
74
|
+
<button type="button" class="celeste-range-calendar-nav">
|
|
75
|
+
<i class="i-celeste-arrow-left-s-line" />
|
|
76
|
+
</button>
|
|
77
|
+
</RangeCalendarPrev>
|
|
78
|
+
<span class="celeste-range-calendar-heading">{{ formatMonth(month.value) }}</span>
|
|
79
|
+
<RangeCalendarNext as-child>
|
|
80
|
+
<button type="button" class="celeste-range-calendar-nav">
|
|
81
|
+
<i class="i-celeste-arrow-right-s-line" />
|
|
82
|
+
</button>
|
|
83
|
+
</RangeCalendarNext>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<RangeCalendarGrid class="celeste-range-calendar-grid">
|
|
87
|
+
<RangeCalendarGridHead>
|
|
88
|
+
<RangeCalendarGridRow class="celeste-range-calendar-week">
|
|
89
|
+
<RangeCalendarHeadCell
|
|
90
|
+
v-for="day in weekDays"
|
|
91
|
+
:key="day"
|
|
92
|
+
class="celeste-range-calendar-weekday"
|
|
104
93
|
>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
94
|
+
{{ weekdayLabel(day) }}
|
|
95
|
+
</RangeCalendarHeadCell>
|
|
96
|
+
</RangeCalendarGridRow>
|
|
97
|
+
</RangeCalendarGridHead>
|
|
98
|
+
<RangeCalendarGridBody class="celeste-range-calendar-body">
|
|
99
|
+
<RangeCalendarGridRow
|
|
100
|
+
v-for="(weekDates, index) in month.rows"
|
|
101
|
+
:key="`week-${index}`"
|
|
102
|
+
class="celeste-range-calendar-week"
|
|
103
|
+
>
|
|
104
|
+
<RangeCalendarCell
|
|
105
|
+
v-for="weekDate in weekDates"
|
|
106
|
+
:key="weekDate.toString()"
|
|
107
|
+
:date="weekDate"
|
|
108
|
+
class="celeste-range-calendar-cell"
|
|
109
|
+
>
|
|
110
|
+
<RangeCalendarCellTrigger
|
|
111
|
+
:day="weekDate"
|
|
112
|
+
:month="month.value"
|
|
113
|
+
class="celeste-range-calendar-day"
|
|
114
|
+
:data-marked="isMarked(weekDate) ? '' : undefined"
|
|
110
115
|
>
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
<span class="celeste-range-calendar-day-number">{{ weekDate.day }}</span>
|
|
118
|
-
</RangeCalendarCellTrigger>
|
|
119
|
-
</RangeCalendarCell>
|
|
120
|
-
</RangeCalendarGridRow>
|
|
121
|
-
</RangeCalendarGridBody>
|
|
122
|
-
</RangeCalendarGrid>
|
|
123
|
-
</div>
|
|
116
|
+
<span class="celeste-range-calendar-day-number">{{ weekDate.day }}</span>
|
|
117
|
+
</RangeCalendarCellTrigger>
|
|
118
|
+
</RangeCalendarCell>
|
|
119
|
+
</RangeCalendarGridRow>
|
|
120
|
+
</RangeCalendarGridBody>
|
|
121
|
+
</RangeCalendarGrid>
|
|
124
122
|
</div>
|
|
125
|
-
</
|
|
126
|
-
</
|
|
123
|
+
</div>
|
|
124
|
+
</RangeCalendarRoot>
|
|
127
125
|
</template>
|
|
128
126
|
|
|
129
127
|
<style scoped lang="scss">
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { ScrollAreaRootProps } from 'reka-ui';
|
|
3
3
|
import type { HTMLAttributes } from 'vue';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import {
|
|
5
|
+
import { ScrollAreaCorner, ScrollAreaRoot, ScrollAreaViewport } from 'reka-ui';
|
|
6
6
|
import { useDelegatedProps, useDirection } from '@/composables';
|
|
7
7
|
import ScrollBar from './scroll-bar.vue';
|
|
8
8
|
|
|
@@ -10,23 +10,22 @@ const props = defineProps<ScrollAreaRootProps & { class?: HTMLAttributes['class'
|
|
|
10
10
|
|
|
11
11
|
const delegatedProps = useDelegatedProps(props, 'class');
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const dir = useDirection(() => props.dir);
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<template>
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</ConfigProvider>
|
|
17
|
+
<ScrollAreaRoot
|
|
18
|
+
v-bind="delegatedProps"
|
|
19
|
+
:class="clsx('celeste-scroll-area', props.class)"
|
|
20
|
+
:dir="dir"
|
|
21
|
+
>
|
|
22
|
+
<ScrollAreaViewport class="celeste-scroll-area-viewport">
|
|
23
|
+
<slot />
|
|
24
|
+
</ScrollAreaViewport>
|
|
25
|
+
<ScrollBar />
|
|
26
|
+
<ScrollBar orientation="horizontal" />
|
|
27
|
+
<ScrollAreaCorner />
|
|
28
|
+
</ScrollAreaRoot>
|
|
30
29
|
</template>
|
|
31
30
|
|
|
32
31
|
<style scoped lang="scss">
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { ToggleGroupRootEmits, ToggleGroupRootProps } from 'reka-ui';
|
|
3
3
|
import type { HTMLAttributes } from 'vue';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import {
|
|
5
|
+
import { ToggleGroupRoot as SegmentedControlRoot, useForwardPropsEmits } from 'reka-ui';
|
|
6
6
|
import { useDelegatedProps } from '@/composables/use-delegated-props';
|
|
7
7
|
import { useDirection } from '@/composables/use-direction';
|
|
8
8
|
import { useTabObserver } from '@/composables/use-tab-observer';
|
|
@@ -13,31 +13,30 @@ const emits = defineEmits<ToggleGroupRootEmits>();
|
|
|
13
13
|
const delegatedProps = useDelegatedProps(props, 'class');
|
|
14
14
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const dir = useDirection(() => props.dir);
|
|
17
17
|
|
|
18
18
|
const { listRef, indicator, ready } = useTabObserver('[data-state="on"]');
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
21
|
<template>
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
</ConfigProvider>
|
|
22
|
+
<SegmentedControlRoot
|
|
23
|
+
ref="listRef"
|
|
24
|
+
:class="clsx('celeste-segmented-control', props.class)"
|
|
25
|
+
v-bind="forwarded"
|
|
26
|
+
type="single"
|
|
27
|
+
:dir="dir"
|
|
28
|
+
>
|
|
29
|
+
<slot />
|
|
30
|
+
<div
|
|
31
|
+
:hidden="!ready"
|
|
32
|
+
class="celeste-segmented-control-indicator"
|
|
33
|
+
:style="{
|
|
34
|
+
width: `${indicator.width}px`,
|
|
35
|
+
height: `${indicator.height}px`,
|
|
36
|
+
transform: `translate3d(${indicator.left}px, ${indicator.top}px, 0)`,
|
|
37
|
+
}"
|
|
38
|
+
/>
|
|
39
|
+
</SegmentedControlRoot>
|
|
41
40
|
</template>
|
|
42
41
|
|
|
43
42
|
<style scoped>
|
|
@@ -12,16 +12,17 @@ const emits = defineEmits<SelectRootEmits>();
|
|
|
12
12
|
const delegatedProps = useDelegatedProps(props, 'class');
|
|
13
13
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const dir = useDirection(() => props.dir);
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<template>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
<SelectRoot
|
|
20
|
+
v-bind="forwarded"
|
|
21
|
+
:class="clsx('celeste-select', props.class)"
|
|
22
|
+
:dir="dir"
|
|
23
|
+
>
|
|
24
|
+
<ConfigProvider :dir="dir">
|
|
24
25
|
<slot />
|
|
25
|
-
</
|
|
26
|
-
</
|
|
26
|
+
</ConfigProvider>
|
|
27
|
+
</SelectRoot>
|
|
27
28
|
</template>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { SliderRootEmits, SliderRootProps } from 'reka-ui';
|
|
3
3
|
import type { HTMLAttributes } from 'vue';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import {
|
|
5
|
+
import { SliderRange, SliderRoot, SliderThumb, SliderTrack, useForwardPropsEmits } from 'reka-ui';
|
|
6
6
|
import { useDelegatedProps } from '@/composables/use-delegated-props';
|
|
7
7
|
import { useDirection } from '@/composables/use-direction';
|
|
8
8
|
|
|
@@ -12,26 +12,25 @@ const emits = defineEmits<SliderRootEmits>();
|
|
|
12
12
|
const delegatedProps = useDelegatedProps(props, 'class');
|
|
13
13
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const dir = useDirection(() => props.dir);
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<template>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
<SliderRoot
|
|
20
|
+
v-bind="forwarded"
|
|
21
|
+
:class="clsx('celeste-slider', props.class)"
|
|
22
|
+
:dir="dir"
|
|
23
|
+
>
|
|
24
|
+
<SliderTrack class="celeste-slider-track">
|
|
25
|
+
<SliderRange class="celeste-slider-range" />
|
|
26
|
+
</SliderTrack>
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</ConfigProvider>
|
|
28
|
+
<SliderThumb
|
|
29
|
+
v-for="(_, key) in modelValue"
|
|
30
|
+
:key="key"
|
|
31
|
+
class="celeste-slider-thumb"
|
|
32
|
+
/>
|
|
33
|
+
</SliderRoot>
|
|
35
34
|
</template>
|
|
36
35
|
|
|
37
36
|
<style lang="scss">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { TabsRootEmits, TabsRootProps } from 'reka-ui';
|
|
3
|
-
import {
|
|
3
|
+
import { TabsRoot, useForwardPropsEmits } from 'reka-ui';
|
|
4
4
|
import { useDirection } from '@/composables/use-direction';
|
|
5
5
|
|
|
6
6
|
const props = defineProps<TabsRootProps>();
|
|
@@ -8,18 +8,17 @@ const emits = defineEmits<TabsRootEmits>();
|
|
|
8
8
|
|
|
9
9
|
const forwarded = useForwardPropsEmits(props, emits);
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const dir = useDirection(() => props.dir);
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<template>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</ConfigProvider>
|
|
15
|
+
<TabsRoot
|
|
16
|
+
v-bind="forwarded"
|
|
17
|
+
class="celeste-tab-menu-root"
|
|
18
|
+
:dir="dir"
|
|
19
|
+
>
|
|
20
|
+
<slot />
|
|
21
|
+
</TabsRoot>
|
|
23
22
|
</template>
|
|
24
23
|
|
|
25
24
|
<style scoped>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Direction } from 'reka-ui';
|
|
2
|
-
import type {
|
|
3
|
-
import { getCurrentInstance, onMounted, ref, watch } from 'vue';
|
|
2
|
+
import type { ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
3
|
+
import { computed, getCurrentInstance, onMounted, ref, toValue, watch } from 'vue';
|
|
4
4
|
|
|
5
5
|
const revision = ref(0);
|
|
6
6
|
|
|
@@ -18,9 +18,9 @@ function documentDirection(): Direction {
|
|
|
18
18
|
return typeof document !== 'undefined' && document.documentElement.dir === 'rtl' ? 'rtl' : 'ltr';
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export function useDirection():
|
|
21
|
+
export function useDirection(override?: MaybeRefOrGetter<Direction | undefined>): ComputedRef<Direction> {
|
|
22
22
|
const instance = getCurrentInstance();
|
|
23
|
-
const
|
|
23
|
+
const resolved = ref<Direction>(documentDirection());
|
|
24
24
|
|
|
25
25
|
observeDocument();
|
|
26
26
|
|
|
@@ -28,7 +28,7 @@ export function useDirection(): Ref<Direction> {
|
|
|
28
28
|
const node = instance?.vnode.el as Node | null | undefined;
|
|
29
29
|
const element = node instanceof HTMLElement ? node : node?.parentElement;
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
resolved.value = element
|
|
32
32
|
? getComputedStyle(element).direction === 'rtl' ? 'rtl' : 'ltr'
|
|
33
33
|
: documentDirection();
|
|
34
34
|
}
|
|
@@ -36,5 +36,5 @@ export function useDirection(): Ref<Direction> {
|
|
|
36
36
|
onMounted(read);
|
|
37
37
|
watch(revision, read);
|
|
38
38
|
|
|
39
|
-
return
|
|
39
|
+
return computed(() => toValue(override) ?? resolved.value);
|
|
40
40
|
}
|