@companix/uikit 0.0.31 → 0.0.33

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 (66) hide show
  1. package/dist/DatePicker/index.d.ts +1 -1
  2. package/dist/Popover/index.d.ts +1 -0
  3. package/dist/ThemeProvider/script.d.ts +1 -0
  4. package/dist/__hooks/useCalendar.d.ts +1 -1
  5. package/dist/__libs/calendar.d.ts +1 -1
  6. package/dist/bundle.es.js +30 -27
  7. package/dist/bundle.es10.js +2 -2
  8. package/dist/bundle.es11.js +1 -1
  9. package/dist/bundle.es12.js +1 -1
  10. package/dist/bundle.es14.js +1 -1
  11. package/dist/bundle.es17.js +7 -6
  12. package/dist/bundle.es18.js +1 -1
  13. package/dist/bundle.es19.js +1 -1
  14. package/dist/bundle.es20.js +1 -1
  15. package/dist/bundle.es23.js +1 -1
  16. package/dist/bundle.es24.js +3 -3
  17. package/dist/bundle.es25.js +27 -26
  18. package/dist/bundle.es26.js +2 -2
  19. package/dist/bundle.es29.js +2 -2
  20. package/dist/bundle.es32.js +13 -17
  21. package/dist/bundle.es33.js +21 -10
  22. package/dist/bundle.es34.js +10 -24
  23. package/dist/bundle.es35.js +17 -31
  24. package/dist/bundle.es36.js +36 -48
  25. package/dist/bundle.es37.js +49 -41
  26. package/dist/bundle.es38.js +42 -8
  27. package/dist/bundle.es39.js +8 -23
  28. package/dist/bundle.es40.js +24 -87
  29. package/dist/bundle.es41.js +87 -18
  30. package/dist/bundle.es42.js +16 -18
  31. package/dist/bundle.es43.js +20 -24
  32. package/dist/bundle.es44.js +20 -35
  33. package/dist/bundle.es45.js +39 -3
  34. package/dist/bundle.es46.js +3 -5
  35. package/dist/bundle.es47.js +5 -14
  36. package/dist/bundle.es48.js +13 -13
  37. package/dist/bundle.es49.js +14 -3
  38. package/dist/bundle.es50.js +3 -3
  39. package/dist/bundle.es51.js +3 -70
  40. package/dist/bundle.es52.js +68 -66
  41. package/dist/bundle.es53.js +67 -69
  42. package/dist/bundle.es54.js +69 -11
  43. package/dist/bundle.es55.js +11 -42
  44. package/dist/bundle.es56.js +42 -14
  45. package/dist/bundle.es57.js +11 -20
  46. package/dist/bundle.es59.js +1 -1
  47. package/dist/bundle.es62.js +13 -75
  48. package/dist/bundle.es63.js +20 -49
  49. package/dist/bundle.es64.js +2 -14
  50. package/dist/bundle.es65.js +18 -17
  51. package/dist/bundle.es66.js +2 -2
  52. package/dist/bundle.es67.js +17 -18
  53. package/dist/bundle.es68.js +76 -2
  54. package/dist/bundle.es69.js +49 -20
  55. package/dist/bundle.es7.js +19 -17
  56. package/dist/bundle.es71.js +14 -3
  57. package/dist/bundle.es72.js +1 -1
  58. package/dist/bundle.es73.js +3 -14
  59. package/dist/bundle.es9.js +4 -4
  60. package/dist/index.d.ts +2 -1
  61. package/dist/index.scss +1 -2
  62. package/package.json +1 -1
  63. package/dist/DatePicker/DatePicker.scss +0 -0
  64. /package/dist/{DatePicker → Calendar}/Calendar.d.ts +0 -0
  65. /package/dist/{DatePicker → Calendar}/Calendar.scss +0 -0
  66. /package/dist/{DatePicker → Calendar}/CalendarHeader.d.ts +0 -0
