dawn-ui-react 1.0.0-alpha.2 → 1.0.0-alpha.20
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/CompositeItem-CH9gluPn.js +45 -0
- package/dist/CompositeListContext-DMNULDos.js +15 -0
- package/dist/FieldItemContext-D1iEutzE.js +9 -0
- package/dist/FormContext-DmYxHG1e.js +26 -0
- package/dist/{Input-DXDwtOqf.js → Input-DXQc6T_w.js} +16 -10
- package/dist/LabelableContext-mL6rBiul.js +85 -0
- package/dist/RadioGroupContext-zHzEliyD.js +9 -0
- package/dist/clamp-63kvPeUJ.js +801 -0
- package/dist/{cn-CXogf8HW.js → cn-BSNuKelt.js} +349 -307
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/badge/badge.types.d.ts +1 -0
- package/dist/components/chart/chart-container.d.ts +5 -0
- package/dist/components/chart/chart-legend-content.d.ts +8 -0
- package/dist/components/chart/chart-legend-icon.d.ts +2 -0
- package/dist/components/chart/chart-legend-indicator.d.ts +2 -0
- package/dist/components/chart/chart-legend-label.d.ts +2 -0
- package/dist/components/chart/chart-legend.d.ts +2 -0
- package/dist/components/chart/chart-linear-gradient.d.ts +2 -0
- package/dist/components/chart/chart-tooltip-content.d.ts +3 -0
- package/dist/components/chart/chart-tooltip-icon.d.ts +2 -0
- package/dist/components/chart/chart-tooltip-indicator.d.ts +2 -0
- package/dist/components/chart/chart-tooltip-label.d.ts +2 -0
- package/dist/components/chart/chart-tooltip-name.d.ts +2 -0
- package/dist/components/chart/chart-tooltip-payload.d.ts +4 -0
- package/dist/components/chart/chart-tooltip-value.d.ts +2 -0
- package/dist/components/chart/chart-tooltip.d.ts +2 -0
- package/dist/components/chart/chart.types.d.ts +50 -0
- package/dist/components/chart/chart.utils.d.ts +11 -0
- package/dist/components/chart/index.d.ts +19 -0
- package/dist/components/code-block/code-block-actions.d.ts +2 -0
- package/dist/components/code-block/code-block-copy.d.ts +2 -0
- package/dist/components/code-block/code-block-download.d.ts +2 -0
- package/dist/components/code-block/code-block-header.d.ts +3 -0
- package/dist/components/code-block/code-block-name.d.ts +2 -0
- package/dist/components/code-block/code-block-select.d.ts +2 -0
- package/dist/components/code-block/code-block-tabs.d.ts +2 -0
- package/dist/components/code-block/code-block-window.d.ts +2 -0
- package/dist/components/code-block/code-block.d.ts +3 -0
- package/dist/components/code-block/code-block.types.d.ts +26 -0
- package/dist/components/code-block/index.d.ts +10 -0
- package/dist/components/combobox/combobox-virtualized-list.d.ts +2 -0
- package/dist/components/combobox/combobox.types.d.ts +9 -0
- package/dist/components/combobox/index.d.ts +2 -1
- package/dist/components/dialog/index.d.ts +1 -1
- package/dist/components/drawer/drawer-close.d.ts +2 -0
- package/dist/components/drawer/drawer-content.d.ts +2 -0
- package/dist/components/drawer/drawer-description.d.ts +2 -0
- package/dist/components/drawer/drawer-header.d.ts +2 -0
- package/dist/components/drawer/drawer-popup.d.ts +2 -0
- package/dist/components/drawer/drawer-provider.d.ts +2 -0
- package/dist/components/drawer/drawer-title.d.ts +2 -0
- package/dist/components/drawer/drawer-trigger.d.ts +2 -0
- package/dist/components/drawer/drawer.d.ts +2 -0
- package/dist/components/drawer/drawer.types.d.ts +10 -0
- package/dist/components/drawer/index.d.ts +10 -0
- package/dist/components/field/field-radio.d.ts +2 -0
- package/dist/components/field/field-set.d.ts +2 -0
- package/dist/components/field/field.types.d.ts +3 -1
- package/dist/components/field/index.d.ts +5 -1
- package/dist/components/form/form-context.d.ts +56 -14
- package/dist/components/index.d.ts +3 -0
- package/dist/components/input/input.d.ts +1 -1
- package/dist/components/input/input.types.d.ts +3 -1
- package/dist/components/input-otp/index.d.ts +2 -1
- package/dist/components/input-otp/input-otp-separator.d.ts +2 -0
- package/dist/components/input-otp/input-otp-slot.d.ts +1 -1
- package/dist/components/input-otp/input-otp.types.d.ts +4 -3
- package/dist/components/layer-tree/index.d.ts +5 -1
- package/dist/components/layer-tree/layer-tree-body.d.ts +1 -1
- package/dist/components/layer-tree/layer-tree-footer.d.ts +2 -0
- package/dist/components/layer-tree/layer-tree-node-toggle.d.ts +1 -1
- package/dist/components/layer-tree/layer-tree-node.d.ts +1 -1
- package/dist/components/layer-tree/layer-tree-row.d.ts +1 -1
- package/dist/components/layer-tree/layer-tree-search.d.ts +1 -1
- package/dist/components/layer-tree/layer-tree-sort.d.ts +2 -0
- package/dist/components/layer-tree/layer-tree-utils.d.ts +83 -0
- package/dist/components/layer-tree/layer-tree.d.ts +9 -4
- package/dist/components/layer-tree/layer-tree.types.d.ts +16 -5
- package/dist/components/number-field/number-field.d.ts +1 -1
- package/dist/components/popover/index.d.ts +2 -1
- package/dist/components/popover/popover-button.d.ts +2 -0
- package/dist/components/popover/popover.types.d.ts +2 -0
- package/dist/components/profile/index.d.ts +5 -1
- package/dist/components/profile/profile-action.d.ts +2 -0
- package/dist/components/profile/profile-content.d.ts +2 -0
- package/dist/components/profile/profile-name.d.ts +2 -0
- package/dist/components/profile/profile-subname.d.ts +2 -0
- package/dist/components/profile/profile.d.ts +1 -1
- package/dist/components/profile/profile.types.d.ts +6 -14
- package/dist/components/scroll-area/scroll-area.d.ts +1 -1
- package/dist/components/scroll-area/scroll-area.types.d.ts +6 -2
- package/dist/components/select/select.types.d.ts +5 -0
- package/dist/components/separator/separator.d.ts +1 -1
- package/dist/components/separator/separator.types.d.ts +3 -1
- package/dist/components/slider/slider.d.ts +1 -1
- package/dist/components/slider/slider.types.d.ts +7 -1
- package/dist/components/table/index.d.ts +15 -2
- package/dist/components/table/table-body.d.ts +1 -1
- package/dist/components/table/table-column-toggle.d.ts +2 -0
- package/dist/components/table/table-container.d.ts +2 -0
- package/dist/components/table/table-data-set-select.d.ts +2 -0
- package/dist/components/table/table-data-set-tabs.d.ts +2 -0
- package/dist/components/table/table-filter-form.d.ts +3 -0
- package/dist/components/table/table-filter.d.ts +1 -1
- package/dist/components/table/table-filters.d.ts +2 -0
- package/dist/components/table/table-pagination.d.ts +1 -1
- package/dist/components/table/table-paging.d.ts +2 -0
- package/dist/components/table/table-row-grid.d.ts +1 -1
- package/dist/components/table/table-row-list.d.ts +1 -1
- package/dist/components/table/table-sort.d.ts +1 -1
- package/dist/components/table/table-toolbar.d.ts +2 -0
- package/dist/components/table/table.constants.d.ts +64 -0
- package/dist/components/table/table.d.ts +14 -5
- package/dist/components/table/table.types.d.ts +73 -15
- package/dist/components/table/table.utils.d.ts +4 -0
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tabs/tabs.types.d.ts +4 -1
- package/dist/components/toggle-group/toggle-group.d.ts +1 -1
- package/dist/components/toggle-group/toggle-group.types.d.ts +1 -0
- package/dist/composite-8Z1YCmUf.js +161 -0
- package/dist/composite-DTxBFZq_.js +328 -0
- package/dist/createBaseUIEventDetails-BHkB1IRT.js +36 -0
- package/dist/dawn-ui-react.js +38096 -11606
- package/dist/dawn-ui-react.umd.cjs +176 -27
- package/dist/{form-context-DqrRdk0d.js → form-context-CpevRrMx.js} +541 -515
- package/dist/input.types-DDZuq7AK.js +21 -0
- package/dist/label-C57cQsPN.js +50 -0
- package/dist/owner-CZ-bExcn.js +6 -0
- package/dist/serializeValue-DadF0djs.js +12 -0
- package/dist/shadowDom-nxuQhD_O.js +25 -0
- package/dist/styles.css +149 -118
- package/dist/useBaseUiId-DJ56dhex.js +25 -0
- package/dist/useCompositeListItem-CuKiOJnK.js +53 -0
- package/dist/useControlled-kefeIBTp.js +48 -0
- package/dist/useLabelableId-Cb5S9nao.js +39 -0
- package/dist/useOpenChangeComplete-D1bYAEWf.js +178 -0
- package/dist/useRegisterFieldControl-I4gdfodR.js +27 -0
- package/dist/visuallyHidden-C0MRt467.js +21 -0
- package/package.json +42 -37
- package/dist/clamp-CYKyjuJR.js +0 -3033
- package/dist/field-description-BDRJXMS8.js +0 -12
- package/dist/field-errors-DVQtEKG3.js +0 -19
- package/dist/field-input-Doplzz0V.js +0 -58
- package/dist/field-input-group-CzX_hAjq.js +0 -18
- package/dist/field-input-group-input-micw-J2Y.js +0 -20
- package/dist/field-label-C2atREm0.js +0 -16
- package/dist/field-select--mY7GbNz.js +0 -2149
- package/dist/field-slider-D54-Z8Ds.js +0 -2167
- package/dist/input-group-DgFUfXr7.js +0 -12
- package/dist/input-group-input-DNZQ6g-3.js +0 -11
- package/dist/input.types-D8b-1Bcm.js +0 -21
- package/dist/rolldown-runtime-CAFD8bLK.js +0 -11
- package/dist/useLabelableId-BaWKrZ8_.js +0 -271
|
@@ -0,0 +1,801 @@
|
|
|
1
|
+
import { G as e, I as t, J as n, K as r, M as i, N as a, O as o, Q as s, X as c, Z as l, j as u, x as ee, z as d } from "./form-context-CpevRrMx.js";
|
|
2
|
+
import { M as f, d as p, t as m, w as te } from "./createBaseUIEventDetails-BHkB1IRT.js";
|
|
3
|
+
import { n as h } from "./useBaseUiId-DJ56dhex.js";
|
|
4
|
+
import { l as g } from "./useOpenChangeComplete-D1bYAEWf.js";
|
|
5
|
+
import { H as _, J as v, N as y, W as ne, j as b } from "./composite-DTxBFZq_.js";
|
|
6
|
+
import { n as x, r as re } from "./shadowDom-nxuQhD_O.js";
|
|
7
|
+
import { t as ie } from "./owner-CZ-bExcn.js";
|
|
8
|
+
import * as S from "react";
|
|
9
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
10
|
+
import { useSyncExternalStore as w } from "use-sync-external-store/shim";
|
|
11
|
+
import { useSyncExternalStoreWithSelector as T } from "use-sync-external-store/shim/with-selector";
|
|
12
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/floating-ui-react/utils/element.js
|
|
13
|
+
function E(e, t) {
|
|
14
|
+
if (!u(e)) return !1;
|
|
15
|
+
let n = e;
|
|
16
|
+
if (t.hasElement(n)) return !n.hasAttribute("data-trigger-disabled");
|
|
17
|
+
for (let [, e] of t.entries()) if (x(e, n)) return !e.hasAttribute("data-trigger-disabled");
|
|
18
|
+
return !1;
|
|
19
|
+
}
|
|
20
|
+
function D(e, t) {
|
|
21
|
+
if (t == null) return !1;
|
|
22
|
+
if ("composedPath" in e) return e.composedPath().includes(t);
|
|
23
|
+
let n = e;
|
|
24
|
+
return n.target != null && t.contains(n.target);
|
|
25
|
+
}
|
|
26
|
+
function ae(e) {
|
|
27
|
+
return e.matches("html,body");
|
|
28
|
+
}
|
|
29
|
+
function O(e) {
|
|
30
|
+
return i(e) && e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])");
|
|
31
|
+
}
|
|
32
|
+
function k(e) {
|
|
33
|
+
return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${ne}`) != null;
|
|
34
|
+
}
|
|
35
|
+
function oe(e) {
|
|
36
|
+
return e ? e.getAttribute("role") === "combobox" && O(e) : !1;
|
|
37
|
+
}
|
|
38
|
+
function se(e) {
|
|
39
|
+
if (!e || v) return !0;
|
|
40
|
+
try {
|
|
41
|
+
return e.matches(":focus-visible");
|
|
42
|
+
} catch {
|
|
43
|
+
return !0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function A(e) {
|
|
47
|
+
return e ? e.hasAttribute("data-base-ui-focusable") ? e : e.querySelector("[data-base-ui-focusable]") || e : null;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/floating-ui-react/utils/nodes.js
|
|
51
|
+
function j(e, t, n = !0) {
|
|
52
|
+
return e.filter((e) => e.parentId === t).flatMap((t) => [...!n || t.context?.open ? [t] : [], ...j(e, t.id, n)]);
|
|
53
|
+
}
|
|
54
|
+
function M(e, t) {
|
|
55
|
+
let n = [], r = e.find((e) => e.id === t)?.parentId;
|
|
56
|
+
for (; r;) {
|
|
57
|
+
let t = e.find((e) => e.id === r);
|
|
58
|
+
r = t?.parentId, t && (n = n.concat(t));
|
|
59
|
+
}
|
|
60
|
+
return n;
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/utils/esm/addEventListener.js
|
|
64
|
+
function N(e, t, n, r) {
|
|
65
|
+
return e.addEventListener(t, n, r), () => {
|
|
66
|
+
e.removeEventListener(t, n, r);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/utils/esm/useOnFirstRender.js
|
|
71
|
+
function P(e) {
|
|
72
|
+
let t = S.useRef(!0);
|
|
73
|
+
t.current && (t.current = !1, e());
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/utils/esm/useTimeout.js
|
|
77
|
+
var F = 0, I = class e {
|
|
78
|
+
static create() {
|
|
79
|
+
return new e();
|
|
80
|
+
}
|
|
81
|
+
currentId = F;
|
|
82
|
+
start(e, t) {
|
|
83
|
+
this.clear(), this.currentId = setTimeout(() => {
|
|
84
|
+
this.currentId = F, t();
|
|
85
|
+
}, e);
|
|
86
|
+
}
|
|
87
|
+
isStarted() {
|
|
88
|
+
return this.currentId !== F;
|
|
89
|
+
}
|
|
90
|
+
clear = () => {
|
|
91
|
+
this.currentId !== F && (clearTimeout(this.currentId), this.currentId = F);
|
|
92
|
+
};
|
|
93
|
+
disposeEffect = () => this.clear;
|
|
94
|
+
};
|
|
95
|
+
function L() {
|
|
96
|
+
let e = s(I.create).current;
|
|
97
|
+
return g(e.disposeEffect), e;
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/utils/esm/mergeCleanups.js
|
|
101
|
+
function R(...e) {
|
|
102
|
+
return () => {
|
|
103
|
+
for (let t = 0; t < e.length; t += 1) {
|
|
104
|
+
let n = e[t];
|
|
105
|
+
n && n();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/utils/esm/useValueAsRef.js
|
|
111
|
+
function ce(e) {
|
|
112
|
+
let t = s(z, e).current;
|
|
113
|
+
return t.next = e, c(t.effect), t;
|
|
114
|
+
}
|
|
115
|
+
function z(e) {
|
|
116
|
+
let t = {
|
|
117
|
+
current: e,
|
|
118
|
+
next: e,
|
|
119
|
+
effect: () => {
|
|
120
|
+
t.current = t.next;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
return t;
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/floating-ui-react/utils/createAttribute.js
|
|
127
|
+
function le(e) {
|
|
128
|
+
return `data-base-ui-${e}`;
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/floating-ui-react/utils/createEventEmitter.js
|
|
132
|
+
function B() {
|
|
133
|
+
let e = /* @__PURE__ */ new Map();
|
|
134
|
+
return {
|
|
135
|
+
emit(t, n) {
|
|
136
|
+
e.get(t)?.forEach((e) => e(n));
|
|
137
|
+
},
|
|
138
|
+
on(t, n) {
|
|
139
|
+
e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(n);
|
|
140
|
+
},
|
|
141
|
+
off(t, n) {
|
|
142
|
+
e.get(t)?.delete(n);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingTreeStore.js
|
|
148
|
+
var V = class {
|
|
149
|
+
nodesRef = { current: [] };
|
|
150
|
+
events = B();
|
|
151
|
+
addNode(e) {
|
|
152
|
+
this.nodesRef.current.push(e);
|
|
153
|
+
}
|
|
154
|
+
removeNode(e) {
|
|
155
|
+
let t = this.nodesRef.current.findIndex((t) => t === e);
|
|
156
|
+
t !== -1 && this.nodesRef.current.splice(t, 1);
|
|
157
|
+
}
|
|
158
|
+
}, H = /* @__PURE__ */ S.createContext(null);
|
|
159
|
+
process.env.NODE_ENV !== "production" && (H.displayName = "FloatingNodeContext");
|
|
160
|
+
var U = /* @__PURE__ */ S.createContext(null);
|
|
161
|
+
process.env.NODE_ENV !== "production" && (U.displayName = "FloatingTreeContext");
|
|
162
|
+
var W = () => S.useContext(H)?.id || null, G = (e) => {
|
|
163
|
+
let t = S.useContext(U);
|
|
164
|
+
return e ?? t;
|
|
165
|
+
};
|
|
166
|
+
function K(e) {
|
|
167
|
+
let t = h(), n = G(e), r = W();
|
|
168
|
+
return c(() => {
|
|
169
|
+
if (!t) return;
|
|
170
|
+
let e = {
|
|
171
|
+
id: t,
|
|
172
|
+
parentId: r
|
|
173
|
+
};
|
|
174
|
+
return n?.addNode(e), () => {
|
|
175
|
+
n?.removeNode(e);
|
|
176
|
+
};
|
|
177
|
+
}, [
|
|
178
|
+
n,
|
|
179
|
+
t,
|
|
180
|
+
r
|
|
181
|
+
]), t;
|
|
182
|
+
}
|
|
183
|
+
function q(e) {
|
|
184
|
+
let { children: t, id: n } = e, r = W();
|
|
185
|
+
return /* @__PURE__ */ C(H.Provider, {
|
|
186
|
+
value: S.useMemo(() => ({
|
|
187
|
+
id: n,
|
|
188
|
+
parentId: r
|
|
189
|
+
}), [n, r]),
|
|
190
|
+
children: t
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
function J(e) {
|
|
194
|
+
let { children: t, externalTree: n } = e, r = s(() => n ?? new V()).current;
|
|
195
|
+
return /* @__PURE__ */ C(U.Provider, {
|
|
196
|
+
value: r,
|
|
197
|
+
children: t
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useDismiss.js
|
|
202
|
+
var ue = {
|
|
203
|
+
intentional: "onClick",
|
|
204
|
+
sloppy: "onPointerDown"
|
|
205
|
+
};
|
|
206
|
+
function Y() {
|
|
207
|
+
return !1;
|
|
208
|
+
}
|
|
209
|
+
function de(e) {
|
|
210
|
+
return {
|
|
211
|
+
escapeKey: typeof e == "boolean" ? e : e?.escapeKey ?? !1,
|
|
212
|
+
outsidePress: typeof e == "boolean" ? e : e?.outsidePress ?? !0
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
function X(e, n = {}) {
|
|
216
|
+
let r = "rootStore" in e ? e.rootStore : e, s = r.useState("open"), c = r.useState("floatingElement"), { dataRef: h } = r.context, { enabled: g = !0, escapeKey: _ = !0, outsidePress: v = !0, outsidePressEvent: ne = "sloppy", referencePress: b = Y, referencePressEvent: C = "sloppy", bubbles: w, externalTree: T } = n, E = G(T), O = l(typeof v == "function" ? v : () => !1), k = typeof v == "function" ? O : v, oe = k !== !1, se = l(() => ne), A = S.useRef(!1), M = S.useRef(!1), P = S.useRef(!1), { escapeKey: F, outsidePress: ce } = de(w), z = S.useRef(null), B = L(), V = L(), H = l(() => {
|
|
217
|
+
V.clear(), h.current.insideReactTree = !1;
|
|
218
|
+
}), U = S.useRef(!1), W = S.useRef(""), K = l(b), q = l((e) => {
|
|
219
|
+
if (!s || !g || !_ || e.key !== "Escape" || U.current) return;
|
|
220
|
+
let t = h.current.floatingContext?.nodeId, n = E ? j(E.nodesRef.current, t) : [];
|
|
221
|
+
if (!F && n.length > 0) {
|
|
222
|
+
let e = !0;
|
|
223
|
+
if (n.forEach((t) => {
|
|
224
|
+
t.context?.open && !t.context.dataRef.current.__escapeKeyBubbles && (e = !1);
|
|
225
|
+
}), !e) return;
|
|
226
|
+
}
|
|
227
|
+
let i = m(p, y(e) ? e.nativeEvent : e);
|
|
228
|
+
r.setOpen(!1, i), !F && !i.isPropagationAllowed && e.stopPropagation();
|
|
229
|
+
}), J = l(() => {
|
|
230
|
+
h.current.insideReactTree = !0, V.start(0, H);
|
|
231
|
+
});
|
|
232
|
+
S.useEffect(() => {
|
|
233
|
+
if (!s || !g) return;
|
|
234
|
+
h.current.__escapeKeyBubbles = F, h.current.__outsidePressBubbles = ce;
|
|
235
|
+
let e = new I(), n = new I();
|
|
236
|
+
function l() {
|
|
237
|
+
e.clear(), U.current = !0;
|
|
238
|
+
}
|
|
239
|
+
function f() {
|
|
240
|
+
e.start(d() ? 5 : 0, () => {
|
|
241
|
+
U.current = !1;
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
function p() {
|
|
245
|
+
P.current = !0, n.start(0, () => {
|
|
246
|
+
P.current = !1;
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
function v() {
|
|
250
|
+
A.current = !1, M.current = !1;
|
|
251
|
+
}
|
|
252
|
+
function y() {
|
|
253
|
+
let e = W.current, t = e === "pen" || !e ? "mouse" : e, n = se(), r = typeof n == "function" ? n() : n;
|
|
254
|
+
return typeof r == "string" ? r : r[t];
|
|
255
|
+
}
|
|
256
|
+
function ne(e) {
|
|
257
|
+
let t = y();
|
|
258
|
+
return t === "intentional" && e.type !== "click" || t === "sloppy" && e.type === "click";
|
|
259
|
+
}
|
|
260
|
+
function b(e) {
|
|
261
|
+
let t = h.current.floatingContext?.nodeId, n = E && j(E.nodesRef.current, t).some((t) => D(e, t.context?.elements.floating));
|
|
262
|
+
return D(e, r.select("floatingElement")) || D(e, r.select("domReferenceElement")) || n;
|
|
263
|
+
}
|
|
264
|
+
function S(e) {
|
|
265
|
+
if (ne(e)) {
|
|
266
|
+
H();
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
if (h.current.insideReactTree) {
|
|
270
|
+
H();
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
let s = re(e), c = `[${le("inert")}]`, l = u(s) ? s.getRootNode() : null, d = Array.from((t(l) ? l : ie(r.select("floatingElement"))).querySelectorAll(c)), f = r.context.triggerElements;
|
|
274
|
+
if (s && (f.hasElement(s) || f.hasMatchingElement((e) => x(e, s)))) return;
|
|
275
|
+
let p = u(s) ? s : null;
|
|
276
|
+
for (; p && !a(p);) {
|
|
277
|
+
let e = o(p);
|
|
278
|
+
if (a(e) || !u(e)) break;
|
|
279
|
+
p = e;
|
|
280
|
+
}
|
|
281
|
+
if (d.length && u(s) && !ae(s) && !x(s, r.select("floatingElement")) && d.every((e) => !x(p, e))) return;
|
|
282
|
+
if (i(s) && !("touches" in e)) {
|
|
283
|
+
let t = a(s), n = ee(s), r = /auto|scroll/, i = t || r.test(n.overflowX), o = t || r.test(n.overflowY), c = i && s.clientWidth > 0 && s.scrollWidth > s.clientWidth, l = o && s.clientHeight > 0 && s.scrollHeight > s.clientHeight, u = n.direction === "rtl", d = l && (u ? e.offsetX <= s.offsetWidth - s.clientWidth : e.offsetX > s.clientWidth), f = c && e.offsetY > s.clientHeight;
|
|
284
|
+
if (d || f) return;
|
|
285
|
+
}
|
|
286
|
+
if (b(e)) return;
|
|
287
|
+
if (y() === "intentional" && P.current) {
|
|
288
|
+
n.clear(), P.current = !1;
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
if (typeof k == "function" && !k(e)) return;
|
|
292
|
+
let g = h.current.floatingContext?.nodeId, _ = E ? j(E.nodesRef.current, g) : [];
|
|
293
|
+
if (_.length > 0) {
|
|
294
|
+
let e = !0;
|
|
295
|
+
if (_.forEach((t) => {
|
|
296
|
+
t.context?.open && !t.context.dataRef.current.__outsidePressBubbles && (e = !1);
|
|
297
|
+
}), !e) return;
|
|
298
|
+
}
|
|
299
|
+
r.setOpen(!1, m(te, e)), H();
|
|
300
|
+
}
|
|
301
|
+
function C(e) {
|
|
302
|
+
y() !== "sloppy" || e.pointerType === "touch" || !r.select("open") || !g || D(e, r.select("floatingElement")) || D(e, r.select("domReferenceElement")) || S(e);
|
|
303
|
+
}
|
|
304
|
+
function w(e) {
|
|
305
|
+
if (y() !== "sloppy" || !r.select("open") || !g || D(e, r.select("floatingElement")) || D(e, r.select("domReferenceElement"))) return;
|
|
306
|
+
let t = e.touches[0];
|
|
307
|
+
t && (z.current = {
|
|
308
|
+
startTime: Date.now(),
|
|
309
|
+
startX: t.clientX,
|
|
310
|
+
startY: t.clientY,
|
|
311
|
+
dismissOnTouchEnd: !1,
|
|
312
|
+
dismissOnMouseDown: !0
|
|
313
|
+
}, B.start(1e3, () => {
|
|
314
|
+
z.current && (z.current.dismissOnTouchEnd = !1, z.current.dismissOnMouseDown = !1);
|
|
315
|
+
}));
|
|
316
|
+
}
|
|
317
|
+
function T(e, t) {
|
|
318
|
+
let n = re(e);
|
|
319
|
+
if (!n) return;
|
|
320
|
+
let r = N(n, e.type, () => {
|
|
321
|
+
t(e), r();
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
function O(e) {
|
|
325
|
+
W.current = "touch", T(e, w);
|
|
326
|
+
}
|
|
327
|
+
function L(e) {
|
|
328
|
+
B.clear(), e.type === "pointerdown" && (W.current = e.pointerType), !(e.type === "mousedown" && z.current && !z.current.dismissOnMouseDown) && T(e, (e) => {
|
|
329
|
+
e.type === "pointerdown" ? C(e) : S(e);
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
function V(e) {
|
|
333
|
+
if (!A.current) return;
|
|
334
|
+
let t = M.current;
|
|
335
|
+
if (v(), y() === "intentional") {
|
|
336
|
+
if (e.type === "pointercancel") {
|
|
337
|
+
t && p();
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
if (!b(e)) {
|
|
341
|
+
if (t) {
|
|
342
|
+
p();
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
typeof k == "function" && !k(e) || (n.clear(), P.current = !0, H());
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
function G(e) {
|
|
350
|
+
if (y() !== "sloppy" || !z.current || D(e, r.select("floatingElement")) || D(e, r.select("domReferenceElement"))) return;
|
|
351
|
+
let t = e.touches[0];
|
|
352
|
+
if (!t) return;
|
|
353
|
+
let n = Math.abs(t.clientX - z.current.startX), i = Math.abs(t.clientY - z.current.startY), a = Math.sqrt(n * n + i * i);
|
|
354
|
+
a > 5 && (z.current.dismissOnTouchEnd = !0), a > 10 && (S(e), B.clear(), z.current = null);
|
|
355
|
+
}
|
|
356
|
+
function K(e) {
|
|
357
|
+
T(e, G);
|
|
358
|
+
}
|
|
359
|
+
function J(e) {
|
|
360
|
+
y() !== "sloppy" || !z.current || D(e, r.select("floatingElement")) || D(e, r.select("domReferenceElement")) || (z.current.dismissOnTouchEnd && S(e), B.clear(), z.current = null);
|
|
361
|
+
}
|
|
362
|
+
function ue(e) {
|
|
363
|
+
T(e, J);
|
|
364
|
+
}
|
|
365
|
+
let Y = ie(c), de = R(_ && R(N(Y, "keydown", q), N(Y, "compositionstart", l), N(Y, "compositionend", f)), oe && R(N(Y, "click", L, !0), N(Y, "pointerdown", L, !0), N(Y, "pointerup", V, !0), N(Y, "pointercancel", V, !0), N(Y, "mousedown", L, !0), N(Y, "mouseup", V, !0), N(Y, "touchstart", O, !0), N(Y, "touchmove", K, !0), N(Y, "touchend", ue, !0)));
|
|
366
|
+
return () => {
|
|
367
|
+
de(), e.clear(), n.clear(), v(), P.current = !1;
|
|
368
|
+
};
|
|
369
|
+
}, [
|
|
370
|
+
h,
|
|
371
|
+
c,
|
|
372
|
+
_,
|
|
373
|
+
oe,
|
|
374
|
+
k,
|
|
375
|
+
s,
|
|
376
|
+
g,
|
|
377
|
+
F,
|
|
378
|
+
ce,
|
|
379
|
+
q,
|
|
380
|
+
H,
|
|
381
|
+
se,
|
|
382
|
+
E,
|
|
383
|
+
r,
|
|
384
|
+
B
|
|
385
|
+
]), S.useEffect(H, [k, H]);
|
|
386
|
+
let X = S.useMemo(() => ({
|
|
387
|
+
onKeyDown: q,
|
|
388
|
+
[ue[C]]: (e) => {
|
|
389
|
+
K() && r.setOpen(!1, m(f, e.nativeEvent));
|
|
390
|
+
},
|
|
391
|
+
...C !== "intentional" && { onClick(e) {
|
|
392
|
+
K() && r.setOpen(!1, m("trigger-press", e.nativeEvent));
|
|
393
|
+
} }
|
|
394
|
+
}), [
|
|
395
|
+
q,
|
|
396
|
+
r,
|
|
397
|
+
C,
|
|
398
|
+
K
|
|
399
|
+
]), Z = l((e) => {
|
|
400
|
+
if (!s || !g || e.button !== 0) return;
|
|
401
|
+
let t = re(e.nativeEvent);
|
|
402
|
+
x(r.select("floatingElement"), t) && (A.current || (A.current = !0, M.current = !1));
|
|
403
|
+
}), Q = l((e) => {
|
|
404
|
+
!s || !g || (e.defaultPrevented || e.nativeEvent.defaultPrevented) && A.current && (M.current = !0);
|
|
405
|
+
}), $ = S.useMemo(() => ({
|
|
406
|
+
onKeyDown: q,
|
|
407
|
+
onPointerDown: Q,
|
|
408
|
+
onMouseDown: Q,
|
|
409
|
+
onClickCapture: J,
|
|
410
|
+
onMouseDownCapture(e) {
|
|
411
|
+
J(), Z(e);
|
|
412
|
+
},
|
|
413
|
+
onPointerDownCapture(e) {
|
|
414
|
+
J(), Z(e);
|
|
415
|
+
},
|
|
416
|
+
onMouseUpCapture: J,
|
|
417
|
+
onTouchEndCapture: J,
|
|
418
|
+
onTouchMoveCapture: J
|
|
419
|
+
}), [
|
|
420
|
+
q,
|
|
421
|
+
J,
|
|
422
|
+
Z,
|
|
423
|
+
Q
|
|
424
|
+
]);
|
|
425
|
+
return S.useMemo(() => g ? {
|
|
426
|
+
reference: X,
|
|
427
|
+
floating: $,
|
|
428
|
+
trigger: X
|
|
429
|
+
} : {}, [
|
|
430
|
+
g,
|
|
431
|
+
X,
|
|
432
|
+
$
|
|
433
|
+
]);
|
|
434
|
+
}
|
|
435
|
+
//#endregion
|
|
436
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/utils/esm/store/createSelector.js
|
|
437
|
+
var Z = (e, t, r, i, a, o, ...s) => {
|
|
438
|
+
if (s.length > 0) throw Error(process.env.NODE_ENV === "production" ? n(1) : "Unsupported number of selectors");
|
|
439
|
+
let c;
|
|
440
|
+
if (e && t && r && i && a && o) c = (n, s, c, l) => o(e(n, s, c, l), t(n, s, c, l), r(n, s, c, l), i(n, s, c, l), a(n, s, c, l), s, c, l);
|
|
441
|
+
else if (e && t && r && i && a) c = (n, o, s, c) => a(e(n, o, s, c), t(n, o, s, c), r(n, o, s, c), i(n, o, s, c), o, s, c);
|
|
442
|
+
else if (e && t && r && i) c = (n, a, o, s) => i(e(n, a, o, s), t(n, a, o, s), r(n, a, o, s), a, o, s);
|
|
443
|
+
else if (e && t && r) c = (n, i, a, o) => r(e(n, i, a, o), t(n, i, a, o), i, a, o);
|
|
444
|
+
else if (e && t) c = (n, r, i, a) => t(e(n, r, i, a), r, i, a);
|
|
445
|
+
else if (e) c = e;
|
|
446
|
+
else throw Error("Missing arguments");
|
|
447
|
+
return c;
|
|
448
|
+
}, Q = [], $ = void 0;
|
|
449
|
+
function fe() {
|
|
450
|
+
return $;
|
|
451
|
+
}
|
|
452
|
+
function pe(e) {
|
|
453
|
+
Q.push(e);
|
|
454
|
+
}
|
|
455
|
+
function me(e) {
|
|
456
|
+
let t = (t, n) => {
|
|
457
|
+
let r = s(ge).current, i;
|
|
458
|
+
try {
|
|
459
|
+
$ = r;
|
|
460
|
+
for (let e of Q) e.before(r);
|
|
461
|
+
i = e(t, n);
|
|
462
|
+
for (let e of Q) e.after(r);
|
|
463
|
+
r.didInitialize = !0;
|
|
464
|
+
} finally {
|
|
465
|
+
$ = void 0;
|
|
466
|
+
}
|
|
467
|
+
return i;
|
|
468
|
+
};
|
|
469
|
+
return t.displayName = e.displayName || e.name, t;
|
|
470
|
+
}
|
|
471
|
+
function he(e) {
|
|
472
|
+
return /* @__PURE__ */ S.forwardRef(me(e));
|
|
473
|
+
}
|
|
474
|
+
function ge() {
|
|
475
|
+
return { didInitialize: !1 };
|
|
476
|
+
}
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/utils/esm/store/useStore.js
|
|
479
|
+
var _e = r(19) ? be : xe;
|
|
480
|
+
function ve(e, t, n, r, i) {
|
|
481
|
+
return _e(e, t, n, r, i);
|
|
482
|
+
}
|
|
483
|
+
function ye(e, t, n, r, i) {
|
|
484
|
+
let a = S.useCallback(() => t(e.getSnapshot(), n, r, i), [
|
|
485
|
+
e,
|
|
486
|
+
t,
|
|
487
|
+
n,
|
|
488
|
+
r,
|
|
489
|
+
i
|
|
490
|
+
]);
|
|
491
|
+
return w(e.subscribe, a, a);
|
|
492
|
+
}
|
|
493
|
+
pe({
|
|
494
|
+
before(e) {
|
|
495
|
+
e.syncIndex = 0, e.didInitialize || (e.syncTick = 1, e.syncHooks = [], e.didChangeStore = !0, e.getSnapshot = () => {
|
|
496
|
+
let t = !1;
|
|
497
|
+
for (let n = 0; n < e.syncHooks.length; n += 1) {
|
|
498
|
+
let r = e.syncHooks[n], i = r.selector(r.store.state, r.a1, r.a2, r.a3);
|
|
499
|
+
(r.didChange || !Object.is(r.value, i)) && (t = !0, r.value = i, r.didChange = !1);
|
|
500
|
+
}
|
|
501
|
+
return t && (e.syncTick += 1), e.syncTick;
|
|
502
|
+
});
|
|
503
|
+
},
|
|
504
|
+
after(e) {
|
|
505
|
+
e.syncHooks.length > 0 && (e.didChangeStore && (e.didChangeStore = !1, e.subscribe = (t) => {
|
|
506
|
+
let n = /* @__PURE__ */ new Set();
|
|
507
|
+
for (let t of e.syncHooks) n.add(t.store);
|
|
508
|
+
let r = [];
|
|
509
|
+
for (let e of n) r.push(e.subscribe(t));
|
|
510
|
+
return () => {
|
|
511
|
+
for (let e of r) e();
|
|
512
|
+
};
|
|
513
|
+
}), w(e.subscribe, e.getSnapshot, e.getSnapshot));
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
function be(e, t, n, r, i) {
|
|
517
|
+
let a = fe();
|
|
518
|
+
if (!a) return ye(e, t, n, r, i);
|
|
519
|
+
let o = a.syncIndex;
|
|
520
|
+
a.syncIndex += 1;
|
|
521
|
+
let s;
|
|
522
|
+
return a.didInitialize ? (s = a.syncHooks[o], (s.store !== e || s.selector !== t || !Object.is(s.a1, n) || !Object.is(s.a2, r) || !Object.is(s.a3, i)) && (s.store !== e && (a.didChangeStore = !0), s.store = e, s.selector = t, s.a1 = n, s.a2 = r, s.a3 = i, s.didChange = !0)) : (s = {
|
|
523
|
+
store: e,
|
|
524
|
+
selector: t,
|
|
525
|
+
a1: n,
|
|
526
|
+
a2: r,
|
|
527
|
+
a3: i,
|
|
528
|
+
value: t(e.getSnapshot(), n, r, i),
|
|
529
|
+
didChange: !1
|
|
530
|
+
}, a.syncHooks.push(s)), s.value;
|
|
531
|
+
}
|
|
532
|
+
function xe(e, t, n, r, i) {
|
|
533
|
+
return T(e.subscribe, e.getSnapshot, e.getSnapshot, (e) => t(e, n, r, i));
|
|
534
|
+
}
|
|
535
|
+
//#endregion
|
|
536
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/utils/esm/store/Store.js
|
|
537
|
+
var Se = class {
|
|
538
|
+
constructor(e) {
|
|
539
|
+
this.state = e, this.listeners = /* @__PURE__ */ new Set(), this.updateTick = 0;
|
|
540
|
+
}
|
|
541
|
+
subscribe = (e) => (this.listeners.add(e), () => {
|
|
542
|
+
this.listeners.delete(e);
|
|
543
|
+
});
|
|
544
|
+
getSnapshot = () => this.state;
|
|
545
|
+
setState(e) {
|
|
546
|
+
if (this.state === e) return;
|
|
547
|
+
this.state = e, this.updateTick += 1;
|
|
548
|
+
let t = this.updateTick;
|
|
549
|
+
for (let n of this.listeners) {
|
|
550
|
+
if (t !== this.updateTick) return;
|
|
551
|
+
n(e);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
update(e) {
|
|
555
|
+
for (let t in e) if (!Object.is(this.state[t], e[t])) {
|
|
556
|
+
this.setState({
|
|
557
|
+
...this.state,
|
|
558
|
+
...e
|
|
559
|
+
});
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
set(e, t) {
|
|
564
|
+
Object.is(this.state[e], t) || this.setState({
|
|
565
|
+
...this.state,
|
|
566
|
+
[e]: t
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
notifyAll() {
|
|
570
|
+
let e = { ...this.state };
|
|
571
|
+
this.setState(e);
|
|
572
|
+
}
|
|
573
|
+
use(e, t, n, r) {
|
|
574
|
+
return ve(this, e, t, n, r);
|
|
575
|
+
}
|
|
576
|
+
}, Ce = class extends Se {
|
|
577
|
+
constructor(e, t = {}, n) {
|
|
578
|
+
super(e), this.context = t, this.selectors = n;
|
|
579
|
+
}
|
|
580
|
+
useSyncedValue(e, t) {
|
|
581
|
+
S.useDebugValue(e), c(() => {
|
|
582
|
+
this.state[e] !== t && this.set(e, t);
|
|
583
|
+
}, [e, t]);
|
|
584
|
+
}
|
|
585
|
+
useSyncedValueWithCleanup(e, t) {
|
|
586
|
+
let n = this;
|
|
587
|
+
c(() => (n.state[e] !== t && n.set(e, t), () => {
|
|
588
|
+
n.set(e, void 0);
|
|
589
|
+
}), [
|
|
590
|
+
n,
|
|
591
|
+
e,
|
|
592
|
+
t
|
|
593
|
+
]);
|
|
594
|
+
}
|
|
595
|
+
useSyncedValues(e) {
|
|
596
|
+
let t = this;
|
|
597
|
+
if (process.env.NODE_ENV !== "production") {
|
|
598
|
+
S.useDebugValue(e, (e) => Object.keys(e));
|
|
599
|
+
let t = S.useRef(Object.keys(e)).current, n = Object.keys(e);
|
|
600
|
+
(t.length !== n.length || t.some((e, t) => e !== n[t])) && console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.");
|
|
601
|
+
}
|
|
602
|
+
c(() => {
|
|
603
|
+
t.update(e);
|
|
604
|
+
}, [t, ...Object.values(e)]);
|
|
605
|
+
}
|
|
606
|
+
useControlledProp(e, t) {
|
|
607
|
+
S.useDebugValue(e);
|
|
608
|
+
let n = t !== void 0;
|
|
609
|
+
if (c(() => {
|
|
610
|
+
n && !Object.is(this.state[e], t) && super.setState({
|
|
611
|
+
...this.state,
|
|
612
|
+
[e]: t
|
|
613
|
+
});
|
|
614
|
+
}, [
|
|
615
|
+
e,
|
|
616
|
+
t,
|
|
617
|
+
n
|
|
618
|
+
]), process.env.NODE_ENV !== "production") {
|
|
619
|
+
let t = this.controlledValues ??= /* @__PURE__ */ new Map();
|
|
620
|
+
t.has(e) || t.set(e, n);
|
|
621
|
+
let r = t.get(e);
|
|
622
|
+
r !== void 0 && r !== n && console.error(`A component is changing the ${n ? "" : "un"}controlled state of ${e.toString()} to be ${n ? "un" : ""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
select(e, t, n, r) {
|
|
626
|
+
let i = this.selectors[e];
|
|
627
|
+
return i(this.state, t, n, r);
|
|
628
|
+
}
|
|
629
|
+
useState(e, t, n, r) {
|
|
630
|
+
return S.useDebugValue(e), ve(this, this.selectors[e], t, n, r);
|
|
631
|
+
}
|
|
632
|
+
useContextCallback(t, n) {
|
|
633
|
+
S.useDebugValue(t);
|
|
634
|
+
let r = l(n ?? e);
|
|
635
|
+
this.context[t] = r;
|
|
636
|
+
}
|
|
637
|
+
useStateSetter(e) {
|
|
638
|
+
let t = S.useRef(void 0);
|
|
639
|
+
return t.current === void 0 && (t.current = (t) => {
|
|
640
|
+
this.set(e, t);
|
|
641
|
+
}), t.current;
|
|
642
|
+
}
|
|
643
|
+
observe(e, t) {
|
|
644
|
+
let n;
|
|
645
|
+
n = typeof e == "function" ? e : this.selectors[e];
|
|
646
|
+
let r = n(this.state);
|
|
647
|
+
return t(r, r, this), this.subscribe((e) => {
|
|
648
|
+
let i = n(e);
|
|
649
|
+
if (!Object.is(r, i)) {
|
|
650
|
+
let e = r;
|
|
651
|
+
r = i, t(i, e, this);
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
}, we = {
|
|
656
|
+
open: Z((e) => e.open),
|
|
657
|
+
transitionStatus: Z((e) => e.transitionStatus),
|
|
658
|
+
domReferenceElement: Z((e) => e.domReferenceElement),
|
|
659
|
+
referenceElement: Z((e) => e.positionReference ?? e.referenceElement),
|
|
660
|
+
floatingElement: Z((e) => e.floatingElement),
|
|
661
|
+
floatingId: Z((e) => e.floatingId)
|
|
662
|
+
}, Te = class extends Ce {
|
|
663
|
+
constructor(e) {
|
|
664
|
+
let { syncOnly: t, nested: n, onOpenChange: r, triggerElements: i, ...a } = e;
|
|
665
|
+
super({
|
|
666
|
+
...a,
|
|
667
|
+
positionReference: a.referenceElement,
|
|
668
|
+
domReferenceElement: a.referenceElement
|
|
669
|
+
}, {
|
|
670
|
+
onOpenChange: r,
|
|
671
|
+
dataRef: { current: {} },
|
|
672
|
+
events: B(),
|
|
673
|
+
nested: n,
|
|
674
|
+
triggerElements: i
|
|
675
|
+
}, we), this.syncOnly = t;
|
|
676
|
+
}
|
|
677
|
+
syncOpenEvent = (e, t) => {
|
|
678
|
+
(!e || !this.state.open || t != null && b(t)) && (this.context.dataRef.current.openEvent = e ? t : void 0);
|
|
679
|
+
};
|
|
680
|
+
dispatchOpenChange = (e, t) => {
|
|
681
|
+
this.syncOpenEvent(e, t.event);
|
|
682
|
+
let n = {
|
|
683
|
+
open: e,
|
|
684
|
+
reason: t.reason,
|
|
685
|
+
nativeEvent: t.event,
|
|
686
|
+
nested: this.context.nested,
|
|
687
|
+
triggerElement: t.trigger
|
|
688
|
+
};
|
|
689
|
+
this.context.events.emit("openchange", n);
|
|
690
|
+
};
|
|
691
|
+
setOpen = (e, t) => {
|
|
692
|
+
if (this.syncOnly) {
|
|
693
|
+
this.context.onOpenChange?.(e, t);
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
this.dispatchOpenChange(e, t), this.context.onOpenChange?.(e, t);
|
|
697
|
+
};
|
|
698
|
+
}, Ee = class {
|
|
699
|
+
constructor() {
|
|
700
|
+
this.elementsSet = /* @__PURE__ */ new Set(), this.idMap = /* @__PURE__ */ new Map();
|
|
701
|
+
}
|
|
702
|
+
add(e, t) {
|
|
703
|
+
let n = this.idMap.get(e);
|
|
704
|
+
if (n !== t && (n !== void 0 && this.elementsSet.delete(n), this.elementsSet.add(t), this.idMap.set(e, t), process.env.NODE_ENV !== "production" && this.elementsSet.size !== this.idMap.size)) throw Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.");
|
|
705
|
+
}
|
|
706
|
+
delete(e) {
|
|
707
|
+
let t = this.idMap.get(e);
|
|
708
|
+
t && (this.elementsSet.delete(t), this.idMap.delete(e));
|
|
709
|
+
}
|
|
710
|
+
hasElement(e) {
|
|
711
|
+
return this.elementsSet.has(e);
|
|
712
|
+
}
|
|
713
|
+
hasMatchingElement(e) {
|
|
714
|
+
for (let t of this.elementsSet) if (e(t)) return !0;
|
|
715
|
+
return !1;
|
|
716
|
+
}
|
|
717
|
+
getById(e) {
|
|
718
|
+
return this.idMap.get(e);
|
|
719
|
+
}
|
|
720
|
+
entries() {
|
|
721
|
+
return this.idMap.entries();
|
|
722
|
+
}
|
|
723
|
+
elements() {
|
|
724
|
+
return this.elementsSet.values();
|
|
725
|
+
}
|
|
726
|
+
get size() {
|
|
727
|
+
return this.idMap.size;
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
//#endregion
|
|
731
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFloatingRootContext.js
|
|
732
|
+
function De(e) {
|
|
733
|
+
let { open: t = !1, onOpenChange: n, elements: r = {} } = e, i = h(), a = W() != null;
|
|
734
|
+
if (process.env.NODE_ENV !== "production") {
|
|
735
|
+
let e = r.reference;
|
|
736
|
+
e && !u(e) && console.error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `context.setPositionReference()`", "instead.");
|
|
737
|
+
}
|
|
738
|
+
let o = s(() => new Te({
|
|
739
|
+
open: t,
|
|
740
|
+
transitionStatus: void 0,
|
|
741
|
+
onOpenChange: n,
|
|
742
|
+
referenceElement: r.reference ?? null,
|
|
743
|
+
floatingElement: r.floating ?? null,
|
|
744
|
+
triggerElements: new Ee(),
|
|
745
|
+
floatingId: i,
|
|
746
|
+
syncOnly: !1,
|
|
747
|
+
nested: a
|
|
748
|
+
})).current;
|
|
749
|
+
return c(() => {
|
|
750
|
+
let e = {
|
|
751
|
+
open: t,
|
|
752
|
+
floatingId: i
|
|
753
|
+
};
|
|
754
|
+
r.reference !== void 0 && (e.referenceElement = r.reference, e.domReferenceElement = u(r.reference) ? r.reference : null), r.floating !== void 0 && (e.floatingElement = r.floating), o.update(e);
|
|
755
|
+
}, [
|
|
756
|
+
t,
|
|
757
|
+
i,
|
|
758
|
+
r.reference,
|
|
759
|
+
r.floating,
|
|
760
|
+
o
|
|
761
|
+
]), o.context.onOpenChange = n, o.context.nested = a, o;
|
|
762
|
+
}
|
|
763
|
+
//#endregion
|
|
764
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useInteractions.js
|
|
765
|
+
function Oe(e = []) {
|
|
766
|
+
let t = e.map((e) => e?.reference), n = e.map((e) => e?.floating), r = e.map((e) => e?.item), i = e.map((e) => e?.trigger), a = S.useCallback((t) => ke(t, e, "reference"), t), o = S.useCallback((t) => ke(t, e, "floating"), n), s = S.useCallback((t) => ke(t, e, "item"), r), c = S.useCallback((t) => ke(t, e, "trigger"), i);
|
|
767
|
+
return S.useMemo(() => ({
|
|
768
|
+
getReferenceProps: a,
|
|
769
|
+
getFloatingProps: o,
|
|
770
|
+
getItemProps: s,
|
|
771
|
+
getTriggerProps: c
|
|
772
|
+
}), [
|
|
773
|
+
a,
|
|
774
|
+
o,
|
|
775
|
+
s,
|
|
776
|
+
c
|
|
777
|
+
]);
|
|
778
|
+
}
|
|
779
|
+
function ke(e, t, n) {
|
|
780
|
+
let r = /* @__PURE__ */ new Map(), i = n === "item", a = {};
|
|
781
|
+
n === "floating" && (a.tabIndex = -1, a[_] = "");
|
|
782
|
+
for (let t in e) i && e && (t === "active" || t === "selected") || (a[t] = e[t]);
|
|
783
|
+
for (let o = 0; o < t.length; o += 1) {
|
|
784
|
+
let s, c = t[o]?.[n];
|
|
785
|
+
s = typeof c == "function" ? e ? c(e) : null : c, s && Ae(a, s, i, r);
|
|
786
|
+
}
|
|
787
|
+
return Ae(a, e, i, r), a;
|
|
788
|
+
}
|
|
789
|
+
function Ae(e, t, n, r) {
|
|
790
|
+
for (let i in t) {
|
|
791
|
+
let a = t[i];
|
|
792
|
+
n && (i === "active" || i === "selected") || (i.startsWith("on") ? (r.has(i) || r.set(i, []), typeof a == "function" && (r.get(i)?.push(a), e[i] = (...e) => r.get(i)?.map((t) => t(...e)).find((e) => e !== void 0))) : e[i] = a);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
//#endregion
|
|
796
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/clamp.js
|
|
797
|
+
function je(e, t = -(2 ** 53 - 1), n = 2 ** 53 - 1) {
|
|
798
|
+
return Math.max(t, Math.min(e, n));
|
|
799
|
+
}
|
|
800
|
+
//#endregion
|
|
801
|
+
export { E as A, L as C, j as D, M as E, O as M, se as N, A as O, I as S, N as T, G as _, Te as a, ce as b, ve as c, Z as d, X as f, W as g, K as h, Ee as i, oe as j, k, me as l, J as m, Oe as n, Ce as o, q as p, De as r, Se as s, je as t, he as u, V as v, P as w, R as x, le as y };
|