@konstructio/ui 0.1.2-alpha.46 → 0.1.2-alpha.48

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 (40) hide show
  1. package/dist/assets/icons/index.js +7 -0
  2. package/dist/components/Badge/Badge.js +36 -35
  3. package/dist/components/Counter/Counter.js +210 -0
  4. package/dist/components/Counter/Counter.variants.js +70 -0
  5. package/dist/components/ImageUpload/ImageUpload.js +9 -9
  6. package/dist/components/ImageUpload/ImageUpload.variants.js +1 -1
  7. package/dist/components/Input/Input.js +185 -118
  8. package/dist/components/Input/Input.variants.js +16 -20
  9. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +19 -19
  10. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +11 -15
  11. package/dist/components/MultiSelectDropdown/components/Item/Item.js +18 -26
  12. package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +8 -8
  13. package/dist/components/MultiSelectDropdown/components/List/List.js +12 -19
  14. package/dist/components/MultiSelectDropdown/components/List/List.variants.js +6 -4
  15. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +79 -65
  16. package/dist/components/PhoneNumberInput/components/Wrapper.js +43 -36
  17. package/dist/components/Radio/Radio.js +47 -44
  18. package/dist/components/Radio/Radio.variants.js +12 -8
  19. package/dist/components/RadioGroup/RadioGroup.js +9 -9
  20. package/dist/components/Select/components/Wrapper.js +1 -1
  21. package/dist/components/TimePicker/TimePicker.variants.js +11 -6
  22. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +30 -20
  23. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +50 -35
  24. package/dist/components/Typography/Typography.js +11 -13
  25. package/dist/components/Typography/Typography.variants.js +54 -46
  26. package/dist/components/VirtualizedTable/VirtualizedTable.js +14 -14
  27. package/dist/components/VirtualizedTable/components/Actions/Actions.js +20 -16
  28. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +60 -60
  29. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +8 -8
  30. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +32 -21
  31. package/dist/components/VirtualizedTable/components/Header/Header.js +15 -15
  32. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +8 -8
  33. package/dist/components/index.js +96 -95
  34. package/dist/index.d.ts +38 -30
  35. package/dist/index.js +110 -109
  36. package/dist/package.json +4 -4
  37. package/dist/styles.css +1 -1
  38. package/package.json +4 -4
  39. package/dist/components/NumberInput/NumberInput.js +0 -179
  40. package/dist/components/NumberInput/NumberInput.variants.js +0 -50
@@ -1,36 +1,29 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { cn as m } from "../../../../utils/index.js";
3
- import { Item as i } from "../Item/Item.js";
4
- import { wrapperVariants as p } from "./List.variants.js";
5
- import { useMultiSelectDropdown as c } from "../../contexts/MultiSelectDropdown.hook.js";
3
+ import { Item as t } from "../Item/Item.js";
4
+ import { listVariants as c } from "./List.variants.js";
6
5
  import { Typography as d } from "../../../Typography/Typography.js";
6
+ import { useMultiSelectDropdown as p } from "../../contexts/MultiSelectDropdown.hook.js";
7
7
  const y = ({ theme: s }) => {
8
- const { options: o, selectedOptions: n, isLoading: r, noOptionsText: a } = c();
9
- return /* @__PURE__ */ e("ul", { role: "listbox", "data-theme": s, className: m(p()), children: r ? /* @__PURE__ */ e(
10
- i,
8
+ const { options: i, selectedOptions: n, isLoading: l, noOptionsText: r } = p();
9
+ return /* @__PURE__ */ e("ul", { role: "listbox", "data-theme": s, className: m(c()), children: l ? /* @__PURE__ */ e(
10
+ t,
11
11
  {
12
12
  option: { id: "loading", label: "Loading..." },
13
13
  className: "select-none pointer-events-none",
14
14
  isSelected: !1
15
15
  },
16
16
  "loading"
17
- ) : o.length > 0 ? o.map((t) => /* @__PURE__ */ e(
18
- i,
17
+ ) : i.length > 0 ? i.map((o) => /* @__PURE__ */ e(
18
+ t,
19
19
  {
20
- option: t,
20
+ option: o,
21
21
  isSelected: n.some(
22
- (l) => l.id === t.id
22
+ (a) => a.id === o.id
23
23
  )
24
24
  },
25
- t.id
26
- )) : /* @__PURE__ */ e("li", { className: "select-none", children: /* @__PURE__ */ e(
27
- d,
28
- {
29
- variant: "body2",
30
- className: "text-zinc-800 dark:text-slate-50 italic px-2 py-2",
31
- children: a ?? "No options"
32
- }
33
- ) }) });
25
+ o.id
26
+ )) : /* @__PURE__ */ e("li", { className: "select-none", children: /* @__PURE__ */ e(d, { variant: "body2", className: "italic px-2 py-2", children: r ?? "No options" }) }) });
34
27
  };
