@youcan/celeste 0.7.3 → 0.9.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.
Files changed (69) hide show
  1. package/dist/celeste.css +465 -0
  2. package/dist/cjs/calendar.cjs +2 -0
  3. package/dist/cjs/chunks/ComboboxContent.cjs +1 -1
  4. package/dist/cjs/chunks/DialogPortal.cjs +1 -1
  5. package/dist/cjs/chunks/DismissableLayer.cjs +0 -34
  6. package/dist/cjs/chunks/FocusScope.cjs +2 -2
  7. package/dist/cjs/chunks/MenuContentImpl.cjs +1 -1
  8. package/dist/cjs/chunks/SelectItemAlignedPosition.cjs +1 -1
  9. package/dist/cjs/chunks/calendar.cjs +923 -0
  10. package/dist/cjs/chunks/components.cjs +9 -1
  11. package/dist/cjs/chunks/counter-input.cjs +2 -13
  12. package/dist/cjs/chunks/date-picker.cjs +99 -0
  13. package/dist/cjs/chunks/defu.cjs +34 -0
  14. package/dist/cjs/chunks/popover-content.cjs +1 -1
  15. package/dist/cjs/chunks/range-calendar.cjs +1170 -0
  16. package/dist/cjs/chunks/range-picker.cjs +231 -0
  17. package/dist/cjs/chunks/tooltip-content.cjs +3 -2
  18. package/dist/cjs/chunks/useCalendar.cjs +2439 -0
  19. package/dist/cjs/chunks/useLocale.cjs +20 -0
  20. package/dist/cjs/date-picker.cjs +2 -0
  21. package/dist/cjs/index.cjs +9 -1
  22. package/dist/cjs/range-calendar.cjs +2 -0
  23. package/dist/cjs/range-picker.cjs +2 -0
  24. package/dist/components/calendar/calendar.d.ts +19 -0
  25. package/dist/components/calendar/index.d.ts +2 -0
  26. package/dist/components/date-picker/date-picker.d.ts +27 -0
  27. package/dist/components/date-picker/index.d.ts +2 -0
  28. package/dist/components/index.d.ts +4 -0
  29. package/dist/components/range-calendar/index.d.ts +2 -0
  30. package/dist/components/range-calendar/range-calendar.d.ts +24 -0
  31. package/dist/components/range-picker/index.d.ts +2 -0
  32. package/dist/components/range-picker/range-picker.d.ts +38 -0
  33. package/dist/components/rich-editor/rich-editor.d.ts +1 -1
  34. package/dist/es/calendar.js +2 -0
  35. package/dist/es/chunks/ComboboxContent.js +1 -1
  36. package/dist/es/chunks/DialogPortal.js +1 -1
  37. package/dist/es/chunks/DismissableLayer.js +1 -29
  38. package/dist/es/chunks/FocusScope.js +1 -1
  39. package/dist/es/chunks/MenuContentImpl.js +1 -1
  40. package/dist/es/chunks/SelectItemAlignedPosition.js +1 -1
  41. package/dist/es/chunks/calendar.js +916 -0
  42. package/dist/es/chunks/components.js +9 -1
  43. package/dist/es/chunks/counter-input.js +1 -12
  44. package/dist/es/chunks/date-picker.js +92 -0
  45. package/dist/es/chunks/defu.js +29 -0
  46. package/dist/es/chunks/popover-content.js +1 -1
  47. package/dist/es/chunks/range-calendar.js +1163 -0
  48. package/dist/es/chunks/range-picker.js +224 -0
  49. package/dist/es/chunks/tooltip-content.js +2 -1
  50. package/dist/es/chunks/useCalendar.js +2331 -0
  51. package/dist/es/chunks/useLocale.js +14 -0
  52. package/dist/es/date-picker.js +2 -0
  53. package/dist/es/index.js +6 -2
  54. package/dist/es/range-calendar.js +2 -0
  55. package/dist/es/range-picker.js +2 -0
  56. package/package.json +5 -3
  57. package/src/components/calendar/calendar.vue +305 -0
  58. package/src/components/calendar/index.ts +2 -0
  59. package/src/components/calendar/stories/calendar.stories.ts +76 -0
  60. package/src/components/date-picker/date-picker.vue +91 -0
  61. package/src/components/date-picker/index.ts +2 -0
  62. package/src/components/date-picker/stories/date-picker.stories.ts +92 -0
  63. package/src/components/index.ts +4 -0
  64. package/src/components/range-calendar/index.ts +2 -0
  65. package/src/components/range-calendar/range-calendar.vue +363 -0
  66. package/src/components/range-calendar/stories/range-calendar.stories.ts +46 -0
  67. package/src/components/range-picker/index.ts +2 -0
  68. package/src/components/range-picker/range-picker.vue +237 -0
  69. package/src/components/range-picker/stories/range-picker.stories.ts +97 -0
