@bridge-ui/vue 0.21.0 → 0.22.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.
Files changed (55) hide show
  1. package/dist/Components/Alert/Alert.vue_vue_type_script_setup_true_lang.js +24 -10
  2. package/dist/Components/Alert/alert.types.d.ts +5 -4
  3. package/dist/Components/Alert/composables/useAlert.d.ts +2 -2
  4. package/dist/Components/Alert/composables/useAlert.js +2 -2
  5. package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +1 -0
  6. package/dist/Components/Autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +5 -1
  7. package/dist/Components/Autocomplete/autocomplete.types.d.ts +7 -0
  8. package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +2 -2
  9. package/dist/Components/Autocomplete/composables/useAutocomplete.js +3 -2
  10. package/dist/Components/Avatar/composables/useAvatar.js +2 -2
  11. package/dist/Components/Calendar/composables/useCalendar.js +132 -131
  12. package/dist/Components/CalendarDate/composables/useCalendarDate.js +116 -115
  13. package/dist/Components/CalendarRange/composables/useCalendarRange.js +132 -131
  14. package/dist/Components/Card/Card.vue_vue_type_script_setup_true_lang.js +24 -10
  15. package/dist/Components/Card/card.types.d.ts +5 -4
  16. package/dist/Components/Card/composables/useCard.d.ts +2 -2
  17. package/dist/Components/Card/composables/useCard.js +2 -2
  18. package/dist/Components/Carousel/composables/useCarousel.js +6 -6
  19. package/dist/Components/Chip/Chip.vue.d.ts +0 -1
  20. package/dist/Components/Chip/Chip.vue_vue_type_script_setup_true_lang.js +1 -1
  21. package/dist/Components/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js +48 -39
  22. package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +33 -36
  23. package/dist/Components/DataTable/composables/useDataTable.d.ts +2 -0
  24. package/dist/Components/DataTable/composables/useDataTable.js +226 -216
  25. package/dist/Components/EmptyState/EmptyState.vue.d.ts +0 -3
  26. package/dist/Components/EmptyState/EmptyState.vue_vue_type_script_setup_true_lang.js +4 -4
  27. package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +51 -57
  28. package/dist/Components/FileUpload/composables/useFileUpload.d.ts +2 -0
  29. package/dist/Components/FileUpload/composables/useFileUpload.js +6 -4
  30. package/dist/Components/Link/Link.vue_vue_type_script_setup_true_lang.js +1 -1
  31. package/dist/Components/Link/link.types.d.ts +1 -1
  32. package/dist/Components/ListItem/composables/useListItem.js +4 -5
  33. package/dist/Components/Pagination/composables/usePagination.js +9 -9
  34. package/dist/Components/Select/Select.vue.d.ts +1 -0
  35. package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +5 -1
  36. package/dist/Components/Select/composables/useSelect.d.ts +2 -2
  37. package/dist/Components/Select/composables/useSelect.js +3 -2
  38. package/dist/Components/Select/select.types.d.ts +7 -0
  39. package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +97 -72
  40. package/dist/Components/Snackbar/composables/useSnackbar.d.ts +2 -2
  41. package/dist/Components/Snackbar/composables/useSnackbar.js +2 -2
  42. package/dist/Components/Snackbar/snackbar.types.d.ts +5 -4
  43. package/dist/Components/Table/composables/useTableRow.js +3 -3
  44. package/dist/Components/Text/Text.vue_vue_type_script_setup_true_lang.js +1 -1
  45. package/dist/Components/Text/composables/useText.d.ts +1 -1
  46. package/dist/Components/Text/text.types.d.ts +1 -1
  47. package/dist/Components/TimePanel/composables/useTimePanel.js +113 -112
  48. package/dist/Utils/index.d.ts +6 -0
  49. package/dist/Utils/index.js +21 -17
  50. package/dist/index.js +157 -157
  51. package/docs/components/Autocomplete.md +23 -22
  52. package/docs/components/Link.md +1 -1
  53. package/docs/components/Select.md +22 -21
  54. package/docs/components/Text.md +6 -4
  55. package/package.json +2 -2
@@ -1,12 +1,13 @@
1
1
  import { hasNamedSlot as e, isPropPresent as t } from "../../Utils/slotOrProp.js";
2
2
  import n from "../Icon/Icon.js";
3
3
  import { useAlert as r } from "./composables/useAlert.js";
4
- import { Fragment as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, defineComponent as u, guardReactiveProps as d, mergeProps as f, normalizeProps as p, openBlock as m, renderSlot as h, toDisplayString as g, unref as _ } from "vue";
4
+ import i from "../Text/Text.js";
5
+ import { Fragment as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, guardReactiveProps as p, mergeProps as m, normalizeProps as h, openBlock as g, renderSlot as _, toDisplayString as v, unref as y, withCtx as b } from "vue";
5
6
  // src/Components/Alert/Alert.vue?vue&type=script&setup=true&lang.ts
