@companix/uikit 0.0.35 → 0.0.37

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 (51) hide show
  1. package/dist/Icon/index.d.ts +2 -1
  2. package/dist/bundle.es14.js +14 -14
  3. package/dist/bundle.es17.js +11 -11
  4. package/dist/bundle.es21.js +1 -1
  5. package/dist/bundle.es22.js +1 -1
  6. package/dist/bundle.es23.js +1 -1
  7. package/dist/bundle.es26.js +1 -1
  8. package/dist/bundle.es27.js +42 -43
  9. package/dist/bundle.es28.js +4 -4
  10. package/dist/bundle.es29.js +2 -2
  11. package/dist/bundle.es32.js +2 -2
  12. package/dist/bundle.es33.js +10 -12
  13. package/dist/bundle.es35.js +1 -1
  14. package/dist/bundle.es38.js +1 -1
  15. package/dist/bundle.es39.js +1 -1
  16. package/dist/bundle.es40.js +1 -1
  17. package/dist/bundle.es45.js +1 -1
  18. package/dist/bundle.es49.js +1 -1
  19. package/dist/bundle.es50.js +5 -3
  20. package/dist/bundle.es51.js +14 -5
  21. package/dist/bundle.es52.js +13 -13
  22. package/dist/bundle.es53.js +69 -13
  23. package/dist/bundle.es54.js +68 -3
  24. package/dist/bundle.es55.js +70 -3
  25. package/dist/bundle.es56.js +9 -68
  26. package/dist/bundle.es57.js +41 -66
  27. package/dist/bundle.es58.js +13 -68
  28. package/dist/bundle.es59.js +32 -12
  29. package/dist/bundle.es60.js +69 -42
  30. package/dist/bundle.es61.js +13 -14
  31. package/dist/bundle.es62.js +74 -31
  32. package/dist/bundle.es63.js +47 -68
  33. package/dist/bundle.es64.js +12 -12
  34. package/package.json +2 -6
  35. package/dist/bundle.es65.js +0 -22
  36. package/dist/bundle.es66.js +0 -4
  37. package/dist/bundle.es67.js +0 -78
  38. package/dist/bundle.es68.js +0 -51
  39. package/dist/bundle.es69.js +0 -22
  40. package/dist/bundle.es70.js +0 -4
  41. package/dist/bundle.es71.js +0 -23
  42. package/dist/bundle.es72.js +0 -4
  43. package/dist/bundle.es73.js +0 -22
  44. package/dist/bundle.es74.js +0 -16
  45. package/dist/bundle.es75.js +0 -4
  46. package/dist/bundle.es76.js +0 -5
  47. package/dist/bundle.es77.js +0 -5
  48. package/dist/bundle.es78.js +0 -22
  49. package/dist/bundle.es79.js +0 -4
  50. package/dist/bundle.es80.js +0 -22
  51. package/dist/bundle.es81.js +0 -4
