fina-react-ds 0.0.0
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 +17 -0
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +4 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js +4 -0
- package/dist/components/alert-dialog.d.ts +16 -0
- package/dist/components/alert.d.ts +8 -0
- package/dist/components/alert.js +70 -0
- package/dist/components/avatar.d.ts +5 -0
- package/dist/components/avatar.js +58 -0
- package/dist/components/badge.d.ts +8 -0
- package/dist/components/badge.js +43 -0
- package/dist/components/button.d.ts +10 -0
- package/dist/components/button.js +152 -0
- package/dist/components/card.d.ts +8 -0
- package/dist/components/card.js +99 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.js +34 -0
- package/dist/components/dialog.d.ts +15 -0
- package/dist/components/dialog.js +148 -0
- package/dist/components/dropdown-menu.d.ts +25 -0
- package/dist/components/dropdown-menu.js +248 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/input.js +24 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.js +32 -0
- package/dist/components/pagination.d.ts +13 -0
- package/dist/components/pagination.js +128 -0
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.js +50 -0
- package/dist/components/select.d.ts +11 -0
- package/dist/components/select.js +48 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/simple-pagination.d.ts +6 -0
- package/dist/components/simple-pagination.js +34 -0
- package/dist/components/tabs.d.ts +7 -0
- package/dist/components/tabs.js +73 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/index.js +80 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +11 -0
- package/dist/lib.d.ts +16 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +534 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +430 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +215 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +159 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +149 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +12 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +80 -0
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +258 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +51 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +34 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +76 -0
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +265 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +12 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +133 -0
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +230 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +21 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +149 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-label/dist/index.js +22 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +663 -0
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +247 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +224 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +77 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +39 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +189 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +60 -0
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +168 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +59 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +17 -0
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +19 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
- package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +11 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +30 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +54 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +9 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +11 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +116 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +33 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +18 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +70 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +73 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +27 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +13 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +17 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +35 -0
- package/dist/node_modules/tslib/tslib.es6.js +31 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +9 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +29 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +28 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +21 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +72 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +73 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +62 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js +13 -0
- package/dist/themes/base.css +1982 -0
- package/dist/themes/pro.css +188 -0
- package/dist/themes/puulse-colors.css +388 -0
- package/package.json +114 -0
|
@@ -0,0 +1,663 @@
|
|
|
1
|
+
var qe = Object.defineProperty;
|
|
2
|
+
var m = (e, n) => qe(e, "name", { value: n, configurable: !0 });
|
|
3
|
+
import * as r from "react";
|
|
4
|
+
import { composeEventHandlers as v } from "../../primitive/dist/index.js";
|
|
5
|
+
import { createCollection as Je } from "../../react-collection/dist/index.js";
|
|
6
|
+
import { useComposedRefs as F, composeRefs as Qe } from "../../react-compose-refs/dist/index.js";
|
|
7
|
+
import { createContextScope as et } from "../../react-context/dist/index.js";
|
|
8
|
+
import { useDirection as tt } from "../../react-direction/dist/index.js";
|
|
9
|
+
import { DismissableLayer as nt } from "../../react-dismissable-layer/dist/index.js";
|
|
10
|
+
import { useFocusGuards as ot } from "../../react-focus-guards/dist/index.js";
|
|
11
|
+
import { FocusScope as rt } from "../../react-focus-scope/dist/index.js";
|
|
12
|
+
import { useId as he } from "../../react-id/dist/index.js";
|
|
13
|
+
import { createPopperScope as Ce, Root as ge, Anchor as ct, Content as at, Arrow as st } from "../../react-popper/dist/index.js";
|
|
14
|
+
import { Portal as ut } from "../../react-portal/dist/index.js";
|
|
15
|
+
import { Presence as z } from "../../react-presence/dist/index.js";
|
|
16
|
+
import { Primitive as L, dispatchDiscreteCustomEvent as it } from "../../react-primitive/dist/index.js";
|
|
17
|
+
import { createRovingFocusGroupScope as _e, Item as lt, Root as dt } from "../../react-roving-focus/dist/index.js";
|
|
18
|
+
import { createSlot as ft } from "../../react-slot/dist/index.js";
|
|
19
|
+
import { useCallbackRef as te } from "../../react-use-callback-ref/dist/index.js";
|
|
20
|
+
import { hideOthers as mt } from "../../../aria-hidden/dist/es2015/index.js";
|
|
21
|
+
import pt from "../../../react-remove-scroll/dist/es2015/Combination.js";
|
|
22
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
23
|
+
var ee = ["Enter", " "], Mt = ["ArrowDown", "PageUp", "Home"], Re = ["ArrowUp", "PageDown", "End"], ht = [...Mt, ...Re], vt = {
|
|
24
|
+
ltr: [...ee, "ArrowRight"],
|
|
25
|
+
rtl: [...ee, "ArrowLeft"]
|
|
26
|
+
}, Ct = {
|
|
27
|
+
ltr: ["ArrowLeft"],
|
|
28
|
+
rtl: ["ArrowRight"]
|
|
29
|
+
}, K = "Menu", [k, gt, _t] = Je(K), [y, un] = et(K, [
|
|
30
|
+
_t,
|
|
31
|
+
Ce,
|
|
32
|
+
_e
|
|
33
|
+
]), G = Ce(), Se = _e(), [Pe, w] = y(K), [Rt, U] = y(K), Ee = /* @__PURE__ */ m((e) => {
|
|
34
|
+
const { __scopeMenu: n, open: t = !1, children: o, dir: s, onOpenChange: a, modal: l = !0 } = e, M = G(n), [h, p] = r.useState(null), f = r.useRef(!1), c = te(a), d = tt(s);
|
|
35
|
+
return r.useEffect(() => {
|
|
36
|
+
const g = /* @__PURE__ */ m(() => {
|
|
37
|
+
f.current = !0, document.addEventListener("pointerdown", C, { capture: !0, once: !0 }), document.addEventListener("pointermove", C, { capture: !0, once: !0 });
|
|
38
|
+
}, "handleKeyDown"), C = /* @__PURE__ */ m(() => f.current = !1, "handlePointer");
|
|
39
|
+
return document.addEventListener("keydown", g, { capture: !0 }), () => {
|
|
40
|
+
document.removeEventListener("keydown", g, { capture: !0 }), document.removeEventListener("pointerdown", C, { capture: !0 }), document.removeEventListener("pointermove", C, { capture: !0 });
|
|
41
|
+
};
|
|
42
|
+
}, []), /* @__PURE__ */ u(ge, { ...M, children: /* @__PURE__ */ u(
|
|
43
|
+
Pe,
|
|
44
|
+
{
|
|
45
|
+
scope: n,
|
|
46
|
+
open: t,
|
|
47
|
+
onOpenChange: c,
|
|
48
|
+
content: h,
|
|
49
|
+
onContentChange: p,
|
|
50
|
+
children: /* @__PURE__ */ u(
|
|
51
|
+
Rt,
|
|
52
|
+
{
|
|
53
|
+
scope: n,
|
|
54
|
+
onClose: r.useCallback(() => c(!1), [c]),
|
|
55
|
+
isUsingKeyboardRef: f,
|
|
56
|
+
dir: d,
|
|
57
|
+
modal: l,
|
|
58
|
+
children: o
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
) });
|
|
63
|
+
}, "Menu");
|
|
64
|
+
Ee.displayName = K;
|
|
65
|
+
var St = "MenuAnchor", ne = r.forwardRef(
|
|
66
|
+
(e, n) => {
|
|
67
|
+
const { __scopeMenu: t, ...o } = e, s = G(t);
|
|
68
|
+
return /* @__PURE__ */ u(ct, { ...s, ...o, ref: n });
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
ne.displayName = St;
|
|
72
|
+
var oe = "MenuPortal", [Pt, we] = y(oe, {
|
|
73
|
+
forceMount: void 0
|
|
74
|
+
}), Ie = /* @__PURE__ */ m((e) => {
|
|
75
|
+
const { __scopeMenu: n, forceMount: t, children: o, container: s } = e, a = w(oe, n);
|
|
76
|
+
return /* @__PURE__ */ u(Pt, { scope: n, forceMount: t, children: /* @__PURE__ */ u(z, { present: t || a.open, children: /* @__PURE__ */ u(ut, { asChild: !0, container: s, children: o }) }) });
|
|
77
|
+
}, "MenuPortal");
|
|
78
|
+
Ie.displayName = oe;
|
|
79
|
+
var R = "MenuContent", [Et, re] = y(R), ye = r.forwardRef(
|
|
80
|
+
(e, n) => {
|
|
81
|
+
const t = we(R, e.__scopeMenu), { forceMount: o = t.forceMount, ...s } = e, a = w(R, e.__scopeMenu), l = U(R, e.__scopeMenu);
|
|
82
|
+
return /* @__PURE__ */ u(k.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(z, { present: o || a.open, children: /* @__PURE__ */ u(k.Slot, { scope: e.__scopeMenu, children: l.modal ? /* @__PURE__ */ u(wt, { ...s, ref: n }) : /* @__PURE__ */ u(It, { ...s, ref: n }) }) }) });
|
|
83
|
+
}
|
|
84
|
+
), wt = r.forwardRef(
|
|
85
|
+
(e, n) => {
|
|
86
|
+
const t = w(R, e.__scopeMenu), o = r.useRef(null), s = F(n, o);
|
|
87
|
+
return r.useEffect(() => {
|
|
88
|
+
const a = o.current;
|
|
89
|
+
if (a) return mt(a);
|
|
90
|
+
}, []), /* @__PURE__ */ u(
|
|
91
|
+
ce,
|
|
92
|
+
{
|
|
93
|
+
...e,
|
|
94
|
+
ref: s,
|
|
95
|
+
trapFocus: t.open,
|
|
96
|
+
disableOutsidePointerEvents: t.open,
|
|
97
|
+
disableOutsideScroll: !0,
|
|
98
|
+
onFocusOutside: v(
|
|
99
|
+
e.onFocusOutside,
|
|
100
|
+
(a) => a.preventDefault(),
|
|
101
|
+
{ checkForDefaultPrevented: !1 }
|
|
102
|
+
),
|
|
103
|
+
onDismiss: /* @__PURE__ */ m(() => t.onOpenChange(!1), "onDismiss")
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
), It = r.forwardRef((e, n) => {
|
|
108
|
+
const t = w(R, e.__scopeMenu);
|
|
109
|
+
return /* @__PURE__ */ u(
|
|
110
|
+
ce,
|
|
111
|
+
{
|
|
112
|
+
...e,
|
|
113
|
+
ref: n,
|
|
114
|
+
trapFocus: !1,
|
|
115
|
+
disableOutsidePointerEvents: !1,
|
|
116
|
+
disableOutsideScroll: !1,
|
|
117
|
+
onDismiss: /* @__PURE__ */ m(() => t.onOpenChange(!1), "onDismiss")
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}), yt = ft("MenuContent.ScrollLock"), ce = r.forwardRef(
|
|
121
|
+
(e, n) => {
|
|
122
|
+
const {
|
|
123
|
+
__scopeMenu: t,
|
|
124
|
+
loop: o = !1,
|
|
125
|
+
trapFocus: s,
|
|
126
|
+
onOpenAutoFocus: a,
|
|
127
|
+
onCloseAutoFocus: l,
|
|
128
|
+
disableOutsidePointerEvents: M,
|
|
129
|
+
onEntryFocus: h,
|
|
130
|
+
onEscapeKeyDown: p,
|
|
131
|
+
onPointerDownOutside: f,
|
|
132
|
+
onFocusOutside: c,
|
|
133
|
+
onInteractOutside: d,
|
|
134
|
+
onDismiss: g,
|
|
135
|
+
disableOutsideScroll: C,
|
|
136
|
+
...I
|
|
137
|
+
} = e, x = w(R, t), A = U(R, t), B = G(t), V = Se(t), le = gt(t), [je, de] = r.useState(null), Y = r.useRef(null), He = F(n, Y, x.onContentChange), X = r.useRef(0), j = r.useRef(""), We = r.useRef(0), $ = r.useRef(null), fe = r.useRef("right"), q = r.useRef(0), ze = C ? pt : r.Fragment, Ze = C ? { as: yt, allowPinchZoom: !0 } : void 0, $e = /* @__PURE__ */ m((i) => {
|
|
138
|
+
var T, pe;
|
|
139
|
+
const _ = j.current + i, S = le().filter((P) => !P.disabled), E = document.activeElement, J = (T = S.find((P) => P.ref.current === E)) == null ? void 0 : T.textValue, Q = S.map((P) => P.textValue), me = Gt(Q, _, J), O = (pe = S.find((P) => P.textValue === me)) == null ? void 0 : pe.ref.current;
|
|
140
|
+
(/* @__PURE__ */ m(function P(Me) {
|
|
141
|
+
j.current = Me, window.clearTimeout(X.current), Me !== "" && (X.current = window.setTimeout(() => P(""), 1e3));
|
|
142
|
+
}, "updateSearch"))(_), O && setTimeout(() => O.focus());
|
|
143
|
+
}, "handleTypeaheadSearch");
|
|
144
|
+
r.useEffect(() => () => window.clearTimeout(X.current), []), ot();
|
|
145
|
+
const b = r.useCallback((i) => {
|
|
146
|
+
var S, E;
|
|
147
|
+
return fe.current === ((S = $.current) == null ? void 0 : S.side) && Bt(i, (E = $.current) == null ? void 0 : E.area);
|
|
148
|
+
}, []);
|
|
149
|
+
return /* @__PURE__ */ u(
|
|
150
|
+
Et,
|
|
151
|
+
{
|
|
152
|
+
scope: t,
|
|
153
|
+
searchRef: j,
|
|
154
|
+
onItemEnter: r.useCallback(
|
|
155
|
+
(i) => {
|
|
156
|
+
b(i) && i.preventDefault();
|
|
157
|
+
},
|
|
158
|
+
[b]
|
|
159
|
+
),
|
|
160
|
+
onItemLeave: r.useCallback(
|
|
161
|
+
(i) => {
|
|
162
|
+
var _;
|
|
163
|
+
b(i) || ((_ = Y.current) == null || _.focus(), de(null));
|
|
164
|
+
},
|
|
165
|
+
[b]
|
|
166
|
+
),
|
|
167
|
+
onTriggerLeave: r.useCallback(
|
|
168
|
+
(i) => {
|
|
169
|
+
b(i) && i.preventDefault();
|
|
170
|
+
},
|
|
171
|
+
[b]
|
|
172
|
+
),
|
|
173
|
+
pointerGraceTimerRef: We,
|
|
174
|
+
onPointerGraceIntentChange: r.useCallback((i) => {
|
|
175
|
+
$.current = i;
|
|
176
|
+
}, []),
|
|
177
|
+
children: /* @__PURE__ */ u(ze, { ...Ze, children: /* @__PURE__ */ u(
|
|
178
|
+
rt,
|
|
179
|
+
{
|
|
180
|
+
asChild: !0,
|
|
181
|
+
trapped: s,
|
|
182
|
+
onMountAutoFocus: v(a, (i) => {
|
|
183
|
+
var _;
|
|
184
|
+
i.preventDefault(), (_ = Y.current) == null || _.focus({ preventScroll: !0 });
|
|
185
|
+
}),
|
|
186
|
+
onUnmountAutoFocus: l,
|
|
187
|
+
children: /* @__PURE__ */ u(
|
|
188
|
+
nt,
|
|
189
|
+
{
|
|
190
|
+
asChild: !0,
|
|
191
|
+
disableOutsidePointerEvents: M,
|
|
192
|
+
onEscapeKeyDown: p,
|
|
193
|
+
onPointerDownOutside: f,
|
|
194
|
+
onFocusOutside: c,
|
|
195
|
+
onInteractOutside: d,
|
|
196
|
+
onDismiss: g,
|
|
197
|
+
children: /* @__PURE__ */ u(
|
|
198
|
+
dt,
|
|
199
|
+
{
|
|
200
|
+
asChild: !0,
|
|
201
|
+
...V,
|
|
202
|
+
dir: A.dir,
|
|
203
|
+
orientation: "vertical",
|
|
204
|
+
loop: o,
|
|
205
|
+
currentTabStopId: je,
|
|
206
|
+
onCurrentTabStopIdChange: de,
|
|
207
|
+
onEntryFocus: v(h, (i) => {
|
|
208
|
+
A.isUsingKeyboardRef.current || i.preventDefault();
|
|
209
|
+
}),
|
|
210
|
+
preventScrollOnEntryFocus: !0,
|
|
211
|
+
children: /* @__PURE__ */ u(
|
|
212
|
+
at,
|
|
213
|
+
{
|
|
214
|
+
role: "menu",
|
|
215
|
+
"aria-orientation": "vertical",
|
|
216
|
+
"data-state": Xe(x.open),
|
|
217
|
+
"data-radix-menu-content": "",
|
|
218
|
+
dir: A.dir,
|
|
219
|
+
...B,
|
|
220
|
+
...I,
|
|
221
|
+
ref: He,
|
|
222
|
+
style: { outline: "none", ...I.style },
|
|
223
|
+
onKeyDown: v(I.onKeyDown, (i) => {
|
|
224
|
+
const S = i.target.closest("[data-radix-menu-content]") === i.currentTarget, E = i.ctrlKey || i.altKey || i.metaKey, J = i.key.length === 1;
|
|
225
|
+
S && (i.key === "Tab" && i.preventDefault(), !E && J && $e(i.key));
|
|
226
|
+
const Q = Y.current;
|
|
227
|
+
if (i.target !== Q || !ht.includes(i.key)) return;
|
|
228
|
+
i.preventDefault();
|
|
229
|
+
const O = le().filter((T) => !T.disabled).map((T) => T.ref.current);
|
|
230
|
+
Re.includes(i.key) && O.reverse(), Lt(O);
|
|
231
|
+
}),
|
|
232
|
+
onBlur: v(e.onBlur, (i) => {
|
|
233
|
+
i.currentTarget.contains(i.target) || (window.clearTimeout(X.current), j.current = "");
|
|
234
|
+
}),
|
|
235
|
+
onPointerMove: v(
|
|
236
|
+
e.onPointerMove,
|
|
237
|
+
N((i) => {
|
|
238
|
+
const _ = i.target, S = q.current !== i.clientX;
|
|
239
|
+
if (i.currentTarget.contains(_) && S) {
|
|
240
|
+
const E = i.clientX > q.current ? "right" : "left";
|
|
241
|
+
fe.current = E, q.current = i.clientX;
|
|
242
|
+
}
|
|
243
|
+
})
|
|
244
|
+
)
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
}
|
|
248
|
+
)
|
|
249
|
+
}
|
|
250
|
+
)
|
|
251
|
+
}
|
|
252
|
+
) })
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
ye.displayName = R;
|
|
258
|
+
var xt = "MenuGroup", ae = r.forwardRef(
|
|
259
|
+
(e, n) => {
|
|
260
|
+
const { __scopeMenu: t, ...o } = e;
|
|
261
|
+
return /* @__PURE__ */ u(L.div, { role: "group", ...o, ref: n });
|
|
262
|
+
}
|
|
263
|
+
);
|
|
264
|
+
ae.displayName = xt;
|
|
265
|
+
var bt = "MenuLabel", xe = r.forwardRef(
|
|
266
|
+
(e, n) => {
|
|
267
|
+
const { __scopeMenu: t, ...o } = e;
|
|
268
|
+
return /* @__PURE__ */ u(L.div, { ...o, ref: n });
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
xe.displayName = bt;
|
|
272
|
+
var H = "MenuItem", ve = "menu.itemSelect", Z = r.forwardRef(
|
|
273
|
+
(e, n) => {
|
|
274
|
+
const { disabled: t = !1, onSelect: o, ...s } = e, a = r.useRef(null), l = U(H, e.__scopeMenu), M = re(H, e.__scopeMenu), h = F(n, a), p = r.useRef(!1), f = /* @__PURE__ */ m(() => {
|
|
275
|
+
const c = a.current;
|
|
276
|
+
if (!t && c) {
|
|
277
|
+
const d = new CustomEvent(ve, { bubbles: !0, cancelable: !0 });
|
|
278
|
+
c.addEventListener(ve, (g) => o == null ? void 0 : o(g), { once: !0 }), it(c, d), d.defaultPrevented ? p.current = !1 : l.onClose();
|
|
279
|
+
}
|
|
280
|
+
}, "handleSelect");
|
|
281
|
+
return /* @__PURE__ */ u(
|
|
282
|
+
be,
|
|
283
|
+
{
|
|
284
|
+
...s,
|
|
285
|
+
ref: h,
|
|
286
|
+
disabled: t,
|
|
287
|
+
onClick: v(e.onClick, f),
|
|
288
|
+
onPointerDown: /* @__PURE__ */ m((c) => {
|
|
289
|
+
var d;
|
|
290
|
+
(d = e.onPointerDown) == null || d.call(e, c), p.current = !0;
|
|
291
|
+
}, "onPointerDown"),
|
|
292
|
+
onPointerUp: v(e.onPointerUp, (c) => {
|
|
293
|
+
var d;
|
|
294
|
+
p.current || (d = c.currentTarget) == null || d.click();
|
|
295
|
+
}),
|
|
296
|
+
onKeyDown: v(e.onKeyDown, (c) => {
|
|
297
|
+
const d = M.searchRef.current !== "";
|
|
298
|
+
t || d && c.key === " " || ee.includes(c.key) && (c.currentTarget.click(), c.preventDefault());
|
|
299
|
+
})
|
|
300
|
+
}
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
);
|
|
304
|
+
Z.displayName = H;
|
|
305
|
+
var be = r.forwardRef(
|
|
306
|
+
(e, n) => {
|
|
307
|
+
const { __scopeMenu: t, disabled: o = !1, textValue: s, ...a } = e, l = re(H, t), M = Se(t), h = r.useRef(null), p = F(n, h), [f, c] = r.useState(!1), [d, g] = r.useState("");
|
|
308
|
+
return r.useEffect(() => {
|
|
309
|
+
const C = h.current;
|
|
310
|
+
C && g((C.textContent ?? "").trim());
|
|
311
|
+
}, [a.children]), /* @__PURE__ */ u(
|
|
312
|
+
k.ItemSlot,
|
|
313
|
+
{
|
|
314
|
+
scope: t,
|
|
315
|
+
disabled: o,
|
|
316
|
+
textValue: s ?? d,
|
|
317
|
+
children: /* @__PURE__ */ u(lt, { asChild: !0, ...M, focusable: !o, children: /* @__PURE__ */ u(
|
|
318
|
+
L.div,
|
|
319
|
+
{
|
|
320
|
+
role: "menuitem",
|
|
321
|
+
"data-highlighted": f ? "" : void 0,
|
|
322
|
+
"aria-disabled": o || void 0,
|
|
323
|
+
"data-disabled": o ? "" : void 0,
|
|
324
|
+
...a,
|
|
325
|
+
ref: p,
|
|
326
|
+
onPointerMove: v(
|
|
327
|
+
e.onPointerMove,
|
|
328
|
+
N((C) => {
|
|
329
|
+
o ? l.onItemLeave(C) : (l.onItemEnter(C), C.defaultPrevented || C.currentTarget.focus({ preventScroll: !0 }));
|
|
330
|
+
})
|
|
331
|
+
),
|
|
332
|
+
onPointerLeave: v(
|
|
333
|
+
e.onPointerLeave,
|
|
334
|
+
N((C) => l.onItemLeave(C))
|
|
335
|
+
),
|
|
336
|
+
onFocus: v(e.onFocus, () => c(!0)),
|
|
337
|
+
onBlur: v(e.onBlur, () => c(!1))
|
|
338
|
+
}
|
|
339
|
+
) })
|
|
340
|
+
}
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
), Tt = "MenuCheckboxItem", Te = r.forwardRef(
|
|
344
|
+
(e, n) => {
|
|
345
|
+
const { checked: t = !1, onCheckedChange: o, ...s } = e;
|
|
346
|
+
return /* @__PURE__ */ u(Ne, { scope: e.__scopeMenu, checked: t, children: /* @__PURE__ */ u(
|
|
347
|
+
Z,
|
|
348
|
+
{
|
|
349
|
+
role: "menuitemcheckbox",
|
|
350
|
+
"aria-checked": W(t) ? "mixed" : t,
|
|
351
|
+
...s,
|
|
352
|
+
ref: n,
|
|
353
|
+
"data-state": ie(t),
|
|
354
|
+
onSelect: v(
|
|
355
|
+
s.onSelect,
|
|
356
|
+
() => o == null ? void 0 : o(W(t) ? !0 : !t),
|
|
357
|
+
{ checkForDefaultPrevented: !1 }
|
|
358
|
+
)
|
|
359
|
+
}
|
|
360
|
+
) });
|
|
361
|
+
}
|
|
362
|
+
);
|
|
363
|
+
Te.displayName = Tt;
|
|
364
|
+
var Ae = "MenuRadioGroup", [At, Ot] = y(
|
|
365
|
+
Ae,
|
|
366
|
+
{ value: void 0, onValueChange: /* @__PURE__ */ m(() => {
|
|
367
|
+
}, "onValueChange") }
|
|
368
|
+
), Oe = r.forwardRef(
|
|
369
|
+
(e, n) => {
|
|
370
|
+
const { value: t, onValueChange: o, ...s } = e, a = te(o);
|
|
371
|
+
return /* @__PURE__ */ u(At, { scope: e.__scopeMenu, value: t, onValueChange: a, children: /* @__PURE__ */ u(ae, { ...s, ref: n }) });
|
|
372
|
+
}
|
|
373
|
+
);
|
|
374
|
+
Oe.displayName = Ae;
|
|
375
|
+
var De = "MenuRadioItem", ke = r.forwardRef(
|
|
376
|
+
(e, n) => {
|
|
377
|
+
const { value: t, ...o } = e, s = Ot(De, e.__scopeMenu), a = t === s.value;
|
|
378
|
+
return /* @__PURE__ */ u(Ne, { scope: e.__scopeMenu, checked: a, children: /* @__PURE__ */ u(
|
|
379
|
+
Z,
|
|
380
|
+
{
|
|
381
|
+
role: "menuitemradio",
|
|
382
|
+
"aria-checked": a,
|
|
383
|
+
...o,
|
|
384
|
+
ref: n,
|
|
385
|
+
"data-state": ie(a),
|
|
386
|
+
onSelect: v(
|
|
387
|
+
o.onSelect,
|
|
388
|
+
() => {
|
|
389
|
+
var l;
|
|
390
|
+
return (l = s.onValueChange) == null ? void 0 : l.call(s, t);
|
|
391
|
+
},
|
|
392
|
+
{ checkForDefaultPrevented: !1 }
|
|
393
|
+
)
|
|
394
|
+
}
|
|
395
|
+
) });
|
|
396
|
+
}
|
|
397
|
+
);
|
|
398
|
+
ke.displayName = De;
|
|
399
|
+
var se = "MenuItemIndicator", [Ne, Dt] = y(
|
|
400
|
+
se,
|
|
401
|
+
{ checked: !1 }
|
|
402
|
+
), Fe = r.forwardRef(
|
|
403
|
+
(e, n) => {
|
|
404
|
+
const { __scopeMenu: t, forceMount: o, ...s } = e, a = Dt(se, t);
|
|
405
|
+
return /* @__PURE__ */ u(
|
|
406
|
+
z,
|
|
407
|
+
{
|
|
408
|
+
present: o || W(a.checked) || a.checked === !0,
|
|
409
|
+
children: /* @__PURE__ */ u(
|
|
410
|
+
L.span,
|
|
411
|
+
{
|
|
412
|
+
...s,
|
|
413
|
+
ref: n,
|
|
414
|
+
"data-state": ie(a.checked)
|
|
415
|
+
}
|
|
416
|
+
)
|
|
417
|
+
}
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
);
|
|
421
|
+
Fe.displayName = se;
|
|
422
|
+
var kt = "MenuSeparator", Le = r.forwardRef(
|
|
423
|
+
(e, n) => {
|
|
424
|
+
const { __scopeMenu: t, ...o } = e;
|
|
425
|
+
return /* @__PURE__ */ u(
|
|
426
|
+
L.div,
|
|
427
|
+
{
|
|
428
|
+
role: "separator",
|
|
429
|
+
"aria-orientation": "horizontal",
|
|
430
|
+
...o,
|
|
431
|
+
ref: n
|
|
432
|
+
}
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
);
|
|
436
|
+
Le.displayName = kt;
|
|
437
|
+
var Nt = "MenuArrow", Ke = r.forwardRef(
|
|
438
|
+
(e, n) => {
|
|
439
|
+
const { __scopeMenu: t, ...o } = e, s = G(t);
|
|
440
|
+
return /* @__PURE__ */ u(st, { ...s, ...o, ref: n });
|
|
441
|
+
}
|
|
442
|
+
);
|
|
443
|
+
Ke.displayName = Nt;
|
|
444
|
+
var ue = "MenuSub", [Ft, Ge] = y(ue), Ue = /* @__PURE__ */ m((e) => {
|
|
445
|
+
const { __scopeMenu: n, children: t, open: o = !1, onOpenChange: s } = e, a = w(ue, n), l = G(n), [M, h] = r.useState(null), [p, f] = r.useState(null), c = te(s);
|
|
446
|
+
return r.useEffect(() => (a.open === !1 && c(!1), () => c(!1)), [a.open, c]), /* @__PURE__ */ u(ge, { ...l, children: /* @__PURE__ */ u(
|
|
447
|
+
Pe,
|
|
448
|
+
{
|
|
449
|
+
scope: n,
|
|
450
|
+
open: o,
|
|
451
|
+
onOpenChange: c,
|
|
452
|
+
content: p,
|
|
453
|
+
onContentChange: f,
|
|
454
|
+
children: /* @__PURE__ */ u(
|
|
455
|
+
Ft,
|
|
456
|
+
{
|
|
457
|
+
scope: n,
|
|
458
|
+
contentId: he(),
|
|
459
|
+
triggerId: he(),
|
|
460
|
+
trigger: M,
|
|
461
|
+
onTriggerChange: h,
|
|
462
|
+
children: t
|
|
463
|
+
}
|
|
464
|
+
)
|
|
465
|
+
}
|
|
466
|
+
) });
|
|
467
|
+
}, "MenuSub");
|
|
468
|
+
Ue.displayName = ue;
|
|
469
|
+
var D = "MenuSubTrigger", Be = r.forwardRef(
|
|
470
|
+
(e, n) => {
|
|
471
|
+
const t = w(D, e.__scopeMenu), o = U(D, e.__scopeMenu), s = Ge(D, e.__scopeMenu), a = re(D, e.__scopeMenu), l = r.useRef(null), { pointerGraceTimerRef: M, onPointerGraceIntentChange: h } = a, p = { __scopeMenu: e.__scopeMenu }, f = r.useCallback(() => {
|
|
472
|
+
l.current && window.clearTimeout(l.current), l.current = null;
|
|
473
|
+
}, []);
|
|
474
|
+
return r.useEffect(() => f, [f]), r.useEffect(() => {
|
|
475
|
+
const c = M.current;
|
|
476
|
+
return () => {
|
|
477
|
+
window.clearTimeout(c), h(null);
|
|
478
|
+
};
|
|
479
|
+
}, [M, h]), /* @__PURE__ */ u(ne, { asChild: !0, ...p, children: /* @__PURE__ */ u(
|
|
480
|
+
be,
|
|
481
|
+
{
|
|
482
|
+
id: s.triggerId,
|
|
483
|
+
"aria-haspopup": "menu",
|
|
484
|
+
"aria-expanded": t.open,
|
|
485
|
+
"aria-controls": s.contentId,
|
|
486
|
+
"data-state": Xe(t.open),
|
|
487
|
+
...e,
|
|
488
|
+
ref: Qe(n, s.onTriggerChange),
|
|
489
|
+
onClick: /* @__PURE__ */ m((c) => {
|
|
490
|
+
var d;
|
|
491
|
+
(d = e.onClick) == null || d.call(e, c), !(e.disabled || c.defaultPrevented) && (c.currentTarget.focus(), t.open || t.onOpenChange(!0));
|
|
492
|
+
}, "onClick"),
|
|
493
|
+
onPointerMove: v(
|
|
494
|
+
e.onPointerMove,
|
|
495
|
+
N((c) => {
|
|
496
|
+
a.onItemEnter(c), !c.defaultPrevented && !e.disabled && !t.open && !l.current && (a.onPointerGraceIntentChange(null), l.current = window.setTimeout(() => {
|
|
497
|
+
t.onOpenChange(!0), f();
|
|
498
|
+
}, 100));
|
|
499
|
+
})
|
|
500
|
+
),
|
|
501
|
+
onPointerLeave: v(
|
|
502
|
+
e.onPointerLeave,
|
|
503
|
+
N((c) => {
|
|
504
|
+
var g, C;
|
|
505
|
+
f();
|
|
506
|
+
const d = (g = t.content) == null ? void 0 : g.getBoundingClientRect();
|
|
507
|
+
if (d) {
|
|
508
|
+
const I = (C = t.content) == null ? void 0 : C.dataset.side, x = I === "right", A = x ? -5 : 5, B = d[x ? "left" : "right"], V = d[x ? "right" : "left"];
|
|
509
|
+
a.onPointerGraceIntentChange({
|
|
510
|
+
area: [
|
|
511
|
+
// Apply a bleed on clientX to ensure that our exit point is
|
|
512
|
+
// consistently within polygon bounds
|
|
513
|
+
{ x: c.clientX + A, y: c.clientY },
|
|
514
|
+
{ x: B, y: d.top },
|
|
515
|
+
{ x: V, y: d.top },
|
|
516
|
+
{ x: V, y: d.bottom },
|
|
517
|
+
{ x: B, y: d.bottom }
|
|
518
|
+
],
|
|
519
|
+
side: I
|
|
520
|
+
}), window.clearTimeout(M.current), M.current = window.setTimeout(
|
|
521
|
+
() => a.onPointerGraceIntentChange(null),
|
|
522
|
+
300
|
|
523
|
+
);
|
|
524
|
+
} else {
|
|
525
|
+
if (a.onTriggerLeave(c), c.defaultPrevented) return;
|
|
526
|
+
a.onPointerGraceIntentChange(null);
|
|
527
|
+
}
|
|
528
|
+
})
|
|
529
|
+
),
|
|
530
|
+
onKeyDown: v(e.onKeyDown, (c) => {
|
|
531
|
+
var g;
|
|
532
|
+
const d = a.searchRef.current !== "";
|
|
533
|
+
e.disabled || d && c.key === " " || vt[o.dir].includes(c.key) && (t.onOpenChange(!0), (g = t.content) == null || g.focus(), c.preventDefault());
|
|
534
|
+
})
|
|
535
|
+
}
|
|
536
|
+
) });
|
|
537
|
+
}
|
|
538
|
+
);
|
|
539
|
+
Be.displayName = D;
|
|
540
|
+
var Ve = "MenuSubContent", Ye = r.forwardRef(
|
|
541
|
+
(e, n) => {
|
|
542
|
+
const t = we(R, e.__scopeMenu), { forceMount: o = t.forceMount, ...s } = e, a = w(R, e.__scopeMenu), l = U(R, e.__scopeMenu), M = Ge(Ve, e.__scopeMenu), h = r.useRef(null), p = F(n, h);
|
|
543
|
+
return /* @__PURE__ */ u(k.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(z, { present: o || a.open, children: /* @__PURE__ */ u(k.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(
|
|
544
|
+
ce,
|
|
545
|
+
{
|
|
546
|
+
id: M.contentId,
|
|
547
|
+
"aria-labelledby": M.triggerId,
|
|
548
|
+
...s,
|
|
549
|
+
ref: p,
|
|
550
|
+
align: "start",
|
|
551
|
+
side: l.dir === "rtl" ? "left" : "right",
|
|
552
|
+
disableOutsidePointerEvents: !1,
|
|
553
|
+
disableOutsideScroll: !1,
|
|
554
|
+
trapFocus: !1,
|
|
555
|
+
onOpenAutoFocus: /* @__PURE__ */ m((f) => {
|
|
556
|
+
var c;
|
|
557
|
+
l.isUsingKeyboardRef.current && ((c = h.current) == null || c.focus()), f.preventDefault();
|
|
558
|
+
}, "onOpenAutoFocus"),
|
|
559
|
+
onCloseAutoFocus: /* @__PURE__ */ m((f) => f.preventDefault(), "onCloseAutoFocus"),
|
|
560
|
+
onFocusOutside: v(e.onFocusOutside, (f) => {
|
|
561
|
+
f.target !== M.trigger && a.onOpenChange(!1);
|
|
562
|
+
}),
|
|
563
|
+
onEscapeKeyDown: v(e.onEscapeKeyDown, (f) => {
|
|
564
|
+
l.onClose(), f.preventDefault();
|
|
565
|
+
}),
|
|
566
|
+
onKeyDown: v(e.onKeyDown, (f) => {
|
|
567
|
+
var g;
|
|
568
|
+
const c = f.currentTarget.contains(f.target), d = Ct[l.dir].includes(f.key);
|
|
569
|
+
c && d && (a.onOpenChange(!1), (g = M.trigger) == null || g.focus(), f.preventDefault());
|
|
570
|
+
})
|
|
571
|
+
}
|
|
572
|
+
) }) }) });
|
|
573
|
+
}
|
|
574
|
+
);
|
|
575
|
+
Ye.displayName = Ve;
|
|
576
|
+
function Xe(e) {
|
|
577
|
+
return e ? "open" : "closed";
|
|
578
|
+
}
|
|
579
|
+
m(Xe, "getOpenState");
|
|
580
|
+
function W(e) {
|
|
581
|
+
return e === "indeterminate";
|
|
582
|
+
}
|
|
583
|
+
m(W, "isIndeterminate");
|
|
584
|
+
function ie(e) {
|
|
585
|
+
return W(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
586
|
+
}
|
|
587
|
+
m(ie, "getCheckedState");
|
|
588
|
+
function Lt(e) {
|
|
589
|
+
const n = document.activeElement;
|
|
590
|
+
for (const t of e)
|
|
591
|
+
if (t === n || (t.focus(), document.activeElement !== n)) return;
|
|
592
|
+
}
|
|
593
|
+
m(Lt, "focusFirst");
|
|
594
|
+
function Kt(e, n) {
|
|
595
|
+
return e.map((t, o) => e[(n + o) % e.length]);
|
|
596
|
+
}
|
|
597
|
+
m(Kt, "wrapArray");
|
|
598
|
+
function Gt(e, n, t) {
|
|
599
|
+
const s = n.length > 1 && Array.from(n).every((p) => p === n[0]) ? n[0] : n, a = t ? e.indexOf(t) : -1;
|
|
600
|
+
let l = Kt(e, Math.max(a, 0));
|
|
601
|
+
s.length === 1 && (l = l.filter((p) => p !== t));
|
|
602
|
+
const h = l.find(
|
|
603
|
+
(p) => p.toLowerCase().startsWith(s.toLowerCase())
|
|
604
|
+
);
|
|
605
|
+
return h !== t ? h : void 0;
|
|
606
|
+
}
|
|
607
|
+
m(Gt, "getNextMatch");
|
|
608
|
+
function Ut(e, n) {
|
|
609
|
+
const { x: t, y: o } = e;
|
|
610
|
+
let s = !1;
|
|
611
|
+
for (let a = 0, l = n.length - 1; a < n.length; l = a++) {
|
|
612
|
+
const M = n[a], h = n[l], p = M.x, f = M.y, c = h.x, d = h.y;
|
|
613
|
+
f > o != d > o && t < (c - p) * (o - f) / (d - f) + p && (s = !s);
|
|
614
|
+
}
|
|
615
|
+
return s;
|
|
616
|
+
}
|
|
617
|
+
m(Ut, "isPointInPolygon");
|
|
618
|
+
function Bt(e, n) {
|
|
619
|
+
if (!n) return !1;
|
|
620
|
+
const t = { x: e.clientX, y: e.clientY };
|
|
621
|
+
return Ut(t, n);
|
|
622
|
+
}
|
|
623
|
+
m(Bt, "isPointerInGraceArea");
|
|
624
|
+
function N(e) {
|
|
625
|
+
return (n) => n.pointerType === "mouse" ? e(n) : void 0;
|
|
626
|
+
}
|
|
627
|
+
m(N, "whenMouse");
|
|
628
|
+
var ln = Ee, dn = ne, fn = Ie, mn = ye, pn = ae, Mn = xe, hn = Z, vn = Te, Cn = Oe, gn = ke, _n = Fe, Rn = Le, Sn = Ke, Pn = Ue, En = Be, wn = Ye;
|
|
629
|
+
export {
|
|
630
|
+
dn as Anchor,
|
|
631
|
+
Sn as Arrow,
|
|
632
|
+
vn as CheckboxItem,
|
|
633
|
+
mn as Content,
|
|
634
|
+
pn as Group,
|
|
635
|
+
hn as Item,
|
|
636
|
+
_n as ItemIndicator,
|
|
637
|
+
Mn as Label,
|
|
638
|
+
Ee as Menu,
|
|
639
|
+
ne as MenuAnchor,
|
|
640
|
+
Ke as MenuArrow,
|
|
641
|
+
Te as MenuCheckboxItem,
|
|
642
|
+
ye as MenuContent,
|
|
643
|
+
ae as MenuGroup,
|
|
644
|
+
Z as MenuItem,
|
|
645
|
+
Fe as MenuItemIndicator,
|
|
646
|
+
xe as MenuLabel,
|
|
647
|
+
Ie as MenuPortal,
|
|
648
|
+
Oe as MenuRadioGroup,
|
|
649
|
+
ke as MenuRadioItem,
|
|
650
|
+
Le as MenuSeparator,
|
|
651
|
+
Ue as MenuSub,
|
|
652
|
+
Ye as MenuSubContent,
|
|
653
|
+
Be as MenuSubTrigger,
|
|
654
|
+
fn as Portal,
|
|
655
|
+
Cn as RadioGroup,
|
|
656
|
+
gn as RadioItem,
|
|
657
|
+
ln as Root,
|
|
658
|
+
Rn as Separator,
|
|
659
|
+
Pn as Sub,
|
|
660
|
+
wn as SubContent,
|
|
661
|
+
En as SubTrigger,
|
|
662
|
+
un as createMenuScope
|
|
663
|
+
};
|