@companix/uikit 0.0.32 → 0.0.34

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 (92) hide show
  1. package/dist/Avatar/Avatar.scss +64 -0
  2. package/dist/Avatar/helpers.d.ts +10 -0
  3. package/dist/Avatar/index.d.ts +8 -0
  4. package/dist/Avatar/types.d.ts +2 -0
  5. package/dist/Icon/index.d.ts +2 -3
  6. package/dist/Segments/Segments.scss +57 -0
  7. package/dist/Segments/index.d.ts +11 -0
  8. package/dist/ThemeProvider/script.d.ts +1 -0
  9. package/dist/bundle.es.js +86 -77
  10. package/dist/bundle.es10.js +78 -39
  11. package/dist/bundle.es11.js +26 -36
  12. package/dist/bundle.es12.js +75 -56
  13. package/dist/bundle.es13.js +39 -19
  14. package/dist/bundle.es14.js +36 -33
  15. package/dist/bundle.es15.js +54 -23
  16. package/dist/bundle.es16.js +21 -45
  17. package/dist/bundle.es17.js +29 -19
  18. package/dist/bundle.es18.js +21 -25
  19. package/dist/bundle.es19.js +45 -38
  20. package/dist/bundle.es2.js +42 -45
  21. package/dist/bundle.es20.js +21 -14
  22. package/dist/bundle.es21.js +28 -33
  23. package/dist/bundle.es22.js +38 -21
  24. package/dist/bundle.es23.js +12 -38
  25. package/dist/bundle.es24.js +32 -114
  26. package/dist/bundle.es25.js +20 -120
  27. package/dist/bundle.es26.js +40 -72
  28. package/dist/bundle.es27.js +115 -32
  29. package/dist/bundle.es28.js +120 -11
  30. package/dist/bundle.es29.js +71 -83
  31. package/dist/bundle.es3.js +2 -8
  32. package/dist/bundle.es30.js +31 -20
  33. package/dist/bundle.es31.js +11 -6
  34. package/dist/bundle.es32.js +83 -36
  35. package/dist/bundle.es33.js +22 -11
  36. package/dist/bundle.es34.js +6 -24
  37. package/dist/bundle.es35.js +33 -37
  38. package/dist/bundle.es36.js +20 -49
  39. package/dist/bundle.es37.js +10 -42
  40. package/dist/bundle.es38.js +24 -8
  41. package/dist/bundle.es39.js +35 -20
  42. package/dist/bundle.es4.js +44 -10
  43. package/dist/bundle.es40.js +51 -87
  44. package/dist/bundle.es41.js +42 -17
  45. package/dist/bundle.es42.js +8 -19
  46. package/dist/bundle.es43.js +25 -24
  47. package/dist/bundle.es44.js +24 -39
  48. package/dist/bundle.es45.js +87 -3
  49. package/dist/bundle.es46.js +18 -5
  50. package/dist/bundle.es47.js +19 -13
  51. package/dist/bundle.es48.js +24 -14
  52. package/dist/bundle.es49.js +39 -3
  53. package/dist/bundle.es5.js +8 -85
  54. package/dist/bundle.es50.js +3 -3
  55. package/dist/bundle.es51.js +5 -70
  56. package/dist/bundle.es52.js +13 -67
  57. package/dist/bundle.es53.js +13 -69
  58. package/dist/bundle.es54.js +3 -12
  59. package/dist/bundle.es55.js +3 -43
  60. package/dist/bundle.es56.js +69 -14
  61. package/dist/bundle.es57.js +67 -23
  62. package/dist/bundle.es58.js +69 -31
  63. package/dist/bundle.es59.js +12 -70
  64. package/dist/bundle.es6.js +11 -85
  65. package/dist/bundle.es60.js +41 -12
  66. package/dist/bundle.es61.js +15 -20
  67. package/dist/bundle.es62.js +32 -2
  68. package/dist/bundle.es63.js +69 -19
  69. package/dist/bundle.es64.js +76 -2
  70. package/dist/bundle.es65.js +49 -21
  71. package/dist/bundle.es66.js +14 -2
  72. package/dist/bundle.es67.js +9 -9
  73. package/dist/bundle.es68.js +2 -76
  74. package/dist/bundle.es69.js +20 -49
  75. package/dist/bundle.es7.js +84 -79
  76. package/dist/bundle.es70.js +2 -2
  77. package/dist/bundle.es71.js +21 -14
  78. package/dist/bundle.es72.js +2 -3
  79. package/dist/bundle.es73.js +20 -3
  80. package/dist/bundle.es74.js +3 -20
  81. package/dist/bundle.es75.js +3 -2
  82. package/dist/bundle.es76.js +14 -20
  83. package/dist/bundle.es77.js +2 -2
  84. package/dist/bundle.es78.js +22 -0
  85. package/dist/bundle.es79.js +4 -0
  86. package/dist/bundle.es8.js +83 -24
  87. package/dist/bundle.es80.js +22 -0
  88. package/dist/bundle.es81.js +4 -0
  89. package/dist/bundle.es9.js +20 -73
  90. package/dist/index.d.ts +7 -0
  91. package/dist/index.scss +2 -0
  92. package/package.json +1 -1