@@ -1,4 +1,5 @@
1
- import { IconDefinition } from '@fortawesome/free-solid-svg-icons';
1
+ export type IconPathData = string | string[];
2
+ export type IconDefinition = [number, number, (string | number)[], string, IconPathData];
2
3
  export interface IconProps extends React.SVGProps<SVGSVGElement> {
3
4
  icon: IconDefinition;
4
5
  size?: 'xxxs' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl';
@@ -3,36 +3,36 @@ import N from "classnames";
3
3
  import { Icon as v } from "./bundle.es33.js";
4
4
  import { attr as t } from "@companix/utils-browser";
5
5
  import { forwardRef as k } from "react";
6
- import { f as x } from "./bundle.es50.js";
7
- const E = k(
8
- ({ title: s, icon: c, active: e, label: n, disabled: a, minimal: r, onClick: d, className: l, ...m }, p) => {
6
+ import { faCheck as x } from "@companix/icons-solid";
7
+ const O = k(
8
+ ({ title: d, icon: n, active: c, label: e, disabled: r, minimal: a, onClick: l, className: m, ...s }, p) => {
9
9
  const f = (h) => {
10
- a || d?.(h);
10
+ r || l?.(h);
11
11
  };
12
12
  return /* @__PURE__ */ i(
13
13
  "div",
14
14
  {
15
15
  ref: p,
16
- ...m,
17
- className: N("option", l),
18
- "data-selected": t(e),
19
- "data-disabled": t(a),
20
- "data-minimal": t(r),
16
+ ...s,
17
+ className: N("option", m),
18
+ "data-selected": t(c),
19
+ "data-disabled": t(r),
20
+ "data-minimal": t(a),
21
21
  onClick: f,
22
22
  children: [
23
23
  /* @__PURE__ */ i("div", { className: "option-content", children: [
24
- c && /* @__PURE__ */ o("div", { className: "option-icon", children: c }),
24
+ n && /* @__PURE__ */ o("div", { className: "option-icon", children: n }),
25
25
  /* @__PURE__ */ i("div", { className: "option-content-layout", children: [
26
- /* @__PURE__ */ o("div", { className: "option-title", children: s }),
27
- n && /* @__PURE__ */ o("div", { className: "option-label", children: n })
26
+ /* @__PURE__ */ o("div", { className: "option-title", children: d }),
27
+ e && /* @__PURE__ */ o("div", { className: "option-label", children: e })
28
28
  ] })
29
29
  ] }),
30
- e && !r && /* @__PURE__ */ o("div", { className: "option-check", children: /* @__PURE__ */ o(v, { icon: x.faCheck }) })
30
+ c && !a && /* @__PURE__ */ o("div", { className: "option-check", children: /* @__PURE__ */ o(v, { icon: x }) })
31
31
  ]
32
32
  }
33
33
  );
34
34
  }
35
35
  );
36
36
  export {
37
- E as OptionItem
37
+ O as OptionItem
38
38
  };
@@ -1,35 +1,35 @@
1
- import { jsxs as d, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as x, jsx as o } from "react/jsx-runtime";
2
2
  import * as t from "@radix-ui/react-checkbox";
3
3
  import { Icon as h } from "./bundle.es33.js";
4
- import { f as l } from "./bundle.es50.js";
4
+ import { faCheck as l } from "@companix/icons-solid";
5
5
  import { useId as n } from "react";
6
6
  import { attr as c } from "@companix/utils-browser";
7
- const N = ({ checked: a, required: s, disabled: r, onCheckedChange: m, size: x, label: e }) => {
7
+ const u = ({ checked: e, required: m, disabled: r, onCheckedChange: s, size: d, label: a }) => {
8
8
  const i = n();
9
- return /* @__PURE__ */ d(
9
+ return /* @__PURE__ */ x(
10
10
  "div",
11
11
  {
12
12
  className: "checkbox",
13
- "data-size": x ?? "md",
14
- "data-required": c(s && !a),
13
+ "data-size": d ?? "md",
14
+ "data-required": c(m && !e),
15
15
  "data-disabled": c(r),
16
16
  children: [
17
17
  /* @__PURE__ */ o(
18
18
  t.Root,
19
19
  {
20
20
  className: "checkbox-box",
21
- checked: a,
22
- onCheckedChange: m,
21
+ checked: e,
22
+ onCheckedChange: s,
23
23
  disabled: r,
24
24
  id: i,
25
- children: /* @__PURE__ */ o(t.Indicator, { className: "checkbox-icon", children: /* @__PURE__ */ o(h, { icon: l.faCheck, size: "xxxs" }) })
25
+ children: /* @__PURE__ */ o(t.Indicator, { className: "checkbox-icon", children: /* @__PURE__ */ o(h, { icon: l, size: "xxxs" }) })
26
26
  }
27
27
  ),
28
- e && /* @__PURE__ */ o("label", { className: "checkbox-label", htmlFor: i, "data-disabled": c(r), children: e })
28
+ a && /* @__PURE__ */ o("label", { className: "checkbox-label", htmlFor: i, "data-disabled": c(r), children: a })
29
29
  ]
30
30
  }
31
31
  );
32
32
  };
33
33
  export {
34
- N as Checkbox
34
+ u as Checkbox
35
35
  };
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
2
  import f from "classnames";
3
3
  import * as o from "@radix-ui/react-dialog";
4
4
  import { VisuallyHidden as a } from "@radix-ui/react-visually-hidden";
5
- import { RemoveListener as v } from "./bundle.es51.js";
5
+ import { RemoveListener as v } from "./bundle.es50.js";
6
6
  const g = (l) => {
7
7
  const { size: n = "s", open: r, onOpenChange: s, children: c, onClosed: t, disableEsc: p, className: d } = l, m = (h) => {
8
8
  p && h.preventDefault();
@@ -1,7 +1,7 @@
1
1
  import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
2
  import * as r from "@radix-ui/react-alert-dialog";
3
3
  import { Button as c } from "./bundle.es4.js";
4
- import { RemoveListener as N } from "./bundle.es51.js";
4
+ import { RemoveListener as N } from "./bundle.es50.js";
5
5
  import { VisuallyHidden as u } from "@radix-ui/react-visually-hidden";
6
6
  const C = ({
7
7
  open: d,
@@ -1,6 +1,6 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { Button as m } from "./bundle.es4.js";
3
- import { useLoading as p } from "./bundle.es52.js";
3
+ import { useLoading as p } from "./bundle.es51.js";
4
4
  const g = ({ onClick: o, appearance: r = "primary", ...i }) => {
5
5
  const { isLoading: n, isError: t, handleClick: a } = p({ onClick: o });
6
6
  return /* @__PURE__ */ e(
@@ -1,5 +1,5 @@
1
1
  import { jsx as f } from "react/jsx-runtime";
2
- import { useResizeTextarea as x } from "./bundle.es53.js";
2
+ import { useResizeTextarea as x } from "./bundle.es52.js";
3
3
  import { attr as e, callMultiple as u } from "@companix/utils-browser";
4
4
  import { useEffect as z } from "react";
5
5
  import { mergeRefs as R } from "react-merge-refs";
@@ -1,65 +1,64 @@
1
- import { jsx as o, jsxs as l } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
2
  import { useFroozeClosing as M } from "./bundle.es44.js";
3
3
  import { Popover as j } from "./bundle.es10.js";
4
4
  import { OptionItem as q } from "./bundle.es14.js";
5
5
  import { OptionsList as V } from "./bundle.es16.js";
6
6
  import { Icon as d } from "./bundle.es33.js";
7
7
  import { useState as B, useRef as h, useMemo as g } from "react";
8
- import { f as H } from "./bundle.es54.js";
9
- import { f as Q } from "./bundle.es55.js";
10
- import { attr as x, getActiveElementByAnotherElement as G, contains as J } from "@companix/utils-browser";
11
- import { mergeRefs as K } from "react-merge-refs";
12
- const se = (C) => {
8
+ import { attr as v, getActiveElementByAnotherElement as H, contains as Q } from "@companix/utils-browser";
9
+ import { mergeRefs as X } from "react-merge-refs";
10
+ import { faXmark as G, faChevronDown as J } from "@companix/icons-solid";
11
+ const re = (x) => {
13
12
  const {
14
13
  options: r,
15
- closeAfterSelect: v,
14
+ closeAfterSelect: C,
16
15
  placeholder: N,
17
- onChange: c,
16
+ onChange: l,
18
17
  emptyText: R = "Ничего не найдено",
19
18
  readOnly: m,
20
19
  size: z = "md",
21
20
  value: n,
22
21
  inputRef: A,
23
- disabled: u,
24
- required: D
25
- } = C, [a, E] = B(""), i = h(null), w = h(null), { popoverRef: f, froozePopoverPosition: y, handleAnimationEnd: b } = M(), O = g(() => {
22
+ disabled: f,
23
+ required: y
24
+ } = x, [s, D] = B(""), a = h(null), b = h(null), { popoverRef: u, froozePopoverPosition: k, handleAnimationEnd: w } = M(), E = g(() => {
26
25
  const e = {};
27
26
  return r.forEach((t) => {
28
27
  e[t.value] = t;
29
28
  }), e;
30
- }, [r]), P = (e) => n.includes(e) ? [...n] : [...n, e], T = (e) => n.filter((t) => e !== t), k = (e, t) => {
31
- v ? (y(), c(e), t()) : c(e);
32
- }, p = g(() => a.trim() ? r.filter(({ title: e }) => {
33
- const t = e.toLowerCase(), s = a.trim().toLowerCase();
34
- return t.indexOf(s) >= 0;
35
- }) : r, [a, r]), I = (e) => {
36
- if (u) return;
37
- f.current && f.current.getAttribute("data-state") === "open" && e.preventDefault();
38
- const t = G(e.currentTarget);
39
- e.defaultPrevented || J(e.currentTarget, t) || i.current && i.current.focus();
29
+ }, [r]), O = (e) => n.includes(e) ? [...n] : [...n, e], P = (e) => n.filter((t) => e !== t), T = (e, t) => {
30
+ C ? (k(), l(e), t()) : l(e);
31
+ }, p = g(() => s.trim() ? r.filter(({ title: e }) => {
32
+ const t = e.toLowerCase(), i = s.trim().toLowerCase();
33
+ return t.indexOf(i) >= 0;
34
+ }) : r, [s, r]), I = (e) => {
35
+ if (f) return;
36
+ u.current && u.current.getAttribute("data-state") === "open" && e.preventDefault();
37
+ const t = H(e.currentTarget);
38
+ e.defaultPrevented || Q(e.currentTarget, t) || a.current && a.current.focus();
40
39
  }, S = (e) => {
41
- e.target !== i.current && e.preventDefault();
40
+ e.target !== a.current && e.preventDefault();
42
41
  }, $ = (e, t) => {
43
- e.stopPropagation(), c(T(t));
42
+ e.stopPropagation(), l(P(t));
44
43
  };
45
44
  return /* @__PURE__ */ o(
46
45
  j,
47
46
  {
48
47
  minimal: !0,
49
- ref: f,
48
+ ref: u,
50
49
  sideOffset: 0,
51
50
  matchTarget: "width",
52
- onAnimationEnd: b,
51
+ onAnimationEnd: w,
53
52
  onOpenAutoFocus: (e) => e.preventDefault(),
54
53
  onCloseAutoFocus: (e) => e.preventDefault(),
55
- content: ({ close: e }) => /* @__PURE__ */ l(V, { maxHeight: 300, children: [
54
+ content: ({ close: e }) => /* @__PURE__ */ c(V, { maxHeight: 300, children: [
56
55
  p.length === 0 && /* @__PURE__ */ o("div", { className: "select-tags-empty", children: R }),
57
- p.map(({ value: t, title: s, icon: F }, L) => /* @__PURE__ */ o(
56
+ p.map(({ value: t, title: i, icon: F }, L) => /* @__PURE__ */ o(
58
57
  q,
59
58
  {
60
59
  active: n.includes(t),
61
- onClick: () => k(P(t), e),
62
- title: s,
60
+ onClick: () => T(O(t), e),
61
+ title: i,
63
62
  icon: F
64
63
  },
65
64
  `option-item-${t}-${L}`
@@ -72,41 +71,41 @@ const se = (C) => {
72
71
  onClick: I,
73
72
  onMouseDown: S,
74
73
  "data-size": z,
75
- "data-required": x(D),
76
- children: /* @__PURE__ */ l("div", { className: "select-tags-container", children: [
77
- /* @__PURE__ */ l("div", { className: "select-tags", children: [
74
+ "data-required": v(y),
75
+ children: /* @__PURE__ */ c("div", { className: "select-tags-container", children: [
76
+ /* @__PURE__ */ c("div", { className: "select-tags", children: [
78
77
  n.length > 0 && /* @__PURE__ */ o(
79
78
  "div",
80
79
  {
81
80
  className: "tag-container",
82
- ref: w,
81
+ ref: b,
83
82
  role: "listbox",
84
- "data-readonly": x(m),
85
- children: n.map((e, t) => /* @__PURE__ */ l("div", { className: "tag", children: [
86
- /* @__PURE__ */ o("span", { className: "tag-name", children: O[e].title }),
87
- /* @__PURE__ */ o("button", { className: "tag-close-button", onClick: (s) => $(s, e), children: /* @__PURE__ */ o(d, { className: "tag-close-icon", icon: Q.faClose, size: "xxxs" }) })
83
+ "data-readonly": v(m),
84
+ children: n.map((e, t) => /* @__PURE__ */ c("div", { className: "tag", children: [
85
+ /* @__PURE__ */ o("span", { className: "tag-name", children: E[e].title }),
86
+ /* @__PURE__ */ o("button", { className: "tag-close-button", onClick: (i) => $(i, e), children: /* @__PURE__ */ o(d, { className: "tag-close-icon", icon: G, size: "xxxs" }) })
88
87
  ] }, `tag-option-${e}-${t}`))
89
88
  }
90
89
  ),
91
90
  (!m || n.length === 0) && /* @__PURE__ */ o(
92
91
  "input",
93
92
  {
94
- ref: K([A, i]),
93
+ ref: X([A, a]),
95
94
  type: "text",
96
95
  autoCapitalize: "none",
97
96
  autoComplete: "off",
98
97
  autoCorrect: "off",
99
98
  className: "form-input",
100
99
  spellCheck: !1,
101
- value: a,
102
- disabled: u,
100
+ value: s,
101
+ disabled: f,
103
102
  readOnly: m,
104
103
  placeholder: N,
105
- onChange: ({ target: e }) => E(e.value)
104
+ onChange: ({ target: e }) => D(e.value)
106
105
  }
107
106
  )
108
107
  ] }),
109
- /* @__PURE__ */ o(d, { className: "expand-icon", icon: H.faChevronDown, size: "xxxs" })
108
+ /* @__PURE__ */ o(d, { className: "expand-icon", icon: J, size: "xxxs" })
110
109
  ] })
111
110
  }
112
111
  )
@@ -114,5 +113,5 @@ const se = (C) => {
114
113
  );
115
114
  };
116
115
  export {
117
- se as SelectTags
116
+ re as SelectTags
118
117
  };
@@ -2,11 +2,11 @@ import { jsx as u } from "react/jsx-runtime";
2
2
  import { Popover as T } from "./bundle.es10.js";
3
3
  import { Input as w } from "./bundle.es13.js";
4
4
  import { useState as A, useRef as j } from "react";
5
- import { Calendar as E } from "./bundle.es56.js";
6
- import { useDayDisableCheker as N } from "./bundle.es57.js";
5
+ import { Calendar as E } from "./bundle.es53.js";
6
+ import { useDayDisableCheker as N } from "./bundle.es54.js";
7
7
  import { getNum as h, formatTime as v } from "@companix/utils-js";
8
- import { removeDigits as O } from "./bundle.es58.js";
9
- import { SelectRightElements as Y } from "./bundle.es59.js";
8
+ import { removeDigits as O } from "./bundle.es55.js";
9
+ import { SelectRightElements as Y } from "./bundle.es56.js";
10
10
  const i = {
11
11
  char: "-",
12
12
  toString: (e) => {
@@ -1,8 +1,8 @@
1
1
  import { jsxs as D, jsx as h } from "react/jsx-runtime";
2
2
  import { useMemo as M, useEffect as C } from "react";
3
3
  import { Select as c } from "./bundle.es12.js";
4
- import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.es58.js";
5
- import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es60.js";
4
+ import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.es55.js";
5
+ import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es57.js";
6
6
  const B = ({
7
7
  min: o = j,
8
8
  max: e = N,
@@ -1,8 +1,8 @@
1
1
  import { jsx as g } from "react/jsx-runtime";
2
2
  import { useRef as _, useMemo as b, useState as P, useEffect as j } from "react";
3
3
  import { getNum as v } from "@companix/utils-js";
4
- import { getTimesOptions as D, getTimeValue as A, removeDigits as W, convertTimeToOption as q } from "./bundle.es58.js";
5
- import { SelectRightElements as w } from "./bundle.es59.js";
4
+ import { getTimesOptions as D, getTimeValue as A, removeDigits as W, convertTimeToOption as q } from "./bundle.es55.js";
5
+ import { SelectRightElements as w } from "./bundle.es56.js";
6
6
  import { Select as y } from "./bundle.es12.js";
7
7
  import { Input as z } from "./bundle.es13.js";
8
8
  const r = {
@@ -1,24 +1,22 @@
1
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;
2
+ import m from "classnames";
3
+ import { forwardRef as s } from "react";
4
+ const g = s(
5
+ ({ icon: r, className: t, size: i = "m", ...e }, n) => {
6
+ const [c, a, , , l] = r;
7
7
  return /* @__PURE__ */ o(
8
8
  "svg",
9
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),
10
+ ref: n,
11
+ viewBox: `0 0 ${c} ${a}`,
12
+ className: m(`icon icon-size-${i}`, t),
15
13
  ...e,
16
14
  role: "img",
17
- children: /* @__PURE__ */ o(s, { paths: m })
15
+ children: /* @__PURE__ */ o(f, { paths: l })
18
16
  }
19
17
  );
20
18
  }
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 });
19
+ ), f = ({ 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 });
22
20
  export {
23
21
  g as Icon
24
22
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as u } from "react/jsx-runtime";
2
2
  import { useState as h, useEffect as c, createContext as f, useContext as w } from "react";
3
- import { getColorScheme as v, updateDOM as m } from "./bundle.es61.js";
3
+ import { getColorScheme as v, updateDOM as m } from "./bundle.es58.js";
4
4
  const i = f({
5
5
  setColorScheme: () => {
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { hash as m } from "@companix/utils-js";
3
3
  import { useRef as n, useMemo as s } from "react";
4
- import { Viewport as u } from "./bundle.es62.js";
4
+ import { Viewport as u } from "./bundle.es59.js";
5
5
  const h = (t = {}) => {
6
6
  const e = {
7
7
  emit: (r) => {
@@ -1,6 +1,6 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { hash as r } from "@companix/utils-js";
3
- import { Viewport as a } from "./bundle.es63.js";
3
+ import { Viewport as a } from "./bundle.es60.js";
4
4
  import { useRef as c, useMemo as h } from "react";
5
5
  const m = (i = {}) => {
6
6
  const o = {
@@ -2,7 +2,7 @@ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
2
  import * as t from "@radix-ui/react-toast";
3
3
  import { attr as T } from "@companix/utils-browser";
4
4
  import { useState as d, useRef as b, useEffect as j, useLayoutEffect as E } from "react";
5
- import { RemoveListener as I } from "./bundle.es51.js";
5
+ import { RemoveListener as I } from "./bundle.es50.js";
6
6
  const m = (o) => {
7
7
  const [r, u] = d(!0), [p, f] = d(!1), s = b(null), {
8
8
  appearance: C = "neutral",
@@ -4,7 +4,7 @@ import { attr as l } from "@companix/utils-browser";
4
4
  import { forwardRef as y, useRef as S, useCallback as T } from "react";
5
5
  import { VisuallyHidden as j } from "@radix-ui/react-visually-hidden";
6
6
  import { mergeRefs as w } from "react-merge-refs";
7
- import { SelectRightElements as z } from "./bundle.es59.js";
7
+ import { SelectRightElements as z } from "./bundle.es56.js";
8
8
  const V = y(
9
9
  ({
10
10
  required: a,
@@ -2,7 +2,7 @@ import { jsxs as b, jsx as o } from "react/jsx-runtime";
2
2
  import h from "classnames";
3
3
  import { attr as e } from "@companix/utils-browser";
4
4
  import { forwardRef as x } from "react";
5
- import { useInputPadding as N } from "./bundle.es64.js";
5
+ import { useInputPadding as N } from "./bundle.es61.js";
6
6
  const v = x(
7
7
  ({
8
8
  required: s,
@@ -1,5 +1,7 @@
1
- import { __require as r } from "./bundle.es65.js";
2
- var a = /* @__PURE__ */ r();
1
+ import { useEffect as r } from "react";
2
+ const n = ({ callback: e }) => (r(() => () => {
3
+ e?.();
4
+ }, []), null);
3
5
  export {
4
- a as f
6
+ n as RemoveListener
5
7
  };
@@ -1,7 +1,16 @@
1
- import { useEffect as r } from "react";
2
- const n = ({ callback: e }) => (r(() => () => {
3
- e?.();
4
- }, []), null);
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
+ };
5
14
  export {
6
- n as RemoveListener
15
+ d as useLoading
7
16
  };
@@ -1,16 +1,16 @@
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
- } };
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];
13
13
  };
14
14
  export {
15
- d as useLoading
15
+ f as useResizeTextarea
16
16
  };
@@ -1,16 +1,72 @@
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 { 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.es55.js";
3
+ import { CalendarHeader as F } from "./bundle.es62.js";
4
+ import { useCalendar as j } from "./bundle.es63.js";
5
+ import { attr as m } from "@companix/utils-browser";
6
+ import { isSameDate as f } from "./bundle.es54.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
+ );
13
69
  };
14
70
  export {
15
- f as useResizeTextarea
71
+ T as Calendar
16
72
  };