@youcan/celeste 0.7.2 → 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 (73) hide show
  1. package/dist/celeste.css +495 -30
  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/text-input.cjs +1 -1
  18. package/dist/cjs/chunks/tooltip-content.cjs +3 -2
  19. package/dist/cjs/chunks/useCalendar.cjs +2439 -0
  20. package/dist/cjs/chunks/useLocale.cjs +20 -0
  21. package/dist/cjs/date-picker.cjs +2 -0
  22. package/dist/cjs/index.cjs +9 -1
  23. package/dist/cjs/range-calendar.cjs +2 -0
  24. package/dist/cjs/range-picker.cjs +2 -0
  25. package/dist/components/calendar/calendar.d.ts +19 -0
  26. package/dist/components/calendar/index.d.ts +2 -0
  27. package/dist/components/date-picker/date-picker.d.ts +27 -0
  28. package/dist/components/date-picker/index.d.ts +2 -0
  29. package/dist/components/index.d.ts +4 -0
  30. package/dist/components/range-calendar/index.d.ts +2 -0
  31. package/dist/components/range-calendar/range-calendar.d.ts +24 -0
  32. package/dist/components/range-picker/index.d.ts +2 -0
  33. package/dist/components/range-picker/range-picker.d.ts +38 -0
  34. package/dist/components/rich-editor/rich-editor.d.ts +1 -1
  35. package/dist/components/text-input/text-input.d.ts +2 -2
  36. package/dist/es/calendar.js +2 -0
  37. package/dist/es/chunks/ComboboxContent.js +1 -1
  38. package/dist/es/chunks/DialogPortal.js +1 -1
  39. package/dist/es/chunks/DismissableLayer.js +1 -29
  40. package/dist/es/chunks/FocusScope.js +1 -1
  41. package/dist/es/chunks/MenuContentImpl.js +1 -1
  42. package/dist/es/chunks/SelectItemAlignedPosition.js +1 -1
  43. package/dist/es/chunks/calendar.js +916 -0
  44. package/dist/es/chunks/components.js +9 -1
  45. package/dist/es/chunks/counter-input.js +1 -12
  46. package/dist/es/chunks/date-picker.js +92 -0
  47. package/dist/es/chunks/defu.js +29 -0
  48. package/dist/es/chunks/popover-content.js +1 -1
  49. package/dist/es/chunks/range-calendar.js +1163 -0
  50. package/dist/es/chunks/range-picker.js +224 -0
  51. package/dist/es/chunks/text-input.js +1 -1
  52. package/dist/es/chunks/tooltip-content.js +2 -1
  53. package/dist/es/chunks/useCalendar.js +2331 -0
  54. package/dist/es/chunks/useLocale.js +14 -0
  55. package/dist/es/date-picker.js +2 -0
  56. package/dist/es/index.js +6 -2
  57. package/dist/es/range-calendar.js +2 -0
  58. package/dist/es/range-picker.js +2 -0
  59. package/package.json +4 -3
  60. package/src/components/calendar/calendar.vue +305 -0
  61. package/src/components/calendar/index.ts +2 -0
  62. package/src/components/calendar/stories/calendar.stories.ts +76 -0
  63. package/src/components/date-picker/date-picker.vue +91 -0
  64. package/src/components/date-picker/index.ts +2 -0
  65. package/src/components/date-picker/stories/date-picker.stories.ts +92 -0
  66. package/src/components/index.ts +4 -0
  67. package/src/components/range-calendar/index.ts +2 -0
  68. package/src/components/range-calendar/range-calendar.vue +363 -0
  69. package/src/components/range-calendar/stories/range-calendar.stories.ts +46 -0
  70. package/src/components/range-picker/index.ts +2 -0
  71. package/src/components/range-picker/range-picker.vue +237 -0
  72. package/src/components/range-picker/stories/range-picker.stories.ts +97 -0
  73. package/src/components/text-input/text-input.vue +2 -1
@@ -5,13 +5,13 @@ import { t as sonner_alert_default } from "./sonner-alert.js";
5
5
  import { t as badge_default } from "./badge.js";
6
6
  import { t as status_badge_default } from "./status-badge.js";
7
7
  import { t as tooltip_content_default } from "./tooltip-content.js";
8
- import { t as counter_input_default } from "./counter-input.js";
9
8
  import { t as collapsible_content_default } from "./collapsible-content.js";
