@companix/uikit 0.0.32 → 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 (49) hide show
  1. package/dist/ThemeProvider/script.d.ts +1 -0
  2. package/dist/bundle.es.js +30 -27
  3. package/dist/bundle.es10.js +2 -2
  4. package/dist/bundle.es11.js +1 -1
  5. package/dist/bundle.es12.js +1 -1
  6. package/dist/bundle.es14.js +1 -1
  7. package/dist/bundle.es18.js +1 -1
  8. package/dist/bundle.es19.js +1 -1
  9. package/dist/bundle.es20.js +1 -1
  10. package/dist/bundle.es23.js +1 -1
  11. package/dist/bundle.es24.js +3 -3
  12. package/dist/bundle.es25.js +4 -4
  13. package/dist/bundle.es26.js +2 -2
  14. package/dist/bundle.es29.js +2 -2
  15. package/dist/bundle.es32.js +13 -17
  16. package/dist/bundle.es33.js +21 -10
  17. package/dist/bundle.es34.js +10 -24
  18. package/dist/bundle.es35.js +17 -31
  19. package/dist/bundle.es36.js +36 -48
  20. package/dist/bundle.es37.js +49 -41
  21. package/dist/bundle.es38.js +42 -8
  22. package/dist/bundle.es39.js +8 -23
  23. package/dist/bundle.es40.js +24 -87
  24. package/dist/bundle.es41.js +87 -18
  25. package/dist/bundle.es42.js +16 -18
  26. package/dist/bundle.es43.js +20 -24
  27. package/dist/bundle.es44.js +20 -35
  28. package/dist/bundle.es45.js +39 -3
  29. package/dist/bundle.es46.js +3 -5
  30. package/dist/bundle.es47.js +5 -14
  31. package/dist/bundle.es48.js +13 -13
  32. package/dist/bundle.es49.js +14 -3
  33. package/dist/bundle.es50.js +3 -3
  34. package/dist/bundle.es51.js +3 -70
  35. package/dist/bundle.es52.js +68 -66
  36. package/dist/bundle.es53.js +67 -69
  37. package/dist/bundle.es54.js +69 -11
  38. package/dist/bundle.es55.js +11 -42
  39. package/dist/bundle.es56.js +42 -14
  40. package/dist/bundle.es57.js +11 -20
  41. package/dist/bundle.es59.js +1 -1
  42. package/dist/bundle.es60.js +20 -14
  43. package/dist/bundle.es61.js +2 -20
  44. package/dist/bundle.es62.js +14 -2
  45. package/dist/bundle.es68.js +2 -2
  46. package/dist/bundle.es69.js +2 -2
  47. package/dist/bundle.es9.js +4 -4
  48. package/dist/index.d.ts +1 -0
  49. package/package.json +1 -1
@@ -1,72 +1,5 @@
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.es53.js";
3
- import { CalendarHeader as F } from "./bundle.es68.js";
4
- import { useCalendar as j } from "./bundle.es69.js";
5
- import { attr as m } from "@companix/utils-browser";
6
- import { isSameDate as f } from "./bundle.es52.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
- );
69
- };
1
+ import { __require as r } from "./bundle.es65.js";
2
+ var o = /* @__PURE__ */ r();
70
3
  export {
71
- T as Calendar
4
+ o as f
72
5
  };
@@ -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.es54.js";
3
+ import { CalendarHeader as F } from "./bundle.es68.js";
4
+ import { useCalendar as j } from "./bundle.es69.js";
5
+ import { attr as m } from "@companix/utils-browser";
6
+ import { isSameDate as f } from "./bundle.es53.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
  };
