ics-ui-kit 1.0.0-alpha.0 → 1.0.0-alpha.2
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/CalendarPreviousMonthButton-CHMp8bkd.js +2964 -0
- package/dist/CalendarPreviousMonthButton-CHMp8bkd.js.map +1 -0
- package/dist/{CheckboxField-Ca48ZYoX.js → CheckboxField-xDqHgXHh.js} +2 -2
- package/dist/{CheckboxField-Ca48ZYoX.js.map → CheckboxField-xDqHgXHh.js.map} +1 -1
- package/dist/{Command-CsW4aK7M.js → Command-WsAKNQrY.js} +2 -2
- package/dist/{Command-CsW4aK7M.js.map → Command-WsAKNQrY.js.map} +1 -1
- package/dist/{Dialog-BT_775Iz.js → Dialog-i_Y-phdM.js} +42 -43
- package/dist/Dialog-i_Y-phdM.js.map +1 -0
- package/dist/{Field-BRPdaQ8D.js → Field-BcwUtgGr.js} +2 -2
- package/dist/{Field-BRPdaQ8D.js.map → Field-BcwUtgGr.js.map} +1 -1
- package/dist/{FieldLabel-ic0eq9Un.js → FieldLabel-DYu1AcGH.js} +2 -2
- package/dist/{FieldLabel-ic0eq9Un.js.map → FieldLabel-DYu1AcGH.js.map} +1 -1
- package/dist/{FormFooterTemplate-BIwnBQhL.js → FormFooterTemplate-CHlas_Pp.js} +2 -2
- package/dist/{FormFooterTemplate-BIwnBQhL.js.map → FormFooterTemplate-CHlas_Pp.js.map} +1 -1
- package/dist/FormStack-DfoaOry7.js +1205 -0
- package/dist/FormStack-DfoaOry7.js.map +1 -0
- package/dist/{IconTooltip-CgbefRXG.js → IconTooltip-R6_6_f40.js} +2 -2
- package/dist/{IconTooltip-CgbefRXG.js.map → IconTooltip-R6_6_f40.js.map} +1 -1
- package/dist/{Popover-Dz2eNsXh.js → Popover-XrJa7lyb.js} +49 -50
- package/dist/Popover-XrJa7lyb.js.map +1 -0
- package/dist/{Select-Bfbtj5zt.js → Select-DO02vXt3.js} +185 -186
- package/dist/{Select-Bfbtj5zt.js.map → Select-DO02vXt3.js.map} +1 -1
- package/dist/{Sheet-aLBPtE1k.js → Sheet-C2UoHLL0.js} +35 -36
- package/dist/Sheet-C2UoHLL0.js.map +1 -0
- package/dist/{TextOverflowTooltip-BaNPKqnO.js → TextOverflowTooltip-XPDdO9Dz.js} +2 -2
- package/dist/{TextOverflowTooltip-BaNPKqnO.js.map → TextOverflowTooltip-XPDdO9Dz.js.map} +1 -1
- package/dist/{Tooltip-DOgKy50D.js → Tooltip-D2XvRS0c.js} +63 -64
- package/dist/Tooltip-D2XvRS0c.js.map +1 -0
- package/dist/blocks/auth/otp-form.js +3240 -204
- package/dist/blocks/auth/otp-form.js.map +1 -1
- package/dist/components/alert-dialog/AlertDialog.d.ts +2 -4
- package/dist/components/alert-dialog.js +70 -71
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/calendar/components/calendar-dropdown/CalendarDropdown.d.ts +24 -0
- package/dist/components/calendar/styles.d.ts +61 -0
- package/dist/components/calendar-scroll/CalendarScroll.d.ts +21 -0
- package/dist/components/calendar-scroll/CalendarScroll.stories.d.ts +16 -0
- package/dist/components/calendar-scroll/index.d.ts +3 -0
- package/dist/components/calendar-scroll.d.ts +2 -0
- package/dist/components/calendar-scroll.js +181 -0
- package/dist/components/calendar-scroll.js.map +1 -0
- package/dist/components/calendar.js +51 -147
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/dialog/Dialog.d.ts +2 -4
- package/dist/components/dialog.js +3 -3
- package/dist/components/drawer/components/drawer-content/DrawerContent.d.ts +1 -2
- package/dist/components/drawer.js +96 -97
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown/Dropdown.d.ts +2 -4
- package/dist/components/dropdown.js +251 -252
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/file-upload.js +1 -1
- package/dist/components/form/Form.d.ts +14 -0
- package/dist/components/form/components/form-field/FormField.d.ts +4 -0
- package/dist/components/form.js +3 -3
- package/dist/components/icon-tooltip.js +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/overflow-tooltip.js +1 -1
- package/dist/components/popover/Popover.d.ts +1 -2
- package/dist/components/popover.js +1 -1
- package/dist/components/resizable/Resizable.d.ts +1 -1
- package/dist/components/scheduler.js +1 -1
- package/dist/components/search-select/multi-select/MultiSelect.d.ts +1 -1
- package/dist/components/search-select.js +3 -3
- package/dist/components/search-select.js.map +1 -1
- package/dist/components/select/Select.d.ts +1 -2
- package/dist/components/select.js +1 -1
- package/dist/components/sheet/Sheet.d.ts +1 -2
- package/dist/components/sheet.js +1 -1
- package/dist/components/sidebar.js +2 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/tag-input.js +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +2 -4
- package/dist/components/tooltip.js +1 -1
- package/dist/tailwind.css +406 -361
- package/package.json +22 -18
- package/dist/DayPicker-4hE1QEvO.js +0 -2452
- package/dist/DayPicker-4hE1QEvO.js.map +0 -1
- package/dist/Dialog-BT_775Iz.js.map +0 -1
- package/dist/FormStack-CxiZhx1n.js +0 -127
- package/dist/FormStack-CxiZhx1n.js.map +0 -1
- package/dist/Popover-Dz2eNsXh.js.map +0 -1
- package/dist/Sheet-aLBPtE1k.js.map +0 -1
- package/dist/Tooltip-DOgKy50D.js.map +0 -1
- package/dist/buildMatchPatternFn-d7GTeGl_.js +0 -68
- package/dist/buildMatchPatternFn-d7GTeGl_.js.map +0 -1
- package/dist/components/portal-container/PortalContainer.d.ts +0 -10
- package/dist/components/portal-container/index.d.ts +0 -2
- package/dist/components/portal-container/portalContainerEvents.d.ts +0 -12
- package/dist/components/portal-container/usePortalContainer.d.ts +0 -11
- package/dist/components/portal-container.d.ts +0 -2
- package/dist/components/portal-container.js +0 -14
- package/dist/components/portal-container.js.map +0 -1
- package/dist/index.esm-CXA6i4d7.js +0 -1282
- package/dist/index.esm-CXA6i4d7.js.map +0 -1
- package/dist/normalizeDates-9A3c9WYM.js +0 -32
- package/dist/normalizeDates-9A3c9WYM.js.map +0 -1
- package/dist/styles.css +0 -9064
- package/dist/styles.d.ts +0 -1
- package/dist/usePortalContainer-B1xla842.js +0 -33
- package/dist/usePortalContainer-B1xla842.js.map +0 -1
- package/dist/vendors/date-fns/index.d.ts +0 -12
- package/dist/vendors/date-fns/locale/en-US/index.d.ts +0 -5
- package/dist/vendors/date-fns/locale/en-US.d.ts +0 -2
- package/dist/vendors/date-fns/locale/en-US.js +0 -372
- package/dist/vendors/date-fns/locale/en-US.js.map +0 -1
- package/dist/vendors/date-fns/locale/ru/index.d.ts +0 -5
- package/dist/vendors/date-fns/locale/ru.d.ts +0 -2
- package/dist/vendors/date-fns/locale/ru.js +0 -569
- package/dist/vendors/date-fns/locale/ru.js.map +0 -1
- package/dist/vendors/date-fns.d.ts +0 -2
- package/dist/vendors/date-fns.js +0 -2
- package/dist/vendors/date-fns.js.map +0 -1
- package/dist/vendors/react-day-picker/index.d.ts +0 -13
- package/dist/vendors/react-day-picker.d.ts +0 -2
- package/dist/vendors/react-day-picker.js +0 -87
- package/dist/vendors/react-day-picker.js.map +0 -1
- package/dist/vendors/react-hook-form/index.d.ts +0 -14
- package/dist/vendors/react-hook-form.d.ts +0 -2
- package/dist/vendors/react-hook-form.js +0 -19
- package/dist/vendors/react-hook-form.js.map +0 -1
- package/dist/vendors/tanstack/react-table/index.d.ts +0 -13
- package/dist/vendors/tanstack/react-table.d.ts +0 -2
- package/dist/vendors/tanstack/react-table.js +0 -2090
- package/dist/vendors/tanstack/react-table.js.map +0 -1
- package/dist/vendors/zod/index.d.ts +0 -13
- package/dist/vendors/zod.d.ts +0 -2
- package/dist/vendors/zod.js +0 -3080
- package/dist/vendors/zod.js.map +0 -1
- package/dist/zod-BMNoK3aM.js +0 -75
- package/dist/zod-BMNoK3aM.js.map +0 -1
|
@@ -18,25 +18,24 @@ import { u as Ot } from "./index-BZPx6jYI.js";
|
|
|
18
18
|
import { V as Dt } from "./index-Uiy0Xwy2.js";
|
|
19
19
|
import { h as Lt } from "./index-BjtNfqNq.js";
|
|
20
20
|
import { T as Y } from "./index-BVqs-uqP.js";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { C as Ht } from "./circle-x-u75Rx3Tj.js";
|
|
21
|
+
import { m as Bt } from "./MenuItem-C51uFz3V.js";
|
|
22
|
+
import { I as kt } from "./Icon-DH3ev9GK.js";
|
|
23
|
+
import { C as Vt } from "./circle-x-u75Rx3Tj.js";
|
|
25
24
|
import { C as De } from "./chevron-down-CAOItu8X.js";
|
|
26
|
-
import { C as
|
|
27
|
-
import { C as
|
|
28
|
-
var
|
|
29
|
-
|
|
25
|
+
import { C as Ht } from "./check-CeyaOoZv.js";
|
|
26
|
+
import { C as Ut } from "./chevron-up-UDiVTHo0.js";
|
|
27
|
+
var Wt = [" ", "Enter", "ArrowUp", "ArrowDown"], Ft = [" ", "Enter"], ee = "Select", [de, pe, Kt] = yt(ee), [re, tr] = bt(ee, [
|
|
28
|
+
Kt,
|
|
30
29
|
Oe
|
|
31
|
-
]), ue = Oe(), [
|
|
30
|
+
]), ue = Oe(), [$t, q] = re(ee), [Gt, jt] = re(ee), Le = (t) => {
|
|
32
31
|
const {
|
|
33
32
|
__scopeSelect: r,
|
|
34
33
|
children: e,
|
|
35
34
|
open: n,
|
|
36
|
-
defaultOpen:
|
|
35
|
+
defaultOpen: a,
|
|
37
36
|
onOpenChange: d,
|
|
38
37
|
value: s,
|
|
39
|
-
defaultValue:
|
|
38
|
+
defaultValue: l,
|
|
40
39
|
onValueChange: i,
|
|
41
40
|
dir: f,
|
|
42
41
|
name: g,
|
|
@@ -46,17 +45,17 @@ var Ft = [" ", "Enter", "ArrowUp", "ArrowDown"], Kt = [" ", "Enter"], ee = "Sele
|
|
|
46
45
|
form: x
|
|
47
46
|
} = t, p = ue(r), [h, S] = o.useState(null), [m, v] = o.useState(null), [F, A] = o.useState(!1), ne = xt(f), [R, D] = Me({
|
|
48
47
|
prop: n,
|
|
49
|
-
defaultProp:
|
|
48
|
+
defaultProp: a ?? !1,
|
|
50
49
|
onChange: d,
|
|
51
50
|
caller: ee
|
|
52
51
|
}), [K, Z] = Me({
|
|
53
52
|
prop: s,
|
|
54
|
-
defaultProp:
|
|
53
|
+
defaultProp: l,
|
|
55
54
|
onChange: i,
|
|
56
55
|
caller: ee
|
|
57
56
|
}), k = o.useRef(null), V = h ? x || !!h.closest("form") : !0, [$, H] = o.useState(/* @__PURE__ */ new Set()), U = Array.from($).map((E) => E.props.value).join(";");
|
|
58
57
|
return /* @__PURE__ */ c(Rt, { ...p, children: /* @__PURE__ */ j(
|
|
59
|
-
|
|
58
|
+
$t,
|
|
60
59
|
{
|
|
61
60
|
required: I,
|
|
62
61
|
scope: r,
|
|
@@ -76,7 +75,7 @@ var Ft = [" ", "Enter", "ArrowUp", "ArrowDown"], Kt = [" ", "Enter"], ee = "Sele
|
|
|
76
75
|
disabled: P,
|
|
77
76
|
children: [
|
|
78
77
|
/* @__PURE__ */ c(de.Provider, { scope: r, children: /* @__PURE__ */ c(
|
|
79
|
-
|
|
78
|
+
Gt,
|
|
80
79
|
{
|
|
81
80
|
scope: t.__scopeSelect,
|
|
82
81
|
onNativeOptionAdd: o.useCallback((E) => {
|
|
@@ -117,11 +116,11 @@ var Ft = [" ", "Enter", "ArrowUp", "ArrowDown"], Kt = [" ", "Enter"], ee = "Sele
|
|
|
117
116
|
Le.displayName = ee;
|
|
118
117
|
var Be = "SelectTrigger", ke = o.forwardRef(
|
|
119
118
|
(t, r) => {
|
|
120
|
-
const { __scopeSelect: e, disabled: n = !1, ...
|
|
119
|
+
const { __scopeSelect: e, disabled: n = !1, ...a } = t, d = ue(e), s = q(Be, e), l = s.disabled || n, i = B(r, s.onTriggerChange), f = pe(e), g = o.useRef("touch"), [y, P, I] = ct((p) => {
|
|
121
120
|
const h = f().filter((v) => !v.disabled), S = h.find((v) => v.value === s.value), m = it(h, p, S);
|
|
122
121
|
m !== void 0 && s.onValueChange(m.value);
|
|
123
122
|
}), x = (p) => {
|
|
124
|
-
|
|
123
|
+
l || (s.onOpenChange(!0), I()), p && (s.triggerPointerDownPosRef.current = {
|
|
125
124
|
x: Math.round(p.pageX),
|
|
126
125
|
y: Math.round(p.pageY)
|
|
127
126
|
});
|
|
@@ -137,22 +136,22 @@ var Be = "SelectTrigger", ke = o.forwardRef(
|
|
|
137
136
|
"aria-autocomplete": "none",
|
|
138
137
|
dir: s.dir,
|
|
139
138
|
"data-state": s.open ? "open" : "closed",
|
|
140
|
-
disabled:
|
|
141
|
-
"data-disabled":
|
|
139
|
+
disabled: l,
|
|
140
|
+
"data-disabled": l ? "" : void 0,
|
|
142
141
|
"data-placeholder": lt(s.value) ? "" : void 0,
|
|
143
|
-
...
|
|
142
|
+
...a,
|
|
144
143
|
ref: i,
|
|
145
|
-
onClick: N(
|
|
144
|
+
onClick: N(a.onClick, (p) => {
|
|
146
145
|
p.currentTarget.focus(), g.current !== "mouse" && x(p);
|
|
147
146
|
}),
|
|
148
|
-
onPointerDown: N(
|
|
147
|
+
onPointerDown: N(a.onPointerDown, (p) => {
|
|
149
148
|
g.current = p.pointerType;
|
|
150
149
|
const h = p.target;
|
|
151
150
|
h.hasPointerCapture(p.pointerId) && h.releasePointerCapture(p.pointerId), p.button === 0 && p.ctrlKey === !1 && p.pointerType === "mouse" && (x(p), p.preventDefault());
|
|
152
151
|
}),
|
|
153
|
-
onKeyDown: N(
|
|
152
|
+
onKeyDown: N(a.onKeyDown, (p) => {
|
|
154
153
|
const h = y.current !== "";
|
|
155
|
-
!(p.ctrlKey || p.altKey || p.metaKey) && p.key.length === 1 && P(p.key), !(h && p.key === " ") &&
|
|
154
|
+
!(p.ctrlKey || p.altKey || p.metaKey) && p.key.length === 1 && P(p.key), !(h && p.key === " ") && Wt.includes(p.key) && (x(), p.preventDefault());
|
|
156
155
|
})
|
|
157
156
|
}
|
|
158
157
|
) });
|
|
@@ -161,13 +160,13 @@ var Be = "SelectTrigger", ke = o.forwardRef(
|
|
|
161
160
|
ke.displayName = Be;
|
|
162
161
|
var Ve = "SelectValue", He = o.forwardRef(
|
|
163
162
|
(t, r) => {
|
|
164
|
-
const { __scopeSelect: e, className: n, style:
|
|
163
|
+
const { __scopeSelect: e, className: n, style: a, children: d, placeholder: s = "", ...l } = t, i = q(Ve, e), { onValueNodeHasChildrenChange: f } = i, g = d !== void 0, y = B(r, i.onValueNodeChange);
|
|
165
164
|
return z(() => {
|
|
166
165
|
f(g);
|
|
167
166
|
}, [f, g]), /* @__PURE__ */ c(
|
|
168
167
|
M.span,
|
|
169
168
|
{
|
|
170
|
-
...
|
|
169
|
+
...l,
|
|
171
170
|
ref: y,
|
|
172
171
|
style: { pointerEvents: "none" },
|
|
173
172
|
children: lt(i.value) ? /* @__PURE__ */ c(Ie, { children: s }) : d
|
|
@@ -176,20 +175,20 @@ var Ve = "SelectValue", He = o.forwardRef(
|
|
|
176
175
|
}
|
|
177
176
|
);
|
|
178
177
|
He.displayName = Ve;
|
|
179
|
-
var
|
|
178
|
+
var zt = "SelectIcon", Ue = o.forwardRef(
|
|
180
179
|
(t, r) => {
|
|
181
|
-
const { __scopeSelect: e, children: n, ...
|
|
182
|
-
return /* @__PURE__ */ c(M.span, { "aria-hidden": !0, ...
|
|
180
|
+
const { __scopeSelect: e, children: n, ...a } = t;
|
|
181
|
+
return /* @__PURE__ */ c(M.span, { "aria-hidden": !0, ...a, ref: r, children: n || "▼" });
|
|
183
182
|
}
|
|
184
183
|
);
|
|
185
|
-
Ue.displayName =
|
|
186
|
-
var
|
|
187
|
-
We.displayName =
|
|
184
|
+
Ue.displayName = zt;
|
|
185
|
+
var Yt = "SelectPortal", We = (t) => /* @__PURE__ */ c(Ct, { asChild: !0, ...t });
|
|
186
|
+
We.displayName = Yt;
|
|
188
187
|
var te = "SelectContent", Fe = o.forwardRef(
|
|
189
188
|
(t, r) => {
|
|
190
|
-
const e = q(te, t.__scopeSelect), [n,
|
|
189
|
+
const e = q(te, t.__scopeSelect), [n, a] = o.useState();
|
|
191
190
|
if (z(() => {
|
|
192
|
-
|
|
191
|
+
a(new DocumentFragment());
|
|
193
192
|
}, []), !e.open) {
|
|
194
193
|
const d = n;
|
|
195
194
|
return d ? Ae.createPortal(
|
|
@@ -201,17 +200,17 @@ var te = "SelectContent", Fe = o.forwardRef(
|
|
|
201
200
|
}
|
|
202
201
|
);
|
|
203
202
|
Fe.displayName = te;
|
|
204
|
-
var O = 10, [Ke, X] = re(te),
|
|
203
|
+
var O = 10, [Ke, X] = re(te), qt = "SelectContentImpl", Xt = wt("SelectContent.RemoveScroll"), $e = o.forwardRef(
|
|
205
204
|
(t, r) => {
|
|
206
205
|
const {
|
|
207
206
|
__scopeSelect: e,
|
|
208
207
|
position: n = "item-aligned",
|
|
209
|
-
onCloseAutoFocus:
|
|
208
|
+
onCloseAutoFocus: a,
|
|
210
209
|
onEscapeKeyDown: d,
|
|
211
210
|
onPointerDownOutside: s,
|
|
212
211
|
//
|
|
213
212
|
// PopperContent props
|
|
214
|
-
side:
|
|
213
|
+
side: l,
|
|
215
214
|
sideOffset: i,
|
|
216
215
|
align: f,
|
|
217
216
|
alignOffset: g,
|
|
@@ -281,7 +280,7 @@ var O = 10, [Ke, X] = re(te), Xt = "SelectContentImpl", Zt = wt("SelectContent.R
|
|
|
281
280
|
},
|
|
282
281
|
[m.value]
|
|
283
282
|
), ce = n === "popper" ? we : Ge, se = ce === we ? {
|
|
284
|
-
side:
|
|
283
|
+
side: l,
|
|
285
284
|
sideOffset: i,
|
|
286
285
|
align: f,
|
|
287
286
|
alignOffset: g,
|
|
@@ -308,7 +307,7 @@ var O = 10, [Ke, X] = re(te), Xt = "SelectContentImpl", Zt = wt("SelectContent.R
|
|
|
308
307
|
position: n,
|
|
309
308
|
isPositioned: $,
|
|
310
309
|
searchRef: fe,
|
|
311
|
-
children: /* @__PURE__ */ c(Nt, { as:
|
|
310
|
+
children: /* @__PURE__ */ c(Nt, { as: Xt, allowPinchZoom: !0, children: /* @__PURE__ */ c(
|
|
312
311
|
Pt,
|
|
313
312
|
{
|
|
314
313
|
asChild: !0,
|
|
@@ -316,7 +315,7 @@ var O = 10, [Ke, X] = re(te), Xt = "SelectContentImpl", Zt = wt("SelectContent.R
|
|
|
316
315
|
onMountAutoFocus: (u) => {
|
|
317
316
|
u.preventDefault();
|
|
318
317
|
},
|
|
319
|
-
onUnmountAutoFocus: N(
|
|
318
|
+
onUnmountAutoFocus: N(a, (u) => {
|
|
320
319
|
m.trigger?.focus({ preventScroll: !0 }), u.preventDefault();
|
|
321
320
|
}),
|
|
322
321
|
children: /* @__PURE__ */ c(
|
|
@@ -369,10 +368,10 @@ var O = 10, [Ke, X] = re(te), Xt = "SelectContentImpl", Zt = wt("SelectContent.R
|
|
|
369
368
|
);
|
|
370
369
|
}
|
|
371
370
|
);
|
|
372
|
-
$e.displayName =
|
|
373
|
-
var
|
|
374
|
-
const { __scopeSelect: e, onPlaced: n, ...
|
|
375
|
-
if (d.trigger && d.valueNode &&
|
|
371
|
+
$e.displayName = qt;
|
|
372
|
+
var Zt = "SelectItemAlignedPosition", Ge = o.forwardRef((t, r) => {
|
|
373
|
+
const { __scopeSelect: e, onPlaced: n, ...a } = t, d = q(te, e), s = X(te, e), [l, i] = o.useState(null), [f, g] = o.useState(null), y = B(r, (R) => g(R)), P = pe(e), I = o.useRef(!1), x = o.useRef(!0), { viewport: p, selectedItem: h, selectedItemText: S, focusSelectedItem: m } = s, v = o.useCallback(() => {
|
|
374
|
+
if (d.trigger && d.valueNode && l && f && p && h && S) {
|
|
376
375
|
const R = d.trigger.getBoundingClientRect(), D = f.getBoundingClientRect(), K = d.valueNode.getBoundingClientRect(), Z = S.getBoundingClientRect();
|
|
377
376
|
if (d.dir !== "rtl") {
|
|
378
377
|
const b = Z.left - D.left, T = K.left - b, J = R.left - T, Q = R.width + J, ve = Math.max(Q, D.width), ge = window.innerWidth - O, Se = _e(T, [
|
|
@@ -384,41 +383,41 @@ var Jt = "SelectItemAlignedPosition", Ge = o.forwardRef((t, r) => {
|
|
|
384
383
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
385
384
|
Math.max(O, ge - ve)
|
|
386
385
|
]);
|
|
387
|
-
|
|
386
|
+
l.style.minWidth = Q + "px", l.style.left = Se + "px";
|
|
388
387
|
} else {
|
|
389
388
|
const b = D.right - Z.right, T = window.innerWidth - K.right - b, J = window.innerWidth - R.right - T, Q = R.width + J, ve = Math.max(Q, D.width), ge = window.innerWidth - O, Se = _e(T, [
|
|
390
389
|
O,
|
|
391
390
|
Math.max(O, ge - ve)
|
|
392
391
|
]);
|
|
393
|
-
|
|
392
|
+
l.style.minWidth = Q + "px", l.style.right = Se + "px";
|
|
394
393
|
}
|
|
395
394
|
const k = P(), V = window.innerHeight - O * 2, $ = p.scrollHeight, H = window.getComputedStyle(f), U = parseInt(H.borderTopWidth, 10), E = parseInt(H.paddingTop, 10), L = parseInt(H.borderBottomWidth, 10), W = parseInt(H.paddingBottom, 10), G = U + E + $ + W + L, fe = Math.min(h.offsetHeight * 5, G), le = window.getComputedStyle(p), me = parseInt(le.paddingTop, 10), he = parseInt(le.paddingBottom, 10), oe = R.top + R.height / 2 - O, ce = V - oe, se = h.offsetHeight / 2, u = h.offsetTop + se, C = U + E + u, _ = G - C;
|
|
396
395
|
if (C <= oe) {
|
|
397
396
|
const b = k.length > 0 && h === k[k.length - 1].ref.current;
|
|
398
|
-
|
|
397
|
+
l.style.bottom = "0px";
|
|
399
398
|
const T = f.clientHeight - p.offsetTop - p.offsetHeight, J = Math.max(
|
|
400
399
|
ce,
|
|
401
400
|
se + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
402
401
|
(b ? he : 0) + T + L
|
|
403
402
|
), Q = C + J;
|
|
404
|
-
|
|
403
|
+
l.style.height = Q + "px";
|
|
405
404
|
} else {
|
|
406
405
|
const b = k.length > 0 && h === k[0].ref.current;
|
|
407
|
-
|
|
406
|
+
l.style.top = "0px";
|
|
408
407
|
const J = Math.max(
|
|
409
408
|
oe,
|
|
410
409
|
U + p.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
411
410
|
(b ? me : 0) + se
|
|
412
411
|
) + _;
|
|
413
|
-
|
|
412
|
+
l.style.height = J + "px", p.scrollTop = C - oe + p.offsetTop;
|
|
414
413
|
}
|
|
415
|
-
|
|
414
|
+
l.style.margin = `${O}px 0`, l.style.minHeight = fe + "px", l.style.maxHeight = V + "px", n?.(), requestAnimationFrame(() => I.current = !0);
|
|
416
415
|
}
|
|
417
416
|
}, [
|
|
418
417
|
P,
|
|
419
418
|
d.trigger,
|
|
420
419
|
d.valueNode,
|
|
421
|
-
|
|
420
|
+
l,
|
|
422
421
|
f,
|
|
423
422
|
p,
|
|
424
423
|
h,
|
|
@@ -438,10 +437,10 @@ var Jt = "SelectItemAlignedPosition", Ge = o.forwardRef((t, r) => {
|
|
|
438
437
|
[v, m]
|
|
439
438
|
);
|
|
440
439
|
return /* @__PURE__ */ c(
|
|
441
|
-
|
|
440
|
+
Qt,
|
|
442
441
|
{
|
|
443
442
|
scope: e,
|
|
444
|
-
contentWrapper:
|
|
443
|
+
contentWrapper: l,
|
|
445
444
|
shouldExpandOnScrollRef: I,
|
|
446
445
|
onScrollButtonChange: ne,
|
|
447
446
|
children: /* @__PURE__ */ c(
|
|
@@ -457,7 +456,7 @@ var Jt = "SelectItemAlignedPosition", Ge = o.forwardRef((t, r) => {
|
|
|
457
456
|
children: /* @__PURE__ */ c(
|
|
458
457
|
M.div,
|
|
459
458
|
{
|
|
460
|
-
...
|
|
459
|
+
...a,
|
|
461
460
|
ref: y,
|
|
462
461
|
style: {
|
|
463
462
|
// When we get the height of the content, it includes borders. If we were to set
|
|
@@ -465,7 +464,7 @@ var Jt = "SelectItemAlignedPosition", Ge = o.forwardRef((t, r) => {
|
|
|
465
464
|
boxSizing: "border-box",
|
|
466
465
|
// We need to ensure the content doesn't get taller than the wrapper
|
|
467
466
|
maxHeight: "100%",
|
|
468
|
-
...
|
|
467
|
+
...a.style
|
|
469
468
|
}
|
|
470
469
|
}
|
|
471
470
|
)
|
|
@@ -474,12 +473,12 @@ var Jt = "SelectItemAlignedPosition", Ge = o.forwardRef((t, r) => {
|
|
|
474
473
|
}
|
|
475
474
|
);
|
|
476
475
|
});
|
|
477
|
-
Ge.displayName =
|
|
478
|
-
var
|
|
476
|
+
Ge.displayName = Zt;
|
|
477
|
+
var Jt = "SelectPopperPosition", we = o.forwardRef((t, r) => {
|
|
479
478
|
const {
|
|
480
479
|
__scopeSelect: e,
|
|
481
480
|
align: n = "start",
|
|
482
|
-
collisionPadding:
|
|
481
|
+
collisionPadding: a = O,
|
|
483
482
|
...d
|
|
484
483
|
} = t, s = ue(e);
|
|
485
484
|
return /* @__PURE__ */ c(
|
|
@@ -489,7 +488,7 @@ var Qt = "SelectPopperPosition", we = o.forwardRef((t, r) => {
|
|
|
489
488
|
...d,
|
|
490
489
|
ref: r,
|
|
491
490
|
align: n,
|
|
492
|
-
collisionPadding:
|
|
491
|
+
collisionPadding: a,
|
|
493
492
|
style: {
|
|
494
493
|
// Ensure border-box for floating-ui calculations
|
|
495
494
|
boxSizing: "border-box",
|
|
@@ -503,10 +502,10 @@ var Qt = "SelectPopperPosition", we = o.forwardRef((t, r) => {
|
|
|
503
502
|
}
|
|
504
503
|
);
|
|
505
504
|
});
|
|
506
|
-
we.displayName =
|
|
507
|
-
var [
|
|
505
|
+
we.displayName = Jt;
|
|
506
|
+
var [Qt, Ne] = re(te, {}), ye = "SelectViewport", je = o.forwardRef(
|
|
508
507
|
(t, r) => {
|
|
509
|
-
const { __scopeSelect: e, nonce: n, ...
|
|
508
|
+
const { __scopeSelect: e, nonce: n, ...a } = t, d = X(ye, e), s = Ne(ye, e), l = B(r, d.onViewportChange), i = o.useRef(0);
|
|
510
509
|
return /* @__PURE__ */ j(Ie, { children: [
|
|
511
510
|
/* @__PURE__ */ c(
|
|
512
511
|
"style",
|
|
@@ -522,8 +521,8 @@ var [eo, Ne] = re(te, {}), ye = "SelectViewport", je = o.forwardRef(
|
|
|
522
521
|
{
|
|
523
522
|
"data-radix-select-viewport": "",
|
|
524
523
|
role: "presentation",
|
|
525
|
-
...
|
|
526
|
-
ref:
|
|
524
|
+
...a,
|
|
525
|
+
ref: l,
|
|
527
526
|
style: {
|
|
528
527
|
// we use position: 'relative' here on the `viewport` so that when we call
|
|
529
528
|
// `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
|
|
@@ -535,9 +534,9 @@ var [eo, Ne] = re(te, {}), ye = "SelectViewport", je = o.forwardRef(
|
|
|
535
534
|
// revisit this if/when that is supported
|
|
536
535
|
// https://developer.chrome.com/blog/vertical-form-controls
|
|
537
536
|
overflow: "hidden auto",
|
|
538
|
-
...
|
|
537
|
+
...a.style
|
|
539
538
|
},
|
|
540
|
-
onScroll: N(
|
|
539
|
+
onScroll: N(a.onScroll, (f) => {
|
|
541
540
|
const g = f.currentTarget, { contentWrapper: y, shouldExpandOnScrollRef: P } = s;
|
|
542
541
|
if (P?.current && y) {
|
|
543
542
|
const I = Math.abs(i.current - g.scrollTop);
|
|
@@ -557,44 +556,44 @@ var [eo, Ne] = re(te, {}), ye = "SelectViewport", je = o.forwardRef(
|
|
|
557
556
|
}
|
|
558
557
|
);
|
|
559
558
|
je.displayName = ye;
|
|
560
|
-
var ze = "SelectGroup", [
|
|
559
|
+
var ze = "SelectGroup", [eo, to] = re(ze), Ye = o.forwardRef(
|
|
561
560
|
(t, r) => {
|
|
562
|
-
const { __scopeSelect: e, ...n } = t,
|
|
563
|
-
return /* @__PURE__ */ c(
|
|
561
|
+
const { __scopeSelect: e, ...n } = t, a = Te();
|
|
562
|
+
return /* @__PURE__ */ c(eo, { scope: e, id: a, children: /* @__PURE__ */ c(M.div, { role: "group", "aria-labelledby": a, ...n, ref: r }) });
|
|
564
563
|
}
|
|
565
564
|
);
|
|
566
565
|
Ye.displayName = ze;
|
|
567
566
|
var qe = "SelectLabel", Xe = o.forwardRef(
|
|
568
567
|
(t, r) => {
|
|
569
|
-
const { __scopeSelect: e, ...n } = t,
|
|
570
|
-
return /* @__PURE__ */ c(M.div, { id:
|
|
568
|
+
const { __scopeSelect: e, ...n } = t, a = to(qe, e);
|
|
569
|
+
return /* @__PURE__ */ c(M.div, { id: a.id, ...n, ref: r });
|
|
571
570
|
}
|
|
572
571
|
);
|
|
573
572
|
Xe.displayName = qe;
|
|
574
|
-
var ie = "SelectItem", [
|
|
573
|
+
var ie = "SelectItem", [oo, Ze] = re(ie), Je = o.forwardRef(
|
|
575
574
|
(t, r) => {
|
|
576
575
|
const {
|
|
577
576
|
__scopeSelect: e,
|
|
578
577
|
value: n,
|
|
579
|
-
disabled:
|
|
578
|
+
disabled: a = !1,
|
|
580
579
|
textValue: d,
|
|
581
580
|
...s
|
|
582
|
-
} = t,
|
|
581
|
+
} = t, l = q(ie, e), i = X(ie, e), f = l.value === n, [g, y] = o.useState(d ?? ""), [P, I] = o.useState(!1), x = B(
|
|
583
582
|
r,
|
|
584
|
-
(m) => i.itemRefCallback?.(m, n,
|
|
583
|
+
(m) => i.itemRefCallback?.(m, n, a)
|
|
585
584
|
), p = Te(), h = o.useRef("touch"), S = () => {
|
|
586
|
-
|
|
585
|
+
a || (l.onValueChange(n), l.onOpenChange(!1));
|
|
587
586
|
};
|
|
588
587
|
if (n === "")
|
|
589
588
|
throw new Error(
|
|
590
589
|
"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."
|
|
591
590
|
);
|
|
592
591
|
return /* @__PURE__ */ c(
|
|
593
|
-
|
|
592
|
+
oo,
|
|
594
593
|
{
|
|
595
594
|
scope: e,
|
|
596
595
|
value: n,
|
|
597
|
-
disabled:
|
|
596
|
+
disabled: a,
|
|
598
597
|
textId: p,
|
|
599
598
|
isSelected: f,
|
|
600
599
|
onItemTextChange: o.useCallback((m) => {
|
|
@@ -605,7 +604,7 @@ var ie = "SelectItem", [ro, Ze] = re(ie), Je = o.forwardRef(
|
|
|
605
604
|
{
|
|
606
605
|
scope: e,
|
|
607
606
|
value: n,
|
|
608
|
-
disabled:
|
|
607
|
+
disabled: a,
|
|
609
608
|
textValue: g,
|
|
610
609
|
children: /* @__PURE__ */ c(
|
|
611
610
|
M.div,
|
|
@@ -615,9 +614,9 @@ var ie = "SelectItem", [ro, Ze] = re(ie), Je = o.forwardRef(
|
|
|
615
614
|
"data-highlighted": P ? "" : void 0,
|
|
616
615
|
"aria-selected": f && P,
|
|
617
616
|
"data-state": f ? "checked" : "unchecked",
|
|
618
|
-
"aria-disabled":
|
|
619
|
-
"data-disabled":
|
|
620
|
-
tabIndex:
|
|
617
|
+
"aria-disabled": a || void 0,
|
|
618
|
+
"data-disabled": a ? "" : void 0,
|
|
619
|
+
tabIndex: a ? void 0 : -1,
|
|
621
620
|
...s,
|
|
622
621
|
ref: x,
|
|
623
622
|
onFocus: N(s.onFocus, () => I(!0)),
|
|
@@ -632,13 +631,13 @@ var ie = "SelectItem", [ro, Ze] = re(ie), Je = o.forwardRef(
|
|
|
632
631
|
h.current = m.pointerType;
|
|
633
632
|
}),
|
|
634
633
|
onPointerMove: N(s.onPointerMove, (m) => {
|
|
635
|
-
h.current = m.pointerType,
|
|
634
|
+
h.current = m.pointerType, a ? i.onItemLeave?.() : h.current === "mouse" && m.currentTarget.focus({ preventScroll: !0 });
|
|
636
635
|
}),
|
|
637
636
|
onPointerLeave: N(s.onPointerLeave, (m) => {
|
|
638
637
|
m.currentTarget === document.activeElement && i.onItemLeave?.();
|
|
639
638
|
}),
|
|
640
639
|
onKeyDown: N(s.onKeyDown, (m) => {
|
|
641
|
-
i.searchRef?.current !== "" && m.key === " " || (
|
|
640
|
+
i.searchRef?.current !== "" && m.key === " " || (Ft.includes(m.key) && S(), m.key === " " && m.preventDefault());
|
|
642
641
|
})
|
|
643
642
|
}
|
|
644
643
|
)
|
|
@@ -651,11 +650,11 @@ var ie = "SelectItem", [ro, Ze] = re(ie), Je = o.forwardRef(
|
|
|
651
650
|
Je.displayName = ie;
|
|
652
651
|
var ae = "SelectItemText", Qe = o.forwardRef(
|
|
653
652
|
(t, r) => {
|
|
654
|
-
const { __scopeSelect: e, className: n, style:
|
|
653
|
+
const { __scopeSelect: e, className: n, style: a, ...d } = t, s = q(ae, e), l = X(ae, e), i = Ze(ae, e), f = jt(ae, e), [g, y] = o.useState(null), P = B(
|
|
655
654
|
r,
|
|
656
655
|
(S) => y(S),
|
|
657
656
|
i.onItemTextChange,
|
|
658
|
-
(S) =>
|
|
657
|
+
(S) => l.itemTextRefCallback?.(S, i.value, i.disabled)
|
|
659
658
|
), I = g?.textContent, x = o.useMemo(
|
|
660
659
|
() => /* @__PURE__ */ c("option", { value: i.value, disabled: i.disabled, children: I }, i.value),
|
|
661
660
|
[i.disabled, i.value, I]
|
|
@@ -675,104 +674,104 @@ var et = "SelectItemIndicator", tt = o.forwardRef(
|
|
|
675
674
|
);
|
|
676
675
|
tt.displayName = et;
|
|
677
676
|
var be = "SelectScrollUpButton", ot = o.forwardRef((t, r) => {
|
|
678
|
-
const e = X(be, t.__scopeSelect), n = Ne(be, t.__scopeSelect), [
|
|
677
|
+
const e = X(be, t.__scopeSelect), n = Ne(be, t.__scopeSelect), [a, d] = o.useState(!1), s = B(r, n.onScrollButtonChange);
|
|
679
678
|
return z(() => {
|
|
680
679
|
if (e.viewport && e.isPositioned) {
|
|
681
|
-
let
|
|
680
|
+
let l = function() {
|
|
682
681
|
const f = i.scrollTop > 0;
|
|
683
682
|
d(f);
|
|
684
683
|
};
|
|
685
684
|
const i = e.viewport;
|
|
686
|
-
return
|
|
685
|
+
return l(), i.addEventListener("scroll", l), () => i.removeEventListener("scroll", l);
|
|
687
686
|
}
|
|
688
|
-
}, [e.viewport, e.isPositioned]),
|
|
687
|
+
}, [e.viewport, e.isPositioned]), a ? /* @__PURE__ */ c(
|
|
689
688
|
nt,
|
|
690
689
|
{
|
|
691
690
|
...t,
|
|
692
691
|
ref: s,
|
|
693
692
|
onAutoScroll: () => {
|
|
694
|
-
const { viewport:
|
|
695
|
-
|
|
693
|
+
const { viewport: l, selectedItem: i } = e;
|
|
694
|
+
l && i && (l.scrollTop = l.scrollTop - i.offsetHeight);
|
|
696
695
|
}
|
|
697
696
|
}
|
|
698
697
|
) : null;
|
|
699
698
|
});
|
|
700
699
|
ot.displayName = be;
|
|
701
700
|
var xe = "SelectScrollDownButton", rt = o.forwardRef((t, r) => {
|
|
702
|
-
const e = X(xe, t.__scopeSelect), n = Ne(xe, t.__scopeSelect), [
|
|
701
|
+
const e = X(xe, t.__scopeSelect), n = Ne(xe, t.__scopeSelect), [a, d] = o.useState(!1), s = B(r, n.onScrollButtonChange);
|
|
703
702
|
return z(() => {
|
|
704
703
|
if (e.viewport && e.isPositioned) {
|
|
705
|
-
let
|
|
704
|
+
let l = function() {
|
|
706
705
|
const f = i.scrollHeight - i.clientHeight, g = Math.ceil(i.scrollTop) < f;
|
|
707
706
|
d(g);
|
|
708
707
|
};
|
|
709
708
|
const i = e.viewport;
|
|
710
|
-
return
|
|
709
|
+
return l(), i.addEventListener("scroll", l), () => i.removeEventListener("scroll", l);
|
|
711
710
|
}
|
|
712
|
-
}, [e.viewport, e.isPositioned]),
|
|
711
|
+
}, [e.viewport, e.isPositioned]), a ? /* @__PURE__ */ c(
|
|
713
712
|
nt,
|
|
714
713
|
{
|
|
715
714
|
...t,
|
|
716
715
|
ref: s,
|
|
717
716
|
onAutoScroll: () => {
|
|
718
|
-
const { viewport:
|
|
719
|
-
|
|
717
|
+
const { viewport: l, selectedItem: i } = e;
|
|
718
|
+
l && i && (l.scrollTop = l.scrollTop + i.offsetHeight);
|
|
720
719
|
}
|
|
721
720
|
}
|
|
722
721
|
) : null;
|
|
723
722
|
});
|
|
724
723
|
rt.displayName = xe;
|
|
725
724
|
var nt = o.forwardRef((t, r) => {
|
|
726
|
-
const { __scopeSelect: e, onAutoScroll: n, ...
|
|
725
|
+
const { __scopeSelect: e, onAutoScroll: n, ...a } = t, d = X("SelectScrollButton", e), s = o.useRef(null), l = pe(e), i = o.useCallback(() => {
|
|
727
726
|
s.current !== null && (window.clearInterval(s.current), s.current = null);
|
|
728
727
|
}, []);
|
|
729
728
|
return o.useEffect(() => () => i(), [i]), z(() => {
|
|
730
|
-
|
|
731
|
-
}, [
|
|
729
|
+
l().find((g) => g.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
730
|
+
}, [l]), /* @__PURE__ */ c(
|
|
732
731
|
M.div,
|
|
733
732
|
{
|
|
734
733
|
"aria-hidden": !0,
|
|
735
|
-
...
|
|
734
|
+
...a,
|
|
736
735
|
ref: r,
|
|
737
|
-
style: { flexShrink: 0, ...
|
|
738
|
-
onPointerDown: N(
|
|
736
|
+
style: { flexShrink: 0, ...a.style },
|
|
737
|
+
onPointerDown: N(a.onPointerDown, () => {
|
|
739
738
|
s.current === null && (s.current = window.setInterval(n, 50));
|
|
740
739
|
}),
|
|
741
|
-
onPointerMove: N(
|
|
740
|
+
onPointerMove: N(a.onPointerMove, () => {
|
|
742
741
|
d.onItemLeave?.(), s.current === null && (s.current = window.setInterval(n, 50));
|
|
743
742
|
}),
|
|
744
|
-
onPointerLeave: N(
|
|
743
|
+
onPointerLeave: N(a.onPointerLeave, () => {
|
|
745
744
|
i();
|
|
746
745
|
})
|
|
747
746
|
}
|
|
748
747
|
);
|
|
749
|
-
}),
|
|
748
|
+
}), ro = "SelectSeparator", st = o.forwardRef(
|
|
750
749
|
(t, r) => {
|
|
751
750
|
const { __scopeSelect: e, ...n } = t;
|
|
752
751
|
return /* @__PURE__ */ c(M.div, { "aria-hidden": !0, ...n, ref: r });
|
|
753
752
|
}
|
|
754
753
|
);
|
|
755
|
-
st.displayName =
|
|
756
|
-
var Ce = "SelectArrow",
|
|
754
|
+
st.displayName = ro;
|
|
755
|
+
var Ce = "SelectArrow", no = o.forwardRef(
|
|
757
756
|
(t, r) => {
|
|
758
|
-
const { __scopeSelect: e, ...n } = t,
|
|
759
|
-
return d.open && s.position === "popper" ? /* @__PURE__ */ c(Mt, { ...
|
|
757
|
+
const { __scopeSelect: e, ...n } = t, a = ue(e), d = q(Ce, e), s = X(Ce, e);
|
|
758
|
+
return d.open && s.position === "popper" ? /* @__PURE__ */ c(Mt, { ...a, ...n, ref: r }) : null;
|
|
760
759
|
}
|
|
761
760
|
);
|
|
762
|
-
|
|
763
|
-
var
|
|
761
|
+
no.displayName = Ce;
|
|
762
|
+
var so = "SelectBubbleInput", at = o.forwardRef(
|
|
764
763
|
({ __scopeSelect: t, value: r, ...e }, n) => {
|
|
765
|
-
const
|
|
764
|
+
const a = o.useRef(null), d = B(n, a), s = Ot(r);
|
|
766
765
|
return o.useEffect(() => {
|
|
767
|
-
const
|
|
768
|
-
if (!
|
|
766
|
+
const l = a.current;
|
|
767
|
+
if (!l) return;
|
|
769
768
|
const i = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
|
|
770
769
|
i,
|
|
771
770
|
"value"
|
|
772
771
|
).set;
|
|
773
772
|
if (s !== r && g) {
|
|
774
773
|
const y = new Event("change", { bubbles: !0 });
|
|
775
|
-
g.call(
|
|
774
|
+
g.call(l, r), l.dispatchEvent(y);
|
|
776
775
|
}
|
|
777
776
|
}, [s, r]), /* @__PURE__ */ c(
|
|
778
777
|
M.select,
|
|
@@ -785,45 +784,45 @@ var ao = "SelectBubbleInput", at = o.forwardRef(
|
|
|
785
784
|
);
|
|
786
785
|
}
|
|
787
786
|
);
|
|
788
|
-
at.displayName =
|
|
787
|
+
at.displayName = so;
|
|
789
788
|
function lt(t) {
|
|
790
789
|
return t === "" || t === void 0;
|
|
791
790
|
}
|
|
792
791
|
function ct(t) {
|
|
793
|
-
const r = At(t), e = o.useRef(""), n = o.useRef(0),
|
|
792
|
+
const r = At(t), e = o.useRef(""), n = o.useRef(0), a = o.useCallback(
|
|
794
793
|
(s) => {
|
|
795
|
-
const
|
|
796
|
-
r(
|
|
794
|
+
const l = e.current + s;
|
|
795
|
+
r(l), function i(f) {
|
|
797
796
|
e.current = f, window.clearTimeout(n.current), f !== "" && (n.current = window.setTimeout(() => i(""), 1e3));
|
|
798
|
-
}(
|
|
797
|
+
}(l);
|
|
799
798
|
},
|
|
800
799
|
[r]
|
|
801
800
|
), d = o.useCallback(() => {
|
|
802
801
|
e.current = "", window.clearTimeout(n.current);
|
|
803
802
|
}, []);
|
|
804
|
-
return o.useEffect(() => () => window.clearTimeout(n.current), []), [e,
|
|
803
|
+
return o.useEffect(() => () => window.clearTimeout(n.current), []), [e, a, d];
|
|
805
804
|
}
|
|
806
805
|
function it(t, r, e) {
|
|
807
|
-
const
|
|
808
|
-
let s =
|
|
809
|
-
|
|
806
|
+
const a = r.length > 1 && Array.from(r).every((f) => f === r[0]) ? r[0] : r, d = e ? t.indexOf(e) : -1;
|
|
807
|
+
let s = ao(t, Math.max(d, 0));
|
|
808
|
+
a.length === 1 && (s = s.filter((f) => f !== e));
|
|
810
809
|
const i = s.find(
|
|
811
|
-
(f) => f.textValue.toLowerCase().startsWith(
|
|
810
|
+
(f) => f.textValue.toLowerCase().startsWith(a.toLowerCase())
|
|
812
811
|
);
|
|
813
812
|
return i !== e ? i : void 0;
|
|
814
813
|
}
|
|
815
|
-
function
|
|
814
|
+
function ao(t, r) {
|
|
816
815
|
return t.map((e, n) => t[(r + n) % t.length]);
|
|
817
816
|
}
|
|
818
|
-
var
|
|
819
|
-
const
|
|
817
|
+
var lo = Le, dt = ke, co = He, io = Ue, po = We, pt = Fe, uo = je, fo = Ye, ut = Xe, Pe = Je, Re = Qe, Ee = tt, ft = ot, mt = rt, ht = st;
|
|
818
|
+
const mo = Y({
|
|
820
819
|
base: [
|
|
821
820
|
"inline-flex aspect-square cursor-pointer select-none items-center justify-center overflow-hidden rounded-lg bg-transparent p-2.5 text-muted transition-all",
|
|
822
821
|
"hover:text-primary-fg focus-visible:shadow-focus focus-visible:outline-hidden"
|
|
823
822
|
]
|
|
824
|
-
}), vt = ({ className: t, icon: r =
|
|
823
|
+
}), vt = ({ className: t, icon: r = Vt, ...e }) => /* @__PURE__ */ c("span", { role: "button", tabIndex: 0, className: mo({ className: t }), ...e, children: /* @__PURE__ */ c(kt, { icon: r }) });
|
|
825
824
|
vt.displayName = "ClearButton";
|
|
826
|
-
const
|
|
825
|
+
const ho = ({ onClear: t, ...r }) => /* @__PURE__ */ c(
|
|
827
826
|
vt,
|
|
828
827
|
{
|
|
829
828
|
onPointerDown: (e) => {
|
|
@@ -837,7 +836,7 @@ const vo = ({ onClear: t, ...r }) => /* @__PURE__ */ c(
|
|
|
837
836
|
},
|
|
838
837
|
...r
|
|
839
838
|
}
|
|
840
|
-
),
|
|
839
|
+
), or = lo, rr = fo, nr = co, vo = Y({
|
|
841
840
|
base: [
|
|
842
841
|
"group flex h-10 w-full items-center whitespace-nowrap rounded-lg border border-secondary-border bg-secondary-bg py-2.5 pl-3 pr-2.5 font-sans shadow-soft-sm outline-hidden lg:h-9 lg:py-2",
|
|
843
842
|
"text-sm text-primary-fg",
|
|
@@ -864,46 +863,46 @@ const vo = ({ onClear: t, ...r }) => /* @__PURE__ */ c(
|
|
|
864
863
|
}
|
|
865
864
|
}
|
|
866
865
|
}
|
|
867
|
-
}),
|
|
868
|
-
({ className: t, children: r, onClear: e, disabled: n, invalid:
|
|
869
|
-
const
|
|
870
|
-
return /* @__PURE__ */ j(dt, { ref: s, className:
|
|
866
|
+
}), go = o.forwardRef(
|
|
867
|
+
({ className: t, children: r, onClear: e, disabled: n, invalid: a, ...d }, s) => {
|
|
868
|
+
const l = vo({ invalid: a, disabled: n });
|
|
869
|
+
return /* @__PURE__ */ j(dt, { ref: s, className: l.base({ className: t }), disabled: n, ...d, children: [
|
|
871
870
|
r,
|
|
872
|
-
/* @__PURE__ */ j("div", { className:
|
|
871
|
+
/* @__PURE__ */ j("div", { className: l.iconWrapper(), children: [
|
|
873
872
|
!n && e && /* @__PURE__ */ c(
|
|
874
|
-
|
|
873
|
+
ho,
|
|
875
874
|
{
|
|
876
875
|
onClear: e,
|
|
877
876
|
className: "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100"
|
|
878
877
|
}
|
|
879
878
|
),
|
|
880
|
-
/* @__PURE__ */ c(
|
|
879
|
+
/* @__PURE__ */ c(io, { asChild: !0, children: /* @__PURE__ */ c(De, { className: l.icon() }) })
|
|
881
880
|
] })
|
|
882
881
|
] });
|
|
883
882
|
}
|
|
884
883
|
);
|
|
885
|
-
|
|
886
|
-
const
|
|
884
|
+
go.displayName = dt.displayName;
|
|
885
|
+
const So = Y({
|
|
887
886
|
base: ["flex cursor-default items-center justify-center py-1"],
|
|
888
887
|
slots: {
|
|
889
888
|
icon: "h-4 w-4"
|
|
890
889
|
}
|
|
891
890
|
}), gt = o.forwardRef(({ className: t, ...r }, e) => {
|
|
892
|
-
const n =
|
|
893
|
-
return /* @__PURE__ */ c(ft, { ref: e, className: n.base({ className: t }), ...r, children: /* @__PURE__ */ c(
|
|
891
|
+
const n = So();
|
|
892
|
+
return /* @__PURE__ */ c(ft, { ref: e, className: n.base({ className: t }), ...r, children: /* @__PURE__ */ c(Ut, { className: n.icon() }) });
|
|
894
893
|
});
|
|
895
894
|
gt.displayName = ft.displayName;
|
|
896
|
-
const
|
|
895
|
+
const wo = Y({
|
|
897
896
|
base: ["flex cursor-default items-center justify-center py-1"],
|
|
898
897
|
slots: {
|
|
899
898
|
icon: "h-4 w-4"
|
|
900
899
|
}
|
|
901
900
|
}), St = o.forwardRef(({ className: t, ...r }, e) => {
|
|
902
|
-
const n =
|
|
901
|
+
const n = wo();
|
|
903
902
|
return /* @__PURE__ */ c(mt, { ref: e, className: n.base({ className: t }), ...r, children: /* @__PURE__ */ c(De, { className: n.icon() }) });
|
|
904
903
|
});
|
|
905
904
|
St.displayName = mt.displayName;
|
|
906
|
-
const
|
|
905
|
+
const yo = Y({
|
|
907
906
|
base: [
|
|
908
907
|
"relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-lg",
|
|
909
908
|
"border border-secondary-border bg-secondary-bg text-primary-fg shadow-soft-sm",
|
|
@@ -922,59 +921,59 @@ const bo = Y({
|
|
|
922
921
|
"item-aligned": ""
|
|
923
922
|
}
|
|
924
923
|
}
|
|
925
|
-
}),
|
|
926
|
-
const s =
|
|
927
|
-
return /* @__PURE__ */ c(
|
|
924
|
+
}), bo = o.forwardRef(({ className: t, children: r, position: e = "popper", portalContainer: n, ...a }, d) => {
|
|
925
|
+
const s = yo({ position: e });
|
|
926
|
+
return /* @__PURE__ */ c(po, { container: n, children: /* @__PURE__ */ j(pt, { ref: d, className: s.base({ className: t }), position: e, ...a, children: [
|
|
928
927
|
/* @__PURE__ */ c(gt, {}),
|
|
929
|
-
/* @__PURE__ */ c(
|
|
928
|
+
/* @__PURE__ */ c(uo, { className: s.viewport(), children: r }),
|
|
930
929
|
/* @__PURE__ */ c(St, {})
|
|
931
930
|
] }) });
|
|
932
931
|
});
|
|
933
|
-
|
|
934
|
-
const
|
|
932
|
+
bo.displayName = pt.displayName;
|
|
933
|
+
const xo = Y({
|
|
935
934
|
base: ["overflow-hidden text-ellipsis px-2 py-1.5 text-xs font-normal text-muted"]
|
|
936
|
-
}),
|
|
937
|
-
|
|
938
|
-
const
|
|
939
|
-
extend:
|
|
935
|
+
}), Co = o.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ c(ut, { ref: e, className: xo({ className: t }), ...r }));
|
|
936
|
+
Co.displayName = ut.displayName;
|
|
937
|
+
const Io = Y({
|
|
938
|
+
extend: Bt,
|
|
940
939
|
base: "",
|
|
941
940
|
slots: {
|
|
942
941
|
indicator: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
943
942
|
indicatorIcon: "h-4 w-4"
|
|
944
943
|
}
|
|
945
|
-
}),
|
|
946
|
-
const d =
|
|
947
|
-
return /* @__PURE__ */ j(Pe, { ref:
|
|
948
|
-
/* @__PURE__ */ c("span", { className: d.indicator(), children: /* @__PURE__ */ c(Ee, { children: /* @__PURE__ */ c(
|
|
944
|
+
}), To = o.forwardRef(({ className: t, children: r, disabled: e, ...n }, a) => {
|
|
945
|
+
const d = Io({ disabled: e });
|
|
946
|
+
return /* @__PURE__ */ j(Pe, { ref: a, disabled: e, className: d.base({ className: t }), ...n, children: [
|
|
947
|
+
/* @__PURE__ */ c("span", { className: d.indicator(), children: /* @__PURE__ */ c(Ee, { children: /* @__PURE__ */ c(Ht, { className: d.indicatorIcon() }) }) }),
|
|
949
948
|
/* @__PURE__ */ c(Re, { children: r })
|
|
950
949
|
] });
|
|
951
950
|
});
|
|
952
|
-
|
|
953
|
-
const
|
|
951
|
+
To.displayName = Pe.displayName;
|
|
952
|
+
const No = Y({
|
|
954
953
|
base: ["-mx-1 my-1 h-px bg-secondary-border"]
|
|
955
|
-
}),
|
|
956
|
-
|
|
957
|
-
const
|
|
958
|
-
|
|
959
|
-
const
|
|
960
|
-
|
|
961
|
-
const
|
|
962
|
-
|
|
954
|
+
}), Po = o.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ c(ht, { ref: e, className: No({ className: t }), ...r }));
|
|
955
|
+
Po.displayName = ht.displayName;
|
|
956
|
+
const Ro = Pe;
|
|
957
|
+
Ro.displayName = "SelectOption";
|
|
958
|
+
const Eo = Re;
|
|
959
|
+
Eo.displayName = Re.displayName;
|
|
960
|
+
const _o = Ee;
|
|
961
|
+
_o.displayName = Ee.displayName;
|
|
963
962
|
export {
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
963
|
+
or as S,
|
|
964
|
+
rr as a,
|
|
965
|
+
nr as b,
|
|
966
|
+
go as c,
|
|
967
|
+
bo as d,
|
|
968
|
+
Co as e,
|
|
969
|
+
To as f,
|
|
970
|
+
Po as g,
|
|
972
971
|
gt as h,
|
|
973
972
|
St as i,
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
973
|
+
Ro as j,
|
|
974
|
+
Eo as k,
|
|
975
|
+
_o as l,
|
|
976
|
+
ho as m,
|
|
977
|
+
vo as s
|
|
979
978
|
};
|
|
980
|
-
//# sourceMappingURL=Select-
|
|
979
|
+
//# sourceMappingURL=Select-DO02vXt3.js.map
|