@@ -1,17 +1,45 @@
1
- const r = (e, o) => {
2
- let t;
3
- try {
4
- t = localStorage.getItem(e) || void 0;
5
- } catch {
6
- }
7
- return t ?? o;
8
- }, m = (e) => (e || (e = window.matchMedia("(prefers-color-scheme: dark)")), e.matches ? "dark" : "light"), s = (e) => {
9
- const [o, t] = ["theme-light", "theme-dark"];
10
- let c = e;
11
- e === "system" && (c = m()), document.documentElement.classList.remove(o, t), document.documentElement.classList.add(c === "dark" ? t : o), document.documentElement.style.colorScheme = c;
1
+ import { DefaultMonths as f, getMonthMaxDay as i } from "./bundle.es54.js";
2
+ import { useMemo as s } from "react";
3
+ import { range as l } from "@companix/utils-js";
4
+ const p = { day: 31, month: 12, year: 2050 }, u = { day: 1, month: 1, year: 1900 }, I = ({ min: t = u, max: e = p, now: r }) => {
5
+ const h = s(() => l(e.year, t.year).map((n) => ({
6
+ title: n.toString(),
7
+ value: n
8
+ })), [e.year, t.year]), d = s(() => {
9
+ const n = f.map((o, a) => ({
10
+ title: o,
11
+ value: a + 1
12
+ }));
13
+ if (t.month && r.year === t.year) {
14
+ const o = n.findIndex(({ value: a }) => a === t.month);
15
+ n.splice(0, o);
16
+ }
17
+ if (e.month && r.year === e.year) {
18
+ const o = n.findIndex(({ value: a }) => a === e.month);
19
+ n.splice(o + 1, n.length);
20
+ }
21
+ return n;
22
+ }, [r.year, t.year, t.month, e.year, e.month]), c = s(() => {
23
+ if (r.month === 0)
24
+ return [];
25
+ const n = i(r.month, r.year), o = Array.from({ length: n }, (a, y) => ({
26
+ title: `${y + 1}`,
27
+ value: y + 1
28
+ }));
29
+ if (t.day && r.month === t.month && r.year === t.year) {
30
+ const a = o.findIndex(({ value: y }) => y === t.day);
31
+ o.splice(0, a);
32
+ }
33
+ if (e.day && r.month === e.month && r.year === e.year) {
34
+ const a = o.findIndex(({ value: y }) => y === e.day);
35
+ o.splice(a + 1, o.length);
36
+ }
37
+ return o;
38
+ }, [r.month, r.year, t, e]);
39
+ return { years: h, months: d, days: c };
12
40
  };
13
41
  export {
14
- r as getColorScheme,
15
- m as getSystemColorScheme,
16
- s as updateDOM
42
+ p as defaultMax,
43
+ u as defaultMin,
44
+ I as useCalendarOptions
17
45
  };
@@ -1,26 +1,17 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { memo as l } from "react";
3
- const h = l(({ storageKey: o, defaultColorScheme: r }) => {
4
- const e = JSON.stringify([o, r]).slice(1, -1);
5
- return /* @__PURE__ */ n(
6
- "script",
7
- {
8
- suppressHydrationWarning: !0,
9
- dangerouslySetInnerHTML: {
10
- __html: `(${i.toString()})(${e})`
11
- }
12
- }
13
- );
14
- }), i = (o, r) => {
15
- const [e, c] = ["theme-light", "theme-dark"];
1
+ const r = (e, o) => {
2
+ let t;
16
3
  try {
17
- let t = localStorage.getItem(o) || r;
18
- t === "system" && (t = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
19
- const m = t === "dark" ? c : e;
20
- document.documentElement.classList.remove(e, c), document.documentElement.classList.add(m), document.documentElement.style.colorScheme = t;
4
+ t = localStorage.getItem(e) || void 0;
21
5
  } catch {
22
6
  }
7
+ return t ?? o;
8
+ }, m = (e) => (e || (e = window.matchMedia("(prefers-color-scheme: dark)")), e.matches ? "dark" : "light"), s = (e) => {
9
+ const [o, t] = ["theme-light", "theme-dark"];
10
+ let c = e;
11
+ e === "system" && (c = m()), document.documentElement.classList.remove(o, t), document.documentElement.classList.add(c === "dark" ? t : o), document.documentElement.style.colorScheme = c;
23
12
  };
24
13
  export {
25
- h as ColorSchemeScript
14
+ r as getColorScheme,
15
+ m as getSystemColorScheme,
16
+ s as updateDOM
26
17
  };
@@ -2,7 +2,7 @@ import { jsxs as y, jsx as I } from "react/jsx-runtime";
2
2
  import { forwardRef as $, useState as b, useMemo as w, useImperativeHandle as C, useCallback as P, createElement as j } from "react";
3
3
  import * as c from "@radix-ui/react-toast";
4
4
  import { varToStyle as k } from "@companix/utils-browser";
5
- import { Toast as E } from "./bundle.es36.js";
5
+ import { Toast as E } from "./bundle.es37.js";
6
6
  var u = /* @__PURE__ */ ((r) => (r["top-center"] = "up", r["top-left"] = "left", r["top-right"] = "right", r["bottom-center"] = "down", r["bottom-left"] = "left", r["bottom-right"] = "right", r))(u || {});
7
7
  const M = $((r, h) => {
8
8
  const { side: l = "top", align: f = "center", gap: d = 14, duration: g, swipeThreshold: x, closeIcon: T } = r, [i, p] = b([]), a = w(() => ({}), []);
@@ -1,78 +1,16 @@
1
- import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
- import { useCallback as h, useMemo as d } from "react";
3
- import { Select as p } from "./bundle.es9.js";
4
- import { getMonths as Y, getYears as k, DEFAULT_MAX_YEAR as u, DEFAULT_MIN_YEAR as g } from "./bundle.es53.js";
5
- import { Icon as C } from "./bundle.es30.js";
6
- import { f as z } from "./bundle.es71.js";
7
- import { f as L } from "./bundle.es72.js";
8
- import { setMonth as R, setYear as T } from "./bundle.es52.js";
9
- const S = ({
10
- viewDate: n,
11
- onChange: m,
12
- isMonthDisabled: a,
13
- isYearDisabled: c,
14
- onNextMonth: v,
15
- onPrevMonth: x
16
- }) => {
17
- const r = n.getFullYear(), e = n.getMonth(), i = "ru", N = h(
18
- (t) => {
19
- m(R(n, t));
20
- },
21
- [m, n]
22
- ), E = h(
23
- (t) => {
24
- m(T(n, t));
25
- },
26
- [m, n]
27
- ), M = d(() => Y(i).map((t) => ({
28
- ...t,
29
- className: "capitalize",
30
- disabled: a && a(t.value)
31
- })), [i, a]), A = d(() => k(r, 100).map((t) => ({
32
- ...t,
33
- disabled: c && c(t.value)
34
- })), [r, c]);
35
- let l = e === 11 && r === u;
36
- a && !l && (l = a(
37
- e === 11 ? 0 : e + 1,
38
- e === 11 ? Math.min(r + 1, u) : r
39
- ));
40
- let s = e === 0 && r === g;
41
- return a && !s && (s = a(
42
- e === 0 ? 11 : e - 1,
43
- e === 0 ? Math.max(r - 1, g) : r
44
- )), /* @__PURE__ */ f("div", { className: "calendar-header", children: [
45
- !s && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: x, children: /* @__PURE__ */ o(C, { icon: L.faChevronLeft }) }),
46
- /* @__PURE__ */ f("div", { className: "calendar-pickers", children: [
47
- /* @__PURE__ */ o(
48
- p,
49
- {
50
- fill: !0,
51
- options: A,
52
- size: "sm",
53
- value: r,
54
- minimalOptions: !0,
55
- matchTarget: "min-width",
56
- onChange: (t) => E(t)
57
- }
58
- ),
59
- /* @__PURE__ */ o(
60
- p,
61
- {
62
- fill: !0,
63
- options: M,
64
- size: "sm",
65
- className: "capitalize",
66
- value: e,
67
- minimalOptions: !0,
68
- matchTarget: "min-width",
69
- onChange: (t) => N(t)
70
- }
71
- )
72
- ] }),
73
- !l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: v, children: /* @__PURE__ */ o(C, { icon: z.faChevronRight }) })
74
- ] });
1
+ import { useRef as l, useCallback as p } from "react";
2
+ import { useEffectWithLayout as d } from "./bundle.es71.js";
3
+ const g = (r, f) => {
4
+ const c = l(null), i = l(null), o = { Right: c, Left: i }, u = p((t) => {
5
+ if (r.current) {
6
+ const n = r.current.style, e = o[t];
7
+ e.current && e.current.clientWidth ? n[`padding${t}`] !== `${e.current.clientWidth}px` && (n[`padding${t}`] = `${e.current.clientWidth}px`) : n[`padding${t}`] && (n[`padding${t}`] = "");
8
+ }
9
+ }, []);
10
+ return d(() => {
11
+ u("Left"), u("Right");
12
+ }, f), { rightRef: c, leftRef: i };
75
13
  };
76
14
  export {
77
- S as CalendarHeader
15
+ g as useInputPadding
78
16
  };
@@ -1,51 +1,22 @@
1
- import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es52.js";
2
- import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es53.js";
3
- import { useState as U, useCallback as M } from "react";
4
- const X = ({
5
- value: p,
6
- disablePast: r,
7
- disableFuture: c,
8
- shouldDisableDate: E,
9
- minDateTime: l,
10
- maxDateTime: s
11
- }) => {
12
- const [e, u] = U(p || /* @__PURE__ */ new Date()), _ = M(() => {
13
- u(L(e));
14
- }, [e]), C = M(() => {
15
- u(N(e, 1));
16
- }, [e]), D = R({
17
- disableFuture: c,
18
- disablePast: r,
19
- shouldDisableDate: E,
20
- minDateTime: l,
21
- maxDateTime: s
22
- }), k = M(
23
- (o, t) => {
24
- const n = /* @__PURE__ */ new Date();
25
- t = t || e.getFullYear();
26
- const h = l ? l.getMonth() : 0, Y = s ? s.getMonth() : 11, F = l?.getFullYear() || w, f = s?.getFullYear() || A;
27
- let g = t >= F && t <= f ? t === F && h > o || t === f && o > Y : !0;
28
- return c && (g = g || (t === n.getFullYear() ? o > n.getMonth() : t > n.getFullYear())), r && (g = g || (t === n.getFullYear() ? o < n.getMonth() : t < n.getFullYear())), g;
29
- },
30
- [c, r, e, l, s]
31
- ), v = M(
32
- (o) => {
33
- const t = /* @__PURE__ */ new Date(), n = l?.getFullYear() || w, h = s?.getFullYear() || A;
34
- let Y = n > o || o > h;
35
- return c && (Y = Y || o > t.getFullYear()), r && (Y = Y || o < t.getFullYear()), Y;
36
- },
37
- [c, r, l, s]
38
- );
39
- return {
40
- viewDate: e,
41
- setViewDate: u,
42
- setPrevMonth: _,
43
- setNextMonth: C,
44
- isDayDisabled: D,
45
- isMonthDisabled: k,
46
- isYearDisabled: v
47
- };
48
- };
1
+ import { __exports as e } from "./bundle.es64.js";
2
+ var c;
3
+ function d() {
4
+ return c ? e : (c = 1, (function(a) {
5
+ Object.defineProperty(a, "__esModule", { value: !0 });
6
+ var n = "fas", r = "chevron-down", v = 448, o = 512, i = [], f = "f078", h = "M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z";
7
+ a.definition = {
8
+ prefix: n,
9
+ iconName: r,
10
+ icon: [
11
+ v,
12
+ o,
13
+ i,
14
+ f,
15
+ h
16
+ ]
17
+ }, a.faChevronDown = a.definition, a.prefix = n, a.iconName = r, a.width = v, a.height = o, a.ligatures = i, a.unicode = f, a.svgPathData = h, a.aliases = i;
18
+ })(e), e);
19
+ }
49
20
  export {
50
- X as useCalendar
21
+ d as __require
51
22
  };
@@ -1,16 +1,4 @@
1
- import { useRef as l, useCallback as p } from "react";
2
- import { useEffectWithLayout as d } from "./bundle.es73.js";
3
- const g = (r, f) => {
4
- const c = l(null), i = l(null), o = { Right: c, Left: i }, u = p((t) => {
5
- if (r.current) {
6
- const n = r.current.style, e = o[t];
7
- e.current && e.current.clientWidth ? n[`padding${t}`] !== `${e.current.clientWidth}px` && (n[`padding${t}`] = `${e.current.clientWidth}px`) : n[`padding${t}`] && (n[`padding${t}`] = "");
8
- }
9
- }, []);
10
- return d(() => {
11
- u("Left"), u("Right");
12
- }, f), { rightRef: c, leftRef: i };
13
- };
1
+ var o = {};
14
2
  export {
15
- g as useInputPadding
3
+ o as __exports
16
4
  };
@@ -1,22 +1,23 @@
1
- import { __exports as e } from "./bundle.es66.js";
2
- var c;
3
- function d() {
4
- return c ? e : (c = 1, (function(a) {
5
- Object.defineProperty(a, "__esModule", { value: !0 });
6
- var n = "fas", r = "chevron-down", v = 448, o = 512, i = [], f = "f078", h = "M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z";
7
- a.definition = {
8
- prefix: n,
9
- iconName: r,
1
+ import { __exports as a } from "./bundle.es66.js";
2
+ import { __require as n } from "./bundle.es67.js";
3
+ var r;
4
+ function f() {
5
+ return r ? a : (r = 1, (function(e) {
6
+ Object.defineProperty(e, "__esModule", { value: !0 });
7
+ var i = /* @__PURE__ */ n();
8
+ e.definition = {
9
+ prefix: i.prefix,
10
+ iconName: i.iconName,
10
11
  icon: [
11
- v,
12
- o,
13
- i,
14
- f,
15
- h
12
+ i.width,
13
+ i.height,
14
+ i.aliases,
15
+ i.unicode,
16
+ i.svgPathData
16
17
  ]
17
- }, a.faChevronDown = a.definition, a.prefix = n, a.iconName = r, a.width = v, a.height = o, a.ligatures = i, a.unicode = f, a.svgPathData = h, a.aliases = i;
18
- })(e), e);
18
+ }, e.faClose = e.definition, e.prefix = i.prefix, e.iconName = i.iconName, e.width = i.width, e.height = i.height, e.ligatures = i.aliases, e.unicode = i.unicode, e.svgPathData = i.svgPathData, e.aliases = i.aliases;
19
+ })(a), a);
19
20
  }
20
21
  export {
21
- d as __require
22
+ f as __require
22
23
  };
@@ -1,4 +1,4 @@
1
- var o = {};
1
+ var a = {};
2
2
  export {
3
- o as __exports
3
+ a as __exports
4
4
  };
@@ -1,23 +1,22 @@
1
- import { __exports as a } from "./bundle.es68.js";
2
- import { __require as n } from "./bundle.es69.js";
3
- var r;
4
- function f() {
5
- return r ? a : (r = 1, (function(e) {
6
- Object.defineProperty(e, "__esModule", { value: !0 });
7
- var i = /* @__PURE__ */ n();
8
- e.definition = {
9
- prefix: i.prefix,
10
- iconName: i.iconName,
1
+ import { __exports as e } from "./bundle.es70.js";
2
+ var t;
3
+ function d() {
4
+ return t ? e : (t = 1, (function(a) {
5
+ Object.defineProperty(a, "__esModule", { value: !0 });
6
+ var r = "fas", n = "xmark", c = 384, f = 512, i = [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], u = "f00d", m = "M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z";
7
+ a.definition = {
8
+ prefix: r,
9
+ iconName: n,
11
10
  icon: [
12
- i.width,
13
- i.height,
14
- i.aliases,
15
- i.unicode,
16
- i.svgPathData
11
+ c,
12
+ f,
13
+ i,
14
+ u,
15
+ m
17
16
  ]
18
- }, e.faClose = e.definition, e.prefix = i.prefix, e.iconName = i.iconName, e.width = i.width, e.height = i.height, e.ligatures = i.aliases, e.unicode = i.unicode, e.svgPathData = i.svgPathData, e.aliases = i.aliases;
19
- })(a), a);
17
+ }, a.faXmark = a.definition, a.prefix = r, a.iconName = n, a.width = c, a.height = f, a.ligatures = i, a.unicode = u, a.svgPathData = m, a.aliases = i;
18
+ })(e), e);
20
19
  }
21
20
  export {
22
- f as __require
21
+ d as __require
23
22
  };
@@ -1,4 +1,78 @@
1
- var a = {};
1
+ import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
+ import { useCallback as h, useMemo as d } from "react";
3
+ import { Select as p } from "./bundle.es9.js";
4
+ import { getMonths as Y, getYears as k, DEFAULT_MAX_YEAR as u, DEFAULT_MIN_YEAR as g } from "./bundle.es54.js";
5
+ import { Icon as C } from "./bundle.es30.js";
6
+ import { f as z } from "./bundle.es72.js";
7
+ import { f as L } from "./bundle.es73.js";
8
+ import { setMonth as R, setYear as T } from "./bundle.es53.js";
9
+ const S = ({
10
+ viewDate: n,
11
+ onChange: m,
12
+ isMonthDisabled: a,
13
+ isYearDisabled: c,
14
+ onNextMonth: v,
15
+ onPrevMonth: x
16
+ }) => {
17
+ const r = n.getFullYear(), e = n.getMonth(), i = "ru", N = h(
18
+ (t) => {
19
+ m(R(n, t));
20
+ },
21
+ [m, n]
22
+ ), E = h(
23
+ (t) => {
24
+ m(T(n, t));
25
+ },
26
+ [m, n]
27
+ ), M = d(() => Y(i).map((t) => ({
28
+ ...t,
29
+ className: "capitalize",
30
+ disabled: a && a(t.value)
31
+ })), [i, a]), A = d(() => k(r, 100).map((t) => ({
32
+ ...t,
33
+ disabled: c && c(t.value)
34
+ })), [r, c]);
35
+ let l = e === 11 && r === u;
36
+ a && !l && (l = a(
37
+ e === 11 ? 0 : e + 1,
38
+ e === 11 ? Math.min(r + 1, u) : r
39
+ ));
40
+ let s = e === 0 && r === g;
41
+ return a && !s && (s = a(
42
+ e === 0 ? 11 : e - 1,
43
+ e === 0 ? Math.max(r - 1, g) : r
44
+ )), /* @__PURE__ */ f("div", { className: "calendar-header", children: [
45
+ !s && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: x, children: /* @__PURE__ */ o(C, { icon: L.faChevronLeft }) }),
46
+ /* @__PURE__ */ f("div", { className: "calendar-pickers", children: [
47
+ /* @__PURE__ */ o(
48
+ p,
49
+ {
50
+ fill: !0,
51
+ options: A,
52
+ size: "sm",
53
+ value: r,
54
+ minimalOptions: !0,
55
+ matchTarget: "min-width",
56
+ onChange: (t) => E(t)
57
+ }
58
+ ),
59
+ /* @__PURE__ */ o(
60
+ p,
61
+ {
62
+ fill: !0,
63
+ options: M,
64
+ size: "sm",
65
+ className: "capitalize",
66
+ value: e,
67
+ minimalOptions: !0,
68
+ matchTarget: "min-width",
69
+ onChange: (t) => N(t)
70
+ }
71
+ )
72
+ ] }),
73
+ !l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: v, children: /* @__PURE__ */ o(C, { icon: z.faChevronRight }) })
74
+ ] });
75
+ };
2
76
  export {
3
- a as __exports
77
+ S as CalendarHeader
4
78
  };
