@companix/uikit 0.1.42 → 0.1.44

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 (84) hide show
  1. package/dist/CounterInput/CounterInput.scss +29 -0
  2. package/dist/CounterInput/index.d.ts +14 -0
  3. package/dist/Select/index.d.ts +9 -1
  4. package/dist/bundle.es.js +122 -120
  5. package/dist/bundle.es10.js +1 -1
  6. package/dist/bundle.es13.js +82 -76
  7. package/dist/bundle.es14.js +4 -4
  8. package/dist/bundle.es15.js +2 -2
  9. package/dist/bundle.es16.js +1 -1
  10. package/dist/bundle.es17.js +1 -1
  11. package/dist/bundle.es18.js +105 -19
  12. package/dist/bundle.es19.js +21 -34
  13. package/dist/bundle.es20.js +33 -24
  14. package/dist/bundle.es21.js +24 -45
  15. package/dist/bundle.es22.js +46 -26
  16. package/dist/bundle.es23.js +24 -259
  17. package/dist/bundle.es24.js +260 -13
  18. package/dist/bundle.es25.js +14 -21
  19. package/dist/bundle.es26.js +20 -37
  20. package/dist/bundle.es27.js +38 -21
  21. package/dist/bundle.es28.js +20 -18
  22. package/dist/bundle.es29.js +18 -21
  23. package/dist/bundle.es30.js +21 -43
  24. package/dist/bundle.es31.js +37 -114
  25. package/dist/bundle.es32.js +119 -72
  26. package/dist/bundle.es33.js +68 -38
  27. package/dist/bundle.es34.js +42 -10
  28. package/dist/bundle.es35.js +11 -85
  29. package/dist/bundle.es36.js +85 -19
  30. package/dist/bundle.es37.js +20 -7
  31. package/dist/bundle.es38.js +7 -3
  32. package/dist/bundle.es39.js +3 -23
  33. package/dist/bundle.es40.js +16 -45
  34. package/dist/bundle.es41.js +51 -56
  35. package/dist/bundle.es42.js +57 -162
  36. package/dist/bundle.es43.js +160 -79
  37. package/dist/bundle.es44.js +81 -7
  38. package/dist/bundle.es45.js +7 -59
  39. package/dist/bundle.es46.js +58 -33
  40. package/dist/bundle.es47.js +33 -20
  41. package/dist/bundle.es48.js +19 -47
  42. package/dist/bundle.es49.js +49 -11
  43. package/dist/bundle.es50.js +11 -13
  44. package/dist/bundle.es51.js +13 -13
  45. package/dist/bundle.es52.js +13 -30
  46. package/dist/bundle.es53.js +30 -11
  47. package/dist/bundle.es54.js +10 -25
  48. package/dist/bundle.es55.js +17 -29
  49. package/dist/bundle.es56.js +36 -48
  50. package/dist/bundle.es57.js +49 -55
  51. package/dist/bundle.es58.js +56 -8
  52. package/dist/bundle.es59.js +8 -26
  53. package/dist/bundle.es60.js +27 -5
  54. package/dist/bundle.es61.js +5 -66
  55. package/dist/bundle.es62.js +66 -23
  56. package/dist/bundle.es63.js +22 -23
  57. package/dist/bundle.es64.js +24 -90
  58. package/dist/bundle.es65.js +90 -18
  59. package/dist/bundle.es66.js +17 -93
  60. package/dist/bundle.es67.js +93 -73
  61. package/dist/bundle.es68.js +73 -23
  62. package/dist/bundle.es69.js +20 -35
  63. package/dist/bundle.es70.js +39 -24
  64. package/dist/bundle.es71.js +24 -79
  65. package/dist/bundle.es72.js +71 -85
  66. package/dist/bundle.es73.js +93 -10
  67. package/dist/bundle.es74.js +10 -6
  68. package/dist/bundle.es75.js +5 -69
  69. package/dist/bundle.es76.js +68 -10
  70. package/dist/bundle.es77.js +11 -42
  71. package/dist/bundle.es78.js +42 -32
  72. package/dist/bundle.es79.js +31 -64
  73. package/dist/bundle.es80.js +65 -40
  74. package/dist/bundle.es81.js +40 -14
  75. package/dist/bundle.es82.js +15 -32
  76. package/dist/bundle.es83.js +23 -61
  77. package/dist/bundle.es84.js +69 -13
  78. package/dist/bundle.es85.js +13 -74
  79. package/dist/bundle.es86.js +71 -45
  80. package/dist/bundle.es87.js +48 -13
  81. package/dist/bundle.es88.js +16 -0
  82. package/dist/index.d.ts +3 -1
  83. package/dist/index.scss +1 -0
  84. package/package.json +1 -1