10
9
  import { t as collapsible_trigger_default } from "./collapsible-trigger.js";
11
10
  import { t as combobox_anchor_default } from "./combobox-anchor.js";
12
11
  import { t as combobox_empty_default } from "./combobox-empty.js";
13
12
  import { t as combobox_list_default } from "./combobox-list.js";
14
13
  import { t as combobox_trigger_default } from "./combobox-trigger.js";
14
+ import { t as calendar_default } from "./calendar.js";
15
15
  import { t as checkbox_default } from "./checkbox.js";
16
16
  import { t as slider_default } from "./slider.js";
17
17
  import { t as dropdown_menu_item_default } from "./dropdown-menu-item.js";
@@ -22,9 +22,11 @@ import { t as dropdown_menu_sub_content_default } from "./dropdown-menu-sub-cont
22
22
  import { t as dropdown_menu_sub_trigger_default } from "./dropdown-menu-sub-trigger.js";
23
23
  import { t as popover_content_default } from "./popover-content.js";
24
24
  import { t as popover_trigger_default } from "./popover-trigger.js";
25
+ import { t as range_calendar_default } from "./range-calendar.js";
25
26
  import { t as dropdown_menu_group_default } from "./dropdown-menu-group.js";
26
27
  import { t as dropdown_menu_sub_default } from "./dropdown-menu-sub.js";
27
28
  import { t as dropdown_menu_trigger_default } from "./dropdown-menu-trigger.js";
29
+ import { t as counter_input_default } from "./counter-input.js";
28
30
  import { t as pagination_ellipsis_default } from "./pagination-ellipsis.js";
29
31
  import { t as pagination_first_default } from "./pagination-first.js";
30
32
  import { t as pagination_last_default } from "./pagination-last.js";
@@ -74,6 +76,7 @@ import { t as combobox_item_default } from "./combobox-item.js";
74
76
  import { t as combobox_root_default } from "./combobox-root.js";
75
77
  import { t as combobox_separator_default } from "./combobox-separator.js";
76
78
  import { t as combobox_default } from "./combobox.js";
79
+ import { t as date_picker_default } from "./date-picker.js";
77
80
  import { t as digit_input_group_default } from "./digit-input-group.js";
78
81
  import { t as digit_input_default } from "./digit-input.js";
79
82
  import { t as dropdown_menu_default } from "./dropdown-menu.js";
@@ -96,6 +99,7 @@ import { t as progress_circle_default } from "./progress-circle.js";
96
99
  import { t as radio_group_card_default } from "./radio-group-card.js";
97
100
  import { t as radio_group_label_default } from "./radio-group-label.js";
98
101
  import { t as radio_group_default } from "./radio-group.js";
102
+ import { t as range_picker_default } from "./range-picker.js";
99
103
  import { t as rich_editor_default } from "./rich-editor.js";
100
104
  import { t as segmented_control_default } from "./segmented-control.js";
101
105
  import { t as sheet_close_default } from "./sheet-close.js";