@@ -1,72 +1,70 @@
1
- import { clamp as m } from "@companix/utils-browser";
2
- import { formatTime as i } from "@companix/utils-js";
3
- const g = (n, r) => new Date(r, n, 0).getDate(), u = (n, r) => new Date(r, n - 1, 1).getDay(), D = (n) => n === 0 ? 6 : n - 1, d = (n) => new Array(n).fill(0), T = (n) => ({
4
- day: n.getDate(),
5
- month: n.getMonth() + 1,
6
- year: n.getFullYear()
7
- }), p = ({ min: n, max: r }) => (t) => {
8
- if (n.year === t.year) {
9
- if (t.month !== 0 && t.month < n.month)
10
- return t.month = 0, t.day = 0, t;
11
- if (t.month === n.month && t.day < n.day && t.day !== 0)
12
- return t.day = 0, t;
13
- }
14
- if (r.year === t.year) {
15
- if (t.month !== 0 && t.month > r.month)
16
- return t.month = 0, t.day = 0, t;
17
- if (t.month === r.month && t.day > r.day && t.day !== 0)
18
- return t.day = 0, t;
19
- }
20
- }, A = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"], M = [
21
- "Январь",
22
- "Февраль",
23
- "Март",
24
- "Апрель",
25
- "Май",
26
- "Июнь",
27
- "Июль",
28
- "Август",
29
- "Сентябрь",
30
- "Октябрь",
31
- "Ноябрь",
32
- "Декабрь"
33
- ], c = 9999, a = 100, w = (n, r) => {
34
- const t = [], o = m(n - r, a, c), e = m(n + r, a, c);
35
- for (let s = o; s <= e; s++)
36
- t.push({ title: String(s).padStart(4, "0"), value: s });
37
- return t;
38
- }, F = (n) => {
39
- const r = [], t = new Intl.DateTimeFormat(n, {
40
- month: "long"
41
- });
42
- for (let o = 0; o < 12; o++)
43
- r.push({
44
- title: t.format(new Date(2023, o, 15)),
45
- value: o
46
- });
47
- return r;
48
- }, Y = (n, r) => r.reduce((t, o) => t.replaceAll(o, ""), n.trim()), E = ({ hours: n, minutes: r }, t = ":") => [i(n), i(r)].join(t), h = (n, r = ":") => {
49
- const [t, o] = [i(n.hours), i(n.minutes)], e = [t, o].join(r);
50
- return { title: e, value: e, hours: t, minutes: o };
51
- }, _ = (n, r = ":") => {
52
- const t = { minutes: -n, hours: 0 };
53
- return Array.from({ length: 1440 / n }).map(() => (t.minutes += n, t.minutes === 60 && (t.minutes = 0, t.hours++), h(t, r)));
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;
48
+ };
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]);
54
58
  };
55
59
  export {
56
- c as DEFAULT_MAX_YEAR,
57
- a as DEFAULT_MIN_YEAR,
58
- M as DefaultMonths,
59
- E as convertTimeToOption,
60
- p as createDateValidation,
61
- d as createVoids,
62
- T as dateToFormat,
63
- D as getDayIndex,
64
- u as getFirstDay,
65
- g as getMonthMaxDay,
66
- F as getMonths,
67
- h as getTimeValue,
68
- _ as getTimesOptions,
69
- w as getYears,
70
- Y as removeDigits,
71
- A as weeks
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
72
70
  };
@@ -1,14 +1,72 @@
1
- import { jsxs as a, Fragment as l, jsx as o } from "react/jsx-runtime";
2
- import { f as i } from "./bundle.es50.js";
3
- import { f as m } from "./bundle.es49.js";
4
- import { Icon as e } from "./bundle.es30.js";
5
- const C = (s) => {
6
- const { clearButton: n, clearButtonIcon: t, value: c, onClear: r } = s;
7
- return /* @__PURE__ */ a(l, { children: [
8
- n && c && /* @__PURE__ */ o("button", { className: "select-close-button", onClick: r, children: t ?? /* @__PURE__ */ o(e, { className: "select-close-icon", icon: i.faClose, size: "xxxs" }) }),
9
- /* @__PURE__ */ o(e, { className: "expand-icon select-expand", icon: m.faChevronDown, size: "xxxs" })
10
- ] });
1
+ import { clamp as m } from "@companix/utils-browser";
2
+ import { formatTime as i } from "@companix/utils-js";
3
+ const g = (n, r) => new Date(r, n, 0).getDate(), u = (n, r) => new Date(r, n - 1, 1).getDay(), D = (n) => n === 0 ? 6 : n - 1, d = (n) => new Array(n).fill(0), T = (n) => ({
4
+ day: n.getDate(),
5
+ month: n.getMonth() + 1,
6
+ year: n.getFullYear()
7
+ }), p = ({ min: n, max: r }) => (t) => {
8
+ if (n.year === t.year) {
9
+ if (t.month !== 0 && t.month < n.month)
10
+ return t.month = 0, t.day = 0, t;
11
+ if (t.month === n.month && t.day < n.day && t.day !== 0)
12
+ return t.day = 0, t;
13
+ }
14
+ if (r.year === t.year) {
15
+ if (t.month !== 0 && t.month > r.month)
16
+ return t.month = 0, t.day = 0, t;
17
+ if (t.month === r.month && t.day > r.day && t.day !== 0)
18
+ return t.day = 0, t;
19
+ }
20
+ }, A = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"], M = [
21
+ "Январь",
22
+ "Февраль",
23
+ "Март",
24
+ "Апрель",
25
+ "Май",
26
+ "Июнь",
27
+ "Июль",
28
+ "Август",
29
+ "Сентябрь",
30
+ "Октябрь",
31
+ "Ноябрь",
32
+ "Декабрь"
33
+ ], c = 9999, a = 100, w = (n, r) => {
34
+ const t = [], o = m(n - r, a, c), e = m(n + r, a, c);
35
+ for (let s = o; s <= e; s++)
36
+ t.push({ title: String(s).padStart(4, "0"), value: s });
37
+ return t;
38
+ }, F = (n) => {
39
+ const r = [], t = new Intl.DateTimeFormat(n, {
40
+ month: "long"
41
+ });
42
+ for (let o = 0; o < 12; o++)
43
+ r.push({
44
+ title: t.format(new Date(2023, o, 15)),
45
+ value: o
46
+ });
47
+ return r;
48
+ }, Y = (n, r) => r.reduce((t, o) => t.replaceAll(o, ""), n.trim()), E = ({ hours: n, minutes: r }, t = ":") => [i(n), i(r)].join(t), h = (n, r = ":") => {
49
+ const [t, o] = [i(n.hours), i(n.minutes)], e = [t, o].join(r);
50
+ return { title: e, value: e, hours: t, minutes: o };
51
+ }, _ = (n, r = ":") => {
52
+ const t = { minutes: -n, hours: 0 };
53
+ return Array.from({ length: 1440 / n }).map(() => (t.minutes += n, t.minutes === 60 && (t.minutes = 0, t.hours++), h(t, r)));
11
54
  };