@@ -1,23 +1,109 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { Scrollable as n } from "./bundle.es8.js";
3
- const s = ({
4
- children: o,
5
- maxHeight: t,
6
- scrollboxRef: i,
7
- optionsWrapperRef: e
8
- }) => /* @__PURE__ */ r(
9
- n,
10
- {
11
- ref: i,
12
- implementation: "inner",
13
- padding: 10,
14
- thumbPadding: 3,
15
- thumbColor: "#0000002b",
16
- maxHeight: t,
17
- scrollY: !0,
18
- children: /* @__PURE__ */ r("div", { className: "option-list", ref: e, children: o })
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import b from "classnames";
3
+ import { forwardRef as G, useRef as H } from "react";
4
+ import { mergeRefs as J } from "react-merge-refs";
5
+ import { NumericFormat as K } from "react-number-format";
6
+ import { faPlus as L, faMinus as O } from "@companix/icons-solid";
7
+ import { getFloatDigits as Q, normalize as a } from "@companix/utils-js";
8
+ import { InputContainer as T } from "./bundle.es70.js";
9
+ import { Icon as x } from "./bundle.es37.js";
10
+ const tt = G(
11
+ ({
12
+ onChange: I,
13
+ onValueChange: c,
14
+ value: t,
15
+ placeholder: R,
16
+ min: r,
17
+ max: e,
18
+ step: p = 1,
19
+ thousandSeparator: g,
20
+ decimalSeparator: h,
21
+ allowedDecimalSeparators: N,
22
+ thousandsGroupStyle: y,
23
+ decimalScale: f,
24
+ fixedDecimalScale: z,
25
+ allowNegative: C = (r ?? 0) < 0,
26
+ allowLeadingZeros: D,
27
+ suffix: k,
28
+ prefix: B,
29
+ inputClassName: E,
30
+ inputRef: F,
31
+ disabled: s,
32
+ onBlur: j,
33
+ className: w,
34
+ ...M
35
+ }, P) => {
36
+ const u = H(null), m = f ?? Q(String(p)), l = (n) => {
37
+ let o = n;
38
+ return r !== void 0 && o < r && (o = r), e !== void 0 && o > e && (o = e), a(o, m);
39
+ }, d = (n) => {
40
+ c?.(l(a((t ?? 0) + n * p, m)));
41
+ }, S = (n) => {
42
+ if (t != null) {
43
+ const o = l(t);
44
+ o !== t && c?.(o);
45
+ }
46
+ j?.(n);
47
+ }, q = s || r !== void 0 && t !== null && t !== void 0 && t <= r, A = s || e !== void 0 && t !== null && t !== void 0 && t >= e;
48
+ return /* @__PURE__ */ i(
49
+ T,
50
+ {
51
+ ref: P,
52
+ inputRef: u,
53
+ ...M,
54
+ disabled: s,
55
+ onBlur: S,
56
+ className: b("counter-input", w),
57
+ leftElement: /* @__PURE__ */ i(
58
+ "button",
59
+ {
60
+ type: "button",
61
+ className: "counter-input-button",
62
+ tabIndex: -1,
63
+ disabled: q,
64
+ onClick: () => d(-1),
65
+ children: /* @__PURE__ */ i(x, { icon: O, size: "xxxs" })
66
+ }
67
+ ),
68
+ rightElement: /* @__PURE__ */ i(
69
+ "button",
70
+ {
71
+ type: "button",
72
+ className: "counter-input-button",
73
+ tabIndex: -1,
74
+ disabled: A,
75
+ onClick: () => d(1),
76
+ children: /* @__PURE__ */ i(x, { icon: L, size: "xxxs" })
77
+ }
78
+ ),
79
+ children: /* @__PURE__ */ i(
80
+ K,
81
+ {
82
+ type: "text",
83
+ getInputRef: J([u, F]),
84
+ className: b("form-input form-input-base counter-input-field", E),
85
+ "aria-disabled": s,
86
+ onChange: I,
87
+ onValueChange: ({ floatValue: n }) => c?.(n ?? null),
88
+ value: t,
89
+ placeholder: R,
90
+ disabled: s,
91
+ thousandSeparator: g,
92
+ decimalSeparator: h,
93
+ allowedDecimalSeparators: N,
94
+ thousandsGroupStyle: y,
95
+ decimalScale: f,
96
+ fixedDecimalScale: z,
97
+ allowNegative: C,
98
+ allowLeadingZeros: D,
99
+ suffix: k,
100
+ prefix: B
101
+ }
102
+ )
103
+ }
104
+ );
19
105
  }
20
106
  );
21
107
  export {
22
- s as OptionsList
108
+ tt as CounterInput
23
109
  };
@@ -1,36 +1,23 @@
1
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import b from "classnames";
3
- import * as s from "@radix-ui/react-checkbox";
4
- import { Icon as x } from "./bundle.es36.js";
5
- import { faCheck as k } from "@companix/icons-solid";
6
- import { useId as f } from "react";
7
- import { attr as c } from "@companix/utils-browser";
8
- const j = (d) => {
9
- const { checked: a, className: m, required: t, disabled: o, onCheckedChange: l, size: h, label: r } = d, i = f();
10
- return /* @__PURE__ */ n(
11
- "div",
12
- {
13
- className: b("checkbox", m),
14
- "data-size": h ?? "md",
15
- "data-required": c(t && !a),
16
- "data-disabled": c(o),
17
- children: [
18
- /* @__PURE__ */ e(
19
- s.Root,
20
- {
21
- className: "checkbox-box",
22
- checked: a,
23
- onCheckedChange: l,
24
- disabled: o,
25
- id: i,
26
- children: /* @__PURE__ */ e(s.Indicator, { className: "checkbox-icon", children: /* @__PURE__ */ e(x, { icon: k, size: "xxxs" }) })
27
- }
28
- ),
29
- r && /* @__PURE__ */ e("label", { className: "checkbox-label", htmlFor: i, "data-disabled": c(o), children: r })
30
- ]
31
- }
32
- );
33
- };
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Scrollable as n } from "./bundle.es8.js";
3
+ const s = ({
4
+ children: o,
5
+ maxHeight: t,
6
+ scrollboxRef: i,
7
+ optionsWrapperRef: e
8
+ }) => /* @__PURE__ */ r(
9
+ n,
10
+ {
11
+ ref: i,
12
+ implementation: "inner",
13
+ padding: 10,
14
+ thumbPadding: 3,
15
+ thumbColor: "#0000002b",
16
+ maxHeight: t,
17
+ scrollY: !0,
18
+ children: /* @__PURE__ */ r("div", { className: "option-list", ref: e, children: o })
19
+ }
20
+ );
34
21
  export {
35
- j as Checkbox
22
+ s as OptionsList
36
23
  };
@@ -1,27 +1,36 @@
1
- import { jsxs as d, jsx as c } from "react/jsx-runtime";
2
- import * as r from "@radix-ui/react-switch";
3
- import { attr as a } from "@companix/utils-browser";
4
- import { useId as n } from "react";
5
- const u = (m) => {
6
- const { checked: e, disabled: s, onCheckedChange: o, uncheckedIcon: i, checkedIcon: t, label: h } = m, l = n();
7
- return /* @__PURE__ */ d("div", { className: "switch", "data-disabled": a(s), children: [
8
- /* @__PURE__ */ c(
9
- r.Root,
10
- {
11
- className: "switch-track",
12
- checked: e,
13
- onCheckedChange: o,
14
- disabled: s,
15
- id: l,
16
- children: /* @__PURE__ */ d(r.Thumb, { className: "switch-thumb", children: [
17
- i && /* @__PURE__ */ c("span", { className: "switch-thumb-icon", "data-visible": a(!e), children: i }),
18
- t && /* @__PURE__ */ c("span", { className: "switch-thumb-icon", "data-visible": a(e), children: t })
19
- ] })
20
- }
21
- ),
22
- h && /* @__PURE__ */ c("label", { className: "switch-label", htmlFor: l, "data-disabled": s, children: h })
23
- ] });
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import b from "classnames";
3
+ import * as s from "@radix-ui/react-checkbox";
4
+ import { Icon as x } from "./bundle.es37.js";
5
+ import { faCheck as k } from "@companix/icons-solid";
6
+ import { useId as f } from "react";
7
+ import { attr as c } from "@companix/utils-browser";
8
+ const j = (d) => {
9
+ const { checked: a, className: m, required: t, disabled: o, onCheckedChange: l, size: h, label: r } = d, i = f();
10
+ return /* @__PURE__ */ n(
11
+ "div",
12
+ {
13
+ className: b("checkbox", m),
14
+ "data-size": h ?? "md",
15
+ "data-required": c(t && !a),
16
+ "data-disabled": c(o),
17
+ children: [
18
+ /* @__PURE__ */ e(
19
+ s.Root,
20
+ {
21
+ className: "checkbox-box",
22
+ checked: a,
23
+ onCheckedChange: l,
24
+ disabled: o,
25
+ id: i,
26
+ children: /* @__PURE__ */ e(s.Indicator, { className: "checkbox-icon", children: /* @__PURE__ */ e(x, { icon: k, size: "xxxs" }) })
27
+ }
28
+ ),
29
+ r && /* @__PURE__ */ e("label", { className: "checkbox-label", htmlFor: i, "data-disabled": c(o), children: r })
30
+ ]
31
+ }
32
+ );
24
33
  };
25
34
  export {
26
- u as Switch
35
+ j as Checkbox
27
36
  };
@@ -1,48 +1,27 @@
1
- import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
- import h from "classnames";
3
- import { useId as N } from "react";
4
- import * as l from "@radix-ui/react-radio-group";
5
- import { attr as s } from "@companix/utils-browser";
6
- const R = (t) => {
7
- const { options: m, value: a, onChange: r, disabled: i, required: e, size: n, className: c } = t;
8
- return /* @__PURE__ */ o(
9
- l.Root,
10
- {
11
- className: h("radio-group", c),
12
- disabled: i,
13
- "data-required": s(e && !a),
14
- "data-v": a,
15
- value: a,
16
- onValueChange: (d) => r(d),
17
- children: m.map((d, u) => /* @__PURE__ */ o(
18
- f,
19
- {
20
- ...d,
21
- size: n,
22
- disabled: i,
23
- required: e && !a
24
- },
25
- `radio-${d.value}-${u}`
26
- ))
27
- }
28
- );
29
- }, f = ({ value: t, label: m, size: a = "md", disabled: r, required: i }) => {
30
- const e = N();
31
- return /* @__PURE__ */ p(
32
- "span",
33
- {
34
- className: "radio",
35
- "data-disabled": s(r),
36
- "data-size": a,
37
- "data-required": s(i),
38
- children: [
39
- /* @__PURE__ */ o(l.Item, { className: "radio-box", value: t, disabled: r, id: e, children: /* @__PURE__ */ o(l.Indicator, { className: "radio-mark" }) }),
40
- /* @__PURE__ */ o("label", { className: "radio-label", htmlFor: e, "data-disabled": s(r), children: m })
41
- ]
42
- }
43
- );
1
+ import { jsxs as d, jsx as c } from "react/jsx-runtime";
2
+ import * as r from "@radix-ui/react-switch";
3
+ import { attr as a } from "@companix/utils-browser";
4
+ import { useId as n } from "react";
5
+ const u = (m) => {
6
+ const { checked: e, disabled: s, onCheckedChange: o, uncheckedIcon: i, checkedIcon: t, label: h } = m, l = n();
7
+ return /* @__PURE__ */ d("div", { className: "switch", "data-disabled": a(s), children: [
8
+ /* @__PURE__ */ c(
9
+ r.Root,
10
+ {
11
+ className: "switch-track",
12
+ checked: e,
13
+ onCheckedChange: o,
14
+ disabled: s,
15
+ id: l,
16
+ children: /* @__PURE__ */ d(r.Thumb, { className: "switch-thumb", children: [
17
+ i && /* @__PURE__ */ c("span", { className: "switch-thumb-icon", "data-visible": a(!e), children: i }),
18
+ t && /* @__PURE__ */ c("span", { className: "switch-thumb-icon", "data-visible": a(e), children: t })
19
+ ] })
20
+ }
21
+ ),
22
+ h && /* @__PURE__ */ c("label", { className: "switch-label", htmlFor: l, "data-disabled": s, children: h })
23
+ ] });
44
24
  };
45
25
  export {
46
- f as Radio,
47
- R as RadioGroup
26
+ u as Switch
48
27
  };
@@ -1,28 +1,48 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import r from "classnames";
3
- import { customCSS as i } from "@companix/utils-browser";
4
- import { PopupLayout as o } from "./bundle.es25.js";
5
- const l = ({
6
- direction: e,
7
- children: t,
8
- size: a,
9
- overlayClassName: m,
10
- className: s,
11
- ...p
12
- }) => /* @__PURE__ */ c(
13
- o,
14
- {
15
- ...p,
16
- overlay: { className: r("drawer-overlay", m) },
17
- content: {
18
- className: r("popup drawer", s),
19
- style: i({ "--drawer-size": a ?? "50%" }),
20
- "data-direction": e
21
- },
22
- children: t
23
- }
24
- );
25
- l.Close = o.Close;
1
+ import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
+ import h from "classnames";
3
+ import { useId as N } from "react";
4
+ import * as l from "@radix-ui/react-radio-group";
5
+ import { attr as s } from "@companix/utils-browser";
6
+ const R = (t) => {
7
+ const { options: m, value: a, onChange: r, disabled: i, required: e, size: n, className: c } = t;
8
+ return /* @__PURE__ */ o(
9
+ l.Root,
10
+ {
11
+ className: h("radio-group", c),
12
+ disabled: i,
13
+ "data-required": s(e && !a),
14
+ "data-v": a,
15
+ value: a,
16
+ onValueChange: (d) => r(d),
17
+ children: m.map((d, u) => /* @__PURE__ */ o(
18
+ f,
19
+ {
20
+ ...d,
21
+ size: n,
22
+ disabled: i,
23
+ required: e && !a
24
+ },
25
+ `radio-${d.value}-${u}`
26
+ ))
27
+ }
28
+ );
29
+ }, f = ({ value: t, label: m, size: a = "md", disabled: r, required: i }) => {
30
+ const e = N();
31
+ return /* @__PURE__ */ p(
32
+ "span",
33
+ {
34
+ className: "radio",
35
+ "data-disabled": s(r),
36
+ "data-size": a,
37
+ "data-required": s(i),
38
+ children: [
39
+ /* @__PURE__ */ o(l.Item, { className: "radio-box", value: t, disabled: r, id: e, children: /* @__PURE__ */ o(l.Indicator, { className: "radio-mark" }) }),
40
+ /* @__PURE__ */ o("label", { className: "radio-label", htmlFor: e, "data-disabled": s(r), children: m })
41
+ ]
42
+ }
43
+ );
44
+ };
26
45
  export {
27
- l as Drawer
46
+ f as Radio,
47
+ R as RadioGroup
28
48
  };