@@ -160,6 +164,7 @@ var components_exports = /* @__PURE__ */ __exportAll({
160
164
  AlphaSlider: () => alpha_slider_default,
161
165
  Badge: () => badge_default,
162
166
  Button: () => button_default,
167
+ Calendar: () => calendar_default,
163
168
  Checkbox: () => checkbox_default,
164
169
  CheckboxCard: () => checkbox_card_default,
165
170
  CheckboxLabel: () => checkbox_label_default,
@@ -182,6 +187,7 @@ var components_exports = /* @__PURE__ */ __exportAll({
182
187
  CompactButton: () => compact_button_default,
183
188
  ContentDivider: () => content_divider_default,
184
189
  CounterInput: () => counter_input_default,
190
+ DatePicker: () => date_picker_default,
185
191
  DigitInput: () => digit_input_default,
186
192
  DigitInputGroup: () => digit_input_group_default,
187
193
  DigitInputSlot: () => digit_input_slot_default,
@@ -225,6 +231,8 @@ var components_exports = /* @__PURE__ */ __exportAll({
225
231
  RadioGroupCard: () => radio_group_card_default,
226
232
  RadioGroupItem: () => radio_group_item_default,
227
233
  RadioGroupLabel: () => radio_group_label_default,
234
+ RangeCalendar: () => range_calendar_default,
235
+ RangePicker: () => range_picker_default,
228
236
  RichEditor: () => rich_editor_default,
229
237
  ScrollArea: () => scroll_area_default,
230
238
  SegmentedControl: () => segmented_control_default,
@@ -5,27 +5,16 @@ import { t as getActiveElement } from "./getActiveElement.js";
5
5
  import { t as isNullish } from "./nullish.js";
6
6
  import { c as createEventHook, d as isClient, i as useEventListener, p as reactiveComputed, r as unrefElement, s as useVModel } from "./dist.js";
7
7
  import { t as Primitive } from "./Primitive.js";
8
- import { t as injectConfigProviderContext } from "./ConfigProvider.js";
9
8
  import { t as useComposing } from "./useComposing.js";
10
9
  import { t as useFormControl } from "./useFormControl.js";
11
10
  import { t as useForwardPropsEmits } from "./useForwardPropsEmits.js";
12
11
  import { t as useKbd } from "./useKbd.js";
12
+ import { t as useLocale } from "./useLocale.js";
13
13
  import { t as usePrimitiveElement } from "./usePrimitiveElement.js";
14
14
  import { t as VisuallyHiddenInput_default } from "./VisuallyHiddenInput.js";
15
15
  import { t as compact_button_default } from "./compact-button.js";
16
16
  import { useDelegatedProps } from "../use-delegated-props.js";
17
17
  import { computed, createBlock, createCommentVNode, createVNode, defineComponent, mergeProps, onMounted, openBlock, ref, renderSlot, toRefs, unref, watch, withCtx, withModifiers } from "vue";
18
- //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/shared/useLocale.js
19
- /**
20
- * The `useLocale` function provides a way to access the current locale in your application.
21
- * @param {Ref<string | undefined>} [locale] - An optional ref containing the locale.
22
- * @returns A computed ref holding the resolved locale.
23
- */
24
- function useLocale(locale) {
25
- const context = injectConfigProviderContext({ locale: ref("en") });
26
- return computed(() => locale?.value || context.locale?.value || "en");
27
- }
28
- //#endregion
29
18
  //#region ../../node_modules/.pnpm/@internationalized+number@3.6.0/node_modules/@internationalized/number/dist/NumberFormatter.mjs
30
19
  var $488c6ddbf4ef74c2$var$formatterCache = /* @__PURE__ */ new Map();
31
20
  var $488c6ddbf4ef74c2$var$supportsSignDisplay = false;
@@ -0,0 +1,92 @@
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 calendar_default } from "./calendar.js";
4
+ import { t as button_default } from "./button.js";
5
+ import { useDelegatedProps } from "../use-delegated-props.js";
6
+ import { computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, normalizeClass, openBlock, toDisplayString, unref, useModel, withCtx } from "vue";
7
+ //#region src/components/date-picker/date-picker.vue?vue&type=script&setup=true&lang.ts
8
+ var _hoisted_1 = { class: "celeste-date-picker-body" };
9
+ var _hoisted_2 = {
10
+ key: 0,
11
+ class: "celeste-date-picker-footer"
12
+ };
13
+ //#endregion
14
+ //#region src/components/date-picker/date-picker.vue
15
+ var date_picker_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
16
+ __name: "date-picker",
17
+ props: /* @__PURE__ */ mergeModels({
18
+ footer: {
19
+ type: Boolean,
20
+ default: true
21
+ },
22
+ cancelLabel: { default: "Cancel" },
23
+ applyLabel: { default: "Apply" },
24
+ class: {},
25
+ markedDates: {},
26
+ defaultValue: {},
27
+ defaultPlaceholder: {},
28
+ placeholder: {},
29
+ pagedNavigation: { type: Boolean },
30
+ preventDeselect: { type: Boolean },
31
+ weekStartsOn: {},
32
+ weekdayFormat: {},
33
+ calendarLabel: {},
34
+ fixedWeeks: { type: Boolean },
35
+ maxValue: {},
36
+ minValue: {},
37
+ locale: {},
38
+ numberOfMonths: {},
39
+ disabled: { type: Boolean },
40
+ readonly: { type: Boolean },
41
+ initialFocus: { type: Boolean },
42
+ isDateDisabled: {},
43
+ isDateUnavailable: {},
44
+ dir: {},
45
+ nextPage: {},
46
+ prevPage: {},
47
+ multiple: { type: Boolean },
48
+ disableDaysOutsideCurrentView: { type: Boolean },
49
+ asChild: { type: Boolean },
50
+ as: {}
51
+ }, {
52
+ "modelValue": {},
53
+ "modelModifiers": {}
54
+ }),
55
+ emits: /* @__PURE__ */ mergeModels(["apply", "cancel"], ["update:modelValue"]),
56
+ setup(__props, { emit: __emit }) {
57
+ const props = __props;
58
+ const emits = __emit;
59
+ const modelValue = useModel(__props, "modelValue");
60
+ const calendarProps = useDelegatedProps(props, [
61
+ "class",
62
+ "footer",
63
+ "cancelLabel",
64
+ "applyLabel"
65
+ ]);
66
+ const cardClass = computed(() => clsx("celeste-date-picker", props.class));
67
+ return (_ctx, _cache) => {
68
+ return openBlock(), createElementBlock("div", { class: normalizeClass(cardClass.value) }, [createElementVNode("div", _hoisted_1, [createVNode(calendar_default, mergeProps({
69
+ modelValue: modelValue.value,
70
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event)
71
+ }, unref(calendarProps)), null, 16, ["modelValue"])]), _ctx.footer ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(button_default, {
72
+ class: "celeste-date-picker-action",
73
+ variant: "stroke",
74
+ intent: "neutral",
75
+ onClick: _cache[1] || (_cache[1] = ($event) => emits("cancel"))
76
+ }, {
77
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.cancelLabel), 1)]),
78
+ _: 1
79
+ }), createVNode(button_default, {
80
+ class: "celeste-date-picker-action",
81
+ variant: "fill",
82
+ intent: "primary",
83
+ onClick: _cache[2] || (_cache[2] = ($event) => emits("apply", modelValue.value))
84
+ }, {
85
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.applyLabel), 1)]),
86
+ _: 1
87
+ })])) : createCommentVNode("", true)], 2);
88
+ };
89
+ }
90
+ }), [["__scopeId", "data-v-ac6d198e"]]);
91
+ //#endregion
92
+ export { date_picker_default as t };
@@ -0,0 +1,29 @@
1
+ //#region ../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs
2
+ function isPlainObject(value) {
3
+ if (value === null || typeof value !== "object") return false;
4
+ const prototype = Object.getPrototypeOf(value);
5
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
6
+ if (Symbol.iterator in value) return false;
7
+ if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
8
+ return true;
9
+ }
10
+ function _defu(baseObject, defaults, namespace = ".", merger) {
11
+ if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
12
+ const object = { ...defaults };
13
+ for (const key of Object.keys(baseObject)) {
14
+ if (key === "__proto__" || key === "constructor") continue;
15
+ const value = baseObject[key];
16
+ if (value === null || value === void 0) continue;
17
+ if (merger && merger(object, key, value, namespace)) continue;
18
+ if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
19
+ else if (isPlainObject(value) && isPlainObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
20
+ else object[key] = value;
21
+ }
22
+ return object;
23
+ }
24
+ function createDefu(merger) {
25
+ return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
26
+ }
27
+ var defu = createDefu();
28
+ //#endregion
29
+ export { defu as t };
@@ -3,7 +3,6 @@ import { t as clsx } from "./clsx.js";
3
3
  import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
4
4
  import { m as reactiveOmit } from "./dist.js";
5
5
  import { t as Primitive } from "./Primitive.js";
6
- import { t as DismissableLayer_default } from "./DismissableLayer.js";
7
6
  import { n as useBodyScrollLock, t as FocusScope_default } from "./FocusScope.js";
8
7
  import { t as useFocusGuards } from "./useFocusGuards.js";
9
8
  import { t as useForwardExpose } from "./useForwardExpose.js";
@@ -12,6 +11,7 @@ import { t as useForwardPropsEmits } from "./useForwardPropsEmits.js";
12
11
  import { t as useHideOthers } from "./useHideOthers.js";
13
12
  import { t as useId } from "./useId.js";
14
13
  import { t as Presence_default } from "./Presence.js";
14
+ import { t as DismissableLayer_default } from "./DismissableLayer.js";
15
15
  import { t as Teleport_default } from "./Teleport.js";
16
16
  import { t as PopperArrow_default } from "./PopperArrow.js";
17
17
  import { n as injectPopoverRootContext } from "./PopoverRoot.js";