@companix/uikit 0.0.11 → 0.0.14

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 (42) hide show
  1. package/dist/DatePicker/index.d.ts +0 -1
  2. package/dist/Input/index.d.ts +1 -1
  3. package/dist/Select/SelectInput.d.ts +1 -0
  4. package/dist/Select/index.d.ts +2 -5
  5. package/dist/SelectTags/index.d.ts +1 -0
  6. package/dist/TextArea/index.d.ts +2 -1
  7. package/dist/__hooks/use-loading.d.ts +2 -2
  8. package/dist/bundle.es.js +12 -10
  9. package/dist/bundle.es10.js +1 -1
  10. package/dist/bundle.es14.js +1 -1
  11. package/dist/bundle.es19.js +1 -1
  12. package/dist/bundle.es20.js +1 -1
  13. package/dist/bundle.es23.js +17 -15
  14. package/dist/bundle.es24.js +38 -36
  15. package/dist/bundle.es25.js +3 -3
  16. package/dist/bundle.es27.js +11 -10
  17. package/dist/bundle.es28.js +10 -24
  18. package/dist/bundle.es29.js +17 -28
  19. package/dist/bundle.es30.js +32 -20
  20. package/dist/bundle.es31.js +24 -81
  21. package/dist/bundle.es32.js +83 -18
  22. package/dist/bundle.es33.js +17 -13
  23. package/dist/bundle.es34.js +14 -22
  24. package/dist/bundle.es35.js +22 -5
  25. package/dist/bundle.es36.js +5 -21
  26. package/dist/bundle.es37.js +13 -13
  27. package/dist/bundle.es38.js +13 -69
  28. package/dist/bundle.es39.js +68 -66
  29. package/dist/bundle.es40.js +67 -31
  30. package/dist/bundle.es41.js +23 -59
  31. package/dist/bundle.es42.js +67 -30
  32. package/dist/bundle.es43.js +30 -74
  33. package/dist/bundle.es44.js +71 -45
  34. package/dist/bundle.es45.js +47 -41
  35. package/dist/bundle.es46.js +45 -0
  36. package/dist/bundle.es8.js +50 -54
  37. package/dist/bundle.es9.js +1 -1
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.scss +1 -1
  40. package/package.json +1 -1
  41. /package/dist/{FormLabel/FormLabel.scss → FormGroup/FormGroup.scss} +0 -0
  42. /package/dist/{FormLabel → FormGroup}/index.d.ts +0 -0
