@seeqdev/qomponents 0.0.63 → 0.0.65
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/ButtonWithDropdown/ButtonWithDropdown.types.d.ts +2 -12
- package/dist/ButtonWithPopover/ButtonWithPopover.types.d.ts +4 -12
- package/dist/Checkbox/Checkbox.types.d.ts +2 -1
- package/dist/Icon/Icon.types.d.ts +3 -12
- package/dist/Tooltip/Tooltip.types.d.ts +13 -1
- package/dist/Tooltip/qTip.utilities.d.ts +3 -0
- package/dist/index.esm.js +2021 -394
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2021 -394
- package/dist/index.js.map +1 -1
- package/dist/styles.css +28 -10
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -53,6 +53,16 @@ const browserIsFirefox = browserId && browserName === 'Firefox';
|
|
|
53
53
|
|
|
54
54
|
const DEFAULT_TOOL_TIP_DELAY = 500;
|
|
55
55
|
|
|
56
|
+
const getQTipData = ({ tooltip, tooltipPlacement, isHtmlTooltip, tooltipTestId, tooltipDelay = DEFAULT_TOOL_TIP_DELAY, }) => tooltip
|
|
57
|
+
? {
|
|
58
|
+
'data-qtip-text': tooltip,
|
|
59
|
+
'data-qtip-placement': tooltipPlacement,
|
|
60
|
+
'data-qtip-is-html': isHtmlTooltip,
|
|
61
|
+
'data-qtip-testid': tooltipTestId,
|
|
62
|
+
'data-qtip-delay': tooltipDelay,
|
|
63
|
+
}
|
|
64
|
+
: undefined;
|
|
65
|
+
|
|
56
66
|
const colorClassesThemeLight = {
|
|
57
67
|
'theme': 'tw-text-sq-color-dark',
|
|
58
68
|
'white': 'tw-text-white',
|
|
@@ -88,7 +98,7 @@ const colorClassesThemeDark = {
|
|
|
88
98
|
* - access to Seeq custom icons by providing the desired icon
|
|
89
99
|
* - leverage "type" to style your icon
|
|
90
100
|
*/
|
|
91
|
-
const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClassNames, id, large, small, color, testId, customId,
|
|
101
|
+
const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClassNames, id, large, small, color, testId, customId, number, ...tooltipProps }) => {
|
|
92
102
|
if ((type === 'color' && (color === undefined || color === '')) || (color && type !== 'color')) {
|
|
93
103
|
const errorMessage = color === undefined || color === ''
|
|
94
104
|
? 'Icon with type="color" must have prop color specified.'
|
|
@@ -100,15 +110,7 @@ const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClas
|
|
|
100
110
|
const style = type === 'color' && color ? { color } : {};
|
|
101
111
|
const appliedClassNames = `${iconPrefixString} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
|
|
102
112
|
${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'cursor-pointer' : ''} ${extraClassNames}`;
|
|
103
|
-
const tooltipData =
|
|
104
|
-
? {
|
|
105
|
-
'data-qtip-text': tooltip,
|
|
106
|
-
'data-qtip-placement': tooltipPlacement,
|
|
107
|
-
'data-qtip-is-html': isHtmlTooltip,
|
|
108
|
-
'data-qtip-testid': tooltipTestId,
|
|
109
|
-
'data-qtip-delay': tooltipDelay,
|
|
110
|
-
}
|
|
111
|
-
: undefined;
|
|
113
|
+
const tooltipData = getQTipData(tooltipProps);
|
|
112
114
|
return (React.createElement("i", { className: appliedClassNames, style: style, onClick: onClick, "data-testid": testId, "data-customid": customId, id: id, "data-number": number, ...tooltipData }));
|
|
113
115
|
};
|
|
114
116
|
|
|
@@ -208,7 +210,7 @@ function _extends() {
|
|
|
208
210
|
return _extends.apply(this, arguments);
|
|
209
211
|
}
|
|
210
212
|
|
|
211
|
-
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
|
|
213
|
+
function $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
|
|
212
214
|
return function handleEvent(event) {
|
|
213
215
|
originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
|
|
214
216
|
if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
|
|
@@ -218,29 +220,29 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEven
|
|
|
218
220
|
/**
|
|
219
221
|
* Set a given ref to a given value
|
|
220
222
|
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
221
|
-
*/ function $6ed0406888f73fc4$var$setRef(ref, value) {
|
|
223
|
+
*/ function $6ed0406888f73fc4$var$setRef$1(ref, value) {
|
|
222
224
|
if (typeof ref === 'function') ref(value);
|
|
223
225
|
else if (ref !== null && ref !== undefined) ref.current = value;
|
|
224
226
|
}
|
|
225
227
|
/**
|
|
226
228
|
* A utility to compose multiple refs together
|
|
227
229
|
* Accepts callback refs and RefObject(s)
|
|
228
|
-
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
|
229
|
-
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
|
|
230
|
+
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af$1(...refs) {
|
|
231
|
+
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef$1(ref, node)
|
|
230
232
|
)
|
|
231
233
|
;
|
|
232
234
|
}
|
|
233
235
|
/**
|
|
234
236
|
* A custom hook that composes multiple refs
|
|
235
237
|
* Accepts callback refs and RefObject(s)
|
|
236
|
-
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
238
|
+
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(...refs) {
|
|
237
239
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
238
|
-
return React.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
240
|
+
return React.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af$1(...refs), refs);
|
|
239
241
|
}
|
|
240
242
|
|
|
241
243
|
/* -------------------------------------------------------------------------------------------------
|
|
242
244
|
* createContextScope
|
|
243
|
-
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
|
|
245
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1$1(scopeName, createContextScopeDeps = []) {
|
|
244
246
|
let defaultContexts = [];
|
|
245
247
|
/* -----------------------------------------------------------------------------------------------
|
|
246
248
|
* createContext
|
|
@@ -297,12 +299,12 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEven
|
|
|
297
299
|
createScope.scopeName = scopeName;
|
|
298
300
|
return [
|
|
299
301
|
$c512c27ab02ef895$export$fd42f52fd3ae1109,
|
|
300
|
-
$c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
|
|
302
|
+
$c512c27ab02ef895$var$composeContextScopes$1(createScope, ...createContextScopeDeps)
|
|
301
303
|
];
|
|
302
304
|
}
|
|
303
305
|
/* -------------------------------------------------------------------------------------------------
|
|
304
306
|
* composeContextScopes
|
|
305
|
-
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
|
|
307
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes$1(...scopes) {
|
|
306
308
|
const baseScope = scopes[0];
|
|
307
309
|
if (scopes.length === 1) return baseScope;
|
|
308
310
|
const createScope1 = ()=>{
|
|
@@ -337,10 +339,10 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEven
|
|
|
337
339
|
|
|
338
340
|
/* -------------------------------------------------------------------------------------------------
|
|
339
341
|
* Slot
|
|
340
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
342
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360$1 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
341
343
|
const { children: children , ...slotProps } = props;
|
|
342
344
|
const childrenArray = React.Children.toArray(children);
|
|
343
|
-
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
345
|
+
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable$1);
|
|
344
346
|
if (slottable) {
|
|
345
347
|
// the new element to render is the one passed as a child of `Slottable`
|
|
346
348
|
const newElement = slottable.props.children;
|
|
@@ -352,35 +354,35 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEven
|
|
|
352
354
|
return /*#__PURE__*/ React.isValidElement(newElement) ? newElement.props.children : null;
|
|
353
355
|
} else return child;
|
|
354
356
|
});
|
|
355
|
-
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
357
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone$1, _extends({}, slotProps, {
|
|
356
358
|
ref: forwardedRef
|
|
357
359
|
}), /*#__PURE__*/ React.isValidElement(newElement) ? /*#__PURE__*/ React.cloneElement(newElement, undefined, newChildren) : null);
|
|
358
360
|
}
|
|
359
|
-
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
361
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone$1, _extends({}, slotProps, {
|
|
360
362
|
ref: forwardedRef
|
|
361
363
|
}), children);
|
|
362
364
|
});
|
|
363
|
-
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
|
|
365
|
+
$5e63c961fc1ce211$export$8c6ed5c666ac1360$1.displayName = 'Slot';
|
|
364
366
|
/* -------------------------------------------------------------------------------------------------
|
|
365
367
|
* SlotClone
|
|
366
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
368
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone$1 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
367
369
|
const { children: children , ...slotProps } = props;
|
|
368
370
|
if (/*#__PURE__*/ React.isValidElement(children)) return /*#__PURE__*/ React.cloneElement(children, {
|
|
369
|
-
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
370
|
-
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
|
|
371
|
+
...$5e63c961fc1ce211$var$mergeProps$1(slotProps, children.props),
|
|
372
|
+
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af$1(forwardedRef, children.ref) : children.ref
|
|
371
373
|
});
|
|
372
374
|
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
373
375
|
});
|
|
374
|
-
$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
|
|
376
|
+
$5e63c961fc1ce211$var$SlotClone$1.displayName = 'SlotClone';
|
|
375
377
|
/* -------------------------------------------------------------------------------------------------
|
|
376
378
|
* Slottable
|
|
377
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
|
|
379
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45$1 = ({ children: children })=>{
|
|
378
380
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, children);
|
|
379
381
|
};
|
|
380
|
-
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
381
|
-
return /*#__PURE__*/ React.isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
382
|
+
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable$1(child) {
|
|
383
|
+
return /*#__PURE__*/ React.isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45$1;
|
|
382
384
|
}
|
|
383
|
-
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
385
|
+
function $5e63c961fc1ce211$var$mergeProps$1(slotProps, childProps) {
|
|
384
386
|
// all child props should override
|
|
385
387
|
const overrideProps = {
|
|
386
388
|
...childProps
|
|
@@ -411,7 +413,7 @@ function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
|
411
413
|
};
|
|
412
414
|
}
|
|
413
415
|
|
|
414
|
-
const $8927f6f2acc4f386$var$NODES = [
|
|
416
|
+
const $8927f6f2acc4f386$var$NODES$1 = [
|
|
415
417
|
'a',
|
|
416
418
|
'button',
|
|
417
419
|
'div',
|
|
@@ -433,10 +435,10 @@ const $8927f6f2acc4f386$var$NODES = [
|
|
|
433
435
|
// prettier-ignore
|
|
434
436
|
/* -------------------------------------------------------------------------------------------------
|
|
435
437
|
* Primitive
|
|
436
|
-
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
|
|
438
|
+
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034$1 = $8927f6f2acc4f386$var$NODES$1.reduce((primitive, node)=>{
|
|
437
439
|
const Node = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
438
440
|
const { asChild: asChild , ...primitiveProps } = props;
|
|
439
|
-
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
|
441
|
+
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360$1 : node;
|
|
440
442
|
React.useEffect(()=>{
|
|
441
443
|
window[Symbol.for('radix-ui')] = true;
|
|
442
444
|
}, []);
|
|
@@ -487,7 +489,7 @@ const $8927f6f2acc4f386$var$NODES = [
|
|
|
487
489
|
* Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
|
|
488
490
|
* this utility with them. This is because it's possible for those handlers to be called implicitly during render
|
|
489
491
|
* e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
|
|
490
|
-
*/ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
|
|
492
|
+
*/ function $8927f6f2acc4f386$export$6d1a0317bde7de7f$1(target, event) {
|
|
491
493
|
if (target) ReactDOM.flushSync(()=>target.dispatchEvent(event)
|
|
492
494
|
);
|
|
493
495
|
}
|
|
@@ -495,7 +497,7 @@ const $8927f6f2acc4f386$var$NODES = [
|
|
|
495
497
|
/**
|
|
496
498
|
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
497
499
|
* prop or avoid re-executing effects when passed as a dependency
|
|
498
|
-
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
500
|
+
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(callback) {
|
|
499
501
|
const callbackRef = React.useRef(callback);
|
|
500
502
|
React.useEffect(()=>{
|
|
501
503
|
callbackRef.current = callback;
|
|
@@ -509,8 +511,8 @@ const $8927f6f2acc4f386$var$NODES = [
|
|
|
509
511
|
|
|
510
512
|
/**
|
|
511
513
|
* Listens for when the escape key is down
|
|
512
|
-
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
513
|
-
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
514
|
+
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765$1(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
515
|
+
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onEscapeKeyDownProp);
|
|
514
516
|
React.useEffect(()=>{
|
|
515
517
|
const handleKeyDown = (event)=>{
|
|
516
518
|
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
@@ -524,23 +526,23 @@ const $8927f6f2acc4f386$var$NODES = [
|
|
|
524
526
|
]);
|
|
525
527
|
}
|
|
526
528
|
|
|
527
|
-
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
528
|
-
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
529
|
-
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
530
|
-
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
531
|
-
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ React.createContext({
|
|
529
|
+
const $5cb92bef7577960e$var$CONTEXT_UPDATE$1 = 'dismissableLayer.update';
|
|
530
|
+
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE$1 = 'dismissableLayer.pointerDownOutside';
|
|
531
|
+
const $5cb92bef7577960e$var$FOCUS_OUTSIDE$1 = 'dismissableLayer.focusOutside';
|
|
532
|
+
let $5cb92bef7577960e$var$originalBodyPointerEvents$1;
|
|
533
|
+
const $5cb92bef7577960e$var$DismissableLayerContext$1 = /*#__PURE__*/ React.createContext({
|
|
532
534
|
layers: new Set(),
|
|
533
535
|
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
534
536
|
branches: new Set()
|
|
535
537
|
});
|
|
536
|
-
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
538
|
+
const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
537
539
|
var _node$ownerDocument;
|
|
538
540
|
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
539
|
-
const context = React.useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
541
|
+
const context = React.useContext($5cb92bef7577960e$var$DismissableLayerContext$1);
|
|
540
542
|
const [node1, setNode] = React.useState(null);
|
|
541
543
|
const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
|
|
542
544
|
const [, force] = React.useState({});
|
|
543
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
545
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setNode(node)
|
|
544
546
|
);
|
|
545
547
|
const layers = Array.from(context.layers);
|
|
546
548
|
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
@@ -550,7 +552,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
550
552
|
const index = node1 ? layers.indexOf(node1) : -1;
|
|
551
553
|
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
552
554
|
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
553
|
-
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
555
|
+
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside$1((event)=>{
|
|
554
556
|
const target = event.target;
|
|
555
557
|
const isPointerDownOnBranch = [
|
|
556
558
|
...context.branches
|
|
@@ -561,7 +563,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
561
563
|
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
562
564
|
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
563
565
|
}, ownerDocument);
|
|
564
|
-
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
|
|
566
|
+
const focusOutside = $5cb92bef7577960e$var$useFocusOutside$1((event)=>{
|
|
565
567
|
const target = event.target;
|
|
566
568
|
const isFocusInBranch = [
|
|
567
569
|
...context.branches
|
|
@@ -572,7 +574,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
572
574
|
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
573
575
|
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
574
576
|
}, ownerDocument);
|
|
575
|
-
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
577
|
+
$addc16e1bbe58fd0$export$3a72a57244d6e765$1((event)=>{
|
|
576
578
|
const isHighestLayer = index === context.layers.size - 1;
|
|
577
579
|
if (!isHighestLayer) return;
|
|
578
580
|
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
@@ -585,15 +587,15 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
585
587
|
if (!node1) return;
|
|
586
588
|
if (disableOutsidePointerEvents) {
|
|
587
589
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
588
|
-
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
590
|
+
$5cb92bef7577960e$var$originalBodyPointerEvents$1 = ownerDocument.body.style.pointerEvents;
|
|
589
591
|
ownerDocument.body.style.pointerEvents = 'none';
|
|
590
592
|
}
|
|
591
593
|
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
592
594
|
}
|
|
593
595
|
context.layers.add(node1);
|
|
594
|
-
$5cb92bef7577960e$var$dispatchUpdate();
|
|
596
|
+
$5cb92bef7577960e$var$dispatchUpdate$1();
|
|
595
597
|
return ()=>{
|
|
596
|
-
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
598
|
+
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents$1;
|
|
597
599
|
};
|
|
598
600
|
}, [
|
|
599
601
|
node1,
|
|
@@ -611,7 +613,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
611
613
|
if (!node1) return;
|
|
612
614
|
context.layers.delete(node1);
|
|
613
615
|
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
614
|
-
$5cb92bef7577960e$var$dispatchUpdate();
|
|
616
|
+
$5cb92bef7577960e$var$dispatchUpdate$1();
|
|
615
617
|
};
|
|
616
618
|
}, [
|
|
617
619
|
node1,
|
|
@@ -620,27 +622,27 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
620
622
|
React.useEffect(()=>{
|
|
621
623
|
const handleUpdate = ()=>force({})
|
|
622
624
|
;
|
|
623
|
-
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
624
|
-
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
625
|
+
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE$1, handleUpdate);
|
|
626
|
+
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE$1, handleUpdate)
|
|
625
627
|
;
|
|
626
628
|
}, []);
|
|
627
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
|
|
629
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, layerProps, {
|
|
628
630
|
ref: composedRefs,
|
|
629
631
|
style: {
|
|
630
632
|
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
631
633
|
...props.style
|
|
632
634
|
},
|
|
633
|
-
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
634
|
-
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
635
|
-
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
635
|
+
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
636
|
+
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
637
|
+
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
636
638
|
}));
|
|
637
639
|
});
|
|
638
640
|
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
639
641
|
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
640
642
|
* to mimic layer dismissing behaviour present in OS.
|
|
641
643
|
* Returns props to pass to the node we want to check for outside events.
|
|
642
|
-
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
643
|
-
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
644
|
+
*/ function $5cb92bef7577960e$var$usePointerDownOutside$1(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
645
|
+
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onPointerDownOutside);
|
|
644
646
|
const isPointerInsideReactTreeRef = React.useRef(false);
|
|
645
647
|
const handleClickRef = React.useRef(()=>{});
|
|
646
648
|
React.useEffect(()=>{
|
|
@@ -650,7 +652,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
650
652
|
originalEvent: event
|
|
651
653
|
};
|
|
652
654
|
function handleAndDispatchPointerDownOutsideEvent() {
|
|
653
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
655
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent$1($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE$1, handlePointerDownOutside, eventDetail, {
|
|
654
656
|
discrete: true
|
|
655
657
|
});
|
|
656
658
|
}
|
|
@@ -709,8 +711,8 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
709
711
|
/**
|
|
710
712
|
* Listens for when focus happens outside a react subtree.
|
|
711
713
|
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
712
|
-
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
713
|
-
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
714
|
+
*/ function $5cb92bef7577960e$var$useFocusOutside$1(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
715
|
+
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onFocusOutside);
|
|
714
716
|
const isFocusInsideReactTreeRef = React.useRef(false);
|
|
715
717
|
React.useEffect(()=>{
|
|
716
718
|
const handleFocus = (event)=>{
|
|
@@ -718,7 +720,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
718
720
|
const eventDetail = {
|
|
719
721
|
originalEvent: event
|
|
720
722
|
};
|
|
721
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
723
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent$1($5cb92bef7577960e$var$FOCUS_OUTSIDE$1, handleFocusOutside, eventDetail, {
|
|
722
724
|
discrete: false
|
|
723
725
|
});
|
|
724
726
|
}
|
|
@@ -736,11 +738,11 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
736
738
|
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
|
|
737
739
|
};
|
|
738
740
|
}
|
|
739
|
-
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
740
|
-
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
741
|
+
function $5cb92bef7577960e$var$dispatchUpdate$1() {
|
|
742
|
+
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE$1);
|
|
741
743
|
document.dispatchEvent(event);
|
|
742
744
|
}
|
|
743
|
-
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
745
|
+
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent$1(name, handler, detail, { discrete: discrete }) {
|
|
744
746
|
const target = detail.originalEvent.target;
|
|
745
747
|
const event = new CustomEvent(name, {
|
|
746
748
|
bubbles: false,
|
|
@@ -750,7 +752,7 @@ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detai
|
|
|
750
752
|
if (handler) target.addEventListener(name, handler, {
|
|
751
753
|
once: true
|
|
752
754
|
});
|
|
753
|
-
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
755
|
+
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f$1(target, event);
|
|
754
756
|
else target.dispatchEvent(event);
|
|
755
757
|
}
|
|
756
758
|
|
|
@@ -789,10 +791,10 @@ const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
|
789
791
|
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
790
792
|
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
|
791
793
|
const [container1, setContainer] = React.useState(null);
|
|
792
|
-
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
|
793
|
-
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
|
794
|
+
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onMountAutoFocusProp);
|
|
795
|
+
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onUnmountAutoFocusProp);
|
|
794
796
|
const lastFocusedElementRef = React.useRef(null);
|
|
795
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
|
|
797
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setContainer(node)
|
|
796
798
|
);
|
|
797
799
|
const focusScope = React.useRef({
|
|
798
800
|
paused: false,
|
|
@@ -925,7 +927,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React.forwardRef
|
|
|
925
927
|
trapped,
|
|
926
928
|
focusScope.paused
|
|
927
929
|
]);
|
|
928
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
930
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
929
931
|
tabIndex: -1
|
|
930
932
|
}, scopeProps, {
|
|
931
933
|
ref: composedRefs,
|
|
@@ -1055,14 +1057,14 @@ function $d3863c46a17e8a28$var$removeLinks(items) {
|
|
|
1055
1057
|
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
1056
1058
|
*
|
|
1057
1059
|
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
1058
|
-
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? React.useLayoutEffect : ()=>{};
|
|
1060
|
+
*/ const $9f79659886946c16$export$e5c5a5f917a5871c$1 = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? React.useLayoutEffect : ()=>{};
|
|
1059
1061
|
|
|
1060
1062
|
const $1746a345f3d73bb7$var$useReactId = React__namespace['useId'.toString()] || (()=>undefined
|
|
1061
1063
|
);
|
|
1062
1064
|
let $1746a345f3d73bb7$var$count = 0;
|
|
1063
1065
|
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
1064
1066
|
const [id, setId] = React__namespace.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
|
|
1065
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
1067
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
1066
1068
|
if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
|
|
1067
1069
|
);
|
|
1068
1070
|
}, [
|
|
@@ -1413,7 +1415,7 @@ async function detectOverflow(state, options) {
|
|
|
1413
1415
|
* appears centered to the reference element.
|
|
1414
1416
|
* @see https://floating-ui.com/docs/arrow
|
|
1415
1417
|
*/
|
|
1416
|
-
const arrow$
|
|
1418
|
+
const arrow$3 = options => ({
|
|
1417
1419
|
name: 'arrow',
|
|
1418
1420
|
options,
|
|
1419
1421
|
async fn(state) {
|
|
@@ -2721,7 +2723,7 @@ const hide = hide$1;
|
|
|
2721
2723
|
* appears centered to the reference element.
|
|
2722
2724
|
* @see https://floating-ui.com/docs/arrow
|
|
2723
2725
|
*/
|
|
2724
|
-
const arrow$
|
|
2726
|
+
const arrow$2 = arrow$3;
|
|
2725
2727
|
|
|
2726
2728
|
/**
|
|
2727
2729
|
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
@@ -2757,7 +2759,7 @@ const computePosition = (reference, floating, options) => {
|
|
|
2757
2759
|
* This wraps the core `arrow` middleware to allow React refs as the element.
|
|
2758
2760
|
* @see https://floating-ui.com/docs/arrow
|
|
2759
2761
|
*/
|
|
2760
|
-
const arrow = options => {
|
|
2762
|
+
const arrow$1 = options => {
|
|
2761
2763
|
function isRef(value) {
|
|
2762
2764
|
return {}.hasOwnProperty.call(value, 'current');
|
|
2763
2765
|
}
|
|
@@ -2771,14 +2773,14 @@ const arrow = options => {
|
|
|
2771
2773
|
} = typeof options === 'function' ? options(state) : options;
|
|
2772
2774
|
if (element && isRef(element)) {
|
|
2773
2775
|
if (element.current != null) {
|
|
2774
|
-
return arrow$
|
|
2776
|
+
return arrow$2({
|
|
2775
2777
|
element: element.current,
|
|
2776
2778
|
padding
|
|
2777
2779
|
}).fn(state);
|
|
2778
2780
|
}
|
|
2779
2781
|
return {};
|
|
2780
2782
|
} else if (element) {
|
|
2781
|
-
return arrow$
|
|
2783
|
+
return arrow$2({
|
|
2782
2784
|
element,
|
|
2783
2785
|
padding
|
|
2784
2786
|
}).fn(state);
|
|
@@ -2788,11 +2790,11 @@ const arrow = options => {
|
|
|
2788
2790
|
};
|
|
2789
2791
|
};
|
|
2790
2792
|
|
|
2791
|
-
var index$
|
|
2793
|
+
var index$2 = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
2792
2794
|
|
|
2793
2795
|
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
|
|
2794
2796
|
// functions
|
|
2795
|
-
function deepEqual(a, b) {
|
|
2797
|
+
function deepEqual$1(a, b) {
|
|
2796
2798
|
if (a === b) {
|
|
2797
2799
|
return true;
|
|
2798
2800
|
}
|
|
@@ -2808,7 +2810,7 @@ function deepEqual(a, b) {
|
|
|
2808
2810
|
length = a.length;
|
|
2809
2811
|
if (length != b.length) return false;
|
|
2810
2812
|
for (i = length; i-- !== 0;) {
|
|
2811
|
-
if (!deepEqual(a[i], b[i])) {
|
|
2813
|
+
if (!deepEqual$1(a[i], b[i])) {
|
|
2812
2814
|
return false;
|
|
2813
2815
|
}
|
|
2814
2816
|
}
|
|
@@ -2829,7 +2831,7 @@ function deepEqual(a, b) {
|
|
|
2829
2831
|
if (key === '_owner' && a.$$typeof) {
|
|
2830
2832
|
continue;
|
|
2831
2833
|
}
|
|
2832
|
-
if (!deepEqual(a[key], b[key])) {
|
|
2834
|
+
if (!deepEqual$1(a[key], b[key])) {
|
|
2833
2835
|
return false;
|
|
2834
2836
|
}
|
|
2835
2837
|
}
|
|
@@ -2851,9 +2853,9 @@ function roundByDPR(element, value) {
|
|
|
2851
2853
|
return Math.round(value * dpr) / dpr;
|
|
2852
2854
|
}
|
|
2853
2855
|
|
|
2854
|
-
function useLatestRef(value) {
|
|
2856
|
+
function useLatestRef$1(value) {
|
|
2855
2857
|
const ref = React__namespace.useRef(value);
|
|
2856
|
-
index$
|
|
2858
|
+
index$2(() => {
|
|
2857
2859
|
ref.current = value;
|
|
2858
2860
|
});
|
|
2859
2861
|
return ref;
|
|
@@ -2863,7 +2865,7 @@ function useLatestRef(value) {
|
|
|
2863
2865
|
* Provides data to position a floating element.
|
|
2864
2866
|
* @see https://floating-ui.com/docs/useFloating
|
|
2865
2867
|
*/
|
|
2866
|
-
function useFloating(options) {
|
|
2868
|
+
function useFloating$1(options) {
|
|
2867
2869
|
if (options === void 0) {
|
|
2868
2870
|
options = {};
|
|
2869
2871
|
}
|
|
@@ -2889,7 +2891,7 @@ function useFloating(options) {
|
|
|
2889
2891
|
isPositioned: false
|
|
2890
2892
|
});
|
|
2891
2893
|
const [latestMiddleware, setLatestMiddleware] = React__namespace.useState(middleware);
|
|
2892
|
-
if (!deepEqual(latestMiddleware, middleware)) {
|
|
2894
|
+
if (!deepEqual$1(latestMiddleware, middleware)) {
|
|
2893
2895
|
setLatestMiddleware(middleware);
|
|
2894
2896
|
}
|
|
2895
2897
|
const [_reference, _setReference] = React__namespace.useState(null);
|
|
@@ -2911,8 +2913,8 @@ function useFloating(options) {
|
|
|
2911
2913
|
const referenceRef = React__namespace.useRef(null);
|
|
2912
2914
|
const floatingRef = React__namespace.useRef(null);
|
|
2913
2915
|
const dataRef = React__namespace.useRef(data);
|
|
2914
|
-
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
2915
|
-
const platformRef = useLatestRef(platform);
|
|
2916
|
+
const whileElementsMountedRef = useLatestRef$1(whileElementsMounted);
|
|
2917
|
+
const platformRef = useLatestRef$1(platform);
|
|
2916
2918
|
const update = React__namespace.useCallback(() => {
|
|
2917
2919
|
if (!referenceRef.current || !floatingRef.current) {
|
|
2918
2920
|
return;
|
|
@@ -2930,7 +2932,7 @@ function useFloating(options) {
|
|
|
2930
2932
|
...data,
|
|
2931
2933
|
isPositioned: true
|
|
2932
2934
|
};
|
|
2933
|
-
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
2935
|
+
if (isMountedRef.current && !deepEqual$1(dataRef.current, fullData)) {
|
|
2934
2936
|
dataRef.current = fullData;
|
|
2935
2937
|
ReactDOM__namespace.flushSync(() => {
|
|
2936
2938
|
setData(fullData);
|
|
@@ -2938,7 +2940,7 @@ function useFloating(options) {
|
|
|
2938
2940
|
}
|
|
2939
2941
|
});
|
|
2940
2942
|
}, [latestMiddleware, placement, strategy, platformRef]);
|
|
2941
|
-
index$
|
|
2943
|
+
index$2(() => {
|
|
2942
2944
|
if (open === false && dataRef.current.isPositioned) {
|
|
2943
2945
|
dataRef.current.isPositioned = false;
|
|
2944
2946
|
setData(data => ({
|
|
@@ -2948,13 +2950,13 @@ function useFloating(options) {
|
|
|
2948
2950
|
}
|
|
2949
2951
|
}, [open]);
|
|
2950
2952
|
const isMountedRef = React__namespace.useRef(false);
|
|
2951
|
-
index$
|
|
2953
|
+
index$2(() => {
|
|
2952
2954
|
isMountedRef.current = true;
|
|
2953
2955
|
return () => {
|
|
2954
2956
|
isMountedRef.current = false;
|
|
2955
2957
|
};
|
|
2956
2958
|
}, []);
|
|
2957
|
-
index$
|
|
2959
|
+
index$2(() => {
|
|
2958
2960
|
if (referenceEl) referenceRef.current = referenceEl;
|
|
2959
2961
|
if (floatingEl) floatingRef.current = floatingEl;
|
|
2960
2962
|
if (referenceEl && floatingEl) {
|
|
@@ -3010,9 +3012,9 @@ function useFloating(options) {
|
|
|
3010
3012
|
}), [data, update, refs, elements, floatingStyles]);
|
|
3011
3013
|
}
|
|
3012
3014
|
|
|
3013
|
-
const $7e8f5cd07187803e$export$21b07c8f274aebd5 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
3015
|
+
const $7e8f5cd07187803e$export$21b07c8f274aebd5$1 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
3014
3016
|
const { children: children , width: width = 10 , height: height = 5 , ...arrowProps } = props;
|
|
3015
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.svg, _extends({}, arrowProps, {
|
|
3017
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.svg, _extends({}, arrowProps, {
|
|
3016
3018
|
ref: forwardedRef,
|
|
3017
3019
|
width: width,
|
|
3018
3020
|
height: height,
|
|
@@ -3022,11 +3024,11 @@ const $7e8f5cd07187803e$export$21b07c8f274aebd5 = /*#__PURE__*/ React.forwardRef
|
|
|
3022
3024
|
points: "0,0 30,0 15,10"
|
|
3023
3025
|
}));
|
|
3024
3026
|
});
|
|
3025
|
-
/* -----------------------------------------------------------------------------------------------*/ const $7e8f5cd07187803e$export$be92b6f5f03c0fe9 = $7e8f5cd07187803e$export$21b07c8f274aebd5;
|
|
3027
|
+
/* -----------------------------------------------------------------------------------------------*/ const $7e8f5cd07187803e$export$be92b6f5f03c0fe9$1 = $7e8f5cd07187803e$export$21b07c8f274aebd5$1;
|
|
3026
3028
|
|
|
3027
|
-
function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
|
3029
|
+
function $db6c3485150b8e66$export$1ab7ae714698c4b8$1(element) {
|
|
3028
3030
|
const [size, setSize] = React.useState(undefined);
|
|
3029
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3031
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
3030
3032
|
if (element) {
|
|
3031
3033
|
// provide size as early as possible
|
|
3032
3034
|
setSize({
|
|
@@ -3073,13 +3075,13 @@ function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
|
|
3073
3075
|
|
|
3074
3076
|
/* -------------------------------------------------------------------------------------------------
|
|
3075
3077
|
* Popper
|
|
3076
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$POPPER_NAME = 'Popper';
|
|
3077
|
-
const [$cf1ac5d9fe0e8206$var$createPopperContext, $cf1ac5d9fe0e8206$export$722aac194ae923] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
3078
|
-
const [$cf1ac5d9fe0e8206$var$PopperProvider, $cf1ac5d9fe0e8206$var$usePopperContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
3079
|
-
const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 = (props)=>{
|
|
3078
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$POPPER_NAME$1 = 'Popper';
|
|
3079
|
+
const [$cf1ac5d9fe0e8206$var$createPopperContext$1, $cf1ac5d9fe0e8206$export$722aac194ae923$1] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($cf1ac5d9fe0e8206$var$POPPER_NAME$1);
|
|
3080
|
+
const [$cf1ac5d9fe0e8206$var$PopperProvider$1, $cf1ac5d9fe0e8206$var$usePopperContext$1] = $cf1ac5d9fe0e8206$var$createPopperContext$1($cf1ac5d9fe0e8206$var$POPPER_NAME$1);
|
|
3081
|
+
const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9$1 = (props)=>{
|
|
3080
3082
|
const { __scopePopper: __scopePopper , children: children } = props;
|
|
3081
3083
|
const [anchor, setAnchor] = React.useState(null);
|
|
3082
|
-
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperProvider, {
|
|
3084
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperProvider$1, {
|
|
3083
3085
|
scope: __scopePopper,
|
|
3084
3086
|
anchor: anchor,
|
|
3085
3087
|
onAnchorChange: setAnchor
|
|
@@ -3087,35 +3089,35 @@ const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 = (props)=>{
|
|
|
3087
3089
|
};
|
|
3088
3090
|
/* -------------------------------------------------------------------------------------------------
|
|
3089
3091
|
* PopperAnchor
|
|
3090
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ANCHOR_NAME = 'PopperAnchor';
|
|
3091
|
-
const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
3092
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ANCHOR_NAME$1 = 'PopperAnchor';
|
|
3093
|
+
const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d$1 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
3092
3094
|
const { __scopePopper: __scopePopper , virtualRef: virtualRef , ...anchorProps } = props;
|
|
3093
|
-
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME, __scopePopper);
|
|
3095
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext$1($cf1ac5d9fe0e8206$var$ANCHOR_NAME$1, __scopePopper);
|
|
3094
3096
|
const ref = React.useRef(null);
|
|
3095
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
3097
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
|
|
3096
3098
|
React.useEffect(()=>{
|
|
3097
3099
|
// Consumer can anchor the popper to something that isn't
|
|
3098
3100
|
// a DOM node e.g. pointer position, so we override the
|
|
3099
3101
|
// `anchorRef` with their virtual ref in this case.
|
|
3100
3102
|
context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
|
|
3101
3103
|
});
|
|
3102
|
-
return virtualRef ? null : /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, anchorProps, {
|
|
3104
|
+
return virtualRef ? null : /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, anchorProps, {
|
|
3103
3105
|
ref: composedRefs
|
|
3104
3106
|
}));
|
|
3105
3107
|
});
|
|
3106
3108
|
/* -------------------------------------------------------------------------------------------------
|
|
3107
3109
|
* PopperContent
|
|
3108
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$CONTENT_NAME = 'PopperContent';
|
|
3109
|
-
const [$cf1ac5d9fe0e8206$var$PopperContentProvider, $cf1ac5d9fe0e8206$var$useContentContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME);
|
|
3110
|
-
const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
3110
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$CONTENT_NAME$1 = 'PopperContent';
|
|
3111
|
+
const [$cf1ac5d9fe0e8206$var$PopperContentProvider$1, $cf1ac5d9fe0e8206$var$useContentContext$1] = $cf1ac5d9fe0e8206$var$createPopperContext$1($cf1ac5d9fe0e8206$var$CONTENT_NAME$1);
|
|
3112
|
+
const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc$1 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
3111
3113
|
var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$trans, _middlewareData$trans2, _middlewareData$hide;
|
|
3112
3114
|
const { __scopePopper: __scopePopper , side: side = 'bottom' , sideOffset: sideOffset = 0 , align: align = 'center' , alignOffset: alignOffset = 0 , arrowPadding: arrowPadding = 0 , avoidCollisions: avoidCollisions = true , collisionBoundary: collisionBoundary = [] , collisionPadding: collisionPaddingProp = 0 , sticky: sticky = 'partial' , hideWhenDetached: hideWhenDetached = false , updatePositionStrategy: updatePositionStrategy = 'optimized' , onPlaced: onPlaced , ...contentProps } = props;
|
|
3113
|
-
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
|
|
3115
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext$1($cf1ac5d9fe0e8206$var$CONTENT_NAME$1, __scopePopper);
|
|
3114
3116
|
const [content, setContent] = React.useState(null);
|
|
3115
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
|
3117
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setContent(node)
|
|
3116
3118
|
);
|
|
3117
|
-
const [arrow
|
|
3118
|
-
const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(arrow
|
|
3119
|
+
const [arrow, setArrow] = React.useState(null);
|
|
3120
|
+
const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8$1(arrow);
|
|
3119
3121
|
const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0;
|
|
3120
3122
|
const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0;
|
|
3121
3123
|
const desiredPlacement = side + (align !== 'center' ? '-' + align : '');
|
|
@@ -3132,11 +3134,11 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ React.forwardRef(
|
|
|
3132
3134
|
const hasExplicitBoundaries = boundary.length > 0;
|
|
3133
3135
|
const detectOverflowOptions = {
|
|
3134
3136
|
padding: collisionPadding,
|
|
3135
|
-
boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull),
|
|
3137
|
+
boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull$1),
|
|
3136
3138
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
3137
3139
|
altBoundary: hasExplicitBoundaries
|
|
3138
3140
|
};
|
|
3139
|
-
const { refs: refs , floatingStyles: floatingStyles , placement: placement , isPositioned: isPositioned , middlewareData: middlewareData } = useFloating({
|
|
3141
|
+
const { refs: refs , floatingStyles: floatingStyles , placement: placement , isPositioned: isPositioned , middlewareData: middlewareData } = useFloating$1({
|
|
3140
3142
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
3141
3143
|
strategy: 'fixed',
|
|
3142
3144
|
placement: desiredPlacement,
|
|
@@ -3174,11 +3176,11 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ React.forwardRef(
|
|
|
3174
3176
|
contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`);
|
|
3175
3177
|
}
|
|
3176
3178
|
}),
|
|
3177
|
-
arrow
|
|
3178
|
-
element: arrow
|
|
3179
|
+
arrow && arrow$1({
|
|
3180
|
+
element: arrow,
|
|
3179
3181
|
padding: arrowPadding
|
|
3180
3182
|
}),
|
|
3181
|
-
$cf1ac5d9fe0e8206$var$transformOrigin({
|
|
3183
|
+
$cf1ac5d9fe0e8206$var$transformOrigin$1({
|
|
3182
3184
|
arrowWidth: arrowWidth,
|
|
3183
3185
|
arrowHeight: arrowHeight
|
|
3184
3186
|
}),
|
|
@@ -3188,9 +3190,9 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ React.forwardRef(
|
|
|
3188
3190
|
})
|
|
3189
3191
|
]
|
|
3190
3192
|
});
|
|
3191
|
-
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
3192
|
-
const handlePlaced = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPlaced);
|
|
3193
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3193
|
+
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement$1(placement);
|
|
3194
|
+
const handlePlaced = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onPlaced);
|
|
3195
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
3194
3196
|
if (isPositioned) handlePlaced === null || handlePlaced === void 0 || handlePlaced();
|
|
3195
3197
|
}, [
|
|
3196
3198
|
isPositioned,
|
|
@@ -3200,7 +3202,7 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ React.forwardRef(
|
|
|
3200
3202
|
const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y;
|
|
3201
3203
|
const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0;
|
|
3202
3204
|
const [contentZIndex, setContentZIndex] = React.useState();
|
|
3203
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3205
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
3204
3206
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
3205
3207
|
}, [
|
|
3206
3208
|
content
|
|
@@ -3221,14 +3223,14 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ React.forwardRef(
|
|
|
3221
3223
|
} // Floating UI interally calculates logical alignment based the `dir` attribute on
|
|
3222
3224
|
,
|
|
3223
3225
|
dir: props.dir
|
|
3224
|
-
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperContentProvider, {
|
|
3226
|
+
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperContentProvider$1, {
|
|
3225
3227
|
scope: __scopePopper,
|
|
3226
3228
|
placedSide: placedSide,
|
|
3227
3229
|
onArrowChange: setArrow,
|
|
3228
3230
|
arrowX: arrowX,
|
|
3229
3231
|
arrowY: arrowY,
|
|
3230
3232
|
shouldHideArrow: cannotCenterArrow
|
|
3231
|
-
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
3233
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
3232
3234
|
"data-side": placedSide,
|
|
3233
3235
|
"data-align": placedAlign
|
|
3234
3236
|
}, contentProps, {
|
|
@@ -3245,17 +3247,17 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ React.forwardRef(
|
|
|
3245
3247
|
});
|
|
3246
3248
|
/* -------------------------------------------------------------------------------------------------
|
|
3247
3249
|
* PopperArrow
|
|
3248
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ARROW_NAME = 'PopperArrow';
|
|
3249
|
-
const $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE = {
|
|
3250
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ARROW_NAME$1 = 'PopperArrow';
|
|
3251
|
+
const $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE$1 = {
|
|
3250
3252
|
top: 'bottom',
|
|
3251
3253
|
right: 'left',
|
|
3252
3254
|
bottom: 'top',
|
|
3253
3255
|
left: 'right'
|
|
3254
3256
|
};
|
|
3255
|
-
const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0 = /*#__PURE__*/ React.forwardRef(function $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0(props, forwardedRef) {
|
|
3257
|
+
const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0$1 = /*#__PURE__*/ React.forwardRef(function $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0(props, forwardedRef) {
|
|
3256
3258
|
const { __scopePopper: __scopePopper , ...arrowProps } = props;
|
|
3257
|
-
const contentContext = $cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME, __scopePopper);
|
|
3258
|
-
const baseSide = $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE[contentContext.placedSide];
|
|
3259
|
+
const contentContext = $cf1ac5d9fe0e8206$var$useContentContext$1($cf1ac5d9fe0e8206$var$ARROW_NAME$1, __scopePopper);
|
|
3260
|
+
const baseSide = $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE$1[contentContext.placedSide];
|
|
3259
3261
|
return(/*#__PURE__*/ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
3260
3262
|
// doesn't report size as we'd expect on SVG elements.
|
|
3261
3263
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
@@ -3280,7 +3282,7 @@ const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0 = /*#__PURE__*/ React.forwardRef
|
|
|
3280
3282
|
}[contentContext.placedSide],
|
|
3281
3283
|
visibility: contentContext.shouldHideArrow ? 'hidden' : undefined
|
|
3282
3284
|
}
|
|
3283
|
-
}, /*#__PURE__*/ React.createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9, _extends({}, arrowProps, {
|
|
3285
|
+
}, /*#__PURE__*/ React.createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9$1, _extends({}, arrowProps, {
|
|
3284
3286
|
ref: forwardedRef,
|
|
3285
3287
|
style: {
|
|
3286
3288
|
...arrowProps.style,
|
|
@@ -3289,10 +3291,10 @@ const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0 = /*#__PURE__*/ React.forwardRef
|
|
|
3289
3291
|
}
|
|
3290
3292
|
}))));
|
|
3291
3293
|
});
|
|
3292
|
-
/* -----------------------------------------------------------------------------------------------*/ function $cf1ac5d9fe0e8206$var$isNotNull(value) {
|
|
3294
|
+
/* -----------------------------------------------------------------------------------------------*/ function $cf1ac5d9fe0e8206$var$isNotNull$1(value) {
|
|
3293
3295
|
return value !== null;
|
|
3294
3296
|
}
|
|
3295
|
-
const $cf1ac5d9fe0e8206$var$transformOrigin = (options)=>({
|
|
3297
|
+
const $cf1ac5d9fe0e8206$var$transformOrigin$1 = (options)=>({
|
|
3296
3298
|
name: 'transformOrigin',
|
|
3297
3299
|
options: options,
|
|
3298
3300
|
fn (data) {
|
|
@@ -3302,7 +3304,7 @@ const $cf1ac5d9fe0e8206$var$transformOrigin = (options)=>({
|
|
|
3302
3304
|
const isArrowHidden = cannotCenterArrow;
|
|
3303
3305
|
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
3304
3306
|
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
3305
|
-
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
3307
|
+
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement$1(placement);
|
|
3306
3308
|
const noArrowAlign = {
|
|
3307
3309
|
start: '0%',
|
|
3308
3310
|
center: '50%',
|
|
@@ -3334,27 +3336,27 @@ const $cf1ac5d9fe0e8206$var$transformOrigin = (options)=>({
|
|
|
3334
3336
|
}
|
|
3335
3337
|
})
|
|
3336
3338
|
;
|
|
3337
|
-
function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement) {
|
|
3339
|
+
function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement$1(placement) {
|
|
3338
3340
|
const [side, align = 'center'] = placement.split('-');
|
|
3339
3341
|
return [
|
|
3340
3342
|
side,
|
|
3341
3343
|
align
|
|
3342
3344
|
];
|
|
3343
3345
|
}
|
|
3344
|
-
const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9;
|
|
3345
|
-
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
|
|
3346
|
-
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
|
|
3347
|
-
const $cf1ac5d9fe0e8206$export$21b07c8f274aebd5 = $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0;
|
|
3346
|
+
const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9$1 = $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9$1;
|
|
3347
|
+
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7$1 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d$1;
|
|
3348
|
+
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2$1 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc$1;
|
|
3349
|
+
const $cf1ac5d9fe0e8206$export$21b07c8f274aebd5$1 = $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0$1;
|
|
3348
3350
|
|
|
3349
|
-
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
3351
|
+
const $f1701beae083dbae$export$602eac185826482c$1 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
3350
3352
|
var _globalThis$document;
|
|
3351
3353
|
const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
|
|
3352
|
-
return container ? /*#__PURE__*/ ReactDOM.createPortal(/*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
|
3354
|
+
return container ? /*#__PURE__*/ ReactDOM.createPortal(/*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, portalProps, {
|
|
3353
3355
|
ref: forwardedRef
|
|
3354
3356
|
})), container) : null;
|
|
3355
3357
|
});
|
|
3356
3358
|
|
|
3357
|
-
function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
|
|
3359
|
+
function $fe963b355347cc68$export$3e6543de14f8614f$1(initialState, machine) {
|
|
3358
3360
|
return React.useReducer((state, event)=>{
|
|
3359
3361
|
const nextState = machine[state][event];
|
|
3360
3362
|
return nextState !== null && nextState !== void 0 ? nextState : state;
|
|
@@ -3362,28 +3364,28 @@ function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
|
|
|
3362
3364
|
}
|
|
3363
3365
|
|
|
3364
3366
|
|
|
3365
|
-
const $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props)=>{
|
|
3367
|
+
const $921a889cee6df7e8$export$99c2b779aa4e8b8b$1 = (props)=>{
|
|
3366
3368
|
const { present: present , children: children } = props;
|
|
3367
|
-
const presence = $921a889cee6df7e8$var$usePresence(present);
|
|
3369
|
+
const presence = $921a889cee6df7e8$var$usePresence$1(present);
|
|
3368
3370
|
const child = typeof children === 'function' ? children({
|
|
3369
3371
|
present: presence.isPresent
|
|
3370
3372
|
}) : React.Children.only(children);
|
|
3371
|
-
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
|
|
3373
|
+
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(presence.ref, child.ref);
|
|
3372
3374
|
const forceMount = typeof children === 'function';
|
|
3373
3375
|
return forceMount || presence.isPresent ? /*#__PURE__*/ React.cloneElement(child, {
|
|
3374
3376
|
ref: ref
|
|
3375
3377
|
}) : null;
|
|
3376
3378
|
};
|
|
3377
|
-
$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
|
|
3379
|
+
$921a889cee6df7e8$export$99c2b779aa4e8b8b$1.displayName = 'Presence';
|
|
3378
3380
|
/* -------------------------------------------------------------------------------------------------
|
|
3379
3381
|
* usePresence
|
|
3380
|
-
* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence(present) {
|
|
3382
|
+
* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence$1(present) {
|
|
3381
3383
|
const [node1, setNode] = React.useState();
|
|
3382
3384
|
const stylesRef = React.useRef({});
|
|
3383
3385
|
const prevPresentRef = React.useRef(present);
|
|
3384
3386
|
const prevAnimationNameRef = React.useRef('none');
|
|
3385
3387
|
const initialState = present ? 'mounted' : 'unmounted';
|
|
3386
|
-
const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
|
|
3388
|
+
const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f$1(initialState, {
|
|
3387
3389
|
mounted: {
|
|
3388
3390
|
UNMOUNT: 'unmounted',
|
|
3389
3391
|
ANIMATION_OUT: 'unmountSuspended'
|
|
@@ -3397,18 +3399,18 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
|
|
|
3397
3399
|
}
|
|
3398
3400
|
});
|
|
3399
3401
|
React.useEffect(()=>{
|
|
3400
|
-
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
3402
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName$1(stylesRef.current);
|
|
3401
3403
|
prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';
|
|
3402
3404
|
}, [
|
|
3403
3405
|
state
|
|
3404
3406
|
]);
|
|
3405
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3407
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
3406
3408
|
const styles = stylesRef.current;
|
|
3407
3409
|
const wasPresent = prevPresentRef.current;
|
|
3408
3410
|
const hasPresentChanged = wasPresent !== present;
|
|
3409
3411
|
if (hasPresentChanged) {
|
|
3410
3412
|
const prevAnimationName = prevAnimationNameRef.current;
|
|
3411
|
-
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
|
|
3413
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName$1(styles);
|
|
3412
3414
|
if (present) send('MOUNT');
|
|
3413
3415
|
else if (currentAnimationName === 'none' || (styles === null || styles === void 0 ? void 0 : styles.display) === 'none') // If there is no exit animation or the element is hidden, animations won't run
|
|
3414
3416
|
// so we unmount instantly
|
|
@@ -3429,14 +3431,14 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
|
|
|
3429
3431
|
present,
|
|
3430
3432
|
send
|
|
3431
3433
|
]);
|
|
3432
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3434
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
3433
3435
|
if (node1) {
|
|
3434
3436
|
/**
|
|
3435
3437
|
* Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`
|
|
3436
3438
|
* event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we
|
|
3437
3439
|
* make sure we only trigger ANIMATION_END for the currently active animation.
|
|
3438
3440
|
*/ const handleAnimationEnd = (event)=>{
|
|
3439
|
-
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
3441
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName$1(stylesRef.current);
|
|
3440
3442
|
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
3441
3443
|
if (event.target === node1 && isCurrentAnimation) // With React 18 concurrency this update is applied
|
|
3442
3444
|
// a frame after the animation ends, creating a flash of visible content.
|
|
@@ -3446,7 +3448,7 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
|
|
|
3446
3448
|
};
|
|
3447
3449
|
const handleAnimationStart = (event)=>{
|
|
3448
3450
|
if (event.target === node1) // if animation occurred, store its name as the previous animation.
|
|
3449
|
-
prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
3451
|
+
prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName$1(stylesRef.current);
|
|
3450
3452
|
};
|
|
3451
3453
|
node1.addEventListener('animationstart', handleAnimationStart);
|
|
3452
3454
|
node1.addEventListener('animationcancel', handleAnimationEnd);
|
|
@@ -3474,18 +3476,18 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
|
|
|
3474
3476
|
}, [])
|
|
3475
3477
|
};
|
|
3476
3478
|
}
|
|
3477
|
-
/* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName(styles) {
|
|
3479
|
+
/* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName$1(styles) {
|
|
3478
3480
|
return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none';
|
|
3479
3481
|
}
|
|
3480
3482
|
|
|
3481
|
-
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
|
|
3482
|
-
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
3483
|
+
function $71cd76cc60e0454e$export$6f32135080cb4c3$1({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
|
|
3484
|
+
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState$1({
|
|
3483
3485
|
defaultProp: defaultProp,
|
|
3484
3486
|
onChange: onChange
|
|
3485
3487
|
});
|
|
3486
3488
|
const isControlled = prop !== undefined;
|
|
3487
3489
|
const value1 = isControlled ? prop : uncontrolledProp;
|
|
3488
|
-
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
3490
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onChange);
|
|
3489
3491
|
const setValue = React.useCallback((nextValue)=>{
|
|
3490
3492
|
if (isControlled) {
|
|
3491
3493
|
const setter = nextValue;
|
|
@@ -3503,11 +3505,11 @@ function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: de
|
|
|
3503
3505
|
setValue
|
|
3504
3506
|
];
|
|
3505
3507
|
}
|
|
3506
|
-
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
|
|
3508
|
+
function $71cd76cc60e0454e$var$useUncontrolledState$1({ defaultProp: defaultProp , onChange: onChange }) {
|
|
3507
3509
|
const uncontrolledState = React.useState(defaultProp);
|
|
3508
3510
|
const [value] = uncontrolledState;
|
|
3509
3511
|
const prevValueRef = React.useRef(value);
|
|
3510
|
-
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
3512
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onChange);
|
|
3511
3513
|
React.useEffect(()=>{
|
|
3512
3514
|
if (prevValueRef.current !== value) {
|
|
3513
3515
|
handleChange(value);
|
|
@@ -4359,22 +4361,22 @@ var $epM9y$RemoveScroll = ReactRemoveScroll;
|
|
|
4359
4361
|
/* -------------------------------------------------------------------------------------------------
|
|
4360
4362
|
* Popover
|
|
4361
4363
|
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$POPOVER_NAME = 'Popover';
|
|
4362
|
-
const [$cb5cc270b50c6fcd$var$createPopoverContext, $cb5cc270b50c6fcd$export$c8393c9e73286932] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cb5cc270b50c6fcd$var$POPOVER_NAME, [
|
|
4363
|
-
$cf1ac5d9fe0e8206$export$722aac194ae923
|
|
4364
|
+
const [$cb5cc270b50c6fcd$var$createPopoverContext, $cb5cc270b50c6fcd$export$c8393c9e73286932] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($cb5cc270b50c6fcd$var$POPOVER_NAME, [
|
|
4365
|
+
$cf1ac5d9fe0e8206$export$722aac194ae923$1
|
|
4364
4366
|
]);
|
|
4365
|
-
const $cb5cc270b50c6fcd$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923();
|
|
4367
|
+
const $cb5cc270b50c6fcd$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923$1();
|
|
4366
4368
|
const [$cb5cc270b50c6fcd$var$PopoverProvider, $cb5cc270b50c6fcd$var$usePopoverContext] = $cb5cc270b50c6fcd$var$createPopoverContext($cb5cc270b50c6fcd$var$POPOVER_NAME);
|
|
4367
4369
|
const $cb5cc270b50c6fcd$export$5b6b19405a83ff9d = (props)=>{
|
|
4368
4370
|
const { __scopePopover: __scopePopover , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = false } = props;
|
|
4369
4371
|
const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover);
|
|
4370
4372
|
const triggerRef = React.useRef(null);
|
|
4371
4373
|
const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
|
|
4372
|
-
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
4374
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
|
|
4373
4375
|
prop: openProp,
|
|
4374
4376
|
defaultProp: defaultOpen,
|
|
4375
4377
|
onChange: onOpenChange
|
|
4376
4378
|
});
|
|
4377
|
-
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PopoverProvider, {
|
|
4379
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9$1, popperScope, /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PopoverProvider, {
|
|
4378
4380
|
scope: __scopePopover,
|
|
4379
4381
|
contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
4380
4382
|
triggerRef: triggerRef,
|
|
@@ -4393,6 +4395,26 @@ const $cb5cc270b50c6fcd$export$5b6b19405a83ff9d = (props)=>{
|
|
|
4393
4395
|
modal: modal
|
|
4394
4396
|
}, children));
|
|
4395
4397
|
};
|
|
4398
|
+
/* -------------------------------------------------------------------------------------------------
|
|
4399
|
+
* PopoverAnchor
|
|
4400
|
+
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$ANCHOR_NAME = 'PopoverAnchor';
|
|
4401
|
+
const $cb5cc270b50c6fcd$export$96e5381f42521a79 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
4402
|
+
const { __scopePopover: __scopePopover , ...anchorProps } = props;
|
|
4403
|
+
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$ANCHOR_NAME, __scopePopover);
|
|
4404
|
+
const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover);
|
|
4405
|
+
const { onCustomAnchorAdd: onCustomAnchorAdd , onCustomAnchorRemove: onCustomAnchorRemove } = context;
|
|
4406
|
+
React.useEffect(()=>{
|
|
4407
|
+
onCustomAnchorAdd();
|
|
4408
|
+
return ()=>onCustomAnchorRemove()
|
|
4409
|
+
;
|
|
4410
|
+
}, [
|
|
4411
|
+
onCustomAnchorAdd,
|
|
4412
|
+
onCustomAnchorRemove
|
|
4413
|
+
]);
|
|
4414
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7$1, _extends({}, popperScope, anchorProps, {
|
|
4415
|
+
ref: forwardedRef
|
|
4416
|
+
}));
|
|
4417
|
+
});
|
|
4396
4418
|
/* -------------------------------------------------------------------------------------------------
|
|
4397
4419
|
* PopoverTrigger
|
|
4398
4420
|
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$TRIGGER_NAME = 'PopoverTrigger';
|
|
@@ -4400,8 +4422,8 @@ const $cb5cc270b50c6fcd$export$7dacb05d26466c3 = /*#__PURE__*/ React.forwardRef(
|
|
|
4400
4422
|
const { __scopePopover: __scopePopover , ...triggerProps } = props;
|
|
4401
4423
|
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$TRIGGER_NAME, __scopePopover);
|
|
4402
4424
|
const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover);
|
|
4403
|
-
const composedTriggerRef = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.triggerRef);
|
|
4404
|
-
const trigger = /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
4425
|
+
const composedTriggerRef = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, context.triggerRef);
|
|
4426
|
+
const trigger = /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.button, _extends({
|
|
4405
4427
|
type: "button",
|
|
4406
4428
|
"aria-haspopup": "dialog",
|
|
4407
4429
|
"aria-expanded": context.open,
|
|
@@ -4409,9 +4431,9 @@ const $cb5cc270b50c6fcd$export$7dacb05d26466c3 = /*#__PURE__*/ React.forwardRef(
|
|
|
4409
4431
|
"data-state": $cb5cc270b50c6fcd$var$getState(context.open)
|
|
4410
4432
|
}, triggerProps, {
|
|
4411
4433
|
ref: composedTriggerRef,
|
|
4412
|
-
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onOpenToggle)
|
|
4434
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onClick, context.onOpenToggle)
|
|
4413
4435
|
}));
|
|
4414
|
-
return context.hasCustomAnchor ? trigger : /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({
|
|
4436
|
+
return context.hasCustomAnchor ? trigger : /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7$1, _extends({
|
|
4415
4437
|
asChild: true
|
|
4416
4438
|
}, popperScope), trigger);
|
|
4417
4439
|
});
|
|
@@ -4421,6 +4443,19 @@ const $cb5cc270b50c6fcd$export$7dacb05d26466c3 = /*#__PURE__*/ React.forwardRef(
|
|
|
4421
4443
|
const [$cb5cc270b50c6fcd$var$PortalProvider, $cb5cc270b50c6fcd$var$usePortalContext] = $cb5cc270b50c6fcd$var$createPopoverContext($cb5cc270b50c6fcd$var$PORTAL_NAME, {
|
|
4422
4444
|
forceMount: undefined
|
|
4423
4445
|
});
|
|
4446
|
+
const $cb5cc270b50c6fcd$export$dd679ffb4362d2d4 = (props)=>{
|
|
4447
|
+
const { __scopePopover: __scopePopover , forceMount: forceMount , children: children , container: container } = props;
|
|
4448
|
+
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$PORTAL_NAME, __scopePopover);
|
|
4449
|
+
return /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PortalProvider, {
|
|
4450
|
+
scope: __scopePopover,
|
|
4451
|
+
forceMount: forceMount
|
|
4452
|
+
}, /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b$1, {
|
|
4453
|
+
present: forceMount || context.open
|
|
4454
|
+
}, /*#__PURE__*/ React.createElement($f1701beae083dbae$export$602eac185826482c$1, {
|
|
4455
|
+
asChild: true,
|
|
4456
|
+
container: container
|
|
4457
|
+
}, children)));
|
|
4458
|
+
};
|
|
4424
4459
|
/* -------------------------------------------------------------------------------------------------
|
|
4425
4460
|
* PopoverContent
|
|
4426
4461
|
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$CONTENT_NAME = 'PopoverContent';
|
|
@@ -4428,7 +4463,7 @@ const $cb5cc270b50c6fcd$export$d7e1f420b25549ff = /*#__PURE__*/ React.forwardRef
|
|
|
4428
4463
|
const portalContext = $cb5cc270b50c6fcd$var$usePortalContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
|
|
4429
4464
|
const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
|
|
4430
4465
|
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
|
|
4431
|
-
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
4466
|
+
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b$1, {
|
|
4432
4467
|
present: forceMount || context.open
|
|
4433
4468
|
}, context.modal ? /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PopoverContentModal, _extends({}, contentProps, {
|
|
4434
4469
|
ref: forwardedRef
|
|
@@ -4439,26 +4474,26 @@ const $cb5cc270b50c6fcd$export$d7e1f420b25549ff = /*#__PURE__*/ React.forwardRef
|
|
|
4439
4474
|
/* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$PopoverContentModal = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
4440
4475
|
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
|
|
4441
4476
|
const contentRef = React.useRef(null);
|
|
4442
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef);
|
|
4477
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, contentRef);
|
|
4443
4478
|
const isRightClickOutsideRef = React.useRef(false); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
4444
4479
|
React.useEffect(()=>{
|
|
4445
4480
|
const content = contentRef.current;
|
|
4446
4481
|
if (content) return hideOthers(content);
|
|
4447
4482
|
}, []);
|
|
4448
4483
|
return /*#__PURE__*/ React.createElement($epM9y$RemoveScroll, {
|
|
4449
|
-
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
4484
|
+
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360$1,
|
|
4450
4485
|
allowPinchZoom: true
|
|
4451
4486
|
}, /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PopoverContentImpl, _extends({}, props, {
|
|
4452
4487
|
ref: composedRefs // we make sure we're not trapping once it's been closed
|
|
4453
4488
|
,
|
|
4454
4489
|
trapFocus: context.open,
|
|
4455
4490
|
disableOutsidePointerEvents: true,
|
|
4456
|
-
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{
|
|
4491
|
+
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onCloseAutoFocus, (event)=>{
|
|
4457
4492
|
var _context$triggerRef$c;
|
|
4458
4493
|
event.preventDefault();
|
|
4459
4494
|
if (!isRightClickOutsideRef.current) (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
4460
4495
|
}),
|
|
4461
|
-
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownOutside, (event)=>{
|
|
4496
|
+
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onPointerDownOutside, (event)=>{
|
|
4462
4497
|
const originalEvent = event.detail.originalEvent;
|
|
4463
4498
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
4464
4499
|
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
@@ -4467,7 +4502,7 @@ const $cb5cc270b50c6fcd$export$d7e1f420b25549ff = /*#__PURE__*/ React.forwardRef
|
|
|
4467
4502
|
checkForDefaultPrevented: false
|
|
4468
4503
|
}) // When focus is trapped, a `focusout` event may still happen.
|
|
4469
4504
|
,
|
|
4470
|
-
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault()
|
|
4505
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onFocusOutside, (event)=>event.preventDefault()
|
|
4471
4506
|
, {
|
|
4472
4507
|
checkForDefaultPrevented: false
|
|
4473
4508
|
})
|
|
@@ -4523,7 +4558,7 @@ const $cb5cc270b50c6fcd$var$PopoverContentNonModal = /*#__PURE__*/ React.forward
|
|
|
4523
4558
|
trapped: trapFocus,
|
|
4524
4559
|
onMountAutoFocus: onOpenAutoFocus,
|
|
4525
4560
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
4526
|
-
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, {
|
|
4561
|
+
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22$1, {
|
|
4527
4562
|
asChild: true,
|
|
4528
4563
|
disableOutsidePointerEvents: disableOutsidePointerEvents,
|
|
4529
4564
|
onInteractOutside: onInteractOutside,
|
|
@@ -4531,7 +4566,7 @@ const $cb5cc270b50c6fcd$var$PopoverContentNonModal = /*#__PURE__*/ React.forward
|
|
|
4531
4566
|
onPointerDownOutside: onPointerDownOutside,
|
|
4532
4567
|
onFocusOutside: onFocusOutside,
|
|
4533
4568
|
onDismiss: ()=>context.onOpenChange(false)
|
|
4534
|
-
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({
|
|
4569
|
+
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2$1, _extends({
|
|
4535
4570
|
"data-state": $cb5cc270b50c6fcd$var$getState(context.open),
|
|
4536
4571
|
role: "dialog",
|
|
4537
4572
|
id: context.contentId
|
|
@@ -4547,10 +4582,24 @@ const $cb5cc270b50c6fcd$var$PopoverContentNonModal = /*#__PURE__*/ React.forward
|
|
|
4547
4582
|
}
|
|
4548
4583
|
}))));
|
|
4549
4584
|
});
|
|
4585
|
+
/* -------------------------------------------------------------------------------------------------
|
|
4586
|
+
* PopoverClose
|
|
4587
|
+
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$CLOSE_NAME = 'PopoverClose';
|
|
4588
|
+
const $cb5cc270b50c6fcd$export$d6ac43ebaa40d53e = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
4589
|
+
const { __scopePopover: __scopePopover , ...closeProps } = props;
|
|
4590
|
+
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CLOSE_NAME, __scopePopover);
|
|
4591
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.button, _extends({
|
|
4592
|
+
type: "button"
|
|
4593
|
+
}, closeProps, {
|
|
4594
|
+
ref: forwardedRef,
|
|
4595
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onClick, ()=>context.onOpenChange(false)
|
|
4596
|
+
)
|
|
4597
|
+
}));
|
|
4598
|
+
});
|
|
4550
4599
|
const $cb5cc270b50c6fcd$export$3152841115e061b2 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
4551
4600
|
const { __scopePopover: __scopePopover , ...arrowProps } = props;
|
|
4552
4601
|
const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover);
|
|
4553
|
-
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5, _extends({}, popperScope, arrowProps, {
|
|
4602
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5$1, _extends({}, popperScope, arrowProps, {
|
|
4554
4603
|
ref: forwardedRef
|
|
4555
4604
|
}));
|
|
4556
4605
|
});
|
|
@@ -4558,10 +4607,32 @@ const $cb5cc270b50c6fcd$export$3152841115e061b2 = /*#__PURE__*/ React.forwardRef
|
|
|
4558
4607
|
return open ? 'open' : 'closed';
|
|
4559
4608
|
}
|
|
4560
4609
|
const $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9 = $cb5cc270b50c6fcd$export$5b6b19405a83ff9d;
|
|
4610
|
+
const $cb5cc270b50c6fcd$export$b688253958b8dfe7 = $cb5cc270b50c6fcd$export$96e5381f42521a79;
|
|
4561
4611
|
const $cb5cc270b50c6fcd$export$41fb9f06171c75f4 = $cb5cc270b50c6fcd$export$7dacb05d26466c3;
|
|
4612
|
+
const $cb5cc270b50c6fcd$export$602eac185826482c = $cb5cc270b50c6fcd$export$dd679ffb4362d2d4;
|
|
4562
4613
|
const $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2 = $cb5cc270b50c6fcd$export$d7e1f420b25549ff;
|
|
4614
|
+
const $cb5cc270b50c6fcd$export$f39c2d165cd861fe = $cb5cc270b50c6fcd$export$d6ac43ebaa40d53e;
|
|
4563
4615
|
const $cb5cc270b50c6fcd$export$21b07c8f274aebd5 = $cb5cc270b50c6fcd$export$3152841115e061b2;
|
|
4564
4616
|
|
|
4617
|
+
var PopoverPrimitive = /*#__PURE__*/Object.freeze({
|
|
4618
|
+
__proto__: null,
|
|
4619
|
+
Anchor: $cb5cc270b50c6fcd$export$b688253958b8dfe7,
|
|
4620
|
+
Arrow: $cb5cc270b50c6fcd$export$21b07c8f274aebd5,
|
|
4621
|
+
Close: $cb5cc270b50c6fcd$export$f39c2d165cd861fe,
|
|
4622
|
+
Content: $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,
|
|
4623
|
+
Popover: $cb5cc270b50c6fcd$export$5b6b19405a83ff9d,
|
|
4624
|
+
PopoverAnchor: $cb5cc270b50c6fcd$export$96e5381f42521a79,
|
|
4625
|
+
PopoverArrow: $cb5cc270b50c6fcd$export$3152841115e061b2,
|
|
4626
|
+
PopoverClose: $cb5cc270b50c6fcd$export$d6ac43ebaa40d53e,
|
|
4627
|
+
PopoverContent: $cb5cc270b50c6fcd$export$d7e1f420b25549ff,
|
|
4628
|
+
PopoverPortal: $cb5cc270b50c6fcd$export$dd679ffb4362d2d4,
|
|
4629
|
+
PopoverTrigger: $cb5cc270b50c6fcd$export$7dacb05d26466c3,
|
|
4630
|
+
Portal: $cb5cc270b50c6fcd$export$602eac185826482c,
|
|
4631
|
+
Root: $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,
|
|
4632
|
+
Trigger: $cb5cc270b50c6fcd$export$41fb9f06171c75f4,
|
|
4633
|
+
createPopoverScope: $cb5cc270b50c6fcd$export$c8393c9e73286932
|
|
4634
|
+
});
|
|
4635
|
+
|
|
4565
4636
|
const borderStyles$3 = [
|
|
4566
4637
|
'tw-border-solid',
|
|
4567
4638
|
'tw-border',
|
|
@@ -4709,10 +4780,11 @@ const radioClasses = `tw-form-radio ${baseClasses$2}`;
|
|
|
4709
4780
|
* Checkbox and Radio Box Component.
|
|
4710
4781
|
*/
|
|
4711
4782
|
const Checkbox = (props) => {
|
|
4712
|
-
const { type = 'checkbox', value, disabled = false, label, onChange, onClick, onKeyDown, checked, defaultChecked, id, name, extraClassNames, extraLabelClassNames, testId, } = props;
|
|
4783
|
+
const { type = 'checkbox', value, disabled = false, label, onChange, onClick, onKeyDown, checked, defaultChecked, id, name, extraClassNames, extraLabelClassNames, testId, ...tooltipProps } = props;
|
|
4713
4784
|
const assignedId = id ?? 'checkbox_' + Math.random();
|
|
4785
|
+
const tooltipData = getQTipData(tooltipProps);
|
|
4714
4786
|
return (React.createElement("span", { className: `${alignment} ${extraClassNames}` },
|
|
4715
|
-
React.createElement("input", { value: value, type: type, "data-testid": testId, name: name, id: assignedId, checked: checked, defaultChecked: defaultChecked, className: `${type === 'checkbox' ? checkboxClasses : radioClasses} ${disabled ? 'tw-cursor-not-allowed' : 'tw-cursor-pointer'}`, disabled: disabled, onClick: onClick, onChange: onChange, onKeyDown: onKeyDown }),
|
|
4787
|
+
React.createElement("input", { value: value, type: type, "data-testid": testId, name: name, id: assignedId, checked: checked, defaultChecked: defaultChecked, className: `${type === 'checkbox' ? checkboxClasses : radioClasses} ${disabled ? 'tw-cursor-not-allowed' : 'tw-cursor-pointer'}`, disabled: disabled, onClick: onClick, onChange: onChange, onKeyDown: onKeyDown, ...tooltipData }),
|
|
4716
4788
|
React.createElement("label", { htmlFor: assignedId, className: `${labelClasses} ${extraLabelClassNames} ${disabled
|
|
4717
4789
|
? 'tw-cursor-not-allowed dark:tw-text-sq-fairly-dark-gray tw-text-sq-fairly-dark-gray'
|
|
4718
4790
|
: 'tw-cursor-pointer tw-text-sq-text-color dark:tw-text-sq-dark-text'}` }, label)));
|
|
@@ -6567,7 +6639,7 @@ const QTip = () => {
|
|
|
6567
6639
|
if (tooltipRef.current && tooltipTarget.current) {
|
|
6568
6640
|
computePosition(tooltipTarget.current, tooltipRef.current, {
|
|
6569
6641
|
placement: position,
|
|
6570
|
-
middleware: [offset(10), arrow$
|
|
6642
|
+
middleware: [offset(10), arrow$2({ element: tooltipArrowRef.current })],
|
|
6571
6643
|
}).then(({ x, y, middlewareData }) => {
|
|
6572
6644
|
Object.assign(tooltipRef.current?.style, {
|
|
6573
6645
|
left: `${x}px`,
|
|
@@ -9559,7 +9631,7 @@ function _taggedTemplateLiteral(strings, raw) {
|
|
|
9559
9631
|
}));
|
|
9560
9632
|
}
|
|
9561
9633
|
|
|
9562
|
-
var index = React.useLayoutEffect ;
|
|
9634
|
+
var index$1 = React.useLayoutEffect ;
|
|
9563
9635
|
|
|
9564
9636
|
var _excluded$3 = ["className", "clearValue", "cx", "getStyles", "getClassNames", "getValue", "hasValue", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue", "theme"];
|
|
9565
9637
|
// ==============================
|
|
@@ -9813,10 +9885,10 @@ var options = {
|
|
|
9813
9885
|
}
|
|
9814
9886
|
};
|
|
9815
9887
|
// check for SSR
|
|
9816
|
-
var w = typeof window !== 'undefined' ? window : {};
|
|
9817
|
-
if (w.addEventListener && w.removeEventListener) {
|
|
9818
|
-
w.addEventListener('p', noop, options);
|
|
9819
|
-
w.removeEventListener('p', noop, false);
|
|
9888
|
+
var w$1 = typeof window !== 'undefined' ? window : {};
|
|
9889
|
+
if (w$1.addEventListener && w$1.removeEventListener) {
|
|
9890
|
+
w$1.addEventListener('p', noop, options);
|
|
9891
|
+
w$1.removeEventListener('p', noop, false);
|
|
9820
9892
|
}
|
|
9821
9893
|
var supportsPassiveEvents = passiveOptionAccessed;
|
|
9822
9894
|
function notNullish(item) {
|
|
@@ -10058,7 +10130,7 @@ var MenuPlacer = function MenuPlacer(props) {
|
|
|
10058
10130
|
placement = _useState4[0],
|
|
10059
10131
|
setPlacement = _useState4[1];
|
|
10060
10132
|
var controlHeight = theme.spacing.controlHeight;
|
|
10061
|
-
index(function () {
|
|
10133
|
+
index$1(function () {
|
|
10062
10134
|
var menuEl = ref.current;
|
|
10063
10135
|
if (!menuEl) return;
|
|
10064
10136
|
|
|
@@ -10219,7 +10291,7 @@ var MenuPortal = function MenuPortal(props) {
|
|
|
10219
10291
|
});
|
|
10220
10292
|
}
|
|
10221
10293
|
}, [controlElement, menuPosition, placement, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.offset, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.left, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.width]);
|
|
10222
|
-
index(function () {
|
|
10294
|
+
index$1(function () {
|
|
10223
10295
|
updateComputedPosition();
|
|
10224
10296
|
}, [updateComputedPosition]);
|
|
10225
10297
|
var runAutoUpdate = React.useCallback(function () {
|
|
@@ -10233,7 +10305,7 @@ var MenuPortal = function MenuPortal(props) {
|
|
|
10233
10305
|
});
|
|
10234
10306
|
}
|
|
10235
10307
|
}, [controlElement, updateComputedPosition]);
|
|
10236
|
-
index(function () {
|
|
10308
|
+
index$1(function () {
|
|
10237
10309
|
runAutoUpdate();
|
|
10238
10310
|
}, [runAutoUpdate]);
|
|
10239
10311
|
var setMenuPortalElement = React.useCallback(function (menuPortalElement) {
|
|
@@ -11433,8 +11505,8 @@ var anyDiacritic = new RegExp('[' + diacritics.map(function (d) {
|
|
|
11433
11505
|
return d.letters;
|
|
11434
11506
|
}).join('') + ']', 'g');
|
|
11435
11507
|
var diacriticToBase = {};
|
|
11436
|
-
for (var i = 0; i < diacritics.length; i++) {
|
|
11437
|
-
var diacritic = diacritics[i];
|
|
11508
|
+
for (var i$2 = 0; i$2 < diacritics.length; i$2++) {
|
|
11509
|
+
var diacritic = diacritics[i$2];
|
|
11438
11510
|
for (var j = 0; j < diacritic.letters.length; j++) {
|
|
11439
11511
|
diacriticToBase[diacritic.letters[j]] = diacritic.base;
|
|
11440
11512
|
}
|
|
@@ -13777,13 +13849,13 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
13777
13849
|
/* -------------------------------------------------------------------------------------------------
|
|
13778
13850
|
* Dialog
|
|
13779
13851
|
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DIALOG_NAME = 'Dialog';
|
|
13780
|
-
const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($5d3850c4d0b4e6c7$var$DIALOG_NAME);
|
|
13852
|
+
const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($5d3850c4d0b4e6c7$var$DIALOG_NAME);
|
|
13781
13853
|
const [$5d3850c4d0b4e6c7$var$DialogProvider, $5d3850c4d0b4e6c7$var$useDialogContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$DIALOG_NAME);
|
|
13782
13854
|
const $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 = (props)=>{
|
|
13783
13855
|
const { __scopeDialog: __scopeDialog , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props;
|
|
13784
13856
|
const triggerRef = React.useRef(null);
|
|
13785
13857
|
const contentRef = React.useRef(null);
|
|
13786
|
-
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
13858
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
|
|
13787
13859
|
prop: openProp,
|
|
13788
13860
|
defaultProp: defaultOpen,
|
|
13789
13861
|
onChange: onOpenChange
|
|
@@ -13817,9 +13889,9 @@ const $5d3850c4d0b4e6c7$export$dad7c95542bacce0 = (props)=>{
|
|
|
13817
13889
|
return /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$PortalProvider, {
|
|
13818
13890
|
scope: __scopeDialog,
|
|
13819
13891
|
forceMount: forceMount
|
|
13820
|
-
}, React.Children.map(children, (child)=>/*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
13892
|
+
}, React.Children.map(children, (child)=>/*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b$1, {
|
|
13821
13893
|
present: forceMount || context.open
|
|
13822
|
-
}, /*#__PURE__*/ React.createElement($f1701beae083dbae$export$602eac185826482c, {
|
|
13894
|
+
}, /*#__PURE__*/ React.createElement($f1701beae083dbae$export$602eac185826482c$1, {
|
|
13823
13895
|
asChild: true,
|
|
13824
13896
|
container: container
|
|
13825
13897
|
}, child))
|
|
@@ -13832,7 +13904,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
13832
13904
|
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13833
13905
|
const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
|
|
13834
13906
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13835
|
-
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
13907
|
+
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b$1, {
|
|
13836
13908
|
present: forceMount || context.open
|
|
13837
13909
|
}, context.modal ? /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$DialogContentModal, _extends({}, contentProps, {
|
|
13838
13910
|
ref: forwardedRef
|
|
@@ -13843,7 +13915,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
13843
13915
|
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentModal = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
13844
13916
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13845
13917
|
const contentRef = React.useRef(null);
|
|
13846
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
13918
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
13847
13919
|
React.useEffect(()=>{
|
|
13848
13920
|
const content = contentRef.current;
|
|
13849
13921
|
if (content) return hideOthers(content);
|
|
@@ -13853,12 +13925,12 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
13853
13925
|
,
|
|
13854
13926
|
trapFocus: context.open,
|
|
13855
13927
|
disableOutsidePointerEvents: true,
|
|
13856
|
-
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{
|
|
13928
|
+
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onCloseAutoFocus, (event)=>{
|
|
13857
13929
|
var _context$triggerRef$c;
|
|
13858
13930
|
event.preventDefault();
|
|
13859
13931
|
(_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
13860
13932
|
}),
|
|
13861
|
-
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownOutside, (event)=>{
|
|
13933
|
+
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onPointerDownOutside, (event)=>{
|
|
13862
13934
|
const originalEvent = event.detail.originalEvent;
|
|
13863
13935
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
13864
13936
|
const isRightClick = originalEvent.button === 2 || ctrlLeftClick; // If the event is a right-click, we shouldn't close because
|
|
@@ -13866,7 +13938,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
13866
13938
|
if (isRightClick) event.preventDefault();
|
|
13867
13939
|
}) // When focus is trapped, a `focusout` event may still happen.
|
|
13868
13940
|
,
|
|
13869
|
-
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault()
|
|
13941
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onFocusOutside, (event)=>event.preventDefault()
|
|
13870
13942
|
)
|
|
13871
13943
|
}));
|
|
13872
13944
|
});
|
|
@@ -13912,7 +13984,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
13912
13984
|
const { __scopeDialog: __scopeDialog , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props;
|
|
13913
13985
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, __scopeDialog);
|
|
13914
13986
|
const contentRef = React.useRef(null);
|
|
13915
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
|
|
13987
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
|
|
13916
13988
|
// the last element in the DOM (beacuse of the `Portal`)
|
|
13917
13989
|
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
13918
13990
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
@@ -13921,7 +13993,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
13921
13993
|
trapped: trapFocus,
|
|
13922
13994
|
onMountAutoFocus: onOpenAutoFocus,
|
|
13923
13995
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
13924
|
-
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, _extends({
|
|
13996
|
+
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22$1, _extends({
|
|
13925
13997
|
role: "dialog",
|
|
13926
13998
|
id: context.contentId,
|
|
13927
13999
|
"aria-describedby": context.descriptionId,
|
|
@@ -13938,7 +14010,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
13938
14010
|
const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
13939
14011
|
const { __scopeDialog: __scopeDialog , ...titleProps } = props;
|
|
13940
14012
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TITLE_NAME, __scopeDialog);
|
|
13941
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.h2, _extends({
|
|
14013
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.h2, _extends({
|
|
13942
14014
|
id: context.titleId
|
|
13943
14015
|
}, titleProps, {
|
|
13944
14016
|
ref: forwardedRef
|
|
@@ -13950,7 +14022,7 @@ const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ React.forwardRef
|
|
|
13950
14022
|
const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
13951
14023
|
const { __scopeDialog: __scopeDialog , ...descriptionProps } = props;
|
|
13952
14024
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$DESCRIPTION_NAME, __scopeDialog);
|
|
13953
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.p, _extends({
|
|
14025
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.p, _extends({
|
|
13954
14026
|
id: context.descriptionId
|
|
13955
14027
|
}, descriptionProps, {
|
|
13956
14028
|
ref: forwardedRef
|
|
@@ -13962,11 +14034,11 @@ const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ React.forwardRef
|
|
|
13962
14034
|
const $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
13963
14035
|
const { __scopeDialog: __scopeDialog , ...closeProps } = props;
|
|
13964
14036
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CLOSE_NAME, __scopeDialog);
|
|
13965
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
14037
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.button, _extends({
|
|
13966
14038
|
type: "button"
|
|
13967
14039
|
}, closeProps, {
|
|
13968
14040
|
ref: forwardedRef,
|
|
13969
|
-
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, ()=>context.onOpenChange(false)
|
|
14041
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onClick, ()=>context.onOpenChange(false)
|
|
13970
14042
|
)
|
|
13971
14043
|
}));
|
|
13972
14044
|
});
|
|
@@ -14144,7 +14216,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
14144
14216
|
/* -----------------------------------------------------------------------------------------------
|
|
14145
14217
|
* CollectionProvider
|
|
14146
14218
|
* ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
|
|
14147
|
-
const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
|
|
14219
|
+
const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1(PROVIDER_NAME);
|
|
14148
14220
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
14149
14221
|
collectionRef: {
|
|
14150
14222
|
current: null
|
|
@@ -14167,8 +14239,8 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
14167
14239
|
const CollectionSlot = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14168
14240
|
const { scope: scope , children: children } = props;
|
|
14169
14241
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
14170
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
|
|
14171
|
-
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
14242
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, context.collectionRef);
|
|
14243
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360$1, {
|
|
14172
14244
|
ref: composedRefs
|
|
14173
14245
|
}, children);
|
|
14174
14246
|
});
|
|
@@ -14179,7 +14251,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
14179
14251
|
const CollectionItemSlot = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14180
14252
|
const { scope: scope , children: children , ...itemData } = props;
|
|
14181
14253
|
const ref = React.useRef(null);
|
|
14182
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
14254
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
|
|
14183
14255
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
14184
14256
|
React.useEffect(()=>{
|
|
14185
14257
|
context.itemMap.set(ref, {
|
|
@@ -14189,7 +14261,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
14189
14261
|
return ()=>void context.itemMap.delete(ref)
|
|
14190
14262
|
;
|
|
14191
14263
|
});
|
|
14192
|
-
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
14264
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360$1, {
|
|
14193
14265
|
[ITEM_DATA_ATTR]: '',
|
|
14194
14266
|
ref: composedRefs
|
|
14195
14267
|
}, children);
|
|
@@ -14238,7 +14310,7 @@ const $d7bdfb9eb0fdf311$var$EVENT_OPTIONS = {
|
|
|
14238
14310
|
* RovingFocusGroup
|
|
14239
14311
|
* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$GROUP_NAME = 'RovingFocusGroup';
|
|
14240
14312
|
const [$d7bdfb9eb0fdf311$var$Collection, $d7bdfb9eb0fdf311$var$useCollection, $d7bdfb9eb0fdf311$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($d7bdfb9eb0fdf311$var$GROUP_NAME);
|
|
14241
|
-
const [$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext, $d7bdfb9eb0fdf311$export$c7109489551a4f4] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($d7bdfb9eb0fdf311$var$GROUP_NAME, [
|
|
14313
|
+
const [$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext, $d7bdfb9eb0fdf311$export$c7109489551a4f4] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($d7bdfb9eb0fdf311$var$GROUP_NAME, [
|
|
14242
14314
|
$d7bdfb9eb0fdf311$var$createCollectionScope
|
|
14243
14315
|
]);
|
|
14244
14316
|
const [$d7bdfb9eb0fdf311$var$RovingFocusProvider, $d7bdfb9eb0fdf311$var$useRovingFocusContext] = $d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME);
|
|
@@ -14254,15 +14326,15 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ React.forwardRef
|
|
|
14254
14326
|
/* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14255
14327
|
const { __scopeRovingFocusGroup: __scopeRovingFocusGroup , orientation: orientation , loop: loop = false , dir: dir , currentTabStopId: currentTabStopIdProp , defaultCurrentTabStopId: defaultCurrentTabStopId , onCurrentTabStopIdChange: onCurrentTabStopIdChange , onEntryFocus: onEntryFocus , ...groupProps } = props;
|
|
14256
14328
|
const ref = React.useRef(null);
|
|
14257
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
14329
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
|
|
14258
14330
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
14259
|
-
const [currentTabStopId = null, setCurrentTabStopId] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14331
|
+
const [currentTabStopId = null, setCurrentTabStopId] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
|
|
14260
14332
|
prop: currentTabStopIdProp,
|
|
14261
14333
|
defaultProp: defaultCurrentTabStopId,
|
|
14262
14334
|
onChange: onCurrentTabStopIdChange
|
|
14263
14335
|
});
|
|
14264
14336
|
const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
|
|
14265
|
-
const handleEntryFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEntryFocus);
|
|
14337
|
+
const handleEntryFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onEntryFocus);
|
|
14266
14338
|
const getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup);
|
|
14267
14339
|
const isClickFocusRef = React.useRef(false);
|
|
14268
14340
|
const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);
|
|
@@ -14294,7 +14366,7 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ React.forwardRef
|
|
|
14294
14366
|
onFocusableItemRemove: React.useCallback(()=>setFocusableItemsCount((prevCount)=>prevCount - 1
|
|
14295
14367
|
)
|
|
14296
14368
|
, [])
|
|
14297
|
-
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14369
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
14298
14370
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
14299
14371
|
"data-orientation": orientation
|
|
14300
14372
|
}, groupProps, {
|
|
@@ -14303,10 +14375,10 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ React.forwardRef
|
|
|
14303
14375
|
outline: 'none',
|
|
14304
14376
|
...props.style
|
|
14305
14377
|
},
|
|
14306
|
-
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, ()=>{
|
|
14378
|
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onMouseDown, ()=>{
|
|
14307
14379
|
isClickFocusRef.current = true;
|
|
14308
14380
|
}),
|
|
14309
|
-
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, (event)=>{
|
|
14381
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onFocus, (event)=>{
|
|
14310
14382
|
// We normally wouldn't need this check, because we already check
|
|
14311
14383
|
// that the focus is on the current target and not bubbling to it.
|
|
14312
14384
|
// We do this because Safari doesn't focus buttons when clicked, and
|
|
@@ -14334,7 +14406,7 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ React.forwardRef
|
|
|
14334
14406
|
}
|
|
14335
14407
|
isClickFocusRef.current = false;
|
|
14336
14408
|
}),
|
|
14337
|
-
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, ()=>setIsTabbingBackOut(false)
|
|
14409
|
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onBlur, ()=>setIsTabbingBackOut(false)
|
|
14338
14410
|
)
|
|
14339
14411
|
})));
|
|
14340
14412
|
});
|
|
@@ -14365,20 +14437,20 @@ const $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = /*#__PURE__*/ React.forwardRef(
|
|
|
14365
14437
|
id: id,
|
|
14366
14438
|
focusable: focusable,
|
|
14367
14439
|
active: active
|
|
14368
|
-
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
14440
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.span, _extends({
|
|
14369
14441
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
14370
14442
|
"data-orientation": context.orientation
|
|
14371
14443
|
}, itemProps, {
|
|
14372
14444
|
ref: forwardedRef,
|
|
14373
|
-
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, (event)=>{
|
|
14445
|
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onMouseDown, (event)=>{
|
|
14374
14446
|
// We prevent focusing non-focusable items on `mousedown`.
|
|
14375
14447
|
// Even though the item has tabIndex={-1}, that only means take it out of the tab order.
|
|
14376
14448
|
if (!focusable) event.preventDefault(); // Safari doesn't focus a button when clicked so we run our logic on mousedown also
|
|
14377
14449
|
else context.onItemFocus(id);
|
|
14378
14450
|
}),
|
|
14379
|
-
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, ()=>context.onItemFocus(id)
|
|
14451
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onFocus, ()=>context.onItemFocus(id)
|
|
14380
14452
|
),
|
|
14381
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
14453
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onKeyDown, (event)=>{
|
|
14382
14454
|
if (event.key === 'Tab' && event.shiftKey) {
|
|
14383
14455
|
context.onItemShiftTab();
|
|
14384
14456
|
return;
|
|
@@ -14455,7 +14527,7 @@ const $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2 = $d7bdfb9eb0fdf311$export$ab9df
|
|
|
14455
14527
|
/* -------------------------------------------------------------------------------------------------
|
|
14456
14528
|
* Tabs
|
|
14457
14529
|
* -----------------------------------------------------------------------------------------------*/ const $69cb30bb0017df05$var$TABS_NAME = 'Tabs';
|
|
14458
|
-
const [$69cb30bb0017df05$var$createTabsContext, $69cb30bb0017df05$export$355f5bd209d7b13a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($69cb30bb0017df05$var$TABS_NAME, [
|
|
14530
|
+
const [$69cb30bb0017df05$var$createTabsContext, $69cb30bb0017df05$export$355f5bd209d7b13a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($69cb30bb0017df05$var$TABS_NAME, [
|
|
14459
14531
|
$d7bdfb9eb0fdf311$export$c7109489551a4f4
|
|
14460
14532
|
]);
|
|
14461
14533
|
const $69cb30bb0017df05$var$useRovingFocusGroupScope = $d7bdfb9eb0fdf311$export$c7109489551a4f4();
|
|
@@ -14463,7 +14535,7 @@ const [$69cb30bb0017df05$var$TabsProvider, $69cb30bb0017df05$var$useTabsContext]
|
|
|
14463
14535
|
const $69cb30bb0017df05$export$b2539bed5023c21c = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14464
14536
|
const { __scopeTabs: __scopeTabs , value: valueProp , onValueChange: onValueChange , defaultValue: defaultValue , orientation: orientation = 'horizontal' , dir: dir , activationMode: activationMode = 'automatic' , ...tabsProps } = props;
|
|
14465
14537
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
14466
|
-
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14538
|
+
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
|
|
14467
14539
|
prop: valueProp,
|
|
14468
14540
|
onChange: onValueChange,
|
|
14469
14541
|
defaultProp: defaultValue
|
|
@@ -14476,7 +14548,7 @@ const $69cb30bb0017df05$export$b2539bed5023c21c = /*#__PURE__*/ React.forwardRef
|
|
|
14476
14548
|
orientation: orientation,
|
|
14477
14549
|
dir: direction,
|
|
14478
14550
|
activationMode: activationMode
|
|
14479
|
-
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14551
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
14480
14552
|
dir: direction,
|
|
14481
14553
|
"data-orientation": orientation
|
|
14482
14554
|
}, tabsProps, {
|
|
@@ -14496,7 +14568,7 @@ const $69cb30bb0017df05$export$9712d22edc0d78c1 = /*#__PURE__*/ React.forwardRef
|
|
|
14496
14568
|
orientation: context.orientation,
|
|
14497
14569
|
dir: context.dir,
|
|
14498
14570
|
loop: loop
|
|
14499
|
-
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14571
|
+
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
14500
14572
|
role: "tablist",
|
|
14501
14573
|
"aria-orientation": context.orientation
|
|
14502
14574
|
}, listProps, {
|
|
@@ -14518,7 +14590,7 @@ const $69cb30bb0017df05$export$8114b9fdfdf9f3ba = /*#__PURE__*/ React.forwardRef
|
|
|
14518
14590
|
}, rovingFocusGroupScope, {
|
|
14519
14591
|
focusable: !disabled,
|
|
14520
14592
|
active: isSelected
|
|
14521
|
-
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
14593
|
+
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.button, _extends({
|
|
14522
14594
|
type: "button",
|
|
14523
14595
|
role: "tab",
|
|
14524
14596
|
"aria-selected": isSelected,
|
|
@@ -14529,20 +14601,20 @@ const $69cb30bb0017df05$export$8114b9fdfdf9f3ba = /*#__PURE__*/ React.forwardRef
|
|
|
14529
14601
|
id: triggerId
|
|
14530
14602
|
}, triggerProps, {
|
|
14531
14603
|
ref: forwardedRef,
|
|
14532
|
-
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, (event)=>{
|
|
14604
|
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onMouseDown, (event)=>{
|
|
14533
14605
|
// only call handler if it's the left button (mousedown gets triggered by all mouse buttons)
|
|
14534
14606
|
// but not when the control key is pressed (avoiding MacOS right click)
|
|
14535
14607
|
if (!disabled && event.button === 0 && event.ctrlKey === false) context.onValueChange(value);
|
|
14536
14608
|
else // prevent focus to avoid accidental activation
|
|
14537
14609
|
event.preventDefault();
|
|
14538
14610
|
}),
|
|
14539
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
14611
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onKeyDown, (event)=>{
|
|
14540
14612
|
if ([
|
|
14541
14613
|
' ',
|
|
14542
14614
|
'Enter'
|
|
14543
14615
|
].includes(event.key)) context.onValueChange(value);
|
|
14544
14616
|
}),
|
|
14545
|
-
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, ()=>{
|
|
14617
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onFocus, ()=>{
|
|
14546
14618
|
// handle "automatic" activation if necessary
|
|
14547
14619
|
// ie. activate tab following focus
|
|
14548
14620
|
const isAutomaticActivation = context.activationMode !== 'manual';
|
|
@@ -14566,9 +14638,9 @@ const $69cb30bb0017df05$export$bd905d70e8fd2ebb = /*#__PURE__*/ React.forwardRef
|
|
|
14566
14638
|
return ()=>cancelAnimationFrame(rAF)
|
|
14567
14639
|
;
|
|
14568
14640
|
}, []);
|
|
14569
|
-
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
14641
|
+
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b$1, {
|
|
14570
14642
|
present: forceMount || isSelected
|
|
14571
|
-
}, ({ present: present })=>/*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14643
|
+
}, ({ present: present })=>/*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
14572
14644
|
"data-state": isSelected ? 'active' : 'inactive',
|
|
14573
14645
|
"data-orientation": context.orientation,
|
|
14574
14646
|
role: "tabpanel",
|
|
@@ -14617,11 +14689,11 @@ const Tabs = ({ tabs, defaultActiveTab, activeTab, onTabSelect, extraClassNames,
|
|
|
14617
14689
|
/* -------------------------------------------------------------------------------------------------
|
|
14618
14690
|
* Collapsible
|
|
14619
14691
|
* -----------------------------------------------------------------------------------------------*/ const $409067139f391064$var$COLLAPSIBLE_NAME = 'Collapsible';
|
|
14620
|
-
const [$409067139f391064$var$createCollapsibleContext, $409067139f391064$export$952b32dcbe73087a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($409067139f391064$var$COLLAPSIBLE_NAME);
|
|
14692
|
+
const [$409067139f391064$var$createCollapsibleContext, $409067139f391064$export$952b32dcbe73087a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($409067139f391064$var$COLLAPSIBLE_NAME);
|
|
14621
14693
|
const [$409067139f391064$var$CollapsibleProvider, $409067139f391064$var$useCollapsibleContext] = $409067139f391064$var$createCollapsibleContext($409067139f391064$var$COLLAPSIBLE_NAME);
|
|
14622
14694
|
const $409067139f391064$export$6eb0f7ddcda6131f = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14623
14695
|
const { __scopeCollapsible: __scopeCollapsible , open: openProp , defaultOpen: defaultOpen , disabled: disabled , onOpenChange: onOpenChange , ...collapsibleProps } = props;
|
|
14624
|
-
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14696
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
|
|
14625
14697
|
prop: openProp,
|
|
14626
14698
|
defaultProp: defaultOpen,
|
|
14627
14699
|
onChange: onOpenChange
|
|
@@ -14636,7 +14708,7 @@ const $409067139f391064$export$6eb0f7ddcda6131f = /*#__PURE__*/ React.forwardRef
|
|
|
14636
14708
|
, [
|
|
14637
14709
|
setOpen
|
|
14638
14710
|
])
|
|
14639
|
-
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14711
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
14640
14712
|
"data-state": $409067139f391064$var$getState(open),
|
|
14641
14713
|
"data-disabled": disabled ? '' : undefined
|
|
14642
14714
|
}, collapsibleProps, {
|
|
@@ -14649,7 +14721,7 @@ const $409067139f391064$export$6eb0f7ddcda6131f = /*#__PURE__*/ React.forwardRef
|
|
|
14649
14721
|
const $409067139f391064$export$c135dce7b15bbbdc = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14650
14722
|
const { __scopeCollapsible: __scopeCollapsible , ...triggerProps } = props;
|
|
14651
14723
|
const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$TRIGGER_NAME, __scopeCollapsible);
|
|
14652
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
14724
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.button, _extends({
|
|
14653
14725
|
type: "button",
|
|
14654
14726
|
"aria-controls": context.contentId,
|
|
14655
14727
|
"aria-expanded": context.open || false,
|
|
@@ -14658,7 +14730,7 @@ const $409067139f391064$export$c135dce7b15bbbdc = /*#__PURE__*/ React.forwardRef
|
|
|
14658
14730
|
disabled: context.disabled
|
|
14659
14731
|
}, triggerProps, {
|
|
14660
14732
|
ref: forwardedRef,
|
|
14661
|
-
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onOpenToggle)
|
|
14733
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onClick, context.onOpenToggle)
|
|
14662
14734
|
}));
|
|
14663
14735
|
});
|
|
14664
14736
|
/* -------------------------------------------------------------------------------------------------
|
|
@@ -14667,7 +14739,7 @@ const $409067139f391064$export$c135dce7b15bbbdc = /*#__PURE__*/ React.forwardRef
|
|
|
14667
14739
|
const $409067139f391064$export$aadde00976f34151 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14668
14740
|
const { forceMount: forceMount , ...contentProps } = props;
|
|
14669
14741
|
const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, props.__scopeCollapsible);
|
|
14670
|
-
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
14742
|
+
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b$1, {
|
|
14671
14743
|
present: forceMount || context.open
|
|
14672
14744
|
}, ({ present: present })=>/*#__PURE__*/ React.createElement($409067139f391064$var$CollapsibleContentImpl, _extends({}, contentProps, {
|
|
14673
14745
|
ref: forwardedRef,
|
|
@@ -14680,7 +14752,7 @@ const $409067139f391064$export$aadde00976f34151 = /*#__PURE__*/ React.forwardRef
|
|
|
14680
14752
|
const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, __scopeCollapsible);
|
|
14681
14753
|
const [isPresent, setIsPresent] = React.useState(present);
|
|
14682
14754
|
const ref = React.useRef(null);
|
|
14683
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
14755
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
|
|
14684
14756
|
const heightRef = React.useRef(0);
|
|
14685
14757
|
const height = heightRef.current;
|
|
14686
14758
|
const widthRef = React.useRef(0);
|
|
@@ -14695,7 +14767,7 @@ const $409067139f391064$export$aadde00976f34151 = /*#__PURE__*/ React.forwardRef
|
|
|
14695
14767
|
return ()=>cancelAnimationFrame(rAF)
|
|
14696
14768
|
;
|
|
14697
14769
|
}, []);
|
|
14698
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
14770
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
14699
14771
|
const node = ref.current;
|
|
14700
14772
|
if (node) {
|
|
14701
14773
|
originalStylesRef.current = originalStylesRef.current || {
|
|
@@ -14722,7 +14794,7 @@ const $409067139f391064$export$aadde00976f34151 = /*#__PURE__*/ React.forwardRef
|
|
|
14722
14794
|
context.open,
|
|
14723
14795
|
present
|
|
14724
14796
|
]);
|
|
14725
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14797
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
14726
14798
|
"data-state": $409067139f391064$var$getState(context.open),
|
|
14727
14799
|
"data-disabled": context.disabled ? '' : undefined,
|
|
14728
14800
|
id: context.contentId,
|
|
@@ -14755,7 +14827,7 @@ const $1bf158f521e1b1b4$var$ACCORDION_KEYS = [
|
|
|
14755
14827
|
'ArrowRight'
|
|
14756
14828
|
];
|
|
14757
14829
|
const [$1bf158f521e1b1b4$var$Collection, $1bf158f521e1b1b4$var$useCollection, $1bf158f521e1b1b4$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($1bf158f521e1b1b4$var$ACCORDION_NAME);
|
|
14758
|
-
const [$1bf158f521e1b1b4$var$createAccordionContext, $1bf158f521e1b1b4$export$9748edc328a73be1] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($1bf158f521e1b1b4$var$ACCORDION_NAME, [
|
|
14830
|
+
const [$1bf158f521e1b1b4$var$createAccordionContext, $1bf158f521e1b1b4$export$9748edc328a73be1] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($1bf158f521e1b1b4$var$ACCORDION_NAME, [
|
|
14759
14831
|
$1bf158f521e1b1b4$var$createCollectionScope,
|
|
14760
14832
|
$409067139f391064$export$952b32dcbe73087a
|
|
14761
14833
|
]);
|
|
@@ -14790,7 +14862,7 @@ const [$1bf158f521e1b1b4$var$AccordionCollapsibleProvider, $1bf158f521e1b1b4$var
|
|
|
14790
14862
|
});
|
|
14791
14863
|
const $1bf158f521e1b1b4$var$AccordionImplSingle = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14792
14864
|
const { value: valueProp , defaultValue: defaultValue , onValueChange: onValueChange = ()=>{} , collapsible: collapsible = false , ...accordionSingleProps } = props;
|
|
14793
|
-
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14865
|
+
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
|
|
14794
14866
|
prop: valueProp,
|
|
14795
14867
|
defaultProp: defaultValue,
|
|
14796
14868
|
onChange: onValueChange
|
|
@@ -14815,7 +14887,7 @@ const $1bf158f521e1b1b4$var$AccordionImplSingle = /*#__PURE__*/ React.forwardRef
|
|
|
14815
14887
|
});
|
|
14816
14888
|
/* -----------------------------------------------------------------------------------------------*/ const $1bf158f521e1b1b4$var$AccordionImplMultiple = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14817
14889
|
const { value: valueProp , defaultValue: defaultValue , onValueChange: onValueChange = ()=>{} , ...accordionMultipleProps } = props;
|
|
14818
|
-
const [value1 = [], setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14890
|
+
const [value1 = [], setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
|
|
14819
14891
|
prop: valueProp,
|
|
14820
14892
|
defaultProp: defaultValue,
|
|
14821
14893
|
onChange: onValueChange
|
|
@@ -14850,11 +14922,11 @@ const $1bf158f521e1b1b4$var$AccordionImplSingle = /*#__PURE__*/ React.forwardRef
|
|
|
14850
14922
|
const $1bf158f521e1b1b4$var$AccordionImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14851
14923
|
const { __scopeAccordion: __scopeAccordion , disabled: disabled , dir: dir , orientation: orientation = 'vertical' , ...accordionProps } = props;
|
|
14852
14924
|
const accordionRef = React.useRef(null);
|
|
14853
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(accordionRef, forwardedRef);
|
|
14925
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(accordionRef, forwardedRef);
|
|
14854
14926
|
const getItems = $1bf158f521e1b1b4$var$useCollection(__scopeAccordion);
|
|
14855
14927
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
14856
14928
|
const isDirectionLTR = direction === 'ltr';
|
|
14857
|
-
const handleKeyDown = $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
14929
|
+
const handleKeyDown = $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onKeyDown, (event)=>{
|
|
14858
14930
|
var _triggerCollection$cl;
|
|
14859
14931
|
if (!$1bf158f521e1b1b4$var$ACCORDION_KEYS.includes(event.key)) return;
|
|
14860
14932
|
const target = event.target;
|
|
@@ -14914,7 +14986,7 @@ const $1bf158f521e1b1b4$var$AccordionImpl = /*#__PURE__*/ React.forwardRef((prop
|
|
|
14914
14986
|
orientation: orientation
|
|
14915
14987
|
}, /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$Collection.Slot, {
|
|
14916
14988
|
scope: __scopeAccordion
|
|
14917
|
-
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, accordionProps, {
|
|
14989
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, accordionProps, {
|
|
14918
14990
|
"data-orientation": orientation,
|
|
14919
14991
|
ref: composedRefs,
|
|
14920
14992
|
onKeyDown: disabled ? undefined : handleKeyDown
|
|
@@ -15011,100 +15083,1664 @@ const Accordion = ({ accordionItems, defaultValue, value, onItemSelect, disabled
|
|
|
15011
15083
|
React.createElement($1bf158f521e1b1b4$export$7c6e2c02157bb7d2, { className: `data-[state=open]:tw-animate-slideDown data-[state=closed]:tw-animate-slideUp tw-overflow-hidden focus-visible:tw-outline-none ${item.contentClassNames || ''}` }, item.content))))));
|
|
15012
15084
|
};
|
|
15013
15085
|
|
|
15014
|
-
|
|
15015
|
-
|
|
15016
|
-
|
|
15017
|
-
|
|
15018
|
-
|
|
15019
|
-
|
|
15020
|
-
'dark:tw-border-gray-700',
|
|
15021
|
-
].join(' ');
|
|
15022
|
-
const disabledClasses$1 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
15023
|
-
const ButtonWithPopover = ({ children, trigger, tooltipText, id, hasArrow, extraTriggerClassNames, extraPopoverClassNames, containerTestId, tooltipTestId, tooltipDelay, tooltipPlacement, disabled = false, align = 'end', alignOffset = -5, placement = 'bottom', placementOffset = 2, onOpenChange, isOpen, isHtmlTooltip = false, isCloseOnContentClick = false, setFocusOnTriggerOnClose = true, }) => {
|
|
15024
|
-
let tooltipData = undefined;
|
|
15025
|
-
if (tooltipText) {
|
|
15026
|
-
tooltipData = {
|
|
15027
|
-
'data-qtip-text': tooltipText,
|
|
15028
|
-
'data-qtip-placement': tooltipPlacement,
|
|
15029
|
-
'data-qtip-is-html': isHtmlTooltip,
|
|
15030
|
-
'data-qtip-testid': tooltipTestId,
|
|
15031
|
-
'data-qtip-delay': tooltipDelay ?? DEFAULT_TOOL_TIP_DELAY,
|
|
15032
|
-
};
|
|
15033
|
-
}
|
|
15034
|
-
return (React__namespace.createElement($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, { open: isOpen, defaultOpen: false, onOpenChange: onOpenChange },
|
|
15035
|
-
React__namespace.createElement($cb5cc270b50c6fcd$export$41fb9f06171c75f4, { id: id, className: `tw-border-none`, disabled: disabled },
|
|
15036
|
-
React__namespace.createElement("div", { ...tooltipData, className: `tw-bg-transparent tw-flex tw-flex-col tw-items-center tw-justify-center ${disabled ? disabledClasses$1 : ''} ${extraTriggerClassNames || ''}` }, trigger)),
|
|
15037
|
-
React__namespace.createElement($cb5cc270b50c6fcd$export$7c6e2c02157bb7d2, { sideOffset: placementOffset, align: align, side: placement, alignOffset: alignOffset, onCloseAutoFocus: (e) => !setFocusOnTriggerOnClose && e.preventDefault(), asChild: true, onClick: () => isCloseOnContentClick && onOpenChange && onOpenChange(false), className: "focus-visible:tw-outline-none tw-outline-none" },
|
|
15038
|
-
React__namespace.createElement("div", { "data-testid": containerTestId, className: `${bgStyles$1} ${borderStyles$1} tw-relative tw-z-[1000] tw-min-w-6 tw-p-[0.5rem] focus-visible:tw-outline-none tw-outline-none data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out
|
|
15039
|
-
data-[side=top]:tw-animate-slideDownAndFade data-[side=right]:tw-animate-slideLeftAndFade data-[side=bottom]:tw-animate-slideUpAndFade data-[side=left]:tw-animate-slideRightAndFade
|
|
15040
|
-
${extraPopoverClassNames || ''}` },
|
|
15041
|
-
hasArrow && (React__namespace.createElement($cb5cc270b50c6fcd$export$21b07c8f274aebd5, { asChild: true },
|
|
15042
|
-
React__namespace.createElement("div", { className: " tw-fill-transparent tw-bg-white tw-w-[6px] tw-h-[6px] tw-rotate-45 dark:tw-bg-sq-dark-background tw-border-b tw-border-r tw-border-sq-disabled-gray dark:tw-border-gray-700 tw-mt-[-2px]" }))),
|
|
15043
|
-
children))));
|
|
15044
|
-
};
|
|
15086
|
+
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
|
|
15087
|
+
return function handleEvent(event) {
|
|
15088
|
+
originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
|
|
15089
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
|
|
15090
|
+
};
|
|
15091
|
+
}
|
|
15045
15092
|
|
|
15046
|
-
const $6cc32821e9371a1c$var$SELECTION_KEYS = [
|
|
15047
|
-
'Enter',
|
|
15048
|
-
' '
|
|
15049
|
-
];
|
|
15050
|
-
const $6cc32821e9371a1c$var$FIRST_KEYS = [
|
|
15051
|
-
'ArrowDown',
|
|
15052
|
-
'PageUp',
|
|
15053
|
-
'Home'
|
|
15054
|
-
];
|
|
15055
|
-
const $6cc32821e9371a1c$var$LAST_KEYS = [
|
|
15056
|
-
'ArrowUp',
|
|
15057
|
-
'PageDown',
|
|
15058
|
-
'End'
|
|
15059
|
-
];
|
|
15060
|
-
const $6cc32821e9371a1c$var$FIRST_LAST_KEYS = [
|
|
15061
|
-
...$6cc32821e9371a1c$var$FIRST_KEYS,
|
|
15062
|
-
...$6cc32821e9371a1c$var$LAST_KEYS
|
|
15063
|
-
];
|
|
15064
15093
|
/* -------------------------------------------------------------------------------------------------
|
|
15065
|
-
*
|
|
15066
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
15067
|
-
|
|
15068
|
-
|
|
15069
|
-
|
|
15070
|
-
|
|
15071
|
-
|
|
15072
|
-
|
|
15073
|
-
|
|
15074
|
-
|
|
15075
|
-
|
|
15076
|
-
|
|
15077
|
-
|
|
15078
|
-
|
|
15079
|
-
|
|
15080
|
-
|
|
15081
|
-
|
|
15082
|
-
|
|
15083
|
-
|
|
15084
|
-
|
|
15085
|
-
|
|
15086
|
-
|
|
15087
|
-
|
|
15088
|
-
|
|
15089
|
-
|
|
15090
|
-
|
|
15091
|
-
|
|
15092
|
-
});
|
|
15093
|
-
|
|
15094
|
-
|
|
15095
|
-
|
|
15096
|
-
|
|
15097
|
-
|
|
15098
|
-
|
|
15099
|
-
|
|
15100
|
-
|
|
15101
|
-
|
|
15102
|
-
|
|
15103
|
-
|
|
15104
|
-
|
|
15105
|
-
|
|
15106
|
-
|
|
15107
|
-
|
|
15094
|
+
* createContextScope
|
|
15095
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
|
|
15096
|
+
let defaultContexts = [];
|
|
15097
|
+
/* -----------------------------------------------------------------------------------------------
|
|
15098
|
+
* createContext
|
|
15099
|
+
* ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
|
|
15100
|
+
const BaseContext = /*#__PURE__*/ React.createContext(defaultContext);
|
|
15101
|
+
const index = defaultContexts.length;
|
|
15102
|
+
defaultContexts = [
|
|
15103
|
+
...defaultContexts,
|
|
15104
|
+
defaultContext
|
|
15105
|
+
];
|
|
15106
|
+
function Provider(props) {
|
|
15107
|
+
const { scope: scope , children: children , ...context } = props;
|
|
15108
|
+
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
|
|
15109
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15110
|
+
const value = React.useMemo(()=>context
|
|
15111
|
+
, Object.values(context));
|
|
15112
|
+
return /*#__PURE__*/ React.createElement(Context.Provider, {
|
|
15113
|
+
value: value
|
|
15114
|
+
}, children);
|
|
15115
|
+
}
|
|
15116
|
+
function useContext(consumerName, scope) {
|
|
15117
|
+
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
|
|
15118
|
+
const context = React.useContext(Context);
|
|
15119
|
+
if (context) return context;
|
|
15120
|
+
if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
|
|
15121
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
15122
|
+
}
|
|
15123
|
+
Provider.displayName = rootComponentName + 'Provider';
|
|
15124
|
+
return [
|
|
15125
|
+
Provider,
|
|
15126
|
+
useContext
|
|
15127
|
+
];
|
|
15128
|
+
}
|
|
15129
|
+
/* -----------------------------------------------------------------------------------------------
|
|
15130
|
+
* createScope
|
|
15131
|
+
* ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
|
|
15132
|
+
const scopeContexts = defaultContexts.map((defaultContext)=>{
|
|
15133
|
+
return /*#__PURE__*/ React.createContext(defaultContext);
|
|
15134
|
+
});
|
|
15135
|
+
return function useScope(scope) {
|
|
15136
|
+
const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
|
|
15137
|
+
return React.useMemo(()=>({
|
|
15138
|
+
[`__scope${scopeName}`]: {
|
|
15139
|
+
...scope,
|
|
15140
|
+
[scopeName]: contexts
|
|
15141
|
+
}
|
|
15142
|
+
})
|
|
15143
|
+
, [
|
|
15144
|
+
scope,
|
|
15145
|
+
contexts
|
|
15146
|
+
]);
|
|
15147
|
+
};
|
|
15148
|
+
};
|
|
15149
|
+
createScope.scopeName = scopeName;
|
|
15150
|
+
return [
|
|
15151
|
+
$c512c27ab02ef895$export$fd42f52fd3ae1109,
|
|
15152
|
+
$c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
|
|
15153
|
+
];
|
|
15154
|
+
}
|
|
15155
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15156
|
+
* composeContextScopes
|
|
15157
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
|
|
15158
|
+
const baseScope = scopes[0];
|
|
15159
|
+
if (scopes.length === 1) return baseScope;
|
|
15160
|
+
const createScope1 = ()=>{
|
|
15161
|
+
const scopeHooks = scopes.map((createScope)=>({
|
|
15162
|
+
useScope: createScope(),
|
|
15163
|
+
scopeName: createScope.scopeName
|
|
15164
|
+
})
|
|
15165
|
+
);
|
|
15166
|
+
return function useComposedScopes(overrideScopes) {
|
|
15167
|
+
const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
|
|
15168
|
+
// We are calling a hook inside a callback which React warns against to avoid inconsistent
|
|
15169
|
+
// renders, however, scoping doesn't have render side effects so we ignore the rule.
|
|
15170
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
15171
|
+
const scopeProps = useScope(overrideScopes);
|
|
15172
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
15173
|
+
return {
|
|
15174
|
+
...nextScopes,
|
|
15175
|
+
...currentScope
|
|
15176
|
+
};
|
|
15177
|
+
}, {});
|
|
15178
|
+
return React.useMemo(()=>({
|
|
15179
|
+
[`__scope${baseScope.scopeName}`]: nextScopes1
|
|
15180
|
+
})
|
|
15181
|
+
, [
|
|
15182
|
+
nextScopes1
|
|
15183
|
+
]);
|
|
15184
|
+
};
|
|
15185
|
+
};
|
|
15186
|
+
createScope1.scopeName = baseScope.scopeName;
|
|
15187
|
+
return createScope1;
|
|
15188
|
+
}
|
|
15189
|
+
|
|
15190
|
+
/**
|
|
15191
|
+
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
15192
|
+
* prop or avoid re-executing effects when passed as a dependency
|
|
15193
|
+
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
15194
|
+
const callbackRef = React.useRef(callback);
|
|
15195
|
+
React.useEffect(()=>{
|
|
15196
|
+
callbackRef.current = callback;
|
|
15197
|
+
}); // https://github.com/facebook/react/issues/19240
|
|
15198
|
+
return React.useMemo(()=>(...args)=>{
|
|
15199
|
+
var _callbackRef$current;
|
|
15200
|
+
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
15201
|
+
}
|
|
15202
|
+
, []);
|
|
15203
|
+
}
|
|
15204
|
+
|
|
15205
|
+
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
|
|
15206
|
+
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
15207
|
+
defaultProp: defaultProp,
|
|
15208
|
+
onChange: onChange
|
|
15209
|
+
});
|
|
15210
|
+
const isControlled = prop !== undefined;
|
|
15211
|
+
const value1 = isControlled ? prop : uncontrolledProp;
|
|
15212
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
15213
|
+
const setValue = React.useCallback((nextValue)=>{
|
|
15214
|
+
if (isControlled) {
|
|
15215
|
+
const setter = nextValue;
|
|
15216
|
+
const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
|
|
15217
|
+
if (value !== prop) handleChange(value);
|
|
15218
|
+
} else setUncontrolledProp(nextValue);
|
|
15219
|
+
}, [
|
|
15220
|
+
isControlled,
|
|
15221
|
+
prop,
|
|
15222
|
+
setUncontrolledProp,
|
|
15223
|
+
handleChange
|
|
15224
|
+
]);
|
|
15225
|
+
return [
|
|
15226
|
+
value1,
|
|
15227
|
+
setValue
|
|
15228
|
+
];
|
|
15229
|
+
}
|
|
15230
|
+
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
|
|
15231
|
+
const uncontrolledState = React.useState(defaultProp);
|
|
15232
|
+
const [value] = uncontrolledState;
|
|
15233
|
+
const prevValueRef = React.useRef(value);
|
|
15234
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
15235
|
+
React.useEffect(()=>{
|
|
15236
|
+
if (prevValueRef.current !== value) {
|
|
15237
|
+
handleChange(value);
|
|
15238
|
+
prevValueRef.current = value;
|
|
15239
|
+
}
|
|
15240
|
+
}, [
|
|
15241
|
+
value,
|
|
15242
|
+
prevValueRef,
|
|
15243
|
+
handleChange
|
|
15244
|
+
]);
|
|
15245
|
+
return uncontrolledState;
|
|
15246
|
+
}
|
|
15247
|
+
|
|
15248
|
+
/**
|
|
15249
|
+
* Set a given ref to a given value
|
|
15250
|
+
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
15251
|
+
*/ function $6ed0406888f73fc4$var$setRef(ref, value) {
|
|
15252
|
+
if (typeof ref === 'function') ref(value);
|
|
15253
|
+
else if (ref !== null && ref !== undefined) ref.current = value;
|
|
15254
|
+
}
|
|
15255
|
+
/**
|
|
15256
|
+
* A utility to compose multiple refs together
|
|
15257
|
+
* Accepts callback refs and RefObject(s)
|
|
15258
|
+
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
|
15259
|
+
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
|
|
15260
|
+
)
|
|
15261
|
+
;
|
|
15262
|
+
}
|
|
15263
|
+
/**
|
|
15264
|
+
* A custom hook that composes multiple refs
|
|
15265
|
+
* Accepts callback refs and RefObject(s)
|
|
15266
|
+
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
15267
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15268
|
+
return React.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
15269
|
+
}
|
|
15270
|
+
|
|
15271
|
+
function t(t){return t.split("-")[0]}function e(t){return t.split("-")[1]}function n$1(e){return ["top","bottom"].includes(t(e))?"x":"y"}function r$1(t){return "y"===t?"height":"width"}function i$1(i,o,a){let{reference:l,floating:s}=i;const c=l.x+l.width/2-s.width/2,f=l.y+l.height/2-s.height/2,u=n$1(o),m=r$1(u),g=l[m]/2-s[m]/2,d="x"===u;let p;switch(t(o)){case"top":p={x:c,y:l.y-s.height};break;case"bottom":p={x:c,y:l.y+l.height};break;case"right":p={x:l.x+l.width,y:f};break;case"left":p={x:l.x-s.width,y:f};break;default:p={x:l.x,y:l.y};}switch(e(o)){case"start":p[u]-=g*(a&&d?-1:1);break;case"end":p[u]+=g*(a&&d?-1:1);}return p}const o$1=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:l}=n,s=await(null==l.isRTL?void 0:l.isRTL(e));let c=await l.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:u}=i$1(c,r,s),m=r,g={},d=0;for(let n=0;n<a.length;n++){const{name:p,fn:h}=a[n],{x:y,y:x,data:w,reset:v}=await h({x:f,y:u,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:c,platform:l,elements:{reference:t,floating:e}});f=null!=y?y:f,u=null!=x?x:u,g={...g,[p]:{...g[p],...w}},v&&d<=50&&(d++,"object"==typeof v&&(v.placement&&(m=v.placement),v.rects&&(c=!0===v.rects?await l.getElementRects({reference:t,floating:e,strategy:o}):v.rects),({x:f,y:u}=i$1(c,m,s))),n=-1);}return {x:f,y:u,placement:m,strategy:o,middlewareData:g}};function a$1(t){return "number"!=typeof t?function(t){return {top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function l$1(t){return {...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function s$1(t,e){var n;void 0===e&&(e={});const{x:r,y:i,platform:o,rects:s,elements:c,strategy:f}=t,{boundary:u="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:d=!1,padding:p=0}=e,h=a$1(p),y=c[d?"floating"===g?"reference":"floating":g],x=l$1(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(y)))||n?y:y.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(c.floating)),boundary:u,rootBoundary:m,strategy:f})),w=l$1(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===g?{...s.floating,x:r,y:i}:s.reference,offsetParent:await(null==o.getOffsetParent?void 0:o.getOffsetParent(c.floating)),strategy:f}):s[g]);return {top:x.top-w.top+h.top,bottom:w.bottom-x.bottom+h.bottom,left:x.left-w.left+h.left,right:w.right-x.right+h.right}}const c$1=Math.min,f$1=Math.max;function u$1(t,e,n){return f$1(t,c$1(e,n))}const m$1=t=>({name:"arrow",options:t,async fn(i){const{element:o,padding:l=0}=null!=t?t:{},{x:s,y:c,placement:f,rects:m,platform:g}=i;if(null==o)return {};const d=a$1(l),p={x:s,y:c},h=n$1(f),y=e(f),x=r$1(h),w=await g.getDimensions(o),v="y"===h?"top":"left",b="y"===h?"bottom":"right",R=m.reference[x]+m.reference[h]-p[h]-m.floating[x],A=p[h]-m.reference[h],P=await(null==g.getOffsetParent?void 0:g.getOffsetParent(o));let T=P?"y"===h?P.clientHeight||0:P.clientWidth||0:0;0===T&&(T=m.floating[x]);const O=R/2-A/2,D=d[v],L=T-w[x]-d[b],k=T/2-w[x]/2+O,E=u$1(D,k,L),C=("start"===y?d[v]:d[b])>0&&k!==E&&m.reference[x]<=m.floating[x];return {[h]:p[h]-(C?k<D?D-k:L-k:0),data:{[h]:E,centerOffset:k-E}}}}),g$1={left:"right",right:"left",bottom:"top",top:"bottom"};function d$1(t){return t.replace(/left|right|bottom|top/g,(t=>g$1[t]))}function p$1(t,i,o){void 0===o&&(o=!1);const a=e(t),l=n$1(t),s=r$1(l);let c="x"===l?a===(o?"end":"start")?"right":"left":"start"===a?"bottom":"top";return i.reference[s]>i.floating[s]&&(c=d$1(c)),{main:c,cross:d$1(c)}}const h$1={start:"end",end:"start"};function y$1(t){return t.replace(/start|end/g,(t=>h$1[t]))}const x$1=["top","right","bottom","left"];x$1.reduce(((t,e)=>t.concat(e,e+"-start",e+"-end")),[]);const b$1=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(n){var r;const{placement:i,middlewareData:o,rects:a,initialPlacement:l,platform:c,elements:f}=n,{mainAxis:u=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",flipAlignment:x=!0,...w}=e,v=t(i),b=g||(v===l||!x?[d$1(l)]:function(t){const e=d$1(t);return [y$1(t),e,y$1(e)]}(l)),R=[l,...b],A=await s$1(n,w),P=[];let T=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&P.push(A[v]),m){const{main:t,cross:e}=p$1(i,a,await(null==c.isRTL?void 0:c.isRTL(f.floating)));P.push(A[t],A[e]);}if(T=[...T,{placement:i,overflows:P}],!P.every((t=>t<=0))){var O,D;const t=(null!=(O=null==(D=o.flip)?void 0:D.index)?O:0)+1,e=R[t];if(e)return {data:{index:t,overflows:T},reset:{placement:e}};let n="bottom";switch(h){case"bestFit":{var L;const t=null==(L=T.map((t=>[t,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:L[0].placement;t&&(n=t);break}case"initialPlacement":n=l;}if(i!==n)return {reset:{placement:n}}}return {}}}};function R$1(t,e){return {top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function A(t){return x$1.some((e=>t[e]>=0))}const P=function(t){let{strategy:e="referenceHidden",...n}=void 0===t?{}:t;return {name:"hide",async fn(t){const{rects:r}=t;switch(e){case"referenceHidden":{const e=R$1(await s$1(t,{...n,elementContext:"reference"}),r.reference);return {data:{referenceHiddenOffsets:e,referenceHidden:A(e)}}}case"escaped":{const e=R$1(await s$1(t,{...n,altBoundary:!0}),r.floating);return {data:{escapedOffsets:e,escaped:A(e)}}}default:return {}}}}};const T$1=function(r){return void 0===r&&(r=0),{name:"offset",options:r,async fn(i){const{x:o,y:a}=i,l=await async function(r,i){const{placement:o,platform:a,elements:l}=r,s=await(null==a.isRTL?void 0:a.isRTL(l.floating)),c=t(o),f=e(o),u="x"===n$1(o),m=["left","top"].includes(c)?-1:1,g=s&&u?-1:1,d="function"==typeof i?i(r):i;let{mainAxis:p,crossAxis:h,alignmentAxis:y}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return f&&"number"==typeof y&&(h="end"===f?-1*y:y),u?{x:h*g,y:p*m}:{x:p*m,y:h*g}}(i,r);return {x:o+l.x,y:a+l.y,data:l}}}};function O(t){return "x"===t?"y":"x"}const D$1=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(r){const{x:i,y:o,placement:a}=r,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:t=>{let{x:e,y:n}=t;return {x:e,y:n}}},...m}=e,g={x:i,y:o},d=await s$1(r,m),p=n$1(t(a)),h=O(p);let y=g[p],x=g[h];if(l){const t="y"===p?"bottom":"right";y=u$1(y+d["y"===p?"top":"left"],y,y-d[t]);}if(c){const t="y"===h?"bottom":"right";x=u$1(x+d["y"===h?"top":"left"],x,x-d[t]);}const w=f.fn({...r,[p]:y,[h]:x});return {...w,data:{x:w.x-i,y:w.y-o}}}}},L$1=function(e){return void 0===e&&(e={}),{options:e,fn(r){const{x:i,y:o,placement:a,rects:l,middlewareData:s}=r,{offset:c=0,mainAxis:f=!0,crossAxis:u=!0}=e,m={x:i,y:o},g=n$1(a),d=O(g);let p=m[g],h=m[d];const y="function"==typeof c?c({...l,placement:a}):c,x="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(f){const t="y"===g?"height":"width",e=l.reference[g]-l.floating[t]+x.mainAxis,n=l.reference[g]+l.reference[t]-x.mainAxis;p<e?p=e:p>n&&(p=n);}if(u){var w,v,b,R;const e="y"===g?"width":"height",n=["top","left"].includes(t(a)),r=l.reference[d]-l.floating[e]+(n&&null!=(w=null==(v=s.offset)?void 0:v[d])?w:0)+(n?0:x.crossAxis),i=l.reference[d]+l.reference[e]+(n?0:null!=(b=null==(R=s.offset)?void 0:R[d])?b:0)-(n?x.crossAxis:0);h<r?h=r:h>i&&(h=i);}return {[g]:p,[d]:h}}}},k=function(n){return void 0===n&&(n={}),{name:"size",options:n,async fn(r){const{placement:i,rects:o,platform:a,elements:l}=r,{apply:c,...u}=n,m=await s$1(r,u),g=t(i),d=e(i);let p,h;"top"===g||"bottom"===g?(p=g,h=d===(await(null==a.isRTL?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(h=g,p="end"===d?"top":"bottom");const y=f$1(m.left,0),x=f$1(m.right,0),w=f$1(m.top,0),v=f$1(m.bottom,0),b={availableHeight:o.floating.height-(["left","right"].includes(i)?2*(0!==w||0!==v?w+v:f$1(m.top,m.bottom)):m[p]),availableWidth:o.floating.width-(["top","bottom"].includes(i)?2*(0!==y||0!==x?y+x:f$1(m.left,m.right)):m[h])},R=await a.getDimensions(l.floating);null==c||c({...r,...b});const A=await a.getDimensions(l.floating);return R.width!==A.width||R.height!==A.height?{reset:{rects:!0}}:{}}}};
|
|
15272
|
+
|
|
15273
|
+
function n(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function o(t){if(null==t)return window;if(!n(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function i(t){return o(t).getComputedStyle(t)}function r(t){return n(t)?"":t?(t.nodeName||"").toLowerCase():""}function l(){const t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((t=>t.brand+"/"+t.version)).join(" "):navigator.userAgent}function c(t){return t instanceof o(t).HTMLElement}function f(t){return t instanceof o(t).Element}function s(t){if("undefined"==typeof ShadowRoot)return !1;return t instanceof o(t).ShadowRoot||t instanceof ShadowRoot}function u(t){const{overflow:e,overflowX:n,overflowY:o}=i(t);return /auto|scroll|overlay|hidden/.test(e+o+n)}function d(t){return ["table","td","th"].includes(r(t))}function h(t){const e=/firefox/i.test(l()),n=i(t);return "none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter}function a(){return !/^((?!chrome|android).)*safari/i.test(l())}const g=Math.min,p=Math.max,m=Math.round;function w(t,e,n){var i,r,l,s;void 0===e&&(e=!1),void 0===n&&(n=!1);const u=t.getBoundingClientRect();let d=1,h=1;e&&c(t)&&(d=t.offsetWidth>0&&m(u.width)/t.offsetWidth||1,h=t.offsetHeight>0&&m(u.height)/t.offsetHeight||1);const g=f(t)?o(t):window,p=!a()&&n,w=(u.left+(p&&null!=(i=null==(r=g.visualViewport)?void 0:r.offsetLeft)?i:0))/d,v=(u.top+(p&&null!=(l=null==(s=g.visualViewport)?void 0:s.offsetTop)?l:0))/h,y=u.width/d,x=u.height/h;return {width:y,height:x,top:v,right:w+y,bottom:v+x,left:w,x:w,y:v}}function v(t){return (e=t,(e instanceof o(e).Node?t.ownerDocument:t.document)||window.document).documentElement;var e;}function y(t){return f(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function x(t){return w(v(t)).left+y(t).scrollLeft}function b(t,e,n){const o=c(e),i=v(e),l=w(t,o&&function(t){const e=w(t);return m(e.width)!==t.offsetWidth||m(e.height)!==t.offsetHeight}(e),"fixed"===n);let f={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==r(e)||u(i))&&(f=y(e)),c(e)){const t=w(e,!0);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop;}else i&&(s.x=x(i));return {x:l.left+f.scrollLeft-s.x,y:l.top+f.scrollTop-s.y,width:l.width,height:l.height}}function L(t){return "html"===r(t)?t:t.assignedSlot||t.parentNode||(s(t)?t.host:null)||v(t)}function R(t){return c(t)&&"fixed"!==getComputedStyle(t).position?t.offsetParent:null}function T(t){const e=o(t);let n=R(t);for(;n&&d(n)&&"static"===getComputedStyle(n).position;)n=R(n);return n&&("html"===r(n)||"body"===r(n)&&"static"===getComputedStyle(n).position&&!h(n))?e:n||function(t){let e=L(t);for(s(e)&&(e=e.host);c(e)&&!["html","body"].includes(r(e));){if(h(e))return e;e=e.parentNode;}return null}(t)||e}function W(t){if(c(t))return {width:t.offsetWidth,height:t.offsetHeight};const e=w(t);return {width:e.width,height:e.height}}function E(t){const e=L(t);return ["html","body","#document"].includes(r(e))?t.ownerDocument.body:c(e)&&u(e)?e:E(e)}function H(t,e){var n;void 0===e&&(e=[]);const i=E(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),l=o(i),c=r?[l].concat(l.visualViewport||[],u(i)?i:[]):i,f=e.concat(c);return r?f:f.concat(H(c))}function C(e,n,r){return "viewport"===n?l$1(function(t,e){const n=o(t),i=v(t),r=n.visualViewport;let l=i.clientWidth,c=i.clientHeight,f=0,s=0;if(r){l=r.width,c=r.height;const t=a();(t||!t&&"fixed"===e)&&(f=r.offsetLeft,s=r.offsetTop);}return {width:l,height:c,x:f,y:s}}(e,r)):f(n)?function(t,e){const n=w(t,!1,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft;return {top:o,left:i,x:i,y:o,right:i+t.clientWidth,bottom:o+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}(n,r):l$1(function(t){var e;const n=v(t),o=y(t),r=null==(e=t.ownerDocument)?void 0:e.body,l=p(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),c=p(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0);let f=-o.scrollLeft+x(t);const s=-o.scrollTop;return "rtl"===i(r||n).direction&&(f+=p(n.clientWidth,r?r.clientWidth:0)-l),{width:l,height:c,x:f,y:s}}(v(e)))}function S(t){const e=H(t),n=["absolute","fixed"].includes(i(t).position)&&c(t)?T(t):t;return f(n)?e.filter((t=>f(t)&&function(t,e){const n=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return !0;if(n&&s(n)){let n=e;do{if(n&&t===n)return !0;n=n.parentNode||n.host;}while(n)}return !1}(t,n)&&"body"!==r(t))):[]}const D={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?S(e):[].concat(n),o],l=r[0],c=r.reduce(((t,n)=>{const o=C(e,n,i);return t.top=p(o.top,t.top),t.right=g(o.right,t.right),t.bottom=g(o.bottom,t.bottom),t.left=p(o.left,t.left),t}),C(e,l,i));return {width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=c(n),l=v(n);if(n===l)return e;let f={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&"fixed"!==o)&&(("body"!==r(n)||u(l))&&(f=y(n)),c(n))){const t=w(n,!0);s.x=t.x+n.clientLeft,s.y=t.y+n.clientTop;}return {...e,x:e.x-f.scrollLeft+s.x,y:e.y-f.scrollTop+s.y}},isElement:f,getDimensions:W,getOffsetParent:T,getDocumentElement:v,getElementRects:t=>{let{reference:e,floating:n,strategy:o}=t;return {reference:b(e,T(n),o),floating:{...W(n),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===i(t).direction};function N(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=!0,animationFrame:c=!1}=o,s=i&&!c,u=r&&!c,d=s||u?[...f(t)?H(t):[],...H(e)]:[];d.forEach((t=>{s&&t.addEventListener("scroll",n,{passive:!0}),u&&t.addEventListener("resize",n);}));let h,a=null;if(l){let o=!0;a=new ResizeObserver((()=>{o||n(),o=!1;})),f(t)&&!c&&a.observe(t),a.observe(e);}let g=c?w(t):null;return c&&function e(){const o=w(t);!g||o.x===g.x&&o.y===g.y&&o.width===g.width&&o.height===g.height||n();g=o,h=requestAnimationFrame(e);}(),n(),()=>{var t;d.forEach((t=>{s&&t.removeEventListener("scroll",n),u&&t.removeEventListener("resize",n);})),null==(t=a)||t.disconnect(),a=null,c&&cancelAnimationFrame(h);}}const z=(t,n,o)=>o$1(t,n,{platform:D,...o});
|
|
15274
|
+
|
|
15275
|
+
var index = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
15276
|
+
|
|
15277
|
+
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
|
|
15278
|
+
// functions
|
|
15279
|
+
function deepEqual(a, b) {
|
|
15280
|
+
if (a === b) {
|
|
15281
|
+
return true;
|
|
15282
|
+
}
|
|
15283
|
+
|
|
15284
|
+
if (typeof a !== typeof b) {
|
|
15285
|
+
return false;
|
|
15286
|
+
}
|
|
15287
|
+
|
|
15288
|
+
if (typeof a === 'function' && a.toString() === b.toString()) {
|
|
15289
|
+
return true;
|
|
15290
|
+
}
|
|
15291
|
+
|
|
15292
|
+
let length, i, keys;
|
|
15293
|
+
|
|
15294
|
+
if (a && b && typeof a == 'object') {
|
|
15295
|
+
if (Array.isArray(a)) {
|
|
15296
|
+
length = a.length;
|
|
15297
|
+
if (length != b.length) return false;
|
|
15298
|
+
|
|
15299
|
+
for (i = length; i-- !== 0;) {
|
|
15300
|
+
if (!deepEqual(a[i], b[i])) {
|
|
15301
|
+
return false;
|
|
15302
|
+
}
|
|
15303
|
+
}
|
|
15304
|
+
|
|
15305
|
+
return true;
|
|
15306
|
+
}
|
|
15307
|
+
|
|
15308
|
+
keys = Object.keys(a);
|
|
15309
|
+
length = keys.length;
|
|
15310
|
+
|
|
15311
|
+
if (length !== Object.keys(b).length) {
|
|
15312
|
+
return false;
|
|
15313
|
+
}
|
|
15314
|
+
|
|
15315
|
+
for (i = length; i-- !== 0;) {
|
|
15316
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {
|
|
15317
|
+
return false;
|
|
15318
|
+
}
|
|
15319
|
+
}
|
|
15320
|
+
|
|
15321
|
+
for (i = length; i-- !== 0;) {
|
|
15322
|
+
const key = keys[i];
|
|
15323
|
+
|
|
15324
|
+
if (key === '_owner' && a.$$typeof) {
|
|
15325
|
+
continue;
|
|
15326
|
+
}
|
|
15327
|
+
|
|
15328
|
+
if (!deepEqual(a[key], b[key])) {
|
|
15329
|
+
return false;
|
|
15330
|
+
}
|
|
15331
|
+
}
|
|
15332
|
+
|
|
15333
|
+
return true;
|
|
15334
|
+
}
|
|
15335
|
+
|
|
15336
|
+
return a !== a && b !== b;
|
|
15337
|
+
}
|
|
15338
|
+
|
|
15339
|
+
function useLatestRef(value) {
|
|
15340
|
+
const ref = React__namespace.useRef(value);
|
|
15341
|
+
index(() => {
|
|
15342
|
+
ref.current = value;
|
|
15343
|
+
});
|
|
15344
|
+
return ref;
|
|
15345
|
+
}
|
|
15346
|
+
|
|
15347
|
+
function useFloating(_temp) {
|
|
15348
|
+
let {
|
|
15349
|
+
middleware,
|
|
15350
|
+
placement = 'bottom',
|
|
15351
|
+
strategy = 'absolute',
|
|
15352
|
+
whileElementsMounted
|
|
15353
|
+
} = _temp === void 0 ? {} : _temp;
|
|
15354
|
+
const reference = React__namespace.useRef(null);
|
|
15355
|
+
const floating = React__namespace.useRef(null);
|
|
15356
|
+
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
15357
|
+
const cleanupRef = React__namespace.useRef(null);
|
|
15358
|
+
const [data, setData] = React__namespace.useState({
|
|
15359
|
+
// Setting these to `null` will allow the consumer to determine if
|
|
15360
|
+
// `computePosition()` has run yet
|
|
15361
|
+
x: null,
|
|
15362
|
+
y: null,
|
|
15363
|
+
strategy,
|
|
15364
|
+
placement,
|
|
15365
|
+
middlewareData: {}
|
|
15366
|
+
});
|
|
15367
|
+
const [latestMiddleware, setLatestMiddleware] = React__namespace.useState(middleware);
|
|
15368
|
+
|
|
15369
|
+
if (!deepEqual(latestMiddleware == null ? void 0 : latestMiddleware.map(_ref => {
|
|
15370
|
+
let {
|
|
15371
|
+
options
|
|
15372
|
+
} = _ref;
|
|
15373
|
+
return options;
|
|
15374
|
+
}), middleware == null ? void 0 : middleware.map(_ref2 => {
|
|
15375
|
+
let {
|
|
15376
|
+
options
|
|
15377
|
+
} = _ref2;
|
|
15378
|
+
return options;
|
|
15379
|
+
}))) {
|
|
15380
|
+
setLatestMiddleware(middleware);
|
|
15381
|
+
}
|
|
15382
|
+
|
|
15383
|
+
const update = React__namespace.useCallback(() => {
|
|
15384
|
+
if (!reference.current || !floating.current) {
|
|
15385
|
+
return;
|
|
15386
|
+
}
|
|
15387
|
+
|
|
15388
|
+
z(reference.current, floating.current, {
|
|
15389
|
+
middleware: latestMiddleware,
|
|
15390
|
+
placement,
|
|
15391
|
+
strategy
|
|
15392
|
+
}).then(data => {
|
|
15393
|
+
if (isMountedRef.current) {
|
|
15394
|
+
ReactDOM__namespace.flushSync(() => {
|
|
15395
|
+
setData(data);
|
|
15396
|
+
});
|
|
15397
|
+
}
|
|
15398
|
+
});
|
|
15399
|
+
}, [latestMiddleware, placement, strategy]);
|
|
15400
|
+
index(() => {
|
|
15401
|
+
// Skip first update
|
|
15402
|
+
if (isMountedRef.current) {
|
|
15403
|
+
update();
|
|
15404
|
+
}
|
|
15405
|
+
}, [update]);
|
|
15406
|
+
const isMountedRef = React__namespace.useRef(false);
|
|
15407
|
+
index(() => {
|
|
15408
|
+
isMountedRef.current = true;
|
|
15409
|
+
return () => {
|
|
15410
|
+
isMountedRef.current = false;
|
|
15411
|
+
};
|
|
15412
|
+
}, []);
|
|
15413
|
+
const runElementMountCallback = React__namespace.useCallback(() => {
|
|
15414
|
+
if (typeof cleanupRef.current === 'function') {
|
|
15415
|
+
cleanupRef.current();
|
|
15416
|
+
cleanupRef.current = null;
|
|
15417
|
+
}
|
|
15418
|
+
|
|
15419
|
+
if (reference.current && floating.current) {
|
|
15420
|
+
if (whileElementsMountedRef.current) {
|
|
15421
|
+
const cleanupFn = whileElementsMountedRef.current(reference.current, floating.current, update);
|
|
15422
|
+
cleanupRef.current = cleanupFn;
|
|
15423
|
+
} else {
|
|
15424
|
+
update();
|
|
15425
|
+
}
|
|
15426
|
+
}
|
|
15427
|
+
}, [update, whileElementsMountedRef]);
|
|
15428
|
+
const setReference = React__namespace.useCallback(node => {
|
|
15429
|
+
reference.current = node;
|
|
15430
|
+
runElementMountCallback();
|
|
15431
|
+
}, [runElementMountCallback]);
|
|
15432
|
+
const setFloating = React__namespace.useCallback(node => {
|
|
15433
|
+
floating.current = node;
|
|
15434
|
+
runElementMountCallback();
|
|
15435
|
+
}, [runElementMountCallback]);
|
|
15436
|
+
const refs = React__namespace.useMemo(() => ({
|
|
15437
|
+
reference,
|
|
15438
|
+
floating
|
|
15439
|
+
}), []);
|
|
15440
|
+
return React__namespace.useMemo(() => ({ ...data,
|
|
15441
|
+
update,
|
|
15442
|
+
refs,
|
|
15443
|
+
reference: setReference,
|
|
15444
|
+
floating: setFloating
|
|
15445
|
+
}), [data, update, refs, setReference, setFloating]);
|
|
15446
|
+
}
|
|
15447
|
+
|
|
15448
|
+
/**
|
|
15449
|
+
* Positions an inner element of the floating element such that it is centered
|
|
15450
|
+
* to the reference element.
|
|
15451
|
+
* This wraps the core `arrow` middleware to allow React refs as the element.
|
|
15452
|
+
* @see https://floating-ui.com/docs/arrow
|
|
15453
|
+
*/
|
|
15454
|
+
|
|
15455
|
+
const arrow = options => {
|
|
15456
|
+
const {
|
|
15457
|
+
element,
|
|
15458
|
+
padding
|
|
15459
|
+
} = options;
|
|
15460
|
+
|
|
15461
|
+
function isRef(value) {
|
|
15462
|
+
return Object.prototype.hasOwnProperty.call(value, 'current');
|
|
15463
|
+
}
|
|
15464
|
+
|
|
15465
|
+
return {
|
|
15466
|
+
name: 'arrow',
|
|
15467
|
+
options,
|
|
15468
|
+
|
|
15469
|
+
fn(args) {
|
|
15470
|
+
if (isRef(element)) {
|
|
15471
|
+
if (element.current != null) {
|
|
15472
|
+
return m$1({
|
|
15473
|
+
element: element.current,
|
|
15474
|
+
padding
|
|
15475
|
+
}).fn(args);
|
|
15476
|
+
}
|
|
15477
|
+
|
|
15478
|
+
return {};
|
|
15479
|
+
} else if (element) {
|
|
15480
|
+
return m$1({
|
|
15481
|
+
element,
|
|
15482
|
+
padding
|
|
15483
|
+
}).fn(args);
|
|
15484
|
+
}
|
|
15485
|
+
|
|
15486
|
+
return {};
|
|
15487
|
+
}
|
|
15488
|
+
|
|
15489
|
+
};
|
|
15490
|
+
};
|
|
15491
|
+
|
|
15492
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15493
|
+
* Slot
|
|
15494
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
15495
|
+
const { children: children , ...slotProps } = props;
|
|
15496
|
+
const childrenArray = React.Children.toArray(children);
|
|
15497
|
+
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
15498
|
+
if (slottable) {
|
|
15499
|
+
// the new element to render is the one passed as a child of `Slottable`
|
|
15500
|
+
const newElement = slottable.props.children;
|
|
15501
|
+
const newChildren = childrenArray.map((child)=>{
|
|
15502
|
+
if (child === slottable) {
|
|
15503
|
+
// because the new element will be the one rendered, we are only interested
|
|
15504
|
+
// in grabbing its children (`newElement.props.children`)
|
|
15505
|
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
15506
|
+
return /*#__PURE__*/ React.isValidElement(newElement) ? newElement.props.children : null;
|
|
15507
|
+
} else return child;
|
|
15508
|
+
});
|
|
15509
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
15510
|
+
ref: forwardedRef
|
|
15511
|
+
}), /*#__PURE__*/ React.isValidElement(newElement) ? /*#__PURE__*/ React.cloneElement(newElement, undefined, newChildren) : null);
|
|
15512
|
+
}
|
|
15513
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
15514
|
+
ref: forwardedRef
|
|
15515
|
+
}), children);
|
|
15516
|
+
});
|
|
15517
|
+
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
|
|
15518
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15519
|
+
* SlotClone
|
|
15520
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
15521
|
+
const { children: children , ...slotProps } = props;
|
|
15522
|
+
if (/*#__PURE__*/ React.isValidElement(children)) return /*#__PURE__*/ React.cloneElement(children, {
|
|
15523
|
+
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
15524
|
+
ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref)
|
|
15525
|
+
});
|
|
15526
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
15527
|
+
});
|
|
15528
|
+
$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
|
|
15529
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15530
|
+
* Slottable
|
|
15531
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
|
|
15532
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, children);
|
|
15533
|
+
};
|
|
15534
|
+
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
15535
|
+
return /*#__PURE__*/ React.isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
15536
|
+
}
|
|
15537
|
+
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
15538
|
+
// all child props should override
|
|
15539
|
+
const overrideProps = {
|
|
15540
|
+
...childProps
|
|
15541
|
+
};
|
|
15542
|
+
for(const propName in childProps){
|
|
15543
|
+
const slotPropValue = slotProps[propName];
|
|
15544
|
+
const childPropValue = childProps[propName];
|
|
15545
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
15546
|
+
if (isHandler) {
|
|
15547
|
+
// if the handler exists on both, we compose them
|
|
15548
|
+
if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{
|
|
15549
|
+
childPropValue(...args);
|
|
15550
|
+
slotPropValue(...args);
|
|
15551
|
+
};
|
|
15552
|
+
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
15553
|
+
} else if (propName === 'style') overrideProps[propName] = {
|
|
15554
|
+
...slotPropValue,
|
|
15555
|
+
...childPropValue
|
|
15556
|
+
};
|
|
15557
|
+
else if (propName === 'className') overrideProps[propName] = [
|
|
15558
|
+
slotPropValue,
|
|
15559
|
+
childPropValue
|
|
15560
|
+
].filter(Boolean).join(' ');
|
|
15561
|
+
}
|
|
15562
|
+
return {
|
|
15563
|
+
...slotProps,
|
|
15564
|
+
...overrideProps
|
|
15565
|
+
};
|
|
15566
|
+
}
|
|
15567
|
+
|
|
15568
|
+
const $8927f6f2acc4f386$var$NODES = [
|
|
15569
|
+
'a',
|
|
15570
|
+
'button',
|
|
15571
|
+
'div',
|
|
15572
|
+
'h2',
|
|
15573
|
+
'h3',
|
|
15574
|
+
'img',
|
|
15575
|
+
'label',
|
|
15576
|
+
'li',
|
|
15577
|
+
'nav',
|
|
15578
|
+
'ol',
|
|
15579
|
+
'p',
|
|
15580
|
+
'span',
|
|
15581
|
+
'svg',
|
|
15582
|
+
'ul'
|
|
15583
|
+
]; // Temporary while we await merge of this fix:
|
|
15584
|
+
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
|
|
15585
|
+
// prettier-ignore
|
|
15586
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15587
|
+
* Primitive
|
|
15588
|
+
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
|
|
15589
|
+
const Node = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
15590
|
+
const { asChild: asChild , ...primitiveProps } = props;
|
|
15591
|
+
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
|
15592
|
+
React.useEffect(()=>{
|
|
15593
|
+
window[Symbol.for('radix-ui')] = true;
|
|
15594
|
+
}, []);
|
|
15595
|
+
return /*#__PURE__*/ React.createElement(Comp, _extends({}, primitiveProps, {
|
|
15596
|
+
ref: forwardedRef
|
|
15597
|
+
}));
|
|
15598
|
+
});
|
|
15599
|
+
Node.displayName = `Primitive.${node}`;
|
|
15600
|
+
return {
|
|
15601
|
+
...primitive,
|
|
15602
|
+
[node]: Node
|
|
15603
|
+
};
|
|
15604
|
+
}, {});
|
|
15605
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15606
|
+
* Utils
|
|
15607
|
+
* -----------------------------------------------------------------------------------------------*/ /**
|
|
15608
|
+
* Flush custom event dispatch
|
|
15609
|
+
* https://github.com/radix-ui/primitives/pull/1378
|
|
15610
|
+
*
|
|
15611
|
+
* React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.
|
|
15612
|
+
*
|
|
15613
|
+
* Internally, React prioritises events in the following order:
|
|
15614
|
+
* - discrete
|
|
15615
|
+
* - continuous
|
|
15616
|
+
* - default
|
|
15617
|
+
*
|
|
15618
|
+
* https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350
|
|
15619
|
+
*
|
|
15620
|
+
* `discrete` is an important distinction as updates within these events are applied immediately.
|
|
15621
|
+
* React however, is not able to infer the priority of custom event types due to how they are detected internally.
|
|
15622
|
+
* Because of this, it's possible for updates from custom events to be unexpectedly batched when
|
|
15623
|
+
* dispatched by another `discrete` event.
|
|
15624
|
+
*
|
|
15625
|
+
* In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.
|
|
15626
|
+
* This utility should be used when dispatching a custom event from within another `discrete` event, this utility
|
|
15627
|
+
* is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.
|
|
15628
|
+
* For example:
|
|
15629
|
+
*
|
|
15630
|
+
* dispatching a known click 👎
|
|
15631
|
+
* target.dispatchEvent(new Event(‘click’))
|
|
15632
|
+
*
|
|
15633
|
+
* dispatching a custom type within a non-discrete event 👎
|
|
15634
|
+
* onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}
|
|
15635
|
+
*
|
|
15636
|
+
* dispatching a custom type within a `discrete` event 👍
|
|
15637
|
+
* onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}
|
|
15638
|
+
*
|
|
15639
|
+
* Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
|
|
15640
|
+
* this utility with them. This is because it's possible for those handlers to be called implicitly during render
|
|
15641
|
+
* e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
|
|
15642
|
+
*/ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
|
|
15643
|
+
if (target) ReactDOM.flushSync(()=>target.dispatchEvent(event)
|
|
15644
|
+
);
|
|
15645
|
+
}
|
|
15646
|
+
|
|
15647
|
+
const $7e8f5cd07187803e$export$21b07c8f274aebd5 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
15648
|
+
const { children: children , width: width = 10 , height: height = 5 , ...arrowProps } = props;
|
|
15649
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.svg, _extends({}, arrowProps, {
|
|
15650
|
+
ref: forwardedRef,
|
|
15651
|
+
width: width,
|
|
15652
|
+
height: height,
|
|
15653
|
+
viewBox: "0 0 30 10",
|
|
15654
|
+
preserveAspectRatio: "none"
|
|
15655
|
+
}), props.asChild ? children : /*#__PURE__*/ React.createElement("polygon", {
|
|
15656
|
+
points: "0,0 30,0 15,10"
|
|
15657
|
+
}));
|
|
15658
|
+
});
|
|
15659
|
+
/* -----------------------------------------------------------------------------------------------*/ const $7e8f5cd07187803e$export$be92b6f5f03c0fe9 = $7e8f5cd07187803e$export$21b07c8f274aebd5;
|
|
15660
|
+
|
|
15661
|
+
/**
|
|
15662
|
+
* On the server, React emits a warning when calling `useLayoutEffect`.
|
|
15663
|
+
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
|
15664
|
+
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
15665
|
+
*
|
|
15666
|
+
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
15667
|
+
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? React.useLayoutEffect : ()=>{};
|
|
15668
|
+
|
|
15669
|
+
function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
|
15670
|
+
const [size, setSize] = React.useState(undefined);
|
|
15671
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
15672
|
+
if (element) {
|
|
15673
|
+
// provide size as early as possible
|
|
15674
|
+
setSize({
|
|
15675
|
+
width: element.offsetWidth,
|
|
15676
|
+
height: element.offsetHeight
|
|
15677
|
+
});
|
|
15678
|
+
const resizeObserver = new ResizeObserver((entries)=>{
|
|
15679
|
+
if (!Array.isArray(entries)) return;
|
|
15680
|
+
// Since we only observe the one element, we don't need to loop over the
|
|
15681
|
+
// array
|
|
15682
|
+
if (!entries.length) return;
|
|
15683
|
+
const entry = entries[0];
|
|
15684
|
+
let width;
|
|
15685
|
+
let height;
|
|
15686
|
+
if ('borderBoxSize' in entry) {
|
|
15687
|
+
const borderSizeEntry = entry['borderBoxSize']; // iron out differences between browsers
|
|
15688
|
+
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
15689
|
+
width = borderSize['inlineSize'];
|
|
15690
|
+
height = borderSize['blockSize'];
|
|
15691
|
+
} else {
|
|
15692
|
+
// for browsers that don't support `borderBoxSize`
|
|
15693
|
+
// we calculate it ourselves to get the correct border box.
|
|
15694
|
+
width = element.offsetWidth;
|
|
15695
|
+
height = element.offsetHeight;
|
|
15696
|
+
}
|
|
15697
|
+
setSize({
|
|
15698
|
+
width: width,
|
|
15699
|
+
height: height
|
|
15700
|
+
});
|
|
15701
|
+
});
|
|
15702
|
+
resizeObserver.observe(element, {
|
|
15703
|
+
box: 'border-box'
|
|
15704
|
+
});
|
|
15705
|
+
return ()=>resizeObserver.unobserve(element)
|
|
15706
|
+
;
|
|
15707
|
+
} else // We only want to reset to `undefined` when the element becomes `null`,
|
|
15708
|
+
// not if it changes to another element.
|
|
15709
|
+
setSize(undefined);
|
|
15710
|
+
}, [
|
|
15711
|
+
element
|
|
15712
|
+
]);
|
|
15713
|
+
return size;
|
|
15714
|
+
}
|
|
15715
|
+
|
|
15716
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15717
|
+
* Popper
|
|
15718
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$POPPER_NAME = 'Popper';
|
|
15719
|
+
const [$cf1ac5d9fe0e8206$var$createPopperContext, $cf1ac5d9fe0e8206$export$722aac194ae923] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
15720
|
+
const [$cf1ac5d9fe0e8206$var$PopperProvider, $cf1ac5d9fe0e8206$var$usePopperContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
15721
|
+
const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 = (props)=>{
|
|
15722
|
+
const { __scopePopper: __scopePopper , children: children } = props;
|
|
15723
|
+
const [anchor, setAnchor] = React.useState(null);
|
|
15724
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperProvider, {
|
|
15725
|
+
scope: __scopePopper,
|
|
15726
|
+
anchor: anchor,
|
|
15727
|
+
onAnchorChange: setAnchor
|
|
15728
|
+
}, children);
|
|
15729
|
+
};
|
|
15730
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15731
|
+
* PopperAnchor
|
|
15732
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ANCHOR_NAME = 'PopperAnchor';
|
|
15733
|
+
const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
15734
|
+
const { __scopePopper: __scopePopper , virtualRef: virtualRef , ...anchorProps } = props;
|
|
15735
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME, __scopePopper);
|
|
15736
|
+
const ref = React.useRef(null);
|
|
15737
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
15738
|
+
React.useEffect(()=>{
|
|
15739
|
+
// Consumer can anchor the popper to something that isn't
|
|
15740
|
+
// a DOM node e.g. pointer position, so we override the
|
|
15741
|
+
// `anchorRef` with their virtual ref in this case.
|
|
15742
|
+
context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
|
|
15743
|
+
});
|
|
15744
|
+
return virtualRef ? null : /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, anchorProps, {
|
|
15745
|
+
ref: composedRefs
|
|
15746
|
+
}));
|
|
15747
|
+
});
|
|
15748
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15749
|
+
* PopperContent
|
|
15750
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$CONTENT_NAME = 'PopperContent';
|
|
15751
|
+
const [$cf1ac5d9fe0e8206$var$PopperContentProvider, $cf1ac5d9fe0e8206$var$useContentContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME);
|
|
15752
|
+
const [$cf1ac5d9fe0e8206$var$PositionContextProvider, $cf1ac5d9fe0e8206$var$usePositionContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, {
|
|
15753
|
+
hasParent: false,
|
|
15754
|
+
positionUpdateFns: new Set()
|
|
15755
|
+
});
|
|
15756
|
+
const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
15757
|
+
var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$hide, _middlewareData$trans, _middlewareData$trans2;
|
|
15758
|
+
const { __scopePopper: __scopePopper , side: side = 'bottom' , sideOffset: sideOffset = 0 , align: align = 'center' , alignOffset: alignOffset = 0 , arrowPadding: arrowPadding = 0 , collisionBoundary: collisionBoundary = [] , collisionPadding: collisionPaddingProp = 0 , sticky: sticky = 'partial' , hideWhenDetached: hideWhenDetached = false , avoidCollisions: avoidCollisions = true , onPlaced: onPlaced , ...contentProps } = props;
|
|
15759
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
|
|
15760
|
+
const [content, setContent] = React.useState(null);
|
|
15761
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
|
15762
|
+
);
|
|
15763
|
+
const [arrow$1, setArrow] = React.useState(null);
|
|
15764
|
+
const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(arrow$1);
|
|
15765
|
+
const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0;
|
|
15766
|
+
const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0;
|
|
15767
|
+
const desiredPlacement = side + (align !== 'center' ? '-' + align : '');
|
|
15768
|
+
const collisionPadding = typeof collisionPaddingProp === 'number' ? collisionPaddingProp : {
|
|
15769
|
+
top: 0,
|
|
15770
|
+
right: 0,
|
|
15771
|
+
bottom: 0,
|
|
15772
|
+
left: 0,
|
|
15773
|
+
...collisionPaddingProp
|
|
15774
|
+
};
|
|
15775
|
+
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [
|
|
15776
|
+
collisionBoundary
|
|
15777
|
+
];
|
|
15778
|
+
const hasExplicitBoundaries = boundary.length > 0;
|
|
15779
|
+
const detectOverflowOptions = {
|
|
15780
|
+
padding: collisionPadding,
|
|
15781
|
+
boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull),
|
|
15782
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
15783
|
+
altBoundary: hasExplicitBoundaries
|
|
15784
|
+
};
|
|
15785
|
+
const { reference: reference , floating: floating , strategy: strategy , x: x , y: y , placement: placement , middlewareData: middlewareData , update: update } = useFloating({
|
|
15786
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
15787
|
+
strategy: 'fixed',
|
|
15788
|
+
placement: desiredPlacement,
|
|
15789
|
+
whileElementsMounted: N,
|
|
15790
|
+
middleware: [
|
|
15791
|
+
$cf1ac5d9fe0e8206$var$anchorCssProperties(),
|
|
15792
|
+
T$1({
|
|
15793
|
+
mainAxis: sideOffset + arrowHeight,
|
|
15794
|
+
alignmentAxis: alignOffset
|
|
15795
|
+
}),
|
|
15796
|
+
avoidCollisions ? D$1({
|
|
15797
|
+
mainAxis: true,
|
|
15798
|
+
crossAxis: false,
|
|
15799
|
+
limiter: sticky === 'partial' ? L$1() : undefined,
|
|
15800
|
+
...detectOverflowOptions
|
|
15801
|
+
}) : undefined,
|
|
15802
|
+
arrow$1 ? arrow({
|
|
15803
|
+
element: arrow$1,
|
|
15804
|
+
padding: arrowPadding
|
|
15805
|
+
}) : undefined,
|
|
15806
|
+
avoidCollisions ? b$1({
|
|
15807
|
+
...detectOverflowOptions
|
|
15808
|
+
}) : undefined,
|
|
15809
|
+
k({
|
|
15810
|
+
...detectOverflowOptions,
|
|
15811
|
+
apply: ({ elements: elements , availableWidth: width , availableHeight: height })=>{
|
|
15812
|
+
elements.floating.style.setProperty('--radix-popper-available-width', `${width}px`);
|
|
15813
|
+
elements.floating.style.setProperty('--radix-popper-available-height', `${height}px`);
|
|
15814
|
+
}
|
|
15815
|
+
}),
|
|
15816
|
+
$cf1ac5d9fe0e8206$var$transformOrigin({
|
|
15817
|
+
arrowWidth: arrowWidth,
|
|
15818
|
+
arrowHeight: arrowHeight
|
|
15819
|
+
}),
|
|
15820
|
+
hideWhenDetached ? P({
|
|
15821
|
+
strategy: 'referenceHidden'
|
|
15822
|
+
}) : undefined
|
|
15823
|
+
].filter($cf1ac5d9fe0e8206$var$isDefined)
|
|
15824
|
+
}); // assign the reference dynamically once `Content` has mounted so we can collocate the logic
|
|
15825
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
15826
|
+
reference(context.anchor);
|
|
15827
|
+
}, [
|
|
15828
|
+
reference,
|
|
15829
|
+
context.anchor
|
|
15830
|
+
]);
|
|
15831
|
+
const isPlaced = x !== null && y !== null;
|
|
15832
|
+
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
15833
|
+
const handlePlaced = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPlaced);
|
|
15834
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
15835
|
+
if (isPlaced) handlePlaced === null || handlePlaced === void 0 || handlePlaced();
|
|
15836
|
+
}, [
|
|
15837
|
+
isPlaced,
|
|
15838
|
+
handlePlaced
|
|
15839
|
+
]);
|
|
15840
|
+
const arrowX = (_middlewareData$arrow = middlewareData.arrow) === null || _middlewareData$arrow === void 0 ? void 0 : _middlewareData$arrow.x;
|
|
15841
|
+
const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y;
|
|
15842
|
+
const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0;
|
|
15843
|
+
const [contentZIndex, setContentZIndex] = React.useState();
|
|
15844
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
15845
|
+
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
15846
|
+
}, [
|
|
15847
|
+
content
|
|
15848
|
+
]);
|
|
15849
|
+
const { hasParent: hasParent , positionUpdateFns: positionUpdateFns } = $cf1ac5d9fe0e8206$var$usePositionContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
|
|
15850
|
+
const isRoot = !hasParent;
|
|
15851
|
+
React.useLayoutEffect(()=>{
|
|
15852
|
+
if (!isRoot) {
|
|
15853
|
+
positionUpdateFns.add(update);
|
|
15854
|
+
return ()=>{
|
|
15855
|
+
positionUpdateFns.delete(update);
|
|
15856
|
+
};
|
|
15857
|
+
}
|
|
15858
|
+
}, [
|
|
15859
|
+
isRoot,
|
|
15860
|
+
positionUpdateFns,
|
|
15861
|
+
update
|
|
15862
|
+
]); // when nested contents are rendered in portals, they are appended out of order causing
|
|
15863
|
+
// children to be positioned incorrectly if initially open.
|
|
15864
|
+
// we need to re-compute the positioning once the parent has finally been placed.
|
|
15865
|
+
// https://github.com/floating-ui/floating-ui/issues/1531
|
|
15866
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
15867
|
+
if (isRoot && isPlaced) Array.from(positionUpdateFns).reverse().forEach((fn)=>requestAnimationFrame(fn)
|
|
15868
|
+
);
|
|
15869
|
+
}, [
|
|
15870
|
+
isRoot,
|
|
15871
|
+
isPlaced,
|
|
15872
|
+
positionUpdateFns
|
|
15873
|
+
]);
|
|
15874
|
+
const commonProps = {
|
|
15875
|
+
'data-side': placedSide,
|
|
15876
|
+
'data-align': placedAlign,
|
|
15877
|
+
...contentProps,
|
|
15878
|
+
ref: composedRefs,
|
|
15879
|
+
style: {
|
|
15880
|
+
...contentProps.style,
|
|
15881
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
15882
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
15883
|
+
animation: !isPlaced ? 'none' : undefined,
|
|
15884
|
+
// hide the content if using the hide middleware and should be hidden
|
|
15885
|
+
opacity: (_middlewareData$hide = middlewareData.hide) !== null && _middlewareData$hide !== void 0 && _middlewareData$hide.referenceHidden ? 0 : undefined
|
|
15886
|
+
}
|
|
15887
|
+
};
|
|
15888
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
15889
|
+
ref: floating,
|
|
15890
|
+
"data-radix-popper-content-wrapper": "",
|
|
15891
|
+
style: {
|
|
15892
|
+
position: strategy,
|
|
15893
|
+
left: 0,
|
|
15894
|
+
top: 0,
|
|
15895
|
+
transform: isPlaced ? `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)` : 'translate3d(0, -200%, 0)',
|
|
15896
|
+
// keep off the page when measuring
|
|
15897
|
+
minWidth: 'max-content',
|
|
15898
|
+
zIndex: contentZIndex,
|
|
15899
|
+
['--radix-popper-transform-origin']: [
|
|
15900
|
+
(_middlewareData$trans = middlewareData.transformOrigin) === null || _middlewareData$trans === void 0 ? void 0 : _middlewareData$trans.x,
|
|
15901
|
+
(_middlewareData$trans2 = middlewareData.transformOrigin) === null || _middlewareData$trans2 === void 0 ? void 0 : _middlewareData$trans2.y
|
|
15902
|
+
].join(' ')
|
|
15903
|
+
} // Floating UI interally calculates logical alignment based the `dir` attribute on
|
|
15904
|
+
,
|
|
15905
|
+
dir: props.dir
|
|
15906
|
+
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperContentProvider, {
|
|
15907
|
+
scope: __scopePopper,
|
|
15908
|
+
placedSide: placedSide,
|
|
15909
|
+
onArrowChange: setArrow,
|
|
15910
|
+
arrowX: arrowX,
|
|
15911
|
+
arrowY: arrowY,
|
|
15912
|
+
shouldHideArrow: cannotCenterArrow
|
|
15913
|
+
}, isRoot ? /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PositionContextProvider, {
|
|
15914
|
+
scope: __scopePopper,
|
|
15915
|
+
hasParent: true,
|
|
15916
|
+
positionUpdateFns: positionUpdateFns
|
|
15917
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, commonProps)) : /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, commonProps)));
|
|
15918
|
+
});
|
|
15919
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15920
|
+
* PopperArrow
|
|
15921
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ARROW_NAME = 'PopperArrow';
|
|
15922
|
+
const $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE = {
|
|
15923
|
+
top: 'bottom',
|
|
15924
|
+
right: 'left',
|
|
15925
|
+
bottom: 'top',
|
|
15926
|
+
left: 'right'
|
|
15927
|
+
};
|
|
15928
|
+
const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0 = /*#__PURE__*/ React.forwardRef(function $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0(props, forwardedRef) {
|
|
15929
|
+
const { __scopePopper: __scopePopper , ...arrowProps } = props;
|
|
15930
|
+
const contentContext = $cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME, __scopePopper);
|
|
15931
|
+
const baseSide = $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE[contentContext.placedSide];
|
|
15932
|
+
return(/*#__PURE__*/ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
15933
|
+
// doesn't report size as we'd expect on SVG elements.
|
|
15934
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
15935
|
+
React.createElement("span", {
|
|
15936
|
+
ref: contentContext.onArrowChange,
|
|
15937
|
+
style: {
|
|
15938
|
+
position: 'absolute',
|
|
15939
|
+
left: contentContext.arrowX,
|
|
15940
|
+
top: contentContext.arrowY,
|
|
15941
|
+
[baseSide]: 0,
|
|
15942
|
+
transformOrigin: {
|
|
15943
|
+
top: '',
|
|
15944
|
+
right: '0 0',
|
|
15945
|
+
bottom: 'center 0',
|
|
15946
|
+
left: '100% 0'
|
|
15947
|
+
}[contentContext.placedSide],
|
|
15948
|
+
transform: {
|
|
15949
|
+
top: 'translateY(100%)',
|
|
15950
|
+
right: 'translateY(50%) rotate(90deg) translateX(-50%)',
|
|
15951
|
+
bottom: `rotate(180deg)`,
|
|
15952
|
+
left: 'translateY(50%) rotate(-90deg) translateX(50%)'
|
|
15953
|
+
}[contentContext.placedSide],
|
|
15954
|
+
visibility: contentContext.shouldHideArrow ? 'hidden' : undefined
|
|
15955
|
+
}
|
|
15956
|
+
}, /*#__PURE__*/ React.createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9, _extends({}, arrowProps, {
|
|
15957
|
+
ref: forwardedRef,
|
|
15958
|
+
style: {
|
|
15959
|
+
...arrowProps.style,
|
|
15960
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
|
15961
|
+
display: 'block'
|
|
15962
|
+
}
|
|
15963
|
+
}))));
|
|
15964
|
+
});
|
|
15965
|
+
/* -----------------------------------------------------------------------------------------------*/ function $cf1ac5d9fe0e8206$var$isDefined(value) {
|
|
15966
|
+
return value !== undefined;
|
|
15967
|
+
}
|
|
15968
|
+
function $cf1ac5d9fe0e8206$var$isNotNull(value) {
|
|
15969
|
+
return value !== null;
|
|
15970
|
+
}
|
|
15971
|
+
const $cf1ac5d9fe0e8206$var$anchorCssProperties = ()=>({
|
|
15972
|
+
name: 'anchorCssProperties',
|
|
15973
|
+
fn (data) {
|
|
15974
|
+
const { rects: rects , elements: elements } = data;
|
|
15975
|
+
const { width: width , height: height } = rects.reference;
|
|
15976
|
+
elements.floating.style.setProperty('--radix-popper-anchor-width', `${width}px`);
|
|
15977
|
+
elements.floating.style.setProperty('--radix-popper-anchor-height', `${height}px`);
|
|
15978
|
+
return {};
|
|
15979
|
+
}
|
|
15980
|
+
})
|
|
15981
|
+
;
|
|
15982
|
+
const $cf1ac5d9fe0e8206$var$transformOrigin = (options)=>({
|
|
15983
|
+
name: 'transformOrigin',
|
|
15984
|
+
options: options,
|
|
15985
|
+
fn (data) {
|
|
15986
|
+
var _middlewareData$arrow4, _middlewareData$arrow5, _middlewareData$arrow6, _middlewareData$arrow7, _middlewareData$arrow8;
|
|
15987
|
+
const { placement: placement , rects: rects , middlewareData: middlewareData } = data;
|
|
15988
|
+
const cannotCenterArrow = ((_middlewareData$arrow4 = middlewareData.arrow) === null || _middlewareData$arrow4 === void 0 ? void 0 : _middlewareData$arrow4.centerOffset) !== 0;
|
|
15989
|
+
const isArrowHidden = cannotCenterArrow;
|
|
15990
|
+
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
15991
|
+
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
15992
|
+
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
15993
|
+
const noArrowAlign = {
|
|
15994
|
+
start: '0%',
|
|
15995
|
+
center: '50%',
|
|
15996
|
+
end: '100%'
|
|
15997
|
+
}[placedAlign];
|
|
15998
|
+
const arrowXCenter = ((_middlewareData$arrow5 = (_middlewareData$arrow6 = middlewareData.arrow) === null || _middlewareData$arrow6 === void 0 ? void 0 : _middlewareData$arrow6.x) !== null && _middlewareData$arrow5 !== void 0 ? _middlewareData$arrow5 : 0) + arrowWidth / 2;
|
|
15999
|
+
const arrowYCenter = ((_middlewareData$arrow7 = (_middlewareData$arrow8 = middlewareData.arrow) === null || _middlewareData$arrow8 === void 0 ? void 0 : _middlewareData$arrow8.y) !== null && _middlewareData$arrow7 !== void 0 ? _middlewareData$arrow7 : 0) + arrowHeight / 2;
|
|
16000
|
+
let x = '';
|
|
16001
|
+
let y = '';
|
|
16002
|
+
if (placedSide === 'bottom') {
|
|
16003
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
16004
|
+
y = `${-arrowHeight}px`;
|
|
16005
|
+
} else if (placedSide === 'top') {
|
|
16006
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
16007
|
+
y = `${rects.floating.height + arrowHeight}px`;
|
|
16008
|
+
} else if (placedSide === 'right') {
|
|
16009
|
+
x = `${-arrowHeight}px`;
|
|
16010
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
16011
|
+
} else if (placedSide === 'left') {
|
|
16012
|
+
x = `${rects.floating.width + arrowHeight}px`;
|
|
16013
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
16014
|
+
}
|
|
16015
|
+
return {
|
|
16016
|
+
data: {
|
|
16017
|
+
x: x,
|
|
16018
|
+
y: y
|
|
16019
|
+
}
|
|
16020
|
+
};
|
|
16021
|
+
}
|
|
16022
|
+
})
|
|
16023
|
+
;
|
|
16024
|
+
function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement) {
|
|
16025
|
+
const [side, align = 'center'] = placement.split('-');
|
|
16026
|
+
return [
|
|
16027
|
+
side,
|
|
16028
|
+
align
|
|
16029
|
+
];
|
|
16030
|
+
}
|
|
16031
|
+
const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9;
|
|
16032
|
+
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
|
|
16033
|
+
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
|
|
16034
|
+
const $cf1ac5d9fe0e8206$export$21b07c8f274aebd5 = $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0;
|
|
16035
|
+
|
|
16036
|
+
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
16037
|
+
var _globalThis$document;
|
|
16038
|
+
const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
|
|
16039
|
+
return container ? /*#__PURE__*/ ReactDOM.createPortal(/*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
|
16040
|
+
ref: forwardedRef
|
|
16041
|
+
})), container) : null;
|
|
16042
|
+
});
|
|
16043
|
+
|
|
16044
|
+
function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
|
|
16045
|
+
return React.useReducer((state, event)=>{
|
|
16046
|
+
const nextState = machine[state][event];
|
|
16047
|
+
return nextState !== null && nextState !== void 0 ? nextState : state;
|
|
16048
|
+
}, initialState);
|
|
16049
|
+
}
|
|
16050
|
+
|
|
16051
|
+
|
|
16052
|
+
const $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props)=>{
|
|
16053
|
+
const { present: present , children: children } = props;
|
|
16054
|
+
const presence = $921a889cee6df7e8$var$usePresence(present);
|
|
16055
|
+
const child = typeof children === 'function' ? children({
|
|
16056
|
+
present: presence.isPresent
|
|
16057
|
+
}) : React.Children.only(children);
|
|
16058
|
+
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
|
|
16059
|
+
const forceMount = typeof children === 'function';
|
|
16060
|
+
return forceMount || presence.isPresent ? /*#__PURE__*/ React.cloneElement(child, {
|
|
16061
|
+
ref: ref
|
|
16062
|
+
}) : null;
|
|
16063
|
+
};
|
|
16064
|
+
$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
|
|
16065
|
+
/* -------------------------------------------------------------------------------------------------
|
|
16066
|
+
* usePresence
|
|
16067
|
+
* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence(present) {
|
|
16068
|
+
const [node1, setNode] = React.useState();
|
|
16069
|
+
const stylesRef = React.useRef({});
|
|
16070
|
+
const prevPresentRef = React.useRef(present);
|
|
16071
|
+
const prevAnimationNameRef = React.useRef('none');
|
|
16072
|
+
const initialState = present ? 'mounted' : 'unmounted';
|
|
16073
|
+
const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
|
|
16074
|
+
mounted: {
|
|
16075
|
+
UNMOUNT: 'unmounted',
|
|
16076
|
+
ANIMATION_OUT: 'unmountSuspended'
|
|
16077
|
+
},
|
|
16078
|
+
unmountSuspended: {
|
|
16079
|
+
MOUNT: 'mounted',
|
|
16080
|
+
ANIMATION_END: 'unmounted'
|
|
16081
|
+
},
|
|
16082
|
+
unmounted: {
|
|
16083
|
+
MOUNT: 'mounted'
|
|
16084
|
+
}
|
|
16085
|
+
});
|
|
16086
|
+
React.useEffect(()=>{
|
|
16087
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
16088
|
+
prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';
|
|
16089
|
+
}, [
|
|
16090
|
+
state
|
|
16091
|
+
]);
|
|
16092
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
16093
|
+
const styles = stylesRef.current;
|
|
16094
|
+
const wasPresent = prevPresentRef.current;
|
|
16095
|
+
const hasPresentChanged = wasPresent !== present;
|
|
16096
|
+
if (hasPresentChanged) {
|
|
16097
|
+
const prevAnimationName = prevAnimationNameRef.current;
|
|
16098
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
|
|
16099
|
+
if (present) send('MOUNT');
|
|
16100
|
+
else if (currentAnimationName === 'none' || (styles === null || styles === void 0 ? void 0 : styles.display) === 'none') // If there is no exit animation or the element is hidden, animations won't run
|
|
16101
|
+
// so we unmount instantly
|
|
16102
|
+
send('UNMOUNT');
|
|
16103
|
+
else {
|
|
16104
|
+
/**
|
|
16105
|
+
* When `present` changes to `false`, we check changes to animation-name to
|
|
16106
|
+
* determine whether an animation has started. We chose this approach (reading
|
|
16107
|
+
* computed styles) because there is no `animationrun` event and `animationstart`
|
|
16108
|
+
* fires after `animation-delay` has expired which would be too late.
|
|
16109
|
+
*/ const isAnimating = prevAnimationName !== currentAnimationName;
|
|
16110
|
+
if (wasPresent && isAnimating) send('ANIMATION_OUT');
|
|
16111
|
+
else send('UNMOUNT');
|
|
16112
|
+
}
|
|
16113
|
+
prevPresentRef.current = present;
|
|
16114
|
+
}
|
|
16115
|
+
}, [
|
|
16116
|
+
present,
|
|
16117
|
+
send
|
|
16118
|
+
]);
|
|
16119
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
16120
|
+
if (node1) {
|
|
16121
|
+
/**
|
|
16122
|
+
* Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`
|
|
16123
|
+
* event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we
|
|
16124
|
+
* make sure we only trigger ANIMATION_END for the currently active animation.
|
|
16125
|
+
*/ const handleAnimationEnd = (event)=>{
|
|
16126
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
16127
|
+
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
16128
|
+
if (event.target === node1 && isCurrentAnimation) // With React 18 concurrency this update is applied
|
|
16129
|
+
// a frame after the animation ends, creating a flash of visible content.
|
|
16130
|
+
// By manually flushing we ensure they sync within a frame, removing the flash.
|
|
16131
|
+
ReactDOM.flushSync(()=>send('ANIMATION_END')
|
|
16132
|
+
);
|
|
16133
|
+
};
|
|
16134
|
+
const handleAnimationStart = (event)=>{
|
|
16135
|
+
if (event.target === node1) // if animation occurred, store its name as the previous animation.
|
|
16136
|
+
prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
16137
|
+
};
|
|
16138
|
+
node1.addEventListener('animationstart', handleAnimationStart);
|
|
16139
|
+
node1.addEventListener('animationcancel', handleAnimationEnd);
|
|
16140
|
+
node1.addEventListener('animationend', handleAnimationEnd);
|
|
16141
|
+
return ()=>{
|
|
16142
|
+
node1.removeEventListener('animationstart', handleAnimationStart);
|
|
16143
|
+
node1.removeEventListener('animationcancel', handleAnimationEnd);
|
|
16144
|
+
node1.removeEventListener('animationend', handleAnimationEnd);
|
|
16145
|
+
};
|
|
16146
|
+
} else // Transition to the unmounted state if the node is removed prematurely.
|
|
16147
|
+
// We avoid doing so during cleanup as the node may change but still exist.
|
|
16148
|
+
send('ANIMATION_END');
|
|
16149
|
+
}, [
|
|
16150
|
+
node1,
|
|
16151
|
+
send
|
|
16152
|
+
]);
|
|
16153
|
+
return {
|
|
16154
|
+
isPresent: [
|
|
16155
|
+
'mounted',
|
|
16156
|
+
'unmountSuspended'
|
|
16157
|
+
].includes(state),
|
|
16158
|
+
ref: React.useCallback((node)=>{
|
|
16159
|
+
if (node) stylesRef.current = getComputedStyle(node);
|
|
16160
|
+
setNode(node);
|
|
16161
|
+
}, [])
|
|
16162
|
+
};
|
|
16163
|
+
}
|
|
16164
|
+
/* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName(styles) {
|
|
16165
|
+
return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none';
|
|
16166
|
+
}
|
|
16167
|
+
|
|
16168
|
+
/**
|
|
16169
|
+
* Listens for when the escape key is down
|
|
16170
|
+
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
16171
|
+
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
16172
|
+
React.useEffect(()=>{
|
|
16173
|
+
const handleKeyDown = (event)=>{
|
|
16174
|
+
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
16175
|
+
};
|
|
16176
|
+
ownerDocument.addEventListener('keydown', handleKeyDown);
|
|
16177
|
+
return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
|
|
16178
|
+
;
|
|
16179
|
+
}, [
|
|
16180
|
+
onEscapeKeyDown,
|
|
16181
|
+
ownerDocument
|
|
16182
|
+
]);
|
|
16183
|
+
}
|
|
16184
|
+
|
|
16185
|
+
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
16186
|
+
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
16187
|
+
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
16188
|
+
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
16189
|
+
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ React.createContext({
|
|
16190
|
+
layers: new Set(),
|
|
16191
|
+
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
16192
|
+
branches: new Set()
|
|
16193
|
+
});
|
|
16194
|
+
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
16195
|
+
var _node$ownerDocument;
|
|
16196
|
+
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
16197
|
+
const context = React.useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
16198
|
+
const [node1, setNode] = React.useState(null);
|
|
16199
|
+
const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
|
|
16200
|
+
const [, force] = React.useState({});
|
|
16201
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
16202
|
+
);
|
|
16203
|
+
const layers = Array.from(context.layers);
|
|
16204
|
+
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
16205
|
+
...context.layersWithOutsidePointerEventsDisabled
|
|
16206
|
+
].slice(-1); // prettier-ignore
|
|
16207
|
+
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
|
|
16208
|
+
const index = node1 ? layers.indexOf(node1) : -1;
|
|
16209
|
+
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
16210
|
+
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
16211
|
+
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
16212
|
+
const target = event.target;
|
|
16213
|
+
const isPointerDownOnBranch = [
|
|
16214
|
+
...context.branches
|
|
16215
|
+
].some((branch)=>branch.contains(target)
|
|
16216
|
+
);
|
|
16217
|
+
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
16218
|
+
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
|
|
16219
|
+
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
16220
|
+
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
16221
|
+
}, ownerDocument);
|
|
16222
|
+
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
|
|
16223
|
+
const target = event.target;
|
|
16224
|
+
const isFocusInBranch = [
|
|
16225
|
+
...context.branches
|
|
16226
|
+
].some((branch)=>branch.contains(target)
|
|
16227
|
+
);
|
|
16228
|
+
if (isFocusInBranch) return;
|
|
16229
|
+
onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
|
|
16230
|
+
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
16231
|
+
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
16232
|
+
}, ownerDocument);
|
|
16233
|
+
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
16234
|
+
const isHighestLayer = index === context.layers.size - 1;
|
|
16235
|
+
if (!isHighestLayer) return;
|
|
16236
|
+
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
16237
|
+
if (!event.defaultPrevented && onDismiss) {
|
|
16238
|
+
event.preventDefault();
|
|
16239
|
+
onDismiss();
|
|
16240
|
+
}
|
|
16241
|
+
}, ownerDocument);
|
|
16242
|
+
React.useEffect(()=>{
|
|
16243
|
+
if (!node1) return;
|
|
16244
|
+
if (disableOutsidePointerEvents) {
|
|
16245
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
16246
|
+
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
16247
|
+
ownerDocument.body.style.pointerEvents = 'none';
|
|
16248
|
+
}
|
|
16249
|
+
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
16250
|
+
}
|
|
16251
|
+
context.layers.add(node1);
|
|
16252
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
16253
|
+
return ()=>{
|
|
16254
|
+
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
16255
|
+
};
|
|
16256
|
+
}, [
|
|
16257
|
+
node1,
|
|
16258
|
+
ownerDocument,
|
|
16259
|
+
disableOutsidePointerEvents,
|
|
16260
|
+
context
|
|
16261
|
+
]);
|
|
16262
|
+
/**
|
|
16263
|
+
* We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
|
|
16264
|
+
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
|
|
16265
|
+
* and add it to the end again so the layering order wouldn't be _creation order_.
|
|
16266
|
+
* We only want them to be removed from context stacks when unmounted.
|
|
16267
|
+
*/ React.useEffect(()=>{
|
|
16268
|
+
return ()=>{
|
|
16269
|
+
if (!node1) return;
|
|
16270
|
+
context.layers.delete(node1);
|
|
16271
|
+
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
16272
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
16273
|
+
};
|
|
16274
|
+
}, [
|
|
16275
|
+
node1,
|
|
16276
|
+
context
|
|
16277
|
+
]);
|
|
16278
|
+
React.useEffect(()=>{
|
|
16279
|
+
const handleUpdate = ()=>force({})
|
|
16280
|
+
;
|
|
16281
|
+
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
16282
|
+
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
16283
|
+
;
|
|
16284
|
+
}, []);
|
|
16285
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
|
|
16286
|
+
ref: composedRefs,
|
|
16287
|
+
style: {
|
|
16288
|
+
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
16289
|
+
...props.style
|
|
16290
|
+
},
|
|
16291
|
+
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
16292
|
+
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
16293
|
+
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
16294
|
+
}));
|
|
16295
|
+
});
|
|
16296
|
+
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
16297
|
+
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
16298
|
+
* to mimic layer dismissing behaviour present in OS.
|
|
16299
|
+
* Returns props to pass to the node we want to check for outside events.
|
|
16300
|
+
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
16301
|
+
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
16302
|
+
const isPointerInsideReactTreeRef = React.useRef(false);
|
|
16303
|
+
const handleClickRef = React.useRef(()=>{});
|
|
16304
|
+
React.useEffect(()=>{
|
|
16305
|
+
const handlePointerDown = (event)=>{
|
|
16306
|
+
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
16307
|
+
const eventDetail = {
|
|
16308
|
+
originalEvent: event
|
|
16309
|
+
};
|
|
16310
|
+
function handleAndDispatchPointerDownOutsideEvent() {
|
|
16311
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
16312
|
+
discrete: true
|
|
16313
|
+
});
|
|
16314
|
+
}
|
|
16315
|
+
/**
|
|
16316
|
+
* On touch devices, we need to wait for a click event because browsers implement
|
|
16317
|
+
* a ~350ms delay between the time the user stops touching the display and when the
|
|
16318
|
+
* browser executres events. We need to ensure we don't reactivate pointer-events within
|
|
16319
|
+
* this timeframe otherwise the browser may execute events that should have been prevented.
|
|
16320
|
+
*
|
|
16321
|
+
* Additionally, this also lets us deal automatically with cancellations when a click event
|
|
16322
|
+
* isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
|
|
16323
|
+
*
|
|
16324
|
+
* This is why we also continuously remove the previous listener, because we cannot be
|
|
16325
|
+
* certain that it was raised, and therefore cleaned-up.
|
|
16326
|
+
*/ if (event.pointerType === 'touch') {
|
|
16327
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
16328
|
+
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
|
|
16329
|
+
ownerDocument.addEventListener('click', handleClickRef.current, {
|
|
16330
|
+
once: true
|
|
16331
|
+
});
|
|
16332
|
+
} else handleAndDispatchPointerDownOutsideEvent();
|
|
16333
|
+
}
|
|
16334
|
+
isPointerInsideReactTreeRef.current = false;
|
|
16335
|
+
};
|
|
16336
|
+
/**
|
|
16337
|
+
* if this hook executes in a component that mounts via a `pointerdown` event, the event
|
|
16338
|
+
* would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
|
|
16339
|
+
* this by delaying the event listener registration on the document.
|
|
16340
|
+
* This is not React specific, but rather how the DOM works, ie:
|
|
16341
|
+
* ```
|
|
16342
|
+
* button.addEventListener('pointerdown', () => {
|
|
16343
|
+
* console.log('I will log');
|
|
16344
|
+
* document.addEventListener('pointerdown', () => {
|
|
16345
|
+
* console.log('I will also log');
|
|
16346
|
+
* })
|
|
16347
|
+
* });
|
|
16348
|
+
*/ const timerId = window.setTimeout(()=>{
|
|
16349
|
+
ownerDocument.addEventListener('pointerdown', handlePointerDown);
|
|
16350
|
+
}, 0);
|
|
16351
|
+
return ()=>{
|
|
16352
|
+
window.clearTimeout(timerId);
|
|
16353
|
+
ownerDocument.removeEventListener('pointerdown', handlePointerDown);
|
|
16354
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
16355
|
+
};
|
|
16356
|
+
}, [
|
|
16357
|
+
ownerDocument,
|
|
16358
|
+
handlePointerDownOutside
|
|
16359
|
+
]);
|
|
16360
|
+
return {
|
|
16361
|
+
// ensures we check React component tree (not just DOM tree)
|
|
16362
|
+
onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
|
|
16363
|
+
};
|
|
16364
|
+
}
|
|
16365
|
+
/**
|
|
16366
|
+
* Listens for when focus happens outside a react subtree.
|
|
16367
|
+
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
16368
|
+
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
16369
|
+
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
16370
|
+
const isFocusInsideReactTreeRef = React.useRef(false);
|
|
16371
|
+
React.useEffect(()=>{
|
|
16372
|
+
const handleFocus = (event)=>{
|
|
16373
|
+
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
16374
|
+
const eventDetail = {
|
|
16375
|
+
originalEvent: event
|
|
16376
|
+
};
|
|
16377
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
16378
|
+
discrete: false
|
|
16379
|
+
});
|
|
16380
|
+
}
|
|
16381
|
+
};
|
|
16382
|
+
ownerDocument.addEventListener('focusin', handleFocus);
|
|
16383
|
+
return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
|
|
16384
|
+
;
|
|
16385
|
+
}, [
|
|
16386
|
+
ownerDocument,
|
|
16387
|
+
handleFocusOutside
|
|
16388
|
+
]);
|
|
16389
|
+
return {
|
|
16390
|
+
onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
|
|
16391
|
+
,
|
|
16392
|
+
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
|
|
16393
|
+
};
|
|
16394
|
+
}
|
|
16395
|
+
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
16396
|
+
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
16397
|
+
document.dispatchEvent(event);
|
|
16398
|
+
}
|
|
16399
|
+
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
16400
|
+
const target = detail.originalEvent.target;
|
|
16401
|
+
const event = new CustomEvent(name, {
|
|
16402
|
+
bubbles: false,
|
|
16403
|
+
cancelable: true,
|
|
16404
|
+
detail: detail
|
|
16405
|
+
});
|
|
16406
|
+
if (handler) target.addEventListener(name, handler, {
|
|
16407
|
+
once: true
|
|
16408
|
+
});
|
|
16409
|
+
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
16410
|
+
else target.dispatchEvent(event);
|
|
16411
|
+
}
|
|
16412
|
+
|
|
16413
|
+
/* -------------------------------------------------------------------------------------------------
|
|
16414
|
+
* HoverCard
|
|
16415
|
+
* -----------------------------------------------------------------------------------------------*/ let $cef8881cdc69808e$var$originalBodyUserSelect;
|
|
16416
|
+
const $cef8881cdc69808e$var$HOVERCARD_NAME = 'HoverCard';
|
|
16417
|
+
const [$cef8881cdc69808e$var$createHoverCardContext, $cef8881cdc69808e$export$47b6998a836b7260] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cef8881cdc69808e$var$HOVERCARD_NAME, [
|
|
16418
|
+
$cf1ac5d9fe0e8206$export$722aac194ae923
|
|
16419
|
+
]);
|
|
16420
|
+
const $cef8881cdc69808e$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923();
|
|
16421
|
+
const [$cef8881cdc69808e$var$HoverCardProvider, $cef8881cdc69808e$var$useHoverCardContext] = $cef8881cdc69808e$var$createHoverCardContext($cef8881cdc69808e$var$HOVERCARD_NAME);
|
|
16422
|
+
const $cef8881cdc69808e$export$57a077cc9fbe653e = (props)=>{
|
|
16423
|
+
const { __scopeHoverCard: __scopeHoverCard , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , openDelay: openDelay = 700 , closeDelay: closeDelay = 300 } = props;
|
|
16424
|
+
const popperScope = $cef8881cdc69808e$var$usePopperScope(__scopeHoverCard);
|
|
16425
|
+
const openTimerRef = React.useRef(0);
|
|
16426
|
+
const closeTimerRef = React.useRef(0);
|
|
16427
|
+
const hasSelectionRef = React.useRef(false);
|
|
16428
|
+
const isPointerDownOnContentRef = React.useRef(false);
|
|
16429
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
16430
|
+
prop: openProp,
|
|
16431
|
+
defaultProp: defaultOpen,
|
|
16432
|
+
onChange: onOpenChange
|
|
16433
|
+
});
|
|
16434
|
+
const handleOpen = React.useCallback(()=>{
|
|
16435
|
+
clearTimeout(closeTimerRef.current);
|
|
16436
|
+
openTimerRef.current = window.setTimeout(()=>setOpen(true)
|
|
16437
|
+
, openDelay);
|
|
16438
|
+
}, [
|
|
16439
|
+
openDelay,
|
|
16440
|
+
setOpen
|
|
16441
|
+
]);
|
|
16442
|
+
const handleClose = React.useCallback(()=>{
|
|
16443
|
+
clearTimeout(openTimerRef.current);
|
|
16444
|
+
if (!hasSelectionRef.current && !isPointerDownOnContentRef.current) closeTimerRef.current = window.setTimeout(()=>setOpen(false)
|
|
16445
|
+
, closeDelay);
|
|
16446
|
+
}, [
|
|
16447
|
+
closeDelay,
|
|
16448
|
+
setOpen
|
|
16449
|
+
]);
|
|
16450
|
+
const handleDismiss = React.useCallback(()=>setOpen(false)
|
|
16451
|
+
, [
|
|
16452
|
+
setOpen
|
|
16453
|
+
]); // cleanup any queued state updates on unmount
|
|
16454
|
+
React.useEffect(()=>{
|
|
16455
|
+
return ()=>{
|
|
16456
|
+
clearTimeout(openTimerRef.current);
|
|
16457
|
+
clearTimeout(closeTimerRef.current);
|
|
16458
|
+
};
|
|
16459
|
+
}, []);
|
|
16460
|
+
return /*#__PURE__*/ React.createElement($cef8881cdc69808e$var$HoverCardProvider, {
|
|
16461
|
+
scope: __scopeHoverCard,
|
|
16462
|
+
open: open,
|
|
16463
|
+
onOpenChange: setOpen,
|
|
16464
|
+
onOpen: handleOpen,
|
|
16465
|
+
onClose: handleClose,
|
|
16466
|
+
onDismiss: handleDismiss,
|
|
16467
|
+
hasSelectionRef: hasSelectionRef,
|
|
16468
|
+
isPointerDownOnContentRef: isPointerDownOnContentRef
|
|
16469
|
+
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, children));
|
|
16470
|
+
};
|
|
16471
|
+
/* -------------------------------------------------------------------------------------------------
|
|
16472
|
+
* HoverCardTrigger
|
|
16473
|
+
* -----------------------------------------------------------------------------------------------*/ const $cef8881cdc69808e$var$TRIGGER_NAME = 'HoverCardTrigger';
|
|
16474
|
+
const $cef8881cdc69808e$export$ef9f7fd8e4ba882f = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
16475
|
+
const { __scopeHoverCard: __scopeHoverCard , ...triggerProps } = props;
|
|
16476
|
+
const context = $cef8881cdc69808e$var$useHoverCardContext($cef8881cdc69808e$var$TRIGGER_NAME, __scopeHoverCard);
|
|
16477
|
+
const popperScope = $cef8881cdc69808e$var$usePopperScope(__scopeHoverCard);
|
|
16478
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({
|
|
16479
|
+
asChild: true
|
|
16480
|
+
}, popperScope), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.a, _extends({
|
|
16481
|
+
"data-state": context.open ? 'open' : 'closed'
|
|
16482
|
+
}, triggerProps, {
|
|
16483
|
+
ref: forwardedRef,
|
|
16484
|
+
onPointerEnter: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerEnter, $cef8881cdc69808e$var$excludeTouch(context.onOpen)),
|
|
16485
|
+
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerLeave, $cef8881cdc69808e$var$excludeTouch(context.onClose)),
|
|
16486
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, context.onOpen),
|
|
16487
|
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, context.onClose) // prevent focus event on touch devices
|
|
16488
|
+
,
|
|
16489
|
+
onTouchStart: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onTouchStart, (event)=>event.preventDefault()
|
|
16490
|
+
)
|
|
16491
|
+
})));
|
|
16492
|
+
});
|
|
16493
|
+
/* -------------------------------------------------------------------------------------------------
|
|
16494
|
+
* HoverCardPortal
|
|
16495
|
+
* -----------------------------------------------------------------------------------------------*/ const $cef8881cdc69808e$var$PORTAL_NAME = 'HoverCardPortal';
|
|
16496
|
+
const [$cef8881cdc69808e$var$PortalProvider, $cef8881cdc69808e$var$usePortalContext] = $cef8881cdc69808e$var$createHoverCardContext($cef8881cdc69808e$var$PORTAL_NAME, {
|
|
16497
|
+
forceMount: undefined
|
|
16498
|
+
});
|
|
16499
|
+
const $cef8881cdc69808e$export$b384c6e0a789f88b = (props)=>{
|
|
16500
|
+
const { __scopeHoverCard: __scopeHoverCard , forceMount: forceMount , children: children , container: container } = props;
|
|
16501
|
+
const context = $cef8881cdc69808e$var$useHoverCardContext($cef8881cdc69808e$var$PORTAL_NAME, __scopeHoverCard);
|
|
16502
|
+
return /*#__PURE__*/ React.createElement($cef8881cdc69808e$var$PortalProvider, {
|
|
16503
|
+
scope: __scopeHoverCard,
|
|
16504
|
+
forceMount: forceMount
|
|
16505
|
+
}, /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
16506
|
+
present: forceMount || context.open
|
|
16507
|
+
}, /*#__PURE__*/ React.createElement($f1701beae083dbae$export$602eac185826482c, {
|
|
16508
|
+
asChild: true,
|
|
16509
|
+
container: container
|
|
16510
|
+
}, children)));
|
|
16511
|
+
};
|
|
16512
|
+
/* -------------------------------------------------------------------------------------------------
|
|
16513
|
+
* HoverCardContent
|
|
16514
|
+
* -----------------------------------------------------------------------------------------------*/ const $cef8881cdc69808e$var$CONTENT_NAME = 'HoverCardContent';
|
|
16515
|
+
const $cef8881cdc69808e$export$aa4724a5938c586 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
16516
|
+
const portalContext = $cef8881cdc69808e$var$usePortalContext($cef8881cdc69808e$var$CONTENT_NAME, props.__scopeHoverCard);
|
|
16517
|
+
const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
|
|
16518
|
+
const context = $cef8881cdc69808e$var$useHoverCardContext($cef8881cdc69808e$var$CONTENT_NAME, props.__scopeHoverCard);
|
|
16519
|
+
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
16520
|
+
present: forceMount || context.open
|
|
16521
|
+
}, /*#__PURE__*/ React.createElement($cef8881cdc69808e$var$HoverCardContentImpl, _extends({
|
|
16522
|
+
"data-state": context.open ? 'open' : 'closed'
|
|
16523
|
+
}, contentProps, {
|
|
16524
|
+
onPointerEnter: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerEnter, $cef8881cdc69808e$var$excludeTouch(context.onOpen)),
|
|
16525
|
+
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerLeave, $cef8881cdc69808e$var$excludeTouch(context.onClose)),
|
|
16526
|
+
ref: forwardedRef
|
|
16527
|
+
})));
|
|
16528
|
+
});
|
|
16529
|
+
/* ---------------------------------------------------------------------------------------------- */ const $cef8881cdc69808e$var$HoverCardContentImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
16530
|
+
const { __scopeHoverCard: __scopeHoverCard , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , ...contentProps } = props;
|
|
16531
|
+
const context = $cef8881cdc69808e$var$useHoverCardContext($cef8881cdc69808e$var$CONTENT_NAME, __scopeHoverCard);
|
|
16532
|
+
const popperScope = $cef8881cdc69808e$var$usePopperScope(__scopeHoverCard);
|
|
16533
|
+
const ref = React.useRef(null);
|
|
16534
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
16535
|
+
const [containSelection, setContainSelection] = React.useState(false);
|
|
16536
|
+
React.useEffect(()=>{
|
|
16537
|
+
if (containSelection) {
|
|
16538
|
+
const body = document.body; // Safari requires prefix
|
|
16539
|
+
$cef8881cdc69808e$var$originalBodyUserSelect = body.style.userSelect || body.style.webkitUserSelect;
|
|
16540
|
+
body.style.userSelect = 'none';
|
|
16541
|
+
body.style.webkitUserSelect = 'none';
|
|
16542
|
+
return ()=>{
|
|
16543
|
+
body.style.userSelect = $cef8881cdc69808e$var$originalBodyUserSelect;
|
|
16544
|
+
body.style.webkitUserSelect = $cef8881cdc69808e$var$originalBodyUserSelect;
|
|
16545
|
+
};
|
|
16546
|
+
}
|
|
16547
|
+
}, [
|
|
16548
|
+
containSelection
|
|
16549
|
+
]);
|
|
16550
|
+
React.useEffect(()=>{
|
|
16551
|
+
if (ref.current) {
|
|
16552
|
+
const handlePointerUp = ()=>{
|
|
16553
|
+
setContainSelection(false);
|
|
16554
|
+
context.isPointerDownOnContentRef.current = false; // Delay a frame to ensure we always access the latest selection
|
|
16555
|
+
setTimeout(()=>{
|
|
16556
|
+
var _document$getSelectio;
|
|
16557
|
+
const hasSelection = ((_document$getSelectio = document.getSelection()) === null || _document$getSelectio === void 0 ? void 0 : _document$getSelectio.toString()) !== '';
|
|
16558
|
+
if (hasSelection) context.hasSelectionRef.current = true;
|
|
16559
|
+
});
|
|
16560
|
+
};
|
|
16561
|
+
document.addEventListener('pointerup', handlePointerUp);
|
|
16562
|
+
return ()=>{
|
|
16563
|
+
document.removeEventListener('pointerup', handlePointerUp);
|
|
16564
|
+
context.hasSelectionRef.current = false;
|
|
16565
|
+
context.isPointerDownOnContentRef.current = false;
|
|
16566
|
+
};
|
|
16567
|
+
}
|
|
16568
|
+
}, [
|
|
16569
|
+
context.isPointerDownOnContentRef,
|
|
16570
|
+
context.hasSelectionRef
|
|
16571
|
+
]);
|
|
16572
|
+
React.useEffect(()=>{
|
|
16573
|
+
if (ref.current) {
|
|
16574
|
+
const tabbables = $cef8881cdc69808e$var$getTabbableNodes(ref.current);
|
|
16575
|
+
tabbables.forEach((tabbable)=>tabbable.setAttribute('tabindex', '-1')
|
|
16576
|
+
);
|
|
16577
|
+
}
|
|
16578
|
+
});
|
|
16579
|
+
return /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, {
|
|
16580
|
+
asChild: true,
|
|
16581
|
+
disableOutsidePointerEvents: false,
|
|
16582
|
+
onInteractOutside: onInteractOutside,
|
|
16583
|
+
onEscapeKeyDown: onEscapeKeyDown,
|
|
16584
|
+
onPointerDownOutside: onPointerDownOutside,
|
|
16585
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onFocusOutside, (event)=>{
|
|
16586
|
+
event.preventDefault();
|
|
16587
|
+
}),
|
|
16588
|
+
onDismiss: context.onDismiss
|
|
16589
|
+
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({}, popperScope, contentProps, {
|
|
16590
|
+
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onPointerDown, (event)=>{
|
|
16591
|
+
// Contain selection to current layer
|
|
16592
|
+
if (event.currentTarget.contains(event.target)) setContainSelection(true);
|
|
16593
|
+
context.hasSelectionRef.current = false;
|
|
16594
|
+
context.isPointerDownOnContentRef.current = true;
|
|
16595
|
+
}),
|
|
16596
|
+
ref: composedRefs,
|
|
16597
|
+
style: {
|
|
16598
|
+
...contentProps.style,
|
|
16599
|
+
userSelect: containSelection ? 'text' : undefined,
|
|
16600
|
+
// Safari requires prefix
|
|
16601
|
+
WebkitUserSelect: containSelection ? 'text' : undefined,
|
|
16602
|
+
'--radix-hover-card-content-transform-origin': 'var(--radix-popper-transform-origin)',
|
|
16603
|
+
'--radix-hover-card-content-available-width': 'var(--radix-popper-available-width)',
|
|
16604
|
+
'--radix-hover-card-content-available-height': 'var(--radix-popper-available-height)',
|
|
16605
|
+
'--radix-hover-card-trigger-width': 'var(--radix-popper-anchor-width)',
|
|
16606
|
+
'--radix-hover-card-trigger-height': 'var(--radix-popper-anchor-height)'
|
|
16607
|
+
}
|
|
16608
|
+
})));
|
|
16609
|
+
});
|
|
16610
|
+
const $cef8881cdc69808e$export$b9744d3e7456d806 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
16611
|
+
const { __scopeHoverCard: __scopeHoverCard , ...arrowProps } = props;
|
|
16612
|
+
const popperScope = $cef8881cdc69808e$var$usePopperScope(__scopeHoverCard);
|
|
16613
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5, _extends({}, popperScope, arrowProps, {
|
|
16614
|
+
ref: forwardedRef
|
|
16615
|
+
}));
|
|
16616
|
+
});
|
|
16617
|
+
/* -----------------------------------------------------------------------------------------------*/ function $cef8881cdc69808e$var$excludeTouch(eventHandler) {
|
|
16618
|
+
return (event)=>event.pointerType === 'touch' ? undefined : eventHandler()
|
|
16619
|
+
;
|
|
16620
|
+
}
|
|
16621
|
+
/**
|
|
16622
|
+
* Returns a list of nodes that can be in the tab sequence.
|
|
16623
|
+
* @see: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
|
|
16624
|
+
*/ function $cef8881cdc69808e$var$getTabbableNodes(container) {
|
|
16625
|
+
const nodes = [];
|
|
16626
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
16627
|
+
acceptNode: (node)=>{
|
|
16628
|
+
// `.tabIndex` is not the same as the `tabindex` attribute. It works on the
|
|
16629
|
+
// runtime's understanding of tabbability, so this automatically accounts
|
|
16630
|
+
// for any kind of element that could be tabbed to.
|
|
16631
|
+
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
16632
|
+
}
|
|
16633
|
+
});
|
|
16634
|
+
while(walker.nextNode())nodes.push(walker.currentNode);
|
|
16635
|
+
return nodes;
|
|
16636
|
+
}
|
|
16637
|
+
const $cef8881cdc69808e$export$be92b6f5f03c0fe9 = $cef8881cdc69808e$export$57a077cc9fbe653e;
|
|
16638
|
+
const $cef8881cdc69808e$export$41fb9f06171c75f4 = $cef8881cdc69808e$export$ef9f7fd8e4ba882f;
|
|
16639
|
+
const $cef8881cdc69808e$export$602eac185826482c = $cef8881cdc69808e$export$b384c6e0a789f88b;
|
|
16640
|
+
const $cef8881cdc69808e$export$7c6e2c02157bb7d2 = $cef8881cdc69808e$export$aa4724a5938c586;
|
|
16641
|
+
const $cef8881cdc69808e$export$21b07c8f274aebd5 = $cef8881cdc69808e$export$b9744d3e7456d806;
|
|
16642
|
+
|
|
16643
|
+
var HoverPrimitive = /*#__PURE__*/Object.freeze({
|
|
16644
|
+
__proto__: null,
|
|
16645
|
+
Arrow: $cef8881cdc69808e$export$21b07c8f274aebd5,
|
|
16646
|
+
Content: $cef8881cdc69808e$export$7c6e2c02157bb7d2,
|
|
16647
|
+
HoverCard: $cef8881cdc69808e$export$57a077cc9fbe653e,
|
|
16648
|
+
HoverCardArrow: $cef8881cdc69808e$export$b9744d3e7456d806,
|
|
16649
|
+
HoverCardContent: $cef8881cdc69808e$export$aa4724a5938c586,
|
|
16650
|
+
HoverCardPortal: $cef8881cdc69808e$export$b384c6e0a789f88b,
|
|
16651
|
+
HoverCardTrigger: $cef8881cdc69808e$export$ef9f7fd8e4ba882f,
|
|
16652
|
+
Portal: $cef8881cdc69808e$export$602eac185826482c,
|
|
16653
|
+
Root: $cef8881cdc69808e$export$be92b6f5f03c0fe9,
|
|
16654
|
+
Trigger: $cef8881cdc69808e$export$41fb9f06171c75f4,
|
|
16655
|
+
createHoverCardScope: $cef8881cdc69808e$export$47b6998a836b7260
|
|
16656
|
+
});
|
|
16657
|
+
|
|
16658
|
+
const bgStyles$1 = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
16659
|
+
const borderStyles$1 = [
|
|
16660
|
+
'tw-border-solid',
|
|
16661
|
+
'tw-border',
|
|
16662
|
+
'tw-rounded-sm',
|
|
16663
|
+
'tw-border-sq-disabled-gray',
|
|
16664
|
+
'dark:tw-border-gray-500',
|
|
16665
|
+
].join(' ');
|
|
16666
|
+
const disabledClasses$1 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
16667
|
+
const ButtonWithPopover = ({ children, trigger, id, hasArrow, extraTriggerClassNames, extraPopoverClassNames, containerTestId, disabled = false, align = 'end', alignOffset = -35, placement = 'bottom', placementOffset = 5, onOpenChange, isOpen, isCloseOnContentClick = false, setFocusOnTriggerOnClose = true, isHoverEnabled = false, ...tooltipProps }) => {
|
|
16668
|
+
const tooltipData = getQTipData(tooltipProps);
|
|
16669
|
+
const Primitive = isHoverEnabled ? HoverPrimitive : PopoverPrimitive;
|
|
16670
|
+
return (React__namespace.createElement(Primitive.Root, { open: isOpen, defaultOpen: false, onOpenChange: onOpenChange, openDelay: isHoverEnabled ? 300 : undefined, closeDelay: isHoverEnabled ? 200 : undefined },
|
|
16671
|
+
React__namespace.createElement(Primitive.Trigger, { id: id, className: `tw-border-none`, disabled: disabled },
|
|
16672
|
+
React__namespace.createElement("div", { ...tooltipData, className: `tw-bg-transparent tw-flex tw-flex-col tw-items-center tw-justify-center ${disabled ? disabledClasses$1 : ''} ${extraTriggerClassNames || ''}` }, trigger)),
|
|
16673
|
+
React__namespace.createElement(Primitive.Content, { sideOffset: placementOffset, align: align, side: placement, alignOffset: alignOffset, onCloseAutoFocus: (e) => !setFocusOnTriggerOnClose && e.preventDefault(), asChild: true, onClick: () => isCloseOnContentClick && onOpenChange && onOpenChange(false), className: "focus-visible:tw-outline-none tw-outline-none" },
|
|
16674
|
+
React__namespace.createElement("div", { "data-testid": containerTestId, className: `${bgStyles$1} ${borderStyles$1} tw-relative tw-z-[1000] tw-min-w-6 focus-visible:tw-outline-none tw-outline-none data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out
|
|
16675
|
+
data-[side=top]:tw-animate-slideDownAndFade data-[side=right]:tw-animate-slideLeftAndFade data-[side=bottom]:tw-animate-slideUpAndFade data-[side=left]:tw-animate-slideRightAndFade tw-text-sq-text-color
|
|
16676
|
+
${extraPopoverClassNames || ''}` },
|
|
16677
|
+
hasArrow && (React__namespace.createElement(Primitive.Arrow, { asChild: true },
|
|
16678
|
+
React__namespace.createElement("div", { className: " tw-fill-transparent tw-bg-white tw-w-[15px] tw-h-[15px] tw-mt-[-7px] tw-rotate-45 dark:tw-bg-sq-dark-background tw-border-b tw-border-r tw-border-sq-disabled-gray dark:tw-border-gray-500" }))),
|
|
16679
|
+
children))));
|
|
16680
|
+
};
|
|
16681
|
+
|
|
16682
|
+
const $6cc32821e9371a1c$var$SELECTION_KEYS = [
|
|
16683
|
+
'Enter',
|
|
16684
|
+
' '
|
|
16685
|
+
];
|
|
16686
|
+
const $6cc32821e9371a1c$var$FIRST_KEYS = [
|
|
16687
|
+
'ArrowDown',
|
|
16688
|
+
'PageUp',
|
|
16689
|
+
'Home'
|
|
16690
|
+
];
|
|
16691
|
+
const $6cc32821e9371a1c$var$LAST_KEYS = [
|
|
16692
|
+
'ArrowUp',
|
|
16693
|
+
'PageDown',
|
|
16694
|
+
'End'
|
|
16695
|
+
];
|
|
16696
|
+
const $6cc32821e9371a1c$var$FIRST_LAST_KEYS = [
|
|
16697
|
+
...$6cc32821e9371a1c$var$FIRST_KEYS,
|
|
16698
|
+
...$6cc32821e9371a1c$var$LAST_KEYS
|
|
16699
|
+
];
|
|
16700
|
+
/* -------------------------------------------------------------------------------------------------
|
|
16701
|
+
* Menu
|
|
16702
|
+
* -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$MENU_NAME = 'Menu';
|
|
16703
|
+
const [$6cc32821e9371a1c$var$Collection, $6cc32821e9371a1c$var$useCollection, $6cc32821e9371a1c$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($6cc32821e9371a1c$var$MENU_NAME);
|
|
16704
|
+
const [$6cc32821e9371a1c$var$createMenuContext, $6cc32821e9371a1c$export$4027731b685e72eb] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($6cc32821e9371a1c$var$MENU_NAME, [
|
|
16705
|
+
$6cc32821e9371a1c$var$createCollectionScope,
|
|
16706
|
+
$cf1ac5d9fe0e8206$export$722aac194ae923$1,
|
|
16707
|
+
$d7bdfb9eb0fdf311$export$c7109489551a4f4
|
|
16708
|
+
]);
|
|
16709
|
+
const $6cc32821e9371a1c$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923$1();
|
|
16710
|
+
const $6cc32821e9371a1c$var$useRovingFocusGroupScope = $d7bdfb9eb0fdf311$export$c7109489551a4f4();
|
|
16711
|
+
const [$6cc32821e9371a1c$var$MenuProvider, $6cc32821e9371a1c$var$useMenuContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$MENU_NAME);
|
|
16712
|
+
const [$6cc32821e9371a1c$var$MenuRootProvider, $6cc32821e9371a1c$var$useMenuRootContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$MENU_NAME);
|
|
16713
|
+
const $6cc32821e9371a1c$export$d9b273488cd8ce6f = (props)=>{
|
|
16714
|
+
const { __scopeMenu: __scopeMenu , open: open = false , children: children , dir: dir , onOpenChange: onOpenChange , modal: modal = true } = props;
|
|
16715
|
+
const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);
|
|
16716
|
+
const [content, setContent] = React.useState(null);
|
|
16717
|
+
const isUsingKeyboardRef = React.useRef(false);
|
|
16718
|
+
const handleOpenChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onOpenChange);
|
|
16719
|
+
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
16720
|
+
React.useEffect(()=>{
|
|
16721
|
+
// Capture phase ensures we set the boolean before any side effects execute
|
|
16722
|
+
// in response to the key or pointer event as they might depend on this value.
|
|
16723
|
+
const handleKeyDown = ()=>{
|
|
16724
|
+
isUsingKeyboardRef.current = true;
|
|
16725
|
+
document.addEventListener('pointerdown', handlePointer, {
|
|
16726
|
+
capture: true,
|
|
16727
|
+
once: true
|
|
16728
|
+
});
|
|
16729
|
+
document.addEventListener('pointermove', handlePointer, {
|
|
16730
|
+
capture: true,
|
|
16731
|
+
once: true
|
|
16732
|
+
});
|
|
16733
|
+
};
|
|
16734
|
+
const handlePointer = ()=>isUsingKeyboardRef.current = false
|
|
16735
|
+
;
|
|
16736
|
+
document.addEventListener('keydown', handleKeyDown, {
|
|
16737
|
+
capture: true
|
|
16738
|
+
});
|
|
16739
|
+
return ()=>{
|
|
16740
|
+
document.removeEventListener('keydown', handleKeyDown, {
|
|
16741
|
+
capture: true
|
|
16742
|
+
});
|
|
16743
|
+
document.removeEventListener('pointerdown', handlePointer, {
|
|
15108
16744
|
capture: true
|
|
15109
16745
|
});
|
|
15110
16746
|
document.removeEventListener('pointermove', handlePointer, {
|
|
@@ -15112,7 +16748,7 @@ const $6cc32821e9371a1c$export$d9b273488cd8ce6f = (props)=>{
|
|
|
15112
16748
|
});
|
|
15113
16749
|
};
|
|
15114
16750
|
}, []);
|
|
15115
|
-
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$MenuProvider, {
|
|
16751
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9$1, popperScope, /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$MenuProvider, {
|
|
15116
16752
|
scope: __scopeMenu,
|
|
15117
16753
|
open: open,
|
|
15118
16754
|
onOpenChange: handleOpenChange,
|
|
@@ -15132,7 +16768,7 @@ const $6cc32821e9371a1c$export$d9b273488cd8ce6f = (props)=>{
|
|
|
15132
16768
|
const $6cc32821e9371a1c$export$9fa5ebd18bee4d43 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
15133
16769
|
const { __scopeMenu: __scopeMenu , ...anchorProps } = props;
|
|
15134
16770
|
const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);
|
|
15135
|
-
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({}, popperScope, anchorProps, {
|
|
16771
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7$1, _extends({}, popperScope, anchorProps, {
|
|
15136
16772
|
ref: forwardedRef
|
|
15137
16773
|
}));
|
|
15138
16774
|
});
|
|
@@ -15153,7 +16789,7 @@ const $6cc32821e9371a1c$export$479f0f2f71193efe = /*#__PURE__*/ React.forwardRef
|
|
|
15153
16789
|
const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);
|
|
15154
16790
|
return /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$Collection.Provider, {
|
|
15155
16791
|
scope: props.__scopeMenu
|
|
15156
|
-
}, /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
16792
|
+
}, /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b$1, {
|
|
15157
16793
|
present: forceMount || context.open
|
|
15158
16794
|
}, /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$Collection.Slot, {
|
|
15159
16795
|
scope: props.__scopeMenu
|
|
@@ -15166,7 +16802,7 @@ const $6cc32821e9371a1c$export$479f0f2f71193efe = /*#__PURE__*/ React.forwardRef
|
|
|
15166
16802
|
/* ---------------------------------------------------------------------------------------------- */ const $6cc32821e9371a1c$var$MenuRootContentModal = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
15167
16803
|
const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);
|
|
15168
16804
|
const ref = React.useRef(null);
|
|
15169
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref); // Hide everything from ARIA except the `MenuContent`
|
|
16805
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref); // Hide everything from ARIA except the `MenuContent`
|
|
15170
16806
|
React.useEffect(()=>{
|
|
15171
16807
|
const content = ref.current;
|
|
15172
16808
|
if (content) return hideOthers(content);
|
|
@@ -15179,7 +16815,7 @@ const $6cc32821e9371a1c$export$479f0f2f71193efe = /*#__PURE__*/ React.forwardRef
|
|
|
15179
16815
|
disableOutsidePointerEvents: context.open,
|
|
15180
16816
|
disableOutsideScroll: true // When focus is trapped, a `focusout` event may still happen.
|
|
15181
16817
|
,
|
|
15182
|
-
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault()
|
|
16818
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onFocusOutside, (event)=>event.preventDefault()
|
|
15183
16819
|
, {
|
|
15184
16820
|
checkForDefaultPrevented: false
|
|
15185
16821
|
}),
|
|
@@ -15205,7 +16841,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
15205
16841
|
const getItems = $6cc32821e9371a1c$var$useCollection(__scopeMenu);
|
|
15206
16842
|
const [currentItemId, setCurrentItemId] = React.useState(null);
|
|
15207
16843
|
const contentRef = React.useRef(null);
|
|
15208
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef, context.onContentChange);
|
|
16844
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, contentRef, context.onContentChange);
|
|
15209
16845
|
const timerRef = React.useRef(0);
|
|
15210
16846
|
const searchRef = React.useRef('');
|
|
15211
16847
|
const pointerGraceTimerRef = React.useRef(0);
|
|
@@ -15214,7 +16850,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
15214
16850
|
const lastPointerXRef = React.useRef(0);
|
|
15215
16851
|
const ScrollLockWrapper = disableOutsideScroll ? $epM9y$RemoveScroll : React.Fragment;
|
|
15216
16852
|
const scrollLockWrapperProps = disableOutsideScroll ? {
|
|
15217
|
-
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
16853
|
+
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360$1,
|
|
15218
16854
|
allowPinchZoom: true
|
|
15219
16855
|
} : undefined;
|
|
15220
16856
|
const handleTypeaheadSearch = (key)=>{
|
|
@@ -15281,7 +16917,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
15281
16917
|
}, /*#__PURE__*/ React.createElement(ScrollLockWrapper, scrollLockWrapperProps, /*#__PURE__*/ React.createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
15282
16918
|
asChild: true,
|
|
15283
16919
|
trapped: trapFocus,
|
|
15284
|
-
onMountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onOpenAutoFocus, (event)=>{
|
|
16920
|
+
onMountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(onOpenAutoFocus, (event)=>{
|
|
15285
16921
|
var _contentRef$current2;
|
|
15286
16922
|
// when opening, explicitly focus the content area only and leave
|
|
15287
16923
|
// `onEntryFocus` in control of focusing first item
|
|
@@ -15289,7 +16925,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
15289
16925
|
(_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 || _contentRef$current2.focus();
|
|
15290
16926
|
}),
|
|
15291
16927
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
15292
|
-
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, {
|
|
16928
|
+
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22$1, {
|
|
15293
16929
|
asChild: true,
|
|
15294
16930
|
disableOutsidePointerEvents: disableOutsidePointerEvents,
|
|
15295
16931
|
onEscapeKeyDown: onEscapeKeyDown,
|
|
@@ -15305,11 +16941,11 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
15305
16941
|
loop: loop,
|
|
15306
16942
|
currentTabStopId: currentItemId,
|
|
15307
16943
|
onCurrentTabStopIdChange: setCurrentItemId,
|
|
15308
|
-
onEntryFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onEntryFocus, (event)=>{
|
|
16944
|
+
onEntryFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(onEntryFocus, (event)=>{
|
|
15309
16945
|
// only focus first item when using keyboard
|
|
15310
16946
|
if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
|
|
15311
16947
|
})
|
|
15312
|
-
}), /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({
|
|
16948
|
+
}), /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2$1, _extends({
|
|
15313
16949
|
role: "menu",
|
|
15314
16950
|
"aria-orientation": "vertical",
|
|
15315
16951
|
"data-state": $6cc32821e9371a1c$var$getOpenState(context.open),
|
|
@@ -15321,7 +16957,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
15321
16957
|
outline: 'none',
|
|
15322
16958
|
...contentProps.style
|
|
15323
16959
|
},
|
|
15324
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onKeyDown, (event)=>{
|
|
16960
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(contentProps.onKeyDown, (event)=>{
|
|
15325
16961
|
// submenu key events bubble through portals. We only care about keys in this menu.
|
|
15326
16962
|
const target = event.target;
|
|
15327
16963
|
const isKeyDownInside = target.closest('[data-radix-menu-content]') === event.currentTarget;
|
|
@@ -15343,14 +16979,14 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
15343
16979
|
if ($6cc32821e9371a1c$var$LAST_KEYS.includes(event.key)) candidateNodes.reverse();
|
|
15344
16980
|
$6cc32821e9371a1c$var$focusFirst(candidateNodes);
|
|
15345
16981
|
}),
|
|
15346
|
-
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, (event)=>{
|
|
16982
|
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onBlur, (event)=>{
|
|
15347
16983
|
// clear search buffer when leaving the menu
|
|
15348
16984
|
if (!event.currentTarget.contains(event.target)) {
|
|
15349
16985
|
window.clearTimeout(timerRef.current);
|
|
15350
16986
|
searchRef.current = '';
|
|
15351
16987
|
}
|
|
15352
16988
|
}),
|
|
15353
|
-
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse((event)=>{
|
|
16989
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse((event)=>{
|
|
15354
16990
|
const target = event.target;
|
|
15355
16991
|
const pointerXHasChanged = lastPointerXRef.current !== event.clientX; // We don't use `event.movementX` for this check because Safari will
|
|
15356
16992
|
// always return `0` on a pointer event.
|
|
@@ -15364,7 +17000,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
15364
17000
|
});
|
|
15365
17001
|
const $6cc32821e9371a1c$export$dd37bec0e8a99143 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
15366
17002
|
const { __scopeMenu: __scopeMenu , ...labelProps } = props;
|
|
15367
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, labelProps, {
|
|
17003
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, labelProps, {
|
|
15368
17004
|
ref: forwardedRef
|
|
15369
17005
|
}));
|
|
15370
17006
|
});
|
|
@@ -15377,7 +17013,7 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ React.forwardRef
|
|
|
15377
17013
|
const ref = React.useRef(null);
|
|
15378
17014
|
const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$ITEM_NAME, props.__scopeMenu);
|
|
15379
17015
|
const contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$ITEM_NAME, props.__scopeMenu);
|
|
15380
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
17016
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
|
|
15381
17017
|
const isPointerDownRef = React.useRef(false);
|
|
15382
17018
|
const handleSelect = ()=>{
|
|
15383
17019
|
const menuItem = ref.current;
|
|
@@ -15390,7 +17026,7 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ React.forwardRef
|
|
|
15390
17026
|
, {
|
|
15391
17027
|
once: true
|
|
15392
17028
|
});
|
|
15393
|
-
$8927f6f2acc4f386$export$6d1a0317bde7de7f(menuItem, itemSelectEvent);
|
|
17029
|
+
$8927f6f2acc4f386$export$6d1a0317bde7de7f$1(menuItem, itemSelectEvent);
|
|
15394
17030
|
if (itemSelectEvent.defaultPrevented) isPointerDownRef.current = false;
|
|
15395
17031
|
else rootContext.onClose();
|
|
15396
17032
|
}
|
|
@@ -15398,20 +17034,20 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ React.forwardRef
|
|
|
15398
17034
|
return /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$MenuItemImpl, _extends({}, itemProps, {
|
|
15399
17035
|
ref: composedRefs,
|
|
15400
17036
|
disabled: disabled,
|
|
15401
|
-
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, handleSelect),
|
|
17037
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onClick, handleSelect),
|
|
15402
17038
|
onPointerDown: (event)=>{
|
|
15403
17039
|
var _props$onPointerDown;
|
|
15404
17040
|
(_props$onPointerDown = props.onPointerDown) === null || _props$onPointerDown === void 0 || _props$onPointerDown.call(props, event);
|
|
15405
17041
|
isPointerDownRef.current = true;
|
|
15406
17042
|
},
|
|
15407
|
-
onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerUp, (event)=>{
|
|
17043
|
+
onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onPointerUp, (event)=>{
|
|
15408
17044
|
var _event$currentTarget;
|
|
15409
17045
|
// Pointer down can move to a different menu item which should activate it on pointer up.
|
|
15410
17046
|
// We dispatch a click for selection to allow composition with click based triggers and to
|
|
15411
17047
|
// prevent Firefox from getting stuck in text selection mode when the menu closes.
|
|
15412
17048
|
if (!isPointerDownRef.current) (_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 || _event$currentTarget.click();
|
|
15413
17049
|
}),
|
|
15414
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
17050
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onKeyDown, (event)=>{
|
|
15415
17051
|
const isTypingAhead = contentContext.searchRef.current !== '';
|
|
15416
17052
|
if (disabled || isTypingAhead && event.key === ' ') return;
|
|
15417
17053
|
if ($6cc32821e9371a1c$var$SELECTION_KEYS.includes(event.key)) {
|
|
@@ -15431,7 +17067,7 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ React.forwardRef
|
|
|
15431
17067
|
const contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$ITEM_NAME, __scopeMenu);
|
|
15432
17068
|
const rovingFocusGroupScope = $6cc32821e9371a1c$var$useRovingFocusGroupScope(__scopeMenu);
|
|
15433
17069
|
const ref = React.useRef(null);
|
|
15434
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
17070
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
|
|
15435
17071
|
const [isFocused, setIsFocused] = React.useState(false); // get the item's `.textContent` as default strategy for typeahead `textValue`
|
|
15436
17072
|
const [textContent, setTextContent] = React.useState('');
|
|
15437
17073
|
React.useEffect(()=>{
|
|
@@ -15451,14 +17087,14 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ React.forwardRef
|
|
|
15451
17087
|
asChild: true
|
|
15452
17088
|
}, rovingFocusGroupScope, {
|
|
15453
17089
|
focusable: !disabled
|
|
15454
|
-
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
17090
|
+
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
15455
17091
|
role: "menuitem",
|
|
15456
17092
|
"data-highlighted": isFocused ? '' : undefined,
|
|
15457
17093
|
"aria-disabled": disabled || undefined,
|
|
15458
17094
|
"data-disabled": disabled ? '' : undefined
|
|
15459
17095
|
}, itemProps, {
|
|
15460
17096
|
ref: composedRefs,
|
|
15461
|
-
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse((event)=>{
|
|
17097
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse((event)=>{
|
|
15462
17098
|
if (disabled) contentContext.onItemLeave(event);
|
|
15463
17099
|
else {
|
|
15464
17100
|
contentContext.onItemEnter(event);
|
|
@@ -15468,11 +17104,11 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ React.forwardRef
|
|
|
15468
17104
|
}
|
|
15469
17105
|
}
|
|
15470
17106
|
})),
|
|
15471
|
-
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerLeave, $6cc32821e9371a1c$var$whenMouse((event)=>contentContext.onItemLeave(event)
|
|
17107
|
+
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onPointerLeave, $6cc32821e9371a1c$var$whenMouse((event)=>contentContext.onItemLeave(event)
|
|
15472
17108
|
)),
|
|
15473
|
-
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, ()=>setIsFocused(true)
|
|
17109
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onFocus, ()=>setIsFocused(true)
|
|
15474
17110
|
),
|
|
15475
|
-
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, ()=>setIsFocused(false)
|
|
17111
|
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onBlur, ()=>setIsFocused(false)
|
|
15476
17112
|
)
|
|
15477
17113
|
}))));
|
|
15478
17114
|
});
|
|
@@ -15491,7 +17127,7 @@ $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$ITEM_INDICATOR_NAM
|
|
|
15491
17127
|
});
|
|
15492
17128
|
const $6cc32821e9371a1c$export$1cec7dcdd713e220 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
15493
17129
|
const { __scopeMenu: __scopeMenu , ...separatorProps } = props;
|
|
15494
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
17130
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
15495
17131
|
role: "separator",
|
|
15496
17132
|
"aria-orientation": "horizontal"
|
|
15497
17133
|
}, separatorProps, {
|
|
@@ -15501,7 +17137,7 @@ const $6cc32821e9371a1c$export$1cec7dcdd713e220 = /*#__PURE__*/ React.forwardRef
|
|
|
15501
17137
|
const $6cc32821e9371a1c$export$bcdda4773debf5fa = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
15502
17138
|
const { __scopeMenu: __scopeMenu , ...arrowProps } = props;
|
|
15503
17139
|
const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);
|
|
15504
|
-
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5, _extends({}, popperScope, arrowProps, {
|
|
17140
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5$1, _extends({}, popperScope, arrowProps, {
|
|
15505
17141
|
ref: forwardedRef
|
|
15506
17142
|
}));
|
|
15507
17143
|
});
|
|
@@ -15595,7 +17231,7 @@ const $6cc32821e9371a1c$export$21b07c8f274aebd5 = $6cc32821e9371a1c$export$bcdda
|
|
|
15595
17231
|
/* -------------------------------------------------------------------------------------------------
|
|
15596
17232
|
* DropdownMenu
|
|
15597
17233
|
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$DROPDOWN_MENU_NAME = 'DropdownMenu';
|
|
15598
|
-
const [$d08ef79370b62062$var$createDropdownMenuContext, $d08ef79370b62062$export$c0623cd925aeb687] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($d08ef79370b62062$var$DROPDOWN_MENU_NAME, [
|
|
17234
|
+
const [$d08ef79370b62062$var$createDropdownMenuContext, $d08ef79370b62062$export$c0623cd925aeb687] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($d08ef79370b62062$var$DROPDOWN_MENU_NAME, [
|
|
15599
17235
|
$6cc32821e9371a1c$export$4027731b685e72eb
|
|
15600
17236
|
]);
|
|
15601
17237
|
const $d08ef79370b62062$var$useMenuScope = $6cc32821e9371a1c$export$4027731b685e72eb();
|
|
@@ -15604,7 +17240,7 @@ const $d08ef79370b62062$export$e44a253a59704894 = (props)=>{
|
|
|
15604
17240
|
const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , dir: dir , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props;
|
|
15605
17241
|
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
15606
17242
|
const triggerRef = React.useRef(null);
|
|
15607
|
-
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
17243
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
|
|
15608
17244
|
prop: openProp,
|
|
15609
17245
|
defaultProp: defaultOpen,
|
|
15610
17246
|
onChange: onOpenChange
|
|
@@ -15638,7 +17274,7 @@ const $d08ef79370b62062$export$d2469213b3befba9 = /*#__PURE__*/ React.forwardRef
|
|
|
15638
17274
|
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
15639
17275
|
return /*#__PURE__*/ React.createElement($6cc32821e9371a1c$export$b688253958b8dfe7, _extends({
|
|
15640
17276
|
asChild: true
|
|
15641
|
-
}, menuScope), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
17277
|
+
}, menuScope), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.button, _extends({
|
|
15642
17278
|
type: "button",
|
|
15643
17279
|
id: context.triggerId,
|
|
15644
17280
|
"aria-haspopup": "menu",
|
|
@@ -15648,8 +17284,8 @@ const $d08ef79370b62062$export$d2469213b3befba9 = /*#__PURE__*/ React.forwardRef
|
|
|
15648
17284
|
"data-disabled": disabled ? '' : undefined,
|
|
15649
17285
|
disabled: disabled
|
|
15650
17286
|
}, triggerProps, {
|
|
15651
|
-
ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, context.triggerRef),
|
|
15652
|
-
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDown, (event)=>{
|
|
17287
|
+
ref: $6ed0406888f73fc4$export$43e446d32b3d21af$1(forwardedRef, context.triggerRef),
|
|
17288
|
+
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onPointerDown, (event)=>{
|
|
15653
17289
|
// only call handler if it's the left button (mousedown gets triggered by all mouse buttons)
|
|
15654
17290
|
// but not when the control key is pressed (avoiding MacOS right click)
|
|
15655
17291
|
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
@@ -15658,7 +17294,7 @@ const $d08ef79370b62062$export$d2469213b3befba9 = /*#__PURE__*/ React.forwardRef
|
|
|
15658
17294
|
if (!context.open) event.preventDefault();
|
|
15659
17295
|
}
|
|
15660
17296
|
}),
|
|
15661
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
17297
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onKeyDown, (event)=>{
|
|
15662
17298
|
if (disabled) return;
|
|
15663
17299
|
if ([
|
|
15664
17300
|
'Enter',
|
|
@@ -15687,13 +17323,13 @@ const $d08ef79370b62062$export$6e76d93a37c01248 = /*#__PURE__*/ React.forwardRef
|
|
|
15687
17323
|
"aria-labelledby": context.triggerId
|
|
15688
17324
|
}, menuScope, contentProps, {
|
|
15689
17325
|
ref: forwardedRef,
|
|
15690
|
-
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{
|
|
17326
|
+
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onCloseAutoFocus, (event)=>{
|
|
15691
17327
|
var _context$triggerRef$c;
|
|
15692
17328
|
if (!hasInteractedOutsideRef.current) (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
15693
17329
|
hasInteractedOutsideRef.current = false; // Always prevent auto focus because we either focus manually or want user agent focus
|
|
15694
17330
|
event.preventDefault();
|
|
15695
17331
|
}),
|
|
15696
|
-
onInteractOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onInteractOutside, (event)=>{
|
|
17332
|
+
onInteractOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onInteractOutside, (event)=>{
|
|
15697
17333
|
const originalEvent = event.detail.originalEvent;
|
|
15698
17334
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
15699
17335
|
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
@@ -15750,31 +17386,22 @@ const borderStyles = [
|
|
|
15750
17386
|
'tw-border',
|
|
15751
17387
|
'tw-rounded-sm',
|
|
15752
17388
|
'tw-border-sq-disabled-gray',
|
|
15753
|
-
'dark:tw-border-gray-
|
|
17389
|
+
'dark:tw-border-gray-500',
|
|
15754
17390
|
].join(' ');
|
|
15755
17391
|
const bgStyles = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
15756
17392
|
const disabledClasses = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
15757
|
-
const ButtonWithDropdown = ({ dropdownItems, triggerIcon,
|
|
15758
|
-
|
|
15759
|
-
if (tooltipText) {
|
|
15760
|
-
tooltipData = {
|
|
15761
|
-
'data-qtip-text': tooltipText,
|
|
15762
|
-
'data-qtip-placement': tooltipPlacement,
|
|
15763
|
-
'data-qtip-is-html': isHtmlTooltip,
|
|
15764
|
-
'data-qtip-testid': tooltipTestId,
|
|
15765
|
-
'data-qtip-delay': tooltipDelay ?? DEFAULT_TOOL_TIP_DELAY,
|
|
15766
|
-
};
|
|
15767
|
-
}
|
|
17393
|
+
const ButtonWithDropdown = ({ dropdownItems, triggerIcon, id, extraClassNames, containerTestId, disabled = false, align = 'end', placement = 'bottom', placementOffset = 5, alignOffset = -35, hasArrow = false, onOpenChange, isOpen, setFocusOnTriggerOnClose = true, keepFocusInsideDropdown = true, ...tooltipProps }) => {
|
|
17394
|
+
const tooltipData = getQTipData(tooltipProps);
|
|
15768
17395
|
return (React__namespace.createElement($d08ef79370b62062$export$be92b6f5f03c0fe9, { defaultOpen: false, open: isOpen, onOpenChange: onOpenChange, modal: keepFocusInsideDropdown },
|
|
15769
17396
|
React__namespace.createElement($d08ef79370b62062$export$41fb9f06171c75f4, { id: id, className: `tw-border-none focus-visible:tw-outline-none focus:tw-outline-none focus-within:tw-outline-none`, disabled: disabled },
|
|
15770
17397
|
React__namespace.createElement("div", { ...tooltipData, className: `tw-bg-transparent tw-flex tw-flex-col tw-items-center focus-visible:tw-outline-none focus:tw-outline-none focus-within:tw-outline-none ${disabled ? disabledClasses : ''} ${extraClassNames || ''}` }, triggerIcon)),
|
|
15771
17398
|
React__namespace.createElement($d08ef79370b62062$export$7c6e2c02157bb7d2, { sideOffset: placementOffset, side: placement, align: align, alignOffset: alignOffset, asChild: true, onCloseAutoFocus: (e) => !setFocusOnTriggerOnClose && e.preventDefault(), className: "focus-visible:tw-outline-none tw-outline-none" },
|
|
15772
17399
|
React__namespace.createElement("div", { "data-testid": containerTestId, className: bgStyles +
|
|
15773
|
-
' tw-relative tw-z-[1000] tw-min-w-6 focus-visible:tw-outline-none tw-outline-none data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out' +
|
|
17400
|
+
' tw-relative tw-z-[1000] tw-min-w-6 tw-pt-2 focus-visible:tw-outline-none tw-outline-none data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out' +
|
|
15774
17401
|
' forceFont data-[side=top]:tw-animate-slideDownAndFade data-[side=right]:tw-animate-slideLeftAndFade data-[side=bottom]:tw-animate-slideUpAndFade data-[side=left]:tw-animate-slideRightAndFade ' +
|
|
15775
17402
|
borderStyles },
|
|
15776
17403
|
hasArrow && (React__namespace.createElement($d08ef79370b62062$export$21b07c8f274aebd5, { asChild: true },
|
|
15777
|
-
React__namespace.createElement("div", { className: " tw-fill-transparent tw-bg-white tw-w-[
|
|
17404
|
+
React__namespace.createElement("div", { className: " tw-fill-transparent tw-bg-white tw-w-[15px] tw-h-[15px] tw-rotate-45 dark:tw-bg-sq-dark-background tw-border-b tw-border-r tw-border-sq-disabled-gray dark:tw-border-gray-500 tw-mt-[-7px]" }))),
|
|
15778
17405
|
dropdownItems.map((item, index) => {
|
|
15779
17406
|
return item.isLabel ? (React__namespace.createElement($d08ef79370b62062$export$b04be29aa201d4f5, { key: (item.label || '') + index, className: item.containerExtraClassNames },
|
|
15780
17407
|
item.icon && (React__namespace.createElement(Icon, { icon: item.icon, testId: item.iconTestId, type: "text", color: item.iconColor, extraClassNames: "tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px]" })),
|
|
@@ -15784,7 +17411,7 @@ const ButtonWithDropdown = ({ dropdownItems, triggerIcon, tooltipText, id, extra
|
|
|
15784
17411
|
}, className: `tw-cursor-pointer tw-flex dark:tw-text-sq-white hover:tw-bg-sq-colored-hover hover:dark:tw-bg-sq-colored-hover-dark tw-leading-none tw-items-center tw-h-[27px] tw-px-[19px] tw-relative tw-select-none tw-outline-none data-[disabled]:tw-text-sq-disabled-gray data-[disabled]:tw-pointer-events-none ${item.containerExtraClassNames || ''}`, "data-testid": item.testId, disabled: item.disabled },
|
|
15785
17412
|
item.icon && (React__namespace.createElement(Icon, { icon: item.icon, testId: item.iconTestId, type: (item.iconType || 'text'), color: item.iconColor, customId: item.iconCustomId, extraClassNames: `tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px] ${item.iconExtraClassNames || ''}` })),
|
|
15786
17413
|
React__namespace.createElement("div", { "data-testid": item.labelTestId, "data-customid": item.labelCustomId, className: `tw-text-[13px] tw-ml-1 ${item.labelClasses}` }, item.label)),
|
|
15787
|
-
item.hasDivider && (React__namespace.createElement($d08ef79370b62062$export$1ff3c3f08ae963c0, { "data-testid": `dropdown-divider-${index}`, className: "tw-h-[1px] tw-bg-sq-disabled-gray dark:tw-bg-gray-
|
|
17414
|
+
item.hasDivider && (React__namespace.createElement($d08ef79370b62062$export$1ff3c3f08ae963c0, { "data-testid": `dropdown-divider-${index}`, className: "tw-h-[1px] tw-bg-sq-disabled-gray dark:tw-bg-gray-500 tw-my-[8px]" }))));
|
|
15788
17415
|
})))));
|
|
15789
17416
|
};
|
|
15790
17417
|
|