12
55
  export {
13
- C as SelectRightElements
56
+ c as DEFAULT_MAX_YEAR,
57
+ a as DEFAULT_MIN_YEAR,
58
+ M as DefaultMonths,
59
+ E as convertTimeToOption,
60
+ p as createDateValidation,
61
+ d as createVoids,
62
+ T as dateToFormat,
63
+ D as getDayIndex,
64
+ u as getFirstDay,
65
+ g as getMonthMaxDay,
66
+ F as getMonths,
67
+ h as getTimeValue,
68
+ _ as getTimesOptions,
69
+ w as getYears,
70
+ Y as removeDigits,
71
+ A as weeks
14
72
  };
@@ -1,45 +1,14 @@
1
- import { DefaultMonths as f, getMonthMaxDay as i } from "./bundle.es53.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 };
1
+ import { jsxs as a, Fragment as l, jsx as o } from "react/jsx-runtime";
2
+ import { f as i } from "./bundle.es51.js";
3
+ import { f as m } from "./bundle.es50.js";
4
+ import { Icon as e } from "./bundle.es30.js";
5
+ const C = (s) => {
6
+ const { clearButton: n, clearButtonIcon: t, value: c, onClear: r } = s;
7
+ return /* @__PURE__ */ a(l, { children: [
8
+ n && c && /* @__PURE__ */ o("button", { className: "select-close-button", onClick: r, children: t ?? /* @__PURE__ */ o(e, { className: "select-close-icon", icon: i.faClose, size: "xxxs" }) }),
9
+ /* @__PURE__ */ o(e, { className: "expand-icon select-expand", icon: m.faChevronDown, size: "xxxs" })
10
+ ] });
40
11
  };
41
12
  export {
42
- p as defaultMax,
43
- u as defaultMin,
44
- I as useCalendarOptions
13
+ C as SelectRightElements
45
14
  };
@@ -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,16 +1,22 @@
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 };
13
- };
1
+ import { __exports as e } from "./bundle.es61.js";
2
+ var v;
3
+ function d() {
4
+ return v ? e : (v = 1, (function(a) {
5
+ Object.defineProperty(a, "__esModule", { value: !0 });
6
+ var c = "fas", n = "check", r = 448, f = 512, i = [10003, 10004], h = "f00c", u = "M434.8 70.1c14.3 10.4 17.5 30.4 7.1 44.7l-256 352c-5.5 7.6-14 12.3-23.4 13.1s-18.5-2.7-25.1-9.3l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l101.5 101.5 234-321.7c10.4-14.3 30.4-17.5 44.7-7.1z";
7
+ a.definition = {
8
+ prefix: c,
9
+ iconName: n,
10
+ icon: [
11
+ r,
12
+ f,
13
+ i,
14
+ h,
15
+ u
16
+ ]
17
+ }, a.faCheck = a.definition, a.prefix = c, a.iconName = n, a.width = r, a.height = f, a.ligatures = i, a.unicode = h, a.svgPathData = u, a.aliases = i;
18
+ })(e), e);
19
+ }
14
20
  export {
15
- g as useInputPadding
21
+ d as __require
16
22
  };