@@ -1,83 +1,26 @@
1
- import { jsxs as n, jsx as c } from "react/jsx-runtime";
2
- import b from "classnames";
3
- import { attr as r } from "@companix/utils-browser";
4
- import { forwardRef as g, useRef as w, useCallback as y } from "react";
5
- import { Icon as a } from "./bundle.es34.js";
6
- import { faClose as D, faChevronDown as R } from "@fortawesome/free-solid-svg-icons";
7
- import { VisuallyHidden as T } from "@radix-ui/react-visually-hidden";
8
- const V = g(
9
- ({
10
- required: u,
11
- size: d,
12
- fill: m,
13
- leftElement: l,
14
- className: p,
15
- value: o,
16
- clearButton: f,
17
- placeholder: C,
18
- clearButtonIcon: h,
19
- disabled: s,
20
- onClear: I,
21
- ...i
22
- }, N) => {
23
- const e = w(null), k = y(
24
- (t) => {
25
- if (!e.current || !document)
26
- return;
27
- t.target !== e.current && (e.current.click(), document.activeElement !== e.current && e.current.focus());
28
- },
29
- [e]
30
- ), x = (t) => {
31
- document && document.activeElement === e.current && t.preventDefault();
32
- }, v = (t) => {
33
- s || k(t);
34
- }, F = (t) => {
35
- x(t);
36
- }, z = (t) => {
37
- e.current && e.current.focus(), I?.(t);
38
- };
39
- return /* @__PURE__ */ n(
40
- "div",
41
- {
42
- ref: N,
43
- className: b("form select", p),
44
- "data-size": d ?? "md",
45
- "data-fill": r(m),
46
- "data-required": r(u),
47
- "data-disabled": r(s),
48
- onMouseDown: F,
49
- ...i,
50
- onClick: v,
51
- children: [
52
- /* @__PURE__ */ n("div", { className: "select-layout form-input", children: [
53
- l && /* @__PURE__ */ c("div", { className: "select-element", children: l }),
54
- /* @__PURE__ */ c("div", { className: "select-content", children: /* @__PURE__ */ n("div", { className: "select-content-text", "aria-disabled": s, children: [
55
- !o && /* @__PURE__ */ c("span", { className: "select-placeholder", children: C }),
56
- o
57
- ] }) }),
58
- /* @__PURE__ */ n("div", { className: "select-element", children: [
59
- f && o && /* @__PURE__ */ c("button", { className: "select-close-button", onClick: z, children: h ?? /* @__PURE__ */ c(a, { className: "select-close-icon", icon: D, size: "xxxs" }) }),
60
- /* @__PURE__ */ c(a, { className: "expand-icon select-expand", icon: R, size: "xxxs" })
61
- ] })
62
- ] }),
63
- /* @__PURE__ */ c(T, { asChild: !0, children: /* @__PURE__ */ c(
64
- "input",
65
- {
66
- ref: e,
67
- autoComplete: "off",
68
- autoCapitalize: "none",
69
- autoCorrect: "off",
70
- spellCheck: "false",
71
- "aria-autocomplete": "none",
72
- onClick: i.onClick,
73
- readOnly: !0
74
- }
75
- ) })
76
- ]
77
- }
78
- );
79
- }
80
- );
1
+ import { useRef as s, useCallback as c } from "react";
2
+ const p = () => {
3
+ const t = s(null), r = s({ cb: null }), i = c(() => {
4
+ if (t.current && t.current.parentElement) {
5
+ const e = t.current.parentElement, u = e.style.getPropertyValue("--radix-popper-anchor-width"), n = e.style.getPropertyValue("transform"), o = new MutationObserver(() => {
6
+ e.style.transform !== n && e.style.setProperty("transform", n);
7
+ });
8
+ o.observe(e, {
9
+ attributes: !0,
10
+ attributeFilter: ["style"]
11
+ }), r.current.cb = () => {
12
+ o.disconnect();
13
+ }, t.current.style.setProperty("--radix-popover-trigger-width", u);
14
+ }
15
+ }, []), l = c(() => {
16
+ r.current.cb && (r.current.cb(), r.current.cb = null);
17
+ }, []);
18
+ return {
19
+ popoverRef: t,
20
+ handleAnimationEnd: l,
21
+ froozePopoverPosition: i
22
+ };
23
+ };
81
24
  export {
82
- V as SelectInput
25
+ p as useFroozeClosing
83
26
  };