@@ -1,76 +1,44 @@
1
- import { jsxs as D, jsx as h } from "react/jsx-runtime";
2
- import { useMemo as M, useEffect as C } from "react";
3
- import { Select as c } from "./bundle.es9.js";
4
- import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.es53.js";
5
- import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es55.js";
6
- const B = ({
7
- min: o = j,
8
- max: e = N,
9
- disabled: r,
10
- value: a,
11
- noDaySelect: g,
12
- noYearSelect: u,
13
- onChange: l,
14
- required: m,
15
- size: i
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { useResizeTextarea as x } from "./bundle.es53.js";
3
+ import { attr as e, callMultiple as u } from "@companix/utils-browser";
4
+ import { useEffect as z } from "react";
5
+ import { mergeRefs as R } from "react-merge-refs";
6
+ const q = ({
7
+ onResize: m,
8
+ grow: a = !1,
9
+ value: t,
10
+ onChange: s,
11
+ disabled: o,
12
+ required: i,
13
+ rows: l = 2,
14
+ fill: p = !1,
15
+ textAreaRef: c,
16
+ ...d
16
17
  }) => {
17
- const d = M(() => O({ min: o, max: e }), [o, e]);
18
- C(() => {
19
- const t = d(a);
20
- t && l(t);
21
- }, [d, a]);
22
- const { years: p, months: w, days: f } = V({ min: o, max: e, now: a }), s = (t, x) => {
23
- const n = { ...a };
24
- n[t] = x;
25
- const y = T(n.month, n.year);
26
- n.day = n.day > y ? y : n.day, l(n);
27
- };
28
- return /* @__PURE__ */ D("div", { className: "data-input", children: [
29
- !u && p.length > 0 && /* @__PURE__ */ h(
30
- c,
31
- {
32
- placeholder: "Год",
33
- options: p,
34
- onChange: (t) => s("year", t),
35
- value: a.year,
36
- required: m,
37
- disabled: r,
38
- size: i,
39
- minimalOptions: !0,
40
- matchTarget: "min-width"
41
- }
42
- ),
43
- /* @__PURE__ */ h(
44
- c,
45
- {
46
- placeholder: "Месяц",
47
- className: "w-full",
48
- options: w,
49
- onChange: (t) => s("month", t),
50
- value: a.month,
51
- disabled: r,
52
- required: m,
53
- size: i,
54
- minimalOptions: !0,
55
- matchTarget: "min-width"
56
- }
57
- ),
58
- !g && /* @__PURE__ */ h(
59
- c,
60
- {
61
- placeholder: "День",
62
- options: f,
63
- disabled: r || f.length === 0,
64
- onChange: (t) => s("day", t),
65
- value: a.day,
66
- required: m,
67
- size: i,
68
- minimalOptions: !0,
69
- matchTarget: "min-width"
70
- }
71
- )
72
- ] });
18
+ const [n, r] = x(m, a);
19
+ return z(r, [r, t]), /* @__PURE__ */ f(
20
+ "div",
21
+ {
22
+ className: "form form-textarea",
23
+ "data-required": e(i),
24
+ "data-disabled": e(o),
25
+ "data-fill": e(p),
26
+ children: /* @__PURE__ */ f(
27
+ "textarea",
28
+ {
29
+ className: "form-input",
30
+ "data-grow": e(a),
31
+ value: t,
32
+ ref: R([c, n]),
33
+ rows: l,
34
+ disabled: o,
35
+ onChange: u(s, r),
36
+ ...d
37
+ }
38
+ )
39
+ }
40
+ );
73
41
  };
74
42
  export {
75
- B as DateInput
43
+ q as TextArea
76
44
  };
@@ -1,35 +1,118 @@
1
- import { jsxs as s, jsx as i } from "react/jsx-runtime";
2
- import { VisuallyHidden as p } from "@radix-ui/react-visually-hidden";
3
- import { useRef as h, useMemo as m } from "react";
4
- const j = ({
5
- onChange: l,
6
- disabled: n,
7
- children: o,
8
- multiple: f,
9
- mimes: e,
10
- className: a
11
- }) => {
12
- const t = h(null), u = (r) => {
13
- n || (r.target.files && l?.(Array.from(r.target.files)), t.current && (t.current.value = ""));
14
- }, c = m(() => {
15
- if (e)
16
- return e.map((r) => `${r}/*`).join(",");
17
- }, [e]);
18
- return /* @__PURE__ */ s("label", { className: a, children: [
19
- o,
20
- /* @__PURE__ */ i(p, { asChild: !0, children: /* @__PURE__ */ i(
21
- "input",
22
- {
23
- ref: t,
24
- type: "file",
25
- multiple: f,
26
- accept: c,
27
- onChange: u,
28
- disabled: n
29
- }
30
- ) })
31
- ] });
1
+ import { jsx as o, jsxs as l } from "react/jsx-runtime";
2
+ import { useFroozeClosing as M } from "./bundle.es44.js";
3
+ import { Popover as j } from "./bundle.es10.js";
4
+ import { OptionItem as q } from "./bundle.es14.js";
5
+ import { OptionsList as V } from "./bundle.es16.js";
6
+ import { Icon as d } from "./bundle.es33.js";
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) => {
13
+ const {
14
+ options: r,
15
+ closeAfterSelect: v,
16
+ placeholder: N,
17
+ onChange: c,
18
+ emptyText: R = "Ничего не найдено",
19
+ readOnly: m,
20
+ size: z = "md",
21
+ value: n,
22
+ 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(() => {
26
+ const e = {};
27
+ return r.forEach((t) => {
28
+ e[t.value] = t;
29
+ }), 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();
40
+ }, S = (e) => {
41
+ e.target !== i.current && e.preventDefault();
42
+ }, $ = (e, t) => {
43
+ e.stopPropagation(), c(T(t));
44
+ };
45
+ return /* @__PURE__ */ o(
46
+ j,
47
+ {
48
+ minimal: !0,
49
+ ref: f,
50
+ sideOffset: 0,
51
+ matchTarget: "width",
52
+ onAnimationEnd: b,
53
+ onOpenAutoFocus: (e) => e.preventDefault(),
54
+ onCloseAutoFocus: (e) => e.preventDefault(),
55
+ content: ({ close: e }) => /* @__PURE__ */ l(V, { maxHeight: 300, children: [
56
+ p.length === 0 && /* @__PURE__ */ o("div", { className: "select-tags-empty", children: R }),
57
+ p.map(({ value: t, title: s, icon: F }, L) => /* @__PURE__ */ o(
58
+ q,
59
+ {
60
+ active: n.includes(t),
61
+ onClick: () => k(P(t), e),
62
+ title: s,
63
+ icon: F
64
+ },
65
+ `option-item-${t}-${L}`
66
+ ))
67
+ ] }),
68
+ children: /* @__PURE__ */ o(
69
+ "div",
70
+ {
71
+ className: "form",
72
+ onClick: I,
73
+ onMouseDown: S,
74
+ "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: [
78
+ n.length > 0 && /* @__PURE__ */ o(
79
+ "div",
80
+ {
81
+ className: "tag-container",
82
+ ref: w,
83
+ 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" }) })
88
+ ] }, `tag-option-${e}-${t}`))
89
+ }
90
+ ),
91
+ (!m || n.length === 0) && /* @__PURE__ */ o(
92
+ "input",
93
+ {
94
+ ref: K([A, i]),
95
+ type: "text",
96
+ autoCapitalize: "none",
97
+ autoComplete: "off",
98
+ autoCorrect: "off",
99
+ className: "form-input",
100
+ spellCheck: !1,
101
+ value: a,
102
+ disabled: u,
103
+ readOnly: m,
104
+ placeholder: N,
105
+ onChange: ({ target: e }) => E(e.value)
106
+ }
107
+ )
108
+ ] }),
109
+ /* @__PURE__ */ o(d, { className: "expand-icon", icon: H.faChevronDown, size: "xxxs" })
110
+ ] })
111
+ }
112
+ )
113
+ }
114
+ );
32
115
  };
