@overdoser/react-toolkit 0.0.5 → 0.0.6

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 (2) hide show
  1. package/index.js +495 -484
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { forwardRef as W, createElement as Ie, useState as X, useCallback as L, useMemo as ee, useEffect as F, useRef as O, useId as ne, createContext as fe, useContext as ae, cloneElement as $e } from "react";
2
2
  import { jsxs as I, jsx as c } from "react/jsx-runtime";
3
- import { FormProvider as Ce, useFormContext as Re, useController as De } from "react-hook-form";
3
+ import { FormProvider as Ce, useFormContext as De, useController as Re } from "react-hook-form";
4
4
  import { createPortal as Ee } from "react-dom";
5
5
  function ge(e) {
6
6
  var r, t, n = "";
@@ -15,7 +15,7 @@ function l() {
15
15
  for (var e, r, t = 0, n = "", o = arguments.length; t < o; t++) (e = arguments[t]) && (r = ge(e)) && (n && (n += " "), n += r);
16
16
  return n;
17
17
  }
18
- const Le = "crk-root-8RX49", Be = "crk-loading-QfItr", Te = "crk-primary-st6yY", Ae = "crk-secondary-j-3rj", Oe = "crk-danger-Hxs5n", Pe = "crk-ghost-kQ0A8", Me = "crk-sm-RXFPY", We = "crk-md-nDnOD", He = "crk-lg-qD-Qh", qe = "crk-fullWidth-AHpSl", Fe = "crk-content-PpYVU", je = "crk-shimmer-8iQSU", ze = "crk-loadingShimmer-BVvFw", Ke = "crk-shimmerSweep-uiZ01", Ue = "crk-dots-U8wss", Ge = "crk-loadingDots-eKv64", Ve = "crk-dot-Owuk1", Qe = "crk-dotBounce-FwdcC", Xe = "crk-loadingBorder-9ULFw", Ye = "crk-borderSpin-EJ2gW", H = {
18
+ const Le = "crk-root-8RX49", Be = "crk-loading-QfItr", Te = "crk-primary-st6yY", Ae = "crk-secondary-j-3rj", Oe = "crk-danger-Hxs5n", Pe = "crk-ghost-kQ0A8", Me = "crk-sm-RXFPY", We = "crk-md-nDnOD", He = "crk-lg-qD-Qh", qe = "crk-fullWidth-AHpSl", Fe = "crk-content-PpYVU", je = "crk-shimmer-8iQSU", ze = "crk-loadingShimmer-BVvFw", Ue = "crk-shimmerSweep-uiZ01", Ke = "crk-dots-U8wss", Ve = "crk-loadingDots-eKv64", Ge = "crk-dot-Owuk1", Qe = "crk-dotBounce-FwdcC", Xe = "crk-loadingBorder-9ULFw", Ye = "crk-borderSpin-EJ2gW", H = {
19
19
  root: Le,
20
20
  loading: Be,
21
21
  primary: Te,
@@ -29,10 +29,10 @@ const Le = "crk-root-8RX49", Be = "crk-loading-QfItr", Te = "crk-primary-st6yY",
29
29
  content: Fe,
30
30
  shimmer: je,
31
31
  loadingShimmer: ze,
32
- shimmerSweep: Ke,
33
- dots: Ue,
34
- loadingDots: Ge,
35
- dot: Ve,
32
+ shimmerSweep: Ue,
33
+ dots: Ke,
34
+ loadingDots: Ve,
35
+ dot: Ge,
36
36
  dotBounce: Qe,
37
37
  loadingBorder: Xe,
38
38
  borderSpin: Ye
@@ -48,15 +48,15 @@ const Le = "crk-root-8RX49", Be = "crk-loading-QfItr", Te = "crk-primary-st6yY",
48
48
  loadingStyle: n = "dots",
49
49
  fullWidth: o = !1,
50
50
  disabled: m,
51
- classes: a,
51
+ classes: i,
52
52
  className: h,
53
- style: i,
54
- children: y,
53
+ style: a,
54
+ children: v,
55
55
  ...u
56
- }, g) => /* @__PURE__ */ I(
56
+ }, f) => /* @__PURE__ */ I(
57
57
  "button",
58
58
  {
59
- ref: g,
59
+ ref: f,
60
60
  className: l(
61
61
  H.root,
62
62
  H[e],
@@ -64,20 +64,20 @@ const Le = "crk-root-8RX49", Be = "crk-loading-QfItr", Te = "crk-primary-st6yY",
64
64
  o && H.fullWidth,
65
65
  t && H.loading,
66
66
  t && Je[n],
67
- a?.root,
67
+ i?.root,
68
68
  h
69
69
  ),
70
- style: i,
70
+ style: a,
71
71
  disabled: m || t,
72
72
  "aria-busy": t || void 0,
73
73
  ...u,
74
74
  children: [
75
- /* @__PURE__ */ c("div", { className: l(H.shimmer, a?.shimmer) }),
76
- /* @__PURE__ */ c("span", { className: l(H.content, a?.content), children: y }),
77
- /* @__PURE__ */ I("span", { className: l(H.dots, a?.dots), "aria-hidden": "true", children: [
78
- /* @__PURE__ */ c("span", { className: l(H.dot, a?.dot) }),
79
- /* @__PURE__ */ c("span", { className: l(H.dot, a?.dot) }),
80
- /* @__PURE__ */ c("span", { className: l(H.dot, a?.dot) })
75
+ /* @__PURE__ */ c("div", { className: l(H.shimmer, i?.shimmer) }),
76
+ /* @__PURE__ */ c("span", { className: l(H.content, i?.content), children: v }),
77
+ /* @__PURE__ */ I("span", { className: l(H.dots, i?.dots), "aria-hidden": "true", children: [
78
+ /* @__PURE__ */ c("span", { className: l(H.dot, i?.dot) }),
79
+ /* @__PURE__ */ c("span", { className: l(H.dot, i?.dot) }),
80
+ /* @__PURE__ */ c("span", { className: l(H.dot, i?.dot) })
81
81
  ] })
82
82
  ]
83
83
  }
@@ -98,10 +98,10 @@ const _e = "crk-root-2j4Vp", er = "crk-muted-vReNc", rr = "crk-danger-ugf9r", tr
98
98
  style: n,
99
99
  children: o,
100
100
  ...m
101
- }, a) => /* @__PURE__ */ I(
101
+ }, i) => /* @__PURE__ */ I(
102
102
  "a",
103
103
  {
104
- ref: a,
104
+ ref: i,
105
105
  className: l(me.root, me[e], t),
106
106
  style: n,
107
107
  ...r && {
@@ -117,7 +117,7 @@ const _e = "crk-root-2j4Vp", er = "crk-muted-vReNc", rr = "crk-danger-ugf9r", tr
117
117
  )
118
118
  );
119
119
  nr.displayName = "Link";
120
- const or = "crk-root-U-oiq", cr = "crk-h1-Aivwz", lr = "crk-h2-CV8Oo", sr = "crk-h3-lrbrK", ar = "crk-h4--jkC1", ir = "crk-h5-GnQvD", dr = "crk-h6-MKlIN", ur = "crk-p-FzRtm", mr = "crk-span-NZvLx", hr = "crk-label-Cwi6a", pr = "crk-normal-7AeZz", fr = "crk-medium-36OXr", gr = "crk-semibold-oQixc", br = "crk-bold-bk4b4", kr = "crk-muted-itOSW", vr = "crk-primary-rp36t", yr = "crk-danger-SyOy-", Nr = "crk-success-w8PpD", wr = "crk-align-left-3AGYw", xr = "crk-align-center-h-x--", Sr = "crk-align-right-IXFhK", Ir = "crk-truncate-eqr85", _ = {
120
+ const or = "crk-root-U-oiq", cr = "crk-h1-Aivwz", lr = "crk-h2-CV8Oo", sr = "crk-h3-lrbrK", ar = "crk-h4--jkC1", ir = "crk-h5-GnQvD", dr = "crk-h6-MKlIN", ur = "crk-p-FzRtm", mr = "crk-span-NZvLx", hr = "crk-label-Cwi6a", pr = "crk-normal-7AeZz", fr = "crk-medium-36OXr", gr = "crk-semibold-oQixc", br = "crk-bold-bk4b4", kr = "crk-muted-itOSW", yr = "crk-primary-rp36t", vr = "crk-danger-SyOy-", Nr = "crk-success-w8PpD", wr = "crk-align-left-3AGYw", xr = "crk-align-center-h-x--", Sr = "crk-align-right-IXFhK", Ir = "crk-truncate-eqr85", _ = {
121
121
  root: or,
122
122
  h1: cr,
123
123
  h2: lr,
@@ -134,8 +134,8 @@ const or = "crk-root-U-oiq", cr = "crk-h1-Aivwz", lr = "crk-h2-CV8Oo", sr = "crk
134
134
  bold: br,
135
135
  default: "crk-default-79lKR",
136
136
  muted: kr,
137
- primary: vr,
138
- danger: yr,
137
+ primary: yr,
138
+ danger: vr,
139
139
  success: Nr,
140
140
  alignLeft: wr,
141
141
  alignCenter: xr,
@@ -149,13 +149,13 @@ const or = "crk-root-U-oiq", cr = "crk-h1-Aivwz", lr = "crk-h2-CV8Oo", sr = "crk
149
149
  align: n,
150
150
  truncate: o = !1,
151
151
  className: m,
152
- style: a,
152
+ style: i,
153
153
  children: h,
154
- ...i
155
- }, y) => Ie(
154
+ ...a
155
+ }, v) => Ie(
156
156
  e,
157
157
  {
158
- ref: y,
158
+ ref: v,
159
159
  className: l(
160
160
  _.root,
161
161
  _[e],
@@ -165,17 +165,17 @@ const or = "crk-root-U-oiq", cr = "crk-h1-Aivwz", lr = "crk-h2-CV8Oo", sr = "crk
165
165
  o && _.truncate,
166
166
  m
167
167
  ),
168
- style: a,
169
- ...i
168
+ style: i,
169
+ ...a
170
170
  },
171
171
  h
172
172
  )
173
173
  );
174
174
  $r.displayName = "Typography";
