@utk09/finra-ui 0.0.1
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/LICENSE +21 -0
- package/dist/Switch-BgWsJGsh.js +67 -0
- package/dist/Switch-BgWsJGsh.js.map +1 -0
- package/dist/components/Badge/Badge.d.ts +12 -0
- package/dist/components/Button/Button.d.ts +15 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +5 -0
- package/dist/components/Checkbox/Checkbox.d.ts +6 -0
- package/dist/components/Divider/Divider.d.ts +7 -0
- package/dist/components/FormField/FormField.d.ts +16 -0
- package/dist/components/IconButton/IconButton.d.ts +11 -0
- package/dist/components/Input/Input.d.ts +16 -0
- package/dist/components/NumberInput/NumberInput.d.ts +19 -0
- package/dist/components/Switch/Switch.d.ts +6 -0
- package/dist/components/Textarea/Textarea.d.ts +17 -0
- package/dist/components/componentIds.d.ts +24 -0
- package/dist/fonts/InclusiveSans-Bold.ttf +0 -0
- package/dist/fonts/InclusiveSans-BoldItalic.ttf +0 -0
- package/dist/fonts/InclusiveSans-Italic.ttf +0 -0
- package/dist/fonts/InclusiveSans-Light.ttf +0 -0
- package/dist/fonts/InclusiveSans-LightItalic.ttf +0 -0
- package/dist/fonts/InclusiveSans-Medium.ttf +0 -0
- package/dist/fonts/InclusiveSans-MediumItalic.ttf +0 -0
- package/dist/fonts/InclusiveSans-Regular.ttf +0 -0
- package/dist/fonts/InclusiveSans-SemiBold.ttf +0 -0
- package/dist/fonts/InclusiveSans-SemiBoldItalic.ttf +0 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +834 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/styles.d.ts +2 -0
- package/dist/types/global.d.ts +14 -0
- package/dist/unstyled/Button/Button.d.ts +5 -0
- package/dist/unstyled/Checkbox/Checkbox.d.ts +5 -0
- package/dist/unstyled/IconButton/IconButton.d.ts +7 -0
- package/dist/unstyled/Input/Input.d.ts +5 -0
- package/dist/unstyled/NumberInput/NumberInput.d.ts +5 -0
- package/dist/unstyled/Slot.d.ts +5 -0
- package/dist/unstyled/Switch/Switch.d.ts +4 -0
- package/dist/unstyled/Textarea/Textarea.d.ts +5 -0
- package/dist/unstyled.d.ts +14 -0
- package/dist/unstyled.js +26 -0
- package/dist/unstyled.js.map +1 -0
- package/package.json +81 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,834 @@
|
|
|
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", _ = {
|
|
5
|
+
// Button family
|
|
6
|
+
button: "button",
|
|
7
|
+
iconButton: "icon-button",
|
|
8
|
+
buttonGroup: "button-group",
|
|
9
|
+
// Input
|
|
10
|
+
input: "input",
|
|
11
|
+
inputField: "input-field",
|
|
12
|
+
// Textarea
|
|
13
|
+
textarea: "textarea",
|
|
14
|
+
textareaField: "textarea-field",
|
|
15
|
+
textareaCount: "textarea-count",
|
|
16
|
+
// NumberInput
|
|
17
|
+
numberInput: "number-input",
|
|
18
|
+
numberInputField: "number-input-field",
|
|
19
|
+
numberInputIncrement: "number-input-increment",
|
|
20
|
+
numberInputDecrement: "number-input-decrement",
|
|
21
|
+
// FormField
|
|
22
|
+
formField: "form-field",
|
|
23
|
+
formFieldLabel: "form-field-label",
|
|
24
|
+
formFieldHelper: "form-field-helper",
|
|
25
|
+
formFieldError: "form-field-error",
|
|
26
|
+
// Checkbox
|
|
27
|
+
checkbox: "checkbox",
|
|
28
|
+
// Switch
|
|
29
|
+
switch: "switch",
|
|
30
|
+
// Badge
|
|
31
|
+
badge: "badge",
|
|
32
|
+
// Divider
|
|
33
|
+
divider: "divider"
|
|
34
|
+
};
|
|
35
|
+
function rt(r) {
|
|
36
|
+
var e, t, n = "";
|
|
37
|
+
if (typeof r == "string" || typeof r == "number") n += r;
|
|
38
|
+
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
39
|
+
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;
|
|
43
|
+
}
|
|
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;
|
|
47
|
+
}
|
|
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({
|
|
64
|
+
...o,
|
|
65
|
+
...y
|
|
66
|
+
}[I]) : {
|
|
67
|
+
...o,
|
|
68
|
+
...y
|
|
69
|
+
}[I] === f;
|
|
70
|
+
}) ? [
|
|
71
|
+
...s,
|
|
72
|
+
v,
|
|
73
|
+
u
|
|
74
|
+
] : s;
|
|
75
|
+
}, []);
|
|
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, {
|
|
94
|
+
variants: {
|
|
95
|
+
variant: {
|
|
96
|
+
primary: C.variantPrimary,
|
|
97
|
+
secondary: C.variantSecondary,
|
|
98
|
+
tertiary: C.variantTertiary
|
|
99
|
+
},
|
|
100
|
+
fullWidth: {
|
|
101
|
+
true: C.fullWidth
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
defaultVariants: {
|
|
105
|
+
variant: "primary"
|
|
106
|
+
}
|
|
107
|
+
}), Nt = B(
|
|
108
|
+
({ className: r, variant: e, fullWidth: t, sentiment: n, startIcon: a, endIcon: o, children: c, ...y }, m) => /* @__PURE__ */ V(
|
|
109
|
+
ct,
|
|
110
|
+
{
|
|
111
|
+
ref: m,
|
|
112
|
+
type: "button",
|
|
113
|
+
[d]: _.button,
|
|
114
|
+
className: $(
|
|
115
|
+
kt({ variant: e, fullWidth: t }),
|
|
116
|
+
n && $t[n],
|
|
117
|
+
r
|
|
118
|
+
),
|
|
119
|
+
...y,
|
|
120
|
+
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
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
);
|
|
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, {
|
|
144
|
+
variants: {
|
|
145
|
+
variant: {
|
|
146
|
+
primary: E.variantPrimary,
|
|
147
|
+
secondary: E.variantSecondary,
|
|
148
|
+
tertiary: E.variantTertiary
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
defaultVariants: {
|
|
152
|
+
variant: "primary"
|
|
153
|
+
}
|
|
154
|
+
}), Dt = B(
|
|
155
|
+
({ className: r, variant: e, sentiment: t, ...n }, a) => /* @__PURE__ */ i(
|
|
156
|
+
lt,
|
|
157
|
+
{
|
|
158
|
+
ref: a,
|
|
159
|
+
type: "button",
|
|
160
|
+
[d]: _.iconButton,
|
|
161
|
+
className: $(
|
|
162
|
+
Et({ variant: e }),
|
|
163
|
+
t && Pt[t],
|
|
164
|
+
r
|
|
165
|
+
),
|
|
166
|
+
...n
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
);
|
|
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(
|
|
176
|
+
"div",
|
|
177
|
+
{
|
|
178
|
+
ref: a,
|
|
179
|
+
role: "group",
|
|
180
|
+
[d]: _.buttonGroup,
|
|
181
|
+
className: $(
|
|
182
|
+
tt.buttonGroup,
|
|
183
|
+
e === "vertical" && tt.vertical,
|
|
184
|
+
r
|
|
185
|
+
),
|
|
186
|
+
...n,
|
|
187
|
+
children: t
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
);
|
|
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, {
|
|
206
|
+
variants: {
|
|
207
|
+
variant: {
|
|
208
|
+
primary: N.variantPrimary,
|
|
209
|
+
secondary: N.variantSecondary,
|
|
210
|
+
tertiary: N.variantTertiary
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
defaultVariants: {
|
|
214
|
+
variant: "primary"
|
|
215
|
+
}
|
|
216
|
+
}), Xt = {
|
|
217
|
+
error: N.statusError,
|
|
218
|
+
warning: N.statusWarning,
|
|
219
|
+
success: N.statusSuccess
|
|
220
|
+
}, Zt = B(
|
|
221
|
+
({
|
|
222
|
+
className: r,
|
|
223
|
+
variant: e,
|
|
224
|
+
validationStatus: t,
|
|
225
|
+
startAdornment: n,
|
|
226
|
+
endAdornment: a,
|
|
227
|
+
clearable: o,
|
|
228
|
+
onClear: c,
|
|
229
|
+
fullWidth: y,
|
|
230
|
+
disabled: m,
|
|
231
|
+
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
|
+
HTMLInputElement.prototype,
|
|
241
|
+
"value"
|
|
242
|
+
)?.set?.call(f.current, ""), f.current.dispatchEvent(new Event("input", { bubbles: !0 }))), f.current?.focus();
|
|
243
|
+
},
|
|
244
|
+
[c, f]
|
|
245
|
+
), F = o && !m && !s && (p ?? v ?? "") !== "";
|
|
246
|
+
return /* @__PURE__ */ V(
|
|
247
|
+
"div",
|
|
248
|
+
{
|
|
249
|
+
[d]: _.input,
|
|
250
|
+
className: $(
|
|
251
|
+
Qt({ variant: e }),
|
|
252
|
+
t && Xt[t],
|
|
253
|
+
m && N.disabled,
|
|
254
|
+
y && N.fullWidth,
|
|
255
|
+
r
|
|
256
|
+
),
|
|
257
|
+
children: [
|
|
258
|
+
n ? /* @__PURE__ */ i("span", { className: N.adornment, children: n }) : null,
|
|
259
|
+
/* @__PURE__ */ i(
|
|
260
|
+
"input",
|
|
261
|
+
{
|
|
262
|
+
ref: f,
|
|
263
|
+
[d]: _.inputField,
|
|
264
|
+
className: N.field,
|
|
265
|
+
disabled: m,
|
|
266
|
+
readOnly: s,
|
|
267
|
+
value: p,
|
|
268
|
+
defaultValue: v,
|
|
269
|
+
onChange: u,
|
|
270
|
+
...k
|
|
271
|
+
}
|
|
272
|
+
),
|
|
273
|
+
F ? /* @__PURE__ */ i(
|
|
274
|
+
"button",
|
|
275
|
+
{
|
|
276
|
+
type: "button",
|
|
277
|
+
className: N.clearButton,
|
|
278
|
+
onClick: h,
|
|
279
|
+
"aria-label": "Clear input",
|
|
280
|
+
tabIndex: -1,
|
|
281
|
+
children: /* @__PURE__ */ i(
|
|
282
|
+
"svg",
|
|
283
|
+
{
|
|
284
|
+
viewBox: "0 0 24 24",
|
|
285
|
+
fill: "none",
|
|
286
|
+
stroke: "currentColor",
|
|
287
|
+
strokeWidth: "2",
|
|
288
|
+
strokeLinecap: "round",
|
|
289
|
+
strokeLinejoin: "round",
|
|
290
|
+
children: /* @__PURE__ */ i("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
291
|
+
}
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
|
+
) : null,
|
|
295
|
+
a ? /* @__PURE__ */ i("span", { className: N.adornment, children: a }) : null
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
);
|
|
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, {
|
|
317
|
+
variants: {
|
|
318
|
+
variant: {
|
|
319
|
+
primary: W.variantPrimary,
|
|
320
|
+
secondary: W.variantSecondary,
|
|
321
|
+
tertiary: W.variantTertiary
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
defaultVariants: {
|
|
325
|
+
variant: "primary"
|
|
326
|
+
}
|
|
327
|
+
}), fn = {
|
|
328
|
+
error: W.statusError,
|
|
329
|
+
warning: W.statusWarning,
|
|
330
|
+
success: W.statusSuccess
|
|
331
|
+
}, yn = B(
|
|
332
|
+
({
|
|
333
|
+
className: r,
|
|
334
|
+
variant: e,
|
|
335
|
+
validationStatus: t,
|
|
336
|
+
showCharCount: n,
|
|
337
|
+
warningThreshold: a,
|
|
338
|
+
autoResize: o,
|
|
339
|
+
minRows: c = 3,
|
|
340
|
+
maxRows: y,
|
|
341
|
+
fullWidth: m,
|
|
342
|
+
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);
|
|
367
|
+
},
|
|
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(
|
|
371
|
+
"div",
|
|
372
|
+
{
|
|
373
|
+
[d]: _.textarea,
|
|
374
|
+
className: $(
|
|
375
|
+
vn({ variant: e }),
|
|
376
|
+
b && fn[b],
|
|
377
|
+
p && W.disabled,
|
|
378
|
+
m && W.fullWidth,
|
|
379
|
+
r
|
|
380
|
+
),
|
|
381
|
+
children: [
|
|
382
|
+
/* @__PURE__ */ i(
|
|
383
|
+
"textarea",
|
|
384
|
+
{
|
|
385
|
+
ref: F,
|
|
386
|
+
[d]: _.textareaField,
|
|
387
|
+
className: W.field,
|
|
388
|
+
rows: c,
|
|
389
|
+
maxLength: s,
|
|
390
|
+
disabled: p,
|
|
391
|
+
readOnly: v,
|
|
392
|
+
value: u,
|
|
393
|
+
defaultValue: k,
|
|
394
|
+
onChange: j,
|
|
395
|
+
...I
|
|
396
|
+
}
|
|
397
|
+
),
|
|
398
|
+
n && s !== void 0 ? /* @__PURE__ */ V(
|
|
399
|
+
"span",
|
|
400
|
+
{
|
|
401
|
+
[d]: _.textareaCount,
|
|
402
|
+
className: $(
|
|
403
|
+
W.charCount,
|
|
404
|
+
G === "warning" && W.charCountWarning,
|
|
405
|
+
G === "error" && W.charCountError
|
|
406
|
+
),
|
|
407
|
+
children: [
|
|
408
|
+
g,
|
|
409
|
+
"/",
|
|
410
|
+
s
|
|
411
|
+
]
|
|
412
|
+
}
|
|
413
|
+
) : null
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
);
|
|
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, {
|
|
433
|
+
variants: {
|
|
434
|
+
variant: {
|
|
435
|
+
primary: S.variantPrimary,
|
|
436
|
+
secondary: S.variantSecondary,
|
|
437
|
+
tertiary: S.variantTertiary
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
defaultVariants: {
|
|
441
|
+
variant: "primary"
|
|
442
|
+
}
|
|
443
|
+
}), Cn = {
|
|
444
|
+
error: S.statusError,
|
|
445
|
+
warning: S.statusWarning,
|
|
446
|
+
success: S.statusSuccess
|
|
447
|
+
};
|
|
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;
|
|
451
|
+
}
|
|
452
|
+
function R(r, e) {
|
|
453
|
+
return e !== void 0 ? r.toFixed(e) : String(r);
|
|
454
|
+
}
|
|
455
|
+
const Fn = B(
|
|
456
|
+
({
|
|
457
|
+
className: r,
|
|
458
|
+
variant: e,
|
|
459
|
+
validationStatus: t,
|
|
460
|
+
value: n,
|
|
461
|
+
defaultValue: a,
|
|
462
|
+
min: o,
|
|
463
|
+
max: c,
|
|
464
|
+
step: y = 1,
|
|
465
|
+
precision: m,
|
|
466
|
+
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);
|
|
482
|
+
},
|
|
483
|
+
[o, c, m, h, s]
|
|
484
|
+
), j = P(
|
|
485
|
+
(b) => {
|
|
486
|
+
const l = parseFloat(w) || 0;
|
|
487
|
+
T(l + y * b);
|
|
488
|
+
},
|
|
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);
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
const q = parseFloat(l);
|
|
498
|
+
isNaN(q) || (h || g(l), s?.(q));
|
|
499
|
+
},
|
|
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));
|
|
507
|
+
},
|
|
508
|
+
[j]
|
|
509
|
+
);
|
|
510
|
+
return /* @__PURE__ */ V(
|
|
511
|
+
"div",
|
|
512
|
+
{
|
|
513
|
+
[d]: _.numberInput,
|
|
514
|
+
className: $(
|
|
515
|
+
In({ variant: e }),
|
|
516
|
+
t && Cn[t],
|
|
517
|
+
v && S.disabled,
|
|
518
|
+
p && S.fullWidth,
|
|
519
|
+
r
|
|
520
|
+
),
|
|
521
|
+
children: [
|
|
522
|
+
/* @__PURE__ */ i(
|
|
523
|
+
"button",
|
|
524
|
+
{
|
|
525
|
+
type: "button",
|
|
526
|
+
[d]: _.numberInputDecrement,
|
|
527
|
+
className: S.stepButton,
|
|
528
|
+
onClick: () => j(-1),
|
|
529
|
+
disabled: v || u || o !== void 0 && (parseFloat(w) || 0) <= o,
|
|
530
|
+
"aria-label": "Decrement",
|
|
531
|
+
tabIndex: -1,
|
|
532
|
+
children: /* @__PURE__ */ i(
|
|
533
|
+
"svg",
|
|
534
|
+
{
|
|
535
|
+
viewBox: "0 0 24 24",
|
|
536
|
+
fill: "none",
|
|
537
|
+
stroke: "currentColor",
|
|
538
|
+
strokeWidth: "2",
|
|
539
|
+
strokeLinecap: "round",
|
|
540
|
+
children: /* @__PURE__ */ i("path", { d: "M5 12h14" })
|
|
541
|
+
}
|
|
542
|
+
)
|
|
543
|
+
}
|
|
544
|
+
),
|
|
545
|
+
/* @__PURE__ */ i(
|
|
546
|
+
"input",
|
|
547
|
+
{
|
|
548
|
+
ref: f,
|
|
549
|
+
[d]: _.numberInputField,
|
|
550
|
+
className: S.field,
|
|
551
|
+
inputMode: "decimal",
|
|
552
|
+
value: w,
|
|
553
|
+
onChange: K,
|
|
554
|
+
onBlur: Y,
|
|
555
|
+
onKeyDown: G,
|
|
556
|
+
disabled: v,
|
|
557
|
+
readOnly: u,
|
|
558
|
+
role: "spinbutton",
|
|
559
|
+
"aria-valuemin": o,
|
|
560
|
+
"aria-valuemax": c,
|
|
561
|
+
"aria-valuenow": typeof w == "string" ? parseFloat(w) || void 0 : w,
|
|
562
|
+
...k
|
|
563
|
+
}
|
|
564
|
+
),
|
|
565
|
+
/* @__PURE__ */ i(
|
|
566
|
+
"button",
|
|
567
|
+
{
|
|
568
|
+
type: "button",
|
|
569
|
+
[d]: _.numberInputIncrement,
|
|
570
|
+
className: S.stepButton,
|
|
571
|
+
onClick: () => j(1),
|
|
572
|
+
disabled: v || u || c !== void 0 && (parseFloat(w) || 0) >= c,
|
|
573
|
+
"aria-label": "Increment",
|
|
574
|
+
tabIndex: -1,
|
|
575
|
+
children: /* @__PURE__ */ i(
|
|
576
|
+
"svg",
|
|
577
|
+
{
|
|
578
|
+
viewBox: "0 0 24 24",
|
|
579
|
+
fill: "none",
|
|
580
|
+
stroke: "currentColor",
|
|
581
|
+
strokeWidth: "2",
|
|
582
|
+
strokeLinecap: "round",
|
|
583
|
+
children: /* @__PURE__ */ i("path", { d: "M12 5v14M5 12h14" })
|
|
584
|
+
}
|
|
585
|
+
)
|
|
586
|
+
}
|
|
587
|
+
)
|
|
588
|
+
]
|
|
589
|
+
}
|
|
590
|
+
);
|
|
591
|
+
}
|
|
592
|
+
);
|
|
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(
|
|
603
|
+
({
|
|
604
|
+
className: r,
|
|
605
|
+
label: e,
|
|
606
|
+
helperText: t,
|
|
607
|
+
errorMessage: n,
|
|
608
|
+
validationStatus: a,
|
|
609
|
+
required: o,
|
|
610
|
+
fullWidth: c,
|
|
611
|
+
disabled: y,
|
|
612
|
+
htmlFor: m,
|
|
613
|
+
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,
|
|
619
|
+
"aria-invalid": a === "error" ? !0 : void 0,
|
|
620
|
+
disabled: y || void 0,
|
|
621
|
+
validationStatus: a
|
|
622
|
+
}) : g);
|
|
623
|
+
return /* @__PURE__ */ V(
|
|
624
|
+
"div",
|
|
625
|
+
{
|
|
626
|
+
ref: v,
|
|
627
|
+
[d]: _.formField,
|
|
628
|
+
className: $(
|
|
629
|
+
M.formField,
|
|
630
|
+
c && M.fullWidth,
|
|
631
|
+
y && M.disabled,
|
|
632
|
+
r
|
|
633
|
+
),
|
|
634
|
+
...p,
|
|
635
|
+
children: [
|
|
636
|
+
/* @__PURE__ */ i(
|
|
637
|
+
"label",
|
|
638
|
+
{
|
|
639
|
+
[d]: _.formFieldLabel,
|
|
640
|
+
htmlFor: k,
|
|
641
|
+
className: $(M.label, o && M.required),
|
|
642
|
+
children: e
|
|
643
|
+
}
|
|
644
|
+
),
|
|
645
|
+
F,
|
|
646
|
+
f ? /* @__PURE__ */ i(
|
|
647
|
+
"p",
|
|
648
|
+
{
|
|
649
|
+
[d]: _.formFieldError,
|
|
650
|
+
id: I,
|
|
651
|
+
className: M.errorMessage,
|
|
652
|
+
role: "alert",
|
|
653
|
+
children: n
|
|
654
|
+
}
|
|
655
|
+
) : null,
|
|
656
|
+
t ? /* @__PURE__ */ i(
|
|
657
|
+
"p",
|
|
658
|
+
{
|
|
659
|
+
[d]: _.formFieldHelper,
|
|
660
|
+
id: x,
|
|
661
|
+
className: M.helperText,
|
|
662
|
+
children: t
|
|
663
|
+
}
|
|
664
|
+
) : null
|
|
665
|
+
]
|
|
666
|
+
}
|
|
667
|
+
);
|
|
668
|
+
}
|
|
669
|
+
);
|
|
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
|
+
};
|
|
678
|
+
function zn(...r) {
|
|
679
|
+
return (e) => {
|
|
680
|
+
for (const t of r)
|
|
681
|
+
typeof t == "function" ? t(e) : t && typeof t == "object" && (t.current = e);
|
|
682
|
+
};
|
|
683
|
+
}
|
|
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(
|
|
690
|
+
"label",
|
|
691
|
+
{
|
|
692
|
+
[d]: _.checkbox,
|
|
693
|
+
className: $(L.checkbox, n && L.disabled, r),
|
|
694
|
+
children: [
|
|
695
|
+
/* @__PURE__ */ i(
|
|
696
|
+
ut,
|
|
697
|
+
{
|
|
698
|
+
ref: zn(o, c),
|
|
699
|
+
className: L.input,
|
|
700
|
+
disabled: n,
|
|
701
|
+
"data-indeterminate": t || void 0,
|
|
702
|
+
...a
|
|
703
|
+
}
|
|
704
|
+
),
|
|
705
|
+
/* @__PURE__ */ i("span", { className: L.indicator, "aria-hidden": "true", children: t ? /* @__PURE__ */ i(
|
|
706
|
+
"svg",
|
|
707
|
+
{
|
|
708
|
+
viewBox: "0 0 12 12",
|
|
709
|
+
fill: "none",
|
|
710
|
+
stroke: "currentColor",
|
|
711
|
+
strokeWidth: "2",
|
|
712
|
+
strokeLinecap: "round",
|
|
713
|
+
children: /* @__PURE__ */ i("path", { d: "M2.5 6h7" })
|
|
714
|
+
}
|
|
715
|
+
) : /* @__PURE__ */ i(
|
|
716
|
+
"svg",
|
|
717
|
+
{
|
|
718
|
+
viewBox: "0 0 12 12",
|
|
719
|
+
fill: "none",
|
|
720
|
+
stroke: "currentColor",
|
|
721
|
+
strokeWidth: "2",
|
|
722
|
+
strokeLinecap: "round",
|
|
723
|
+
strokeLinejoin: "round",
|
|
724
|
+
children: /* @__PURE__ */ i("path", { d: "M2.5 6l2.5 2.5 4.5-5" })
|
|
725
|
+
}
|
|
726
|
+
) }),
|
|
727
|
+
e ? /* @__PURE__ */ i("span", { className: L.label, children: e }) : null
|
|
728
|
+
]
|
|
729
|
+
}
|
|
730
|
+
);
|
|
731
|
+
}
|
|
732
|
+
);
|
|
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 = {
|
|
735
|
+
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
|
+
"label",
|
|
744
|
+
{
|
|
745
|
+
[d]: _.switch,
|
|
746
|
+
className: $(H.switch, t && H.disabled, r),
|
|
747
|
+
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
|
|
751
|
+
]
|
|
752
|
+
}
|
|
753
|
+
)
|
|
754
|
+
);
|
|
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, {
|
|
771
|
+
variants: {
|
|
772
|
+
variant: {
|
|
773
|
+
primary: D.variantPrimary,
|
|
774
|
+
secondary: D.variantSecondary,
|
|
775
|
+
tertiary: D.variantTertiary
|
|
776
|
+
}
|
|
777
|
+
},
|
|
778
|
+
defaultVariants: {
|
|
779
|
+
variant: "primary"
|
|
780
|
+
}
|
|
781
|
+
}), lr = B(
|
|
782
|
+
({ className: r, variant: e, sentiment: t, children: n, ...a }, o) => /* @__PURE__ */ i(
|
|
783
|
+
"span",
|
|
784
|
+
{
|
|
785
|
+
ref: o,
|
|
786
|
+
[d]: _.badge,
|
|
787
|
+
className: $(
|
|
788
|
+
cr({ variant: e }),
|
|
789
|
+
t && or[t],
|
|
790
|
+
r
|
|
791
|
+
),
|
|
792
|
+
...a,
|
|
793
|
+
children: n
|
|
794
|
+
}
|
|
795
|
+
)
|
|
796
|
+
);
|
|
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(
|
|
804
|
+
"hr",
|
|
805
|
+
{
|
|
806
|
+
ref: a,
|
|
807
|
+
[d]: _.divider,
|
|
808
|
+
className: $(
|
|
809
|
+
U.divider,
|
|
810
|
+
e === "vertical" ? U.vertical : U.horizontal,
|
|
811
|
+
r
|
|
812
|
+
),
|
|
813
|
+
...t ? { "aria-hidden": !0 } : { role: "separator", "aria-orientation": e },
|
|
814
|
+
...n
|
|
815
|
+
}
|
|
816
|
+
)
|
|
817
|
+
);
|
|
818
|
+
mr.displayName = "Divider";
|
|
819
|
+
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
|
|
833
|
+
};
|
|
834
|
+
//# sourceMappingURL=index.js.map
|