33
116
  export {
34
- j as FileOverlay
117
+ se as SelectTags
35
118
  };
@@ -1,14 +1,123 @@
1
- import { jsxs as p, jsx as a } from "react/jsx-runtime";
2
- import t from "classnames";
3
- import { attr as n } from "@companix/utils-browser";
4
- const u = (o) => {
5
- const { fill: e, className: l, label: c, children: i, caption: r, apperance: m = "neutral" } = o;
6
- return /* @__PURE__ */ p("div", { className: t("form-group", l), "data-fill": n(e), children: [
7
- /* @__PURE__ */ a("div", { className: "form-group-label", children: c }),
8
- i,
9
- r && /* @__PURE__ */ a("div", { className: "form-group-caption", "data-appearance": m, children: r })
10
- ] });
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { Popover as T } from "./bundle.es10.js";
3
+ import { Input as w } from "./bundle.es13.js";
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";
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";
10
+ const i = {
11
+ char: "-",
12
+ toString: (e) => {
13
+ if (e) {
14
+ const n = v(e.getDate()), r = v(e.getMonth() + 1), l = e.getFullYear();
15
+ return [n, r, l].join(i.char);
16
+ }
17
+ return "";
18
+ },
19
+ toValue: (e) => {
20
+ const n = e.split(i.char);
21
+ if (n.length === 3) {
22
+ const [r, l, a] = [h(n[0]), h(n[1]), h(n[2])];
23
+ if (r && l && a) {
24
+ const o = new Date(a, l - 1, r);
25
+ if (o.getFullYear() === a && o.getDate() === r && o.getMonth() === l - 1)
26
+ return o;
27
+ }
28
+ }
29
+ return null;
30
+ }
31
+ }, U = (e) => {
32
+ const {
33
+ clearButton: n,
34
+ clearButtonIcon: r,
35
+ children: l,
36
+ disabled: a,
37
+ // calendar props
38
+ value: o,
39
+ enableTime: y,
40
+ disablePickers: I,
41
+ showNeighboringMonth: P,
42
+ onChange: c,
43
+ shouldDisableDate: g,
44
+ viewDate: S,
45
+ disablePast: d,
46
+ disableFuture: D,
47
+ minDateTime: C,
48
+ maxDateTime: b,
49
+ // input props
50
+ ...V
51
+ } = e, [m, s] = A(() => i.toString(o ?? null)), p = j(null), k = N({
52
+ disableFuture: D,
53
+ disablePast: d,
54
+ shouldDisableDate: g,
55
+ minDateTime: C,
56
+ maxDateTime: b
57
+ }), B = (t) => {
58
+ a || p.current && p.current.getAttribute("data-state") === "open" && t.preventDefault();
59
+ }, F = (t) => {
60
+ t.stopPropagation(), s(""), c?.(null);
61
+ }, x = (t) => {
62
+ s(t);
63
+ const f = i.toValue(t);
64
+ f && !k(f) && c?.(f);
65
+ }, M = () => {
66
+ const t = i.toValue(m);
67
+ (!t || k(t)) && s(i.toString(o ?? null));
68
+ }, R = (t) => {
69
+ c?.(t), s(i.toString(t));
70
+ };
71
+ return /* @__PURE__ */ u(
72
+ T,
73
+ {
74
+ minimal: !0,
75
+ ref: p,
76
+ sideOffset: 0,
77
+ onOpenAutoFocus: (t) => t.preventDefault(),
78
+ onCloseAutoFocus: (t) => t.preventDefault(),
79
+ disabled: a,
80
+ fitMaxHeight: !1,
81
+ content: () => /* @__PURE__ */ u(
82
+ E,
83
+ {
84
+ value: o,
85
+ disablePast: d,
86
+ disableFuture: D,
87
+ enableTime: y,
88
+ disablePickers: I,
89
+ showNeighboringMonth: P,
90
+ onChange: R,
91
+ shouldDisableDate: g,
92
+ viewDate: S,
93
+ minDateTime: C,
94
+ maxDateTime: b
95
+ }
96
+ ),
97
+ children: /* @__PURE__ */ u(
98
+ w,
99
+ {
100
+ ...V,
101
+ value: m,
102
+ disabled: a,
103
+ onClick: B,
104
+ onValueChange: x,
105
+ onBlur: M,
106
+ mask: "99-99-9999",
107
+ rightElement: /* @__PURE__ */ u(
108
+ Y,
109
+ {
110
+ clearButton: n,
111
+ clearButtonIcon: r,
112
+ value: !!O(m, ["-", "_"]),
113
+ onClear: F
114
+ }
115
+ )
116
+ }
117
+ )
118
+ }
119
+ );
11
120
  };
12
121
  export {
13
- u as FormGroup
122
+ U as DatePicker
14
123
  };
@@ -1,88 +1,76 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- import { useRef as _, useMemo as b, useState as P, useEffect as j } from "react";
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.es53.js";
5
- import { SelectRightElements as w } from "./bundle.es54.js";
6
- import { Select as y } from "./bundle.es9.js";
7
- import { Input as z } from "./bundle.es10.js";
8
- const r = {
9
- char: ":",
10
- toString: (s) => s ? q(s, r.char) : "",
11
- toValue: (s) => {
12
- const n = s.split(r.char);
13
- if (n.length === 2) {
14
- const [e, i] = [v(n[0]), v(n[1])];
15
- if (e !== null && i !== null && e < 24 && e >= 0 && i < 60 && i >= 0)
16
- return { hours: e, minutes: i };
17
- }
18
- return null;
19
- }
20
- }, U = (s) => {
21
- const { value: n, onChange: e, clearButton: i, clearButtonIcon: I, disabled: a, ...T } = s, m = _(null), p = _(null), h = b(() => D(10), []), d = b(() => {
22
- if (n && !n.minutes.toString().endsWith("0")) {
23
- const t = n.hours * 6 + Math.trunc(n.minutes / 10), u = [...h];
24
- return u.splice(t + 1, 0, A(n)), u;
25
- }
26
- return h;
27
- }, [h, n]), [o, l] = P(() => r.toString(n)), x = (t) => {
28
- l(t);
29
- const u = r.toValue(t);
30
- u && e?.(u);
31
- }, B = (t) => {
32
- a || m.current && m.current.getAttribute("data-state") === "open" && t.preventDefault();
33
- }, O = () => {
34
- r.toValue(o) === null && l(r.toString(n ?? null));
35
- }, R = (t) => {
36
- e?.(r.toValue(t)), l(t);
37
- }, k = (t) => {
38
- t.stopPropagation(), l(""), e?.(null);
1
+ import { jsxs as D, jsx as h } from "react/jsx-runtime";
2
+ import { useMemo as M, useEffect as C } from "react";
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";
6
+ const B = ({
7
+ min: o = j,
8
+ max: e = N,
9
+ disabled: r,
10
+ value: a,
11
+ noDaySelect: g,
12
+ noYearSelect: u,
13
+ onChange: l,
14
+ required: m,
15
+ size: i
16
+ }) => {
17
+ const d = M(() => O({ min: o, max: e }), [o, e]);
18
+ C(() => {
19
+ const t = d(a);
20
+ t && l(t);
21
+ }, [d, a]);
22
+ const { years: p, months: w, days: f } = V({ min: o, max: e, now: a }), s = (t, x) => {
23
+ const n = { ...a };
24
+ n[t] = x;
25
+ const y = T(n.month, n.year);
26
+ n.day = n.day > y ? y : n.day, l(n);
39
27
  };
40
- return j(() => {
41
- if (o && o !== "__:__") {
42
- const [t, u] = o.split(":"), V = (c) => {
43
- const [C, S] = c.split(""), [E, M] = [C === "_" ? "0" : C, S === "_" ? "0" : S];
44
- return E + M;
45
- }, N = [V(t), V(u)].join(":"), f = r.toValue(N);
46
- if (f) {
47
- const c = f.hours * 6 + Math.trunc(f.minutes / 10);
48
- c !== -1 && p.current && p.current.scrollTo(c);
28
+ return /* @__PURE__ */ D("div", { className: "data-input", children: [
29
+ !u && p.length > 0 && /* @__PURE__ */ h(
30
+ c,
31
+ {
32
+ placeholder: "Год",
33
+ options: p,
34
+ onChange: (t) => s("year", t),
35
+ value: a.year,
36
+ required: m,
37
+ disabled: r,
38
+ size: i,
39
+ minimalOptions: !0,
40
+ matchTarget: "min-width"
49
41
  }
50
- }
51
- }, [d, o]), /* @__PURE__ */ g(
52
- y,
53
- {
54
- minimalOptions: !0,
55
- options: d,
56
- onChange: R,
57
- value: o,
58
- popoverRef: m,
59
- scrollRef: p,
60
- disabled: a,
61
- children: /* @__PURE__ */ g(
62
- z,
63
- {
64
- ...T,
65
- value: o,
66
- disabled: a,
67
- onClick: B,
68
- onValueChange: x,
69
- onBlur: O,
70
- mask: "99:99",
71
- placeholder: "00:00",
72
- rightElement: /* @__PURE__ */ g(
73
- w,
74
- {
75
- clearButton: i,
76
- clearButtonIcon: I,
77
- value: !!W(o, [":", "_"]),
78
- onClear: k
79
- }
80
- )
81
- }
82
- )
83
- }
84
- );
42
+ ),
43
+ /* @__PURE__ */ h(
44
+ c,
45
+ {
46
+ placeholder: "Месяц",
47
+ className: "w-full",
48
+ options: w,
49
+ onChange: (t) => s("month", t),
50
+ value: a.month,
51
+ disabled: r,
52
+ required: m,
53
+ size: i,
54
+ minimalOptions: !0,
55
+ matchTarget: "min-width"
56
+ }
57
+ ),
58
+ !g && /* @__PURE__ */ h(
59
+ c,
60
+ {
61
+ placeholder: "День",
62
+ options: f,
63
+ disabled: r || f.length === 0,
64
+ onChange: (t) => s("day", t),
65
+ value: a.day,
66
+ required: m,
67
+ size: i,
68
+ minimalOptions: !0,
69
+ matchTarget: "min-width"
70
+ }
71
+ )
72
+ ] });
85
73
  };
86
74
  export {
87
- U as TimePicker
75
+ B as DateInput
88
76
  };
@@ -1,10 +1,4 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import { forwardRef as p } from "react";
3
- import a from "classnames";
4
- import { attr as i } from "@companix/utils-browser";
5
- const c = p(
6
- ({ children: r, className: o, fill: t }, m) => /* @__PURE__ */ f("div", { ref: m, className: a("button-group", o), "data-fill": i(t), children: r })
7
- );
1
+ const a = [16, 20, 24, 28, 32, 36, 40, 44, 48, 56, 64, 72, 80, 88, 96];
8
2
  export {
9
- c as ButtonGroup
3
+ a as avatarSizes
10
4
  };
@@ -1,24 +1,35 @@
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",
1
+ import { jsxs as s, jsx as i } from "react/jsx-runtime";
2
+ import { VisuallyHidden as p } from "@radix-ui/react-visually-hidden";
3
+ import { useRef as h, useMemo as m } from "react";
4
+ const j = ({
5
+ onChange: l,
6
+ disabled: n,
7
+ children: o,
8
+ multiple: f,
9
+ mimes: e,
10
+ className: a
11
+ }) => {
12
+ const t = h(null), u = (r) => {
13
+ n || (r.target.files && l?.(Array.from(r.target.files)), t.current && (t.current.value = ""));
14
+ }, c = m(() => {
15
+ if (e)
16
+ return e.map((r) => `${r}/*`).join(",");
17
+ }, [e]);
18
+ return /* @__PURE__ */ s("label", { className: a, children: [
19
+ o,
20
+ /* @__PURE__ */ i(p, { asChild: !0, children: /* @__PURE__ */ i(
21
+ "input",
9
22
  {
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 })
23
+ ref: t,
24
+ type: "file",
25
+ multiple: f,
26
+ accept: c,
27
+ onChange: u,
28
+ disabled: n
18
29
  }
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 });
30
+ ) })
31
+ ] });
32
+ };
22
33
  export {
23
- g as Icon
34
+ j as FileOverlay
24
35
  };