@@ -1,20 +1,85 @@
1
- import { useRef as i, useCallback as T } from "react";
2
- const a = () => {
3
- const t = i(null), l = i(null);
4
- return { scrollToElement: T(
5
- (r, u = !1) => {
6
- const o = t.current, s = l.current;
7
- if (!o || !s || r < 0 || r > s.children.length)
8
- return;
9
- const n = s.children[r];
10
- if (!n)
11
- return;
12
- const c = o.offsetHeight, f = o.scrollTop, e = n.offsetTop, p = n.offsetHeight;
13
- u ? o.scrollTop = e - c / 2 + p / 2 : e + p > c + f ? o.scrollTop = e - c + p : e < f && (o.scrollTop = e);
14
- },
15
- [l, t]
16
- ), scrollBoxRef: t, optionsWrapperRef: l };
17
- };
1
+ import { jsxs as n, jsx as c } from "react/jsx-runtime";
2
+ import R from "classnames";
3
+ import { attr as r } from "@companix/utils-browser";
4
+ import { forwardRef as b, useRef as w, useCallback as y } from "react";
5
+ import { Icon as a } from "./bundle.es35.js";
6
+ import { faClose as D, faChevronDown as T } from "@fortawesome/free-solid-svg-icons";
7
+ import { VisuallyHidden as j } from "@radix-ui/react-visually-hidden";
8
+ import { mergeRefs as O } from "react-merge-refs";
9
+ const J = b(
10
+ ({
11
+ required: u,
12
+ size: d,
13
+ fill: m,
14
+ leftElement: l,
15
+ className: f,
16
+ value: o,
17
+ clearButton: p,
18
+ placeholder: C,
19
+ clearButtonIcon: h,
20
+ disabled: s,
21
+ onClear: I,
22
+ inputRef: N,
23
+ ...i
24
+ }, k) => {
25
+ const e = w(null), x = y(
26
+ (t) => {
27
+ if (!e.current || !document)
28
+ return;
29
+ t.target !== e.current && (e.current.click(), document.activeElement !== e.current && e.current.focus());
30
+ },
31
+ [e]
32
+ ), v = (t) => {
33
+ document && document.activeElement === e.current && t.preventDefault();
34
+ }, F = (t) => {
35
+ s || x(t);
36
+ }, g = (t) => {
37
+ v(t);
38
+ }, z = (t) => {
39
+ e.current && e.current.focus(), I?.(t);
40
+ };
41
+ return /* @__PURE__ */ n(
42
+ "div",
43
+ {
44
+ ref: k,
45
+ className: R("form select", f),
46
+ "data-size": d ?? "md",
47
+ "data-fill": r(m),
48
+ "data-required": r(u),
49
+ "data-disabled": r(s),
50
+ onMouseDown: g,
51
+ ...i,
52
+ onClick: F,
53
+ children: [
54
+ /* @__PURE__ */ n("div", { className: "select-layout form-input", children: [
55
+ l && /* @__PURE__ */ c("div", { className: "select-element", children: l }),
56
+ /* @__PURE__ */ c("div", { className: "select-content", children: /* @__PURE__ */ n("div", { className: "select-content-text", "aria-disabled": s, children: [
57
+ !o && /* @__PURE__ */ c("span", { className: "select-placeholder", children: C }),
58
+ o
59
+ ] }) }),
60
+ /* @__PURE__ */ n("div", { className: "select-element", children: [
61
+ p && o && /* @__PURE__ */ c("button", { className: "select-close-button", onClick: z, children: h ?? /* @__PURE__ */ c(a, { className: "select-close-icon", icon: D, size: "xxxs" }) }),
62
+ /* @__PURE__ */ c(a, { className: "expand-icon select-expand", icon: T, size: "xxxs" })
63
+ ] })
64
+ ] }),
65
+ /* @__PURE__ */ c(j, { asChild: !0, children: /* @__PURE__ */ c(
66
+ "input",
67
+ {
68
+ ref: O([N, e]),
69
+ autoComplete: "off",
70
+ autoCapitalize: "none",
71
+ autoCorrect: "off",
72
+ spellCheck: "false",
73
+ "aria-autocomplete": "none",
74
+ onClick: i.onClick,
75
+ readOnly: !0
76
+ }
77
+ ) })
78
+ ]
79
+ }
80
+ );
81
+ }
82
+ );
18
83
  export {
19
- a as useScrollListController
84
+ J as SelectInput
20
85
  };
