@cfx-dev/ui-components 4.5.0 → 4.5.3

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 (46) hide show
  1. package/dist/assets/all_css.css +2 -0
  2. package/dist/assets/css/Input.css +1 -1
  3. package/dist/assets/css/StyledInput.css +1 -0
  4. package/dist/assets/css/StyledTextarea.css +1 -0
  5. package/dist/assets/css/Textarea.css +1 -1
  6. package/dist/assets/general/global.css +1 -1
  7. package/dist/components/Checkbox/Checkbox.d.ts +1 -0
  8. package/dist/components/Checkbox/Checkbox.js +139 -129
  9. package/dist/components/DropdownSelect/DropdownSelect.d.ts +2 -1
  10. package/dist/components/DropdownSelect/DropdownSelect.js +53 -44
  11. package/dist/components/DropdownSelect/DropdownSelectShowcase.js +13 -12
  12. package/dist/components/Input/Input.d.ts +3 -2
  13. package/dist/components/Input/Input.js +94 -89
  14. package/dist/components/Input/Input.types.d.ts +2 -0
  15. package/dist/components/Input/Input.types.js +1 -0
  16. package/dist/components/Input/RichInput.d.ts +1 -1
  17. package/dist/components/Input/index.d.ts +2 -1
  18. package/dist/components/InputDropzone/InputDropzone.d.ts +1 -0
  19. package/dist/components/InputDropzone/InputDropzone.js +135 -134
  20. package/dist/components/InputDropzone/InputDropzoneShowcase.js +6 -5
  21. package/dist/components/Radio/Radio.d.ts +1 -0
  22. package/dist/components/Radio/Radio.js +21 -19
  23. package/dist/components/StyledInput/StyledInput.d.ts +12 -0
  24. package/dist/components/StyledInput/StyledInput.js +46 -0
  25. package/dist/components/StyledInput/index.d.ts +2 -0
  26. package/dist/components/StyledInput/index.js +4 -0
  27. package/dist/components/StyledTextarea/StyledTextarea.d.ts +10 -0
  28. package/dist/components/StyledTextarea/StyledTextarea.js +32 -0
  29. package/dist/components/StyledTextarea/index.d.ts +2 -0
  30. package/dist/components/StyledTextarea/index.js +4 -0
  31. package/dist/components/Switch/Switch.js +61 -49
  32. package/dist/components/Tabular/Tabular.d.ts +12 -0
  33. package/dist/components/Tabular/Tabular.js +34 -33
  34. package/dist/components/Tabular/index.d.ts +1 -1
  35. package/dist/components/Textarea/Textarea.d.ts +7 -3
  36. package/dist/components/Textarea/Textarea.js +46 -43
  37. package/dist/components/ToggleGroup/ToggleGroup.d.ts +1 -0
  38. package/dist/components/ToggleGroup/ToggleGroup.js +57 -47
  39. package/dist/main.d.ts +5 -1
  40. package/dist/main.js +126 -122
  41. package/dist/rsc.d.ts +4 -0
  42. package/dist/rsc.js +12 -8
  43. package/dist/styles-scss/_ui.scss +4 -2
  44. package/dist/styles-scss/global.scss +1 -1
  45. package/dist/styles-scss/tokens.scss +19 -20
  46. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- import { jsxs as wa, jsx as U } from "react/jsx-runtime";
2
- import oa, { useMemo as L, useRef as ea, useReducer as hi, useEffect as ka, useCallback as y, forwardRef as yi, useImperativeHandle as wi, Fragment as ki } from "react";
1
+ import { jsxs as wa, jsx as B } from "react/jsx-runtime";
2
+ import oa, { useMemo as T, useRef as ea, useReducer as hi, useEffect as ka, useCallback as y, forwardRef as yi, useImperativeHandle as wi, Fragment as ki } from "react";
3
3
  import { P as s } from "../../index-DQMInta3.js";
4
- import { a as R } from "../../tslib.es6-CtHwNPxX.js";
4
+ import { a as I } from "../../tslib.es6-CtHwNPxX.js";
5
5
  import { IconBig as ji } from "../IconBig/IconBig.js";
6
6
  import { Text as Na } from "../Text/Text.js";
7
7
  import { clsx as Di } from "../../utils/clsx.js";
@@ -1209,7 +1209,7 @@ const zi = /* @__PURE__ */ new Map([
1209
1209
  ["zmm", "application/vnd.handheld-entertainment+xml"],
1210
1210
  ["zsh", "text/x-scriptzsh"]
1211
1211
  ]);