@@ -1,9 +1,14 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { clamp as o, pc as p } from "@companix/utils-browser";
3
- const i = ({ appearance: a = "primary", value: e }) => {
4
- const s = 100 * o(e, 0, 1);
5
- return /* @__PURE__ */ r("div", { "aria-valuemax": 100, "aria-valuemin": 0, role: "progressbar", className: "progress-bar", children: /* @__PURE__ */ r("div", { className: "progress-bar-thumb", "data-appearance": a, style: { width: p(s) } }) });
1
+ import { jsxs as p, jsx as a } from "react/jsx-runtime";
2
+ import t from "classnames";
3
+ import { attr as n } from "@companix/utils-browser";
4
+ const u = (o) => {
5
+ const { fill: e, className: l, label: c, children: i, caption: r, apperance: m = "neutral" } = o;
6
+ return /* @__PURE__ */ p("div", { className: t("form-group", l), "data-fill": n(e), children: [
7
+ /* @__PURE__ */ a("div", { className: "form-group-label", children: c }),
8
+ i,
9
+ r && /* @__PURE__ */ a("div", { className: "form-group-caption", "data-appearance": m, children: r })
10
+ ] });
6
11
  };
7
12
  export {
8
- i as ProgressBar
13
+ u as FormGroup
9
14
  };