@utk09/finra-ui 0.0.4 → 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.
- package/dist/Calendar-EtS0i3_l.js +664 -0
- package/dist/Calendar-EtS0i3_l.js.map +1 -0
- package/dist/Calendar.module-D02DGwqf.js +374 -0
- package/dist/Calendar.module-D02DGwqf.js.map +1 -0
- package/dist/DateInput-DhLq-Jah.js +230 -0
- package/dist/DateInput-DhLq-Jah.js.map +1 -0
- package/dist/assets/icons/CalendarIcon.d.ts +2 -0
- package/dist/assets/icons/CheckIcon.d.ts +2 -0
- package/dist/assets/icons/ChevronDownIcon.d.ts +2 -0
- package/dist/assets/icons/ChevronLeftIcon.d.ts +2 -0
- package/dist/assets/icons/ChevronRightIcon.d.ts +2 -0
- package/dist/assets/icons/CloseIcon.d.ts +2 -0
- package/dist/assets/icons/CloseSmallIcon.d.ts +2 -0
- package/dist/assets/icons/DashIcon.d.ts +2 -0
- package/dist/assets/icons/MinusIcon.d.ts +2 -0
- package/dist/assets/icons/PlusIcon.d.ts +2 -0
- package/dist/assets/icons/SpinnerIcon.d.ts +2 -0
- package/dist/assets/icons/UploadIcon.d.ts +2 -0
- package/dist/assets/icons/index.d.ts +12 -0
- package/dist/components/Badge/Badge.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/ComboBox/ComboBox.d.ts +36 -0
- package/dist/components/DateInput/DateInput.d.ts +16 -0
- package/dist/components/DateTenorInput/DateTenorInput.d.ts +16 -0
- package/dist/components/FormField/FormField.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/TenorInput/TenorInput.d.ts +14 -0
- package/dist/components/Textarea/Textarea.d.ts +1 -1
- package/dist/components/componentIds.d.ts +15 -0
- package/dist/dateFormat-CGZCSpqw.js +77 -0
- package/dist/dateFormat-CGZCSpqw.js.map +1 -0
- package/dist/finance.d.ts +8 -0
- package/dist/finance.js +486 -0
- package/dist/finance.js.map +1 -0
- package/dist/index.d.ts +20 -16
- package/dist/index.js +821 -805
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/unstyled/Calendar/Calendar.d.ts +54 -0
- package/dist/unstyled/ComboBox/ComboBox.d.ts +108 -0
- package/dist/unstyled/DateInput/DateInput.d.ts +58 -0
- package/dist/unstyled/DateTenorInput/DateTenorInput.d.ts +78 -0
- package/dist/unstyled/FormField/FormField.d.ts +1 -1
- package/dist/unstyled/Slot.d.ts +1 -1
- package/dist/unstyled/TenorInput/TenorInput.d.ts +27 -0
- package/dist/unstyled.d.ts +24 -18
- package/dist/unstyled.js +146 -153
- package/dist/unstyled.js.map +1 -1
- package/dist/utils/dateFormat.d.ts +17 -0
- package/dist/utils/mergeRefs.d.ts +2 -0
- package/dist/utils/tenor.d.ts +15 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +98 -0
- package/dist/utils.js.map +1 -0
- package/package.json +11 -1
- package/dist/Slider-BXQjDfhb.js +0 -73
- package/dist/Slider-BXQjDfhb.js.map +0 -1
package/dist/finance.js
ADDED
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
import { jsx as d, jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import { c as q, C as ge, a as H, F as z, b as p, d as he, e as Se, f as Ie, g as Ne, h as Te } from "./Calendar.module-D02DGwqf.js";
|
|
3
|
+
import { forwardRef as U, useMemo as P, useCallback as y, useRef as F, useState as V, useEffect as ee } from "react";
|
|
4
|
+
import { parseTenor as re, STANDARD_TENORS as J, resolveTenor as Be, dateToTenor as te } from "./utils.js";
|
|
5
|
+
import { C as De, a as be } from "./Calendar-EtS0i3_l.js";
|
|
6
|
+
import { g as Ce, a as we, f as L, p as ne, v as Oe, b as Ae, m as Re } from "./dateFormat-CGZCSpqw.js";
|
|
7
|
+
function ke(r, n) {
|
|
8
|
+
let t;
|
|
9
|
+
if (r)
|
|
10
|
+
t = r;
|
|
11
|
+
else if (t = [...J], n)
|
|
12
|
+
for (const o of n)
|
|
13
|
+
t.includes(o) || t.push(o);
|
|
14
|
+
return t.map((o) => ({ value: o, label: o }));
|
|
15
|
+
}
|
|
16
|
+
function xe(r, n) {
|
|
17
|
+
const t = n.toUpperCase();
|
|
18
|
+
return r.label.toUpperCase().includes(t);
|
|
19
|
+
}
|
|
20
|
+
const Ee = U(
|
|
21
|
+
({
|
|
22
|
+
value: r,
|
|
23
|
+
onChange: n,
|
|
24
|
+
extraTenors: t,
|
|
25
|
+
allowedTenors: o,
|
|
26
|
+
allowCustom: i = !1,
|
|
27
|
+
placeholder: a = "Select tenor...",
|
|
28
|
+
className: u,
|
|
29
|
+
noOptionsMessage: f = "No matching tenors",
|
|
30
|
+
...N
|
|
31
|
+
}, T) => {
|
|
32
|
+
const B = P(
|
|
33
|
+
() => ke(o, t),
|
|
34
|
+
[o, t]
|
|
35
|
+
), _ = y(
|
|
36
|
+
(v) => {
|
|
37
|
+
const g = Array.isArray(v) ? v[0] ?? null : v;
|
|
38
|
+
n?.(g);
|
|
39
|
+
},
|
|
40
|
+
[n]
|
|
41
|
+
), m = y(
|
|
42
|
+
(v) => {
|
|
43
|
+
const g = re(v);
|
|
44
|
+
g.valid && g.tenor && n?.(g.tenor);
|
|
45
|
+
},
|
|
46
|
+
[n]
|
|
47
|
+
);
|
|
48
|
+
return /* @__PURE__ */ d("div", { [z]: q.tenorInput, children: /* @__PURE__ */ d(
|
|
49
|
+
ge,
|
|
50
|
+
{
|
|
51
|
+
ref: T,
|
|
52
|
+
options: B,
|
|
53
|
+
value: r,
|
|
54
|
+
onChange: _,
|
|
55
|
+
filterFn: xe,
|
|
56
|
+
creatable: i,
|
|
57
|
+
onCreateOption: i ? m : void 0,
|
|
58
|
+
formatCreateLabel: i ? (v) => `Use "${v.toUpperCase()}"` : void 0,
|
|
59
|
+
placeholder: a,
|
|
60
|
+
className: H(u),
|
|
61
|
+
noOptionsMessage: f,
|
|
62
|
+
...N
|
|
63
|
+
}
|
|
64
|
+
) });
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
Ee.displayName = "TenorInput";
|
|
68
|
+
function Le(r, n) {
|
|
69
|
+
let t;
|
|
70
|
+
if (r)
|
|
71
|
+
t = r;
|
|
72
|
+
else if (t = [...J], n)
|
|
73
|
+
for (const o of n)
|
|
74
|
+
t.includes(o) || t.push(o);
|
|
75
|
+
return t.map((o) => ({ value: o, label: o }));
|
|
76
|
+
}
|
|
77
|
+
function Ue(r, n) {
|
|
78
|
+
const t = n.toUpperCase();
|
|
79
|
+
return r.label.toUpperCase().includes(t);
|
|
80
|
+
}
|
|
81
|
+
const Pe = U(
|
|
82
|
+
({
|
|
83
|
+
value: r,
|
|
84
|
+
onChange: n,
|
|
85
|
+
extraTenors: t,
|
|
86
|
+
allowedTenors: o,
|
|
87
|
+
allowCustom: i = !1,
|
|
88
|
+
placeholder: a = "Select tenor...",
|
|
89
|
+
disabled: u,
|
|
90
|
+
open: f,
|
|
91
|
+
onOpenChange: N,
|
|
92
|
+
classNames: T,
|
|
93
|
+
dataAttributes: B,
|
|
94
|
+
renderCheckIcon: _,
|
|
95
|
+
renderIndicator: m,
|
|
96
|
+
renderPillRemoveIcon: v,
|
|
97
|
+
renderLoading: g,
|
|
98
|
+
...M
|
|
99
|
+
}, l) => {
|
|
100
|
+
const W = P(
|
|
101
|
+
() => Le(o, t),
|
|
102
|
+
[o, t]
|
|
103
|
+
), R = y(
|
|
104
|
+
(h) => {
|
|
105
|
+
const D = Array.isArray(h) ? h[0] ?? null : h;
|
|
106
|
+
n?.(D);
|
|
107
|
+
},
|
|
108
|
+
[n]
|
|
109
|
+
), k = y(
|
|
110
|
+
(h) => {
|
|
111
|
+
const D = re(h);
|
|
112
|
+
D.valid && D.tenor && n?.(D.tenor);
|
|
113
|
+
},
|
|
114
|
+
[n]
|
|
115
|
+
);
|
|
116
|
+
return /* @__PURE__ */ d(
|
|
117
|
+
De,
|
|
118
|
+
{
|
|
119
|
+
ref: l,
|
|
120
|
+
options: W,
|
|
121
|
+
value: r,
|
|
122
|
+
onChange: R,
|
|
123
|
+
filterFn: Ue,
|
|
124
|
+
creatable: i,
|
|
125
|
+
onCreateOption: i ? k : void 0,
|
|
126
|
+
formatCreateLabel: i ? (h) => `Use "${h.toUpperCase()}"` : void 0,
|
|
127
|
+
placeholder: a,
|
|
128
|
+
disabled: u,
|
|
129
|
+
open: f,
|
|
130
|
+
onOpenChange: N,
|
|
131
|
+
classNames: T,
|
|
132
|
+
dataAttributes: B,
|
|
133
|
+
renderCheckIcon: _,
|
|
134
|
+
renderIndicator: m,
|
|
135
|
+
renderPillRemoveIcon: v,
|
|
136
|
+
renderLoading: g,
|
|
137
|
+
noOptionsMessage: "No matching tenors",
|
|
138
|
+
...M
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
Pe.displayName = "TenorInputBase";
|
|
144
|
+
function Me(r, n, t) {
|
|
145
|
+
const o = r.replace(/\D/g, "");
|
|
146
|
+
let i = "", a = 0;
|
|
147
|
+
for (let u = 0; u < n.length && a < o.length; u++) {
|
|
148
|
+
u > 0 && (i += t);
|
|
149
|
+
const f = n[u];
|
|
150
|
+
i += o.slice(a, a + f), a += f;
|
|
151
|
+
}
|
|
152
|
+
return i;
|
|
153
|
+
}
|
|
154
|
+
function We(r, n) {
|
|
155
|
+
const t = r.reduce((i, a) => i + a, 0), o = r.length - 1;
|
|
156
|
+
return t + o * n.length;
|
|
157
|
+
}
|
|
158
|
+
function Y(...r) {
|
|
159
|
+
return r.filter(Boolean).join(" ") || void 0;
|
|
160
|
+
}
|
|
161
|
+
const oe = U(
|
|
162
|
+
({
|
|
163
|
+
dateValue: r,
|
|
164
|
+
tenorValue: n,
|
|
165
|
+
onChange: t,
|
|
166
|
+
referenceDate: o,
|
|
167
|
+
tenorResolver: i,
|
|
168
|
+
dateFormat: a = "YYYY-MM-DD",
|
|
169
|
+
minDate: u,
|
|
170
|
+
maxDate: f,
|
|
171
|
+
disabledDates: N,
|
|
172
|
+
extraTenors: T,
|
|
173
|
+
allowedTenors: B,
|
|
174
|
+
disabled: _,
|
|
175
|
+
readOnly: m,
|
|
176
|
+
datePlaceholder: v,
|
|
177
|
+
tenorSectionTitle: g = "Tenor",
|
|
178
|
+
weekStartsOn: M,
|
|
179
|
+
classNames: l,
|
|
180
|
+
dataAttributes: W,
|
|
181
|
+
renderCalendarIcon: R,
|
|
182
|
+
renderIndicator: k,
|
|
183
|
+
renderCalendarNavPrev: h,
|
|
184
|
+
renderCalendarNavNext: D,
|
|
185
|
+
dateId: ae,
|
|
186
|
+
dateAriaLabel: se,
|
|
187
|
+
tenorAriaLabel: ie,
|
|
188
|
+
...ce
|
|
189
|
+
}, le) => {
|
|
190
|
+
const G = F(null), K = F(null), b = Ce(a), $ = we(a), j = We($, b), [S, C] = V(!1), [w, x] = V(() => r ? L(r, a) : "");
|
|
191
|
+
ee(() => {
|
|
192
|
+
r !== void 0 && x(r === null ? "" : L(r, a));
|
|
193
|
+
}, [r, a]);
|
|
194
|
+
const de = P(() => {
|
|
195
|
+
if (B) return B;
|
|
196
|
+
const e = [...J];
|
|
197
|
+
if (T)
|
|
198
|
+
for (const c of T)
|
|
199
|
+
e.includes(c) || e.push(c);
|
|
200
|
+
return e;
|
|
201
|
+
}, [B, T]), O = y(() => o ?? /* @__PURE__ */ new Date(), [o]), Q = y(
|
|
202
|
+
(e, c) => i ? i(e, c) : Be(e, c),
|
|
203
|
+
[i]
|
|
204
|
+
);
|
|
205
|
+
ee(() => {
|
|
206
|
+
if (!S) return;
|
|
207
|
+
const e = (c) => {
|
|
208
|
+
G.current && !G.current.contains(c.target) && C(!1);
|
|
209
|
+
};
|
|
210
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
211
|
+
}, [S]);
|
|
212
|
+
const X = y(() => {
|
|
213
|
+
_ || m || C((e) => !e);
|
|
214
|
+
}, [_, m]), ue = y(
|
|
215
|
+
(e) => {
|
|
216
|
+
if (_ || m) return;
|
|
217
|
+
const I = e.target.value.split("").filter((Z) => /\d/.test(Z) || Z === b).join(""), me = Me(I, $, b).slice(0, j);
|
|
218
|
+
x(me);
|
|
219
|
+
},
|
|
220
|
+
[_, m, b, $, j]
|
|
221
|
+
), pe = y(() => {
|
|
222
|
+
if (w.trim() === "") {
|
|
223
|
+
t?.({ date: null, tenor: null });
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
const e = ne(w, a);
|
|
227
|
+
if (!e.valid || !e.date) return;
|
|
228
|
+
const c = Oe(e.date, {
|
|
229
|
+
min: u,
|
|
230
|
+
max: f,
|
|
231
|
+
disabledDates: N
|
|
232
|
+
});
|
|
233
|
+
if (!c.valid || !c.date) return;
|
|
234
|
+
const I = O(), A = te(c.date, I);
|
|
235
|
+
t?.({ date: c.date, tenor: A });
|
|
236
|
+
}, [w, a, t, u, f, N, O]), fe = y(
|
|
237
|
+
(e) => {
|
|
238
|
+
if (e.key === "Escape" && S) {
|
|
239
|
+
C(!1);
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
[
|
|
243
|
+
"Backspace",
|
|
244
|
+
"Delete",
|
|
245
|
+
"Tab",
|
|
246
|
+
"ArrowLeft",
|
|
247
|
+
"ArrowRight",
|
|
248
|
+
"ArrowUp",
|
|
249
|
+
"ArrowDown",
|
|
250
|
+
"Home",
|
|
251
|
+
"End",
|
|
252
|
+
"Escape"
|
|
253
|
+
].includes(e.key) || e.ctrlKey || e.metaKey || /^\d$/.test(e.key) || e.key !== b && e.preventDefault();
|
|
254
|
+
},
|
|
255
|
+
[b, S]
|
|
256
|
+
), ye = y(
|
|
257
|
+
(e) => {
|
|
258
|
+
const c = L(e, a);
|
|
259
|
+
x(c);
|
|
260
|
+
const I = O(), A = te(e, I);
|
|
261
|
+
t?.({ date: e, tenor: A }), C(!1), K.current?.focus();
|
|
262
|
+
},
|
|
263
|
+
[a, t, O]
|
|
264
|
+
), _e = y(
|
|
265
|
+
(e) => {
|
|
266
|
+
const c = O(), I = Q(e, c);
|
|
267
|
+
if (I) {
|
|
268
|
+
const A = L(I, a);
|
|
269
|
+
x(A);
|
|
270
|
+
}
|
|
271
|
+
t?.(e === n ? { date: null, tenor: null } : { date: I, tenor: e }), C(!1), K.current?.focus();
|
|
272
|
+
},
|
|
273
|
+
[O, Q, a, t, n]
|
|
274
|
+
), ve = r !== void 0 ? r : (() => {
|
|
275
|
+
if (!w) return null;
|
|
276
|
+
const e = ne(w, a);
|
|
277
|
+
return e.valid ? e.date : null;
|
|
278
|
+
})();
|
|
279
|
+
return /* @__PURE__ */ E("div", { ref: Re(le, G), className: l?.root, ...W, ...ce, children: [
|
|
280
|
+
/* @__PURE__ */ E("div", { className: Y(l?.trigger, S && l?.triggerOpen), children: [
|
|
281
|
+
/* @__PURE__ */ d(
|
|
282
|
+
"input",
|
|
283
|
+
{
|
|
284
|
+
ref: K,
|
|
285
|
+
className: l?.dateInput,
|
|
286
|
+
type: "text",
|
|
287
|
+
inputMode: "numeric",
|
|
288
|
+
id: ae,
|
|
289
|
+
value: w,
|
|
290
|
+
placeholder: v ?? Ae(a),
|
|
291
|
+
disabled: _,
|
|
292
|
+
readOnly: m,
|
|
293
|
+
maxLength: j,
|
|
294
|
+
"aria-label": se,
|
|
295
|
+
onChange: ue,
|
|
296
|
+
onBlur: pe,
|
|
297
|
+
onKeyDown: fe,
|
|
298
|
+
onClick: () => {
|
|
299
|
+
!_ && !m && !S && C(!0);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
),
|
|
303
|
+
n ? /* @__PURE__ */ d("span", { className: l?.tenorBadge, children: n }) : null,
|
|
304
|
+
R ? /* @__PURE__ */ d(
|
|
305
|
+
"button",
|
|
306
|
+
{
|
|
307
|
+
type: "button",
|
|
308
|
+
className: l?.calendarButton,
|
|
309
|
+
onClick: X,
|
|
310
|
+
tabIndex: -1,
|
|
311
|
+
"aria-label": "Toggle date and tenor picker",
|
|
312
|
+
disabled: _,
|
|
313
|
+
children: R()
|
|
314
|
+
}
|
|
315
|
+
) : null,
|
|
316
|
+
k ? /* @__PURE__ */ d(
|
|
317
|
+
"span",
|
|
318
|
+
{
|
|
319
|
+
className: Y(l?.indicator, S && l?.indicatorOpen),
|
|
320
|
+
"aria-hidden": "true",
|
|
321
|
+
onMouseDown: (e) => {
|
|
322
|
+
e.preventDefault(), X();
|
|
323
|
+
},
|
|
324
|
+
children: k(S)
|
|
325
|
+
}
|
|
326
|
+
) : null
|
|
327
|
+
] }),
|
|
328
|
+
S ? /* @__PURE__ */ E("div", { className: l?.popup, children: [
|
|
329
|
+
/* @__PURE__ */ d("div", { className: l?.calendarSection, children: /* @__PURE__ */ d(
|
|
330
|
+
be,
|
|
331
|
+
{
|
|
332
|
+
value: ve,
|
|
333
|
+
onSelect: ye,
|
|
334
|
+
min: u,
|
|
335
|
+
max: f,
|
|
336
|
+
disabledDates: N,
|
|
337
|
+
weekStartsOn: M,
|
|
338
|
+
classNames: l?.calendar,
|
|
339
|
+
renderNavPrev: h,
|
|
340
|
+
renderNavNext: D
|
|
341
|
+
}
|
|
342
|
+
) }),
|
|
343
|
+
/* @__PURE__ */ E("div", { className: l?.tenorSection, role: "listbox", "aria-label": ie ?? "Tenor", children: [
|
|
344
|
+
g ? /* @__PURE__ */ d("div", { className: l?.tenorTitle, "aria-hidden": "true", children: g }) : null,
|
|
345
|
+
/* @__PURE__ */ d("div", { className: l?.tenorGrid, children: de.map((e) => /* @__PURE__ */ d(
|
|
346
|
+
"button",
|
|
347
|
+
{
|
|
348
|
+
type: "button",
|
|
349
|
+
role: "option",
|
|
350
|
+
"aria-selected": e === n || void 0,
|
|
351
|
+
className: Y(l?.tenor, e === n && l?.tenorSelected),
|
|
352
|
+
onMouseDown: (c) => {
|
|
353
|
+
c.preventDefault(), _e(e);
|
|
354
|
+
},
|
|
355
|
+
children: e
|
|
356
|
+
},
|
|
357
|
+
e
|
|
358
|
+
)) })
|
|
359
|
+
] })
|
|
360
|
+
] }) : null
|
|
361
|
+
] });
|
|
362
|
+
}
|
|
363
|
+
);
|
|
364
|
+
oe.displayName = "DateTenorInputBase";
|
|
365
|
+
const Ge = "_root_s79ry_1", Ke = "_fullWidth_s79ry_6", $e = "_trigger_s79ry_10", je = "_variantPrimary_s79ry_34", Ye = "_variantSecondary_s79ry_37", He = "_variantTertiary_s79ry_41", qe = "_statusError_s79ry_49", ze = "_statusWarning_s79ry_52", Je = "_statusSuccess_s79ry_55", Qe = "_open_s79ry_58", Xe = "_disabled_s79ry_63", Ze = "_dateInput_s79ry_72", Fe = "_tenorBadge_s79ry_75", Ve = "_calendarButton_s79ry_80", et = "_indicator_s79ry_81", tt = "_indicatorOpen_s79ry_166", nt = "_popup_s79ry_170", rt = "_calendarSection_s79ry_185", ot = "_tenorSection_s79ry_190", at = "_tenorTitle_s79ry_200", st = "_tenorGrid_s79ry_216", it = "_tenor_s79ry_75", ct = "_tenorSelected_s79ry_245", s = {
|
|
366
|
+
root: Ge,
|
|
367
|
+
fullWidth: Ke,
|
|
368
|
+
trigger: $e,
|
|
369
|
+
variantPrimary: je,
|
|
370
|
+
variantSecondary: Ye,
|
|
371
|
+
variantTertiary: He,
|
|
372
|
+
statusError: qe,
|
|
373
|
+
statusWarning: ze,
|
|
374
|
+
statusSuccess: Je,
|
|
375
|
+
open: Qe,
|
|
376
|
+
disabled: Xe,
|
|
377
|
+
dateInput: Ze,
|
|
378
|
+
tenorBadge: Fe,
|
|
379
|
+
calendarButton: Ve,
|
|
380
|
+
indicator: et,
|
|
381
|
+
indicatorOpen: tt,
|
|
382
|
+
popup: nt,
|
|
383
|
+
calendarSection: rt,
|
|
384
|
+
tenorSection: ot,
|
|
385
|
+
tenorTitle: at,
|
|
386
|
+
tenorGrid: st,
|
|
387
|
+
tenor: it,
|
|
388
|
+
tenorSelected: ct
|
|
389
|
+
}, lt = he(s.trigger, {
|
|
390
|
+
variants: {
|
|
391
|
+
variant: {
|
|
392
|
+
primary: s.variantPrimary,
|
|
393
|
+
secondary: s.variantSecondary,
|
|
394
|
+
tertiary: s.variantTertiary
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
defaultVariants: {
|
|
398
|
+
variant: "primary"
|
|
399
|
+
}
|
|
400
|
+
}), dt = {
|
|
401
|
+
error: s.statusError,
|
|
402
|
+
warning: s.statusWarning,
|
|
403
|
+
success: s.statusSuccess
|
|
404
|
+
}, ut = { [z]: q.dateTenorInput };
|
|
405
|
+
function pt() {
|
|
406
|
+
return /* @__PURE__ */ d(Te, { "aria-hidden": "true", [z]: q.calendarIcon });
|
|
407
|
+
}
|
|
408
|
+
function ft(r) {
|
|
409
|
+
return /* @__PURE__ */ d(Ne, {});
|
|
410
|
+
}
|
|
411
|
+
function yt() {
|
|
412
|
+
return /* @__PURE__ */ d(Ie, { "aria-hidden": "true" });
|
|
413
|
+
}
|
|
414
|
+
function _t() {
|
|
415
|
+
return /* @__PURE__ */ d(Se, { "aria-hidden": "true" });
|
|
416
|
+
}
|
|
417
|
+
const vt = U(
|
|
418
|
+
({ className: r, variant: n, validationStatus: t, fullWidth: o, disabled: i, ...a }, u) => {
|
|
419
|
+
const f = P(
|
|
420
|
+
() => ({
|
|
421
|
+
root: H(
|
|
422
|
+
s.root,
|
|
423
|
+
o && s.fullWidth,
|
|
424
|
+
i && s.disabled,
|
|
425
|
+
r
|
|
426
|
+
),
|
|
427
|
+
trigger: H(
|
|
428
|
+
lt({ variant: n }),
|
|
429
|
+
t && dt[t]
|
|
430
|
+
),
|
|
431
|
+
triggerOpen: s.open,
|
|
432
|
+
dateInput: s.dateInput,
|
|
433
|
+
tenorBadge: s.tenorBadge,
|
|
434
|
+
calendarButton: s.calendarButton,
|
|
435
|
+
indicator: s.indicator,
|
|
436
|
+
indicatorOpen: s.indicatorOpen,
|
|
437
|
+
popup: s.popup,
|
|
438
|
+
calendarSection: s.calendarSection,
|
|
439
|
+
tenorSection: s.tenorSection,
|
|
440
|
+
tenorTitle: s.tenorTitle,
|
|
441
|
+
tenorGrid: s.tenorGrid,
|
|
442
|
+
tenor: s.tenor,
|
|
443
|
+
tenorSelected: s.tenorSelected,
|
|
444
|
+
calendar: {
|
|
445
|
+
root: p.root,
|
|
446
|
+
header: p.header,
|
|
447
|
+
navButton: p.navButton,
|
|
448
|
+
title: p.title,
|
|
449
|
+
weekdayRow: p.weekdayRow,
|
|
450
|
+
weekday: p.weekday,
|
|
451
|
+
grid: p.grid,
|
|
452
|
+
row: p.row,
|
|
453
|
+
day: p.day,
|
|
454
|
+
dayToday: p.dayToday,
|
|
455
|
+
daySelected: p.daySelected,
|
|
456
|
+
dayDisabled: p.dayDisabled,
|
|
457
|
+
dayOutside: p.dayOutside,
|
|
458
|
+
footer: p.footer
|
|
459
|
+
}
|
|
460
|
+
}),
|
|
461
|
+
[r, n, t, o, i]
|
|
462
|
+
);
|
|
463
|
+
return /* @__PURE__ */ d(
|
|
464
|
+
oe,
|
|
465
|
+
{
|
|
466
|
+
ref: u,
|
|
467
|
+
disabled: i,
|
|
468
|
+
classNames: f,
|
|
469
|
+
dataAttributes: ut,
|
|
470
|
+
renderCalendarIcon: pt,
|
|
471
|
+
renderIndicator: ft,
|
|
472
|
+
renderCalendarNavPrev: yt,
|
|
473
|
+
renderCalendarNavNext: _t,
|
|
474
|
+
...a
|
|
475
|
+
}
|
|
476
|
+
);
|
|
477
|
+
}
|
|
478
|
+
);
|
|
479
|
+
vt.displayName = "DateTenorInput";
|
|
480
|
+
export {
|
|
481
|
+
vt as DateTenorInput,
|
|
482
|
+
oe as DateTenorInputBase,
|
|
483
|
+
Ee as TenorInput,
|
|
484
|
+
Pe as TenorInputBase
|
|
485
|
+
};
|
|
486
|
+
//# sourceMappingURL=finance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finance.js","sources":["../src/components/TenorInput/TenorInput.tsx","../src/unstyled/TenorInput/TenorInput.tsx","../src/unstyled/DateTenorInput/DateTenorInput.tsx","../src/components/DateTenorInput/DateTenorInput.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { forwardRef, useCallback, useMemo } from \"react\";\n\nimport { parseTenor, STANDARD_TENORS } from \"../../utils/tenor\";\nimport { ComboBox, type ComboBoxOption, type ComboBoxProps } from \"../ComboBox/ComboBox\";\nimport { componentIds, FINRA_UI_ATTR } from \"../componentIds\";\n\nexport interface TenorInputProps extends Omit<\n ComboBoxProps<string>,\n | \"options\"\n | \"multiple\"\n | \"creatable\"\n | \"onCreateOption\"\n | \"formatCreateLabel\"\n | \"value\"\n | \"onChange\"\n> {\n /** Selected tenor value. */\n value?: string | null;\n /** Called when tenor changes. */\n onChange?: (tenor: string | null) => void;\n /** Additional tenors beyond the standard set. */\n extraTenors?: string[];\n /** Restrict to only these tenors. */\n allowedTenors?: string[];\n /** Allow free-text tenor input (e.g. \"4M\"). */\n allowCustom?: boolean;\n}\n\nfunction buildTenorOptions(\n allowedTenors?: string[],\n extraTenors?: string[],\n): ComboBoxOption<string>[] {\n let tenors: string[];\n\n if (allowedTenors) {\n tenors = allowedTenors;\n } else {\n tenors = [...STANDARD_TENORS];\n if (extraTenors) {\n for (const t of extraTenors) {\n if (!tenors.includes(t)) {\n tenors.push(t);\n }\n }\n }\n }\n\n return tenors.map((t) => ({ value: t, label: t }));\n}\n\nfunction tenorFilterFn(option: ComboBoxOption<string>, inputValue: string): boolean {\n const needle = inputValue.toUpperCase();\n return option.label.toUpperCase().includes(needle);\n}\n\nexport const TenorInput = forwardRef<HTMLInputElement, TenorInputProps>(\n (\n {\n value,\n onChange,\n extraTenors,\n allowedTenors,\n allowCustom = false,\n placeholder = \"Select tenor...\",\n className,\n noOptionsMessage = \"No matching tenors\",\n ...props\n },\n ref,\n ) => {\n const options = useMemo(\n () => buildTenorOptions(allowedTenors, extraTenors),\n [allowedTenors, extraTenors],\n );\n\n const handleChange = useCallback(\n (val: string | string[] | null) => {\n const tenor = Array.isArray(val) ? (val[0] ?? null) : val;\n onChange?.(tenor);\n },\n [onChange],\n );\n\n const handleCreateOption = useCallback(\n (inputValue: string) => {\n const parsed = parseTenor(inputValue);\n if (parsed.valid && parsed.tenor) {\n onChange?.(parsed.tenor);\n }\n },\n [onChange],\n );\n\n return (\n <div {...{ [FINRA_UI_ATTR]: componentIds.tenorInput }}>\n <ComboBox<string>\n ref={ref}\n options={options}\n value={value}\n onChange={handleChange}\n filterFn={tenorFilterFn}\n creatable={allowCustom}\n onCreateOption={allowCustom ? handleCreateOption : undefined}\n formatCreateLabel={allowCustom ? (v) => `Use \"${v.toUpperCase()}\"` : undefined}\n placeholder={placeholder}\n className={clsx(className)}\n noOptionsMessage={noOptionsMessage}\n {...props}\n />\n </div>\n );\n },\n);\n\nTenorInput.displayName = \"TenorInput\";\n","import { forwardRef, type HTMLAttributes, type ReactNode, useCallback, useMemo } from \"react\";\n\nimport { parseTenor, STANDARD_TENORS } from \"../../utils/tenor\";\nimport { ComboBoxBase, type ComboBoxClassNames, type ComboBoxOption } from \"../ComboBox/ComboBox\";\n\nexport interface TenorInputClassNames extends ComboBoxClassNames {}\n\nexport interface TenorInputBaseProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n \"onChange\" | \"defaultValue\"\n> {\n /** Selected tenor value. */\n value?: string | null;\n /** Called when tenor changes. */\n onChange?: (tenor: string | null) => void;\n /** Additional tenors beyond the standard set. */\n extraTenors?: string[];\n /** Restrict to only these tenors. */\n allowedTenors?: string[];\n /** Allow free-text tenor input (e.g. \"4M\"). */\n allowCustom?: boolean;\n placeholder?: string;\n disabled?: boolean;\n\n // Open state\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n\n // Style injection (same pattern as ComboBox)\n classNames?: TenorInputClassNames;\n dataAttributes?: Record<string, string>;\n renderCheckIcon?: () => ReactNode;\n renderIndicator?: (isOpen: boolean) => ReactNode;\n renderPillRemoveIcon?: () => ReactNode;\n renderLoading?: () => ReactNode;\n}\n\nfunction buildTenorOptions(\n allowedTenors?: string[],\n extraTenors?: string[],\n): ComboBoxOption<string>[] {\n let tenors: string[];\n\n if (allowedTenors) {\n tenors = allowedTenors;\n } else {\n tenors = [...STANDARD_TENORS];\n if (extraTenors) {\n for (const t of extraTenors) {\n if (!tenors.includes(t)) {\n tenors.push(t);\n }\n }\n }\n }\n\n return tenors.map((t) => ({ value: t, label: t }));\n}\n\nfunction tenorFilterFn(option: ComboBoxOption<string>, inputValue: string): boolean {\n const needle = inputValue.toUpperCase();\n return option.label.toUpperCase().includes(needle);\n}\n\nexport const TenorInputBase = forwardRef<HTMLInputElement, TenorInputBaseProps>(\n (\n {\n value,\n onChange,\n extraTenors,\n allowedTenors,\n allowCustom = false,\n placeholder = \"Select tenor...\",\n disabled,\n open,\n onOpenChange,\n classNames,\n dataAttributes,\n renderCheckIcon,\n renderIndicator,\n renderPillRemoveIcon,\n renderLoading,\n ...props\n },\n ref,\n ) => {\n const options = useMemo(\n () => buildTenorOptions(allowedTenors, extraTenors),\n [allowedTenors, extraTenors],\n );\n\n const handleChange = useCallback(\n (val: string | string[] | null) => {\n // TenorInput is always single-select\n const tenor = Array.isArray(val) ? (val[0] ?? null) : val;\n onChange?.(tenor);\n },\n [onChange],\n );\n\n const handleCreateOption = useCallback(\n (inputValue: string) => {\n const parsed = parseTenor(inputValue);\n if (parsed.valid && parsed.tenor) {\n onChange?.(parsed.tenor);\n }\n },\n [onChange],\n );\n\n return (\n <ComboBoxBase<string>\n ref={ref}\n options={options}\n value={value}\n onChange={handleChange}\n filterFn={tenorFilterFn}\n creatable={allowCustom}\n onCreateOption={allowCustom ? handleCreateOption : undefined}\n formatCreateLabel={allowCustom ? (v) => `Use \"${v.toUpperCase()}\"` : undefined}\n placeholder={placeholder}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n classNames={classNames}\n dataAttributes={dataAttributes}\n renderCheckIcon={renderCheckIcon}\n renderIndicator={renderIndicator}\n renderPillRemoveIcon={renderPillRemoveIcon}\n renderLoading={renderLoading}\n noOptionsMessage=\"No matching tenors\"\n {...props}\n />\n );\n },\n);\n\nTenorInputBase.displayName = \"TenorInputBase\";\n","import {\n type ChangeEvent,\n forwardRef,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport type { DateFormat } from \"../../utils/dateFormat\";\nimport {\n formatDate,\n getFormatPlaceholder,\n getFormatSegmentLengths,\n getFormatSeparator,\n parseDate,\n validateDate,\n} from \"../../utils/dateFormat\";\nimport { mergeRefs } from \"../../utils/mergeRefs\";\nimport type { TenorResolver } from \"../../utils/tenor\";\nimport { dateToTenor, resolveTenor, STANDARD_TENORS } from \"../../utils/tenor\";\nimport type { CalendarClassNames } from \"../Calendar/Calendar\";\nimport { CalendarBase } from \"../Calendar/Calendar\";\n\n// Types\n\nexport interface DateTenorInputClassNames {\n root?: string;\n trigger?: string;\n triggerOpen?: string;\n dateInput?: string;\n tenorBadge?: string;\n calendarButton?: string;\n indicator?: string;\n indicatorOpen?: string;\n popup?: string;\n calendarSection?: string;\n tenorSection?: string;\n tenorTitle?: string;\n tenorGrid?: string;\n tenor?: string;\n tenorSelected?: string;\n calendar?: CalendarClassNames;\n}\n\nexport interface DateTenorInputBaseProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n \"onChange\" | \"defaultValue\"\n> {\n /** Current date value. */\n dateValue?: Date | null;\n /** Current tenor value. */\n tenorValue?: string | null;\n /** Called when either field changes. */\n onChange?: (values: { date: Date | null; tenor: string | null }) => void;\n /** Reference date for tenor resolution (defaults to today). */\n referenceDate?: Date;\n /** Custom tenor-to-date resolver (for business day logic, holidays). */\n tenorResolver?: TenorResolver;\n /** Date format pattern. */\n dateFormat?: DateFormat;\n /** Minimum allowed date. */\n minDate?: Date;\n /** Maximum allowed date. */\n maxDate?: Date;\n /** Dates that cannot be selected. */\n disabledDates?: Date[] | ((date: Date) => boolean);\n /** Additional tenors beyond the standard set. */\n extraTenors?: string[];\n /** Restrict to only these tenors. */\n allowedTenors?: string[];\n /** Disable both fields. */\n disabled?: boolean;\n /** Make both fields read-only. */\n readOnly?: boolean;\n /** Placeholder for the date input. */\n datePlaceholder?: string;\n /** Placeholder for the tenor section title. */\n tenorSectionTitle?: string;\n /** 0 = Sunday, 1 = Monday. Default: 1. */\n weekStartsOn?: 0 | 1;\n /** CSS class names injected by the styled layer. */\n classNames?: DateTenorInputClassNames;\n /** data-* attributes injected by the styled layer. */\n dataAttributes?: Record<string, string>;\n /** Render the calendar icon for the trigger. */\n renderCalendarIcon?: () => ReactNode;\n /** Render the dropdown indicator. */\n renderIndicator?: (isOpen: boolean) => ReactNode;\n /** Render the calendar prev month nav icon. */\n renderCalendarNavPrev?: () => ReactNode;\n /** Render the calendar next month nav icon. */\n renderCalendarNavNext?: () => ReactNode;\n /** id for the date input element. */\n dateId?: string;\n /** aria-label for the date input. */\n dateAriaLabel?: string;\n /** aria-label for the tenor section. */\n tenorAriaLabel?: string;\n}\n\n// Helpers\n\nfunction autoInsertSeparators(raw: string, segmentLengths: readonly number[], sep: string): string {\n const digitsOnly = raw.replace(/\\D/g, \"\");\n let result = \"\";\n let digitIndex = 0;\n for (let i = 0; i < segmentLengths.length && digitIndex < digitsOnly.length; i++) {\n if (i > 0) result += sep;\n const segLen = segmentLengths[i];\n result += digitsOnly.slice(digitIndex, digitIndex + segLen);\n digitIndex += segLen;\n }\n return result;\n}\n\nfunction getMaxLength(segmentLengths: readonly number[], sep: string): number {\n const digitCount = segmentLengths.reduce((sum, len) => sum + len, 0);\n const separatorCount = segmentLengths.length - 1;\n return digitCount + separatorCount * sep.length;\n}\n\nfunction cx(...classes: (string | false | undefined | null)[]): string | undefined {\n const result = classes.filter(Boolean).join(\" \");\n return result || undefined;\n}\n\n// Component\n\nexport const DateTenorInputBase = forwardRef<HTMLDivElement, DateTenorInputBaseProps>(\n (\n {\n dateValue,\n tenorValue,\n onChange,\n referenceDate,\n tenorResolver,\n dateFormat = \"YYYY-MM-DD\",\n minDate,\n maxDate,\n disabledDates,\n extraTenors,\n allowedTenors,\n disabled,\n readOnly,\n datePlaceholder,\n tenorSectionTitle = \"Tenor\",\n weekStartsOn,\n classNames: cn,\n dataAttributes,\n renderCalendarIcon,\n renderIndicator,\n renderCalendarNavPrev,\n renderCalendarNavNext,\n dateId,\n dateAriaLabel,\n tenorAriaLabel,\n ...props\n },\n ref,\n ) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // Format helpers\n const separator = getFormatSeparator(dateFormat);\n const segmentLengths = getFormatSegmentLengths(dateFormat);\n const maxLen = getMaxLength(segmentLengths, separator);\n\n // Open state\n const [isOpen, setIsOpen] = useState(false);\n\n // Input text\n const [inputText, setInputText] = useState(() => {\n if (dateValue) return formatDate(dateValue, dateFormat);\n return \"\";\n });\n\n // Sync controlled dateValue → input text\n useEffect(() => {\n if (dateValue === undefined) return;\n setInputText(dateValue === null ? \"\" : formatDate(dateValue, dateFormat));\n }, [dateValue, dateFormat]);\n\n // Build tenor list\n const tenors = useMemo(() => {\n if (allowedTenors) return allowedTenors;\n const list = [...STANDARD_TENORS] as string[];\n if (extraTenors) {\n for (const t of extraTenors) {\n if (!list.includes(t)) list.push(t);\n }\n }\n return list;\n }, [allowedTenors, extraTenors]);\n\n // Resolve helpers\n const getRefDate = useCallback(() => referenceDate ?? new Date(), [referenceDate]);\n\n const resolve = useCallback(\n (tenor: string, refDate: Date): Date | null => {\n return tenorResolver ? tenorResolver(tenor, refDate) : resolveTenor(tenor, refDate);\n },\n [tenorResolver],\n );\n\n // Close on outside click\n useEffect(() => {\n if (!isOpen) return;\n const handler = (e: MouseEvent) => {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n setIsOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handler);\n return () => document.removeEventListener(\"mousedown\", handler);\n }, [isOpen]);\n\n const togglePopup = useCallback(() => {\n if (disabled || readOnly) return;\n setIsOpen((prev) => !prev);\n }, [disabled, readOnly]);\n\n // Date input handlers (same auto-separator logic)\n\n const handleInputChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n if (disabled || readOnly) return;\n const raw = e.target.value;\n const filtered = raw\n .split(\"\")\n .filter((ch) => /\\d/.test(ch) || ch === separator)\n .join(\"\");\n const formatted = autoInsertSeparators(filtered, segmentLengths, separator);\n const clamped = formatted.slice(0, maxLen);\n setInputText(clamped);\n },\n [disabled, readOnly, separator, segmentLengths, maxLen],\n );\n\n const handleInputBlur = useCallback(() => {\n // Don't validate/fire on blur if popup is open (user is clicking calendar/tenor)\n // The mousedown on calendar/tenor buttons prevents default, so blur doesn't fire\n // But if they click outside, the outside-click handler closes the popup\n\n if (inputText.trim() === \"\") {\n onChange?.({ date: null, tenor: null });\n return;\n }\n const parseResult = parseDate(inputText, dateFormat);\n if (!parseResult.valid || !parseResult.date) return;\n\n const validationResult = validateDate(parseResult.date, {\n min: minDate,\n max: maxDate,\n disabledDates,\n });\n if (!validationResult.valid || !validationResult.date) return;\n\n const refDate = getRefDate();\n const matchedTenor = dateToTenor(validationResult.date, refDate);\n onChange?.({ date: validationResult.date, tenor: matchedTenor });\n }, [inputText, dateFormat, onChange, minDate, maxDate, disabledDates, getRefDate]);\n\n const handleInputKeyDown = useCallback(\n (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"Escape\" && isOpen) {\n setIsOpen(false);\n return;\n }\n const allowedKeys = [\n \"Backspace\",\n \"Delete\",\n \"Tab\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n \"Escape\",\n ];\n if (allowedKeys.includes(e.key)) return;\n if (e.ctrlKey || e.metaKey) return;\n if (/^\\d$/.test(e.key)) return;\n if (e.key === separator) return;\n e.preventDefault();\n },\n [separator, isOpen],\n );\n\n // Calendar selection\n\n const handleCalendarSelect = useCallback(\n (date: Date) => {\n const formatted = formatDate(date, dateFormat);\n setInputText(formatted);\n const refDate = getRefDate();\n const matchedTenor = dateToTenor(date, refDate);\n onChange?.({ date, tenor: matchedTenor });\n setIsOpen(false);\n inputRef.current?.focus();\n },\n [dateFormat, onChange, getRefDate],\n );\n\n // Tenor selection\n\n const handleTenorSelect = useCallback(\n (tenor: string) => {\n const refDate = getRefDate();\n const resolvedDate = resolve(tenor, refDate);\n if (resolvedDate) {\n const formatted = formatDate(resolvedDate, dateFormat);\n setInputText(formatted);\n }\n // If the clicked tenor is the same as the current, deselect\n if (tenor === tenorValue) {\n onChange?.({ date: null, tenor: null });\n } else {\n onChange?.({ date: resolvedDate, tenor });\n }\n setIsOpen(false);\n inputRef.current?.focus();\n },\n [getRefDate, resolve, dateFormat, onChange, tenorValue],\n );\n\n // Calendar display value\n const calendarDisplayValue: Date | null | undefined =\n dateValue !== undefined\n ? dateValue\n : (() => {\n if (!inputText) return null;\n const result = parseDate(inputText, dateFormat);\n return result.valid ? result.date : null;\n })();\n\n return (\n <div ref={mergeRefs(ref, containerRef)} className={cn?.root} {...dataAttributes} {...props}>\n {/* Trigger */}\n <div className={cx(cn?.trigger, isOpen && cn?.triggerOpen)}>\n <input\n ref={inputRef}\n className={cn?.dateInput}\n type=\"text\"\n inputMode=\"numeric\"\n id={dateId}\n value={inputText}\n placeholder={datePlaceholder ?? getFormatPlaceholder(dateFormat)}\n disabled={disabled}\n readOnly={readOnly}\n maxLength={maxLen}\n aria-label={dateAriaLabel}\n onChange={handleInputChange}\n onBlur={handleInputBlur}\n onKeyDown={handleInputKeyDown}\n onClick={() => {\n if (!disabled && !readOnly && !isOpen) setIsOpen(true);\n }}\n />\n\n {tenorValue ? <span className={cn?.tenorBadge}>{tenorValue}</span> : null}\n\n {renderCalendarIcon ? (\n <button\n type=\"button\"\n className={cn?.calendarButton}\n onClick={togglePopup}\n tabIndex={-1}\n aria-label=\"Toggle date and tenor picker\"\n disabled={disabled}>\n {renderCalendarIcon()}\n </button>\n ) : null}\n\n {renderIndicator ? (\n <span\n className={cx(cn?.indicator, isOpen && cn?.indicatorOpen)}\n aria-hidden=\"true\"\n onMouseDown={(e) => {\n e.preventDefault();\n togglePopup();\n }}>\n {renderIndicator(isOpen)}\n </span>\n ) : null}\n </div>\n\n {/* Popup: calendar + tenor list */}\n {isOpen ? (\n <div className={cn?.popup}>\n <div className={cn?.calendarSection}>\n <CalendarBase\n value={calendarDisplayValue}\n onSelect={handleCalendarSelect}\n min={minDate}\n max={maxDate}\n disabledDates={disabledDates}\n weekStartsOn={weekStartsOn}\n classNames={cn?.calendar}\n renderNavPrev={renderCalendarNavPrev}\n renderNavNext={renderCalendarNavNext}\n />\n </div>\n <div className={cn?.tenorSection} role=\"listbox\" aria-label={tenorAriaLabel ?? \"Tenor\"}>\n {tenorSectionTitle ? (\n <div className={cn?.tenorTitle} aria-hidden=\"true\">\n {tenorSectionTitle}\n </div>\n ) : null}\n <div className={cn?.tenorGrid}>\n {tenors.map((t) => (\n <button\n key={t}\n type=\"button\"\n role=\"option\"\n aria-selected={t === tenorValue || undefined}\n className={cx(cn?.tenor, t === tenorValue && cn?.tenorSelected)}\n onMouseDown={(e) => {\n e.preventDefault();\n handleTenorSelect(t);\n }}>\n {t}\n </button>\n ))}\n </div>\n </div>\n </div>\n ) : null}\n </div>\n );\n },\n);\n\nDateTenorInputBase.displayName = \"DateTenorInputBase\";\n","import { cva, type VariantProps } from \"class-variance-authority\";\nimport { clsx } from \"clsx\";\nimport { forwardRef, useMemo } from \"react\";\n\nimport {\n CalendarIcon,\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n} from \"../../assets/icons\";\nimport type {\n DateTenorInputBaseProps,\n DateTenorInputClassNames,\n} from \"../../unstyled/DateTenorInput/DateTenorInput\";\nimport { DateTenorInputBase } from \"../../unstyled/DateTenorInput/DateTenorInput\";\nimport calendarStyles from \"../Calendar/Calendar.module.scss\";\nimport { componentIds, FINRA_UI_ATTR } from \"../componentIds\";\nimport type { ValidationStatus } from \"../Input/Input\";\nimport styles from \"./DateTenorInput.module.scss\";\n\n// Variant CVA (for the trigger)\n\nconst triggerVariants = cva(styles.trigger, {\n variants: {\n variant: {\n primary: styles.variantPrimary,\n secondary: styles.variantSecondary,\n tertiary: styles.variantTertiary,\n },\n },\n defaultVariants: {\n variant: \"primary\",\n },\n});\n\n// Validation classes\n\nconst validationClasses: Record<ValidationStatus, string> = {\n error: styles.statusError,\n warning: styles.statusWarning,\n success: styles.statusSuccess,\n};\n\n// Props\n\nexport interface DateTenorInputProps\n extends\n Omit<\n DateTenorInputBaseProps,\n | \"classNames\"\n | \"dataAttributes\"\n | \"renderCalendarIcon\"\n | \"renderIndicator\"\n | \"renderCalendarNavPrev\"\n | \"renderCalendarNavNext\"\n >,\n VariantProps<typeof triggerVariants> {\n /** Visual validation status. */\n validationStatus?: ValidationStatus;\n /** Stretch to fill container width. */\n fullWidth?: boolean;\n /** Additional CSS class for the root wrapper. */\n className?: string;\n}\n\n// Static data attributes\n\nconst dateTenorDataAttributes = { [FINRA_UI_ATTR]: componentIds.dateTenorInput } as const;\n\n// Styled render callbacks\n\nfunction styledCalendarIcon() {\n return <CalendarIcon aria-hidden=\"true\" {...{ [FINRA_UI_ATTR]: componentIds.calendarIcon }} />;\n}\n\nfunction styledIndicator(_isOpen: boolean) {\n return <ChevronDownIcon />;\n}\n\nfunction styledNavPrev() {\n return <ChevronLeftIcon aria-hidden=\"true\" />;\n}\n\nfunction styledNavNext() {\n return <ChevronRightIcon aria-hidden=\"true\" />;\n}\n\n// Component\n\nexport const DateTenorInput = forwardRef<HTMLDivElement, DateTenorInputProps>(\n ({ className, variant, validationStatus, fullWidth, disabled, ...props }, ref) => {\n const classNames = useMemo<DateTenorInputClassNames>(\n () => ({\n root: clsx(\n styles.root,\n fullWidth && styles.fullWidth,\n disabled && styles.disabled,\n className,\n ),\n trigger: clsx(\n triggerVariants({ variant }),\n validationStatus && validationClasses[validationStatus],\n ),\n triggerOpen: styles.open,\n dateInput: styles.dateInput,\n tenorBadge: styles.tenorBadge,\n calendarButton: styles.calendarButton,\n indicator: styles.indicator,\n indicatorOpen: styles.indicatorOpen,\n popup: styles.popup,\n calendarSection: styles.calendarSection,\n tenorSection: styles.tenorSection,\n tenorTitle: styles.tenorTitle,\n tenorGrid: styles.tenorGrid,\n tenor: styles.tenor,\n tenorSelected: styles.tenorSelected,\n calendar: {\n root: calendarStyles.root,\n header: calendarStyles.header,\n navButton: calendarStyles.navButton,\n title: calendarStyles.title,\n weekdayRow: calendarStyles.weekdayRow,\n weekday: calendarStyles.weekday,\n grid: calendarStyles.grid,\n row: calendarStyles.row,\n day: calendarStyles.day,\n dayToday: calendarStyles.dayToday,\n daySelected: calendarStyles.daySelected,\n dayDisabled: calendarStyles.dayDisabled,\n dayOutside: calendarStyles.dayOutside,\n footer: calendarStyles.footer,\n },\n }),\n [className, variant, validationStatus, fullWidth, disabled],\n );\n\n return (\n <DateTenorInputBase\n ref={ref}\n disabled={disabled}\n classNames={classNames}\n dataAttributes={dateTenorDataAttributes}\n renderCalendarIcon={styledCalendarIcon}\n renderIndicator={styledIndicator}\n renderCalendarNavPrev={styledNavPrev}\n renderCalendarNavNext={styledNavNext}\n {...props}\n />\n );\n },\n);\n\nDateTenorInput.displayName = \"DateTenorInput\";\n"],"names":["buildTenorOptions","allowedTenors","extraTenors","tenors","STANDARD_TENORS","t","tenorFilterFn","option","inputValue","needle","TenorInput","forwardRef","value","onChange","allowCustom","placeholder","className","noOptionsMessage","props","ref","options","useMemo","handleChange","useCallback","val","tenor","handleCreateOption","parsed","parseTenor","jsx","FINRA_UI_ATTR","componentIds","ComboBox","clsx","TenorInputBase","disabled","open","onOpenChange","classNames","dataAttributes","renderCheckIcon","renderIndicator","renderPillRemoveIcon","renderLoading","ComboBoxBase","v","autoInsertSeparators","raw","segmentLengths","sep","digitsOnly","result","digitIndex","i","segLen","getMaxLength","digitCount","sum","len","separatorCount","cx","classes","DateTenorInputBase","dateValue","tenorValue","referenceDate","tenorResolver","dateFormat","minDate","maxDate","disabledDates","readOnly","datePlaceholder","tenorSectionTitle","weekStartsOn","cn","renderCalendarIcon","renderCalendarNavPrev","renderCalendarNavNext","dateId","dateAriaLabel","tenorAriaLabel","containerRef","useRef","inputRef","separator","getFormatSeparator","getFormatSegmentLengths","maxLen","isOpen","setIsOpen","useState","inputText","setInputText","formatDate","useEffect","list","getRefDate","resolve","refDate","resolveTenor","handler","e","togglePopup","prev","handleInputChange","filtered","ch","clamped","handleInputBlur","parseResult","parseDate","validationResult","validateDate","matchedTenor","dateToTenor","handleInputKeyDown","handleCalendarSelect","date","formatted","handleTenorSelect","resolvedDate","calendarDisplayValue","jsxs","mergeRefs","getFormatPlaceholder","CalendarBase","triggerVariants","cva","styles","validationClasses","dateTenorDataAttributes","styledCalendarIcon","CalendarIcon","styledIndicator","_isOpen","ChevronDownIcon","styledNavPrev","ChevronLeftIcon","styledNavNext","ChevronRightIcon","DateTenorInput","variant","validationStatus","fullWidth","calendarStyles"],"mappings":";;;;;;AA6BA,SAASA,GACPC,GACAC,GAC0B;AAC1B,MAAIC;AAEJ,MAAIF;AACF,IAAAE,IAASF;AAAA,WAETE,IAAS,CAAC,GAAGC,CAAe,GACxBF;AACF,eAAWG,KAAKH;AACd,MAAKC,EAAO,SAASE,CAAC,KACpBF,EAAO,KAAKE,CAAC;AAMrB,SAAOF,EAAO,IAAI,CAACE,OAAO,EAAE,OAAOA,GAAG,OAAOA,EAAA,EAAI;AACnD;AAEA,SAASC,GAAcC,GAAgCC,GAA6B;AAClF,QAAMC,IAASD,EAAW,YAAA;AAC1B,SAAOD,EAAO,MAAM,YAAA,EAAc,SAASE,CAAM;AACnD;AAEO,MAAMC,KAAaC;AAAA,EACxB,CACE;AAAA,IACE,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAX;AAAA,IACA,eAAAD;AAAA,IACA,aAAAa,IAAc;AAAA,IACd,aAAAC,IAAc;AAAA,IACd,WAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAUC;AAAA,MACd,MAAMrB,GAAkBC,GAA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
package/dist/index.d.ts
CHANGED
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
export { FINRA_UI_ATTR, componentIds } from './components/componentIds';
|
|
2
1
|
export type { ComponentId } from './components/componentIds';
|
|
3
|
-
export {
|
|
2
|
+
export { componentIds, FINRA_UI_ATTR } from './components/componentIds';
|
|
4
3
|
export type { ButtonProps, ButtonSentiment } from './components/Button/Button';
|
|
5
|
-
export {
|
|
4
|
+
export { Button } from './components/Button/Button';
|
|
6
5
|
export type { IconButtonProps, IconButtonSentiment } from './components/IconButton/IconButton';
|
|
7
|
-
export {
|
|
6
|
+
export { IconButton } from './components/IconButton/IconButton';
|
|
8
7
|
export type { ButtonGroupProps } from './components/ButtonGroup/ButtonGroup';
|
|
9
|
-
export {
|
|
8
|
+
export { ButtonGroup } from './components/ButtonGroup/ButtonGroup';
|
|
10
9
|
export type { InputProps, ValidationStatus } from './components/Input/Input';
|
|
11
|
-
export {
|
|
10
|
+
export { Input } from './components/Input/Input';
|
|
12
11
|
export type { TextareaProps } from './components/Textarea/Textarea';
|
|
13
|
-
export {
|
|
12
|
+
export { Textarea } from './components/Textarea/Textarea';
|
|
14
13
|
export type { NumberInputProps } from './components/NumberInput/NumberInput';
|
|
15
|
-
export {
|
|
14
|
+
export { NumberInput } from './components/NumberInput/NumberInput';
|
|
16
15
|
export type { FormFieldProps } from './components/FormField/FormField';
|
|
17
|
-
export {
|
|
16
|
+
export { FormField } from './components/FormField/FormField';
|
|
18
17
|
export type { CheckboxProps } from './components/Checkbox/Checkbox';
|
|
19
|
-
export {
|
|
18
|
+
export { Checkbox } from './components/Checkbox/Checkbox';
|
|
20
19
|
export type { SwitchProps } from './components/Switch/Switch';
|
|
21
|
-
export {
|
|
20
|
+
export { Switch } from './components/Switch/Switch';
|
|
22
21
|
export type { RadioButtonProps } from './components/RadioButton/RadioButton';
|
|
23
|
-
export {
|
|
22
|
+
export { RadioButton } from './components/RadioButton/RadioButton';
|
|
24
23
|
export type { SliderProps } from './components/Slider/Slider';
|
|
25
|
-
export {
|
|
24
|
+
export { Slider } from './components/Slider/Slider';
|
|
26
25
|
export type { PillInputProps } from './components/PillInput/PillInput';
|
|
27
|
-
export {
|
|
26
|
+
export { PillInput } from './components/PillInput/PillInput';
|
|
28
27
|
export type { FileDropZoneProps } from './components/FileDropZone/FileDropZone';
|
|
29
|
-
export {
|
|
28
|
+
export { FileDropZone } from './components/FileDropZone/FileDropZone';
|
|
29
|
+
export type { ComboBoxGroup, ComboBoxOption, ComboBoxProps, ComboBoxRenderOptionState, } from './components/ComboBox/ComboBox';
|
|
30
|
+
export { ComboBox } from './components/ComboBox/ComboBox';
|
|
31
|
+
export type { DateInputProps } from './components/DateInput/DateInput';
|
|
32
|
+
export { DateInput } from './components/DateInput/DateInput';
|
|
30
33
|
export type { BadgeProps, BadgeSentiment } from './components/Badge/Badge';
|
|
31
|
-
export {
|
|
34
|
+
export { Badge } from './components/Badge/Badge';
|
|
32
35
|
export type { DividerProps } from './components/Divider/Divider';
|
|
36
|
+
export { Divider } from './components/Divider/Divider';
|