35
28
  export {
36
29
  y as List
@@ -1,5 +1,5 @@
1
- import { c as o } from "../../../../index-D29mdTf5.js";
2
- const a = o([
1
+ import { c as a } from "../../../../index-D29mdTf5.js";
2
+ const o = a([
3
3
  "absolute",
4
4
  "bg-white",
5
5
  "border",
@@ -16,8 +16,10 @@ const a = o([
16
16
  "animate-in",
17
17
  "fade-in-50",
18
18
  "overflow-hidden",
19
- "border-gray-200"
19
+ "border-gray-200",
20
+ "dark:border-metal-700",
21
+ "dark:bg-metal-800"
20
22
  ]);
21
23
  export {
22
- a as wrapperVariants
24
+ o as listVariants
23
25
  };
@@ -1,82 +1,96 @@
1
1
  import "../Item/Item.js";
2
- import { List as N } from "../List/List.js";
3
- import { jsxs as m, jsx as e } from "react/jsx-runtime";
4
- import * as c from "react";
5
- import { forwardRef as S, useId as b, useImperativeHandle as C } from "react";
6
- import { S as O } from "../../../../loader-juvMSJ9L.js";
7
- import { cn as t } from "../../../../utils/index.js";
8
- import { useMultiSelectDropdown as k } from "../../hooks/useMultiSelectDropdown.js";
9
- import { labelVariants as D, multiSelectDropdownVariants as M, wrapperVariants as R } from "../../MultiSelectDropdown.variants.js";
10
- import { C as y } from "../../../../chevron-up-DEfvgPCw.js";
11
- import { useMultiSelectDropdown as I } from "../../contexts/MultiSelectDropdown.hook.js";
12
- import { Tag as V } from "../../../Tag/Tag.js";
13
- const j = (r) => /* @__PURE__ */ c.createElement("svg", { width: 9, height: 9, viewBox: "0 0 9 9", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...r }, /* @__PURE__ */ c.createElement("path", { d: "M8.16667 0.8225L7.34417 0L4.08333 3.26083L0.8225 0L0 0.8225L3.26083 4.08333L0 7.34417L0.8225 8.16667L4.08333 4.90583L7.34417 8.16667L8.16667 7.34417L4.90583 4.08333L8.16667 0.8225Z", fill: "#364153" })), E = S(
14
- ({ label: r, labelClassName: p, name: l, placeholder: d = "", theme: h, wrapperClassName: f }, u) => {
15
- const o = b(), {
16
- selectedOptions: n,
17
- isOpen: s,
18
- onOpen: w,
19
- onRemoveOption: L,
20
- inputRef: i,
21
- isLoading: g
22
- } = I(), { wrapperRef: x, handleOpen: v } = k();
23
- return C(u, () => i.current, [i]), /* @__PURE__ */ m(
2
+ import { List as S } from "../List/List.js";
3
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
4
+ import { forwardRef as k, useId as O, useImperativeHandle as C } from "react";
5
+ import { S as D } from "../../../../loader-juvMSJ9L.js";
6
+ import { Badge as L } from "../../../Badge/Badge.js";
7
+ import { Typography as p } from "../../../Typography/Typography.js";
8
+ import { cn as a } from "../../../../utils/index.js";
9
+ import { useMultiSelectDropdown as M } from "../../hooks/useMultiSelectDropdown.js";
10
+ import { labelVariants as R, multiSelectDropdownVariants as I, wrapperVariants as V } from "../../MultiSelectDropdown.variants.js";
11
+ import { X as j } from "../../../../x-BXShoIAM.js";
12
+ import { C as W } from "../../../../chevron-up-DEfvgPCw.js";
13
+ import { useMultiSelectDropdown as $ } from "../../contexts/MultiSelectDropdown.hook.js";
14
+ const B = k(
15
+ ({
16
+ isRequired: c,
17
+ label: n,
18
+ labelClassName: d,
19
+ name: s,
20
+ placeholder: f = "",
21
+ theme: u,
22
+ wrapperClassName: h
23
+ }, x) => {
24
+ const N = O(), i = s ? `${N}-name` : "id", {
25
+ inputRef: t,
26
+ isLoading: w,
27
+ isOpen: o,
28
+ selectedOptions: m,
29
+ onOpen: g,
30
+ onRemoveOption: v
31
+ } = $(), { wrapperRef: b, handleOpen: y } = M();
32
+ return C(x, () => t.current, [t]), /* @__PURE__ */ l(
24
33
  "div",
25
34
  {
26
- ref: x,
27
- className: t(
28
- R({
29
- className: f
35
+ ref: b,
36
+ className: a(
37
+ V({
38
+ className: h
30
39
  })
31
40
  ),
32
- "data-theme": h,
41
+ "data-theme": u,
33
42
  children: [
34
- r ? /* @__PURE__ */ e(
35
- "label",
43
+ n ? /* @__PURE__ */ l(
44
+ p,
36
45
  {
37
- htmlFor: l ?? o,
38
- className: t(
39
- D({
40
- className: p
46
+ component: "label",
47
+ variant: "labelLarge",
48
+ htmlFor: i,
49
+ className: a(
50
+ R({
51
+ className: d
41
52
  })
42
53
  ),
43
- onClick: () => w(!0),
44
- children: r
54
+ onClick: () => g(!0),
55
+ children: [
56
+ n,
57
+ " ",
58
+ c && /* @__PURE__ */ e(
59
+ p,
60
+ {
61
+ component: "span",
62
+ className: "text-red-500 dark:text-red-500 text-sm font-normal",
63
+ children: "*"
64
+ }
65
+ )
66
+ ]
45
67
  }
46
68
  ) : null,
47
- /* @__PURE__ */ m(
69
+ /* @__PURE__ */ l(
48
70
  "div",
49
71
  {
50
- id: l ?? o,
51
- className: t(M()),
72
+ id: i,
73
+ className: a(I()),
52
74
  role: "combobox",
53
- onClick: v,
54
- "aria-expanded": s,
75
+ onClick: y,
76
+ "aria-expanded": o,
55
77
  children: [
56
- n.length === 0 ? /* @__PURE__ */ e("span", { className: "text-base text-inherit select-none", children: d }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: n.map((a) => /* @__PURE__ */ e(
57
- V,
78
+ m.length === 0 ? /* @__PURE__ */ e("span", { className: "text-base text-inherit select-none", children: f }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: m.map((r) => /* @__PURE__ */ e(
79
+ L,
58
80
  {
59
- id: a.id,
60
- label: a.value || a.tagLabel || "",
61
- color: a.tagColor || "gray-800",
62
- className: "select-none gap-2",
63
- rightIcon: /* @__PURE__ */ e(
64
- j,
65
- {
66
- className: "w-2 h-2",
67
- onClick: () => L(a)
68
- }
69
- ),
70
- "data-value": a.label
81
+ "data-value": r.label,
82
+ label: r.value ?? r.label ?? "",
83
+ className: "select-none",
84
+ rightIcon: /* @__PURE__ */ e(j, { onClick: () => v(r) })
71
85
  },
72
- a.id
86
+ r.id
73
87
  )) }),
74
- g ? /* @__PURE__ */ e(O, { className: "w-4 h-4 text-slate-400 animate-spin shrink-0" }) : /* @__PURE__ */ e(
75
- y,
88
+ w ? /* @__PURE__ */ e(D, { className: "w-4 h-4 animate-spin shrink-0 text-gray-400" }) : /* @__PURE__ */ e(
89
+ W,
76
90
  {
77
- className: t(
78
- "w-4 h-4 text-inherit transition-all duration-50 shrink-0",
79
- s ? "rotate-0" : "rotate-180"
91
+ className: a(
92
+ "w-4 h-4 transition-all duration-50 shrink-0 text-gray-400",
93
+ o ? "rotate-0" : "rotate-180"
80
94
  )
81
95
  }
82
96
  )
@@ -86,20 +100,20 @@ const j = (r) => /* @__PURE__ */ c.createElement("svg", { width: 9, height: 9, v
86
100
  /* @__PURE__ */ e(
87
101
  "input",
88
102
  {
89
- ref: i,
103
+ ref: t,
90
104
  type: "text",
91
- name: l,
105
+ name: s,
92
106
  className: "hidden",
93
107
  readOnly: !0
94
108
  }
95
109
  ),
96
- s ? /* @__PURE__ */ e(N, {}) : null
110
+ o ? /* @__PURE__ */ e(S, {}) : null
97
111
  ]
98
112
  }
99
113
  );
100
114
  }
101
115
  );
102
- E.displayName = "MultiSelectDropdownWrapper";
116
+ B.displayName = "MultiSelectDropdownWrapper";
103
117
  export {
104
- E as Wrapper
118
+ B as Wrapper
105
119
  };
@@ -1,8 +1,8 @@
1
1
  import "./FlagSelectorList/FlagSelectorList.js";
2
2
  import { jsxs as Z, jsx as V } from "react/jsx-runtime";
3
3
  import { i as Ae } from "../../../index-BmVmDQGH.js";
4
- import { useRef as ee, useMemo as Ne, forwardRef as Be, useId as Re, useImperativeHandle as Ge, useCallback as Le, useEffect as ce } from "react";
5
- import { Typography as se } from "../../Typography/Typography.js";
4
+ import { useRef as te, useMemo as Ne, forwardRef as Be, useId as Re, useImperativeHandle as Ge, useCallback as Le, useEffect as se } from "react";
5
+ import { Typography as X } from "../../Typography/Typography.js";
6
6
  import { cn as pe } from "../../../utils/index.js";
7
7
  import { labelVariants as Ve, phoneNumberInputVariants as xe } from "../PhoneNumberInput.variants.js";
8
8
  import { usePhoneNumberContext as Ke } from "../contexts/phone-number.hook.js";
@@ -90,7 +90,7 @@ function Y(e) {
90
90
  }
91
91
  function _e(e, t) {
92
92
  if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
93
- e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && te(e, t);
93
+ e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && ne(e, t);
94
94
  }
95
95
  function we() {
96
96
  try {
@@ -140,10 +140,10 @@ function We(e, t) {
140
140
  }
141
141
  return o;
142
142
  }
143
- function te(e, t) {
144
- return te = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
143
+ function ne(e, t) {
144
+ return ne = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
145
145
  return n.__proto__ = r, n;
146
- }, te(e, t);
146
+ }, ne(e, t);
147
147
  }
148
148
  function U(e, t) {
149
149
  var n, r = t.replacementChars, o = t.replacement, a = t.separate, l = r, u = "", i = Oe(e);
@@ -188,7 +188,7 @@ function Pe(e, t) {
188
188
  function K(e) {
189
189
  return e.length > 0 ? Se({}, e, /./) : {};
190
190
  }
191
- function ne(e, t) {
191
+ function re(e, t) {
192
192
  for (var n = t.start, r = n === void 0 ? 0 : n, o = t.end, a = t.mask, l = t.replacement, u = t.separate, i = e.slice(r, o), c = a.slice(r, o), p = "", f = 0; f < c.length; f++) {
193
193
  var b = Object.prototype.hasOwnProperty.call(l, c[f]);
194
194
  b && i[f] !== void 0 && i[f] !== c[f] ? p += i[f] : b && u && (p += c[f]);
@@ -200,7 +200,7 @@ function Me(e, t) {
200
200
  return ke(U(e, { replacementChars: n.replace(a, ""), replacement: o, separate: !1 }), { mask: n, replacement: o, separate: !1, showMask: !1 });
201
201
  }
202
202
  function Ze(e, t) {
203
- var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a = ne(e, { mask: n, replacement: o, separate: !1 }), l = RegExp("[^".concat(Object.keys(o).join(""), "]"), "g");
203
+ var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a = re(e, { mask: n, replacement: o, separate: !1 }), l = RegExp("[^".concat(Object.keys(o).join(""), "]"), "g");
204
204
  return U(a, { replacementChars: n.replace(l, ""), replacement: o, separate: !1 });
205
205
  }
206
206
  function Je(e, t) {
@@ -231,7 +231,7 @@ function Xe(e, t, n) {
231
231
  if (a === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
232
232
  return a;
233
233
  })(r);
234
- })(e, ae() ? Reflect.construct(t, n || [], z(e).constructor) : t.apply(e, n));
234
+ })(e, oe() ? Reflect.construct(t, n || [], z(e).constructor) : t.apply(e, n));
235
235
  }
236
236
  function Ee(e, t) {
237
237
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
@@ -263,13 +263,13 @@ function tt(e, t) {
263
263
  if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
264
264
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && H(e, t);
265
265
  }
266
- function ae() {
266
+ function oe() {
267
267
  try {
268
268
  var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {
269
269
  })));
270
270
  } catch {
271
271
  }
272
- return (ae = function() {
272
+ return (oe = function() {
273
273
  return !!e;
274
274
  })();
275
275
  }
@@ -316,9 +316,9 @@ function H(e, t) {
316
316
  return n.__proto__ = r, n;
317
317
  }, H(e, t);
318
318
  }
319
- function re(e) {
319
+ function ae(e) {
320
320
  var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
321
- return re = function(n) {
321
+ return ae = function(n) {
322
322
  if (n === null || !(function(o) {
323
323
  try {
324
324
  return Function.toString.call(o).indexOf("[native code]") !== -1;
@@ -333,7 +333,7 @@ function re(e) {
333
333
  }
334
334
  function r() {
335
335
  return (function(o, a, l) {
336
- if (ae()) return Reflect.construct.apply(null, arguments);
336
+ if (oe()) return Reflect.construct.apply(null, arguments);
337
337
  var u = [null];
338
338
  u.push.apply(u, a);
339
339
  var i = new (o.bind.apply(o, u))();
@@ -341,7 +341,7 @@ function re(e) {
341
341
  })(n, arguments, z(this).constructor);
342
342
  }
343
343
  return r.prototype = Object.create(n.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), H(r, n);
344
- }, re(e);
344
+ }, ae(e);
345
345
  }
346
346
  var $ = (function(e) {
347
347
  function t(n) {
@@ -349,7 +349,7 @@ var $ = (function(e) {
349
349
  return Ee(this, t), (r = Xe(this, t, [n])).name = "SyntheticChangeError", r;
350
350
  }
351
351
  return tt(t, e), Ce(t);
352
- })(re(Error)), ye, rt = ["options"], ge = ["text", "email", "tel", "search", "url"], je = Ce((function e(t) {
352
+ })(ae(Error)), ye, rt = ["options"], ge = ["text", "email", "tel", "search", "url"], je = Ce((function e(t) {
353
353
  var n = t.init, r = t.tracking;
354
354
  Ee(this, e);
355
355
  var o = /* @__PURE__ */ new WeakMap();
@@ -399,7 +399,7 @@ var $ = (function(e) {
399
399
  };
400
400
  }));
401
401
  ye = je, Object.defineProperty(ye.prototype, Symbol.toStringTag, { writable: !1, enumerable: !1, configurable: !0, value: "Input" });
402
- var X = function(e) {
402
+ var ee = function(e) {
403
403
  return function() {
404
404
  for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r];
405
405
  return new e("".concat(n.join(`
@@ -419,11 +419,11 @@ var Te = (function(e) {
419
419
  var a = o.initialValue, l = o.controlled, u = x(r), i = u.mask, c = u.replacement, p = u.separate, f = u.showMask;
420
420
  return a = l || a ? a : f ? i : "", process.env.NODE_ENV !== "production" && (function(b) {
421
421
  var M = b.initialValue, j = b.mask, h = b.replacement;
422
- M.length > j.length && console.error(X(Error)("The initialized value of the `value` or `defaultValue` property is longer than the value specified in the `mask` property. Check the correctness of the initialized value in the specified property.", 'Invalid value: "'.concat(M, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
422
+ M.length > j.length && console.error(ee(Error)("The initialized value of the `value` or `defaultValue` property is longer than the value specified in the `mask` property. Check the correctness of the initialized value in the specified property.", 'Invalid value: "'.concat(M, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
423
423
  var m = Object.keys(h).filter((function(d) {
424
424
  return d.length > 1;
425
425
  }));
426
- m.length > 0 && console.error(X(Error)("Object keys in the `replacement` property are longer than one character. Replacement keys must be one character long. Check the correctness of the value in the specified property.", "Invalid keys: ".concat(m.join(", "), "."), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
426
+ m.length > 0 && console.error(ee(Error)("Object keys in the `replacement` property are longer than one character. Replacement keys must be one character long. Check the correctness of the value in the specified property.", "Invalid keys: ".concat(m.join(", "), "."), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
427
427
  for (var s = j.slice(0, M.length), O = -1, S = 0; S < s.length; S++) {
428
428
  var w = Object.prototype.hasOwnProperty.call(h, s[S]);
429
429
  if (!(s[S] === M[S] || w && h[s[S]].test(M[S]))) {
@@ -431,7 +431,7 @@ var Te = (function(e) {
431
431
  break;
432
432
  }
433
433
  }
434
- O !== -1 && console.error(X(Error)("An invalid character was found in the initialized property value `value` or `defaultValue` (index: ".concat(O, "). Check the correctness of the initialized value in the specified property."), 'Invalid value: "'.concat(M, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
434
+ O !== -1 && console.error(ee(Error)("An invalid character was found in the initialized property value `value` or `defaultValue` (index: ".concat(O, "). Check the correctness of the initialized value in the specified property."), 'Invalid value: "'.concat(M, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
435
435
  })({ initialValue: a, mask: i, replacement: c }), { value: a, options: { mask: i, replacement: c, separate: p } };
436
436
  }, tracking: function(o) {
437
437
  var a = o.inputType, l = o.previousValue, u = o.previousOptions, i = o.addedValue, c = o.changeStart, p = o.changeEnd, f = x(r), b = f.track, M = f.modify, j = We(f, at), h = j.mask, m = j.replacement, s = j.showMask, O = j.separate, S = J(J({}, a === "insert" ? { inputType: a, data: i } : { inputType: a, data: null }), {}, { value: l, selectionStart: c, selectionEnd: p }), w = b?.(S);
@@ -439,7 +439,7 @@ var Te = (function(e) {
439
439
  w === null ? i = "" : w !== !0 && w !== void 0 && (i = w);
440
440
  var d = M?.(S);
441
441
  d?.mask !== void 0 && (h = d.mask), d?.replacement !== void 0 && (m = typeof d?.replacement == "string" ? K(d?.replacement) : d.replacement), d?.showMask !== void 0 && (s = d.showMask), d?.separate !== void 0 && (O = d.separate);
442
- var y = ne(l, J({ end: c }, u)), v = ne(l, J({ start: p }, u)), k = RegExp("[^".concat(Object.keys(m).join(""), "]"), "g"), P = h.replace(k, "");
442
+ var y = re(l, J({ end: c }, u)), v = re(l, J({ start: p }, u)), k = RegExp("[^".concat(Object.keys(m).join(""), "]"), "g"), P = h.replace(k, "");
443
443
  if (y && (y = U(y, { replacementChars: P, replacement: m, separate: O }), P = P.slice(y.length)), i && (i = U(i, { replacementChars: P, replacement: m, separate: !1 }), P = P.slice(i.length)), a === "insert" && i === "") throw new $("The character does not match the key value of the `replacement` object.");
444
444
  if (O) {
445
445
  var g = h.slice(c, p).replace(k, ""), T = g.length - i.length;
@@ -447,12 +447,12 @@ var Te = (function(e) {
447
447
  }
448
448
  v && (v = U(v, { replacementChars: P, replacement: m, separate: O }));
449
449
  var C = ke(y + i + v, { mask: h, replacement: m, separate: O, showMask: s }), E = (function(I) {
450
- var N, B, D, F = I.inputType, R = I.value, _ = I.addedValue, A = I.beforeChangeValue, W = I.mask, oe = I.replacement, Ie = I.separate, Q = Pe(R, { mask: W, replacement: oe }).filter((function(q) {
451
- var ue = q.type;
452
- return ue === "input" || Ie && ue === "replacement";
453
- })), ie = (N = Q[A.length + _.length - 1]) === null || N === void 0 ? void 0 : N.index, G = (B = Q[A.length - 1]) === null || B === void 0 ? void 0 : B.index, L = (D = Q[A.length + _.length]) === null || D === void 0 ? void 0 : D.index;
450
+ var N, B, D, F = I.inputType, R = I.value, _ = I.addedValue, A = I.beforeChangeValue, W = I.mask, ie = I.replacement, Ie = I.separate, Q = Pe(R, { mask: W, replacement: ie }).filter((function(q) {
451
+ var ce = q.type;
452
+ return ce === "input" || Ie && ce === "replacement";
453
+ })), le = (N = Q[A.length + _.length - 1]) === null || N === void 0 ? void 0 : N.index, G = (B = Q[A.length - 1]) === null || B === void 0 ? void 0 : B.index, L = (D = Q[A.length + _.length]) === null || D === void 0 ? void 0 : D.index;
454
454
  if (F === "insert") {
455
- if (ie !== void 0) return ie + 1;
455
+ if (le !== void 0) return le + 1;
456
456
  if (L !== void 0) return L;
457
457
  if (G !== void 0) return G + 1;
458
458
  }
@@ -464,10 +464,10 @@ var Te = (function(e) {
464
464
  if (G !== void 0) return G + 1;
465
465
  if (L !== void 0) return L;
466
466
  }
467
- var le = R.split("").findIndex((function(q) {
468
- return Object.prototype.hasOwnProperty.call(oe, q);
467
+ var ue = R.split("").findIndex((function(q) {
468
+ return Object.prototype.hasOwnProperty.call(ie, q);
469
469
  }));
470
- return le !== -1 ? le : R.length;
470
+ return ue !== -1 ? ue : R.length;
471
471
  })({ inputType: a, value: C, addedValue: i, beforeChangeValue: y, mask: h, replacement: m, separate: O });
472
472
  return { value: C, selectionStart: E, selectionEnd: E, options: { mask: h, replacement: m, separate: O } };
473
473
  } }])).format = function(o) {
@@ -484,7 +484,7 @@ var Te = (function(e) {
484
484
  })();
485
485
  be = Te, Object.defineProperty(be.prototype, Symbol.toStringTag, { writable: !1, enumerable: !1, configurable: !0, value: "Mask" });
486
486
  function ot() {
487
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.mask, n = e.replacement, r = e.showMask, o = e.separate, a = e.track, l = e.modify, u = ee(null), i = ee({ mask: t, replacement: n, showMask: r, separate: o, track: a, modify: l });
487
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.mask, n = e.replacement, r = e.showMask, o = e.separate, a = e.track, l = e.modify, u = te(null), i = te({ mask: t, replacement: n, showMask: r, separate: o, track: a, modify: l });
488
488
  return i.current.mask = t, i.current.replacement = n, i.current.showMask = r, i.current.separate = o, i.current.track = a, i.current.modify = l, Ne((function() {
489
489
  return qe(u, new Te(i.current));
490
490
  }), []);
@@ -512,7 +512,7 @@ const Ot = Be(
512
512
  showPlaceHolder: M,
513
513
  ...j
514
514
  }, h) => {
515
- const m = u ?? Re(), s = ee(null), {
515
+ const m = u ?? Re(), s = te(null), {
516
516
  isOpenSelector: O,
517
517
  value: S,
518
518
  selectedCountry: w,
@@ -529,7 +529,7 @@ const Ot = Be(
529
529
  },
530
530
  [w.prefix, d]
531
531
  );
532
- return ce(() => {
532
+ return se(() => {
533
533
  const g = new AbortController(), T = (E) => {
534
534
  E.key === "Escape" && y(!1);
535
535
  }, C = (E) => {
@@ -550,7 +550,7 @@ const Ot = Be(
550
550
  ), () => {
551
551
  g.abort();
552
552
  };
553
- }, [y, s]), ce(() => {
553
+ }, [y, s]), se(() => {
554
554
  k.current && (k.current.value = w.prefix + " ");
555
555
  }, [w.code]), /* @__PURE__ */ Z("div", { className: "w-full flex flex-col gap-2", children: [
556
556
  a ? /* @__PURE__ */ Z(
@@ -561,7 +561,14 @@ const Ot = Be(
561
561
  onClick: () => !e && k.current?.focus(),
562
562
  children: [
563
563
  a,
564
- o && /* @__PURE__ */ V("span", { className: "text-red-600 ml-1", children: "*" })
564
+ o && /* @__PURE__ */ V(
565
+ X,
566
+ {
567
+ component: "span",
568
+ className: "text-red-600 dark:text-red-500 ml-1",
569
+ children: "*"
570
+ }
571
+ )
565
572
  ]
566
573
  }
567
574
  ) : null,
@@ -618,7 +625,7 @@ const Ot = Be(
618
625
  }
619
626
  ),
620
627
  t ? /* @__PURE__ */ V(
621
- se,
628
+ X,
622
629
  {
623
630
  component: "span",
624
631
  className: "text-xs text-red-700 dark:text-red-500",
@@ -626,7 +633,7 @@ const Ot = Be(
626
633
  }
627
634
  ) : null,
628
635
  !t && n ? /* @__PURE__ */ V(
629
- se,
636
+ X,
630
637
  {
631
638
  component: "span",
632
639
  className: pe(
@@ -1,53 +1,54 @@
1
- import { jsxs as n, jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as g, useId as j, useCallback as w } from "react";
1
+ import { jsxs as c, jsx as s } from "react/jsx-runtime";
2
+ import { forwardRef as V, useId as j, useCallback as w } from "react";
3
+ import { Typography as d } from "../Typography/Typography.js";
3
4
  import { cn as a } from "../../utils/index.js";
4
- import { radioVariants as y, labelRadioVariants as t, wrapperRadioVariants as F } from "./Radio.variants.js";
5
- const $ = g(
5
+ import { radioVariants as F, labelRadioVariants as p, wrapperRadioVariants as $ } from "./Radio.variants.js";
6
+ const C = V(
6
7
  ({
7
8
  checked: r = !1,
8
- className: p,
9
- defaultChecked: o,
9
+ className: f,
10
+ defaultChecked: l,
10
11
  disabled: e,
11
- label: f,
12
- labelTextClassName: N,
13
- description: l,
14
- descriptionClassName: h,
15
- name: i,
16
- theme: x,
17
- value: m,
18
- wrapperClassName: R,
19
- onChange: c
20
- }, u) => {
21
- const d = `${j()}-${i}`, b = w(
22
- (V) => {
23
- c?.(V);
12
+ label: N,
13
+ labelTextClassName: h,
14
+ description: o,
15
+ descriptionClassName: x,
16
+ name: m,
17
+ theme: R,
18
+ value: n,
19
+ wrapperClassName: u,
20
+ onChange: i
21
+ }, y) => {
22
+ const t = `${j()}-${m}`, b = w(
23
+ (g) => {
24
+ i?.(g);
24
25
  },
25
- [c]
26
+ [i]
26
27
  );
27
- return /* @__PURE__ */ n(
28
+ return /* @__PURE__ */ c(
28
29
  "label",
29
30
  {
30
- htmlFor: d,
31
+ htmlFor: t,
31
32
  className: a(
32
- F({
33
- className: R,
33
+ $({
34
+ className: u,
34
35
  disabled: e || !1
35
36
  })
36
37
  ),
37
- "data-theme": x,
38
+ "data-theme": R,
38
39
  children: [
39
40
  /* @__PURE__ */ s(
40
41
  "input",
41
42
  {
42
- ref: u,
43
- id: d,
43
+ ref: y,
44
+ id: t,
44
45
  type: "radio",
45
- name: i,
46
- value: m,
46
+ name: m,
47
+ value: n,
47
48
  checked: r,
48
- defaultChecked: o,
49
+ defaultChecked: l,
49
50
  className: "hidden peer",
50
- onChange: () => b(m),
51
+ onChange: () => b(n),
51
52
  disabled: e
52
53
  }
53
54
  ),
@@ -55,31 +56,33 @@ const $ = g(
55
56
  "span",
56
57
  {
57
58
  className: a(
58
- y({
59
- className: p,
59
+ F({
60
+ className: f,
60
61
  disabled: e || !1,
61
- checked: r || o || !1
62
+ checked: r || l || !1
62
63
  })
63
64
  )
64
65
  }
65
66
  ),
66
- /* @__PURE__ */ n("div", { className: a(l && "flex flex-col gap-1"), children: [
67
+ /* @__PURE__ */ c("div", { className: a(o && "flex flex-col gap-1"), children: [
67
68
  /* @__PURE__ */ s(
68
- "span",
69
+ d,
69
70
  {
71
+ component: "span",
70
72
  className: a(
71
- t({ className: N })
73
+ p({ className: h })
72
74
  ),
73
- children: f
75
+ children: N
74
76
  }
75
77
  ),
76
- l && /* @__PURE__ */ s(
77
- "span",
78
+ o && /* @__PURE__ */ s(
79
+ d,
78
80
  {
81
+ component: "span",
79
82
  className: a(
80
- t({ className: h })
83
+ p({ className: x })
81
84
  ),
82
- children: l
85
+ children: o
83
86
  }
84
87
  )
85
88
  ] })
@@ -88,7 +91,7 @@ const $ = g(
88
91
  );
89
92
  }
90
93
  );
91
- $.displayName = "KonstructRadio";
94
+ C.displayName = "KonstructRadio";
92
95
  export {
93
- $ as Radio
96
+ C as Radio
94
97
  };