175
- const Cr = "crk-root-PVrgx", Rr = "crk-unordered-FhCWT", Dr = "crk-item-TfW82", Er = "crk-ordered-8x4YC", Lr = "crk-none-f03Kx", Br = "crk-sm-Rg4Mv", Tr = "crk-md-X4Icb", Ar = "crk-lg-JjNKZ", le = {
175
+ const Cr = "crk-root-PVrgx", Dr = "crk-unordered-FhCWT", Rr = "crk-item-TfW82", Er = "crk-ordered-8x4YC", Lr = "crk-none-f03Kx", Br = "crk-sm-Rg4Mv", Tr = "crk-md-X4Icb", Ar = "crk-lg-JjNKZ", le = {
176
176
  root: Cr,
177
- unordered: Rr,
178
- item: Dr,
177
+ unordered: Dr,
178
+ item: Rr,
179
179
  ordered: Er,
180
180
  none: Lr,
181
181
  sm: Br,
@@ -189,10 +189,10 @@ const Cr = "crk-root-PVrgx", Rr = "crk-unordered-FhCWT", Dr = "crk-item-TfW82",
189
189
  style: n,
190
190
  children: o,
191
191
  ...m
192
- }, a) => /* @__PURE__ */ c(
192
+ }, i) => /* @__PURE__ */ c(
193
193
  e === "ordered" ? "ol" : "ul",
194
194
  {
195
- ref: a,
195
+ ref: i,
196
196
  className: l(
197
197
  le.root,
198
198
  le[e],
@@ -219,7 +219,7 @@ const Pr = W(
219
219
  )
220
220
  );
221
221
  Pr.displayName = "ListItem";
222
- const Mr = "crk-wrapper-zxjMt", Wr = "crk-root-Gf85-", Hr = "crk-headerCell-ePPZW", qr = "crk-headerCellSortable-NMybk", Fr = "crk-sortIndicator-WGD2S", jr = "crk-sortArrow-1-ok4", zr = "crk-sortArrowActive-yhWrO", Kr = "crk-sortIndex-HGoca", Ur = "crk-row-H0wL1", Gr = "crk-cell-ZfnbG", Vr = "crk-emptyRow-AoPfj", Qr = "crk-emptyCell-99-7C", Xr = "crk-striped-6Qckq", Yr = "crk-hoverable-ljU9B", Jr = "crk-compact-2-UWr", Zr = "crk-paginator-UlYIY", _r = "crk-paginatorInfo-BVca4", et = "crk-paginatorText-sqWS0", rt = "crk-pageSizeSelect-yhqJQ", tt = "crk-paginatorNav-MDSui", nt = "crk-pageButton-1PX-g", ot = "crk-pageButtonActive--D7Q7", ct = "crk-pageEllipsis-en59J", C = {
222
+ const Mr = "crk-wrapper-zxjMt", Wr = "crk-root-Gf85-", Hr = "crk-headerCell-ePPZW", qr = "crk-headerCellSortable-NMybk", Fr = "crk-sortIndicator-WGD2S", jr = "crk-sortArrow-1-ok4", zr = "crk-sortArrowActive-yhWrO", Ur = "crk-sortIndex-HGoca", Kr = "crk-row-H0wL1", Vr = "crk-cell-ZfnbG", Gr = "crk-emptyRow-AoPfj", Qr = "crk-emptyCell-99-7C", Xr = "crk-striped-6Qckq", Yr = "crk-hoverable-ljU9B", Jr = "crk-compact-2-UWr", Zr = "crk-paginator-UlYIY", _r = "crk-paginatorInfo-BVca4", et = "crk-paginatorText-sqWS0", rt = "crk-pageSizeSelect-yhqJQ", tt = "crk-paginatorNav-MDSui", nt = "crk-pageButton-1PX-g", ot = "crk-pageButtonActive--D7Q7", ct = "crk-pageEllipsis-en59J", R = {
223
223
  wrapper: Mr,
224
224
  root: Wr,
225
225
  headerCell: Hr,
@@ -227,10 +227,10 @@ const Mr = "crk-wrapper-zxjMt", Wr = "crk-root-Gf85-", Hr = "crk-headerCell-ePPZ
227
227
  sortIndicator: Fr,
228
228
  sortArrow: jr,
229
229
  sortArrowActive: zr,
230
- sortIndex: Kr,
231
- row: Ur,
232
- cell: Gr,
233
- emptyRow: Vr,
230
+ sortIndex: Ur,
231
+ row: Kr,
232
+ cell: Vr,
233
+ emptyRow: Gr,
234
234
  emptyCell: Qr,
235
235
  striped: Xr,
236
236
  hoverable: Yr,
@@ -248,39 +248,39 @@ function lt(e, r) {
248
248
  return e == null && r == null ? 0 : e == null ? -1 : r == null ? 1 : typeof e == "number" && typeof r == "number" ? e - r : String(e).localeCompare(String(r));
249
249
  }
250
250
  function st(e, r = []) {
251
- const [t, n] = X(r), o = L((i) => {
252
- n((y) => {
253
- const u = y.find((g) => g.key === i);
254
- return u ? u.direction === "asc" ? [{ key: i, direction: "desc" }] : [] : [{ key: i, direction: "asc" }];
251
+ const [t, n] = X(r), o = L((a) => {
252
+ n((v) => {
253
+ const u = v.find((f) => f.key === a);
254
+ return u ? u.direction === "asc" ? [{ key: a, direction: "desc" }] : [] : [{ key: a, direction: "asc" }];
255
255
  });
256
- }, []), m = L((i) => {
257
- n((y) => {
258
- const u = y.findIndex((v) => v.key === i);
256
+ }, []), m = L((a) => {
257
+ n((v) => {
258
+ const u = v.findIndex((y) => y.key === a);
259
259
  if (u === -1)
260
- return [...y, { key: i, direction: "asc" }];
261
- if (y[u].direction === "asc") {
262
- const v = [...y];
263
- return v[u] = { key: i, direction: "desc" }, v;
260
+ return [...v, { key: a, direction: "asc" }];
261
+ if (v[u].direction === "asc") {
262
+ const y = [...v];
263
+ return y[u] = { key: a, direction: "desc" }, y;
264
264
  }
265
- return y.filter((v, b) => b !== u);
265
+ return v.filter((y, b) => b !== u);
266
266
  });
267
- }, []), a = L(() => {
267
+ }, []), i = L(() => {
268
268
  n([]);
269
269
  }, []);
270
- return { sortedData: ee(() => t.length === 0 ? e : [...e].sort((i, y) => {
271
- for (const { key: u, direction: g } of t) {
272
- const v = lt(i[u], y[u]);
273
- if (v !== 0)
274
- return g === "asc" ? v : -v;
270
+ return { sortedData: ee(() => t.length === 0 ? e : [...e].sort((a, v) => {
271
+ for (const { key: u, direction: f } of t) {
272
+ const y = lt(a[u], v[u]);
273
+ if (y !== 0)
274
+ return f === "asc" ? y : -y;
275
275
  }
276
276
  return 0;
277
- }), [e, t]), sortConfig: t, requestSort: o, requestMultiSort: m, resetSort: a };
277
+ }), [e, t]), sortConfig: t, requestSort: o, requestMultiSort: m, resetSort: i };
278
278
  }
279
279
  function at({ direction: e, sortIndex: r }) {
280
- return /* @__PURE__ */ I("span", { className: C.sortIndicator, "aria-hidden": "true", children: [
281
- /* @__PURE__ */ c("span", { className: l(C.sortArrow, e === "asc" && C.sortArrowActive), children: "▲" }),
282
- /* @__PURE__ */ c("span", { className: l(C.sortArrow, e === "desc" && C.sortArrowActive), children: "▼" }),
283
- r !== void 0 && r >= 0 && /* @__PURE__ */ c("span", { className: C.sortIndex, children: r + 1 })
280
+ return /* @__PURE__ */ I("span", { className: R.sortIndicator, "aria-hidden": "true", children: [
281
+ /* @__PURE__ */ c("span", { className: l(R.sortArrow, e === "asc" && R.sortArrowActive), children: "▲" }),
282
+ /* @__PURE__ */ c("span", { className: l(R.sortArrow, e === "desc" && R.sortArrowActive), children: "▼" }),
283
+ r !== void 0 && r >= 0 && /* @__PURE__ */ c("span", { className: R.sortIndex, children: r + 1 })
284
284
  ] });
285
285
  }
286
286
  function it({
@@ -291,25 +291,25 @@ function it({
291
291
  onPageChange: o,
292
292
  paginatorClasses: m
293
293
  }) {
294
- const a = Math.max(1, Math.ceil(t / r)), h = (e - 1) * r + 1, i = Math.min(e * r, t), y = ee(() => {
294
+ const i = Math.max(1, Math.ceil(t / r)), h = (e - 1) * r + 1, a = Math.min(e * r, t), v = ee(() => {
295
295
  const u = [];
296
- if (a <= 7)
297
- for (let g = 1; g <= a; g++) u.push(g);
296
+ if (i <= 7)
297
+ for (let f = 1; f <= i; f++) u.push(f);
298
298
  else {
299
299
  u.push(1), e > 3 && u.push("ellipsis");
300
- for (let g = Math.max(2, e - 1); g <= Math.min(a - 1, e + 1); g++)
301
- u.push(g);
302
- e < a - 2 && u.push("ellipsis"), u.push(a);
300
+ for (let f = Math.max(2, e - 1); f <= Math.min(i - 1, e + 1); f++)
301
+ u.push(f);
302
+ e < i - 2 && u.push("ellipsis"), u.push(i);
303
303
  }
304
304
  return u;
305
- }, [e, a]);
306
- return /* @__PURE__ */ I("nav", { className: l(C.paginator, m?.paginator), "aria-label": "Table pagination", children: [
307
- /* @__PURE__ */ I("div", { className: C.paginatorInfo, children: [
308
- /* @__PURE__ */ c("span", { className: C.paginatorText, children: t > 0 ? `${h}–${i} of ${t}` : "No results" }),
305
+ }, [e, i]);
306
+ return /* @__PURE__ */ I("nav", { className: l(R.paginator, m?.paginator), "aria-label": "Table pagination", children: [
307
+ /* @__PURE__ */ I("div", { className: R.paginatorInfo, children: [
308
+ /* @__PURE__ */ c("span", { className: R.paginatorText, children: t > 0 ? `${h}–${a} of ${t}` : "No results" }),
309
309
  n.length > 1 && /* @__PURE__ */ c(
310
310
  "select",
311
311
  {
312
- className: C.pageSizeSelect,
312
+ className: R.pageSizeSelect,
313
313
  value: r,
314
314
  onChange: (u) => o(1, Number(u.target.value)),
315
315
  "aria-label": "Rows per page",
@@ -320,24 +320,24 @@ function it({
320
320
  }
321
321
  )
322
322
  ] }),
323
- /* @__PURE__ */ I("div", { className: C.paginatorNav, children: [
323
+ /* @__PURE__ */ I("div", { className: R.paginatorNav, children: [
324
324
  /* @__PURE__ */ c(
325
325
  "button",
326
326
  {
327
327
  type: "button",
328
- className: l(C.pageButton, m?.pageButton),
328
+ className: l(R.pageButton, m?.pageButton),
329
329
  disabled: e <= 1,
330
330
  onClick: () => o(e - 1, r),
331
331
  "aria-label": "Previous page",
332
332
  children: "‹"
333
333
  }
334
334
  ),
335
- y.map(
336
- (u, g) => u === "ellipsis" ? /* @__PURE__ */ c("span", { className: C.pageEllipsis, children: "…" }, `ellipsis-${g}`) : /* @__PURE__ */ c(
335
+ v.map(
336
+ (u, f) => u === "ellipsis" ? /* @__PURE__ */ c("span", { className: R.pageEllipsis, children: "…" }, `ellipsis-${f}`) : /* @__PURE__ */ c(
337
337
  "button",
338
338
  {
339
339
  type: "button",
340
- className: l(C.pageButton, u === e && C.pageButtonActive, m?.pageButton),
340
+ className: l(R.pageButton, u === e && R.pageButtonActive, m?.pageButton),
341
341
  onClick: () => o(u, r),
342
342
  "aria-label": `Page ${u}`,
343
343
  "aria-current": u === e ? "page" : void 0,
@@ -350,8 +350,8 @@ function it({
350
350
  "button",
351
351
  {
352
352
  type: "button",
353
- className: l(C.pageButton, m?.pageButton),
354
- disabled: e >= a,
353
+ className: l(R.pageButton, m?.pageButton),
354
+ disabled: e >= i,
355
355
  onClick: () => o(e + 1, r),
356
356
  "aria-label": "Next page",
357
357
  children: "›"
@@ -367,81 +367,81 @@ function dt({
367
367
  onSort: n,
368
368
  multiSort: o = !0,
369
369
  striped: m = !1,
370
- hoverable: a = !1,
370
+ hoverable: i = !1,
371
371
  compact: h = !1,
372
- className: i,
373
- style: y,
372
+ className: a,
373
+ style: v,
374
374
  rowKey: u,
375
- emptyMessage: g = "No data",
376
- pagination: v,
375
+ emptyMessage: f = "No data",
376
+ pagination: y,
377
377
  classes: b
378
378
  }) {
379
- const p = n !== void 0, {
379
+ const g = n !== void 0, {
380
380
  sortedData: $,
381
381
  sortConfig: w,
382
- requestSort: R,
382
+ requestSort: C,
383
383
  requestMultiSort: D
384
- } = st(e, t), S = p ? t ?? [] : w, E = p ? e : $, K = ee(() => {
385
- if (!v || p) return E;
386
- const k = (v.page - 1) * v.pageSize;
387
- return E.slice(k, k + v.pageSize);
388
- }, [E, v, p]), q = v?.totalRows ?? E.length, V = L(
384
+ } = st(e, t), x = g ? t ?? [] : w, E = g ? e : $, U = ee(() => {
385
+ if (!y || g) return E;
386
+ const k = (y.page - 1) * y.pageSize;
387
+ return E.slice(k, k + y.pageSize);
388
+ }, [E, y, g]), q = y?.totalRows ?? E.length, G = L(
389
389
  (k, P) => {
390
- const x = o && (P.ctrlKey || P.metaKey);
391
- if (p)
392
- if (x) {
393
- const B = S.findIndex((A) => A.key === k);
390
+ const S = o && (P.ctrlKey || P.metaKey);
391
+ if (g)
392
+ if (S) {
393
+ const B = x.findIndex((A) => A.key === k);
394
394
  let z;
395
- B === -1 ? z = [...S, { key: k, direction: "asc" }] : S[B].direction === "asc" ? z = S.map(
395
+ B === -1 ? z = [...x, { key: k, direction: "asc" }] : x[B].direction === "asc" ? z = x.map(
396
396
  (A, Z) => Z === B ? { key: k, direction: "desc" } : A
397
- ) : z = S.filter((A, Z) => Z !== B), n(z);
397
+ ) : z = x.filter((A, Z) => Z !== B), n(z);
398
398
  } else {
399
- const B = S.find((z) => z.key === k);
399
+ const B = x.find((z) => z.key === k);
400
400
  B ? B.direction === "asc" ? n([{ key: k, direction: "desc" }]) : n([]) : n([{ key: k, direction: "asc" }]);
401
401
  }
402
402
  else
403
- x ? D(k) : R(k);
403
+ S ? D(k) : C(k);
404
404
  },
405
405
  [
406
- p,
406
+ g,
407
407
  o,
408
- S,
408
+ x,
409
409
  n,
410
- R,
410
+ C,
411
411
  D
412
412
  ]
413
- ), j = (k) => S.find((x) => x.key === k)?.direction, Y = (k) => {
414
- if (S.length <= 1) return;
415
- const P = S.findIndex((x) => x.key === k);
413
+ ), j = (k) => x.find((S) => S.key === k)?.direction, Y = (k) => {
414
+ if (x.length <= 1) return;
415
+ const P = x.findIndex((S) => S.key === k);
416
416
  return P >= 0 ? P : void 0;
417
417
  };
418
- return /* @__PURE__ */ I("div", { className: l(C.wrapper, b?.wrapper), children: [
418
+ return /* @__PURE__ */ I("div", { className: l(R.wrapper, b?.wrapper), children: [
419
419
  /* @__PURE__ */ I(
420
420
  "table",
421
421
  {
422
422
  className: l(
423
- C.root,
424
- m && C.striped,
425
- a && C.hoverable,
426
- h && C.compact,
423
+ R.root,
424
+ m && R.striped,
425
+ i && R.hoverable,
426
+ h && R.compact,
427
427
  b?.root,
428
- i
428
+ a
429
429
  ),
430
- style: y,
430
+ style: v,
431
431
  children: [
432
432
  /* @__PURE__ */ c("thead", { children: /* @__PURE__ */ c("tr", { children: r.map((k) => /* @__PURE__ */ I(
433
433
  "th",
434
434
  {
435
435
  className: l(
436
- C.headerCell,
437
- k.sortable && C.headerCellSortable,
436
+ R.headerCell,
437
+ k.sortable && R.headerCellSortable,
438
438
  b?.headerCell
439
439
  ),
440
440
  style: {
441
441
  width: k.width,
442
442
  textAlign: k.align
443
443
  },
444
- onClick: k.sortable ? (P) => V(k.key, P) : void 0,
444
+ onClick: k.sortable ? (P) => G(k.key, P) : void 0,
445
445
  "aria-sort": k.sortable ? j(k.key) === "asc" ? "ascending" : j(k.key) === "desc" ? "descending" : "none" : void 0,
446
446
  children: [
447
447
  k.header,
@@ -456,32 +456,32 @@ function dt({
456
456
  },
457
457
  k.key
458
458
  )) }) }),
459
- /* @__PURE__ */ c("tbody", { children: K.length === 0 ? /* @__PURE__ */ c("tr", { className: C.emptyRow, children: /* @__PURE__ */ c("td", { className: l(C.emptyCell, b?.emptyCell), colSpan: r.length, children: g }) }) : K.map((k, P) => {
460
- const x = u ? String(k[u]) : P;
461
- return /* @__PURE__ */ c("tr", { className: l(C.row, b?.row), children: r.map((B) => /* @__PURE__ */ c(
459
+ /* @__PURE__ */ c("tbody", { children: U.length === 0 ? /* @__PURE__ */ c("tr", { className: R.emptyRow, children: /* @__PURE__ */ c("td", { className: l(R.emptyCell, b?.emptyCell), colSpan: r.length, children: f }) }) : U.map((k, P) => {
460
+ const S = u ? String(k[u]) : P;
461
+ return /* @__PURE__ */ c("tr", { className: l(R.row, b?.row), children: r.map((B) => /* @__PURE__ */ c(
462
462
  "td",
463
463
  {
464
- className: l(C.cell, b?.cell),
464
+ className: l(R.cell, b?.cell),
465
465
  style: { textAlign: B.align },
466
466
  children: B.render ? B.render(k[B.key], k, P) : k[B.key]
467
467
  },
468
468
  B.key
469
- )) }, x);
469
+ )) }, S);
470
470
  }) })
471
471
  ]
472
472
  }
473
473
  ),
474
- v && /* @__PURE__ */ c(
474
+ y && /* @__PURE__ */ c(
475
475
  it,
476
476
  {
477
- ...v,
477
+ ...y,
478
478
  totalRows: q,
479
479
  paginatorClasses: { paginator: b?.paginator, pageButton: b?.pageButton }
480
480
  }
481
481
  )
482
482
  ] });
483
483
  }
484
- const $o = dt, ut = "crk-root-an8Cf", mt = "crk-fullWidth-S-uVk", ht = "crk-trigger-LwPaD", pt = "crk-triggerOpen-U4pa9", ft = "crk-triggerLabel-QLITs", gt = "crk-triggerError-3jlu1", bt = "crk-placeholder-fWdch", kt = "crk-chevron-jmDNe", vt = "crk-menu-fxnKL", yt = "crk-menuOpen-HF-Y1", Nt = "crk-alignLeft-buCDJ", wt = "crk-alignRight-05P9w", xt = "crk-item-f-Rhh", St = "crk-itemDisabled-L-d6i", It = "crk-itemSelected-Fwmuo", M = {
484
+ const Co = dt, ut = "crk-root-an8Cf", mt = "crk-fullWidth-S-uVk", ht = "crk-trigger-LwPaD", pt = "crk-triggerOpen-U4pa9", ft = "crk-triggerLabel-QLITs", gt = "crk-triggerError-3jlu1", bt = "crk-placeholder-fWdch", kt = "crk-chevron-jmDNe", yt = "crk-menu-fxnKL", vt = "crk-menuOpen-HF-Y1", Nt = "crk-alignLeft-buCDJ", wt = "crk-alignRight-05P9w", xt = "crk-item-f-Rhh", St = "crk-itemDisabled-L-d6i", It = "crk-itemSelected-Fwmuo", M = {
485
485
  root: ut,
486
486
  fullWidth: mt,
487
487
  trigger: ht,
@@ -490,8 +490,8 @@ const $o = dt, ut = "crk-root-an8Cf", mt = "crk-fullWidth-S-uVk", ht = "crk-trig
490
490
  triggerError: gt,
491
491
  placeholder: bt,
492
492
  chevron: kt,
493
- menu: vt,
494
- menuOpen: yt,
493
+ menu: yt,
494
+ menuOpen: vt,
495
495
  alignLeft: Nt,
496
496
  alignRight: wt,
497
497
  item: xt,
@@ -532,32 +532,32 @@ const $t = W(
532
532
  className: n,
533
533
  style: o,
534
534
  id: m,
535
- onOpen: a,
535
+ onOpen: i,
536
536
  onClose: h,
537
- options: i,
538
- placeholder: y = "Select...",
537
+ options: a,
538
+ placeholder: v = "Select...",
539
539
  value: u,
540
- onChange: g,
541
- error: v = !1,
540
+ onChange: f,
541
+ error: y = !1,
542
542
  fullWidth: b = !0,
543
- classes: p
543
+ classes: g
544
544
  }, $) => {
545
- const [w, R] = X(!1), D = O(null), S = O(null), E = O(null), K = ne();
545
+ const [w, C] = X(!1), D = O(null), x = O(null), E = O(null), U = ne();
546
546
  F(() => {
547
- w && S.current && S.current.querySelector('[role="menuitem"]:not(:disabled)')?.focus();
547
+ w && x.current && x.current.querySelector('[role="menuitem"]:not(:disabled)')?.focus();
548
548
  }, [w]);
549
549
  const q = L(() => {
550
- R(!1), h?.(), E.current?.focus();
551
- }, [h]), V = L(() => {
552
- R((x) => {
553
- const B = !x;
554
- return B ? a?.() : h?.(), B;
550
+ C(!1), h?.(), E.current?.focus();
551
+ }, [h]), G = L(() => {
552
+ C((S) => {
553
+ const B = !S;
554
+ return B ? i?.() : h?.(), B;
555
555
  });
556
- }, [a, h]), j = L(
557
- (x) => {
558
- g?.(x), q();
556
+ }, [i, h]), j = L(
557
+ (S) => {
558
+ f?.(S), q();
559
559
  },
560
- [g, q]
560
+ [f, q]
561
561
  );
562
562
  ie(D, q, w), he(
563
563
  {
@@ -565,12 +565,12 @@ const $t = W(
565
565
  },
566
566
  w
567
567
  );
568
- const Y = i?.find((x) => x.value === u)?.label, k = i ? Y || y : e, P = i && !Y;
568
+ const Y = a?.find((S) => S.value === u)?.label, k = a ? Y || v : e, P = a && !Y;
569
569
  return /* @__PURE__ */ c(
570
570
  "div",
571
571
  {
572
572
  ref: $,
573
- className: l(M.root, b && M.fullWidth, p?.root, n),
573
+ className: l(M.root, b && M.fullWidth, g?.root, n),
574
574
  style: o,
575
575
  children: /* @__PURE__ */ I("div", { ref: D, style: b ? { width: "100%" } : void 0, children: [
576
576
  /* @__PURE__ */ I(
@@ -582,49 +582,49 @@ const $t = W(
582
582
  className: l(
583
583
  M.trigger,
584
584
  w && M.triggerOpen,
585
- v && M.triggerError,
585
+ y && M.triggerError,
586
586
  b && M.fullWidth,
587
- p?.trigger
587
+ g?.trigger
588
588
  ),
589
- onClick: V,
589
+ onClick: G,
590
590
  "aria-expanded": w,
591
591
  "aria-haspopup": "menu",
592
- "aria-controls": w ? K : void 0,
592
+ "aria-controls": w ? U : void 0,
593
593
  children: [
594
- /* @__PURE__ */ c("span", { className: l(M.triggerLabel, P && M.placeholder, p?.triggerLabel), children: k }),
595
- /* @__PURE__ */ c("span", { className: l(M.chevron, p?.chevron), "aria-hidden": "true" })
594
+ /* @__PURE__ */ c("span", { className: l(M.triggerLabel, P && M.placeholder, g?.triggerLabel), children: k }),
595
+ /* @__PURE__ */ c("span", { className: l(M.chevron, g?.chevron), "aria-hidden": "true" })
596
596
  ]
597
597
  }
598
598
  ),
599
599
  /* @__PURE__ */ c(
600
600
  "div",
601
601
  {
602
- ref: S,
603
- id: K,
602
+ ref: x,
603
+ id: U,
604
604
  className: l(
605
605
  M.menu,
606
606
  w && M.menuOpen,
607
607
  t === "left" ? M.alignLeft : M.alignRight,
608
608
  b && M.fullWidth,
609
- p?.menu
609
+ g?.menu
610
610
  ),
611
611
  role: "menu",
612
- children: i ? i.map((x) => /* @__PURE__ */ c(
612
+ children: a ? a.map((S) => /* @__PURE__ */ c(
613
613
  "button",
614
614
  {
615
615
  type: "button",
616
616
  role: "menuitem",
617
617
  className: l(
618
618
  M.item,
619
- x.disabled && M.itemDisabled,
620
- x.value === u && M.itemSelected,
621
- p?.item
619
+ S.disabled && M.itemDisabled,
620
+ S.value === u && M.itemSelected,
621
+ g?.item
622
622
  ),
623
- disabled: x.disabled,
624
- onClick: () => j(x.value),
625
- children: x.label
623
+ disabled: S.disabled,
624
+ onClick: () => j(S.value),
625
+ children: S.label
626
626
  },
627
- x.value
627
+ S.value
628
628
  )) : r
629
629
  }
630
630
  )
@@ -658,9 +658,9 @@ const Ct = W(
658
658
  )
659
659
  );
660
660
  Ct.displayName = "DropdownItem";
661
- const Rt = "crk-root-8H-L9", Dt = "crk-trigger-Zn1nQ", Et = "crk-popover-rvS3X", Lt = "crk-popoverFade-hj41M", Bt = "crk-bottom-lawQw", Tt = "crk-top-rqvC6", At = "crk-left-J6exv", Ot = "crk-right-3y20l", oe = {
662
- root: Rt,
663
- trigger: Dt,
661
+ const Dt = "crk-root-8H-L9", Rt = "crk-trigger-Zn1nQ", Et = "crk-popover-rvS3X", Lt = "crk-popoverFade-hj41M", Bt = "crk-bottom-lawQw", Tt = "crk-top-rqvC6", At = "crk-left-J6exv", Ot = "crk-right-3y20l", oe = {
662
+ root: Dt,
663
+ trigger: Rt,
664
664
  popover: Et,
665
665
  popoverFade: Lt,
666
666
  bottom: Bt,
@@ -675,56 +675,56 @@ const Rt = "crk-root-8H-L9", Dt = "crk-trigger-Zn1nQ", Et = "crk-popover-rvS3X",
675
675
  open: n,
676
676
  onOpenChange: o,
677
677
  classes: m,
678
- className: a,
678
+ className: i,
679
679
  style: h
680
- }, i) => {
681
- const [y, u] = X(!1), g = O(null), v = O(null), b = O(null), p = ne(), $ = n !== void 0, w = $ ? n : y, R = L(
680
+ }, a) => {
681
+ const [v, u] = X(!1), f = O(null), y = O(null), b = O(null), g = ne(), $ = n !== void 0, w = $ ? n : v, C = L(
682
682
  (E) => {
683
683
  $ || u(E), o?.(E);
684
684
  },
685
685
  [$, o]
686
686
  ), D = L(() => {
687
- R(!1), b.current?.focus();
688
- }, [R]), S = L(() => {
689
- R(!w);
690
- }, [w, R]);
691
- return ie(g, D, w), he(
687
+ C(!1), b.current?.focus();
688
+ }, [C]), x = L(() => {
689
+ C(!w);
690
+ }, [w, C]);
691
+ return ie(f, D, w), he(
692
692
  {
693
693
  Escape: () => D()
694
694
  },
695
695
  w
696
696
  ), F(() => {
697
- if (w && v.current) {
698
- const E = v.current.querySelector(
697
+ if (w && y.current) {
698
+ const E = y.current.querySelector(
699
699
  'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
700
700
  );
701
- E ? E.focus() : v.current.focus();
701
+ E ? E.focus() : y.current.focus();
702
702
  }
703
703
  }, [w]), /* @__PURE__ */ c(
704
704
  "div",
705
705
  {
706
- ref: i,
707
- className: l(oe.root, m?.root, a),
706
+ ref: a,
707
+ className: l(oe.root, m?.root, i),
708
708
  style: h,
709
- children: /* @__PURE__ */ I("div", { ref: g, children: [
709
+ children: /* @__PURE__ */ I("div", { ref: f, children: [
710
710
  /* @__PURE__ */ c(
711
711
  "button",
712
712
  {
713
713
  ref: b,
714
714
  type: "button",
715
715
  className: l(oe.trigger, m?.trigger),
716
- onClick: S,
716
+ onClick: x,
717
717
  "aria-expanded": w,
718
718
  "aria-haspopup": "dialog",
719
- "aria-controls": w ? p : void 0,
719
+ "aria-controls": w ? g : void 0,
720
720
  children: e
721
721
  }
722
722
  ),
723
723
  w && /* @__PURE__ */ c(
724
724
  "div",
725
725
  {
726
- ref: v,
727
- id: p,
726
+ ref: y,
727
+ id: g,
728
728
  role: "dialog",
729
729
  tabIndex: -1,
730
730
  className: l(oe.popover, oe[t], m?.popover),
@@ -757,8 +757,8 @@ function Mt(e, r) {
757
757
  o.preventDefault();
758
758
  return;
759
759
  }
760
- const a = m[0], h = m[m.length - 1];
761
- o.shiftKey ? document.activeElement === a && (o.preventDefault(), h.focus()) : document.activeElement === h && (o.preventDefault(), a.focus());
760
+ const i = m[0], h = m[m.length - 1];
761
+ o.shiftKey ? document.activeElement === i && (o.preventDefault(), h.focus()) : document.activeElement === h && (o.preventDefault(), i.focus());
762
762
  },
763
763
  [e]
764
764
  );
@@ -772,17 +772,17 @@ function Mt(e, r) {
772
772
  };
773
773
  }, [r, e, n]);
774
774
  }
775
- const Wt = "crk-backdrop-jYpTA", Ht = "crk-backdropIn-x5Z-A", qt = "crk-modal-yNG-7", Ft = "crk-modalIn-xFUwm", jt = "crk-sm--xyY9", zt = "crk-md-ETTfh", Kt = "crk-lg-5DBb7", Ut = "crk-fullscreen-b4jQ-", Gt = "crk-header-NS30G", Vt = "crk-headerWithClose-4davm", Qt = "crk-closeButton-JX-aq", Xt = "crk-body-3zIj9", Yt = "crk-footer-Oyz-R", J = {
775
+ const Wt = "crk-backdrop-jYpTA", Ht = "crk-backdropIn-x5Z-A", qt = "crk-modal-yNG-7", Ft = "crk-modalIn-xFUwm", jt = "crk-sm--xyY9", zt = "crk-md-ETTfh", Ut = "crk-lg-5DBb7", Kt = "crk-fullscreen-b4jQ-", Vt = "crk-header-NS30G", Gt = "crk-headerWithClose-4davm", Qt = "crk-closeButton-JX-aq", Xt = "crk-body-3zIj9", Yt = "crk-footer-Oyz-R", J = {
776
776
  backdrop: Wt,
777
777
  backdropIn: Ht,
778
778
  modal: qt,
779
779
  modalIn: Ft,
780
780
  sm: jt,
781
781
  md: zt,
782
- lg: Kt,
783
- fullscreen: Ut,
784
- header: Gt,
785
- headerWithClose: Vt,
782
+ lg: Ut,
783
+ fullscreen: Kt,
784
+ header: Vt,
785
+ headerWithClose: Gt,
786
786
  closeButton: Qt,
787
787
  body: Xt,
788
788
  footer: Yt
@@ -816,11 +816,11 @@ const ke = ({ children: e, className: r, style: t }) => {
816
816
  return /* @__PURE__ */ c("div", { className: l(J.body, n.body, r), style: t, children: e });
817
817
  };
818
818
  ke.displayName = "Modal.Body";
819
- const ve = ({ children: e, className: r, style: t }) => {
819
+ const ye = ({ children: e, className: r, style: t }) => {
820
820
  const { classes: n } = ae(de);
821
821
  return /* @__PURE__ */ c("div", { className: l(J.footer, n.footer, r), style: t, children: e });
822
822
  };
823
- ve.displayName = "Modal.Footer";
823
+ ye.displayName = "Modal.Footer";
824
824
  const ue = W(
825
825
  ({
826
826
  open: e,
@@ -829,13 +829,13 @@ const ue = W(
829
829
  closeOnEscape: n = !0,
830
830
  size: o = "md",
831
831
  classes: m,
832
- className: a,
832
+ className: i,
833
833
  style: h,
834
- children: i,
835
- "aria-label": y,
834
+ children: a,
835
+ "aria-label": v,
836
836
  "aria-labelledby": u
837
- }, g) => {
838
- const v = O(null), b = g ?? v, p = ne(), $ = u ?? `${p}-title`;
837
+ }, f) => {
838
+ const y = O(null), b = f ?? y, g = ne(), $ = u ?? `${g}-title`;
839
839
  Mt(b, e);
840
840
  const w = ee(
841
841
  () => ({
@@ -852,7 +852,7 @@ const ue = W(
852
852
  document.body.style.overflow = D;
853
853
  };
854
854
  }, [e]);
855
- const R = (D) => {
855
+ const C = (D) => {
856
856
  t && D.target === D.currentTarget && r();
857
857
  };
858
858
  return e ? Ee(
@@ -860,19 +860,19 @@ const ue = W(
860
860
  "div",
861
861
  {
862
862
  className: l(J.backdrop, m?.backdrop),
863
- onClick: R,
863
+ onClick: C,
864
864
  role: "presentation",
865
865
  children: /* @__PURE__ */ c(
866
866
  "div",
867
867
  {
868
868
  ref: b,
869
- className: l(J.modal, J[o], m?.modal, a),
869
+ className: l(J.modal, J[o], m?.modal, i),
870
870
  style: h,
871
871
  role: "dialog",
872
872
  "aria-modal": "true",
873
- "aria-label": y,
874
- "aria-labelledby": y ? void 0 : $,
875
- children: /* @__PURE__ */ c(de.Provider, { value: { classes: m ?? {}, titleId: $ }, children: i })
873
+ "aria-label": v,
874
+ "aria-labelledby": v ? void 0 : $,
875
+ children: /* @__PURE__ */ c(de.Provider, { value: { classes: m ?? {}, titleId: $ }, children: a })
876
876
  }
877
877
  )
878
878
  }
@@ -884,8 +884,8 @@ const ue = W(
884
884
  ue.displayName = "Modal";
885
885
  ue.Header = be;
886
886
  ue.Body = ke;
887
- ue.Footer = ve;
888
- const Jt = "crk-root-jHIIP", Zt = "crk-formErrors-eh-OP", _t = "crk-formError-XEuWv", en = "crk-field-OUlYz", rn = "crk-label-udkR7", tn = "crk-labelError-LOgKi", nn = "crk-required-IYiA2", on = "crk-error-yFZXm", cn = "crk-helperText-Dm-rb", ln = "crk-row-nNbx-", G = {
887
+ ue.Footer = ye;
888
+ const Jt = "crk-root-jHIIP", Zt = "crk-formErrors-eh-OP", _t = "crk-formError-XEuWv", en = "crk-field-OUlYz", rn = "crk-label-udkR7", tn = "crk-labelError-LOgKi", nn = "crk-required-IYiA2", on = "crk-error-yFZXm", cn = "crk-helperText-Dm-rb", ln = "crk-row-nNbx-", V = {
889
889
  root: Jt,
890
890
  formErrors: Zt,
891
891
  formError: _t,
@@ -897,7 +897,7 @@ const Jt = "crk-root-jHIIP", Zt = "crk-formErrors-eh-OP", _t = "crk-formError-XE
897
897
  helperText: cn,
898
898
  row: ln
899
899
  };
900
- function Co({
900
+ function Do({
901
901
  form: e,
902
902
  onSubmit: r,
903
903
  errors: t,
@@ -905,20 +905,27 @@ function Co({
905
905
  style: o,
906
906
  children: m
907
907
  }) {
908
- const a = t && t.length > 0;
908
+ const i = t && t.length > 0;
909
909
  return /* @__PURE__ */ c(Ce, { ...e, children: /* @__PURE__ */ I(
910
910
  "form",
911
911
  {
912
912
  onSubmit: e.handleSubmit(r),
913
- className: l(G.root, n),
913
+ className: l(V.root, n),
914
914
  style: o,
915
915
  children: [
916
- a && /* @__PURE__ */ c("ul", { className: G.formErrors, role: "alert", children: t.map((h, i) => /* @__PURE__ */ c("li", { className: G.formError, children: h }, i)) }),
916
+ i && /* @__PURE__ */ c("ul", { className: V.formErrors, role: "alert", children: t.map((h, a) => /* @__PURE__ */ c("li", { className: V.formError, children: h }, a)) }),
917
917
  m
918
918
  ]
919
919
  }
920
920
  ) });
921
921
  }
922
+ const sn = /* @__PURE__ */ new Set([
923
+ "Select",
924
+ "NativeSelect",
925
+ "SearchableSelect",
926
+ "MultiSelect",
927
+ "Dropdown"
928
+ ]);
922
929
  function Ro({
923
930
  name: e,
924
931
  label: r,
@@ -926,59 +933,63 @@ function Ro({
926
933
  required: n,
927
934
  rules: o,
928
935
  classes: m,
929
- className: a,
936
+ className: i,
930
937
  style: h,
931
- children: i
938
+ children: a
932
939
  }) {
933
- const { control: y } = Re(), { field: u, fieldState: g } = De({ name: e, control: y, rules: o }), { ref: v, ...b } = u, p = O(v);
934
- p.current = v;
935
- const $ = L(
936
- (w) => {
937
- if (w) {
938
- const R = w.matches("input, select, textarea, button, [tabindex]") ? w : w.querySelector('input, select, textarea, button, [tabindex]:not([tabindex="-1"])');
939
- p.current(R ?? w);
940
+ const { control: v } = De(), { field: u, fieldState: f } = Re({ name: e, control: v, rules: o }), y = a.type, b = typeof y == "string" ? "" : y?.displayName ?? y?.name ?? "", g = sn.has(b), { ref: $, ...w } = u, C = O($);
941
+ C.current = $;
942
+ const D = L(
943
+ (x) => {
944
+ if (x) {
945
+ const E = x.matches("input, select, textarea, button, [tabindex]") ? x : x.querySelector('input, select, textarea, button, [tabindex]:not([tabindex="-1"])');
946
+ C.current(E ?? x);
940
947
  } else
941
- p.current(null);
948
+ C.current(null);
942
949
  },
943
950
  // eslint-disable-next-line react-hooks/exhaustive-deps
944
951
  []
945
952
  );
946
- return /* @__PURE__ */ I("div", { className: l(G.field, m?.field, a), style: h, children: [
947
- r && /* @__PURE__ */ I("label", { className: l(G.label, g.error && G.labelError, m?.label), htmlFor: e, children: [
953
+ return /* @__PURE__ */ I("div", { className: l(V.field, m?.field, i), style: h, children: [
954
+ r && /* @__PURE__ */ I("label", { className: l(V.label, f.error && V.labelError, m?.label), htmlFor: e, children: [
948
955
  r,
949
- n && /* @__PURE__ */ c("span", { className: G.required, children: "*" })
956
+ n && /* @__PURE__ */ c("span", { className: V.required, children: "*" })
950
957
  ] }),
951
- $e(i, {
952
- ...b,
953
- ref: $,
958
+ $e(a, {
959
+ ...w,
960
+ ref: D,
954
961
  id: e,
955
- error: !!g.error,
956
- "aria-invalid": g.error ? !0 : void 0,
957
- "aria-describedby": g.error?.message ? `${e}-error` : t ? `${e}-helper` : void 0,
958
- // Bridge for custom components that use onValueChange/onValuesChange
959
- onValueChange: b.onChange,
960
- onValuesChange: b.onChange,
962
+ error: !!f.error,
963
+ "aria-invalid": f.error ? !0 : void 0,
964
+ "aria-describedby": f.error?.message ? `${e}-error` : t ? `${e}-helper` : void 0,
965
+ // Bridge for custom components that use onValueChange/onValuesChange (Select, Dropdown).
966
+ // Skip for native-input wrappers (Input, Textarea, Checkbox, Radio) so the unknown
967
+ // handler doesn't leak onto the DOM and trip React's "Unknown event handler" warning.
968
+ ...g && {
969
+ onValueChange: w.onChange,
970
+ onValuesChange: w.onChange
971
+ },
961
972
  // Bridge for Checkbox (expects checked, not value)
962
- checked: typeof b.value == "boolean" ? b.value : void 0
973
+ checked: typeof w.value == "boolean" ? w.value : void 0
963
974
  }),
964
- g.error?.message ? /* @__PURE__ */ c("span", { id: `${e}-error`, className: l(G.error, m?.error), role: "alert", children: g.error.message }) : t ? /* @__PURE__ */ c("span", { id: `${e}-helper`, className: l(G.helperText, m?.helperText), children: t }) : null
975
+ f.error?.message ? /* @__PURE__ */ c("span", { id: `${e}-error`, className: l(V.error, m?.error), role: "alert", children: f.error.message }) : t ? /* @__PURE__ */ c("span", { id: `${e}-helper`, className: l(V.helperText, m?.helperText), children: t }) : null
965
976
  ] });
966
977
  }
967
- function Do({ children: e, className: r, style: t }) {
968
- return /* @__PURE__ */ c("div", { className: l(G.row, r), style: t, children: e });
978
+ function Eo({ children: e, className: r, style: t }) {
979
+ return /* @__PURE__ */ c("div", { className: l(V.row, r), style: t, children: e });
969
980
  }
970
- const sn = "crk-root-rSgdy", an = "crk-wrapper-GHy8V", dn = "crk-sm-DptM5", un = "crk-md-F4B0G", mn = "crk-lg-pBxwX", hn = "crk-error-fucxe", pn = "crk-prefix-w53Md", fn = "crk-suffix-fcNgR", gn = "crk-hasPrefix--bqPD", bn = "crk-hasSuffix-zO0nX", U = {
971
- root: sn,
972
- wrapper: an,
973
- sm: dn,
974
- md: un,
975
- lg: mn,
976
- error: hn,
977
- prefix: pn,
978
- suffix: fn,
979
- hasPrefix: gn,
980
- hasSuffix: bn
981
- }, kn = W(
981
+ const an = "crk-root-rSgdy", dn = "crk-wrapper-GHy8V", un = "crk-sm-DptM5", mn = "crk-md-F4B0G", hn = "crk-lg-pBxwX", pn = "crk-error-fucxe", fn = "crk-prefix-w53Md", gn = "crk-suffix-fcNgR", bn = "crk-hasPrefix--bqPD", kn = "crk-hasSuffix-zO0nX", K = {
982
+ root: an,
983
+ wrapper: dn,
984
+ sm: un,
985
+ md: mn,
986
+ lg: hn,
987
+ error: pn,
988
+ prefix: fn,
989
+ suffix: gn,
990
+ hasPrefix: bn,
991
+ hasSuffix: kn
992
+ }, yn = W(
982
993
  ({
983
994
  inputSize: e = "md",
984
995
  error: r = !1,
@@ -986,75 +997,75 @@ const sn = "crk-root-rSgdy", an = "crk-wrapper-GHy8V", dn = "crk-sm-DptM5", un =
986
997
  suffix: n,
987
998
  classes: o,
988
999
  className: m,
989
- style: a,
1000
+ style: i,
990
1001
  ...h
991
- }, i) => {
992
- const y = /* @__PURE__ */ c(
1002
+ }, a) => {
1003
+ const v = /* @__PURE__ */ c(
993
1004
  "input",
994
1005
  {
995
- ref: i,
1006
+ ref: a,
996
1007
  className: l(
997
- U.root,
998
- U[e],
999
- r && U.error,
1000
- t && U.hasPrefix,
1001
- n && U.hasSuffix,
1008
+ K.root,
1009
+ K[e],
1010
+ r && K.error,
1011
+ t && K.hasPrefix,
1012
+ n && K.hasSuffix,
1002
1013
  o?.root,
1003
1014
  !t && !n && m
1004
1015
  ),
1005
- style: !t && !n ? a : void 0,
1016
+ style: !t && !n ? i : void 0,
1006
1017
  ...h
1007
1018
  }
1008
1019
  );
1009
1020
  return t || n ? /* @__PURE__ */ I(
1010
1021
  "div",
1011
1022
  {
1012
- className: l(U.wrapper, U[e], r && U.error, o?.wrapper, m),
1013
- style: a,
1023
+ className: l(K.wrapper, K[e], r && K.error, o?.wrapper, m),
1024
+ style: i,
1014
1025
  children: [
1015
- t && /* @__PURE__ */ c("span", { className: l(U.prefix, o?.prefix), children: t }),
1016
- y,
1017
- n && /* @__PURE__ */ c("span", { className: l(U.suffix, o?.suffix), children: n })
1026
+ t && /* @__PURE__ */ c("span", { className: l(K.prefix, o?.prefix), children: t }),
1027
+ v,
1028
+ n && /* @__PURE__ */ c("span", { className: l(K.suffix, o?.suffix), children: n })
1018
1029
  ]
1019
1030
  }
1020
- ) : y;
1031
+ ) : v;
1021
1032
  }
1022
1033
  );
1023
- kn.displayName = "Input";
1024
- const vn = "crk-wrapper-SP2JE", yn = "crk-sm-DqshL", Nn = "crk-md-j4AKI", wn = "crk-lg-24Xd3", xn = "crk-root-Uu9Ah", Sn = "crk-error-9oRU6", In = "crk-arrow-WU8ZW", $n = "crk-searchableWrapper-7AL4l", Cn = "crk-hiddenSelect-s3DEx", Rn = "crk-searchableTrigger-m-GWV", Dn = "crk-triggerOpen-Lo8-j", En = "crk-triggerLabel-5rETZ", Ln = "crk-placeholder-teBBh", Bn = "crk-arrowInline-m-roG", Tn = "crk-disabled-pcSeq", An = "crk-visuallyHidden-2tTD5", On = "crk-menu--i-je", Pn = "crk-menuEnter-vJjLV", Mn = "crk-menuItems-VrZnE", Wn = "crk-item-fU3XI", Hn = "crk-itemHighlighted-MvR41", qn = "crk-itemDisabled-KTUO8", Fn = "crk-itemSelected-42-BG", jn = "crk-noResults-uicSW", zn = "crk-multiTrigger-Pd3wJ", Kn = "crk-multiTriggerDisabled-9ajge", Un = "crk-chip-TuYUB", Gn = "crk-chipLabel-H4JWu", Vn = "crk-chipRemove-Lfk0R", Qn = "crk-multiSearch-OrVeS", Xn = "crk-arrowMulti-Nh9Hr", Yn = "crk-itemCheck-DPB5A", d = {
1034
+ yn.displayName = "Input";
1035
+ const vn = "crk-wrapper-SP2JE", Nn = "crk-sm-DqshL", wn = "crk-md-j4AKI", xn = "crk-lg-24Xd3", Sn = "crk-root-Uu9Ah", In = "crk-error-9oRU6", $n = "crk-arrow-WU8ZW", Cn = "crk-searchableWrapper-7AL4l", Dn = "crk-hiddenSelect-s3DEx", Rn = "crk-searchableTrigger-m-GWV", En = "crk-triggerOpen-Lo8-j", Ln = "crk-triggerLabel-5rETZ", Bn = "crk-placeholder-teBBh", Tn = "crk-arrowInline-m-roG", An = "crk-disabled-pcSeq", On = "crk-visuallyHidden-2tTD5", Pn = "crk-menu--i-je", Mn = "crk-menuEnter-vJjLV", Wn = "crk-menuItems-VrZnE", Hn = "crk-item-fU3XI", qn = "crk-itemHighlighted-MvR41", Fn = "crk-itemDisabled-KTUO8", jn = "crk-itemSelected-42-BG", zn = "crk-noResults-uicSW", Un = "crk-multiTrigger-Pd3wJ", Kn = "crk-multiTriggerDisabled-9ajge", Vn = "crk-chip-TuYUB", Gn = "crk-chipLabel-H4JWu", Qn = "crk-chipRemove-Lfk0R", Xn = "crk-multiSearch-OrVeS", Yn = "crk-arrowMulti-Nh9Hr", Jn = "crk-itemCheck-DPB5A", d = {
1025
1036
  wrapper: vn,
1026
- sm: yn,
1027
- md: Nn,
1028
- lg: wn,
1029
- root: xn,
1030
- error: Sn,
1031
- arrow: In,
1032
- searchableWrapper: $n,
1033
- hiddenSelect: Cn,
1037
+ sm: Nn,
1038
+ md: wn,
1039
+ lg: xn,
1040
+ root: Sn,
1041
+ error: In,
1042
+ arrow: $n,
1043
+ searchableWrapper: Cn,
1044
+ hiddenSelect: Dn,
1034
1045
  searchableTrigger: Rn,
1035
- triggerOpen: Dn,
1036
- triggerLabel: En,
1037
- placeholder: Ln,
1038
- arrowInline: Bn,
1039
- disabled: Tn,
1040
- visuallyHidden: An,
1041
- menu: On,
1042
- menuEnter: Pn,
1043
- menuItems: Mn,
1044
- item: Wn,
1045
- itemHighlighted: Hn,
1046
- itemDisabled: qn,
1047
- itemSelected: Fn,
1048
- noResults: jn,
1049
- multiTrigger: zn,
1046
+ triggerOpen: En,
1047
+ triggerLabel: Ln,
1048
+ placeholder: Bn,
1049
+ arrowInline: Tn,
1050
+ disabled: An,
1051
+ visuallyHidden: On,
1052
+ menu: Pn,
1053
+ menuEnter: Mn,
1054
+ menuItems: Wn,
1055
+ item: Hn,
1056
+ itemHighlighted: qn,
1057
+ itemDisabled: Fn,
1058
+ itemSelected: jn,
1059
+ noResults: zn,
1060
+ multiTrigger: Un,
1050
1061
  multiTriggerDisabled: Kn,
1051
- chip: Un,
1062
+ chip: Vn,
1052
1063
  chipLabel: Gn,
1053
- chipRemove: Vn,
1054
- multiSearch: Qn,
1055
- arrowMulti: Xn,
1056
- itemCheck: Yn
1057
- }, ye = W(
1064
+ chipRemove: Qn,
1065
+ multiSearch: Xn,
1066
+ arrowMulti: Yn,
1067
+ itemCheck: Jn
1068
+ }, ve = W(
1058
1069
  ({
1059
1070
  inputSize: e = "md",
1060
1071
  error: r = !1,
@@ -1062,19 +1073,19 @@ const vn = "crk-wrapper-SP2JE", yn = "crk-sm-DqshL", Nn = "crk-md-j4AKI", wn = "
1062
1073
  placeholder: n,
1063
1074
  classes: o,
1064
1075
  className: m,
1065
- style: a,
1076
+ style: i,
1066
1077
  children: h,
1067
- searchable: i,
1068
- searchPlaceholder: y,
1078
+ searchable: a,
1079
+ searchPlaceholder: v,
1069
1080
  onValueChange: u,
1070
- ...g
1071
- }, v) => /* @__PURE__ */ I("div", { className: l(d.wrapper, d[e], r && d.error, o?.wrapper, m), style: a, children: [
1081
+ ...f
1082
+ }, y) => /* @__PURE__ */ I("div", { className: l(d.wrapper, d[e], r && d.error, o?.wrapper, m), style: i, children: [
1072
1083
  /* @__PURE__ */ I(
1073
1084
  "select",
1074
1085
  {
1075
- ref: v,
1086
+ ref: y,
1076
1087
  className: l(d.root, d[e], r && d.error, o?.root),
1077
- ...g,
1088
+ ...f,
1078
1089
  children: [
1079
1090
  n && /* @__PURE__ */ c("option", { value: "", disabled: !0, children: n }),
1080
1091
  t ? t.map((b) => /* @__PURE__ */ c("option", { value: b.value, disabled: b.disabled, children: b.label }, b.value)) : h
@@ -1084,7 +1095,7 @@ const vn = "crk-wrapper-SP2JE", yn = "crk-sm-DqshL", Nn = "crk-md-j4AKI", wn = "
1084
1095
  /* @__PURE__ */ c("span", { className: l(d.arrow, o?.arrow) })
1085
1096
  ] })
1086
1097
  );
1087
- ye.displayName = "NativeSelect";
1098
+ ve.displayName = "NativeSelect";
1088
1099
  const Ne = W(
1089
1100
  ({
1090
1101
  inputSize: e = "md",
@@ -1093,35 +1104,35 @@ const Ne = W(
1093
1104
  placeholder: n = "Select...",
1094
1105
  classes: o,
1095
1106
  className: m,
1096
- style: a,
1107
+ style: i,
1097
1108
  value: h,
1098
- disabled: i,
1099
- id: y,
1109
+ disabled: a,
1110
+ id: v,
1100
1111
  searchPlaceholder: u = "Search...",
1101
- onChange: g,
1102
- onValueChange: v
1112
+ onChange: f,
1113
+ onValueChange: y
1103
1114
  }, b) => {
1104
- const [p, $] = X(!1), [w, R] = X(""), [D, S] = X(0), E = O(null), K = O(null), q = O(null), V = O(null), j = ne(), Y = O(null), k = b ?? Y, P = O(!1);
1115
+ const [g, $] = X(!1), [w, C] = X(""), [D, x] = X(0), E = O(null), U = O(null), q = O(null), G = O(null), j = ne(), Y = O(null), k = b ?? Y, P = O(!1);
1105
1116
  F(() => {
1106
- P.current && !p && q.current?.focus(), P.current = p;
1107
- }, [p]);
1108
- const x = L(() => {
1109
- $(!1), R(""), S(0);
1117
+ P.current && !g && q.current?.focus(), P.current = g;
1118
+ }, [g]);
1119
+ const S = L(() => {
1120
+ $(!1), C(""), x(0);
1110
1121
  }, []), B = L(() => {
1111
- i || ($(!0), R(""), S(0), setTimeout(() => K.current?.focus(), 0));
1112
- }, [i]), z = L(
1122
+ a || ($(!0), C(""), x(0), setTimeout(() => U.current?.focus(), 0));
1123
+ }, [a]), z = L(
1113
1124
  (s) => {
1114
- if (v?.(s), k.current) {
1125
+ if (y?.(s), k.current) {
1115
1126
  Object.getOwnPropertyDescriptor(
1116
1127
  HTMLSelectElement.prototype,
1117
1128
  "value"
1118
1129
  )?.set?.call(k.current, s);
1119
1130
  const T = new Event("change", { bubbles: !0 });
1120
- k.current.dispatchEvent(T), g?.(T);
1131
+ k.current.dispatchEvent(T), f?.(T);
1121
1132
  }
1122
- x();
1133
+ S();
1123
1134
  },
1124
- [v, g, k, x]
1135
+ [y, f, k, S]
1125
1136
  ), A = ee(() => {
1126
1137
  if (!w) return t;
1127
1138
  const s = w.toLowerCase();
@@ -1129,24 +1140,24 @@ const Ne = W(
1129
1140
  }, [t, w]);
1130
1141
  F(() => {
1131
1142
  const s = A.findIndex((N) => !N.disabled);
1132
- S(s >= 0 ? s : 0);
1143
+ x(s >= 0 ? s : 0);
1133
1144
  }, [A]), F(() => {
1134
- if (!p) return;
1135
- const s = V.current;
1145
+ if (!g) return;
1146
+ const s = G.current;
1136
1147
  if (!s) return;
1137
1148
  s.querySelectorAll('[role="option"]')[D]?.scrollIntoView?.({ block: "nearest" });
1138
- }, [D, p]);
1149
+ }, [D, g]);
1139
1150
  const Z = L(
1140
1151
  (s) => {
1141
1152
  const N = A.map((T, Q) => T.disabled ? -1 : Q).filter((T) => T >= 0);
1142
1153
  if (N.length !== 0)
1143
1154
  if (s.key === "ArrowDown")
1144
- s.preventDefault(), S((T) => {
1155
+ s.preventDefault(), x((T) => {
1145
1156
  const Q = N.indexOf(T);
1146
1157
  return Q < N.length - 1 ? N[Q + 1] : N[0];
1147
1158
  });
1148
1159
  else if (s.key === "ArrowUp")
1149
- s.preventDefault(), S((T) => {
1160
+ s.preventDefault(), x((T) => {
1150
1161
  const Q = N.indexOf(T);
1151
1162
  return Q > 0 ? N[Q - 1] : N[N.length - 1];
1152
1163
  });
@@ -1154,12 +1165,12 @@ const Ne = W(
1154
1165
  s.preventDefault();
1155
1166
  const T = A[D];
1156
1167
  T && !T.disabled && z(T.value);
1157
- } else s.key === "Escape" && (s.preventDefault(), x());
1168
+ } else s.key === "Escape" && (s.preventDefault(), S());
1158
1169
  },
1159
- [A, D, z, x]
1170
+ [A, D, z, S]
1160
1171
  );
1161
- ie(E, x, p);
1162
- const re = t.find((s) => s.value === h)?.label, f = A.filter((s) => !s.disabled);
1172
+ ie(E, S, g);
1173
+ const re = t.find((s) => s.value === h)?.label, p = A.filter((s) => !s.disabled);
1163
1174
  return /* @__PURE__ */ I(
1164
1175
  "div",
1165
1176
  {
@@ -1169,11 +1180,11 @@ const Ne = W(
1169
1180
  d.searchableWrapper,
1170
1181
  d[e],
1171
1182
  r && d.error,
1172
- i && d.disabled,
1183
+ a && d.disabled,
1173
1184
  o?.wrapper,
1174
1185
  m
1175
1186
  ),
1176
- style: a,
1187
+ style: i,
1177
1188
  children: [
1178
1189
  /* @__PURE__ */ c(
1179
1190
  "select",
@@ -1181,7 +1192,7 @@ const Ne = W(
1181
1192
  ref: k,
1182
1193
  className: d.hiddenSelect,
1183
1194
  value: h ?? "",
1184
- disabled: i,
1195
+ disabled: a,
1185
1196
  tabIndex: -1,
1186
1197
  "aria-hidden": "true",
1187
1198
  onChange: () => {
@@ -1193,32 +1204,32 @@ const Ne = W(
1193
1204
  "button",
1194
1205
  {
1195
1206
  ref: q,
1196
- id: y,
1207
+ id: v,
1197
1208
  type: "button",
1198
1209
  className: l(
1199
1210
  d.root,
1200
1211
  d.searchableTrigger,
1201
1212
  d[e],
1202
- p && d.triggerOpen,
1213
+ g && d.triggerOpen,
1203
1214
  r && d.error,
1204
- p && d.visuallyHidden,
1215
+ g && d.visuallyHidden,
1205
1216
  o?.root
1206
1217
  ),
1207
1218
  onClick: B,
1208
- disabled: i,
1209
- "aria-expanded": p,
1219
+ disabled: a,
1220
+ "aria-expanded": g,
1210
1221
  "aria-haspopup": "listbox",
1211
- "aria-controls": p ? j : void 0,
1222
+ "aria-controls": g ? j : void 0,
1212
1223
  children: [
1213
1224
  /* @__PURE__ */ c("span", { className: l(d.triggerLabel, !re && d.placeholder), children: re || n }),
1214
1225
  /* @__PURE__ */ c("span", { className: l(d.arrow, d.arrowInline, o?.arrow) })
1215
1226
  ]
1216
1227
  }
1217
1228
  ),
1218
- p && /* @__PURE__ */ c(
1229
+ g && /* @__PURE__ */ c(
1219
1230
  "input",
1220
1231
  {
1221
- ref: K,
1232
+ ref: U,
1222
1233
  type: "text",
1223
1234
  role: "combobox",
1224
1235
  className: l(
@@ -1232,15 +1243,15 @@ const Ne = W(
1232
1243
  ),
1233
1244
  placeholder: re || n,
1234
1245
  value: w,
1235
- onChange: (s) => R(s.target.value),
1246
+ onChange: (s) => C(s.target.value),
1236
1247
  onKeyDown: Z,
1237
1248
  "aria-expanded": !0,
1238
1249
  "aria-haspopup": "listbox",
1239
1250
  "aria-controls": j,
1240
- "aria-activedescendant": f.length > 0 ? `select-option-${A[D]?.value}` : void 0
1251
+ "aria-activedescendant": p.length > 0 ? `select-option-${A[D]?.value}` : void 0
1241
1252
  }
1242
1253
  ),
1243
- p && /* @__PURE__ */ c("div", { id: j, className: l(d.menu, o?.menu), role: "listbox", children: /* @__PURE__ */ c("div", { className: d.menuItems, ref: V, children: A.length === 0 ? /* @__PURE__ */ c("div", { className: d.noResults, children: "No results" }) : A.map((s, N) => /* @__PURE__ */ c(
1254
+ g && /* @__PURE__ */ c("div", { id: j, className: l(d.menu, o?.menu), role: "listbox", children: /* @__PURE__ */ c("div", { className: d.menuItems, ref: G, children: A.length === 0 ? /* @__PURE__ */ c("div", { className: d.noResults, children: "No results" }) : A.map((s, N) => /* @__PURE__ */ c(
1244
1255
  "button",
1245
1256
  {
1246
1257
  id: `select-option-${s.value}`,
@@ -1256,7 +1267,7 @@ const Ne = W(
1256
1267
  ),
1257
1268
  disabled: s.disabled,
1258
1269
  onClick: () => z(s.value),
1259
- onMouseEnter: () => S(N),
1270
+ onMouseEnter: () => x(N),
1260
1271
  children: s.content ?? s.label
1261
1272
  },
1262
1273
  s.value
@@ -1275,89 +1286,89 @@ const we = W(
1275
1286
  placeholder: n = "Select...",
1276
1287
  classes: o,
1277
1288
  className: m,
1278
- style: a,
1289
+ style: i,
1279
1290
  value: h,
1280
- disabled: i,
1281
- id: y,
1291
+ disabled: a,
1292
+ id: v,
1282
1293
  searchPlaceholder: u,
1283
- onValuesChange: g,
1284
- clearSearchOnSelect: v = !0
1294
+ onValuesChange: f,
1295
+ clearSearchOnSelect: y = !0
1285
1296
  }, b) => {
1286
- const p = Array.isArray(h) ? h : h ? [h] : [], [$, w] = X(!1), [R, D] = X(""), [S, E] = X(0), K = O(null), q = O(null), V = O(null), j = ne(), Y = O(null), k = b ?? Y, P = L(() => {
1297
+ const g = Array.isArray(h) ? h : h ? [h] : [], [$, w] = X(!1), [C, D] = X(""), [x, E] = X(0), U = O(null), q = O(null), G = O(null), j = ne(), Y = O(null), k = b ?? Y, P = L(() => {
1287
1298
  w(!1), D(""), E(0);
1288
- }, []), x = L(() => {
1289
- i || (w(!0), D(""), E(0), setTimeout(() => q.current?.focus(), 0));
1290
- }, [i]), B = L(
1291
- (f) => {
1292
- const s = p.includes(f) ? p.filter((N) => N !== f) : [...p, f];
1293
- g?.(s), v && D("");
1299
+ }, []), S = L(() => {
1300
+ a || (w(!0), D(""), E(0), setTimeout(() => q.current?.focus(), 0));
1301
+ }, [a]), B = L(
1302
+ (p) => {
1303
+ const s = g.includes(p) ? g.filter((N) => N !== p) : [...g, p];
1304
+ f?.(s), y && D("");
1294
1305
  },
1295
- [p, g, v]
1306
+ [g, f, y]
1296
1307
  ), z = L(
1297
- (f, s) => {
1298
- s.stopPropagation(), g?.(p.filter((N) => N !== f));
1308
+ (p, s) => {
1309
+ s.stopPropagation(), f?.(g.filter((N) => N !== p));
1299
1310
  },
1300
- [p, g]
1311
+ [g, f]
1301
1312
  ), A = ee(() => {
1302
- if (!R) return t;
1303
- const f = R.toLowerCase();
1304
- return t.filter((s) => s.label.toLowerCase().includes(f));
1305
- }, [t, R]);
1313
+ if (!C) return t;
1314
+ const p = C.toLowerCase();
1315
+ return t.filter((s) => s.label.toLowerCase().includes(p));
1316
+ }, [t, C]);
1306
1317
  F(() => {
1307
- const f = A.findIndex((s) => !s.disabled);
1308
- E(f >= 0 ? f : 0);
1318
+ const p = A.findIndex((s) => !s.disabled);
1319
+ E(p >= 0 ? p : 0);
1309
1320
  }, [A]), F(() => {
1310
1321
  if (!$) return;
1311
- const f = V.current;
1312
- if (!f) return;
1313
- f.querySelectorAll('[role="option"]')[S]?.scrollIntoView?.({ block: "nearest" });
1314
- }, [S, $]);
1322
+ const p = G.current;
1323
+ if (!p) return;
1324
+ p.querySelectorAll('[role="option"]')[x]?.scrollIntoView?.({ block: "nearest" });
1325
+ }, [x, $]);
1315
1326
  const Z = L(
1316
- (f) => {
1327
+ (p) => {
1317
1328
  const s = A.map((N, T) => N.disabled ? -1 : T).filter((N) => N >= 0);
1318
- if (f.key === "Backspace" && R === "" && p.length > 0) {
1319
- f.preventDefault(), g?.(p.slice(0, -1));
1329
+ if (p.key === "Backspace" && C === "" && g.length > 0) {
1330
+ p.preventDefault(), f?.(g.slice(0, -1));
1320
1331
  return;
1321
1332
  }
1322
1333
  if (s.length !== 0)
1323
- if (f.key === "ArrowDown") {
1324
- if (f.preventDefault(), !$) {
1325
- x();
1334
+ if (p.key === "ArrowDown") {
1335
+ if (p.preventDefault(), !$) {
1336
+ S();
1326
1337
  return;
1327
1338
  }
1328
1339
  E((N) => {
1329
1340
  const T = s.indexOf(N);
1330
1341
  return T < s.length - 1 ? s[T + 1] : s[0];
1331
1342
  });
1332
- } else if (f.key === "ArrowUp")
1333
- f.preventDefault(), E((N) => {
1343
+ } else if (p.key === "ArrowUp")
1344
+ p.preventDefault(), E((N) => {
1334
1345
  const T = s.indexOf(N);
1335
1346
  return T > 0 ? s[T - 1] : s[s.length - 1];
1336
1347
  });
1337
- else if (f.key === "Enter") {
1338
- f.preventDefault();
1339
- const N = A[S];
1348
+ else if (p.key === "Enter") {
1349
+ p.preventDefault();
1350
+ const N = A[x];
1340
1351
  N && !N.disabled && B(N.value);
1341
- } else f.key === "Escape" && (f.preventDefault(), P());
1352
+ } else p.key === "Escape" && (p.preventDefault(), P());
1342
1353
  },
1343
- [A, S, B, P, R, p, g, $, x]
1354
+ [A, x, B, P, C, g, f, $, S]
1344
1355
  );
1345
- ie(K, P, $);
1346
- const re = p.map((f) => t.find((s) => s.value === f)).filter((f) => !!f);
1356
+ ie(U, P, $);
1357
+ const re = g.map((p) => t.find((s) => s.value === p)).filter((p) => !!p);
1347
1358
  return /* @__PURE__ */ I(
1348
1359
  "div",
1349
1360
  {
1350
- ref: K,
1361
+ ref: U,
1351
1362
  className: l(
1352
1363
  d.wrapper,
1353
1364
  d.searchableWrapper,
1354
1365
  d[e],
1355
1366
  r && d.error,
1356
- i && d.disabled,
1367
+ a && d.disabled,
1357
1368
  o?.wrapper,
1358
1369
  m
1359
1370
  ),
1360
- style: a,
1371
+ style: i,
1361
1372
  children: [
1362
1373
  /* @__PURE__ */ c(
1363
1374
  "select",
@@ -1365,13 +1376,13 @@ const we = W(
1365
1376
  ref: k,
1366
1377
  className: d.hiddenSelect,
1367
1378
  multiple: !0,
1368
- value: p,
1369
- disabled: i,
1379
+ value: g,
1380
+ disabled: a,
1370
1381
  tabIndex: -1,
1371
1382
  "aria-hidden": "true",
1372
1383
  onChange: () => {
1373
1384
  },
1374
- children: t.map((f) => /* @__PURE__ */ c("option", { value: f.value, children: f.label }, f.value))
1385
+ children: t.map((p) => /* @__PURE__ */ c("option", { value: p.value, children: p.label }, p.value))
1375
1386
  }
1376
1387
  ),
1377
1388
  /* @__PURE__ */ I(
@@ -1382,45 +1393,45 @@ const we = W(
1382
1393
  d[e],
1383
1394
  $ && d.triggerOpen,
1384
1395
  r && d.error,
1385
- i && d.multiTriggerDisabled,
1396
+ a && d.multiTriggerDisabled,
1386
1397
  o?.root
1387
1398
  ),
1388
1399
  onClick: () => {
1389
- $ ? q.current?.focus() : x();
1400
+ $ ? q.current?.focus() : S();
1390
1401
  },
1391
1402
  role: "combobox",
1392
1403
  "aria-expanded": $,
1393
1404
  "aria-haspopup": "listbox",
1394
1405
  "aria-controls": $ ? j : void 0,
1395
1406
  children: [
1396
- re.map((f) => /* @__PURE__ */ I("span", { className: l(d.chip, o?.chip), children: [
1397
- /* @__PURE__ */ c("span", { className: d.chipLabel, children: f.content ?? f.label }),
1407
+ re.map((p) => /* @__PURE__ */ I("span", { className: l(d.chip, o?.chip), children: [
1408
+ /* @__PURE__ */ c("span", { className: d.chipLabel, children: p.content ?? p.label }),
1398
1409
  /* @__PURE__ */ c(
1399
1410
  "button",
1400
1411
  {
1401
1412
  type: "button",
1402
1413
  className: l(d.chipRemove, o?.chipRemove),
1403
- onClick: (s) => z(f.value, s),
1404
- "aria-label": `Remove ${f.label}`,
1414
+ onClick: (s) => z(p.value, s),
1415
+ "aria-label": `Remove ${p.label}`,
1405
1416
  tabIndex: -1,
1406
1417
  children: "×"
1407
1418
  }
1408
1419
  )
1409
- ] }, f.value)),
1420
+ ] }, p.value)),
1410
1421
  /* @__PURE__ */ c(
1411
1422
  "input",
1412
1423
  {
1413
1424
  ref: q,
1414
- id: y,
1425
+ id: v,
1415
1426
  type: "text",
1416
1427
  className: d.multiSearch,
1417
- placeholder: p.length === 0 ? n : "",
1418
- value: R,
1419
- onChange: (f) => {
1420
- D(f.target.value), $ || x();
1428
+ placeholder: g.length === 0 ? n : "",
1429
+ value: C,
1430
+ onChange: (p) => {
1431
+ D(p.target.value), $ || S();
1421
1432
  },
1422
1433
  onKeyDown: Z,
1423
- disabled: i,
1434
+ disabled: a,
1424
1435
  "aria-label": "Search options"
1425
1436
  }
1426
1437
  ),
@@ -1428,31 +1439,31 @@ const we = W(
1428
1439
  ]
1429
1440
  }
1430
1441
  ),
1431
- $ && /* @__PURE__ */ c("div", { id: j, className: l(d.menu, o?.menu), role: "listbox", "aria-multiselectable": "true", children: /* @__PURE__ */ c("div", { className: d.menuItems, ref: V, children: A.length === 0 ? /* @__PURE__ */ c("div", { className: d.noResults, children: "No results" }) : A.map((f, s) => {
1432
- const N = p.includes(f.value);
1442
+ $ && /* @__PURE__ */ c("div", { id: j, className: l(d.menu, o?.menu), role: "listbox", "aria-multiselectable": "true", children: /* @__PURE__ */ c("div", { className: d.menuItems, ref: G, children: A.length === 0 ? /* @__PURE__ */ c("div", { className: d.noResults, children: "No results" }) : A.map((p, s) => {
1443
+ const N = g.includes(p.value);
1433
1444
  return /* @__PURE__ */ I(
1434
1445
  "button",
1435
1446
  {
1436
- id: `select-option-${f.value}`,
1447
+ id: `select-option-${p.value}`,
1437
1448
  type: "button",
1438
1449
  role: "option",
1439
1450
  "aria-selected": N,
1440
1451
  className: l(
1441
1452
  d.item,
1442
- f.disabled && d.itemDisabled,
1453
+ p.disabled && d.itemDisabled,
1443
1454
  N && d.itemSelected,
1444
- s === S && d.itemHighlighted,
1455
+ s === x && d.itemHighlighted,
1445
1456
  o?.item
1446
1457
  ),
1447
- disabled: f.disabled,
1448
- onClick: () => B(f.value),
1458
+ disabled: p.disabled,
1459
+ onClick: () => B(p.value),
1449
1460
  onMouseEnter: () => E(s),
1450
1461
  children: [
1451
1462
  N && /* @__PURE__ */ c("span", { className: d.itemCheck, "aria-hidden": "true" }),
1452
- f.content ?? f.label
1463
+ p.content ?? p.label
1453
1464
  ]
1454
1465
  },
1455
- f.value
1466
+ p.value
1456
1467
  );
1457
1468
  }) }) })
1458
1469
  ]
@@ -1461,16 +1472,16 @@ const we = W(
1461
1472
  }
1462
1473
  );
1463
1474
  we.displayName = "MultiSelect";
1464
- const Jn = W(
1465
- (e, r) => e.multiple ? /* @__PURE__ */ c(we, { ref: r, ...e }) : e.searchable ? /* @__PURE__ */ c(Ne, { ref: r, ...e }) : /* @__PURE__ */ c(ye, { ref: r, ...e })
1475
+ const Zn = W(
1476
+ (e, r) => e.multiple ? /* @__PURE__ */ c(we, { ref: r, ...e }) : e.searchable ? /* @__PURE__ */ c(Ne, { ref: r, ...e }) : /* @__PURE__ */ c(ve, { ref: r, ...e })
1466
1477
  );
1467
- Jn.displayName = "Select";
1468
- const Zn = "crk-root-61cKD", _n = "crk-input-bAjPU", eo = "crk-label-W9IeS", ro = "crk-indeterminate-mLarv", ce = {
1469
- root: Zn,
1470
- input: _n,
1471
- label: eo,
1472
- indeterminate: ro
1473
- }, to = W(
1478
+ Zn.displayName = "Select";
1479
+ const _n = "crk-root-61cKD", eo = "crk-input-bAjPU", ro = "crk-label-W9IeS", to = "crk-indeterminate-mLarv", ce = {
1480
+ root: _n,
1481
+ input: eo,
1482
+ label: ro,
1483
+ indeterminate: to
1484
+ }, no = W(
1474
1485
  ({
1475
1486
  label: e,
1476
1487
  indeterminate: r = !1,
@@ -1478,7 +1489,7 @@ const Zn = "crk-root-61cKD", _n = "crk-input-bAjPU", eo = "crk-label-W9IeS", ro
1478
1489
  className: n,
1479
1490
  style: o,
1480
1491
  ...m
1481
- }, a) => {
1492
+ }, i) => {
1482
1493
  const h = O(null);
1483
1494
  return F(() => {
1484
1495
  h.current && (h.current.indeterminate = r);
@@ -1491,8 +1502,8 @@ const Zn = "crk-root-61cKD", _n = "crk-input-bAjPU", eo = "crk-label-W9IeS", ro
1491
1502
  /* @__PURE__ */ c(
1492
1503
  "input",
1493
1504
  {
1494
- ref: (i) => {
1495
- h.current = i, typeof a == "function" ? a(i) : a && (a.current = i);
1505
+ ref: (a) => {
1506
+ h.current = a, typeof i == "function" ? i(a) : i && (i.current = a);
1496
1507
  },
1497
1508
  type: "checkbox",
1498
1509
  className: l(ce.input, t?.input),
@@ -1505,39 +1516,39 @@ const Zn = "crk-root-61cKD", _n = "crk-input-bAjPU", eo = "crk-label-W9IeS", ro
1505
1516
  );
1506
1517
  }
1507
1518
  );
1508
- to.displayName = "Checkbox";
1509
- const no = "crk-group-NNwCD", oo = "crk-root-7fGik", co = "crk-input-43PQW", lo = "crk-label-aW30x", se = {
1510
- group: no,
1511
- root: oo,
1512
- input: co,
1513
- label: lo
1514
- }, xe = fe(null), so = ({
1519
+ no.displayName = "Checkbox";
1520
+ const oo = "crk-group-NNwCD", co = "crk-root-7fGik", lo = "crk-input-43PQW", so = "crk-label-aW30x", se = {
1521
+ group: oo,
1522
+ root: co,
1523
+ input: lo,
1524
+ label: so
1525
+ }, xe = fe(null), ao = ({
1515
1526
  name: e,
1516
1527
  value: r,
1517
1528
  onChange: t,
1518
1529
  className: n,
1519
1530
  style: o,
1520
1531
  children: m,
1521
- id: a,
1532
+ id: i,
1522
1533
  "aria-label": h,
1523
- "aria-labelledby": i,
1524
- required: y
1534
+ "aria-labelledby": a,
1535
+ required: v
1525
1536
  }) => /* @__PURE__ */ c(xe.Provider, { value: { name: e, value: r, onChange: t }, children: /* @__PURE__ */ c(
1526
1537
  "div",
1527
1538
  {
1528
- id: a,
1539
+ id: i,
1529
1540
  className: l(se.group, n),
1530
1541
  style: o,
1531
1542
  role: "radiogroup",
1532
1543
  tabIndex: -1,
1533
1544
  "aria-label": h,
1534
- "aria-labelledby": i,
1535
- "aria-required": y || void 0,
1545
+ "aria-labelledby": a,
1546
+ "aria-required": v || void 0,
1536
1547
  children: m
1537
1548
  }
1538
1549
  ) });
1539
- so.displayName = "RadioGroup";
1540
- const ao = W(
1550
+ ao.displayName = "RadioGroup";
1551
+ const io = W(
1541
1552
  ({
1542
1553
  label: e,
1543
1554
  value: r,
@@ -1545,49 +1556,49 @@ const ao = W(
1545
1556
  className: n,
1546
1557
  style: o,
1547
1558
  onChange: m,
1548
- checked: a,
1559
+ checked: i,
1549
1560
  name: h,
1550
- ...i
1551
- }, y) => {
1552
- const u = ae(xe), g = u?.name ?? h, v = u ? u.value === r : a, b = (p) => {
1553
- u?.onChange?.(r), m?.(p);
1561
+ ...a
1562
+ }, v) => {
1563
+ const u = ae(xe), f = u?.name ?? h, y = u ? u.value === r : i, b = (g) => {
1564
+ u?.onChange?.(r), m?.(g);
1554
1565
  };
1555
1566
  return /* @__PURE__ */ I("label", { className: l(se.root, t?.root, n), style: o, children: [
1556
1567
  /* @__PURE__ */ c(
1557
1568
  "input",
1558
1569
  {
1559
- ref: y,
1570
+ ref: v,
1560
1571
  type: "radio",
1561
1572
  className: l(se.input, t?.input),
1562
- name: g,
1573
+ name: f,
1563
1574
  value: r,
1564
- checked: v,
1575
+ checked: y,
1565
1576
  onChange: b,
1566
- ...i
1577
+ ...a
1567
1578
  }
1568
1579
  ),
1569
1580
  e && /* @__PURE__ */ c("span", { className: l(se.label, t?.label), children: e })
1570
1581
  ] });
1571
1582
  }
1572
1583
  );
1573
- ao.displayName = "Radio";
1574
- const io = "crk-root-IGgdn", uo = "crk-sm-N-5I2", mo = "crk-md-bbyFl", ho = "crk-lg-Pd-Iq", po = "crk-error-fyu3i", fo = "crk-resizeNone-SmNT4", go = "crk-resizeVertical-oi8vP", bo = "crk-resizeHorizontal-riMLL", ko = "crk-resizeBoth-NYSh4", vo = "crk-autoExpand-JWone", te = {
1575
- root: io,
1576
- sm: uo,
1577
- md: mo,
1578
- lg: ho,
1579
- error: po,
1580
- resizeNone: fo,
1581
- resizeVertical: go,
1582
- resizeHorizontal: bo,
1583
- resizeBoth: ko,
1584
+ io.displayName = "Radio";
1585
+ const uo = "crk-root-IGgdn", mo = "crk-sm-N-5I2", ho = "crk-md-bbyFl", po = "crk-lg-Pd-Iq", fo = "crk-error-fyu3i", go = "crk-resizeNone-SmNT4", bo = "crk-resizeVertical-oi8vP", ko = "crk-resizeHorizontal-riMLL", yo = "crk-resizeBoth-NYSh4", vo = "crk-autoExpand-JWone", te = {
1586
+ root: uo,
1587
+ sm: mo,
1588
+ md: ho,
1589
+ lg: po,
1590
+ error: fo,
1591
+ resizeNone: go,
1592
+ resizeVertical: bo,
1593
+ resizeHorizontal: ko,
1594
+ resizeBoth: yo,
1584
1595
  autoExpand: vo
1585
- }, yo = {
1596
+ }, No = {
1586
1597
  none: "resizeNone",
1587
1598
  vertical: "resizeVertical",
1588
1599
  horizontal: "resizeHorizontal",
1589
1600
  both: "resizeBoth"
1590
- }, No = W(
1601
+ }, wo = W(
1591
1602
  ({
1592
1603
  inputSize: e = "md",
1593
1604
  error: r = !1,
@@ -1595,63 +1606,63 @@ const io = "crk-root-IGgdn", uo = "crk-sm-N-5I2", mo = "crk-md-bbyFl", ho = "crk
1595
1606
  autoExpand: n = !0,
1596
1607
  className: o,
1597
1608
  style: m,
1598
- onChange: a,
1609
+ onChange: i,
1599
1610
  ...h
1600
- }, i) => {
1601
- const y = O(null), u = L(() => {
1602
- const b = y.current;
1611
+ }, a) => {
1612
+ const v = O(null), u = L(() => {
1613
+ const b = v.current;
1603
1614
  b && (b.style.height = "auto", b.style.height = `${b.scrollHeight}px`);
1604
- }, []), g = h.value ?? "";
1615
+ }, []), f = h.value ?? "";
1605
1616
  F(() => {
1606
1617
  n && u();
1607
- }, [n, u, g]);
1608
- const v = L(
1618
+ }, [n, u, f]);
1619
+ const y = L(
1609
1620
  (b) => {
1610
- n && u(), a?.(b);
1621
+ n && u(), i?.(b);
1611
1622
  },
1612
- [n, u, a]
1623
+ [n, u, i]
1613
1624
  );
1614
1625
  return /* @__PURE__ */ c(
1615
1626
  "textarea",
1616
1627
  {
1617
1628
  ref: (b) => {
1618
- y.current = b, typeof i == "function" ? i(b) : i && (i.current = b);
1629
+ v.current = b, typeof a == "function" ? a(b) : a && (a.current = b);
1619
1630
  },
1620
1631
  className: l(
1621
1632
  te.root,
1622
1633
  te[e],
1623
1634
  r && te.error,
1624
- n ? te.autoExpand : te[yo[t]],
1635
+ n ? te.autoExpand : te[No[t]],
1625
1636
  o
1626
1637
  ),
1627
1638
  style: m,
1628
- onChange: v,
1639
+ onChange: y,
1629
1640
  rows: h.rows ?? 1,
1630
1641
  ...h
1631
1642
  }
1632
1643
  );
1633
1644
  }
1634
1645
  );
1635
- No.displayName = "Textarea";
1646
+ wo.displayName = "Textarea";
1636
1647
  export {
1637
1648
  Ze as Button,
1638
- to as Checkbox,
1649
+ no as Checkbox,
1639
1650
  $t as Dropdown,
1640
1651
  Ct as DropdownItem,
1641
- Co as Form,
1652
+ Do as Form,
1642
1653
  Ro as FormField,
1643
- Do as FormRow,
1644
- kn as Input,
1654
+ Eo as FormRow,
1655
+ yn as Input,
1645
1656
  nr as Link,
1646
1657
  Or as List,
1647
1658
  Pr as ListItem,
1648
1659
  ue as Modal,
1649
1660
  Pt as Popover,
1650
- ao as Radio,
1651
- so as RadioGroup,
1652
- Jn as Select,
1653
- $o as Table,
1654
- No as Textarea,
1661
+ io as Radio,
1662
+ ao as RadioGroup,
1663
+ Zn as Select,
1664
+ Co as Table,
1665
+ wo as Textarea,
1655
1666
  $r as Typography,
1656
1667
  ie as useClickOutside,
1657
1668
  Mt as useFocusTrap,