ics-ui-kit 0.1.0-alpha.47 → 0.1.0-alpha.49
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 +32 -32
- package/dist/AlertContext-CxjW1LVL.js.map +1 -1
- package/dist/AlertIcon-DQs4wtDT.js.map +1 -1
- package/dist/Button--ooZ8ALo.js.map +1 -1
- package/dist/ButtonBase-Sf-fcVor.js.map +1 -1
- package/dist/CarouselItem-DCAuGIKz.js.map +1 -1
- package/dist/{CheckboxField-DvsGq3kV.js → CheckboxField-BR2hWwTO.js} +2 -2
- package/dist/CheckboxField-BR2hWwTO.js.map +1 -0
- package/dist/{Command-BU9Ouar3.js → Command-C_iW2joV.js} +2 -2
- package/dist/Command-C_iW2joV.js.map +1 -0
- package/dist/ComponentVariantProvider-B0SFUaXB.js.map +1 -1
- package/dist/Description-BTPMlTT-.js.map +1 -1
- package/dist/Dialog-CkDUxZUj.js.map +1 -1
- package/dist/Divider-Dm2gjy8W.js.map +1 -1
- package/dist/EmptyState-DRKjscH-.js.map +1 -1
- package/dist/ErrorState-B26k67-z.js.map +1 -1
- package/dist/FeatureIcon-yM7FhAXa.js.map +1 -1
- package/dist/{Field-CdocNMjg.js → Field-DpbrZvvg.js} +2 -2
- package/dist/Field-DpbrZvvg.js.map +1 -0
- package/dist/{FieldLabel-DRwAhGMz.js → FieldLabel-saPDMPPr.js} +2 -2
- package/dist/FieldLabel-saPDMPPr.js.map +1 -0
- package/dist/FolderSvg-cw0DxNVy.js.map +1 -1
- package/dist/{FormFooterTemplate-1MNxzQ7J.js → FormFooterTemplate-DV4pN3b-.js} +2 -2
- package/dist/FormFooterTemplate-DV4pN3b-.js.map +1 -0
- package/dist/FormHeader-BA2dJOPS.js.map +1 -1
- package/dist/{FormStack-DbtLshF8.js → FormStack-D-0fK-Zy.js} +3 -3
- package/dist/FormStack-D-0fK-Zy.js.map +1 -0
- package/dist/HintState-BxrCAWqq.js.map +1 -1
- package/dist/Icon-DH3ev9GK.js.map +1 -1
- package/dist/IconButton-moydR8IU.js.map +1 -1
- package/dist/{IconTooltip-CibXkFmt.js → IconTooltip-BbswlF6Q.js} +3 -3
- package/dist/IconTooltip-BbswlF6Q.js.map +1 -0
- package/dist/ImagePlaceholder-B6mGYVx2.js.map +1 -1
- package/dist/ImagePreview-BIBDrLVV.js.map +1 -1
- package/dist/ImageUploader-C-_ZPptv.js.map +1 -1
- package/dist/Indicator-B75A1Vgp.js.map +1 -1
- package/dist/InputGroup-CmstXpkX.js.map +1 -1
- package/dist/InputOTP-B2e1nfSO.js.map +1 -1
- package/dist/Loader-BpHiL6W-.js.map +1 -1
- package/dist/MenuItem-pvsONHlh.js.map +1 -1
- package/dist/{MenuItemShortcut-CGbVYqRi.js → MenuItemShortcut-DK7VneTR.js} +2 -2
- package/dist/MenuItemShortcut-DK7VneTR.js.map +1 -0
- package/dist/MenuItemText-7uPl9P3z.js.map +1 -1
- package/dist/Overlay-CLw_hvAN.js.map +1 -1
- package/dist/{Popover-CkezMtEz.js → Popover-DmwXZwYd.js} +17 -17
- package/dist/Popover-DmwXZwYd.js.map +1 -0
- package/dist/RichButton-BuenN3bJ.js.map +1 -1
- package/dist/ScrollShadowContainer-ODG9ChxA.js.map +1 -1
- package/dist/{SearchSelectTag-D1bFK1ux.js → SearchSelectTag-Ce-Q9JGR.js} +2 -2
- package/dist/SearchSelectTag-Ce-Q9JGR.js.map +1 -0
- package/dist/{Select-Bfrb-J8s.js → Select-CWbLja8r.js} +195 -195
- package/dist/Select-CWbLja8r.js.map +1 -0
- package/dist/Sheet-Dx9mwcF6.js.map +1 -1
- package/dist/Shortcut-D8L15_ed.js +22 -0
- package/dist/Shortcut-D8L15_ed.js.map +1 -0
- package/dist/Skeleton-y6I-i9q5.js.map +1 -1
- package/dist/{Tag-DJuVSJh5.js → Tag-CofZF1d0.js} +6 -6
- package/dist/Tag-CofZF1d0.js.map +1 -0
- package/dist/Text-DeBE8AKl.js.map +1 -1
- package/dist/TextInput-DTzujp77.js.map +1 -1
- package/dist/{Toggle-CS29Nksd.js → Toggle-CCD2UHWr.js} +15 -13
- package/dist/Toggle-CCD2UHWr.js.map +1 -0
- package/dist/{Tooltip-Cm1-WEdA.js → Tooltip-BH_Jc6ub.js} +2 -2
- package/dist/Tooltip-BH_Jc6ub.js.map +1 -0
- package/dist/TriggerButton-a2ClSj7f.js +33 -0
- package/dist/TriggerButton-a2ClSj7f.js.map +1 -0
- package/dist/blocks/auth/otp-form.js +1 -1
- package/dist/blocks/auth/otp-form.js.map +1 -1
- package/dist/cn-dsXlqdJg.js.map +1 -1
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.js.map +1 -1
- package/dist/components/avatar/Avatar.d.ts +1 -1
- package/dist/components/avatar/avatar-indicator/AvatarIndicator.d.ts +3 -1
- package/dist/components/avatar/avatar-label/AvatarLabel.d.ts +1 -1
- package/dist/components/avatar.js +110 -93
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.js.map +1 -1
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/color-tile.js.map +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/container.js.map +1 -1
- package/dist/components/counter.js.map +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/divider.js.map +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown.js +2 -2
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/error-state.js.map +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/file-upload.js.map +1 -1
- package/dist/components/form.js +3 -3
- package/dist/components/form.js.map +1 -1
- package/dist/components/gallery.js.map +1 -1
- package/dist/components/icon-tooltip.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/menu-item.js +1 -1
- package/dist/components/menu-item.js.map +1 -1
- package/dist/components/overflow-tooltip.js +1 -1
- package/dist/components/overflow-tooltip.js.map +1 -1
- package/dist/components/page-state.js.map +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/portal-container.js.map +1 -1
- package/dist/components/progress-circle.js.map +1 -1
- package/dist/components/progress.js.map +1 -1
- package/dist/components/prose.js.map +1 -1
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/scheduler.js +1 -1
- package/dist/components/scheduler.js.map +1 -1
- package/dist/components/search-select.js +4 -4
- package/dist/components/search-select.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/shortcut.js +1 -1
- package/dist/components/sidebar.js +71 -68
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/slider.js.map +1 -1
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/switch.js.map +1 -1
- package/dist/components/system-state.js.map +1 -1
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tag-input.js +2 -2
- package/dist/components/tag-input.js.map +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toggle/Toggle.d.ts +8 -2
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/components/toolbar.js.map +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/downloadFile-yZV-aaO2.js.map +1 -1
- package/dist/font-inter.css +15 -15
- package/dist/font-menlo.css +15 -15
- package/dist/index-0ioNhtNM.js.map +1 -1
- package/dist/index-5Bhkapwi.js.map +1 -1
- package/dist/index-BGQepRFJ.js.map +1 -1
- package/dist/index-BGfrl8IX.js.map +1 -1
- package/dist/index-BNirMMl4.js.map +1 -1
- package/dist/index-BVqs-uqP.js.map +1 -1
- package/dist/index-BZPx6jYI.js.map +1 -1
- package/dist/index-BdXokVmb.js.map +1 -1
- package/dist/index-Bwf2hSw6.js.map +1 -1
- package/dist/index-C0UREtMP.js.map +1 -1
- package/dist/index-C3surxzg.js.map +1 -1
- package/dist/index-CCKe-Mpx.js.map +1 -1
- package/dist/index-CpDnqHCm.js.map +1 -1
- package/dist/index-DFZozV_h.js.map +1 -1
- package/dist/index-DG36Jang.js.map +1 -1
- package/dist/index-DfNPZZ8M.js.map +1 -1
- package/dist/index-DpXwz_9G.js.map +1 -1
- package/dist/index-Nzc5v6h6.js.map +1 -1
- package/dist/index-l1F44JQJ.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/inputBaseStyles-BZJgQP7O.js.map +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/styles-scoped.css +5846 -5832
- package/dist/styles.css +1949 -1935
- package/dist/types/css.d.ts +4 -4
- package/dist/useBreakpoints-wEcfJPHd.js.map +1 -1
- package/dist/useDebounce-BRah78CF.js.map +1 -1
- package/dist/useFileUpload-iDag0iqM.js.map +1 -1
- package/dist/useMergeRefs-qoKniYqT.js.map +1 -1
- package/dist/usePortalContainer-ae6EzS08.js.map +1 -1
- package/dist/vendors/tanstack/react-table.js.map +1 -1
- package/dist/zod-BMNoK3aM.js.map +1 -1
- package/package.json +172 -172
- package/dist/CheckboxField-DvsGq3kV.js.map +0 -1
- package/dist/Command-BU9Ouar3.js.map +0 -1
- package/dist/Field-CdocNMjg.js.map +0 -1
- package/dist/FieldLabel-DRwAhGMz.js.map +0 -1
- package/dist/FormFooterTemplate-1MNxzQ7J.js.map +0 -1
- package/dist/FormStack-DbtLshF8.js.map +0 -1
- package/dist/IconTooltip-CibXkFmt.js.map +0 -1
- package/dist/MenuItemShortcut-CGbVYqRi.js.map +0 -1
- package/dist/Popover-CkezMtEz.js.map +0 -1
- package/dist/SearchSelectTag-D1bFK1ux.js.map +0 -1
- package/dist/Select-Bfrb-J8s.js.map +0 -1
- package/dist/Shortcut-Cm4nUx2C.js +0 -22
- package/dist/Shortcut-Cm4nUx2C.js.map +0 -1
- package/dist/Tag-DJuVSJh5.js.map +0 -1
- package/dist/Toggle-CS29Nksd.js.map +0 -1
- package/dist/Tooltip-Cm1-WEdA.js.map +0 -1
- package/dist/TriggerButton-BzXO5wcQ.js +0 -33
- package/dist/TriggerButton-BzXO5wcQ.js.map +0 -1
- package/dist/design-tokens.source.json +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i, jsxs as z, Fragment as Ie } from "react/jsx-runtime";
|
|
2
2
|
import * as o from "react";
|
|
3
3
|
import * as Ae from "react-dom";
|
|
4
4
|
import { c as _e } from "./index-rKs9bXHr.js";
|
|
@@ -30,12 +30,12 @@ var Ft = [" ", "Enter", "ArrowUp", "ArrowDown"], Kt = [" ", "Enter"], Q = "Selec
|
|
|
30
30
|
const {
|
|
31
31
|
__scopeSelect: r,
|
|
32
32
|
children: e,
|
|
33
|
-
open:
|
|
33
|
+
open: n,
|
|
34
34
|
defaultOpen: l,
|
|
35
35
|
onOpenChange: d,
|
|
36
|
-
value:
|
|
37
|
-
defaultValue:
|
|
38
|
-
onValueChange:
|
|
36
|
+
value: s,
|
|
37
|
+
defaultValue: a,
|
|
38
|
+
onValueChange: c,
|
|
39
39
|
dir: f,
|
|
40
40
|
name: g,
|
|
41
41
|
autoComplete: y,
|
|
@@ -43,17 +43,17 @@ var Ft = [" ", "Enter", "ArrowUp", "ArrowDown"], Kt = [" ", "Enter"], Q = "Selec
|
|
|
43
43
|
required: I,
|
|
44
44
|
form: x
|
|
45
45
|
} = t, p = ue(r), [h, S] = o.useState(null), [m, v] = o.useState(null), [F, A] = o.useState(!1), ne = wt(f), [R, O] = Me({
|
|
46
|
-
prop:
|
|
46
|
+
prop: n,
|
|
47
47
|
defaultProp: l ?? !1,
|
|
48
48
|
onChange: d,
|
|
49
49
|
caller: Q
|
|
50
50
|
}), [K, X] = Me({
|
|
51
|
-
prop:
|
|
52
|
-
defaultProp:
|
|
53
|
-
onChange:
|
|
51
|
+
prop: s,
|
|
52
|
+
defaultProp: a,
|
|
53
|
+
onChange: c,
|
|
54
54
|
caller: Q
|
|
55
55
|
}), 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(";");
|
|
56
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ i(Et, { ...p, children: /* @__PURE__ */ z(
|
|
57
57
|
Gt,
|
|
58
58
|
{
|
|
59
59
|
required: I,
|
|
@@ -73,7 +73,7 @@ var Ft = [" ", "Enter", "ArrowUp", "ArrowDown"], Kt = [" ", "Enter"], Q = "Selec
|
|
|
73
73
|
triggerPointerDownPosRef: k,
|
|
74
74
|
disabled: P,
|
|
75
75
|
children: [
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ i(de.Provider, { scope: r, children: /* @__PURE__ */ i(
|
|
77
77
|
zt,
|
|
78
78
|
{
|
|
79
79
|
scope: t.__scopeSelect,
|
|
@@ -102,7 +102,7 @@ var Ft = [" ", "Enter", "ArrowUp", "ArrowDown"], Kt = [" ", "Enter"], Q = "Selec
|
|
|
102
102
|
disabled: P,
|
|
103
103
|
form: x,
|
|
104
104
|
children: [
|
|
105
|
-
K === void 0 ? /* @__PURE__ */
|
|
105
|
+
K === void 0 ? /* @__PURE__ */ i("option", { value: "" }) : null,
|
|
106
106
|
Array.from($)
|
|
107
107
|
]
|
|
108
108
|
},
|
|
@@ -115,31 +115,31 @@ var Ft = [" ", "Enter", "ArrowUp", "ArrowDown"], Kt = [" ", "Enter"], Q = "Selec
|
|
|
115
115
|
Le.displayName = Q;
|
|
116
116
|
var Be = "SelectTrigger", ke = o.forwardRef(
|
|
117
117
|
(t, r) => {
|
|
118
|
-
const { __scopeSelect: e, disabled:
|
|
119
|
-
const h = f().filter((v) => !v.disabled), S = h.find((v) => v.value ===
|
|
120
|
-
m !== void 0 &&
|
|
118
|
+
const { __scopeSelect: e, disabled: n = !1, ...l } = t, d = ue(e), s = Y(Be, e), a = s.disabled || n, c = B(r, s.onTriggerChange), f = pe(e), g = o.useRef("touch"), [y, P, I] = ct((p) => {
|
|
119
|
+
const h = f().filter((v) => !v.disabled), S = h.find((v) => v.value === s.value), m = it(h, p, S);
|
|
120
|
+
m !== void 0 && s.onValueChange(m.value);
|
|
121
121
|
}), x = (p) => {
|
|
122
|
-
|
|
122
|
+
a || (s.onOpenChange(!0), I()), p && (s.triggerPointerDownPosRef.current = {
|
|
123
123
|
x: Math.round(p.pageX),
|
|
124
124
|
y: Math.round(p.pageY)
|
|
125
125
|
});
|
|
126
126
|
};
|
|
127
|
-
return /* @__PURE__ */
|
|
127
|
+
return /* @__PURE__ */ i(_t, { asChild: !0, ...d, children: /* @__PURE__ */ i(
|
|
128
128
|
M.button,
|
|
129
129
|
{
|
|
130
130
|
type: "button",
|
|
131
131
|
role: "combobox",
|
|
132
|
-
"aria-controls":
|
|
133
|
-
"aria-expanded":
|
|
134
|
-
"aria-required":
|
|
132
|
+
"aria-controls": s.contentId,
|
|
133
|
+
"aria-expanded": s.open,
|
|
134
|
+
"aria-required": s.required,
|
|
135
135
|
"aria-autocomplete": "none",
|
|
136
|
-
dir:
|
|
137
|
-
"data-state":
|
|
138
|
-
disabled:
|
|
139
|
-
"data-disabled":
|
|
140
|
-
"data-placeholder": lt(
|
|
136
|
+
dir: s.dir,
|
|
137
|
+
"data-state": s.open ? "open" : "closed",
|
|
138
|
+
disabled: a,
|
|
139
|
+
"data-disabled": a ? "" : void 0,
|
|
140
|
+
"data-placeholder": lt(s.value) ? "" : void 0,
|
|
141
141
|
...l,
|
|
142
|
-
ref:
|
|
142
|
+
ref: c,
|
|
143
143
|
onClick: N(l.onClick, (p) => {
|
|
144
144
|
p.currentTarget.focus(), g.current !== "mouse" && x(p);
|
|
145
145
|
}),
|
|
@@ -159,16 +159,16 @@ var Be = "SelectTrigger", ke = o.forwardRef(
|
|
|
159
159
|
ke.displayName = Be;
|
|
160
160
|
var Ve = "SelectValue", He = o.forwardRef(
|
|
161
161
|
(t, r) => {
|
|
162
|
-
const { __scopeSelect: e, className:
|
|
162
|
+
const { __scopeSelect: e, className: n, style: l, children: d, placeholder: s = "", ...a } = t, c = Y(Ve, e), { onValueNodeHasChildrenChange: f } = c, g = d !== void 0, y = B(r, c.onValueNodeChange);
|
|
163
163
|
return j(() => {
|
|
164
164
|
f(g);
|
|
165
|
-
}, [f, g]), /* @__PURE__ */
|
|
165
|
+
}, [f, g]), /* @__PURE__ */ i(
|
|
166
166
|
M.span,
|
|
167
167
|
{
|
|
168
|
-
...
|
|
168
|
+
...a,
|
|
169
169
|
ref: y,
|
|
170
170
|
style: { pointerEvents: "none" },
|
|
171
|
-
children: lt(
|
|
171
|
+
children: lt(c.value) ? /* @__PURE__ */ i(Ie, { children: s }) : d
|
|
172
172
|
}
|
|
173
173
|
);
|
|
174
174
|
}
|
|
@@ -176,26 +176,26 @@ var Ve = "SelectValue", He = o.forwardRef(
|
|
|
176
176
|
He.displayName = Ve;
|
|
177
177
|
var Yt = "SelectIcon", Ue = o.forwardRef(
|
|
178
178
|
(t, r) => {
|
|
179
|
-
const { __scopeSelect: e, children:
|
|
180
|
-
return /* @__PURE__ */
|
|
179
|
+
const { __scopeSelect: e, children: n, ...l } = t;
|
|
180
|
+
return /* @__PURE__ */ i(M.span, { "aria-hidden": !0, ...l, ref: r, children: n || "▼" });
|
|
181
181
|
}
|
|
182
182
|
);
|
|
183
183
|
Ue.displayName = Yt;
|
|
184
|
-
var qt = "SelectPortal", We = (t) => /* @__PURE__ */
|
|
184
|
+
var qt = "SelectPortal", We = (t) => /* @__PURE__ */ i(Ct, { asChild: !0, ...t });
|
|
185
185
|
We.displayName = qt;
|
|
186
186
|
var ee = "SelectContent", Fe = o.forwardRef(
|
|
187
187
|
(t, r) => {
|
|
188
|
-
const e = Y(ee, t.__scopeSelect), [
|
|
188
|
+
const e = Y(ee, t.__scopeSelect), [n, l] = o.useState();
|
|
189
189
|
if (j(() => {
|
|
190
190
|
l(new DocumentFragment());
|
|
191
191
|
}, []), !e.open) {
|
|
192
|
-
const d =
|
|
192
|
+
const d = n;
|
|
193
193
|
return d ? Ae.createPortal(
|
|
194
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ i(Ke, { scope: t.__scopeSelect, children: /* @__PURE__ */ i(de.Slot, { scope: t.__scopeSelect, children: /* @__PURE__ */ i("div", { children: t.children }) }) }),
|
|
195
195
|
d
|
|
196
196
|
) : null;
|
|
197
197
|
}
|
|
198
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ i($e, { ...t, ref: r });
|
|
199
199
|
}
|
|
200
200
|
);
|
|
201
201
|
Fe.displayName = ee;
|
|
@@ -203,14 +203,14 @@ var D = 10, [Ke, q] = re(ee), Xt = "SelectContentImpl", Zt = bt("SelectContent.R
|
|
|
203
203
|
(t, r) => {
|
|
204
204
|
const {
|
|
205
205
|
__scopeSelect: e,
|
|
206
|
-
position:
|
|
206
|
+
position: n = "item-aligned",
|
|
207
207
|
onCloseAutoFocus: l,
|
|
208
208
|
onEscapeKeyDown: d,
|
|
209
|
-
onPointerDownOutside:
|
|
209
|
+
onPointerDownOutside: s,
|
|
210
210
|
//
|
|
211
211
|
// PopperContent props
|
|
212
|
-
side:
|
|
213
|
-
sideOffset:
|
|
212
|
+
side: a,
|
|
213
|
+
sideOffset: c,
|
|
214
214
|
align: f,
|
|
215
215
|
alignOffset: g,
|
|
216
216
|
arrowPadding: y,
|
|
@@ -278,9 +278,9 @@ var D = 10, [Ke, q] = re(ee), Xt = "SelectContentImpl", Zt = bt("SelectContent.R
|
|
|
278
278
|
(m.value !== void 0 && m.value === C || w) && k(u);
|
|
279
279
|
},
|
|
280
280
|
[m.value]
|
|
281
|
-
), ce =
|
|
282
|
-
side:
|
|
283
|
-
sideOffset:
|
|
281
|
+
), ce = n === "popper" ? we : Ge, se = ce === we ? {
|
|
282
|
+
side: a,
|
|
283
|
+
sideOffset: c,
|
|
284
284
|
align: f,
|
|
285
285
|
alignOffset: g,
|
|
286
286
|
arrowPadding: y,
|
|
@@ -290,7 +290,7 @@ var D = 10, [Ke, q] = re(ee), Xt = "SelectContentImpl", Zt = bt("SelectContent.R
|
|
|
290
290
|
hideWhenDetached: p,
|
|
291
291
|
avoidCollisions: h
|
|
292
292
|
} : {};
|
|
293
|
-
return /* @__PURE__ */
|
|
293
|
+
return /* @__PURE__ */ i(
|
|
294
294
|
Ke,
|
|
295
295
|
{
|
|
296
296
|
scope: e,
|
|
@@ -303,10 +303,10 @@ var D = 10, [Ke, q] = re(ee), Xt = "SelectContentImpl", Zt = bt("SelectContent.R
|
|
|
303
303
|
itemTextRefCallback: oe,
|
|
304
304
|
focusSelectedItem: L,
|
|
305
305
|
selectedItemText: X,
|
|
306
|
-
position:
|
|
306
|
+
position: n,
|
|
307
307
|
isPositioned: $,
|
|
308
308
|
searchRef: fe,
|
|
309
|
-
children: /* @__PURE__ */
|
|
309
|
+
children: /* @__PURE__ */ i(Pt, { as: Zt, allowPinchZoom: !0, children: /* @__PURE__ */ i(
|
|
310
310
|
Rt,
|
|
311
311
|
{
|
|
312
312
|
asChild: !0,
|
|
@@ -317,16 +317,16 @@ var D = 10, [Ke, q] = re(ee), Xt = "SelectContentImpl", Zt = bt("SelectContent.R
|
|
|
317
317
|
onUnmountAutoFocus: N(l, (u) => {
|
|
318
318
|
m.trigger?.focus({ preventScroll: !0 }), u.preventDefault();
|
|
319
319
|
}),
|
|
320
|
-
children: /* @__PURE__ */
|
|
320
|
+
children: /* @__PURE__ */ i(
|
|
321
321
|
It,
|
|
322
322
|
{
|
|
323
323
|
asChild: !0,
|
|
324
324
|
disableOutsidePointerEvents: !0,
|
|
325
325
|
onEscapeKeyDown: d,
|
|
326
|
-
onPointerDownOutside:
|
|
326
|
+
onPointerDownOutside: s,
|
|
327
327
|
onFocusOutside: (u) => u.preventDefault(),
|
|
328
328
|
onDismiss: () => m.onOpenChange(!1),
|
|
329
|
-
children: /* @__PURE__ */
|
|
329
|
+
children: /* @__PURE__ */ i(
|
|
330
330
|
ce,
|
|
331
331
|
{
|
|
332
332
|
role: "listbox",
|
|
@@ -369,8 +369,8 @@ var D = 10, [Ke, q] = re(ee), Xt = "SelectContentImpl", Zt = bt("SelectContent.R
|
|
|
369
369
|
);
|
|
370
370
|
$e.displayName = Xt;
|
|
371
371
|
var Jt = "SelectItemAlignedPosition", Ge = o.forwardRef((t, r) => {
|
|
372
|
-
const { __scopeSelect: e, onPlaced:
|
|
373
|
-
if (d.trigger && d.valueNode &&
|
|
372
|
+
const { __scopeSelect: e, onPlaced: n, ...l } = t, d = Y(ee, e), s = q(ee, e), [a, c] = 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(() => {
|
|
373
|
+
if (d.trigger && d.valueNode && a && f && p && h && S) {
|
|
374
374
|
const R = d.trigger.getBoundingClientRect(), O = f.getBoundingClientRect(), K = d.valueNode.getBoundingClientRect(), X = S.getBoundingClientRect();
|
|
375
375
|
if (d.dir !== "rtl") {
|
|
376
376
|
const b = X.left - O.left, T = K.left - b, Z = R.left - T, J = R.width + Z, ve = Math.max(J, O.width), ge = window.innerWidth - D, Se = _e(T, [
|
|
@@ -382,47 +382,47 @@ var Jt = "SelectItemAlignedPosition", Ge = o.forwardRef((t, r) => {
|
|
|
382
382
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
383
383
|
Math.max(D, ge - ve)
|
|
384
384
|
]);
|
|
385
|
-
|
|
385
|
+
a.style.minWidth = J + "px", a.style.left = Se + "px";
|
|
386
386
|
} else {
|
|
387
387
|
const b = O.right - X.right, T = window.innerWidth - K.right - b, Z = window.innerWidth - R.right - T, J = R.width + Z, ve = Math.max(J, O.width), ge = window.innerWidth - D, Se = _e(T, [
|
|
388
388
|
D,
|
|
389
389
|
Math.max(D, ge - ve)
|
|
390
390
|
]);
|
|
391
|
-
|
|
391
|
+
a.style.minWidth = J + "px", a.style.right = Se + "px";
|
|
392
392
|
}
|
|
393
393
|
const k = P(), V = window.innerHeight - D * 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 - D, ce = V - oe, se = h.offsetHeight / 2, u = h.offsetTop + se, C = U + E + u, _ = G - C;
|
|
394
394
|
if (C <= oe) {
|
|
395
395
|
const b = k.length > 0 && h === k[k.length - 1].ref.current;
|
|
396
|
-
|
|
396
|
+
a.style.bottom = "0px";
|
|
397
397
|
const T = f.clientHeight - p.offsetTop - p.offsetHeight, Z = Math.max(
|
|
398
398
|
ce,
|
|
399
399
|
se + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
400
400
|
(b ? he : 0) + T + L
|
|
401
401
|
), J = C + Z;
|
|
402
|
-
|
|
402
|
+
a.style.height = J + "px";
|
|
403
403
|
} else {
|
|
404
404
|
const b = k.length > 0 && h === k[0].ref.current;
|
|
405
|
-
|
|
405
|
+
a.style.top = "0px";
|
|
406
406
|
const Z = Math.max(
|
|
407
407
|
oe,
|
|
408
408
|
U + p.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
409
409
|
(b ? me : 0) + se
|
|
410
410
|
) + _;
|
|
411
|
-
|
|
411
|
+
a.style.height = Z + "px", p.scrollTop = C - oe + p.offsetTop;
|
|
412
412
|
}
|
|
413
|
-
|
|
413
|
+
a.style.margin = `${D}px 0`, a.style.minHeight = fe + "px", a.style.maxHeight = V + "px", n?.(), requestAnimationFrame(() => I.current = !0);
|
|
414
414
|
}
|
|
415
415
|
}, [
|
|
416
416
|
P,
|
|
417
417
|
d.trigger,
|
|
418
418
|
d.valueNode,
|
|
419
|
-
|
|
419
|
+
a,
|
|
420
420
|
f,
|
|
421
421
|
p,
|
|
422
422
|
h,
|
|
423
423
|
S,
|
|
424
424
|
d.dir,
|
|
425
|
-
|
|
425
|
+
n
|
|
426
426
|
]);
|
|
427
427
|
j(() => v(), [v]);
|
|
428
428
|
const [F, A] = o.useState();
|
|
@@ -435,24 +435,24 @@ var Jt = "SelectItemAlignedPosition", Ge = o.forwardRef((t, r) => {
|
|
|
435
435
|
},
|
|
436
436
|
[v, m]
|
|
437
437
|
);
|
|
438
|
-
return /* @__PURE__ */
|
|
438
|
+
return /* @__PURE__ */ i(
|
|
439
439
|
eo,
|
|
440
440
|
{
|
|
441
441
|
scope: e,
|
|
442
|
-
contentWrapper:
|
|
442
|
+
contentWrapper: a,
|
|
443
443
|
shouldExpandOnScrollRef: I,
|
|
444
444
|
onScrollButtonChange: ne,
|
|
445
|
-
children: /* @__PURE__ */
|
|
445
|
+
children: /* @__PURE__ */ i(
|
|
446
446
|
"div",
|
|
447
447
|
{
|
|
448
|
-
ref:
|
|
448
|
+
ref: c,
|
|
449
449
|
style: {
|
|
450
450
|
display: "flex",
|
|
451
451
|
flexDirection: "column",
|
|
452
452
|
position: "fixed",
|
|
453
453
|
zIndex: F
|
|
454
454
|
},
|
|
455
|
-
children: /* @__PURE__ */
|
|
455
|
+
children: /* @__PURE__ */ i(
|
|
456
456
|
M.div,
|
|
457
457
|
{
|
|
458
458
|
...l,
|
|
@@ -476,17 +476,17 @@ Ge.displayName = Jt;
|
|
|
476
476
|
var Qt = "SelectPopperPosition", we = o.forwardRef((t, r) => {
|
|
477
477
|
const {
|
|
478
478
|
__scopeSelect: e,
|
|
479
|
-
align:
|
|
479
|
+
align: n = "start",
|
|
480
480
|
collisionPadding: l = D,
|
|
481
481
|
...d
|
|
482
|
-
} = t,
|
|
483
|
-
return /* @__PURE__ */
|
|
482
|
+
} = t, s = ue(e);
|
|
483
|
+
return /* @__PURE__ */ i(
|
|
484
484
|
Mt,
|
|
485
485
|
{
|
|
486
|
-
...
|
|
486
|
+
...s,
|
|
487
487
|
...d,
|
|
488
488
|
ref: r,
|
|
489
|
-
align:
|
|
489
|
+
align: n,
|
|
490
490
|
collisionPadding: l,
|
|
491
491
|
style: {
|
|
492
492
|
// Ensure border-box for floating-ui calculations
|
|
@@ -504,24 +504,24 @@ var Qt = "SelectPopperPosition", we = o.forwardRef((t, r) => {
|
|
|
504
504
|
we.displayName = Qt;
|
|
505
505
|
var [eo, Ne] = re(ee, {}), ye = "SelectViewport", ze = o.forwardRef(
|
|
506
506
|
(t, r) => {
|
|
507
|
-
const { __scopeSelect: e, nonce:
|
|
507
|
+
const { __scopeSelect: e, nonce: n, ...l } = t, d = q(ye, e), s = Ne(ye, e), a = B(r, d.onViewportChange), c = o.useRef(0);
|
|
508
508
|
return /* @__PURE__ */ z(Ie, { children: [
|
|
509
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ i(
|
|
510
510
|
"style",
|
|
511
511
|
{
|
|
512
512
|
dangerouslySetInnerHTML: {
|
|
513
513
|
__html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
|
|
514
514
|
},
|
|
515
|
-
nonce:
|
|
515
|
+
nonce: n
|
|
516
516
|
}
|
|
517
517
|
),
|
|
518
|
-
/* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ i(de.Slot, { scope: e, children: /* @__PURE__ */ i(
|
|
519
519
|
M.div,
|
|
520
520
|
{
|
|
521
521
|
"data-radix-select-viewport": "",
|
|
522
522
|
role: "presentation",
|
|
523
523
|
...l,
|
|
524
|
-
ref:
|
|
524
|
+
ref: a,
|
|
525
525
|
style: {
|
|
526
526
|
// we use position: 'relative' here on the `viewport` so that when we call
|
|
527
527
|
// `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
|
|
@@ -536,9 +536,9 @@ var [eo, Ne] = re(ee, {}), ye = "SelectViewport", ze = o.forwardRef(
|
|
|
536
536
|
...l.style
|
|
537
537
|
},
|
|
538
538
|
onScroll: N(l.onScroll, (f) => {
|
|
539
|
-
const g = f.currentTarget, { contentWrapper: y, shouldExpandOnScrollRef: P } =
|
|
539
|
+
const g = f.currentTarget, { contentWrapper: y, shouldExpandOnScrollRef: P } = s;
|
|
540
540
|
if (P?.current && y) {
|
|
541
|
-
const I = Math.abs(
|
|
541
|
+
const I = Math.abs(c.current - g.scrollTop);
|
|
542
542
|
if (I > 0) {
|
|
543
543
|
const x = window.innerHeight - D * 2, p = parseFloat(y.style.minHeight), h = parseFloat(y.style.height), S = Math.max(p, h);
|
|
544
544
|
if (S < x) {
|
|
@@ -547,7 +547,7 @@ var [eo, Ne] = re(ee, {}), ye = "SelectViewport", ze = o.forwardRef(
|
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
|
|
550
|
+
c.current = g.scrollTop;
|
|
551
551
|
})
|
|
552
552
|
}
|
|
553
553
|
) })
|
|
@@ -557,15 +557,15 @@ var [eo, Ne] = re(ee, {}), ye = "SelectViewport", ze = o.forwardRef(
|
|
|
557
557
|
ze.displayName = ye;
|
|
558
558
|
var je = "SelectGroup", [to, oo] = re(je), Ye = o.forwardRef(
|
|
559
559
|
(t, r) => {
|
|
560
|
-
const { __scopeSelect: e, ...
|
|
561
|
-
return /* @__PURE__ */
|
|
560
|
+
const { __scopeSelect: e, ...n } = t, l = Te();
|
|
561
|
+
return /* @__PURE__ */ i(to, { scope: e, id: l, children: /* @__PURE__ */ i(M.div, { role: "group", "aria-labelledby": l, ...n, ref: r }) });
|
|
562
562
|
}
|
|
563
563
|
);
|
|
564
564
|
Ye.displayName = je;
|
|
565
565
|
var qe = "SelectLabel", Xe = o.forwardRef(
|
|
566
566
|
(t, r) => {
|
|
567
|
-
const { __scopeSelect: e, ...
|
|
568
|
-
return /* @__PURE__ */
|
|
567
|
+
const { __scopeSelect: e, ...n } = t, l = oo(qe, e);
|
|
568
|
+
return /* @__PURE__ */ i(M.div, { id: l.id, ...n, ref: r });
|
|
569
569
|
}
|
|
570
570
|
);
|
|
571
571
|
Xe.displayName = qe;
|
|
@@ -573,39 +573,39 @@ var ie = "SelectItem", [ro, Ze] = re(ie), Je = o.forwardRef(
|
|
|
573
573
|
(t, r) => {
|
|
574
574
|
const {
|
|
575
575
|
__scopeSelect: e,
|
|
576
|
-
value:
|
|
576
|
+
value: n,
|
|
577
577
|
disabled: l = !1,
|
|
578
578
|
textValue: d,
|
|
579
|
-
...
|
|
580
|
-
} = t,
|
|
579
|
+
...s
|
|
580
|
+
} = t, a = Y(ie, e), c = q(ie, e), f = a.value === n, [g, y] = o.useState(d ?? ""), [P, I] = o.useState(!1), x = B(
|
|
581
581
|
r,
|
|
582
|
-
(m) =>
|
|
582
|
+
(m) => c.itemRefCallback?.(m, n, l)
|
|
583
583
|
), p = Te(), h = o.useRef("touch"), S = () => {
|
|
584
|
-
l || (
|
|
584
|
+
l || (a.onValueChange(n), a.onOpenChange(!1));
|
|
585
585
|
};
|
|
586
|
-
if (
|
|
586
|
+
if (n === "")
|
|
587
587
|
throw new Error(
|
|
588
588
|
"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."
|
|
589
589
|
);
|
|
590
|
-
return /* @__PURE__ */
|
|
590
|
+
return /* @__PURE__ */ i(
|
|
591
591
|
ro,
|
|
592
592
|
{
|
|
593
593
|
scope: e,
|
|
594
|
-
value:
|
|
594
|
+
value: n,
|
|
595
595
|
disabled: l,
|
|
596
596
|
textId: p,
|
|
597
597
|
isSelected: f,
|
|
598
598
|
onItemTextChange: o.useCallback((m) => {
|
|
599
599
|
y((v) => v || (m?.textContent ?? "").trim());
|
|
600
600
|
}, []),
|
|
601
|
-
children: /* @__PURE__ */
|
|
601
|
+
children: /* @__PURE__ */ i(
|
|
602
602
|
de.ItemSlot,
|
|
603
603
|
{
|
|
604
604
|
scope: e,
|
|
605
|
-
value:
|
|
605
|
+
value: n,
|
|
606
606
|
disabled: l,
|
|
607
607
|
textValue: g,
|
|
608
|
-
children: /* @__PURE__ */
|
|
608
|
+
children: /* @__PURE__ */ i(
|
|
609
609
|
M.div,
|
|
610
610
|
{
|
|
611
611
|
role: "option",
|
|
@@ -616,27 +616,27 @@ var ie = "SelectItem", [ro, Ze] = re(ie), Je = o.forwardRef(
|
|
|
616
616
|
"aria-disabled": l || void 0,
|
|
617
617
|
"data-disabled": l ? "" : void 0,
|
|
618
618
|
tabIndex: l ? void 0 : -1,
|
|
619
|
-
...
|
|
619
|
+
...s,
|
|
620
620
|
ref: x,
|
|
621
|
-
onFocus: N(
|
|
622
|
-
onBlur: N(
|
|
623
|
-
onClick: N(
|
|
621
|
+
onFocus: N(s.onFocus, () => I(!0)),
|
|
622
|
+
onBlur: N(s.onBlur, () => I(!1)),
|
|
623
|
+
onClick: N(s.onClick, () => {
|
|
624
624
|
h.current !== "mouse" && S();
|
|
625
625
|
}),
|
|
626
|
-
onPointerUp: N(
|
|
626
|
+
onPointerUp: N(s.onPointerUp, () => {
|
|
627
627
|
h.current === "mouse" && S();
|
|
628
628
|
}),
|
|
629
|
-
onPointerDown: N(
|
|
629
|
+
onPointerDown: N(s.onPointerDown, (m) => {
|
|
630
630
|
h.current = m.pointerType;
|
|
631
631
|
}),
|
|
632
|
-
onPointerMove: N(
|
|
633
|
-
h.current = m.pointerType, l ?
|
|
632
|
+
onPointerMove: N(s.onPointerMove, (m) => {
|
|
633
|
+
h.current = m.pointerType, l ? c.onItemLeave?.() : h.current === "mouse" && m.currentTarget.focus({ preventScroll: !0 });
|
|
634
634
|
}),
|
|
635
|
-
onPointerLeave: N(
|
|
636
|
-
m.currentTarget === document.activeElement &&
|
|
635
|
+
onPointerLeave: N(s.onPointerLeave, (m) => {
|
|
636
|
+
m.currentTarget === document.activeElement && c.onItemLeave?.();
|
|
637
637
|
}),
|
|
638
|
-
onKeyDown: N(
|
|
639
|
-
|
|
638
|
+
onKeyDown: N(s.onKeyDown, (m) => {
|
|
639
|
+
c.searchRef?.current !== "" && m.key === " " || (Kt.includes(m.key) && S(), m.key === " " && m.preventDefault());
|
|
640
640
|
})
|
|
641
641
|
}
|
|
642
642
|
)
|
|
@@ -649,84 +649,84 @@ var ie = "SelectItem", [ro, Ze] = re(ie), Je = o.forwardRef(
|
|
|
649
649
|
Je.displayName = ie;
|
|
650
650
|
var ae = "SelectItemText", Qe = o.forwardRef(
|
|
651
651
|
(t, r) => {
|
|
652
|
-
const { __scopeSelect: e, className:
|
|
652
|
+
const { __scopeSelect: e, className: n, style: l, ...d } = t, s = Y(ae, e), a = q(ae, e), c = Ze(ae, e), f = jt(ae, e), [g, y] = o.useState(null), P = B(
|
|
653
653
|
r,
|
|
654
654
|
(S) => y(S),
|
|
655
|
-
|
|
656
|
-
(S) =>
|
|
655
|
+
c.onItemTextChange,
|
|
656
|
+
(S) => a.itemTextRefCallback?.(S, c.value, c.disabled)
|
|
657
657
|
), I = g?.textContent, x = o.useMemo(
|
|
658
|
-
() => /* @__PURE__ */
|
|
659
|
-
[
|
|
658
|
+
() => /* @__PURE__ */ i("option", { value: c.value, disabled: c.disabled, children: I }, c.value),
|
|
659
|
+
[c.disabled, c.value, I]
|
|
660
660
|
), { onNativeOptionAdd: p, onNativeOptionRemove: h } = f;
|
|
661
661
|
return j(() => (p(x), () => h(x)), [p, h, x]), /* @__PURE__ */ z(Ie, { children: [
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
|
|
662
|
+
/* @__PURE__ */ i(M.span, { id: c.textId, ...d, ref: P }),
|
|
663
|
+
c.isSelected && s.valueNode && !s.valueNodeHasChildren ? Ae.createPortal(d.children, s.valueNode) : null
|
|
664
664
|
] });
|
|
665
665
|
}
|
|
666
666
|
);
|
|
667
667
|
Qe.displayName = ae;
|
|
668
668
|
var et = "SelectItemIndicator", tt = o.forwardRef(
|
|
669
669
|
(t, r) => {
|
|
670
|
-
const { __scopeSelect: e, ...
|
|
671
|
-
return Ze(et, e).isSelected ? /* @__PURE__ */
|
|
670
|
+
const { __scopeSelect: e, ...n } = t;
|
|
671
|
+
return Ze(et, e).isSelected ? /* @__PURE__ */ i(M.span, { "aria-hidden": !0, ...n, ref: r }) : null;
|
|
672
672
|
}
|
|
673
673
|
);
|
|
674
674
|
tt.displayName = et;
|
|
675
675
|
var be = "SelectScrollUpButton", ot = o.forwardRef((t, r) => {
|
|
676
|
-
const e = q(be, t.__scopeSelect),
|
|
676
|
+
const e = q(be, t.__scopeSelect), n = Ne(be, t.__scopeSelect), [l, d] = o.useState(!1), s = B(r, n.onScrollButtonChange);
|
|
677
677
|
return j(() => {
|
|
678
678
|
if (e.viewport && e.isPositioned) {
|
|
679
|
-
let
|
|
680
|
-
const f =
|
|
679
|
+
let a = function() {
|
|
680
|
+
const f = c.scrollTop > 0;
|
|
681
681
|
d(f);
|
|
682
682
|
};
|
|
683
|
-
const
|
|
684
|
-
return
|
|
683
|
+
const c = e.viewport;
|
|
684
|
+
return a(), c.addEventListener("scroll", a), () => c.removeEventListener("scroll", a);
|
|
685
685
|
}
|
|
686
|
-
}, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */
|
|
686
|
+
}, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ i(
|
|
687
687
|
nt,
|
|
688
688
|
{
|
|
689
689
|
...t,
|
|
690
|
-
ref:
|
|
690
|
+
ref: s,
|
|
691
691
|
onAutoScroll: () => {
|
|
692
|
-
const { viewport:
|
|
693
|
-
|
|
692
|
+
const { viewport: a, selectedItem: c } = e;
|
|
693
|
+
a && c && (a.scrollTop = a.scrollTop - c.offsetHeight);
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
696
|
) : null;
|
|
697
697
|
});
|
|
698
698
|
ot.displayName = be;
|
|
699
699
|
var xe = "SelectScrollDownButton", rt = o.forwardRef((t, r) => {
|
|
700
|
-
const e = q(xe, t.__scopeSelect),
|
|
700
|
+
const e = q(xe, t.__scopeSelect), n = Ne(xe, t.__scopeSelect), [l, d] = o.useState(!1), s = B(r, n.onScrollButtonChange);
|
|
701
701
|
return j(() => {
|
|
702
702
|
if (e.viewport && e.isPositioned) {
|
|
703
|
-
let
|
|
704
|
-
const f =
|
|
703
|
+
let a = function() {
|
|
704
|
+
const f = c.scrollHeight - c.clientHeight, g = Math.ceil(c.scrollTop) < f;
|
|
705
705
|
d(g);
|
|
706
706
|
};
|
|
707
|
-
const
|
|
708
|
-
return
|
|
707
|
+
const c = e.viewport;
|
|
708
|
+
return a(), c.addEventListener("scroll", a), () => c.removeEventListener("scroll", a);
|
|
709
709
|
}
|
|
710
|
-
}, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */
|
|
710
|
+
}, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ i(
|
|
711
711
|
nt,
|
|
712
712
|
{
|
|
713
713
|
...t,
|
|
714
|
-
ref:
|
|
714
|
+
ref: s,
|
|
715
715
|
onAutoScroll: () => {
|
|
716
|
-
const { viewport:
|
|
717
|
-
|
|
716
|
+
const { viewport: a, selectedItem: c } = e;
|
|
717
|
+
a && c && (a.scrollTop = a.scrollTop + c.offsetHeight);
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
720
|
) : null;
|
|
721
721
|
});
|
|
722
722
|
rt.displayName = xe;
|
|
723
723
|
var nt = o.forwardRef((t, r) => {
|
|
724
|
-
const { __scopeSelect: e, onAutoScroll:
|
|
725
|
-
|
|
724
|
+
const { __scopeSelect: e, onAutoScroll: n, ...l } = t, d = q("SelectScrollButton", e), s = o.useRef(null), a = pe(e), c = o.useCallback(() => {
|
|
725
|
+
s.current !== null && (window.clearInterval(s.current), s.current = null);
|
|
726
726
|
}, []);
|
|
727
|
-
return o.useEffect(() => () =>
|
|
728
|
-
|
|
729
|
-
}, [
|
|
727
|
+
return o.useEffect(() => () => c(), [c]), j(() => {
|
|
728
|
+
a().find((g) => g.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
729
|
+
}, [a]), /* @__PURE__ */ i(
|
|
730
730
|
M.div,
|
|
731
731
|
{
|
|
732
732
|
"aria-hidden": !0,
|
|
@@ -734,45 +734,45 @@ var nt = o.forwardRef((t, r) => {
|
|
|
734
734
|
ref: r,
|
|
735
735
|
style: { flexShrink: 0, ...l.style },
|
|
736
736
|
onPointerDown: N(l.onPointerDown, () => {
|
|
737
|
-
|
|
737
|
+
s.current === null && (s.current = window.setInterval(n, 50));
|
|
738
738
|
}),
|
|
739
739
|
onPointerMove: N(l.onPointerMove, () => {
|
|
740
|
-
d.onItemLeave?.(),
|
|
740
|
+
d.onItemLeave?.(), s.current === null && (s.current = window.setInterval(n, 50));
|
|
741
741
|
}),
|
|
742
742
|
onPointerLeave: N(l.onPointerLeave, () => {
|
|
743
|
-
|
|
743
|
+
c();
|
|
744
744
|
})
|
|
745
745
|
}
|
|
746
746
|
);
|
|
747
747
|
}), no = "SelectSeparator", st = o.forwardRef(
|
|
748
748
|
(t, r) => {
|
|
749
|
-
const { __scopeSelect: e, ...
|
|
750
|
-
return /* @__PURE__ */
|
|
749
|
+
const { __scopeSelect: e, ...n } = t;
|
|
750
|
+
return /* @__PURE__ */ i(M.div, { "aria-hidden": !0, ...n, ref: r });
|
|
751
751
|
}
|
|
752
752
|
);
|
|
753
753
|
st.displayName = no;
|
|
754
754
|
var Ce = "SelectArrow", so = o.forwardRef(
|
|
755
755
|
(t, r) => {
|
|
756
|
-
const { __scopeSelect: e, ...
|
|
757
|
-
return d.open &&
|
|
756
|
+
const { __scopeSelect: e, ...n } = t, l = ue(e), d = Y(Ce, e), s = q(Ce, e);
|
|
757
|
+
return d.open && s.position === "popper" ? /* @__PURE__ */ i(At, { ...l, ...n, ref: r }) : null;
|
|
758
758
|
}
|
|
759
759
|
);
|
|
760
760
|
so.displayName = Ce;
|
|
761
761
|
var ao = "SelectBubbleInput", at = o.forwardRef(
|
|
762
|
-
({ __scopeSelect: t, value: r, ...e },
|
|
763
|
-
const l = o.useRef(null), d = B(
|
|
762
|
+
({ __scopeSelect: t, value: r, ...e }, n) => {
|
|
763
|
+
const l = o.useRef(null), d = B(n, l), s = Ot(r);
|
|
764
764
|
return o.useEffect(() => {
|
|
765
|
-
const
|
|
766
|
-
if (!
|
|
767
|
-
const
|
|
768
|
-
|
|
765
|
+
const a = l.current;
|
|
766
|
+
if (!a) return;
|
|
767
|
+
const c = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
|
|
768
|
+
c,
|
|
769
769
|
"value"
|
|
770
770
|
).set;
|
|
771
|
-
if (
|
|
771
|
+
if (s !== r && g) {
|
|
772
772
|
const y = new Event("change", { bubbles: !0 });
|
|
773
|
-
g.call(
|
|
773
|
+
g.call(a, r), a.dispatchEvent(y);
|
|
774
774
|
}
|
|
775
|
-
}, [
|
|
775
|
+
}, [s, r]), /* @__PURE__ */ i(
|
|
776
776
|
M.select,
|
|
777
777
|
{
|
|
778
778
|
...e,
|
|
@@ -788,33 +788,33 @@ function lt(t) {
|
|
|
788
788
|
return t === "" || t === void 0;
|
|
789
789
|
}
|
|
790
790
|
function ct(t) {
|
|
791
|
-
const r = Dt(t), e = o.useRef(""),
|
|
792
|
-
(
|
|
793
|
-
const
|
|
794
|
-
r(
|
|
795
|
-
e.current = f, window.clearTimeout(
|
|
796
|
-
}(
|
|
791
|
+
const r = Dt(t), e = o.useRef(""), n = o.useRef(0), l = o.useCallback(
|
|
792
|
+
(s) => {
|
|
793
|
+
const a = e.current + s;
|
|
794
|
+
r(a), function c(f) {
|
|
795
|
+
e.current = f, window.clearTimeout(n.current), f !== "" && (n.current = window.setTimeout(() => c(""), 1e3));
|
|
796
|
+
}(a);
|
|
797
797
|
},
|
|
798
798
|
[r]
|
|
799
799
|
), d = o.useCallback(() => {
|
|
800
|
-
e.current = "", window.clearTimeout(
|
|
800
|
+
e.current = "", window.clearTimeout(n.current);
|
|
801
801
|
}, []);
|
|
802
|
-
return o.useEffect(() => () => window.clearTimeout(
|
|
802
|
+
return o.useEffect(() => () => window.clearTimeout(n.current), []), [e, l, d];
|
|
803
803
|
}
|
|
804
804
|
function it(t, r, e) {
|
|
805
805
|
const l = r.length > 1 && Array.from(r).every((f) => f === r[0]) ? r[0] : r, d = e ? t.indexOf(e) : -1;
|
|
806
|
-
let
|
|
807
|
-
l.length === 1 && (
|
|
808
|
-
const
|
|
806
|
+
let s = lo(t, Math.max(d, 0));
|
|
807
|
+
l.length === 1 && (s = s.filter((f) => f !== e));
|
|
808
|
+
const c = s.find(
|
|
809
809
|
(f) => f.textValue.toLowerCase().startsWith(l.toLowerCase())
|
|
810
810
|
);
|
|
811
|
-
return
|
|
811
|
+
return c !== e ? c : void 0;
|
|
812
812
|
}
|
|
813
813
|
function lo(t, r) {
|
|
814
|
-
return t.map((e,
|
|
814
|
+
return t.map((e, n) => t[(r + n) % t.length]);
|
|
815
815
|
}
|
|
816
816
|
var co = Le, dt = ke, io = He, po = Ue, uo = We, pt = Fe, fo = ze, mo = Ye, ut = Xe, Pe = Je, Re = Qe, Ee = tt, ft = ot, mt = rt, ht = st;
|
|
817
|
-
const vt = ({ onClear: t, ...r }) => /* @__PURE__ */
|
|
817
|
+
const vt = ({ onClear: t, ...r }) => /* @__PURE__ */ i(kt, { type: "button", icon: Vt, variant: "text", size: "md", onClick: t, ...r });
|
|
818
818
|
vt.displayName = "ClearButton";
|
|
819
819
|
const er = co, tr = mo, or = io, ho = te({
|
|
820
820
|
base: [
|
|
@@ -845,26 +845,26 @@ const er = co, tr = mo, or = io, ho = te({
|
|
|
845
845
|
}
|
|
846
846
|
}
|
|
847
847
|
}), vo = o.forwardRef(
|
|
848
|
-
({ className: t, children: r, onClear: e, invalid:
|
|
849
|
-
const
|
|
850
|
-
return /* @__PURE__ */ z(dt, { ref:
|
|
848
|
+
({ className: t, children: r, onClear: e, disabled: n, invalid: l, ...d }, s) => {
|
|
849
|
+
const a = ho({ invalid: l, disabled: n });
|
|
850
|
+
return /* @__PURE__ */ z(dt, { ref: s, className: a.base({ className: t }), disabled: n, ...d, children: [
|
|
851
851
|
r,
|
|
852
|
-
/* @__PURE__ */ z("div", { className:
|
|
853
|
-
e && /* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ z("div", { className: a.iconWrapper(), children: [
|
|
853
|
+
!n && e && /* @__PURE__ */ i(
|
|
854
854
|
vt,
|
|
855
855
|
{
|
|
856
856
|
onClear: () => {
|
|
857
857
|
e();
|
|
858
858
|
},
|
|
859
|
-
onPointerDown: (
|
|
860
|
-
|
|
859
|
+
onPointerDown: (c) => {
|
|
860
|
+
c.stopPropagation(), c.preventDefault();
|
|
861
861
|
},
|
|
862
|
-
onKeyDown: (
|
|
863
|
-
|
|
862
|
+
onKeyDown: (c) => {
|
|
863
|
+
c.key === "Enter" && (e(), c.stopPropagation(), c.preventDefault());
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
866
|
),
|
|
867
|
-
/* @__PURE__ */
|
|
867
|
+
/* @__PURE__ */ i(po, { asChild: !0, children: /* @__PURE__ */ i(Oe, { className: a.icon() }) })
|
|
868
868
|
] })
|
|
869
869
|
] });
|
|
870
870
|
}
|
|
@@ -876,8 +876,8 @@ const go = te({
|
|
|
876
876
|
icon: "h-4 w-4"
|
|
877
877
|
}
|
|
878
878
|
}), gt = o.forwardRef(({ className: t, ...r }, e) => {
|
|
879
|
-
const
|
|
880
|
-
return /* @__PURE__ */
|
|
879
|
+
const n = go();
|
|
880
|
+
return /* @__PURE__ */ i(ft, { ref: e, className: n.base({ className: t }), ...r, children: /* @__PURE__ */ i(Wt, { className: n.icon() }) });
|
|
881
881
|
});
|
|
882
882
|
gt.displayName = ft.displayName;
|
|
883
883
|
const So = te({
|
|
@@ -886,8 +886,8 @@ const So = te({
|
|
|
886
886
|
icon: "h-4 w-4"
|
|
887
887
|
}
|
|
888
888
|
}), St = o.forwardRef(({ className: t, ...r }, e) => {
|
|
889
|
-
const
|
|
890
|
-
return /* @__PURE__ */
|
|
889
|
+
const n = So();
|
|
890
|
+
return /* @__PURE__ */ i(mt, { ref: e, className: n.base({ className: t }), ...r, children: /* @__PURE__ */ i(Oe, { className: n.icon() }) });
|
|
891
891
|
});
|
|
892
892
|
St.displayName = mt.displayName;
|
|
893
893
|
const wo = te({
|
|
@@ -909,18 +909,18 @@ const wo = te({
|
|
|
909
909
|
"item-aligned": ""
|
|
910
910
|
}
|
|
911
911
|
}
|
|
912
|
-
}), yo = o.forwardRef(({ className: t, children: r, position: e = "popper", portalContainer:
|
|
913
|
-
const
|
|
914
|
-
return /* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
912
|
+
}), yo = o.forwardRef(({ className: t, children: r, position: e = "popper", portalContainer: n, ...l }, d) => {
|
|
913
|
+
const s = wo({ position: e }), a = Bt(n);
|
|
914
|
+
return /* @__PURE__ */ i(uo, { container: a, children: /* @__PURE__ */ z(pt, { ref: d, className: s.base({ className: t }), position: e, ...l, children: [
|
|
915
|
+
/* @__PURE__ */ i(gt, {}),
|
|
916
|
+
/* @__PURE__ */ i(fo, { className: s.viewport(), children: r }),
|
|
917
|
+
/* @__PURE__ */ i(St, {})
|
|
918
918
|
] }) });
|
|
919
919
|
});
|
|
920
920
|
yo.displayName = pt.displayName;
|
|
921
921
|
const bo = te({
|
|
922
922
|
base: ["overflow-hidden overflow-ellipsis px-2 py-1.5 text-xs font-normal text-muted"]
|
|
923
|
-
}), xo = o.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */
|
|
923
|
+
}), xo = o.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(ut, { ref: e, className: bo({ className: t }), ...r }));
|
|
924
924
|
xo.displayName = ut.displayName;
|
|
925
925
|
const Co = te({
|
|
926
926
|
extend: Ht,
|
|
@@ -929,17 +929,17 @@ const Co = te({
|
|
|
929
929
|
indicator: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
930
930
|
indicatorIcon: "h-4 w-4"
|
|
931
931
|
}
|
|
932
|
-
}), Io = o.forwardRef(({ className: t, children: r, disabled: e, ...
|
|
932
|
+
}), Io = o.forwardRef(({ className: t, children: r, disabled: e, ...n }, l) => {
|
|
933
933
|
const d = Co({ disabled: e });
|
|
934
|
-
return /* @__PURE__ */ z(Pe, { ref: l, disabled: e, className: d.base({ className: t }), ...
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
/* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */ z(Pe, { ref: l, disabled: e, className: d.base({ className: t }), ...n, children: [
|
|
935
|
+
/* @__PURE__ */ i("span", { className: d.indicator(), children: /* @__PURE__ */ i(Ee, { children: /* @__PURE__ */ i(Ut, { className: d.indicatorIcon() }) }) }),
|
|
936
|
+
/* @__PURE__ */ i(Re, { children: r })
|
|
937
937
|
] });
|
|
938
938
|
});
|
|
939
939
|
Io.displayName = Pe.displayName;
|
|
940
940
|
const To = te({
|
|
941
941
|
base: ["-mx-1 my-1 h-px bg-secondary-border"]
|
|
942
|
-
}), No = o.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */
|
|
942
|
+
}), No = o.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(ht, { ref: e, className: To({ className: t }), ...r }));
|
|
943
943
|
No.displayName = ht.displayName;
|
|
944
944
|
const Po = Pe;
|
|
945
945
|
Po.displayName = "SelectOption";
|
|
@@ -964,4 +964,4 @@ export {
|
|
|
964
964
|
Eo as l,
|
|
965
965
|
ho as s
|
|
966
966
|
};
|
|
967
|
-
//# sourceMappingURL=Select-
|
|
967
|
+
//# sourceMappingURL=Select-CWbLja8r.js.map
|