@ledgerhq/lumen-ui-react 0.1.44 → 0.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +111 -107
- package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
- package/dist/lib/Components/AmountDisplay/AmountDisplay.js +1 -0
- package/dist/lib/Components/AmountInput/AmountInput.d.ts +1 -1
- package/dist/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/lib/Components/AmountInput/AmountInput.js +34 -32
- package/dist/lib/Components/AmountInput/types.d.ts +8 -0
- package/dist/lib/Components/AmountInput/types.d.ts.map +1 -1
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts +1 -0
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts.map +1 -1
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.js +9 -8
- package/dist/lib/Components/BaseInput/BaseInput.js +13 -13
- package/dist/lib/Components/Button/Button.js +9 -9
- package/dist/lib/Components/Card/Card.js +14 -14
- package/dist/lib/Components/DataTable/DataTable.js +6 -6
- package/dist/lib/Components/Divider/Divider.js +4 -4
- package/dist/lib/Components/DotIcon/DotIcon.js +5 -5
- package/dist/lib/Components/Icon/Icon.js +4 -4
- package/dist/lib/Components/Link/Link.js +6 -6
- package/dist/lib/Components/MediaImage/MediaImage.js +6 -6
- package/dist/lib/Components/Menu/Menu.d.ts +8 -3
- package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.js +40 -33
- package/dist/lib/Components/Menu/types.d.ts +6 -5
- package/dist/lib/Components/Menu/types.d.ts.map +1 -1
- package/dist/lib/Components/NavBar/NavBar.js +9 -9
- package/dist/lib/Components/Pagination/Pagination.js +10 -10
- package/dist/lib/Components/Popover/Popover.js +10 -10
- package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts +8 -3
- package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/lib/Components/SegmentedControl/SegmentedControl.js +41 -32
- package/dist/lib/Components/SegmentedControl/types.d.ts +6 -5
- package/dist/lib/Components/SegmentedControl/types.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.d.ts +19 -5
- package/dist/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.js +127 -104
- package/dist/lib/Components/Select/index.d.ts +1 -1
- package/dist/lib/Components/Select/index.d.ts.map +1 -1
- package/dist/lib/Components/Select/types.d.ts +20 -19
- package/dist/lib/Components/Select/types.d.ts.map +1 -1
- package/dist/lib/Components/Select/useSelectItems/useSelectItems.d.ts +9 -9
- package/dist/lib/Components/Select/useSelectItems/useSelectItems.d.ts.map +1 -1
- package/dist/lib/Components/Select/utils/groupItems.d.ts +2 -2
- package/dist/lib/Components/Select/utils/groupItems.d.ts.map +1 -1
- package/dist/lib/Components/SideBar/SideBar.d.ts +11 -3
- package/dist/lib/Components/SideBar/SideBar.d.ts.map +1 -1
- package/dist/lib/Components/SideBar/SideBar.js +61 -51
- package/dist/lib/Components/SideBar/index.d.ts +2 -2
- package/dist/lib/Components/SideBar/index.d.ts.map +1 -1
- package/dist/lib/Components/SideBar/types.d.ts +7 -6
- package/dist/lib/Components/SideBar/types.d.ts.map +1 -1
- package/dist/lib/Components/Table/Table.js +49 -49
- package/dist/lib/Components/Table/utils/useThrottledScrollBottom.js +5 -5
- package/dist/lib/Components/TileButton/TileButton.js +6 -6
- package/dist/lib/Components/Tooltip/Tooltip.js +4 -4
- package/dist/libs/utils-shared/dist/index.js +138 -143
- package/dist/package.json +1 -1
- package/package.json +3 -3
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
2
|
-
import { useDisabledContext as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { useLayoutEffect as
|
|
5
|
-
import { SelectProvider as
|
|
6
|
-
import { useControllableState as
|
|
7
|
-
import { useSelectItems as
|
|
2
|
+
import { useDisabledContext as G, cn as l } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as k } from "class-variance-authority";
|
|
4
|
+
import { useLayoutEffect as F } from "react";
|
|
5
|
+
import { SelectProvider as M, useSelectContext as p } from "./SelectContext.js";
|
|
6
|
+
import { useControllableState as W } from "../../../utils/useControllableState/useControllableState.js";
|
|
7
|
+
import { useSelectItems as A } from "./useSelectItems/useSelectItems.js";
|
|
8
8
|
import { resolveValue as f } from "./utils/groupItems.js";
|
|
9
|
-
import { SearchInput as
|
|
10
|
-
import { Check as
|
|
11
|
-
import { Divider as
|
|
12
|
-
import { ChevronDown as
|
|
13
|
-
import { ComboboxRoot as
|
|
9
|
+
import { SearchInput as B } from "../SearchInput/SearchInput.js";
|
|
10
|
+
import { Check as H } from "../../Symbols/Icons/Check.js";
|
|
11
|
+
import { Divider as J } from "../Divider/Divider.js";
|
|
12
|
+
import { ChevronDown as K } from "../../Symbols/Icons/ChevronDown.js";
|
|
13
|
+
import { ComboboxRoot as O } from "../../../node_modules/@base-ui/react/esm/combobox/root/ComboboxRoot.js";
|
|
14
14
|
import { ComboboxTrigger as x } from "../../../node_modules/@base-ui/react/esm/combobox/trigger/ComboboxTrigger.js";
|
|
15
|
-
import { ComboboxPortal as
|
|
16
|
-
import { ComboboxPositioner as
|
|
17
|
-
import { ComboboxPopup as
|
|
18
|
-
import { ComboboxInput as
|
|
19
|
-
import { ComboboxList as
|
|
20
|
-
import { ComboboxGroup as
|
|
21
|
-
import { ComboboxCollection as
|
|
22
|
-
import { ComboboxItem as
|
|
23
|
-
import { ComboboxItemIndicator as
|
|
24
|
-
import { ComboboxEmpty as
|
|
15
|
+
import { ComboboxPortal as Q } from "../../../node_modules/@base-ui/react/esm/combobox/portal/ComboboxPortal.js";
|
|
16
|
+
import { ComboboxPositioner as U } from "../../../node_modules/@base-ui/react/esm/combobox/positioner/ComboboxPositioner.js";
|
|
17
|
+
import { ComboboxPopup as X } from "../../../node_modules/@base-ui/react/esm/combobox/popup/ComboboxPopup.js";
|
|
18
|
+
import { ComboboxInput as Y } from "../../../node_modules/@base-ui/react/esm/combobox/input/ComboboxInput.js";
|
|
19
|
+
import { ComboboxList as Z } from "../../../node_modules/@base-ui/react/esm/combobox/list/ComboboxList.js";
|
|
20
|
+
import { ComboboxGroup as _ } from "../../../node_modules/@base-ui/react/esm/combobox/group/ComboboxGroup.js";
|
|
21
|
+
import { ComboboxCollection as $ } from "../../../node_modules/@base-ui/react/esm/combobox/collection/ComboboxCollection.js";
|
|
22
|
+
import { ComboboxItem as ee } from "../../../node_modules/@base-ui/react/esm/combobox/item/ComboboxItem.js";
|
|
23
|
+
import { ComboboxItemIndicator as te } from "../../../node_modules/@base-ui/react/esm/combobox/item-indicator/ComboboxItemIndicator.js";
|
|
24
|
+
import { ComboboxEmpty as oe } from "../../../node_modules/@base-ui/react/esm/combobox/empty/ComboboxEmpty.js";
|
|
25
25
|
import { ComboboxValue as g } from "../../../node_modules/@base-ui/react/esm/combobox/value/ComboboxValue.js";
|
|
26
|
-
import { ComboboxGroupLabel as
|
|
27
|
-
function
|
|
26
|
+
import { ComboboxGroupLabel as ae } from "../../../node_modules/@base-ui/react/esm/combobox/group-label/ComboboxGroupLabel.js";
|
|
27
|
+
function re({
|
|
28
28
|
value: o,
|
|
29
29
|
defaultValue: a,
|
|
30
30
|
onValueChange: e,
|
|
@@ -35,17 +35,17 @@ function Ge({
|
|
|
35
35
|
searchValue: c,
|
|
36
36
|
defaultSearchValue: m,
|
|
37
37
|
onSearchValueChange: b,
|
|
38
|
-
open:
|
|
39
|
-
defaultOpen:
|
|
40
|
-
onOpenChange:
|
|
41
|
-
name:
|
|
42
|
-
required:
|
|
43
|
-
children:
|
|
38
|
+
open: y,
|
|
39
|
+
defaultOpen: v,
|
|
40
|
+
onOpenChange: C,
|
|
41
|
+
name: N,
|
|
42
|
+
required: w,
|
|
43
|
+
children: I
|
|
44
44
|
}) {
|
|
45
|
-
const
|
|
45
|
+
const V = G({
|
|
46
46
|
consumerName: "Select",
|
|
47
47
|
mergeWith: { disabled: r }
|
|
48
|
-
}), [h,
|
|
48
|
+
}), [h, T] = W(
|
|
49
49
|
{
|
|
50
50
|
prop: o,
|
|
51
51
|
defaultProp: a ?? null,
|
|
@@ -54,14 +54,14 @@ function Ge({
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
), {
|
|
57
|
-
isGrouped:
|
|
58
|
-
groupedItems:
|
|
59
|
-
filteredItemsForRoot:
|
|
60
|
-
resolvedSearchValue:
|
|
61
|
-
searchMounted:
|
|
62
|
-
registerSearch:
|
|
63
|
-
handleSearchValueChange:
|
|
64
|
-
} =
|
|
57
|
+
isGrouped: L,
|
|
58
|
+
groupedItems: R,
|
|
59
|
+
filteredItemsForRoot: q,
|
|
60
|
+
resolvedSearchValue: P,
|
|
61
|
+
searchMounted: j,
|
|
62
|
+
registerSearch: z,
|
|
63
|
+
handleSearchValueChange: D
|
|
64
|
+
} = A({
|
|
65
65
|
items: s,
|
|
66
66
|
filter: n,
|
|
67
67
|
filteredItems: i,
|
|
@@ -70,47 +70,47 @@ function Ge({
|
|
|
70
70
|
onSearchValueChange: b
|
|
71
71
|
});
|
|
72
72
|
return /* @__PURE__ */ t(
|
|
73
|
-
|
|
73
|
+
O,
|
|
74
74
|
{
|
|
75
75
|
"data-slot": "select",
|
|
76
76
|
filter: null,
|
|
77
|
-
items:
|
|
78
|
-
filteredItems:
|
|
79
|
-
inputValue:
|
|
80
|
-
onInputValueChange:
|
|
77
|
+
items: R ?? s,
|
|
78
|
+
filteredItems: q,
|
|
79
|
+
inputValue: P,
|
|
80
|
+
onInputValueChange: D,
|
|
81
81
|
value: h,
|
|
82
|
-
onValueChange: (d) =>
|
|
83
|
-
isItemEqualToValue: (d,
|
|
84
|
-
open:
|
|
85
|
-
defaultOpen:
|
|
86
|
-
onOpenChange:
|
|
87
|
-
name:
|
|
88
|
-
required:
|
|
89
|
-
disabled:
|
|
82
|
+
onValueChange: (d) => T(f(d)),
|
|
83
|
+
isItemEqualToValue: (d, E) => f(d) === f(E),
|
|
84
|
+
open: y,
|
|
85
|
+
defaultOpen: v,
|
|
86
|
+
onOpenChange: C,
|
|
87
|
+
name: N,
|
|
88
|
+
required: w,
|
|
89
|
+
disabled: V,
|
|
90
90
|
children: /* @__PURE__ */ t(
|
|
91
|
-
|
|
91
|
+
M,
|
|
92
92
|
{
|
|
93
|
-
value: { selectedValue: h, registerSearch:
|
|
94
|
-
children:
|
|
93
|
+
value: { selectedValue: h, registerSearch: z, isGrouped: L, searchMounted: j },
|
|
94
|
+
children: I
|
|
95
95
|
}
|
|
96
96
|
)
|
|
97
97
|
}
|
|
98
98
|
);
|
|
99
99
|
}
|
|
100
|
-
const
|
|
100
|
+
const le = l(
|
|
101
101
|
"group relative flex h-48 w-full cursor-pointer items-center justify-between gap-8",
|
|
102
102
|
"rounded-sm bg-muted px-16",
|
|
103
103
|
"body-2 text-base",
|
|
104
104
|
"hover:bg-muted-hover",
|
|
105
105
|
"transition-colors duration-200 focus:ring-2 focus:ring-active focus:outline-hidden",
|
|
106
106
|
"disabled:cursor-not-allowed disabled:text-disabled"
|
|
107
|
-
),
|
|
107
|
+
), se = l(
|
|
108
108
|
"pointer-events-none absolute left-16 origin-left text-muted transition-all duration-300",
|
|
109
109
|
"top-10 -translate-y-4 body-4",
|
|
110
110
|
"group-data-placeholder:top-14 group-data-placeholder:translate-y-0 group-data-placeholder:body-2",
|
|
111
111
|
"group-data-disabled:text-disabled",
|
|
112
112
|
"max-w-[calc(100%-var(--size-56))] truncate"
|
|
113
|
-
),
|
|
113
|
+
), ne = ({
|
|
114
114
|
ref: o,
|
|
115
115
|
className: a,
|
|
116
116
|
labelClassName: e,
|
|
@@ -127,10 +127,10 @@ const ae = l(
|
|
|
127
127
|
ref: o,
|
|
128
128
|
"data-slot": "select-trigger",
|
|
129
129
|
"data-placeholder": i ? void 0 : "",
|
|
130
|
-
className: l(
|
|
130
|
+
className: l(le, a),
|
|
131
131
|
...s,
|
|
132
132
|
children: [
|
|
133
|
-
r && /* @__PURE__ */ t("label", { className: l(
|
|
133
|
+
r && /* @__PURE__ */ t("label", { className: l(se, e), children: r }),
|
|
134
134
|
/* @__PURE__ */ t(
|
|
135
135
|
"span",
|
|
136
136
|
{
|
|
@@ -143,7 +143,7 @@ const ae = l(
|
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
145
|
/* @__PURE__ */ t(
|
|
146
|
-
|
|
146
|
+
K,
|
|
147
147
|
{
|
|
148
148
|
size: 20,
|
|
149
149
|
className: "text-muted group-data-disabled:text-disabled"
|
|
@@ -152,7 +152,11 @@ const ae = l(
|
|
|
152
152
|
]
|
|
153
153
|
}
|
|
154
154
|
);
|
|
155
|
-
},
|
|
155
|
+
}, ie = ({
|
|
156
|
+
render: o,
|
|
157
|
+
disabled: a,
|
|
158
|
+
...e
|
|
159
|
+
}) => {
|
|
156
160
|
const { selectedValue: r } = p({
|
|
157
161
|
consumerName: "SelectTrigger",
|
|
158
162
|
contextRequired: !0
|
|
@@ -163,10 +167,13 @@ const ae = l(
|
|
|
163
167
|
disabled: a,
|
|
164
168
|
ref: e.ref,
|
|
165
169
|
"data-slot": "select-trigger",
|
|
166
|
-
render: o({
|
|
170
|
+
render: o({
|
|
171
|
+
selectedValue: r,
|
|
172
|
+
selectedContent: s
|
|
173
|
+
})
|
|
167
174
|
}
|
|
168
|
-
) : /* @__PURE__ */ t(
|
|
169
|
-
},
|
|
175
|
+
) : /* @__PURE__ */ t(ne, { ...e, disabled: a });
|
|
176
|
+
}, ce = k(
|
|
170
177
|
[
|
|
171
178
|
"group/select-content relative flex max-h-(--available-height) w-(--anchor-width) flex-col overflow-hidden",
|
|
172
179
|
"rounded-sm bg-surface",
|
|
@@ -194,7 +201,7 @@ const ae = l(
|
|
|
194
201
|
}
|
|
195
202
|
}
|
|
196
203
|
}
|
|
197
|
-
),
|
|
204
|
+
), de = ({
|
|
198
205
|
ref: o,
|
|
199
206
|
className: a,
|
|
200
207
|
children: e,
|
|
@@ -203,8 +210,8 @@ const ae = l(
|
|
|
203
210
|
align: n = "start",
|
|
204
211
|
initialFocus: i = !0,
|
|
205
212
|
...c
|
|
206
|
-
}) => /* @__PURE__ */ t(
|
|
207
|
-
|
|
213
|
+
}) => /* @__PURE__ */ t(Q, { "data-slot": "select-portal", children: /* @__PURE__ */ t(
|
|
214
|
+
U,
|
|
208
215
|
{
|
|
209
216
|
"data-slot": "select-positioner",
|
|
210
217
|
className: "pointer-events-auto z-select",
|
|
@@ -212,18 +219,18 @@ const ae = l(
|
|
|
212
219
|
sideOffset: s,
|
|
213
220
|
align: n,
|
|
214
221
|
children: /* @__PURE__ */ t(
|
|
215
|
-
|
|
222
|
+
X,
|
|
216
223
|
{
|
|
217
224
|
ref: o,
|
|
218
225
|
"data-slot": "select-content",
|
|
219
226
|
initialFocus: i,
|
|
220
|
-
className: l(
|
|
227
|
+
className: l(ce({ side: r }), a),
|
|
221
228
|
...c,
|
|
222
229
|
children: e
|
|
223
230
|
}
|
|
224
231
|
)
|
|
225
232
|
}
|
|
226
|
-
) }),
|
|
233
|
+
) }), me = ({
|
|
227
234
|
ref: o,
|
|
228
235
|
className: a,
|
|
229
236
|
renderItem: e,
|
|
@@ -234,7 +241,7 @@ const ae = l(
|
|
|
234
241
|
contextRequired: !0
|
|
235
242
|
});
|
|
236
243
|
return /* @__PURE__ */ t(
|
|
237
|
-
|
|
244
|
+
Z,
|
|
238
245
|
{
|
|
239
246
|
ref: o,
|
|
240
247
|
"data-slot": "select-list",
|
|
@@ -244,29 +251,29 @@ const ae = l(
|
|
|
244
251
|
),
|
|
245
252
|
...r,
|
|
246
253
|
children: s ? (n, i) => /* @__PURE__ */ u(
|
|
247
|
-
|
|
254
|
+
_,
|
|
248
255
|
{
|
|
249
256
|
items: n.items,
|
|
250
257
|
"data-slot": "select-group",
|
|
251
258
|
children: [
|
|
252
|
-
i > 0 && /* @__PURE__ */ t(
|
|
253
|
-
n.label && /* @__PURE__ */ t(
|
|
254
|
-
/* @__PURE__ */ t(
|
|
259
|
+
i > 0 && /* @__PURE__ */ t(S, {}),
|
|
260
|
+
n.label && /* @__PURE__ */ t(ue, { children: n.label }),
|
|
261
|
+
/* @__PURE__ */ t($, { children: e })
|
|
255
262
|
]
|
|
256
263
|
},
|
|
257
264
|
n.label
|
|
258
265
|
) : e
|
|
259
266
|
}
|
|
260
267
|
);
|
|
261
|
-
},
|
|
262
|
-
|
|
268
|
+
}, ue = ({ ref: o, className: a, ...e }) => /* @__PURE__ */ t(
|
|
269
|
+
ae,
|
|
263
270
|
{
|
|
264
271
|
ref: o,
|
|
265
272
|
"data-slot": "select-label",
|
|
266
273
|
className: l("mb-4 px-8 pt-8 pb-0 body-3-semi-bold text-muted", a),
|
|
267
274
|
...e
|
|
268
275
|
}
|
|
269
|
-
),
|
|
276
|
+
), pe = l(
|
|
270
277
|
"group/item flex w-full min-w-0 cursor-pointer items-center gap-12 bg-base-transparent select-none",
|
|
271
278
|
"rounded-sm p-8",
|
|
272
279
|
"body-2 text-base",
|
|
@@ -274,28 +281,28 @@ const ae = l(
|
|
|
274
281
|
"data-highlighted:bg-base-transparent-hover",
|
|
275
282
|
"active:bg-base-transparent-pressed",
|
|
276
283
|
"data-disabled:cursor-not-allowed data-disabled:text-disabled"
|
|
277
|
-
),
|
|
284
|
+
), be = ({
|
|
278
285
|
ref: o,
|
|
279
286
|
className: a,
|
|
280
287
|
children: e,
|
|
281
288
|
...r
|
|
282
289
|
}) => /* @__PURE__ */ u(
|
|
283
|
-
|
|
290
|
+
ee,
|
|
284
291
|
{
|
|
285
292
|
ref: o,
|
|
286
293
|
"data-slot": "select-item",
|
|
287
|
-
className: l(
|
|
294
|
+
className: l(pe, a),
|
|
288
295
|
...r,
|
|
289
296
|
children: [
|
|
290
297
|
e,
|
|
291
|
-
/* @__PURE__ */ t(
|
|
298
|
+
/* @__PURE__ */ t(te, { className: "ml-auto flex shrink-0 items-center justify-center", children: /* @__PURE__ */ t(H, { size: 24, className: "shrink-0 text-active" }) })
|
|
292
299
|
]
|
|
293
300
|
}
|
|
294
|
-
),
|
|
301
|
+
), S = ({
|
|
295
302
|
ref: o,
|
|
296
303
|
className: a,
|
|
297
304
|
...e
|
|
298
|
-
}) => /* @__PURE__ */ t(
|
|
305
|
+
}) => /* @__PURE__ */ t(J, { ref: o, className: l("mx-8 my-4 w-auto", a), ...e }), fe = ({ ref: o, className: a, ...e }) => /* @__PURE__ */ t(
|
|
299
306
|
"span",
|
|
300
307
|
{
|
|
301
308
|
ref: o,
|
|
@@ -303,7 +310,7 @@ const ae = l(
|
|
|
303
310
|
className: l("truncate body-2", a),
|
|
304
311
|
...e
|
|
305
312
|
}
|
|
306
|
-
),
|
|
313
|
+
), he = ({
|
|
307
314
|
ref: o,
|
|
308
315
|
className: a,
|
|
309
316
|
children: e,
|
|
@@ -317,7 +324,7 @@ const ae = l(
|
|
|
317
324
|
...r,
|
|
318
325
|
children: e
|
|
319
326
|
}
|
|
320
|
-
),
|
|
327
|
+
), xe = ({
|
|
321
328
|
ref: o,
|
|
322
329
|
className: a,
|
|
323
330
|
children: e,
|
|
@@ -335,7 +342,7 @@ const ae = l(
|
|
|
335
342
|
...r,
|
|
336
343
|
children: e
|
|
337
344
|
}
|
|
338
|
-
),
|
|
345
|
+
), ge = ({
|
|
339
346
|
className: o,
|
|
340
347
|
placeholder: a = "Search",
|
|
341
348
|
helperText: e,
|
|
@@ -349,11 +356,11 @@ const ae = l(
|
|
|
349
356
|
consumerName: "SelectSearch",
|
|
350
357
|
contextRequired: !0
|
|
351
358
|
});
|
|
352
|
-
return
|
|
353
|
-
|
|
359
|
+
return F(() => m(), [m]), /* @__PURE__ */ t(
|
|
360
|
+
Y,
|
|
354
361
|
{
|
|
355
362
|
render: (b) => /* @__PURE__ */ t(
|
|
356
|
-
|
|
363
|
+
B,
|
|
357
364
|
{
|
|
358
365
|
...b,
|
|
359
366
|
"aria-invalid": s,
|
|
@@ -369,14 +376,14 @@ const ae = l(
|
|
|
369
376
|
)
|
|
370
377
|
}
|
|
371
378
|
);
|
|
372
|
-
},
|
|
379
|
+
}, Se = ({
|
|
373
380
|
ref: o,
|
|
374
381
|
className: a,
|
|
375
382
|
title: e,
|
|
376
383
|
description: r,
|
|
377
384
|
...s
|
|
378
385
|
}) => /* @__PURE__ */ u(
|
|
379
|
-
|
|
386
|
+
oe,
|
|
380
387
|
{
|
|
381
388
|
ref: o,
|
|
382
389
|
"data-slot": "select-empty-state",
|
|
@@ -392,16 +399,32 @@ const ae = l(
|
|
|
392
399
|
]
|
|
393
400
|
}
|
|
394
401
|
);
|
|
402
|
+
function Oe() {
|
|
403
|
+
return {
|
|
404
|
+
Select: re,
|
|
405
|
+
SelectTrigger: ie,
|
|
406
|
+
SelectContent: de,
|
|
407
|
+
SelectSearch: ge,
|
|
408
|
+
SelectList: me,
|
|
409
|
+
SelectItemText: fe,
|
|
410
|
+
SelectItemContent: he,
|
|
411
|
+
SelectItemDescription: xe,
|
|
412
|
+
SelectItem: be,
|
|
413
|
+
SelectSeparator: S,
|
|
414
|
+
SelectEmptyState: Se
|
|
415
|
+
};
|
|
416
|
+
}
|
|
395
417
|
export {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
418
|
+
re as Select,
|
|
419
|
+
de as SelectContent,
|
|
420
|
+
Se as SelectEmptyState,
|
|
421
|
+
be as SelectItem,
|
|
422
|
+
he as SelectItemContent,
|
|
423
|
+
xe as SelectItemDescription,
|
|
424
|
+
fe as SelectItemText,
|
|
425
|
+
me as SelectList,
|
|
426
|
+
ge as SelectSearch,
|
|
427
|
+
S as SelectSeparator,
|
|
428
|
+
ie as SelectTrigger,
|
|
429
|
+
Oe as createSelect
|
|
407
430
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from './Select';
|
|
2
|
-
export type { MetaShape, SelectItemData, SelectProps, SelectTriggerProps, SelectTriggerRenderProps, SelectContentProps, SelectSearchProps, SelectListProps, SelectItemTextProps, SelectItemContentProps, SelectItemDescriptionProps, SelectItemProps, SelectSeparatorProps, SelectEmptyStateProps, } from './types';
|
|
2
|
+
export type { MetaShape, SelectValue, SelectItemData, SelectProps, SelectTriggerProps, SelectTriggerRenderProps, SelectContentProps, SelectSearchProps, SelectListProps, SelectItemTextProps, SelectItemContentProps, SelectItemDescriptionProps, SelectItemProps, SelectSeparatorProps, SelectEmptyStateProps, } from './types';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Select/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,YAAY,EACV,SAAS,EACT,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,eAAe,EACf,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Select/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,YAAY,EACV,SAAS,EACT,WAAW,EACX,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,eAAe,EACf,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,SAAS,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ReactElement, ReactNode, RefObject } from 'react';
|
|
2
2
|
import { SearchInputProps } from '../SearchInput/types';
|
|
3
3
|
export type MetaShape = Record<string, unknown>;
|
|
4
|
-
export type
|
|
4
|
+
export type SelectValue = string;
|
|
5
|
+
export type SelectItemData<T extends SelectValue = SelectValue, TMeta extends MetaShape = MetaShape> = {
|
|
5
6
|
/** Unique string identifier for this item, used for selection tracking. */
|
|
6
|
-
value:
|
|
7
|
+
value: T;
|
|
7
8
|
/** Display text used in the trigger. Also the field matched against by the default search filter. */
|
|
8
9
|
label: string;
|
|
9
10
|
/** When true, the item cannot be selected or focused. */
|
|
@@ -27,23 +28,23 @@ export type SelectItemData<TMeta extends MetaShape = MetaShape> = {
|
|
|
27
28
|
meta?: TMeta;
|
|
28
29
|
};
|
|
29
30
|
/** @internal A named group of select items, used to represent a resolved group with its header label and child items. */
|
|
30
|
-
export type SelectItemGroup<TMeta extends MetaShape = MetaShape> = {
|
|
31
|
+
export type SelectItemGroup<T extends SelectValue = SelectValue, TMeta extends MetaShape = MetaShape> = {
|
|
31
32
|
/** The displayed group name, matching the `group` field on each child item. */
|
|
32
33
|
label: string;
|
|
33
34
|
/** The items belonging to this group. */
|
|
34
|
-
items: SelectItemData<TMeta>[];
|
|
35
|
+
items: SelectItemData<T, TMeta>[];
|
|
35
36
|
};
|
|
36
|
-
export type SelectTriggerRenderProps = {
|
|
37
|
+
export type SelectTriggerRenderProps<T extends SelectValue = SelectValue> = {
|
|
37
38
|
/**
|
|
38
39
|
* The currently selected value, or null if nothing is selected.
|
|
39
40
|
*/
|
|
40
|
-
selectedValue:
|
|
41
|
+
selectedValue: T | null;
|
|
41
42
|
/**
|
|
42
43
|
* A ReactNode that renders the selected item's content via `Combobox.Value`.
|
|
43
44
|
*/
|
|
44
45
|
selectedContent: ReactNode;
|
|
45
46
|
};
|
|
46
|
-
export type SelectProps<TMeta extends MetaShape = MetaShape> = {
|
|
47
|
+
export type SelectProps<T extends SelectValue = SelectValue, TMeta extends MetaShape = MetaShape> = {
|
|
47
48
|
/**
|
|
48
49
|
* The children of the select.
|
|
49
50
|
*/
|
|
@@ -59,7 +60,7 @@ export type SelectProps<TMeta extends MetaShape = MetaShape> = {
|
|
|
59
60
|
* them by that value, rendering group headers, separators, and per-group
|
|
60
61
|
* collection iteration internally.
|
|
61
62
|
*/
|
|
62
|
-
items: SelectItemData<TMeta>[];
|
|
63
|
+
items: SelectItemData<T, TMeta>[];
|
|
63
64
|
/**
|
|
64
65
|
* Filter function used to match items against a search query.
|
|
65
66
|
* When `SelectSearch` is rendered inside the content, a default case-insensitive
|
|
@@ -70,13 +71,13 @@ export type SelectProps<TMeta extends MetaShape = MetaShape> = {
|
|
|
70
71
|
* items within each group. Empty groups are automatically hidden.
|
|
71
72
|
* @default undefined
|
|
72
73
|
*/
|
|
73
|
-
filter?: null | ((item: SelectItemData<TMeta>, query: string) => boolean);
|
|
74
|
+
filter?: null | ((item: SelectItemData<T, TMeta>, query: string) => boolean);
|
|
74
75
|
/**
|
|
75
76
|
* Pre-filtered items to display in the list. When provided, the component uses
|
|
76
77
|
* these items directly instead of filtering `items` internally. Use alongside
|
|
77
78
|
* `onSearchValueChange` for async/remote search where the server handles filtering.
|
|
78
79
|
*/
|
|
79
|
-
filteredItems?: SelectItemData<TMeta>[];
|
|
80
|
+
filteredItems?: SelectItemData<T, TMeta>[];
|
|
80
81
|
/**
|
|
81
82
|
* The controlled search input value.
|
|
82
83
|
* Should be used in conjunction with `onSearchValueChange`.
|
|
@@ -106,7 +107,7 @@ export type SelectProps<TMeta extends MetaShape = MetaShape> = {
|
|
|
106
107
|
/**
|
|
107
108
|
* The value of the select when initially rendered (uncontrolled).
|
|
108
109
|
*/
|
|
109
|
-
defaultValue?:
|
|
110
|
+
defaultValue?: T;
|
|
110
111
|
/**
|
|
111
112
|
* Event handler called when the open state of the popup changes.
|
|
112
113
|
*/
|
|
@@ -115,12 +116,12 @@ export type SelectProps<TMeta extends MetaShape = MetaShape> = {
|
|
|
115
116
|
* The controlled value of the select.
|
|
116
117
|
* Should be used in conjunction with `onValueChange`.
|
|
117
118
|
*/
|
|
118
|
-
value?:
|
|
119
|
+
value?: T | null;
|
|
119
120
|
/**
|
|
120
121
|
* Event handler called when the selected value changes.
|
|
121
122
|
* Receives `null` when the selection is cleared (e.g. combobox clear behavior).
|
|
122
123
|
*/
|
|
123
|
-
onValueChange?: (value:
|
|
124
|
+
onValueChange?: (value: T | null) => void;
|
|
124
125
|
/**
|
|
125
126
|
* The name of the select for form submission.
|
|
126
127
|
*/
|
|
@@ -135,7 +136,7 @@ export type SelectProps<TMeta extends MetaShape = MetaShape> = {
|
|
|
135
136
|
*/
|
|
136
137
|
required?: boolean;
|
|
137
138
|
};
|
|
138
|
-
export type SelectTriggerProps = {
|
|
139
|
+
export type SelectTriggerProps<T extends SelectValue = SelectValue> = {
|
|
139
140
|
/**
|
|
140
141
|
* Render function that replaces the default input-style trigger.
|
|
141
142
|
* When provided, the trigger delegates rendering to this function.
|
|
@@ -144,7 +145,7 @@ export type SelectTriggerProps = {
|
|
|
144
145
|
* @example render={({ selectedValue, selectedContent }) => <MediaButton>{selectedValue ? selectedContent : 'Label'}</MediaButton>}
|
|
145
146
|
* @example render={({ selectedValue, selectedContent }) => <MyTrigger />}
|
|
146
147
|
*/
|
|
147
|
-
render?: (props: SelectTriggerRenderProps) => ReactElement;
|
|
148
|
+
render?: (props: SelectTriggerRenderProps<T>) => ReactElement;
|
|
148
149
|
/**
|
|
149
150
|
* Extra class names to apply to the trigger element.
|
|
150
151
|
*/
|
|
@@ -193,7 +194,7 @@ export type SelectContentProps = {
|
|
|
193
194
|
*/
|
|
194
195
|
initialFocus?: boolean | RefObject<HTMLElement | null>;
|
|
195
196
|
} & ComponentPropsWithRef<'div'>;
|
|
196
|
-
export type SelectListProps<TMeta extends MetaShape = MetaShape> = {
|
|
197
|
+
export type SelectListProps<T extends SelectValue = SelectValue, TMeta extends MetaShape = MetaShape> = {
|
|
197
198
|
/**
|
|
198
199
|
* A render function that receives each item and its index, returning a ReactNode.
|
|
199
200
|
*
|
|
@@ -202,7 +203,7 @@ export type SelectListProps<TMeta extends MetaShape = MetaShape> = {
|
|
|
202
203
|
* is handled automatically by `SelectList`.
|
|
203
204
|
* @example renderItem={(item) => <SelectItem value={item.value}>{item.label}</SelectItem>}
|
|
204
205
|
*/
|
|
205
|
-
renderItem: (item: SelectItemData<TMeta>, index: number) => ReactNode;
|
|
206
|
+
renderItem: (item: SelectItemData<T, TMeta>, index: number) => ReactNode;
|
|
206
207
|
/**
|
|
207
208
|
* Extra class names to apply to the list element.
|
|
208
209
|
*/
|
|
@@ -228,11 +229,11 @@ export type SelectItemTextProps = {
|
|
|
228
229
|
*/
|
|
229
230
|
className?: string;
|
|
230
231
|
} & ComponentPropsWithRef<'span'>;
|
|
231
|
-
export type SelectItemProps = {
|
|
232
|
+
export type SelectItemProps<T extends SelectValue = SelectValue> = {
|
|
232
233
|
/**
|
|
233
234
|
* The unique string value associated with this item.
|
|
234
235
|
*/
|
|
235
|
-
value:
|
|
236
|
+
value: T;
|
|
236
237
|
/**
|
|
237
238
|
* The children of the select item. Supports custom content
|
|
238
239
|
* (icons, tags, descriptions, etc.) alongside `SelectItemText`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,SAAS,EACT,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEhD,MAAM,MAAM,cAAc,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,SAAS,EACT,SAAS,EACV,MAAM,OAAO,CAAC;AACf,O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electItemGroup } from '../types';
|
|
2
|
-
type UseSelectItemsParams<TMeta extends MetaShape = MetaShape> = {
|
|
3
|
-
items: SelectItemData<TMeta>[];
|
|
4
|
-
filter?: null | ((item: SelectItemData<TMeta>, query: string) => boolean);
|
|
5
|
-
filteredItems?: SelectItemData<TMeta>[];
|
|
1
|
+
import { MetaShape, SelectItemData, SelectItemGroup, SelectValue } from '../types';
|
|
2
|
+
type UseSelectItemsParams<T extends SelectValue = SelectValue, TMeta extends MetaShape = MetaShape> = {
|
|
3
|
+
items: SelectItemData<T, TMeta>[];
|
|
4
|
+
filter?: null | ((item: SelectItemData<T, TMeta>, query: string) => boolean);
|
|
5
|
+
filteredItems?: SelectItemData<T, TMeta>[];
|
|
6
6
|
searchValue?: string;
|
|
7
7
|
defaultSearchValue?: string;
|
|
8
8
|
onSearchValueChange?: (value: string) => void;
|
|
9
9
|
};
|
|
10
|
-
type UseSelectItemsReturn<TMeta extends MetaShape = MetaShape> = {
|
|
10
|
+
type UseSelectItemsReturn<T extends SelectValue = SelectValue, TMeta extends MetaShape = MetaShape> = {
|
|
11
11
|
isGrouped: boolean;
|
|
12
|
-
groupedItems: SelectItemGroup<TMeta>[] | null;
|
|
13
|
-
filteredItemsForRoot: SelectItemData<TMeta>[] | SelectItemGroup<TMeta>[];
|
|
12
|
+
groupedItems: SelectItemGroup<T, TMeta>[] | null;
|
|
13
|
+
filteredItemsForRoot: SelectItemData<T, TMeta>[] | SelectItemGroup<T, TMeta>[];
|
|
14
14
|
resolvedSearchValue: string;
|
|
15
15
|
searchMounted: boolean;
|
|
16
16
|
registerSearch: () => () => void;
|
|
@@ -26,6 +26,6 @@ type UseSelectItemsReturn<TMeta extends MetaShape = MetaShape> = {
|
|
|
26
26
|
* the internal filter entirely.
|
|
27
27
|
* - Supports controlled and uncontrolled `searchValue` via `useControllableState`.
|
|
28
28
|
*/
|
|
29
|
-
export declare function useSelectItems<TMeta extends MetaShape = MetaShape>({ items, filter, filteredItems: filteredItemsProp, searchValue: searchValueProp, defaultSearchValue, onSearchValueChange: onSearchValueChangeProp, }: UseSelectItemsParams<TMeta>): UseSelectItemsReturn<TMeta>;
|
|
29
|
+
export declare function useSelectItems<T extends SelectValue = SelectValue, TMeta extends MetaShape = MetaShape>({ items, filter, filteredItems: filteredItemsProp, searchValue: searchValueProp, defaultSearchValue, onSearchValueChange: onSearchValueChangeProp, }: UseSelectItemsParams<T, TMeta>): UseSelectItemsReturn<T, TMeta>;
|
|
30
30
|
export {};
|
|
31
31
|
//# sourceMappingURL=useSelectItems.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelectItems.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Select/useSelectItems/useSelectItems.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"useSelectItems.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Select/useSelectItems/useSelectItems.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,eAAe,EACf,WAAW,EACZ,MAAM,UAAU,CAAC;AAGlB,KAAK,oBAAoB,CACvB,CAAC,SAAS,WAAW,GAAG,WAAW,EACnC,KAAK,SAAS,SAAS,GAAG,SAAS,IACjC;IACF,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,MAAM,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;IAC7E,aAAa,CAAC,EAAE,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C,CAAC;AAE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