@reformer/ui-kit 7.0.0 → 9.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -70
- package/dist/components/state/error-state.d.ts +1 -2
- package/dist/components/state/index.d.ts +2 -0
- package/dist/components/state/loading-state.d.ts +1 -2
- package/dist/components/state/state-a11y.test.d.ts +1 -0
- package/dist/components/ui/checkbox.d.ts +1 -1
- package/dist/components/ui/checkbox.test.d.ts +1 -0
- package/dist/components/ui/input-mask.d.ts +1 -1
- package/dist/components/ui/input-number-buffer.d.ts +69 -0
- package/dist/components/ui/input-number-buffer.test.d.ts +1 -0
- package/dist/components/ui/input-password.d.ts +1 -1
- package/dist/components/ui/input.d.ts +30 -18
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.test.d.ts +1 -0
- package/dist/components/ui/select.d.ts +9 -4
- package/dist/components/ui/select.test.d.ts +1 -0
- package/dist/components/ui/textarea.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/loading-state-BOBeK9tp.js +49 -0
- package/dist/package-exports.test.d.ts +1 -0
- package/dist/state.js +1 -1
- package/dist/ui/checkbox.js +42 -21
- package/dist/ui/form-field.js +175 -150
- package/dist/ui/input.js +74 -45
- package/dist/ui/radio-group.js +67 -47
- package/dist/ui/select.js +207 -179
- package/llms.txt +62 -52
- package/package.json +8 -10
- package/dist/loading-state-4VeOE6iN.js +0 -38
package/dist/ui/select.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { XIcon as
|
|
1
|
+
import { jsxs as f, jsx as a, Fragment as F } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import * as i from "@radix-ui/react-select";
|
|
4
|
+
import { XIcon as A, ChevronDownIcon as _, CheckIcon as G, ChevronUpIcon as K } from "lucide-react";
|
|
5
5
|
import { c as g } from "../utils-DtaLkIY8.js";
|
|
6
|
-
function
|
|
6
|
+
function O(e) {
|
|
7
7
|
switch (e) {
|
|
8
8
|
case "partial":
|
|
9
9
|
return { serverSearch: !0, paginated: !0, searchable: !0 };
|
|
@@ -14,7 +14,7 @@ function U(e) {
|
|
|
14
14
|
return { serverSearch: !1, paginated: !1, searchable: !1 };
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function M(e) {
|
|
18
18
|
return e.map((t) => ({
|
|
19
19
|
id: t.id,
|
|
20
20
|
label: t.label,
|
|
@@ -22,17 +22,17 @@ function z(e) {
|
|
|
22
22
|
group: t.group
|
|
23
23
|
}));
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
for (const
|
|
28
|
-
|
|
25
|
+
function X(e, t) {
|
|
26
|
+
const r = new Set(e.map((l) => l.id)), n = [...e];
|
|
27
|
+
for (const l of t)
|
|
28
|
+
r.has(l.id) || (r.add(l.id), n.push(l));
|
|
29
29
|
return n;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
const
|
|
33
|
-
return
|
|
31
|
+
function J(e, t) {
|
|
32
|
+
const r = t.trim().toLowerCase();
|
|
33
|
+
return r ? e.filter((n) => n.label.toLowerCase().includes(r)) : e;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function z() {
|
|
36
36
|
return {
|
|
37
37
|
options: [],
|
|
38
38
|
page: 0,
|
|
@@ -43,18 +43,18 @@ function w() {
|
|
|
43
43
|
search: ""
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Q(e, t) {
|
|
47
47
|
switch (t.kind) {
|
|
48
48
|
case "load-start":
|
|
49
49
|
return {
|
|
50
|
-
...
|
|
50
|
+
...z(),
|
|
51
51
|
loading: !0,
|
|
52
52
|
search: t.search
|
|
53
53
|
};
|
|
54
54
|
case "load-success":
|
|
55
55
|
return {
|
|
56
56
|
...e,
|
|
57
|
-
options:
|
|
57
|
+
options: M(t.result.items),
|
|
58
58
|
totalCount: t.result.totalCount,
|
|
59
59
|
page: t.page,
|
|
60
60
|
loading: !1,
|
|
@@ -65,7 +65,7 @@ function G(e, t) {
|
|
|
65
65
|
case "load-more-success":
|
|
66
66
|
return {
|
|
67
67
|
...e,
|
|
68
|
-
options:
|
|
68
|
+
options: X(e.options, M(t.result.items)),
|
|
69
69
|
totalCount: t.result.totalCount,
|
|
70
70
|
page: t.page,
|
|
71
71
|
loadingMore: !1,
|
|
@@ -74,257 +74,285 @@ function G(e, t) {
|
|
|
74
74
|
case "load-error":
|
|
75
75
|
return { ...e, loading: !1, loadingMore: !1, error: !0 };
|
|
76
76
|
case "reset":
|
|
77
|
-
return
|
|
77
|
+
return z();
|
|
78
78
|
default:
|
|
79
79
|
return e;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function R(e) {
|
|
83
83
|
return e.options.length < e.totalCount;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function W(e, t = 48) {
|
|
86
86
|
return e.scrollTop + e.clientHeight >= e.scrollHeight - t;
|
|
87
87
|
}
|
|
88
|
-
const
|
|
89
|
-
function
|
|
90
|
-
const t =
|
|
91
|
-
|
|
88
|
+
const Y = 300;
|
|
89
|
+
function Z(e) {
|
|
90
|
+
const t = u.useMemo(() => O(e?.type), [e?.type]), [r, n] = u.useReducer(Q, void 0, z), [l, d] = u.useState(""), [b, x] = u.useState(0), y = u.useCallback(() => x((s) => s + 1), []);
|
|
91
|
+
u.useEffect(() => {
|
|
92
92
|
if (!e || t.serverSearch) return;
|
|
93
|
-
let
|
|
93
|
+
let s = !1;
|
|
94
94
|
return n({ kind: "load-start", search: "" }), e.load({}).then(
|
|
95
|
-
(
|
|
96
|
-
|
|
95
|
+
(h) => {
|
|
96
|
+
s || n({ kind: "load-success", result: h, page: 1 });
|
|
97
97
|
},
|
|
98
98
|
() => {
|
|
99
|
-
|
|
99
|
+
s || n({ kind: "load-error" });
|
|
100
100
|
}
|
|
101
101
|
), () => {
|
|
102
|
-
|
|
102
|
+
s = !0;
|
|
103
103
|
};
|
|
104
|
-
}, [e, t.serverSearch]),
|
|
104
|
+
}, [e, t.serverSearch, b]), u.useEffect(() => {
|
|
105
105
|
if (!e || !t.serverSearch) return;
|
|
106
|
-
let
|
|
107
|
-
const
|
|
108
|
-
n({ kind: "load-start", search:
|
|
109
|
-
(
|
|
110
|
-
|
|
106
|
+
let s = !1;
|
|
107
|
+
const h = setTimeout(() => {
|
|
108
|
+
n({ kind: "load-start", search: l }), e.load({ search: l, page: 1, pageSize: e.pageSize }).then(
|
|
109
|
+
(C) => {
|
|
110
|
+
s || n({ kind: "load-success", result: C, page: 1 });
|
|
111
111
|
},
|
|
112
112
|
() => {
|
|
113
|
-
|
|
113
|
+
s || n({ kind: "load-error" });
|
|
114
114
|
}
|
|
115
115
|
);
|
|
116
|
-
},
|
|
116
|
+
}, Y);
|
|
117
117
|
return () => {
|
|
118
|
-
|
|
118
|
+
s = !0, clearTimeout(h);
|
|
119
119
|
};
|
|
120
|
-
}, [e, t.serverSearch,
|
|
121
|
-
const
|
|
122
|
-
if (!e || !t.paginated ||
|
|
123
|
-
const
|
|
124
|
-
n({ kind: "load-more-start" }), e.load({ search:
|
|
125
|
-
(
|
|
120
|
+
}, [e, t.serverSearch, l, b]);
|
|
121
|
+
const w = u.useCallback(() => {
|
|
122
|
+
if (!e || !t.paginated || r.loading || r.loadingMore || !R(r)) return;
|
|
123
|
+
const s = r.page + 1;
|
|
124
|
+
n({ kind: "load-more-start" }), e.load({ search: r.search, page: s, pageSize: e.pageSize }).then(
|
|
125
|
+
(h) => n({ kind: "load-more-success", result: h, page: s }),
|
|
126
126
|
() => n({ kind: "load-error", more: !0 })
|
|
127
127
|
);
|
|
128
|
-
}, [e, t.paginated,
|
|
128
|
+
}, [e, t.paginated, r]);
|
|
129
129
|
return {
|
|
130
|
-
options: t.serverSearch ?
|
|
131
|
-
loading:
|
|
132
|
-
loadingMore:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
options: t.serverSearch ? r.options : J(r.options, l),
|
|
131
|
+
loading: r.loading,
|
|
132
|
+
loadingMore: r.loadingMore,
|
|
133
|
+
error: r.error,
|
|
134
|
+
hasMore: R(r),
|
|
135
|
+
loadMore: w,
|
|
136
|
+
reload: y,
|
|
137
|
+
searchInput: l,
|
|
138
|
+
setSearchInput: d,
|
|
137
139
|
flags: t
|
|
138
140
|
};
|
|
139
141
|
}
|
|
140
|
-
const
|
|
142
|
+
const $ = u.forwardRef(
|
|
141
143
|
({
|
|
142
144
|
className: e,
|
|
143
145
|
value: t,
|
|
144
|
-
onChange:
|
|
146
|
+
onChange: r,
|
|
145
147
|
onBlur: n,
|
|
146
|
-
resource:
|
|
147
|
-
options:
|
|
148
|
-
placeholder:
|
|
149
|
-
disabled:
|
|
150
|
-
clearable:
|
|
151
|
-
|
|
152
|
-
"
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
148
|
+
resource: l,
|
|
149
|
+
options: d,
|
|
150
|
+
placeholder: b,
|
|
151
|
+
disabled: x,
|
|
152
|
+
clearable: y = !1,
|
|
153
|
+
id: w,
|
|
154
|
+
"data-testid": k,
|
|
155
|
+
"aria-invalid": s,
|
|
156
|
+
"aria-labelledby": h,
|
|
157
|
+
"aria-describedby": C,
|
|
158
|
+
"aria-errormessage": j,
|
|
159
|
+
"aria-required": L,
|
|
160
|
+
...P
|
|
161
|
+
}, T) => {
|
|
162
|
+
const c = Z(l), N = u.useMemo(() => d ? d.map((o) => ({
|
|
163
|
+
id: o.value,
|
|
164
|
+
label: o.label,
|
|
165
|
+
value: String(o.value),
|
|
166
|
+
group: o.group
|
|
167
|
+
})) : c.options, [d, c.options]), V = !d && !!l && c.flags.searchable, v = !d && c.loading, B = !d && c.error && N.length === 0, D = (o) => {
|
|
168
|
+
r?.(o);
|
|
169
|
+
}, E = (o) => {
|
|
170
|
+
o || n?.();
|
|
171
|
+
}, H = (o) => {
|
|
172
|
+
o.stopPropagation(), r?.(null);
|
|
173
|
+
}, U = (o) => {
|
|
174
|
+
c.flags.paginated && W(o.currentTarget) && c.loadMore();
|
|
175
|
+
}, I = y && t && !x && !v, q = V ? /* @__PURE__ */ a("div", { className: "sticky top-0 z-10 border-b bg-popover p-1", children: /* @__PURE__ */ a(
|
|
169
176
|
"input",
|
|
170
177
|
{
|
|
171
178
|
type: "text",
|
|
172
|
-
value:
|
|
173
|
-
onChange: (
|
|
174
|
-
onKeyDown: (
|
|
179
|
+
value: c.searchInput,
|
|
180
|
+
onChange: (o) => c.setSearchInput(o.target.value),
|
|
181
|
+
onKeyDown: (o) => o.stopPropagation(),
|
|
175
182
|
placeholder: "Search...",
|
|
176
|
-
className: "w-full rounded-sm border border-
|
|
183
|
+
className: "w-full rounded-sm border border-input px-2 py-1 text-sm outline-none focus:border-ring",
|
|
177
184
|
"aria-label": "Search options"
|
|
178
185
|
}
|
|
179
186
|
) }) : null;
|
|
180
|
-
return /* @__PURE__ */
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
|
|
187
|
+
return /* @__PURE__ */ f("div", { className: "relative w-full", children: [
|
|
188
|
+
/* @__PURE__ */ f(
|
|
189
|
+
i.Root,
|
|
183
190
|
{
|
|
184
191
|
"data-slot": "select",
|
|
185
192
|
value: t || "",
|
|
186
|
-
onValueChange:
|
|
187
|
-
onOpenChange:
|
|
188
|
-
disabled:
|
|
189
|
-
...
|
|
193
|
+
onValueChange: D,
|
|
194
|
+
onOpenChange: E,
|
|
195
|
+
disabled: x || v,
|
|
196
|
+
...P,
|
|
190
197
|
children: [
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
|
|
198
|
+
/* @__PURE__ */ a(
|
|
199
|
+
ae,
|
|
193
200
|
{
|
|
194
|
-
ref:
|
|
195
|
-
className: g(e,
|
|
196
|
-
disabled:
|
|
197
|
-
|
|
198
|
-
"
|
|
199
|
-
|
|
200
|
-
|
|
201
|
+
ref: T,
|
|
202
|
+
className: g(e, I && "pr-8"),
|
|
203
|
+
disabled: v,
|
|
204
|
+
id: w,
|
|
205
|
+
"data-testid": k,
|
|
206
|
+
"aria-invalid": s,
|
|
207
|
+
"aria-labelledby": h,
|
|
208
|
+
"aria-describedby": C,
|
|
209
|
+
"aria-errormessage": j,
|
|
210
|
+
"aria-required": L,
|
|
211
|
+
children: /* @__PURE__ */ a(
|
|
212
|
+
te,
|
|
201
213
|
{
|
|
202
|
-
placeholder:
|
|
214
|
+
placeholder: v ? "Loading..." : b || "Select an option..."
|
|
203
215
|
}
|
|
204
216
|
)
|
|
205
217
|
}
|
|
206
218
|
),
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
|
|
219
|
+
/* @__PURE__ */ a(
|
|
220
|
+
re,
|
|
209
221
|
{
|
|
210
|
-
header:
|
|
211
|
-
onViewportScroll:
|
|
212
|
-
children:
|
|
222
|
+
header: q,
|
|
223
|
+
onViewportScroll: c.flags.paginated ? U : void 0,
|
|
224
|
+
children: v ? /* @__PURE__ */ a("div", { className: "px-2 py-1.5 text-sm text-muted-foreground", children: "Loading..." }) : B ? /* @__PURE__ */ f("div", { className: "flex items-center justify-between gap-2 px-2 py-1.5 text-sm text-destructive", children: [
|
|
225
|
+
/* @__PURE__ */ a("span", { children: "Failed to load options" }),
|
|
226
|
+
/* @__PURE__ */ a(
|
|
227
|
+
"button",
|
|
228
|
+
{
|
|
229
|
+
type: "button",
|
|
230
|
+
onKeyDown: (o) => o.stopPropagation(),
|
|
231
|
+
onClick: (o) => {
|
|
232
|
+
o.stopPropagation(), c.reload();
|
|
233
|
+
},
|
|
234
|
+
className: "rounded-sm px-2 py-0.5 text-xs font-medium text-foreground underline underline-offset-2 hover:text-destructive focus:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
235
|
+
children: "Retry"
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
] }) : N.length === 0 ? /* @__PURE__ */ a("div", { className: "px-2 py-1.5 text-sm text-muted-foreground", children: "No options available" }) : /* @__PURE__ */ f(F, { children: [
|
|
213
239
|
(() => {
|
|
214
|
-
const
|
|
215
|
-
(
|
|
216
|
-
const
|
|
217
|
-
return
|
|
240
|
+
const o = N.reduce(
|
|
241
|
+
(p, S) => {
|
|
242
|
+
const m = S.group || "default";
|
|
243
|
+
return p[m] || (p[m] = []), p[m].push(S), p;
|
|
218
244
|
},
|
|
219
245
|
{}
|
|
220
246
|
);
|
|
221
|
-
return Object.entries(
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
] },
|
|
247
|
+
return Object.entries(o).map(([p, S]) => /* @__PURE__ */ f(ee, { children: [
|
|
248
|
+
p !== "default" && /* @__PURE__ */ a(oe, { children: p }),
|
|
249
|
+
S.map((m) => /* @__PURE__ */ a(ne, { value: m.value, children: m.label }, m.id))
|
|
250
|
+
] }, p));
|
|
225
251
|
})(),
|
|
226
|
-
|
|
252
|
+
c.loadingMore && /* @__PURE__ */ a("div", { className: "px-2 py-1.5 text-center text-xs text-muted-foreground", children: "Loading more..." })
|
|
227
253
|
] })
|
|
228
254
|
}
|
|
229
255
|
)
|
|
230
256
|
]
|
|
231
257
|
}
|
|
232
258
|
),
|
|
233
|
-
|
|
259
|
+
I && /* @__PURE__ */ a(
|
|
234
260
|
"button",
|
|
235
261
|
{
|
|
236
262
|
type: "button",
|
|
237
263
|
className: "absolute right-8 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600 transition-colors bg-transparent border-none p-0 cursor-pointer focus:outline-none z-10",
|
|
238
|
-
onClick:
|
|
264
|
+
onClick: H,
|
|
239
265
|
"aria-label": "Clear selection",
|
|
240
266
|
tabIndex: -1,
|
|
241
|
-
children: /* @__PURE__ */
|
|
267
|
+
children: /* @__PURE__ */ a(A, { className: "size-4" })
|
|
242
268
|
}
|
|
243
269
|
)
|
|
244
270
|
] });
|
|
245
271
|
}
|
|
246
272
|
);
|
|
247
|
-
|
|
248
|
-
function
|
|
249
|
-
return /* @__PURE__ */
|
|
273
|
+
$.displayName = "Select";
|
|
274
|
+
function ee({ ...e }) {
|
|
275
|
+
return /* @__PURE__ */ a(i.Group, { "data-slot": "select-group", ...e });
|
|
250
276
|
}
|
|
251
|
-
function
|
|
252
|
-
return /* @__PURE__ */
|
|
277
|
+
function te({ ...e }) {
|
|
278
|
+
return /* @__PURE__ */ a(i.Value, { "data-slot": "select-value", ...e });
|
|
253
279
|
}
|
|
254
|
-
function
|
|
280
|
+
function ae({
|
|
255
281
|
className: e,
|
|
256
282
|
size: t = "default",
|
|
257
|
-
children:
|
|
283
|
+
children: r,
|
|
258
284
|
"aria-label": n,
|
|
259
|
-
|
|
285
|
+
"aria-labelledby": l,
|
|
286
|
+
...d
|
|
260
287
|
}) {
|
|
261
|
-
|
|
262
|
-
|
|
288
|
+
const b = n ?? (l ? void 0 : "Select an option");
|
|
289
|
+
return /* @__PURE__ */ f(
|
|
290
|
+
i.Trigger,
|
|
263
291
|
{
|
|
264
292
|
"data-slot": "select-trigger",
|
|
265
293
|
"data-size": t,
|
|
266
|
-
"aria-label":
|
|
294
|
+
"aria-label": b,
|
|
295
|
+
"aria-labelledby": l,
|
|
267
296
|
className: g(
|
|
268
|
-
"h-9 w-full rounded-md border border-
|
|
269
|
-
"
|
|
270
|
-
"placeholder:text-muted-foreground data-[placeholder]:text-
|
|
297
|
+
"h-9 w-full rounded-md border border-input px-3 py-2 text-sm shadow-xs transition-colors",
|
|
298
|
+
"bg-background text-foreground",
|
|
299
|
+
"placeholder:text-muted-foreground data-[placeholder]:text-muted-foreground",
|
|
271
300
|
"focus-visible:outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
272
301
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
273
302
|
"aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
274
303
|
"flex items-center justify-between gap-2",
|
|
275
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg]:text-
|
|
304
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg]:text-muted-foreground",
|
|
276
305
|
e
|
|
277
306
|
),
|
|
278
|
-
|
|
279
|
-
...o,
|
|
307
|
+
...d,
|
|
280
308
|
children: [
|
|
281
|
-
|
|
282
|
-
/* @__PURE__ */
|
|
309
|
+
r,
|
|
310
|
+
/* @__PURE__ */ a(i.Icon, { asChild: !0, children: /* @__PURE__ */ a(_, { className: "size-4 opacity-50" }) })
|
|
283
311
|
]
|
|
284
312
|
}
|
|
285
313
|
);
|
|
286
314
|
}
|
|
287
|
-
function
|
|
315
|
+
function re({
|
|
288
316
|
className: e,
|
|
289
317
|
children: t,
|
|
290
|
-
position:
|
|
318
|
+
position: r = "popper",
|
|
291
319
|
header: n,
|
|
292
|
-
onViewportScroll:
|
|
293
|
-
...
|
|
320
|
+
onViewportScroll: l,
|
|
321
|
+
...d
|
|
294
322
|
}) {
|
|
295
|
-
return /* @__PURE__ */
|
|
296
|
-
|
|
323
|
+
return /* @__PURE__ */ a(i.Portal, { children: /* @__PURE__ */ f(
|
|
324
|
+
i.Content,
|
|
297
325
|
{
|
|
298
326
|
"data-slot": "select-content",
|
|
299
327
|
className: g(
|
|
300
|
-
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-
|
|
328
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
301
329
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
302
330
|
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
303
|
-
|
|
331
|
+
r === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
304
332
|
e
|
|
305
333
|
),
|
|
306
|
-
style:
|
|
307
|
-
position:
|
|
308
|
-
...
|
|
334
|
+
style: r === "popper" ? { width: "var(--radix-select-trigger-width)" } : void 0,
|
|
335
|
+
position: r,
|
|
336
|
+
...d,
|
|
309
337
|
children: [
|
|
310
338
|
n,
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
|
|
339
|
+
/* @__PURE__ */ a(le, {}),
|
|
340
|
+
/* @__PURE__ */ a(
|
|
341
|
+
i.Viewport,
|
|
314
342
|
{
|
|
315
|
-
className: g("p-1",
|
|
316
|
-
onScroll:
|
|
343
|
+
className: g("p-1", r === "popper" && "w-full"),
|
|
344
|
+
onScroll: l,
|
|
317
345
|
children: t
|
|
318
346
|
}
|
|
319
347
|
),
|
|
320
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ a(se, {})
|
|
321
349
|
]
|
|
322
350
|
}
|
|
323
351
|
) });
|
|
324
352
|
}
|
|
325
|
-
function
|
|
326
|
-
return /* @__PURE__ */
|
|
327
|
-
|
|
353
|
+
function oe({ className: e, ...t }) {
|
|
354
|
+
return /* @__PURE__ */ a(
|
|
355
|
+
i.Label,
|
|
328
356
|
{
|
|
329
357
|
"data-slot": "select-label",
|
|
330
358
|
className: g("text-muted-foreground px-2 py-1.5 text-xs", e),
|
|
@@ -332,63 +360,63 @@ function Z({ className: e, ...t }) {
|
|
|
332
360
|
}
|
|
333
361
|
);
|
|
334
362
|
}
|
|
335
|
-
function
|
|
363
|
+
function ne({
|
|
336
364
|
className: e,
|
|
337
365
|
children: t,
|
|
338
|
-
...
|
|
366
|
+
...r
|
|
339
367
|
}) {
|
|
340
|
-
return /* @__PURE__ */
|
|
341
|
-
|
|
368
|
+
return /* @__PURE__ */ f(
|
|
369
|
+
i.Item,
|
|
342
370
|
{
|
|
343
371
|
"data-slot": "select-item",
|
|
344
372
|
className: g(
|
|
345
373
|
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-3 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
346
374
|
e
|
|
347
375
|
),
|
|
348
|
-
...
|
|
376
|
+
...r,
|
|
349
377
|
children: [
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ a("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ a(i.ItemIndicator, { children: /* @__PURE__ */ a(G, { className: "size-4" }) }) }),
|
|
379
|
+
/* @__PURE__ */ a(i.ItemText, { children: t })
|
|
352
380
|
]
|
|
353
381
|
}
|
|
354
382
|
);
|
|
355
383
|
}
|
|
356
|
-
function
|
|
384
|
+
function le({
|
|
357
385
|
className: e,
|
|
358
386
|
...t
|
|
359
387
|
}) {
|
|
360
|
-
return /* @__PURE__ */
|
|
361
|
-
|
|
388
|
+
return /* @__PURE__ */ a(
|
|
389
|
+
i.ScrollUpButton,
|
|
362
390
|
{
|
|
363
391
|
"data-slot": "select-scroll-up-button",
|
|
364
392
|
className: g("flex cursor-default items-center justify-center py-1", e),
|
|
365
393
|
...t,
|
|
366
|
-
children: /* @__PURE__ */
|
|
394
|
+
children: /* @__PURE__ */ a(K, { className: "size-4" })
|
|
367
395
|
}
|
|
368
396
|
);
|
|
369
397
|
}
|
|
370
|
-
function
|
|
398
|
+
function se({
|
|
371
399
|
className: e,
|
|
372
400
|
...t
|
|
373
401
|
}) {
|
|
374
|
-
return /* @__PURE__ */
|
|
375
|
-
|
|
402
|
+
return /* @__PURE__ */ a(
|
|
403
|
+
i.ScrollDownButton,
|
|
376
404
|
{
|
|
377
405
|
"data-slot": "select-scroll-down-button",
|
|
378
406
|
className: g("flex cursor-default items-center justify-center py-1", e),
|
|
379
407
|
...t,
|
|
380
|
-
children: /* @__PURE__ */
|
|
408
|
+
children: /* @__PURE__ */ a(_, { className: "size-4" })
|
|
381
409
|
}
|
|
382
410
|
);
|
|
383
411
|
}
|
|
384
412
|
export {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
413
|
+
$ as Select,
|
|
414
|
+
re as SelectContent,
|
|
415
|
+
ee as SelectGroup,
|
|
416
|
+
ne as SelectItem,
|
|
417
|
+
oe as SelectLabel,
|
|
418
|
+
se as SelectScrollDownButton,
|
|
419
|
+
le as SelectScrollUpButton,
|
|
420
|
+
ae as SelectTrigger,
|
|
421
|
+
te as SelectValue
|
|
394
422
|
};
|