1212
- function M(a, i, t) {
1212
+ function L(a, i, t) {
1213
1213
  const n = Ai(a), { webkitRelativePath: p } = a, o = typeof i == "string" ? i : typeof p == "string" && p.length > 0 ? p : `./${a.name}`;
1214
1214
  return typeof n.path != "string" && Ba(n, "path", o), Ba(n, "relativePath", o), n;
1215
1215
  }
@@ -1242,7 +1242,7 @@ const _i = [
1242
1242
  // Windows
1243
1243
  ];
1244
1244
  function Ei(a) {
1245
- return R(this, void 0, void 0, function* () {
1245
+ return I(this, void 0, void 0, function* () {
1246
1246
  return ca(a) && Fi(a.dataTransfer) ? Ri(a.dataTransfer, a.type) : Oi(a) ? Pi(a) : Array.isArray(a) && a.every((i) => "getFile" in i && typeof i.getFile == "function") ? Ii(a) : [];
1247
1247
  });
1248
1248
  }
@@ -1256,15 +1256,15 @@ function ca(a) {
1256
1256
  return typeof a == "object" && a !== null;
1257
1257
  }
1258
1258
  function Pi(a) {
1259
- return za(a.target.files).map((i) => M(i));
1259
+ return za(a.target.files).map((i) => L(i));
1260
1260
  }
1261
1261
  function Ii(a) {
1262
- return R(this, void 0, void 0, function* () {
1263
- return (yield Promise.all(a.map((t) => t.getFile()))).map((t) => M(t));
1262
+ return I(this, void 0, void 0, function* () {
1263
+ return (yield Promise.all(a.map((t) => t.getFile()))).map((t) => L(t));
1264
1264
  });
1265
1265
  }
1266
1266
  function Ri(a, i) {
1267
- return R(this, void 0, void 0, function* () {
1267
+ return I(this, void 0, void 0, function* () {
1268
1268
  if (a.items) {
1269
1269
  const t = za(a.items).filter((p) => p.kind === "file");
1270
1270
  if (i !== "drop")
@@ -1272,7 +1272,7 @@ function Ri(a, i) {
1272
1272
  const n = yield Promise.all(t.map(qi));
1273
1273
  return Ua(ti(n));
1274
1274
  }
1275
- return Ua(za(a.files).map((t) => M(t)));
1275
+ return Ua(za(a.files).map((t) => L(t)));
1276
1276
  });
1277
1277
  }
1278
1278
  function Ua(a) {
@@ -1301,7 +1301,7 @@ function ti(a) {
1301
1301
  ], []);
1302
1302
  }
1303
1303
  function Ya(a, i) {
1304
- return R(this, void 0, void 0, function* () {
1304
+ return I(this, void 0, void 0, function* () {
1305
1305
  var t;
1306
1306
  if (globalThis.isSecureContext && typeof a.getAsFileSystemHandle == "function") {
1307
1307
  const o = yield a.getAsFileSystemHandle();
@@ -1309,17 +1309,17 @@ function Ya(a, i) {
1309
1309
  throw new Error(`${a} is not a File`);
1310
1310
  if (o !== void 0) {
1311
1311
  const l = yield o.getFile();
1312
- return l.handle = o, M(l);
1312
+ return l.handle = o, L(l);
1313
1313
  }
1314
1314
  }
1315
1315
  const n = a.getAsFile();
1316
1316
  if (!n)
1317
1317
  throw new Error(`${a} is not a File`);
1318
- return M(n, (t = i == null ? void 0 : i.fullPath) !== null && t !== void 0 ? t : void 0);
1318
+ return L(n, (t = i == null ? void 0 : i.fullPath) !== null && t !== void 0 ? t : void 0);
1319
1319
  });
1320
1320
  }
1321
1321
  function Ci(a) {
1322
- return R(this, void 0, void 0, function* () {
1322
+ return I(this, void 0, void 0, function* () {
1323
1323
  return a.isDirectory ? ni(a) : Si(a);
1324
1324
  });
1325
1325
  }
@@ -1328,7 +1328,7 @@ function ni(a) {
1328
1328
  return new Promise((t, n) => {
1329
1329
  const p = [];
1330
1330
  function o() {
1331
- i.readEntries((l) => R(this, void 0, void 0, function* () {
1331
+ i.readEntries((l) => I(this, void 0, void 0, function* () {
1332
1332
  if (l.length) {
1333
1333
  const r = Promise.all(l.map(Ci));
1334
1334
  p.push(r), o();
@@ -1347,10 +1347,10 @@ function ni(a) {
1347
1347
  });
1348
1348
  }
1349
1349
  function Si(a) {
1350
- return R(this, void 0, void 0, function* () {
1350
+ return I(this, void 0, void 0, function* () {
1351
1351
  return new Promise((i, t) => {
1352
1352
  a.file((n) => {
1353
- const p = M(n, a.fullPath);
1353
+ const p = L(n, a.fullPath);
1354
1354
  i(p);
1355
1355
  }, (n) => {
1356
1356
  t(n);
@@ -1408,7 +1408,7 @@ function Va(a) {
1408
1408
  function ei(a, i, t) {
1409
1409
  return i in a ? Object.defineProperty(a, i, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : a[i] = t, a;
1410
1410
  }
1411
- function Y(a, i) {
1411
+ function U(a, i) {
1412
1412
  return Hi(a) || Ki(a, i) || pi(a, i) || $i();
1413
1413
  }
1414
1414
  function $i() {
@@ -1476,24 +1476,24 @@ function oi(a, i) {
1476
1476
  return [t, t ? null : Gi(i)];
1477
1477
  }
1478
1478
  function ci(a, i, t) {
1479
- if (I(a.size))
1480
- if (I(i) && I(t)) {
1479
+ if (P(a.size))
1480
+ if (P(i) && P(t)) {
1481
1481
  if (a.size > t) return [!1, Qa(t)];
1482
1482
  if (a.size < i) return [!1, Xa(i)];
1483
1483
  } else {
1484
- if (I(i) && a.size < i) return [!1, Xa(i)];
1485
- if (I(t) && a.size > t) return [!1, Qa(t)];
1484
+ if (P(i) && a.size < i) return [!1, Xa(i)];
1485
+ if (P(t) && a.size > t) return [!1, Qa(t)];
1486
1486
  }
1487
1487
  return [!0, null];
1488
1488
  }
1489
- function I(a) {
1489
+ function P(a) {
1490
1490
  return a != null;
1491
1491
  }
1492
1492
  function Vi(a) {
1493
1493
  var i = a.files, t = a.accept, n = a.minSize, p = a.maxSize, o = a.multiple, l = a.maxFiles, r = a.validator;
1494
1494
  return !o && i.length > 1 || o && l >= 1 && i.length > l ? !1 : i.every(function(u) {
1495
- var k = oi(u, t), z = Y(k, 1), j = z[0], A = ci(u, n, p), _ = Y(A, 1), E = _[0], F = r ? r(u) : null;
1496
- return j && E && !F;
1495
+ var k = oi(u, t), z = U(k, 1), A = z[0], j = ci(u, n, p), _ = U(j, 1), E = _[0], F = r ? r(u) : null;
1496
+ return A && E && !F;
1497
1497
  });
1498
1498
  }
1499
1499
  function la(a) {
@@ -1532,12 +1532,12 @@ function at() {
1532
1532
  return "showOpenFilePicker" in window;
1533
1533
  }
1534
1534
  function it(a) {
1535
- if (I(a)) {
1535
+ if (P(a)) {
1536
1536
  var i = Object.entries(a).filter(function(t) {
1537
- var n = Y(t, 2), p = n[0], o = n[1], l = !0;
1537
+ var n = U(t, 2), p = n[0], o = n[1], l = !0;
1538
1538
  return li(p) || (console.warn('Skipped "'.concat(p, '" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')), l = !1), (!Array.isArray(o) || !o.every(ri)) && (console.warn('Skipped "'.concat(p, '" because an invalid file extension was provided.')), l = !1), l;
1539
1539
  }).reduce(function(t, n) {
1540
- var p = Y(n, 2), o = p[0], l = p[1];
1540
+ var p = U(n, 2), o = p[0], l = p[1];
1541
1541
  return Va(Va({}, t), {}, ei({}, o, l));
1542
1542
  }, {});
1543
1543
  return [{
@@ -1549,9 +1549,9 @@ function it(a) {
1549
1549
  return a;
1550
1550
  }
1551
1551
  function tt(a) {
1552
- if (I(a))
1552
+ if (P(a))
1553
1553
  return Object.entries(a).reduce(function(i, t) {
1554
- var n = Y(t, 2), p = n[0], o = n[1];
1554
+ var n = U(t, 2), p = n[0], o = n[1];
1555
1555
  return [].concat(Ga(i), [p], Ga(o));
1556
1556
  }, []).filter(function(i) {
1557
1557
  return li(i) || ri(i);
@@ -1873,19 +1873,19 @@ var Fa = {
1873
1873
  fileRejections: []
1874
1874
  };
1875
1875
  function mi() {
1876
- var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = d(d({}, di), a), t = i.accept, n = i.disabled, p = i.getFilesFromEvent, o = i.maxSize, l = i.minSize, r = i.multiple, u = i.maxFiles, k = i.onDragEnter, z = i.onDragLeave, j = i.onDragOver, A = i.onDrop, _ = i.onDropAccepted, E = i.onDropRejected, F = i.onFileDialogCancel, $ = i.onFileDialogOpen, G = i.useFsAccessApi, J = i.autoFocus, K = i.preventDropOnDocument, V = i.noClick, H = i.noKeyboard, b = i.noDrag, O = i.noDragEventsBubbling, sa = i.onError, N = i.validator, W = L(function() {
1876
+ var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = d(d({}, di), a), t = i.accept, n = i.disabled, p = i.getFilesFromEvent, o = i.maxSize, l = i.minSize, r = i.multiple, u = i.maxFiles, k = i.onDragEnter, z = i.onDragLeave, A = i.onDragOver, j = i.onDrop, _ = i.onDropAccepted, E = i.onDropRejected, F = i.onFileDialogCancel, M = i.onFileDialogOpen, Y = i.useFsAccessApi, G = i.autoFocus, $ = i.preventDropOnDocument, J = i.noClick, K = i.noKeyboard, V = i.noDrag, f = i.noDragEventsBubbling, sa = i.onError, H = i.validator, N = T(function() {
1877
1877
  return tt(t);
1878
- }, [t]), Pa = L(function() {
1878
+ }, [t]), Pa = T(function() {
1879
1879
  return it(t);
1880
- }, [t]), da = L(function() {
1881
- return typeof $ == "function" ? $ : ii;
1882
- }, [$]), Q = L(function() {
1880
+ }, [t]), da = T(function() {
1881
+ return typeof M == "function" ? M : ii;
1882
+ }, [M]), Q = T(function() {
1883
1883
  return typeof F == "function" ? F : ii;
1884
- }, [F]), f = ea(null), h = ea(null), vi = hi(gt, Fa), Ia = Da(vi, 2), ma = Ia[0], x = Ia[1], ui = ma.isFocused, Ra = ma.isFileDialogActive, X = ea(typeof window < "u" && window.isSecureContext && G && at()), qa = function() {
1884
+ }, [F]), x = ea(null), h = ea(null), vi = hi(gt, Fa), Ia = Da(vi, 2), ma = Ia[0], g = Ia[1], ui = ma.isFocused, Ra = ma.isFileDialogActive, X = ea(typeof window < "u" && window.isSecureContext && Y && at()), qa = function() {
1885
1885
  !X.current && Ra && setTimeout(function() {
1886
1886
  if (h.current) {
1887
1887
  var c = h.current.files;
1888
- c.length || (x({
1888
+ c.length || (g({
1889
1889
  type: "closeDialog"
1890
1890
  }), Q());
1891
1891
  }
@@ -1896,42 +1896,42 @@ function mi() {
1896
1896
  window.removeEventListener("focus", qa, !1);
1897
1897
  };
1898
1898
  }, [h, Ra, Q, X]);
1899
- var q = ea([]), Ca = function(c) {
1900
- f.current && f.current.contains(c.target) || (c.preventDefault(), q.current = []);
1899
+ var R = ea([]), Ca = function(c) {
1900
+ x.current && x.current.contains(c.target) || (c.preventDefault(), R.current = []);
1901
1901
  };
1902
1902
  ka(function() {
1903
- return K && (document.addEventListener("dragover", Za, !1), document.addEventListener("drop", Ca, !1)), function() {
1904
- K && (document.removeEventListener("dragover", Za), document.removeEventListener("drop", Ca));
1903
+ return $ && (document.addEventListener("dragover", Za, !1), document.addEventListener("drop", Ca, !1)), function() {
1904
+ $ && (document.removeEventListener("dragover", Za), document.removeEventListener("drop", Ca));
1905
1905
  };
1906
- }, [f, K]), ka(function() {
1907
- return !n && J && f.current && f.current.focus(), function() {
1906
+ }, [x, $]), ka(function() {
1907
+ return !n && G && x.current && x.current.focus(), function() {
1908
1908
  };
1909
- }, [f, J, n]);
1910
- var P = y(function(e) {
1909
+ }, [x, G, n]);
1910
+ var O = y(function(e) {
1911
1911
  sa ? sa(e) : console.error(e);
1912
1912
  }, [sa]), Sa = y(function(e) {
1913
- e.preventDefault(), e.persist(), ta(e), q.current = [].concat(rt(q.current), [e.target]), pa(e) && Promise.resolve(p(e)).then(function(c) {
1914
- if (!(la(e) && !O)) {
1913
+ e.preventDefault(), e.persist(), ta(e), R.current = [].concat(rt(R.current), [e.target]), pa(e) && Promise.resolve(p(e)).then(function(c) {
1914
+ if (!(la(e) && !f)) {
1915
1915
  var m = c.length, v = m > 0 && Vi({
1916
1916
  files: c,
1917
- accept: W,
1917
+ accept: N,
1918
1918
  minSize: l,
1919
1919
  maxSize: o,
1920
1920
  multiple: r,
1921
1921
  maxFiles: u,
1922
- validator: N
1923
- }), g = m > 0 && !v;
1924
- x({
1922
+ validator: H
1923
+ }), b = m > 0 && !v;
1924
+ g({
1925
1925
  isDragAccept: v,
1926
- isDragReject: g,
1926
+ isDragReject: b,
1927
1927
  isDragActive: !0,
1928
1928
  type: "setDraggedFiles"
1929
1929
  }), k && k(e);
1930
1930
  }
1931
1931
  }).catch(function(c) {
1932
- return P(c);
1932
+ return O(c);
1933
1933
  });
1934
- }, [p, k, P, O, W, l, o, r, u, N]), Ta = y(function(e) {
1934
+ }, [p, k, O, f, N, l, o, r, u, H]), Ta = y(function(e) {
1935
1935
  e.preventDefault(), e.persist(), ta(e);
1936
1936
  var c = pa(e);
1937
1937
  if (c && e.dataTransfer)
@@ -1939,55 +1939,55 @@ function mi() {
1939
1939
  e.dataTransfer.dropEffect = "copy";
1940
1940
  } catch {
1941
1941
  }
1942
- return c && j && j(e), !1;
1943
- }, [j, O]), La = y(function(e) {
1942
+ return c && A && A(e), !1;
1943
+ }, [A, f]), La = y(function(e) {
1944
1944
  e.preventDefault(), e.persist(), ta(e);
1945
- var c = q.current.filter(function(v) {
1946
- return f.current && f.current.contains(v);
1945
+ var c = R.current.filter(function(v) {
1946
+ return x.current && x.current.contains(v);
1947
1947
  }), m = c.indexOf(e.target);
1948
- m !== -1 && c.splice(m, 1), q.current = c, !(c.length > 0) && (x({
1948
+ m !== -1 && c.splice(m, 1), R.current = c, !(c.length > 0) && (g({
1949
1949
  type: "setDraggedFiles",
1950
1950
  isDragActive: !1,
1951
1951
  isDragAccept: !1,
1952
1952
  isDragReject: !1
1953
1953
  }), pa(e) && z && z(e));
1954
- }, [f, z, O]), Z = y(function(e, c) {
1954
+ }, [x, z, f]), Z = y(function(e, c) {
1955
1955
  var m = [], v = [];
1956
- e.forEach(function(g) {
1957
- var B = oi(g, W), T = Da(B, 2), ua = T[0], fa = T[1], xa = ci(g, l, o), na = Da(xa, 2), ga = na[0], ba = na[1], ha = N ? N(g) : null;
1956
+ e.forEach(function(b) {
1957
+ var W = oi(b, N), S = Da(W, 2), ua = S[0], fa = S[1], xa = ci(b, l, o), na = Da(xa, 2), ga = na[0], ba = na[1], ha = H ? H(b) : null;
1958
1958
  if (ua && ga && !ha)
1959
- m.push(g);
1959
+ m.push(b);
1960
1960
  else {
1961
1961
  var ya = [fa, ba];
1962
1962
  ha && (ya = ya.concat(ha)), v.push({
1963
- file: g,
1963
+ file: b,
1964
1964
  errors: ya.filter(function(bi) {
1965
1965
  return bi;
1966
1966
  })
1967
1967
  });
1968
1968
  }
1969
- }), (!r && m.length > 1 || r && u >= 1 && m.length > u) && (m.forEach(function(g) {
1969
+ }), (!r && m.length > 1 || r && u >= 1 && m.length > u) && (m.forEach(function(b) {
1970
1970
  v.push({
1971
- file: g,
1971
+ file: b,
1972
1972
  errors: [Ji]
1973
1973
  });
1974
- }), m.splice(0)), x({
1974
+ }), m.splice(0)), g({
1975
1975
  acceptedFiles: m,
1976
1976
  fileRejections: v,
1977
1977
  isDragReject: v.length > 0,
1978
1978
  type: "setFiles"
1979
- }), A && A(m, v, c), v.length > 0 && E && E(v, c), m.length > 0 && _ && _(m, c);
1980
- }, [x, r, W, l, o, u, A, _, E, N]), aa = y(function(e) {
1981
- e.preventDefault(), e.persist(), ta(e), q.current = [], pa(e) && Promise.resolve(p(e)).then(function(c) {
1982
- la(e) && !O || Z(c, e);
1979
+ }), j && j(m, v, c), v.length > 0 && E && E(v, c), m.length > 0 && _ && _(m, c);
1980
+ }, [g, r, N, l, o, u, j, _, E, H]), aa = y(function(e) {
1981
+ e.preventDefault(), e.persist(), ta(e), R.current = [], pa(e) && Promise.resolve(p(e)).then(function(c) {
1982
+ la(e) && !f || Z(c, e);
1983
1983
  }).catch(function(c) {
1984
- return P(c);
1985
- }), x({
1984
+ return O(c);
1985
+ }), g({
1986
1986
  type: "reset"
1987
1987
  });
1988
- }, [p, Z, P, O]), C = y(function() {
1988
+ }, [p, Z, O, f]), q = y(function() {
1989
1989
  if (X.current) {
1990
- x({
1990
+ g({
1991
1991
  type: "openDialog"
1992
1992
  }), da();
1993
1993
  var e = {
@@ -1997,62 +1997,62 @@ function mi() {
1997
1997
  window.showOpenFilePicker(e).then(function(c) {
1998
1998
  return p(c);
1999
1999
  }).then(function(c) {
2000
- Z(c, null), x({
2000
+ Z(c, null), g({
2001
2001
  type: "closeDialog"
2002
2002
  });
2003
2003
  }).catch(function(c) {
2004
- nt(c) ? (Q(c), x({
2004
+ nt(c) ? (Q(c), g({
2005
2005
  type: "closeDialog"
2006
- })) : et(c) ? (X.current = !1, h.current ? (h.current.value = null, h.current.click()) : P(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))) : P(c);
2006
+ })) : et(c) ? (X.current = !1, h.current ? (h.current.value = null, h.current.click()) : O(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))) : O(c);
2007
2007
  });
2008
2008
  return;
2009
2009
  }
2010
- h.current && (x({
2010
+ h.current && (g({
2011
2011
  type: "openDialog"
2012
2012
  }), da(), h.current.value = null, h.current.click());
2013
- }, [x, da, Q, G, Z, P, Pa, r]), Ma = y(function(e) {
2014
- !f.current || !f.current.isEqualNode(e.target) || (e.key === " " || e.key === "Enter" || e.keyCode === 32 || e.keyCode === 13) && (e.preventDefault(), C());
2015
- }, [f, C]), $a = y(function() {
2016
- x({
2013
+ }, [g, da, Q, Y, Z, O, Pa, r]), Ma = y(function(e) {
2014
+ !x.current || !x.current.isEqualNode(e.target) || (e.key === " " || e.key === "Enter" || e.keyCode === 32 || e.keyCode === 13) && (e.preventDefault(), q());
2015
+ }, [x, q]), $a = y(function() {
2016
+ g({
2017
2017
  type: "focus"
2018
2018
  });
2019
2019
  }, []), Ka = y(function() {
2020
- x({
2020
+ g({
2021
2021
  type: "blur"
2022
2022
  });
2023
2023
  }, []), Ha = y(function() {
2024
- V || (Zi() ? setTimeout(C, 0) : C());
2025
- }, [V, C]), S = function(c) {
2024
+ J || (Zi() ? setTimeout(q, 0) : q());
2025
+ }, [J, q]), C = function(c) {
2026
2026
  return n ? null : c;
2027
2027
  }, va = function(c) {
2028
- return H ? null : S(c);
2028
+ return K ? null : C(c);
2029
2029
  }, ia = function(c) {
2030
- return b ? null : S(c);
2030
+ return V ? null : C(c);
2031
2031
  }, ta = function(c) {
2032
- O && c.stopPropagation();
2033
- }, fi = L(function() {
2032
+ f && c.stopPropagation();
2033
+ }, fi = T(function() {
2034
2034
  return function() {
2035
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = e.refKey, m = c === void 0 ? "ref" : c, v = e.role, g = e.onKeyDown, B = e.onFocus, T = e.onBlur, ua = e.onClick, fa = e.onDragEnter, xa = e.onDragOver, na = e.onDragLeave, ga = e.onDrop, ba = ra(e, ct);
2035
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = e.refKey, m = c === void 0 ? "ref" : c, v = e.role, b = e.onKeyDown, W = e.onFocus, S = e.onBlur, ua = e.onClick, fa = e.onDragEnter, xa = e.onDragOver, na = e.onDragLeave, ga = e.onDrop, ba = ra(e, ct);
2036
2036
  return d(d(Ea({
2037
- onKeyDown: va(w(g, Ma)),
2038
- onFocus: va(w(B, $a)),
2039
- onBlur: va(w(T, Ka)),
2040
- onClick: S(w(ua, Ha)),
2037
+ onKeyDown: va(w(b, Ma)),
2038
+ onFocus: va(w(W, $a)),
2039
+ onBlur: va(w(S, Ka)),
2040
+ onClick: C(w(ua, Ha)),
2041
2041
  onDragEnter: ia(w(fa, Sa)),
2042
2042
  onDragOver: ia(w(xa, Ta)),
2043
2043
  onDragLeave: ia(w(na, La)),
2044
2044
  onDrop: ia(w(ga, aa)),
2045
2045
  role: typeof v == "string" && v !== "" ? v : "presentation"
2046
- }, m, f), !n && !H ? {
2046
+ }, m, x), !n && !K ? {
2047
2047
  tabIndex: 0
2048
2048
  } : {}), ba);
2049
2049
  };
2050
- }, [f, Ma, $a, Ka, Ha, Sa, Ta, La, aa, H, b, n]), xi = y(function(e) {
2050
+ }, [x, Ma, $a, Ka, Ha, Sa, Ta, La, aa, K, V, n]), xi = y(function(e) {
2051
2051
  e.stopPropagation();
2052
- }, []), gi = L(function() {
2052
+ }, []), gi = T(function() {
2053
2053
  return function() {
2054
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = e.refKey, m = c === void 0 ? "ref" : c, v = e.onChange, g = e.onClick, B = ra(e, lt), T = Ea({
2055
- accept: W,
2054
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, c = e.refKey, m = c === void 0 ? "ref" : c, v = e.onChange, b = e.onClick, W = ra(e, lt), S = Ea({
2055
+ accept: N,
2056
2056
  multiple: r,
2057
2057
  type: "file",
2058
2058
  style: {
@@ -2067,20 +2067,20 @@ function mi() {
2067
2067
  width: "1px",
2068
2068
  whiteSpace: "nowrap"
2069
2069
  },
2070
- onChange: S(w(v, aa)),
2071
- onClick: S(w(g, xi)),
2070
+ onChange: C(w(v, aa)),
2071
+ onClick: C(w(b, xi)),
2072
2072
  tabIndex: -1
2073
2073
  }, m, h);
2074
- return d(d({}, T), B);
2074
+ return d(d({}, S), W);
2075
2075
  };
2076
2076
  }, [h, t, r, aa, n]);
2077
2077
  return d(d({}, ma), {}, {
2078
2078
  isFocused: ui && !n,
2079
2079
  getRootProps: fi,
2080
2080
  getInputProps: gi,
2081
- rootRef: f,
2081
+ rootRef: x,
2082
2082
  inputRef: h,
2083
- open: S(C)
2083
+ open: C(q)
2084
2084
  });
2085
2085
  }
2086
2086
  function gt(a, i) {
@@ -2140,41 +2140,42 @@ function jt(a) {
2140
2140
  onRemoveRejection: u,
2141
2141
  dropzoneItemClassName: k,
2142
2142
  dropzoneClassName: z,
2143
+ name: A,
2143
2144
  ...j
2144
2145
  } = a, {
2145
- isFocused: A,
2146
- isDragActive: _,
2147
- isDragAccept: E,
2148
- isDragReject: F,
2149
- isFileDialogActive: $,
2146
+ isFocused: _,
2147
+ isDragActive: E,
2148
+ isDragAccept: F,
2149
+ isDragReject: M,
2150
+ isFileDialogActive: Y,
2150
2151
  getRootProps: G,
2151
- getInputProps: J
2152
- } = mi(j), K = oa.useCallback((b) => {
2153
- r && r(b);
2154
- }, [r]), V = oa.useCallback((b) => {
2155
- u && u(b);
2156
- }, [u]), H = Di(D.dropzone, z, {
2152
+ getInputProps: $
2153
+ } = mi(j), J = oa.useCallback((f) => {
2154
+ r && r(f);
2155
+ }, [r]), K = oa.useCallback((f) => {
2156
+ u && u(f);
2157
+ }, [u]), V = Di(D.dropzone, z, {
2157
2158
  [D.disabled]: j.disabled,
2158
- [D.focused]: A,
2159
- [D.dragActive]: _,
2160
- [D.dragAccept]: E,
2161
- [D.dragReject]: F,
2162
- [D.fileDialogActive]: $
2159
+ [D.focused]: _,
2160
+ [D.dragActive]: E,
2161
+ [D.dragAccept]: F,
2162
+ [D.dragReject]: M,
2163
+ [D.fileDialogActive]: Y
2163
2164
  });
2164
2165
  return /* @__PURE__ */ wa("section", { children: [
2165
2166
  /* @__PURE__ */ wa(
2166
2167
  "div",
2167
2168
  {
2168
- className: H,
2169
+ className: V,
2169
2170
  ...G({
2170
2171
  "aria-label": l
2171
2172
  }),
2172
2173
  children: [
2173
- /* @__PURE__ */ U("input", { ...J() }),
2174
- /* @__PURE__ */ U(ji, { name: "Upload" }),
2174
+ /* @__PURE__ */ B("input", { ...$({ name: A }) }),
2175
+ /* @__PURE__ */ B(ji, { name: "Upload" }),
2175
2176
  /* @__PURE__ */ wa(Na, { className: D.text, children: [
2176
2177
  p ? `${n} ` : n,
2177
- !!p && /* @__PURE__ */ U(
2178
+ !!p && /* @__PURE__ */ B(
2178
2179
  Na,
2179
2180
  {
2180
2181
  weight: "bold",
@@ -2187,28 +2188,28 @@ function jt(a) {
2187
2188
  ]
2188
2189
  }
2189
2190
  ),
2190
- i.map((b) => /* @__PURE__ */ U(
2191
+ i.map((f) => /* @__PURE__ */ B(
2191
2192
  Wa,
2192
2193
  {
2193
2194
  removeAriaLabel: o,
2194
- file: b,
2195
- onRemoveFile: K,
2195
+ file: f,
2196
+ onRemoveFile: J,
2196
2197
  className: k
2197
2198
  },
2198
- b.path
2199
+ f.path
2199
2200
  )),
2200
2201
  t.map(({
2201
- file: b
2202
- }) => /* @__PURE__ */ U(
2202
+ file: f
2203
+ }) => /* @__PURE__ */ B(
2203
2204
  Wa,
2204
2205
  {
2205
2206
  theme: "failed",
2206
2207
  removeAriaLabel: o,
2207
- file: b,
2208
- onRemoveFile: V,
2208
+ file: f,
2209
+ onRemoveFile: K,
2209
2210
  className: k
2210
2211
  },
2211
- b.path
2212
+ f.path
2212
2213
  ))
2213
2214
  ] });
2214
2215
  }
@@ -2,7 +2,7 @@ import { jsx as m } from "react/jsx-runtime";
2
2
  import n from "react";
3
3
  import d from "./InputDropzone.js";
4
4
  function R() {
5
- const [l, i] = n.useState([]), [a, c] = n.useState([]), r = n.useCallback((o, t) => {
5
+ const [a, i] = n.useState([]), [l, c] = n.useState([]), r = n.useCallback((o, t) => {
6
6
  i(o), c(t);
7
7
  }, []), p = n.useCallback((o) => {
8
8
  i((t) => {
@@ -18,8 +18,9 @@ function R() {
18
18
  return /* @__PURE__ */ m(
19
19
  d,
20
20
  {
21
- value: l,
22
- rejections: a,
21
+ value: a,
22
+ rejections: l,
23
+ name: "InputDropzone",
23
24
  onRemoveFile: p,
24
25
  onRemoveRejection: u,
25
26
  onDrop: r,
@@ -31,7 +32,7 @@ function R() {
31
32
  }
32
33
  );
33
34
  }
34
- const D = n.memo(R);
35
+ const j = n.memo(R);
35
36
  export {
36
- D as default
37
+ j as default
37
38
  };
@@ -8,5 +8,6 @@ export interface RadioProps {
8
8
  size?: RadioSize;
9
9
  disabled?: boolean;
10
10
  className?: string;
11
+ name?: string;
11
12
  }
12
13
  export declare function Radio(props: RadioProps): import("react/jsx-runtime").JSX.Element;
@@ -1,45 +1,47 @@
1
- import { jsxs as x, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as b, jsx as o } from "react/jsx-runtime";
2
2
  import a from "react";
3
- import { clsx as b } from "../../utils/clsx.js";
4
- const h = "cfxui__Radio__root__05f1c", R = "cfxui__Radio__indicator__2181e", p = "cfxui__Radio__disabled__c411f", o = {
5
- root: h,
3
+ import { clsx as h } from "../../utils/clsx.js";
4
+ const R = "cfxui__Radio__root__05f1c", p = "cfxui__Radio__indicator__2181e", z = "cfxui__Radio__disabled__c411f", e = {
5
+ root: R,
6
6
  "size-normal": "cfxui__Radio__size-normal__6dccc",
7
7
  "size-large": "cfxui__Radio__size-large__0a074",
8
- indicator: R,
9
- disabled: p
8
+ indicator: p,
9
+ disabled: z
10
10
  };
11
11
  let t = 1;
12
- function C(d) {
12
+ function N(d) {
13
13
  const {
14
14
  checked: i,
15
15
  onChange: n,
16
16
  label: _,
17
17
  size: l = "normal",
18
18
  className: r,
19
- disabled: s = !1
20
- } = d, f = a.useRef(t);
19
+ disabled: s = !1,
20
+ name: f
21
+ } = d, m = a.useRef(t);
21
22
  a.useEffect(() => {
22
23
  t += 1;
23
24
  }, []);
24
- const m = () => {
25
+ const u = () => {
25
26
  n(!i);
26
- }, c = a.useId(), u = b(o.root, r, o[`size-${l}`], { [o.disabled]: s });
27
- return /* @__PURE__ */ x("label", { className: u, htmlFor: c, children: [
28
- /* @__PURE__ */ e(
27
+ }, c = a.useId(), x = h(e.root, r, e[`size-${l}`], { [e.disabled]: s });
28
+ return /* @__PURE__ */ b("label", { className: x, htmlFor: c, children: [
29
+ /* @__PURE__ */ o(
29
30
  "input",
30
31
  {
31
32
  type: "radio",
32
- tabIndex: f.current,
33
+ tabIndex: m.current,
33
34
  checked: i,
34
35
  disabled: s,
35
- onChange: m,
36
- id: c
36
+ onChange: u,
37
+ id: c,
38
+ name: f
37
39
  }
38
40
  ),
39
- /* @__PURE__ */ e("div", { className: o.indicator }),
40
- /* @__PURE__ */ e("div", { className: o.label, children: _ })
41
+ /* @__PURE__ */ o("div", { className: e.indicator }),
42
+ /* @__PURE__ */ o("div", { className: e.label, children: _ })
41
43
  ] });
42
44
  }
43
45
  export {
44
- C as Radio
46
+ N as Radio
45
47
  };