6
- var v = {
7
+ var x = {
7
8
  key: 1,
8
9
  class: "flex justify-between items-start"
9
- }, y = { class: "flex items-start gap-x-3" }, b = /*@__PURE__*/ u({
10
+ }, S = { class: "flex items-start gap-x-3" }, C = /*@__PURE__*/ f({
10
11
  inheritAttrs: !1,
11
12
  __name: "Alert",
12
13
  props: {
@@ -20,19 +21,32 @@ var v = {
20
21
  title: {},
21
22
  variant: {}
22
23
  },
23
- setup(u) {
24
- let { slots: b, merged: x, bodyBind: S, iconBind: C, rootBind: w, hasTitle: T, titleBind: E, resolvedIcon: D, hasDefaultBody: O } = r(u, {
24
+ setup(f) {
25
+ let { slots: C, merged: w, bodyBind: T, iconBind: E, rootBind: D, hasTitle: O, titleBind: k, resolvedIcon: A, hasDefaultBody: j } = r(f, {
25
26
  shadow: "sm",
26
27
  rounded: "sm",
27
28
  variant: "flat",
28
29
  color: "primary",
29
30
  padding: "medium"
30
31
  });
31
- return (r, u) => (m(), s("div", p(d(_(w))), [
32
- _(e)(_(b), "header") ? h(r.$slots, "header", {}, void 0, void 0, 0) : _(T) ? (m(), s("div", v, [c("div", y, [_(e)(_(b), "icon") ? h(r.$slots, "icon", {}, void 0, void 0, 0) : _(D) ? (m(), a(n, f({ key: 1 }, _(C), { icon: _(D) }), null, 16, ["icon"])) : o("", !0), c("div", p(d(_(E))), [_(e)(_(b), "title") ? h(r.$slots, "title", {}, void 0, void 0, 0) : _(t)(_(x).title) ? (m(), s(i, { key: 1 }, [l(g(_(x).title), 1)], 64)) : h(r.$slots, "default", {}, void 0, void 0, 2)], 16)]), h(r.$slots, "action")])) : o("", !0),
33
- _(O) ? (m(), s("div", p(f({ key: 2 }, _(S))), [h(r.$slots, "default")], 16)) : o("", !0),
34
- h(r.$slots, "footer")
32
+ return (r, f) => (g(), c("div", h(p(y(D))), [
33
+ y(e)(y(C), "header") ? _(r.$slots, "header", {}, void 0, void 0, 0) : y(O) ? (g(), c("div", x, [l("div", S, [y(e)(y(C), "icon") ? _(r.$slots, "icon", {}, void 0, void 0, 0) : y(A) ? (g(), o(n, m({ key: 1 }, y(E), { icon: y(A) }), null, 16, ["icon"])) : s("", !0), d(y(i), m({
34
+ as: "div",
35
+ color: "inherit"
36
+ }, y(k)), {
37
+ default: b(() => [y(e)(y(C), "title") ? _(r.$slots, "title", {}, void 0, void 0, 0) : y(t)(y(w).title) ? (g(), c(a, { key: 1 }, [u(v(y(w).title), 1)], 64)) : _(r.$slots, "default", {}, void 0, void 0, 2)]),
38
+ _: 3
39
+ }, 16)]), _(r.$slots, "action")])) : s("", !0),
40
+ y(j) ? (g(), o(y(i), m({
41
+ key: 2,
42
+ as: "div",
43
+ color: "inherit"
44
+ }, y(T)), {
45
+ default: b(() => [_(r.$slots, "default")]),
46
+ _: 3
47
+ }, 16)) : s("", !0),
48
+ _(r.$slots, "footer")
35
49
  ], 16));
36
50
  }
37
51
  });
38
- export { b as default };
52
+ export { C as default };
@@ -3,6 +3,7 @@ import { AlertColor, AlertPadding, AlertRounded, AlertShadow, AlertVariant } fro
3
3
  import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
4
4
  import { IconSource } from '../../Adapters/Icon';
5
5
  import { IconProps } from '../Icon';
6
+ import { TextProps } from '../Text';
6
7
  export interface AlertColorOverrides {}
7
8
  export interface AlertShadowOverrides {}
8
9
  export interface AlertPaddingOverrides {}
@@ -28,9 +29,9 @@ export interface AlertClasses {
28
29
  }
29
30
  export interface AlertCustomProps {
30
31
  /**
31
- * Props forwarded to the default body container.
32
+ * Props forwarded to the `Text` that renders the default body container.
32
33
  */
33
- body?: HTMLAttributes;
34
+ body?: Partial<Omit<TextProps, "as">>;
34
35
  /**
35
36
  * Props forwarded to the default `Icon` (`icon` is set by the alert).
36
37
  */
@@ -40,9 +41,9 @@ export interface AlertCustomProps {
40
41
  */
41
42
  root?: HTMLAttributes;
42
43
  /**
43
- * Props forwarded to the title container.
44
+ * Props forwarded to the `Text` that renders the title container.
44
45
  */
45
- title?: HTMLAttributes;
46
+ title?: Partial<Omit<TextProps, "as">>;
46
47
  }
47
48
  /**
48
49
  * Alert banner. Does not set `role` or `aria-live` by default — pass them when needed:
@@ -8,11 +8,11 @@ export declare function useAlert(props: AlertOwnProps, libDefaults: AlertLibDefa
8
8
  [name: string]: import('vue').Slot<any> | undefined;
9
9
  }>;
10
10
  merged: import('vue').ComputedRef<AlertMerged>;
11
- bodyBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
11
+ bodyBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Text').TextProps, "as">> | undefined, {}>>;
12
12
  iconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
13
13
  rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<AlertProps, "color" | "icon" | "classes" | "customProps" | "title" | "rounded" | "variant" | "padding" | "shadow">>>;
14
14
  hasTitle: import('vue').ComputedRef<boolean>;
15
- titleBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
15
+ titleBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Text').TextProps, "as">> | undefined, {}>>;
16
16
  resolvedIcon: import('vue').ComputedRef<IconSource | null>;
17
17
  hasDefaultBody: import('vue').ComputedRef<boolean>;
18
18
  };
@@ -51,7 +51,7 @@ function y(y, b) {
51
51
  slots: S,
52
52
  merged: w,
53
53
  bodyBind: o(() => n(E.value?.body, {}, h({
54
- "grow text-sm text-start": !0,
54
+ "grow font-normal text-start": !0,
55
55
  [l(P.value, "body") ?? ""]: !0,
56
56
  [l(M.value, "text") ?? ""]: !0,
57
57
  [l(D.value, "body") ?? ""]: !0
@@ -72,7 +72,7 @@ function y(y, b) {
72
72
  }))),
73
73
  hasTitle: A,
74
74
  titleBind: o(() => n(E.value?.title, {}, h({
75
- "text-start text-sm whitespace-normal": !0,
75
+ "text-start whitespace-normal": !0,
76
76
  "font-normal": !j.value,
77
77
  "font-semibold": j.value,
78
78
  [l(M.value, "text") ?? ""]: !0,
@@ -32,6 +32,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
32
32
  showErrorIcon: boolean;
33
33
  clearable: boolean;
34
34
  minItemsForSearch: number;
35
+ persistentPlaceholder: boolean;
35
36
  searchable: boolean;
36
37
  freeSolo: boolean;
37
38
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -14,7 +14,7 @@ import { cn as M } from "@bridge-ui/core/Utils";
14
14
  // src/Components/Autocomplete/Autocomplete.vue?vue&type=script&setup=true&lang.ts
15
15
  var N = {
16
16
  key: 0,
17
- class: "flex min-w-0 flex-1 flex-wrap items-center gap-0.5"
17
+ class: "flex min-w-0 flex-1 flex-wrap items-center gap-0.5 py-1.5 [&>textarea]:py-0"
18
18
  }, P = {
19
19
  key: 1,
20
20
  class: "flex min-w-0 flex-1 items-center gap-1"
@@ -51,6 +51,10 @@ var N = {
51
51
  options: {},
52
52
  optionValue: {},
53
53
  overlay: {},
54
+ persistentPlaceholder: {
55
+ type: Boolean,
56
+ default: !1
57
+ },
54
58
  placeholder: {},
55
59
  searchable: {
56
60
  type: Boolean,
@@ -226,6 +226,13 @@ export interface AutocompleteOwnProps extends Omit<FormFieldOwnProps, "field"> {
226
226
  * @default "auto"
227
227
  */
228
228
  overlay?: FieldOverlayMode;
229
+ /**
230
+ * Keeps the placeholder visible next to the chips when `multiple` is set.
231
+ * By default it hides once a value is selected.
232
+ *
233
+ * @default false
234
+ */
235
+ persistentPlaceholder?: boolean;
229
236
  /**
230
237
  * Placeholder shown when no value is selected.
231
238
  */
@@ -487,9 +487,9 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
487
487
  "aria-expanded": boolean;
488
488
  readonly: boolean;
489
489
  onKeydown: (event: KeyboardEvent) => void;
490
- placeholder: string | undefined;
491
490
  "aria-autocomplete": string | undefined;
492
491
  "aria-activedescendant": string | undefined;
492
+ placeholder: string | undefined;
493
493
  } | {
494
494
  onInput: (event: Event) => void;
495
495
  role: string;
@@ -498,9 +498,9 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
498
498
  "aria-expanded": boolean;
499
499
  readonly: boolean;
500
500
  onKeydown: (event: KeyboardEvent) => void;
501
- placeholder: string | undefined;
502
501
  "aria-autocomplete": string | undefined;
503
502
  "aria-activedescendant": string | undefined;
503
+ placeholder: string | undefined;
504
504
  }, import('@bridge-ui/core/Utils').MergePartBind<object, "class", {
505
505
  id: string;
506
506
  disabled: boolean;
@@ -33,7 +33,8 @@ var Me = [
33
33
  "disableMaxHeight",
34
34
  "hideEmptyMessage",
35
35
  "minItemsForSearch",
36
- "optionDescription"
36
+ "optionDescription",
37
+ "persistentPlaceholder"
37
38
  ];
38
39
  function m(m, h, g, _, Ne) {
39
40
  let Pe = de(), v = pe(), y = fe(), Fe = n(), b = e(), x = s(!1), S = s(""), C = s(!1), w = s(-1), T = s([]), E = s([]), D = s([]), O = s(null), k = null, A = a(() => je({
@@ -278,9 +279,9 @@ function m(m, h, g, _, Ne) {
278
279
  "aria-expanded": x.value,
279
280
  readonly: Ye.value,
280
281
  onKeydown: ft,
281
- placeholder: j.value.placeholder,
282
282
  "aria-autocomplete": W.value ? "list" : void 0,
283
283
  "aria-activedescendant": x.value ? q.activeDescendantId.value : void 0,
284
+ placeholder: N.value && H.value && !j.value.persistentPlaceholder ? void 0 : j.value.placeholder,
284
285
  ...N.value ? {
285
286
  rows: 1,
286
287
  onInput: (e) => {
@@ -44,11 +44,11 @@ function v(v, y) {
44
44
  return s(e, C.value.size);
45
45
  }), F = i(() => C.value.customProps), I = i(() => t(F.value?.root, S.value.inheritedAttrs, m({
46
46
  "inline-flex shrink-0 items-center justify-center overflow-hidden": !0,
47
- [T.value.root ?? ""]: !0,
48
47
  [N.value ?? ""]: !0,
49
48
  [j.value ?? ""]: A.value || E.value || D.value,
50
49
  [s(M.value, "background") ?? ""]: A.value,
51
- [s(M.value, "text") ?? ""]: A.value
50
+ [s(M.value, "text") ?? ""]: A.value,
51
+ [T.value.root ?? ""]: !0
52
52
  }))), L = i(() => t(F.value?.image, {
53
53
  alt: C.value.alt,
54
54
  src: C.value.src
@@ -1,229 +1,230 @@
1
1
  import { useDateAdapter as e } from "../../../Adapters/Date/useDateAdapter.js";
2
2
  import { useResolveMessage as t } from "../../../Adapters/I18n/useI18nAdapter.js";
3
- import { mergePartBind as n, useBridgeUIComponent as ee, useBridgeUIMergedRegistryClasses as te } from "../../../Utils/index.js";
4
- import { computed as r, getCurrentInstance as i, ref as a, toValue as o, useAttrs as s } from "vue";
5
- import { get as c, isFunction as l, isNil as u, omit as ne } from "es-toolkit/compat";
6
- import { CALENDAR_YEAR_PAGE_SIZE as re, applyDateSelection as d, calendarPanelViewFromGranularity as f, getCalendarNavigationMessage as p, getCalendarYearPageStart as m, isCalendarMonthPanelHidden as h, isCalendarYearPanelHidden as g, resolveCalendarFocusDate as ie, resolveCalendarMonthSelection as ae, resolveCalendarNavigation as oe, resolveCalendarPanelView as _, resolveCalendarYearSelection as v, resolveDatePickerMode as y } from "@bridge-ui/core/Domain";
7
- import { calendarRoundedProps as b } from "@bridge-ui/core/Tokens";
8
- import { cn as x, mergeBridgeUILayeredClasses as se, splitComponentProps as ce } from "@bridge-ui/core/Utils";
3
+ import { mergePartBind as n, useBridgeUIComponent as r, useBridgeUIMergedRegistryClasses as i, useDefaultTextSizeClass as ee } from "../../../Utils/index.js";
4
+ import { computed as a, getCurrentInstance as o, ref as s, toValue as c, useAttrs as te } from "vue";
5
+ import { get as ne, isFunction as l, isNil as u, omit as d } from "es-toolkit/compat";
6
+ import { CALENDAR_YEAR_PAGE_SIZE as f, applyDateSelection as p, calendarPanelViewFromGranularity as m, getCalendarNavigationMessage as h, getCalendarYearPageStart as g, isCalendarMonthPanelHidden as _, isCalendarYearPanelHidden as v, resolveCalendarFocusDate as y, resolveCalendarMonthSelection as re, resolveCalendarNavigation as ie, resolveCalendarPanelView as b, resolveCalendarYearSelection as ae, resolveDatePickerMode as oe } from "@bridge-ui/core/Domain";
7
+ import { calendarRoundedProps as se } from "@bridge-ui/core/Tokens";
8
+ import { cn as x, mergeBridgeUILayeredClasses as ce, splitComponentProps as le } from "@bridge-ui/core/Utils";
9
9
  // src/Components/Calendar/composables/useCalendar.ts
10
- var le = /* @__PURE__ */ "fill.view.color.error.range.classes.maxDate.minDate.rounded.disabled.multiple.readOnly.timeZone.viewDate.hideYears.hideMonths.customProps.defaultView.granularity.previewDate.startOfWeek.defaultValue.disableDates.disableYears.hideWeekdays.disableMonths.hideOutsideDays".split(".");
11
- function S(S, C, w, T) {
12
- let E = s(), D = e(), O = t(), k = r(() => ce({
13
- bridgeKeys: le,
10
+ var ue = /* @__PURE__ */ "fill.view.color.error.range.classes.maxDate.minDate.rounded.disabled.multiple.readOnly.timeZone.viewDate.hideYears.hideMonths.customProps.defaultView.granularity.previewDate.startOfWeek.defaultValue.disableDates.disableYears.hideWeekdays.disableMonths.hideOutsideDays".split(".");
11
+ function S(S, de, C, w) {
12
+ let T = te(), E = e(), D = t(), O = a(() => le({
13
+ bridgeKeys: ue,
14
14
  props: {
15
- ...E,
16
- ...o(S)
15
+ ...T,
16
+ ...c(S)
17
17
  }
18
- })), { merged: A, entry: ue } = ee({
19
- libDefaults: C,
18
+ })), { merged: k, entry: A } = r({
19
+ libDefaults: de,
20
20
  componentName: "Calendar",
21
- props: () => k.value.componentProps
22
- }), j = r(() => A.value.customProps), de = r(() => ne(k.value.inheritedAttrs, [
21
+ props: () => O.value.componentProps
22
+ }), j = a(() => k.value.customProps), fe = a(() => d(O.value.inheritedAttrs, [
23
23
  "onChange",
24
24
  "onViewChange",
25
25
  "onViewDateChange",
26
26
  "onPreviewDateChange",
27
27
  "onUpdate:modelValue"
28
- ])), M = te({
29
- props: () => k.value.componentProps,
30
- entry: r(() => {})
31
- }), N = r(() => A.value.timeZone), P = r(() => y({
32
- range: A.value.range,
33
- multiple: A.value.multiple
34
- })), F = r(() => o(S)), I = r(() => {
35
- let e = i()?.vnode.props ?? {}, t = l(e.onViewChange) || l(e["onUpdate:view"]);
28
+ ])), M = i({
29
+ props: () => O.value.componentProps,
30
+ entry: a(() => {})
31
+ }), N = a(() => k.value.timeZone), P = a(() => oe({
32
+ range: k.value.range,
33
+ multiple: k.value.multiple
34
+ })), F = a(() => c(S)), I = a(() => {
35
+ let e = o()?.vnode.props ?? {}, t = l(e.onViewChange) || l(e["onUpdate:view"]);
36
36
  return !u(F.value.view) && t;
37
- }), L = r(() => {
38
- let e = i()?.vnode.props ?? {}, t = l(e.onViewDateChange) || l(e["onUpdate:viewDate"]);
37
+ }), L = a(() => {
38
+ let e = o()?.vnode.props ?? {}, t = l(e.onViewDateChange) || l(e["onUpdate:viewDate"]);
39
39
  return !u(F.value.viewDate) && t;
40
- }), R = a(_({
41
- hideYears: A.value.hideYears,
42
- hideMonths: A.value.hideMonths,
40
+ }), R = s(b({
41
+ hideYears: k.value.hideYears,
42
+ hideMonths: k.value.hideMonths,
43
43
  granularity: F.value.granularity ?? "day",
44
- view: F.value.view ?? A.value.defaultView ?? f(F.value.granularity ?? "day")
45
- })), z = a(D.value.startOfMonth(u(F.value.viewDate) ? ie(w.value, D.value, N.value) : F.value.viewDate, N.value)), B = a(null), V = r(() => A.value.granularity ?? "day"), H = r(() => {
44
+ view: F.value.view ?? k.value.defaultView ?? m(F.value.granularity ?? "day")
45
+ })), z = s(E.value.startOfMonth(u(F.value.viewDate) ? y(C.value, E.value, N.value) : F.value.viewDate, N.value)), B = s(null), V = a(() => k.value.granularity ?? "day"), H = a(() => {
46
46
  let e = I.value ? F.value.view ?? "date" : R.value;
47
- return _({
47
+ return b({
48
48
  view: e,
49
49
  granularity: V.value,
50
- hideYears: A.value.hideYears,
51
- hideMonths: A.value.hideMonths
50
+ hideYears: k.value.hideYears,
51
+ hideMonths: k.value.hideMonths
52
52
  });
53
- }), U = r(() => L.value ? F.value.viewDate : z.value), fe = r(() => String(D.value.getYear(U.value, N.value))), pe = r(() => D.value.getMonthNames()[D.value.getMonth(U.value, N.value)] ?? ""), W = r(() => D.value.getYear(U.value, N.value)), me = r(() => D.value.getMonth(U.value, N.value)), G = r(() => u(B.value) ? m(W.value) : B.value), K = r(() => {
54
- let e = se(b, ue.value?.tokens?.rounded);
55
- return c(e, A.value.rounded);
56
- }), q = (e) => {
57
- I.value || (R.value = e), T("viewChange", e);
53
+ }), U = a(() => L.value ? F.value.viewDate : z.value), pe = a(() => String(E.value.getYear(U.value, N.value))), W = a(() => E.value.getMonthNames()[E.value.getMonth(U.value, N.value)] ?? ""), G = a(() => E.value.getYear(U.value, N.value)), me = a(() => E.value.getMonth(U.value, N.value)), K = a(() => u(B.value) ? g(G.value) : B.value), q = a(() => {
54
+ let e = ce(se, A.value?.tokens?.rounded);
55
+ return ne(e, k.value.rounded);
56
+ }), J = (e) => {
57
+ I.value || (R.value = e), w("viewChange", e);
58
58
  }, he = () => {
59
- B.value = m(W.value), q("year");
60
- }, J = (e) => {
61
- let t = D.value.startOfMonth(e, N.value);
62
- L.value || (z.value = t), T("viewDateChange", t);
59
+ B.value = g(G.value), J("year");
63
60
  }, Y = (e) => {
64
- w.value = e, T("change", e);
61
+ let t = E.value.startOfMonth(e, N.value);
62
+ L.value || (z.value = t), w("viewDateChange", t);
65
63
  }, X = (e) => {
66
- let t = oe({
64
+ C.value = e, w("change", e);
65
+ }, Z = (e) => {
66
+ let t = ie({
67
67
  direction: e,
68
68
  view: H.value,
69
- adapter: D.value,
69
+ adapter: E.value,
70
70
  viewDate: U.value,
71
71
  timeZone: N.value,
72
- yearPageStart: G.value
72
+ yearPageStart: K.value
73
73
  });
74
- t.type === "yearPage" ? B.value = t.yearPageStart : J(t.viewDate);
74
+ t.type === "yearPage" ? B.value = t.yearPageStart : Y(t.viewDate);
75
75
  }, ge = () => {
76
- X(-1);
76
+ Z(-1);
77
77
  }, _e = () => {
78
- X(1);
78
+ Z(1);
79
79
  }, ve = () => {
80
- let e = D.value.startOfMonth(D.value.now(N.value), N.value);
81
- B.value = null, J(e), q(f(V.value));
80
+ let e = E.value.startOfMonth(E.value.now(N.value), N.value);
81
+ B.value = null, Y(e), J(m(V.value));
82
82
  }, ye = (e) => {
83
83
  B.value = null;
84
- let t = v({
84
+ let t = ae({
85
85
  year: e,
86
- adapter: D.value,
86
+ adapter: E.value,
87
87
  viewDate: U.value,
88
88
  timeZone: N.value,
89
89
  granularity: V.value,
90
- hideMonths: A.value.hideMonths
90
+ hideMonths: k.value.hideMonths
91
91
  });
92
- J(t.viewDate), t.type === "commit" ? Y(d({
92
+ Y(t.viewDate), t.type === "commit" ? X(p({
93
93
  mode: P.value,
94
- value: w.value,
94
+ value: C.value,
95
95
  next: t.date,
96
- adapter: D.value,
96
+ adapter: E.value,
97
97
  timeZone: N.value,
98
98
  granularity: V.value
99
- })) : q(t.view);
99
+ })) : J(t.view);
100
100
  }, be = (e) => {
101
- let t = ae({
101
+ let t = re({
102
102
  month: e,
103
- adapter: D.value,
103
+ adapter: E.value,
104
104
  viewDate: U.value,
105
105
  timeZone: N.value,
106
106
  granularity: V.value
107
107
  });
108
- J(t.viewDate), t.type === "commit" ? Y(d({
108
+ Y(t.viewDate), t.type === "commit" ? X(p({
109
109
  mode: P.value,
110
- value: w.value,
110
+ value: C.value,
111
111
  next: t.date,
112
- adapter: D.value,
112
+ adapter: E.value,
113
113
  timeZone: N.value,
114
114
  granularity: V.value
115
- })) : q(t.view);
116
- }, xe = r(() => ({
117
- color: A.value.color,
118
- error: A.value.error,
119
- rounded: A.value.rounded,
120
- maxDate: A.value.maxDate,
121
- minDate: A.value.minDate,
122
- disabled: A.value.disabled,
123
- readOnly: A.value.readOnly,
124
- timeZone: A.value.timeZone
125
- })), Se = r(() => n(j.value?.root, de.value, x({
115
+ })) : J(t.view);
116
+ }, xe = a(() => ({
117
+ color: k.value.color,
118
+ error: k.value.error,
119
+ rounded: k.value.rounded,
120
+ maxDate: k.value.maxDate,
121
+ minDate: k.value.minDate,
122
+ disabled: k.value.disabled,
123
+ readOnly: k.value.readOnly,
124
+ timeZone: k.value.timeZone
125
+ })), Se = a(() => n(j.value?.root, fe.value, x({
126
126
  "flex flex-col overflow-hidden": !0,
127
- "w-full min-w-72": A.value.fill,
128
- "w-72": !A.value.fill,
127
+ "w-full min-w-72": k.value.fill,
128
+ "w-72": !k.value.fill,
129
129
  [M.value.root ?? ""]: !0
130
- }))), Ce = r(() => n(j.value?.header, {}, x({
130
+ }))), Ce = a(() => n(j.value?.header, {}, x({
131
131
  "flex items-center justify-between p-2.5": !0,
132
132
  [M.value.header ?? ""]: !0
133
- }))), we = r(() => n(j.value?.body, {}, x({
133
+ }))), we = a(() => n(j.value?.body, {}, x({
134
134
  "flex flex-col p-2.5": !0,
135
135
  [M.value.body ?? ""]: !0
136
- }))), Z = r(() => n(j.value?.selector, {
136
+ }))), Te = ee(), Q = a(() => n(j.value?.selector, {
137
137
  type: "button",
138
- disabled: A.value.disabled
138
+ disabled: k.value.disabled
139
139
  }, x({
140
- "inline-flex cursor-pointer items-center gap-x-2 px-1.5 py-1 text-sm font-medium text-dark-600 hover:bg-dark-100 focus:outline-none disabled:cursor-not-allowed dark:text-dark-300 dark:hover:bg-dark-800": !0,
141
- [K.value ?? ""]: !0,
140
+ "inline-flex cursor-pointer items-center gap-x-2 px-1.5 py-1 font-medium text-dark-600 hover:bg-dark-100 focus:outline-none disabled:cursor-not-allowed dark:text-dark-300 dark:hover:bg-dark-800": !0,
141
+ [q.value ?? ""]: !0,
142
+ [Te.value]: !0,
142
143
  [M.value.selector ?? ""]: !0
143
- }))), Q = r(() => n(j.value?.navButton, {
144
+ }))), $ = a(() => n(j.value?.navButton, {
144
145
  type: "button",
145
- disabled: A.value.disabled
146
+ disabled: k.value.disabled
146
147
  }, x({
147
148
  "inline-flex size-8 shrink-0 cursor-pointer items-center justify-center text-dark-600 hover:bg-dark-100 disabled:cursor-not-allowed dark:text-dark-300 dark:hover:bg-dark-800": !0,
148
- [K.value ?? ""]: !0,
149
+ [q.value ?? ""]: !0,
149
150
  [M.value.navButton ?? ""]: !0
150
- }))), Te = r(() => O(p(H.value, -1))), Ee = r(() => O(p(H.value, 1))), De = r(() => n(j.value?.previousButton, {
151
- ...Q.value,
151
+ }))), Ee = a(() => D(h(H.value, -1))), De = a(() => D(h(H.value, 1))), Oe = a(() => n(j.value?.previousButton, {
152
+ ...$.value,
152
153
  onClick: ge,
153
154
  type: "button",
154
- disabled: A.value.disabled,
155
- "aria-label": Te.value
156
- }, x({ [M.value.navButton ?? ""]: !0 }))), Oe = r(() => n(j.value?.nextButton, {
157
- ...Q.value,
155
+ disabled: k.value.disabled,
156
+ "aria-label": Ee.value
157
+ }, x({ [M.value.navButton ?? ""]: !0 }))), ke = a(() => n(j.value?.nextButton, {
158
+ ...$.value,
158
159
  onClick: _e,
159
160
  type: "button",
160
- disabled: A.value.disabled,
161
- "aria-label": Ee.value
162
- }, x({ [M.value.navButton ?? ""]: !0 }))), $ = r(() => n(j.value?.todayButton, {
161
+ disabled: k.value.disabled,
162
+ "aria-label": De.value
163
+ }, x({ [M.value.navButton ?? ""]: !0 }))), Ae = a(() => n(j.value?.todayButton, {
163
164
  onClick: ve,
164
165
  type: "button",
165
- disabled: A.value.disabled,
166
- "aria-label": O("Today")
166
+ disabled: k.value.disabled,
167
+ "aria-label": D("Today")
167
168
  }, x({
168
169
  "inline-flex size-8 shrink-0 cursor-pointer items-center justify-center hover:bg-dark-100 disabled:cursor-not-allowed dark:hover:bg-dark-800": !0,
169
- [K.value ?? ""]: !0,
170
+ [q.value ?? ""]: !0,
170
171
  [M.value.navButton ?? ""]: !0
171
- }))), ke = r(() => n(j.value?.selector, void 0, {
172
- ...Z.value,
172
+ }))), je = a(() => n(j.value?.selector, void 0, {
173
+ ...Q.value,
173
174
  onClick: he,
174
175
  type: "button",
175
- "aria-label": O("Select year"),
176
- disabled: A.value.disabled || g({
176
+ "aria-label": D("Select year"),
177
+ disabled: k.value.disabled || v({
177
178
  granularity: V.value,
178
- hideYears: A.value.hideYears
179
+ hideYears: k.value.hideYears
179
180
  })
180
- })), Ae = r(() => n(j.value?.selector, void 0, {
181
- ...Z.value,
181
+ })), Me = a(() => n(j.value?.selector, void 0, {
182
+ ...Q.value,
182
183
  type: "button",
183
- onClick: () => q("month"),
184
- "aria-label": O("Select month"),
185
- disabled: A.value.disabled || h({
184
+ onClick: () => J("month"),
185
+ "aria-label": D("Select month"),
186
+ disabled: k.value.disabled || _({
186
187
  granularity: V.value,
187
- hideMonths: A.value.hideMonths
188
+ hideMonths: k.value.hideMonths
188
189
  })
189
- })), je = r(() => !g({
190
+ })), Ne = a(() => !v({
190
191
  granularity: V.value,
191
- hideYears: A.value.hideYears
192
- })), Me = r(() => !h({
192
+ hideYears: k.value.hideYears
193
+ })), Pe = a(() => !_({
193
194
  granularity: V.value,
194
- hideMonths: A.value.hideMonths
195
+ hideMonths: k.value.hideMonths
195
196
  }));
196
197
  return {
197
198
  view: H,
198
199
  mode: P,
199
- model: w,
200
- merged: A,
200
+ model: C,
201
+ merged: k,
201
202
  shared: xe,
202
- showNav: r(() => !0),
203
+ showNav: a(() => !0),
203
204
  timeZone: N,
204
205
  rootBind: Se,
205
206
  viewDate: U,
206
- viewYear: W,
207
+ viewYear: G,
207
208
  bodyBind: we,
208
209
  viewMonth: me,
209
- yearLabel: fe,
210
- monthLabel: pe,
210
+ yearLabel: pe,
211
+ monthLabel: W,
211
212
  headerBind: Ce,
212
- setViewDate: J,
213
- navIconBind: r(() => j.value?.navIcon),
213
+ setViewDate: Y,
214
+ navIconBind: a(() => j.value?.navIcon),
214
215
  granularity: V,
215
- handleChange: Y,
216
- nextButtonBind: Oe,
217
- todayButtonBind: $,
218
- yearSelectorBind: ke,
216
+ handleChange: X,
217
+ nextButtonBind: ke,
218
+ todayButtonBind: Ae,
219
+ yearSelectorBind: je,
219
220
  handleYearSelect: ye,
220
- showYearSelector: je,
221
- monthSelectorBind: Ae,
221
+ showYearSelector: Ne,
222
+ monthSelectorBind: Me,
222
223
  handleMonthSelect: be,
223
- showMonthSelector: Me,
224
- previousButtonBind: De,
225
- yearPageStart: G,
226
- yearPageSize: re
224
+ showMonthSelector: Pe,
225
+ previousButtonBind: Oe,
226
+ yearPageStart: K,
227
+ yearPageSize: f
227
228
  };
228
229
  }
229
230
  export { S as useCalendar };