@@ -0,0 +1,916 @@
1
+ import { t as clsx } from "./clsx.js";
2
+ import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
3
+ import { t as createContext } from "./createContext.js";
4
+ import { s as useVModel } from "./dist.js";
5
+ import { t as Primitive } from "./Primitive.js";
6
+ import { a as handleCalendarInitialFocus, d as toDate, g as $14e0f24ef4ac5c92$export$aa8b41735afcabd2, h as $14e0f24ef4ac5c92$export$a18c89cbd24170ff, i as getWeekStartsOn, m as $14e0f24ef4ac5c92$export$91b62ebf2ba703ee, n as useCalendarState, p as $14e0f24ef4ac5c92$export$629b0a497aa65267, s as getDefaultDate, t as useCalendar, v as $14e0f24ef4ac5c92$export$ea39ec197993aef0 } from "./useCalendar.js";
7
+ import { t as useDirection } from "./useDirection.js";
8
+ import { t as useForwardPropsEmits } from "./useForwardPropsEmits.js";
9
+ import { t as useKbd } from "./useKbd.js";
10
+ import { t as useLocale } from "./useLocale.js";
11
+ import { t as usePrimitiveElement } from "./usePrimitiveElement.js";
12
+ import { useDelegatedProps } from "../use-delegated-props.js";
13
+ import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeProps, onMounted, openBlock, renderList, renderSlot, toDisplayString, toRefs, unref, watch, withCtx, withKeys } from "vue";
14
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/Calendar/CalendarRoot.js
15
+ var _hoisted_1$1 = { style: {
16
+ "border": "0px",
17
+ "clip": "rect(0px, 0px, 0px, 0px)",
18
+ "clip-path": "inset(50%)",
19
+ "height": "1px",
20
+ "margin": "-1px",
21
+ "overflow": "hidden",
22
+ "padding": "0px",
23
+ "position": "absolute",
24
+ "white-space": "nowrap",
25
+ "width": "1px"
26
+ } };
27
+ var _hoisted_2$1 = {
28
+ role: "heading",
29
+ "aria-level": "2"
30
+ };
31
+ var [injectCalendarRootContext, provideCalendarRootContext] = /* @__PURE__ */ createContext("CalendarRoot");
32
+ var CalendarRoot_default = /* @__PURE__ */ defineComponent({
33
+ __name: "CalendarRoot",
34
+ props: {
35
+ defaultValue: {
36
+ type: null,
37
+ required: false,
38
+ default: void 0
39
+ },
40
+ defaultPlaceholder: {
41
+ type: null,
42
+ required: false
43
+ },
44
+ placeholder: {
45
+ type: null,
46
+ required: false,
47
+ default: void 0
48
+ },
49
+ pagedNavigation: {
50
+ type: Boolean,
51
+ required: false,
52
+ default: false
53
+ },
54
+ preventDeselect: {
55
+ type: Boolean,
56
+ required: false,
57
+ default: false
58
+ },
59
+ weekStartsOn: {
60
+ type: Number,
61
+ required: false
62
+ },
63
+ weekdayFormat: {
64
+ type: String,
65
+ required: false,
66
+ default: "narrow"
67
+ },
68
+ calendarLabel: {
69
+ type: String,
70
+ required: false
71
+ },
72
+ fixedWeeks: {
73
+ type: Boolean,
74
+ required: false,
75
+ default: false
76
+ },
77
+ maxValue: {
78
+ type: null,
79
+ required: false
80
+ },
81
+ minValue: {
82
+ type: null,
83
+ required: false
84
+ },
85
+ locale: {
86
+ type: String,
87
+ required: false
88
+ },
89
+ numberOfMonths: {
90
+ type: Number,
91
+ required: false,
92
+ default: 1
93
+ },
94
+ disabled: {
95
+ type: Boolean,
96
+ required: false,
97
+ default: false
98
+ },
99
+ readonly: {
100
+ type: Boolean,
101
+ required: false,
102
+ default: false
103
+ },
104
+ initialFocus: {
105
+ type: Boolean,
106
+ required: false,
107
+ default: false
108
+ },
109
+ isDateDisabled: {
110
+ type: Function,
111
+ required: false,
112
+ default: void 0
113
+ },
114
+ isDateUnavailable: {
115
+ type: Function,
116
+ required: false,
117
+ default: void 0
118
+ },
119
+ dir: {
120
+ type: String,
121
+ required: false
122
+ },
123
+ nextPage: {
124
+ type: Function,
125
+ required: false
126
+ },
127
+ prevPage: {
128
+ type: Function,
129
+ required: false
130
+ },
131
+ modelValue: {
132
+ type: null,
133
+ required: false
134
+ },
135
+ multiple: {
136
+ type: Boolean,
137
+ required: false,
138
+ default: false
139
+ },
140
+ disableDaysOutsideCurrentView: {
141
+ type: Boolean,
142
+ required: false,
143
+ default: false
144
+ },
145
+ asChild: {
146
+ type: Boolean,
147
+ required: false
148
+ },
149
+ as: {
150
+ type: null,
151
+ required: false,
152
+ default: "div"
153
+ }
154
+ },
155
+ emits: ["update:modelValue", "update:placeholder"],
156
+ setup(__props, { emit: __emit }) {
157
+ const props = __props;
158
+ const emits = __emit;
159
+ const { disabled, readonly, initialFocus, pagedNavigation, weekdayFormat, fixedWeeks, multiple, minValue, maxValue, numberOfMonths, preventDeselect, isDateDisabled: propsIsDateDisabled, isDateUnavailable: propsIsDateUnavailable, calendarLabel, defaultValue, nextPage: propsNextPage, prevPage: propsPrevPage, dir: propDir, locale: propLocale, disableDaysOutsideCurrentView } = toRefs(props);
160
+ const { primitiveElement, currentElement: parentElement } = usePrimitiveElement();
161
+ const locale = useLocale(propLocale);
162
+ const dir = useDirection(propDir);
163
+ const weekStartsOn = computed(() => props.weekStartsOn ?? getWeekStartsOn(locale.value));
164
+ const modelValue = useVModel(props, "modelValue", emits, {
165
+ defaultValue: defaultValue.value,
166
+ passive: props.modelValue === void 0
167
+ });
168
+ const defaultDate = getDefaultDate({
169
+ defaultPlaceholder: props.placeholder,
170
+ defaultValue: modelValue.value,
171
+ locale: props.locale
172
+ });
173
+ const placeholder = useVModel(props, "placeholder", emits, {
174
+ defaultValue: props.defaultPlaceholder ?? defaultDate.copy(),
175
+ passive: props.placeholder === void 0
176
+ });
177
+ function onPlaceholderChange(value) {
178
+ placeholder.value = value.copy();
179
+ }
180
+ const { fullCalendarLabel, headingValue, isDateDisabled, isDateUnavailable, isNextButtonDisabled, isPrevButtonDisabled, weekdays, isOutsideVisibleView, nextPage, prevPage, formatter, grid, isPlaceholderFocusable, firstFocusableDate } = useCalendar({
181
+ locale,
182
+ placeholder,
183
+ weekStartsOn,
184
+ fixedWeeks,
185
+ numberOfMonths,
186
+ minValue,
187
+ maxValue,
188
+ disabled,
189
+ weekdayFormat,
190
+ pagedNavigation,
191
+ isDateDisabled: propsIsDateDisabled.value,
192
+ isDateUnavailable: propsIsDateUnavailable.value,
193
+ calendarLabel,
194
+ nextPage: propsNextPage,
195
+ prevPage: propsPrevPage
196
+ });
197
+ const { isInvalid, isDateSelected, hasSelectedDate, isSelectedDateDisabled } = useCalendarState({
198
+ date: modelValue,
199
+ isDateDisabled,
200
+ isDateUnavailable
201
+ });
202
+ watch(modelValue, (_modelValue) => {
203
+ if (Array.isArray(_modelValue) && _modelValue.length) {
204
+ const lastValue = _modelValue.at(-1);
205
+ if (lastValue && !$14e0f24ef4ac5c92$export$91b62ebf2ba703ee(placeholder.value, lastValue)) onPlaceholderChange(lastValue);
206
+ } else if (!Array.isArray(_modelValue) && _modelValue && !$14e0f24ef4ac5c92$export$91b62ebf2ba703ee(placeholder.value, _modelValue)) onPlaceholderChange(_modelValue);
207
+ });
208
+ function onDateChange(value) {
209
+ if (!multiple.value) {
210
+ if (!modelValue.value) {
211
+ modelValue.value = value.copy();
212
+ return;
213
+ }
214
+ if (!preventDeselect.value && $14e0f24ef4ac5c92$export$91b62ebf2ba703ee(modelValue.value, value)) {
215
+ placeholder.value = value.copy();
216
+ modelValue.value = void 0;
217
+ } else modelValue.value = value.copy();
218
+ } else if (!modelValue.value) modelValue.value = [value.copy()];
219
+ else if (Array.isArray(modelValue.value)) {
220
+ if (modelValue.value.findIndex((date) => $14e0f24ef4ac5c92$export$ea39ec197993aef0(date, value)) === -1) modelValue.value = [...modelValue.value, value];
221
+ else if (!preventDeselect.value) {
222
+ const next = modelValue.value.filter((date) => !$14e0f24ef4ac5c92$export$ea39ec197993aef0(date, value));
223
+ if (!next.length) {
224
+ placeholder.value = value.copy();
225
+ modelValue.value = void 0;
226
+ return;
227
+ }
228
+ modelValue.value = next.map((date) => date.copy());
229
+ }
230
+ }
231
+ }
232
+ onMounted(() => {
233
+ if (initialFocus.value) handleCalendarInitialFocus(parentElement.value);
234
+ });
235
+ provideCalendarRootContext({
236
+ isDateUnavailable,
237
+ dir,
238
+ isDateDisabled,
239
+ locale,
240
+ formatter,
241
+ modelValue,
242
+ placeholder,
243
+ disabled,
244
+ initialFocus,
245
+ pagedNavigation,
246
+ grid,
247
+ weekDays: weekdays,
248
+ weekStartsOn,
249
+ weekdayFormat,
250
+ fixedWeeks,
251
+ multiple,
252
+ numberOfMonths,
253
+ readonly,
254
+ preventDeselect,
255
+ fullCalendarLabel,
256
+ headingValue,
257
+ isInvalid,
258
+ isDateSelected,
259
+ isNextButtonDisabled,
260
+ isPrevButtonDisabled,
261
+ isOutsideVisibleView,
262
+ nextPage,
263
+ prevPage,
264
+ parentElement,
265
+ onPlaceholderChange,
266
+ onDateChange,
267
+ disableDaysOutsideCurrentView,
268
+ minValue,
269
+ maxValue,
270
+ isPlaceholderFocusable,
271
+ firstFocusableDate,
272
+ hasSelectedDate,
273
+ isSelectedDateDisabled
274
+ });
275
+ return (_ctx, _cache) => {
276
+ return openBlock(), createBlock(unref(Primitive), {
277
+ ref_key: "primitiveElement",
278
+ ref: primitiveElement,
279
+ as: _ctx.as,
280
+ "as-child": _ctx.asChild,
281
+ "aria-label": unref(fullCalendarLabel),
282
+ "data-readonly": unref(readonly) ? "" : void 0,
283
+ "data-disabled": unref(disabled) ? "" : void 0,
284
+ "data-invalid": unref(isInvalid) ? "" : void 0,
285
+ dir: unref(dir)
286
+ }, {
287
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", {
288
+ date: unref(placeholder),
289
+ grid: unref(grid),
290
+ weekDays: unref(weekdays),
291
+ weekStartsOn: weekStartsOn.value,
292
+ locale: unref(locale),
293
+ fixedWeeks: unref(fixedWeeks),
294
+ modelValue: unref(modelValue)
295
+ }), createElementVNode("div", _hoisted_1$1, [createElementVNode("div", _hoisted_2$1, toDisplayString(unref(fullCalendarLabel)), 1)])]),
296
+ _: 3
297
+ }, 8, [
298
+ "as",
299
+ "as-child",
300
+ "aria-label",
301
+ "data-readonly",
302
+ "data-disabled",
303
+ "data-invalid",
304
+ "dir"
305
+ ]);
306
+ };
307
+ }
308
+ });
309
+ //#endregion
310
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/Calendar/CalendarCell.js
311
+ var CalendarCell_default = /* @__PURE__ */ defineComponent({
312
+ __name: "CalendarCell",
313
+ props: {
314
+ date: {
315
+ type: null,
316
+ required: true
317
+ },
318
+ asChild: {
319
+ type: Boolean,
320
+ required: false
321
+ },
322
+ as: {
323
+ type: null,
324
+ required: false,
325
+ default: "td"
326
+ }
327
+ },
328
+ setup(__props) {
329
+ const rootContext = injectCalendarRootContext();
330
+ return (_ctx, _cache) => {
331
+ return openBlock(), createBlock(unref(Primitive), {
332
+ as: _ctx.as,
333
+ "as-child": _ctx.asChild,
334
+ role: "gridcell",
335
+ "aria-selected": unref(rootContext).isDateSelected(_ctx.date) ? true : void 0,
336
+ "aria-disabled": unref(rootContext).isDateDisabled(_ctx.date) || unref(rootContext).isDateUnavailable?.(_ctx.date) || unref(rootContext).disableDaysOutsideCurrentView.value,
337
+ "data-disabled": unref(rootContext).isDateDisabled(_ctx.date) || unref(rootContext).disableDaysOutsideCurrentView.value ? "" : void 0
338
+ }, {
339
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
340
+ _: 3
341
+ }, 8, [
342
+ "as",
343
+ "as-child",
344
+ "aria-selected",
345
+ "aria-disabled",
346
+ "data-disabled"
347
+ ]);
348
+ };
349
+ }
350
+ });
351
+ //#endregion
352
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/Calendar/CalendarCellTrigger.js
353
+ var CalendarCellTrigger_default = /* @__PURE__ */ defineComponent({
354
+ __name: "CalendarCellTrigger",
355
+ props: {
356
+ day: {
357
+ type: null,
358
+ required: true
359
+ },
360
+ month: {
361
+ type: null,
362
+ required: true
363
+ },
364
+ asChild: {
365
+ type: Boolean,
366
+ required: false
367
+ },
368
+ as: {
369
+ type: null,
370
+ required: false,
371
+ default: "div"
372
+ }
373
+ },
374
+ setup(__props) {
375
+ const props = __props;
376
+ const kbd = useKbd();
377
+ const rootContext = injectCalendarRootContext();
378
+ const { primitiveElement, currentElement } = usePrimitiveElement();
379
+ const dayValue = computed(() => props.day.day.toLocaleString(rootContext.locale.value));
380
+ const labelText = computed(() => {
381
+ return rootContext.formatter.custom(toDate(props.day), {
382
+ weekday: "long",
383
+ month: "long",
384
+ day: "numeric",
385
+ year: "numeric"
386
+ });
387
+ });
388
+ const isUnavailable = computed(() => rootContext.isDateUnavailable?.(props.day) ?? false);
389
+ const isDateToday = computed(() => {
390
+ return $14e0f24ef4ac5c92$export$629b0a497aa65267(props.day, $14e0f24ef4ac5c92$export$aa8b41735afcabd2());
391
+ });
392
+ const isOutsideView = computed(() => {
393
+ return !$14e0f24ef4ac5c92$export$a18c89cbd24170ff(props.day, props.month);
394
+ });
395
+ const isOutsideVisibleView = computed(() => rootContext.isOutsideVisibleView(props.day));
396
+ const isDisabled = computed(() => rootContext.isDateDisabled(props.day) || rootContext.disableDaysOutsideCurrentView.value && isOutsideView.value);
397
+ const isFocusedDate = computed(() => {
398
+ if (isOutsideView.value || isDisabled.value) return false;
399
+ if (!rootContext.disabled.value && rootContext.isPlaceholderFocusable.value && $14e0f24ef4ac5c92$export$ea39ec197993aef0(props.day, rootContext.placeholder.value)) return true;
400
+ if ((!rootContext.hasSelectedDate.value || rootContext.isSelectedDateDisabled.value) && !rootContext.isPlaceholderFocusable.value) return rootContext.firstFocusableDate.value && $14e0f24ef4ac5c92$export$ea39ec197993aef0(props.day, rootContext.firstFocusableDate.value);
401
+ return false;
402
+ });
403
+ const isSelectedDate = computed(() => rootContext.isDateSelected(props.day));
404
+ function changeDate(date) {
405
+ if (rootContext.readonly.value) return;
406
+ if (rootContext.isDateDisabled(date) || rootContext.isDateUnavailable?.(date)) return;
407
+ rootContext.onDateChange(date);
408
+ }
409
+ function handleClick() {
410
+ if (isDisabled.value) return;
411
+ changeDate(props.day);
412
+ }
413
+ function handleArrowKey(e) {
414
+ if (isDisabled.value) return;
415
+ if ((e.code === kbd.ENTER || e.code === kbd.SPACE_CODE) && (e.ctrlKey || e.metaKey || e.altKey)) return;
416
+ e.preventDefault();
417
+ e.stopPropagation();
418
+ const parentElement = rootContext.parentElement.value;
419
+ const indexIncrementation = 7;
420
+ const sign = rootContext.dir.value === "rtl" ? -1 : 1;
421
+ switch (e.code) {
422
+ case kbd.ARROW_RIGHT:
423
+ shiftFocus(props.day, sign);
424
+ break;
425
+ case kbd.ARROW_LEFT:
426
+ shiftFocus(props.day, -sign);
427
+ break;
428
+ case kbd.ARROW_UP:
429
+ shiftFocus(props.day, -indexIncrementation);
430
+ break;
431
+ case kbd.ARROW_DOWN:
432
+ shiftFocus(props.day, indexIncrementation);
433
+ break;
434
+ case kbd.ENTER:
435
+ case kbd.SPACE_CODE: changeDate(props.day);
436
+ }
437
+ function shiftFocus(day, add) {
438
+ const candidateDayValue = day.add({ days: add });
439
+ if (rootContext.minValue.value && candidateDayValue.compare(rootContext.minValue.value) < 0 || rootContext.maxValue.value && candidateDayValue.compare(rootContext.maxValue.value) > 0) return;
440
+ const candidateDay = parentElement.querySelector(`[data-value='${candidateDayValue.toString()}']:not([data-outside-view])`);
441
+ if (!candidateDay) {
442
+ if (add > 0) {
443
+ if (rootContext.isNextButtonDisabled()) return;
444
+ rootContext.nextPage();
445
+ } else {
446
+ if (rootContext.isPrevButtonDisabled()) return;
447
+ rootContext.prevPage();
448
+ }
449
+ nextTick(() => {
450
+ shiftFocus(day, add);
451
+ });
452
+ return;
453
+ }
454
+ if (candidateDay && candidateDay.hasAttribute("data-disabled")) return shiftFocus(candidateDayValue, add);
455
+ rootContext.onPlaceholderChange(candidateDayValue);
456
+ candidateDay?.focus();
457
+ }
458
+ }
459
+ return (_ctx, _cache) => {
460
+ return openBlock(), createBlock(unref(Primitive), {
461
+ ref_key: "primitiveElement",
462
+ ref: primitiveElement,
463
+ as: props.as,
464
+ "as-child": props.asChild,
465
+ role: "button",
466
+ "aria-label": labelText.value,
467
+ "data-reka-calendar-cell-trigger": "",
468
+ "aria-disabled": isDisabled.value || isUnavailable.value ? true : void 0,
469
+ "data-selected": isSelectedDate.value ? true : void 0,
470
+ "data-value": _ctx.day.toString(),
471
+ "data-disabled": isDisabled.value ? "" : void 0,
472
+ "data-unavailable": isUnavailable.value ? "" : void 0,
473
+ "data-today": isDateToday.value ? "" : void 0,
474
+ "data-outside-view": isOutsideView.value ? "" : void 0,
475
+ "data-outside-visible-view": isOutsideVisibleView.value ? "" : void 0,
476
+ "data-focused": isFocusedDate.value ? "" : void 0,
477
+ tabindex: isFocusedDate.value ? 0 : isOutsideView.value || isDisabled.value ? void 0 : -1,
478
+ onClick: handleClick,
479
+ onKeydown: withKeys(handleArrowKey, [
480
+ "up",
481
+ "down",
482
+ "left",
483
+ "right",
484
+ "space",
485
+ "enter"
486
+ ])
487
+ }, {
488
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", {
489
+ dayValue: dayValue.value,
490
+ disabled: isDisabled.value,
491
+ today: isDateToday.value,
492
+ selected: isSelectedDate.value,
493
+ outsideView: isOutsideView.value,
494
+ outsideVisibleView: isOutsideVisibleView.value,
495
+ unavailable: isUnavailable.value
496
+ }, () => [createTextVNode(toDisplayString(dayValue.value), 1)])]),
497
+ _: 3
498
+ }, 8, [
499
+ "as",
500
+ "as-child",
501
+ "aria-label",
502
+ "aria-disabled",
503
+ "data-selected",
504
+ "data-value",
505
+ "data-disabled",
506
+ "data-unavailable",
507
+ "data-today",
508
+ "data-outside-view",
509
+ "data-outside-visible-view",
510
+ "data-focused",
511
+ "tabindex"
512
+ ]);
513
+ };
514
+ }
515
+ });
516
+ //#endregion
517
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/Calendar/CalendarGrid.js
518
+ var CalendarGrid_default = /* @__PURE__ */ defineComponent({
519
+ __name: "CalendarGrid",
520
+ props: {
521
+ asChild: {
522
+ type: Boolean,
523
+ required: false
524
+ },
525
+ as: {
526
+ type: null,
527
+ required: false,
528
+ default: "table"
529
+ }
530
+ },
531
+ setup(__props) {
532
+ const props = __props;
533
+ const rootContext = injectCalendarRootContext();
534
+ const disabled = computed(() => rootContext.disabled.value ? true : void 0);
535
+ const readonly = computed(() => rootContext.readonly.value ? true : void 0);
536
+ return (_ctx, _cache) => {
537
+ return openBlock(), createBlock(unref(Primitive), mergeProps(props, {
538
+ tabindex: "-1",
539
+ role: "application",
540
+ "aria-readonly": readonly.value,
541
+ "aria-disabled": disabled.value,
542
+ "data-readonly": readonly.value && "",
543
+ "data-disabled": disabled.value && ""
544
+ }), {
545
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
546
+ _: 3
547
+ }, 16, [
548
+ "aria-readonly",
549
+ "aria-disabled",
550
+ "data-readonly",
551
+ "data-disabled"
552
+ ]);
553
+ };
554
+ }
555
+ });
556
+ //#endregion
557
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/Calendar/CalendarGridBody.js
558
+ var CalendarGridBody_default = /* @__PURE__ */ defineComponent({
559
+ __name: "CalendarGridBody",
560
+ props: {
561
+ asChild: {
562
+ type: Boolean,
563
+ required: false
564
+ },
565
+ as: {
566
+ type: null,
567
+ required: false,
568
+ default: "tbody"
569
+ }
570
+ },
571
+ setup(__props) {
572
+ const props = __props;
573
+ return (_ctx, _cache) => {
574
+ return openBlock(), createBlock(unref(Primitive), normalizeProps(guardReactiveProps(props)), {
575
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
576
+ _: 3
577
+ }, 16);
578
+ };
579
+ }
580
+ });
581
+ //#endregion
582
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/Calendar/CalendarGridHead.js
583
+ var CalendarGridHead_default = /* @__PURE__ */ defineComponent({
584
+ __name: "CalendarGridHead",
585
+ props: {
586
+ asChild: {
587
+ type: Boolean,
588
+ required: false
589
+ },
590
+ as: {
591
+ type: null,
592
+ required: false,
593
+ default: "thead"
594
+ }
595
+ },
596
+ setup(__props) {
597
+ const props = __props;
598
+ return (_ctx, _cache) => {
599
+ return openBlock(), createBlock(unref(Primitive), mergeProps(props, { "aria-hidden": "true" }), {
600
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
601
+ _: 3
602
+ }, 16);
603
+ };
604
+ }
605
+ });
606
+ //#endregion
607
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/Calendar/CalendarGridRow.js
608
+ var CalendarGridRow_default = /* @__PURE__ */ defineComponent({
609
+ __name: "CalendarGridRow",
610
+ props: {
611
+ asChild: {
612
+ type: Boolean,
613
+ required: false
614
+ },
615
+ as: {
616
+ type: null,
617
+ required: false,
618
+ default: "tr"
619
+ }
620
+ },
621
+ setup(__props) {
622
+ const props = __props;
623
+ return (_ctx, _cache) => {
624
+ return openBlock(), createBlock(unref(Primitive), normalizeProps(guardReactiveProps(props)), {
625
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
626
+ _: 3
627
+ }, 16);
628
+ };
629
+ }
630
+ });
631
+ //#endregion
632
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/Calendar/CalendarHeadCell.js
633
+ var CalendarHeadCell_default = /* @__PURE__ */ defineComponent({
634
+ __name: "CalendarHeadCell",
635
+ props: {
636
+ asChild: {
637
+ type: Boolean,
638
+ required: false
639
+ },
640
+ as: {
641
+ type: null,
642
+ required: false,
643
+ default: "th"
644
+ }
645
+ },
646
+ setup(__props) {
647
+ const props = __props;
648
+ return (_ctx, _cache) => {
649
+ return openBlock(), createBlock(unref(Primitive), normalizeProps(guardReactiveProps(props)), {
650
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
651
+ _: 3
652
+ }, 16);
653
+ };
654
+ }
655
+ });
656
+ //#endregion
657
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/Calendar/CalendarHeading.js
658
+ var CalendarHeading_default = /* @__PURE__ */ defineComponent({
659
+ __name: "CalendarHeading",
660
+ props: {
661
+ asChild: {
662
+ type: Boolean,
663
+ required: false
664
+ },
665
+ as: {
666
+ type: null,
667
+ required: false,
668
+ default: "div"
669
+ }
670
+ },
671
+ setup(__props) {
672
+ const props = __props;
673
+ const rootContext = injectCalendarRootContext();
674
+ return (_ctx, _cache) => {
675
+ return openBlock(), createBlock(unref(Primitive), mergeProps(props, { "data-disabled": unref(rootContext).disabled.value ? "" : void 0 }), {
676
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", { headingValue: unref(rootContext).headingValue.value }, () => [createTextVNode(toDisplayString(unref(rootContext).headingValue.value), 1)])]),
677
+ _: 3
678
+ }, 16, ["data-disabled"]);
679
+ };
680
+ }
681
+ });
682
+ //#endregion
683
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/Calendar/CalendarNext.js
684
+ var CalendarNext_default = /* @__PURE__ */ defineComponent({
685
+ __name: "CalendarNext",
686
+ props: {
687
+ nextPage: {
688
+ type: Function,
689
+ required: false
690
+ },
691
+ asChild: {
692
+ type: Boolean,
693
+ required: false
694
+ },
695
+ as: {
696
+ type: null,
697
+ required: false,
698
+ default: "button"
699
+ }
700
+ },
701
+ setup(__props) {
702
+ const props = __props;
703
+ const disabled = computed(() => rootContext.disabled.value || rootContext.isNextButtonDisabled(props.nextPage));
704
+ const rootContext = injectCalendarRootContext();
705
+ function handleClick() {
706
+ if (disabled.value) return;
707
+ rootContext.nextPage(props.nextPage);
708
+ }
709
+ return (_ctx, _cache) => {
710
+ return openBlock(), createBlock(unref(Primitive), {
711
+ as: props.as,
712
+ "as-child": props.asChild,
713
+ "aria-label": "Next page",
714
+ type: props.as === "button" ? "button" : void 0,
715
+ "aria-disabled": disabled.value || void 0,
716
+ "data-disabled": disabled.value || void 0,
717
+ disabled: disabled.value,
718
+ onClick: handleClick
719
+ }, {
720
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", { disabled: disabled.value }, () => [_cache[0] || (_cache[0] = createTextVNode(" Next page "))])]),
721
+ _: 3
722
+ }, 8, [
723
+ "as",
724
+ "as-child",
725
+ "type",
726
+ "aria-disabled",
727
+ "data-disabled",
728
+ "disabled"
729
+ ]);
730
+ };
731
+ }
732
+ });
733
+ //#endregion
734
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/Calendar/CalendarPrev.js
735
+ var CalendarPrev_default = /* @__PURE__ */ defineComponent({
736
+ __name: "CalendarPrev",
737
+ props: {
738
+ prevPage: {
739
+ type: Function,
740
+ required: false
741
+ },
742
+ asChild: {
743
+ type: Boolean,
744
+ required: false
745
+ },
746
+ as: {
747
+ type: null,
748
+ required: false,
749
+ default: "button"
750
+ }
751
+ },
752
+ setup(__props) {
753
+ const props = __props;
754
+ const disabled = computed(() => rootContext.disabled.value || rootContext.isPrevButtonDisabled(props.prevPage));
755
+ const rootContext = injectCalendarRootContext();
756
+ function handleClick() {
757
+ if (disabled.value) return;
758
+ rootContext.prevPage(props.prevPage);
759
+ }
760
+ return (_ctx, _cache) => {
761
+ return openBlock(), createBlock(unref(Primitive), {
762
+ "aria-label": "Previous page",
763
+ as: props.as,
764
+ "as-child": props.asChild,
765
+ type: props.as === "button" ? "button" : void 0,
766
+ "aria-disabled": disabled.value || void 0,
767
+ "data-disabled": disabled.value || void 0,
768
+ disabled: disabled.value,
769
+ onClick: handleClick
770
+ }, {
771
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", { disabled: disabled.value }, () => [_cache[0] || (_cache[0] = createTextVNode(" Prev page "))])]),
772
+ _: 3
773
+ }, 8, [
774
+ "as",
775
+ "as-child",
776
+ "type",
777
+ "aria-disabled",
778
+ "data-disabled",
779
+ "disabled"
780
+ ]);
781
+ };
782
+ }
783
+ });
784
+ //#endregion
785
+ //#region src/components/calendar/calendar.vue?vue&type=script&setup=true&lang.ts
786
+ var _hoisted_1 = { class: "celeste-calendar-header" };
787
+ var _hoisted_2 = { class: "celeste-calendar-months" };
788
+ var _hoisted_3 = { class: "celeste-calendar-day-number" };
789
+ //#endregion
790
+ //#region src/components/calendar/calendar.vue
791
+ var calendar_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
792
+ __name: "calendar",
793
+ props: {
794
+ class: {},
795
+ markedDates: {},
796
+ defaultValue: {},
797
+ defaultPlaceholder: {},
798
+ placeholder: {},
799
+ pagedNavigation: { type: Boolean },
800
+ preventDeselect: { type: Boolean },
801
+ weekStartsOn: { default: 1 },
802
+ weekdayFormat: { default: "short" },
803
+ calendarLabel: {},
804
+ fixedWeeks: {
805
+ type: Boolean,
806
+ default: true
807
+ },
808
+ maxValue: {},
809
+ minValue: {},
810
+ locale: {},
811
+ numberOfMonths: {},
812
+ disabled: { type: Boolean },
813
+ readonly: { type: Boolean },
814
+ initialFocus: { type: Boolean },
815
+ isDateDisabled: {},
816
+ isDateUnavailable: {},
817
+ dir: {},
818
+ nextPage: {},
819
+ prevPage: {},
820
+ modelValue: {},
821
+ multiple: { type: Boolean },
822
+ disableDaysOutsideCurrentView: { type: Boolean },
823
+ asChild: { type: Boolean },
824
+ as: {}
825
+ },
826
+ emits: ["update:modelValue", "update:placeholder"],
827
+ setup(__props, { emit: __emit }) {
828
+ const props = __props;
829
+ const emits = __emit;
830
+ const forwarded = useForwardPropsEmits(useDelegatedProps(props, ["class", "markedDates"]), emits);
831
+ function isMarked(date) {
832
+ return props.markedDates?.some((marked) => $14e0f24ef4ac5c92$export$91b62ebf2ba703ee(marked, date)) ?? false;
833
+ }
834
+ function weekdayLabel(day) {
835
+ return /^[a-z]/i.test(day.trim()) ? day.slice(0, 2) : day;
836
+ }
837
+ return (_ctx, _cache) => {
838
+ return openBlock(), createBlock(unref(CalendarRoot_default), mergeProps(unref(forwarded), { class: unref(clsx)("celeste-calendar", props.class) }), {
839
+ default: withCtx(({ weekDays, grid }) => [createElementVNode("div", _hoisted_1, [
840
+ createVNode(unref(CalendarPrev_default), { "as-child": "" }, {
841
+ default: withCtx(() => _cache[0] || (_cache[0] = [createElementVNode("button", {
842
+ type: "button",
843
+ class: "celeste-calendar-nav"
844
+ }, [createElementVNode("i", { class: "i-celeste-arrow-left-s-line" })], -1)])),
845
+ _: 1
846
+ }),
847
+ createVNode(unref(CalendarHeading_default), { class: "celeste-calendar-heading" }),
848
+ createVNode(unref(CalendarNext_default), { "as-child": "" }, {
849
+ default: withCtx(() => _cache[1] || (_cache[1] = [createElementVNode("button", {
850
+ type: "button",
851
+ class: "celeste-calendar-nav"
852
+ }, [createElementVNode("i", { class: "i-celeste-arrow-right-s-line" })], -1)])),
853
+ _: 1
854
+ })
855
+ ]), createElementVNode("div", _hoisted_2, [(openBlock(true), createElementBlock(Fragment, null, renderList(grid, (month) => {
856
+ return openBlock(), createBlock(unref(CalendarGrid_default), {
857
+ key: month.value.toString(),
858
+ class: "celeste-calendar-grid"
859
+ }, {
860
+ default: withCtx(() => [createVNode(unref(CalendarGridHead_default), null, {
861
+ default: withCtx(() => [createVNode(unref(CalendarGridRow_default), { class: "celeste-calendar-week" }, {
862
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(weekDays, (day) => {
863
+ return openBlock(), createBlock(unref(CalendarHeadCell_default), {
864
+ key: day,
865
+ class: "celeste-calendar-weekday"
866
+ }, {
867
+ default: withCtx(() => [createTextVNode(toDisplayString(weekdayLabel(day)), 1)]),
868
+ _: 2
869
+ }, 1024);
870
+ }), 128))]),
871
+ _: 2
872
+ }, 1024)]),
873
+ _: 2
874
+ }, 1024), createVNode(unref(CalendarGridBody_default), { class: "celeste-calendar-body" }, {
875
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(month.rows, (weekDates, index) => {
876
+ return openBlock(), createBlock(unref(CalendarGridRow_default), {
877
+ key: `week-${index}`,
878
+ class: "celeste-calendar-week"
879
+ }, {
880
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(weekDates, (weekDate) => {
881
+ return openBlock(), createBlock(unref(CalendarCell_default), {
882
+ key: weekDate.toString(),
883
+ date: weekDate,
884
+ class: "celeste-calendar-cell"
885
+ }, {
886
+ default: withCtx(() => [createVNode(unref(CalendarCellTrigger_default), {
887
+ day: weekDate,
888
+ month: month.value,
889
+ class: "celeste-calendar-day",
890
+ "data-marked": isMarked(weekDate) ? "" : void 0
891
+ }, {
892
+ default: withCtx(() => [createElementVNode("span", _hoisted_3, toDisplayString(weekDate.day), 1)]),
893
+ _: 2
894
+ }, 1032, [
895
+ "day",
896
+ "month",
897
+ "data-marked"
898
+ ])]),
899
+ _: 2
900
+ }, 1032, ["date"]);
901
+ }), 128))]),
902
+ _: 2
903
+ }, 1024);
904
+ }), 128))]),
905
+ _: 2
906
+ }, 1024)]),
907
+ _: 2
908
+ }, 1024);
909
+ }), 128))])]),
910
+ _: 1
911
+ }, 16, ["class"]);
912
+ };
913
+ }
914
+ }), [["__scopeId", "data-v-b0c6d2f8"]]);
915
+ //#endregion
916
+ export { calendar_default as t };