@seeqdev/qomponents 0.0.65 → 0.0.67
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 +23 -8
- package/dist/ButtonWithPopover/ButtonWithPopover.types.d.ts +6 -0
- package/dist/index.esm.js +646 -1976
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +646 -1976
- package/dist/index.js.map +1 -1
- package/dist/styles.css +17 -44
- package/package.json +1 -2
- package/dist/Accordion/Accordion.js +0 -9
- package/dist/Accordion/Accordion.js.map +0 -1
- package/dist/Accordion/Accordion.stories.js +0 -109
- package/dist/Accordion/Accordion.stories.js.map +0 -1
- package/dist/Accordion/Accordion.test.js +0 -55
- package/dist/Accordion/Accordion.test.js.map +0 -1
- package/dist/Accordion/Accordion.types.js +0 -2
- package/dist/Accordion/Accordion.types.js.map +0 -1
- package/dist/Accordion/index.js +0 -2
- package/dist/Accordion/index.js.map +0 -1
- package/dist/Button/Button.js +0 -87
- package/dist/Button/Button.js.map +0 -1
- package/dist/Button/Button.stories.js +0 -77
- package/dist/Button/Button.stories.js.map +0 -1
- package/dist/Button/Button.test.js +0 -49
- package/dist/Button/Button.test.js.map +0 -1
- package/dist/Button/Button.types.js +0 -4
- package/dist/Button/Button.types.js.map +0 -1
- package/dist/Button/index.js +0 -2
- package/dist/Button/index.js.map +0 -1
- package/dist/ButtonWithDropdown/ButtonWithDropdown.js +0 -44
- package/dist/ButtonWithDropdown/ButtonWithDropdown.js.map +0 -1
- package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js +0 -66
- package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js.map +0 -1
- package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js +0 -72
- package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js.map +0 -1
- package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js +0 -2
- package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js.map +0 -1
- package/dist/ButtonWithDropdown/index.js +0 -2
- package/dist/ButtonWithDropdown/index.js.map +0 -1
- package/dist/ButtonWithPopover/ButtonWithPopover.js +0 -36
- package/dist/ButtonWithPopover/ButtonWithPopover.js.map +0 -1
- package/dist/ButtonWithPopover/ButtonWithPopover.stories.js +0 -50
- package/dist/ButtonWithPopover/ButtonWithPopover.stories.js.map +0 -1
- package/dist/ButtonWithPopover/ButtonWithPopover.test.js +0 -61
- package/dist/ButtonWithPopover/ButtonWithPopover.test.js.map +0 -1
- package/dist/ButtonWithPopover/ButtonWithPopover.types.js +0 -2
- package/dist/ButtonWithPopover/ButtonWithPopover.types.js.map +0 -1
- package/dist/ButtonWithPopover/index.js +0 -2
- package/dist/ButtonWithPopover/index.js.map +0 -1
- package/dist/Checkbox/Checkbox.js +0 -24
- package/dist/Checkbox/Checkbox.js.map +0 -1
- package/dist/Checkbox/Checkbox.stories.js +0 -32
- package/dist/Checkbox/Checkbox.stories.js.map +0 -1
- package/dist/Checkbox/Checkbox.test.js +0 -94
- package/dist/Checkbox/Checkbox.test.js.map +0 -1
- package/dist/Checkbox/Checkbox.types.js +0 -2
- package/dist/Checkbox/Checkbox.types.js.map +0 -1
- package/dist/Checkbox/index.js +0 -2
- package/dist/Checkbox/index.js.map +0 -1
- package/dist/Icon/Icon.js +0 -63
- package/dist/Icon/Icon.js.map +0 -1
- package/dist/Icon/Icon.stories.js +0 -41
- package/dist/Icon/Icon.stories.js.map +0 -1
- package/dist/Icon/Icon.test.js +0 -55
- package/dist/Icon/Icon.test.js.map +0 -1
- package/dist/Icon/Icon.types.js +0 -16
- package/dist/Icon/Icon.types.js.map +0 -1
- package/dist/Icon/index.js +0 -2
- package/dist/Icon/index.js.map +0 -1
- package/dist/Modal/Modal.js +0 -99
- package/dist/Modal/Modal.js.map +0 -1
- package/dist/Modal/Modal.stories.js +0 -176
- package/dist/Modal/Modal.stories.js.map +0 -1
- package/dist/Modal/Modal.test.js +0 -108
- package/dist/Modal/Modal.test.js.map +0 -1
- package/dist/Modal/Modal.types.js +0 -2
- package/dist/Modal/Modal.types.js.map +0 -1
- package/dist/Modal/index.js +0 -2
- package/dist/Modal/index.js.map +0 -1
- package/dist/Select/Select.js +0 -168
- package/dist/Select/Select.js.map +0 -1
- package/dist/Select/Select.stories.js +0 -72
- package/dist/Select/Select.stories.js.map +0 -1
- package/dist/Select/Select.test.js +0 -161
- package/dist/Select/Select.test.js.map +0 -1
- package/dist/Select/Select.types.js +0 -2
- package/dist/Select/Select.types.js.map +0 -1
- package/dist/Select/index.js +0 -2
- package/dist/Select/index.js.map +0 -1
- package/dist/Tabs/Tabs.js +0 -22
- package/dist/Tabs/Tabs.js.map +0 -1
- package/dist/Tabs/Tabs.stories.js +0 -91
- package/dist/Tabs/Tabs.stories.js.map +0 -1
- package/dist/Tabs/Tabs.test.js +0 -91
- package/dist/Tabs/Tabs.test.js.map +0 -1
- package/dist/Tabs/Tabs.types.js +0 -2
- package/dist/Tabs/Tabs.types.js.map +0 -1
- package/dist/Tabs/index.js +0 -2
- package/dist/Tabs/index.js.map +0 -1
- package/dist/TextArea/TextArea.js +0 -23
- package/dist/TextArea/TextArea.js.map +0 -1
- package/dist/TextArea/TextArea.stories.js +0 -39
- package/dist/TextArea/TextArea.stories.js.map +0 -1
- package/dist/TextArea/TextArea.test.js +0 -68
- package/dist/TextArea/TextArea.test.js.map +0 -1
- package/dist/TextArea/TextArea.types.js +0 -2
- package/dist/TextArea/TextArea.types.js.map +0 -1
- package/dist/TextArea/index.js +0 -2
- package/dist/TextArea/index.js.map +0 -1
- package/dist/TextField/TextField.js +0 -64
- package/dist/TextField/TextField.js.map +0 -1
- package/dist/TextField/TextField.stories.js +0 -41
- package/dist/TextField/TextField.stories.js.map +0 -1
- package/dist/TextField/TextField.test.js +0 -35
- package/dist/TextField/TextField.test.js.map +0 -1
- package/dist/TextField/TextField.types.js +0 -2
- package/dist/TextField/TextField.types.js.map +0 -1
- package/dist/TextField/index.js +0 -2
- package/dist/TextField/index.js.map +0 -1
- package/dist/ToolbarButton/ToolbarButton.js +0 -76
- package/dist/ToolbarButton/ToolbarButton.js.map +0 -1
- package/dist/ToolbarButton/ToolbarButton.stories.js +0 -89
- package/dist/ToolbarButton/ToolbarButton.stories.js.map +0 -1
- package/dist/ToolbarButton/ToolbarButton.test.js +0 -93
- package/dist/ToolbarButton/ToolbarButton.test.js.map +0 -1
- package/dist/ToolbarButton/ToolbarButton.types.js +0 -2
- package/dist/ToolbarButton/ToolbarButton.types.js.map +0 -1
- package/dist/ToolbarButton/index.js +0 -2
- package/dist/ToolbarButton/index.js.map +0 -1
- package/dist/Tooltip/QTip.stories.js +0 -40
- package/dist/Tooltip/QTip.stories.js.map +0 -1
- package/dist/Tooltip/QTip.types.js +0 -2
- package/dist/Tooltip/QTip.types.js.map +0 -1
- package/dist/Tooltip/QTipPerformance.stories.js +0 -30
- package/dist/Tooltip/QTipPerformance.stories.js.map +0 -1
- package/dist/Tooltip/Qtip.js +0 -154
- package/dist/Tooltip/Qtip.js.map +0 -1
- package/dist/Tooltip/Tooltip.js +0 -36
- package/dist/Tooltip/Tooltip.js.map +0 -1
- package/dist/Tooltip/Tooltip.stories.js +0 -32
- package/dist/Tooltip/Tooltip.stories.js.map +0 -1
- package/dist/Tooltip/Tooltip.types.js +0 -3
- package/dist/Tooltip/Tooltip.types.js.map +0 -1
- package/dist/Tooltip/TooltipPerformance.stories.js +0 -30
- package/dist/Tooltip/TooltipPerformance.stories.js.map +0 -1
- package/dist/Tooltip/index.js +0 -3
- package/dist/Tooltip/index.js.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/utils/browserId.js +0 -29
- package/dist/utils/browserId.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -109,7 +109,7 @@ const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClas
|
|
|
109
109
|
const iconPrefixString = icon.startsWith('fc') ? 'fc' : fontAwesomePrefix;
|
|
110
110
|
const style = type === 'color' && color ? { color } : {};
|
|
111
111
|
const appliedClassNames = `${iconPrefixString} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
|
|
112
|
-
${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'cursor-pointer' : ''} ${extraClassNames}`;
|
|
112
|
+
${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'cursor-pointer' : ''} ${extraClassNames} focus:tw-outline-none focus-visible:tw-outline-none tw-outline-none`;
|
|
113
113
|
const tooltipData = getQTipData(tooltipProps);
|
|
114
114
|
return (React.createElement("i", { className: appliedClassNames, style: style, onClick: onClick, "data-testid": testId, "data-customid": customId, id: id, "data-number": number, ...tooltipData }));
|
|
115
115
|
};
|
|
@@ -210,7 +210,7 @@ function _extends() {
|
|
|
210
210
|
return _extends.apply(this, arguments);
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
function $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
213
|
+
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
|
|
214
214
|
return function handleEvent(event) {
|
|
215
215
|
originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
|
|
216
216
|
if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
|
|
@@ -220,29 +220,29 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(originalEventHandler, ourEv
|
|
|
220
220
|
/**
|
|
221
221
|
* Set a given ref to a given value
|
|
222
222
|
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
223
|
-
*/ function $6ed0406888f73fc4$var$setRef
|
|
223
|
+
*/ function $6ed0406888f73fc4$var$setRef(ref, value) {
|
|
224
224
|
if (typeof ref === 'function') ref(value);
|
|
225
225
|
else if (ref !== null && ref !== undefined) ref.current = value;
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
228
228
|
* A utility to compose multiple refs together
|
|
229
229
|
* Accepts callback refs and RefObject(s)
|
|
230
|
-
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af
|
|
231
|
-
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef
|
|
230
|
+
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
|
231
|
+
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
|
|
232
232
|
)
|
|
233
233
|
;
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
236
236
|
* A custom hook that composes multiple refs
|
|
237
237
|
* Accepts callback refs and RefObject(s)
|
|
238
|
-
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
238
|
+
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
239
239
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
240
|
-
return React.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af
|
|
240
|
+
return React.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
/* -------------------------------------------------------------------------------------------------
|
|
244
244
|
* createContextScope
|
|
245
|
-
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
245
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
|
|
246
246
|
let defaultContexts = [];
|
|
247
247
|
/* -----------------------------------------------------------------------------------------------
|
|
248
248
|
* createContext
|
|
@@ -299,12 +299,12 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(originalEventHandler, ourEv
|
|
|
299
299
|
createScope.scopeName = scopeName;
|
|
300
300
|
return [
|
|
301
301
|
$c512c27ab02ef895$export$fd42f52fd3ae1109,
|
|
302
|
-
$c512c27ab02ef895$var$composeContextScopes
|
|
302
|
+
$c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
|
|
303
303
|
];
|
|
304
304
|
}
|
|
305
305
|
/* -------------------------------------------------------------------------------------------------
|
|
306
306
|
* composeContextScopes
|
|
307
|
-
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes
|
|
307
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
|
|
308
308
|
const baseScope = scopes[0];
|
|
309
309
|
if (scopes.length === 1) return baseScope;
|
|
310
310
|
const createScope1 = ()=>{
|
|
@@ -339,10 +339,10 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(originalEventHandler, ourEv
|
|
|
339
339
|
|
|
340
340
|
/* -------------------------------------------------------------------------------------------------
|
|
341
341
|
* Slot
|
|
342
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360
|
|
342
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
343
343
|
const { children: children , ...slotProps } = props;
|
|
344
344
|
const childrenArray = React.Children.toArray(children);
|
|
345
|
-
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable
|
|
345
|
+
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
346
346
|
if (slottable) {
|
|
347
347
|
// the new element to render is the one passed as a child of `Slottable`
|
|
348
348
|
const newElement = slottable.props.children;
|
|
@@ -354,35 +354,35 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(originalEventHandler, ourEv
|
|
|
354
354
|
return /*#__PURE__*/ React.isValidElement(newElement) ? newElement.props.children : null;
|
|
355
355
|
} else return child;
|
|
356
356
|
});
|
|
357
|
-
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone
|
|
357
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
358
358
|
ref: forwardedRef
|
|
359
359
|
}), /*#__PURE__*/ React.isValidElement(newElement) ? /*#__PURE__*/ React.cloneElement(newElement, undefined, newChildren) : null);
|
|
360
360
|
}
|
|
361
|
-
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone
|
|
361
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
362
362
|
ref: forwardedRef
|
|
363
363
|
}), children);
|
|
364
364
|
});
|
|
365
|
-
$5e63c961fc1ce211$export$8c6ed5c666ac1360
|
|
365
|
+
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
|
|
366
366
|
/* -------------------------------------------------------------------------------------------------
|
|
367
367
|
* SlotClone
|
|
368
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone
|
|
368
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
369
369
|
const { children: children , ...slotProps } = props;
|
|
370
370
|
if (/*#__PURE__*/ React.isValidElement(children)) return /*#__PURE__*/ React.cloneElement(children, {
|
|
371
|
-
...$5e63c961fc1ce211$var$mergeProps
|
|
372
|
-
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af
|
|
371
|
+
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
372
|
+
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
|
|
373
373
|
});
|
|
374
374
|
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
375
375
|
});
|
|
376
|
-
$5e63c961fc1ce211$var$SlotClone
|
|
376
|
+
$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
|
|
377
377
|
/* -------------------------------------------------------------------------------------------------
|
|
378
378
|
* Slottable
|
|
379
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45
|
|
379
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
|
|
380
380
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, children);
|
|
381
381
|
};
|
|
382
|
-
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable
|
|
383
|
-
return /*#__PURE__*/ React.isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45
|
|
382
|
+
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
383
|
+
return /*#__PURE__*/ React.isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
384
384
|
}
|
|
385
|
-
function $5e63c961fc1ce211$var$mergeProps
|
|
385
|
+
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
386
386
|
// all child props should override
|
|
387
387
|
const overrideProps = {
|
|
388
388
|
...childProps
|
|
@@ -413,7 +413,7 @@ function $5e63c961fc1ce211$var$mergeProps$1(slotProps, childProps) {
|
|
|
413
413
|
};
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
-
const $8927f6f2acc4f386$var$NODES
|
|
416
|
+
const $8927f6f2acc4f386$var$NODES = [
|
|
417
417
|
'a',
|
|
418
418
|
'button',
|
|
419
419
|
'div',
|
|
@@ -435,10 +435,10 @@ const $8927f6f2acc4f386$var$NODES$1 = [
|
|
|
435
435
|
// prettier-ignore
|
|
436
436
|
/* -------------------------------------------------------------------------------------------------
|
|
437
437
|
* Primitive
|
|
438
|
-
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
438
|
+
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
|
|
439
439
|
const Node = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
440
440
|
const { asChild: asChild , ...primitiveProps } = props;
|
|
441
|
-
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360
|
|
441
|
+
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
|
442
442
|
React.useEffect(()=>{
|
|
443
443
|
window[Symbol.for('radix-ui')] = true;
|
|
444
444
|
}, []);
|
|
@@ -489,7 +489,7 @@ const $8927f6f2acc4f386$var$NODES$1 = [
|
|
|
489
489
|
* Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
|
|
490
490
|
* this utility with them. This is because it's possible for those handlers to be called implicitly during render
|
|
491
491
|
* e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
|
|
492
|
-
*/ function $8927f6f2acc4f386$export$6d1a0317bde7de7f
|
|
492
|
+
*/ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
|
|
493
493
|
if (target) ReactDOM.flushSync(()=>target.dispatchEvent(event)
|
|
494
494
|
);
|
|
495
495
|
}
|
|
@@ -497,7 +497,7 @@ const $8927f6f2acc4f386$var$NODES$1 = [
|
|
|
497
497
|
/**
|
|
498
498
|
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
499
499
|
* prop or avoid re-executing effects when passed as a dependency
|
|
500
|
-
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
500
|
+
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
501
501
|
const callbackRef = React.useRef(callback);
|
|
502
502
|
React.useEffect(()=>{
|
|
503
503
|
callbackRef.current = callback;
|
|
@@ -511,8 +511,8 @@ const $8927f6f2acc4f386$var$NODES$1 = [
|
|
|
511
511
|
|
|
512
512
|
/**
|
|
513
513
|
* Listens for when the escape key is down
|
|
514
|
-
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765
|
|
515
|
-
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
514
|
+
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
515
|
+
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
516
516
|
React.useEffect(()=>{
|
|
517
517
|
const handleKeyDown = (event)=>{
|
|
518
518
|
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
@@ -526,23 +526,23 @@ const $8927f6f2acc4f386$var$NODES$1 = [
|
|
|
526
526
|
]);
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
-
const $5cb92bef7577960e$var$CONTEXT_UPDATE
|
|
530
|
-
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE
|
|
531
|
-
const $5cb92bef7577960e$var$FOCUS_OUTSIDE
|
|
532
|
-
let $5cb92bef7577960e$var$originalBodyPointerEvents
|
|
533
|
-
const $5cb92bef7577960e$var$DismissableLayerContext
|
|
529
|
+
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
530
|
+
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
531
|
+
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
532
|
+
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
533
|
+
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ React.createContext({
|
|
534
534
|
layers: new Set(),
|
|
535
535
|
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
536
536
|
branches: new Set()
|
|
537
537
|
});
|
|
538
|
-
const $5cb92bef7577960e$export$177fb62ff3ec1f22
|
|
538
|
+
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
539
539
|
var _node$ownerDocument;
|
|
540
540
|
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
541
|
-
const context = React.useContext($5cb92bef7577960e$var$DismissableLayerContext
|
|
541
|
+
const context = React.useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
542
542
|
const [node1, setNode] = React.useState(null);
|
|
543
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;
|
|
544
544
|
const [, force] = React.useState({});
|
|
545
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
545
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
546
546
|
);
|
|
547
547
|
const layers = Array.from(context.layers);
|
|
548
548
|
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
@@ -552,7 +552,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ React.forwardR
|
|
|
552
552
|
const index = node1 ? layers.indexOf(node1) : -1;
|
|
553
553
|
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
554
554
|
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
555
|
-
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside
|
|
555
|
+
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
556
556
|
const target = event.target;
|
|
557
557
|
const isPointerDownOnBranch = [
|
|
558
558
|
...context.branches
|
|
@@ -563,7 +563,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ React.forwardR
|
|
|
563
563
|
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
564
564
|
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
565
565
|
}, ownerDocument);
|
|
566
|
-
const focusOutside = $5cb92bef7577960e$var$useFocusOutside
|
|
566
|
+
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
|
|
567
567
|
const target = event.target;
|
|
568
568
|
const isFocusInBranch = [
|
|
569
569
|
...context.branches
|
|
@@ -574,7 +574,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ React.forwardR
|
|
|
574
574
|
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
575
575
|
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
576
576
|
}, ownerDocument);
|
|
577
|
-
$addc16e1bbe58fd0$export$3a72a57244d6e765
|
|
577
|
+
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
578
578
|
const isHighestLayer = index === context.layers.size - 1;
|
|
579
579
|
if (!isHighestLayer) return;
|
|
580
580
|
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
@@ -587,15 +587,15 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ React.forwardR
|
|
|
587
587
|
if (!node1) return;
|
|
588
588
|
if (disableOutsidePointerEvents) {
|
|
589
589
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
590
|
-
$5cb92bef7577960e$var$originalBodyPointerEvents
|
|
590
|
+
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
591
591
|
ownerDocument.body.style.pointerEvents = 'none';
|
|
592
592
|
}
|
|
593
593
|
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
594
594
|
}
|
|
595
595
|
context.layers.add(node1);
|
|
596
|
-
$5cb92bef7577960e$var$dispatchUpdate
|
|
596
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
597
597
|
return ()=>{
|
|
598
|
-
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;
|
|
599
599
|
};
|
|
600
600
|
}, [
|
|
601
601
|
node1,
|
|
@@ -613,7 +613,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ React.forwardR
|
|
|
613
613
|
if (!node1) return;
|
|
614
614
|
context.layers.delete(node1);
|
|
615
615
|
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
616
|
-
$5cb92bef7577960e$var$dispatchUpdate
|
|
616
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
617
617
|
};
|
|
618
618
|
}, [
|
|
619
619
|
node1,
|
|
@@ -622,27 +622,27 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ React.forwardR
|
|
|
622
622
|
React.useEffect(()=>{
|
|
623
623
|
const handleUpdate = ()=>force({})
|
|
624
624
|
;
|
|
625
|
-
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE
|
|
626
|
-
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE
|
|
625
|
+
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
626
|
+
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
627
627
|
;
|
|
628
628
|
}, []);
|
|
629
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
629
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
|
|
630
630
|
ref: composedRefs,
|
|
631
631
|
style: {
|
|
632
632
|
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
633
633
|
...props.style
|
|
634
634
|
},
|
|
635
|
-
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
636
|
-
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
637
|
-
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
635
|
+
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
636
|
+
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
637
|
+
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
638
638
|
}));
|
|
639
639
|
});
|
|
640
640
|
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
641
641
|
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
642
642
|
* to mimic layer dismissing behaviour present in OS.
|
|
643
643
|
* Returns props to pass to the node we want to check for outside events.
|
|
644
|
-
*/ function $5cb92bef7577960e$var$usePointerDownOutside
|
|
645
|
-
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
644
|
+
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
645
|
+
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
646
646
|
const isPointerInsideReactTreeRef = React.useRef(false);
|
|
647
647
|
const handleClickRef = React.useRef(()=>{});
|
|
648
648
|
React.useEffect(()=>{
|
|
@@ -652,7 +652,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ React.forwardR
|
|
|
652
652
|
originalEvent: event
|
|
653
653
|
};
|
|
654
654
|
function handleAndDispatchPointerDownOutsideEvent() {
|
|
655
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent
|
|
655
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
656
656
|
discrete: true
|
|
657
657
|
});
|
|
658
658
|
}
|
|
@@ -711,8 +711,8 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ React.forwardR
|
|
|
711
711
|
/**
|
|
712
712
|
* Listens for when focus happens outside a react subtree.
|
|
713
713
|
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
714
|
-
*/ function $5cb92bef7577960e$var$useFocusOutside
|
|
715
|
-
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
714
|
+
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
715
|
+
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
716
716
|
const isFocusInsideReactTreeRef = React.useRef(false);
|
|
717
717
|
React.useEffect(()=>{
|
|
718
718
|
const handleFocus = (event)=>{
|
|
@@ -720,7 +720,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ React.forwardR
|
|
|
720
720
|
const eventDetail = {
|
|
721
721
|
originalEvent: event
|
|
722
722
|
};
|
|
723
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent
|
|
723
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
724
724
|
discrete: false
|
|
725
725
|
});
|
|
726
726
|
}
|
|
@@ -738,11 +738,11 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ React.forwardR
|
|
|
738
738
|
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
|
|
739
739
|
};
|
|
740
740
|
}
|
|
741
|
-
function $5cb92bef7577960e$var$dispatchUpdate
|
|
742
|
-
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE
|
|
741
|
+
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
742
|
+
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
743
743
|
document.dispatchEvent(event);
|
|
744
744
|
}
|
|
745
|
-
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent
|
|
745
|
+
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
746
746
|
const target = detail.originalEvent.target;
|
|
747
747
|
const event = new CustomEvent(name, {
|
|
748
748
|
bubbles: false,
|
|
@@ -752,7 +752,7 @@ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent$1(name, handler, det
|
|
|
752
752
|
if (handler) target.addEventListener(name, handler, {
|
|
753
753
|
once: true
|
|
754
754
|
});
|
|
755
|
-
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f
|
|
755
|
+
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
756
756
|
else target.dispatchEvent(event);
|
|
757
757
|
}
|
|
758
758
|
|
|
@@ -791,10 +791,10 @@ const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
|
791
791
|
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
792
792
|
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
|
793
793
|
const [container1, setContainer] = React.useState(null);
|
|
794
|
-
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
795
|
-
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
794
|
+
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
|
795
|
+
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
|
796
796
|
const lastFocusedElementRef = React.useRef(null);
|
|
797
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
797
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
|
|
798
798
|
);
|
|
799
799
|
const focusScope = React.useRef({
|
|
800
800
|
paused: false,
|
|
@@ -927,7 +927,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React.forwardRef
|
|
|
927
927
|
trapped,
|
|
928
928
|
focusScope.paused
|
|
929
929
|
]);
|
|
930
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
930
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
931
931
|
tabIndex: -1
|
|
932
932
|
}, scopeProps, {
|
|
933
933
|
ref: composedRefs,
|
|
@@ -1057,14 +1057,14 @@ function $d3863c46a17e8a28$var$removeLinks(items) {
|
|
|
1057
1057
|
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
1058
1058
|
*
|
|
1059
1059
|
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
1060
|
-
*/ const $9f79659886946c16$export$e5c5a5f917a5871c
|
|
1060
|
+
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? React.useLayoutEffect : ()=>{};
|
|
1061
1061
|
|
|
1062
1062
|
const $1746a345f3d73bb7$var$useReactId = React__namespace['useId'.toString()] || (()=>undefined
|
|
1063
1063
|
);
|
|
1064
1064
|
let $1746a345f3d73bb7$var$count = 0;
|
|
1065
1065
|
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
1066
1066
|
const [id, setId] = React__namespace.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
|
|
1067
|
-
$9f79659886946c16$export$e5c5a5f917a5871c
|
|
1067
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
1068
1068
|
if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
|
|
1069
1069
|
);
|
|
1070
1070
|
}, [
|
|
@@ -1415,7 +1415,7 @@ async function detectOverflow(state, options) {
|
|
|
1415
1415
|
* appears centered to the reference element.
|
|
1416
1416
|
* @see https://floating-ui.com/docs/arrow
|
|
1417
1417
|
*/
|
|
1418
|
-
const arrow$
|
|
1418
|
+
const arrow$2 = options => ({
|
|
1419
1419
|
name: 'arrow',
|
|
1420
1420
|
options,
|
|
1421
1421
|
async fn(state) {
|
|
@@ -2723,7 +2723,7 @@ const hide = hide$1;
|
|
|
2723
2723
|
* appears centered to the reference element.
|
|
2724
2724
|
* @see https://floating-ui.com/docs/arrow
|
|
2725
2725
|
*/
|
|
2726
|
-
const arrow$
|
|
2726
|
+
const arrow$1 = arrow$2;
|
|
2727
2727
|
|
|
2728
2728
|
/**
|
|
2729
2729
|
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
@@ -2759,7 +2759,7 @@ const computePosition = (reference, floating, options) => {
|
|
|
2759
2759
|
* This wraps the core `arrow` middleware to allow React refs as the element.
|
|
2760
2760
|
* @see https://floating-ui.com/docs/arrow
|
|
2761
2761
|
*/
|
|
2762
|
-
const arrow
|
|
2762
|
+
const arrow = options => {
|
|
2763
2763
|
function isRef(value) {
|
|
2764
2764
|
return {}.hasOwnProperty.call(value, 'current');
|
|
2765
2765
|
}
|
|
@@ -2773,14 +2773,14 @@ const arrow$1 = options => {
|
|
|
2773
2773
|
} = typeof options === 'function' ? options(state) : options;
|
|
2774
2774
|
if (element && isRef(element)) {
|
|
2775
2775
|
if (element.current != null) {
|
|
2776
|
-
return arrow$
|
|
2776
|
+
return arrow$1({
|
|
2777
2777
|
element: element.current,
|
|
2778
2778
|
padding
|
|
2779
2779
|
}).fn(state);
|
|
2780
2780
|
}
|
|
2781
2781
|
return {};
|
|
2782
2782
|
} else if (element) {
|
|
2783
|
-
return arrow$
|
|
2783
|
+
return arrow$1({
|
|
2784
2784
|
element,
|
|
2785
2785
|
padding
|
|
2786
2786
|
}).fn(state);
|
|
@@ -2790,11 +2790,11 @@ const arrow$1 = options => {
|
|
|
2790
2790
|
};
|
|
2791
2791
|
};
|
|
2792
2792
|
|
|
2793
|
-
var index$
|
|
2793
|
+
var index$1 = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
2794
2794
|
|
|
2795
2795
|
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
|
|
2796
2796
|
// functions
|
|
2797
|
-
function deepEqual
|
|
2797
|
+
function deepEqual(a, b) {
|
|
2798
2798
|
if (a === b) {
|
|
2799
2799
|
return true;
|
|
2800
2800
|
}
|
|
@@ -2810,7 +2810,7 @@ function deepEqual$1(a, b) {
|
|
|
2810
2810
|
length = a.length;
|
|
2811
2811
|
if (length != b.length) return false;
|
|
2812
2812
|
for (i = length; i-- !== 0;) {
|
|
2813
|
-
if (!deepEqual
|
|
2813
|
+
if (!deepEqual(a[i], b[i])) {
|
|
2814
2814
|
return false;
|
|
2815
2815
|
}
|
|
2816
2816
|
}
|
|
@@ -2831,7 +2831,7 @@ function deepEqual$1(a, b) {
|
|
|
2831
2831
|
if (key === '_owner' && a.$$typeof) {
|
|
2832
2832
|
continue;
|
|
2833
2833
|
}
|
|
2834
|
-
if (!deepEqual
|
|
2834
|
+
if (!deepEqual(a[key], b[key])) {
|
|
2835
2835
|
return false;
|
|
2836
2836
|
}
|
|
2837
2837
|
}
|
|
@@ -2853,9 +2853,9 @@ function roundByDPR(element, value) {
|
|
|
2853
2853
|
return Math.round(value * dpr) / dpr;
|
|
2854
2854
|
}
|
|
2855
2855
|
|
|
2856
|
-
function useLatestRef
|
|
2856
|
+
function useLatestRef(value) {
|
|
2857
2857
|
const ref = React__namespace.useRef(value);
|
|
2858
|
-
index$
|
|
2858
|
+
index$1(() => {
|
|
2859
2859
|
ref.current = value;
|
|
2860
2860
|
});
|
|
2861
2861
|
return ref;
|
|
@@ -2865,7 +2865,7 @@ function useLatestRef$1(value) {
|
|
|
2865
2865
|
* Provides data to position a floating element.
|
|
2866
2866
|
* @see https://floating-ui.com/docs/useFloating
|
|
2867
2867
|
*/
|
|
2868
|
-
function useFloating
|
|
2868
|
+
function useFloating(options) {
|
|
2869
2869
|
if (options === void 0) {
|
|
2870
2870
|
options = {};
|
|
2871
2871
|
}
|
|
@@ -2891,7 +2891,7 @@ function useFloating$1(options) {
|
|
|
2891
2891
|
isPositioned: false
|
|
2892
2892
|
});
|
|
2893
2893
|
const [latestMiddleware, setLatestMiddleware] = React__namespace.useState(middleware);
|
|
2894
|
-
if (!deepEqual
|
|
2894
|
+
if (!deepEqual(latestMiddleware, middleware)) {
|
|
2895
2895
|
setLatestMiddleware(middleware);
|
|
2896
2896
|
}
|
|
2897
2897
|
const [_reference, _setReference] = React__namespace.useState(null);
|
|
@@ -2913,8 +2913,8 @@ function useFloating$1(options) {
|
|
|
2913
2913
|
const referenceRef = React__namespace.useRef(null);
|
|
2914
2914
|
const floatingRef = React__namespace.useRef(null);
|
|
2915
2915
|
const dataRef = React__namespace.useRef(data);
|
|
2916
|
-
const whileElementsMountedRef = useLatestRef
|
|
2917
|
-
const platformRef = useLatestRef
|
|
2916
|
+
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
2917
|
+
const platformRef = useLatestRef(platform);
|
|
2918
2918
|
const update = React__namespace.useCallback(() => {
|
|
2919
2919
|
if (!referenceRef.current || !floatingRef.current) {
|
|
2920
2920
|
return;
|
|
@@ -2932,7 +2932,7 @@ function useFloating$1(options) {
|
|
|
2932
2932
|
...data,
|
|
2933
2933
|
isPositioned: true
|
|
2934
2934
|
};
|
|
2935
|
-
if (isMountedRef.current && !deepEqual
|
|
2935
|
+
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
2936
2936
|
dataRef.current = fullData;
|
|
2937
2937
|
ReactDOM__namespace.flushSync(() => {
|
|
2938
2938
|
setData(fullData);
|
|
@@ -2940,7 +2940,7 @@ function useFloating$1(options) {
|
|
|
2940
2940
|
}
|
|
2941
2941
|
});
|
|
2942
2942
|
}, [latestMiddleware, placement, strategy, platformRef]);
|
|
2943
|
-
index$
|
|
2943
|
+
index$1(() => {
|
|
2944
2944
|
if (open === false && dataRef.current.isPositioned) {
|
|
2945
2945
|
dataRef.current.isPositioned = false;
|
|
2946
2946
|
setData(data => ({
|
|
@@ -2950,13 +2950,13 @@ function useFloating$1(options) {
|
|
|
2950
2950
|
}
|
|
2951
2951
|
}, [open]);
|
|
2952
2952
|
const isMountedRef = React__namespace.useRef(false);
|
|
2953
|
-
index$
|
|
2953
|
+
index$1(() => {
|
|
2954
2954
|
isMountedRef.current = true;
|
|
2955
2955
|
return () => {
|
|
2956
2956
|
isMountedRef.current = false;
|
|
2957
2957
|
};
|
|
2958
2958
|
}, []);
|
|
2959
|
-
index$
|
|
2959
|
+
index$1(() => {
|
|
2960
2960
|
if (referenceEl) referenceRef.current = referenceEl;
|
|
2961
2961
|
if (floatingEl) floatingRef.current = floatingEl;
|
|
2962
2962
|
if (referenceEl && floatingEl) {
|
|
@@ -3012,9 +3012,9 @@ function useFloating$1(options) {
|
|
|
3012
3012
|
}), [data, update, refs, elements, floatingStyles]);
|
|
3013
3013
|
}
|
|
3014
3014
|
|
|
3015
|
-
const $7e8f5cd07187803e$export$21b07c8f274aebd5
|
|
3015
|
+
const $7e8f5cd07187803e$export$21b07c8f274aebd5 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
3016
3016
|
const { children: children , width: width = 10 , height: height = 5 , ...arrowProps } = props;
|
|
3017
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
3017
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.svg, _extends({}, arrowProps, {
|
|
3018
3018
|
ref: forwardedRef,
|
|
3019
3019
|
width: width,
|
|
3020
3020
|
height: height,
|
|
@@ -3024,11 +3024,11 @@ const $7e8f5cd07187803e$export$21b07c8f274aebd5$1 = /*#__PURE__*/ React.forwardR
|
|
|
3024
3024
|
points: "0,0 30,0 15,10"
|
|
3025
3025
|
}));
|
|
3026
3026
|
});
|
|
3027
|
-
/* -----------------------------------------------------------------------------------------------*/ const $7e8f5cd07187803e$export$be92b6f5f03c0fe9
|
|
3027
|
+
/* -----------------------------------------------------------------------------------------------*/ const $7e8f5cd07187803e$export$be92b6f5f03c0fe9 = $7e8f5cd07187803e$export$21b07c8f274aebd5;
|
|
3028
3028
|
|
|
3029
|
-
function $db6c3485150b8e66$export$1ab7ae714698c4b8
|
|
3029
|
+
function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
|
3030
3030
|
const [size, setSize] = React.useState(undefined);
|
|
3031
|
-
$9f79659886946c16$export$e5c5a5f917a5871c
|
|
3031
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3032
3032
|
if (element) {
|
|
3033
3033
|
// provide size as early as possible
|
|
3034
3034
|
setSize({
|
|
@@ -3075,13 +3075,13 @@ function $db6c3485150b8e66$export$1ab7ae714698c4b8$1(element) {
|
|
|
3075
3075
|
|
|
3076
3076
|
/* -------------------------------------------------------------------------------------------------
|
|
3077
3077
|
* Popper
|
|
3078
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$POPPER_NAME
|
|
3079
|
-
const [$cf1ac5d9fe0e8206$var$createPopperContext
|
|
3080
|
-
const [$cf1ac5d9fe0e8206$var$PopperProvider
|
|
3081
|
-
const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9
|
|
3078
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$POPPER_NAME = 'Popper';
|
|
3079
|
+
const [$cf1ac5d9fe0e8206$var$createPopperContext, $cf1ac5d9fe0e8206$export$722aac194ae923] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
3080
|
+
const [$cf1ac5d9fe0e8206$var$PopperProvider, $cf1ac5d9fe0e8206$var$usePopperContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
3081
|
+
const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 = (props)=>{
|
|
3082
3082
|
const { __scopePopper: __scopePopper , children: children } = props;
|
|
3083
3083
|
const [anchor, setAnchor] = React.useState(null);
|
|
3084
|
-
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperProvider
|
|
3084
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperProvider, {
|
|
3085
3085
|
scope: __scopePopper,
|
|
3086
3086
|
anchor: anchor,
|
|
3087
3087
|
onAnchorChange: setAnchor
|
|
@@ -3089,35 +3089,35 @@ const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9$1 = (props)=>{
|
|
|
3089
3089
|
};
|
|
3090
3090
|
/* -------------------------------------------------------------------------------------------------
|
|
3091
3091
|
* PopperAnchor
|
|
3092
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ANCHOR_NAME
|
|
3093
|
-
const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d
|
|
3092
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ANCHOR_NAME = 'PopperAnchor';
|
|
3093
|
+
const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
3094
3094
|
const { __scopePopper: __scopePopper , virtualRef: virtualRef , ...anchorProps } = props;
|
|
3095
|
-
const context = $cf1ac5d9fe0e8206$var$usePopperContext
|
|
3095
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME, __scopePopper);
|
|
3096
3096
|
const ref = React.useRef(null);
|
|
3097
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
3097
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
3098
3098
|
React.useEffect(()=>{
|
|
3099
3099
|
// Consumer can anchor the popper to something that isn't
|
|
3100
3100
|
// a DOM node e.g. pointer position, so we override the
|
|
3101
3101
|
// `anchorRef` with their virtual ref in this case.
|
|
3102
3102
|
context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
|
|
3103
3103
|
});
|
|
3104
|
-
return virtualRef ? null : /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
3104
|
+
return virtualRef ? null : /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, anchorProps, {
|
|
3105
3105
|
ref: composedRefs
|
|
3106
3106
|
}));
|
|
3107
3107
|
});
|
|
3108
3108
|
/* -------------------------------------------------------------------------------------------------
|
|
3109
3109
|
* PopperContent
|
|
3110
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$CONTENT_NAME
|
|
3111
|
-
const [$cf1ac5d9fe0e8206$var$PopperContentProvider
|
|
3112
|
-
const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc
|
|
3110
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$CONTENT_NAME = 'PopperContent';
|
|
3111
|
+
const [$cf1ac5d9fe0e8206$var$PopperContentProvider, $cf1ac5d9fe0e8206$var$useContentContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME);
|
|
3112
|
+
const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
3113
3113
|
var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$trans, _middlewareData$trans2, _middlewareData$hide;
|
|
3114
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;
|
|
3115
|
-
const context = $cf1ac5d9fe0e8206$var$usePopperContext
|
|
3115
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
|
|
3116
3116
|
const [content, setContent] = React.useState(null);
|
|
3117
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
3117
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
|
3118
3118
|
);
|
|
3119
|
-
const [arrow, setArrow] = React.useState(null);
|
|
3120
|
-
const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8$1
|
|
3119
|
+
const [arrow$1, setArrow] = React.useState(null);
|
|
3120
|
+
const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(arrow$1);
|
|
3121
3121
|
const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0;
|
|
3122
3122
|
const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0;
|
|
3123
3123
|
const desiredPlacement = side + (align !== 'center' ? '-' + align : '');
|
|
@@ -3134,11 +3134,11 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc$1 = /*#__PURE__*/ React.forwardRe
|
|
|
3134
3134
|
const hasExplicitBoundaries = boundary.length > 0;
|
|
3135
3135
|
const detectOverflowOptions = {
|
|
3136
3136
|
padding: collisionPadding,
|
|
3137
|
-
boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull
|
|
3137
|
+
boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull),
|
|
3138
3138
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
3139
3139
|
altBoundary: hasExplicitBoundaries
|
|
3140
3140
|
};
|
|
3141
|
-
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({
|
|
3142
3142
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
3143
3143
|
strategy: 'fixed',
|
|
3144
3144
|
placement: desiredPlacement,
|
|
@@ -3176,11 +3176,11 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc$1 = /*#__PURE__*/ React.forwardRe
|
|
|
3176
3176
|
contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`);
|
|
3177
3177
|
}
|
|
3178
3178
|
}),
|
|
3179
|
-
arrow && arrow
|
|
3180
|
-
element: arrow,
|
|
3179
|
+
arrow$1 && arrow({
|
|
3180
|
+
element: arrow$1,
|
|
3181
3181
|
padding: arrowPadding
|
|
3182
3182
|
}),
|
|
3183
|
-
$cf1ac5d9fe0e8206$var$transformOrigin
|
|
3183
|
+
$cf1ac5d9fe0e8206$var$transformOrigin({
|
|
3184
3184
|
arrowWidth: arrowWidth,
|
|
3185
3185
|
arrowHeight: arrowHeight
|
|
3186
3186
|
}),
|
|
@@ -3190,9 +3190,9 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc$1 = /*#__PURE__*/ React.forwardRe
|
|
|
3190
3190
|
})
|
|
3191
3191
|
]
|
|
3192
3192
|
});
|
|
3193
|
-
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement
|
|
3194
|
-
const handlePlaced = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
3195
|
-
$9f79659886946c16$export$e5c5a5f917a5871c
|
|
3193
|
+
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
3194
|
+
const handlePlaced = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPlaced);
|
|
3195
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3196
3196
|
if (isPositioned) handlePlaced === null || handlePlaced === void 0 || handlePlaced();
|
|
3197
3197
|
}, [
|
|
3198
3198
|
isPositioned,
|
|
@@ -3202,7 +3202,7 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc$1 = /*#__PURE__*/ React.forwardRe
|
|
|
3202
3202
|
const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y;
|
|
3203
3203
|
const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0;
|
|
3204
3204
|
const [contentZIndex, setContentZIndex] = React.useState();
|
|
3205
|
-
$9f79659886946c16$export$e5c5a5f917a5871c
|
|
3205
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3206
3206
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
3207
3207
|
}, [
|
|
3208
3208
|
content
|
|
@@ -3223,14 +3223,14 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc$1 = /*#__PURE__*/ React.forwardRe
|
|
|
3223
3223
|
} // Floating UI interally calculates logical alignment based the `dir` attribute on
|
|
3224
3224
|
,
|
|
3225
3225
|
dir: props.dir
|
|
3226
|
-
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperContentProvider
|
|
3226
|
+
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperContentProvider, {
|
|
3227
3227
|
scope: __scopePopper,
|
|
3228
3228
|
placedSide: placedSide,
|
|
3229
3229
|
onArrowChange: setArrow,
|
|
3230
3230
|
arrowX: arrowX,
|
|
3231
3231
|
arrowY: arrowY,
|
|
3232
3232
|
shouldHideArrow: cannotCenterArrow
|
|
3233
|
-
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
3233
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
3234
3234
|
"data-side": placedSide,
|
|
3235
3235
|
"data-align": placedAlign
|
|
3236
3236
|
}, contentProps, {
|
|
@@ -3247,17 +3247,17 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc$1 = /*#__PURE__*/ React.forwardRe
|
|
|
3247
3247
|
});
|
|
3248
3248
|
/* -------------------------------------------------------------------------------------------------
|
|
3249
3249
|
* PopperArrow
|
|
3250
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ARROW_NAME
|
|
3251
|
-
const $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE
|
|
3250
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ARROW_NAME = 'PopperArrow';
|
|
3251
|
+
const $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE = {
|
|
3252
3252
|
top: 'bottom',
|
|
3253
3253
|
right: 'left',
|
|
3254
3254
|
bottom: 'top',
|
|
3255
3255
|
left: 'right'
|
|
3256
3256
|
};
|
|
3257
|
-
const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0
|
|
3257
|
+
const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0 = /*#__PURE__*/ React.forwardRef(function $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0(props, forwardedRef) {
|
|
3258
3258
|
const { __scopePopper: __scopePopper , ...arrowProps } = props;
|
|
3259
|
-
const contentContext = $cf1ac5d9fe0e8206$var$useContentContext
|
|
3260
|
-
const baseSide = $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE
|
|
3259
|
+
const contentContext = $cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME, __scopePopper);
|
|
3260
|
+
const baseSide = $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE[contentContext.placedSide];
|
|
3261
3261
|
return(/*#__PURE__*/ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
3262
3262
|
// doesn't report size as we'd expect on SVG elements.
|
|
3263
3263
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
@@ -3282,7 +3282,7 @@ const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0$1 = /*#__PURE__*/ React.forwardR
|
|
|
3282
3282
|
}[contentContext.placedSide],
|
|
3283
3283
|
visibility: contentContext.shouldHideArrow ? 'hidden' : undefined
|
|
3284
3284
|
}
|
|
3285
|
-
}, /*#__PURE__*/ React.createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9
|
|
3285
|
+
}, /*#__PURE__*/ React.createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9, _extends({}, arrowProps, {
|
|
3286
3286
|
ref: forwardedRef,
|
|
3287
3287
|
style: {
|
|
3288
3288
|
...arrowProps.style,
|
|
@@ -3291,10 +3291,10 @@ const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0$1 = /*#__PURE__*/ React.forwardR
|
|
|
3291
3291
|
}
|
|
3292
3292
|
}))));
|
|
3293
3293
|
});
|
|
3294
|
-
/* -----------------------------------------------------------------------------------------------*/ function $cf1ac5d9fe0e8206$var$isNotNull
|
|
3294
|
+
/* -----------------------------------------------------------------------------------------------*/ function $cf1ac5d9fe0e8206$var$isNotNull(value) {
|
|
3295
3295
|
return value !== null;
|
|
3296
3296
|
}
|
|
3297
|
-
const $cf1ac5d9fe0e8206$var$transformOrigin
|
|
3297
|
+
const $cf1ac5d9fe0e8206$var$transformOrigin = (options)=>({
|
|
3298
3298
|
name: 'transformOrigin',
|
|
3299
3299
|
options: options,
|
|
3300
3300
|
fn (data) {
|
|
@@ -3304,7 +3304,7 @@ const $cf1ac5d9fe0e8206$var$transformOrigin$1 = (options)=>({
|
|
|
3304
3304
|
const isArrowHidden = cannotCenterArrow;
|
|
3305
3305
|
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
3306
3306
|
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
3307
|
-
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement
|
|
3307
|
+
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
3308
3308
|
const noArrowAlign = {
|
|
3309
3309
|
start: '0%',
|
|
3310
3310
|
center: '50%',
|
|
@@ -3336,27 +3336,27 @@ const $cf1ac5d9fe0e8206$var$transformOrigin$1 = (options)=>({
|
|
|
3336
3336
|
}
|
|
3337
3337
|
})
|
|
3338
3338
|
;
|
|
3339
|
-
function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement
|
|
3339
|
+
function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement) {
|
|
3340
3340
|
const [side, align = 'center'] = placement.split('-');
|
|
3341
3341
|
return [
|
|
3342
3342
|
side,
|
|
3343
3343
|
align
|
|
3344
3344
|
];
|
|
3345
3345
|
}
|
|
3346
|
-
const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9
|
|
3347
|
-
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7
|
|
3348
|
-
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2
|
|
3349
|
-
const $cf1ac5d9fe0e8206$export$21b07c8f274aebd5
|
|
3346
|
+
const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9;
|
|
3347
|
+
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
|
|
3348
|
+
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
|
|
3349
|
+
const $cf1ac5d9fe0e8206$export$21b07c8f274aebd5 = $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0;
|
|
3350
3350
|
|
|
3351
|
-
const $f1701beae083dbae$export$602eac185826482c
|
|
3351
|
+
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
3352
3352
|
var _globalThis$document;
|
|
3353
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;
|
|
3354
|
-
return container ? /*#__PURE__*/ ReactDOM.createPortal(/*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
3354
|
+
return container ? /*#__PURE__*/ ReactDOM.createPortal(/*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
|
3355
3355
|
ref: forwardedRef
|
|
3356
3356
|
})), container) : null;
|
|
3357
3357
|
});
|
|
3358
3358
|
|
|
3359
|
-
function $fe963b355347cc68$export$3e6543de14f8614f
|
|
3359
|
+
function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
|
|
3360
3360
|
return React.useReducer((state, event)=>{
|
|
3361
3361
|
const nextState = machine[state][event];
|
|
3362
3362
|
return nextState !== null && nextState !== void 0 ? nextState : state;
|
|
@@ -3364,28 +3364,28 @@ function $fe963b355347cc68$export$3e6543de14f8614f$1(initialState, machine) {
|
|
|
3364
3364
|
}
|
|
3365
3365
|
|
|
3366
3366
|
|
|
3367
|
-
const $921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
3367
|
+
const $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props)=>{
|
|
3368
3368
|
const { present: present , children: children } = props;
|
|
3369
|
-
const presence = $921a889cee6df7e8$var$usePresence
|
|
3369
|
+
const presence = $921a889cee6df7e8$var$usePresence(present);
|
|
3370
3370
|
const child = typeof children === 'function' ? children({
|
|
3371
3371
|
present: presence.isPresent
|
|
3372
3372
|
}) : React.Children.only(children);
|
|
3373
|
-
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
3373
|
+
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
|
|
3374
3374
|
const forceMount = typeof children === 'function';
|
|
3375
3375
|
return forceMount || presence.isPresent ? /*#__PURE__*/ React.cloneElement(child, {
|
|
3376
3376
|
ref: ref
|
|
3377
3377
|
}) : null;
|
|
3378
3378
|
};
|
|
3379
|
-
$921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
3379
|
+
$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
|
|
3380
3380
|
/* -------------------------------------------------------------------------------------------------
|
|
3381
3381
|
* usePresence
|
|
3382
|
-
* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence
|
|
3382
|
+
* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence(present) {
|
|
3383
3383
|
const [node1, setNode] = React.useState();
|
|
3384
3384
|
const stylesRef = React.useRef({});
|
|
3385
3385
|
const prevPresentRef = React.useRef(present);
|
|
3386
3386
|
const prevAnimationNameRef = React.useRef('none');
|
|
3387
3387
|
const initialState = present ? 'mounted' : 'unmounted';
|
|
3388
|
-
const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f
|
|
3388
|
+
const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
|
|
3389
3389
|
mounted: {
|
|
3390
3390
|
UNMOUNT: 'unmounted',
|
|
3391
3391
|
ANIMATION_OUT: 'unmountSuspended'
|
|
@@ -3399,18 +3399,18 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b$1.displayName = 'Presence';
|
|
|
3399
3399
|
}
|
|
3400
3400
|
});
|
|
3401
3401
|
React.useEffect(()=>{
|
|
3402
|
-
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName
|
|
3402
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
3403
3403
|
prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';
|
|
3404
3404
|
}, [
|
|
3405
3405
|
state
|
|
3406
3406
|
]);
|
|
3407
|
-
$9f79659886946c16$export$e5c5a5f917a5871c
|
|
3407
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3408
3408
|
const styles = stylesRef.current;
|
|
3409
3409
|
const wasPresent = prevPresentRef.current;
|
|
3410
3410
|
const hasPresentChanged = wasPresent !== present;
|
|
3411
3411
|
if (hasPresentChanged) {
|
|
3412
3412
|
const prevAnimationName = prevAnimationNameRef.current;
|
|
3413
|
-
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName
|
|
3413
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
|
|
3414
3414
|
if (present) send('MOUNT');
|
|
3415
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
|
|
3416
3416
|
// so we unmount instantly
|
|
@@ -3431,14 +3431,14 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b$1.displayName = 'Presence';
|
|
|
3431
3431
|
present,
|
|
3432
3432
|
send
|
|
3433
3433
|
]);
|
|
3434
|
-
$9f79659886946c16$export$e5c5a5f917a5871c
|
|
3434
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3435
3435
|
if (node1) {
|
|
3436
3436
|
/**
|
|
3437
3437
|
* Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`
|
|
3438
3438
|
* event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we
|
|
3439
3439
|
* make sure we only trigger ANIMATION_END for the currently active animation.
|
|
3440
3440
|
*/ const handleAnimationEnd = (event)=>{
|
|
3441
|
-
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName
|
|
3441
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
3442
3442
|
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
3443
3443
|
if (event.target === node1 && isCurrentAnimation) // With React 18 concurrency this update is applied
|
|
3444
3444
|
// a frame after the animation ends, creating a flash of visible content.
|
|
@@ -3448,7 +3448,7 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b$1.displayName = 'Presence';
|
|
|
3448
3448
|
};
|
|
3449
3449
|
const handleAnimationStart = (event)=>{
|
|
3450
3450
|
if (event.target === node1) // if animation occurred, store its name as the previous animation.
|
|
3451
|
-
prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName
|
|
3451
|
+
prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
3452
3452
|
};
|
|
3453
3453
|
node1.addEventListener('animationstart', handleAnimationStart);
|
|
3454
3454
|
node1.addEventListener('animationcancel', handleAnimationEnd);
|
|
@@ -3476,18 +3476,18 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b$1.displayName = 'Presence';
|
|
|
3476
3476
|
}, [])
|
|
3477
3477
|
};
|
|
3478
3478
|
}
|
|
3479
|
-
/* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName
|
|
3479
|
+
/* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName(styles) {
|
|
3480
3480
|
return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none';
|
|
3481
3481
|
}
|
|
3482
3482
|
|
|
3483
|
-
function $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
3484
|
-
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState
|
|
3483
|
+
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
|
|
3484
|
+
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
3485
3485
|
defaultProp: defaultProp,
|
|
3486
3486
|
onChange: onChange
|
|
3487
3487
|
});
|
|
3488
3488
|
const isControlled = prop !== undefined;
|
|
3489
3489
|
const value1 = isControlled ? prop : uncontrolledProp;
|
|
3490
|
-
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
3490
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
3491
3491
|
const setValue = React.useCallback((nextValue)=>{
|
|
3492
3492
|
if (isControlled) {
|
|
3493
3493
|
const setter = nextValue;
|
|
@@ -3505,11 +3505,11 @@ function $71cd76cc60e0454e$export$6f32135080cb4c3$1({ prop: prop , defaultProp:
|
|
|
3505
3505
|
setValue
|
|
3506
3506
|
];
|
|
3507
3507
|
}
|
|
3508
|
-
function $71cd76cc60e0454e$var$useUncontrolledState
|
|
3508
|
+
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
|
|
3509
3509
|
const uncontrolledState = React.useState(defaultProp);
|
|
3510
3510
|
const [value] = uncontrolledState;
|
|
3511
3511
|
const prevValueRef = React.useRef(value);
|
|
3512
|
-
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
3512
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
3513
3513
|
React.useEffect(()=>{
|
|
3514
3514
|
if (prevValueRef.current !== value) {
|
|
3515
3515
|
handleChange(value);
|
|
@@ -4361,22 +4361,22 @@ var $epM9y$RemoveScroll = ReactRemoveScroll;
|
|
|
4361
4361
|
/* -------------------------------------------------------------------------------------------------
|
|
4362
4362
|
* Popover
|
|
4363
4363
|
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$POPOVER_NAME = 'Popover';
|
|
4364
|
-
const [$cb5cc270b50c6fcd$var$createPopoverContext, $cb5cc270b50c6fcd$export$c8393c9e73286932] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
4365
|
-
$cf1ac5d9fe0e8206$export$722aac194ae923
|
|
4364
|
+
const [$cb5cc270b50c6fcd$var$createPopoverContext, $cb5cc270b50c6fcd$export$c8393c9e73286932] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cb5cc270b50c6fcd$var$POPOVER_NAME, [
|
|
4365
|
+
$cf1ac5d9fe0e8206$export$722aac194ae923
|
|
4366
4366
|
]);
|
|
4367
|
-
const $cb5cc270b50c6fcd$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923
|
|
4367
|
+
const $cb5cc270b50c6fcd$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923();
|
|
4368
4368
|
const [$cb5cc270b50c6fcd$var$PopoverProvider, $cb5cc270b50c6fcd$var$usePopoverContext] = $cb5cc270b50c6fcd$var$createPopoverContext($cb5cc270b50c6fcd$var$POPOVER_NAME);
|
|
4369
4369
|
const $cb5cc270b50c6fcd$export$5b6b19405a83ff9d = (props)=>{
|
|
4370
4370
|
const { __scopePopover: __scopePopover , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = false } = props;
|
|
4371
4371
|
const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover);
|
|
4372
4372
|
const triggerRef = React.useRef(null);
|
|
4373
4373
|
const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
|
|
4374
|
-
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
4374
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
4375
4375
|
prop: openProp,
|
|
4376
4376
|
defaultProp: defaultOpen,
|
|
4377
4377
|
onChange: onOpenChange
|
|
4378
4378
|
});
|
|
4379
|
-
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9
|
|
4379
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PopoverProvider, {
|
|
4380
4380
|
scope: __scopePopover,
|
|
4381
4381
|
contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
4382
4382
|
triggerRef: triggerRef,
|
|
@@ -4395,26 +4395,6 @@ const $cb5cc270b50c6fcd$export$5b6b19405a83ff9d = (props)=>{
|
|
|
4395
4395
|
modal: modal
|
|
4396
4396
|
}, children));
|
|
4397
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
|
-
});
|
|
4418
4398
|
/* -------------------------------------------------------------------------------------------------
|
|
4419
4399
|
* PopoverTrigger
|
|
4420
4400
|
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$TRIGGER_NAME = 'PopoverTrigger';
|
|
@@ -4422,8 +4402,8 @@ const $cb5cc270b50c6fcd$export$7dacb05d26466c3 = /*#__PURE__*/ React.forwardRef(
|
|
|
4422
4402
|
const { __scopePopover: __scopePopover , ...triggerProps } = props;
|
|
4423
4403
|
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$TRIGGER_NAME, __scopePopover);
|
|
4424
4404
|
const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover);
|
|
4425
|
-
const composedTriggerRef = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
4426
|
-
const trigger = /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
4405
|
+
const composedTriggerRef = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.triggerRef);
|
|
4406
|
+
const trigger = /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
4427
4407
|
type: "button",
|
|
4428
4408
|
"aria-haspopup": "dialog",
|
|
4429
4409
|
"aria-expanded": context.open,
|
|
@@ -4431,9 +4411,9 @@ const $cb5cc270b50c6fcd$export$7dacb05d26466c3 = /*#__PURE__*/ React.forwardRef(
|
|
|
4431
4411
|
"data-state": $cb5cc270b50c6fcd$var$getState(context.open)
|
|
4432
4412
|
}, triggerProps, {
|
|
4433
4413
|
ref: composedTriggerRef,
|
|
4434
|
-
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
4414
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onOpenToggle)
|
|
4435
4415
|
}));
|
|
4436
|
-
return context.hasCustomAnchor ? trigger : /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7
|
|
4416
|
+
return context.hasCustomAnchor ? trigger : /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({
|
|
4437
4417
|
asChild: true
|
|
4438
4418
|
}, popperScope), trigger);
|
|
4439
4419
|
});
|
|
@@ -4443,19 +4423,6 @@ const $cb5cc270b50c6fcd$export$7dacb05d26466c3 = /*#__PURE__*/ React.forwardRef(
|
|
|
4443
4423
|
const [$cb5cc270b50c6fcd$var$PortalProvider, $cb5cc270b50c6fcd$var$usePortalContext] = $cb5cc270b50c6fcd$var$createPopoverContext($cb5cc270b50c6fcd$var$PORTAL_NAME, {
|
|
4444
4424
|
forceMount: undefined
|
|
4445
4425
|
});
|
|
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
|
-
};
|
|
4459
4426
|
/* -------------------------------------------------------------------------------------------------
|
|
4460
4427
|
* PopoverContent
|
|
4461
4428
|
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$CONTENT_NAME = 'PopoverContent';
|
|
@@ -4463,7 +4430,7 @@ const $cb5cc270b50c6fcd$export$d7e1f420b25549ff = /*#__PURE__*/ React.forwardRef
|
|
|
4463
4430
|
const portalContext = $cb5cc270b50c6fcd$var$usePortalContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
|
|
4464
4431
|
const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
|
|
4465
4432
|
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
|
|
4466
|
-
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
4433
|
+
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
4467
4434
|
present: forceMount || context.open
|
|
4468
4435
|
}, context.modal ? /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PopoverContentModal, _extends({}, contentProps, {
|
|
4469
4436
|
ref: forwardedRef
|
|
@@ -4474,26 +4441,26 @@ const $cb5cc270b50c6fcd$export$d7e1f420b25549ff = /*#__PURE__*/ React.forwardRef
|
|
|
4474
4441
|
/* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$PopoverContentModal = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
4475
4442
|
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
|
|
4476
4443
|
const contentRef = React.useRef(null);
|
|
4477
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
4444
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef);
|
|
4478
4445
|
const isRightClickOutsideRef = React.useRef(false); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
4479
4446
|
React.useEffect(()=>{
|
|
4480
4447
|
const content = contentRef.current;
|
|
4481
4448
|
if (content) return hideOthers(content);
|
|
4482
4449
|
}, []);
|
|
4483
4450
|
return /*#__PURE__*/ React.createElement($epM9y$RemoveScroll, {
|
|
4484
|
-
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360
|
|
4451
|
+
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
4485
4452
|
allowPinchZoom: true
|
|
4486
4453
|
}, /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PopoverContentImpl, _extends({}, props, {
|
|
4487
4454
|
ref: composedRefs // we make sure we're not trapping once it's been closed
|
|
4488
4455
|
,
|
|
4489
4456
|
trapFocus: context.open,
|
|
4490
4457
|
disableOutsidePointerEvents: true,
|
|
4491
|
-
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
4458
|
+
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{
|
|
4492
4459
|
var _context$triggerRef$c;
|
|
4493
4460
|
event.preventDefault();
|
|
4494
4461
|
if (!isRightClickOutsideRef.current) (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
4495
4462
|
}),
|
|
4496
|
-
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
4463
|
+
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownOutside, (event)=>{
|
|
4497
4464
|
const originalEvent = event.detail.originalEvent;
|
|
4498
4465
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
4499
4466
|
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
@@ -4502,7 +4469,7 @@ const $cb5cc270b50c6fcd$export$d7e1f420b25549ff = /*#__PURE__*/ React.forwardRef
|
|
|
4502
4469
|
checkForDefaultPrevented: false
|
|
4503
4470
|
}) // When focus is trapped, a `focusout` event may still happen.
|
|
4504
4471
|
,
|
|
4505
|
-
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
4472
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault()
|
|
4506
4473
|
, {
|
|
4507
4474
|
checkForDefaultPrevented: false
|
|
4508
4475
|
})
|
|
@@ -4558,7 +4525,7 @@ const $cb5cc270b50c6fcd$var$PopoverContentNonModal = /*#__PURE__*/ React.forward
|
|
|
4558
4525
|
trapped: trapFocus,
|
|
4559
4526
|
onMountAutoFocus: onOpenAutoFocus,
|
|
4560
4527
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
4561
|
-
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22
|
|
4528
|
+
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, {
|
|
4562
4529
|
asChild: true,
|
|
4563
4530
|
disableOutsidePointerEvents: disableOutsidePointerEvents,
|
|
4564
4531
|
onInteractOutside: onInteractOutside,
|
|
@@ -4566,7 +4533,7 @@ const $cb5cc270b50c6fcd$var$PopoverContentNonModal = /*#__PURE__*/ React.forward
|
|
|
4566
4533
|
onPointerDownOutside: onPointerDownOutside,
|
|
4567
4534
|
onFocusOutside: onFocusOutside,
|
|
4568
4535
|
onDismiss: ()=>context.onOpenChange(false)
|
|
4569
|
-
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2
|
|
4536
|
+
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({
|
|
4570
4537
|
"data-state": $cb5cc270b50c6fcd$var$getState(context.open),
|
|
4571
4538
|
role: "dialog",
|
|
4572
4539
|
id: context.contentId
|
|
@@ -4582,24 +4549,10 @@ const $cb5cc270b50c6fcd$var$PopoverContentNonModal = /*#__PURE__*/ React.forward
|
|
|
4582
4549
|
}
|
|
4583
4550
|
}))));
|
|
4584
4551
|
});
|
|
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
|
-
});
|
|
4599
4552
|
const $cb5cc270b50c6fcd$export$3152841115e061b2 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
4600
4553
|
const { __scopePopover: __scopePopover , ...arrowProps } = props;
|
|
4601
4554
|
const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover);
|
|
4602
|
-
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5
|
|
4555
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5, _extends({}, popperScope, arrowProps, {
|
|
4603
4556
|
ref: forwardedRef
|
|
4604
4557
|
}));
|
|
4605
4558
|
});
|
|
@@ -4607,42 +4560,16 @@ const $cb5cc270b50c6fcd$export$3152841115e061b2 = /*#__PURE__*/ React.forwardRef
|
|
|
4607
4560
|
return open ? 'open' : 'closed';
|
|
4608
4561
|
}
|
|
4609
4562
|
const $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9 = $cb5cc270b50c6fcd$export$5b6b19405a83ff9d;
|
|
4610
|
-
const $cb5cc270b50c6fcd$export$b688253958b8dfe7 = $cb5cc270b50c6fcd$export$96e5381f42521a79;
|
|
4611
4563
|
const $cb5cc270b50c6fcd$export$41fb9f06171c75f4 = $cb5cc270b50c6fcd$export$7dacb05d26466c3;
|
|
4612
|
-
const $cb5cc270b50c6fcd$export$602eac185826482c = $cb5cc270b50c6fcd$export$dd679ffb4362d2d4;
|
|
4613
4564
|
const $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2 = $cb5cc270b50c6fcd$export$d7e1f420b25549ff;
|
|
4614
|
-
const $cb5cc270b50c6fcd$export$f39c2d165cd861fe = $cb5cc270b50c6fcd$export$d6ac43ebaa40d53e;
|
|
4615
4565
|
const $cb5cc270b50c6fcd$export$21b07c8f274aebd5 = $cb5cc270b50c6fcd$export$3152841115e061b2;
|
|
4616
4566
|
|
|
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
|
-
|
|
4636
4567
|
const borderStyles$3 = [
|
|
4637
4568
|
'tw-border-solid',
|
|
4638
4569
|
'tw-border',
|
|
4639
4570
|
'tw-rounded-sm',
|
|
4640
|
-
'
|
|
4641
|
-
'
|
|
4642
|
-
'active:tw-border-sq-sq-light-gray',
|
|
4643
|
-
'dark:hover:tw-border-sq-color-dark-dark',
|
|
4644
|
-
'dark:focus:tw-border-sq-color-dark-dark',
|
|
4645
|
-
'dark:active:tw-border-sq-color-dark-dark',
|
|
4571
|
+
'tw-border-sq-disabled-gray',
|
|
4572
|
+
'dark:tw-border-gray-500',
|
|
4646
4573
|
].join(' ');
|
|
4647
4574
|
const triggerBorderStyles = [
|
|
4648
4575
|
'tw-border-solid',
|
|
@@ -4701,7 +4628,8 @@ const ToolbarButton = ({ isSmall = false, label, icon, secondIcon, forceSmallIco
|
|
|
4701
4628
|
' tw-relative tw-z-[1000] tw-min-w-6 tw-p-[0.5rem] focus-visible:tw-outline-none tw-outline-none data-[state=open]:animate-in data-[state=closed]:animate-out' +
|
|
4702
4629
|
' data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2' +
|
|
4703
4630
|
borderStyles$3 },
|
|
4704
|
-
hasArrow && (React__namespace.createElement($cb5cc270b50c6fcd$export$21b07c8f274aebd5, {
|
|
4631
|
+
hasArrow && (React__namespace.createElement($cb5cc270b50c6fcd$export$21b07c8f274aebd5, { asChild: true },
|
|
4632
|
+
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" }))),
|
|
4705
4633
|
popoverContent))) : undefined));
|
|
4706
4634
|
};
|
|
4707
4635
|
|
|
@@ -4784,7 +4712,7 @@ const Checkbox = (props) => {
|
|
|
4784
4712
|
const assignedId = id ?? 'checkbox_' + Math.random();
|
|
4785
4713
|
const tooltipData = getQTipData(tooltipProps);
|
|
4786
4714
|
return (React.createElement("span", { className: `${alignment} ${extraClassNames}` },
|
|
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 }),
|
|
4715
|
+
React.createElement("input", { value: value, type: type, "data-testid": testId, name: name, id: assignedId, readOnly: !onChange, 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 }),
|
|
4788
4716
|
React.createElement("label", { htmlFor: assignedId, className: `${labelClasses} ${extraLabelClassNames} ${disabled
|
|
4789
4717
|
? 'tw-cursor-not-allowed dark:tw-text-sq-fairly-dark-gray tw-text-sq-fairly-dark-gray'
|
|
4790
4718
|
: 'tw-cursor-pointer tw-text-sq-text-color dark:tw-text-sq-dark-text'}` }, label)));
|
|
@@ -6639,7 +6567,7 @@ const QTip = () => {
|
|
|
6639
6567
|
if (tooltipRef.current && tooltipTarget.current) {
|
|
6640
6568
|
computePosition(tooltipTarget.current, tooltipRef.current, {
|
|
6641
6569
|
placement: position,
|
|
6642
|
-
middleware: [offset(10), arrow$
|
|
6570
|
+
middleware: [offset(10), arrow$1({ element: tooltipArrowRef.current })],
|
|
6643
6571
|
}).then(({ x, y, middlewareData }) => {
|
|
6644
6572
|
Object.assign(tooltipRef.current?.style, {
|
|
6645
6573
|
left: `${x}px`,
|
|
@@ -9631,7 +9559,7 @@ function _taggedTemplateLiteral(strings, raw) {
|
|
|
9631
9559
|
}));
|
|
9632
9560
|
}
|
|
9633
9561
|
|
|
9634
|
-
var index
|
|
9562
|
+
var index = React.useLayoutEffect ;
|
|
9635
9563
|
|
|
9636
9564
|
var _excluded$3 = ["className", "clearValue", "cx", "getStyles", "getClassNames", "getValue", "hasValue", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue", "theme"];
|
|
9637
9565
|
// ==============================
|
|
@@ -9885,10 +9813,10 @@ var options = {
|
|
|
9885
9813
|
}
|
|
9886
9814
|
};
|
|
9887
9815
|
// check for SSR
|
|
9888
|
-
var w
|
|
9889
|
-
if (w
|
|
9890
|
-
w
|
|
9891
|
-
w
|
|
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);
|
|
9892
9820
|
}
|
|
9893
9821
|
var supportsPassiveEvents = passiveOptionAccessed;
|
|
9894
9822
|
function notNullish(item) {
|
|
@@ -10130,7 +10058,7 @@ var MenuPlacer = function MenuPlacer(props) {
|
|
|
10130
10058
|
placement = _useState4[0],
|
|
10131
10059
|
setPlacement = _useState4[1];
|
|
10132
10060
|
var controlHeight = theme.spacing.controlHeight;
|
|
10133
|
-
index
|
|
10061
|
+
index(function () {
|
|
10134
10062
|
var menuEl = ref.current;
|
|
10135
10063
|
if (!menuEl) return;
|
|
10136
10064
|
|
|
@@ -10291,7 +10219,7 @@ var MenuPortal = function MenuPortal(props) {
|
|
|
10291
10219
|
});
|
|
10292
10220
|
}
|
|
10293
10221
|
}, [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]);
|
|
10294
|
-
index
|
|
10222
|
+
index(function () {
|
|
10295
10223
|
updateComputedPosition();
|
|
10296
10224
|
}, [updateComputedPosition]);
|
|
10297
10225
|
var runAutoUpdate = React.useCallback(function () {
|
|
@@ -10305,7 +10233,7 @@ var MenuPortal = function MenuPortal(props) {
|
|
|
10305
10233
|
});
|
|
10306
10234
|
}
|
|
10307
10235
|
}, [controlElement, updateComputedPosition]);
|
|
10308
|
-
index
|
|
10236
|
+
index(function () {
|
|
10309
10237
|
runAutoUpdate();
|
|
10310
10238
|
}, [runAutoUpdate]);
|
|
10311
10239
|
var setMenuPortalElement = React.useCallback(function (menuPortalElement) {
|
|
@@ -11505,8 +11433,8 @@ var anyDiacritic = new RegExp('[' + diacritics.map(function (d) {
|
|
|
11505
11433
|
return d.letters;
|
|
11506
11434
|
}).join('') + ']', 'g');
|
|
11507
11435
|
var diacriticToBase = {};
|
|
11508
|
-
for (var i
|
|
11509
|
-
var diacritic = diacritics[i
|
|
11436
|
+
for (var i = 0; i < diacritics.length; i++) {
|
|
11437
|
+
var diacritic = diacritics[i];
|
|
11510
11438
|
for (var j = 0; j < diacritic.letters.length; j++) {
|
|
11511
11439
|
diacriticToBase[diacritic.letters[j]] = diacritic.base;
|
|
11512
11440
|
}
|
|
@@ -13849,13 +13777,13 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
13849
13777
|
/* -------------------------------------------------------------------------------------------------
|
|
13850
13778
|
* Dialog
|
|
13851
13779
|
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DIALOG_NAME = 'Dialog';
|
|
13852
|
-
const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
13780
|
+
const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($5d3850c4d0b4e6c7$var$DIALOG_NAME);
|
|
13853
13781
|
const [$5d3850c4d0b4e6c7$var$DialogProvider, $5d3850c4d0b4e6c7$var$useDialogContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$DIALOG_NAME);
|
|
13854
13782
|
const $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 = (props)=>{
|
|
13855
13783
|
const { __scopeDialog: __scopeDialog , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props;
|
|
13856
13784
|
const triggerRef = React.useRef(null);
|
|
13857
13785
|
const contentRef = React.useRef(null);
|
|
13858
|
-
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
13786
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
13859
13787
|
prop: openProp,
|
|
13860
13788
|
defaultProp: defaultOpen,
|
|
13861
13789
|
onChange: onOpenChange
|
|
@@ -13889,9 +13817,9 @@ const $5d3850c4d0b4e6c7$export$dad7c95542bacce0 = (props)=>{
|
|
|
13889
13817
|
return /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$PortalProvider, {
|
|
13890
13818
|
scope: __scopeDialog,
|
|
13891
13819
|
forceMount: forceMount
|
|
13892
|
-
}, React.Children.map(children, (child)=>/*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
13820
|
+
}, React.Children.map(children, (child)=>/*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
13893
13821
|
present: forceMount || context.open
|
|
13894
|
-
}, /*#__PURE__*/ React.createElement($f1701beae083dbae$export$602eac185826482c
|
|
13822
|
+
}, /*#__PURE__*/ React.createElement($f1701beae083dbae$export$602eac185826482c, {
|
|
13895
13823
|
asChild: true,
|
|
13896
13824
|
container: container
|
|
13897
13825
|
}, child))
|
|
@@ -13904,7 +13832,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
13904
13832
|
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13905
13833
|
const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
|
|
13906
13834
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13907
|
-
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
13835
|
+
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
13908
13836
|
present: forceMount || context.open
|
|
13909
13837
|
}, context.modal ? /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$DialogContentModal, _extends({}, contentProps, {
|
|
13910
13838
|
ref: forwardedRef
|
|
@@ -13915,7 +13843,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
13915
13843
|
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentModal = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
13916
13844
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13917
13845
|
const contentRef = React.useRef(null);
|
|
13918
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
13846
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
13919
13847
|
React.useEffect(()=>{
|
|
13920
13848
|
const content = contentRef.current;
|
|
13921
13849
|
if (content) return hideOthers(content);
|
|
@@ -13925,12 +13853,12 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
13925
13853
|
,
|
|
13926
13854
|
trapFocus: context.open,
|
|
13927
13855
|
disableOutsidePointerEvents: true,
|
|
13928
|
-
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
13856
|
+
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{
|
|
13929
13857
|
var _context$triggerRef$c;
|
|
13930
13858
|
event.preventDefault();
|
|
13931
13859
|
(_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
13932
13860
|
}),
|
|
13933
|
-
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
13861
|
+
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownOutside, (event)=>{
|
|
13934
13862
|
const originalEvent = event.detail.originalEvent;
|
|
13935
13863
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
13936
13864
|
const isRightClick = originalEvent.button === 2 || ctrlLeftClick; // If the event is a right-click, we shouldn't close because
|
|
@@ -13938,7 +13866,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
13938
13866
|
if (isRightClick) event.preventDefault();
|
|
13939
13867
|
}) // When focus is trapped, a `focusout` event may still happen.
|
|
13940
13868
|
,
|
|
13941
|
-
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
13869
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault()
|
|
13942
13870
|
)
|
|
13943
13871
|
}));
|
|
13944
13872
|
});
|
|
@@ -13984,7 +13912,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
13984
13912
|
const { __scopeDialog: __scopeDialog , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props;
|
|
13985
13913
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, __scopeDialog);
|
|
13986
13914
|
const contentRef = React.useRef(null);
|
|
13987
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
13915
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
|
|
13988
13916
|
// the last element in the DOM (beacuse of the `Portal`)
|
|
13989
13917
|
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
13990
13918
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
@@ -13993,7 +13921,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
13993
13921
|
trapped: trapFocus,
|
|
13994
13922
|
onMountAutoFocus: onOpenAutoFocus,
|
|
13995
13923
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
13996
|
-
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22
|
|
13924
|
+
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, _extends({
|
|
13997
13925
|
role: "dialog",
|
|
13998
13926
|
id: context.contentId,
|
|
13999
13927
|
"aria-describedby": context.descriptionId,
|
|
@@ -14010,7 +13938,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
14010
13938
|
const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14011
13939
|
const { __scopeDialog: __scopeDialog , ...titleProps } = props;
|
|
14012
13940
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TITLE_NAME, __scopeDialog);
|
|
14013
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
13941
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.h2, _extends({
|
|
14014
13942
|
id: context.titleId
|
|
14015
13943
|
}, titleProps, {
|
|
14016
13944
|
ref: forwardedRef
|
|
@@ -14022,7 +13950,7 @@ const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ React.forwardRef
|
|
|
14022
13950
|
const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14023
13951
|
const { __scopeDialog: __scopeDialog , ...descriptionProps } = props;
|
|
14024
13952
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$DESCRIPTION_NAME, __scopeDialog);
|
|
14025
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
13953
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.p, _extends({
|
|
14026
13954
|
id: context.descriptionId
|
|
14027
13955
|
}, descriptionProps, {
|
|
14028
13956
|
ref: forwardedRef
|
|
@@ -14034,11 +13962,11 @@ const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ React.forwardRef
|
|
|
14034
13962
|
const $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14035
13963
|
const { __scopeDialog: __scopeDialog , ...closeProps } = props;
|
|
14036
13964
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CLOSE_NAME, __scopeDialog);
|
|
14037
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
13965
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
14038
13966
|
type: "button"
|
|
14039
13967
|
}, closeProps, {
|
|
14040
13968
|
ref: forwardedRef,
|
|
14041
|
-
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
13969
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, ()=>context.onOpenChange(false)
|
|
14042
13970
|
)
|
|
14043
13971
|
}));
|
|
14044
13972
|
});
|
|
@@ -14216,7 +14144,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
14216
14144
|
/* -----------------------------------------------------------------------------------------------
|
|
14217
14145
|
* CollectionProvider
|
|
14218
14146
|
* ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
|
|
14219
|
-
const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
14147
|
+
const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
|
|
14220
14148
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
14221
14149
|
collectionRef: {
|
|
14222
14150
|
current: null
|
|
@@ -14239,8 +14167,8 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
14239
14167
|
const CollectionSlot = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14240
14168
|
const { scope: scope , children: children } = props;
|
|
14241
14169
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
14242
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
14243
|
-
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360
|
|
14170
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
|
|
14171
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
14244
14172
|
ref: composedRefs
|
|
14245
14173
|
}, children);
|
|
14246
14174
|
});
|
|
@@ -14251,7 +14179,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
14251
14179
|
const CollectionItemSlot = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14252
14180
|
const { scope: scope , children: children , ...itemData } = props;
|
|
14253
14181
|
const ref = React.useRef(null);
|
|
14254
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
14182
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
14255
14183
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
14256
14184
|
React.useEffect(()=>{
|
|
14257
14185
|
context.itemMap.set(ref, {
|
|
@@ -14261,7 +14189,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
14261
14189
|
return ()=>void context.itemMap.delete(ref)
|
|
14262
14190
|
;
|
|
14263
14191
|
});
|
|
14264
|
-
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360
|
|
14192
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
14265
14193
|
[ITEM_DATA_ATTR]: '',
|
|
14266
14194
|
ref: composedRefs
|
|
14267
14195
|
}, children);
|
|
@@ -14310,7 +14238,7 @@ const $d7bdfb9eb0fdf311$var$EVENT_OPTIONS = {
|
|
|
14310
14238
|
* RovingFocusGroup
|
|
14311
14239
|
* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$GROUP_NAME = 'RovingFocusGroup';
|
|
14312
14240
|
const [$d7bdfb9eb0fdf311$var$Collection, $d7bdfb9eb0fdf311$var$useCollection, $d7bdfb9eb0fdf311$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($d7bdfb9eb0fdf311$var$GROUP_NAME);
|
|
14313
|
-
const [$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext, $d7bdfb9eb0fdf311$export$c7109489551a4f4] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
14241
|
+
const [$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext, $d7bdfb9eb0fdf311$export$c7109489551a4f4] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($d7bdfb9eb0fdf311$var$GROUP_NAME, [
|
|
14314
14242
|
$d7bdfb9eb0fdf311$var$createCollectionScope
|
|
14315
14243
|
]);
|
|
14316
14244
|
const [$d7bdfb9eb0fdf311$var$RovingFocusProvider, $d7bdfb9eb0fdf311$var$useRovingFocusContext] = $d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME);
|
|
@@ -14326,15 +14254,15 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ React.forwardRef
|
|
|
14326
14254
|
/* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14327
14255
|
const { __scopeRovingFocusGroup: __scopeRovingFocusGroup , orientation: orientation , loop: loop = false , dir: dir , currentTabStopId: currentTabStopIdProp , defaultCurrentTabStopId: defaultCurrentTabStopId , onCurrentTabStopIdChange: onCurrentTabStopIdChange , onEntryFocus: onEntryFocus , ...groupProps } = props;
|
|
14328
14256
|
const ref = React.useRef(null);
|
|
14329
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
14257
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
14330
14258
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
14331
|
-
const [currentTabStopId = null, setCurrentTabStopId] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
14259
|
+
const [currentTabStopId = null, setCurrentTabStopId] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14332
14260
|
prop: currentTabStopIdProp,
|
|
14333
14261
|
defaultProp: defaultCurrentTabStopId,
|
|
14334
14262
|
onChange: onCurrentTabStopIdChange
|
|
14335
14263
|
});
|
|
14336
14264
|
const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
|
|
14337
|
-
const handleEntryFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
14265
|
+
const handleEntryFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEntryFocus);
|
|
14338
14266
|
const getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup);
|
|
14339
14267
|
const isClickFocusRef = React.useRef(false);
|
|
14340
14268
|
const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);
|
|
@@ -14366,7 +14294,7 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ React.forwardRef
|
|
|
14366
14294
|
onFocusableItemRemove: React.useCallback(()=>setFocusableItemsCount((prevCount)=>prevCount - 1
|
|
14367
14295
|
)
|
|
14368
14296
|
, [])
|
|
14369
|
-
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14297
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14370
14298
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
14371
14299
|
"data-orientation": orientation
|
|
14372
14300
|
}, groupProps, {
|
|
@@ -14375,10 +14303,10 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ React.forwardRef
|
|
|
14375
14303
|
outline: 'none',
|
|
14376
14304
|
...props.style
|
|
14377
14305
|
},
|
|
14378
|
-
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14306
|
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, ()=>{
|
|
14379
14307
|
isClickFocusRef.current = true;
|
|
14380
14308
|
}),
|
|
14381
|
-
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14309
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, (event)=>{
|
|
14382
14310
|
// We normally wouldn't need this check, because we already check
|
|
14383
14311
|
// that the focus is on the current target and not bubbling to it.
|
|
14384
14312
|
// We do this because Safari doesn't focus buttons when clicked, and
|
|
@@ -14406,7 +14334,7 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ React.forwardRef
|
|
|
14406
14334
|
}
|
|
14407
14335
|
isClickFocusRef.current = false;
|
|
14408
14336
|
}),
|
|
14409
|
-
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14337
|
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, ()=>setIsTabbingBackOut(false)
|
|
14410
14338
|
)
|
|
14411
14339
|
})));
|
|
14412
14340
|
});
|
|
@@ -14437,20 +14365,20 @@ const $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = /*#__PURE__*/ React.forwardRef(
|
|
|
14437
14365
|
id: id,
|
|
14438
14366
|
focusable: focusable,
|
|
14439
14367
|
active: active
|
|
14440
|
-
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14368
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
14441
14369
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
14442
14370
|
"data-orientation": context.orientation
|
|
14443
14371
|
}, itemProps, {
|
|
14444
14372
|
ref: forwardedRef,
|
|
14445
|
-
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14373
|
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, (event)=>{
|
|
14446
14374
|
// We prevent focusing non-focusable items on `mousedown`.
|
|
14447
14375
|
// Even though the item has tabIndex={-1}, that only means take it out of the tab order.
|
|
14448
14376
|
if (!focusable) event.preventDefault(); // Safari doesn't focus a button when clicked so we run our logic on mousedown also
|
|
14449
14377
|
else context.onItemFocus(id);
|
|
14450
14378
|
}),
|
|
14451
|
-
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14379
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, ()=>context.onItemFocus(id)
|
|
14452
14380
|
),
|
|
14453
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14381
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
14454
14382
|
if (event.key === 'Tab' && event.shiftKey) {
|
|
14455
14383
|
context.onItemShiftTab();
|
|
14456
14384
|
return;
|
|
@@ -14527,7 +14455,7 @@ const $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2 = $d7bdfb9eb0fdf311$export$ab9df
|
|
|
14527
14455
|
/* -------------------------------------------------------------------------------------------------
|
|
14528
14456
|
* Tabs
|
|
14529
14457
|
* -----------------------------------------------------------------------------------------------*/ const $69cb30bb0017df05$var$TABS_NAME = 'Tabs';
|
|
14530
|
-
const [$69cb30bb0017df05$var$createTabsContext, $69cb30bb0017df05$export$355f5bd209d7b13a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
14458
|
+
const [$69cb30bb0017df05$var$createTabsContext, $69cb30bb0017df05$export$355f5bd209d7b13a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($69cb30bb0017df05$var$TABS_NAME, [
|
|
14531
14459
|
$d7bdfb9eb0fdf311$export$c7109489551a4f4
|
|
14532
14460
|
]);
|
|
14533
14461
|
const $69cb30bb0017df05$var$useRovingFocusGroupScope = $d7bdfb9eb0fdf311$export$c7109489551a4f4();
|
|
@@ -14535,7 +14463,7 @@ const [$69cb30bb0017df05$var$TabsProvider, $69cb30bb0017df05$var$useTabsContext]
|
|
|
14535
14463
|
const $69cb30bb0017df05$export$b2539bed5023c21c = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14536
14464
|
const { __scopeTabs: __scopeTabs , value: valueProp , onValueChange: onValueChange , defaultValue: defaultValue , orientation: orientation = 'horizontal' , dir: dir , activationMode: activationMode = 'automatic' , ...tabsProps } = props;
|
|
14537
14465
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
14538
|
-
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
14466
|
+
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14539
14467
|
prop: valueProp,
|
|
14540
14468
|
onChange: onValueChange,
|
|
14541
14469
|
defaultProp: defaultValue
|
|
@@ -14548,7 +14476,7 @@ const $69cb30bb0017df05$export$b2539bed5023c21c = /*#__PURE__*/ React.forwardRef
|
|
|
14548
14476
|
orientation: orientation,
|
|
14549
14477
|
dir: direction,
|
|
14550
14478
|
activationMode: activationMode
|
|
14551
|
-
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14479
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14552
14480
|
dir: direction,
|
|
14553
14481
|
"data-orientation": orientation
|
|
14554
14482
|
}, tabsProps, {
|
|
@@ -14568,7 +14496,7 @@ const $69cb30bb0017df05$export$9712d22edc0d78c1 = /*#__PURE__*/ React.forwardRef
|
|
|
14568
14496
|
orientation: context.orientation,
|
|
14569
14497
|
dir: context.dir,
|
|
14570
14498
|
loop: loop
|
|
14571
|
-
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14499
|
+
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14572
14500
|
role: "tablist",
|
|
14573
14501
|
"aria-orientation": context.orientation
|
|
14574
14502
|
}, listProps, {
|
|
@@ -14590,7 +14518,7 @@ const $69cb30bb0017df05$export$8114b9fdfdf9f3ba = /*#__PURE__*/ React.forwardRef
|
|
|
14590
14518
|
}, rovingFocusGroupScope, {
|
|
14591
14519
|
focusable: !disabled,
|
|
14592
14520
|
active: isSelected
|
|
14593
|
-
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14521
|
+
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
14594
14522
|
type: "button",
|
|
14595
14523
|
role: "tab",
|
|
14596
14524
|
"aria-selected": isSelected,
|
|
@@ -14601,20 +14529,20 @@ const $69cb30bb0017df05$export$8114b9fdfdf9f3ba = /*#__PURE__*/ React.forwardRef
|
|
|
14601
14529
|
id: triggerId
|
|
14602
14530
|
}, triggerProps, {
|
|
14603
14531
|
ref: forwardedRef,
|
|
14604
|
-
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14532
|
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, (event)=>{
|
|
14605
14533
|
// only call handler if it's the left button (mousedown gets triggered by all mouse buttons)
|
|
14606
14534
|
// but not when the control key is pressed (avoiding MacOS right click)
|
|
14607
14535
|
if (!disabled && event.button === 0 && event.ctrlKey === false) context.onValueChange(value);
|
|
14608
14536
|
else // prevent focus to avoid accidental activation
|
|
14609
14537
|
event.preventDefault();
|
|
14610
14538
|
}),
|
|
14611
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14539
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
14612
14540
|
if ([
|
|
14613
14541
|
' ',
|
|
14614
14542
|
'Enter'
|
|
14615
14543
|
].includes(event.key)) context.onValueChange(value);
|
|
14616
14544
|
}),
|
|
14617
|
-
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14545
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, ()=>{
|
|
14618
14546
|
// handle "automatic" activation if necessary
|
|
14619
14547
|
// ie. activate tab following focus
|
|
14620
14548
|
const isAutomaticActivation = context.activationMode !== 'manual';
|
|
@@ -14638,9 +14566,9 @@ const $69cb30bb0017df05$export$bd905d70e8fd2ebb = /*#__PURE__*/ React.forwardRef
|
|
|
14638
14566
|
return ()=>cancelAnimationFrame(rAF)
|
|
14639
14567
|
;
|
|
14640
14568
|
}, []);
|
|
14641
|
-
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
14569
|
+
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
14642
14570
|
present: forceMount || isSelected
|
|
14643
|
-
}, ({ present: present })=>/*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14571
|
+
}, ({ present: present })=>/*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14644
14572
|
"data-state": isSelected ? 'active' : 'inactive',
|
|
14645
14573
|
"data-orientation": context.orientation,
|
|
14646
14574
|
role: "tabpanel",
|
|
@@ -14689,11 +14617,11 @@ const Tabs = ({ tabs, defaultActiveTab, activeTab, onTabSelect, extraClassNames,
|
|
|
14689
14617
|
/* -------------------------------------------------------------------------------------------------
|
|
14690
14618
|
* Collapsible
|
|
14691
14619
|
* -----------------------------------------------------------------------------------------------*/ const $409067139f391064$var$COLLAPSIBLE_NAME = 'Collapsible';
|
|
14692
|
-
const [$409067139f391064$var$createCollapsibleContext, $409067139f391064$export$952b32dcbe73087a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
14620
|
+
const [$409067139f391064$var$createCollapsibleContext, $409067139f391064$export$952b32dcbe73087a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($409067139f391064$var$COLLAPSIBLE_NAME);
|
|
14693
14621
|
const [$409067139f391064$var$CollapsibleProvider, $409067139f391064$var$useCollapsibleContext] = $409067139f391064$var$createCollapsibleContext($409067139f391064$var$COLLAPSIBLE_NAME);
|
|
14694
14622
|
const $409067139f391064$export$6eb0f7ddcda6131f = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14695
14623
|
const { __scopeCollapsible: __scopeCollapsible , open: openProp , defaultOpen: defaultOpen , disabled: disabled , onOpenChange: onOpenChange , ...collapsibleProps } = props;
|
|
14696
|
-
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
14624
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14697
14625
|
prop: openProp,
|
|
14698
14626
|
defaultProp: defaultOpen,
|
|
14699
14627
|
onChange: onOpenChange
|
|
@@ -14708,7 +14636,7 @@ const $409067139f391064$export$6eb0f7ddcda6131f = /*#__PURE__*/ React.forwardRef
|
|
|
14708
14636
|
, [
|
|
14709
14637
|
setOpen
|
|
14710
14638
|
])
|
|
14711
|
-
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14639
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14712
14640
|
"data-state": $409067139f391064$var$getState(open),
|
|
14713
14641
|
"data-disabled": disabled ? '' : undefined
|
|
14714
14642
|
}, collapsibleProps, {
|
|
@@ -14721,7 +14649,7 @@ const $409067139f391064$export$6eb0f7ddcda6131f = /*#__PURE__*/ React.forwardRef
|
|
|
14721
14649
|
const $409067139f391064$export$c135dce7b15bbbdc = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14722
14650
|
const { __scopeCollapsible: __scopeCollapsible , ...triggerProps } = props;
|
|
14723
14651
|
const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$TRIGGER_NAME, __scopeCollapsible);
|
|
14724
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14652
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
14725
14653
|
type: "button",
|
|
14726
14654
|
"aria-controls": context.contentId,
|
|
14727
14655
|
"aria-expanded": context.open || false,
|
|
@@ -14730,7 +14658,7 @@ const $409067139f391064$export$c135dce7b15bbbdc = /*#__PURE__*/ React.forwardRef
|
|
|
14730
14658
|
disabled: context.disabled
|
|
14731
14659
|
}, triggerProps, {
|
|
14732
14660
|
ref: forwardedRef,
|
|
14733
|
-
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14661
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onOpenToggle)
|
|
14734
14662
|
}));
|
|
14735
14663
|
});
|
|
14736
14664
|
/* -------------------------------------------------------------------------------------------------
|
|
@@ -14739,7 +14667,7 @@ const $409067139f391064$export$c135dce7b15bbbdc = /*#__PURE__*/ React.forwardRef
|
|
|
14739
14667
|
const $409067139f391064$export$aadde00976f34151 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14740
14668
|
const { forceMount: forceMount , ...contentProps } = props;
|
|
14741
14669
|
const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, props.__scopeCollapsible);
|
|
14742
|
-
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
14670
|
+
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
14743
14671
|
present: forceMount || context.open
|
|
14744
14672
|
}, ({ present: present })=>/*#__PURE__*/ React.createElement($409067139f391064$var$CollapsibleContentImpl, _extends({}, contentProps, {
|
|
14745
14673
|
ref: forwardedRef,
|
|
@@ -14752,7 +14680,7 @@ const $409067139f391064$export$aadde00976f34151 = /*#__PURE__*/ React.forwardRef
|
|
|
14752
14680
|
const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, __scopeCollapsible);
|
|
14753
14681
|
const [isPresent, setIsPresent] = React.useState(present);
|
|
14754
14682
|
const ref = React.useRef(null);
|
|
14755
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
14683
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
14756
14684
|
const heightRef = React.useRef(0);
|
|
14757
14685
|
const height = heightRef.current;
|
|
14758
14686
|
const widthRef = React.useRef(0);
|
|
@@ -14767,7 +14695,7 @@ const $409067139f391064$export$aadde00976f34151 = /*#__PURE__*/ React.forwardRef
|
|
|
14767
14695
|
return ()=>cancelAnimationFrame(rAF)
|
|
14768
14696
|
;
|
|
14769
14697
|
}, []);
|
|
14770
|
-
$9f79659886946c16$export$e5c5a5f917a5871c
|
|
14698
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
14771
14699
|
const node = ref.current;
|
|
14772
14700
|
if (node) {
|
|
14773
14701
|
originalStylesRef.current = originalStylesRef.current || {
|
|
@@ -14794,7 +14722,7 @@ const $409067139f391064$export$aadde00976f34151 = /*#__PURE__*/ React.forwardRef
|
|
|
14794
14722
|
context.open,
|
|
14795
14723
|
present
|
|
14796
14724
|
]);
|
|
14797
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14725
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14798
14726
|
"data-state": $409067139f391064$var$getState(context.open),
|
|
14799
14727
|
"data-disabled": context.disabled ? '' : undefined,
|
|
14800
14728
|
id: context.contentId,
|
|
@@ -14827,7 +14755,7 @@ const $1bf158f521e1b1b4$var$ACCORDION_KEYS = [
|
|
|
14827
14755
|
'ArrowRight'
|
|
14828
14756
|
];
|
|
14829
14757
|
const [$1bf158f521e1b1b4$var$Collection, $1bf158f521e1b1b4$var$useCollection, $1bf158f521e1b1b4$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($1bf158f521e1b1b4$var$ACCORDION_NAME);
|
|
14830
|
-
const [$1bf158f521e1b1b4$var$createAccordionContext, $1bf158f521e1b1b4$export$9748edc328a73be1] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
14758
|
+
const [$1bf158f521e1b1b4$var$createAccordionContext, $1bf158f521e1b1b4$export$9748edc328a73be1] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($1bf158f521e1b1b4$var$ACCORDION_NAME, [
|
|
14831
14759
|
$1bf158f521e1b1b4$var$createCollectionScope,
|
|
14832
14760
|
$409067139f391064$export$952b32dcbe73087a
|
|
14833
14761
|
]);
|
|
@@ -14862,7 +14790,7 @@ const [$1bf158f521e1b1b4$var$AccordionCollapsibleProvider, $1bf158f521e1b1b4$var
|
|
|
14862
14790
|
});
|
|
14863
14791
|
const $1bf158f521e1b1b4$var$AccordionImplSingle = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14864
14792
|
const { value: valueProp , defaultValue: defaultValue , onValueChange: onValueChange = ()=>{} , collapsible: collapsible = false , ...accordionSingleProps } = props;
|
|
14865
|
-
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
14793
|
+
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14866
14794
|
prop: valueProp,
|
|
14867
14795
|
defaultProp: defaultValue,
|
|
14868
14796
|
onChange: onValueChange
|
|
@@ -14887,7 +14815,7 @@ const $1bf158f521e1b1b4$var$AccordionImplSingle = /*#__PURE__*/ React.forwardRef
|
|
|
14887
14815
|
});
|
|
14888
14816
|
/* -----------------------------------------------------------------------------------------------*/ const $1bf158f521e1b1b4$var$AccordionImplMultiple = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14889
14817
|
const { value: valueProp , defaultValue: defaultValue , onValueChange: onValueChange = ()=>{} , ...accordionMultipleProps } = props;
|
|
14890
|
-
const [value1 = [], setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
14818
|
+
const [value1 = [], setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14891
14819
|
prop: valueProp,
|
|
14892
14820
|
defaultProp: defaultValue,
|
|
14893
14821
|
onChange: onValueChange
|
|
@@ -14922,11 +14850,11 @@ const $1bf158f521e1b1b4$var$AccordionImplSingle = /*#__PURE__*/ React.forwardRef
|
|
|
14922
14850
|
const $1bf158f521e1b1b4$var$AccordionImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
14923
14851
|
const { __scopeAccordion: __scopeAccordion , disabled: disabled , dir: dir , orientation: orientation = 'vertical' , ...accordionProps } = props;
|
|
14924
14852
|
const accordionRef = React.useRef(null);
|
|
14925
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
14853
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(accordionRef, forwardedRef);
|
|
14926
14854
|
const getItems = $1bf158f521e1b1b4$var$useCollection(__scopeAccordion);
|
|
14927
14855
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
14928
14856
|
const isDirectionLTR = direction === 'ltr';
|
|
14929
|
-
const handleKeyDown = $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14857
|
+
const handleKeyDown = $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
14930
14858
|
var _triggerCollection$cl;
|
|
14931
14859
|
if (!$1bf158f521e1b1b4$var$ACCORDION_KEYS.includes(event.key)) return;
|
|
14932
14860
|
const target = event.target;
|
|
@@ -14986,7 +14914,7 @@ const $1bf158f521e1b1b4$var$AccordionImpl = /*#__PURE__*/ React.forwardRef((prop
|
|
|
14986
14914
|
orientation: orientation
|
|
14987
14915
|
}, /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$Collection.Slot, {
|
|
14988
14916
|
scope: __scopeAccordion
|
|
14989
|
-
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14917
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, accordionProps, {
|
|
14990
14918
|
"data-orientation": orientation,
|
|
14991
14919
|
ref: composedRefs,
|
|
14992
14920
|
onKeyDown: disabled ? undefined : handleKeyDown
|
|
@@ -15083,1630 +15011,97 @@ const Accordion = ({ accordionItems, defaultValue, value, onItemSelect, disabled
|
|
|
15083
15011
|
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))))));
|
|
15084
15012
|
};
|
|
15085
15013
|
|
|
15086
|
-
|
|
15087
|
-
|
|
15088
|
-
|
|
15089
|
-
|
|
15090
|
-
|
|
15091
|
-
|
|
15014
|
+
const bgStyles$1 = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
15015
|
+
const borderStyles$1 = [
|
|
15016
|
+
'tw-border-solid',
|
|
15017
|
+
'tw-border',
|
|
15018
|
+
'tw-rounded-sm',
|
|
15019
|
+
'tw-border-sq-disabled-gray',
|
|
15020
|
+
'dark:tw-border-gray-500',
|
|
15021
|
+
].join(' ');
|
|
15022
|
+
const disabledClasses$1 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
15023
|
+
const ButtonWithPopover = ({ children, trigger, id, hasArrow, extraTriggerClassNames, extraPopoverClassNames, containerTestId, onInteractOutside, onPointerDownOutside, disabled = false, align = 'end', alignOffset = -35, placement = 'bottom', placementOffset = 2, isHoverEnabled = false, hoverOpenDelay = 300, onOpenChange, isOpen, isCloseOnContentClick = false, setFocusOnTriggerOnClose = true, ...tooltipProps }) => {
|
|
15024
|
+
const tooltipData = getQTipData(tooltipProps);
|
|
15025
|
+
let timeout;
|
|
15026
|
+
const [isHoveredOpen, setIsHoveredOpen] = React__namespace.useState(false);
|
|
15027
|
+
const onHoverStart = () => {
|
|
15028
|
+
if (isHoverEnabled) {
|
|
15029
|
+
timeout = setTimeout(() => {
|
|
15030
|
+
setIsHoveredOpen(true);
|
|
15031
|
+
onOpenChange && onOpenChange(true);
|
|
15032
|
+
}, hoverOpenDelay);
|
|
15033
|
+
}
|
|
15034
|
+
};
|
|
15035
|
+
const onHoverEnd = () => {
|
|
15036
|
+
if (isHoverEnabled) {
|
|
15037
|
+
timeout = setTimeout(() => {
|
|
15038
|
+
setIsHoveredOpen(false);
|
|
15039
|
+
onOpenChange && onOpenChange(false);
|
|
15040
|
+
}, 200);
|
|
15041
|
+
}
|
|
15042
|
+
};
|
|
15043
|
+
React__namespace.useEffect(() => () => timeout && clearTimeout(timeout), []);
|
|
15044
|
+
const renderPopover = (popoverOpenState) => {
|
|
15045
|
+
return (React__namespace.createElement($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, { open: popoverOpenState, defaultOpen: false, onOpenChange: onOpenChange },
|
|
15046
|
+
React__namespace.createElement($cb5cc270b50c6fcd$export$41fb9f06171c75f4, { id: id, className: `tw-border-none`, disabled: disabled },
|
|
15047
|
+
React__namespace.createElement("div", { ...tooltipData, onMouseOver: onHoverStart, onMouseOut: onHoverEnd, className: `tw-bg-transparent tw-flex tw-flex-col tw-items-center tw-justify-center focus-visible:tw-outline-none tw-outline-none ${disabled ? disabledClasses$1 : ''} ${extraTriggerClassNames || ''}` }, trigger)),
|
|
15048
|
+
React__namespace.createElement($cb5cc270b50c6fcd$export$7c6e2c02157bb7d2, { sideOffset: placementOffset, align: align, side: placement, onInteractOutside: onInteractOutside, onPointerDownOutside: onPointerDownOutside, alignOffset: isHoverEnabled ? -10 : alignOffset, asChild: true, onClick: () => isCloseOnContentClick && onOpenChange && onOpenChange(false), className: "focus-visible:tw-outline-none tw-outline-none" },
|
|
15049
|
+
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
|
|
15050
|
+
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
|
|
15051
|
+
${extraPopoverClassNames || ''}` },
|
|
15052
|
+
hasArrow && (React__namespace.createElement($cb5cc270b50c6fcd$export$21b07c8f274aebd5, { asChild: true },
|
|
15053
|
+
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" }))),
|
|
15054
|
+
children))));
|
|
15055
|
+
};
|
|
15056
|
+
return isHoverEnabled ? renderPopover(isHoveredOpen) : renderPopover(isOpen);
|
|
15057
|
+
};
|
|
15092
15058
|
|
|
15093
|
-
|
|
15094
|
-
|
|
15095
|
-
|
|
15096
|
-
|
|
15097
|
-
|
|
15098
|
-
|
|
15099
|
-
|
|
15100
|
-
|
|
15101
|
-
|
|
15102
|
-
|
|
15103
|
-
|
|
15104
|
-
|
|
15105
|
-
|
|
15106
|
-
|
|
15107
|
-
|
|
15108
|
-
|
|
15109
|
-
|
|
15110
|
-
|
|
15111
|
-
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
|
|
15115
|
-
|
|
15116
|
-
|
|
15117
|
-
|
|
15118
|
-
|
|
15119
|
-
|
|
15120
|
-
|
|
15121
|
-
|
|
15122
|
-
|
|
15123
|
-
|
|
15124
|
-
|
|
15125
|
-
|
|
15126
|
-
|
|
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
|
-
];
|
|
15059
|
+
const $6cc32821e9371a1c$var$SELECTION_KEYS = [
|
|
15060
|
+
'Enter',
|
|
15061
|
+
' '
|
|
15062
|
+
];
|
|
15063
|
+
const $6cc32821e9371a1c$var$FIRST_KEYS = [
|
|
15064
|
+
'ArrowDown',
|
|
15065
|
+
'PageUp',
|
|
15066
|
+
'Home'
|
|
15067
|
+
];
|
|
15068
|
+
const $6cc32821e9371a1c$var$LAST_KEYS = [
|
|
15069
|
+
'ArrowUp',
|
|
15070
|
+
'PageDown',
|
|
15071
|
+
'End'
|
|
15072
|
+
];
|
|
15073
|
+
const $6cc32821e9371a1c$var$FIRST_LAST_KEYS = [
|
|
15074
|
+
...$6cc32821e9371a1c$var$FIRST_KEYS,
|
|
15075
|
+
...$6cc32821e9371a1c$var$LAST_KEYS
|
|
15076
|
+
];
|
|
15077
|
+
const $6cc32821e9371a1c$var$SUB_OPEN_KEYS = {
|
|
15078
|
+
ltr: [
|
|
15079
|
+
...$6cc32821e9371a1c$var$SELECTION_KEYS,
|
|
15080
|
+
'ArrowRight'
|
|
15081
|
+
],
|
|
15082
|
+
rtl: [
|
|
15083
|
+
...$6cc32821e9371a1c$var$SELECTION_KEYS,
|
|
15084
|
+
'ArrowLeft'
|
|
15085
|
+
]
|
|
15086
|
+
};
|
|
15087
|
+
const $6cc32821e9371a1c$var$SUB_CLOSE_KEYS = {
|
|
15088
|
+
ltr: [
|
|
15089
|
+
'ArrowLeft'
|
|
15090
|
+
],
|
|
15091
|
+
rtl: [
|
|
15092
|
+
'ArrowRight'
|
|
15093
|
+
]
|
|
15094
|
+
};
|
|
16700
15095
|
/* -------------------------------------------------------------------------------------------------
|
|
16701
15096
|
* Menu
|
|
16702
15097
|
* -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$MENU_NAME = 'Menu';
|
|
16703
15098
|
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
|
|
15099
|
+
const [$6cc32821e9371a1c$var$createMenuContext, $6cc32821e9371a1c$export$4027731b685e72eb] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($6cc32821e9371a1c$var$MENU_NAME, [
|
|
16705
15100
|
$6cc32821e9371a1c$var$createCollectionScope,
|
|
16706
|
-
$cf1ac5d9fe0e8206$export$722aac194ae923
|
|
15101
|
+
$cf1ac5d9fe0e8206$export$722aac194ae923,
|
|
16707
15102
|
$d7bdfb9eb0fdf311$export$c7109489551a4f4
|
|
16708
15103
|
]);
|
|
16709
|
-
const $6cc32821e9371a1c$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923
|
|
15104
|
+
const $6cc32821e9371a1c$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923();
|
|
16710
15105
|
const $6cc32821e9371a1c$var$useRovingFocusGroupScope = $d7bdfb9eb0fdf311$export$c7109489551a4f4();
|
|
16711
15106
|
const [$6cc32821e9371a1c$var$MenuProvider, $6cc32821e9371a1c$var$useMenuContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$MENU_NAME);
|
|
16712
15107
|
const [$6cc32821e9371a1c$var$MenuRootProvider, $6cc32821e9371a1c$var$useMenuRootContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$MENU_NAME);
|
|
@@ -16715,7 +15110,7 @@ const $6cc32821e9371a1c$export$d9b273488cd8ce6f = (props)=>{
|
|
|
16715
15110
|
const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);
|
|
16716
15111
|
const [content, setContent] = React.useState(null);
|
|
16717
15112
|
const isUsingKeyboardRef = React.useRef(false);
|
|
16718
|
-
const handleOpenChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
15113
|
+
const handleOpenChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onOpenChange);
|
|
16719
15114
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
16720
15115
|
React.useEffect(()=>{
|
|
16721
15116
|
// Capture phase ensures we set the boolean before any side effects execute
|
|
@@ -16748,7 +15143,7 @@ const $6cc32821e9371a1c$export$d9b273488cd8ce6f = (props)=>{
|
|
|
16748
15143
|
});
|
|
16749
15144
|
};
|
|
16750
15145
|
}, []);
|
|
16751
|
-
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9
|
|
15146
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$MenuProvider, {
|
|
16752
15147
|
scope: __scopeMenu,
|
|
16753
15148
|
open: open,
|
|
16754
15149
|
onOpenChange: handleOpenChange,
|
|
@@ -16768,7 +15163,7 @@ const $6cc32821e9371a1c$export$d9b273488cd8ce6f = (props)=>{
|
|
|
16768
15163
|
const $6cc32821e9371a1c$export$9fa5ebd18bee4d43 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
16769
15164
|
const { __scopeMenu: __scopeMenu , ...anchorProps } = props;
|
|
16770
15165
|
const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);
|
|
16771
|
-
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7
|
|
15166
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({}, popperScope, anchorProps, {
|
|
16772
15167
|
ref: forwardedRef
|
|
16773
15168
|
}));
|
|
16774
15169
|
});
|
|
@@ -16789,7 +15184,7 @@ const $6cc32821e9371a1c$export$479f0f2f71193efe = /*#__PURE__*/ React.forwardRef
|
|
|
16789
15184
|
const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);
|
|
16790
15185
|
return /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$Collection.Provider, {
|
|
16791
15186
|
scope: props.__scopeMenu
|
|
16792
|
-
}, /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
15187
|
+
}, /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
16793
15188
|
present: forceMount || context.open
|
|
16794
15189
|
}, /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$Collection.Slot, {
|
|
16795
15190
|
scope: props.__scopeMenu
|
|
@@ -16802,7 +15197,7 @@ const $6cc32821e9371a1c$export$479f0f2f71193efe = /*#__PURE__*/ React.forwardRef
|
|
|
16802
15197
|
/* ---------------------------------------------------------------------------------------------- */ const $6cc32821e9371a1c$var$MenuRootContentModal = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
16803
15198
|
const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);
|
|
16804
15199
|
const ref = React.useRef(null);
|
|
16805
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
15200
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref); // Hide everything from ARIA except the `MenuContent`
|
|
16806
15201
|
React.useEffect(()=>{
|
|
16807
15202
|
const content = ref.current;
|
|
16808
15203
|
if (content) return hideOthers(content);
|
|
@@ -16815,7 +15210,7 @@ const $6cc32821e9371a1c$export$479f0f2f71193efe = /*#__PURE__*/ React.forwardRef
|
|
|
16815
15210
|
disableOutsidePointerEvents: context.open,
|
|
16816
15211
|
disableOutsideScroll: true // When focus is trapped, a `focusout` event may still happen.
|
|
16817
15212
|
,
|
|
16818
|
-
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15213
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault()
|
|
16819
15214
|
, {
|
|
16820
15215
|
checkForDefaultPrevented: false
|
|
16821
15216
|
}),
|
|
@@ -16841,7 +15236,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
16841
15236
|
const getItems = $6cc32821e9371a1c$var$useCollection(__scopeMenu);
|
|
16842
15237
|
const [currentItemId, setCurrentItemId] = React.useState(null);
|
|
16843
15238
|
const contentRef = React.useRef(null);
|
|
16844
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
15239
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef, context.onContentChange);
|
|
16845
15240
|
const timerRef = React.useRef(0);
|
|
16846
15241
|
const searchRef = React.useRef('');
|
|
16847
15242
|
const pointerGraceTimerRef = React.useRef(0);
|
|
@@ -16850,7 +15245,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
16850
15245
|
const lastPointerXRef = React.useRef(0);
|
|
16851
15246
|
const ScrollLockWrapper = disableOutsideScroll ? $epM9y$RemoveScroll : React.Fragment;
|
|
16852
15247
|
const scrollLockWrapperProps = disableOutsideScroll ? {
|
|
16853
|
-
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360
|
|
15248
|
+
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
16854
15249
|
allowPinchZoom: true
|
|
16855
15250
|
} : undefined;
|
|
16856
15251
|
const handleTypeaheadSearch = (key)=>{
|
|
@@ -16917,7 +15312,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
16917
15312
|
}, /*#__PURE__*/ React.createElement(ScrollLockWrapper, scrollLockWrapperProps, /*#__PURE__*/ React.createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
16918
15313
|
asChild: true,
|
|
16919
15314
|
trapped: trapFocus,
|
|
16920
|
-
onMountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15315
|
+
onMountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onOpenAutoFocus, (event)=>{
|
|
16921
15316
|
var _contentRef$current2;
|
|
16922
15317
|
// when opening, explicitly focus the content area only and leave
|
|
16923
15318
|
// `onEntryFocus` in control of focusing first item
|
|
@@ -16925,7 +15320,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
16925
15320
|
(_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 || _contentRef$current2.focus();
|
|
16926
15321
|
}),
|
|
16927
15322
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
16928
|
-
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22
|
|
15323
|
+
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, {
|
|
16929
15324
|
asChild: true,
|
|
16930
15325
|
disableOutsidePointerEvents: disableOutsidePointerEvents,
|
|
16931
15326
|
onEscapeKeyDown: onEscapeKeyDown,
|
|
@@ -16941,11 +15336,11 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
16941
15336
|
loop: loop,
|
|
16942
15337
|
currentTabStopId: currentItemId,
|
|
16943
15338
|
onCurrentTabStopIdChange: setCurrentItemId,
|
|
16944
|
-
onEntryFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15339
|
+
onEntryFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onEntryFocus, (event)=>{
|
|
16945
15340
|
// only focus first item when using keyboard
|
|
16946
15341
|
if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
|
|
16947
15342
|
})
|
|
16948
|
-
}), /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2
|
|
15343
|
+
}), /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({
|
|
16949
15344
|
role: "menu",
|
|
16950
15345
|
"aria-orientation": "vertical",
|
|
16951
15346
|
"data-state": $6cc32821e9371a1c$var$getOpenState(context.open),
|
|
@@ -16957,7 +15352,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
16957
15352
|
outline: 'none',
|
|
16958
15353
|
...contentProps.style
|
|
16959
15354
|
},
|
|
16960
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15355
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onKeyDown, (event)=>{
|
|
16961
15356
|
// submenu key events bubble through portals. We only care about keys in this menu.
|
|
16962
15357
|
const target = event.target;
|
|
16963
15358
|
const isKeyDownInside = target.closest('[data-radix-menu-content]') === event.currentTarget;
|
|
@@ -16979,14 +15374,14 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
16979
15374
|
if ($6cc32821e9371a1c$var$LAST_KEYS.includes(event.key)) candidateNodes.reverse();
|
|
16980
15375
|
$6cc32821e9371a1c$var$focusFirst(candidateNodes);
|
|
16981
15376
|
}),
|
|
16982
|
-
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15377
|
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, (event)=>{
|
|
16983
15378
|
// clear search buffer when leaving the menu
|
|
16984
15379
|
if (!event.currentTarget.contains(event.target)) {
|
|
16985
15380
|
window.clearTimeout(timerRef.current);
|
|
16986
15381
|
searchRef.current = '';
|
|
16987
15382
|
}
|
|
16988
15383
|
}),
|
|
16989
|
-
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15384
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse((event)=>{
|
|
16990
15385
|
const target = event.target;
|
|
16991
15386
|
const pointerXHasChanged = lastPointerXRef.current !== event.clientX; // We don't use `event.movementX` for this check because Safari will
|
|
16992
15387
|
// always return `0` on a pointer event.
|
|
@@ -17000,7 +15395,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ React.forwar
|
|
|
17000
15395
|
});
|
|
17001
15396
|
const $6cc32821e9371a1c$export$dd37bec0e8a99143 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
17002
15397
|
const { __scopeMenu: __scopeMenu , ...labelProps } = props;
|
|
17003
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
15398
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, labelProps, {
|
|
17004
15399
|
ref: forwardedRef
|
|
17005
15400
|
}));
|
|
17006
15401
|
});
|
|
@@ -17013,7 +15408,7 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ React.forwardRef
|
|
|
17013
15408
|
const ref = React.useRef(null);
|
|
17014
15409
|
const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$ITEM_NAME, props.__scopeMenu);
|
|
17015
15410
|
const contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$ITEM_NAME, props.__scopeMenu);
|
|
17016
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
15411
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
17017
15412
|
const isPointerDownRef = React.useRef(false);
|
|
17018
15413
|
const handleSelect = ()=>{
|
|
17019
15414
|
const menuItem = ref.current;
|
|
@@ -17026,7 +15421,7 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ React.forwardRef
|
|
|
17026
15421
|
, {
|
|
17027
15422
|
once: true
|
|
17028
15423
|
});
|
|
17029
|
-
$8927f6f2acc4f386$export$6d1a0317bde7de7f
|
|
15424
|
+
$8927f6f2acc4f386$export$6d1a0317bde7de7f(menuItem, itemSelectEvent);
|
|
17030
15425
|
if (itemSelectEvent.defaultPrevented) isPointerDownRef.current = false;
|
|
17031
15426
|
else rootContext.onClose();
|
|
17032
15427
|
}
|
|
@@ -17034,20 +15429,20 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ React.forwardRef
|
|
|
17034
15429
|
return /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$MenuItemImpl, _extends({}, itemProps, {
|
|
17035
15430
|
ref: composedRefs,
|
|
17036
15431
|
disabled: disabled,
|
|
17037
|
-
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15432
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, handleSelect),
|
|
17038
15433
|
onPointerDown: (event)=>{
|
|
17039
15434
|
var _props$onPointerDown;
|
|
17040
15435
|
(_props$onPointerDown = props.onPointerDown) === null || _props$onPointerDown === void 0 || _props$onPointerDown.call(props, event);
|
|
17041
15436
|
isPointerDownRef.current = true;
|
|
17042
15437
|
},
|
|
17043
|
-
onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15438
|
+
onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerUp, (event)=>{
|
|
17044
15439
|
var _event$currentTarget;
|
|
17045
15440
|
// Pointer down can move to a different menu item which should activate it on pointer up.
|
|
17046
15441
|
// We dispatch a click for selection to allow composition with click based triggers and to
|
|
17047
15442
|
// prevent Firefox from getting stuck in text selection mode when the menu closes.
|
|
17048
15443
|
if (!isPointerDownRef.current) (_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 || _event$currentTarget.click();
|
|
17049
15444
|
}),
|
|
17050
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15445
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
17051
15446
|
const isTypingAhead = contentContext.searchRef.current !== '';
|
|
17052
15447
|
if (disabled || isTypingAhead && event.key === ' ') return;
|
|
17053
15448
|
if ($6cc32821e9371a1c$var$SELECTION_KEYS.includes(event.key)) {
|
|
@@ -17067,7 +15462,7 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ React.forwardRef
|
|
|
17067
15462
|
const contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$ITEM_NAME, __scopeMenu);
|
|
17068
15463
|
const rovingFocusGroupScope = $6cc32821e9371a1c$var$useRovingFocusGroupScope(__scopeMenu);
|
|
17069
15464
|
const ref = React.useRef(null);
|
|
17070
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
15465
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
17071
15466
|
const [isFocused, setIsFocused] = React.useState(false); // get the item's `.textContent` as default strategy for typeahead `textValue`
|
|
17072
15467
|
const [textContent, setTextContent] = React.useState('');
|
|
17073
15468
|
React.useEffect(()=>{
|
|
@@ -17087,14 +15482,14 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ React.forwardRef
|
|
|
17087
15482
|
asChild: true
|
|
17088
15483
|
}, rovingFocusGroupScope, {
|
|
17089
15484
|
focusable: !disabled
|
|
17090
|
-
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
15485
|
+
}), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
17091
15486
|
role: "menuitem",
|
|
17092
15487
|
"data-highlighted": isFocused ? '' : undefined,
|
|
17093
15488
|
"aria-disabled": disabled || undefined,
|
|
17094
15489
|
"data-disabled": disabled ? '' : undefined
|
|
17095
15490
|
}, itemProps, {
|
|
17096
15491
|
ref: composedRefs,
|
|
17097
|
-
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15492
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse((event)=>{
|
|
17098
15493
|
if (disabled) contentContext.onItemLeave(event);
|
|
17099
15494
|
else {
|
|
17100
15495
|
contentContext.onItemEnter(event);
|
|
@@ -17104,11 +15499,11 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ React.forwardRef
|
|
|
17104
15499
|
}
|
|
17105
15500
|
}
|
|
17106
15501
|
})),
|
|
17107
|
-
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15502
|
+
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerLeave, $6cc32821e9371a1c$var$whenMouse((event)=>contentContext.onItemLeave(event)
|
|
17108
15503
|
)),
|
|
17109
|
-
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15504
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, ()=>setIsFocused(true)
|
|
17110
15505
|
),
|
|
17111
|
-
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15506
|
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, ()=>setIsFocused(false)
|
|
17112
15507
|
)
|
|
17113
15508
|
}))));
|
|
17114
15509
|
});
|
|
@@ -17127,7 +15522,7 @@ $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$ITEM_INDICATOR_NAM
|
|
|
17127
15522
|
});
|
|
17128
15523
|
const $6cc32821e9371a1c$export$1cec7dcdd713e220 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
17129
15524
|
const { __scopeMenu: __scopeMenu , ...separatorProps } = props;
|
|
17130
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
15525
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
17131
15526
|
role: "separator",
|
|
17132
15527
|
"aria-orientation": "horizontal"
|
|
17133
15528
|
}, separatorProps, {
|
|
@@ -17137,14 +15532,225 @@ const $6cc32821e9371a1c$export$1cec7dcdd713e220 = /*#__PURE__*/ React.forwardRef
|
|
|
17137
15532
|
const $6cc32821e9371a1c$export$bcdda4773debf5fa = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
17138
15533
|
const { __scopeMenu: __scopeMenu , ...arrowProps } = props;
|
|
17139
15534
|
const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);
|
|
17140
|
-
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5
|
|
15535
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5, _extends({}, popperScope, arrowProps, {
|
|
17141
15536
|
ref: forwardedRef
|
|
17142
15537
|
}));
|
|
17143
15538
|
});
|
|
17144
15539
|
/* -------------------------------------------------------------------------------------------------
|
|
17145
15540
|
* MenuSub
|
|
17146
15541
|
* -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$SUB_NAME = 'MenuSub';
|
|
17147
|
-
$6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$SUB_NAME);
|
|
15542
|
+
const [$6cc32821e9371a1c$var$MenuSubProvider, $6cc32821e9371a1c$var$useMenuSubContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$SUB_NAME);
|
|
15543
|
+
const $6cc32821e9371a1c$export$71bdb9d1e2909932 = (props)=>{
|
|
15544
|
+
const { __scopeMenu: __scopeMenu , children: children , open: open = false , onOpenChange: onOpenChange } = props;
|
|
15545
|
+
const parentMenuContext = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$SUB_NAME, __scopeMenu);
|
|
15546
|
+
const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);
|
|
15547
|
+
const [trigger, setTrigger] = React.useState(null);
|
|
15548
|
+
const [content, setContent] = React.useState(null);
|
|
15549
|
+
const handleOpenChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onOpenChange); // Prevent the parent menu from reopening with open submenus.
|
|
15550
|
+
React.useEffect(()=>{
|
|
15551
|
+
if (parentMenuContext.open === false) handleOpenChange(false);
|
|
15552
|
+
return ()=>handleOpenChange(false)
|
|
15553
|
+
;
|
|
15554
|
+
}, [
|
|
15555
|
+
parentMenuContext.open,
|
|
15556
|
+
handleOpenChange
|
|
15557
|
+
]);
|
|
15558
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$MenuProvider, {
|
|
15559
|
+
scope: __scopeMenu,
|
|
15560
|
+
open: open,
|
|
15561
|
+
onOpenChange: handleOpenChange,
|
|
15562
|
+
content: content,
|
|
15563
|
+
onContentChange: setContent
|
|
15564
|
+
}, /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$MenuSubProvider, {
|
|
15565
|
+
scope: __scopeMenu,
|
|
15566
|
+
contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
15567
|
+
triggerId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
15568
|
+
trigger: trigger,
|
|
15569
|
+
onTriggerChange: setTrigger
|
|
15570
|
+
}, children)));
|
|
15571
|
+
};
|
|
15572
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15573
|
+
* MenuSubTrigger
|
|
15574
|
+
* -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$SUB_TRIGGER_NAME = 'MenuSubTrigger';
|
|
15575
|
+
const $6cc32821e9371a1c$export$5fbbb3ba7297405f = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
15576
|
+
const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15577
|
+
const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15578
|
+
const subContext = $6cc32821e9371a1c$var$useMenuSubContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15579
|
+
const contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15580
|
+
const openTimerRef = React.useRef(null);
|
|
15581
|
+
const { pointerGraceTimerRef: pointerGraceTimerRef , onPointerGraceIntentChange: onPointerGraceIntentChange } = contentContext;
|
|
15582
|
+
const scope = {
|
|
15583
|
+
__scopeMenu: props.__scopeMenu
|
|
15584
|
+
};
|
|
15585
|
+
const clearOpenTimer = React.useCallback(()=>{
|
|
15586
|
+
if (openTimerRef.current) window.clearTimeout(openTimerRef.current);
|
|
15587
|
+
openTimerRef.current = null;
|
|
15588
|
+
}, []);
|
|
15589
|
+
React.useEffect(()=>clearOpenTimer
|
|
15590
|
+
, [
|
|
15591
|
+
clearOpenTimer
|
|
15592
|
+
]);
|
|
15593
|
+
React.useEffect(()=>{
|
|
15594
|
+
const pointerGraceTimer = pointerGraceTimerRef.current;
|
|
15595
|
+
return ()=>{
|
|
15596
|
+
window.clearTimeout(pointerGraceTimer);
|
|
15597
|
+
onPointerGraceIntentChange(null);
|
|
15598
|
+
};
|
|
15599
|
+
}, [
|
|
15600
|
+
pointerGraceTimerRef,
|
|
15601
|
+
onPointerGraceIntentChange
|
|
15602
|
+
]);
|
|
15603
|
+
return /*#__PURE__*/ React.createElement($6cc32821e9371a1c$export$9fa5ebd18bee4d43, _extends({
|
|
15604
|
+
asChild: true
|
|
15605
|
+
}, scope), /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$MenuItemImpl, _extends({
|
|
15606
|
+
id: subContext.triggerId,
|
|
15607
|
+
"aria-haspopup": "menu",
|
|
15608
|
+
"aria-expanded": context.open,
|
|
15609
|
+
"aria-controls": subContext.contentId,
|
|
15610
|
+
"data-state": $6cc32821e9371a1c$var$getOpenState(context.open)
|
|
15611
|
+
}, props, {
|
|
15612
|
+
ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, subContext.onTriggerChange) // This is redundant for mouse users but we cannot determine pointer type from
|
|
15613
|
+
,
|
|
15614
|
+
onClick: (event)=>{
|
|
15615
|
+
var _props$onClick;
|
|
15616
|
+
(_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, event);
|
|
15617
|
+
if (props.disabled || event.defaultPrevented) return;
|
|
15618
|
+
/**
|
|
15619
|
+
* We manually focus because iOS Safari doesn't always focus on click (e.g. buttons)
|
|
15620
|
+
* and we rely heavily on `onFocusOutside` for submenus to close when switching
|
|
15621
|
+
* between separate submenus.
|
|
15622
|
+
*/ event.currentTarget.focus();
|
|
15623
|
+
if (!context.open) context.onOpenChange(true);
|
|
15624
|
+
},
|
|
15625
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse((event)=>{
|
|
15626
|
+
contentContext.onItemEnter(event);
|
|
15627
|
+
if (event.defaultPrevented) return;
|
|
15628
|
+
if (!props.disabled && !context.open && !openTimerRef.current) {
|
|
15629
|
+
contentContext.onPointerGraceIntentChange(null);
|
|
15630
|
+
openTimerRef.current = window.setTimeout(()=>{
|
|
15631
|
+
context.onOpenChange(true);
|
|
15632
|
+
clearOpenTimer();
|
|
15633
|
+
}, 100);
|
|
15634
|
+
}
|
|
15635
|
+
})),
|
|
15636
|
+
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerLeave, $6cc32821e9371a1c$var$whenMouse((event)=>{
|
|
15637
|
+
var _context$content;
|
|
15638
|
+
clearOpenTimer();
|
|
15639
|
+
const contentRect = (_context$content = context.content) === null || _context$content === void 0 ? void 0 : _context$content.getBoundingClientRect();
|
|
15640
|
+
if (contentRect) {
|
|
15641
|
+
var _context$content2;
|
|
15642
|
+
// TODO: make sure to update this when we change positioning logic
|
|
15643
|
+
const side = (_context$content2 = context.content) === null || _context$content2 === void 0 ? void 0 : _context$content2.dataset.side;
|
|
15644
|
+
const rightSide = side === 'right';
|
|
15645
|
+
const bleed = rightSide ? -5 : 5;
|
|
15646
|
+
const contentNearEdge = contentRect[rightSide ? 'left' : 'right'];
|
|
15647
|
+
const contentFarEdge = contentRect[rightSide ? 'right' : 'left'];
|
|
15648
|
+
contentContext.onPointerGraceIntentChange({
|
|
15649
|
+
area: [
|
|
15650
|
+
// consistently within polygon bounds
|
|
15651
|
+
{
|
|
15652
|
+
x: event.clientX + bleed,
|
|
15653
|
+
y: event.clientY
|
|
15654
|
+
},
|
|
15655
|
+
{
|
|
15656
|
+
x: contentNearEdge,
|
|
15657
|
+
y: contentRect.top
|
|
15658
|
+
},
|
|
15659
|
+
{
|
|
15660
|
+
x: contentFarEdge,
|
|
15661
|
+
y: contentRect.top
|
|
15662
|
+
},
|
|
15663
|
+
{
|
|
15664
|
+
x: contentFarEdge,
|
|
15665
|
+
y: contentRect.bottom
|
|
15666
|
+
},
|
|
15667
|
+
{
|
|
15668
|
+
x: contentNearEdge,
|
|
15669
|
+
y: contentRect.bottom
|
|
15670
|
+
}
|
|
15671
|
+
],
|
|
15672
|
+
side: side
|
|
15673
|
+
});
|
|
15674
|
+
window.clearTimeout(pointerGraceTimerRef.current);
|
|
15675
|
+
pointerGraceTimerRef.current = window.setTimeout(()=>contentContext.onPointerGraceIntentChange(null)
|
|
15676
|
+
, 300);
|
|
15677
|
+
} else {
|
|
15678
|
+
contentContext.onTriggerLeave(event);
|
|
15679
|
+
if (event.defaultPrevented) return; // There's 100ms where the user may leave an item before the submenu was opened.
|
|
15680
|
+
contentContext.onPointerGraceIntentChange(null);
|
|
15681
|
+
}
|
|
15682
|
+
})),
|
|
15683
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
15684
|
+
const isTypingAhead = contentContext.searchRef.current !== '';
|
|
15685
|
+
if (props.disabled || isTypingAhead && event.key === ' ') return;
|
|
15686
|
+
if ($6cc32821e9371a1c$var$SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {
|
|
15687
|
+
var _context$content3;
|
|
15688
|
+
context.onOpenChange(true); // The trigger may hold focus if opened via pointer interaction
|
|
15689
|
+
// so we ensure content is given focus again when switching to keyboard.
|
|
15690
|
+
(_context$content3 = context.content) === null || _context$content3 === void 0 || _context$content3.focus(); // prevent window from scrolling
|
|
15691
|
+
event.preventDefault();
|
|
15692
|
+
}
|
|
15693
|
+
})
|
|
15694
|
+
})));
|
|
15695
|
+
});
|
|
15696
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15697
|
+
* MenuSubContent
|
|
15698
|
+
* -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$SUB_CONTENT_NAME = 'MenuSubContent';
|
|
15699
|
+
const $6cc32821e9371a1c$export$e7142ab31822bde6 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
15700
|
+
const portalContext = $6cc32821e9371a1c$var$usePortalContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);
|
|
15701
|
+
const { forceMount: forceMount = portalContext.forceMount , ...subContentProps } = props;
|
|
15702
|
+
const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);
|
|
15703
|
+
const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);
|
|
15704
|
+
const subContext = $6cc32821e9371a1c$var$useMenuSubContext($6cc32821e9371a1c$var$SUB_CONTENT_NAME, props.__scopeMenu);
|
|
15705
|
+
const ref = React.useRef(null);
|
|
15706
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
15707
|
+
return /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$Collection.Provider, {
|
|
15708
|
+
scope: props.__scopeMenu
|
|
15709
|
+
}, /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
15710
|
+
present: forceMount || context.open
|
|
15711
|
+
}, /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$Collection.Slot, {
|
|
15712
|
+
scope: props.__scopeMenu
|
|
15713
|
+
}, /*#__PURE__*/ React.createElement($6cc32821e9371a1c$var$MenuContentImpl, _extends({
|
|
15714
|
+
id: subContext.contentId,
|
|
15715
|
+
"aria-labelledby": subContext.triggerId
|
|
15716
|
+
}, subContentProps, {
|
|
15717
|
+
ref: composedRefs,
|
|
15718
|
+
align: "start",
|
|
15719
|
+
side: rootContext.dir === 'rtl' ? 'left' : 'right',
|
|
15720
|
+
disableOutsidePointerEvents: false,
|
|
15721
|
+
disableOutsideScroll: false,
|
|
15722
|
+
trapFocus: false,
|
|
15723
|
+
onOpenAutoFocus: (event)=>{
|
|
15724
|
+
var _ref$current;
|
|
15725
|
+
// when opening a submenu, focus content for keyboard users only
|
|
15726
|
+
if (rootContext.isUsingKeyboardRef.current) (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.focus();
|
|
15727
|
+
event.preventDefault();
|
|
15728
|
+
} // The menu might close because of focusing another menu item in the parent menu. We
|
|
15729
|
+
,
|
|
15730
|
+
onCloseAutoFocus: (event)=>event.preventDefault()
|
|
15731
|
+
,
|
|
15732
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>{
|
|
15733
|
+
// We prevent closing when the trigger is focused to avoid triggering a re-open animation
|
|
15734
|
+
// on pointer interaction.
|
|
15735
|
+
if (event.target !== subContext.trigger) context.onOpenChange(false);
|
|
15736
|
+
}),
|
|
15737
|
+
onEscapeKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onEscapeKeyDown, (event)=>{
|
|
15738
|
+
rootContext.onClose(); // ensure pressing escape in submenu doesn't escape full screen mode
|
|
15739
|
+
event.preventDefault();
|
|
15740
|
+
}),
|
|
15741
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
15742
|
+
// Submenu key events bubble through portals. We only care about keys in this menu.
|
|
15743
|
+
const isKeyDownInside = event.currentTarget.contains(event.target);
|
|
15744
|
+
const isCloseKey = $6cc32821e9371a1c$var$SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);
|
|
15745
|
+
if (isKeyDownInside && isCloseKey) {
|
|
15746
|
+
var _subContext$trigger;
|
|
15747
|
+
context.onOpenChange(false); // We focus manually because we prevented it in `onCloseAutoFocus`
|
|
15748
|
+
(_subContext$trigger = subContext.trigger) === null || _subContext$trigger === void 0 || _subContext$trigger.focus(); // prevent window from scrolling
|
|
15749
|
+
event.preventDefault();
|
|
15750
|
+
}
|
|
15751
|
+
})
|
|
15752
|
+
})))));
|
|
15753
|
+
});
|
|
17148
15754
|
/* -----------------------------------------------------------------------------------------------*/ function $6cc32821e9371a1c$var$getOpenState(open) {
|
|
17149
15755
|
return open ? 'open' : 'closed';
|
|
17150
15756
|
}
|
|
@@ -17227,11 +15833,14 @@ const $6cc32821e9371a1c$export$b04be29aa201d4f5 = $6cc32821e9371a1c$export$dd37b
|
|
|
17227
15833
|
const $6cc32821e9371a1c$export$6d08773d2e66f8f2 = $6cc32821e9371a1c$export$2ce376c2cc3355c8;
|
|
17228
15834
|
const $6cc32821e9371a1c$export$1ff3c3f08ae963c0 = $6cc32821e9371a1c$export$1cec7dcdd713e220;
|
|
17229
15835
|
const $6cc32821e9371a1c$export$21b07c8f274aebd5 = $6cc32821e9371a1c$export$bcdda4773debf5fa;
|
|
15836
|
+
const $6cc32821e9371a1c$export$d7a01e11500dfb6f = $6cc32821e9371a1c$export$71bdb9d1e2909932;
|
|
15837
|
+
const $6cc32821e9371a1c$export$2ea8a7a591ac5eac = $6cc32821e9371a1c$export$5fbbb3ba7297405f;
|
|
15838
|
+
const $6cc32821e9371a1c$export$6d4de93b380beddf = $6cc32821e9371a1c$export$e7142ab31822bde6;
|
|
17230
15839
|
|
|
17231
15840
|
/* -------------------------------------------------------------------------------------------------
|
|
17232
15841
|
* DropdownMenu
|
|
17233
15842
|
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$DROPDOWN_MENU_NAME = 'DropdownMenu';
|
|
17234
|
-
const [$d08ef79370b62062$var$createDropdownMenuContext, $d08ef79370b62062$export$c0623cd925aeb687] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
15843
|
+
const [$d08ef79370b62062$var$createDropdownMenuContext, $d08ef79370b62062$export$c0623cd925aeb687] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($d08ef79370b62062$var$DROPDOWN_MENU_NAME, [
|
|
17235
15844
|
$6cc32821e9371a1c$export$4027731b685e72eb
|
|
17236
15845
|
]);
|
|
17237
15846
|
const $d08ef79370b62062$var$useMenuScope = $6cc32821e9371a1c$export$4027731b685e72eb();
|
|
@@ -17240,7 +15849,7 @@ const $d08ef79370b62062$export$e44a253a59704894 = (props)=>{
|
|
|
17240
15849
|
const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , dir: dir , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props;
|
|
17241
15850
|
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
17242
15851
|
const triggerRef = React.useRef(null);
|
|
17243
|
-
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
15852
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
17244
15853
|
prop: openProp,
|
|
17245
15854
|
defaultProp: defaultOpen,
|
|
17246
15855
|
onChange: onOpenChange
|
|
@@ -17274,7 +15883,7 @@ const $d08ef79370b62062$export$d2469213b3befba9 = /*#__PURE__*/ React.forwardRef
|
|
|
17274
15883
|
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
17275
15884
|
return /*#__PURE__*/ React.createElement($6cc32821e9371a1c$export$b688253958b8dfe7, _extends({
|
|
17276
15885
|
asChild: true
|
|
17277
|
-
}, menuScope), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
15886
|
+
}, menuScope), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
17278
15887
|
type: "button",
|
|
17279
15888
|
id: context.triggerId,
|
|
17280
15889
|
"aria-haspopup": "menu",
|
|
@@ -17284,8 +15893,8 @@ const $d08ef79370b62062$export$d2469213b3befba9 = /*#__PURE__*/ React.forwardRef
|
|
|
17284
15893
|
"data-disabled": disabled ? '' : undefined,
|
|
17285
15894
|
disabled: disabled
|
|
17286
15895
|
}, triggerProps, {
|
|
17287
|
-
ref: $6ed0406888f73fc4$export$43e446d32b3d21af
|
|
17288
|
-
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15896
|
+
ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, context.triggerRef),
|
|
15897
|
+
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDown, (event)=>{
|
|
17289
15898
|
// only call handler if it's the left button (mousedown gets triggered by all mouse buttons)
|
|
17290
15899
|
// but not when the control key is pressed (avoiding MacOS right click)
|
|
17291
15900
|
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
@@ -17294,7 +15903,7 @@ const $d08ef79370b62062$export$d2469213b3befba9 = /*#__PURE__*/ React.forwardRef
|
|
|
17294
15903
|
if (!context.open) event.preventDefault();
|
|
17295
15904
|
}
|
|
17296
15905
|
}),
|
|
17297
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15906
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
17298
15907
|
if (disabled) return;
|
|
17299
15908
|
if ([
|
|
17300
15909
|
'Enter',
|
|
@@ -17323,13 +15932,13 @@ const $d08ef79370b62062$export$6e76d93a37c01248 = /*#__PURE__*/ React.forwardRef
|
|
|
17323
15932
|
"aria-labelledby": context.triggerId
|
|
17324
15933
|
}, menuScope, contentProps, {
|
|
17325
15934
|
ref: forwardedRef,
|
|
17326
|
-
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15935
|
+
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{
|
|
17327
15936
|
var _context$triggerRef$c;
|
|
17328
15937
|
if (!hasInteractedOutsideRef.current) (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
17329
15938
|
hasInteractedOutsideRef.current = false; // Always prevent auto focus because we either focus manually or want user agent focus
|
|
17330
15939
|
event.preventDefault();
|
|
17331
15940
|
}),
|
|
17332
|
-
onInteractOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15941
|
+
onInteractOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onInteractOutside, (event)=>{
|
|
17333
15942
|
const originalEvent = event.detail.originalEvent;
|
|
17334
15943
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
17335
15944
|
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
@@ -17373,6 +15982,43 @@ const $d08ef79370b62062$export$34b8980744021ec5 = /*#__PURE__*/ React.forwardRef
|
|
|
17373
15982
|
ref: forwardedRef
|
|
17374
15983
|
}));
|
|
17375
15984
|
});
|
|
15985
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15986
|
+
* DropdownMenuSub
|
|
15987
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$export$2f307d81a64f5442 = (props)=>{
|
|
15988
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , open: openProp , onOpenChange: onOpenChange , defaultOpen: defaultOpen } = props;
|
|
15989
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
15990
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
15991
|
+
prop: openProp,
|
|
15992
|
+
defaultProp: defaultOpen,
|
|
15993
|
+
onChange: onOpenChange
|
|
15994
|
+
});
|
|
15995
|
+
return /*#__PURE__*/ React.createElement($6cc32821e9371a1c$export$d7a01e11500dfb6f, _extends({}, menuScope, {
|
|
15996
|
+
open: open,
|
|
15997
|
+
onOpenChange: setOpen
|
|
15998
|
+
}), children);
|
|
15999
|
+
};
|
|
16000
|
+
const $d08ef79370b62062$export$21dcb7ec56f874cf = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
16001
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...subTriggerProps } = props;
|
|
16002
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
16003
|
+
return /*#__PURE__*/ React.createElement($6cc32821e9371a1c$export$2ea8a7a591ac5eac, _extends({}, menuScope, subTriggerProps, {
|
|
16004
|
+
ref: forwardedRef
|
|
16005
|
+
}));
|
|
16006
|
+
});
|
|
16007
|
+
const $d08ef79370b62062$export$f34ec8bc2482cc5f = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
16008
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...subContentProps } = props;
|
|
16009
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
16010
|
+
return /*#__PURE__*/ React.createElement($6cc32821e9371a1c$export$6d4de93b380beddf, _extends({}, menuScope, subContentProps, {
|
|
16011
|
+
ref: forwardedRef,
|
|
16012
|
+
style: {
|
|
16013
|
+
...props.style,
|
|
16014
|
+
'--radix-dropdown-menu-content-transform-origin': 'var(--radix-popper-transform-origin)',
|
|
16015
|
+
'--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)',
|
|
16016
|
+
'--radix-dropdown-menu-content-available-height': 'var(--radix-popper-available-height)',
|
|
16017
|
+
'--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)',
|
|
16018
|
+
'--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)'
|
|
16019
|
+
}
|
|
16020
|
+
}));
|
|
16021
|
+
});
|
|
17376
16022
|
/* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$export$be92b6f5f03c0fe9 = $d08ef79370b62062$export$e44a253a59704894;
|
|
17377
16023
|
const $d08ef79370b62062$export$41fb9f06171c75f4 = $d08ef79370b62062$export$d2469213b3befba9;
|
|
17378
16024
|
const $d08ef79370b62062$export$7c6e2c02157bb7d2 = $d08ef79370b62062$export$6e76d93a37c01248;
|
|
@@ -17380,6 +16026,9 @@ const $d08ef79370b62062$export$b04be29aa201d4f5 = $d08ef79370b62062$export$76e48
|
|
|
17380
16026
|
const $d08ef79370b62062$export$6d08773d2e66f8f2 = $d08ef79370b62062$export$ed97964d1871885d;
|
|
17381
16027
|
const $d08ef79370b62062$export$1ff3c3f08ae963c0 = $d08ef79370b62062$export$da160178fd3bc7e9;
|
|
17382
16028
|
const $d08ef79370b62062$export$21b07c8f274aebd5 = $d08ef79370b62062$export$34b8980744021ec5;
|
|
16029
|
+
const $d08ef79370b62062$export$d7a01e11500dfb6f = $d08ef79370b62062$export$2f307d81a64f5442;
|
|
16030
|
+
const $d08ef79370b62062$export$2ea8a7a591ac5eac = $d08ef79370b62062$export$21dcb7ec56f874cf;
|
|
16031
|
+
const $d08ef79370b62062$export$6d4de93b380beddf = $d08ef79370b62062$export$f34ec8bc2482cc5f;
|
|
17383
16032
|
|
|
17384
16033
|
const borderStyles = [
|
|
17385
16034
|
'tw-border-solid',
|
|
@@ -17397,18 +16046,39 @@ const ButtonWithDropdown = ({ dropdownItems, triggerIcon, id, extraClassNames, c
|
|
|
17397
16046
|
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)),
|
|
17398
16047
|
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" },
|
|
17399
16048
|
React__namespace.createElement("div", { "data-testid": containerTestId, className: bgStyles +
|
|
17400
|
-
' tw-relative tw-z-[1000] tw-min-w-6 tw-
|
|
16049
|
+
' tw-relative tw-z-[1000] tw-min-w-6 tw-py-2 focus-visible:tw-outline-none tw-outline-none' +
|
|
16050
|
+
' data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out' +
|
|
17401
16051
|
' 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 ' +
|
|
17402
16052
|
borderStyles },
|
|
17403
16053
|
hasArrow && (React__namespace.createElement($d08ef79370b62062$export$21b07c8f274aebd5, { asChild: true },
|
|
17404
16054
|
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]" }))),
|
|
17405
16055
|
dropdownItems.map((item, index) => {
|
|
17406
|
-
|
|
17407
|
-
|
|
17408
|
-
|
|
16056
|
+
if (item.isLabel) {
|
|
16057
|
+
return (React__namespace.createElement($d08ef79370b62062$export$b04be29aa201d4f5, { key: (item.label || '') + index, className: item.containerExtraClassNames },
|
|
16058
|
+
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]" })),
|
|
16059
|
+
React__namespace.createElement("div", { "data-testid": item.labelTestId, className: "tw-text-[13px] tw-ml-1" }, item.label)));
|
|
16060
|
+
}
|
|
16061
|
+
if (Array.isArray(item.subMenuItems) && item.subMenuItems.length > 0) {
|
|
16062
|
+
return (React__namespace.createElement($d08ef79370b62062$export$d7a01e11500dfb6f, { key: item.label + index },
|
|
16063
|
+
React__namespace.createElement($d08ef79370b62062$export$2ea8a7a591ac5eac, { id: id, className: `tw-cursor-pointer tw-flex tw-justify-between dark:tw-text-sq-white hover:tw-bg-sq-gray-highlight dark:hover:tw-bg-sq-gray-highlight-dark tw-leading-none tw-items-center tw-h-[27px] tw-pl-[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 },
|
|
16064
|
+
React__namespace.createElement("div", { className: "tw-flex" },
|
|
16065
|
+
item.icon && (React__namespace.createElement(Icon, { icon: item.icon, extraClassNames: `tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px] ${item.iconExtraClassNames || ''}` })),
|
|
16066
|
+
React__namespace.createElement("div", { "data-testid": item.labelTestId, "data-customid": item.labelCustomId, className: `tw-text-[13px] tw-ml-1 ${item.labelClasses}` }, item.label)),
|
|
16067
|
+
React__namespace.createElement(Icon, { small: true, icon: "fc-arrow-dropdown -tw-rotate-90", extraClassNames: "tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px] tw-ml-4 tw-text-[8px] tw-justify-center tw-flex" })),
|
|
16068
|
+
React__namespace.createElement($d08ef79370b62062$export$6d4de93b380beddf, { className: "focus-visible:tw-outline-none tw-outline-none" },
|
|
16069
|
+
React__namespace.createElement("div", { "data-testid": containerTestId, className: bgStyles +
|
|
16070
|
+
' tw-relative tw-z-[1000] tw-min-w-6 tw-py-2 focus-visible:tw-outline-none tw-outline-none data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out' +
|
|
16071
|
+
' 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 ' +
|
|
16072
|
+
borderStyles }, item.subMenuItems.map((subItem, subIndex) => {
|
|
16073
|
+
return (React__namespace.createElement($d08ef79370b62062$export$6d08773d2e66f8f2, { key: subItem.label + subIndex, onSelect: subItem.onClick, "data-qtip-text": subItem.tooltip, className: "tw-cursor-pointer tw-flex dark:tw-text-sq-white hover:tw-bg-sq-gray-highlight dark:hover:tw-bg-sq-gray-highlight-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", disabled: subItem.disabled },
|
|
16074
|
+
subItem.iconClass && (React__namespace.createElement(Icon, { icon: subItem.iconClass, extraClassNames: `tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px]` })),
|
|
16075
|
+
React__namespace.createElement("div", { className: `tw-text-[13px] tw-ml-1` }, subItem.label)));
|
|
16076
|
+
})))));
|
|
16077
|
+
}
|
|
16078
|
+
return (React__namespace.createElement("div", { key: item.label + index },
|
|
17409
16079
|
React__namespace.createElement($d08ef79370b62062$export$6d08773d2e66f8f2, { key: item.label + index, "data-customid": item.itemCustomId, onSelect: (e) => {
|
|
17410
16080
|
item.onClick(e);
|
|
17411
|
-
}, className: `tw-cursor-pointer tw-flex dark:tw-text-sq-white hover:tw-bg-sq-
|
|
16081
|
+
}, className: `tw-cursor-pointer tw-flex dark:tw-text-sq-white hover:tw-bg-sq-gray-highlight dark:hover:tw-bg-sq-gray-highlight-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 },
|
|
17412
16082
|
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 || ''}` })),
|
|
17413
16083
|
React__namespace.createElement("div", { "data-testid": item.labelTestId, "data-customid": item.labelCustomId, className: `tw-text-[13px] tw-ml-1 ${item.labelClasses}` }, item.label)),
|
|
17414
16084
|
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]" }))));
|