@fluid-app/fluid-cli-theme-dev 0.1.171 → 0.1.173
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/dist-cli-preview/.vite/manifest.json +583 -181
- package/dist/dist-cli-preview/account-screens.css +1 -0
- package/dist/dist-cli-preview/account-screens.js +1 -1
- package/dist/dist-cli-preview/chunks/{Breadcrumb-BQKo8hPc.js → Breadcrumb-8-7shsB6.js} +1 -1
- package/dist/dist-cli-preview/chunks/Combobox-m3vSk0_A.js +521 -0
- package/dist/dist-cli-preview/chunks/{ContactsScreen-IsIZ_lQ0.js → ContactsScreen-CBjQOWmH.js} +1523 -1854
- package/dist/dist-cli-preview/chunks/MediaScreen-1akMnH12.js +17379 -0
- package/dist/dist-cli-preview/chunks/{MemberManagementProviders-DiQkiWzc.js → MemberManagementProviders-WSjb3a8B.js} +189 -199
- package/dist/dist-cli-preview/chunks/{MessagingScreen-B8ZxAE0L.js → MessagingScreen-By-jZq6v.js} +27645 -30195
- package/dist/dist-cli-preview/chunks/{MobileActionSheet-DMeTsLlK.js → MobileActionSheet-ERpw3qUF.js} +644 -589
- package/dist/dist-cli-preview/chunks/MySiteScreen-JAGvVMx-.js +1706 -0
- package/dist/dist-cli-preview/chunks/OrdersScreen-B1HQVMZC.js +9 -0
- package/dist/dist-cli-preview/chunks/{OrdersScreen-DrZ3SwEu.js → OrdersScreen-Cb32bBjd.js} +35 -35
- package/dist/dist-cli-preview/chunks/PortalTenantClientProvider-CguU_uRG.js +15 -0
- package/dist/dist-cli-preview/chunks/{ProfileScreen-Dxspc-6p.js → ProfileScreen-CCWM6TBs.js} +454 -463
- package/dist/dist-cli-preview/chunks/Select-5fzq5MB-.js +940 -0
- package/dist/dist-cli-preview/chunks/{SubscriptionsScreen-Be0C29uw.js → SubscriptionsScreen-DLdsaVJK.js} +3 -3
- package/dist/dist-cli-preview/chunks/Textarea-xoKqLVgY.js +330 -0
- package/dist/dist-cli-preview/chunks/{account-screen-runtime-DYMunv0A.js → account-screen-runtime-CCBl8DXt.js} +866 -860
- package/dist/dist-cli-preview/chunks/ar-D6LJV1_E.js +679 -0
- package/dist/dist-cli-preview/chunks/{arrow-left-Bd7dJtIV.js → arrow-left-CTYaRdTX.js} +1 -1
- package/dist/dist-cli-preview/chunks/bg-C5Ldmily.js +679 -0
- package/dist/dist-cli-preview/chunks/bn-kfMPWNR6.js +679 -0
- package/dist/dist-cli-preview/chunks/{cli-preview-C7Db08Ij.js → cli-preview-HAt0Lt-9.js} +20 -13
- package/dist/dist-cli-preview/chunks/{client.gen-Ck6Pm2jV.js → client.gen-B7RMYGYu.js} +1 -1
- package/dist/dist-cli-preview/chunks/copy-DHN1DxE_.js +14 -0
- package/dist/dist-cli-preview/chunks/{countries-api-adapter-InKUzF1q.js → countries-api-adapter-B4TefdRP.js} +2 -2
- package/dist/dist-cli-preview/chunks/{create-card-entry-container-C9z7JILL.js → create-card-entry-container-5NqOQ4D_.js} +3612 -3932
- package/dist/dist-cli-preview/chunks/cs-DqEgtV8D.js +679 -0
- package/dist/dist-cli-preview/chunks/da-BbuvL7Gx.js +679 -0
- package/dist/dist-cli-preview/chunks/de-BfJ7rQig.js +679 -0
- package/dist/dist-cli-preview/chunks/el-BO0rLq6D.js +679 -0
- package/dist/dist-cli-preview/chunks/es-BEVtEUXk.js +679 -0
- package/dist/dist-cli-preview/chunks/eye-qMoMW7-Z.js +20 -0
- package/dist/dist-cli-preview/chunks/fi-DjISV3UN.js +679 -0
- package/dist/dist-cli-preview/chunks/fr-1fFd-aKy.js +679 -0
- package/dist/dist-cli-preview/chunks/he-CaT9bwVp.js +679 -0
- package/dist/dist-cli-preview/chunks/{hey-api-client-DGRBsZ7Y.js → hey-api-client-JMNyZwcF.js} +79 -39
- package/dist/dist-cli-preview/chunks/hi-DkzEm57l.js +679 -0
- package/dist/dist-cli-preview/chunks/hr-DqM5N_bj.js +679 -0
- package/dist/dist-cli-preview/chunks/hu-DiLqjo5c.js +679 -0
- package/dist/dist-cli-preview/chunks/id-DA1KmwgX.js +679 -0
- package/dist/dist-cli-preview/chunks/index-BS4PnEcu.js +353 -0
- package/dist/dist-cli-preview/chunks/index-BhMjUmAr.js +2572 -0
- package/dist/dist-cli-preview/chunks/{screen-route-slug-utils-BDjSpDoe.js → index-Dor8vM2o.js} +2417 -3035
- package/dist/dist-cli-preview/chunks/it-CTEVWCRz.js +679 -0
- package/dist/dist-cli-preview/chunks/ja-fxqg1hhg.js +679 -0
- package/dist/dist-cli-preview/chunks/ko-Btp1_5YS.js +679 -0
- package/dist/dist-cli-preview/chunks/lock-DQTMeEw0.js +14 -0
- package/dist/dist-cli-preview/chunks/{log-out-CSPZjXTK.js → log-out-DUdRJX4l.js} +1 -1
- package/dist/dist-cli-preview/chunks/{map-pin-B2ScoijR.js → map-pin-DyIkpqP0.js} +1 -1
- package/dist/dist-cli-preview/chunks/media-vkLeBb90.js +4 -0
- package/dist/dist-cli-preview/chunks/member-permissions-ndhNmlOk.js +19 -0
- package/dist/dist-cli-preview/chunks/{mount-account-screen-5thBUz3X.js → mount-account-screen--gdc5WO_.js} +1869 -1884
- package/dist/dist-cli-preview/chunks/ms-DqRbmHx8.js +679 -0
- package/dist/dist-cli-preview/chunks/navigate-account-screen-AVNopuIP.js +38 -0
- package/dist/dist-cli-preview/chunks/nl-CkPNddxO.js +679 -0
- package/dist/dist-cli-preview/chunks/no-ftcy0RcQ.js +679 -0
- package/dist/dist-cli-preview/chunks/pl-wyJLqfip.js +679 -0
- package/dist/dist-cli-preview/chunks/{plus-CocoE5gC.js → plus-DZjrp536.js} +1 -1
- package/dist/dist-cli-preview/chunks/pt-7uHLacuI.js +679 -0
- package/dist/dist-cli-preview/chunks/ro-Dh12ghww.js +679 -0
- package/dist/dist-cli-preview/chunks/ru-DFM7xWFz.js +679 -0
- package/dist/dist-cli-preview/chunks/{schemas-D94nZk5x.js → schemas-BTblatUV.js} +1107 -1062
- package/dist/dist-cli-preview/chunks/screen-route-slug-utils-DozJp-uc.js +620 -0
- package/dist/dist-cli-preview/chunks/{sheet-haptics-context-iOjKcNDj.js → sheet-haptics-context-CYrEaGtf.js} +3 -3
- package/dist/dist-cli-preview/chunks/sidebar-9qopXeR1.js +598 -0
- package/dist/dist-cli-preview/chunks/sk-CsuNYa1k.js +679 -0
- package/dist/dist-cli-preview/chunks/sortable.esm-Dlen88Fc.js +3283 -0
- package/dist/dist-cli-preview/chunks/{store-api-context-B96Ip2FB.js → store-api-context-B9pW_xao.js} +1 -1
- package/dist/dist-cli-preview/chunks/sv-DVrPaJbh.js +679 -0
- package/dist/dist-cli-preview/chunks/th-BEkMpcVW.js +679 -0
- package/dist/dist-cli-preview/chunks/tl-CqwwplQC.js +679 -0
- package/dist/dist-cli-preview/chunks/tr-XEp4ekrM.js +679 -0
- package/dist/dist-cli-preview/chunks/{trash-2-wVweQZMw.js → trash-2-ClRyi9iY.js} +12 -12
- package/dist/dist-cli-preview/chunks/uk-DWdZFWBl.js +679 -0
- package/dist/dist-cli-preview/chunks/use-mobile-srOt50VV.js +254 -0
- package/dist/dist-cli-preview/chunks/{use-optional-store-lZUz976C.js → use-optional-store-BgrOjfZJ.js} +2 -2
- package/dist/dist-cli-preview/chunks/{use-store-DVmgsDXy.js → use-store-CUSQx1E-.js} +25 -36
- package/dist/dist-cli-preview/chunks/{useInfiniteQuery-Dtzov9uh.js → useInfiniteQuery-DGc8fotv.js} +1 -1
- package/dist/dist-cli-preview/chunks/user-Ca2sKJ-h.js +14 -0
- package/dist/dist-cli-preview/chunks/users-Dh7zTrKY.js +16 -0
- package/dist/dist-cli-preview/chunks/vi-H__PaPsC.js +679 -0
- package/dist/dist-cli-preview/chunks/zh_CN-B62j_w_1.js +679 -0
- package/dist/dist-cli-preview/chunks/zh_TW-CYUIGBvP.js +679 -0
- package/package.json +1 -1
- package/dist/dist-cli-preview/chunks/Combobox-cf11L_T-.js +0 -1455
- package/dist/dist-cli-preview/chunks/MySiteScreen-Dtw1rsF9.js +0 -4950
- package/dist/dist-cli-preview/chunks/OrdersScreen-DkltVCtr.js +0 -9
- package/dist/dist-cli-preview/chunks/sidebar-Ckzom4Xc.js +0 -848
- package/dist/dist-cli-preview/chunks/user-B81IrSgp.js +0 -31
- package/dist/dist-cli-preview/chunks/users-BXTjoCUz.js +0 -27
|
@@ -0,0 +1,940 @@
|
|
|
1
|
+
import { c as ot, l as o, ak as nt, aW as Te, j as n, aa as rt, ba as be, bq as st, aj as L, ab as j, am as P, ad as G, bb as at, a7 as Ne, aX as lt, ac as ct, br as it, bs as dt, bt as ut, bu as pt, bv as ft, bc as mt, an as Pe, M as te, be as ht } from "./account-screen-runtime-CCBl8DXt.js";
|
|
2
|
+
import { k as _e, R as vt, A as gt, V as xt, l as St, n as wt, C as Ee } from "./MobileActionSheet-ERpw3qUF.js";
|
|
3
|
+
import { C as Ct } from "./schemas-BTblatUV.js";
|
|
4
|
+
/**
|
|
5
|
+
* @license lucide-react v0.575.0 - ISC
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the ISC license.
|
|
8
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
const yt = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], bt = ot("chevron-up", yt);
|
|
11
|
+
var It = [" ", "Enter", "ArrowUp", "ArrowDown"], Tt = [" ", "Enter"], J = "Select", [ie, de, Pt] = st(J), [oe] = rt(J, [
|
|
12
|
+
Pt,
|
|
13
|
+
_e
|
|
14
|
+
]), ue = _e(), [Nt, $] = oe(J), [_t, Et] = oe(J), Re = (t) => {
|
|
15
|
+
const {
|
|
16
|
+
__scopeSelect: r,
|
|
17
|
+
children: e,
|
|
18
|
+
open: c,
|
|
19
|
+
defaultOpen: a,
|
|
20
|
+
onOpenChange: u,
|
|
21
|
+
value: s,
|
|
22
|
+
defaultValue: l,
|
|
23
|
+
onValueChange: i,
|
|
24
|
+
dir: f,
|
|
25
|
+
name: g,
|
|
26
|
+
autoComplete: w,
|
|
27
|
+
disabled: N,
|
|
28
|
+
required: I,
|
|
29
|
+
form: y
|
|
30
|
+
} = t, d = ue(r), [h, x] = o.useState(null), [m, v] = o.useState(null), [F, M] = o.useState(!1), ne = nt(f), [_, O] = Te({
|
|
31
|
+
prop: c,
|
|
32
|
+
defaultProp: a ?? !1,
|
|
33
|
+
onChange: u,
|
|
34
|
+
caller: J
|
|
35
|
+
}), [W, q] = Te({
|
|
36
|
+
prop: s,
|
|
37
|
+
defaultProp: l,
|
|
38
|
+
onChange: i,
|
|
39
|
+
caller: J
|
|
40
|
+
}), k = o.useRef(null), B = h ? y || !!h.closest("form") : !0, [z, V] = o.useState(/* @__PURE__ */ new Set()), H = Array.from(z).map((E) => E.props.value).join(";");
|
|
41
|
+
return /* @__PURE__ */ n.jsx(vt, { ...d, children: /* @__PURE__ */ n.jsxs(
|
|
42
|
+
Nt,
|
|
43
|
+
{
|
|
44
|
+
required: I,
|
|
45
|
+
scope: r,
|
|
46
|
+
trigger: h,
|
|
47
|
+
onTriggerChange: x,
|
|
48
|
+
valueNode: m,
|
|
49
|
+
onValueNodeChange: v,
|
|
50
|
+
valueNodeHasChildren: F,
|
|
51
|
+
onValueNodeHasChildrenChange: M,
|
|
52
|
+
contentId: be(),
|
|
53
|
+
value: W,
|
|
54
|
+
onValueChange: q,
|
|
55
|
+
open: _,
|
|
56
|
+
onOpenChange: O,
|
|
57
|
+
dir: ne,
|
|
58
|
+
triggerPointerDownPosRef: k,
|
|
59
|
+
disabled: N,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ n.jsx(ie.Provider, { scope: r, children: /* @__PURE__ */ n.jsx(
|
|
62
|
+
_t,
|
|
63
|
+
{
|
|
64
|
+
scope: t.__scopeSelect,
|
|
65
|
+
onNativeOptionAdd: o.useCallback((E) => {
|
|
66
|
+
V((D) => new Set(D).add(E));
|
|
67
|
+
}, []),
|
|
68
|
+
onNativeOptionRemove: o.useCallback((E) => {
|
|
69
|
+
V((D) => {
|
|
70
|
+
const U = new Set(D);
|
|
71
|
+
return U.delete(E), U;
|
|
72
|
+
});
|
|
73
|
+
}, []),
|
|
74
|
+
children: e
|
|
75
|
+
}
|
|
76
|
+
) }),
|
|
77
|
+
B ? /* @__PURE__ */ n.jsxs(
|
|
78
|
+
Je,
|
|
79
|
+
{
|
|
80
|
+
"aria-hidden": !0,
|
|
81
|
+
required: I,
|
|
82
|
+
tabIndex: -1,
|
|
83
|
+
name: g,
|
|
84
|
+
autoComplete: w,
|
|
85
|
+
value: W,
|
|
86
|
+
onChange: (E) => q(E.target.value),
|
|
87
|
+
disabled: N,
|
|
88
|
+
form: y,
|
|
89
|
+
children: [
|
|
90
|
+
W === void 0 ? /* @__PURE__ */ n.jsx("option", { value: "" }) : null,
|
|
91
|
+
Array.from(z)
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
H
|
|
95
|
+
) : null
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
) });
|
|
99
|
+
};
|
|
100
|
+
Re.displayName = J;
|
|
101
|
+
var je = "SelectTrigger", Me = o.forwardRef(
|
|
102
|
+
(t, r) => {
|
|
103
|
+
const { __scopeSelect: e, disabled: c = !1, ...a } = t, u = ue(e), s = $(je, e), l = s.disabled || c, i = L(r, s.onTriggerChange), f = de(e), g = o.useRef("touch"), [w, N, I] = et((d) => {
|
|
104
|
+
const h = f().filter((v) => !v.disabled), x = h.find((v) => v.value === s.value), m = tt(h, d, x);
|
|
105
|
+
m !== void 0 && s.onValueChange(m.value);
|
|
106
|
+
}), y = (d) => {
|
|
107
|
+
l || (s.onOpenChange(!0), I()), d && (s.triggerPointerDownPosRef.current = {
|
|
108
|
+
x: Math.round(d.pageX),
|
|
109
|
+
y: Math.round(d.pageY)
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
return /* @__PURE__ */ n.jsx(gt, { asChild: !0, ...u, children: /* @__PURE__ */ n.jsx(
|
|
113
|
+
j.button,
|
|
114
|
+
{
|
|
115
|
+
type: "button",
|
|
116
|
+
role: "combobox",
|
|
117
|
+
"aria-controls": s.contentId,
|
|
118
|
+
"aria-expanded": s.open,
|
|
119
|
+
"aria-required": s.required,
|
|
120
|
+
"aria-autocomplete": "none",
|
|
121
|
+
dir: s.dir,
|
|
122
|
+
"data-state": s.open ? "open" : "closed",
|
|
123
|
+
disabled: l,
|
|
124
|
+
"data-disabled": l ? "" : void 0,
|
|
125
|
+
"data-placeholder": Qe(s.value) ? "" : void 0,
|
|
126
|
+
...a,
|
|
127
|
+
ref: i,
|
|
128
|
+
onClick: P(a.onClick, (d) => {
|
|
129
|
+
d.currentTarget.focus(), g.current !== "mouse" && y(d);
|
|
130
|
+
}),
|
|
131
|
+
onPointerDown: P(a.onPointerDown, (d) => {
|
|
132
|
+
g.current = d.pointerType;
|
|
133
|
+
const h = d.target;
|
|
134
|
+
h.hasPointerCapture(d.pointerId) && h.releasePointerCapture(d.pointerId), d.button === 0 && d.ctrlKey === !1 && d.pointerType === "mouse" && (y(d), d.preventDefault());
|
|
135
|
+
}),
|
|
136
|
+
onKeyDown: P(a.onKeyDown, (d) => {
|
|
137
|
+
const h = w.current !== "";
|
|
138
|
+
!(d.ctrlKey || d.altKey || d.metaKey) && d.key.length === 1 && N(d.key), !(h && d.key === " ") && It.includes(d.key) && (y(), d.preventDefault());
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
) });
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
Me.displayName = je;
|
|
145
|
+
var Ae = "SelectValue", Oe = o.forwardRef(
|
|
146
|
+
(t, r) => {
|
|
147
|
+
const { __scopeSelect: e, className: c, style: a, children: u, placeholder: s = "", ...l } = t, i = $(Ae, e), { onValueNodeHasChildrenChange: f } = i, g = u !== void 0, w = L(r, i.onValueNodeChange);
|
|
148
|
+
return G(() => {
|
|
149
|
+
f(g);
|
|
150
|
+
}, [f, g]), /* @__PURE__ */ n.jsx(
|
|
151
|
+
j.span,
|
|
152
|
+
{
|
|
153
|
+
...l,
|
|
154
|
+
ref: w,
|
|
155
|
+
style: { pointerEvents: "none" },
|
|
156
|
+
children: Qe(i.value) ? /* @__PURE__ */ n.jsx(n.Fragment, { children: s }) : u
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
Oe.displayName = Ae;
|
|
162
|
+
var Rt = "SelectIcon", De = o.forwardRef(
|
|
163
|
+
(t, r) => {
|
|
164
|
+
const { __scopeSelect: e, children: c, ...a } = t;
|
|
165
|
+
return /* @__PURE__ */ n.jsx(j.span, { "aria-hidden": !0, ...a, ref: r, children: c || "▼" });
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
De.displayName = Rt;
|
|
169
|
+
var jt = "SelectPortal", Le = (t) => /* @__PURE__ */ n.jsx(at, { asChild: !0, ...t });
|
|
170
|
+
Le.displayName = jt;
|
|
171
|
+
var Q = "SelectContent", ke = o.forwardRef(
|
|
172
|
+
(t, r) => {
|
|
173
|
+
const e = $(Q, t.__scopeSelect), [c, a] = o.useState();
|
|
174
|
+
if (G(() => {
|
|
175
|
+
a(new DocumentFragment());
|
|
176
|
+
}, []), !e.open) {
|
|
177
|
+
const u = c;
|
|
178
|
+
return u ? Ne.createPortal(
|
|
179
|
+
/* @__PURE__ */ n.jsx(Be, { scope: t.__scopeSelect, children: /* @__PURE__ */ n.jsx(ie.Slot, { scope: t.__scopeSelect, children: /* @__PURE__ */ n.jsx("div", { children: t.children }) }) }),
|
|
180
|
+
u
|
|
181
|
+
) : null;
|
|
182
|
+
}
|
|
183
|
+
return /* @__PURE__ */ n.jsx(Ve, { ...t, ref: r });
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
ke.displayName = Q;
|
|
187
|
+
var A = 10, [Be, Y] = oe(Q), Mt = "SelectContentImpl", At = pt("SelectContent.RemoveScroll"), Ve = o.forwardRef(
|
|
188
|
+
(t, r) => {
|
|
189
|
+
const {
|
|
190
|
+
__scopeSelect: e,
|
|
191
|
+
position: c = "item-aligned",
|
|
192
|
+
onCloseAutoFocus: a,
|
|
193
|
+
onEscapeKeyDown: u,
|
|
194
|
+
onPointerDownOutside: s,
|
|
195
|
+
//
|
|
196
|
+
// PopperContent props
|
|
197
|
+
side: l,
|
|
198
|
+
sideOffset: i,
|
|
199
|
+
align: f,
|
|
200
|
+
alignOffset: g,
|
|
201
|
+
arrowPadding: w,
|
|
202
|
+
collisionBoundary: N,
|
|
203
|
+
collisionPadding: I,
|
|
204
|
+
sticky: y,
|
|
205
|
+
hideWhenDetached: d,
|
|
206
|
+
avoidCollisions: h,
|
|
207
|
+
//
|
|
208
|
+
...x
|
|
209
|
+
} = t, m = $(Q, e), [v, F] = o.useState(null), [M, ne] = o.useState(null), _ = L(r, (p) => F(p)), [O, W] = o.useState(null), [q, k] = o.useState(
|
|
210
|
+
null
|
|
211
|
+
), B = de(e), [z, V] = o.useState(!1), H = o.useRef(!1);
|
|
212
|
+
o.useEffect(() => {
|
|
213
|
+
if (v) return it(v);
|
|
214
|
+
}, [v]), dt();
|
|
215
|
+
const E = o.useCallback(
|
|
216
|
+
(p) => {
|
|
217
|
+
const [b, ...R] = B().map((T) => T.ref.current), [S] = R.slice(-1), C = document.activeElement;
|
|
218
|
+
for (const T of p)
|
|
219
|
+
if (T === C || (T?.scrollIntoView({ block: "nearest" }), T === b && M && (M.scrollTop = 0), T === S && M && (M.scrollTop = M.scrollHeight), T?.focus(), document.activeElement !== C)) return;
|
|
220
|
+
},
|
|
221
|
+
[B, M]
|
|
222
|
+
), D = o.useCallback(
|
|
223
|
+
() => E([O, v]),
|
|
224
|
+
[E, O, v]
|
|
225
|
+
);
|
|
226
|
+
o.useEffect(() => {
|
|
227
|
+
z && D();
|
|
228
|
+
}, [z, D]);
|
|
229
|
+
const { onOpenChange: U, triggerPointerDownPosRef: K } = m;
|
|
230
|
+
o.useEffect(() => {
|
|
231
|
+
if (v) {
|
|
232
|
+
let p = { x: 0, y: 0 };
|
|
233
|
+
const b = (S) => {
|
|
234
|
+
p = {
|
|
235
|
+
x: Math.abs(Math.round(S.pageX) - (K.current?.x ?? 0)),
|
|
236
|
+
y: Math.abs(Math.round(S.pageY) - (K.current?.y ?? 0))
|
|
237
|
+
};
|
|
238
|
+
}, R = (S) => {
|
|
239
|
+
p.x <= 10 && p.y <= 10 ? S.preventDefault() : v.contains(S.target) || U(!1), document.removeEventListener("pointermove", b), K.current = null;
|
|
240
|
+
};
|
|
241
|
+
return K.current !== null && (document.addEventListener("pointermove", b), document.addEventListener("pointerup", R, { capture: !0, once: !0 })), () => {
|
|
242
|
+
document.removeEventListener("pointermove", b), document.removeEventListener("pointerup", R, { capture: !0 });
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
}, [v, U, K]), o.useEffect(() => {
|
|
246
|
+
const p = () => U(!1);
|
|
247
|
+
return window.addEventListener("blur", p), window.addEventListener("resize", p), () => {
|
|
248
|
+
window.removeEventListener("blur", p), window.removeEventListener("resize", p);
|
|
249
|
+
};
|
|
250
|
+
}, [U]);
|
|
251
|
+
const [pe, ae] = et((p) => {
|
|
252
|
+
const b = B().filter((C) => !C.disabled), R = b.find((C) => C.ref.current === document.activeElement), S = tt(b, p, R);
|
|
253
|
+
S && setTimeout(() => S.ref.current.focus());
|
|
254
|
+
}), fe = o.useCallback(
|
|
255
|
+
(p, b, R) => {
|
|
256
|
+
const S = !H.current && !R;
|
|
257
|
+
(m.value !== void 0 && m.value === b || S) && (W(p), S && (H.current = !0));
|
|
258
|
+
},
|
|
259
|
+
[m.value]
|
|
260
|
+
), me = o.useCallback(() => v?.focus(), [v]), ee = o.useCallback(
|
|
261
|
+
(p, b, R) => {
|
|
262
|
+
const S = !H.current && !R;
|
|
263
|
+
(m.value !== void 0 && m.value === b || S) && k(p);
|
|
264
|
+
},
|
|
265
|
+
[m.value]
|
|
266
|
+
), le = c === "popper" ? xe : He, re = le === xe ? {
|
|
267
|
+
side: l,
|
|
268
|
+
sideOffset: i,
|
|
269
|
+
align: f,
|
|
270
|
+
alignOffset: g,
|
|
271
|
+
arrowPadding: w,
|
|
272
|
+
collisionBoundary: N,
|
|
273
|
+
collisionPadding: I,
|
|
274
|
+
sticky: y,
|
|
275
|
+
hideWhenDetached: d,
|
|
276
|
+
avoidCollisions: h
|
|
277
|
+
} : {};
|
|
278
|
+
return /* @__PURE__ */ n.jsx(
|
|
279
|
+
Be,
|
|
280
|
+
{
|
|
281
|
+
scope: e,
|
|
282
|
+
content: v,
|
|
283
|
+
viewport: M,
|
|
284
|
+
onViewportChange: ne,
|
|
285
|
+
itemRefCallback: fe,
|
|
286
|
+
selectedItem: O,
|
|
287
|
+
onItemLeave: me,
|
|
288
|
+
itemTextRefCallback: ee,
|
|
289
|
+
focusSelectedItem: D,
|
|
290
|
+
selectedItemText: q,
|
|
291
|
+
position: c,
|
|
292
|
+
isPositioned: z,
|
|
293
|
+
searchRef: pe,
|
|
294
|
+
children: /* @__PURE__ */ n.jsx(ut, { as: At, allowPinchZoom: !0, children: /* @__PURE__ */ n.jsx(
|
|
295
|
+
ft,
|
|
296
|
+
{
|
|
297
|
+
asChild: !0,
|
|
298
|
+
trapped: m.open,
|
|
299
|
+
onMountAutoFocus: (p) => {
|
|
300
|
+
p.preventDefault();
|
|
301
|
+
},
|
|
302
|
+
onUnmountAutoFocus: P(a, (p) => {
|
|
303
|
+
m.trigger?.focus({ preventScroll: !0 }), p.preventDefault();
|
|
304
|
+
}),
|
|
305
|
+
children: /* @__PURE__ */ n.jsx(
|
|
306
|
+
mt,
|
|
307
|
+
{
|
|
308
|
+
asChild: !0,
|
|
309
|
+
disableOutsidePointerEvents: !0,
|
|
310
|
+
onEscapeKeyDown: u,
|
|
311
|
+
onPointerDownOutside: s,
|
|
312
|
+
onFocusOutside: (p) => p.preventDefault(),
|
|
313
|
+
onDismiss: () => m.onOpenChange(!1),
|
|
314
|
+
children: /* @__PURE__ */ n.jsx(
|
|
315
|
+
le,
|
|
316
|
+
{
|
|
317
|
+
role: "listbox",
|
|
318
|
+
id: m.contentId,
|
|
319
|
+
"data-state": m.open ? "open" : "closed",
|
|
320
|
+
dir: m.dir,
|
|
321
|
+
onContextMenu: (p) => p.preventDefault(),
|
|
322
|
+
...x,
|
|
323
|
+
...re,
|
|
324
|
+
onPlaced: () => V(!0),
|
|
325
|
+
ref: _,
|
|
326
|
+
style: {
|
|
327
|
+
// flex layout so we can place the scroll buttons properly
|
|
328
|
+
display: "flex",
|
|
329
|
+
flexDirection: "column",
|
|
330
|
+
// reset the outline by default as the content MAY get focused
|
|
331
|
+
outline: "none",
|
|
332
|
+
...x.style
|
|
333
|
+
},
|
|
334
|
+
onKeyDown: P(x.onKeyDown, (p) => {
|
|
335
|
+
const b = p.ctrlKey || p.altKey || p.metaKey;
|
|
336
|
+
if (p.key === "Tab" && p.preventDefault(), !b && p.key.length === 1 && ae(p.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(p.key)) {
|
|
337
|
+
let S = B().filter((C) => !C.disabled).map((C) => C.ref.current);
|
|
338
|
+
if (["ArrowUp", "End"].includes(p.key) && (S = S.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(p.key)) {
|
|
339
|
+
const C = p.target, T = S.indexOf(C);
|
|
340
|
+
S = S.slice(T + 1);
|
|
341
|
+
}
|
|
342
|
+
setTimeout(() => E(S)), p.preventDefault();
|
|
343
|
+
}
|
|
344
|
+
})
|
|
345
|
+
}
|
|
346
|
+
)
|
|
347
|
+
}
|
|
348
|
+
)
|
|
349
|
+
}
|
|
350
|
+
) })
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
);
|
|
355
|
+
Ve.displayName = Mt;
|
|
356
|
+
var Ot = "SelectItemAlignedPosition", He = o.forwardRef((t, r) => {
|
|
357
|
+
const { __scopeSelect: e, onPlaced: c, ...a } = t, u = $(Q, e), s = Y(Q, e), [l, i] = o.useState(null), [f, g] = o.useState(null), w = L(r, (_) => g(_)), N = de(e), I = o.useRef(!1), y = o.useRef(!0), { viewport: d, selectedItem: h, selectedItemText: x, focusSelectedItem: m } = s, v = o.useCallback(() => {
|
|
358
|
+
if (u.trigger && u.valueNode && l && f && d && h && x) {
|
|
359
|
+
const _ = u.trigger.getBoundingClientRect(), O = f.getBoundingClientRect(), W = u.valueNode.getBoundingClientRect(), q = x.getBoundingClientRect();
|
|
360
|
+
if (u.dir !== "rtl") {
|
|
361
|
+
const C = q.left - O.left, T = W.left - C, X = _.left - T, Z = _.width + X, he = Math.max(Z, O.width), ve = window.innerWidth - A, ge = Pe(T, [
|
|
362
|
+
A,
|
|
363
|
+
// Prevents the content from going off the starting edge of the
|
|
364
|
+
// viewport. It may still go off the ending edge, but this can be
|
|
365
|
+
// controlled by the user since they may want to manage overflow in a
|
|
366
|
+
// specific way.
|
|
367
|
+
// https://github.com/radix-ui/primitives/issues/2049
|
|
368
|
+
Math.max(A, ve - he)
|
|
369
|
+
]);
|
|
370
|
+
l.style.minWidth = Z + "px", l.style.left = ge + "px";
|
|
371
|
+
} else {
|
|
372
|
+
const C = O.right - q.right, T = window.innerWidth - W.right - C, X = window.innerWidth - _.right - T, Z = _.width + X, he = Math.max(Z, O.width), ve = window.innerWidth - A, ge = Pe(T, [
|
|
373
|
+
A,
|
|
374
|
+
Math.max(A, ve - he)
|
|
375
|
+
]);
|
|
376
|
+
l.style.minWidth = Z + "px", l.style.right = ge + "px";
|
|
377
|
+
}
|
|
378
|
+
const k = N(), B = window.innerHeight - A * 2, z = d.scrollHeight, V = window.getComputedStyle(f), H = parseInt(V.borderTopWidth, 10), E = parseInt(V.paddingTop, 10), D = parseInt(V.borderBottomWidth, 10), U = parseInt(V.paddingBottom, 10), K = H + E + z + U + D, pe = Math.min(h.offsetHeight * 5, K), ae = window.getComputedStyle(d), fe = parseInt(ae.paddingTop, 10), me = parseInt(ae.paddingBottom, 10), ee = _.top + _.height / 2 - A, le = B - ee, re = h.offsetHeight / 2, p = h.offsetTop + re, b = H + E + p, R = K - b;
|
|
379
|
+
if (b <= ee) {
|
|
380
|
+
const C = k.length > 0 && h === k[k.length - 1].ref.current;
|
|
381
|
+
l.style.bottom = "0px";
|
|
382
|
+
const T = f.clientHeight - d.offsetTop - d.offsetHeight, X = Math.max(
|
|
383
|
+
le,
|
|
384
|
+
re + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
385
|
+
(C ? me : 0) + T + D
|
|
386
|
+
), Z = b + X;
|
|
387
|
+
l.style.height = Z + "px";
|
|
388
|
+
} else {
|
|
389
|
+
const C = k.length > 0 && h === k[0].ref.current;
|
|
390
|
+
l.style.top = "0px";
|
|
391
|
+
const X = Math.max(
|
|
392
|
+
ee,
|
|
393
|
+
H + d.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
394
|
+
(C ? fe : 0) + re
|
|
395
|
+
) + R;
|
|
396
|
+
l.style.height = X + "px", d.scrollTop = b - ee + d.offsetTop;
|
|
397
|
+
}
|
|
398
|
+
l.style.margin = `${A}px 0`, l.style.minHeight = pe + "px", l.style.maxHeight = B + "px", c?.(), requestAnimationFrame(() => I.current = !0);
|
|
399
|
+
}
|
|
400
|
+
}, [
|
|
401
|
+
N,
|
|
402
|
+
u.trigger,
|
|
403
|
+
u.valueNode,
|
|
404
|
+
l,
|
|
405
|
+
f,
|
|
406
|
+
d,
|
|
407
|
+
h,
|
|
408
|
+
x,
|
|
409
|
+
u.dir,
|
|
410
|
+
c
|
|
411
|
+
]);
|
|
412
|
+
G(() => v(), [v]);
|
|
413
|
+
const [F, M] = o.useState();
|
|
414
|
+
G(() => {
|
|
415
|
+
f && M(window.getComputedStyle(f).zIndex);
|
|
416
|
+
}, [f]);
|
|
417
|
+
const ne = o.useCallback(
|
|
418
|
+
(_) => {
|
|
419
|
+
_ && y.current === !0 && (v(), m?.(), y.current = !1);
|
|
420
|
+
},
|
|
421
|
+
[v, m]
|
|
422
|
+
);
|
|
423
|
+
return /* @__PURE__ */ n.jsx(
|
|
424
|
+
Lt,
|
|
425
|
+
{
|
|
426
|
+
scope: e,
|
|
427
|
+
contentWrapper: l,
|
|
428
|
+
shouldExpandOnScrollRef: I,
|
|
429
|
+
onScrollButtonChange: ne,
|
|
430
|
+
children: /* @__PURE__ */ n.jsx(
|
|
431
|
+
"div",
|
|
432
|
+
{
|
|
433
|
+
ref: i,
|
|
434
|
+
style: {
|
|
435
|
+
display: "flex",
|
|
436
|
+
flexDirection: "column",
|
|
437
|
+
position: "fixed",
|
|
438
|
+
zIndex: F
|
|
439
|
+
},
|
|
440
|
+
children: /* @__PURE__ */ n.jsx(
|
|
441
|
+
j.div,
|
|
442
|
+
{
|
|
443
|
+
...a,
|
|
444
|
+
ref: w,
|
|
445
|
+
style: {
|
|
446
|
+
// When we get the height of the content, it includes borders. If we were to set
|
|
447
|
+
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
448
|
+
boxSizing: "border-box",
|
|
449
|
+
// We need to ensure the content doesn't get taller than the wrapper
|
|
450
|
+
maxHeight: "100%",
|
|
451
|
+
...a.style
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
)
|
|
455
|
+
}
|
|
456
|
+
)
|
|
457
|
+
}
|
|
458
|
+
);
|
|
459
|
+
});
|
|
460
|
+
He.displayName = Ot;
|
|
461
|
+
var Dt = "SelectPopperPosition", xe = o.forwardRef((t, r) => {
|
|
462
|
+
const {
|
|
463
|
+
__scopeSelect: e,
|
|
464
|
+
align: c = "start",
|
|
465
|
+
collisionPadding: a = A,
|
|
466
|
+
...u
|
|
467
|
+
} = t, s = ue(e);
|
|
468
|
+
return /* @__PURE__ */ n.jsx(
|
|
469
|
+
St,
|
|
470
|
+
{
|
|
471
|
+
...s,
|
|
472
|
+
...u,
|
|
473
|
+
ref: r,
|
|
474
|
+
align: c,
|
|
475
|
+
collisionPadding: a,
|
|
476
|
+
style: {
|
|
477
|
+
// Ensure border-box for floating-ui calculations
|
|
478
|
+
boxSizing: "border-box",
|
|
479
|
+
...u.style,
|
|
480
|
+
"--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
481
|
+
"--radix-select-content-available-width": "var(--radix-popper-available-width)",
|
|
482
|
+
"--radix-select-content-available-height": "var(--radix-popper-available-height)",
|
|
483
|
+
"--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
|
|
484
|
+
"--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
);
|
|
488
|
+
});
|
|
489
|
+
xe.displayName = Dt;
|
|
490
|
+
var [Lt, Ie] = oe(Q, {}), Se = "SelectViewport", Ue = o.forwardRef(
|
|
491
|
+
(t, r) => {
|
|
492
|
+
const { __scopeSelect: e, nonce: c, ...a } = t, u = Y(Se, e), s = Ie(Se, e), l = L(r, u.onViewportChange), i = o.useRef(0);
|
|
493
|
+
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
494
|
+
/* @__PURE__ */ n.jsx(
|
|
495
|
+
"style",
|
|
496
|
+
{
|
|
497
|
+
dangerouslySetInnerHTML: {
|
|
498
|
+
__html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
|
|
499
|
+
},
|
|
500
|
+
nonce: c
|
|
501
|
+
}
|
|
502
|
+
),
|
|
503
|
+
/* @__PURE__ */ n.jsx(ie.Slot, { scope: e, children: /* @__PURE__ */ n.jsx(
|
|
504
|
+
j.div,
|
|
505
|
+
{
|
|
506
|
+
"data-radix-select-viewport": "",
|
|
507
|
+
role: "presentation",
|
|
508
|
+
...a,
|
|
509
|
+
ref: l,
|
|
510
|
+
style: {
|
|
511
|
+
// we use position: 'relative' here on the `viewport` so that when we call
|
|
512
|
+
// `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
|
|
513
|
+
// (independent of the scrollUpButton).
|
|
514
|
+
position: "relative",
|
|
515
|
+
flex: 1,
|
|
516
|
+
// Viewport should only be scrollable in the vertical direction.
|
|
517
|
+
// This won't work in vertical writing modes, so we'll need to
|
|
518
|
+
// revisit this if/when that is supported
|
|
519
|
+
// https://developer.chrome.com/blog/vertical-form-controls
|
|
520
|
+
overflow: "hidden auto",
|
|
521
|
+
...a.style
|
|
522
|
+
},
|
|
523
|
+
onScroll: P(a.onScroll, (f) => {
|
|
524
|
+
const g = f.currentTarget, { contentWrapper: w, shouldExpandOnScrollRef: N } = s;
|
|
525
|
+
if (N?.current && w) {
|
|
526
|
+
const I = Math.abs(i.current - g.scrollTop);
|
|
527
|
+
if (I > 0) {
|
|
528
|
+
const y = window.innerHeight - A * 2, d = parseFloat(w.style.minHeight), h = parseFloat(w.style.height), x = Math.max(d, h);
|
|
529
|
+
if (x < y) {
|
|
530
|
+
const m = x + I, v = Math.min(y, m), F = m - v;
|
|
531
|
+
w.style.height = v + "px", w.style.bottom === "0px" && (g.scrollTop = F > 0 ? F : 0, w.style.justifyContent = "flex-end");
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
i.current = g.scrollTop;
|
|
536
|
+
})
|
|
537
|
+
}
|
|
538
|
+
) })
|
|
539
|
+
] });
|
|
540
|
+
}
|
|
541
|
+
);
|
|
542
|
+
Ue.displayName = Se;
|
|
543
|
+
var Fe = "SelectGroup", [kt, Bt] = oe(Fe), Vt = o.forwardRef(
|
|
544
|
+
(t, r) => {
|
|
545
|
+
const { __scopeSelect: e, ...c } = t, a = be();
|
|
546
|
+
return /* @__PURE__ */ n.jsx(kt, { scope: e, id: a, children: /* @__PURE__ */ n.jsx(j.div, { role: "group", "aria-labelledby": a, ...c, ref: r }) });
|
|
547
|
+
}
|
|
548
|
+
);
|
|
549
|
+
Vt.displayName = Fe;
|
|
550
|
+
var We = "SelectLabel", Ht = o.forwardRef(
|
|
551
|
+
(t, r) => {
|
|
552
|
+
const { __scopeSelect: e, ...c } = t, a = Bt(We, e);
|
|
553
|
+
return /* @__PURE__ */ n.jsx(j.div, { id: a.id, ...c, ref: r });
|
|
554
|
+
}
|
|
555
|
+
);
|
|
556
|
+
Ht.displayName = We;
|
|
557
|
+
var ce = "SelectItem", [Ut, ze] = oe(ce), Ke = o.forwardRef(
|
|
558
|
+
(t, r) => {
|
|
559
|
+
const {
|
|
560
|
+
__scopeSelect: e,
|
|
561
|
+
value: c,
|
|
562
|
+
disabled: a = !1,
|
|
563
|
+
textValue: u,
|
|
564
|
+
...s
|
|
565
|
+
} = t, l = $(ce, e), i = Y(ce, e), f = l.value === c, [g, w] = o.useState(u ?? ""), [N, I] = o.useState(!1), y = L(
|
|
566
|
+
r,
|
|
567
|
+
(m) => i.itemRefCallback?.(m, c, a)
|
|
568
|
+
), d = be(), h = o.useRef("touch"), x = () => {
|
|
569
|
+
a || (l.onValueChange(c), l.onOpenChange(!1));
|
|
570
|
+
};
|
|
571
|
+
if (c === "")
|
|
572
|
+
throw new Error(
|
|
573
|
+
"A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
|
|
574
|
+
);
|
|
575
|
+
return /* @__PURE__ */ n.jsx(
|
|
576
|
+
Ut,
|
|
577
|
+
{
|
|
578
|
+
scope: e,
|
|
579
|
+
value: c,
|
|
580
|
+
disabled: a,
|
|
581
|
+
textId: d,
|
|
582
|
+
isSelected: f,
|
|
583
|
+
onItemTextChange: o.useCallback((m) => {
|
|
584
|
+
w((v) => v || (m?.textContent ?? "").trim());
|
|
585
|
+
}, []),
|
|
586
|
+
children: /* @__PURE__ */ n.jsx(
|
|
587
|
+
ie.ItemSlot,
|
|
588
|
+
{
|
|
589
|
+
scope: e,
|
|
590
|
+
value: c,
|
|
591
|
+
disabled: a,
|
|
592
|
+
textValue: g,
|
|
593
|
+
children: /* @__PURE__ */ n.jsx(
|
|
594
|
+
j.div,
|
|
595
|
+
{
|
|
596
|
+
role: "option",
|
|
597
|
+
"aria-labelledby": d,
|
|
598
|
+
"data-highlighted": N ? "" : void 0,
|
|
599
|
+
"aria-selected": f && N,
|
|
600
|
+
"data-state": f ? "checked" : "unchecked",
|
|
601
|
+
"aria-disabled": a || void 0,
|
|
602
|
+
"data-disabled": a ? "" : void 0,
|
|
603
|
+
tabIndex: a ? void 0 : -1,
|
|
604
|
+
...s,
|
|
605
|
+
ref: y,
|
|
606
|
+
onFocus: P(s.onFocus, () => I(!0)),
|
|
607
|
+
onBlur: P(s.onBlur, () => I(!1)),
|
|
608
|
+
onClick: P(s.onClick, () => {
|
|
609
|
+
h.current !== "mouse" && x();
|
|
610
|
+
}),
|
|
611
|
+
onPointerUp: P(s.onPointerUp, () => {
|
|
612
|
+
h.current === "mouse" && x();
|
|
613
|
+
}),
|
|
614
|
+
onPointerDown: P(s.onPointerDown, (m) => {
|
|
615
|
+
h.current = m.pointerType;
|
|
616
|
+
}),
|
|
617
|
+
onPointerMove: P(s.onPointerMove, (m) => {
|
|
618
|
+
h.current = m.pointerType, a ? i.onItemLeave?.() : h.current === "mouse" && m.currentTarget.focus({ preventScroll: !0 });
|
|
619
|
+
}),
|
|
620
|
+
onPointerLeave: P(s.onPointerLeave, (m) => {
|
|
621
|
+
m.currentTarget === document.activeElement && i.onItemLeave?.();
|
|
622
|
+
}),
|
|
623
|
+
onKeyDown: P(s.onKeyDown, (m) => {
|
|
624
|
+
i.searchRef?.current !== "" && m.key === " " || (Tt.includes(m.key) && x(), m.key === " " && m.preventDefault());
|
|
625
|
+
})
|
|
626
|
+
}
|
|
627
|
+
)
|
|
628
|
+
}
|
|
629
|
+
)
|
|
630
|
+
}
|
|
631
|
+
);
|
|
632
|
+
}
|
|
633
|
+
);
|
|
634
|
+
Ke.displayName = ce;
|
|
635
|
+
var se = "SelectItemText", Ge = o.forwardRef(
|
|
636
|
+
(t, r) => {
|
|
637
|
+
const { __scopeSelect: e, className: c, style: a, ...u } = t, s = $(se, e), l = Y(se, e), i = ze(se, e), f = Et(se, e), [g, w] = o.useState(null), N = L(
|
|
638
|
+
r,
|
|
639
|
+
(x) => w(x),
|
|
640
|
+
i.onItemTextChange,
|
|
641
|
+
(x) => l.itemTextRefCallback?.(x, i.value, i.disabled)
|
|
642
|
+
), I = g?.textContent, y = o.useMemo(
|
|
643
|
+
() => /* @__PURE__ */ n.jsx("option", { value: i.value, disabled: i.disabled, children: I }, i.value),
|
|
644
|
+
[i.disabled, i.value, I]
|
|
645
|
+
), { onNativeOptionAdd: d, onNativeOptionRemove: h } = f;
|
|
646
|
+
return G(() => (d(y), () => h(y)), [d, h, y]), /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
647
|
+
/* @__PURE__ */ n.jsx(j.span, { id: i.textId, ...u, ref: N }),
|
|
648
|
+
i.isSelected && s.valueNode && !s.valueNodeHasChildren ? Ne.createPortal(u.children, s.valueNode) : null
|
|
649
|
+
] });
|
|
650
|
+
}
|
|
651
|
+
);
|
|
652
|
+
Ge.displayName = se;
|
|
653
|
+
var $e = "SelectItemIndicator", Ye = o.forwardRef(
|
|
654
|
+
(t, r) => {
|
|
655
|
+
const { __scopeSelect: e, ...c } = t;
|
|
656
|
+
return ze($e, e).isSelected ? /* @__PURE__ */ n.jsx(j.span, { "aria-hidden": !0, ...c, ref: r }) : null;
|
|
657
|
+
}
|
|
658
|
+
);
|
|
659
|
+
Ye.displayName = $e;
|
|
660
|
+
var we = "SelectScrollUpButton", qe = o.forwardRef((t, r) => {
|
|
661
|
+
const e = Y(we, t.__scopeSelect), c = Ie(we, t.__scopeSelect), [a, u] = o.useState(!1), s = L(r, c.onScrollButtonChange);
|
|
662
|
+
return G(() => {
|
|
663
|
+
if (e.viewport && e.isPositioned) {
|
|
664
|
+
let l = function() {
|
|
665
|
+
const f = i.scrollTop > 0;
|
|
666
|
+
u(f);
|
|
667
|
+
};
|
|
668
|
+
const i = e.viewport;
|
|
669
|
+
return l(), i.addEventListener("scroll", l), () => i.removeEventListener("scroll", l);
|
|
670
|
+
}
|
|
671
|
+
}, [e.viewport, e.isPositioned]), a ? /* @__PURE__ */ n.jsx(
|
|
672
|
+
Ze,
|
|
673
|
+
{
|
|
674
|
+
...t,
|
|
675
|
+
ref: s,
|
|
676
|
+
onAutoScroll: () => {
|
|
677
|
+
const { viewport: l, selectedItem: i } = e;
|
|
678
|
+
l && i && (l.scrollTop = l.scrollTop - i.offsetHeight);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
) : null;
|
|
682
|
+
});
|
|
683
|
+
qe.displayName = we;
|
|
684
|
+
var Ce = "SelectScrollDownButton", Xe = o.forwardRef((t, r) => {
|
|
685
|
+
const e = Y(Ce, t.__scopeSelect), c = Ie(Ce, t.__scopeSelect), [a, u] = o.useState(!1), s = L(r, c.onScrollButtonChange);
|
|
686
|
+
return G(() => {
|
|
687
|
+
if (e.viewport && e.isPositioned) {
|
|
688
|
+
let l = function() {
|
|
689
|
+
const f = i.scrollHeight - i.clientHeight, g = Math.ceil(i.scrollTop) < f;
|
|
690
|
+
u(g);
|
|
691
|
+
};
|
|
692
|
+
const i = e.viewport;
|
|
693
|
+
return l(), i.addEventListener("scroll", l), () => i.removeEventListener("scroll", l);
|
|
694
|
+
}
|
|
695
|
+
}, [e.viewport, e.isPositioned]), a ? /* @__PURE__ */ n.jsx(
|
|
696
|
+
Ze,
|
|
697
|
+
{
|
|
698
|
+
...t,
|
|
699
|
+
ref: s,
|
|
700
|
+
onAutoScroll: () => {
|
|
701
|
+
const { viewport: l, selectedItem: i } = e;
|
|
702
|
+
l && i && (l.scrollTop = l.scrollTop + i.offsetHeight);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
) : null;
|
|
706
|
+
});
|
|
707
|
+
Xe.displayName = Ce;
|
|
708
|
+
var Ze = o.forwardRef((t, r) => {
|
|
709
|
+
const { __scopeSelect: e, onAutoScroll: c, ...a } = t, u = Y("SelectScrollButton", e), s = o.useRef(null), l = de(e), i = o.useCallback(() => {
|
|
710
|
+
s.current !== null && (window.clearInterval(s.current), s.current = null);
|
|
711
|
+
}, []);
|
|
712
|
+
return o.useEffect(() => () => i(), [i]), G(() => {
|
|
713
|
+
l().find((g) => g.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
714
|
+
}, [l]), /* @__PURE__ */ n.jsx(
|
|
715
|
+
j.div,
|
|
716
|
+
{
|
|
717
|
+
"aria-hidden": !0,
|
|
718
|
+
...a,
|
|
719
|
+
ref: r,
|
|
720
|
+
style: { flexShrink: 0, ...a.style },
|
|
721
|
+
onPointerDown: P(a.onPointerDown, () => {
|
|
722
|
+
s.current === null && (s.current = window.setInterval(c, 50));
|
|
723
|
+
}),
|
|
724
|
+
onPointerMove: P(a.onPointerMove, () => {
|
|
725
|
+
u.onItemLeave?.(), s.current === null && (s.current = window.setInterval(c, 50));
|
|
726
|
+
}),
|
|
727
|
+
onPointerLeave: P(a.onPointerLeave, () => {
|
|
728
|
+
i();
|
|
729
|
+
})
|
|
730
|
+
}
|
|
731
|
+
);
|
|
732
|
+
}), Ft = "SelectSeparator", Wt = o.forwardRef(
|
|
733
|
+
(t, r) => {
|
|
734
|
+
const { __scopeSelect: e, ...c } = t;
|
|
735
|
+
return /* @__PURE__ */ n.jsx(j.div, { "aria-hidden": !0, ...c, ref: r });
|
|
736
|
+
}
|
|
737
|
+
);
|
|
738
|
+
Wt.displayName = Ft;
|
|
739
|
+
var ye = "SelectArrow", zt = o.forwardRef(
|
|
740
|
+
(t, r) => {
|
|
741
|
+
const { __scopeSelect: e, ...c } = t, a = ue(e), u = $(ye, e), s = Y(ye, e);
|
|
742
|
+
return u.open && s.position === "popper" ? /* @__PURE__ */ n.jsx(wt, { ...a, ...c, ref: r }) : null;
|
|
743
|
+
}
|
|
744
|
+
);
|
|
745
|
+
zt.displayName = ye;
|
|
746
|
+
var Kt = "SelectBubbleInput", Je = o.forwardRef(
|
|
747
|
+
({ __scopeSelect: t, value: r, ...e }, c) => {
|
|
748
|
+
const a = o.useRef(null), u = L(c, a), s = lt(r);
|
|
749
|
+
return o.useEffect(() => {
|
|
750
|
+
const l = a.current;
|
|
751
|
+
if (!l) return;
|
|
752
|
+
const i = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
|
|
753
|
+
i,
|
|
754
|
+
"value"
|
|
755
|
+
).set;
|
|
756
|
+
if (s !== r && g) {
|
|
757
|
+
const w = new Event("change", { bubbles: !0 });
|
|
758
|
+
g.call(l, r), l.dispatchEvent(w);
|
|
759
|
+
}
|
|
760
|
+
}, [s, r]), /* @__PURE__ */ n.jsx(
|
|
761
|
+
j.select,
|
|
762
|
+
{
|
|
763
|
+
...e,
|
|
764
|
+
style: { ...xt, ...e.style },
|
|
765
|
+
ref: u,
|
|
766
|
+
defaultValue: r
|
|
767
|
+
}
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
);
|
|
771
|
+
Je.displayName = Kt;
|
|
772
|
+
function Qe(t) {
|
|
773
|
+
return t === "" || t === void 0;
|
|
774
|
+
}
|
|
775
|
+
function et(t) {
|
|
776
|
+
const r = ct(t), e = o.useRef(""), c = o.useRef(0), a = o.useCallback(
|
|
777
|
+
(s) => {
|
|
778
|
+
const l = e.current + s;
|
|
779
|
+
r(l), (function i(f) {
|
|
780
|
+
e.current = f, window.clearTimeout(c.current), f !== "" && (c.current = window.setTimeout(() => i(""), 1e3));
|
|
781
|
+
})(l);
|
|
782
|
+
},
|
|
783
|
+
[r]
|
|
784
|
+
), u = o.useCallback(() => {
|
|
785
|
+
e.current = "", window.clearTimeout(c.current);
|
|
786
|
+
}, []);
|
|
787
|
+
return o.useEffect(() => () => window.clearTimeout(c.current), []), [e, a, u];
|
|
788
|
+
}
|
|
789
|
+
function tt(t, r, e) {
|
|
790
|
+
const a = r.length > 1 && Array.from(r).every((f) => f === r[0]) ? r[0] : r, u = e ? t.indexOf(e) : -1;
|
|
791
|
+
let s = Gt(t, Math.max(u, 0));
|
|
792
|
+
a.length === 1 && (s = s.filter((f) => f !== e));
|
|
793
|
+
const i = s.find(
|
|
794
|
+
(f) => f.textValue.toLowerCase().startsWith(a.toLowerCase())
|
|
795
|
+
);
|
|
796
|
+
return i !== e ? i : void 0;
|
|
797
|
+
}
|
|
798
|
+
function Gt(t, r) {
|
|
799
|
+
return t.map((e, c) => t[(r + c) % t.length]);
|
|
800
|
+
}
|
|
801
|
+
var $t = Re, Yt = Me, qt = Oe, Xt = De, Zt = Le, Jt = ke, Qt = Ue, eo = Ke, to = Ge, oo = Ye, no = qe, ro = Xe;
|
|
802
|
+
function uo({
|
|
803
|
+
...t
|
|
804
|
+
}) {
|
|
805
|
+
return /* @__PURE__ */ n.jsx($t, { "data-slot": "select", ...t });
|
|
806
|
+
}
|
|
807
|
+
function po({
|
|
808
|
+
...t
|
|
809
|
+
}) {
|
|
810
|
+
return /* @__PURE__ */ n.jsx(qt, { "data-slot": "select-value", ...t });
|
|
811
|
+
}
|
|
812
|
+
function fo({
|
|
813
|
+
className: t,
|
|
814
|
+
size: r = "default",
|
|
815
|
+
children: e,
|
|
816
|
+
...c
|
|
817
|
+
}) {
|
|
818
|
+
return /* @__PURE__ */ n.jsxs(
|
|
819
|
+
Yt,
|
|
820
|
+
{
|
|
821
|
+
"data-slot": "select-trigger",
|
|
822
|
+
"data-size": r,
|
|
823
|
+
className: te(
|
|
824
|
+
"border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
825
|
+
t
|
|
826
|
+
),
|
|
827
|
+
...c,
|
|
828
|
+
children: [
|
|
829
|
+
e,
|
|
830
|
+
/* @__PURE__ */ n.jsx(Xt, { asChild: !0, children: /* @__PURE__ */ n.jsx(Ee, { className: "size-4 opacity-50" }) })
|
|
831
|
+
]
|
|
832
|
+
}
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
function mo({
|
|
836
|
+
className: t,
|
|
837
|
+
children: r,
|
|
838
|
+
position: e = "item-aligned",
|
|
839
|
+
align: c = "center",
|
|
840
|
+
...a
|
|
841
|
+
}) {
|
|
842
|
+
const u = ht();
|
|
843
|
+
return /* @__PURE__ */ n.jsx(Zt, { container: u, children: /* @__PURE__ */ n.jsxs(
|
|
844
|
+
Jt,
|
|
845
|
+
{
|
|
846
|
+
"data-slot": "select-content",
|
|
847
|
+
className: te(
|
|
848
|
+
"bg-popover text-popover-foreground 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
849
|
+
e === "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",
|
|
850
|
+
t
|
|
851
|
+
),
|
|
852
|
+
position: e,
|
|
853
|
+
align: c,
|
|
854
|
+
...a,
|
|
855
|
+
children: [
|
|
856
|
+
/* @__PURE__ */ n.jsx(so, {}),
|
|
857
|
+
/* @__PURE__ */ n.jsx(
|
|
858
|
+
Qt,
|
|
859
|
+
{
|
|
860
|
+
className: te(
|
|
861
|
+
"p-1",
|
|
862
|
+
e === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
863
|
+
),
|
|
864
|
+
children: r
|
|
865
|
+
}
|
|
866
|
+
),
|
|
867
|
+
/* @__PURE__ */ n.jsx(ao, {})
|
|
868
|
+
]
|
|
869
|
+
}
|
|
870
|
+
) });
|
|
871
|
+
}
|
|
872
|
+
function ho({
|
|
873
|
+
className: t,
|
|
874
|
+
children: r,
|
|
875
|
+
...e
|
|
876
|
+
}) {
|
|
877
|
+
return /* @__PURE__ */ n.jsxs(
|
|
878
|
+
eo,
|
|
879
|
+
{
|
|
880
|
+
"data-slot": "select-item",
|
|
881
|
+
className: te(
|
|
882
|
+
"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-2 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",
|
|
883
|
+
t
|
|
884
|
+
),
|
|
885
|
+
...e,
|
|
886
|
+
children: [
|
|
887
|
+
/* @__PURE__ */ n.jsx(
|
|
888
|
+
"span",
|
|
889
|
+
{
|
|
890
|
+
"data-slot": "select-item-indicator",
|
|
891
|
+
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
892
|
+
children: /* @__PURE__ */ n.jsx(oo, { children: /* @__PURE__ */ n.jsx(Ct, { className: "size-4" }) })
|
|
893
|
+
}
|
|
894
|
+
),
|
|
895
|
+
/* @__PURE__ */ n.jsx(to, { children: r })
|
|
896
|
+
]
|
|
897
|
+
}
|
|
898
|
+
);
|
|
899
|
+
}
|
|
900
|
+
function so({
|
|
901
|
+
className: t,
|
|
902
|
+
...r
|
|
903
|
+
}) {
|
|
904
|
+
return /* @__PURE__ */ n.jsx(
|
|
905
|
+
no,
|
|
906
|
+
{
|
|
907
|
+
"data-slot": "select-scroll-up-button",
|
|
908
|
+
className: te(
|
|
909
|
+
"flex cursor-default items-center justify-center py-1",
|
|
910
|
+
t
|
|
911
|
+
),
|
|
912
|
+
...r,
|
|
913
|
+
children: /* @__PURE__ */ n.jsx(bt, { className: "size-4" })
|
|
914
|
+
}
|
|
915
|
+
);
|
|
916
|
+
}
|
|
917
|
+
function ao({
|
|
918
|
+
className: t,
|
|
919
|
+
...r
|
|
920
|
+
}) {
|
|
921
|
+
return /* @__PURE__ */ n.jsx(
|
|
922
|
+
ro,
|
|
923
|
+
{
|
|
924
|
+
"data-slot": "select-scroll-down-button",
|
|
925
|
+
className: te(
|
|
926
|
+
"flex cursor-default items-center justify-center py-1",
|
|
927
|
+
t
|
|
928
|
+
),
|
|
929
|
+
...r,
|
|
930
|
+
children: /* @__PURE__ */ n.jsx(Ee, { className: "size-4" })
|
|
931
|
+
}
|
|
932
|
+
);
|
|
933
|
+
}
|
|
934
|
+
export {
|
|
935
|
+
uo as S,
|
|
936
|
+
fo as a,
|
|
937
|
+
po as b,
|
|
938
|
+
mo as c,
|
|
939
|
+
ho as d
|
|
940
|
+
};
|