@utk09/finra-ui 0.0.2 → 0.0.4

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.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { jsxs as V, jsx as i } from "react/jsx-runtime";
2
- import { forwardRef as B, useRef as O, useCallback as P, useState as nt, useEffect as z, useId as at, Children as it, isValidElement as st, cloneElement as ot } from "react";
3
- import { B as ct, I as lt, C as ut, S as dt } from "./Switch-BgWsJGsh.js";
4
- const d = "data-finra-ui", _ = {
1
+ import { jsxs as C, jsx as i } from "react/jsx-runtime";
2
+ import { forwardRef as B, useRef as K, useCallback as $, useState as Y, useEffect as Q, useId as ct, Children as lt, isValidElement as ut, cloneElement as dt } from "react";
3
+ import { B as _t, I as mt, C as pt, S as vt, R as ft, a as yt } from "./Slider-BXQjDfhb.js";
4
+ const f = "data-finra-ui", y = {
5
5
  // Button family
6
6
  button: "button",
7
7
  iconButton: "icon-button",
@@ -27,255 +27,263 @@ const d = "data-finra-ui", _ = {
27
27
  checkbox: "checkbox",
28
28
  // Switch
29
29
  switch: "switch",
30
+ // RadioButton
31
+ radioButton: "radio-button",
32
+ // Slider
33
+ slider: "slider",
34
+ // PillInput
35
+ pillInput: "pill-input",
36
+ // FileDropZone
37
+ fileDropZone: "file-drop-zone",
30
38
  // Badge
31
39
  badge: "badge",
32
40
  // Divider
33
41
  divider: "divider"
34
42
  };
35
- function rt(r) {
36
- var e, t, n = "";
37
- if (typeof r == "string" || typeof r == "number") n += r;
43
+ function st(r) {
44
+ var n, t, e = "";
45
+ if (typeof r == "string" || typeof r == "number") e += r;
38
46
  else if (typeof r == "object") if (Array.isArray(r)) {
39
47
  var a = r.length;
40
- for (e = 0; e < a; e++) r[e] && (t = rt(r[e])) && (n && (n += " "), n += t);
41
- } else for (t in r) r[t] && (n && (n += " "), n += t);
42
- return n;
48
+ for (n = 0; n < a; n++) r[n] && (t = st(r[n])) && (e && (e += " "), e += t);
49
+ } else for (t in r) r[t] && (e && (e += " "), e += t);
50
+ return e;
43
51
  }
44
- function $() {
45
- for (var r, e, t = 0, n = "", a = arguments.length; t < a; t++) (r = arguments[t]) && (e = rt(r)) && (n && (n += " "), n += e);
46
- return n;
52
+ function x() {
53
+ for (var r, n, t = 0, e = "", a = arguments.length; t < a; t++) (r = arguments[t]) && (n = st(r)) && (e && (e += " "), e += n);
54
+ return e;
47
55
  }
48
- const X = (r) => typeof r == "boolean" ? `${r}` : r === 0 ? "0" : r, Z = $, A = (r, e) => (t) => {
49
- var n;
50
- if (e?.variants == null) return Z(r, t?.class, t?.className);
51
- const { variants: a, defaultVariants: o } = e, c = Object.keys(a).map((s) => {
52
- const p = t?.[s], v = o?.[s];
53
- if (p === null) return null;
54
- const u = X(p) || X(v);
55
- return a[s][u];
56
- }), y = t && Object.entries(t).reduce((s, p) => {
57
- let [v, u] = p;
58
- return u === void 0 || (s[v] = u), s;
59
- }, {}), m = e == null || (n = e.compoundVariants) === null || n === void 0 ? void 0 : n.reduce((s, p) => {
60
- let { class: v, className: u, ...k } = p;
61
- return Object.entries(k).every((x) => {
62
- let [I, f] = x;
63
- return Array.isArray(f) ? f.includes({
56
+ const rt = (r) => typeof r == "boolean" ? `${r}` : r === 0 ? "0" : r, at = x, G = (r, n) => (t) => {
57
+ var e;
58
+ if (n?.variants == null) return at(r, t?.class, t?.className);
59
+ const { variants: a, defaultVariants: o } = n, l = Object.keys(a).map((s) => {
60
+ const g = t?.[s], d = o?.[s];
61
+ if (g === null) return null;
62
+ const _ = rt(g) || rt(d);
63
+ return a[s][_];
64
+ }), p = t && Object.entries(t).reduce((s, g) => {
65
+ let [d, _] = g;
66
+ return _ === void 0 || (s[d] = _), s;
67
+ }, {}), v = n == null || (e = n.compoundVariants) === null || e === void 0 ? void 0 : e.reduce((s, g) => {
68
+ let { class: d, className: _, ...N } = g;
69
+ return Object.entries(N).every((m) => {
70
+ let [w, h] = m;
71
+ return Array.isArray(h) ? h.includes({
64
72
  ...o,
65
- ...y
66
- }[I]) : {
73
+ ...p
74
+ }[w]) : {
67
75
  ...o,
68
- ...y
69
- }[I] === f;
76
+ ...p
77
+ }[w] === h;
70
78
  }) ? [
71
79
  ...s,
72
- v,
73
- u
80
+ d,
81
+ _
74
82
  ] : s;
75
83
  }, []);
76
- return Z(r, c, m, t?.class, t?.className);
77
- }, _t = "_button_nw9o1_1", mt = "_variantPrimary_nw9o1_40", vt = "_variantSecondary_nw9o1_53", ft = "_variantTertiary_nw9o1_66", yt = "_sentimentDanger_nw9o1_78", pt = "_sentimentSuccess_nw9o1_84", ht = "_sentimentWarning_nw9o1_90", bt = "_sentimentInfo_nw9o1_96", gt = "_fullWidth_nw9o1_102", wt = "_icon_nw9o1_106", C = {
78
- button: _t,
79
- variantPrimary: mt,
80
- variantSecondary: vt,
81
- variantTertiary: ft,
82
- sentimentDanger: yt,
83
- sentimentSuccess: pt,
84
- sentimentWarning: ht,
85
- sentimentInfo: bt,
86
- fullWidth: gt,
87
- icon: wt
88
- }, $t = {
89
- danger: C.sentimentDanger,
90
- success: C.sentimentSuccess,
91
- warning: C.sentimentWarning,
92
- info: C.sentimentInfo
93
- }, kt = A(C.button, {
84
+ return at(r, l, v, t?.class, t?.className);
85
+ }, ht = "_button_nw9o1_1", bt = "_variantPrimary_nw9o1_40", gt = "_variantSecondary_nw9o1_53", kt = "_variantTertiary_nw9o1_66", $t = "_sentimentDanger_nw9o1_78", Nt = "_sentimentSuccess_nw9o1_84", wt = "_sentimentWarning_nw9o1_90", xt = "_sentimentInfo_nw9o1_96", It = "_fullWidth_nw9o1_102", St = "_icon_nw9o1_106", E = {
86
+ button: ht,
87
+ variantPrimary: bt,
88
+ variantSecondary: gt,
89
+ variantTertiary: kt,
90
+ sentimentDanger: $t,
91
+ sentimentSuccess: Nt,
92
+ sentimentWarning: wt,
93
+ sentimentInfo: xt,
94
+ fullWidth: It,
95
+ icon: St
96
+ }, Wt = {
97
+ danger: E.sentimentDanger,
98
+ success: E.sentimentSuccess,
99
+ warning: E.sentimentWarning,
100
+ info: E.sentimentInfo
101
+ }, Ct = G(E.button, {
94
102
  variants: {
95
103
  variant: {
96
- primary: C.variantPrimary,
97
- secondary: C.variantSecondary,
98
- tertiary: C.variantTertiary
104
+ primary: E.variantPrimary,
105
+ secondary: E.variantSecondary,
106
+ tertiary: E.variantTertiary
99
107
  },
100
108
  fullWidth: {
101
- true: C.fullWidth
109
+ true: E.fullWidth
102
110
  }
103
111
  },
104
112
  defaultVariants: {
105
113
  variant: "primary"
106
114
  }
107
- }), Nt = B(
108
- ({ className: r, variant: e, fullWidth: t, sentiment: n, startIcon: a, endIcon: o, children: c, ...y }, m) => /* @__PURE__ */ V(
109
- ct,
115
+ }), Bt = B(
116
+ ({ className: r, variant: n, fullWidth: t, sentiment: e, startIcon: a, endIcon: o, children: l, ...p }, v) => /* @__PURE__ */ C(
117
+ _t,
110
118
  {
111
- ref: m,
119
+ ref: v,
112
120
  type: "button",
113
- [d]: _.button,
114
- className: $(
115
- kt({ variant: e, fullWidth: t }),
116
- n && $t[n],
121
+ [f]: y.button,
122
+ className: x(
123
+ Ct({ variant: n, fullWidth: t }),
124
+ e && Wt[e],
117
125
  r
118
126
  ),
119
- ...y,
127
+ ...p,
120
128
  children: [
121
- a ? /* @__PURE__ */ i("span", { className: C.icon, children: a }) : null,
122
- c,
123
- o ? /* @__PURE__ */ i("span", { className: C.icon, children: o }) : null
129
+ a ? /* @__PURE__ */ i("span", { className: E.icon, children: a }) : null,
130
+ l,
131
+ o ? /* @__PURE__ */ i("span", { className: E.icon, children: o }) : null
124
132
  ]
125
133
  }
126
134
  )
127
135
  );
128
- Nt.displayName = "Button";
129
- const Wt = "_iconButton_wgr1d_1", St = "_variantPrimary_wgr1d_37", xt = "_variantSecondary_wgr1d_50", It = "_variantTertiary_wgr1d_63", Ct = "_sentimentDanger_wgr1d_75", Bt = "_sentimentSuccess_wgr1d_81", Ft = "_sentimentWarning_wgr1d_87", Tt = "_sentimentInfo_wgr1d_93", E = {
130
- iconButton: Wt,
131
- variantPrimary: St,
132
- variantSecondary: xt,
133
- variantTertiary: It,
134
- sentimentDanger: Ct,
135
- sentimentSuccess: Bt,
136
- sentimentWarning: Ft,
137
- sentimentInfo: Tt
138
- }, Pt = {
139
- danger: E.sentimentDanger,
140
- success: E.sentimentSuccess,
141
- warning: E.sentimentWarning,
142
- info: E.sentimentInfo
143
- }, Et = A(E.iconButton, {
136
+ Bt.displayName = "Button";
137
+ const Dt = "_iconButton_wgr1d_1", Tt = "_variantPrimary_wgr1d_37", Ft = "_variantSecondary_wgr1d_50", Pt = "_variantTertiary_wgr1d_63", Et = "_sentimentDanger_wgr1d_75", qt = "_sentimentSuccess_wgr1d_81", jt = "_sentimentWarning_wgr1d_87", Vt = "_sentimentInfo_wgr1d_93", q = {
138
+ iconButton: Dt,
139
+ variantPrimary: Tt,
140
+ variantSecondary: Ft,
141
+ variantTertiary: Pt,
142
+ sentimentDanger: Et,
143
+ sentimentSuccess: qt,
144
+ sentimentWarning: jt,
145
+ sentimentInfo: Vt
146
+ }, Rt = {
147
+ danger: q.sentimentDanger,
148
+ success: q.sentimentSuccess,
149
+ warning: q.sentimentWarning,
150
+ info: q.sentimentInfo
151
+ }, Mt = G(q.iconButton, {
144
152
  variants: {
145
153
  variant: {
146
- primary: E.variantPrimary,
147
- secondary: E.variantSecondary,
148
- tertiary: E.variantTertiary
154
+ primary: q.variantPrimary,
155
+ secondary: q.variantSecondary,
156
+ tertiary: q.variantTertiary
149
157
  }
150
158
  },
151
159
  defaultVariants: {
152
160
  variant: "primary"
153
161
  }
154
- }), Dt = B(
155
- ({ className: r, variant: e, sentiment: t, ...n }, a) => /* @__PURE__ */ i(
156
- lt,
162
+ }), Ot = B(
163
+ ({ className: r, variant: n, sentiment: t, ...e }, a) => /* @__PURE__ */ i(
164
+ mt,
157
165
  {
158
166
  ref: a,
159
167
  type: "button",
160
- [d]: _.iconButton,
161
- className: $(
162
- Et({ variant: e }),
163
- t && Pt[t],
168
+ [f]: y.iconButton,
169
+ className: x(
170
+ Mt({ variant: n }),
171
+ t && Rt[t],
164
172
  r
165
173
  ),
166
- ...n
174
+ ...e
167
175
  }
168
176
  )
169
177
  );
170
- Dt.displayName = "IconButton";
171
- const Vt = "_buttonGroup_vy66t_1", jt = "_vertical_vy66t_22", tt = {
172
- buttonGroup: Vt,
173
- vertical: jt
174
- }, qt = B(
175
- ({ className: r, orientation: e = "horizontal", children: t, ...n }, a) => /* @__PURE__ */ i(
178
+ Ot.displayName = "IconButton";
179
+ const Ht = "_buttonGroup_vy66t_1", Lt = "_vertical_vy66t_22", it = {
180
+ buttonGroup: Ht,
181
+ vertical: Lt
182
+ }, At = B(
183
+ ({ className: r, orientation: n = "horizontal", children: t, ...e }, a) => /* @__PURE__ */ i(
176
184
  "div",
177
185
  {
178
186
  ref: a,
179
187
  role: "group",
180
- [d]: _.buttonGroup,
181
- className: $(
182
- tt.buttonGroup,
183
- e === "vertical" && tt.vertical,
188
+ [f]: y.buttonGroup,
189
+ className: x(
190
+ it.buttonGroup,
191
+ n === "vertical" && it.vertical,
184
192
  r
185
193
  ),
186
- ...n,
194
+ ...e,
187
195
  children: t
188
196
  }
189
197
  )
190
198
  );
191
- qt.displayName = "ButtonGroup";
192
- const Mt = "_wrapper_qx7i5_1", Ht = "_disabled_qx7i5_25", At = "_fullWidth_qx7i5_30", Gt = "_variantPrimary_qx7i5_33", Lt = "_variantSecondary_qx7i5_36", Rt = "_variantTertiary_qx7i5_40", zt = "_statusError_qx7i5_49", Ot = "_statusWarning_qx7i5_52", Kt = "_statusSuccess_qx7i5_55", Ut = "_field_qx7i5_59", Yt = "_adornment_qx7i5_76", Jt = "_clearButton_qx7i5_88", N = {
193
- wrapper: Mt,
194
- disabled: Ht,
195
- fullWidth: At,
196
- variantPrimary: Gt,
197
- variantSecondary: Lt,
198
- variantTertiary: Rt,
199
- statusError: zt,
200
- statusWarning: Ot,
201
- statusSuccess: Kt,
202
- field: Ut,
203
- adornment: Yt,
204
- clearButton: Jt
205
- }, Qt = A(N.wrapper, {
199
+ At.displayName = "ButtonGroup";
200
+ const Kt = "_wrapper_qx7i5_1", Gt = "_disabled_qx7i5_25", Zt = "_fullWidth_qx7i5_30", zt = "_variantPrimary_qx7i5_33", Ut = "_variantSecondary_qx7i5_36", Yt = "_variantTertiary_qx7i5_40", Jt = "_statusError_qx7i5_49", Qt = "_statusWarning_qx7i5_52", Xt = "_statusSuccess_qx7i5_55", tn = "_field_qx7i5_59", nn = "_adornment_qx7i5_76", en = "_clearButton_qx7i5_88", T = {
201
+ wrapper: Kt,
202
+ disabled: Gt,
203
+ fullWidth: Zt,
204
+ variantPrimary: zt,
205
+ variantSecondary: Ut,
206
+ variantTertiary: Yt,
207
+ statusError: Jt,
208
+ statusWarning: Qt,
209
+ statusSuccess: Xt,
210
+ field: tn,
211
+ adornment: nn,
212
+ clearButton: en
213
+ }, rn = G(T.wrapper, {
206
214
  variants: {
207
215
  variant: {
208
- primary: N.variantPrimary,
209
- secondary: N.variantSecondary,
210
- tertiary: N.variantTertiary
216
+ primary: T.variantPrimary,
217
+ secondary: T.variantSecondary,
218
+ tertiary: T.variantTertiary
211
219
  }
212
220
  },
213
221
  defaultVariants: {
214
222
  variant: "primary"
215
223
  }
216
- }), Xt = {
217
- error: N.statusError,
218
- warning: N.statusWarning,
219
- success: N.statusSuccess
220
- }, Zt = B(
224
+ }), an = {
225
+ error: T.statusError,
226
+ warning: T.statusWarning,
227
+ success: T.statusSuccess
228
+ }, sn = B(
221
229
  ({
222
230
  className: r,
223
- variant: e,
231
+ variant: n,
224
232
  validationStatus: t,
225
- startAdornment: n,
233
+ startAdornment: e,
226
234
  endAdornment: a,
227
235
  clearable: o,
228
- onClear: c,
229
- fullWidth: y,
230
- disabled: m,
236
+ onClear: l,
237
+ fullWidth: p,
238
+ disabled: v,
231
239
  readOnly: s,
232
- value: p,
233
- defaultValue: v,
234
- onChange: u,
235
- ...k
236
- }, x) => {
237
- const I = O(null), f = x || I, h = P(
238
- (g) => {
239
- g.preventDefault(), c ? c() : f.current && (Object.getOwnPropertyDescriptor(
240
+ value: g,
241
+ defaultValue: d,
242
+ onChange: _,
243
+ ...N
244
+ }, m) => {
245
+ const w = K(null), h = m || w, k = $(
246
+ (I) => {
247
+ I.preventDefault(), l ? l() : h.current && (Object.getOwnPropertyDescriptor(
240
248
  HTMLInputElement.prototype,
241
249
  "value"
242
- )?.set?.call(f.current, ""), f.current.dispatchEvent(new Event("input", { bubbles: !0 }))), f.current?.focus();
250
+ )?.set?.call(h.current, ""), h.current.dispatchEvent(new Event("input", { bubbles: !0 }))), h.current?.focus();
243
251
  },
244
- [c, f]
245
- ), F = o && !m && !s && (p ?? v ?? "") !== "";
246
- return /* @__PURE__ */ V(
252
+ [l, h]
253
+ ), u = o && !v && !s && (g ?? d ?? "") !== "";
254
+ return /* @__PURE__ */ C(
247
255
  "div",
248
256
  {
249
- [d]: _.input,
250
- className: $(
251
- Qt({ variant: e }),
252
- t && Xt[t],
253
- m && N.disabled,
254
- y && N.fullWidth,
257
+ [f]: y.input,
258
+ className: x(
259
+ rn({ variant: n }),
260
+ t && an[t],
261
+ v && T.disabled,
262
+ p && T.fullWidth,
255
263
  r
256
264
  ),
257
265
  children: [
258
- n ? /* @__PURE__ */ i("span", { className: N.adornment, children: n }) : null,
266
+ e ? /* @__PURE__ */ i("span", { className: T.adornment, children: e }) : null,
259
267
  /* @__PURE__ */ i(
260
268
  "input",
261
269
  {
262
- ref: f,
263
- [d]: _.inputField,
264
- className: N.field,
265
- disabled: m,
270
+ ref: h,
271
+ [f]: y.inputField,
272
+ className: T.field,
273
+ disabled: v,
266
274
  readOnly: s,
267
- value: p,
268
- defaultValue: v,
269
- onChange: u,
270
- ...k
275
+ value: g,
276
+ defaultValue: d,
277
+ onChange: _,
278
+ ...N
271
279
  }
272
280
  ),
273
- F ? /* @__PURE__ */ i(
281
+ u ? /* @__PURE__ */ i(
274
282
  "button",
275
283
  {
276
284
  type: "button",
277
- className: N.clearButton,
278
- onClick: h,
285
+ className: T.clearButton,
286
+ onClick: k,
279
287
  "aria-label": "Clear input",
280
288
  tabIndex: -1,
281
289
  children: /* @__PURE__ */ i(
@@ -292,120 +300,120 @@ const Mt = "_wrapper_qx7i5_1", Ht = "_disabled_qx7i5_25", At = "_fullWidth_qx7i5
292
300
  )
293
301
  }
294
302
  ) : null,
295
- a ? /* @__PURE__ */ i("span", { className: N.adornment, children: a }) : null
303
+ a ? /* @__PURE__ */ i("span", { className: T.adornment, children: a }) : null
296
304
  ]
297
305
  }
298
306
  );
299
307
  }
300
308
  );
301
- Zt.displayName = "Input";
302
- const tn = "_wrapper_16m4i_1", nn = "_disabled_16m4i_21", rn = "_fullWidth_16m4i_26", en = "_variantPrimary_16m4i_29", an = "_variantSecondary_16m4i_32", sn = "_variantTertiary_16m4i_36", on = "_statusError_16m4i_45", cn = "_statusWarning_16m4i_48", ln = "_statusSuccess_16m4i_51", un = "_field_16m4i_55", dn = "_charCount_16m4i_74", _n = "_charCountWarning_16m4i_84", mn = "_charCountError_16m4i_88", W = {
303
- wrapper: tn,
304
- disabled: nn,
305
- fullWidth: rn,
306
- variantPrimary: en,
307
- variantSecondary: an,
308
- variantTertiary: sn,
309
- statusError: on,
310
- statusWarning: cn,
311
- statusSuccess: ln,
312
- field: un,
313
- charCount: dn,
314
- charCountWarning: _n,
315
- charCountError: mn
316
- }, vn = A(W.wrapper, {
309
+ sn.displayName = "Input";
310
+ const on = "_wrapper_16m4i_1", cn = "_disabled_16m4i_21", ln = "_fullWidth_16m4i_26", un = "_variantPrimary_16m4i_29", dn = "_variantSecondary_16m4i_32", _n = "_variantTertiary_16m4i_36", mn = "_statusError_16m4i_45", pn = "_statusWarning_16m4i_48", vn = "_statusSuccess_16m4i_51", fn = "_field_16m4i_55", yn = "_charCount_16m4i_74", hn = "_charCountWarning_16m4i_84", bn = "_charCountError_16m4i_88", F = {
311
+ wrapper: on,
312
+ disabled: cn,
313
+ fullWidth: ln,
314
+ variantPrimary: un,
315
+ variantSecondary: dn,
316
+ variantTertiary: _n,
317
+ statusError: mn,
318
+ statusWarning: pn,
319
+ statusSuccess: vn,
320
+ field: fn,
321
+ charCount: yn,
322
+ charCountWarning: hn,
323
+ charCountError: bn
324
+ }, gn = G(F.wrapper, {
317
325
  variants: {
318
326
  variant: {
319
- primary: W.variantPrimary,
320
- secondary: W.variantSecondary,
321
- tertiary: W.variantTertiary
327
+ primary: F.variantPrimary,
328
+ secondary: F.variantSecondary,
329
+ tertiary: F.variantTertiary
322
330
  }
323
331
  },
324
332
  defaultVariants: {
325
333
  variant: "primary"
326
334
  }
327
- }), fn = {
328
- error: W.statusError,
329
- warning: W.statusWarning,
330
- success: W.statusSuccess
331
- }, yn = B(
335
+ }), kn = {
336
+ error: F.statusError,
337
+ warning: F.statusWarning,
338
+ success: F.statusSuccess
339
+ }, $n = B(
332
340
  ({
333
341
  className: r,
334
- variant: e,
342
+ variant: n,
335
343
  validationStatus: t,
336
- showCharCount: n,
344
+ showCharCount: e,
337
345
  warningThreshold: a,
338
346
  autoResize: o,
339
- minRows: c = 3,
340
- maxRows: y,
341
- fullWidth: m,
347
+ minRows: l = 3,
348
+ maxRows: p,
349
+ fullWidth: v,
342
350
  maxLength: s,
343
- disabled: p,
344
- readOnly: v,
345
- value: u,
346
- defaultValue: k,
347
- onChange: x,
348
- ...I
349
- }, f) => {
350
- const h = O(null), F = f || h, [g, w] = nt(() => (u ?? k ?? "").length);
351
- z(() => {
352
- u !== void 0 && w(u.length);
353
- }, [u]);
354
- const T = P(() => {
355
- const l = F.current;
356
- if (!l || !o) return;
357
- l.style.height = "auto";
358
- const q = parseFloat(getComputedStyle(l).lineHeight), et = q * c, J = y ? q * y : 1 / 0, Q = l.scrollHeight;
359
- l.style.height = `${Math.min(Math.max(Q, et), J)}px`, l.style.overflowY = Q > J ? "auto" : "hidden";
360
- }, [o, c, y, F]);
361
- z(() => {
362
- T();
363
- }, [u, T]);
364
- const j = P(
365
- (l) => {
366
- w(l.target.value.length), T(), x?.(l);
351
+ disabled: g,
352
+ readOnly: d,
353
+ value: _,
354
+ defaultValue: N,
355
+ onChange: m,
356
+ ...w
357
+ }, h) => {
358
+ const k = K(null), u = h || k, [I, S] = Y(() => (_ ?? N ?? "").length);
359
+ Q(() => {
360
+ _ !== void 0 && S(_.length);
361
+ }, [_]);
362
+ const c = $(() => {
363
+ const b = u.current;
364
+ if (!b || !o) return;
365
+ b.style.height = "auto";
366
+ const V = parseFloat(getComputedStyle(b).lineHeight), ot = V * l, nt = p ? V * p : 1 / 0, et = b.scrollHeight;
367
+ b.style.height = `${Math.min(Math.max(et, ot), nt)}px`, b.style.overflowY = et > nt ? "auto" : "hidden";
368
+ }, [o, l, p, u]);
369
+ Q(() => {
370
+ c();
371
+ }, [_, c]);
372
+ const D = $(
373
+ (b) => {
374
+ S(b.target.value.length), c(), m?.(b);
367
375
  },
368
- [x, T]
369
- ), K = a !== void 0 && s !== void 0 && g >= a, G = s !== void 0 && g >= s ? "error" : K ? "warning" : void 0, b = t ?? G;
370
- return /* @__PURE__ */ V(
376
+ [m, c]
377
+ ), Z = a !== void 0 && s !== void 0 && I >= a, z = s !== void 0 && I >= s ? "error" : Z ? "warning" : void 0, W = t ?? z;
378
+ return /* @__PURE__ */ C(
371
379
  "div",
372
380
  {
373
- [d]: _.textarea,
374
- className: $(
375
- vn({ variant: e }),
376
- b && fn[b],
377
- p && W.disabled,
378
- m && W.fullWidth,
381
+ [f]: y.textarea,
382
+ className: x(
383
+ gn({ variant: n }),
384
+ W && kn[W],
385
+ g && F.disabled,
386
+ v && F.fullWidth,
379
387
  r
380
388
  ),
381
389
  children: [
382
390
  /* @__PURE__ */ i(
383
391
  "textarea",
384
392
  {
385
- ref: F,
386
- [d]: _.textareaField,
387
- className: W.field,
388
- rows: c,
393
+ ref: u,
394
+ [f]: y.textareaField,
395
+ className: F.field,
396
+ rows: l,
389
397
  maxLength: s,
390
- disabled: p,
391
- readOnly: v,
392
- value: u,
393
- defaultValue: k,
394
- onChange: j,
395
- ...I
398
+ disabled: g,
399
+ readOnly: d,
400
+ value: _,
401
+ defaultValue: N,
402
+ onChange: D,
403
+ ...w
396
404
  }
397
405
  ),
398
- n && s !== void 0 ? /* @__PURE__ */ V(
406
+ e && s !== void 0 ? /* @__PURE__ */ C(
399
407
  "span",
400
408
  {
401
- [d]: _.textareaCount,
402
- className: $(
403
- W.charCount,
404
- G === "warning" && W.charCountWarning,
405
- G === "error" && W.charCountError
409
+ [f]: y.textareaCount,
410
+ className: x(
411
+ F.charCount,
412
+ z === "warning" && F.charCountWarning,
413
+ z === "error" && F.charCountError
406
414
  ),
407
415
  children: [
408
- g,
416
+ I,
409
417
  "/",
410
418
  s
411
419
  ]
@@ -416,106 +424,106 @@ const tn = "_wrapper_16m4i_1", nn = "_disabled_16m4i_21", rn = "_fullWidth_16m4i
416
424
  );
417
425
  }
418
426
  );
419
- yn.displayName = "Textarea";
420
- const pn = "_wrapper_1k2cc_1", hn = "_disabled_1k2cc_22", bn = "_fullWidth_1k2cc_27", gn = "_variantPrimary_1k2cc_30", wn = "_variantSecondary_1k2cc_33", $n = "_variantTertiary_1k2cc_37", kn = "_statusError_1k2cc_46", Nn = "_statusWarning_1k2cc_49", Wn = "_statusSuccess_1k2cc_52", Sn = "_field_1k2cc_56", xn = "_stepButton_1k2cc_79", S = {
421
- wrapper: pn,
422
- disabled: hn,
423
- fullWidth: bn,
424
- variantPrimary: gn,
425
- variantSecondary: wn,
426
- variantTertiary: $n,
427
- statusError: kn,
428
- statusWarning: Nn,
429
- statusSuccess: Wn,
430
- field: Sn,
431
- stepButton: xn
432
- }, In = A(S.wrapper, {
427
+ $n.displayName = "Textarea";
428
+ const Nn = "_wrapper_1k2cc_1", wn = "_disabled_1k2cc_22", xn = "_fullWidth_1k2cc_27", In = "_variantPrimary_1k2cc_30", Sn = "_variantSecondary_1k2cc_33", Wn = "_variantTertiary_1k2cc_37", Cn = "_statusError_1k2cc_46", Bn = "_statusWarning_1k2cc_49", Dn = "_statusSuccess_1k2cc_52", Tn = "_field_1k2cc_56", Fn = "_stepButton_1k2cc_79", P = {
429
+ wrapper: Nn,
430
+ disabled: wn,
431
+ fullWidth: xn,
432
+ variantPrimary: In,
433
+ variantSecondary: Sn,
434
+ variantTertiary: Wn,
435
+ statusError: Cn,
436
+ statusWarning: Bn,
437
+ statusSuccess: Dn,
438
+ field: Tn,
439
+ stepButton: Fn
440
+ }, Pn = G(P.wrapper, {
433
441
  variants: {
434
442
  variant: {
435
- primary: S.variantPrimary,
436
- secondary: S.variantSecondary,
437
- tertiary: S.variantTertiary
443
+ primary: P.variantPrimary,
444
+ secondary: P.variantSecondary,
445
+ tertiary: P.variantTertiary
438
446
  }
439
447
  },
440
448
  defaultVariants: {
441
449
  variant: "primary"
442
450
  }
443
- }), Cn = {
444
- error: S.statusError,
445
- warning: S.statusWarning,
446
- success: S.statusSuccess
451
+ }), En = {
452
+ error: P.statusError,
453
+ warning: P.statusWarning,
454
+ success: P.statusSuccess
447
455
  };
448
- function Bn(r, e, t) {
449
- let n = r;
450
- return e !== void 0 && (n = Math.max(n, e)), t !== void 0 && (n = Math.min(n, t)), n;
456
+ function qn(r, n, t) {
457
+ let e = r;
458
+ return n !== void 0 && (e = Math.max(e, n)), t !== void 0 && (e = Math.min(e, t)), e;
451
459
  }
452
- function R(r, e) {
453
- return e !== void 0 ? r.toFixed(e) : String(r);
460
+ function J(r, n) {
461
+ return n !== void 0 ? r.toFixed(n) : String(r);
454
462
  }
455
- const Fn = B(
463
+ const jn = B(
456
464
  ({
457
465
  className: r,
458
- variant: e,
466
+ variant: n,
459
467
  validationStatus: t,
460
- value: n,
468
+ value: e,
461
469
  defaultValue: a,
462
470
  min: o,
463
- max: c,
464
- step: y = 1,
465
- precision: m,
471
+ max: l,
472
+ step: p = 1,
473
+ precision: v,
466
474
  onChange: s,
467
- fullWidth: p,
468
- disabled: v,
469
- readOnly: u,
470
- ...k
471
- }, x) => {
472
- const I = O(null), f = x || I, h = n !== void 0, [F, g] = nt(
473
- () => a !== void 0 ? R(a, m) : ""
474
- ), w = h ? n === "" ? "" : R(n, m) : F;
475
- z(() => {
476
- h && n !== "" && g(R(n, m));
477
- }, [n, m, h]);
478
- const T = P(
479
- (b) => {
480
- const l = Bn(b, o, c), q = R(l, m);
481
- h || g(q), s?.(l);
475
+ fullWidth: g,
476
+ disabled: d,
477
+ readOnly: _,
478
+ ...N
479
+ }, m) => {
480
+ const w = K(null), h = m || w, k = e !== void 0, [u, I] = Y(
481
+ () => a !== void 0 ? J(a, v) : ""
482
+ ), S = k ? e === "" ? "" : J(e, v) : u;
483
+ Q(() => {
484
+ k && e !== "" && I(J(e, v));
485
+ }, [e, v, k]);
486
+ const c = $(
487
+ (W) => {
488
+ const b = qn(W, o, l), V = J(b, v);
489
+ k || I(V), s?.(b);
482
490
  },
483
- [o, c, m, h, s]
484
- ), j = P(
485
- (b) => {
486
- const l = parseFloat(w) || 0;
487
- T(l + y * b);
491
+ [o, l, v, k, s]
492
+ ), D = $(
493
+ (W) => {
494
+ const b = parseFloat(S) || 0;
495
+ c(b + p * W);
488
496
  },
489
- [w, y, T]
490
- ), K = P(
491
- (b) => {
492
- const l = b.target.value;
493
- if (l === "" || l === "-" || l === ".") {
494
- h || g(l), l === "" && s?.(void 0);
497
+ [S, p, c]
498
+ ), Z = $(
499
+ (W) => {
500
+ const b = W.target.value;
501
+ if (b === "" || b === "-" || b === ".") {
502
+ k || I(b), b === "" && s?.(void 0);
495
503
  return;
496
504
  }
497
- const q = parseFloat(l);
498
- isNaN(q) || (h || g(l), s?.(q));
505
+ const V = parseFloat(b);
506
+ isNaN(V) || (k || I(b), s?.(V));
499
507
  },
500
- [h, s]
501
- ), Y = P(() => {
502
- const b = parseFloat(w);
503
- isNaN(b) ? (h || g(""), s?.(void 0)) : T(b);
504
- }, [w, h, s, T]), G = P(
505
- (b) => {
506
- b.key === "ArrowUp" ? (b.preventDefault(), j(1)) : b.key === "ArrowDown" && (b.preventDefault(), j(-1));
508
+ [k, s]
509
+ ), tt = $(() => {
510
+ const W = parseFloat(S);
511
+ isNaN(W) ? (k || I(""), s?.(void 0)) : c(W);
512
+ }, [S, k, s, c]), z = $(
513
+ (W) => {
514
+ W.key === "ArrowUp" ? (W.preventDefault(), D(1)) : W.key === "ArrowDown" && (W.preventDefault(), D(-1));
507
515
  },
508
- [j]
516
+ [D]
509
517
  );
510
- return /* @__PURE__ */ V(
518
+ return /* @__PURE__ */ C(
511
519
  "div",
512
520
  {
513
- [d]: _.numberInput,
514
- className: $(
515
- In({ variant: e }),
516
- t && Cn[t],
517
- v && S.disabled,
518
- p && S.fullWidth,
521
+ [f]: y.numberInput,
522
+ className: x(
523
+ Pn({ variant: n }),
524
+ t && En[t],
525
+ d && P.disabled,
526
+ g && P.fullWidth,
519
527
  r
520
528
  ),
521
529
  children: [
@@ -523,10 +531,10 @@ const Fn = B(
523
531
  "button",
524
532
  {
525
533
  type: "button",
526
- [d]: _.numberInputDecrement,
527
- className: S.stepButton,
528
- onClick: () => j(-1),
529
- disabled: v || u || o !== void 0 && (parseFloat(w) || 0) <= o,
534
+ [f]: y.numberInputDecrement,
535
+ className: P.stepButton,
536
+ onClick: () => D(-1),
537
+ disabled: d || _ || o !== void 0 && (parseFloat(S) || 0) <= o,
530
538
  "aria-label": "Decrement",
531
539
  tabIndex: -1,
532
540
  children: /* @__PURE__ */ i(
@@ -545,31 +553,31 @@ const Fn = B(
545
553
  /* @__PURE__ */ i(
546
554
  "input",
547
555
  {
548
- ref: f,
549
- [d]: _.numberInputField,
550
- className: S.field,
556
+ ref: h,
557
+ [f]: y.numberInputField,
558
+ className: P.field,
551
559
  inputMode: "decimal",
552
- value: w,
553
- onChange: K,
554
- onBlur: Y,
555
- onKeyDown: G,
556
- disabled: v,
557
- readOnly: u,
560
+ value: S,
561
+ onChange: Z,
562
+ onBlur: tt,
563
+ onKeyDown: z,
564
+ disabled: d,
565
+ readOnly: _,
558
566
  role: "spinbutton",
559
567
  "aria-valuemin": o,
560
- "aria-valuemax": c,
561
- "aria-valuenow": typeof w == "string" ? parseFloat(w) || void 0 : w,
562
- ...k
568
+ "aria-valuemax": l,
569
+ "aria-valuenow": typeof S == "string" ? parseFloat(S) || void 0 : S,
570
+ ...N
563
571
  }
564
572
  ),
565
573
  /* @__PURE__ */ i(
566
574
  "button",
567
575
  {
568
576
  type: "button",
569
- [d]: _.numberInputIncrement,
570
- className: S.stepButton,
571
- onClick: () => j(1),
572
- disabled: v || u || c !== void 0 && (parseFloat(w) || 0) >= c,
577
+ [f]: y.numberInputIncrement,
578
+ className: P.stepButton,
579
+ onClick: () => D(1),
580
+ disabled: d || _ || l !== void 0 && (parseFloat(S) || 0) >= l,
573
581
  "aria-label": "Increment",
574
582
  tabIndex: -1,
575
583
  children: /* @__PURE__ */ i(
@@ -590,75 +598,74 @@ const Fn = B(
590
598
  );
591
599
  }
592
600
  );
593
- Fn.displayName = "NumberInput";
594
- const Tn = "_formField_bdanr_1", Pn = "_fullWidth_bdanr_6", En = "_disabled_bdanr_12", Dn = "_label_bdanr_17", Vn = "_required_bdanr_24", jn = "_helperText_bdanr_29", qn = "_errorMessage_bdanr_37", M = {
595
- formField: Tn,
596
- fullWidth: Pn,
597
- disabled: En,
598
- label: Dn,
599
- required: Vn,
600
- helperText: jn,
601
- errorMessage: qn
602
- }, Mn = B(
601
+ jn.displayName = "NumberInput";
602
+ const Vn = "_formField_bdanr_1", Rn = "_fullWidth_bdanr_6", Mn = "_disabled_bdanr_12", On = "_label_bdanr_17", Hn = "_required_bdanr_24", Ln = "_helperText_bdanr_29", An = "_errorMessage_bdanr_37", R = {
603
+ formField: Vn,
604
+ fullWidth: Rn,
605
+ disabled: Mn,
606
+ label: On,
607
+ required: Hn,
608
+ helperText: Ln,
609
+ errorMessage: An
610
+ }, Kn = B(
603
611
  ({
604
612
  className: r,
605
- label: e,
613
+ label: n,
606
614
  helperText: t,
607
- errorMessage: n,
615
+ errorMessage: e,
608
616
  validationStatus: a,
609
617
  required: o,
610
- fullWidth: c,
611
- disabled: y,
612
- htmlFor: m,
618
+ fullWidth: l,
619
+ disabled: p,
620
+ htmlFor: v,
613
621
  children: s,
614
- ...p
615
- }, v) => {
616
- const u = at(), k = m ?? u, x = `${k}-helper`, I = `${k}-error`, f = a === "error" && n, h = [f ? I : void 0, t ? x : void 0].filter(Boolean).join(" ") || void 0, F = it.map(s, (g) => st(g) ? ot(g, {
617
- id: k,
618
- "aria-describedby": h,
622
+ ...g
623
+ }, d) => {
624
+ const _ = ct(), N = v ?? _, m = `${N}-helper`, w = `${N}-error`, h = a === "error" && e, k = [h ? w : void 0, t ? m : void 0].filter(Boolean).join(" ") || void 0, u = lt.map(s, (I) => ut(I) ? dt(I, {
625
+ id: N,
626
+ "aria-describedby": k,
619
627
  "aria-invalid": a === "error" ? !0 : void 0,
620
- disabled: y || void 0,
621
- validationStatus: a
622
- }) : g);
623
- return /* @__PURE__ */ V(
628
+ disabled: p || void 0
629
+ }) : I);
630
+ return /* @__PURE__ */ C(
624
631
  "div",
625
632
  {
626
- ref: v,
627
- [d]: _.formField,
628
- className: $(
629
- M.formField,
630
- c && M.fullWidth,
631
- y && M.disabled,
633
+ ref: d,
634
+ [f]: y.formField,
635
+ className: x(
636
+ R.formField,
637
+ l && R.fullWidth,
638
+ p && R.disabled,
632
639
  r
633
640
  ),
634
- ...p,
641
+ ...g,
635
642
  children: [
636
643
  /* @__PURE__ */ i(
637
644
  "label",
638
645
  {
639
- [d]: _.formFieldLabel,
640
- htmlFor: k,
641
- className: $(M.label, o && M.required),
642
- children: e
646
+ [f]: y.formFieldLabel,
647
+ htmlFor: N,
648
+ className: x(R.label, o && R.required),
649
+ children: n
643
650
  }
644
651
  ),
645
- F,
646
- f ? /* @__PURE__ */ i(
652
+ u,
653
+ h ? /* @__PURE__ */ i(
647
654
  "p",
648
655
  {
649
- [d]: _.formFieldError,
650
- id: I,
651
- className: M.errorMessage,
656
+ [f]: y.formFieldError,
657
+ id: w,
658
+ className: R.errorMessage,
652
659
  role: "alert",
653
- children: n
660
+ children: e
654
661
  }
655
662
  ) : null,
656
663
  t ? /* @__PURE__ */ i(
657
664
  "p",
658
665
  {
659
- [d]: _.formFieldHelper,
660
- id: x,
661
- className: M.helperText,
666
+ [f]: y.formFieldHelper,
667
+ id: m,
668
+ className: R.helperText,
662
669
  children: t
663
670
  }
664
671
  ) : null
@@ -667,42 +674,42 @@ const Tn = "_formField_bdanr_1", Pn = "_fullWidth_bdanr_6", En = "_disabled_bdan
667
674
  );
668
675
  }
669
676
  );
670
- Mn.displayName = "FormField";
671
- const Hn = "_checkbox_q1fn9_1", An = "_disabled_q1fn9_11", Gn = "_input_q1fn9_16", Ln = "_indicator_q1fn9_25", Rn = "_label_q1fn9_70", L = {
672
- checkbox: Hn,
673
- disabled: An,
674
- input: Gn,
675
- indicator: Ln,
676
- label: Rn
677
+ Kn.displayName = "FormField";
678
+ const Gn = "_checkbox_q1fn9_1", Zn = "_disabled_q1fn9_11", zn = "_input_q1fn9_16", Un = "_indicator_q1fn9_25", Yn = "_label_q1fn9_70", U = {
679
+ checkbox: Gn,
680
+ disabled: Zn,
681
+ input: zn,
682
+ indicator: Un,
683
+ label: Yn
677
684
  };
678
- function zn(...r) {
679
- return (e) => {
685
+ function Jn(...r) {
686
+ return (n) => {
680
687
  for (const t of r)
681
- typeof t == "function" ? t(e) : t && typeof t == "object" && (t.current = e);
688
+ typeof t == "function" ? t(n) : t && typeof t == "object" && (t.current = n);
682
689
  };
683
690
  }
684
- const On = B(
685
- ({ className: r, label: e, indeterminate: t, disabled: n, ...a }, o) => {
686
- const c = O(null);
687
- return z(() => {
688
- c.current && (c.current.indeterminate = t ?? !1);
689
- }, [t]), /* @__PURE__ */ V(
691
+ const Qn = B(
692
+ ({ className: r, label: n, indeterminate: t, disabled: e, ...a }, o) => {
693
+ const l = K(null);
694
+ return Q(() => {
695
+ l.current && (l.current.indeterminate = t ?? !1);
696
+ }, [t]), /* @__PURE__ */ C(
690
697
  "label",
691
698
  {
692
- [d]: _.checkbox,
693
- className: $(L.checkbox, n && L.disabled, r),
699
+ [f]: y.checkbox,
700
+ className: x(U.checkbox, e && U.disabled, r),
694
701
  children: [
695
702
  /* @__PURE__ */ i(
696
- ut,
703
+ pt,
697
704
  {
698
- ref: zn(o, c),
699
- className: L.input,
700
- disabled: n,
705
+ ref: Jn(o, l),
706
+ className: U.input,
707
+ disabled: e,
701
708
  "data-indeterminate": t || void 0,
702
709
  ...a
703
710
  }
704
711
  ),
705
- /* @__PURE__ */ i("span", { className: L.indicator, "aria-hidden": "true", children: t ? /* @__PURE__ */ i(
712
+ /* @__PURE__ */ i("span", { className: U.indicator, "aria-hidden": "true", children: t ? /* @__PURE__ */ i(
706
713
  "svg",
707
714
  {
708
715
  viewBox: "0 0 12 12",
@@ -724,111 +731,401 @@ const On = B(
724
731
  children: /* @__PURE__ */ i("path", { d: "M2.5 6l2.5 2.5 4.5-5" })
725
732
  }
726
733
  ) }),
727
- e ? /* @__PURE__ */ i("span", { className: L.label, children: e }) : null
734
+ n ? /* @__PURE__ */ i("span", { className: U.label, children: n }) : null
728
735
  ]
729
736
  }
730
737
  );
731
738
  }
732
739
  );
733
- On.displayName = "Checkbox";
734
- const Kn = "_disabled_19daj_11", Un = "_input_19daj_16", Yn = "_track_19daj_25", Jn = "_thumb_19daj_29", Qn = "_label_19daj_71", H = {
740
+ Qn.displayName = "Checkbox";
741
+ const Xn = "_disabled_19daj_11", te = "_input_19daj_16", ne = "_track_19daj_25", ee = "_thumb_19daj_29", re = "_label_19daj_71", O = {
735
742
  switch: "_switch_19daj_1",
736
- disabled: Kn,
737
- input: Un,
738
- track: Yn,
739
- thumb: Jn,
740
- label: Qn
741
- }, Xn = B(
742
- ({ className: r, label: e, disabled: t, ...n }, a) => /* @__PURE__ */ V(
743
+ disabled: Xn,
744
+ input: te,
745
+ track: ne,
746
+ thumb: ee,
747
+ label: re
748
+ }, ae = B(
749
+ ({ className: r, label: n, disabled: t, ...e }, a) => /* @__PURE__ */ C(
750
+ "label",
751
+ {
752
+ [f]: y.switch,
753
+ className: x(O.switch, t && O.disabled, r),
754
+ children: [
755
+ /* @__PURE__ */ i(vt, { ref: a, className: O.input, disabled: t, ...e }),
756
+ /* @__PURE__ */ i("span", { className: O.track, "aria-hidden": "true", children: /* @__PURE__ */ i("span", { className: O.thumb }) }),
757
+ n ? /* @__PURE__ */ i("span", { className: O.label, children: n }) : null
758
+ ]
759
+ }
760
+ )
761
+ );
762
+ ae.displayName = "Switch";
763
+ const ie = "_radio_1ra61_1", se = "_disabled_1ra61_11", oe = "_input_1ra61_16", ce = "_indicator_1ra61_25", le = "_dot_1ra61_28", ue = "_label_1ra61_68", H = {
764
+ radio: ie,
765
+ disabled: se,
766
+ input: oe,
767
+ indicator: ce,
768
+ dot: le,
769
+ label: ue
770
+ }, de = B(
771
+ ({ className: r, label: n, disabled: t, ...e }, a) => /* @__PURE__ */ C(
743
772
  "label",
744
773
  {
745
- [d]: _.switch,
746
- className: $(H.switch, t && H.disabled, r),
774
+ [f]: y.radioButton,
775
+ className: x(H.radio, t && H.disabled, r),
747
776
  children: [
748
- /* @__PURE__ */ i(dt, { ref: a, className: H.input, disabled: t, ...n }),
749
- /* @__PURE__ */ i("span", { className: H.track, "aria-hidden": "true", children: /* @__PURE__ */ i("span", { className: H.thumb }) }),
750
- e ? /* @__PURE__ */ i("span", { className: H.label, children: e }) : null
777
+ /* @__PURE__ */ i(ft, { ref: a, className: H.input, disabled: t, ...e }),
778
+ /* @__PURE__ */ i("span", { className: H.indicator, "aria-hidden": "true", children: /* @__PURE__ */ i("span", { className: H.dot }) }),
779
+ n ? /* @__PURE__ */ i("span", { className: H.label, children: n }) : null
751
780
  ]
752
781
  }
753
782
  )
754
783
  );
755
- Xn.displayName = "Switch";
756
- const Zn = "_badge_1ehok_1", tr = "_variantPrimary_1ehok_17", nr = "_variantSecondary_1ehok_22", rr = "_variantTertiary_1ehok_27", er = "_sentimentDanger_1ehok_32", ar = "_sentimentSuccess_1ehok_36", ir = "_sentimentWarning_1ehok_40", sr = "_sentimentInfo_1ehok_44", D = {
757
- badge: Zn,
758
- variantPrimary: tr,
759
- variantSecondary: nr,
760
- variantTertiary: rr,
761
- sentimentDanger: er,
762
- sentimentSuccess: ar,
763
- sentimentWarning: ir,
764
- sentimentInfo: sr
765
- }, or = {
766
- danger: D.sentimentDanger,
767
- success: D.sentimentSuccess,
768
- warning: D.sentimentWarning,
769
- info: D.sentimentInfo
770
- }, cr = A(D.badge, {
784
+ de.displayName = "RadioButton";
785
+ const _e = "_slider_q8xxv_1", me = "_disabled_q8xxv_11", pe = "_header_q8xxv_16", ve = "_label_q8xxv_23", fe = "_value_q8xxv_27", ye = "_input_q8xxv_33", L = {
786
+ slider: _e,
787
+ disabled: me,
788
+ header: pe,
789
+ label: ve,
790
+ value: fe,
791
+ input: ye
792
+ }, he = B(
793
+ ({ className: r, label: n, showValue: t, disabled: e, value: a, defaultValue: o, ...l }, p) => {
794
+ const v = a ?? o ?? "";
795
+ return /* @__PURE__ */ C(
796
+ "label",
797
+ {
798
+ [f]: y.slider,
799
+ className: x(L.slider, e && L.disabled, r),
800
+ children: [
801
+ n || t ? /* @__PURE__ */ C("span", { className: L.header, children: [
802
+ n ? /* @__PURE__ */ i("span", { className: L.label, children: n }) : null,
803
+ t ? /* @__PURE__ */ i("span", { className: L.value, children: v }) : null
804
+ ] }) : null,
805
+ /* @__PURE__ */ i(
806
+ yt,
807
+ {
808
+ ref: p,
809
+ className: L.input,
810
+ disabled: e,
811
+ value: a,
812
+ defaultValue: o,
813
+ ...l
814
+ }
815
+ )
816
+ ]
817
+ }
818
+ );
819
+ }
820
+ );
821
+ he.displayName = "Slider";
822
+ const be = "_pillInput_1on4g_1", ge = "_disabled_1on4g_26", ke = "_pill_1on4g_1", $e = "_pillText_1on4g_47", Ne = "_pillRemove_1on4g_54", we = "_input_1on4g_74", A = {
823
+ pillInput: be,
824
+ disabled: ge,
825
+ pill: ke,
826
+ pillText: $e,
827
+ pillRemove: Ne,
828
+ input: we
829
+ };
830
+ function xe(...r) {
831
+ return (n) => {
832
+ for (const t of r)
833
+ typeof t == "function" ? t(n) : t && typeof t == "object" && (t.current = n);
834
+ };
835
+ }
836
+ const Ie = B(
837
+ ({
838
+ className: r,
839
+ values: n,
840
+ onChange: t,
841
+ placeholder: e,
842
+ disabled: a,
843
+ maxPills: o,
844
+ delimiters: l = [],
845
+ ...p
846
+ }, v) => {
847
+ const [s, g] = Y([]), [d, _] = Y(""), N = K(null), m = n ?? s, w = $(
848
+ (c) => {
849
+ n || g(c), t?.(c);
850
+ },
851
+ [n, t]
852
+ ), h = $(
853
+ (c) => {
854
+ const D = c.trim();
855
+ D && (m.includes(D) || o != null && m.length >= o || (w([...m, D]), _("")));
856
+ },
857
+ [m, o, w]
858
+ ), k = $(
859
+ (c) => {
860
+ w(m.filter((D, Z) => Z !== c)), N.current?.focus();
861
+ },
862
+ [m, w]
863
+ ), u = $(
864
+ (c) => {
865
+ if (c.key === "Enter") {
866
+ c.preventDefault(), h(d);
867
+ return;
868
+ }
869
+ if (c.key === "Backspace" && d === "" && m.length > 0) {
870
+ k(m.length - 1);
871
+ return;
872
+ }
873
+ l.includes(c.key) && (c.preventDefault(), h(d));
874
+ },
875
+ [d, m, l, h, k]
876
+ ), I = $(() => {
877
+ a || N.current?.focus();
878
+ }, [a]), S = $(
879
+ (c) => {
880
+ !a && (c.key === "Enter" || c.key === " ") && N.current?.focus();
881
+ },
882
+ [a]
883
+ );
884
+ return /* @__PURE__ */ C(
885
+ "div",
886
+ {
887
+ [f]: y.pillInput,
888
+ role: "toolbar",
889
+ className: x(A.pillInput, a && A.disabled, r),
890
+ onClick: I,
891
+ onKeyDown: S,
892
+ ...p,
893
+ children: [
894
+ m.map((c) => /* @__PURE__ */ C("span", { className: A.pill, children: [
895
+ /* @__PURE__ */ i("span", { className: A.pillText, children: c }),
896
+ a ? null : /* @__PURE__ */ i(
897
+ "button",
898
+ {
899
+ type: "button",
900
+ className: A.pillRemove,
901
+ onClick: (D) => {
902
+ D.stopPropagation(), k(m.indexOf(c));
903
+ },
904
+ "aria-label": `Remove ${c}`,
905
+ tabIndex: -1,
906
+ children: /* @__PURE__ */ i(
907
+ "svg",
908
+ {
909
+ viewBox: "0 0 12 12",
910
+ fill: "none",
911
+ stroke: "currentColor",
912
+ strokeWidth: "2",
913
+ strokeLinecap: "round",
914
+ children: /* @__PURE__ */ i("path", { d: "M3 3l6 6M9 3l-6 6" })
915
+ }
916
+ )
917
+ }
918
+ )
919
+ ] }, c)),
920
+ /* @__PURE__ */ i(
921
+ "input",
922
+ {
923
+ ref: xe(v, N),
924
+ className: A.input,
925
+ type: "text",
926
+ value: d,
927
+ onChange: (c) => _(c.target.value),
928
+ onKeyDown: u,
929
+ placeholder: m.length === 0 ? e : void 0,
930
+ disabled: a,
931
+ "aria-label": p["aria-label"],
932
+ "aria-labelledby": p["aria-labelledby"]
933
+ }
934
+ )
935
+ ]
936
+ }
937
+ );
938
+ }
939
+ );
940
+ Ie.displayName = "PillInput";
941
+ const Se = "_dropZone_7sw02_1", We = "_dragOver_7sw02_31", Ce = "_disabled_7sw02_35", Be = "_input_7sw02_44", De = "_content_7sw02_53", Te = "_icon_7sw02_61", Fe = "_text_7sw02_67", M = {
942
+ dropZone: Se,
943
+ dragOver: We,
944
+ disabled: Ce,
945
+ input: Be,
946
+ content: De,
947
+ icon: Te,
948
+ text: Fe
949
+ };
950
+ function Pe(...r) {
951
+ return (n) => {
952
+ for (const t of r)
953
+ typeof t == "function" ? t(n) : t && typeof t == "object" && (t.current = n);
954
+ };
955
+ }
956
+ const Ee = B(
957
+ ({ className: r, onChange: n, accept: t, multiple: e, disabled: a, children: o, ...l }, p) => {
958
+ const [v, s] = Y(!1), g = K(null), d = $(
959
+ (u) => {
960
+ !u || u.length === 0 || n?.(Array.from(u));
961
+ },
962
+ [n]
963
+ ), _ = $(
964
+ (u) => {
965
+ u.preventDefault(), a || s(!0);
966
+ },
967
+ [a]
968
+ ), N = $((u) => {
969
+ u.preventDefault(), s(!1);
970
+ }, []), m = $(
971
+ (u) => {
972
+ u.preventDefault(), s(!1), a || d(u.dataTransfer.files);
973
+ },
974
+ [a, d]
975
+ ), w = $(
976
+ (u) => {
977
+ d(u.target.files), u.target.value = "";
978
+ },
979
+ [d]
980
+ ), h = $(() => {
981
+ a || g.current?.click();
982
+ }, [a]), k = $(
983
+ (u) => {
984
+ !a && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), g.current?.click());
985
+ },
986
+ [a]
987
+ );
988
+ return /* @__PURE__ */ C(
989
+ "div",
990
+ {
991
+ [f]: y.fileDropZone,
992
+ role: "button",
993
+ tabIndex: a ? -1 : 0,
994
+ "aria-disabled": a || void 0,
995
+ className: x(
996
+ M.dropZone,
997
+ v && M.dragOver,
998
+ a && M.disabled,
999
+ r
1000
+ ),
1001
+ onClick: h,
1002
+ onKeyDown: k,
1003
+ onDragOver: _,
1004
+ onDragLeave: N,
1005
+ onDrop: m,
1006
+ ...l,
1007
+ children: [
1008
+ /* @__PURE__ */ i(
1009
+ "input",
1010
+ {
1011
+ ref: Pe(p, g),
1012
+ type: "file",
1013
+ className: M.input,
1014
+ accept: t,
1015
+ multiple: e,
1016
+ disabled: a,
1017
+ onChange: w,
1018
+ tabIndex: -1,
1019
+ "aria-hidden": "true"
1020
+ }
1021
+ ),
1022
+ o ?? /* @__PURE__ */ C("div", { className: M.content, children: [
1023
+ /* @__PURE__ */ C(
1024
+ "svg",
1025
+ {
1026
+ className: M.icon,
1027
+ viewBox: "0 0 24 24",
1028
+ fill: "none",
1029
+ stroke: "currentColor",
1030
+ strokeWidth: "1.5",
1031
+ strokeLinecap: "round",
1032
+ strokeLinejoin: "round",
1033
+ "aria-hidden": "true",
1034
+ children: [
1035
+ /* @__PURE__ */ i("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1036
+ /* @__PURE__ */ i("polyline", { points: "17 8 12 3 7 8" }),
1037
+ /* @__PURE__ */ i("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
1038
+ ]
1039
+ }
1040
+ ),
1041
+ /* @__PURE__ */ i("span", { className: M.text, children: "Drop files here or click to browse" })
1042
+ ] })
1043
+ ]
1044
+ }
1045
+ );
1046
+ }
1047
+ );
1048
+ Ee.displayName = "FileDropZone";
1049
+ const qe = "_badge_1ehok_1", je = "_variantPrimary_1ehok_17", Ve = "_variantSecondary_1ehok_22", Re = "_variantTertiary_1ehok_27", Me = "_sentimentDanger_1ehok_32", Oe = "_sentimentSuccess_1ehok_36", He = "_sentimentWarning_1ehok_40", Le = "_sentimentInfo_1ehok_44", j = {
1050
+ badge: qe,
1051
+ variantPrimary: je,
1052
+ variantSecondary: Ve,
1053
+ variantTertiary: Re,
1054
+ sentimentDanger: Me,
1055
+ sentimentSuccess: Oe,
1056
+ sentimentWarning: He,
1057
+ sentimentInfo: Le
1058
+ }, Ae = {
1059
+ danger: j.sentimentDanger,
1060
+ success: j.sentimentSuccess,
1061
+ warning: j.sentimentWarning,
1062
+ info: j.sentimentInfo
1063
+ }, Ke = G(j.badge, {
771
1064
  variants: {
772
1065
  variant: {
773
- primary: D.variantPrimary,
774
- secondary: D.variantSecondary,
775
- tertiary: D.variantTertiary
1066
+ primary: j.variantPrimary,
1067
+ secondary: j.variantSecondary,
1068
+ tertiary: j.variantTertiary
776
1069
  }
777
1070
  },
778
1071
  defaultVariants: {
779
1072
  variant: "primary"
780
1073
  }
781
- }), lr = B(
782
- ({ className: r, variant: e, sentiment: t, children: n, ...a }, o) => /* @__PURE__ */ i(
1074
+ }), Ge = B(
1075
+ ({ className: r, variant: n, sentiment: t, children: e, ...a }, o) => /* @__PURE__ */ i(
783
1076
  "span",
784
1077
  {
785
1078
  ref: o,
786
- [d]: _.badge,
787
- className: $(
788
- cr({ variant: e }),
789
- t && or[t],
1079
+ [f]: y.badge,
1080
+ className: x(
1081
+ Ke({ variant: n }),
1082
+ t && Ae[t],
790
1083
  r
791
1084
  ),
792
1085
  ...a,
793
- children: n
1086
+ children: e
794
1087
  }
795
1088
  )
796
1089
  );
797
- lr.displayName = "Badge";
798
- const ur = "_divider_1kyjw_1", dr = "_horizontal_1kyjw_7", _r = "_vertical_1kyjw_11", U = {
799
- divider: ur,
800
- horizontal: dr,
801
- vertical: _r
802
- }, mr = B(
803
- ({ className: r, orientation: e = "horizontal", decorative: t = !1, ...n }, a) => /* @__PURE__ */ i(
1090
+ Ge.displayName = "Badge";
1091
+ const Ze = "_divider_1kyjw_1", ze = "_horizontal_1kyjw_7", Ue = "_vertical_1kyjw_11", X = {
1092
+ divider: Ze,
1093
+ horizontal: ze,
1094
+ vertical: Ue
1095
+ }, Ye = B(
1096
+ ({ className: r, orientation: n = "horizontal", decorative: t = !1, ...e }, a) => /* @__PURE__ */ i(
804
1097
  "hr",
805
1098
  {
806
1099
  ref: a,
807
- [d]: _.divider,
808
- className: $(
809
- U.divider,
810
- e === "vertical" ? U.vertical : U.horizontal,
1100
+ [f]: y.divider,
1101
+ className: x(
1102
+ X.divider,
1103
+ n === "vertical" ? X.vertical : X.horizontal,
811
1104
  r
812
1105
  ),
813
- ...t ? { "aria-hidden": !0 } : { role: "separator", "aria-orientation": e },
814
- ...n
1106
+ ...t ? { "aria-hidden": !0 } : { role: "separator", "aria-orientation": n },
1107
+ ...e
815
1108
  }
816
1109
  )
817
1110
  );
818
- mr.displayName = "Divider";
1111
+ Ye.displayName = "Divider";
819
1112
  export {
820
- lr as Badge,
821
- Nt as Button,
822
- qt as ButtonGroup,
823
- On as Checkbox,
824
- mr as Divider,
825
- d as FINRA_UI_ATTR,
826
- Mn as FormField,
827
- Dt as IconButton,
828
- Zt as Input,
829
- Fn as NumberInput,
830
- Xn as Switch,
831
- yn as Textarea,
832
- _ as componentIds
1113
+ Ge as Badge,
1114
+ Bt as Button,
1115
+ At as ButtonGroup,
1116
+ Qn as Checkbox,
1117
+ Ye as Divider,
1118
+ f as FINRA_UI_ATTR,
1119
+ Ee as FileDropZone,
1120
+ Kn as FormField,
1121
+ Ot as IconButton,
1122
+ sn as Input,
1123
+ jn as NumberInput,
1124
+ Ie as PillInput,
1125
+ de as RadioButton,
1126
+ he as Slider,
1127
+ ae as Switch,
1128
+ $n as Textarea,
1129
+ y as componentIds
833
1130
  };
834
1131
  //# sourceMappingURL=index.js.map