@@ -1,16 +1,20 @@
1
- import { useRef as u, useLayoutEffect as f, useEffect as s } from "react";
2
- const o = (t, r) => {
3
- const e = u(!1);
4
- f(() => {
5
- e.current = !0, t();
6
- }, []), s(() => {
7
- if (e.current) {
8
- e.current = !1;
9
- return;
10
- }
11
- t();
12
- }, r);
1
+ import { useRef as i, useCallback as T } from "react";
2
+ const a = () => {
3
+ const t = i(null), l = i(null);
4
+ return { scrollToElement: T(
5
+ (r, u = !1) => {
6
+ const o = t.current, s = l.current;
7
+ if (!o || !s || r < 0 || r > s.children.length)
8
+ return;
9
+ const n = s.children[r];
10
+ if (!n)
11
+ return;
12
+ const c = o.offsetHeight, f = o.scrollTop, e = n.offsetTop, p = n.offsetHeight;
13
+ u ? o.scrollTop = e - c / 2 + p / 2 : e + p > c + f ? o.scrollTop = e - c + p : e < f && (o.scrollTop = e);
14
+ },
15
+ [l, t]
16
+ ), scrollBoxRef: t, optionsWrapperRef: l };
13
17
  };
14
18
  export {
15
- o as useLayoutAndUpdate
19
+ a as useScrollListController
16
20
  };
@@ -1,24 +1,16 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import f from "classnames";
3
- import { forwardRef as l } from "react";
4
- const g = l(
5
- ({ icon: r, className: t, size: i = "m", ...e }, a) => {
6
- const [n, c, , , m] = r.icon;
7
- return /* @__PURE__ */ o(
8
- "svg",
9
- {
10
- ref: a,
11
- "data-prefix": r.prefix,
12
- "data-icon": r.iconName,
13
- viewBox: `0 0 ${n} ${c}`,
14
- className: f(`icon icon-size-${i}`, t),
15
- ...e,
16
- role: "img",
17
- children: /* @__PURE__ */ o(s, { paths: m })
18
- }
19
- );
20
- }
21
- ), s = ({ paths: r }) => Array.isArray(r) ? /* @__PURE__ */ o("g", { children: r.map((t, i) => /* @__PURE__ */ o("path", { fill: "currentColor", d: t }, `-d-${i}`)) }) : /* @__PURE__ */ o("path", { fill: "currentColor", d: r });
1
+ import { useRef as u, useLayoutEffect as f, useEffect as s } from "react";
2
+ const o = (t, r) => {
3
+ const e = u(!1);
4
+ f(() => {
5
+ e.current = !0, t();
6
+ }, []), s(() => {
7
+ if (e.current) {
8
+ e.current = !1;
9
+ return;
10
+ }
11
+ t();
12
+ }, r);
13
+ };
22
14
  export {
23
- g as Icon
15
+ o as useLayoutAndUpdate
24
16
  };
@@ -1,7 +1,24 @@
1
- import { useEffect as r } from "react";
2
- const n = ({ callback: e }) => (r(() => () => {
3
- e?.();
4
- }, []), null);
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import f from "classnames";
3
+ import { forwardRef as l } from "react";
4
+ const g = l(
5
+ ({ icon: r, className: t, size: i = "m", ...e }, a) => {
6
+ const [n, c, , , m] = r.icon;
7
+ return /* @__PURE__ */ o(
8
+ "svg",
9
+ {
10
+ ref: a,
11
+ "data-prefix": r.prefix,
12
+ "data-icon": r.iconName,
13
+ viewBox: `0 0 ${n} ${c}`,
14
+ className: f(`icon icon-size-${i}`, t),
15
+ ...e,
16
+ role: "img",
17
+ children: /* @__PURE__ */ o(s, { paths: m })
18
+ }
19
+ );
20
+ }
21
+ ), s = ({ paths: r }) => Array.isArray(r) ? /* @__PURE__ */ o("g", { children: r.map((t, i) => /* @__PURE__ */ o("path", { fill: "currentColor", d: t }, `-d-${i}`)) }) : /* @__PURE__ */ o("path", { fill: "currentColor", d: r });
5
22
  export {
6
- n as RemoveListener
23
+ g as Icon
7
24
  };
@@ -1,23 +1,7 @@
1
- import { useState as a } from "react";
2
- const l = ({ onClick: i }) => {
3
- const [e, s] = a({ isLoading: !1, isError: !1 });
4
- return {
5
- ...e,
6
- handleClick: (o) => {
7
- e.isLoading || i(() => s({ isLoading: !0, isError: !1 }), o).then(() => {
8
- s({
9
- isLoading: !1,
10
- isError: !1
11
- });
12
- }).catch((r) => {
13
- console.log(r), s({
14
- isLoading: !1,
15
- isError: !0
16
- });
17
- });
18
- }
19
- };
20
- };
1
+ import { useEffect as r } from "react";
2
+ const n = ({ callback: e }) => (r(() => () => {
3
+ e?.();
4
+ }, []), null);
21
5
  export {
22
- l as useLoading
6
+ n as RemoveListener
23
7
  };
@@ -1,16 +1,16 @@
1
- import { useRef as i, useCallback as o } from "react";
2
- const f = (e, s) => {
3
- const r = i(null), c = i(void 0), n = o(
4
- (t) => {
5
- s && t.offsetParent && (t.style.height = "", t.style.height = `${t.scrollHeight}px`, t.scrollHeight !== c.current && e && (e(t), c.current = t.scrollHeight));
6
- },
7
- [s, e]
8
- ), l = o(() => {
9
- const t = r.current;
10
- t && n(t);
11
- }, [r, n]);
12
- return [r, l];
1
+ import { useState as e } from "react";
2
+ const d = ({ onClick: t }) => {
3
+ const [a, s] = e({ isLoading: !1, isError: !1 });
4
+ return { ...a, handleClick: (r) => {
5
+ a.isLoading || t(() => {
6
+ s({ isLoading: !0, isError: !1 });
7
+ }, r).then(() => {
8
+ s({ isLoading: !1, isError: !1 });
9
+ }).catch(() => {
10
+ s({ isLoading: !1, isError: !0 });
11
+ });
12
+ } };
13
13
  };
14
14
  export {
15
- f as useResizeTextarea
15
+ d as useLoading
16
16
  };
@@ -1,72 +1,16 @@
1
- import { jsxs as D, jsx as t } from "react/jsx-runtime";
2
- import { dateToFormat as $, weeks as g, createVoids as p, getDayIndex as b, getFirstDay as u, getMonthMaxDay as k } from "./bundle.es42.js";
3
- import { CalendarHeader as F } from "./bundle.es43.js";
4
- import { useCalendar as j } from "./bundle.es44.js";
5
- import { attr as m } from "@companix/utils-browser";
6
- import { isSameDate as f } from "./bundle.es39.js";
7
- import { useLayoutEffect as I } from "react";
8
- const T = ({ disablePickers: c, value: e, onChange: i, ...l }) => {
9
- const {
10
- viewDate: n,
11
- setViewDate: r,
12
- setNextMonth: N,
13
- setPrevMonth: x,
14
- isMonthDisabled: M,
15
- isYearDisabled: v,
16
- isDayDisabled: w
17
- } = j(l);
18
- I(() => {
19
- e && r(e);
20
- }, [e]);
21
- const o = $(n), h = n.getMonth(), y = n.getFullYear(), C = /* @__PURE__ */ new Date();
22
- return /* @__PURE__ */ D("div", { className: "calendar", children: [
23
- /* @__PURE__ */ t(
24
- F,
25
- {
26
- viewDate: n,
27
- onChange: r,
28
- onNextMonth: N,
29
- onPrevMonth: x,
30
- disablePickers: c,
31
- isMonthDisabled: M,
32
- isYearDisabled: v
33
- }
34
- ),
35
- /* @__PURE__ */ t("div", { className: "calendar-names", children: g.map((d, a) => /* @__PURE__ */ t("div", { className: "calendar-name", children: d }, `week-name-${a}`)) }),
36
- /* @__PURE__ */ D("div", { className: "calendar-days", children: [
37
- p(b(u(o.month, o.year))).map((d, a) => /* @__PURE__ */ t("div", { className: "calendar-day", "data-void": !0 }, `void-${d}-${a}`)),
38
- p(k(o.month, o.year)).map((d, a) => {
39
- const s = new Date(y, h, a + 1);
40
- return /* @__PURE__ */ t(
41
- P,
42
- {
43
- day: a + 1,
44
- disabled: w(s),
45
- selected: !!(e && f(e, s)),
46
- today: f(s, C),
47
- onSelect: () => i?.(s)
48
- },
49
- `date-${d}-${y}-${h}-${a}`
50
- );
51
- })
52
- ] })
53
- ] });
54
- }, P = ({ day: c, disabled: e, selected: i, today: l, onSelect: n }) => {
55
- const r = () => {
56
- e || n?.();
57
- };
58
- return /* @__PURE__ */ t(
59
- "div",
60
- {
61
- className: "calendar-day",
62
- "data-disabled": m(e),
63
- "data-selected": m(i),
64
- "data-today": m(l),
65
- onClick: r,
66
- children: /* @__PURE__ */ t("span", { className: "calendar-day-number", children: c })
67
- }
68
- );
1
+ import { useRef as i, useCallback as o } from "react";
2
+ const f = (e, s) => {
3
+ const r = i(null), c = i(void 0), n = o(
4
+ (t) => {
5
+ s && t.offsetParent && (t.style.height = "", t.style.height = `${t.scrollHeight}px`, t.scrollHeight !== c.current && e && (e(t), c.current = t.scrollHeight));
6
+ },
7
+ [s, e]
8
+ ), l = o(() => {
9
+ const t = r.current;
10
+ t && n(t);
11
+ }, [r, n]);
12
+ return [r, l];
69
13
  };
70
14
  export {
71
- T as Calendar
15
+ f as useResizeTextarea
72
16
  };
@@ -1,70 +1,72 @@
1
- import { useMemo as D, useCallback as c } from "react";
2
- function l(e, t) {
3
- return e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
4
- }
5
- function f(e) {
6
- const t = new Date(e);
7
- return t.setHours(0, 0, 0, 0), t;
8
- }
9
- function h(e) {
10
- const t = new Date(e);
11
- return t.setHours(23, 59, 59, 999), t;
12
- }
13
- function M(e, t = {}) {
14
- const { min: n, max: r, withTime: s = !1 } = t;
15
- return !s && (n && l(e, n) || r && l(e, r)) ? !1 : !!(n && e < n || r && e > r);
16
- }
17
- function m(e, t) {
18
- const n = new Date(e);
19
- if (!t)
20
- return n;
21
- const r = n.getDate(), s = new Date(e);
22
- s.setMonth(n.getMonth() + t + 1, 0);
23
- const a = s.getDate();
24
- return r >= a ? s : (n.setFullYear(s.getFullYear(), s.getMonth(), r), n);
25
- }
26
- function F(e, t) {
27
- return m(e, -1);
28
- }
29
- function g(e) {
30
- const t = new Date(e), n = new Date(t);
31
- return n.setFullYear(t.getFullYear(), t.getMonth() + 1, 0), n.setHours(0, 0, 0, 0), n.getDate();
32
- }
33
- function Y(e, t) {
34
- const n = new Date(e);
35
- return n.setFullYear(t), n;
36
- }
37
- function y(e, t) {
38
- const n = new Date(e), r = n.getFullYear(), s = n.getDate(), a = new Date(e);
39
- a.setFullYear(r, t, 15), a.setHours(0, 0, 0, 0);
40
- const u = g(a);
41
- return n.setMonth(t, Math.min(s, u)), n;
42
- }
43
- const w = (e) => {
44
- const { disableFuture: t, disablePast: n, maxDateTime: r, minDateTime: s, shouldDisableDate: a } = e;
45
- return (u, i) => {
46
- const o = /* @__PURE__ */ new Date();
47
- return a ? a(u) : t ? f(u) > o : n ? h(u) < o : s || r ? M(u, { min: s, max: r, withTime: i }) : !1;
1
+ import { jsxs as D, jsx as t } from "react/jsx-runtime";
2
+ import { dateToFormat as $, weeks as g, createVoids as p, getDayIndex as b, getFirstDay as u, getMonthMaxDay as k } from "./bundle.es43.js";
3
+ import { CalendarHeader as F } from "./bundle.es44.js";
4
+ import { useCalendar as j } from "./bundle.es45.js";
5
+ import { attr as m } from "@companix/utils-browser";
6
+ import { isSameDate as f } from "./bundle.es40.js";
7
+ import { useLayoutEffect as I } from "react";
8
+ const T = ({ disablePickers: c, value: e, onChange: i, ...l }) => {
9
+ const {
10
+ viewDate: n,
11
+ setViewDate: r,
12
+ setNextMonth: N,
13
+ setPrevMonth: x,
14
+ isMonthDisabled: M,
15
+ isYearDisabled: v,
16
+ isDayDisabled: w
17
+ } = j(l);
18
+ I(() => {
19
+ e && r(e);
20
+ }, [e]);
21
+ const o = $(n), h = n.getMonth(), y = n.getFullYear(), C = /* @__PURE__ */ new Date();
22
+ return /* @__PURE__ */ D("div", { className: "calendar", children: [
23
+ /* @__PURE__ */ t(
24
+ F,
25
+ {
26
+ viewDate: n,
27
+ onChange: r,
28
+ onNextMonth: N,
29
+ onPrevMonth: x,
30
+ disablePickers: c,
31
+ isMonthDisabled: M,
32
+ isYearDisabled: v
33
+ }
34
+ ),
35
+ /* @__PURE__ */ t("div", { className: "calendar-names", children: g.map((d, a) => /* @__PURE__ */ t("div", { className: "calendar-name", children: d }, `week-name-${a}`)) }),
36
+ /* @__PURE__ */ D("div", { className: "calendar-days", children: [
37
+ p(b(u(o.month, o.year))).map((d, a) => /* @__PURE__ */ t("div", { className: "calendar-day", "data-void": !0 }, `void-${d}-${a}`)),
38
+ p(k(o.month, o.year)).map((d, a) => {
39
+ const s = new Date(y, h, a + 1);
40
+ return /* @__PURE__ */ t(
41
+ P,
42
+ {
43
+ day: a + 1,
44
+ disabled: w(s),
45
+ selected: !!(e && f(e, s)),
46
+ today: f(s, C),
47
+ onSelect: () => i?.(s)
48
+ },
49
+ `date-${d}-${y}-${h}-${a}`
50
+ );
51
+ })
52
+ ] })
53
+ ] });
54
+ }, P = ({ day: c, disabled: e, selected: i, today: l, onSelect: n }) => {
55
+ const r = () => {
56
+ e || n?.();
48
57
  };
49
- }, d = (e) => {
50
- const t = D(() => w(e), [
51
- e.disableFuture,
52
- e.disablePast,
53
- e.shouldDisableDate,
54
- e.minDateTime,
55
- e.maxDateTime
56
- ]);
57
- return c(t, [t]);
58
+ return /* @__PURE__ */ t(
59
+ "div",
60
+ {
61
+ className: "calendar-day",
62
+ "data-disabled": m(e),
63
+ "data-selected": m(i),
64
+ "data-today": m(l),
65
+ onClick: r,
66
+ children: /* @__PURE__ */ t("span", { className: "calendar-day-number", children: c })
67
+ }
68
+ );
58
69
  };
59
70
  export {
60
- m as addMonths,
61
- w as createDayDisableChecker,
62
- h as endOfDay,
63
- M as isDayMinMaxRestricted,
64
- l as isSameDate,
65
- y as setMonth,
66
- Y as setYear,
67
- f as startOfDay,
68
- F as subMonths,
69
- d as useDayDisableCheker
71
+ T as Calendar
70
72
  };