@brightlocal/ui-components 2.11.0 → 2.12.0
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/component-meta.json +163 -12
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.d.ts +16 -4
- package/dist/blocks/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table.js +57 -53
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts +7 -1
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +82 -81
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +18 -7
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +143 -136
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts +14 -2
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +37 -37
- package/dist/callout.cjs +1 -1
- package/dist/callout.d.ts +3 -3
- package/dist/callout.d.ts.map +1 -1
- package/dist/callout.js +2 -1
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +24 -3
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +121 -117
- package/dist/chip.cjs +1 -1
- package/dist/chip.d.ts +11 -0
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +43 -38
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +12 -2
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +235 -230
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +5 -0
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +207 -206
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +10 -0
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +96 -96
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +7 -2
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +38 -30
- package/dist/drawer.d.ts +2 -2
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +5 -0
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +15 -7
- package/dist/index.cjs +1 -1
- package/dist/index.js +178 -178
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.d.ts +7 -1
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +131 -130
- package/dist/input-group.d.ts +1 -1
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +10 -0
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +108 -106
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +1 -1
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +36 -37
- package/dist/list.d.ts +1 -1
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +6 -1
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +25 -22
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts +17 -2
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +32 -26
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +29 -3
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +26 -25
- package/dist/rating.cjs +1 -1
- package/dist/rating.d.ts +6 -0
- package/dist/rating.d.ts.map +1 -1
- package/dist/rating.js +27 -19
- package/dist/resizable.d.ts +1 -1
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +7 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +52 -51
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +16 -4
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +38 -35
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +6 -1
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +42 -41
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +13 -11
- package/dist/text-reveal-motion.cjs +1 -1
- package/dist/text-reveal-motion.d.ts +5 -0
- package/dist/text-reveal-motion.d.ts.map +1 -1
- package/dist/text-reveal-motion.js +111 -110
- package/dist/typography.cjs +1 -1
- package/dist/typography.d.ts +1 -2
- package/dist/typography.d.ts.map +1 -1
- package/dist/typography.js +49 -50
- package/package.json +2 -3
- package/src/blocks/data-table.tsx +26 -9
- package/src/blocks/input-list.tsx +12 -1
- package/src/blocks/sidebar.tsx +43 -21
- package/src/components/breadcrumb.tsx +43 -26
- package/src/components/callout.tsx +5 -4
- package/src/components/carousel.tsx +33 -4
- package/src/components/chip.tsx +22 -2
- package/src/components/combobox.tsx +18 -3
- package/src/components/command.tsx +7 -1
- package/src/components/date-picker.tsx +17 -3
- package/src/components/dialog.tsx +17 -4
- package/src/components/drawer.tsx +2 -2
- package/src/components/global-layout.tsx +15 -2
- package/src/components/input-chip.tsx +12 -1
- package/src/components/input-password.tsx +73 -49
- package/src/components/link.tsx +29 -17
- package/src/components/logo.tsx +10 -2
- package/src/components/map.tsx +23 -0
- package/src/components/pagination.tsx +44 -11
- package/src/components/rating.tsx +20 -2
- package/src/components/select.tsx +9 -1
- package/src/components/separator.tsx +40 -25
- package/src/components/sheet.tsx +28 -20
- package/src/components/skeleton.tsx +13 -2
- package/src/components/text-reveal-motion.tsx +7 -1
- package/src/components/typography.tsx +6 -7
|
@@ -15,14 +15,14 @@ function R(e, n, l) {
|
|
|
15
15
|
m.useEffect(() => {
|
|
16
16
|
r.current = o;
|
|
17
17
|
});
|
|
18
|
-
const
|
|
18
|
+
const d = e !== void 0, c = m.useCallback(
|
|
19
19
|
(s) => {
|
|
20
20
|
const u = typeof s == "function" ? s(r.current) : s;
|
|
21
|
-
|
|
21
|
+
d || i(u), l?.(u);
|
|
22
22
|
},
|
|
23
|
-
[
|
|
23
|
+
[d, l]
|
|
24
24
|
);
|
|
25
|
-
return [o,
|
|
25
|
+
return [o, c];
|
|
26
26
|
}
|
|
27
27
|
function Qe(e) {
|
|
28
28
|
const {
|
|
@@ -32,8 +32,8 @@ function Qe(e) {
|
|
|
32
32
|
enableGlobalFiltering: i = !1,
|
|
33
33
|
enableRowSelection: o = !1,
|
|
34
34
|
enablePagination: r = !1,
|
|
35
|
-
pageSize:
|
|
36
|
-
manualSorting:
|
|
35
|
+
pageSize: d = 10,
|
|
36
|
+
manualSorting: c = !1,
|
|
37
37
|
manualFiltering: s = !1,
|
|
38
38
|
manualPagination: u = !1,
|
|
39
39
|
rowCount: p,
|
|
@@ -53,7 +53,7 @@ function Qe(e) {
|
|
|
53
53
|
onExpandedChange: q
|
|
54
54
|
} = e, [J, K] = R(
|
|
55
55
|
v,
|
|
56
|
-
{ pageIndex: 0, pageSize:
|
|
56
|
+
{ pageIndex: 0, pageSize: d },
|
|
57
57
|
k
|
|
58
58
|
), [O, Q] = R(
|
|
59
59
|
b,
|
|
@@ -87,11 +87,11 @@ function Qe(e) {
|
|
|
87
87
|
...g != null && { pageCount: g }
|
|
88
88
|
},
|
|
89
89
|
...t && {
|
|
90
|
-
...!
|
|
90
|
+
...!c && {
|
|
91
91
|
getSortedRowModel: ie()
|
|
92
92
|
},
|
|
93
93
|
onSortingChange: Q,
|
|
94
|
-
...
|
|
94
|
+
...c && { manualSorting: !0 }
|
|
95
95
|
},
|
|
96
96
|
...i && {
|
|
97
97
|
...!s && {
|
|
@@ -127,8 +127,8 @@ function ye({
|
|
|
127
127
|
isLoading: i = !1,
|
|
128
128
|
skeletonRowCount: o,
|
|
129
129
|
noResultsMessage: r = "No results.",
|
|
130
|
-
stickyHeader:
|
|
131
|
-
className:
|
|
130
|
+
stickyHeader: d = !1,
|
|
131
|
+
className: c,
|
|
132
132
|
footer: s
|
|
133
133
|
}) {
|
|
134
134
|
const u = e.getVisibleLeafColumns().length, p = o ?? e.getState().pagination.pageSize ?? 10;
|
|
@@ -136,13 +136,13 @@ function ye({
|
|
|
136
136
|
"div",
|
|
137
137
|
{
|
|
138
138
|
"aria-busy": i || void 0,
|
|
139
|
-
className: h("border-border overflow-auto rounded-md border",
|
|
139
|
+
className: h("border-border overflow-auto rounded-md border", c),
|
|
140
140
|
"data-hook": n,
|
|
141
141
|
"data-slot": "data-table-view",
|
|
142
142
|
"data-tracking-el": l,
|
|
143
143
|
"data-tracking-label": t,
|
|
144
144
|
children: /* @__PURE__ */ S(j, { dataHook: `${n}-table`, children: [
|
|
145
|
-
/* @__PURE__ */ a(G, { stickyHeader:
|
|
145
|
+
/* @__PURE__ */ a(G, { stickyHeader: d, table: e }),
|
|
146
146
|
/* @__PURE__ */ a(E, { children: i ? /* @__PURE__ */ S(T, { children: [
|
|
147
147
|
/* @__PURE__ */ a(
|
|
148
148
|
B,
|
|
@@ -202,8 +202,8 @@ function Ne({
|
|
|
202
202
|
isLoading: i = !1,
|
|
203
203
|
skeletonRowCount: o,
|
|
204
204
|
noResultsMessage: r = "No results.",
|
|
205
|
-
stickyHeader:
|
|
206
|
-
className:
|
|
205
|
+
stickyHeader: d = !1,
|
|
206
|
+
className: c,
|
|
207
207
|
footer: s,
|
|
208
208
|
height: u,
|
|
209
209
|
estimateSize: p = 48,
|
|
@@ -220,14 +220,14 @@ function Ne({
|
|
|
220
220
|
{
|
|
221
221
|
ref: P,
|
|
222
222
|
"aria-busy": i || void 0,
|
|
223
|
-
className: h("border-border overflow-auto rounded-md border",
|
|
223
|
+
className: h("border-border overflow-auto rounded-md border", c),
|
|
224
224
|
"data-hook": n,
|
|
225
225
|
"data-slot": "data-table-view",
|
|
226
226
|
"data-tracking-el": l,
|
|
227
227
|
"data-tracking-label": t,
|
|
228
228
|
style: u != null ? { height: u } : void 0,
|
|
229
229
|
children: /* @__PURE__ */ S(j, { dataHook: `${n}-table`, children: [
|
|
230
|
-
/* @__PURE__ */ a(G, { stickyHeader:
|
|
230
|
+
/* @__PURE__ */ a(G, { stickyHeader: d, table: e }),
|
|
231
231
|
/* @__PURE__ */ a(E, { children: i ? /* @__PURE__ */ S(T, { children: [
|
|
232
232
|
/* @__PURE__ */ a(
|
|
233
233
|
B,
|
|
@@ -258,7 +258,8 @@ function De({
|
|
|
258
258
|
dataHook: t,
|
|
259
259
|
trackingEl: i,
|
|
260
260
|
trackingLabel: o,
|
|
261
|
-
align: r = "left"
|
|
261
|
+
align: r = "left",
|
|
262
|
+
getSortLabel: d
|
|
262
263
|
}) {
|
|
263
264
|
if (!e.getCanSort())
|
|
264
265
|
return /* @__PURE__ */ a(
|
|
@@ -277,7 +278,7 @@ function De({
|
|
|
277
278
|
children: n
|
|
278
279
|
}
|
|
279
280
|
);
|
|
280
|
-
const c = e.getIsSorted(),
|
|
281
|
+
const c = e.getIsSorted(), s = d ? d(n, c) : c === "desc" ? `Sort by ${n}, currently descending` : c === "asc" ? `Sort by ${n}, currently ascending` : `Sort by ${n}`;
|
|
281
282
|
return /* @__PURE__ */ a(
|
|
282
283
|
"div",
|
|
283
284
|
{
|
|
@@ -293,7 +294,7 @@ function De({
|
|
|
293
294
|
children: /* @__PURE__ */ S(
|
|
294
295
|
H,
|
|
295
296
|
{
|
|
296
|
-
"aria-label":
|
|
297
|
+
"aria-label": s,
|
|
297
298
|
className: "text-muted-foreground h-auto p-0 text-sm font-medium",
|
|
298
299
|
dataHook: t || `column-header-${e.id}`,
|
|
299
300
|
size: "sm",
|
|
@@ -318,34 +319,35 @@ function De({
|
|
|
318
319
|
De.displayName = "DataTableColumnHeader";
|
|
319
320
|
function ze({
|
|
320
321
|
table: e,
|
|
321
|
-
ariaLabel: n
|
|
322
|
-
placeholder: l
|
|
323
|
-
|
|
322
|
+
ariaLabel: n,
|
|
323
|
+
placeholder: l,
|
|
324
|
+
clearSearchAriaLabel: t,
|
|
325
|
+
...i
|
|
324
326
|
}) {
|
|
325
|
-
const
|
|
326
|
-
e.setGlobalFilter(
|
|
327
|
+
const o = e.getState().globalFilter ?? "", r = (d) => {
|
|
328
|
+
e.setGlobalFilter(d);
|
|
327
329
|
};
|
|
328
|
-
return /* @__PURE__ */ S(he, { "data-slot": "data-table-search", ...
|
|
330
|
+
return /* @__PURE__ */ S(he, { "data-slot": "data-table-search", ...i, children: [
|
|
329
331
|
/* @__PURE__ */ a(M, { className: "pl-3", children: /* @__PURE__ */ a(me, {}) }),
|
|
330
332
|
/* @__PURE__ */ a(
|
|
331
333
|
fe,
|
|
332
334
|
{
|
|
333
|
-
"aria-label": n,
|
|
334
|
-
placeholder: l,
|
|
335
|
+
"aria-label": n ?? "Search table",
|
|
336
|
+
placeholder: l ?? "Search...",
|
|
335
337
|
type: "text",
|
|
336
|
-
value:
|
|
337
|
-
onChange: (
|
|
338
|
+
value: o,
|
|
339
|
+
onChange: (d) => r(d.target.value)
|
|
338
340
|
}
|
|
339
341
|
),
|
|
340
|
-
|
|
342
|
+
o && /* @__PURE__ */ a(M, { className: "pr-1", children: /* @__PURE__ */ a(
|
|
341
343
|
H,
|
|
342
344
|
{
|
|
343
|
-
"aria-label": "Clear search",
|
|
345
|
+
"aria-label": t ?? "Clear search",
|
|
344
346
|
className: "h-auto p-1",
|
|
345
347
|
"data-slot": "data-table-search-clear",
|
|
346
|
-
dataHook: `${
|
|
348
|
+
dataHook: `${i.dataHook}-clear`,
|
|
347
349
|
variant: "ghost",
|
|
348
|
-
onClick: () =>
|
|
350
|
+
onClick: () => r(""),
|
|
349
351
|
children: /* @__PURE__ */ a(pe, { size: 14 })
|
|
350
352
|
}
|
|
351
353
|
) })
|
|
@@ -353,7 +355,7 @@ function ze({
|
|
|
353
355
|
}
|
|
354
356
|
ze.displayName = "DataTableSearch";
|
|
355
357
|
function Ie(e) {
|
|
356
|
-
const { pageIndex: n, pageSize: l } = e.getState().pagination, t = e.getRowCount(), i = e.getPageCount(), o = e.getCanPreviousPage(), r = e.getCanNextPage(),
|
|
358
|
+
const { pageIndex: n, pageSize: l } = e.getState().pagination, t = e.getRowCount(), i = e.getPageCount(), o = e.getCanPreviousPage(), r = e.getCanNextPage(), d = n + 1, c = t === 0 ? 0 : n * l + 1, s = Math.min(d * l, t), u = m.useCallback(
|
|
357
359
|
(w) => e.setPageIndex(w - 1),
|
|
358
360
|
[e]
|
|
359
361
|
), p = m.useCallback(() => e.nextPage(), [e]), g = m.useCallback(() => e.previousPage(), [e]), f = m.useCallback(
|
|
@@ -366,9 +368,9 @@ function Ie(e) {
|
|
|
366
368
|
pageSize: l,
|
|
367
369
|
totalRows: t,
|
|
368
370
|
totalPages: i,
|
|
369
|
-
startRow:
|
|
371
|
+
startRow: c,
|
|
370
372
|
endRow: s,
|
|
371
|
-
currentPage:
|
|
373
|
+
currentPage: d,
|
|
372
374
|
canPrev: o,
|
|
373
375
|
canNext: r,
|
|
374
376
|
goToPage: u,
|
|
@@ -381,9 +383,9 @@ function Ie(e) {
|
|
|
381
383
|
l,
|
|
382
384
|
t,
|
|
383
385
|
i,
|
|
384
|
-
d,
|
|
385
|
-
s,
|
|
386
386
|
c,
|
|
387
|
+
s,
|
|
388
|
+
d,
|
|
387
389
|
o,
|
|
388
390
|
r,
|
|
389
391
|
u,
|
|
@@ -406,13 +408,13 @@ function $e({
|
|
|
406
408
|
renderText: e,
|
|
407
409
|
className: n
|
|
408
410
|
}) {
|
|
409
|
-
const { info: l } = U(), { startRow: t, endRow: i, totalRows: o, pageIndex: r, pageSize:
|
|
410
|
-
return
|
|
411
|
+
const { info: l } = U(), { startRow: t, endRow: i, totalRows: o, pageIndex: r, pageSize: d } = l, c = e ? e({ startRow: t, endRow: i, totalRows: o, pageIndex: r, pageSize: d }) : o === 0 ? null : `${t}-${i} of ${o}`;
|
|
412
|
+
return c == null ? null : /* @__PURE__ */ a(
|
|
411
413
|
"span",
|
|
412
414
|
{
|
|
413
415
|
className: h("text-muted-foreground text-sm", n),
|
|
414
416
|
"data-slot": "data-table-pagination-row-count",
|
|
415
|
-
children:
|
|
417
|
+
children: c
|
|
416
418
|
}
|
|
417
419
|
);
|
|
418
420
|
}
|
|
@@ -466,8 +468,8 @@ function Fe({
|
|
|
466
468
|
trackingEl: i,
|
|
467
469
|
trackingLabel: o,
|
|
468
470
|
className: r,
|
|
469
|
-
ariaLabel:
|
|
470
|
-
children:
|
|
471
|
+
ariaLabel: d = "Table pagination",
|
|
472
|
+
children: c
|
|
471
473
|
}) {
|
|
472
474
|
const s = Ie(e), u = m.useMemo(
|
|
473
475
|
() => ({ info: s }),
|
|
@@ -478,13 +480,13 @@ function Fe({
|
|
|
478
480
|
"data-tracking-el": i,
|
|
479
481
|
"data-tracking-label": o
|
|
480
482
|
};
|
|
481
|
-
if (
|
|
483
|
+
if (c)
|
|
482
484
|
return /* @__PURE__ */ a(F.Provider, { value: u, children: /* @__PURE__ */ a(
|
|
483
485
|
"div",
|
|
484
486
|
{
|
|
485
487
|
className: h("flex w-full items-center gap-4", r),
|
|
486
488
|
...p,
|
|
487
|
-
children:
|
|
489
|
+
children: c
|
|
488
490
|
}
|
|
489
491
|
) });
|
|
490
492
|
const g = !l || t === null ? null : t ? t({
|
|
@@ -508,7 +510,7 @@ function Fe({
|
|
|
508
510
|
/* @__PURE__ */ a(
|
|
509
511
|
_,
|
|
510
512
|
{
|
|
511
|
-
ariaLabel:
|
|
513
|
+
ariaLabel: d,
|
|
512
514
|
dataHook: `${n}-nav`
|
|
513
515
|
}
|
|
514
516
|
)
|
|
@@ -521,17 +523,18 @@ function Me({
|
|
|
521
523
|
table: e,
|
|
522
524
|
dataHook: n,
|
|
523
525
|
trackingEl: l,
|
|
524
|
-
trackingLabel: t
|
|
526
|
+
trackingLabel: t,
|
|
527
|
+
selectAllAriaLabel: i
|
|
525
528
|
}) {
|
|
526
529
|
return /* @__PURE__ */ a(
|
|
527
530
|
V,
|
|
528
531
|
{
|
|
529
|
-
"aria-label": "Select all",
|
|
532
|
+
"aria-label": i ?? "Select all",
|
|
530
533
|
checked: e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected() && "indeterminate",
|
|
531
534
|
dataHook: n || "select-all-checkbox",
|
|
532
535
|
trackingEl: l,
|
|
533
536
|
trackingLabel: t,
|
|
534
|
-
onCheckedChange: (
|
|
537
|
+
onCheckedChange: (o) => e.toggleAllPageRowsSelected(!!o)
|
|
535
538
|
}
|
|
536
539
|
);
|
|
537
540
|
}
|
|
@@ -540,18 +543,19 @@ function Ae({
|
|
|
540
543
|
row: e,
|
|
541
544
|
dataHook: n,
|
|
542
545
|
trackingEl: l,
|
|
543
|
-
trackingLabel: t
|
|
546
|
+
trackingLabel: t,
|
|
547
|
+
selectRowAriaLabel: i
|
|
544
548
|
}) {
|
|
545
549
|
return /* @__PURE__ */ a(
|
|
546
550
|
V,
|
|
547
551
|
{
|
|
548
|
-
"aria-label": "Select row",
|
|
552
|
+
"aria-label": i ?? "Select row",
|
|
549
553
|
checked: e.getIsSelected(),
|
|
550
554
|
dataHook: n || `select-row-${e.id}`,
|
|
551
555
|
disabled: !e.getCanSelect(),
|
|
552
556
|
trackingEl: l,
|
|
553
557
|
trackingLabel: t,
|
|
554
|
-
onCheckedChange: (
|
|
558
|
+
onCheckedChange: (o) => e.toggleSelected(!!o)
|
|
555
559
|
}
|
|
556
560
|
);
|
|
557
561
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`);h.length>1&&(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),_=require("react"),k=require("framer-motion"),K=require("@brightlocal/icons"),x=require("@brightlocal/ui-components/lib/utils"),O=require("../button.cjs"),$=require("../input.cjs"),g=require("../list.cjs");function B(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(i,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return i.default=t,Object.freeze(i)}const a=B(_),w=a.createContext(null);function y(){const t=a.useContext(w);if(!t)throw new Error("InputList components must be used within an <InputList>");return t}function A({value:t,onValueChange:i,children:r,className:o,dataHook:u,trackingEl:l,trackingLabel:I}){const[p,m]=a.useState(""),c=a.useRef(t.length),e=a.useRef(t.length),[j,h]=a.useState(()=>t.map((f,s)=>s)),[N,q]=a.useState(0);a.useEffect(()=>{const f=c.current;c.current=t.length,t.length>f&&m(""),h(s=>s.length===t.length?s:t.length>s.length?[...s,...Array.from({length:t.length-s.length},()=>e.current++)]:s.slice(0,t.length))},[t,N]);const b=a.useCallback(f=>{const s=f.map(d=>d.trim()).filter(Boolean);s.length&&(h(d=>[...d,...s.map(()=>e.current++)]),i([...t,...s]),q(d=>d+1))},[t,i]),L=a.useCallback(f=>{h(s=>s.filter((d,S)=>S!==f)),i(t.filter((s,d)=>d!==f))},[t,i]),P=a.useMemo(()=>({value:t,inputValue:p,setInputValue:m,addItems:b,removeItem:L,stableKeys:j}),[t,p,b,L,j]);return n.jsx(w.Provider,{value:P,children:n.jsx("div",{className:x.cn("flex flex-col gap-4",o),"data-hook":u,"data-slot":"input-list","data-tracking-el":l,"data-tracking-label":I,children:r})})}A.displayName="InputList";function C({dataHook:t="input-list",loading:i=!1,skeletonCount:r=5,disabled:o=!1,removeAriaLabel:u,className:l}){const{value:I,removeItem:p,stableKeys:m}=y();return i?n.jsx("ul",{className:x.cn("flex flex-col gap-2",l),"data-slot":"input-list-skeleton",children:Array.from({length:r}).map((c,e)=>n.jsx(g.Item,{variant:"loading"},e))}):n.jsx("ul",{className:x.cn("flex flex-col gap-2",l),"data-hook":`${t}-list`,"data-slot":"list",children:n.jsx(k.AnimatePresence,{initial:!1,mode:"popLayout",children:I.map((c,e)=>n.jsx(k.motion.li,{layout:!0,animate:{opacity:1,scale:1},"data-hook":`${t}-item-${e}`,exit:{opacity:0,scale:.8,transition:{opacity:{duration:.15},scale:{duration:.12}}},initial:{opacity:0,scale:.8},transition:{opacity:{duration:.15},scale:{duration:.15},layout:{type:"spring",stiffness:500,damping:35}},children:n.jsx(g.Item,{asChild:!0,variant:"filled",children:n.jsxs("div",{children:[n.jsx(g.ItemContent,{children:n.jsx(g.ItemTitle,{children:c})}),n.jsx(g.ItemActions,{children:n.jsx("button",{"aria-label":u?u.replace("{item}",c):`Remove ${c}`,className:x.cn("inline-flex size-9 cursor-pointer items-center justify-center rounded-full","text-muted-foreground","focus-visible:shadow-default outline-none","transition-colors duration-150 ease-in-out","disabled:pointer-events-none disabled:opacity-50"),"data-hook":`${t}-remove-${e}`,disabled:o,type:"button",onClick:()=>p(e),children:n.jsx(K.X,{})})})]})})},m[e]))})})}C.displayName="InputListItems";const R=a.forwardRef(({dataHook:t,error:i=!1,className:r,...o},u)=>{const{inputValue:l,setInputValue:I,addItems:p}=y(),m=e=>{e.key==="Enter"&&(e.preventDefault(),p([l])),o.onKeyDown?.(e)},c=e=>{const h=e.clipboardData.getData("text").split(`
|
|
2
|
+
`);h.length>1&&(e.preventDefault(),p(h)),o.onPaste?.(e)};return n.jsx($.Input,{ref:u,...o,className:x.cn("flex-1",r),dataHook:t,error:i,value:l,onChange:e=>{I(e.target.value),o.onChange?.(e)},onKeyDown:m,onPaste:c})});R.displayName="InputListInput";const D=a.forwardRef(({dataHook:t,children:i,...r},o)=>{const{inputValue:u,addItems:l}=y();return n.jsx(O.Button,{ref:o,...r,dataHook:t,onClick:()=>l([u]),children:i})});D.displayName="InputListAddButton";exports.InputList=A;exports.InputListAddButton=D;exports.InputListInput=R;exports.InputListItems=C;exports.useInputListContext=y;
|
|
@@ -82,6 +82,12 @@ export interface InputListItemsProps {
|
|
|
82
82
|
* Disables all remove buttons in the list.
|
|
83
83
|
*/
|
|
84
84
|
disabled?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Accessible label for each item's remove button.
|
|
87
|
+
* Supports `{item}` placeholder for interpolation.
|
|
88
|
+
* @default "Remove {item}"
|
|
89
|
+
*/
|
|
90
|
+
removeAriaLabel?: string;
|
|
85
91
|
/**
|
|
86
92
|
* Additional CSS classes applied to the list element.
|
|
87
93
|
*/
|
|
@@ -99,7 +105,7 @@ export interface InputListItemsProps {
|
|
|
99
105
|
* </InputList>
|
|
100
106
|
* ```
|
|
101
107
|
*/
|
|
102
|
-
declare function InputListItems({ dataHook, loading, skeletonCount, disabled, className, }: InputListItemsProps): import("react/jsx-runtime").JSX.Element;
|
|
108
|
+
declare function InputListItems({ dataHook, loading, skeletonCount, disabled, removeAriaLabel, className, }: InputListItemsProps): import("react/jsx-runtime").JSX.Element;
|
|
103
109
|
declare namespace InputListItems {
|
|
104
110
|
var displayName: string;
|
|
105
111
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-list.d.ts","sourceRoot":"","sources":["../../src/blocks/input-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAQhE,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,+CAA+C;IAC/C,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAMD,iBAAS,mBAAmB,0BAM3B;AAMD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;OAEG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,aAAa,EACb,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,cAAc,2CA2FhB;kBAnGQ,SAAS;;;AA2GlB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,iBAAS,cAAc,CAAC,EACtB,QAAuB,EACvB,OAAe,EACf,aAAiB,EACjB,QAAgB,EAChB,SAAS,GACV,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"input-list.d.ts","sourceRoot":"","sources":["../../src/blocks/input-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAQhE,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,+CAA+C;IAC/C,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAMD,iBAAS,mBAAmB,0BAM3B;AAMD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;OAEG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,aAAa,EACb,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,cAAc,2CA2FhB;kBAnGQ,SAAS;;;AA2GlB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,iBAAS,cAAc,CAAC,EACtB,QAAuB,EACvB,OAAe,EACf,aAAiB,EACjB,QAAgB,EAChB,eAAe,EACf,SAAS,GACV,EAAE,mBAAmB,2CAkFrB;kBAzFQ,cAAc;;;AAiGvB;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EACvC,OAAO,GAAG,MAAM,CACjB;IACC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,QAAA,MAAM,cAAc,8FAuCnB,CAAC;AAOF;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAEnE;;;;;;;;GAQG;AACH,QAAA,MAAM,kBAAkB,gHAgBtB,CAAC;AAOH,OAAO,EACL,SAAS,EACT,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,mBAAmB,GACpB,CAAC"}
|
|
@@ -1,107 +1,108 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as o, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
3
|
import { AnimatePresence as K, motion as $ } from "framer-motion";
|
|
4
4
|
import { X as P } from "@brightlocal/icons";
|
|
5
5
|
import { cn as g } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
import { Button as B } from "../button.js";
|
|
7
7
|
import { Input as S } from "../input.js";
|
|
8
8
|
import { Item as k, ItemContent as V, ItemTitle as _, ItemActions as j } from "../list.js";
|
|
9
|
-
const
|
|
9
|
+
const w = s.createContext(
|
|
10
10
|
null
|
|
11
11
|
);
|
|
12
12
|
function x() {
|
|
13
|
-
const t =
|
|
13
|
+
const t = s.useContext(w);
|
|
14
14
|
if (!t)
|
|
15
15
|
throw new Error("InputList components must be used within an <InputList>");
|
|
16
16
|
return t;
|
|
17
17
|
}
|
|
18
18
|
function E({
|
|
19
19
|
value: t,
|
|
20
|
-
onValueChange:
|
|
21
|
-
children:
|
|
22
|
-
className:
|
|
23
|
-
dataHook:
|
|
24
|
-
trackingEl:
|
|
20
|
+
onValueChange: i,
|
|
21
|
+
children: d,
|
|
22
|
+
className: a,
|
|
23
|
+
dataHook: c,
|
|
24
|
+
trackingEl: l,
|
|
25
25
|
trackingLabel: I
|
|
26
26
|
}) {
|
|
27
|
-
const [p,
|
|
28
|
-
() => t.map((
|
|
29
|
-
), [
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
...
|
|
27
|
+
const [p, f] = s.useState(""), r = s.useRef(t.length), e = s.useRef(t.length), [y, h] = s.useState(
|
|
28
|
+
() => t.map((m, n) => n)
|
|
29
|
+
), [A, C] = s.useState(0);
|
|
30
|
+
s.useEffect(() => {
|
|
31
|
+
const m = r.current;
|
|
32
|
+
r.current = t.length, t.length > m && f(""), h((n) => n.length === t.length ? n : t.length > n.length ? [
|
|
33
|
+
...n,
|
|
34
34
|
...Array.from(
|
|
35
|
-
{ length: t.length -
|
|
36
|
-
() =>
|
|
35
|
+
{ length: t.length - n.length },
|
|
36
|
+
() => e.current++
|
|
37
37
|
)
|
|
38
|
-
] :
|
|
39
|
-
}, [t,
|
|
40
|
-
const L =
|
|
41
|
-
(
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
...
|
|
45
|
-
...
|
|
46
|
-
]),
|
|
38
|
+
] : n.slice(0, t.length));
|
|
39
|
+
}, [t, A]);
|
|
40
|
+
const L = s.useCallback(
|
|
41
|
+
(m) => {
|
|
42
|
+
const n = m.map((u) => u.trim()).filter(Boolean);
|
|
43
|
+
n.length && (h((u) => [
|
|
44
|
+
...u,
|
|
45
|
+
...n.map(() => e.current++)
|
|
46
|
+
]), i([...t, ...n]), C((u) => u + 1));
|
|
47
47
|
},
|
|
48
|
-
[t,
|
|
49
|
-
), b =
|
|
50
|
-
(
|
|
51
|
-
h((
|
|
48
|
+
[t, i]
|
|
49
|
+
), b = s.useCallback(
|
|
50
|
+
(m) => {
|
|
51
|
+
h((n) => n.filter((u, R) => R !== m)), i(t.filter((n, u) => u !== m));
|
|
52
52
|
},
|
|
53
|
-
[t,
|
|
54
|
-
), N =
|
|
53
|
+
[t, i]
|
|
54
|
+
), N = s.useMemo(
|
|
55
55
|
() => ({
|
|
56
56
|
value: t,
|
|
57
57
|
inputValue: p,
|
|
58
|
-
setInputValue:
|
|
58
|
+
setInputValue: f,
|
|
59
59
|
addItems: L,
|
|
60
60
|
removeItem: b,
|
|
61
61
|
stableKeys: y
|
|
62
62
|
}),
|
|
63
63
|
[t, p, L, b, y]
|
|
64
64
|
);
|
|
65
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ o(w.Provider, { value: N, children: /* @__PURE__ */ o(
|
|
66
66
|
"div",
|
|
67
67
|
{
|
|
68
|
-
className: g("flex flex-col gap-4",
|
|
69
|
-
"data-hook":
|
|
68
|
+
className: g("flex flex-col gap-4", a),
|
|
69
|
+
"data-hook": c,
|
|
70
70
|
"data-slot": "input-list",
|
|
71
|
-
"data-tracking-el":
|
|
71
|
+
"data-tracking-el": l,
|
|
72
72
|
"data-tracking-label": I,
|
|
73
|
-
children:
|
|
73
|
+
children: d
|
|
74
74
|
}
|
|
75
75
|
) });
|
|
76
76
|
}
|
|
77
77
|
E.displayName = "InputList";
|
|
78
78
|
function z({
|
|
79
79
|
dataHook: t = "input-list",
|
|
80
|
-
loading:
|
|
81
|
-
skeletonCount:
|
|
82
|
-
disabled:
|
|
80
|
+
loading: i = !1,
|
|
81
|
+
skeletonCount: d = 5,
|
|
82
|
+
disabled: a = !1,
|
|
83
|
+
removeAriaLabel: c,
|
|
83
84
|
className: l
|
|
84
85
|
}) {
|
|
85
|
-
const { value:
|
|
86
|
-
return
|
|
86
|
+
const { value: I, removeItem: p, stableKeys: f } = x();
|
|
87
|
+
return i ? /* @__PURE__ */ o(
|
|
87
88
|
"ul",
|
|
88
89
|
{
|
|
89
90
|
className: g("flex flex-col gap-2", l),
|
|
90
91
|
"data-slot": "input-list-skeleton",
|
|
91
|
-
children: Array.from({ length:
|
|
92
|
+
children: Array.from({ length: d }).map((r, e) => /* @__PURE__ */ o(k, { variant: "loading" }, e))
|
|
92
93
|
}
|
|
93
|
-
) : /* @__PURE__ */
|
|
94
|
+
) : /* @__PURE__ */ o(
|
|
94
95
|
"ul",
|
|
95
96
|
{
|
|
96
97
|
className: g("flex flex-col gap-2", l),
|
|
97
98
|
"data-hook": `${t}-list`,
|
|
98
99
|
"data-slot": "list",
|
|
99
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ o(K, { initial: !1, mode: "popLayout", children: I.map((r, e) => /* @__PURE__ */ o(
|
|
100
101
|
$.li,
|
|
101
102
|
{
|
|
102
103
|
layout: !0,
|
|
103
104
|
animate: { opacity: 1, scale: 1 },
|
|
104
|
-
"data-hook": `${t}-item-${
|
|
105
|
+
"data-hook": `${t}-item-${e}`,
|
|
105
106
|
exit: {
|
|
106
107
|
opacity: 0,
|
|
107
108
|
scale: 0.8,
|
|
@@ -120,12 +121,12 @@ function z({
|
|
|
120
121
|
damping: 35
|
|
121
122
|
}
|
|
122
123
|
},
|
|
123
|
-
children: /* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
/* @__PURE__ */
|
|
124
|
+
children: /* @__PURE__ */ o(k, { asChild: !0, variant: "filled", children: /* @__PURE__ */ D("div", { children: [
|
|
125
|
+
/* @__PURE__ */ o(V, { children: /* @__PURE__ */ o(_, { children: r }) }),
|
|
126
|
+
/* @__PURE__ */ o(j, { children: /* @__PURE__ */ o(
|
|
126
127
|
"button",
|
|
127
128
|
{
|
|
128
|
-
"aria-label": `Remove ${
|
|
129
|
+
"aria-label": c ? c.replace("{item}", r) : `Remove ${r}`,
|
|
129
130
|
className: g(
|
|
130
131
|
"inline-flex size-9 cursor-pointer items-center justify-center rounded-full",
|
|
131
132
|
"text-muted-foreground",
|
|
@@ -133,59 +134,59 @@ function z({
|
|
|
133
134
|
"transition-colors duration-150 ease-in-out",
|
|
134
135
|
"disabled:pointer-events-none disabled:opacity-50"
|
|
135
136
|
),
|
|
136
|
-
"data-hook": `${t}-remove-${
|
|
137
|
-
disabled:
|
|
137
|
+
"data-hook": `${t}-remove-${e}`,
|
|
138
|
+
disabled: a,
|
|
138
139
|
type: "button",
|
|
139
|
-
onClick: () =>
|
|
140
|
-
children: /* @__PURE__ */
|
|
140
|
+
onClick: () => p(e),
|
|
141
|
+
children: /* @__PURE__ */ o(P, {})
|
|
141
142
|
}
|
|
142
143
|
) })
|
|
143
144
|
] }) })
|
|
144
145
|
},
|
|
145
|
-
|
|
146
|
+
f[e]
|
|
146
147
|
)) })
|
|
147
148
|
}
|
|
148
149
|
);
|
|
149
150
|
}
|
|
150
151
|
z.displayName = "InputListItems";
|
|
151
|
-
const M =
|
|
152
|
-
({ dataHook: t, error:
|
|
153
|
-
const { inputValue:
|
|
154
|
-
|
|
155
|
-
},
|
|
156
|
-
const h =
|
|
152
|
+
const M = s.forwardRef(
|
|
153
|
+
({ dataHook: t, error: i = !1, className: d, ...a }, c) => {
|
|
154
|
+
const { inputValue: l, setInputValue: I, addItems: p } = x(), f = (e) => {
|
|
155
|
+
e.key === "Enter" && (e.preventDefault(), p([l])), a.onKeyDown?.(e);
|
|
156
|
+
}, r = (e) => {
|
|
157
|
+
const h = e.clipboardData.getData("text").split(`
|
|
157
158
|
`);
|
|
158
|
-
h.length > 1 && (
|
|
159
|
+
h.length > 1 && (e.preventDefault(), p(h)), a.onPaste?.(e);
|
|
159
160
|
};
|
|
160
|
-
return /* @__PURE__ */
|
|
161
|
+
return /* @__PURE__ */ o(
|
|
161
162
|
S,
|
|
162
163
|
{
|
|
163
|
-
ref:
|
|
164
|
-
...
|
|
165
|
-
className: g("flex-1",
|
|
164
|
+
ref: c,
|
|
165
|
+
...a,
|
|
166
|
+
className: g("flex-1", d),
|
|
166
167
|
dataHook: t,
|
|
167
|
-
error:
|
|
168
|
-
value:
|
|
169
|
-
onChange: (
|
|
170
|
-
I(
|
|
168
|
+
error: i,
|
|
169
|
+
value: l,
|
|
170
|
+
onChange: (e) => {
|
|
171
|
+
I(e.target.value), a.onChange?.(e);
|
|
171
172
|
},
|
|
172
|
-
onKeyDown:
|
|
173
|
-
onPaste:
|
|
173
|
+
onKeyDown: f,
|
|
174
|
+
onPaste: r
|
|
174
175
|
}
|
|
175
176
|
);
|
|
176
177
|
}
|
|
177
178
|
);
|
|
178
179
|
M.displayName = "InputListInput";
|
|
179
|
-
const T =
|
|
180
|
-
const { inputValue:
|
|
181
|
-
return /* @__PURE__ */
|
|
180
|
+
const T = s.forwardRef(({ dataHook: t, children: i, ...d }, a) => {
|
|
181
|
+
const { inputValue: c, addItems: l } = x();
|
|
182
|
+
return /* @__PURE__ */ o(
|
|
182
183
|
B,
|
|
183
184
|
{
|
|
184
|
-
ref:
|
|
185
|
-
...
|
|
185
|
+
ref: a,
|
|
186
|
+
...d,
|
|
186
187
|
dataHook: t,
|
|
187
|
-
onClick: () =>
|
|
188
|
-
children:
|
|
188
|
+
onClick: () => l([c]),
|
|
189
|
+
children: i
|
|
189
190
|
}
|
|
190
191
|
);
|
|
191
192
|
});
|