@@ -1,22 +1,51 @@
1
- import { __exports as e } from "./bundle.es70.js";
2
- var t;
3
- function d() {
4
- return t ? e : (t = 1, (function(a) {
5
- Object.defineProperty(a, "__esModule", { value: !0 });
6
- var r = "fas", n = "xmark", c = 384, f = 512, i = [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], u = "f00d", m = "M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z";
7
- a.definition = {
8
- prefix: r,
9
- iconName: n,
10
- icon: [
11
- c,
12
- f,
13
- i,
14
- u,
15
- m
16
- ]
17
- }, a.faXmark = a.definition, a.prefix = r, a.iconName = n, a.width = c, a.height = f, a.ligatures = i, a.unicode = u, a.svgPathData = m, a.aliases = i;
18
- })(e), e);
19
- }
1
+ import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es53.js";
2
+ import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es54.js";
3
+ import { useState as U, useCallback as M } from "react";
4
+ const X = ({
5
+ value: p,
6
+ disablePast: r,
7
+ disableFuture: c,
8
+ shouldDisableDate: E,
9
+ minDateTime: l,
10
+ maxDateTime: s
11
+ }) => {
12
+ const [e, u] = U(p || /* @__PURE__ */ new Date()), _ = M(() => {
13
+ u(L(e));
14
+ }, [e]), C = M(() => {
15
+ u(N(e, 1));
16
+ }, [e]), D = R({
17
+ disableFuture: c,
18
+ disablePast: r,
19
+ shouldDisableDate: E,
20
+ minDateTime: l,
21
+ maxDateTime: s
22
+ }), k = M(
23
+ (o, t) => {
24
+ const n = /* @__PURE__ */ new Date();
25
+ t = t || e.getFullYear();
26
+ const h = l ? l.getMonth() : 0, Y = s ? s.getMonth() : 11, F = l?.getFullYear() || w, f = s?.getFullYear() || A;
27
+ let g = t >= F && t <= f ? t === F && h > o || t === f && o > Y : !0;
28
+ return c && (g = g || (t === n.getFullYear() ? o > n.getMonth() : t > n.getFullYear())), r && (g = g || (t === n.getFullYear() ? o < n.getMonth() : t < n.getFullYear())), g;
29
+ },
30
+ [c, r, e, l, s]
31
+ ), v = M(
32
+ (o) => {
33
+ const t = /* @__PURE__ */ new Date(), n = l?.getFullYear() || w, h = s?.getFullYear() || A;
34
+ let Y = n > o || o > h;
35
+ return c && (Y = Y || o > t.getFullYear()), r && (Y = Y || o < t.getFullYear()), Y;
36
+ },
37
+ [c, r, l, s]
38
+ );
39
+ return {
40
+ viewDate: e,
41
+ setViewDate: u,
42
+ setPrevMonth: _,
43
+ setNextMonth: C,
44
+ isDayDisabled: D,
45
+ isMonthDisabled: k,
46
+ isYearDisabled: v
47
+ };
48
+ };
20
49
  export {
21
- d as __require
50
+ X as useCalendar
22
51
  };
