@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
|
@@ -3,7 +3,6 @@ import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-hel
|
|
|
3
3
|
import { t as createContext } from "./createContext.js";
|
|
4
4
|
import { p as useVModel, s as useEventListener } from "./dist2.js";
|
|
5
5
|
import { t as Primitive } from "./Primitive.js";
|
|
6
|
-
import { t as ConfigProvider_default } from "./ConfigProvider.js";
|
|
7
6
|
import { a as handleCalendarInitialFocus, c as isBefore, d as toDate, f as $12a3c853105e5a70$export$ad991b66133851cf, g as $ad063034c8620db8$export$aa8b41735afcabd2, h as $ad063034c8620db8$export$a18c89cbd24170ff, i as getWeekStartsOn, l as isBetween, m as $ad063034c8620db8$export$91b62ebf2ba703ee, o as areAllDaysBetweenValid, p as $ad063034c8620db8$export$629b0a497aa65267, r as getDaysBetween, s as getDefaultDate, t as useCalendar, u as isBetweenInclusive, v as $ad063034c8620db8$export$ea39ec197993aef0 } from "./useCalendar.js";
|
|
8
7
|
import { t as useDirection } from "./useDirection.js";
|
|
9
8
|
import { t as useForwardPropsEmits } from "./useForwardPropsEmits.js";
|
|
@@ -1080,7 +1079,7 @@ var range_calendar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
1080
1079
|
const emits = __emit;
|
|
1081
1080
|
const delegatedProps = useDelegatedProps(props, ["class", "markedDates"]);
|
|
1082
1081
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
1083
|
-
const
|
|
1082
|
+
const dir = useDirection$1(() => props.dir);
|
|
1084
1083
|
const monthFormatter = computed(() => new $12a3c853105e5a70$export$ad991b66133851cf(props.locale ?? "en-US", {
|
|
1085
1084
|
month: "long",
|
|
1086
1085
|
year: "numeric"
|
|
@@ -1095,85 +1094,85 @@ var range_calendar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
1095
1094
|
return /^[a-z]/i.test(day.trim()) ? day.slice(0, 2) : day;
|
|
1096
1095
|
}
|
|
1097
1096
|
return (_ctx, _cache) => {
|
|
1098
|
-
return openBlock(), createBlock(unref(
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
}),
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
})
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
_: 2
|
|
1130
|
-
}, 1024);
|
|
1131
|
-
}), 128))]),
|
|
1132
|
-
_: 2
|
|
1133
|
-
}, 1024)]),
|
|
1134
|
-
_: 2
|
|
1135
|
-
}, 1024), createVNode(unref(RangeCalendarGridBody_default), { class: "celeste-range-calendar-body" }, {
|
|
1136
|
-
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(month.rows, (weekDates, index) => {
|
|
1137
|
-
return openBlock(), createBlock(unref(RangeCalendarGridRow_default), {
|
|
1138
|
-
key: `week-${index}`,
|
|
1139
|
-
class: "celeste-range-calendar-week"
|
|
1097
|
+
return openBlock(), createBlock(unref(RangeCalendarRoot_default), mergeProps(unref(forwarded), {
|
|
1098
|
+
class: unref(clsx)("celeste-range-calendar", props.class),
|
|
1099
|
+
dir: unref(dir)
|
|
1100
|
+
}), {
|
|
1101
|
+
default: withCtx(({ weekDays, grid }) => [createElementVNode("div", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(grid, (month) => {
|
|
1102
|
+
return openBlock(), createElementBlock("div", {
|
|
1103
|
+
key: month.value.toString(),
|
|
1104
|
+
class: "celeste-range-calendar-month"
|
|
1105
|
+
}, [createElementVNode("div", _hoisted_2, [
|
|
1106
|
+
createVNode(unref(RangeCalendarPrev_default), { "as-child": "" }, {
|
|
1107
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [createElementVNode("button", {
|
|
1108
|
+
type: "button",
|
|
1109
|
+
class: "celeste-range-calendar-nav"
|
|
1110
|
+
}, [createElementVNode("i", { class: "i-celeste-arrow-left-s-line" })], -1)])]),
|
|
1111
|
+
_: 1
|
|
1112
|
+
}),
|
|
1113
|
+
createElementVNode("span", _hoisted_3, toDisplayString(formatMonth(month.value)), 1),
|
|
1114
|
+
createVNode(unref(RangeCalendarNext_default), { "as-child": "" }, {
|
|
1115
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [createElementVNode("button", {
|
|
1116
|
+
type: "button",
|
|
1117
|
+
class: "celeste-range-calendar-nav"
|
|
1118
|
+
}, [createElementVNode("i", { class: "i-celeste-arrow-right-s-line" })], -1)])]),
|
|
1119
|
+
_: 1
|
|
1120
|
+
})
|
|
1121
|
+
]), createVNode(unref(RangeCalendarGrid_default), { class: "celeste-range-calendar-grid" }, {
|
|
1122
|
+
default: withCtx(() => [createVNode(unref(RangeCalendarGridHead_default), null, {
|
|
1123
|
+
default: withCtx(() => [createVNode(unref(RangeCalendarGridRow_default), { class: "celeste-range-calendar-week" }, {
|
|
1124
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(weekDays, (day) => {
|
|
1125
|
+
return openBlock(), createBlock(unref(RangeCalendarHeadCell_default), {
|
|
1126
|
+
key: day,
|
|
1127
|
+
class: "celeste-range-calendar-weekday"
|
|
1140
1128
|
}, {
|
|
1141
|
-
default: withCtx(() => [(
|
|
1142
|
-
return openBlock(), createBlock(unref(RangeCalendarCell_default), {
|
|
1143
|
-
key: weekDate.toString(),
|
|
1144
|
-
date: weekDate,
|
|
1145
|
-
class: "celeste-range-calendar-cell"
|
|
1146
|
-
}, {
|
|
1147
|
-
default: withCtx(() => [createVNode(unref(RangeCalendarCellTrigger_default), {
|
|
1148
|
-
day: weekDate,
|
|
1149
|
-
month: month.value,
|
|
1150
|
-
class: "celeste-range-calendar-day",
|
|
1151
|
-
"data-marked": isMarked(weekDate) ? "" : void 0
|
|
1152
|
-
}, {
|
|
1153
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_4, toDisplayString(weekDate.day), 1)]),
|
|
1154
|
-
_: 2
|
|
1155
|
-
}, 1032, [
|
|
1156
|
-
"day",
|
|
1157
|
-
"month",
|
|
1158
|
-
"data-marked"
|
|
1159
|
-
])]),
|
|
1160
|
-
_: 2
|
|
1161
|
-
}, 1032, ["date"]);
|
|
1162
|
-
}), 128))]),
|
|
1129
|
+
default: withCtx(() => [createTextVNode(toDisplayString(weekdayLabel(day)), 1)]),
|
|
1163
1130
|
_: 2
|
|
1164
1131
|
}, 1024);
|
|
1165
1132
|
}), 128))]),
|
|
1166
1133
|
_: 2
|
|
1167
1134
|
}, 1024)]),
|
|
1168
1135
|
_: 2
|
|
1169
|
-
}, 1024)
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1136
|
+
}, 1024), createVNode(unref(RangeCalendarGridBody_default), { class: "celeste-range-calendar-body" }, {
|
|
1137
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(month.rows, (weekDates, index) => {
|
|
1138
|
+
return openBlock(), createBlock(unref(RangeCalendarGridRow_default), {
|
|
1139
|
+
key: `week-${index}`,
|
|
1140
|
+
class: "celeste-range-calendar-week"
|
|
1141
|
+
}, {
|
|
1142
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(weekDates, (weekDate) => {
|
|
1143
|
+
return openBlock(), createBlock(unref(RangeCalendarCell_default), {
|
|
1144
|
+
key: weekDate.toString(),
|
|
1145
|
+
date: weekDate,
|
|
1146
|
+
class: "celeste-range-calendar-cell"
|
|
1147
|
+
}, {
|
|
1148
|
+
default: withCtx(() => [createVNode(unref(RangeCalendarCellTrigger_default), {
|
|
1149
|
+
day: weekDate,
|
|
1150
|
+
month: month.value,
|
|
1151
|
+
class: "celeste-range-calendar-day",
|
|
1152
|
+
"data-marked": isMarked(weekDate) ? "" : void 0
|
|
1153
|
+
}, {
|
|
1154
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_4, toDisplayString(weekDate.day), 1)]),
|
|
1155
|
+
_: 2
|
|
1156
|
+
}, 1032, [
|
|
1157
|
+
"day",
|
|
1158
|
+
"month",
|
|
1159
|
+
"data-marked"
|
|
1160
|
+
])]),
|
|
1161
|
+
_: 2
|
|
1162
|
+
}, 1032, ["date"]);
|
|
1163
|
+
}), 128))]),
|
|
1164
|
+
_: 2
|
|
1165
|
+
}, 1024);
|
|
1166
|
+
}), 128))]),
|
|
1167
|
+
_: 2
|
|
1168
|
+
}, 1024)]),
|
|
1169
|
+
_: 2
|
|
1170
|
+
}, 1024)]);
|
|
1171
|
+
}), 128))])]),
|
|
1173
1172
|
_: 1
|
|
1174
|
-
},
|
|
1173
|
+
}, 16, ["class", "dir"]);
|
|
1175
1174
|
};
|
|
1176
1175
|
}
|
|
1177
|
-
}), [["__scopeId", "data-v-
|
|
1176
|
+
}), [["__scopeId", "data-v-ebdaadb8"]]);
|
|
1178
1177
|
//#endregion
|
|
1179
1178
|
export { range_calendar_default as t };
|
|
@@ -2,7 +2,6 @@ import { t as clsx } from "./clsx.js";
|
|
|
2
2
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
3
3
|
import { d as useResizeObserver } from "./dist2.js";
|
|
4
4
|
import { t as Primitive } from "./Primitive.js";
|
|
5
|
-
import { t as ConfigProvider_default } from "./ConfigProvider.js";
|
|
6
5
|
import { t as useForwardExpose } from "./useForwardExpose.js";
|
|
7
6
|
import { t as useNonce } from "./useNonce.js";
|
|
8
7
|
import { n as ScrollAreaRoot_default, r as injectScrollAreaRootContext, t as scroll_bar_default } from "./scroll-bar.js";
|
|
@@ -161,25 +160,25 @@ var scroll_area_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
161
160
|
setup(__props) {
|
|
162
161
|
const props = __props;
|
|
163
162
|
const delegatedProps = useDelegatedProps(props, "class");
|
|
164
|
-
const
|
|
163
|
+
const dir = useDirection(() => props.dir);
|
|
165
164
|
return (_ctx, _cache) => {
|
|
166
|
-
return openBlock(), createBlock(unref(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}),
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
165
|
+
return openBlock(), createBlock(unref(ScrollAreaRoot_default), mergeProps(unref(delegatedProps), {
|
|
166
|
+
class: unref(clsx)("celeste-scroll-area", props.class),
|
|
167
|
+
dir: unref(dir)
|
|
168
|
+
}), {
|
|
169
|
+
default: withCtx(() => [
|
|
170
|
+
createVNode(unref(ScrollAreaViewport_default), { class: "celeste-scroll-area-viewport" }, {
|
|
171
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
|
|
172
|
+
_: 3
|
|
173
|
+
}),
|
|
174
|
+
createVNode(scroll_bar_default),
|
|
175
|
+
createVNode(scroll_bar_default, { orientation: "horizontal" }),
|
|
176
|
+
createVNode(unref(ScrollAreaCorner_default))
|
|
177
|
+
]),
|
|
179
178
|
_: 3
|
|
180
|
-
},
|
|
179
|
+
}, 16, ["class", "dir"]);
|
|
181
180
|
};
|
|
182
181
|
}
|
|
183
|
-
}), [["__scopeId", "data-v-
|
|
182
|
+
}), [["__scopeId", "data-v-0933ded6"]]);
|
|
184
183
|
//#endregion
|
|
185
184
|
export { scroll_area_default as t };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { t as clsx } from "./clsx.js";
|
|
2
2
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
3
|
-
import { t as ConfigProvider_default } from "./ConfigProvider.js";
|
|
4
3
|
import { t as useForwardPropsEmits } from "./useForwardPropsEmits.js";
|
|
5
4
|
import { t as ToggleGroupRoot_default } from "./ToggleGroupRoot.js";
|
|
6
5
|
import { useDelegatedProps } from "../use-delegated-props.js";
|
|
7
6
|
import { useDirection } from "../use-direction.js";
|
|
8
7
|
import { useTabObserver } from "../use-tab-observer.js";
|
|
9
|
-
import { createBlock, createElementVNode,
|
|
8
|
+
import { createBlock, createElementVNode, defineComponent, mergeProps, normalizeStyle, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
10
9
|
//#region src/components/segmented-control/segmented-control.vue?vue&type=script&setup=true&lang.ts
|
|
11
10
|
var _hoisted_1 = ["hidden"];
|
|
12
11
|
//#endregion
|
|
@@ -39,30 +38,30 @@ var segmented_control_default = /*#__PURE__*/ _plugin_vue_export_helper_default(
|
|
|
39
38
|
const emits = __emit;
|
|
40
39
|
const delegatedProps = useDelegatedProps(props, "class");
|
|
41
40
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
42
|
-
const
|
|
41
|
+
const dir = useDirection(() => props.dir);
|
|
43
42
|
const { listRef, indicator, ready } = useTabObserver("[data-state=\"on\"]");
|
|
44
43
|
return (_ctx, _cache) => {
|
|
45
|
-
return openBlock(), createBlock(unref(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
44
|
+
return openBlock(), createBlock(unref(ToggleGroupRoot_default), mergeProps({
|
|
45
|
+
ref_key: "listRef",
|
|
46
|
+
ref: listRef,
|
|
47
|
+
class: unref(clsx)("celeste-segmented-control", props.class)
|
|
48
|
+
}, unref(forwarded), {
|
|
49
|
+
type: "single",
|
|
50
|
+
dir: unref(dir)
|
|
51
|
+
}), {
|
|
52
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true), createElementVNode("div", {
|
|
53
|
+
hidden: !unref(ready),
|
|
54
|
+
class: "celeste-segmented-control-indicator",
|
|
55
|
+
style: normalizeStyle({
|
|
56
|
+
width: `${unref(indicator).width}px`,
|
|
57
|
+
height: `${unref(indicator).height}px`,
|
|
58
|
+
transform: `translate3d(${unref(indicator).left}px, ${unref(indicator).top}px, 0)`
|
|
59
|
+
})
|
|
60
|
+
}, null, 12, _hoisted_1)]),
|
|
62
61
|
_: 3
|
|
63
|
-
},
|
|
62
|
+
}, 16, ["class", "dir"]);
|
|
64
63
|
};
|
|
65
64
|
}
|
|
66
|
-
}), [["__scopeId", "data-v-
|
|
65
|
+
}), [["__scopeId", "data-v-e04f0e52"]]);
|
|
67
66
|
//#endregion
|
|
68
67
|
export { segmented_control_default as t };
|
package/dist/es/chunks/select.js
CHANGED
|
@@ -36,15 +36,18 @@ var select_default = /* @__PURE__ */ defineComponent({
|
|
|
36
36
|
const emits = __emit;
|
|
37
37
|
const delegatedProps = useDelegatedProps(props, "class");
|
|
38
38
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
39
|
-
const
|
|
39
|
+
const dir = useDirection(() => props.dir);
|
|
40
40
|
return (_ctx, _cache) => {
|
|
41
|
-
return openBlock(), createBlock(unref(
|
|
42
|
-
|
|
41
|
+
return openBlock(), createBlock(unref(SelectRoot_default), mergeProps(unref(forwarded), {
|
|
42
|
+
class: unref(clsx)("celeste-select", props.class),
|
|
43
|
+
dir: unref(dir)
|
|
44
|
+
}), {
|
|
45
|
+
default: withCtx(() => [createVNode(unref(ConfigProvider_default), { dir: unref(dir) }, {
|
|
43
46
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
44
47
|
_: 3
|
|
45
|
-
},
|
|
48
|
+
}, 8, ["dir"])]),
|
|
46
49
|
_: 3
|
|
47
|
-
},
|
|
50
|
+
}, 16, ["class", "dir"]);
|
|
48
51
|
};
|
|
49
52
|
}
|
|
50
53
|
});
|
package/dist/es/chunks/slider.js
CHANGED
|
@@ -3,7 +3,6 @@ import { t as clamp } from "./clamp.js";
|
|
|
3
3
|
import { t as createContext } from "./createContext.js";
|
|
4
4
|
import { l as useMounted, p as useVModel } from "./dist2.js";
|
|
5
5
|
import { t as Primitive } from "./Primitive.js";
|
|
6
|
-
import { t as ConfigProvider_default } from "./ConfigProvider.js";
|
|
7
6
|
import { t as useDirection } from "./useDirection.js";
|
|
8
7
|
import { t as useFormControl } from "./useFormControl.js";
|
|
9
8
|
import { t as useForwardExpose } from "./useForwardExpose.js";
|
|
@@ -786,23 +785,23 @@ var slider_default = /* @__PURE__ */ defineComponent({
|
|
|
786
785
|
const emits = __emit;
|
|
787
786
|
const delegatedProps = useDelegatedProps(props, "class");
|
|
788
787
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
789
|
-
const
|
|
788
|
+
const dir = useDirection$1(() => props.dir);
|
|
790
789
|
return (_ctx, _cache) => {
|
|
791
|
-
return openBlock(), createBlock(unref(
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
return openBlock(), createBlock(unref(SliderThumb_default), {
|
|
798
|
-
key,
|
|
799
|
-
class: "celeste-slider-thumb"
|
|
800
|
-
});
|
|
801
|
-
}), 128))]),
|
|
790
|
+
return openBlock(), createBlock(unref(SliderRoot_default), mergeProps(unref(forwarded), {
|
|
791
|
+
class: unref(clsx)("celeste-slider", props.class),
|
|
792
|
+
dir: unref(dir)
|
|
793
|
+
}), {
|
|
794
|
+
default: withCtx(() => [createVNode(unref(SliderTrack_default), { class: "celeste-slider-track" }, {
|
|
795
|
+
default: withCtx(() => [createVNode(unref(SliderRange_default), { class: "celeste-slider-range" })]),
|
|
802
796
|
_: 1
|
|
803
|
-
},
|
|
797
|
+
}), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.modelValue, (_, key) => {
|
|
798
|
+
return openBlock(), createBlock(unref(SliderThumb_default), {
|
|
799
|
+
key,
|
|
800
|
+
class: "celeste-slider-thumb"
|
|
801
|
+
});
|
|
802
|
+
}), 128))]),
|
|
804
803
|
_: 1
|
|
805
|
-
},
|
|
804
|
+
}, 16, ["class", "dir"]);
|
|
806
805
|
};
|
|
807
806
|
}
|
|
808
807
|
});
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
2
|
-
import { t as ConfigProvider_default } from "./ConfigProvider.js";
|
|
3
2
|
import { t as useForwardPropsEmits } from "./useForwardPropsEmits.js";
|
|
4
3
|
import { t as TabsRoot_default } from "./TabsRoot.js";
|
|
5
4
|
import { useDirection } from "../use-direction.js";
|
|
6
|
-
import { createBlock,
|
|
5
|
+
import { createBlock, defineComponent, mergeProps, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
7
6
|
//#endregion
|
|
8
7
|
//#region src/components/tab-menu/tab-menu.vue
|
|
9
8
|
var tab_menu_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -22,17 +21,17 @@ var tab_menu_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
22
21
|
setup(__props, { emit: __emit }) {
|
|
23
22
|
const props = __props;
|
|
24
23
|
const forwarded = useForwardPropsEmits(props, __emit);
|
|
25
|
-
const
|
|
24
|
+
const dir = useDirection(() => props.dir);
|
|
26
25
|
return (_ctx, _cache) => {
|
|
27
|
-
return openBlock(), createBlock(unref(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
26
|
+
return openBlock(), createBlock(unref(TabsRoot_default), mergeProps(unref(forwarded), {
|
|
27
|
+
class: "celeste-tab-menu-root",
|
|
28
|
+
dir: unref(dir)
|
|
29
|
+
}), {
|
|
30
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
|
|
32
31
|
_: 3
|
|
33
|
-
},
|
|
32
|
+
}, 16, ["dir"]);
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
|
-
}), [["__scopeId", "data-v-
|
|
35
|
+
}), [["__scopeId", "data-v-0965db3b"]]);
|
|
37
36
|
//#endregion
|
|
38
37
|
export { tab_menu_default as t };
|
package/dist/es/command-root.js
CHANGED
|
@@ -51,15 +51,18 @@ var command_root_default = /* @__PURE__ */ defineComponent({
|
|
|
51
51
|
return delegated;
|
|
52
52
|
});
|
|
53
53
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
54
|
-
const
|
|
54
|
+
const dir = useDirection(() => props.dir);
|
|
55
55
|
return (_ctx, _cache) => {
|
|
56
|
-
return openBlock(), createBlock(unref(
|
|
57
|
-
|
|
56
|
+
return openBlock(), createBlock(unref(ComboboxRoot_default), mergeProps(unref(forwarded), {
|
|
57
|
+
class: ["celeste-command-root", props.class],
|
|
58
|
+
dir: unref(dir)
|
|
59
|
+
}), {
|
|
60
|
+
default: withCtx(() => [createVNode(unref(ConfigProvider_default), { dir: unref(dir) }, {
|
|
58
61
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
59
62
|
_: 3
|
|
60
|
-
},
|
|
63
|
+
}, 8, ["dir"])]),
|
|
61
64
|
_: 3
|
|
62
|
-
},
|
|
65
|
+
}, 16, ["class", "dir"]);
|
|
63
66
|
};
|
|
64
67
|
}
|
|
65
68
|
});
|
package/dist/es/use-direction.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCurrentInstance, onMounted, ref, watch } from "vue";
|
|
1
|
+
import { computed, getCurrentInstance, onMounted, ref, toValue, watch } from "vue";
|
|
2
2
|
//#region src/composables/use-direction.ts
|
|
3
3
|
var revision = ref(0);
|
|
4
4
|
var observer;
|
|
@@ -13,18 +13,18 @@ function observeDocument() {
|
|
|
13
13
|
function documentDirection() {
|
|
14
14
|
return typeof document !== "undefined" && document.documentElement.dir === "rtl" ? "rtl" : "ltr";
|
|
15
15
|
}
|
|
16
|
-
function useDirection() {
|
|
16
|
+
function useDirection(override) {
|
|
17
17
|
const instance = getCurrentInstance();
|
|
18
|
-
const
|
|
18
|
+
const resolved = ref(documentDirection());
|
|
19
19
|
observeDocument();
|
|
20
20
|
function read() {
|
|
21
21
|
const node = instance?.vnode.el;
|
|
22
22
|
const element = node instanceof HTMLElement ? node : node?.parentElement;
|
|
23
|
-
|
|
23
|
+
resolved.value = element ? getComputedStyle(element).direction === "rtl" ? "rtl" : "ltr" : documentDirection();
|
|
24
24
|
}
|
|
25
25
|
onMounted(read);
|
|
26
26
|
watch(revision, read);
|
|
27
|
-
return
|
|
27
|
+
return computed(() => toValue(override) ?? resolved.value);
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
30
|
export { useDirection };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youcan/celeste",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.1",
|
|
5
5
|
"author": "YouCan <tech@youcan.shop>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"reka-ui": "^2.10.1",
|
|
53
53
|
"tinycolor2": "^1.6.0",
|
|
54
54
|
"vue-sonner": "^2.0.9",
|
|
55
|
-
"@youcan/celeste-icons": "0.13.
|
|
56
|
-
"@youcan/celeste-tokens": "0.13.
|
|
55
|
+
"@youcan/celeste-icons": "0.13.1",
|
|
56
|
+
"@youcan/celeste-tokens": "0.13.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@chromatic-com/storybook": "^5.3.0",
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
CalendarNext,
|
|
16
16
|
CalendarPrev,
|
|
17
17
|
CalendarRoot,
|
|
18
|
-
ConfigProvider,
|
|
19
18
|
useForwardPropsEmits,
|
|
20
19
|
} from 'reka-ui';
|
|
21
20
|
import { useDelegatedProps } from '@/composables/use-delegated-props';
|
|
@@ -37,7 +36,7 @@ const emits = defineEmits<CalendarRootEmits>();
|
|
|
37
36
|
const delegatedProps = useDelegatedProps(props, ['class', 'markedDates']);
|
|
38
37
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
39
38
|
|
|
40
|
-
const
|
|
39
|
+
const dir = useDirection(() => props.dir);
|
|
41
40
|
|
|
42
41
|
function isMarked(date: DateValue): boolean {
|
|
43
42
|
return props.markedDates?.some(marked => isEqualDay(marked, date)) ?? false;
|
|
@@ -49,70 +48,69 @@ function weekdayLabel(day: string): string {
|
|
|
49
48
|
</script>
|
|
50
49
|
|
|
51
50
|
<template>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
51
|
+
<CalendarRoot
|
|
52
|
+
v-slot="{ weekDays, grid }"
|
|
53
|
+
v-bind="forwarded"
|
|
54
|
+
:class="clsx('celeste-calendar', props.class)"
|
|
55
|
+
:dir="dir"
|
|
56
|
+
>
|
|
57
|
+
<div class="celeste-calendar-header">
|
|
58
|
+
<CalendarPrev as-child>
|
|
59
|
+
<button type="button" class="celeste-calendar-nav">
|
|
60
|
+
<i class="i-celeste-arrow-left-s-line" />
|
|
61
|
+
</button>
|
|
62
|
+
</CalendarPrev>
|
|
63
|
+
<CalendarHeading class="celeste-calendar-heading" />
|
|
64
|
+
<CalendarNext as-child>
|
|
65
|
+
<button type="button" class="celeste-calendar-nav">
|
|
66
|
+
<i class="i-celeste-arrow-right-s-line" />
|
|
67
|
+
</button>
|
|
68
|
+
</CalendarNext>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<div class="celeste-calendar-months">
|
|
72
|
+
<CalendarGrid
|
|
73
|
+
v-for="month in grid"
|
|
74
|
+
:key="month.value.toString()"
|
|
75
|
+
class="celeste-calendar-grid"
|
|
76
|
+
>
|
|
77
|
+
<CalendarGridHead>
|
|
78
|
+
<CalendarGridRow class="celeste-calendar-week">
|
|
79
|
+
<CalendarHeadCell
|
|
80
|
+
v-for="day in weekDays"
|
|
81
|
+
:key="day"
|
|
82
|
+
class="celeste-calendar-weekday"
|
|
83
|
+
>
|
|
84
|
+
{{ weekdayLabel(day) }}
|
|
85
|
+
</CalendarHeadCell>
|
|
86
|
+
</CalendarGridRow>
|
|
87
|
+
</CalendarGridHead>
|
|
88
|
+
<CalendarGridBody class="celeste-calendar-body">
|
|
89
|
+
<CalendarGridRow
|
|
90
|
+
v-for="(weekDates, index) in month.rows"
|
|
91
|
+
:key="`week-${index}`"
|
|
92
|
+
class="celeste-calendar-week"
|
|
93
|
+
>
|
|
94
|
+
<CalendarCell
|
|
95
|
+
v-for="weekDate in weekDates"
|
|
96
|
+
:key="weekDate.toString()"
|
|
97
|
+
:date="weekDate"
|
|
98
|
+
class="celeste-calendar-cell"
|
|
94
99
|
>
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
<CalendarCellTrigger
|
|
101
|
+
:day="weekDate"
|
|
102
|
+
:month="month.value"
|
|
103
|
+
class="celeste-calendar-day"
|
|
104
|
+
:data-marked="isMarked(weekDate) ? '' : undefined"
|
|
100
105
|
>
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
</CalendarCell>
|
|
110
|
-
</CalendarGridRow>
|
|
111
|
-
</CalendarGridBody>
|
|
112
|
-
</CalendarGrid>
|
|
113
|
-
</div>
|
|
114
|
-
</CalendarRoot>
|
|
115
|
-
</ConfigProvider>
|
|
106
|
+
<span class="celeste-calendar-day-number">{{ weekDate.day }}</span>
|
|
107
|
+
</CalendarCellTrigger>
|
|
108
|
+
</CalendarCell>
|
|
109
|
+
</CalendarGridRow>
|
|
110
|
+
</CalendarGridBody>
|
|
111
|
+
</CalendarGrid>
|
|
112
|
+
</div>
|
|
113
|
+
</CalendarRoot>
|
|
116
114
|
</template>
|
|
117
115
|
|
|
118
116
|
<style scoped lang="scss">
|