@ledgerhq/lumen-ui-react 0.1.34 → 0.1.36
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/index.js +187 -182
- package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts +1 -1
- package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
- package/dist/lib/Components/AmountDisplay/AmountDisplay.js +117 -78
- package/dist/lib/Components/AmountDisplay/index.d.ts +1 -1
- package/dist/lib/Components/AmountDisplay/index.d.ts.map +1 -1
- package/dist/lib/Components/AmountDisplay/types.d.ts +16 -3
- package/dist/lib/Components/AmountDisplay/types.d.ts.map +1 -1
- package/dist/lib/Components/Card/types.d.ts +1 -1
- package/dist/lib/Components/DescriptionItem/DescriptionItem.d.ts +45 -0
- package/dist/lib/Components/DescriptionItem/DescriptionItem.d.ts.map +1 -0
- package/dist/lib/Components/DescriptionItem/DescriptionItem.js +98 -0
- package/dist/lib/Components/DescriptionItem/index.d.ts +3 -0
- package/dist/lib/Components/DescriptionItem/index.d.ts.map +1 -0
- package/dist/lib/Components/DescriptionItem/types.d.ts +58 -0
- package/dist/lib/Components/DescriptionItem/types.d.ts.map +1 -0
- package/dist/lib/Components/DotIcon/DotIcon.d.ts +1 -1
- package/dist/lib/Components/DotIcon/DotIcon.d.ts.map +1 -1
- package/dist/lib/Components/DotIcon/DotIcon.js +48 -37
- package/dist/lib/Components/DotIcon/types.d.ts +6 -0
- package/dist/lib/Components/DotIcon/types.d.ts.map +1 -1
- package/dist/lib/Components/DotSymbol/DotSymbol.d.ts +1 -1
- package/dist/lib/Components/DotSymbol/DotSymbol.d.ts.map +1 -1
- package/dist/lib/Components/DotSymbol/DotSymbol.js +42 -31
- package/dist/lib/Components/DotSymbol/types.d.ts +6 -0
- package/dist/lib/Components/DotSymbol/types.d.ts.map +1 -1
- package/dist/lib/Components/MediaButton/MediaButton.d.ts +3 -3
- package/dist/lib/Components/MediaButton/MediaButton.d.ts.map +1 -1
- package/dist/lib/Components/MediaButton/MediaButton.js +42 -40
- package/dist/lib/Components/MediaButton/types.d.ts +5 -5
- package/dist/lib/Components/MediaButton/types.d.ts.map +1 -1
- package/dist/lib/Components/MediaImage/MediaImage.d.ts +1 -1
- package/dist/lib/Components/MediaImage/MediaImage.d.ts.map +1 -1
- package/dist/lib/Components/MediaImage/MediaImage.js +40 -29
- package/dist/lib/Components/MediaImage/types.d.ts +6 -0
- package/dist/lib/Components/MediaImage/types.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.d.ts +11 -16
- package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.js +186 -125
- package/dist/lib/Components/Menu/types.d.ts +50 -145
- package/dist/lib/Components/Menu/types.d.ts.map +1 -1
- package/dist/lib/Components/NavBar/CoinCapsule.d.ts +2 -2
- package/dist/lib/Components/NavBar/CoinCapsule.d.ts.map +1 -1
- package/dist/lib/Components/NavBar/CoinCapsule.js +4 -4
- package/dist/lib/Components/NavBar/NavBar.d.ts +4 -4
- package/dist/lib/Components/NavBar/NavBar.d.ts.map +1 -1
- package/dist/lib/Components/NavBar/NavBar.js +10 -2
- package/dist/lib/Components/NavBar/types.d.ts +2 -2
- package/dist/lib/Components/NavBar/types.d.ts.map +1 -1
- package/dist/lib/Components/Popover/Popover.d.ts +2 -2
- package/dist/lib/Components/Popover/types.d.ts +6 -3
- package/dist/lib/Components/Popover/types.d.ts.map +1 -1
- package/dist/lib/Components/index.d.ts +2 -1
- package/dist/lib/Components/index.d.ts.map +1 -1
- package/dist/node_modules/@base-ui/react/esm/composite/item/CompositeItem.js +30 -0
- package/dist/node_modules/@base-ui/react/esm/composite/item/useCompositeItem.js +34 -0
- package/dist/node_modules/@base-ui/react/esm/context-menu/root/ContextMenuRootContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingFocusManager.js +10 -10
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFocus.js +97 -0
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js +10 -10
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js +2 -2
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/utils/element.js +31 -20
- package/dist/node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItem.js +78 -0
- package/dist/node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItemContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItemDataAttributes.js +6 -0
- package/dist/node_modules/@base-ui/react/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +44 -0
- package/dist/node_modules/@base-ui/react/esm/menu/group/MenuGroup.js +28 -0
- package/dist/node_modules/@base-ui/react/esm/menu/group/MenuGroupContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/menu/group-label/MenuGroupLabel.js +29 -0
- package/dist/node_modules/@base-ui/react/esm/menu/item/MenuItem.js +47 -0
- package/dist/node_modules/@base-ui/react/esm/menu/item/useMenuItem.js +50 -0
- package/dist/node_modules/@base-ui/react/esm/menu/item/useMenuItemCommonProps.js +49 -0
- package/dist/node_modules/@base-ui/react/esm/menu/popup/MenuPopup.js +89 -0
- package/dist/node_modules/@base-ui/react/esm/menu/portal/MenuPortal.js +24 -0
- package/dist/node_modules/@base-ui/react/esm/menu/portal/MenuPortalContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/menu/positioner/MenuPositioner.js +174 -0
- package/dist/node_modules/@base-ui/react/esm/menu/positioner/MenuPositionerContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroup.js +45 -0
- package/dist/node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroupContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItem.js +75 -0
- package/dist/node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItemContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js +44 -0
- package/dist/node_modules/@base-ui/react/esm/menu/root/MenuRoot.js +271 -0
- package/dist/node_modules/@base-ui/react/esm/menu/root/MenuRootContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/menu/store/MenuStore.js +109 -0
- package/dist/node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRoot.js +21 -0
- package/dist/node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRootContext.js +10 -0
- package/dist/node_modules/@base-ui/react/esm/menu/submenu-trigger/MenuSubmenuTrigger.js +101 -0
- package/dist/node_modules/@base-ui/react/esm/menu/trigger/MenuTrigger.js +207 -0
- package/dist/node_modules/@base-ui/react/esm/menu/utils/findRootOwnerId.js +10 -0
- package/dist/node_modules/@base-ui/react/esm/menu/utils/stateAttributesMapping.js +15 -0
- package/dist/node_modules/@base-ui/react/esm/menubar/MenubarContext.js +10 -0
- package/dist/node_modules/@base-ui/react/esm/popover/root/PopoverRoot.js +11 -11
- package/dist/node_modules/@base-ui/react/esm/popover/store/PopoverStore.js +7 -7
- package/dist/node_modules/@base-ui/react/esm/popover/trigger/PopoverTrigger.js +11 -11
- package/dist/node_modules/@base-ui/react/esm/utils/constants.js +11 -10
- package/dist/node_modules/@base-ui/react/esm/utils/reason-parts.js +11 -8
- package/dist/node_modules/@base-ui/react/esm/utils/useMixedToggleClickHandler.js +25 -0
- package/dist/node_modules/@base-ui/utils/esm/detectBrowser.js +7 -8
- package/dist/node_modules/@base-ui/utils/esm/fastHooks.js +43 -0
- package/dist/node_modules/@base-ui/utils/esm/store/useStore.js +54 -13
- package/dist/package.json +2 -3
- package/package.json +4 -5
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import de from "../../../../utils/esm/formatErrorMessage.js";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import * as D from "react-dom";
|
|
4
|
+
import { useTimeout as L } from "../../../../utils/esm/useTimeout.js";
|
|
5
|
+
import { ownerDocument as B } from "../../../../utils/esm/owner.js";
|
|
6
|
+
import { fastComponentRef as be } from "../../../../utils/esm/fastHooks.js";
|
|
7
|
+
import { useStableCallback as y } from "../../../../utils/esm/useStableCallback.js";
|
|
8
|
+
import { useIsoLayoutEffect as Te } from "../../../../utils/esm/useIsoLayoutEffect.js";
|
|
9
|
+
import { EMPTY_OBJECT as xe } from "../../../../utils/esm/empty.js";
|
|
10
|
+
import { FloatingTreeStore as Re } from "../../floating-ui-react/components/FloatingTreeStore.js";
|
|
11
|
+
import { useMenuRootContext as G } from "../root/MenuRootContext.js";
|
|
12
|
+
import { pressableTriggerOpenStateMapping as H } from "../../utils/popupStateMapping.js";
|
|
13
|
+
import { useRenderElement as Oe } from "../../utils/useRenderElement.js";
|
|
14
|
+
import { useButton as Me } from "../../use-button/useButton.js";
|
|
15
|
+
import { getPseudoElementBounds as he } from "../../utils/getPseudoElementBounds.js";
|
|
16
|
+
import { CompositeItem as ye } from "../../composite/item/CompositeItem.js";
|
|
17
|
+
import { useCompositeRootContext as Ce } from "../../composite/root/CompositeRootContext.js";
|
|
18
|
+
import { findRootOwnerId as Ee } from "../utils/findRootOwnerId.js";
|
|
19
|
+
import { useBaseUiId as ve } from "../../utils/useBaseUiId.js";
|
|
20
|
+
import { useMixedToggleClickHandler as Fe } from "../../utils/useMixedToggleClickHandler.js";
|
|
21
|
+
import { useContextMenuRootContext as Ie } from "../../context-menu/root/ContextMenuRootContext.js";
|
|
22
|
+
import { useMenubarContext as Pe } from "../../menubar/MenubarContext.js";
|
|
23
|
+
import { PATIENT_CLICK_THRESHOLD as Se } from "../../utils/constants.js";
|
|
24
|
+
import { FocusGuard as A } from "../../utils/FocusGuard.js";
|
|
25
|
+
import { createChangeEventDetails as U } from "../../utils/createBaseUIEventDetails.js";
|
|
26
|
+
import { jsx as d, jsxs as we } from "react/jsx-runtime";
|
|
27
|
+
import { useFloatingTree as ke, useFloatingNodeId as Ne, useFloatingParentNodeId as De } from "../../floating-ui-react/components/FloatingTree.js";
|
|
28
|
+
import { useTriggerDataForwarding as Be } from "../../utils/popups/popupStoreUtils.js";
|
|
29
|
+
import { useHoverReferenceInteraction as He } from "../../floating-ui-react/hooks/useHoverReferenceInteraction.js";
|
|
30
|
+
import { safePolygon as Ae } from "../../floating-ui-react/safePolygon.js";
|
|
31
|
+
import { useClick as Ue } from "../../floating-ui-react/hooks/useClick.js";
|
|
32
|
+
import { useFocus as _e } from "../../floating-ui-react/hooks/useFocus.js";
|
|
33
|
+
import { useInteractions as Le } from "../../floating-ui-react/hooks/useInteractions.js";
|
|
34
|
+
import { getTabbableBeforeElement as Ge, isOutsideEvent as Ye, getTabbableAfterElement as je, getNextTabbable as Ke } from "../../floating-ui-react/utils/tabbable.js";
|
|
35
|
+
import { contains as C } from "../../floating-ui-react/utils/element.js";
|
|
36
|
+
import { cancelOpen as Ve, triggerHover as Xe, focusOut as _ } from "../../utils/reason-parts.js";
|
|
37
|
+
const R = 2, $e = be(function(l, i) {
|
|
38
|
+
const {
|
|
39
|
+
render: b,
|
|
40
|
+
className: m,
|
|
41
|
+
disabled: Y = !1,
|
|
42
|
+
nativeButton: j = !0,
|
|
43
|
+
id: K,
|
|
44
|
+
openOnHover: V,
|
|
45
|
+
delay: X = 100,
|
|
46
|
+
closeDelay: E = 0,
|
|
47
|
+
handle: $,
|
|
48
|
+
payload: J,
|
|
49
|
+
...q
|
|
50
|
+
} = l, z = G(!0), e = $?.store ?? z?.store;
|
|
51
|
+
if (!e)
|
|
52
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle." : de(85));
|
|
53
|
+
const f = ve(K), Q = e.useState("isTriggerActive", f), O = e.useState("floatingRootContext"), u = e.useState("isOpenedByTrigger", f), T = n.useRef(null), s = qe(), W = Ce(!0), v = ke(), x = n.useMemo(() => v ?? new Re(), [v]), Z = Ne(x), ee = De(), {
|
|
54
|
+
registerTrigger: te,
|
|
55
|
+
isMountedByThisTrigger: F
|
|
56
|
+
} = Be(f, T, e, {
|
|
57
|
+
payload: J,
|
|
58
|
+
closeDelay: E,
|
|
59
|
+
parent: s,
|
|
60
|
+
floatingTreeRoot: x,
|
|
61
|
+
floatingNodeId: Z,
|
|
62
|
+
floatingParentNodeId: ee,
|
|
63
|
+
keyboardEventRelay: W?.relayKeyboardEvent
|
|
64
|
+
}), c = s.type === "menubar", oe = e.useState("disabled"), g = Y || oe || c && s.context.disabled, {
|
|
65
|
+
getButtonProps: re,
|
|
66
|
+
buttonRef: ne
|
|
67
|
+
} = Me({
|
|
68
|
+
disabled: g,
|
|
69
|
+
native: j
|
|
70
|
+
});
|
|
71
|
+
n.useEffect(() => {
|
|
72
|
+
!u && s.type === void 0 && (e.context.allowMouseUpTriggerRef.current = !1);
|
|
73
|
+
}, [e, u, s.type]);
|
|
74
|
+
const p = n.useRef(null), I = L(), M = y((t) => {
|
|
75
|
+
if (!p.current)
|
|
76
|
+
return;
|
|
77
|
+
I.clear(), e.context.allowMouseUpTriggerRef.current = !1;
|
|
78
|
+
const r = t.target;
|
|
79
|
+
if (C(p.current, r) || C(e.select("positionerElement"), r) || r === p.current || r != null && Ee(r) === e.select("rootId"))
|
|
80
|
+
return;
|
|
81
|
+
const o = he(p.current);
|
|
82
|
+
t.clientX >= o.left - R && t.clientX <= o.right + R && t.clientY >= o.top - R && t.clientY <= o.bottom + R || x.events.emit("close", {
|
|
83
|
+
domEvent: t,
|
|
84
|
+
reason: Ve
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
n.useEffect(() => {
|
|
88
|
+
u && e.select("lastOpenChangeReason") === Xe && B(p.current).addEventListener("mouseup", M, {
|
|
89
|
+
once: !0
|
|
90
|
+
});
|
|
91
|
+
}, [u, M, e]);
|
|
92
|
+
const h = c && s.context.hasSubmenuOpen, se = He(O, {
|
|
93
|
+
enabled: (V ?? h) && !g && s.type !== "context-menu" && (!c || h && !F),
|
|
94
|
+
handleClose: Ae({
|
|
95
|
+
blockPointerEvents: !c
|
|
96
|
+
}),
|
|
97
|
+
mouseOnly: !0,
|
|
98
|
+
move: !1,
|
|
99
|
+
restMs: s.type === void 0 ? X : void 0,
|
|
100
|
+
delay: {
|
|
101
|
+
close: E
|
|
102
|
+
},
|
|
103
|
+
triggerElementRef: T,
|
|
104
|
+
externalTree: x,
|
|
105
|
+
isActiveTrigger: Q
|
|
106
|
+
}), ie = Je(u, e.select("lastOpenChangeReason")), ue = Ue(O, {
|
|
107
|
+
enabled: !g && s.type !== "context-menu",
|
|
108
|
+
event: u && c ? "click" : "mousedown",
|
|
109
|
+
toggle: !0,
|
|
110
|
+
ignoreMouse: !1,
|
|
111
|
+
stickIfOpen: s.type === void 0 ? ie : !1
|
|
112
|
+
}), ce = _e(O, {
|
|
113
|
+
enabled: !g && h
|
|
114
|
+
}), ae = Fe({
|
|
115
|
+
open: u,
|
|
116
|
+
enabled: c,
|
|
117
|
+
mouseDownAction: "open"
|
|
118
|
+
}), le = Le([ue, ce]), P = {
|
|
119
|
+
disabled: g,
|
|
120
|
+
open: u
|
|
121
|
+
}, fe = e.useState("triggerProps", F), S = [p, i, ne, te, T], w = [le.getReferenceProps(), se ?? xe, fe, {
|
|
122
|
+
"aria-haspopup": "menu",
|
|
123
|
+
id: f,
|
|
124
|
+
onMouseDown: (t) => {
|
|
125
|
+
if (e.select("open"))
|
|
126
|
+
return;
|
|
127
|
+
I.start(200, () => {
|
|
128
|
+
e.context.allowMouseUpTriggerRef.current = !0;
|
|
129
|
+
}), B(t.currentTarget).addEventListener("mouseup", M, {
|
|
130
|
+
once: !0
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}, c ? {
|
|
134
|
+
role: "menuitem"
|
|
135
|
+
} : {}, ae, q, re], k = n.useRef(null), pe = y((t) => {
|
|
136
|
+
D.flushSync(() => {
|
|
137
|
+
e.setOpen(!1, U(_, t.nativeEvent, t.currentTarget));
|
|
138
|
+
}), Ge(k.current)?.focus();
|
|
139
|
+
}), me = y((t) => {
|
|
140
|
+
const r = e.select("positionerElement");
|
|
141
|
+
if (r && Ye(t, r))
|
|
142
|
+
e.context.beforeContentFocusGuardRef.current?.focus();
|
|
143
|
+
else {
|
|
144
|
+
D.flushSync(() => {
|
|
145
|
+
e.setOpen(!1, U(_, t.nativeEvent, t.currentTarget));
|
|
146
|
+
});
|
|
147
|
+
let o = je(e.context.triggerFocusTargetRef.current || T.current);
|
|
148
|
+
for (; o !== null && C(r, o); ) {
|
|
149
|
+
const ge = o;
|
|
150
|
+
if (o = Ke(o), o === ge)
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
o?.focus();
|
|
154
|
+
}
|
|
155
|
+
}), N = Oe("button", l, {
|
|
156
|
+
enabled: !c,
|
|
157
|
+
stateAttributesMapping: H,
|
|
158
|
+
state: P,
|
|
159
|
+
ref: S,
|
|
160
|
+
props: w
|
|
161
|
+
});
|
|
162
|
+
return c ? /* @__PURE__ */ d(ye, {
|
|
163
|
+
tag: "button",
|
|
164
|
+
render: b,
|
|
165
|
+
className: m,
|
|
166
|
+
state: P,
|
|
167
|
+
refs: S,
|
|
168
|
+
props: w,
|
|
169
|
+
stateAttributesMapping: H
|
|
170
|
+
}) : u ? /* @__PURE__ */ we(n.Fragment, {
|
|
171
|
+
children: [/* @__PURE__ */ d(A, {
|
|
172
|
+
ref: k,
|
|
173
|
+
onFocus: pe
|
|
174
|
+
}, `${f}-pre-focus-guard`), /* @__PURE__ */ d(n.Fragment, {
|
|
175
|
+
children: N
|
|
176
|
+
}, f), /* @__PURE__ */ d(A, {
|
|
177
|
+
ref: e.context.triggerFocusTargetRef,
|
|
178
|
+
onFocus: me
|
|
179
|
+
}, `${f}-post-focus-guard`)]
|
|
180
|
+
}) : /* @__PURE__ */ d(n.Fragment, {
|
|
181
|
+
children: N
|
|
182
|
+
}, f);
|
|
183
|
+
});
|
|
184
|
+
process.env.NODE_ENV !== "production" && ($e.displayName = "MenuTrigger");
|
|
185
|
+
function Je(a, l) {
|
|
186
|
+
const i = L(), [b, m] = n.useState(!1);
|
|
187
|
+
return Te(() => {
|
|
188
|
+
a && l === "trigger-hover" ? (m(!0), i.start(Se, () => {
|
|
189
|
+
m(!1);
|
|
190
|
+
})) : a || (i.clear(), m(!1));
|
|
191
|
+
}, [a, l, i]), b;
|
|
192
|
+
}
|
|
193
|
+
function qe() {
|
|
194
|
+
const a = Ie(!0), l = G(!0), i = Pe();
|
|
195
|
+
return n.useMemo(() => i ? {
|
|
196
|
+
type: "menubar",
|
|
197
|
+
context: i
|
|
198
|
+
} : a && !l ? {
|
|
199
|
+
type: "context-menu",
|
|
200
|
+
context: a
|
|
201
|
+
} : {
|
|
202
|
+
type: void 0
|
|
203
|
+
}, [a, l, i]);
|
|
204
|
+
}
|
|
205
|
+
export {
|
|
206
|
+
$e as MenuTrigger
|
|
207
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isHTMLElement as r, isLastTraversableNode as e, getParentNode as i } from "../../../../../@floating-ui/utils/dist/floating-ui.utils.dom.js";
|
|
2
|
+
function n(t) {
|
|
3
|
+
if (r(t) && t.hasAttribute("data-rootownerid"))
|
|
4
|
+
return t.getAttribute("data-rootownerid") ?? void 0;
|
|
5
|
+
if (!e(t))
|
|
6
|
+
return n(i(t));
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
n as findRootOwnerId
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { transitionStatusMapping as r } from "../../utils/stateAttributesMapping.js";
|
|
2
|
+
import { MenuCheckboxItemDataAttributes as t } from "../checkbox-item/MenuCheckboxItemDataAttributes.js";
|
|
3
|
+
const c = {
|
|
4
|
+
checked(e) {
|
|
5
|
+
return e ? {
|
|
6
|
+
[t.checked]: ""
|
|
7
|
+
} : {
|
|
8
|
+
[t.unchecked]: ""
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
...r
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
c as itemMapping
|
|
15
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
const e = /* @__PURE__ */ t.createContext(null);
|
|
3
|
+
process.env.NODE_ENV !== "production" && (e.displayName = "MenubarContext");
|
|
4
|
+
function r(n) {
|
|
5
|
+
return t.useContext(e);
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
e as MenubarContext,
|
|
9
|
+
r as useMenubarContext
|
|
10
|
+
};
|
|
@@ -7,11 +7,11 @@ import { createChangeEventDetails as q } from "../../utils/createBaseUIEventDeta
|
|
|
7
7
|
import { useOpenInteractionType as w } from "../../utils/useOpenInteractionType.js";
|
|
8
8
|
import { jsx as p } from "react/jsx-runtime";
|
|
9
9
|
import { FloatingTree as z, useFloatingParentNodeId as B } from "../../floating-ui-react/components/FloatingTree.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
import { useSyncedFloatingRootContext as G } from "../../floating-ui-react/hooks/useSyncedFloatingRootContext.js";
|
|
11
|
+
import { useDismiss as J } from "../../floating-ui-react/hooks/useDismiss.js";
|
|
12
|
+
import { useRole as K } from "../../floating-ui-react/hooks/useRole.js";
|
|
13
|
+
import { useInteractions as Q } from "../../floating-ui-react/hooks/useInteractions.js";
|
|
14
|
+
import { useImplicitActiveTrigger as W, useOpenStateTransitions as X } from "../../utils/popups/popupStoreUtils.js";
|
|
15
15
|
import { imperativeAction as Y, triggerHover as Z } from "../../utils/reason-parts.js";
|
|
16
16
|
function O({
|
|
17
17
|
props: t
|
|
@@ -45,10 +45,10 @@ function O({
|
|
|
45
45
|
openMethod: g,
|
|
46
46
|
triggerProps: s
|
|
47
47
|
} = w(n);
|
|
48
|
-
|
|
48
|
+
W(e);
|
|
49
49
|
const {
|
|
50
50
|
forceUnmount: f
|
|
51
|
-
} =
|
|
51
|
+
} = X(n, e, () => {
|
|
52
52
|
e.update({
|
|
53
53
|
stickIfOpen: !0,
|
|
54
54
|
openChangeReason: null
|
|
@@ -69,21 +69,21 @@ function O({
|
|
|
69
69
|
unmount: f,
|
|
70
70
|
close: C
|
|
71
71
|
}), [f, C]);
|
|
72
|
-
const u =
|
|
72
|
+
const u = G({
|
|
73
73
|
popupStore: e,
|
|
74
74
|
onOpenChange: e.setOpen
|
|
75
|
-
}), E =
|
|
75
|
+
}), E = J(u, {
|
|
76
76
|
outsidePressEvent: {
|
|
77
77
|
// Ensure `aria-hidden` on outside elements is removed immediately
|
|
78
78
|
// on outside press when trapping focus.
|
|
79
79
|
mouse: r === "trap-focus" ? "sloppy" : "intentional",
|
|
80
80
|
touch: "sloppy"
|
|
81
81
|
}
|
|
82
|
-
}), F =
|
|
82
|
+
}), F = K(u), {
|
|
83
83
|
getReferenceProps: P,
|
|
84
84
|
getFloatingProps: v,
|
|
85
85
|
getTriggerProps: h
|
|
86
|
-
} =
|
|
86
|
+
} = Q([E, F]), M = o.useMemo(() => P(s), [P, s]), b = o.useMemo(() => h(s), [h, s]), D = o.useMemo(() => v(), [v]);
|
|
87
87
|
e.useSyncedValues({
|
|
88
88
|
modal: r,
|
|
89
89
|
openMethod: g,
|
|
@@ -4,14 +4,14 @@ import { Timeout as m } from "../../../../utils/esm/useTimeout.js";
|
|
|
4
4
|
import { useRefWithInit as g } from "../../../../utils/esm/useRefWithInit.js";
|
|
5
5
|
import { useOnMount as h } from "../../../../utils/esm/useOnMount.js";
|
|
6
6
|
import { PATIENT_CLICK_THRESHOLD as I } from "../../utils/constants.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { PopupTriggerMap as E } from "../../utils/popups/popupTriggerMap.js";
|
|
7
|
+
import { ReactStore as R } from "../../../../utils/esm/store/ReactStore.js";
|
|
8
|
+
import { PopupTriggerMap as T } from "../../utils/popups/popupTriggerMap.js";
|
|
10
9
|
import { createSelector as n } from "../../../../utils/esm/store/createSelector.js";
|
|
10
|
+
import { popupStoreSelectors as C, createInitialPopupStoreState as E } from "../../utils/popups/store.js";
|
|
11
11
|
import { focusOut as O, triggerHover as k, triggerPress as y, escapeKey as S } from "../../utils/reason-parts.js";
|
|
12
12
|
function w() {
|
|
13
13
|
return {
|
|
14
|
-
...
|
|
14
|
+
...E(),
|
|
15
15
|
disabled: !1,
|
|
16
16
|
modal: !1,
|
|
17
17
|
instantType: void 0,
|
|
@@ -27,7 +27,7 @@ function w() {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
const H = {
|
|
30
|
-
...
|
|
30
|
+
...C,
|
|
31
31
|
disabled: n((e) => e.disabled),
|
|
32
32
|
instantType: n((e) => e.instantType),
|
|
33
33
|
openMethod: n((e) => e.openMethod),
|
|
@@ -40,7 +40,7 @@ const H = {
|
|
|
40
40
|
closeDelay: n((e) => e.closeDelay),
|
|
41
41
|
hasViewport: n((e) => e.hasViewport)
|
|
42
42
|
};
|
|
43
|
-
class f extends
|
|
43
|
+
class f extends R {
|
|
44
44
|
constructor(o) {
|
|
45
45
|
const t = {
|
|
46
46
|
...w(),
|
|
@@ -55,7 +55,7 @@ class f extends C {
|
|
|
55
55
|
triggerFocusTargetRef: /* @__PURE__ */ s.createRef(),
|
|
56
56
|
beforeContentFocusGuardRef: /* @__PURE__ */ s.createRef(),
|
|
57
57
|
stickIfOpenTimeout: new m(),
|
|
58
|
-
triggerElements: new
|
|
58
|
+
triggerElements: new T()
|
|
59
59
|
}, H);
|
|
60
60
|
}
|
|
61
61
|
setOpen = (o, t) => {
|
|
@@ -12,13 +12,13 @@ import { useBaseUiId as te } from "../../utils/useBaseUiId.js";
|
|
|
12
12
|
import { FocusGuard as v } from "../../utils/FocusGuard.js";
|
|
13
13
|
import { createChangeEventDetails as R } from "../../utils/createBaseUIEventDetails.js";
|
|
14
14
|
import { jsxs as re, jsx as c } from "react/jsx-runtime";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { getTabbableBeforeElement as ce, isOutsideEvent as pe, getTabbableAfterElement as ue, getNextTabbable as le } from "../../floating-ui-react/utils/tabbable.js";
|
|
15
|
+
import { useHoverReferenceInteraction as oe } from "../../floating-ui-react/hooks/useHoverReferenceInteraction.js";
|
|
16
|
+
import { safePolygon as ne } from "../../floating-ui-react/safePolygon.js";
|
|
17
|
+
import { useClick as se } from "../../floating-ui-react/hooks/useClick.js";
|
|
18
|
+
import { useInteractions as ie } from "../../floating-ui-react/hooks/useInteractions.js";
|
|
19
|
+
import { useTriggerDataForwarding as ae } from "../../utils/popups/popupStoreUtils.js";
|
|
21
20
|
import { triggerPress as E, focusOut as P } from "../../utils/reason-parts.js";
|
|
21
|
+
import { getTabbableBeforeElement as ce, isOutsideEvent as pe, getTabbableAfterElement as ue, getNextTabbable as le } from "../../floating-ui-react/utils/tabbable.js";
|
|
22
22
|
import { contains as ge } from "../../floating-ui-react/utils/element.js";
|
|
23
23
|
const fe = /* @__PURE__ */ o.forwardRef(function(l, F) {
|
|
24
24
|
const {
|
|
@@ -39,26 +39,26 @@ const fe = /* @__PURE__ */ o.forwardRef(function(l, F) {
|
|
|
39
39
|
const n = te(I), m = e.useState("isTriggerActive", n), s = e.useState("floatingRootContext"), B = e.useState("isOpenedByTrigger", n), i = o.useRef(null), {
|
|
40
40
|
registerTrigger: N,
|
|
41
41
|
isMountedByThisTrigger: D
|
|
42
|
-
} =
|
|
42
|
+
} = ae(n, i, e, {
|
|
43
43
|
payload: y,
|
|
44
44
|
disabled: p,
|
|
45
45
|
openOnHover: g,
|
|
46
46
|
closeDelay: f
|
|
47
|
-
}), u = e.useState("openChangeReason"), w = e.useState("stickIfOpen"), k = e.useState("openMethod"), A =
|
|
47
|
+
}), u = e.useState("openChangeReason"), w = e.useState("stickIfOpen"), k = e.useState("openMethod"), A = oe(s, {
|
|
48
48
|
enabled: s != null && g && (k !== "touch" || u !== E),
|
|
49
49
|
mouseOnly: !0,
|
|
50
50
|
move: !1,
|
|
51
|
-
handleClose:
|
|
51
|
+
handleClose: ne(),
|
|
52
52
|
restMs: C,
|
|
53
53
|
delay: {
|
|
54
54
|
close: f
|
|
55
55
|
},
|
|
56
56
|
triggerElementRef: i,
|
|
57
57
|
isActiveTrigger: m
|
|
58
|
-
}), G =
|
|
58
|
+
}), G = se(s, {
|
|
59
59
|
enabled: s != null,
|
|
60
60
|
stickIfOpen: w
|
|
61
|
-
}), _ =
|
|
61
|
+
}), _ = ie([G]), j = e.useState("triggerProps", D), H = {
|
|
62
62
|
disabled: p,
|
|
63
63
|
open: B
|
|
64
64
|
}, {
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
const n = 500, t = {
|
|
1
|
+
const n = 500, t = 500, i = {
|
|
2
2
|
style: {
|
|
3
3
|
transition: "none"
|
|
4
4
|
}
|
|
5
|
-
},
|
|
5
|
+
}, I = "data-base-ui-click-trigger", o = {
|
|
6
6
|
fallbackAxisSide: "none"
|
|
7
|
-
},
|
|
7
|
+
}, s = {
|
|
8
8
|
fallbackAxisSide: "end"
|
|
9
|
-
},
|
|
9
|
+
}, e = {
|
|
10
10
|
clipPath: "inset(50%)",
|
|
11
11
|
position: "fixed",
|
|
12
12
|
top: 0,
|
|
13
13
|
left: 0
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
I as CLICK_TRIGGER_IDENTIFIER,
|
|
17
|
+
i as DISABLED_TRANSITIONS_STYLE,
|
|
18
|
+
o as DROPDOWN_COLLISION_AVOIDANCE,
|
|
19
|
+
t as PATIENT_CLICK_THRESHOLD,
|
|
20
|
+
s as POPUP_COLLISION_AVOIDANCE,
|
|
21
|
+
n as TYPEAHEAD_RESET_MS,
|
|
22
|
+
e as ownerVisuallyHidden
|
|
22
23
|
};
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
const s = "none", e = "trigger-press", t = "trigger-hover", n = "outside-press",
|
|
1
|
+
const s = "none", e = "trigger-press", t = "trigger-hover", n = "trigger-focus", o = "outside-press", c = "item-press", i = "close-press", r = "input-change", p = "input-clear", g = "input-press", a = "focus-out", u = "escape-key", l = "list-navigation", v = "cancel-open", P = "sibling-open", m = "imperative-action";
|
|
2
2
|
export {
|
|
3
|
+
v as cancelOpen,
|
|
3
4
|
i as closePress,
|
|
4
|
-
|
|
5
|
+
u as escapeKey,
|
|
5
6
|
a as focusOut,
|
|
6
|
-
|
|
7
|
+
m as imperativeAction,
|
|
7
8
|
r as inputChange,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
p as inputClear,
|
|
10
|
+
g as inputPress,
|
|
11
|
+
c as itemPress,
|
|
12
|
+
l as listNavigation,
|
|
12
13
|
s as none,
|
|
13
|
-
|
|
14
|
+
o as outsidePress,
|
|
15
|
+
P as siblingOpen,
|
|
16
|
+
n as triggerFocus,
|
|
14
17
|
t as triggerHover,
|
|
15
18
|
e as triggerPress
|
|
16
19
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as c from "react";
|
|
2
|
+
import { ownerDocument as i } from "../../../utils/esm/owner.js";
|
|
3
|
+
import { EMPTY_OBJECT as s } from "../../../utils/esm/empty.js";
|
|
4
|
+
function a(u) {
|
|
5
|
+
const {
|
|
6
|
+
enabled: t = !0,
|
|
7
|
+
mouseDownAction: r,
|
|
8
|
+
open: n
|
|
9
|
+
} = u, e = c.useRef(!1);
|
|
10
|
+
return c.useMemo(() => t ? {
|
|
11
|
+
onMouseDown: (o) => {
|
|
12
|
+
(r === "open" && !n || r === "close" && n) && (e.current = !0, i(o.currentTarget).addEventListener("click", () => {
|
|
13
|
+
e.current = !1;
|
|
14
|
+
}, {
|
|
15
|
+
once: !0
|
|
16
|
+
}));
|
|
17
|
+
},
|
|
18
|
+
onClick: (o) => {
|
|
19
|
+
e.current && (e.current = !1, o.preventBaseUIHandler());
|
|
20
|
+
}
|
|
21
|
+
} : s, [t, r, n]);
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
a as useMixedToggleClickHandler
|
|
25
|
+
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
const a = typeof navigator < "u", o =
|
|
1
|
+
const a = typeof navigator < "u", o = e(), n = f(), r = u(), c = typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter:none"), m = (
|
|
2
2
|
// iPads can claim to be MacIntel
|
|
3
3
|
o.platform === "MacIntel" && o.maxTouchPoints > 1 ? !0 : /iP(hone|ad|od)|iOS/.test(o.platform)
|
|
4
|
-
), p = a && /firefox/i.test(r), g = a && /apple/i.test(navigator.vendor), d = a && /android/i.test(n) || /android/i.test(r);
|
|
5
|
-
|
|
6
|
-
const l = r.includes("jsdom/");
|
|
7
|
-
function s() {
|
|
4
|
+
), p = a && /firefox/i.test(r), g = a && /apple/i.test(navigator.vendor), d = a && /android/i.test(n) || /android/i.test(r), l = a && n.toLowerCase().startsWith("mac") && !navigator.maxTouchPoints, v = r.includes("jsdom/");
|
|
5
|
+
function e() {
|
|
8
6
|
if (!a)
|
|
9
7
|
return {
|
|
10
8
|
platform: "",
|
|
@@ -25,8 +23,8 @@ function u() {
|
|
|
25
23
|
const t = navigator.userAgentData;
|
|
26
24
|
return t && Array.isArray(t.brands) ? t.brands.map(({
|
|
27
25
|
brand: i,
|
|
28
|
-
version:
|
|
29
|
-
}) => `${i}/${
|
|
26
|
+
version: s
|
|
27
|
+
}) => `${i}/${s}`).join(" ") : navigator.userAgent;
|
|
30
28
|
}
|
|
31
29
|
function f() {
|
|
32
30
|
if (!a)
|
|
@@ -38,7 +36,8 @@ export {
|
|
|
38
36
|
d as isAndroid,
|
|
39
37
|
p as isFirefox,
|
|
40
38
|
m as isIOS,
|
|
41
|
-
|
|
39
|
+
v as isJSDOM,
|
|
40
|
+
l as isMac,
|
|
42
41
|
g as isSafari,
|
|
43
42
|
c as isWebKit
|
|
44
43
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as c from "react";
|
|
2
|
+
import { useRefWithInit as u } from "./useRefWithInit.js";
|
|
3
|
+
const o = [];
|
|
4
|
+
let r;
|
|
5
|
+
function p() {
|
|
6
|
+
return r;
|
|
7
|
+
}
|
|
8
|
+
function I(t) {
|
|
9
|
+
o.push(t);
|
|
10
|
+
}
|
|
11
|
+
function d(t) {
|
|
12
|
+
const i = (f, s) => {
|
|
13
|
+
const n = u(l).current;
|
|
14
|
+
let a;
|
|
15
|
+
try {
|
|
16
|
+
r = n;
|
|
17
|
+
for (const e of o)
|
|
18
|
+
e.before(n);
|
|
19
|
+
a = t(f, s);
|
|
20
|
+
for (const e of o)
|
|
21
|
+
e.after(n);
|
|
22
|
+
n.didInitialize = !0;
|
|
23
|
+
} finally {
|
|
24
|
+
r = void 0;
|
|
25
|
+
}
|
|
26
|
+
return a;
|
|
27
|
+
};
|
|
28
|
+
return i.displayName = t.displayName || t.name, i;
|
|
29
|
+
}
|
|
30
|
+
function h(t) {
|
|
31
|
+
return /* @__PURE__ */ c.forwardRef(d(t));
|
|
32
|
+
}
|
|
33
|
+
function l() {
|
|
34
|
+
return {
|
|
35
|
+
didInitialize: !1
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
d as fastComponent,
|
|
40
|
+
h as fastComponentRef,
|
|
41
|
+
p as getInstance,
|
|
42
|
+
I as register
|
|
43
|
+
};
|
|
@@ -1,21 +1,62 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as f from "react";
|
|
2
2
|
import { s as u } from "../../../../../_virtual/index.js";
|
|
3
|
-
import { w as
|
|
3
|
+
import { w as d } from "../../../../../_virtual/with-selector.js";
|
|
4
4
|
import { isReactVersionAtLeast as S } from "../reactVersion.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { getInstance as a, register as h } from "../fastHooks.js";
|
|
6
|
+
const l = S(19), g = l ? p : y;
|
|
7
|
+
function H(e, r, s, o, t) {
|
|
8
|
+
return g(e, r, s, o, t);
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
-
return u.useSyncExternalStore(
|
|
10
|
+
function b(e, r, s, o, t) {
|
|
11
|
+
const i = f.useCallback(() => r(e.getSnapshot(), s, o, t), [e, r, s, o, t]);
|
|
12
|
+
return u.useSyncExternalStore(e.subscribe, i, i);
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
h({
|
|
15
|
+
before(e) {
|
|
16
|
+
e.syncIndex = 0, e.didInitialize || (e.syncTick = 1, e.syncHooks = [], e.didChangeStore = !0, e.getSnapshot = () => {
|
|
17
|
+
let r = !1;
|
|
18
|
+
for (let s = 0; s < e.syncHooks.length; s += 1) {
|
|
19
|
+
const o = e.syncHooks[s], t = o.selector(o.store.state, o.a1, o.a2, o.a3);
|
|
20
|
+
(o.didChange || !Object.is(o.value, t)) && (r = !0, o.value = t, o.didChange = !1);
|
|
21
|
+
}
|
|
22
|
+
return r && (e.syncTick += 1), e.syncTick;
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
after(e) {
|
|
26
|
+
e.syncHooks.length > 0 && (e.didChangeStore && (e.didChangeStore = !1, e.subscribe = (r) => {
|
|
27
|
+
const s = /* @__PURE__ */ new Set();
|
|
28
|
+
for (const t of e.syncHooks)
|
|
29
|
+
s.add(t.store);
|
|
30
|
+
const o = [];
|
|
31
|
+
for (const t of s)
|
|
32
|
+
o.push(t.subscribe(r));
|
|
33
|
+
return () => {
|
|
34
|
+
for (const t of o)
|
|
35
|
+
t();
|
|
36
|
+
};
|
|
37
|
+
}), u.useSyncExternalStore(e.subscribe, e.getSnapshot, e.getSnapshot));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
function p(e, r, s, o, t) {
|
|
41
|
+
const i = a();
|
|
42
|
+
if (!i)
|
|
43
|
+
return b(e, r, s, o, t);
|
|
44
|
+
const c = i.syncIndex;
|
|
45
|
+
i.syncIndex += 1;
|
|
46
|
+
let n;
|
|
47
|
+
return i.didInitialize ? (n = i.syncHooks[c], (n.store !== e || n.selector !== r || !Object.is(n.a1, s) || !Object.is(n.a2, o) || !Object.is(n.a3, t)) && (n.store !== e && (i.didChangeStore = !0), n.store = e, n.selector = r, n.a1 = s, n.a2 = o, n.a3 = t, n.didChange = !0)) : (n = {
|
|
48
|
+
store: e,
|
|
49
|
+
selector: r,
|
|
50
|
+
a1: s,
|
|
51
|
+
a2: o,
|
|
52
|
+
a3: t,
|
|
53
|
+
value: r(e.getSnapshot(), s, o, t),
|
|
54
|
+
didChange: !1
|
|
55
|
+
}, i.syncHooks.push(n)), n.value;
|
|
15
56
|
}
|
|
16
|
-
function
|
|
17
|
-
return
|
|
57
|
+
function y(e, r, s, o, t) {
|
|
58
|
+
return d.useSyncExternalStoreWithSelector(e.subscribe, e.getSnapshot, e.getSnapshot, (i) => r(i, s, o, t));
|
|
18
59
|
}
|
|
19
60
|
export {
|
|
20
|
-
|
|
61
|
+
H as useStore
|
|
21
62
|
};
|