@wix/site-ui 1.29.0 → 1.31.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/dist/1268.js +99 -0
- package/dist/1279.js +7 -0
- package/dist/1457.js +10 -0
- package/dist/1477.js +106 -0
- package/dist/1500.js +111 -0
- package/dist/167.js +6 -0
- package/dist/2274.js +34 -0
- package/dist/2287.js +17 -0
- package/dist/2418.js +31 -0
- package/dist/2801.js +20 -0
- package/dist/285.js +86 -0
- package/dist/2861.js +6 -0
- package/dist/3020.js +7 -0
- package/dist/3021.js +72 -0
- package/dist/3056.js +229 -0
- package/dist/3140.js +4 -0
- package/dist/3248.js +307 -0
- package/dist/3296.js +4 -0
- package/dist/3319.js +400 -0
- package/dist/3395.js +4 -0
- package/dist/3485.js +854 -0
- package/dist/353.js +14 -0
- package/dist/3670.js +418 -0
- package/dist/3829.js +113 -0
- package/dist/4026.js +12 -0
- package/dist/4143.js +46 -0
- package/dist/42.js +32 -0
- package/dist/4281.js +30 -0
- package/dist/4346.js +2 -0
- package/dist/4388.js +418 -0
- package/dist/4490.js +32 -0
- package/dist/4495.js +9 -0
- package/dist/4549.js +24 -0
- package/dist/4586.js +41 -0
- package/dist/4586.js.LICENSE.txt +19 -0
- package/dist/4707.js +19 -0
- package/dist/4723.js +7 -0
- package/dist/4745.js +7 -0
- package/dist/4768.js +35 -0
- package/dist/4922.js +15 -0
- package/dist/5036.js +17 -0
- package/dist/5085.js +20 -0
- package/dist/5299.js +597 -0
- package/dist/5659.js +4 -0
- package/dist/5778.js +10 -0
- package/dist/5864.js +86 -0
- package/dist/5992.js +913 -0
- package/dist/5992.js.LICENSE.txt +19 -0
- package/dist/6003.js +10 -0
- package/dist/6046.js +29 -0
- package/dist/6089.js +2355 -0
- package/dist/6107.js +10 -0
- package/dist/6247.js +20 -0
- package/dist/6270.js +487 -0
- package/dist/6329.js +32 -0
- package/dist/6330.js +30 -0
- package/dist/6499.js +7 -0
- package/dist/6535.js +71 -0
- package/dist/6588.js +382 -0
- package/dist/6706.js +16 -0
- package/dist/6825.js +7 -0
- package/dist/6882.js +1562 -0
- package/dist/6914.js +30 -0
- package/dist/7021.js +13 -0
- package/dist/7366.js +83 -0
- package/dist/7373.js +25 -0
- package/dist/7541.js +25 -0
- package/dist/7564.js +10 -0
- package/dist/7642.js +20 -0
- package/dist/7725.js +10 -0
- package/dist/7871.js +38 -0
- package/dist/8052.js +352 -0
- package/dist/8106.js +238 -0
- package/dist/8171.js +346 -0
- package/dist/8225.js +21 -0
- package/dist/8272.js +333 -0
- package/dist/8527.js +58 -0
- package/dist/8724.js +10 -0
- package/dist/8750.js +1920 -0
- package/dist/8758.js +43 -0
- package/dist/880.js +149 -0
- package/dist/8935.js +8 -0
- package/dist/8960.js +22 -0
- package/dist/8971.js +40 -0
- package/dist/8979.js +10 -0
- package/dist/8996.js +71 -0
- package/dist/904.js +121 -0
- package/dist/9048.js +52 -0
- package/dist/9087.js +256 -0
- package/dist/9189.js +158 -0
- package/dist/9255.js +136 -0
- package/dist/9352.js +148 -0
- package/dist/951.js +22 -0
- package/dist/9635.js +22 -0
- package/dist/9829.js +4 -0
- package/dist/9863.js +8 -0
- package/dist/Accordion/index.d.ts +569 -12
- package/dist/Accordion/index.js +423 -8
- package/dist/AlertDialog/index.d.ts +1417 -18
- package/dist/AlertDialog/index.js +34 -14
- package/dist/Autocomplete/index.d.ts +1861 -38
- package/dist/Autocomplete/index.js +98 -24
- package/dist/Avatar/index.d.ts +129 -7
- package/dist/Avatar/index.js +149 -6
- package/dist/Badge/index.css +44 -0
- package/dist/Badge/index.d.ts +22 -0
- package/dist/Badge/index.js +23 -0
- package/dist/Breadcrumbs/index.d.ts +960 -7
- package/dist/Breadcrumbs/index.js +5 -5
- package/dist/Button/index.d.ts +88 -6
- package/dist/Button/index.js +27 -3
- package/dist/Checkbox/index.d.ts +425 -5
- package/dist/Checkbox/index.js +45 -5
- package/dist/CheckboxGroup/index.d.ts +318 -3
- package/dist/CheckboxGroup/index.js +166 -3
- package/dist/Collapsible/index.d.ts +377 -7
- package/dist/Collapsible/index.js +160 -6
- package/dist/Combobox/index.d.ts +1984 -48
- package/dist/Combobox/index.js +352 -29
- package/dist/ContextMenu/index.d.ts +2340 -36
- package/dist/ContextMenu/index.js +197 -22
- package/dist/Dialog/index.d.ts +1355 -18
- package/dist/Dialog/index.js +16 -14
- package/dist/Drawer/index.d.ts +1653 -18
- package/dist/Drawer/index.js +2797 -20
- package/dist/Field/index.d.ts +655 -15
- package/dist/Field/index.js +677 -10
- package/dist/Fieldset/index.d.ts +94 -5
- package/dist/Fieldset/index.js +68 -5
- package/dist/Form/index.d.ts +331 -2
- package/dist/Form/index.js +106 -3
- package/dist/Input/index.d.ts +692 -3
- package/dist/Input/index.js +10 -3
- package/dist/Menu/index.d.ts +2301 -36
- package/dist/Menu/index.js +365 -26
- package/dist/Menubar/index.d.ts +2301 -3
- package/dist/Menubar/index.js +105 -3
- package/dist/Meter/index.d.ts +175 -11
- package/dist/Meter/index.js +129 -9
- package/dist/NavigationMenu/index.d.ts +978 -28
- package/dist/NavigationMenu/index.js +1034 -17
- package/dist/NumberField/index.d.ts +612 -15
- package/dist/NumberField/index.js +1409 -11
- package/dist/Popover/index.d.ts +1655 -20
- package/dist/Popover/index.js +792 -17
- package/dist/PreviewCard/index.d.ts +1523 -14
- package/dist/PreviewCard/index.js +679 -14
- package/dist/Progress/index.d.ts +183 -11
- package/dist/Progress/index.js +181 -9
- package/dist/Radio/index.d.ts +185 -6
- package/dist/Radio/index.js +253 -6
- package/dist/RadioGroup/index.d.ts +341 -2
- package/dist/RadioGroup/index.js +154 -3
- package/dist/ScrollArea/index.d.ts +265 -13
- package/dist/ScrollArea/index.js +892 -10
- package/dist/Select/index.d.ts +1493 -38
- package/dist/Select/index.js +1824 -23
- package/dist/Separator/index.d.ts +80 -6
- package/dist/Separator/index.js +3 -3
- package/dist/Slider/index.d.ts +678 -16
- package/dist/Slider/index.js +1199 -11
- package/dist/Switch/index.d.ts +393 -5
- package/dist/Switch/index.js +208 -6
- package/dist/Tabs/index.d.ts +523 -12
- package/dist/Tabs/index.js +685 -9
- package/dist/Toggle/index.d.ts +305 -2
- package/dist/Toggle/index.js +76 -3
- package/dist/ToggleGroup/index.d.ts +316 -2
- package/dist/ToggleGroup/index.js +102 -3
- package/dist/Toolbar/index.d.ts +282 -13
- package/dist/Toolbar/index.js +230 -9
- package/dist/Tooltip/index.d.ts +1572 -14
- package/dist/Tooltip/index.js +965 -14
- package/dist/index.d.ts +12758 -646
- package/dist/index.js +1 -0
- package/dist/rslib-runtime.js +18 -0
- package/package.json +3 -3
|
@@ -1,53 +1,718 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { PreviewCard } from "@base-ui/react/preview-card";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
2
|
import clsx from "clsx";
|
|
3
|
+
import { EMPTY_OBJECT, mergeProps, useRenderElement, esm_formatErrorMessage } from "../8272.js";
|
|
4
|
+
import { isElement } from "../3829.js";
|
|
5
|
+
import { triggerOpenStateMapping, popupStateMapping, POPUP_COLLISION_AVOIDANCE } from "../4388.js";
|
|
6
|
+
import { useFloatingNodeId, FloatingNode, FloatingTree } from "../285.js";
|
|
7
|
+
import { usePositioner, adaptiveOriginMiddleware_adaptiveOrigin, useAnchorPositioning, getDisabledMountTransitionStyles } from "../8750.js";
|
|
8
|
+
import { useIsoLayoutEffect } from "../6499.js";
|
|
9
|
+
import { transitionStatusMapping, useOpenChangeComplete } from "../880.js";
|
|
10
|
+
import { useStableCallback } from "../7541.js";
|
|
11
|
+
import { useHoverFloatingInteraction } from "../3056.js";
|
|
12
|
+
import { usePopupViewport } from "../8171.js";
|
|
13
|
+
import { useDismiss, PopupTriggerMap, createSelector, fastComponent, fastComponentRef, ReactStore } from "../5992.js";
|
|
14
|
+
import { useBaseUiId } from "../6046.js";
|
|
15
|
+
import { useTriggerDataForwarding, usePopupInteractionProps, setOpenTriggerState, usePopupStore, useImplicitActiveTrigger, useOnFirstRender, useOpenStateTransitions, FOCUSABLE_POPUP_PROPS } from "../8106.js";
|
|
16
|
+
import { safePolygon, useHoverReferenceInteraction } from "../3670.js";
|
|
17
|
+
import { useFocus } from "../904.js";
|
|
18
|
+
import { createPopupFloatingRootContext, popupStoreSelectors, createInitialPopupStoreState } from "../6535.js";
|
|
19
|
+
import { imperativeAction, triggerFocus, triggerHover, triggerPress, escapeKey } from "../2418.js";
|
|
20
|
+
import { createChangeEventDetails } from "../4768.js";
|
|
21
|
+
import { FloatingPortalLite_FloatingPortalLite } from "../8960.js";
|
|
4
22
|
import * as __rspack_external_react from "react";
|
|
23
|
+
import * as __rspack_external_react_dom_7136dc57 from "react-dom";
|
|
24
|
+
const PreviewCardRootContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
|
|
25
|
+
if ("production" !== process.env.NODE_ENV) PreviewCardRootContext.displayName = "PreviewCardRootContext";
|
|
26
|
+
function usePreviewCardRootContext(optional) {
|
|
27
|
+
const context = __rspack_external_react.useContext(PreviewCardRootContext);
|
|
28
|
+
if (void 0 === context && !optional) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: PreviewCardRootContext is missing. PreviewCard parts must be placed within <PreviewCard.Root>.' : esm_formatErrorMessage(50));
|
|
29
|
+
return context;
|
|
30
|
+
}
|
|
31
|
+
const PreviewCardPositionerContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
|
|
32
|
+
if ("production" !== process.env.NODE_ENV) PreviewCardPositionerContext.displayName = "PreviewCardPositionerContext";
|
|
33
|
+
function usePreviewCardPositionerContext() {
|
|
34
|
+
const context = __rspack_external_react.useContext(PreviewCardPositionerContext);
|
|
35
|
+
if (void 0 === context) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: <PreviewCard.Popup> and <PreviewCard.Arrow> must be used within the <PreviewCard.Positioner> component' : esm_formatErrorMessage(49));
|
|
36
|
+
return context;
|
|
37
|
+
}
|
|
38
|
+
const PreviewCardPortalContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
|
|
39
|
+
if ("production" !== process.env.NODE_ENV) PreviewCardPortalContext.displayName = "PreviewCardPortalContext";
|
|
40
|
+
function usePreviewCardPortalContext() {
|
|
41
|
+
const value = __rspack_external_react.useContext(PreviewCardPortalContext);
|
|
42
|
+
if (void 0 === value) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: <PreviewCard.Portal> is missing.' : esm_formatErrorMessage(48));
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
function createRect(left, top, right, bottom) {
|
|
46
|
+
return {
|
|
47
|
+
left,
|
|
48
|
+
top,
|
|
49
|
+
right,
|
|
50
|
+
bottom,
|
|
51
|
+
x: left,
|
|
52
|
+
y: top,
|
|
53
|
+
width: right - left,
|
|
54
|
+
height: bottom - top
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function copyRect(rect) {
|
|
58
|
+
return {
|
|
59
|
+
left: rect.left,
|
|
60
|
+
top: rect.top,
|
|
61
|
+
right: rect.right,
|
|
62
|
+
bottom: rect.bottom,
|
|
63
|
+
width: rect.width,
|
|
64
|
+
height: rect.height
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function getLineRects(rects) {
|
|
68
|
+
const lines = [];
|
|
69
|
+
let previousRect;
|
|
70
|
+
let left = 1 / 0;
|
|
71
|
+
let top = 1 / 0;
|
|
72
|
+
let right = -1 / 0;
|
|
73
|
+
let bottom = -1 / 0;
|
|
74
|
+
for (const rect of Array.from(rects).sort((a, b)=>a.top - b.top)){
|
|
75
|
+
left = Math.min(left, rect.left);
|
|
76
|
+
top = Math.min(top, rect.top);
|
|
77
|
+
right = Math.max(right, rect.right);
|
|
78
|
+
bottom = Math.max(bottom, rect.bottom);
|
|
79
|
+
if (!previousRect || rect.top - previousRect.top > previousRect.height / 2) lines.push(copyRect(rect));
|
|
80
|
+
else {
|
|
81
|
+
const line = lines[lines.length - 1];
|
|
82
|
+
line.left = Math.min(line.left, rect.left);
|
|
83
|
+
line.right = Math.max(line.right, rect.right);
|
|
84
|
+
line.bottom = Math.max(line.bottom, rect.bottom);
|
|
85
|
+
line.width = line.right - line.left;
|
|
86
|
+
line.height = line.bottom - line.top;
|
|
87
|
+
}
|
|
88
|
+
previousRect = rect;
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
lines,
|
|
92
|
+
fallback: createRect(left, top, right, bottom)
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function findLineIndex(lines, x, y) {
|
|
96
|
+
return lines.findIndex((lineRect)=>x > lineRect.left - 2 && x < lineRect.right + 2 && y > lineRect.top - 2 && y < lineRect.bottom + 2);
|
|
97
|
+
}
|
|
98
|
+
function createClientRect(rect) {
|
|
99
|
+
return createRect(rect.left, rect.top, rect.right, rect.bottom);
|
|
100
|
+
}
|
|
101
|
+
function getInlineRectCoords(element, clientX, clientY) {
|
|
102
|
+
const { lines } = getLineRects(element.getClientRects());
|
|
103
|
+
if (lines.length < 2) return;
|
|
104
|
+
const lineIndex = findLineIndex(lines, clientX, clientY);
|
|
105
|
+
return {
|
|
106
|
+
x: clientX,
|
|
107
|
+
y: clientY,
|
|
108
|
+
lineIndex: -1 === lineIndex ? void 0 : lineIndex,
|
|
109
|
+
element
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function getInlineReferenceRect(reference, placement, coords) {
|
|
113
|
+
const { lines, fallback } = getLineRects(reference.getClientRects());
|
|
114
|
+
if (lines.length < 2) return null;
|
|
115
|
+
const x = coords?.x;
|
|
116
|
+
const y = coords?.y;
|
|
117
|
+
const side = placement[0];
|
|
118
|
+
if (coords?.lineIndex != null && lines[coords.lineIndex]) return createClientRect(lines[coords.lineIndex]);
|
|
119
|
+
if (null != x && null != y) {
|
|
120
|
+
const lineIndex = findLineIndex(lines, x, y);
|
|
121
|
+
if (-1 !== lineIndex) return createClientRect(lines[lineIndex]);
|
|
122
|
+
}
|
|
123
|
+
if (2 === lines.length && lines[0].left > lines[1].right && null != x && null != y) return fallback;
|
|
124
|
+
if ('t' === side || 'b' === side) {
|
|
125
|
+
const firstRect = lines[0];
|
|
126
|
+
const lastRect = lines[lines.length - 1];
|
|
127
|
+
const targetRect = 't' === side ? firstRect : lastRect;
|
|
128
|
+
return createRect(targetRect.left, firstRect.top, targetRect.right, lastRect.bottom);
|
|
129
|
+
}
|
|
130
|
+
const isLeft = 'l' === side;
|
|
131
|
+
let left = lines[0].left;
|
|
132
|
+
let right = lines[0].right;
|
|
133
|
+
let edge = isLeft ? 1 / 0 : -1 / 0;
|
|
134
|
+
let targetFirstRect = lines[0];
|
|
135
|
+
let targetLastRect = lines[0];
|
|
136
|
+
for (const rect of lines){
|
|
137
|
+
left = Math.min(left, rect.left);
|
|
138
|
+
right = Math.max(right, rect.right);
|
|
139
|
+
const nextEdge = isLeft ? rect.left : rect.right;
|
|
140
|
+
if (isLeft && nextEdge < edge || !isLeft && nextEdge > edge) {
|
|
141
|
+
edge = nextEdge;
|
|
142
|
+
targetFirstRect = rect;
|
|
143
|
+
targetLastRect = rect;
|
|
144
|
+
} else if (nextEdge === edge) targetLastRect = rect;
|
|
145
|
+
}
|
|
146
|
+
return createRect(left, targetFirstRect.top, right, targetLastRect.bottom);
|
|
147
|
+
}
|
|
148
|
+
function getContextElement(reference) {
|
|
149
|
+
if ('contextElement' in reference && reference.contextElement) return reference.contextElement;
|
|
150
|
+
return isElement(reference) ? reference : void 0;
|
|
151
|
+
}
|
|
152
|
+
function getInlineRectTriggerProps(coordsRef, isOpen) {
|
|
153
|
+
function updateCoords(event) {
|
|
154
|
+
updateInlineRectCoords(coordsRef, event.currentTarget, event.clientX, event.clientY);
|
|
155
|
+
}
|
|
156
|
+
function updateCoordsOnMove(event) {
|
|
157
|
+
if (!isOpen) updateCoords(event);
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
onFocus () {
|
|
161
|
+
coordsRef.current = void 0;
|
|
162
|
+
},
|
|
163
|
+
onMouseEnter: updateCoords,
|
|
164
|
+
onMouseMove: updateCoordsOnMove
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function updateInlineRectCoords(coordsRef, element, clientX, clientY) {
|
|
168
|
+
const nextCoords = getInlineRectCoords(element, clientX, clientY);
|
|
169
|
+
coordsRef.current = nextCoords;
|
|
170
|
+
return nextCoords;
|
|
171
|
+
}
|
|
172
|
+
function createInlineMiddleware(coordsRef) {
|
|
173
|
+
return {
|
|
174
|
+
name: 'inline',
|
|
175
|
+
async fn (state) {
|
|
176
|
+
const reference = state.elements.reference;
|
|
177
|
+
if ('function' != typeof reference?.getClientRects) return {};
|
|
178
|
+
const contextElement = getContextElement(reference);
|
|
179
|
+
const coords = coordsRef.current;
|
|
180
|
+
const currentCoords = coords?.element === reference || coords?.element === contextElement ? coords : void 0;
|
|
181
|
+
const rect = getInlineReferenceRect(reference, state.placement, currentCoords);
|
|
182
|
+
if (!rect || 'function' != typeof state.platform.getElementRects) return {};
|
|
183
|
+
const resetRects = await state.platform.getElementRects({
|
|
184
|
+
reference: {
|
|
185
|
+
contextElement,
|
|
186
|
+
getBoundingClientRect () {
|
|
187
|
+
return rect;
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
floating: state.elements.floating,
|
|
191
|
+
strategy: state.strategy
|
|
192
|
+
});
|
|
193
|
+
if (state.rects.reference.x === resetRects.reference.x && state.rects.reference.y === resetRects.reference.y && state.rects.reference.width === resetRects.reference.width && state.rects.reference.height === resetRects.reference.height) return {};
|
|
194
|
+
return {
|
|
195
|
+
reset: {
|
|
196
|
+
rects: resetRects
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
const PreviewCardPositioner_PreviewCardPositioner = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
203
|
+
const { render, className, anchor, positionMethod = 'absolute', side = 'bottom', align = 'center', sideOffset = 0, alignOffset = 0, collisionBoundary = 'clipping-ancestors', collisionPadding = 5, arrowPadding = 5, sticky = false, disableAnchorTracking = false, collisionAvoidance = POPUP_COLLISION_AVOIDANCE, style, ...elementProps } = componentProps;
|
|
204
|
+
const store = usePreviewCardRootContext();
|
|
205
|
+
const keepMounted = usePreviewCardPortalContext();
|
|
206
|
+
const nodeId = useFloatingNodeId();
|
|
207
|
+
const open = store.useState('open');
|
|
208
|
+
const mounted = store.useState('mounted');
|
|
209
|
+
const floatingRootContext = store.useState('floatingRootContext');
|
|
210
|
+
const instantType = store.useState('instantType');
|
|
211
|
+
const transitionStatus = store.useState('transitionStatus');
|
|
212
|
+
const hasViewport = store.useState('hasViewport');
|
|
213
|
+
const inlineRectCoordsRef = store.context.inlineRectCoordsRef;
|
|
214
|
+
const positioning = useAnchorPositioning({
|
|
215
|
+
anchor,
|
|
216
|
+
floatingRootContext,
|
|
217
|
+
positionMethod,
|
|
218
|
+
mounted,
|
|
219
|
+
side,
|
|
220
|
+
sideOffset,
|
|
221
|
+
align,
|
|
222
|
+
alignOffset,
|
|
223
|
+
arrowPadding,
|
|
224
|
+
collisionBoundary,
|
|
225
|
+
collisionPadding,
|
|
226
|
+
sticky,
|
|
227
|
+
disableAnchorTracking,
|
|
228
|
+
keepMounted,
|
|
229
|
+
nodeId,
|
|
230
|
+
collisionAvoidance,
|
|
231
|
+
adaptiveOrigin: hasViewport ? adaptiveOriginMiddleware_adaptiveOrigin : void 0,
|
|
232
|
+
inline: createInlineMiddleware(inlineRectCoordsRef)
|
|
233
|
+
});
|
|
234
|
+
const updatePosition = positioning.update;
|
|
235
|
+
useIsoLayoutEffect(()=>{
|
|
236
|
+
if (open && mounted) updatePosition();
|
|
237
|
+
}, [
|
|
238
|
+
open,
|
|
239
|
+
mounted,
|
|
240
|
+
updatePosition
|
|
241
|
+
]);
|
|
242
|
+
const state = {
|
|
243
|
+
open,
|
|
244
|
+
side: positioning.side,
|
|
245
|
+
align: positioning.align,
|
|
246
|
+
anchorHidden: positioning.anchorHidden,
|
|
247
|
+
instant: instantType
|
|
248
|
+
};
|
|
249
|
+
const element = usePositioner(componentProps, state, {
|
|
250
|
+
styles: positioning.positionerStyles,
|
|
251
|
+
transitionStatus,
|
|
252
|
+
props: elementProps,
|
|
253
|
+
refs: [
|
|
254
|
+
forwardedRef,
|
|
255
|
+
store.useStateSetter('positionerElement')
|
|
256
|
+
],
|
|
257
|
+
hidden: !mounted,
|
|
258
|
+
inert: !open
|
|
259
|
+
});
|
|
260
|
+
return /*#__PURE__*/ jsx(PreviewCardPositionerContext.Provider, {
|
|
261
|
+
value: positioning,
|
|
262
|
+
children: /*#__PURE__*/ jsx(FloatingNode, {
|
|
263
|
+
id: nodeId,
|
|
264
|
+
children: element
|
|
265
|
+
})
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
if ("production" !== process.env.NODE_ENV) PreviewCardPositioner_PreviewCardPositioner.displayName = "PreviewCardPositioner";
|
|
269
|
+
const stateAttributesMapping = {
|
|
270
|
+
...popupStateMapping,
|
|
271
|
+
...transitionStatusMapping
|
|
272
|
+
};
|
|
273
|
+
const PreviewCardPopup_PreviewCardPopup = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
274
|
+
const { className, render, style, ...elementProps } = componentProps;
|
|
275
|
+
const store = usePreviewCardRootContext();
|
|
276
|
+
const { side, align } = usePreviewCardPositionerContext();
|
|
277
|
+
const open = store.useState('open');
|
|
278
|
+
const instantType = store.useState('instantType');
|
|
279
|
+
const transitionStatus = store.useState('transitionStatus');
|
|
280
|
+
const popupProps = store.useState('popupProps');
|
|
281
|
+
const floatingContext = store.useState('floatingRootContext');
|
|
282
|
+
useOpenChangeComplete({
|
|
283
|
+
open,
|
|
284
|
+
ref: store.context.popupRef,
|
|
285
|
+
onComplete () {
|
|
286
|
+
if (open) store.context.onOpenChangeComplete?.(true);
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
const getCloseDelay = useStableCallback(()=>store.context.closeDelayRef.current);
|
|
290
|
+
useHoverFloatingInteraction(floatingContext, {
|
|
291
|
+
closeDelay: getCloseDelay
|
|
292
|
+
});
|
|
293
|
+
const state = {
|
|
294
|
+
open,
|
|
295
|
+
side,
|
|
296
|
+
align,
|
|
297
|
+
instant: instantType,
|
|
298
|
+
transitionStatus
|
|
299
|
+
};
|
|
300
|
+
const element = useRenderElement('div', componentProps, {
|
|
301
|
+
state,
|
|
302
|
+
ref: [
|
|
303
|
+
forwardedRef,
|
|
304
|
+
store.context.popupRef,
|
|
305
|
+
store.useStateSetter('popupElement')
|
|
306
|
+
],
|
|
307
|
+
props: [
|
|
308
|
+
popupProps,
|
|
309
|
+
getDisabledMountTransitionStyles(transitionStatus),
|
|
310
|
+
elementProps
|
|
311
|
+
],
|
|
312
|
+
stateAttributesMapping: stateAttributesMapping
|
|
313
|
+
});
|
|
314
|
+
return element;
|
|
315
|
+
});
|
|
316
|
+
if ("production" !== process.env.NODE_ENV) PreviewCardPopup_PreviewCardPopup.displayName = "PreviewCardPopup";
|
|
317
|
+
const PreviewCardArrow_PreviewCardArrow = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
318
|
+
const { render, className, style, ...elementProps } = componentProps;
|
|
319
|
+
const store = usePreviewCardRootContext();
|
|
320
|
+
const { arrowRef, side, align, arrowUncentered, arrowStyles } = usePreviewCardPositionerContext();
|
|
321
|
+
const open = store.useState('open');
|
|
322
|
+
const state = {
|
|
323
|
+
open,
|
|
324
|
+
side,
|
|
325
|
+
align,
|
|
326
|
+
uncentered: arrowUncentered
|
|
327
|
+
};
|
|
328
|
+
const element = useRenderElement('div', componentProps, {
|
|
329
|
+
state,
|
|
330
|
+
ref: [
|
|
331
|
+
arrowRef,
|
|
332
|
+
forwardedRef
|
|
333
|
+
],
|
|
334
|
+
props: [
|
|
335
|
+
{
|
|
336
|
+
style: arrowStyles,
|
|
337
|
+
'aria-hidden': true
|
|
338
|
+
},
|
|
339
|
+
elementProps
|
|
340
|
+
],
|
|
341
|
+
stateAttributesMapping: popupStateMapping
|
|
342
|
+
});
|
|
343
|
+
return element;
|
|
344
|
+
});
|
|
345
|
+
if ("production" !== process.env.NODE_ENV) PreviewCardArrow_PreviewCardArrow.displayName = "PreviewCardArrow";
|
|
346
|
+
const PreviewCardBackdrop_stateAttributesMapping = {
|
|
347
|
+
...popupStateMapping,
|
|
348
|
+
...transitionStatusMapping
|
|
349
|
+
};
|
|
350
|
+
const PreviewCardBackdrop_PreviewCardBackdrop = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
351
|
+
const { render, className, style, ...elementProps } = componentProps;
|
|
352
|
+
const store = usePreviewCardRootContext();
|
|
353
|
+
const open = store.useState('open');
|
|
354
|
+
const mounted = store.useState('mounted');
|
|
355
|
+
const transitionStatus = store.useState('transitionStatus');
|
|
356
|
+
const state = {
|
|
357
|
+
open,
|
|
358
|
+
transitionStatus
|
|
359
|
+
};
|
|
360
|
+
const element = useRenderElement('div', componentProps, {
|
|
361
|
+
state,
|
|
362
|
+
ref: [
|
|
363
|
+
forwardedRef
|
|
364
|
+
],
|
|
365
|
+
props: [
|
|
366
|
+
{
|
|
367
|
+
role: 'presentation',
|
|
368
|
+
hidden: !mounted,
|
|
369
|
+
style: {
|
|
370
|
+
pointerEvents: 'none',
|
|
371
|
+
userSelect: 'none',
|
|
372
|
+
WebkitUserSelect: 'none'
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
elementProps
|
|
376
|
+
],
|
|
377
|
+
stateAttributesMapping: PreviewCardBackdrop_stateAttributesMapping
|
|
378
|
+
});
|
|
379
|
+
return element;
|
|
380
|
+
});
|
|
381
|
+
if ("production" !== process.env.NODE_ENV) PreviewCardBackdrop_PreviewCardBackdrop.displayName = "PreviewCardBackdrop";
|
|
382
|
+
let PreviewCardViewportCssVars_PreviewCardViewportCssVars = /*#__PURE__*/ function(PreviewCardViewportCssVars) {
|
|
383
|
+
PreviewCardViewportCssVars["popupWidth"] = "--popup-width";
|
|
384
|
+
PreviewCardViewportCssVars["popupHeight"] = "--popup-height";
|
|
385
|
+
return PreviewCardViewportCssVars;
|
|
386
|
+
}({});
|
|
387
|
+
const PreviewCardViewport_stateAttributesMapping = {
|
|
388
|
+
activationDirection: (value)=>value ? {
|
|
389
|
+
'data-activation-direction': value
|
|
390
|
+
} : null
|
|
391
|
+
};
|
|
392
|
+
const PreviewCardViewport_PreviewCardViewport = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
393
|
+
const { render, className, style, children, ...elementProps } = componentProps;
|
|
394
|
+
const store = usePreviewCardRootContext();
|
|
395
|
+
const positioner = usePreviewCardPositionerContext();
|
|
396
|
+
const instantType = store.useState('instantType');
|
|
397
|
+
const { children: childrenToRender, state: viewportState } = usePopupViewport({
|
|
398
|
+
store,
|
|
399
|
+
side: positioner.side,
|
|
400
|
+
cssVars: PreviewCardViewportCssVars_PreviewCardViewportCssVars,
|
|
401
|
+
children
|
|
402
|
+
});
|
|
403
|
+
const state = {
|
|
404
|
+
activationDirection: viewportState.activationDirection,
|
|
405
|
+
transitioning: viewportState.transitioning,
|
|
406
|
+
instant: instantType
|
|
407
|
+
};
|
|
408
|
+
return useRenderElement('div', componentProps, {
|
|
409
|
+
state,
|
|
410
|
+
ref: forwardedRef,
|
|
411
|
+
props: [
|
|
412
|
+
elementProps,
|
|
413
|
+
{
|
|
414
|
+
children: childrenToRender
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
stateAttributesMapping: PreviewCardViewport_stateAttributesMapping
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
if ("production" !== process.env.NODE_ENV) PreviewCardViewport_PreviewCardViewport.displayName = "PreviewCardViewport";
|
|
421
|
+
const PreviewCardTrigger_PreviewCardTrigger = fastComponentRef(function(componentProps, forwardedRef) {
|
|
422
|
+
const { render, className, delay, closeDelay, id: idProp, payload, handle, style, ...elementProps } = componentProps;
|
|
423
|
+
const rootContext = usePreviewCardRootContext(true);
|
|
424
|
+
const store = handle?.store ?? rootContext;
|
|
425
|
+
if (!store) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: <PreviewCard.Trigger> must be either used within a <PreviewCard.Root> component or provided with a handle.' : esm_formatErrorMessage(89));
|
|
426
|
+
const thisTriggerId = useBaseUiId(idProp);
|
|
427
|
+
const isTriggerActive = store.useState('isTriggerActive', thisTriggerId);
|
|
428
|
+
const isOpenedByThisTrigger = store.useState('isOpenedByTrigger', thisTriggerId);
|
|
429
|
+
const floatingRootContext = store.useState('floatingRootContext');
|
|
430
|
+
const inlineRectCoordsRef = store.context.inlineRectCoordsRef;
|
|
431
|
+
const triggerElementRef = __rspack_external_react.useRef(null);
|
|
432
|
+
const delayWithDefault = delay ?? 600;
|
|
433
|
+
const closeDelayWithDefault = closeDelay ?? 300;
|
|
434
|
+
const { registerTrigger, isMountedByThisTrigger } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {
|
|
435
|
+
payload
|
|
436
|
+
});
|
|
437
|
+
useIsoLayoutEffect(()=>{
|
|
438
|
+
if (isMountedByThisTrigger) store.context.closeDelayRef.current = closeDelayWithDefault;
|
|
439
|
+
}, [
|
|
440
|
+
store,
|
|
441
|
+
isMountedByThisTrigger,
|
|
442
|
+
closeDelayWithDefault
|
|
443
|
+
]);
|
|
444
|
+
const hoverProps = useHoverReferenceInteraction(floatingRootContext, {
|
|
445
|
+
mouseOnly: true,
|
|
446
|
+
move: false,
|
|
447
|
+
handleClose: safePolygon(),
|
|
448
|
+
delay: ()=>({
|
|
449
|
+
open: delayWithDefault,
|
|
450
|
+
close: closeDelayWithDefault
|
|
451
|
+
}),
|
|
452
|
+
triggerElementRef,
|
|
453
|
+
isActiveTrigger: isTriggerActive,
|
|
454
|
+
isClosing: ()=>'ending' === store.select('transitionStatus')
|
|
455
|
+
});
|
|
456
|
+
const focusProps = useFocus(floatingRootContext, {
|
|
457
|
+
delay: delayWithDefault
|
|
458
|
+
});
|
|
459
|
+
const state = {
|
|
460
|
+
open: isOpenedByThisTrigger
|
|
461
|
+
};
|
|
462
|
+
const rootTriggerProps = store.useState('triggerProps', isMountedByThisTrigger);
|
|
463
|
+
const inlineRectTriggerProps = getInlineRectTriggerProps(inlineRectCoordsRef, isOpenedByThisTrigger);
|
|
464
|
+
const element = useRenderElement('a', componentProps, {
|
|
465
|
+
state,
|
|
466
|
+
ref: [
|
|
467
|
+
forwardedRef,
|
|
468
|
+
registerTrigger,
|
|
469
|
+
triggerElementRef
|
|
470
|
+
],
|
|
471
|
+
props: [
|
|
472
|
+
hoverProps,
|
|
473
|
+
focusProps.reference,
|
|
474
|
+
rootTriggerProps,
|
|
475
|
+
inlineRectTriggerProps,
|
|
476
|
+
{
|
|
477
|
+
id: thisTriggerId
|
|
478
|
+
},
|
|
479
|
+
elementProps
|
|
480
|
+
],
|
|
481
|
+
stateAttributesMapping: triggerOpenStateMapping
|
|
482
|
+
});
|
|
483
|
+
return element;
|
|
484
|
+
});
|
|
485
|
+
if ("production" !== process.env.NODE_ENV) PreviewCardTrigger_PreviewCardTrigger.displayName = "PreviewCardTrigger";
|
|
486
|
+
const selectors = {
|
|
487
|
+
...popupStoreSelectors,
|
|
488
|
+
instantType: createSelector((state)=>state.instantType),
|
|
489
|
+
hasViewport: createSelector((state)=>state.hasViewport)
|
|
490
|
+
};
|
|
491
|
+
class PreviewCardStore extends ReactStore {
|
|
492
|
+
constructor(initialState, floatingId, nested = false){
|
|
493
|
+
const triggerElements = new PopupTriggerMap();
|
|
494
|
+
const state = {
|
|
495
|
+
...createInitialState(),
|
|
496
|
+
...initialState
|
|
497
|
+
};
|
|
498
|
+
state.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested);
|
|
499
|
+
super(state, {
|
|
500
|
+
popupRef: /*#__PURE__*/ __rspack_external_react.createRef(),
|
|
501
|
+
onOpenChange: void 0,
|
|
502
|
+
onOpenChangeComplete: void 0,
|
|
503
|
+
triggerElements,
|
|
504
|
+
closeDelayRef: {
|
|
505
|
+
current: 300
|
|
506
|
+
},
|
|
507
|
+
inlineRectCoordsRef: {
|
|
508
|
+
current: void 0
|
|
509
|
+
}
|
|
510
|
+
}, selectors);
|
|
511
|
+
}
|
|
512
|
+
setOpen = (nextOpen, eventDetails)=>{
|
|
513
|
+
const reason = eventDetails.reason;
|
|
514
|
+
const isHover = reason === triggerHover;
|
|
515
|
+
const isFocusOpen = nextOpen && reason === triggerFocus;
|
|
516
|
+
const isDismissClose = !nextOpen && (reason === triggerPress || reason === escapeKey);
|
|
517
|
+
eventDetails.preventUnmountOnClose = ()=>{
|
|
518
|
+
this.set('preventUnmountingOnClose', true);
|
|
519
|
+
};
|
|
520
|
+
this.context.onOpenChange?.(nextOpen, eventDetails);
|
|
521
|
+
if (eventDetails.isCanceled) return;
|
|
522
|
+
const event = eventDetails.event;
|
|
523
|
+
if (nextOpen && isHover && eventDetails.trigger && 'clientX' in event && 'clientY' in event && this.context.inlineRectCoordsRef.current?.element !== eventDetails.trigger) updateInlineRectCoords(this.context.inlineRectCoordsRef, eventDetails.trigger, event.clientX, event.clientY);
|
|
524
|
+
this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
|
|
525
|
+
const changeState = ()=>{
|
|
526
|
+
const updatedState = {
|
|
527
|
+
open: nextOpen
|
|
528
|
+
};
|
|
529
|
+
if (isFocusOpen) updatedState.instantType = 'focus';
|
|
530
|
+
else if (isDismissClose) updatedState.instantType = 'dismiss';
|
|
531
|
+
else if (reason === triggerHover) updatedState.instantType = void 0;
|
|
532
|
+
setOpenTriggerState(updatedState, nextOpen, eventDetails.trigger);
|
|
533
|
+
this.update(updatedState);
|
|
534
|
+
};
|
|
535
|
+
if (isHover) __rspack_external_react_dom_7136dc57.flushSync(changeState);
|
|
536
|
+
else changeState();
|
|
537
|
+
};
|
|
538
|
+
static useStore(externalStore, initialState) {
|
|
539
|
+
const store = usePopupStore(externalStore, (floatingId, nested)=>new PreviewCardStore(initialState, floatingId, nested)).store;
|
|
540
|
+
return store;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
function createInitialState() {
|
|
544
|
+
return {
|
|
545
|
+
...createInitialPopupStoreState(),
|
|
546
|
+
instantType: void 0,
|
|
547
|
+
hasViewport: false
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
function PreviewCardRootComponent(props) {
|
|
551
|
+
const { open: openProp, defaultOpen = false, onOpenChange, onOpenChangeComplete, actionsRef, handle, triggerId: triggerIdProp, defaultTriggerId: defaultTriggerIdProp = null, children } = props;
|
|
552
|
+
const store = PreviewCardStore.useStore(handle?.store, {
|
|
553
|
+
open: defaultOpen,
|
|
554
|
+
openProp,
|
|
555
|
+
activeTriggerId: defaultTriggerIdProp,
|
|
556
|
+
triggerIdProp
|
|
557
|
+
});
|
|
558
|
+
useOnFirstRender(()=>{
|
|
559
|
+
if (void 0 === openProp && false === store.state.open && true === defaultOpen) store.update({
|
|
560
|
+
open: true,
|
|
561
|
+
activeTriggerId: defaultTriggerIdProp
|
|
562
|
+
});
|
|
563
|
+
});
|
|
564
|
+
store.useControlledProp('openProp', openProp);
|
|
565
|
+
store.useControlledProp('triggerIdProp', triggerIdProp);
|
|
566
|
+
store.useContextCallback('onOpenChange', onOpenChange);
|
|
567
|
+
store.useContextCallback('onOpenChangeComplete', onOpenChangeComplete);
|
|
568
|
+
const open = store.useState('open');
|
|
569
|
+
const activeTriggerId = store.useState('activeTriggerId');
|
|
570
|
+
const mounted = store.useState('mounted');
|
|
571
|
+
const payload = store.useState('payload');
|
|
572
|
+
useImplicitActiveTrigger(store);
|
|
573
|
+
const { forceUnmount } = useOpenStateTransitions(open, store, ()=>{
|
|
574
|
+
store.context.inlineRectCoordsRef.current = void 0;
|
|
575
|
+
});
|
|
576
|
+
useIsoLayoutEffect(()=>{
|
|
577
|
+
if (open) {
|
|
578
|
+
if (null == activeTriggerId) store.set('payload', void 0);
|
|
579
|
+
}
|
|
580
|
+
}, [
|
|
581
|
+
store,
|
|
582
|
+
activeTriggerId,
|
|
583
|
+
open
|
|
584
|
+
]);
|
|
585
|
+
const handleImperativeClose = __rspack_external_react.useCallback(()=>{
|
|
586
|
+
store.setOpen(false, createChangeEventDetails(imperativeAction));
|
|
587
|
+
}, [
|
|
588
|
+
store
|
|
589
|
+
]);
|
|
590
|
+
__rspack_external_react.useImperativeHandle(actionsRef, ()=>({
|
|
591
|
+
unmount: forceUnmount,
|
|
592
|
+
close: handleImperativeClose
|
|
593
|
+
}), [
|
|
594
|
+
forceUnmount,
|
|
595
|
+
handleImperativeClose
|
|
596
|
+
]);
|
|
597
|
+
const shouldRenderInteractions = open || mounted;
|
|
598
|
+
return /*#__PURE__*/ jsxs(PreviewCardRootContext.Provider, {
|
|
599
|
+
value: store,
|
|
600
|
+
children: [
|
|
601
|
+
shouldRenderInteractions && /*#__PURE__*/ jsx(PreviewCardInteractions, {
|
|
602
|
+
store: store
|
|
603
|
+
}),
|
|
604
|
+
'function' == typeof children ? children({
|
|
605
|
+
payload
|
|
606
|
+
}) : children
|
|
607
|
+
]
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
function PreviewCardInteractions({ store }) {
|
|
611
|
+
const floatingRootContext = store.useState('floatingRootContext');
|
|
612
|
+
const dismiss = useDismiss(floatingRootContext);
|
|
613
|
+
const activeTriggerProps = dismiss.reference ?? EMPTY_OBJECT;
|
|
614
|
+
const inactiveTriggerProps = dismiss.trigger ?? EMPTY_OBJECT;
|
|
615
|
+
const popupProps = __rspack_external_react.useMemo(()=>mergeProps(FOCUSABLE_POPUP_PROPS, dismiss.floating), [
|
|
616
|
+
dismiss.floating
|
|
617
|
+
]);
|
|
618
|
+
usePopupInteractionProps(store, {
|
|
619
|
+
activeTriggerProps,
|
|
620
|
+
inactiveTriggerProps,
|
|
621
|
+
popupProps
|
|
622
|
+
});
|
|
623
|
+
return null;
|
|
624
|
+
}
|
|
625
|
+
const PreviewCardRoot_PreviewCardRoot = fastComponent(function(props) {
|
|
626
|
+
if (usePreviewCardRootContext(true)) return /*#__PURE__*/ jsx(PreviewCardRootComponent, {
|
|
627
|
+
...props
|
|
628
|
+
});
|
|
629
|
+
return /*#__PURE__*/ jsx(FloatingTree, {
|
|
630
|
+
children: /*#__PURE__*/ jsx(PreviewCardRootComponent, {
|
|
631
|
+
...props
|
|
632
|
+
})
|
|
633
|
+
});
|
|
634
|
+
});
|
|
635
|
+
if ("production" !== process.env.NODE_ENV) PreviewCardRoot_PreviewCardRoot.displayName = "PreviewCardRoot";
|
|
636
|
+
const PreviewCardPortal_PreviewCardPortal = /*#__PURE__*/ __rspack_external_react.forwardRef(function(props, forwardedRef) {
|
|
637
|
+
const { keepMounted = false, ...portalProps } = props;
|
|
638
|
+
const store = usePreviewCardRootContext();
|
|
639
|
+
const mounted = store.useState('mounted');
|
|
640
|
+
const shouldRender = mounted || keepMounted;
|
|
641
|
+
if (!shouldRender) return null;
|
|
642
|
+
return /*#__PURE__*/ jsx(PreviewCardPortalContext.Provider, {
|
|
643
|
+
value: keepMounted,
|
|
644
|
+
children: /*#__PURE__*/ jsx(FloatingPortalLite_FloatingPortalLite, {
|
|
645
|
+
ref: forwardedRef,
|
|
646
|
+
...portalProps
|
|
647
|
+
})
|
|
648
|
+
});
|
|
649
|
+
});
|
|
650
|
+
if ("production" !== process.env.NODE_ENV) PreviewCardPortal_PreviewCardPortal.displayName = "PreviewCardPortal";
|
|
651
|
+
class PreviewCardHandle {
|
|
652
|
+
constructor(){
|
|
653
|
+
this.store = new PreviewCardStore();
|
|
654
|
+
}
|
|
655
|
+
open(triggerId) {
|
|
656
|
+
const triggerElement = triggerId ? this.store.context.triggerElements.getById(triggerId) : void 0;
|
|
657
|
+
if (triggerId && !triggerElement) throw new Error("production" !== process.env.NODE_ENV ? `Base UI: PreviewCardHandle.open: No trigger found with id "${triggerId}".` : esm_formatErrorMessage(88, triggerId));
|
|
658
|
+
this.store.setOpen(true, createChangeEventDetails(imperativeAction, void 0, triggerElement));
|
|
659
|
+
}
|
|
660
|
+
close() {
|
|
661
|
+
this.store.setOpen(false, createChangeEventDetails(imperativeAction, void 0, void 0));
|
|
662
|
+
}
|
|
663
|
+
get isOpen() {
|
|
664
|
+
return this.store.select('open');
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
function createPreviewCardHandle() {
|
|
668
|
+
return new PreviewCardHandle();
|
|
669
|
+
}
|
|
5
670
|
const PreviewCard_module = {
|
|
6
671
|
popup: "popup-s3Cjfv",
|
|
7
672
|
arrow: "arrow-FRR3yT",
|
|
8
673
|
positioner: "positioner-Gzwwg3"
|
|
9
674
|
};
|
|
10
|
-
const Positioner = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(
|
|
675
|
+
const Positioner = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(PreviewCardPositioner_PreviewCardPositioner, {
|
|
11
676
|
ref: ref,
|
|
12
677
|
className: clsx(PreviewCard_module.positioner, className),
|
|
13
678
|
...props
|
|
14
679
|
}));
|
|
15
|
-
const Popup = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(
|
|
680
|
+
const Popup = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(PreviewCardPopup_PreviewCardPopup, {
|
|
16
681
|
ref: ref,
|
|
17
682
|
className: clsx(PreviewCard_module.popup, className),
|
|
18
683
|
...props
|
|
19
684
|
}));
|
|
20
|
-
const Arrow = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(
|
|
685
|
+
const Arrow = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(PreviewCardArrow_PreviewCardArrow, {
|
|
21
686
|
ref: ref,
|
|
22
687
|
className: clsx(PreviewCard_module.arrow, className),
|
|
23
688
|
...props
|
|
24
689
|
}));
|
|
25
|
-
const Backdrop = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(
|
|
690
|
+
const Backdrop = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(PreviewCardBackdrop_PreviewCardBackdrop, {
|
|
26
691
|
ref: ref,
|
|
27
692
|
className: clsx(PreviewCard_module.backdrop, className),
|
|
28
693
|
...props
|
|
29
694
|
}));
|
|
30
|
-
const Viewport = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(
|
|
695
|
+
const Viewport = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(PreviewCardViewport_PreviewCardViewport, {
|
|
31
696
|
ref: ref,
|
|
32
697
|
className: clsx(PreviewCard_module.viewport, className),
|
|
33
698
|
...props
|
|
34
699
|
}));
|
|
35
700
|
function Trigger({ className, ...props }) {
|
|
36
|
-
return /*#__PURE__*/ jsx(
|
|
701
|
+
return /*#__PURE__*/ jsx(PreviewCardTrigger_PreviewCardTrigger, {
|
|
37
702
|
...props,
|
|
38
703
|
className: clsx(PreviewCard_module.trigger, className)
|
|
39
704
|
});
|
|
40
705
|
}
|
|
41
|
-
const
|
|
706
|
+
const PreviewCard = {
|
|
42
707
|
Positioner: Positioner,
|
|
43
708
|
Popup: Popup,
|
|
44
709
|
Arrow: Arrow,
|
|
45
710
|
Backdrop: Backdrop,
|
|
46
711
|
Viewport: Viewport,
|
|
47
|
-
Root:
|
|
712
|
+
Root: PreviewCardRoot_PreviewCardRoot,
|
|
48
713
|
Trigger: Trigger,
|
|
49
|
-
Portal:
|
|
50
|
-
Handle:
|
|
51
|
-
createHandle:
|
|
714
|
+
Portal: PreviewCardPortal_PreviewCardPortal,
|
|
715
|
+
Handle: PreviewCardHandle,
|
|
716
|
+
createHandle: createPreviewCardHandle
|
|
52
717
|
};
|
|
53
|
-
export {
|
|
718
|
+
export { PreviewCard };
|