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