@@ -1,9 +1,9 @@
1
1
  import { jsxs as t, jsx as r } from "react/jsx-runtime";
2
2
  import * as o from "@radix-ui/react-popover";
3
- import { attr as y } from "@companix/utils-browser";
4
- import B from "classnames";
5
- import { forwardRef as M, useRef as j } from "react";
6
- const D = M((a, i) => {
3
+ import { attr as B } from "@companix/utils-browser";
4
+ import M from "classnames";
5
+ import { forwardRef as j, useRef as k } from "react";
6
+ const D = j((a, i) => {
7
7
  const {
8
8
  children: n,
9
9
  sideOffset: s,
@@ -18,38 +18,40 @@ const D = M((a, i) => {
18
18
  content: u,
19
19
  onOpenChange: v,
20
20
  align: C,
21
- disabled: w,
22
- minimal: x,
21
+ disabled: x,
22
+ minimal: w,
23
23
  className: L,
24
24
  fitMaxHeight: N = !0,
25
- side: O,
26
- showArrows: A
27
- } = a, e = j(null), P = () => {
25
+ zIndex: O = 100,
26
+ side: A,
27
+ showArrows: P
28
+ } = a, e = k(null), b = () => {
28
29
  e.current && e.current.click();
29
- }, b = (R) => {
30
- w && R.preventDefault();
30
+ }, y = (R) => {
31
+ x && R.preventDefault();
31
32
  };
32
33
  return /* @__PURE__ */ t(o.Root, { open: g, onOpenChange: v, children: [
33
- /* @__PURE__ */ r(o.Trigger, { ref: p, ...h, onClick: b, asChild: !0, children: n }),
34
+ /* @__PURE__ */ r(o.Trigger, { ref: p, ...h, onClick: y, asChild: !0, children: n }),
34
35
  /* @__PURE__ */ r(o.Portal, { children: /* @__PURE__ */ t(
35
36
  o.Content,
36
37
  {
37
38
  ref: i,
38
- className: B("popover", L),
39
- side: O,
39
+ className: M("popover", L),
40
+ side: A,
40
41
  align: C,
41
- "data-appearance": x ? "minimal" : "default",
42
+ "data-appearance": w ? "minimal" : "default",
42
43
  "data-match-target": l,
43
44
  sideOffset: s ?? 6,
44
45
  avoidCollisions: !0,
45
46
  arrowPadding: 10,
47
+ style: { zIndex: O },
46
48
  onAnimationStart: m,
47
49
  onAnimationEnd: c,
48
50
  onOpenAutoFocus: d,
49
51
  onCloseAutoFocus: f,
50
52
  children: [
51
53
  /* @__PURE__ */ r(o.Close, { ref: e, style: { display: "none" } }),
52
- A && /* @__PURE__ */ r(o.Arrow, { width: 30, height: 11, asChild: !0, children: /* @__PURE__ */ r("div", { className: "popover-arrow", children: /* @__PURE__ */ t("svg", { className: "popover-arrow-icon", viewBox: "0 0 30 11", width: 30, height: 11, children: [
54
+ P && /* @__PURE__ */ r(o.Arrow, { width: 30, height: 11, asChild: !0, children: /* @__PURE__ */ r("div", { className: "popover-arrow", children: /* @__PURE__ */ t("svg", { className: "popover-arrow-icon", viewBox: "0 0 30 11", width: 30, height: 11, children: [
53
55
  /* @__PURE__ */ r(
54
56
  "path",
55
57
  {
@@ -69,7 +71,7 @@ const D = M((a, i) => {
69
71
  }
70
72
  )
71
73
  ] }) }) }),
72
- /* @__PURE__ */ r("div", { className: "popover-content", "data-fit-max-height": y(N), children: u({ close: P }) })
74
+ /* @__PURE__ */ r("div", { className: "popover-content", "data-fit-max-height": B(N), children: u({ close: b }) })
73
75
  ]
74
76
  }
75
77
  ) })
@@ -1,5 +1,16 @@
1
- import { __require as r } from "./bundle.es74.js";
2
- var o = /* @__PURE__ */ r();
1
+ import { useRef as f, useLayoutEffect as u, useEffect as s } from "react";
2
+ const o = (t, r) => {
3
+ const e = f(!1);
4
+ u(() => {
5
+ e.current = !0, t();
6
+ }, []), s(() => {
7
+ if (e.current) {
8
+ e.current = !1;
9
+ return;
10
+ }
11
+ t();
12
+ }, r);
13
+ };
3
14
  export {
4
- o as f
15
+ o as useEffectWithLayout
5
16
  };
@@ -1,4 +1,4 @@
1
- import { __require as r } from "./bundle.es76.js";
1
+ import { __require as r } from "./bundle.es74.js";
2
2
  var o = /* @__PURE__ */ r();
3
3
  export {
4
4
  o as f