@seeqdev/qomponents 0.0.65 → 0.0.66
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 +643 -1976
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +643 -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.esm.js
CHANGED
|
@@ -89,7 +89,7 @@ const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClas
|
|
|
89
89
|
const iconPrefixString = icon.startsWith('fc') ? 'fc' : fontAwesomePrefix;
|
|
90
90
|
const style = type === 'color' && color ? { color } : {};
|
|
91
91
|
const appliedClassNames = `${iconPrefixString} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
|
|
92
|
-
${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'cursor-pointer' : ''} ${extraClassNames}`;
|
|
92
|
+
${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'cursor-pointer' : ''} ${extraClassNames} focus:tw-outline-none focus-visible:tw-outline-none tw-outline-none`;
|
|
93
93
|
const tooltipData = getQTipData(tooltipProps);
|
|
94
94
|
return (React__default.createElement("i", { className: appliedClassNames, style: style, onClick: onClick, "data-testid": testId, "data-customid": customId, id: id, "data-number": number, ...tooltipData }));
|
|
95
95
|
};
|
|
@@ -190,7 +190,7 @@ function _extends() {
|
|
|
190
190
|
return _extends.apply(this, arguments);
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
function $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
193
|
+
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
|
|
194
194
|
return function handleEvent(event) {
|
|
195
195
|
originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
|
|
196
196
|
if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
|
|
@@ -200,29 +200,29 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(originalEventHandler, ourEv
|
|
|
200
200
|
/**
|
|
201
201
|
* Set a given ref to a given value
|
|
202
202
|
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
203
|
-
*/ function $6ed0406888f73fc4$var$setRef
|
|
203
|
+
*/ function $6ed0406888f73fc4$var$setRef(ref, value) {
|
|
204
204
|
if (typeof ref === 'function') ref(value);
|
|
205
205
|
else if (ref !== null && ref !== undefined) ref.current = value;
|
|
206
206
|
}
|
|
207
207
|
/**
|
|
208
208
|
* A utility to compose multiple refs together
|
|
209
209
|
* Accepts callback refs and RefObject(s)
|
|
210
|
-
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af
|
|
211
|
-
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef
|
|
210
|
+
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
|
211
|
+
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
|
|
212
212
|
)
|
|
213
213
|
;
|
|
214
214
|
}
|
|
215
215
|
/**
|
|
216
216
|
* A custom hook that composes multiple refs
|
|
217
217
|
* Accepts callback refs and RefObject(s)
|
|
218
|
-
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
218
|
+
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
219
219
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
220
|
-
return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af
|
|
220
|
+
return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
/* -------------------------------------------------------------------------------------------------
|
|
224
224
|
* createContextScope
|
|
225
|
-
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
225
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
|
|
226
226
|
let defaultContexts = [];
|
|
227
227
|
/* -----------------------------------------------------------------------------------------------
|
|
228
228
|
* createContext
|
|
@@ -279,12 +279,12 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(originalEventHandler, ourEv
|
|
|
279
279
|
createScope.scopeName = scopeName;
|
|
280
280
|
return [
|
|
281
281
|
$c512c27ab02ef895$export$fd42f52fd3ae1109,
|
|
282
|
-
$c512c27ab02ef895$var$composeContextScopes
|
|
282
|
+
$c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
|
|
283
283
|
];
|
|
284
284
|
}
|
|
285
285
|
/* -------------------------------------------------------------------------------------------------
|
|
286
286
|
* composeContextScopes
|
|
287
|
-
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes
|
|
287
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
|
|
288
288
|
const baseScope = scopes[0];
|
|
289
289
|
if (scopes.length === 1) return baseScope;
|
|
290
290
|
const createScope1 = ()=>{
|
|
@@ -319,10 +319,10 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(originalEventHandler, ourEv
|
|
|
319
319
|
|
|
320
320
|
/* -------------------------------------------------------------------------------------------------
|
|
321
321
|
* Slot
|
|
322
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360
|
|
322
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
323
323
|
const { children: children , ...slotProps } = props;
|
|
324
324
|
const childrenArray = Children.toArray(children);
|
|
325
|
-
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable
|
|
325
|
+
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
326
326
|
if (slottable) {
|
|
327
327
|
// the new element to render is the one passed as a child of `Slottable`
|
|
328
328
|
const newElement = slottable.props.children;
|
|
@@ -334,35 +334,35 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(originalEventHandler, ourEv
|
|
|
334
334
|
return /*#__PURE__*/ isValidElement(newElement) ? newElement.props.children : null;
|
|
335
335
|
} else return child;
|
|
336
336
|
});
|
|
337
|
-
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone
|
|
337
|
+
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
338
338
|
ref: forwardedRef
|
|
339
339
|
}), /*#__PURE__*/ isValidElement(newElement) ? /*#__PURE__*/ cloneElement(newElement, undefined, newChildren) : null);
|
|
340
340
|
}
|
|
341
|
-
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone
|
|
341
|
+
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
342
342
|
ref: forwardedRef
|
|
343
343
|
}), children);
|
|
344
344
|
});
|
|
345
|
-
$5e63c961fc1ce211$export$8c6ed5c666ac1360
|
|
345
|
+
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
|
|
346
346
|
/* -------------------------------------------------------------------------------------------------
|
|
347
347
|
* SlotClone
|
|
348
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone
|
|
348
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
349
349
|
const { children: children , ...slotProps } = props;
|
|
350
350
|
if (/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ cloneElement(children, {
|
|
351
|
-
...$5e63c961fc1ce211$var$mergeProps
|
|
352
|
-
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af
|
|
351
|
+
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
352
|
+
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
|
|
353
353
|
});
|
|
354
354
|
return Children.count(children) > 1 ? Children.only(null) : null;
|
|
355
355
|
});
|
|
356
|
-
$5e63c961fc1ce211$var$SlotClone
|
|
356
|
+
$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
|
|
357
357
|
/* -------------------------------------------------------------------------------------------------
|
|
358
358
|
* Slottable
|
|
359
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45
|
|
359
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
|
|
360
360
|
return /*#__PURE__*/ createElement(Fragment, null, children);
|
|
361
361
|
};
|
|
362
|
-
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable
|
|
363
|
-
return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45
|
|
362
|
+
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
363
|
+
return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
364
364
|
}
|
|
365
|
-
function $5e63c961fc1ce211$var$mergeProps
|
|
365
|
+
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
366
366
|
// all child props should override
|
|
367
367
|
const overrideProps = {
|
|
368
368
|
...childProps
|
|
@@ -393,7 +393,7 @@ function $5e63c961fc1ce211$var$mergeProps$1(slotProps, childProps) {
|
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
395
|
|
|
396
|
-
const $8927f6f2acc4f386$var$NODES
|
|
396
|
+
const $8927f6f2acc4f386$var$NODES = [
|
|
397
397
|
'a',
|
|
398
398
|
'button',
|
|
399
399
|
'div',
|
|
@@ -415,10 +415,10 @@ const $8927f6f2acc4f386$var$NODES$1 = [
|
|
|
415
415
|
// prettier-ignore
|
|
416
416
|
/* -------------------------------------------------------------------------------------------------
|
|
417
417
|
* Primitive
|
|
418
|
-
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
418
|
+
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
|
|
419
419
|
const Node = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
420
420
|
const { asChild: asChild , ...primitiveProps } = props;
|
|
421
|
-
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360
|
|
421
|
+
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
|
422
422
|
useEffect(()=>{
|
|
423
423
|
window[Symbol.for('radix-ui')] = true;
|
|
424
424
|
}, []);
|
|
@@ -469,7 +469,7 @@ const $8927f6f2acc4f386$var$NODES$1 = [
|
|
|
469
469
|
* Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
|
|
470
470
|
* this utility with them. This is because it's possible for those handlers to be called implicitly during render
|
|
471
471
|
* e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
|
|
472
|
-
*/ function $8927f6f2acc4f386$export$6d1a0317bde7de7f
|
|
472
|
+
*/ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
|
|
473
473
|
if (target) flushSync(()=>target.dispatchEvent(event)
|
|
474
474
|
);
|
|
475
475
|
}
|
|
@@ -477,7 +477,7 @@ const $8927f6f2acc4f386$var$NODES$1 = [
|
|
|
477
477
|
/**
|
|
478
478
|
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
479
479
|
* prop or avoid re-executing effects when passed as a dependency
|
|
480
|
-
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
480
|
+
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
481
481
|
const callbackRef = useRef(callback);
|
|
482
482
|
useEffect(()=>{
|
|
483
483
|
callbackRef.current = callback;
|
|
@@ -491,8 +491,8 @@ const $8927f6f2acc4f386$var$NODES$1 = [
|
|
|
491
491
|
|
|
492
492
|
/**
|
|
493
493
|
* Listens for when the escape key is down
|
|
494
|
-
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765
|
|
495
|
-
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
494
|
+
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
495
|
+
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
496
496
|
useEffect(()=>{
|
|
497
497
|
const handleKeyDown = (event)=>{
|
|
498
498
|
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
@@ -506,23 +506,23 @@ const $8927f6f2acc4f386$var$NODES$1 = [
|
|
|
506
506
|
]);
|
|
507
507
|
}
|
|
508
508
|
|
|
509
|
-
const $5cb92bef7577960e$var$CONTEXT_UPDATE
|
|
510
|
-
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE
|
|
511
|
-
const $5cb92bef7577960e$var$FOCUS_OUTSIDE
|
|
512
|
-
let $5cb92bef7577960e$var$originalBodyPointerEvents
|
|
513
|
-
const $5cb92bef7577960e$var$DismissableLayerContext
|
|
509
|
+
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
510
|
+
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
511
|
+
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
512
|
+
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
513
|
+
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ createContext({
|
|
514
514
|
layers: new Set(),
|
|
515
515
|
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
516
516
|
branches: new Set()
|
|
517
517
|
});
|
|
518
|
-
const $5cb92bef7577960e$export$177fb62ff3ec1f22
|
|
518
|
+
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
519
519
|
var _node$ownerDocument;
|
|
520
520
|
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
521
|
-
const context = useContext($5cb92bef7577960e$var$DismissableLayerContext
|
|
521
|
+
const context = useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
522
522
|
const [node1, setNode] = useState(null);
|
|
523
523
|
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;
|
|
524
524
|
const [, force] = useState({});
|
|
525
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
525
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
526
526
|
);
|
|
527
527
|
const layers = Array.from(context.layers);
|
|
528
528
|
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
@@ -532,7 +532,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
532
532
|
const index = node1 ? layers.indexOf(node1) : -1;
|
|
533
533
|
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
534
534
|
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
535
|
-
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside
|
|
535
|
+
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
536
536
|
const target = event.target;
|
|
537
537
|
const isPointerDownOnBranch = [
|
|
538
538
|
...context.branches
|
|
@@ -543,7 +543,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
543
543
|
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
544
544
|
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
545
545
|
}, ownerDocument);
|
|
546
|
-
const focusOutside = $5cb92bef7577960e$var$useFocusOutside
|
|
546
|
+
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
|
|
547
547
|
const target = event.target;
|
|
548
548
|
const isFocusInBranch = [
|
|
549
549
|
...context.branches
|
|
@@ -554,7 +554,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
554
554
|
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
555
555
|
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
556
556
|
}, ownerDocument);
|
|
557
|
-
$addc16e1bbe58fd0$export$3a72a57244d6e765
|
|
557
|
+
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
558
558
|
const isHighestLayer = index === context.layers.size - 1;
|
|
559
559
|
if (!isHighestLayer) return;
|
|
560
560
|
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
@@ -567,15 +567,15 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
567
567
|
if (!node1) return;
|
|
568
568
|
if (disableOutsidePointerEvents) {
|
|
569
569
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
570
|
-
$5cb92bef7577960e$var$originalBodyPointerEvents
|
|
570
|
+
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
571
571
|
ownerDocument.body.style.pointerEvents = 'none';
|
|
572
572
|
}
|
|
573
573
|
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
574
574
|
}
|
|
575
575
|
context.layers.add(node1);
|
|
576
|
-
$5cb92bef7577960e$var$dispatchUpdate
|
|
576
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
577
577
|
return ()=>{
|
|
578
|
-
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents
|
|
578
|
+
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
579
579
|
};
|
|
580
580
|
}, [
|
|
581
581
|
node1,
|
|
@@ -593,7 +593,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
593
593
|
if (!node1) return;
|
|
594
594
|
context.layers.delete(node1);
|
|
595
595
|
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
596
|
-
$5cb92bef7577960e$var$dispatchUpdate
|
|
596
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
597
597
|
};
|
|
598
598
|
}, [
|
|
599
599
|
node1,
|
|
@@ -602,27 +602,27 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
602
602
|
useEffect(()=>{
|
|
603
603
|
const handleUpdate = ()=>force({})
|
|
604
604
|
;
|
|
605
|
-
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE
|
|
606
|
-
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE
|
|
605
|
+
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
606
|
+
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
607
607
|
;
|
|
608
608
|
}, []);
|
|
609
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
609
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
|
|
610
610
|
ref: composedRefs,
|
|
611
611
|
style: {
|
|
612
612
|
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
613
613
|
...props.style
|
|
614
614
|
},
|
|
615
|
-
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
616
|
-
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
617
|
-
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
615
|
+
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
616
|
+
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
617
|
+
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
618
618
|
}));
|
|
619
619
|
});
|
|
620
620
|
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
621
621
|
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
622
622
|
* to mimic layer dismissing behaviour present in OS.
|
|
623
623
|
* Returns props to pass to the node we want to check for outside events.
|
|
624
|
-
*/ function $5cb92bef7577960e$var$usePointerDownOutside
|
|
625
|
-
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
624
|
+
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
625
|
+
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
626
626
|
const isPointerInsideReactTreeRef = useRef(false);
|
|
627
627
|
const handleClickRef = useRef(()=>{});
|
|
628
628
|
useEffect(()=>{
|
|
@@ -632,7 +632,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
632
632
|
originalEvent: event
|
|
633
633
|
};
|
|
634
634
|
function handleAndDispatchPointerDownOutsideEvent() {
|
|
635
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent
|
|
635
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
636
636
|
discrete: true
|
|
637
637
|
});
|
|
638
638
|
}
|
|
@@ -691,8 +691,8 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
691
691
|
/**
|
|
692
692
|
* Listens for when focus happens outside a react subtree.
|
|
693
693
|
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
694
|
-
*/ function $5cb92bef7577960e$var$useFocusOutside
|
|
695
|
-
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
694
|
+
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
695
|
+
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
696
696
|
const isFocusInsideReactTreeRef = useRef(false);
|
|
697
697
|
useEffect(()=>{
|
|
698
698
|
const handleFocus = (event)=>{
|
|
@@ -700,7 +700,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
700
700
|
const eventDetail = {
|
|
701
701
|
originalEvent: event
|
|
702
702
|
};
|
|
703
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent
|
|
703
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
704
704
|
discrete: false
|
|
705
705
|
});
|
|
706
706
|
}
|
|
@@ -718,11 +718,11 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
718
718
|
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
|
|
719
719
|
};
|
|
720
720
|
}
|
|
721
|
-
function $5cb92bef7577960e$var$dispatchUpdate
|
|
722
|
-
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE
|
|
721
|
+
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
722
|
+
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
723
723
|
document.dispatchEvent(event);
|
|
724
724
|
}
|
|
725
|
-
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent
|
|
725
|
+
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
726
726
|
const target = detail.originalEvent.target;
|
|
727
727
|
const event = new CustomEvent(name, {
|
|
728
728
|
bubbles: false,
|
|
@@ -732,7 +732,7 @@ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent$1(name, handler, det
|
|
|
732
732
|
if (handler) target.addEventListener(name, handler, {
|
|
733
733
|
once: true
|
|
734
734
|
});
|
|
735
|
-
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f
|
|
735
|
+
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
736
736
|
else target.dispatchEvent(event);
|
|
737
737
|
}
|
|
738
738
|
|
|
@@ -771,10 +771,10 @@ const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
|
771
771
|
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
772
772
|
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
|
773
773
|
const [container1, setContainer] = useState(null);
|
|
774
|
-
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
775
|
-
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
774
|
+
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
|
775
|
+
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
|
776
776
|
const lastFocusedElementRef = useRef(null);
|
|
777
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
777
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
|
|
778
778
|
);
|
|
779
779
|
const focusScope = useRef({
|
|
780
780
|
paused: false,
|
|
@@ -907,7 +907,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((prop
|
|
|
907
907
|
trapped,
|
|
908
908
|
focusScope.paused
|
|
909
909
|
]);
|
|
910
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
910
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
911
911
|
tabIndex: -1
|
|
912
912
|
}, scopeProps, {
|
|
913
913
|
ref: composedRefs,
|
|
@@ -1037,14 +1037,14 @@ function $d3863c46a17e8a28$var$removeLinks(items) {
|
|
|
1037
1037
|
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
1038
1038
|
*
|
|
1039
1039
|
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
1040
|
-
*/ const $9f79659886946c16$export$e5c5a5f917a5871c
|
|
1040
|
+
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
|
|
1041
1041
|
|
|
1042
1042
|
const $1746a345f3d73bb7$var$useReactId = React['useId'.toString()] || (()=>undefined
|
|
1043
1043
|
);
|
|
1044
1044
|
let $1746a345f3d73bb7$var$count = 0;
|
|
1045
1045
|
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
1046
1046
|
const [id, setId] = React.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
|
|
1047
|
-
$9f79659886946c16$export$e5c5a5f917a5871c
|
|
1047
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
1048
1048
|
if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
|
|
1049
1049
|
);
|
|
1050
1050
|
}, [
|
|
@@ -1395,7 +1395,7 @@ async function detectOverflow(state, options) {
|
|
|
1395
1395
|
* appears centered to the reference element.
|
|
1396
1396
|
* @see https://floating-ui.com/docs/arrow
|
|
1397
1397
|
*/
|
|
1398
|
-
const arrow$
|
|
1398
|
+
const arrow$2 = options => ({
|
|
1399
1399
|
name: 'arrow',
|
|
1400
1400
|
options,
|
|
1401
1401
|
async fn(state) {
|
|
@@ -2703,7 +2703,7 @@ const hide = hide$1;
|
|
|
2703
2703
|
* appears centered to the reference element.
|
|
2704
2704
|
* @see https://floating-ui.com/docs/arrow
|
|
2705
2705
|
*/
|
|
2706
|
-
const arrow$
|
|
2706
|
+
const arrow$1 = arrow$2;
|
|
2707
2707
|
|
|
2708
2708
|
/**
|
|
2709
2709
|
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
@@ -2739,7 +2739,7 @@ const computePosition = (reference, floating, options) => {
|
|
|
2739
2739
|
* This wraps the core `arrow` middleware to allow React refs as the element.
|
|
2740
2740
|
* @see https://floating-ui.com/docs/arrow
|
|
2741
2741
|
*/
|
|
2742
|
-
const arrow
|
|
2742
|
+
const arrow = options => {
|
|
2743
2743
|
function isRef(value) {
|
|
2744
2744
|
return {}.hasOwnProperty.call(value, 'current');
|
|
2745
2745
|
}
|
|
@@ -2753,14 +2753,14 @@ const arrow$1 = options => {
|
|
|
2753
2753
|
} = typeof options === 'function' ? options(state) : options;
|
|
2754
2754
|
if (element && isRef(element)) {
|
|
2755
2755
|
if (element.current != null) {
|
|
2756
|
-
return arrow$
|
|
2756
|
+
return arrow$1({
|
|
2757
2757
|
element: element.current,
|
|
2758
2758
|
padding
|
|
2759
2759
|
}).fn(state);
|
|
2760
2760
|
}
|
|
2761
2761
|
return {};
|
|
2762
2762
|
} else if (element) {
|
|
2763
|
-
return arrow$
|
|
2763
|
+
return arrow$1({
|
|
2764
2764
|
element,
|
|
2765
2765
|
padding
|
|
2766
2766
|
}).fn(state);
|
|
@@ -2770,11 +2770,11 @@ const arrow$1 = options => {
|
|
|
2770
2770
|
};
|
|
2771
2771
|
};
|
|
2772
2772
|
|
|
2773
|
-
var index$
|
|
2773
|
+
var index$1 = typeof document !== 'undefined' ? useLayoutEffect : useEffect;
|
|
2774
2774
|
|
|
2775
2775
|
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
|
|
2776
2776
|
// functions
|
|
2777
|
-
function deepEqual
|
|
2777
|
+
function deepEqual(a, b) {
|
|
2778
2778
|
if (a === b) {
|
|
2779
2779
|
return true;
|
|
2780
2780
|
}
|
|
@@ -2790,7 +2790,7 @@ function deepEqual$1(a, b) {
|
|
|
2790
2790
|
length = a.length;
|
|
2791
2791
|
if (length != b.length) return false;
|
|
2792
2792
|
for (i = length; i-- !== 0;) {
|
|
2793
|
-
if (!deepEqual
|
|
2793
|
+
if (!deepEqual(a[i], b[i])) {
|
|
2794
2794
|
return false;
|
|
2795
2795
|
}
|
|
2796
2796
|
}
|
|
@@ -2811,7 +2811,7 @@ function deepEqual$1(a, b) {
|
|
|
2811
2811
|
if (key === '_owner' && a.$$typeof) {
|
|
2812
2812
|
continue;
|
|
2813
2813
|
}
|
|
2814
|
-
if (!deepEqual
|
|
2814
|
+
if (!deepEqual(a[key], b[key])) {
|
|
2815
2815
|
return false;
|
|
2816
2816
|
}
|
|
2817
2817
|
}
|
|
@@ -2833,9 +2833,9 @@ function roundByDPR(element, value) {
|
|
|
2833
2833
|
return Math.round(value * dpr) / dpr;
|
|
2834
2834
|
}
|
|
2835
2835
|
|
|
2836
|
-
function useLatestRef
|
|
2836
|
+
function useLatestRef(value) {
|
|
2837
2837
|
const ref = React.useRef(value);
|
|
2838
|
-
index$
|
|
2838
|
+
index$1(() => {
|
|
2839
2839
|
ref.current = value;
|
|
2840
2840
|
});
|
|
2841
2841
|
return ref;
|
|
@@ -2845,7 +2845,7 @@ function useLatestRef$1(value) {
|
|
|
2845
2845
|
* Provides data to position a floating element.
|
|
2846
2846
|
* @see https://floating-ui.com/docs/useFloating
|
|
2847
2847
|
*/
|
|
2848
|
-
function useFloating
|
|
2848
|
+
function useFloating(options) {
|
|
2849
2849
|
if (options === void 0) {
|
|
2850
2850
|
options = {};
|
|
2851
2851
|
}
|
|
@@ -2871,7 +2871,7 @@ function useFloating$1(options) {
|
|
|
2871
2871
|
isPositioned: false
|
|
2872
2872
|
});
|
|
2873
2873
|
const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);
|
|
2874
|
-
if (!deepEqual
|
|
2874
|
+
if (!deepEqual(latestMiddleware, middleware)) {
|
|
2875
2875
|
setLatestMiddleware(middleware);
|
|
2876
2876
|
}
|
|
2877
2877
|
const [_reference, _setReference] = React.useState(null);
|
|
@@ -2893,8 +2893,8 @@ function useFloating$1(options) {
|
|
|
2893
2893
|
const referenceRef = React.useRef(null);
|
|
2894
2894
|
const floatingRef = React.useRef(null);
|
|
2895
2895
|
const dataRef = React.useRef(data);
|
|
2896
|
-
const whileElementsMountedRef = useLatestRef
|
|
2897
|
-
const platformRef = useLatestRef
|
|
2896
|
+
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
2897
|
+
const platformRef = useLatestRef(platform);
|
|
2898
2898
|
const update = React.useCallback(() => {
|
|
2899
2899
|
if (!referenceRef.current || !floatingRef.current) {
|
|
2900
2900
|
return;
|
|
@@ -2912,7 +2912,7 @@ function useFloating$1(options) {
|
|
|
2912
2912
|
...data,
|
|
2913
2913
|
isPositioned: true
|
|
2914
2914
|
};
|
|
2915
|
-
if (isMountedRef.current && !deepEqual
|
|
2915
|
+
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
2916
2916
|
dataRef.current = fullData;
|
|
2917
2917
|
ReactDOM.flushSync(() => {
|
|
2918
2918
|
setData(fullData);
|
|
@@ -2920,7 +2920,7 @@ function useFloating$1(options) {
|
|
|
2920
2920
|
}
|
|
2921
2921
|
});
|
|
2922
2922
|
}, [latestMiddleware, placement, strategy, platformRef]);
|
|
2923
|
-
index$
|
|
2923
|
+
index$1(() => {
|
|
2924
2924
|
if (open === false && dataRef.current.isPositioned) {
|
|
2925
2925
|
dataRef.current.isPositioned = false;
|
|
2926
2926
|
setData(data => ({
|
|
@@ -2930,13 +2930,13 @@ function useFloating$1(options) {
|
|
|
2930
2930
|
}
|
|
2931
2931
|
}, [open]);
|
|
2932
2932
|
const isMountedRef = React.useRef(false);
|
|
2933
|
-
index$
|
|
2933
|
+
index$1(() => {
|
|
2934
2934
|
isMountedRef.current = true;
|
|
2935
2935
|
return () => {
|
|
2936
2936
|
isMountedRef.current = false;
|
|
2937
2937
|
};
|
|
2938
2938
|
}, []);
|
|
2939
|
-
index$
|
|
2939
|
+
index$1(() => {
|
|
2940
2940
|
if (referenceEl) referenceRef.current = referenceEl;
|
|
2941
2941
|
if (floatingEl) floatingRef.current = floatingEl;
|
|
2942
2942
|
if (referenceEl && floatingEl) {
|
|
@@ -2992,9 +2992,9 @@ function useFloating$1(options) {
|
|
|
2992
2992
|
}), [data, update, refs, elements, floatingStyles]);
|
|
2993
2993
|
}
|
|
2994
2994
|
|
|
2995
|
-
const $7e8f5cd07187803e$export$21b07c8f274aebd5
|
|
2995
|
+
const $7e8f5cd07187803e$export$21b07c8f274aebd5 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
2996
2996
|
const { children: children , width: width = 10 , height: height = 5 , ...arrowProps } = props;
|
|
2997
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
2997
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.svg, _extends({}, arrowProps, {
|
|
2998
2998
|
ref: forwardedRef,
|
|
2999
2999
|
width: width,
|
|
3000
3000
|
height: height,
|
|
@@ -3004,11 +3004,11 @@ const $7e8f5cd07187803e$export$21b07c8f274aebd5$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
3004
3004
|
points: "0,0 30,0 15,10"
|
|
3005
3005
|
}));
|
|
3006
3006
|
});
|
|
3007
|
-
/* -----------------------------------------------------------------------------------------------*/ const $7e8f5cd07187803e$export$be92b6f5f03c0fe9
|
|
3007
|
+
/* -----------------------------------------------------------------------------------------------*/ const $7e8f5cd07187803e$export$be92b6f5f03c0fe9 = $7e8f5cd07187803e$export$21b07c8f274aebd5;
|
|
3008
3008
|
|
|
3009
|
-
function $db6c3485150b8e66$export$1ab7ae714698c4b8
|
|
3009
|
+
function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
|
3010
3010
|
const [size, setSize] = useState(undefined);
|
|
3011
|
-
$9f79659886946c16$export$e5c5a5f917a5871c
|
|
3011
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3012
3012
|
if (element) {
|
|
3013
3013
|
// provide size as early as possible
|
|
3014
3014
|
setSize({
|
|
@@ -3055,13 +3055,13 @@ function $db6c3485150b8e66$export$1ab7ae714698c4b8$1(element) {
|
|
|
3055
3055
|
|
|
3056
3056
|
/* -------------------------------------------------------------------------------------------------
|
|
3057
3057
|
* Popper
|
|
3058
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$POPPER_NAME
|
|
3059
|
-
const [$cf1ac5d9fe0e8206$var$createPopperContext
|
|
3060
|
-
const [$cf1ac5d9fe0e8206$var$PopperProvider
|
|
3061
|
-
const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9
|
|
3058
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$POPPER_NAME = 'Popper';
|
|
3059
|
+
const [$cf1ac5d9fe0e8206$var$createPopperContext, $cf1ac5d9fe0e8206$export$722aac194ae923] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
3060
|
+
const [$cf1ac5d9fe0e8206$var$PopperProvider, $cf1ac5d9fe0e8206$var$usePopperContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
3061
|
+
const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 = (props)=>{
|
|
3062
3062
|
const { __scopePopper: __scopePopper , children: children } = props;
|
|
3063
3063
|
const [anchor, setAnchor] = useState(null);
|
|
3064
|
-
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$var$PopperProvider
|
|
3064
|
+
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$var$PopperProvider, {
|
|
3065
3065
|
scope: __scopePopper,
|
|
3066
3066
|
anchor: anchor,
|
|
3067
3067
|
onAnchorChange: setAnchor
|
|
@@ -3069,35 +3069,35 @@ const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9$1 = (props)=>{
|
|
|
3069
3069
|
};
|
|
3070
3070
|
/* -------------------------------------------------------------------------------------------------
|
|
3071
3071
|
* PopperAnchor
|
|
3072
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ANCHOR_NAME
|
|
3073
|
-
const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d
|
|
3072
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ANCHOR_NAME = 'PopperAnchor';
|
|
3073
|
+
const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
3074
3074
|
const { __scopePopper: __scopePopper , virtualRef: virtualRef , ...anchorProps } = props;
|
|
3075
|
-
const context = $cf1ac5d9fe0e8206$var$usePopperContext
|
|
3075
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME, __scopePopper);
|
|
3076
3076
|
const ref = useRef(null);
|
|
3077
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
3077
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
3078
3078
|
useEffect(()=>{
|
|
3079
3079
|
// Consumer can anchor the popper to something that isn't
|
|
3080
3080
|
// a DOM node e.g. pointer position, so we override the
|
|
3081
3081
|
// `anchorRef` with their virtual ref in this case.
|
|
3082
3082
|
context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
|
|
3083
3083
|
});
|
|
3084
|
-
return virtualRef ? null : /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
3084
|
+
return virtualRef ? null : /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, anchorProps, {
|
|
3085
3085
|
ref: composedRefs
|
|
3086
3086
|
}));
|
|
3087
3087
|
});
|
|
3088
3088
|
/* -------------------------------------------------------------------------------------------------
|
|
3089
3089
|
* PopperContent
|
|
3090
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$CONTENT_NAME
|
|
3091
|
-
const [$cf1ac5d9fe0e8206$var$PopperContentProvider
|
|
3092
|
-
const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc
|
|
3090
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$CONTENT_NAME = 'PopperContent';
|
|
3091
|
+
const [$cf1ac5d9fe0e8206$var$PopperContentProvider, $cf1ac5d9fe0e8206$var$useContentContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME);
|
|
3092
|
+
const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
3093
3093
|
var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$trans, _middlewareData$trans2, _middlewareData$hide;
|
|
3094
3094
|
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;
|
|
3095
|
-
const context = $cf1ac5d9fe0e8206$var$usePopperContext
|
|
3095
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
|
|
3096
3096
|
const [content, setContent] = useState(null);
|
|
3097
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
3097
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
|
3098
3098
|
);
|
|
3099
|
-
const [arrow, setArrow] = useState(null);
|
|
3100
|
-
const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8$1
|
|
3099
|
+
const [arrow$1, setArrow] = useState(null);
|
|
3100
|
+
const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(arrow$1);
|
|
3101
3101
|
const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0;
|
|
3102
3102
|
const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0;
|
|
3103
3103
|
const desiredPlacement = side + (align !== 'center' ? '-' + align : '');
|
|
@@ -3114,11 +3114,11 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc$1 = /*#__PURE__*/ forwardRef((pro
|
|
|
3114
3114
|
const hasExplicitBoundaries = boundary.length > 0;
|
|
3115
3115
|
const detectOverflowOptions = {
|
|
3116
3116
|
padding: collisionPadding,
|
|
3117
|
-
boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull
|
|
3117
|
+
boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull),
|
|
3118
3118
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
3119
3119
|
altBoundary: hasExplicitBoundaries
|
|
3120
3120
|
};
|
|
3121
|
-
const { refs: refs , floatingStyles: floatingStyles , placement: placement , isPositioned: isPositioned , middlewareData: middlewareData } = useFloating
|
|
3121
|
+
const { refs: refs , floatingStyles: floatingStyles , placement: placement , isPositioned: isPositioned , middlewareData: middlewareData } = useFloating({
|
|
3122
3122
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
3123
3123
|
strategy: 'fixed',
|
|
3124
3124
|
placement: desiredPlacement,
|
|
@@ -3156,11 +3156,11 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc$1 = /*#__PURE__*/ forwardRef((pro
|
|
|
3156
3156
|
contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`);
|
|
3157
3157
|
}
|
|
3158
3158
|
}),
|
|
3159
|
-
arrow && arrow
|
|
3160
|
-
element: arrow,
|
|
3159
|
+
arrow$1 && arrow({
|
|
3160
|
+
element: arrow$1,
|
|
3161
3161
|
padding: arrowPadding
|
|
3162
3162
|
}),
|
|
3163
|
-
$cf1ac5d9fe0e8206$var$transformOrigin
|
|
3163
|
+
$cf1ac5d9fe0e8206$var$transformOrigin({
|
|
3164
3164
|
arrowWidth: arrowWidth,
|
|
3165
3165
|
arrowHeight: arrowHeight
|
|
3166
3166
|
}),
|
|
@@ -3170,9 +3170,9 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc$1 = /*#__PURE__*/ forwardRef((pro
|
|
|
3170
3170
|
})
|
|
3171
3171
|
]
|
|
3172
3172
|
});
|
|
3173
|
-
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement
|
|
3174
|
-
const handlePlaced = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
3175
|
-
$9f79659886946c16$export$e5c5a5f917a5871c
|
|
3173
|
+
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
3174
|
+
const handlePlaced = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPlaced);
|
|
3175
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3176
3176
|
if (isPositioned) handlePlaced === null || handlePlaced === void 0 || handlePlaced();
|
|
3177
3177
|
}, [
|
|
3178
3178
|
isPositioned,
|
|
@@ -3182,7 +3182,7 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc$1 = /*#__PURE__*/ forwardRef((pro
|
|
|
3182
3182
|
const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y;
|
|
3183
3183
|
const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0;
|
|
3184
3184
|
const [contentZIndex, setContentZIndex] = useState();
|
|
3185
|
-
$9f79659886946c16$export$e5c5a5f917a5871c
|
|
3185
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3186
3186
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
3187
3187
|
}, [
|
|
3188
3188
|
content
|
|
@@ -3203,14 +3203,14 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc$1 = /*#__PURE__*/ forwardRef((pro
|
|
|
3203
3203
|
} // Floating UI interally calculates logical alignment based the `dir` attribute on
|
|
3204
3204
|
,
|
|
3205
3205
|
dir: props.dir
|
|
3206
|
-
}, /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$var$PopperContentProvider
|
|
3206
|
+
}, /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$var$PopperContentProvider, {
|
|
3207
3207
|
scope: __scopePopper,
|
|
3208
3208
|
placedSide: placedSide,
|
|
3209
3209
|
onArrowChange: setArrow,
|
|
3210
3210
|
arrowX: arrowX,
|
|
3211
3211
|
arrowY: arrowY,
|
|
3212
3212
|
shouldHideArrow: cannotCenterArrow
|
|
3213
|
-
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
3213
|
+
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
3214
3214
|
"data-side": placedSide,
|
|
3215
3215
|
"data-align": placedAlign
|
|
3216
3216
|
}, contentProps, {
|
|
@@ -3227,17 +3227,17 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc$1 = /*#__PURE__*/ forwardRef((pro
|
|
|
3227
3227
|
});
|
|
3228
3228
|
/* -------------------------------------------------------------------------------------------------
|
|
3229
3229
|
* PopperArrow
|
|
3230
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ARROW_NAME
|
|
3231
|
-
const $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE
|
|
3230
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ARROW_NAME = 'PopperArrow';
|
|
3231
|
+
const $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE = {
|
|
3232
3232
|
top: 'bottom',
|
|
3233
3233
|
right: 'left',
|
|
3234
3234
|
bottom: 'top',
|
|
3235
3235
|
left: 'right'
|
|
3236
3236
|
};
|
|
3237
|
-
const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0
|
|
3237
|
+
const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0 = /*#__PURE__*/ forwardRef(function $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0(props, forwardedRef) {
|
|
3238
3238
|
const { __scopePopper: __scopePopper , ...arrowProps } = props;
|
|
3239
|
-
const contentContext = $cf1ac5d9fe0e8206$var$useContentContext
|
|
3240
|
-
const baseSide = $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE
|
|
3239
|
+
const contentContext = $cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME, __scopePopper);
|
|
3240
|
+
const baseSide = $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE[contentContext.placedSide];
|
|
3241
3241
|
return(/*#__PURE__*/ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
3242
3242
|
// doesn't report size as we'd expect on SVG elements.
|
|
3243
3243
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
@@ -3262,7 +3262,7 @@ const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0$1 = /*#__PURE__*/ forwardRef(fun
|
|
|
3262
3262
|
}[contentContext.placedSide],
|
|
3263
3263
|
visibility: contentContext.shouldHideArrow ? 'hidden' : undefined
|
|
3264
3264
|
}
|
|
3265
|
-
}, /*#__PURE__*/ createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9
|
|
3265
|
+
}, /*#__PURE__*/ createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9, _extends({}, arrowProps, {
|
|
3266
3266
|
ref: forwardedRef,
|
|
3267
3267
|
style: {
|
|
3268
3268
|
...arrowProps.style,
|
|
@@ -3271,10 +3271,10 @@ const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0$1 = /*#__PURE__*/ forwardRef(fun
|
|
|
3271
3271
|
}
|
|
3272
3272
|
}))));
|
|
3273
3273
|
});
|
|
3274
|
-
/* -----------------------------------------------------------------------------------------------*/ function $cf1ac5d9fe0e8206$var$isNotNull
|
|
3274
|
+
/* -----------------------------------------------------------------------------------------------*/ function $cf1ac5d9fe0e8206$var$isNotNull(value) {
|
|
3275
3275
|
return value !== null;
|
|
3276
3276
|
}
|
|
3277
|
-
const $cf1ac5d9fe0e8206$var$transformOrigin
|
|
3277
|
+
const $cf1ac5d9fe0e8206$var$transformOrigin = (options)=>({
|
|
3278
3278
|
name: 'transformOrigin',
|
|
3279
3279
|
options: options,
|
|
3280
3280
|
fn (data) {
|
|
@@ -3284,7 +3284,7 @@ const $cf1ac5d9fe0e8206$var$transformOrigin$1 = (options)=>({
|
|
|
3284
3284
|
const isArrowHidden = cannotCenterArrow;
|
|
3285
3285
|
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
3286
3286
|
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
3287
|
-
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement
|
|
3287
|
+
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
3288
3288
|
const noArrowAlign = {
|
|
3289
3289
|
start: '0%',
|
|
3290
3290
|
center: '50%',
|
|
@@ -3316,27 +3316,27 @@ const $cf1ac5d9fe0e8206$var$transformOrigin$1 = (options)=>({
|
|
|
3316
3316
|
}
|
|
3317
3317
|
})
|
|
3318
3318
|
;
|
|
3319
|
-
function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement
|
|
3319
|
+
function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement) {
|
|
3320
3320
|
const [side, align = 'center'] = placement.split('-');
|
|
3321
3321
|
return [
|
|
3322
3322
|
side,
|
|
3323
3323
|
align
|
|
3324
3324
|
];
|
|
3325
3325
|
}
|
|
3326
|
-
const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9
|
|
3327
|
-
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7
|
|
3328
|
-
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2
|
|
3329
|
-
const $cf1ac5d9fe0e8206$export$21b07c8f274aebd5
|
|
3326
|
+
const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9;
|
|
3327
|
+
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
|
|
3328
|
+
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
|
|
3329
|
+
const $cf1ac5d9fe0e8206$export$21b07c8f274aebd5 = $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0;
|
|
3330
3330
|
|
|
3331
|
-
const $f1701beae083dbae$export$602eac185826482c
|
|
3331
|
+
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
3332
3332
|
var _globalThis$document;
|
|
3333
3333
|
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;
|
|
3334
|
-
return container ? /*#__PURE__*/ ReactDOM__default.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
3334
|
+
return container ? /*#__PURE__*/ ReactDOM__default.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
|
3335
3335
|
ref: forwardedRef
|
|
3336
3336
|
})), container) : null;
|
|
3337
3337
|
});
|
|
3338
3338
|
|
|
3339
|
-
function $fe963b355347cc68$export$3e6543de14f8614f
|
|
3339
|
+
function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
|
|
3340
3340
|
return useReducer((state, event)=>{
|
|
3341
3341
|
const nextState = machine[state][event];
|
|
3342
3342
|
return nextState !== null && nextState !== void 0 ? nextState : state;
|
|
@@ -3344,28 +3344,28 @@ function $fe963b355347cc68$export$3e6543de14f8614f$1(initialState, machine) {
|
|
|
3344
3344
|
}
|
|
3345
3345
|
|
|
3346
3346
|
|
|
3347
|
-
const $921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
3347
|
+
const $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props)=>{
|
|
3348
3348
|
const { present: present , children: children } = props;
|
|
3349
|
-
const presence = $921a889cee6df7e8$var$usePresence
|
|
3349
|
+
const presence = $921a889cee6df7e8$var$usePresence(present);
|
|
3350
3350
|
const child = typeof children === 'function' ? children({
|
|
3351
3351
|
present: presence.isPresent
|
|
3352
3352
|
}) : Children.only(children);
|
|
3353
|
-
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
3353
|
+
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
|
|
3354
3354
|
const forceMount = typeof children === 'function';
|
|
3355
3355
|
return forceMount || presence.isPresent ? /*#__PURE__*/ cloneElement(child, {
|
|
3356
3356
|
ref: ref
|
|
3357
3357
|
}) : null;
|
|
3358
3358
|
};
|
|
3359
|
-
$921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
3359
|
+
$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
|
|
3360
3360
|
/* -------------------------------------------------------------------------------------------------
|
|
3361
3361
|
* usePresence
|
|
3362
|
-
* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence
|
|
3362
|
+
* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence(present) {
|
|
3363
3363
|
const [node1, setNode] = useState();
|
|
3364
3364
|
const stylesRef = useRef({});
|
|
3365
3365
|
const prevPresentRef = useRef(present);
|
|
3366
3366
|
const prevAnimationNameRef = useRef('none');
|
|
3367
3367
|
const initialState = present ? 'mounted' : 'unmounted';
|
|
3368
|
-
const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f
|
|
3368
|
+
const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
|
|
3369
3369
|
mounted: {
|
|
3370
3370
|
UNMOUNT: 'unmounted',
|
|
3371
3371
|
ANIMATION_OUT: 'unmountSuspended'
|
|
@@ -3379,18 +3379,18 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b$1.displayName = 'Presence';
|
|
|
3379
3379
|
}
|
|
3380
3380
|
});
|
|
3381
3381
|
useEffect(()=>{
|
|
3382
|
-
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName
|
|
3382
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
3383
3383
|
prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';
|
|
3384
3384
|
}, [
|
|
3385
3385
|
state
|
|
3386
3386
|
]);
|
|
3387
|
-
$9f79659886946c16$export$e5c5a5f917a5871c
|
|
3387
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3388
3388
|
const styles = stylesRef.current;
|
|
3389
3389
|
const wasPresent = prevPresentRef.current;
|
|
3390
3390
|
const hasPresentChanged = wasPresent !== present;
|
|
3391
3391
|
if (hasPresentChanged) {
|
|
3392
3392
|
const prevAnimationName = prevAnimationNameRef.current;
|
|
3393
|
-
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName
|
|
3393
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
|
|
3394
3394
|
if (present) send('MOUNT');
|
|
3395
3395
|
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
|
|
3396
3396
|
// so we unmount instantly
|
|
@@ -3411,14 +3411,14 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b$1.displayName = 'Presence';
|
|
|
3411
3411
|
present,
|
|
3412
3412
|
send
|
|
3413
3413
|
]);
|
|
3414
|
-
$9f79659886946c16$export$e5c5a5f917a5871c
|
|
3414
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
3415
3415
|
if (node1) {
|
|
3416
3416
|
/**
|
|
3417
3417
|
* Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`
|
|
3418
3418
|
* event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we
|
|
3419
3419
|
* make sure we only trigger ANIMATION_END for the currently active animation.
|
|
3420
3420
|
*/ const handleAnimationEnd = (event)=>{
|
|
3421
|
-
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName
|
|
3421
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
3422
3422
|
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
3423
3423
|
if (event.target === node1 && isCurrentAnimation) // With React 18 concurrency this update is applied
|
|
3424
3424
|
// a frame after the animation ends, creating a flash of visible content.
|
|
@@ -3428,7 +3428,7 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b$1.displayName = 'Presence';
|
|
|
3428
3428
|
};
|
|
3429
3429
|
const handleAnimationStart = (event)=>{
|
|
3430
3430
|
if (event.target === node1) // if animation occurred, store its name as the previous animation.
|
|
3431
|
-
prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName
|
|
3431
|
+
prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
3432
3432
|
};
|
|
3433
3433
|
node1.addEventListener('animationstart', handleAnimationStart);
|
|
3434
3434
|
node1.addEventListener('animationcancel', handleAnimationEnd);
|
|
@@ -3456,18 +3456,18 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b$1.displayName = 'Presence';
|
|
|
3456
3456
|
}, [])
|
|
3457
3457
|
};
|
|
3458
3458
|
}
|
|
3459
|
-
/* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName
|
|
3459
|
+
/* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName(styles) {
|
|
3460
3460
|
return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none';
|
|
3461
3461
|
}
|
|
3462
3462
|
|
|
3463
|
-
function $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
3464
|
-
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState
|
|
3463
|
+
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
|
|
3464
|
+
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
3465
3465
|
defaultProp: defaultProp,
|
|
3466
3466
|
onChange: onChange
|
|
3467
3467
|
});
|
|
3468
3468
|
const isControlled = prop !== undefined;
|
|
3469
3469
|
const value1 = isControlled ? prop : uncontrolledProp;
|
|
3470
|
-
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
3470
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
3471
3471
|
const setValue = useCallback((nextValue)=>{
|
|
3472
3472
|
if (isControlled) {
|
|
3473
3473
|
const setter = nextValue;
|
|
@@ -3485,11 +3485,11 @@ function $71cd76cc60e0454e$export$6f32135080cb4c3$1({ prop: prop , defaultProp:
|
|
|
3485
3485
|
setValue
|
|
3486
3486
|
];
|
|
3487
3487
|
}
|
|
3488
|
-
function $71cd76cc60e0454e$var$useUncontrolledState
|
|
3488
|
+
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
|
|
3489
3489
|
const uncontrolledState = useState(defaultProp);
|
|
3490
3490
|
const [value] = uncontrolledState;
|
|
3491
3491
|
const prevValueRef = useRef(value);
|
|
3492
|
-
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
3492
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
3493
3493
|
useEffect(()=>{
|
|
3494
3494
|
if (prevValueRef.current !== value) {
|
|
3495
3495
|
handleChange(value);
|
|
@@ -4341,22 +4341,22 @@ var $epM9y$RemoveScroll = ReactRemoveScroll;
|
|
|
4341
4341
|
/* -------------------------------------------------------------------------------------------------
|
|
4342
4342
|
* Popover
|
|
4343
4343
|
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$POPOVER_NAME = 'Popover';
|
|
4344
|
-
const [$cb5cc270b50c6fcd$var$createPopoverContext, $cb5cc270b50c6fcd$export$c8393c9e73286932] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
4345
|
-
$cf1ac5d9fe0e8206$export$722aac194ae923
|
|
4344
|
+
const [$cb5cc270b50c6fcd$var$createPopoverContext, $cb5cc270b50c6fcd$export$c8393c9e73286932] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cb5cc270b50c6fcd$var$POPOVER_NAME, [
|
|
4345
|
+
$cf1ac5d9fe0e8206$export$722aac194ae923
|
|
4346
4346
|
]);
|
|
4347
|
-
const $cb5cc270b50c6fcd$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923
|
|
4347
|
+
const $cb5cc270b50c6fcd$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923();
|
|
4348
4348
|
const [$cb5cc270b50c6fcd$var$PopoverProvider, $cb5cc270b50c6fcd$var$usePopoverContext] = $cb5cc270b50c6fcd$var$createPopoverContext($cb5cc270b50c6fcd$var$POPOVER_NAME);
|
|
4349
4349
|
const $cb5cc270b50c6fcd$export$5b6b19405a83ff9d = (props)=>{
|
|
4350
4350
|
const { __scopePopover: __scopePopover , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = false } = props;
|
|
4351
4351
|
const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover);
|
|
4352
4352
|
const triggerRef = useRef(null);
|
|
4353
4353
|
const [hasCustomAnchor, setHasCustomAnchor] = useState(false);
|
|
4354
|
-
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
4354
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
4355
4355
|
prop: openProp,
|
|
4356
4356
|
defaultProp: defaultOpen,
|
|
4357
4357
|
onChange: onOpenChange
|
|
4358
4358
|
});
|
|
4359
|
-
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9
|
|
4359
|
+
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ createElement($cb5cc270b50c6fcd$var$PopoverProvider, {
|
|
4360
4360
|
scope: __scopePopover,
|
|
4361
4361
|
contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
4362
4362
|
triggerRef: triggerRef,
|
|
@@ -4375,26 +4375,6 @@ const $cb5cc270b50c6fcd$export$5b6b19405a83ff9d = (props)=>{
|
|
|
4375
4375
|
modal: modal
|
|
4376
4376
|
}, children));
|
|
4377
4377
|
};
|
|
4378
|
-
/* -------------------------------------------------------------------------------------------------
|
|
4379
|
-
* PopoverAnchor
|
|
4380
|
-
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$ANCHOR_NAME = 'PopoverAnchor';
|
|
4381
|
-
const $cb5cc270b50c6fcd$export$96e5381f42521a79 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
4382
|
-
const { __scopePopover: __scopePopover , ...anchorProps } = props;
|
|
4383
|
-
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$ANCHOR_NAME, __scopePopover);
|
|
4384
|
-
const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover);
|
|
4385
|
-
const { onCustomAnchorAdd: onCustomAnchorAdd , onCustomAnchorRemove: onCustomAnchorRemove } = context;
|
|
4386
|
-
useEffect(()=>{
|
|
4387
|
-
onCustomAnchorAdd();
|
|
4388
|
-
return ()=>onCustomAnchorRemove()
|
|
4389
|
-
;
|
|
4390
|
-
}, [
|
|
4391
|
-
onCustomAnchorAdd,
|
|
4392
|
-
onCustomAnchorRemove
|
|
4393
|
-
]);
|
|
4394
|
-
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7$1, _extends({}, popperScope, anchorProps, {
|
|
4395
|
-
ref: forwardedRef
|
|
4396
|
-
}));
|
|
4397
|
-
});
|
|
4398
4378
|
/* -------------------------------------------------------------------------------------------------
|
|
4399
4379
|
* PopoverTrigger
|
|
4400
4380
|
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$TRIGGER_NAME = 'PopoverTrigger';
|
|
@@ -4402,8 +4382,8 @@ const $cb5cc270b50c6fcd$export$7dacb05d26466c3 = /*#__PURE__*/ forwardRef((props
|
|
|
4402
4382
|
const { __scopePopover: __scopePopover , ...triggerProps } = props;
|
|
4403
4383
|
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$TRIGGER_NAME, __scopePopover);
|
|
4404
4384
|
const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover);
|
|
4405
|
-
const composedTriggerRef = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
4406
|
-
const trigger = /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
4385
|
+
const composedTriggerRef = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.triggerRef);
|
|
4386
|
+
const trigger = /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
4407
4387
|
type: "button",
|
|
4408
4388
|
"aria-haspopup": "dialog",
|
|
4409
4389
|
"aria-expanded": context.open,
|
|
@@ -4411,9 +4391,9 @@ const $cb5cc270b50c6fcd$export$7dacb05d26466c3 = /*#__PURE__*/ forwardRef((props
|
|
|
4411
4391
|
"data-state": $cb5cc270b50c6fcd$var$getState(context.open)
|
|
4412
4392
|
}, triggerProps, {
|
|
4413
4393
|
ref: composedTriggerRef,
|
|
4414
|
-
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
4394
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onOpenToggle)
|
|
4415
4395
|
}));
|
|
4416
|
-
return context.hasCustomAnchor ? trigger : /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7
|
|
4396
|
+
return context.hasCustomAnchor ? trigger : /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({
|
|
4417
4397
|
asChild: true
|
|
4418
4398
|
}, popperScope), trigger);
|
|
4419
4399
|
});
|
|
@@ -4423,19 +4403,6 @@ const $cb5cc270b50c6fcd$export$7dacb05d26466c3 = /*#__PURE__*/ forwardRef((props
|
|
|
4423
4403
|
const [$cb5cc270b50c6fcd$var$PortalProvider, $cb5cc270b50c6fcd$var$usePortalContext] = $cb5cc270b50c6fcd$var$createPopoverContext($cb5cc270b50c6fcd$var$PORTAL_NAME, {
|
|
4424
4404
|
forceMount: undefined
|
|
4425
4405
|
});
|
|
4426
|
-
const $cb5cc270b50c6fcd$export$dd679ffb4362d2d4 = (props)=>{
|
|
4427
|
-
const { __scopePopover: __scopePopover , forceMount: forceMount , children: children , container: container } = props;
|
|
4428
|
-
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$PORTAL_NAME, __scopePopover);
|
|
4429
|
-
return /*#__PURE__*/ createElement($cb5cc270b50c6fcd$var$PortalProvider, {
|
|
4430
|
-
scope: __scopePopover,
|
|
4431
|
-
forceMount: forceMount
|
|
4432
|
-
}, /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b$1, {
|
|
4433
|
-
present: forceMount || context.open
|
|
4434
|
-
}, /*#__PURE__*/ createElement($f1701beae083dbae$export$602eac185826482c$1, {
|
|
4435
|
-
asChild: true,
|
|
4436
|
-
container: container
|
|
4437
|
-
}, children)));
|
|
4438
|
-
};
|
|
4439
4406
|
/* -------------------------------------------------------------------------------------------------
|
|
4440
4407
|
* PopoverContent
|
|
4441
4408
|
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$CONTENT_NAME = 'PopoverContent';
|
|
@@ -4443,7 +4410,7 @@ const $cb5cc270b50c6fcd$export$d7e1f420b25549ff = /*#__PURE__*/ forwardRef((prop
|
|
|
4443
4410
|
const portalContext = $cb5cc270b50c6fcd$var$usePortalContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
|
|
4444
4411
|
const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
|
|
4445
4412
|
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
|
|
4446
|
-
return /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
4413
|
+
return /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
4447
4414
|
present: forceMount || context.open
|
|
4448
4415
|
}, context.modal ? /*#__PURE__*/ createElement($cb5cc270b50c6fcd$var$PopoverContentModal, _extends({}, contentProps, {
|
|
4449
4416
|
ref: forwardedRef
|
|
@@ -4454,26 +4421,26 @@ const $cb5cc270b50c6fcd$export$d7e1f420b25549ff = /*#__PURE__*/ forwardRef((prop
|
|
|
4454
4421
|
/* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$PopoverContentModal = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
4455
4422
|
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
|
|
4456
4423
|
const contentRef = useRef(null);
|
|
4457
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
4424
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef);
|
|
4458
4425
|
const isRightClickOutsideRef = useRef(false); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
4459
4426
|
useEffect(()=>{
|
|
4460
4427
|
const content = contentRef.current;
|
|
4461
4428
|
if (content) return hideOthers(content);
|
|
4462
4429
|
}, []);
|
|
4463
4430
|
return /*#__PURE__*/ createElement($epM9y$RemoveScroll, {
|
|
4464
|
-
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360
|
|
4431
|
+
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
4465
4432
|
allowPinchZoom: true
|
|
4466
4433
|
}, /*#__PURE__*/ createElement($cb5cc270b50c6fcd$var$PopoverContentImpl, _extends({}, props, {
|
|
4467
4434
|
ref: composedRefs // we make sure we're not trapping once it's been closed
|
|
4468
4435
|
,
|
|
4469
4436
|
trapFocus: context.open,
|
|
4470
4437
|
disableOutsidePointerEvents: true,
|
|
4471
|
-
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
4438
|
+
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{
|
|
4472
4439
|
var _context$triggerRef$c;
|
|
4473
4440
|
event.preventDefault();
|
|
4474
4441
|
if (!isRightClickOutsideRef.current) (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
4475
4442
|
}),
|
|
4476
|
-
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
4443
|
+
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownOutside, (event)=>{
|
|
4477
4444
|
const originalEvent = event.detail.originalEvent;
|
|
4478
4445
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
4479
4446
|
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
@@ -4482,7 +4449,7 @@ const $cb5cc270b50c6fcd$export$d7e1f420b25549ff = /*#__PURE__*/ forwardRef((prop
|
|
|
4482
4449
|
checkForDefaultPrevented: false
|
|
4483
4450
|
}) // When focus is trapped, a `focusout` event may still happen.
|
|
4484
4451
|
,
|
|
4485
|
-
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
4452
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault()
|
|
4486
4453
|
, {
|
|
4487
4454
|
checkForDefaultPrevented: false
|
|
4488
4455
|
})
|
|
@@ -4538,7 +4505,7 @@ const $cb5cc270b50c6fcd$var$PopoverContentNonModal = /*#__PURE__*/ forwardRef((p
|
|
|
4538
4505
|
trapped: trapFocus,
|
|
4539
4506
|
onMountAutoFocus: onOpenAutoFocus,
|
|
4540
4507
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
4541
|
-
}, /*#__PURE__*/ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22
|
|
4508
|
+
}, /*#__PURE__*/ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, {
|
|
4542
4509
|
asChild: true,
|
|
4543
4510
|
disableOutsidePointerEvents: disableOutsidePointerEvents,
|
|
4544
4511
|
onInteractOutside: onInteractOutside,
|
|
@@ -4546,7 +4513,7 @@ const $cb5cc270b50c6fcd$var$PopoverContentNonModal = /*#__PURE__*/ forwardRef((p
|
|
|
4546
4513
|
onPointerDownOutside: onPointerDownOutside,
|
|
4547
4514
|
onFocusOutside: onFocusOutside,
|
|
4548
4515
|
onDismiss: ()=>context.onOpenChange(false)
|
|
4549
|
-
}, /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2
|
|
4516
|
+
}, /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({
|
|
4550
4517
|
"data-state": $cb5cc270b50c6fcd$var$getState(context.open),
|
|
4551
4518
|
role: "dialog",
|
|
4552
4519
|
id: context.contentId
|
|
@@ -4562,24 +4529,10 @@ const $cb5cc270b50c6fcd$var$PopoverContentNonModal = /*#__PURE__*/ forwardRef((p
|
|
|
4562
4529
|
}
|
|
4563
4530
|
}))));
|
|
4564
4531
|
});
|
|
4565
|
-
/* -------------------------------------------------------------------------------------------------
|
|
4566
|
-
* PopoverClose
|
|
4567
|
-
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$CLOSE_NAME = 'PopoverClose';
|
|
4568
|
-
const $cb5cc270b50c6fcd$export$d6ac43ebaa40d53e = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
4569
|
-
const { __scopePopover: __scopePopover , ...closeProps } = props;
|
|
4570
|
-
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CLOSE_NAME, __scopePopover);
|
|
4571
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.button, _extends({
|
|
4572
|
-
type: "button"
|
|
4573
|
-
}, closeProps, {
|
|
4574
|
-
ref: forwardedRef,
|
|
4575
|
-
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onClick, ()=>context.onOpenChange(false)
|
|
4576
|
-
)
|
|
4577
|
-
}));
|
|
4578
|
-
});
|
|
4579
4532
|
const $cb5cc270b50c6fcd$export$3152841115e061b2 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
4580
4533
|
const { __scopePopover: __scopePopover , ...arrowProps } = props;
|
|
4581
4534
|
const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover);
|
|
4582
|
-
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5
|
|
4535
|
+
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5, _extends({}, popperScope, arrowProps, {
|
|
4583
4536
|
ref: forwardedRef
|
|
4584
4537
|
}));
|
|
4585
4538
|
});
|
|
@@ -4587,42 +4540,16 @@ const $cb5cc270b50c6fcd$export$3152841115e061b2 = /*#__PURE__*/ forwardRef((prop
|
|
|
4587
4540
|
return open ? 'open' : 'closed';
|
|
4588
4541
|
}
|
|
4589
4542
|
const $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9 = $cb5cc270b50c6fcd$export$5b6b19405a83ff9d;
|
|
4590
|
-
const $cb5cc270b50c6fcd$export$b688253958b8dfe7 = $cb5cc270b50c6fcd$export$96e5381f42521a79;
|
|
4591
4543
|
const $cb5cc270b50c6fcd$export$41fb9f06171c75f4 = $cb5cc270b50c6fcd$export$7dacb05d26466c3;
|
|
4592
|
-
const $cb5cc270b50c6fcd$export$602eac185826482c = $cb5cc270b50c6fcd$export$dd679ffb4362d2d4;
|
|
4593
4544
|
const $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2 = $cb5cc270b50c6fcd$export$d7e1f420b25549ff;
|
|
4594
|
-
const $cb5cc270b50c6fcd$export$f39c2d165cd861fe = $cb5cc270b50c6fcd$export$d6ac43ebaa40d53e;
|
|
4595
4545
|
const $cb5cc270b50c6fcd$export$21b07c8f274aebd5 = $cb5cc270b50c6fcd$export$3152841115e061b2;
|
|
4596
4546
|
|
|
4597
|
-
var PopoverPrimitive = /*#__PURE__*/Object.freeze({
|
|
4598
|
-
__proto__: null,
|
|
4599
|
-
Anchor: $cb5cc270b50c6fcd$export$b688253958b8dfe7,
|
|
4600
|
-
Arrow: $cb5cc270b50c6fcd$export$21b07c8f274aebd5,
|
|
4601
|
-
Close: $cb5cc270b50c6fcd$export$f39c2d165cd861fe,
|
|
4602
|
-
Content: $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,
|
|
4603
|
-
Popover: $cb5cc270b50c6fcd$export$5b6b19405a83ff9d,
|
|
4604
|
-
PopoverAnchor: $cb5cc270b50c6fcd$export$96e5381f42521a79,
|
|
4605
|
-
PopoverArrow: $cb5cc270b50c6fcd$export$3152841115e061b2,
|
|
4606
|
-
PopoverClose: $cb5cc270b50c6fcd$export$d6ac43ebaa40d53e,
|
|
4607
|
-
PopoverContent: $cb5cc270b50c6fcd$export$d7e1f420b25549ff,
|
|
4608
|
-
PopoverPortal: $cb5cc270b50c6fcd$export$dd679ffb4362d2d4,
|
|
4609
|
-
PopoverTrigger: $cb5cc270b50c6fcd$export$7dacb05d26466c3,
|
|
4610
|
-
Portal: $cb5cc270b50c6fcd$export$602eac185826482c,
|
|
4611
|
-
Root: $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,
|
|
4612
|
-
Trigger: $cb5cc270b50c6fcd$export$41fb9f06171c75f4,
|
|
4613
|
-
createPopoverScope: $cb5cc270b50c6fcd$export$c8393c9e73286932
|
|
4614
|
-
});
|
|
4615
|
-
|
|
4616
4547
|
const borderStyles$3 = [
|
|
4617
4548
|
'tw-border-solid',
|
|
4618
4549
|
'tw-border',
|
|
4619
4550
|
'tw-rounded-sm',
|
|
4620
|
-
'
|
|
4621
|
-
'
|
|
4622
|
-
'active:tw-border-sq-sq-light-gray',
|
|
4623
|
-
'dark:hover:tw-border-sq-color-dark-dark',
|
|
4624
|
-
'dark:focus:tw-border-sq-color-dark-dark',
|
|
4625
|
-
'dark:active:tw-border-sq-color-dark-dark',
|
|
4551
|
+
'tw-border-sq-disabled-gray',
|
|
4552
|
+
'dark:tw-border-gray-500',
|
|
4626
4553
|
].join(' ');
|
|
4627
4554
|
const triggerBorderStyles = [
|
|
4628
4555
|
'tw-border-solid',
|
|
@@ -4681,7 +4608,8 @@ const ToolbarButton = ({ isSmall = false, label, icon, secondIcon, forceSmallIco
|
|
|
4681
4608
|
' 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' +
|
|
4682
4609
|
' 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' +
|
|
4683
4610
|
borderStyles$3 },
|
|
4684
|
-
hasArrow && (React.createElement($cb5cc270b50c6fcd$export$21b07c8f274aebd5, {
|
|
4611
|
+
hasArrow && (React.createElement($cb5cc270b50c6fcd$export$21b07c8f274aebd5, { asChild: true },
|
|
4612
|
+
React.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" }))),
|
|
4685
4613
|
popoverContent))) : undefined));
|
|
4686
4614
|
};
|
|
4687
4615
|
|
|
@@ -4764,7 +4692,7 @@ const Checkbox = (props) => {
|
|
|
4764
4692
|
const assignedId = id ?? 'checkbox_' + Math.random();
|
|
4765
4693
|
const tooltipData = getQTipData(tooltipProps);
|
|
4766
4694
|
return (React__default.createElement("span", { className: `${alignment} ${extraClassNames}` },
|
|
4767
|
-
React__default.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 }),
|
|
4695
|
+
React__default.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 }),
|
|
4768
4696
|
React__default.createElement("label", { htmlFor: assignedId, className: `${labelClasses} ${extraLabelClassNames} ${disabled
|
|
4769
4697
|
? 'tw-cursor-not-allowed dark:tw-text-sq-fairly-dark-gray tw-text-sq-fairly-dark-gray'
|
|
4770
4698
|
: 'tw-cursor-pointer tw-text-sq-text-color dark:tw-text-sq-dark-text'}` }, label)));
|
|
@@ -6619,7 +6547,7 @@ const QTip = () => {
|
|
|
6619
6547
|
if (tooltipRef.current && tooltipTarget.current) {
|
|
6620
6548
|
computePosition(tooltipTarget.current, tooltipRef.current, {
|
|
6621
6549
|
placement: position,
|
|
6622
|
-
middleware: [offset(10), arrow$
|
|
6550
|
+
middleware: [offset(10), arrow$1({ element: tooltipArrowRef.current })],
|
|
6623
6551
|
}).then(({ x, y, middlewareData }) => {
|
|
6624
6552
|
Object.assign(tooltipRef.current?.style, {
|
|
6625
6553
|
left: `${x}px`,
|
|
@@ -9611,7 +9539,7 @@ function _taggedTemplateLiteral(strings, raw) {
|
|
|
9611
9539
|
}));
|
|
9612
9540
|
}
|
|
9613
9541
|
|
|
9614
|
-
var index
|
|
9542
|
+
var index = useLayoutEffect ;
|
|
9615
9543
|
|
|
9616
9544
|
var _excluded$3 = ["className", "clearValue", "cx", "getStyles", "getClassNames", "getValue", "hasValue", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue", "theme"];
|
|
9617
9545
|
// ==============================
|
|
@@ -9865,10 +9793,10 @@ var options = {
|
|
|
9865
9793
|
}
|
|
9866
9794
|
};
|
|
9867
9795
|
// check for SSR
|
|
9868
|
-
var w
|
|
9869
|
-
if (w
|
|
9870
|
-
w
|
|
9871
|
-
w
|
|
9796
|
+
var w = typeof window !== 'undefined' ? window : {};
|
|
9797
|
+
if (w.addEventListener && w.removeEventListener) {
|
|
9798
|
+
w.addEventListener('p', noop, options);
|
|
9799
|
+
w.removeEventListener('p', noop, false);
|
|
9872
9800
|
}
|
|
9873
9801
|
var supportsPassiveEvents = passiveOptionAccessed;
|
|
9874
9802
|
function notNullish(item) {
|
|
@@ -10110,7 +10038,7 @@ var MenuPlacer = function MenuPlacer(props) {
|
|
|
10110
10038
|
placement = _useState4[0],
|
|
10111
10039
|
setPlacement = _useState4[1];
|
|
10112
10040
|
var controlHeight = theme.spacing.controlHeight;
|
|
10113
|
-
index
|
|
10041
|
+
index(function () {
|
|
10114
10042
|
var menuEl = ref.current;
|
|
10115
10043
|
if (!menuEl) return;
|
|
10116
10044
|
|
|
@@ -10271,7 +10199,7 @@ var MenuPortal = function MenuPortal(props) {
|
|
|
10271
10199
|
});
|
|
10272
10200
|
}
|
|
10273
10201
|
}, [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]);
|
|
10274
|
-
index
|
|
10202
|
+
index(function () {
|
|
10275
10203
|
updateComputedPosition();
|
|
10276
10204
|
}, [updateComputedPosition]);
|
|
10277
10205
|
var runAutoUpdate = useCallback(function () {
|
|
@@ -10285,7 +10213,7 @@ var MenuPortal = function MenuPortal(props) {
|
|
|
10285
10213
|
});
|
|
10286
10214
|
}
|
|
10287
10215
|
}, [controlElement, updateComputedPosition]);
|
|
10288
|
-
index
|
|
10216
|
+
index(function () {
|
|
10289
10217
|
runAutoUpdate();
|
|
10290
10218
|
}, [runAutoUpdate]);
|
|
10291
10219
|
var setMenuPortalElement = useCallback(function (menuPortalElement) {
|
|
@@ -11485,8 +11413,8 @@ var anyDiacritic = new RegExp('[' + diacritics.map(function (d) {
|
|
|
11485
11413
|
return d.letters;
|
|
11486
11414
|
}).join('') + ']', 'g');
|
|
11487
11415
|
var diacriticToBase = {};
|
|
11488
|
-
for (var i
|
|
11489
|
-
var diacritic = diacritics[i
|
|
11416
|
+
for (var i = 0; i < diacritics.length; i++) {
|
|
11417
|
+
var diacritic = diacritics[i];
|
|
11490
11418
|
for (var j = 0; j < diacritic.letters.length; j++) {
|
|
11491
11419
|
diacriticToBase[diacritic.letters[j]] = diacritic.base;
|
|
11492
11420
|
}
|
|
@@ -13829,13 +13757,13 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
13829
13757
|
/* -------------------------------------------------------------------------------------------------
|
|
13830
13758
|
* Dialog
|
|
13831
13759
|
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DIALOG_NAME = 'Dialog';
|
|
13832
|
-
const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
13760
|
+
const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($5d3850c4d0b4e6c7$var$DIALOG_NAME);
|
|
13833
13761
|
const [$5d3850c4d0b4e6c7$var$DialogProvider, $5d3850c4d0b4e6c7$var$useDialogContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$DIALOG_NAME);
|
|
13834
13762
|
const $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 = (props)=>{
|
|
13835
13763
|
const { __scopeDialog: __scopeDialog , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props;
|
|
13836
13764
|
const triggerRef = useRef(null);
|
|
13837
13765
|
const contentRef = useRef(null);
|
|
13838
|
-
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
13766
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
13839
13767
|
prop: openProp,
|
|
13840
13768
|
defaultProp: defaultOpen,
|
|
13841
13769
|
onChange: onOpenChange
|
|
@@ -13869,9 +13797,9 @@ const $5d3850c4d0b4e6c7$export$dad7c95542bacce0 = (props)=>{
|
|
|
13869
13797
|
return /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$PortalProvider, {
|
|
13870
13798
|
scope: __scopeDialog,
|
|
13871
13799
|
forceMount: forceMount
|
|
13872
|
-
}, Children.map(children, (child)=>/*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
13800
|
+
}, Children.map(children, (child)=>/*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
13873
13801
|
present: forceMount || context.open
|
|
13874
|
-
}, /*#__PURE__*/ createElement($f1701beae083dbae$export$602eac185826482c
|
|
13802
|
+
}, /*#__PURE__*/ createElement($f1701beae083dbae$export$602eac185826482c, {
|
|
13875
13803
|
asChild: true,
|
|
13876
13804
|
container: container
|
|
13877
13805
|
}, child))
|
|
@@ -13884,7 +13812,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ forwardRef((prop
|
|
|
13884
13812
|
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13885
13813
|
const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
|
|
13886
13814
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13887
|
-
return /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
13815
|
+
return /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
13888
13816
|
present: forceMount || context.open
|
|
13889
13817
|
}, context.modal ? /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogContentModal, _extends({}, contentProps, {
|
|
13890
13818
|
ref: forwardedRef
|
|
@@ -13895,7 +13823,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ forwardRef((prop
|
|
|
13895
13823
|
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentModal = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
13896
13824
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13897
13825
|
const contentRef = useRef(null);
|
|
13898
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
13826
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
13899
13827
|
useEffect(()=>{
|
|
13900
13828
|
const content = contentRef.current;
|
|
13901
13829
|
if (content) return hideOthers(content);
|
|
@@ -13905,12 +13833,12 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ forwardRef((prop
|
|
|
13905
13833
|
,
|
|
13906
13834
|
trapFocus: context.open,
|
|
13907
13835
|
disableOutsidePointerEvents: true,
|
|
13908
|
-
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
13836
|
+
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{
|
|
13909
13837
|
var _context$triggerRef$c;
|
|
13910
13838
|
event.preventDefault();
|
|
13911
13839
|
(_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
13912
13840
|
}),
|
|
13913
|
-
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
13841
|
+
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownOutside, (event)=>{
|
|
13914
13842
|
const originalEvent = event.detail.originalEvent;
|
|
13915
13843
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
13916
13844
|
const isRightClick = originalEvent.button === 2 || ctrlLeftClick; // If the event is a right-click, we shouldn't close because
|
|
@@ -13918,7 +13846,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ forwardRef((prop
|
|
|
13918
13846
|
if (isRightClick) event.preventDefault();
|
|
13919
13847
|
}) // When focus is trapped, a `focusout` event may still happen.
|
|
13920
13848
|
,
|
|
13921
|
-
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
13849
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault()
|
|
13922
13850
|
)
|
|
13923
13851
|
}));
|
|
13924
13852
|
});
|
|
@@ -13964,7 +13892,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ forwardRef((prop
|
|
|
13964
13892
|
const { __scopeDialog: __scopeDialog , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props;
|
|
13965
13893
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, __scopeDialog);
|
|
13966
13894
|
const contentRef = useRef(null);
|
|
13967
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
13895
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
|
|
13968
13896
|
// the last element in the DOM (beacuse of the `Portal`)
|
|
13969
13897
|
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
13970
13898
|
return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
@@ -13973,7 +13901,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ forwardRef((prop
|
|
|
13973
13901
|
trapped: trapFocus,
|
|
13974
13902
|
onMountAutoFocus: onOpenAutoFocus,
|
|
13975
13903
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
13976
|
-
}, /*#__PURE__*/ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22
|
|
13904
|
+
}, /*#__PURE__*/ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, _extends({
|
|
13977
13905
|
role: "dialog",
|
|
13978
13906
|
id: context.contentId,
|
|
13979
13907
|
"aria-describedby": context.descriptionId,
|
|
@@ -13990,7 +13918,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ forwardRef((prop
|
|
|
13990
13918
|
const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
13991
13919
|
const { __scopeDialog: __scopeDialog , ...titleProps } = props;
|
|
13992
13920
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TITLE_NAME, __scopeDialog);
|
|
13993
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
13921
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.h2, _extends({
|
|
13994
13922
|
id: context.titleId
|
|
13995
13923
|
}, titleProps, {
|
|
13996
13924
|
ref: forwardedRef
|
|
@@ -14002,7 +13930,7 @@ const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ forwardRef((prop
|
|
|
14002
13930
|
const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
14003
13931
|
const { __scopeDialog: __scopeDialog , ...descriptionProps } = props;
|
|
14004
13932
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$DESCRIPTION_NAME, __scopeDialog);
|
|
14005
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
13933
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.p, _extends({
|
|
14006
13934
|
id: context.descriptionId
|
|
14007
13935
|
}, descriptionProps, {
|
|
14008
13936
|
ref: forwardedRef
|
|
@@ -14014,11 +13942,11 @@ const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ forwardRef((prop
|
|
|
14014
13942
|
const $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
14015
13943
|
const { __scopeDialog: __scopeDialog , ...closeProps } = props;
|
|
14016
13944
|
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CLOSE_NAME, __scopeDialog);
|
|
14017
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
13945
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
14018
13946
|
type: "button"
|
|
14019
13947
|
}, closeProps, {
|
|
14020
13948
|
ref: forwardedRef,
|
|
14021
|
-
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
13949
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, ()=>context.onOpenChange(false)
|
|
14022
13950
|
)
|
|
14023
13951
|
}));
|
|
14024
13952
|
});
|
|
@@ -14196,7 +14124,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
14196
14124
|
/* -----------------------------------------------------------------------------------------------
|
|
14197
14125
|
* CollectionProvider
|
|
14198
14126
|
* ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
|
|
14199
|
-
const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
14127
|
+
const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
|
|
14200
14128
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
14201
14129
|
collectionRef: {
|
|
14202
14130
|
current: null
|
|
@@ -14219,8 +14147,8 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
14219
14147
|
const CollectionSlot = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
|
|
14220
14148
|
const { scope: scope , children: children } = props;
|
|
14221
14149
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
14222
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
14223
|
-
return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360
|
|
14150
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
|
|
14151
|
+
return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
14224
14152
|
ref: composedRefs
|
|
14225
14153
|
}, children);
|
|
14226
14154
|
});
|
|
@@ -14231,7 +14159,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
14231
14159
|
const CollectionItemSlot = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
|
|
14232
14160
|
const { scope: scope , children: children , ...itemData } = props;
|
|
14233
14161
|
const ref = React__default.useRef(null);
|
|
14234
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
14162
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
14235
14163
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
14236
14164
|
React__default.useEffect(()=>{
|
|
14237
14165
|
context.itemMap.set(ref, {
|
|
@@ -14241,7 +14169,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
14241
14169
|
return ()=>void context.itemMap.delete(ref)
|
|
14242
14170
|
;
|
|
14243
14171
|
});
|
|
14244
|
-
return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360
|
|
14172
|
+
return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
14245
14173
|
[ITEM_DATA_ATTR]: '',
|
|
14246
14174
|
ref: composedRefs
|
|
14247
14175
|
}, children);
|
|
@@ -14290,7 +14218,7 @@ const $d7bdfb9eb0fdf311$var$EVENT_OPTIONS = {
|
|
|
14290
14218
|
* RovingFocusGroup
|
|
14291
14219
|
* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$GROUP_NAME = 'RovingFocusGroup';
|
|
14292
14220
|
const [$d7bdfb9eb0fdf311$var$Collection, $d7bdfb9eb0fdf311$var$useCollection, $d7bdfb9eb0fdf311$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($d7bdfb9eb0fdf311$var$GROUP_NAME);
|
|
14293
|
-
const [$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext, $d7bdfb9eb0fdf311$export$c7109489551a4f4] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
14221
|
+
const [$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext, $d7bdfb9eb0fdf311$export$c7109489551a4f4] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($d7bdfb9eb0fdf311$var$GROUP_NAME, [
|
|
14294
14222
|
$d7bdfb9eb0fdf311$var$createCollectionScope
|
|
14295
14223
|
]);
|
|
14296
14224
|
const [$d7bdfb9eb0fdf311$var$RovingFocusProvider, $d7bdfb9eb0fdf311$var$useRovingFocusContext] = $d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME);
|
|
@@ -14306,15 +14234,15 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ forwardRef((prop
|
|
|
14306
14234
|
/* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
14307
14235
|
const { __scopeRovingFocusGroup: __scopeRovingFocusGroup , orientation: orientation , loop: loop = false , dir: dir , currentTabStopId: currentTabStopIdProp , defaultCurrentTabStopId: defaultCurrentTabStopId , onCurrentTabStopIdChange: onCurrentTabStopIdChange , onEntryFocus: onEntryFocus , ...groupProps } = props;
|
|
14308
14236
|
const ref = useRef(null);
|
|
14309
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
14237
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
14310
14238
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
14311
|
-
const [currentTabStopId = null, setCurrentTabStopId] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
14239
|
+
const [currentTabStopId = null, setCurrentTabStopId] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14312
14240
|
prop: currentTabStopIdProp,
|
|
14313
14241
|
defaultProp: defaultCurrentTabStopId,
|
|
14314
14242
|
onChange: onCurrentTabStopIdChange
|
|
14315
14243
|
});
|
|
14316
14244
|
const [isTabbingBackOut, setIsTabbingBackOut] = useState(false);
|
|
14317
|
-
const handleEntryFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
14245
|
+
const handleEntryFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEntryFocus);
|
|
14318
14246
|
const getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup);
|
|
14319
14247
|
const isClickFocusRef = useRef(false);
|
|
14320
14248
|
const [focusableItemsCount, setFocusableItemsCount] = useState(0);
|
|
@@ -14346,7 +14274,7 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ forwardRef((prop
|
|
|
14346
14274
|
onFocusableItemRemove: useCallback(()=>setFocusableItemsCount((prevCount)=>prevCount - 1
|
|
14347
14275
|
)
|
|
14348
14276
|
, [])
|
|
14349
|
-
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14277
|
+
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14350
14278
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
14351
14279
|
"data-orientation": orientation
|
|
14352
14280
|
}, groupProps, {
|
|
@@ -14355,10 +14283,10 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ forwardRef((prop
|
|
|
14355
14283
|
outline: 'none',
|
|
14356
14284
|
...props.style
|
|
14357
14285
|
},
|
|
14358
|
-
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14286
|
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, ()=>{
|
|
14359
14287
|
isClickFocusRef.current = true;
|
|
14360
14288
|
}),
|
|
14361
|
-
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14289
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, (event)=>{
|
|
14362
14290
|
// We normally wouldn't need this check, because we already check
|
|
14363
14291
|
// that the focus is on the current target and not bubbling to it.
|
|
14364
14292
|
// We do this because Safari doesn't focus buttons when clicked, and
|
|
@@ -14386,7 +14314,7 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ forwardRef((prop
|
|
|
14386
14314
|
}
|
|
14387
14315
|
isClickFocusRef.current = false;
|
|
14388
14316
|
}),
|
|
14389
|
-
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14317
|
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, ()=>setIsTabbingBackOut(false)
|
|
14390
14318
|
)
|
|
14391
14319
|
})));
|
|
14392
14320
|
});
|
|
@@ -14417,20 +14345,20 @@ const $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = /*#__PURE__*/ forwardRef((props
|
|
|
14417
14345
|
id: id,
|
|
14418
14346
|
focusable: focusable,
|
|
14419
14347
|
active: active
|
|
14420
|
-
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14348
|
+
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
14421
14349
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
14422
14350
|
"data-orientation": context.orientation
|
|
14423
14351
|
}, itemProps, {
|
|
14424
14352
|
ref: forwardedRef,
|
|
14425
|
-
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14353
|
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, (event)=>{
|
|
14426
14354
|
// We prevent focusing non-focusable items on `mousedown`.
|
|
14427
14355
|
// Even though the item has tabIndex={-1}, that only means take it out of the tab order.
|
|
14428
14356
|
if (!focusable) event.preventDefault(); // Safari doesn't focus a button when clicked so we run our logic on mousedown also
|
|
14429
14357
|
else context.onItemFocus(id);
|
|
14430
14358
|
}),
|
|
14431
|
-
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14359
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, ()=>context.onItemFocus(id)
|
|
14432
14360
|
),
|
|
14433
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14361
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
14434
14362
|
if (event.key === 'Tab' && event.shiftKey) {
|
|
14435
14363
|
context.onItemShiftTab();
|
|
14436
14364
|
return;
|
|
@@ -14507,7 +14435,7 @@ const $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2 = $d7bdfb9eb0fdf311$export$ab9df
|
|
|
14507
14435
|
/* -------------------------------------------------------------------------------------------------
|
|
14508
14436
|
* Tabs
|
|
14509
14437
|
* -----------------------------------------------------------------------------------------------*/ const $69cb30bb0017df05$var$TABS_NAME = 'Tabs';
|
|
14510
|
-
const [$69cb30bb0017df05$var$createTabsContext, $69cb30bb0017df05$export$355f5bd209d7b13a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
14438
|
+
const [$69cb30bb0017df05$var$createTabsContext, $69cb30bb0017df05$export$355f5bd209d7b13a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($69cb30bb0017df05$var$TABS_NAME, [
|
|
14511
14439
|
$d7bdfb9eb0fdf311$export$c7109489551a4f4
|
|
14512
14440
|
]);
|
|
14513
14441
|
const $69cb30bb0017df05$var$useRovingFocusGroupScope = $d7bdfb9eb0fdf311$export$c7109489551a4f4();
|
|
@@ -14515,7 +14443,7 @@ const [$69cb30bb0017df05$var$TabsProvider, $69cb30bb0017df05$var$useTabsContext]
|
|
|
14515
14443
|
const $69cb30bb0017df05$export$b2539bed5023c21c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
14516
14444
|
const { __scopeTabs: __scopeTabs , value: valueProp , onValueChange: onValueChange , defaultValue: defaultValue , orientation: orientation = 'horizontal' , dir: dir , activationMode: activationMode = 'automatic' , ...tabsProps } = props;
|
|
14517
14445
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
14518
|
-
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
14446
|
+
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14519
14447
|
prop: valueProp,
|
|
14520
14448
|
onChange: onValueChange,
|
|
14521
14449
|
defaultProp: defaultValue
|
|
@@ -14528,7 +14456,7 @@ const $69cb30bb0017df05$export$b2539bed5023c21c = /*#__PURE__*/ forwardRef((prop
|
|
|
14528
14456
|
orientation: orientation,
|
|
14529
14457
|
dir: direction,
|
|
14530
14458
|
activationMode: activationMode
|
|
14531
|
-
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14459
|
+
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14532
14460
|
dir: direction,
|
|
14533
14461
|
"data-orientation": orientation
|
|
14534
14462
|
}, tabsProps, {
|
|
@@ -14548,7 +14476,7 @@ const $69cb30bb0017df05$export$9712d22edc0d78c1 = /*#__PURE__*/ forwardRef((prop
|
|
|
14548
14476
|
orientation: context.orientation,
|
|
14549
14477
|
dir: context.dir,
|
|
14550
14478
|
loop: loop
|
|
14551
|
-
}), /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14479
|
+
}), /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14552
14480
|
role: "tablist",
|
|
14553
14481
|
"aria-orientation": context.orientation
|
|
14554
14482
|
}, listProps, {
|
|
@@ -14570,7 +14498,7 @@ const $69cb30bb0017df05$export$8114b9fdfdf9f3ba = /*#__PURE__*/ forwardRef((prop
|
|
|
14570
14498
|
}, rovingFocusGroupScope, {
|
|
14571
14499
|
focusable: !disabled,
|
|
14572
14500
|
active: isSelected
|
|
14573
|
-
}), /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14501
|
+
}), /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
14574
14502
|
type: "button",
|
|
14575
14503
|
role: "tab",
|
|
14576
14504
|
"aria-selected": isSelected,
|
|
@@ -14581,20 +14509,20 @@ const $69cb30bb0017df05$export$8114b9fdfdf9f3ba = /*#__PURE__*/ forwardRef((prop
|
|
|
14581
14509
|
id: triggerId
|
|
14582
14510
|
}, triggerProps, {
|
|
14583
14511
|
ref: forwardedRef,
|
|
14584
|
-
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14512
|
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, (event)=>{
|
|
14585
14513
|
// only call handler if it's the left button (mousedown gets triggered by all mouse buttons)
|
|
14586
14514
|
// but not when the control key is pressed (avoiding MacOS right click)
|
|
14587
14515
|
if (!disabled && event.button === 0 && event.ctrlKey === false) context.onValueChange(value);
|
|
14588
14516
|
else // prevent focus to avoid accidental activation
|
|
14589
14517
|
event.preventDefault();
|
|
14590
14518
|
}),
|
|
14591
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14519
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
14592
14520
|
if ([
|
|
14593
14521
|
' ',
|
|
14594
14522
|
'Enter'
|
|
14595
14523
|
].includes(event.key)) context.onValueChange(value);
|
|
14596
14524
|
}),
|
|
14597
|
-
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14525
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, ()=>{
|
|
14598
14526
|
// handle "automatic" activation if necessary
|
|
14599
14527
|
// ie. activate tab following focus
|
|
14600
14528
|
const isAutomaticActivation = context.activationMode !== 'manual';
|
|
@@ -14618,9 +14546,9 @@ const $69cb30bb0017df05$export$bd905d70e8fd2ebb = /*#__PURE__*/ forwardRef((prop
|
|
|
14618
14546
|
return ()=>cancelAnimationFrame(rAF)
|
|
14619
14547
|
;
|
|
14620
14548
|
}, []);
|
|
14621
|
-
return /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
14549
|
+
return /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
14622
14550
|
present: forceMount || isSelected
|
|
14623
|
-
}, ({ present: present })=>/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14551
|
+
}, ({ present: present })=>/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14624
14552
|
"data-state": isSelected ? 'active' : 'inactive',
|
|
14625
14553
|
"data-orientation": context.orientation,
|
|
14626
14554
|
role: "tabpanel",
|
|
@@ -14669,11 +14597,11 @@ const Tabs = ({ tabs, defaultActiveTab, activeTab, onTabSelect, extraClassNames,
|
|
|
14669
14597
|
/* -------------------------------------------------------------------------------------------------
|
|
14670
14598
|
* Collapsible
|
|
14671
14599
|
* -----------------------------------------------------------------------------------------------*/ const $409067139f391064$var$COLLAPSIBLE_NAME = 'Collapsible';
|
|
14672
|
-
const [$409067139f391064$var$createCollapsibleContext, $409067139f391064$export$952b32dcbe73087a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
14600
|
+
const [$409067139f391064$var$createCollapsibleContext, $409067139f391064$export$952b32dcbe73087a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($409067139f391064$var$COLLAPSIBLE_NAME);
|
|
14673
14601
|
const [$409067139f391064$var$CollapsibleProvider, $409067139f391064$var$useCollapsibleContext] = $409067139f391064$var$createCollapsibleContext($409067139f391064$var$COLLAPSIBLE_NAME);
|
|
14674
14602
|
const $409067139f391064$export$6eb0f7ddcda6131f = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
14675
14603
|
const { __scopeCollapsible: __scopeCollapsible , open: openProp , defaultOpen: defaultOpen , disabled: disabled , onOpenChange: onOpenChange , ...collapsibleProps } = props;
|
|
14676
|
-
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
14604
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14677
14605
|
prop: openProp,
|
|
14678
14606
|
defaultProp: defaultOpen,
|
|
14679
14607
|
onChange: onOpenChange
|
|
@@ -14688,7 +14616,7 @@ const $409067139f391064$export$6eb0f7ddcda6131f = /*#__PURE__*/ forwardRef((prop
|
|
|
14688
14616
|
, [
|
|
14689
14617
|
setOpen
|
|
14690
14618
|
])
|
|
14691
|
-
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14619
|
+
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14692
14620
|
"data-state": $409067139f391064$var$getState(open),
|
|
14693
14621
|
"data-disabled": disabled ? '' : undefined
|
|
14694
14622
|
}, collapsibleProps, {
|
|
@@ -14701,7 +14629,7 @@ const $409067139f391064$export$6eb0f7ddcda6131f = /*#__PURE__*/ forwardRef((prop
|
|
|
14701
14629
|
const $409067139f391064$export$c135dce7b15bbbdc = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
14702
14630
|
const { __scopeCollapsible: __scopeCollapsible , ...triggerProps } = props;
|
|
14703
14631
|
const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$TRIGGER_NAME, __scopeCollapsible);
|
|
14704
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14632
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
14705
14633
|
type: "button",
|
|
14706
14634
|
"aria-controls": context.contentId,
|
|
14707
14635
|
"aria-expanded": context.open || false,
|
|
@@ -14710,7 +14638,7 @@ const $409067139f391064$export$c135dce7b15bbbdc = /*#__PURE__*/ forwardRef((prop
|
|
|
14710
14638
|
disabled: context.disabled
|
|
14711
14639
|
}, triggerProps, {
|
|
14712
14640
|
ref: forwardedRef,
|
|
14713
|
-
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14641
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onOpenToggle)
|
|
14714
14642
|
}));
|
|
14715
14643
|
});
|
|
14716
14644
|
/* -------------------------------------------------------------------------------------------------
|
|
@@ -14719,7 +14647,7 @@ const $409067139f391064$export$c135dce7b15bbbdc = /*#__PURE__*/ forwardRef((prop
|
|
|
14719
14647
|
const $409067139f391064$export$aadde00976f34151 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
14720
14648
|
const { forceMount: forceMount , ...contentProps } = props;
|
|
14721
14649
|
const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, props.__scopeCollapsible);
|
|
14722
|
-
return /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
14650
|
+
return /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
14723
14651
|
present: forceMount || context.open
|
|
14724
14652
|
}, ({ present: present })=>/*#__PURE__*/ createElement($409067139f391064$var$CollapsibleContentImpl, _extends({}, contentProps, {
|
|
14725
14653
|
ref: forwardedRef,
|
|
@@ -14732,7 +14660,7 @@ const $409067139f391064$export$aadde00976f34151 = /*#__PURE__*/ forwardRef((prop
|
|
|
14732
14660
|
const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, __scopeCollapsible);
|
|
14733
14661
|
const [isPresent, setIsPresent] = useState(present);
|
|
14734
14662
|
const ref = useRef(null);
|
|
14735
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
14663
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
14736
14664
|
const heightRef = useRef(0);
|
|
14737
14665
|
const height = heightRef.current;
|
|
14738
14666
|
const widthRef = useRef(0);
|
|
@@ -14747,7 +14675,7 @@ const $409067139f391064$export$aadde00976f34151 = /*#__PURE__*/ forwardRef((prop
|
|
|
14747
14675
|
return ()=>cancelAnimationFrame(rAF)
|
|
14748
14676
|
;
|
|
14749
14677
|
}, []);
|
|
14750
|
-
$9f79659886946c16$export$e5c5a5f917a5871c
|
|
14678
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
14751
14679
|
const node = ref.current;
|
|
14752
14680
|
if (node) {
|
|
14753
14681
|
originalStylesRef.current = originalStylesRef.current || {
|
|
@@ -14774,7 +14702,7 @@ const $409067139f391064$export$aadde00976f34151 = /*#__PURE__*/ forwardRef((prop
|
|
|
14774
14702
|
context.open,
|
|
14775
14703
|
present
|
|
14776
14704
|
]);
|
|
14777
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14705
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
14778
14706
|
"data-state": $409067139f391064$var$getState(context.open),
|
|
14779
14707
|
"data-disabled": context.disabled ? '' : undefined,
|
|
14780
14708
|
id: context.contentId,
|
|
@@ -14807,7 +14735,7 @@ const $1bf158f521e1b1b4$var$ACCORDION_KEYS = [
|
|
|
14807
14735
|
'ArrowRight'
|
|
14808
14736
|
];
|
|
14809
14737
|
const [$1bf158f521e1b1b4$var$Collection, $1bf158f521e1b1b4$var$useCollection, $1bf158f521e1b1b4$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($1bf158f521e1b1b4$var$ACCORDION_NAME);
|
|
14810
|
-
const [$1bf158f521e1b1b4$var$createAccordionContext, $1bf158f521e1b1b4$export$9748edc328a73be1] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
14738
|
+
const [$1bf158f521e1b1b4$var$createAccordionContext, $1bf158f521e1b1b4$export$9748edc328a73be1] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($1bf158f521e1b1b4$var$ACCORDION_NAME, [
|
|
14811
14739
|
$1bf158f521e1b1b4$var$createCollectionScope,
|
|
14812
14740
|
$409067139f391064$export$952b32dcbe73087a
|
|
14813
14741
|
]);
|
|
@@ -14842,7 +14770,7 @@ const [$1bf158f521e1b1b4$var$AccordionCollapsibleProvider, $1bf158f521e1b1b4$var
|
|
|
14842
14770
|
});
|
|
14843
14771
|
const $1bf158f521e1b1b4$var$AccordionImplSingle = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
|
|
14844
14772
|
const { value: valueProp , defaultValue: defaultValue , onValueChange: onValueChange = ()=>{} , collapsible: collapsible = false , ...accordionSingleProps } = props;
|
|
14845
|
-
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
14773
|
+
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14846
14774
|
prop: valueProp,
|
|
14847
14775
|
defaultProp: defaultValue,
|
|
14848
14776
|
onChange: onValueChange
|
|
@@ -14867,7 +14795,7 @@ const $1bf158f521e1b1b4$var$AccordionImplSingle = /*#__PURE__*/ React__default.f
|
|
|
14867
14795
|
});
|
|
14868
14796
|
/* -----------------------------------------------------------------------------------------------*/ const $1bf158f521e1b1b4$var$AccordionImplMultiple = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
|
|
14869
14797
|
const { value: valueProp , defaultValue: defaultValue , onValueChange: onValueChange = ()=>{} , ...accordionMultipleProps } = props;
|
|
14870
|
-
const [value1 = [], setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
14798
|
+
const [value1 = [], setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
14871
14799
|
prop: valueProp,
|
|
14872
14800
|
defaultProp: defaultValue,
|
|
14873
14801
|
onChange: onValueChange
|
|
@@ -14902,11 +14830,11 @@ const $1bf158f521e1b1b4$var$AccordionImplSingle = /*#__PURE__*/ React__default.f
|
|
|
14902
14830
|
const $1bf158f521e1b1b4$var$AccordionImpl = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
|
|
14903
14831
|
const { __scopeAccordion: __scopeAccordion , disabled: disabled , dir: dir , orientation: orientation = 'vertical' , ...accordionProps } = props;
|
|
14904
14832
|
const accordionRef = React__default.useRef(null);
|
|
14905
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
14833
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(accordionRef, forwardedRef);
|
|
14906
14834
|
const getItems = $1bf158f521e1b1b4$var$useCollection(__scopeAccordion);
|
|
14907
14835
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
14908
14836
|
const isDirectionLTR = direction === 'ltr';
|
|
14909
|
-
const handleKeyDown = $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
14837
|
+
const handleKeyDown = $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
14910
14838
|
var _triggerCollection$cl;
|
|
14911
14839
|
if (!$1bf158f521e1b1b4$var$ACCORDION_KEYS.includes(event.key)) return;
|
|
14912
14840
|
const target = event.target;
|
|
@@ -14966,7 +14894,7 @@ const $1bf158f521e1b1b4$var$AccordionImpl = /*#__PURE__*/ React__default.forward
|
|
|
14966
14894
|
orientation: orientation
|
|
14967
14895
|
}, /*#__PURE__*/ React__default.createElement($1bf158f521e1b1b4$var$Collection.Slot, {
|
|
14968
14896
|
scope: __scopeAccordion
|
|
14969
|
-
}, /*#__PURE__*/ React__default.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
14897
|
+
}, /*#__PURE__*/ React__default.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, accordionProps, {
|
|
14970
14898
|
"data-orientation": orientation,
|
|
14971
14899
|
ref: composedRefs,
|
|
14972
14900
|
onKeyDown: disabled ? undefined : handleKeyDown
|
|
@@ -15063,1630 +14991,94 @@ const Accordion = ({ accordionItems, defaultValue, value, onItemSelect, disabled
|
|
|
15063
14991
|
React__default.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))))));
|
|
15064
14992
|
};
|
|
15065
14993
|
|
|
15066
|
-
|
|
15067
|
-
|
|
15068
|
-
|
|
15069
|
-
|
|
15070
|
-
|
|
15071
|
-
|
|
14994
|
+
const bgStyles$1 = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
14995
|
+
const borderStyles$1 = [
|
|
14996
|
+
'tw-border-solid',
|
|
14997
|
+
'tw-border',
|
|
14998
|
+
'tw-rounded-sm',
|
|
14999
|
+
'tw-border-sq-disabled-gray',
|
|
15000
|
+
'dark:tw-border-gray-500',
|
|
15001
|
+
].join(' ');
|
|
15002
|
+
const disabledClasses$1 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
15003
|
+
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 }) => {
|
|
15004
|
+
const tooltipData = getQTipData(tooltipProps);
|
|
15005
|
+
let timeout;
|
|
15006
|
+
const [isHoveredOpen, setIsHoveredOpen] = React.useState();
|
|
15007
|
+
const onHoverStart = () => {
|
|
15008
|
+
if (isHoverEnabled) {
|
|
15009
|
+
timeout = setTimeout(() => {
|
|
15010
|
+
setIsHoveredOpen(true);
|
|
15011
|
+
onOpenChange && onOpenChange(true);
|
|
15012
|
+
}, hoverOpenDelay);
|
|
15013
|
+
}
|
|
15014
|
+
};
|
|
15015
|
+
const onHoverEnd = () => {
|
|
15016
|
+
if (isHoverEnabled) {
|
|
15017
|
+
timeout = setTimeout(() => {
|
|
15018
|
+
setIsHoveredOpen(false);
|
|
15019
|
+
onOpenChange && onOpenChange(false);
|
|
15020
|
+
}, 200);
|
|
15021
|
+
}
|
|
15022
|
+
};
|
|
15023
|
+
React.useEffect(() => () => timeout && clearTimeout(timeout), []);
|
|
15024
|
+
return (React.createElement($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, { open: isOpen || isHoveredOpen, defaultOpen: false, onOpenChange: onOpenChange },
|
|
15025
|
+
React.createElement($cb5cc270b50c6fcd$export$41fb9f06171c75f4, { id: id, className: `tw-border-none`, disabled: disabled },
|
|
15026
|
+
React.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)),
|
|
15027
|
+
React.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" },
|
|
15028
|
+
React.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
|
|
15029
|
+
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
|
|
15030
|
+
${extraPopoverClassNames || ''}` },
|
|
15031
|
+
hasArrow && (React.createElement($cb5cc270b50c6fcd$export$21b07c8f274aebd5, { asChild: true },
|
|
15032
|
+
React.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" }))),
|
|
15033
|
+
children))));
|
|
15034
|
+
};
|
|
15072
15035
|
|
|
15073
|
-
|
|
15074
|
-
|
|
15075
|
-
|
|
15076
|
-
|
|
15077
|
-
|
|
15078
|
-
|
|
15079
|
-
|
|
15080
|
-
|
|
15081
|
-
|
|
15082
|
-
|
|
15083
|
-
|
|
15084
|
-
|
|
15085
|
-
|
|
15086
|
-
|
|
15087
|
-
|
|
15088
|
-
|
|
15089
|
-
|
|
15090
|
-
|
|
15091
|
-
|
|
15092
|
-
|
|
15093
|
-
|
|
15094
|
-
|
|
15095
|
-
|
|
15096
|
-
|
|
15097
|
-
|
|
15098
|
-
|
|
15099
|
-
|
|
15100
|
-
|
|
15101
|
-
|
|
15102
|
-
|
|
15103
|
-
|
|
15104
|
-
|
|
15105
|
-
|
|
15106
|
-
|
|
15107
|
-
|
|
15108
|
-
|
|
15109
|
-
/* -----------------------------------------------------------------------------------------------
|
|
15110
|
-
* createScope
|
|
15111
|
-
* ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
|
|
15112
|
-
const scopeContexts = defaultContexts.map((defaultContext)=>{
|
|
15113
|
-
return /*#__PURE__*/ createContext(defaultContext);
|
|
15114
|
-
});
|
|
15115
|
-
return function useScope(scope) {
|
|
15116
|
-
const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
|
|
15117
|
-
return useMemo(()=>({
|
|
15118
|
-
[`__scope${scopeName}`]: {
|
|
15119
|
-
...scope,
|
|
15120
|
-
[scopeName]: contexts
|
|
15121
|
-
}
|
|
15122
|
-
})
|
|
15123
|
-
, [
|
|
15124
|
-
scope,
|
|
15125
|
-
contexts
|
|
15126
|
-
]);
|
|
15127
|
-
};
|
|
15128
|
-
};
|
|
15129
|
-
createScope.scopeName = scopeName;
|
|
15130
|
-
return [
|
|
15131
|
-
$c512c27ab02ef895$export$fd42f52fd3ae1109,
|
|
15132
|
-
$c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
|
|
15133
|
-
];
|
|
15134
|
-
}
|
|
15135
|
-
/* -------------------------------------------------------------------------------------------------
|
|
15136
|
-
* composeContextScopes
|
|
15137
|
-
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
|
|
15138
|
-
const baseScope = scopes[0];
|
|
15139
|
-
if (scopes.length === 1) return baseScope;
|
|
15140
|
-
const createScope1 = ()=>{
|
|
15141
|
-
const scopeHooks = scopes.map((createScope)=>({
|
|
15142
|
-
useScope: createScope(),
|
|
15143
|
-
scopeName: createScope.scopeName
|
|
15144
|
-
})
|
|
15145
|
-
);
|
|
15146
|
-
return function useComposedScopes(overrideScopes) {
|
|
15147
|
-
const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
|
|
15148
|
-
// We are calling a hook inside a callback which React warns against to avoid inconsistent
|
|
15149
|
-
// renders, however, scoping doesn't have render side effects so we ignore the rule.
|
|
15150
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
15151
|
-
const scopeProps = useScope(overrideScopes);
|
|
15152
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
15153
|
-
return {
|
|
15154
|
-
...nextScopes,
|
|
15155
|
-
...currentScope
|
|
15156
|
-
};
|
|
15157
|
-
}, {});
|
|
15158
|
-
return useMemo(()=>({
|
|
15159
|
-
[`__scope${baseScope.scopeName}`]: nextScopes1
|
|
15160
|
-
})
|
|
15161
|
-
, [
|
|
15162
|
-
nextScopes1
|
|
15163
|
-
]);
|
|
15164
|
-
};
|
|
15165
|
-
};
|
|
15166
|
-
createScope1.scopeName = baseScope.scopeName;
|
|
15167
|
-
return createScope1;
|
|
15168
|
-
}
|
|
15169
|
-
|
|
15170
|
-
/**
|
|
15171
|
-
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
15172
|
-
* prop or avoid re-executing effects when passed as a dependency
|
|
15173
|
-
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
15174
|
-
const callbackRef = useRef(callback);
|
|
15175
|
-
useEffect(()=>{
|
|
15176
|
-
callbackRef.current = callback;
|
|
15177
|
-
}); // https://github.com/facebook/react/issues/19240
|
|
15178
|
-
return useMemo(()=>(...args)=>{
|
|
15179
|
-
var _callbackRef$current;
|
|
15180
|
-
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
15181
|
-
}
|
|
15182
|
-
, []);
|
|
15183
|
-
}
|
|
15184
|
-
|
|
15185
|
-
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
|
|
15186
|
-
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
15187
|
-
defaultProp: defaultProp,
|
|
15188
|
-
onChange: onChange
|
|
15189
|
-
});
|
|
15190
|
-
const isControlled = prop !== undefined;
|
|
15191
|
-
const value1 = isControlled ? prop : uncontrolledProp;
|
|
15192
|
-
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
15193
|
-
const setValue = useCallback((nextValue)=>{
|
|
15194
|
-
if (isControlled) {
|
|
15195
|
-
const setter = nextValue;
|
|
15196
|
-
const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
|
|
15197
|
-
if (value !== prop) handleChange(value);
|
|
15198
|
-
} else setUncontrolledProp(nextValue);
|
|
15199
|
-
}, [
|
|
15200
|
-
isControlled,
|
|
15201
|
-
prop,
|
|
15202
|
-
setUncontrolledProp,
|
|
15203
|
-
handleChange
|
|
15204
|
-
]);
|
|
15205
|
-
return [
|
|
15206
|
-
value1,
|
|
15207
|
-
setValue
|
|
15208
|
-
];
|
|
15209
|
-
}
|
|
15210
|
-
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
|
|
15211
|
-
const uncontrolledState = useState(defaultProp);
|
|
15212
|
-
const [value] = uncontrolledState;
|
|
15213
|
-
const prevValueRef = useRef(value);
|
|
15214
|
-
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
15215
|
-
useEffect(()=>{
|
|
15216
|
-
if (prevValueRef.current !== value) {
|
|
15217
|
-
handleChange(value);
|
|
15218
|
-
prevValueRef.current = value;
|
|
15219
|
-
}
|
|
15220
|
-
}, [
|
|
15221
|
-
value,
|
|
15222
|
-
prevValueRef,
|
|
15223
|
-
handleChange
|
|
15224
|
-
]);
|
|
15225
|
-
return uncontrolledState;
|
|
15226
|
-
}
|
|
15227
|
-
|
|
15228
|
-
/**
|
|
15229
|
-
* Set a given ref to a given value
|
|
15230
|
-
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
15231
|
-
*/ function $6ed0406888f73fc4$var$setRef(ref, value) {
|
|
15232
|
-
if (typeof ref === 'function') ref(value);
|
|
15233
|
-
else if (ref !== null && ref !== undefined) ref.current = value;
|
|
15234
|
-
}
|
|
15235
|
-
/**
|
|
15236
|
-
* A utility to compose multiple refs together
|
|
15237
|
-
* Accepts callback refs and RefObject(s)
|
|
15238
|
-
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
|
15239
|
-
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
|
|
15240
|
-
)
|
|
15241
|
-
;
|
|
15242
|
-
}
|
|
15243
|
-
/**
|
|
15244
|
-
* A custom hook that composes multiple refs
|
|
15245
|
-
* Accepts callback refs and RefObject(s)
|
|
15246
|
-
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
15247
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15248
|
-
return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
15249
|
-
}
|
|
15250
|
-
|
|
15251
|
-
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}}:{}}}};
|
|
15252
|
-
|
|
15253
|
-
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});
|
|
15254
|
-
|
|
15255
|
-
var index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;
|
|
15256
|
-
|
|
15257
|
-
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
|
|
15258
|
-
// functions
|
|
15259
|
-
function deepEqual(a, b) {
|
|
15260
|
-
if (a === b) {
|
|
15261
|
-
return true;
|
|
15262
|
-
}
|
|
15263
|
-
|
|
15264
|
-
if (typeof a !== typeof b) {
|
|
15265
|
-
return false;
|
|
15266
|
-
}
|
|
15267
|
-
|
|
15268
|
-
if (typeof a === 'function' && a.toString() === b.toString()) {
|
|
15269
|
-
return true;
|
|
15270
|
-
}
|
|
15271
|
-
|
|
15272
|
-
let length, i, keys;
|
|
15273
|
-
|
|
15274
|
-
if (a && b && typeof a == 'object') {
|
|
15275
|
-
if (Array.isArray(a)) {
|
|
15276
|
-
length = a.length;
|
|
15277
|
-
if (length != b.length) return false;
|
|
15278
|
-
|
|
15279
|
-
for (i = length; i-- !== 0;) {
|
|
15280
|
-
if (!deepEqual(a[i], b[i])) {
|
|
15281
|
-
return false;
|
|
15282
|
-
}
|
|
15283
|
-
}
|
|
15284
|
-
|
|
15285
|
-
return true;
|
|
15286
|
-
}
|
|
15287
|
-
|
|
15288
|
-
keys = Object.keys(a);
|
|
15289
|
-
length = keys.length;
|
|
15290
|
-
|
|
15291
|
-
if (length !== Object.keys(b).length) {
|
|
15292
|
-
return false;
|
|
15293
|
-
}
|
|
15294
|
-
|
|
15295
|
-
for (i = length; i-- !== 0;) {
|
|
15296
|
-
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {
|
|
15297
|
-
return false;
|
|
15298
|
-
}
|
|
15299
|
-
}
|
|
15300
|
-
|
|
15301
|
-
for (i = length; i-- !== 0;) {
|
|
15302
|
-
const key = keys[i];
|
|
15303
|
-
|
|
15304
|
-
if (key === '_owner' && a.$$typeof) {
|
|
15305
|
-
continue;
|
|
15306
|
-
}
|
|
15307
|
-
|
|
15308
|
-
if (!deepEqual(a[key], b[key])) {
|
|
15309
|
-
return false;
|
|
15310
|
-
}
|
|
15311
|
-
}
|
|
15312
|
-
|
|
15313
|
-
return true;
|
|
15314
|
-
}
|
|
15315
|
-
|
|
15316
|
-
return a !== a && b !== b;
|
|
15317
|
-
}
|
|
15318
|
-
|
|
15319
|
-
function useLatestRef(value) {
|
|
15320
|
-
const ref = React.useRef(value);
|
|
15321
|
-
index(() => {
|
|
15322
|
-
ref.current = value;
|
|
15323
|
-
});
|
|
15324
|
-
return ref;
|
|
15325
|
-
}
|
|
15326
|
-
|
|
15327
|
-
function useFloating(_temp) {
|
|
15328
|
-
let {
|
|
15329
|
-
middleware,
|
|
15330
|
-
placement = 'bottom',
|
|
15331
|
-
strategy = 'absolute',
|
|
15332
|
-
whileElementsMounted
|
|
15333
|
-
} = _temp === void 0 ? {} : _temp;
|
|
15334
|
-
const reference = React.useRef(null);
|
|
15335
|
-
const floating = React.useRef(null);
|
|
15336
|
-
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
15337
|
-
const cleanupRef = React.useRef(null);
|
|
15338
|
-
const [data, setData] = React.useState({
|
|
15339
|
-
// Setting these to `null` will allow the consumer to determine if
|
|
15340
|
-
// `computePosition()` has run yet
|
|
15341
|
-
x: null,
|
|
15342
|
-
y: null,
|
|
15343
|
-
strategy,
|
|
15344
|
-
placement,
|
|
15345
|
-
middlewareData: {}
|
|
15346
|
-
});
|
|
15347
|
-
const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);
|
|
15348
|
-
|
|
15349
|
-
if (!deepEqual(latestMiddleware == null ? void 0 : latestMiddleware.map(_ref => {
|
|
15350
|
-
let {
|
|
15351
|
-
options
|
|
15352
|
-
} = _ref;
|
|
15353
|
-
return options;
|
|
15354
|
-
}), middleware == null ? void 0 : middleware.map(_ref2 => {
|
|
15355
|
-
let {
|
|
15356
|
-
options
|
|
15357
|
-
} = _ref2;
|
|
15358
|
-
return options;
|
|
15359
|
-
}))) {
|
|
15360
|
-
setLatestMiddleware(middleware);
|
|
15361
|
-
}
|
|
15362
|
-
|
|
15363
|
-
const update = React.useCallback(() => {
|
|
15364
|
-
if (!reference.current || !floating.current) {
|
|
15365
|
-
return;
|
|
15366
|
-
}
|
|
15367
|
-
|
|
15368
|
-
z(reference.current, floating.current, {
|
|
15369
|
-
middleware: latestMiddleware,
|
|
15370
|
-
placement,
|
|
15371
|
-
strategy
|
|
15372
|
-
}).then(data => {
|
|
15373
|
-
if (isMountedRef.current) {
|
|
15374
|
-
ReactDOM.flushSync(() => {
|
|
15375
|
-
setData(data);
|
|
15376
|
-
});
|
|
15377
|
-
}
|
|
15378
|
-
});
|
|
15379
|
-
}, [latestMiddleware, placement, strategy]);
|
|
15380
|
-
index(() => {
|
|
15381
|
-
// Skip first update
|
|
15382
|
-
if (isMountedRef.current) {
|
|
15383
|
-
update();
|
|
15384
|
-
}
|
|
15385
|
-
}, [update]);
|
|
15386
|
-
const isMountedRef = React.useRef(false);
|
|
15387
|
-
index(() => {
|
|
15388
|
-
isMountedRef.current = true;
|
|
15389
|
-
return () => {
|
|
15390
|
-
isMountedRef.current = false;
|
|
15391
|
-
};
|
|
15392
|
-
}, []);
|
|
15393
|
-
const runElementMountCallback = React.useCallback(() => {
|
|
15394
|
-
if (typeof cleanupRef.current === 'function') {
|
|
15395
|
-
cleanupRef.current();
|
|
15396
|
-
cleanupRef.current = null;
|
|
15397
|
-
}
|
|
15398
|
-
|
|
15399
|
-
if (reference.current && floating.current) {
|
|
15400
|
-
if (whileElementsMountedRef.current) {
|
|
15401
|
-
const cleanupFn = whileElementsMountedRef.current(reference.current, floating.current, update);
|
|
15402
|
-
cleanupRef.current = cleanupFn;
|
|
15403
|
-
} else {
|
|
15404
|
-
update();
|
|
15405
|
-
}
|
|
15406
|
-
}
|
|
15407
|
-
}, [update, whileElementsMountedRef]);
|
|
15408
|
-
const setReference = React.useCallback(node => {
|
|
15409
|
-
reference.current = node;
|
|
15410
|
-
runElementMountCallback();
|
|
15411
|
-
}, [runElementMountCallback]);
|
|
15412
|
-
const setFloating = React.useCallback(node => {
|
|
15413
|
-
floating.current = node;
|
|
15414
|
-
runElementMountCallback();
|
|
15415
|
-
}, [runElementMountCallback]);
|
|
15416
|
-
const refs = React.useMemo(() => ({
|
|
15417
|
-
reference,
|
|
15418
|
-
floating
|
|
15419
|
-
}), []);
|
|
15420
|
-
return React.useMemo(() => ({ ...data,
|
|
15421
|
-
update,
|
|
15422
|
-
refs,
|
|
15423
|
-
reference: setReference,
|
|
15424
|
-
floating: setFloating
|
|
15425
|
-
}), [data, update, refs, setReference, setFloating]);
|
|
15426
|
-
}
|
|
15427
|
-
|
|
15428
|
-
/**
|
|
15429
|
-
* Positions an inner element of the floating element such that it is centered
|
|
15430
|
-
* to the reference element.
|
|
15431
|
-
* This wraps the core `arrow` middleware to allow React refs as the element.
|
|
15432
|
-
* @see https://floating-ui.com/docs/arrow
|
|
15433
|
-
*/
|
|
15434
|
-
|
|
15435
|
-
const arrow = options => {
|
|
15436
|
-
const {
|
|
15437
|
-
element,
|
|
15438
|
-
padding
|
|
15439
|
-
} = options;
|
|
15440
|
-
|
|
15441
|
-
function isRef(value) {
|
|
15442
|
-
return Object.prototype.hasOwnProperty.call(value, 'current');
|
|
15443
|
-
}
|
|
15444
|
-
|
|
15445
|
-
return {
|
|
15446
|
-
name: 'arrow',
|
|
15447
|
-
options,
|
|
15448
|
-
|
|
15449
|
-
fn(args) {
|
|
15450
|
-
if (isRef(element)) {
|
|
15451
|
-
if (element.current != null) {
|
|
15452
|
-
return m$1({
|
|
15453
|
-
element: element.current,
|
|
15454
|
-
padding
|
|
15455
|
-
}).fn(args);
|
|
15456
|
-
}
|
|
15457
|
-
|
|
15458
|
-
return {};
|
|
15459
|
-
} else if (element) {
|
|
15460
|
-
return m$1({
|
|
15461
|
-
element,
|
|
15462
|
-
padding
|
|
15463
|
-
}).fn(args);
|
|
15464
|
-
}
|
|
15465
|
-
|
|
15466
|
-
return {};
|
|
15467
|
-
}
|
|
15468
|
-
|
|
15469
|
-
};
|
|
15470
|
-
};
|
|
15471
|
-
|
|
15472
|
-
/* -------------------------------------------------------------------------------------------------
|
|
15473
|
-
* Slot
|
|
15474
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
15475
|
-
const { children: children , ...slotProps } = props;
|
|
15476
|
-
const childrenArray = Children.toArray(children);
|
|
15477
|
-
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
15478
|
-
if (slottable) {
|
|
15479
|
-
// the new element to render is the one passed as a child of `Slottable`
|
|
15480
|
-
const newElement = slottable.props.children;
|
|
15481
|
-
const newChildren = childrenArray.map((child)=>{
|
|
15482
|
-
if (child === slottable) {
|
|
15483
|
-
// because the new element will be the one rendered, we are only interested
|
|
15484
|
-
// in grabbing its children (`newElement.props.children`)
|
|
15485
|
-
if (Children.count(newElement) > 1) return Children.only(null);
|
|
15486
|
-
return /*#__PURE__*/ isValidElement(newElement) ? newElement.props.children : null;
|
|
15487
|
-
} else return child;
|
|
15488
|
-
});
|
|
15489
|
-
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
15490
|
-
ref: forwardedRef
|
|
15491
|
-
}), /*#__PURE__*/ isValidElement(newElement) ? /*#__PURE__*/ cloneElement(newElement, undefined, newChildren) : null);
|
|
15492
|
-
}
|
|
15493
|
-
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
15494
|
-
ref: forwardedRef
|
|
15495
|
-
}), children);
|
|
15496
|
-
});
|
|
15497
|
-
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
|
|
15498
|
-
/* -------------------------------------------------------------------------------------------------
|
|
15499
|
-
* SlotClone
|
|
15500
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
15501
|
-
const { children: children , ...slotProps } = props;
|
|
15502
|
-
if (/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ cloneElement(children, {
|
|
15503
|
-
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
15504
|
-
ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref)
|
|
15505
|
-
});
|
|
15506
|
-
return Children.count(children) > 1 ? Children.only(null) : null;
|
|
15507
|
-
});
|
|
15508
|
-
$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
|
|
15509
|
-
/* -------------------------------------------------------------------------------------------------
|
|
15510
|
-
* Slottable
|
|
15511
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
|
|
15512
|
-
return /*#__PURE__*/ createElement(Fragment, null, children);
|
|
15513
|
-
};
|
|
15514
|
-
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
15515
|
-
return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
15516
|
-
}
|
|
15517
|
-
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
15518
|
-
// all child props should override
|
|
15519
|
-
const overrideProps = {
|
|
15520
|
-
...childProps
|
|
15521
|
-
};
|
|
15522
|
-
for(const propName in childProps){
|
|
15523
|
-
const slotPropValue = slotProps[propName];
|
|
15524
|
-
const childPropValue = childProps[propName];
|
|
15525
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
15526
|
-
if (isHandler) {
|
|
15527
|
-
// if the handler exists on both, we compose them
|
|
15528
|
-
if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{
|
|
15529
|
-
childPropValue(...args);
|
|
15530
|
-
slotPropValue(...args);
|
|
15531
|
-
};
|
|
15532
|
-
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
15533
|
-
} else if (propName === 'style') overrideProps[propName] = {
|
|
15534
|
-
...slotPropValue,
|
|
15535
|
-
...childPropValue
|
|
15536
|
-
};
|
|
15537
|
-
else if (propName === 'className') overrideProps[propName] = [
|
|
15538
|
-
slotPropValue,
|
|
15539
|
-
childPropValue
|
|
15540
|
-
].filter(Boolean).join(' ');
|
|
15541
|
-
}
|
|
15542
|
-
return {
|
|
15543
|
-
...slotProps,
|
|
15544
|
-
...overrideProps
|
|
15545
|
-
};
|
|
15546
|
-
}
|
|
15547
|
-
|
|
15548
|
-
const $8927f6f2acc4f386$var$NODES = [
|
|
15549
|
-
'a',
|
|
15550
|
-
'button',
|
|
15551
|
-
'div',
|
|
15552
|
-
'h2',
|
|
15553
|
-
'h3',
|
|
15554
|
-
'img',
|
|
15555
|
-
'label',
|
|
15556
|
-
'li',
|
|
15557
|
-
'nav',
|
|
15558
|
-
'ol',
|
|
15559
|
-
'p',
|
|
15560
|
-
'span',
|
|
15561
|
-
'svg',
|
|
15562
|
-
'ul'
|
|
15563
|
-
]; // Temporary while we await merge of this fix:
|
|
15564
|
-
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
|
|
15565
|
-
// prettier-ignore
|
|
15566
|
-
/* -------------------------------------------------------------------------------------------------
|
|
15567
|
-
* Primitive
|
|
15568
|
-
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
|
|
15569
|
-
const Node = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
15570
|
-
const { asChild: asChild , ...primitiveProps } = props;
|
|
15571
|
-
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
|
15572
|
-
useEffect(()=>{
|
|
15573
|
-
window[Symbol.for('radix-ui')] = true;
|
|
15574
|
-
}, []);
|
|
15575
|
-
return /*#__PURE__*/ createElement(Comp, _extends({}, primitiveProps, {
|
|
15576
|
-
ref: forwardedRef
|
|
15577
|
-
}));
|
|
15578
|
-
});
|
|
15579
|
-
Node.displayName = `Primitive.${node}`;
|
|
15580
|
-
return {
|
|
15581
|
-
...primitive,
|
|
15582
|
-
[node]: Node
|
|
15583
|
-
};
|
|
15584
|
-
}, {});
|
|
15585
|
-
/* -------------------------------------------------------------------------------------------------
|
|
15586
|
-
* Utils
|
|
15587
|
-
* -----------------------------------------------------------------------------------------------*/ /**
|
|
15588
|
-
* Flush custom event dispatch
|
|
15589
|
-
* https://github.com/radix-ui/primitives/pull/1378
|
|
15590
|
-
*
|
|
15591
|
-
* React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.
|
|
15592
|
-
*
|
|
15593
|
-
* Internally, React prioritises events in the following order:
|
|
15594
|
-
* - discrete
|
|
15595
|
-
* - continuous
|
|
15596
|
-
* - default
|
|
15597
|
-
*
|
|
15598
|
-
* https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350
|
|
15599
|
-
*
|
|
15600
|
-
* `discrete` is an important distinction as updates within these events are applied immediately.
|
|
15601
|
-
* React however, is not able to infer the priority of custom event types due to how they are detected internally.
|
|
15602
|
-
* Because of this, it's possible for updates from custom events to be unexpectedly batched when
|
|
15603
|
-
* dispatched by another `discrete` event.
|
|
15604
|
-
*
|
|
15605
|
-
* In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.
|
|
15606
|
-
* This utility should be used when dispatching a custom event from within another `discrete` event, this utility
|
|
15607
|
-
* is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.
|
|
15608
|
-
* For example:
|
|
15609
|
-
*
|
|
15610
|
-
* dispatching a known click 👎
|
|
15611
|
-
* target.dispatchEvent(new Event(‘click’))
|
|
15612
|
-
*
|
|
15613
|
-
* dispatching a custom type within a non-discrete event 👎
|
|
15614
|
-
* onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}
|
|
15615
|
-
*
|
|
15616
|
-
* dispatching a custom type within a `discrete` event 👍
|
|
15617
|
-
* onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}
|
|
15618
|
-
*
|
|
15619
|
-
* Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
|
|
15620
|
-
* this utility with them. This is because it's possible for those handlers to be called implicitly during render
|
|
15621
|
-
* e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
|
|
15622
|
-
*/ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
|
|
15623
|
-
if (target) flushSync(()=>target.dispatchEvent(event)
|
|
15624
|
-
);
|
|
15625
|
-
}
|
|
15626
|
-
|
|
15627
|
-
const $7e8f5cd07187803e$export$21b07c8f274aebd5 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
15628
|
-
const { children: children , width: width = 10 , height: height = 5 , ...arrowProps } = props;
|
|
15629
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.svg, _extends({}, arrowProps, {
|
|
15630
|
-
ref: forwardedRef,
|
|
15631
|
-
width: width,
|
|
15632
|
-
height: height,
|
|
15633
|
-
viewBox: "0 0 30 10",
|
|
15634
|
-
preserveAspectRatio: "none"
|
|
15635
|
-
}), props.asChild ? children : /*#__PURE__*/ createElement("polygon", {
|
|
15636
|
-
points: "0,0 30,0 15,10"
|
|
15637
|
-
}));
|
|
15638
|
-
});
|
|
15639
|
-
/* -----------------------------------------------------------------------------------------------*/ const $7e8f5cd07187803e$export$be92b6f5f03c0fe9 = $7e8f5cd07187803e$export$21b07c8f274aebd5;
|
|
15640
|
-
|
|
15641
|
-
/**
|
|
15642
|
-
* On the server, React emits a warning when calling `useLayoutEffect`.
|
|
15643
|
-
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
|
15644
|
-
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
15645
|
-
*
|
|
15646
|
-
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
15647
|
-
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
|
|
15648
|
-
|
|
15649
|
-
function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
|
15650
|
-
const [size, setSize] = useState(undefined);
|
|
15651
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
15652
|
-
if (element) {
|
|
15653
|
-
// provide size as early as possible
|
|
15654
|
-
setSize({
|
|
15655
|
-
width: element.offsetWidth,
|
|
15656
|
-
height: element.offsetHeight
|
|
15657
|
-
});
|
|
15658
|
-
const resizeObserver = new ResizeObserver((entries)=>{
|
|
15659
|
-
if (!Array.isArray(entries)) return;
|
|
15660
|
-
// Since we only observe the one element, we don't need to loop over the
|
|
15661
|
-
// array
|
|
15662
|
-
if (!entries.length) return;
|
|
15663
|
-
const entry = entries[0];
|
|
15664
|
-
let width;
|
|
15665
|
-
let height;
|
|
15666
|
-
if ('borderBoxSize' in entry) {
|
|
15667
|
-
const borderSizeEntry = entry['borderBoxSize']; // iron out differences between browsers
|
|
15668
|
-
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
15669
|
-
width = borderSize['inlineSize'];
|
|
15670
|
-
height = borderSize['blockSize'];
|
|
15671
|
-
} else {
|
|
15672
|
-
// for browsers that don't support `borderBoxSize`
|
|
15673
|
-
// we calculate it ourselves to get the correct border box.
|
|
15674
|
-
width = element.offsetWidth;
|
|
15675
|
-
height = element.offsetHeight;
|
|
15676
|
-
}
|
|
15677
|
-
setSize({
|
|
15678
|
-
width: width,
|
|
15679
|
-
height: height
|
|
15680
|
-
});
|
|
15681
|
-
});
|
|
15682
|
-
resizeObserver.observe(element, {
|
|
15683
|
-
box: 'border-box'
|
|
15684
|
-
});
|
|
15685
|
-
return ()=>resizeObserver.unobserve(element)
|
|
15686
|
-
;
|
|
15687
|
-
} else // We only want to reset to `undefined` when the element becomes `null`,
|
|
15688
|
-
// not if it changes to another element.
|
|
15689
|
-
setSize(undefined);
|
|
15690
|
-
}, [
|
|
15691
|
-
element
|
|
15692
|
-
]);
|
|
15693
|
-
return size;
|
|
15694
|
-
}
|
|
15695
|
-
|
|
15696
|
-
/* -------------------------------------------------------------------------------------------------
|
|
15697
|
-
* Popper
|
|
15698
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$POPPER_NAME = 'Popper';
|
|
15699
|
-
const [$cf1ac5d9fe0e8206$var$createPopperContext, $cf1ac5d9fe0e8206$export$722aac194ae923] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
15700
|
-
const [$cf1ac5d9fe0e8206$var$PopperProvider, $cf1ac5d9fe0e8206$var$usePopperContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
15701
|
-
const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 = (props)=>{
|
|
15702
|
-
const { __scopePopper: __scopePopper , children: children } = props;
|
|
15703
|
-
const [anchor, setAnchor] = useState(null);
|
|
15704
|
-
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$var$PopperProvider, {
|
|
15705
|
-
scope: __scopePopper,
|
|
15706
|
-
anchor: anchor,
|
|
15707
|
-
onAnchorChange: setAnchor
|
|
15708
|
-
}, children);
|
|
15709
|
-
};
|
|
15710
|
-
/* -------------------------------------------------------------------------------------------------
|
|
15711
|
-
* PopperAnchor
|
|
15712
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ANCHOR_NAME = 'PopperAnchor';
|
|
15713
|
-
const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
15714
|
-
const { __scopePopper: __scopePopper , virtualRef: virtualRef , ...anchorProps } = props;
|
|
15715
|
-
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME, __scopePopper);
|
|
15716
|
-
const ref = useRef(null);
|
|
15717
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
15718
|
-
useEffect(()=>{
|
|
15719
|
-
// Consumer can anchor the popper to something that isn't
|
|
15720
|
-
// a DOM node e.g. pointer position, so we override the
|
|
15721
|
-
// `anchorRef` with their virtual ref in this case.
|
|
15722
|
-
context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
|
|
15723
|
-
});
|
|
15724
|
-
return virtualRef ? null : /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, anchorProps, {
|
|
15725
|
-
ref: composedRefs
|
|
15726
|
-
}));
|
|
15727
|
-
});
|
|
15728
|
-
/* -------------------------------------------------------------------------------------------------
|
|
15729
|
-
* PopperContent
|
|
15730
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$CONTENT_NAME = 'PopperContent';
|
|
15731
|
-
const [$cf1ac5d9fe0e8206$var$PopperContentProvider, $cf1ac5d9fe0e8206$var$useContentContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME);
|
|
15732
|
-
const [$cf1ac5d9fe0e8206$var$PositionContextProvider, $cf1ac5d9fe0e8206$var$usePositionContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, {
|
|
15733
|
-
hasParent: false,
|
|
15734
|
-
positionUpdateFns: new Set()
|
|
15735
|
-
});
|
|
15736
|
-
const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
15737
|
-
var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$hide, _middlewareData$trans, _middlewareData$trans2;
|
|
15738
|
-
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;
|
|
15739
|
-
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
|
|
15740
|
-
const [content, setContent] = useState(null);
|
|
15741
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
|
15742
|
-
);
|
|
15743
|
-
const [arrow$1, setArrow] = useState(null);
|
|
15744
|
-
const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(arrow$1);
|
|
15745
|
-
const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0;
|
|
15746
|
-
const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0;
|
|
15747
|
-
const desiredPlacement = side + (align !== 'center' ? '-' + align : '');
|
|
15748
|
-
const collisionPadding = typeof collisionPaddingProp === 'number' ? collisionPaddingProp : {
|
|
15749
|
-
top: 0,
|
|
15750
|
-
right: 0,
|
|
15751
|
-
bottom: 0,
|
|
15752
|
-
left: 0,
|
|
15753
|
-
...collisionPaddingProp
|
|
15754
|
-
};
|
|
15755
|
-
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [
|
|
15756
|
-
collisionBoundary
|
|
15757
|
-
];
|
|
15758
|
-
const hasExplicitBoundaries = boundary.length > 0;
|
|
15759
|
-
const detectOverflowOptions = {
|
|
15760
|
-
padding: collisionPadding,
|
|
15761
|
-
boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull),
|
|
15762
|
-
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
15763
|
-
altBoundary: hasExplicitBoundaries
|
|
15764
|
-
};
|
|
15765
|
-
const { reference: reference , floating: floating , strategy: strategy , x: x , y: y , placement: placement , middlewareData: middlewareData , update: update } = useFloating({
|
|
15766
|
-
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
15767
|
-
strategy: 'fixed',
|
|
15768
|
-
placement: desiredPlacement,
|
|
15769
|
-
whileElementsMounted: N,
|
|
15770
|
-
middleware: [
|
|
15771
|
-
$cf1ac5d9fe0e8206$var$anchorCssProperties(),
|
|
15772
|
-
T$1({
|
|
15773
|
-
mainAxis: sideOffset + arrowHeight,
|
|
15774
|
-
alignmentAxis: alignOffset
|
|
15775
|
-
}),
|
|
15776
|
-
avoidCollisions ? D$1({
|
|
15777
|
-
mainAxis: true,
|
|
15778
|
-
crossAxis: false,
|
|
15779
|
-
limiter: sticky === 'partial' ? L$1() : undefined,
|
|
15780
|
-
...detectOverflowOptions
|
|
15781
|
-
}) : undefined,
|
|
15782
|
-
arrow$1 ? arrow({
|
|
15783
|
-
element: arrow$1,
|
|
15784
|
-
padding: arrowPadding
|
|
15785
|
-
}) : undefined,
|
|
15786
|
-
avoidCollisions ? b$1({
|
|
15787
|
-
...detectOverflowOptions
|
|
15788
|
-
}) : undefined,
|
|
15789
|
-
k({
|
|
15790
|
-
...detectOverflowOptions,
|
|
15791
|
-
apply: ({ elements: elements , availableWidth: width , availableHeight: height })=>{
|
|
15792
|
-
elements.floating.style.setProperty('--radix-popper-available-width', `${width}px`);
|
|
15793
|
-
elements.floating.style.setProperty('--radix-popper-available-height', `${height}px`);
|
|
15794
|
-
}
|
|
15795
|
-
}),
|
|
15796
|
-
$cf1ac5d9fe0e8206$var$transformOrigin({
|
|
15797
|
-
arrowWidth: arrowWidth,
|
|
15798
|
-
arrowHeight: arrowHeight
|
|
15799
|
-
}),
|
|
15800
|
-
hideWhenDetached ? P({
|
|
15801
|
-
strategy: 'referenceHidden'
|
|
15802
|
-
}) : undefined
|
|
15803
|
-
].filter($cf1ac5d9fe0e8206$var$isDefined)
|
|
15804
|
-
}); // assign the reference dynamically once `Content` has mounted so we can collocate the logic
|
|
15805
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
15806
|
-
reference(context.anchor);
|
|
15807
|
-
}, [
|
|
15808
|
-
reference,
|
|
15809
|
-
context.anchor
|
|
15810
|
-
]);
|
|
15811
|
-
const isPlaced = x !== null && y !== null;
|
|
15812
|
-
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
15813
|
-
const handlePlaced = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPlaced);
|
|
15814
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
15815
|
-
if (isPlaced) handlePlaced === null || handlePlaced === void 0 || handlePlaced();
|
|
15816
|
-
}, [
|
|
15817
|
-
isPlaced,
|
|
15818
|
-
handlePlaced
|
|
15819
|
-
]);
|
|
15820
|
-
const arrowX = (_middlewareData$arrow = middlewareData.arrow) === null || _middlewareData$arrow === void 0 ? void 0 : _middlewareData$arrow.x;
|
|
15821
|
-
const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y;
|
|
15822
|
-
const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0;
|
|
15823
|
-
const [contentZIndex, setContentZIndex] = useState();
|
|
15824
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
15825
|
-
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
15826
|
-
}, [
|
|
15827
|
-
content
|
|
15828
|
-
]);
|
|
15829
|
-
const { hasParent: hasParent , positionUpdateFns: positionUpdateFns } = $cf1ac5d9fe0e8206$var$usePositionContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
|
|
15830
|
-
const isRoot = !hasParent;
|
|
15831
|
-
useLayoutEffect(()=>{
|
|
15832
|
-
if (!isRoot) {
|
|
15833
|
-
positionUpdateFns.add(update);
|
|
15834
|
-
return ()=>{
|
|
15835
|
-
positionUpdateFns.delete(update);
|
|
15836
|
-
};
|
|
15837
|
-
}
|
|
15838
|
-
}, [
|
|
15839
|
-
isRoot,
|
|
15840
|
-
positionUpdateFns,
|
|
15841
|
-
update
|
|
15842
|
-
]); // when nested contents are rendered in portals, they are appended out of order causing
|
|
15843
|
-
// children to be positioned incorrectly if initially open.
|
|
15844
|
-
// we need to re-compute the positioning once the parent has finally been placed.
|
|
15845
|
-
// https://github.com/floating-ui/floating-ui/issues/1531
|
|
15846
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
15847
|
-
if (isRoot && isPlaced) Array.from(positionUpdateFns).reverse().forEach((fn)=>requestAnimationFrame(fn)
|
|
15848
|
-
);
|
|
15849
|
-
}, [
|
|
15850
|
-
isRoot,
|
|
15851
|
-
isPlaced,
|
|
15852
|
-
positionUpdateFns
|
|
15853
|
-
]);
|
|
15854
|
-
const commonProps = {
|
|
15855
|
-
'data-side': placedSide,
|
|
15856
|
-
'data-align': placedAlign,
|
|
15857
|
-
...contentProps,
|
|
15858
|
-
ref: composedRefs,
|
|
15859
|
-
style: {
|
|
15860
|
-
...contentProps.style,
|
|
15861
|
-
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
15862
|
-
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
15863
|
-
animation: !isPlaced ? 'none' : undefined,
|
|
15864
|
-
// hide the content if using the hide middleware and should be hidden
|
|
15865
|
-
opacity: (_middlewareData$hide = middlewareData.hide) !== null && _middlewareData$hide !== void 0 && _middlewareData$hide.referenceHidden ? 0 : undefined
|
|
15866
|
-
}
|
|
15867
|
-
};
|
|
15868
|
-
return /*#__PURE__*/ createElement("div", {
|
|
15869
|
-
ref: floating,
|
|
15870
|
-
"data-radix-popper-content-wrapper": "",
|
|
15871
|
-
style: {
|
|
15872
|
-
position: strategy,
|
|
15873
|
-
left: 0,
|
|
15874
|
-
top: 0,
|
|
15875
|
-
transform: isPlaced ? `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)` : 'translate3d(0, -200%, 0)',
|
|
15876
|
-
// keep off the page when measuring
|
|
15877
|
-
minWidth: 'max-content',
|
|
15878
|
-
zIndex: contentZIndex,
|
|
15879
|
-
['--radix-popper-transform-origin']: [
|
|
15880
|
-
(_middlewareData$trans = middlewareData.transformOrigin) === null || _middlewareData$trans === void 0 ? void 0 : _middlewareData$trans.x,
|
|
15881
|
-
(_middlewareData$trans2 = middlewareData.transformOrigin) === null || _middlewareData$trans2 === void 0 ? void 0 : _middlewareData$trans2.y
|
|
15882
|
-
].join(' ')
|
|
15883
|
-
} // Floating UI interally calculates logical alignment based the `dir` attribute on
|
|
15884
|
-
,
|
|
15885
|
-
dir: props.dir
|
|
15886
|
-
}, /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$var$PopperContentProvider, {
|
|
15887
|
-
scope: __scopePopper,
|
|
15888
|
-
placedSide: placedSide,
|
|
15889
|
-
onArrowChange: setArrow,
|
|
15890
|
-
arrowX: arrowX,
|
|
15891
|
-
arrowY: arrowY,
|
|
15892
|
-
shouldHideArrow: cannotCenterArrow
|
|
15893
|
-
}, isRoot ? /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$var$PositionContextProvider, {
|
|
15894
|
-
scope: __scopePopper,
|
|
15895
|
-
hasParent: true,
|
|
15896
|
-
positionUpdateFns: positionUpdateFns
|
|
15897
|
-
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, commonProps)) : /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, commonProps)));
|
|
15898
|
-
});
|
|
15899
|
-
/* -------------------------------------------------------------------------------------------------
|
|
15900
|
-
* PopperArrow
|
|
15901
|
-
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ARROW_NAME = 'PopperArrow';
|
|
15902
|
-
const $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE = {
|
|
15903
|
-
top: 'bottom',
|
|
15904
|
-
right: 'left',
|
|
15905
|
-
bottom: 'top',
|
|
15906
|
-
left: 'right'
|
|
15907
|
-
};
|
|
15908
|
-
const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0 = /*#__PURE__*/ forwardRef(function $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0(props, forwardedRef) {
|
|
15909
|
-
const { __scopePopper: __scopePopper , ...arrowProps } = props;
|
|
15910
|
-
const contentContext = $cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME, __scopePopper);
|
|
15911
|
-
const baseSide = $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE[contentContext.placedSide];
|
|
15912
|
-
return(/*#__PURE__*/ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
15913
|
-
// doesn't report size as we'd expect on SVG elements.
|
|
15914
|
-
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
15915
|
-
createElement("span", {
|
|
15916
|
-
ref: contentContext.onArrowChange,
|
|
15917
|
-
style: {
|
|
15918
|
-
position: 'absolute',
|
|
15919
|
-
left: contentContext.arrowX,
|
|
15920
|
-
top: contentContext.arrowY,
|
|
15921
|
-
[baseSide]: 0,
|
|
15922
|
-
transformOrigin: {
|
|
15923
|
-
top: '',
|
|
15924
|
-
right: '0 0',
|
|
15925
|
-
bottom: 'center 0',
|
|
15926
|
-
left: '100% 0'
|
|
15927
|
-
}[contentContext.placedSide],
|
|
15928
|
-
transform: {
|
|
15929
|
-
top: 'translateY(100%)',
|
|
15930
|
-
right: 'translateY(50%) rotate(90deg) translateX(-50%)',
|
|
15931
|
-
bottom: `rotate(180deg)`,
|
|
15932
|
-
left: 'translateY(50%) rotate(-90deg) translateX(50%)'
|
|
15933
|
-
}[contentContext.placedSide],
|
|
15934
|
-
visibility: contentContext.shouldHideArrow ? 'hidden' : undefined
|
|
15935
|
-
}
|
|
15936
|
-
}, /*#__PURE__*/ createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9, _extends({}, arrowProps, {
|
|
15937
|
-
ref: forwardedRef,
|
|
15938
|
-
style: {
|
|
15939
|
-
...arrowProps.style,
|
|
15940
|
-
// ensures the element can be measured correctly (mostly for if SVG)
|
|
15941
|
-
display: 'block'
|
|
15942
|
-
}
|
|
15943
|
-
}))));
|
|
15944
|
-
});
|
|
15945
|
-
/* -----------------------------------------------------------------------------------------------*/ function $cf1ac5d9fe0e8206$var$isDefined(value) {
|
|
15946
|
-
return value !== undefined;
|
|
15947
|
-
}
|
|
15948
|
-
function $cf1ac5d9fe0e8206$var$isNotNull(value) {
|
|
15949
|
-
return value !== null;
|
|
15950
|
-
}
|
|
15951
|
-
const $cf1ac5d9fe0e8206$var$anchorCssProperties = ()=>({
|
|
15952
|
-
name: 'anchorCssProperties',
|
|
15953
|
-
fn (data) {
|
|
15954
|
-
const { rects: rects , elements: elements } = data;
|
|
15955
|
-
const { width: width , height: height } = rects.reference;
|
|
15956
|
-
elements.floating.style.setProperty('--radix-popper-anchor-width', `${width}px`);
|
|
15957
|
-
elements.floating.style.setProperty('--radix-popper-anchor-height', `${height}px`);
|
|
15958
|
-
return {};
|
|
15959
|
-
}
|
|
15960
|
-
})
|
|
15961
|
-
;
|
|
15962
|
-
const $cf1ac5d9fe0e8206$var$transformOrigin = (options)=>({
|
|
15963
|
-
name: 'transformOrigin',
|
|
15964
|
-
options: options,
|
|
15965
|
-
fn (data) {
|
|
15966
|
-
var _middlewareData$arrow4, _middlewareData$arrow5, _middlewareData$arrow6, _middlewareData$arrow7, _middlewareData$arrow8;
|
|
15967
|
-
const { placement: placement , rects: rects , middlewareData: middlewareData } = data;
|
|
15968
|
-
const cannotCenterArrow = ((_middlewareData$arrow4 = middlewareData.arrow) === null || _middlewareData$arrow4 === void 0 ? void 0 : _middlewareData$arrow4.centerOffset) !== 0;
|
|
15969
|
-
const isArrowHidden = cannotCenterArrow;
|
|
15970
|
-
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
15971
|
-
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
15972
|
-
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
15973
|
-
const noArrowAlign = {
|
|
15974
|
-
start: '0%',
|
|
15975
|
-
center: '50%',
|
|
15976
|
-
end: '100%'
|
|
15977
|
-
}[placedAlign];
|
|
15978
|
-
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;
|
|
15979
|
-
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;
|
|
15980
|
-
let x = '';
|
|
15981
|
-
let y = '';
|
|
15982
|
-
if (placedSide === 'bottom') {
|
|
15983
|
-
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
15984
|
-
y = `${-arrowHeight}px`;
|
|
15985
|
-
} else if (placedSide === 'top') {
|
|
15986
|
-
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
15987
|
-
y = `${rects.floating.height + arrowHeight}px`;
|
|
15988
|
-
} else if (placedSide === 'right') {
|
|
15989
|
-
x = `${-arrowHeight}px`;
|
|
15990
|
-
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
15991
|
-
} else if (placedSide === 'left') {
|
|
15992
|
-
x = `${rects.floating.width + arrowHeight}px`;
|
|
15993
|
-
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
15994
|
-
}
|
|
15995
|
-
return {
|
|
15996
|
-
data: {
|
|
15997
|
-
x: x,
|
|
15998
|
-
y: y
|
|
15999
|
-
}
|
|
16000
|
-
};
|
|
16001
|
-
}
|
|
16002
|
-
})
|
|
16003
|
-
;
|
|
16004
|
-
function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement) {
|
|
16005
|
-
const [side, align = 'center'] = placement.split('-');
|
|
16006
|
-
return [
|
|
16007
|
-
side,
|
|
16008
|
-
align
|
|
16009
|
-
];
|
|
16010
|
-
}
|
|
16011
|
-
const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9;
|
|
16012
|
-
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
|
|
16013
|
-
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
|
|
16014
|
-
const $cf1ac5d9fe0e8206$export$21b07c8f274aebd5 = $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0;
|
|
16015
|
-
|
|
16016
|
-
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
16017
|
-
var _globalThis$document;
|
|
16018
|
-
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;
|
|
16019
|
-
return container ? /*#__PURE__*/ ReactDOM__default.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
|
16020
|
-
ref: forwardedRef
|
|
16021
|
-
})), container) : null;
|
|
16022
|
-
});
|
|
16023
|
-
|
|
16024
|
-
function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
|
|
16025
|
-
return useReducer((state, event)=>{
|
|
16026
|
-
const nextState = machine[state][event];
|
|
16027
|
-
return nextState !== null && nextState !== void 0 ? nextState : state;
|
|
16028
|
-
}, initialState);
|
|
16029
|
-
}
|
|
16030
|
-
|
|
16031
|
-
|
|
16032
|
-
const $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props)=>{
|
|
16033
|
-
const { present: present , children: children } = props;
|
|
16034
|
-
const presence = $921a889cee6df7e8$var$usePresence(present);
|
|
16035
|
-
const child = typeof children === 'function' ? children({
|
|
16036
|
-
present: presence.isPresent
|
|
16037
|
-
}) : Children.only(children);
|
|
16038
|
-
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
|
|
16039
|
-
const forceMount = typeof children === 'function';
|
|
16040
|
-
return forceMount || presence.isPresent ? /*#__PURE__*/ cloneElement(child, {
|
|
16041
|
-
ref: ref
|
|
16042
|
-
}) : null;
|
|
16043
|
-
};
|
|
16044
|
-
$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
|
|
16045
|
-
/* -------------------------------------------------------------------------------------------------
|
|
16046
|
-
* usePresence
|
|
16047
|
-
* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence(present) {
|
|
16048
|
-
const [node1, setNode] = useState();
|
|
16049
|
-
const stylesRef = useRef({});
|
|
16050
|
-
const prevPresentRef = useRef(present);
|
|
16051
|
-
const prevAnimationNameRef = useRef('none');
|
|
16052
|
-
const initialState = present ? 'mounted' : 'unmounted';
|
|
16053
|
-
const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
|
|
16054
|
-
mounted: {
|
|
16055
|
-
UNMOUNT: 'unmounted',
|
|
16056
|
-
ANIMATION_OUT: 'unmountSuspended'
|
|
16057
|
-
},
|
|
16058
|
-
unmountSuspended: {
|
|
16059
|
-
MOUNT: 'mounted',
|
|
16060
|
-
ANIMATION_END: 'unmounted'
|
|
16061
|
-
},
|
|
16062
|
-
unmounted: {
|
|
16063
|
-
MOUNT: 'mounted'
|
|
16064
|
-
}
|
|
16065
|
-
});
|
|
16066
|
-
useEffect(()=>{
|
|
16067
|
-
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
16068
|
-
prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';
|
|
16069
|
-
}, [
|
|
16070
|
-
state
|
|
16071
|
-
]);
|
|
16072
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
16073
|
-
const styles = stylesRef.current;
|
|
16074
|
-
const wasPresent = prevPresentRef.current;
|
|
16075
|
-
const hasPresentChanged = wasPresent !== present;
|
|
16076
|
-
if (hasPresentChanged) {
|
|
16077
|
-
const prevAnimationName = prevAnimationNameRef.current;
|
|
16078
|
-
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
|
|
16079
|
-
if (present) send('MOUNT');
|
|
16080
|
-
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
|
|
16081
|
-
// so we unmount instantly
|
|
16082
|
-
send('UNMOUNT');
|
|
16083
|
-
else {
|
|
16084
|
-
/**
|
|
16085
|
-
* When `present` changes to `false`, we check changes to animation-name to
|
|
16086
|
-
* determine whether an animation has started. We chose this approach (reading
|
|
16087
|
-
* computed styles) because there is no `animationrun` event and `animationstart`
|
|
16088
|
-
* fires after `animation-delay` has expired which would be too late.
|
|
16089
|
-
*/ const isAnimating = prevAnimationName !== currentAnimationName;
|
|
16090
|
-
if (wasPresent && isAnimating) send('ANIMATION_OUT');
|
|
16091
|
-
else send('UNMOUNT');
|
|
16092
|
-
}
|
|
16093
|
-
prevPresentRef.current = present;
|
|
16094
|
-
}
|
|
16095
|
-
}, [
|
|
16096
|
-
present,
|
|
16097
|
-
send
|
|
16098
|
-
]);
|
|
16099
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
16100
|
-
if (node1) {
|
|
16101
|
-
/**
|
|
16102
|
-
* Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`
|
|
16103
|
-
* event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we
|
|
16104
|
-
* make sure we only trigger ANIMATION_END for the currently active animation.
|
|
16105
|
-
*/ const handleAnimationEnd = (event)=>{
|
|
16106
|
-
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
16107
|
-
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
16108
|
-
if (event.target === node1 && isCurrentAnimation) // With React 18 concurrency this update is applied
|
|
16109
|
-
// a frame after the animation ends, creating a flash of visible content.
|
|
16110
|
-
// By manually flushing we ensure they sync within a frame, removing the flash.
|
|
16111
|
-
flushSync(()=>send('ANIMATION_END')
|
|
16112
|
-
);
|
|
16113
|
-
};
|
|
16114
|
-
const handleAnimationStart = (event)=>{
|
|
16115
|
-
if (event.target === node1) // if animation occurred, store its name as the previous animation.
|
|
16116
|
-
prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
16117
|
-
};
|
|
16118
|
-
node1.addEventListener('animationstart', handleAnimationStart);
|
|
16119
|
-
node1.addEventListener('animationcancel', handleAnimationEnd);
|
|
16120
|
-
node1.addEventListener('animationend', handleAnimationEnd);
|
|
16121
|
-
return ()=>{
|
|
16122
|
-
node1.removeEventListener('animationstart', handleAnimationStart);
|
|
16123
|
-
node1.removeEventListener('animationcancel', handleAnimationEnd);
|
|
16124
|
-
node1.removeEventListener('animationend', handleAnimationEnd);
|
|
16125
|
-
};
|
|
16126
|
-
} else // Transition to the unmounted state if the node is removed prematurely.
|
|
16127
|
-
// We avoid doing so during cleanup as the node may change but still exist.
|
|
16128
|
-
send('ANIMATION_END');
|
|
16129
|
-
}, [
|
|
16130
|
-
node1,
|
|
16131
|
-
send
|
|
16132
|
-
]);
|
|
16133
|
-
return {
|
|
16134
|
-
isPresent: [
|
|
16135
|
-
'mounted',
|
|
16136
|
-
'unmountSuspended'
|
|
16137
|
-
].includes(state),
|
|
16138
|
-
ref: useCallback((node)=>{
|
|
16139
|
-
if (node) stylesRef.current = getComputedStyle(node);
|
|
16140
|
-
setNode(node);
|
|
16141
|
-
}, [])
|
|
16142
|
-
};
|
|
16143
|
-
}
|
|
16144
|
-
/* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName(styles) {
|
|
16145
|
-
return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none';
|
|
16146
|
-
}
|
|
16147
|
-
|
|
16148
|
-
/**
|
|
16149
|
-
* Listens for when the escape key is down
|
|
16150
|
-
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
16151
|
-
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
16152
|
-
useEffect(()=>{
|
|
16153
|
-
const handleKeyDown = (event)=>{
|
|
16154
|
-
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
16155
|
-
};
|
|
16156
|
-
ownerDocument.addEventListener('keydown', handleKeyDown);
|
|
16157
|
-
return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
|
|
16158
|
-
;
|
|
16159
|
-
}, [
|
|
16160
|
-
onEscapeKeyDown,
|
|
16161
|
-
ownerDocument
|
|
16162
|
-
]);
|
|
16163
|
-
}
|
|
16164
|
-
|
|
16165
|
-
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
16166
|
-
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
16167
|
-
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
16168
|
-
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
16169
|
-
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ createContext({
|
|
16170
|
-
layers: new Set(),
|
|
16171
|
-
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
16172
|
-
branches: new Set()
|
|
16173
|
-
});
|
|
16174
|
-
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
16175
|
-
var _node$ownerDocument;
|
|
16176
|
-
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
16177
|
-
const context = useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
16178
|
-
const [node1, setNode] = useState(null);
|
|
16179
|
-
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;
|
|
16180
|
-
const [, force] = useState({});
|
|
16181
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
16182
|
-
);
|
|
16183
|
-
const layers = Array.from(context.layers);
|
|
16184
|
-
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
16185
|
-
...context.layersWithOutsidePointerEventsDisabled
|
|
16186
|
-
].slice(-1); // prettier-ignore
|
|
16187
|
-
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
|
|
16188
|
-
const index = node1 ? layers.indexOf(node1) : -1;
|
|
16189
|
-
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
16190
|
-
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
16191
|
-
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
16192
|
-
const target = event.target;
|
|
16193
|
-
const isPointerDownOnBranch = [
|
|
16194
|
-
...context.branches
|
|
16195
|
-
].some((branch)=>branch.contains(target)
|
|
16196
|
-
);
|
|
16197
|
-
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
16198
|
-
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
|
|
16199
|
-
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
16200
|
-
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
16201
|
-
}, ownerDocument);
|
|
16202
|
-
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
|
|
16203
|
-
const target = event.target;
|
|
16204
|
-
const isFocusInBranch = [
|
|
16205
|
-
...context.branches
|
|
16206
|
-
].some((branch)=>branch.contains(target)
|
|
16207
|
-
);
|
|
16208
|
-
if (isFocusInBranch) return;
|
|
16209
|
-
onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
|
|
16210
|
-
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
16211
|
-
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
16212
|
-
}, ownerDocument);
|
|
16213
|
-
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
16214
|
-
const isHighestLayer = index === context.layers.size - 1;
|
|
16215
|
-
if (!isHighestLayer) return;
|
|
16216
|
-
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
16217
|
-
if (!event.defaultPrevented && onDismiss) {
|
|
16218
|
-
event.preventDefault();
|
|
16219
|
-
onDismiss();
|
|
16220
|
-
}
|
|
16221
|
-
}, ownerDocument);
|
|
16222
|
-
useEffect(()=>{
|
|
16223
|
-
if (!node1) return;
|
|
16224
|
-
if (disableOutsidePointerEvents) {
|
|
16225
|
-
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
16226
|
-
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
16227
|
-
ownerDocument.body.style.pointerEvents = 'none';
|
|
16228
|
-
}
|
|
16229
|
-
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
16230
|
-
}
|
|
16231
|
-
context.layers.add(node1);
|
|
16232
|
-
$5cb92bef7577960e$var$dispatchUpdate();
|
|
16233
|
-
return ()=>{
|
|
16234
|
-
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
16235
|
-
};
|
|
16236
|
-
}, [
|
|
16237
|
-
node1,
|
|
16238
|
-
ownerDocument,
|
|
16239
|
-
disableOutsidePointerEvents,
|
|
16240
|
-
context
|
|
16241
|
-
]);
|
|
16242
|
-
/**
|
|
16243
|
-
* We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
|
|
16244
|
-
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
|
|
16245
|
-
* and add it to the end again so the layering order wouldn't be _creation order_.
|
|
16246
|
-
* We only want them to be removed from context stacks when unmounted.
|
|
16247
|
-
*/ useEffect(()=>{
|
|
16248
|
-
return ()=>{
|
|
16249
|
-
if (!node1) return;
|
|
16250
|
-
context.layers.delete(node1);
|
|
16251
|
-
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
16252
|
-
$5cb92bef7577960e$var$dispatchUpdate();
|
|
16253
|
-
};
|
|
16254
|
-
}, [
|
|
16255
|
-
node1,
|
|
16256
|
-
context
|
|
16257
|
-
]);
|
|
16258
|
-
useEffect(()=>{
|
|
16259
|
-
const handleUpdate = ()=>force({})
|
|
16260
|
-
;
|
|
16261
|
-
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
16262
|
-
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
16263
|
-
;
|
|
16264
|
-
}, []);
|
|
16265
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
|
|
16266
|
-
ref: composedRefs,
|
|
16267
|
-
style: {
|
|
16268
|
-
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
16269
|
-
...props.style
|
|
16270
|
-
},
|
|
16271
|
-
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
16272
|
-
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
16273
|
-
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
16274
|
-
}));
|
|
16275
|
-
});
|
|
16276
|
-
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
16277
|
-
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
16278
|
-
* to mimic layer dismissing behaviour present in OS.
|
|
16279
|
-
* Returns props to pass to the node we want to check for outside events.
|
|
16280
|
-
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
16281
|
-
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
16282
|
-
const isPointerInsideReactTreeRef = useRef(false);
|
|
16283
|
-
const handleClickRef = useRef(()=>{});
|
|
16284
|
-
useEffect(()=>{
|
|
16285
|
-
const handlePointerDown = (event)=>{
|
|
16286
|
-
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
16287
|
-
const eventDetail = {
|
|
16288
|
-
originalEvent: event
|
|
16289
|
-
};
|
|
16290
|
-
function handleAndDispatchPointerDownOutsideEvent() {
|
|
16291
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
16292
|
-
discrete: true
|
|
16293
|
-
});
|
|
16294
|
-
}
|
|
16295
|
-
/**
|
|
16296
|
-
* On touch devices, we need to wait for a click event because browsers implement
|
|
16297
|
-
* a ~350ms delay between the time the user stops touching the display and when the
|
|
16298
|
-
* browser executres events. We need to ensure we don't reactivate pointer-events within
|
|
16299
|
-
* this timeframe otherwise the browser may execute events that should have been prevented.
|
|
16300
|
-
*
|
|
16301
|
-
* Additionally, this also lets us deal automatically with cancellations when a click event
|
|
16302
|
-
* isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
|
|
16303
|
-
*
|
|
16304
|
-
* This is why we also continuously remove the previous listener, because we cannot be
|
|
16305
|
-
* certain that it was raised, and therefore cleaned-up.
|
|
16306
|
-
*/ if (event.pointerType === 'touch') {
|
|
16307
|
-
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
16308
|
-
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
|
|
16309
|
-
ownerDocument.addEventListener('click', handleClickRef.current, {
|
|
16310
|
-
once: true
|
|
16311
|
-
});
|
|
16312
|
-
} else handleAndDispatchPointerDownOutsideEvent();
|
|
16313
|
-
}
|
|
16314
|
-
isPointerInsideReactTreeRef.current = false;
|
|
16315
|
-
};
|
|
16316
|
-
/**
|
|
16317
|
-
* if this hook executes in a component that mounts via a `pointerdown` event, the event
|
|
16318
|
-
* would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
|
|
16319
|
-
* this by delaying the event listener registration on the document.
|
|
16320
|
-
* This is not React specific, but rather how the DOM works, ie:
|
|
16321
|
-
* ```
|
|
16322
|
-
* button.addEventListener('pointerdown', () => {
|
|
16323
|
-
* console.log('I will log');
|
|
16324
|
-
* document.addEventListener('pointerdown', () => {
|
|
16325
|
-
* console.log('I will also log');
|
|
16326
|
-
* })
|
|
16327
|
-
* });
|
|
16328
|
-
*/ const timerId = window.setTimeout(()=>{
|
|
16329
|
-
ownerDocument.addEventListener('pointerdown', handlePointerDown);
|
|
16330
|
-
}, 0);
|
|
16331
|
-
return ()=>{
|
|
16332
|
-
window.clearTimeout(timerId);
|
|
16333
|
-
ownerDocument.removeEventListener('pointerdown', handlePointerDown);
|
|
16334
|
-
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
16335
|
-
};
|
|
16336
|
-
}, [
|
|
16337
|
-
ownerDocument,
|
|
16338
|
-
handlePointerDownOutside
|
|
16339
|
-
]);
|
|
16340
|
-
return {
|
|
16341
|
-
// ensures we check React component tree (not just DOM tree)
|
|
16342
|
-
onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
|
|
16343
|
-
};
|
|
16344
|
-
}
|
|
16345
|
-
/**
|
|
16346
|
-
* Listens for when focus happens outside a react subtree.
|
|
16347
|
-
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
16348
|
-
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
16349
|
-
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
16350
|
-
const isFocusInsideReactTreeRef = useRef(false);
|
|
16351
|
-
useEffect(()=>{
|
|
16352
|
-
const handleFocus = (event)=>{
|
|
16353
|
-
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
16354
|
-
const eventDetail = {
|
|
16355
|
-
originalEvent: event
|
|
16356
|
-
};
|
|
16357
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
16358
|
-
discrete: false
|
|
16359
|
-
});
|
|
16360
|
-
}
|
|
16361
|
-
};
|
|
16362
|
-
ownerDocument.addEventListener('focusin', handleFocus);
|
|
16363
|
-
return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
|
|
16364
|
-
;
|
|
16365
|
-
}, [
|
|
16366
|
-
ownerDocument,
|
|
16367
|
-
handleFocusOutside
|
|
16368
|
-
]);
|
|
16369
|
-
return {
|
|
16370
|
-
onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
|
|
16371
|
-
,
|
|
16372
|
-
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
|
|
16373
|
-
};
|
|
16374
|
-
}
|
|
16375
|
-
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
16376
|
-
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
16377
|
-
document.dispatchEvent(event);
|
|
16378
|
-
}
|
|
16379
|
-
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
16380
|
-
const target = detail.originalEvent.target;
|
|
16381
|
-
const event = new CustomEvent(name, {
|
|
16382
|
-
bubbles: false,
|
|
16383
|
-
cancelable: true,
|
|
16384
|
-
detail: detail
|
|
16385
|
-
});
|
|
16386
|
-
if (handler) target.addEventListener(name, handler, {
|
|
16387
|
-
once: true
|
|
16388
|
-
});
|
|
16389
|
-
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
16390
|
-
else target.dispatchEvent(event);
|
|
16391
|
-
}
|
|
16392
|
-
|
|
16393
|
-
/* -------------------------------------------------------------------------------------------------
|
|
16394
|
-
* HoverCard
|
|
16395
|
-
* -----------------------------------------------------------------------------------------------*/ let $cef8881cdc69808e$var$originalBodyUserSelect;
|
|
16396
|
-
const $cef8881cdc69808e$var$HOVERCARD_NAME = 'HoverCard';
|
|
16397
|
-
const [$cef8881cdc69808e$var$createHoverCardContext, $cef8881cdc69808e$export$47b6998a836b7260] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cef8881cdc69808e$var$HOVERCARD_NAME, [
|
|
16398
|
-
$cf1ac5d9fe0e8206$export$722aac194ae923
|
|
16399
|
-
]);
|
|
16400
|
-
const $cef8881cdc69808e$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923();
|
|
16401
|
-
const [$cef8881cdc69808e$var$HoverCardProvider, $cef8881cdc69808e$var$useHoverCardContext] = $cef8881cdc69808e$var$createHoverCardContext($cef8881cdc69808e$var$HOVERCARD_NAME);
|
|
16402
|
-
const $cef8881cdc69808e$export$57a077cc9fbe653e = (props)=>{
|
|
16403
|
-
const { __scopeHoverCard: __scopeHoverCard , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , openDelay: openDelay = 700 , closeDelay: closeDelay = 300 } = props;
|
|
16404
|
-
const popperScope = $cef8881cdc69808e$var$usePopperScope(__scopeHoverCard);
|
|
16405
|
-
const openTimerRef = useRef(0);
|
|
16406
|
-
const closeTimerRef = useRef(0);
|
|
16407
|
-
const hasSelectionRef = useRef(false);
|
|
16408
|
-
const isPointerDownOnContentRef = useRef(false);
|
|
16409
|
-
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
16410
|
-
prop: openProp,
|
|
16411
|
-
defaultProp: defaultOpen,
|
|
16412
|
-
onChange: onOpenChange
|
|
16413
|
-
});
|
|
16414
|
-
const handleOpen = useCallback(()=>{
|
|
16415
|
-
clearTimeout(closeTimerRef.current);
|
|
16416
|
-
openTimerRef.current = window.setTimeout(()=>setOpen(true)
|
|
16417
|
-
, openDelay);
|
|
16418
|
-
}, [
|
|
16419
|
-
openDelay,
|
|
16420
|
-
setOpen
|
|
16421
|
-
]);
|
|
16422
|
-
const handleClose = useCallback(()=>{
|
|
16423
|
-
clearTimeout(openTimerRef.current);
|
|
16424
|
-
if (!hasSelectionRef.current && !isPointerDownOnContentRef.current) closeTimerRef.current = window.setTimeout(()=>setOpen(false)
|
|
16425
|
-
, closeDelay);
|
|
16426
|
-
}, [
|
|
16427
|
-
closeDelay,
|
|
16428
|
-
setOpen
|
|
16429
|
-
]);
|
|
16430
|
-
const handleDismiss = useCallback(()=>setOpen(false)
|
|
16431
|
-
, [
|
|
16432
|
-
setOpen
|
|
16433
|
-
]); // cleanup any queued state updates on unmount
|
|
16434
|
-
useEffect(()=>{
|
|
16435
|
-
return ()=>{
|
|
16436
|
-
clearTimeout(openTimerRef.current);
|
|
16437
|
-
clearTimeout(closeTimerRef.current);
|
|
16438
|
-
};
|
|
16439
|
-
}, []);
|
|
16440
|
-
return /*#__PURE__*/ createElement($cef8881cdc69808e$var$HoverCardProvider, {
|
|
16441
|
-
scope: __scopeHoverCard,
|
|
16442
|
-
open: open,
|
|
16443
|
-
onOpenChange: setOpen,
|
|
16444
|
-
onOpen: handleOpen,
|
|
16445
|
-
onClose: handleClose,
|
|
16446
|
-
onDismiss: handleDismiss,
|
|
16447
|
-
hasSelectionRef: hasSelectionRef,
|
|
16448
|
-
isPointerDownOnContentRef: isPointerDownOnContentRef
|
|
16449
|
-
}, /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, children));
|
|
16450
|
-
};
|
|
16451
|
-
/* -------------------------------------------------------------------------------------------------
|
|
16452
|
-
* HoverCardTrigger
|
|
16453
|
-
* -----------------------------------------------------------------------------------------------*/ const $cef8881cdc69808e$var$TRIGGER_NAME = 'HoverCardTrigger';
|
|
16454
|
-
const $cef8881cdc69808e$export$ef9f7fd8e4ba882f = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
16455
|
-
const { __scopeHoverCard: __scopeHoverCard , ...triggerProps } = props;
|
|
16456
|
-
const context = $cef8881cdc69808e$var$useHoverCardContext($cef8881cdc69808e$var$TRIGGER_NAME, __scopeHoverCard);
|
|
16457
|
-
const popperScope = $cef8881cdc69808e$var$usePopperScope(__scopeHoverCard);
|
|
16458
|
-
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({
|
|
16459
|
-
asChild: true
|
|
16460
|
-
}, popperScope), /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.a, _extends({
|
|
16461
|
-
"data-state": context.open ? 'open' : 'closed'
|
|
16462
|
-
}, triggerProps, {
|
|
16463
|
-
ref: forwardedRef,
|
|
16464
|
-
onPointerEnter: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerEnter, $cef8881cdc69808e$var$excludeTouch(context.onOpen)),
|
|
16465
|
-
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerLeave, $cef8881cdc69808e$var$excludeTouch(context.onClose)),
|
|
16466
|
-
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, context.onOpen),
|
|
16467
|
-
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, context.onClose) // prevent focus event on touch devices
|
|
16468
|
-
,
|
|
16469
|
-
onTouchStart: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onTouchStart, (event)=>event.preventDefault()
|
|
16470
|
-
)
|
|
16471
|
-
})));
|
|
16472
|
-
});
|
|
16473
|
-
/* -------------------------------------------------------------------------------------------------
|
|
16474
|
-
* HoverCardPortal
|
|
16475
|
-
* -----------------------------------------------------------------------------------------------*/ const $cef8881cdc69808e$var$PORTAL_NAME = 'HoverCardPortal';
|
|
16476
|
-
const [$cef8881cdc69808e$var$PortalProvider, $cef8881cdc69808e$var$usePortalContext] = $cef8881cdc69808e$var$createHoverCardContext($cef8881cdc69808e$var$PORTAL_NAME, {
|
|
16477
|
-
forceMount: undefined
|
|
16478
|
-
});
|
|
16479
|
-
const $cef8881cdc69808e$export$b384c6e0a789f88b = (props)=>{
|
|
16480
|
-
const { __scopeHoverCard: __scopeHoverCard , forceMount: forceMount , children: children , container: container } = props;
|
|
16481
|
-
const context = $cef8881cdc69808e$var$useHoverCardContext($cef8881cdc69808e$var$PORTAL_NAME, __scopeHoverCard);
|
|
16482
|
-
return /*#__PURE__*/ createElement($cef8881cdc69808e$var$PortalProvider, {
|
|
16483
|
-
scope: __scopeHoverCard,
|
|
16484
|
-
forceMount: forceMount
|
|
16485
|
-
}, /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
16486
|
-
present: forceMount || context.open
|
|
16487
|
-
}, /*#__PURE__*/ createElement($f1701beae083dbae$export$602eac185826482c, {
|
|
16488
|
-
asChild: true,
|
|
16489
|
-
container: container
|
|
16490
|
-
}, children)));
|
|
16491
|
-
};
|
|
16492
|
-
/* -------------------------------------------------------------------------------------------------
|
|
16493
|
-
* HoverCardContent
|
|
16494
|
-
* -----------------------------------------------------------------------------------------------*/ const $cef8881cdc69808e$var$CONTENT_NAME = 'HoverCardContent';
|
|
16495
|
-
const $cef8881cdc69808e$export$aa4724a5938c586 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
16496
|
-
const portalContext = $cef8881cdc69808e$var$usePortalContext($cef8881cdc69808e$var$CONTENT_NAME, props.__scopeHoverCard);
|
|
16497
|
-
const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
|
|
16498
|
-
const context = $cef8881cdc69808e$var$useHoverCardContext($cef8881cdc69808e$var$CONTENT_NAME, props.__scopeHoverCard);
|
|
16499
|
-
return /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
16500
|
-
present: forceMount || context.open
|
|
16501
|
-
}, /*#__PURE__*/ createElement($cef8881cdc69808e$var$HoverCardContentImpl, _extends({
|
|
16502
|
-
"data-state": context.open ? 'open' : 'closed'
|
|
16503
|
-
}, contentProps, {
|
|
16504
|
-
onPointerEnter: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerEnter, $cef8881cdc69808e$var$excludeTouch(context.onOpen)),
|
|
16505
|
-
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerLeave, $cef8881cdc69808e$var$excludeTouch(context.onClose)),
|
|
16506
|
-
ref: forwardedRef
|
|
16507
|
-
})));
|
|
16508
|
-
});
|
|
16509
|
-
/* ---------------------------------------------------------------------------------------------- */ const $cef8881cdc69808e$var$HoverCardContentImpl = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
16510
|
-
const { __scopeHoverCard: __scopeHoverCard , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , ...contentProps } = props;
|
|
16511
|
-
const context = $cef8881cdc69808e$var$useHoverCardContext($cef8881cdc69808e$var$CONTENT_NAME, __scopeHoverCard);
|
|
16512
|
-
const popperScope = $cef8881cdc69808e$var$usePopperScope(__scopeHoverCard);
|
|
16513
|
-
const ref = useRef(null);
|
|
16514
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
16515
|
-
const [containSelection, setContainSelection] = useState(false);
|
|
16516
|
-
useEffect(()=>{
|
|
16517
|
-
if (containSelection) {
|
|
16518
|
-
const body = document.body; // Safari requires prefix
|
|
16519
|
-
$cef8881cdc69808e$var$originalBodyUserSelect = body.style.userSelect || body.style.webkitUserSelect;
|
|
16520
|
-
body.style.userSelect = 'none';
|
|
16521
|
-
body.style.webkitUserSelect = 'none';
|
|
16522
|
-
return ()=>{
|
|
16523
|
-
body.style.userSelect = $cef8881cdc69808e$var$originalBodyUserSelect;
|
|
16524
|
-
body.style.webkitUserSelect = $cef8881cdc69808e$var$originalBodyUserSelect;
|
|
16525
|
-
};
|
|
16526
|
-
}
|
|
16527
|
-
}, [
|
|
16528
|
-
containSelection
|
|
16529
|
-
]);
|
|
16530
|
-
useEffect(()=>{
|
|
16531
|
-
if (ref.current) {
|
|
16532
|
-
const handlePointerUp = ()=>{
|
|
16533
|
-
setContainSelection(false);
|
|
16534
|
-
context.isPointerDownOnContentRef.current = false; // Delay a frame to ensure we always access the latest selection
|
|
16535
|
-
setTimeout(()=>{
|
|
16536
|
-
var _document$getSelectio;
|
|
16537
|
-
const hasSelection = ((_document$getSelectio = document.getSelection()) === null || _document$getSelectio === void 0 ? void 0 : _document$getSelectio.toString()) !== '';
|
|
16538
|
-
if (hasSelection) context.hasSelectionRef.current = true;
|
|
16539
|
-
});
|
|
16540
|
-
};
|
|
16541
|
-
document.addEventListener('pointerup', handlePointerUp);
|
|
16542
|
-
return ()=>{
|
|
16543
|
-
document.removeEventListener('pointerup', handlePointerUp);
|
|
16544
|
-
context.hasSelectionRef.current = false;
|
|
16545
|
-
context.isPointerDownOnContentRef.current = false;
|
|
16546
|
-
};
|
|
16547
|
-
}
|
|
16548
|
-
}, [
|
|
16549
|
-
context.isPointerDownOnContentRef,
|
|
16550
|
-
context.hasSelectionRef
|
|
16551
|
-
]);
|
|
16552
|
-
useEffect(()=>{
|
|
16553
|
-
if (ref.current) {
|
|
16554
|
-
const tabbables = $cef8881cdc69808e$var$getTabbableNodes(ref.current);
|
|
16555
|
-
tabbables.forEach((tabbable)=>tabbable.setAttribute('tabindex', '-1')
|
|
16556
|
-
);
|
|
16557
|
-
}
|
|
16558
|
-
});
|
|
16559
|
-
return /*#__PURE__*/ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, {
|
|
16560
|
-
asChild: true,
|
|
16561
|
-
disableOutsidePointerEvents: false,
|
|
16562
|
-
onInteractOutside: onInteractOutside,
|
|
16563
|
-
onEscapeKeyDown: onEscapeKeyDown,
|
|
16564
|
-
onPointerDownOutside: onPointerDownOutside,
|
|
16565
|
-
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onFocusOutside, (event)=>{
|
|
16566
|
-
event.preventDefault();
|
|
16567
|
-
}),
|
|
16568
|
-
onDismiss: context.onDismiss
|
|
16569
|
-
}, /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({}, popperScope, contentProps, {
|
|
16570
|
-
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onPointerDown, (event)=>{
|
|
16571
|
-
// Contain selection to current layer
|
|
16572
|
-
if (event.currentTarget.contains(event.target)) setContainSelection(true);
|
|
16573
|
-
context.hasSelectionRef.current = false;
|
|
16574
|
-
context.isPointerDownOnContentRef.current = true;
|
|
16575
|
-
}),
|
|
16576
|
-
ref: composedRefs,
|
|
16577
|
-
style: {
|
|
16578
|
-
...contentProps.style,
|
|
16579
|
-
userSelect: containSelection ? 'text' : undefined,
|
|
16580
|
-
// Safari requires prefix
|
|
16581
|
-
WebkitUserSelect: containSelection ? 'text' : undefined,
|
|
16582
|
-
'--radix-hover-card-content-transform-origin': 'var(--radix-popper-transform-origin)',
|
|
16583
|
-
'--radix-hover-card-content-available-width': 'var(--radix-popper-available-width)',
|
|
16584
|
-
'--radix-hover-card-content-available-height': 'var(--radix-popper-available-height)',
|
|
16585
|
-
'--radix-hover-card-trigger-width': 'var(--radix-popper-anchor-width)',
|
|
16586
|
-
'--radix-hover-card-trigger-height': 'var(--radix-popper-anchor-height)'
|
|
16587
|
-
}
|
|
16588
|
-
})));
|
|
16589
|
-
});
|
|
16590
|
-
const $cef8881cdc69808e$export$b9744d3e7456d806 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
16591
|
-
const { __scopeHoverCard: __scopeHoverCard , ...arrowProps } = props;
|
|
16592
|
-
const popperScope = $cef8881cdc69808e$var$usePopperScope(__scopeHoverCard);
|
|
16593
|
-
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5, _extends({}, popperScope, arrowProps, {
|
|
16594
|
-
ref: forwardedRef
|
|
16595
|
-
}));
|
|
16596
|
-
});
|
|
16597
|
-
/* -----------------------------------------------------------------------------------------------*/ function $cef8881cdc69808e$var$excludeTouch(eventHandler) {
|
|
16598
|
-
return (event)=>event.pointerType === 'touch' ? undefined : eventHandler()
|
|
16599
|
-
;
|
|
16600
|
-
}
|
|
16601
|
-
/**
|
|
16602
|
-
* Returns a list of nodes that can be in the tab sequence.
|
|
16603
|
-
* @see: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
|
|
16604
|
-
*/ function $cef8881cdc69808e$var$getTabbableNodes(container) {
|
|
16605
|
-
const nodes = [];
|
|
16606
|
-
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
16607
|
-
acceptNode: (node)=>{
|
|
16608
|
-
// `.tabIndex` is not the same as the `tabindex` attribute. It works on the
|
|
16609
|
-
// runtime's understanding of tabbability, so this automatically accounts
|
|
16610
|
-
// for any kind of element that could be tabbed to.
|
|
16611
|
-
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
16612
|
-
}
|
|
16613
|
-
});
|
|
16614
|
-
while(walker.nextNode())nodes.push(walker.currentNode);
|
|
16615
|
-
return nodes;
|
|
16616
|
-
}
|
|
16617
|
-
const $cef8881cdc69808e$export$be92b6f5f03c0fe9 = $cef8881cdc69808e$export$57a077cc9fbe653e;
|
|
16618
|
-
const $cef8881cdc69808e$export$41fb9f06171c75f4 = $cef8881cdc69808e$export$ef9f7fd8e4ba882f;
|
|
16619
|
-
const $cef8881cdc69808e$export$602eac185826482c = $cef8881cdc69808e$export$b384c6e0a789f88b;
|
|
16620
|
-
const $cef8881cdc69808e$export$7c6e2c02157bb7d2 = $cef8881cdc69808e$export$aa4724a5938c586;
|
|
16621
|
-
const $cef8881cdc69808e$export$21b07c8f274aebd5 = $cef8881cdc69808e$export$b9744d3e7456d806;
|
|
16622
|
-
|
|
16623
|
-
var HoverPrimitive = /*#__PURE__*/Object.freeze({
|
|
16624
|
-
__proto__: null,
|
|
16625
|
-
Arrow: $cef8881cdc69808e$export$21b07c8f274aebd5,
|
|
16626
|
-
Content: $cef8881cdc69808e$export$7c6e2c02157bb7d2,
|
|
16627
|
-
HoverCard: $cef8881cdc69808e$export$57a077cc9fbe653e,
|
|
16628
|
-
HoverCardArrow: $cef8881cdc69808e$export$b9744d3e7456d806,
|
|
16629
|
-
HoverCardContent: $cef8881cdc69808e$export$aa4724a5938c586,
|
|
16630
|
-
HoverCardPortal: $cef8881cdc69808e$export$b384c6e0a789f88b,
|
|
16631
|
-
HoverCardTrigger: $cef8881cdc69808e$export$ef9f7fd8e4ba882f,
|
|
16632
|
-
Portal: $cef8881cdc69808e$export$602eac185826482c,
|
|
16633
|
-
Root: $cef8881cdc69808e$export$be92b6f5f03c0fe9,
|
|
16634
|
-
Trigger: $cef8881cdc69808e$export$41fb9f06171c75f4,
|
|
16635
|
-
createHoverCardScope: $cef8881cdc69808e$export$47b6998a836b7260
|
|
16636
|
-
});
|
|
16637
|
-
|
|
16638
|
-
const bgStyles$1 = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
16639
|
-
const borderStyles$1 = [
|
|
16640
|
-
'tw-border-solid',
|
|
16641
|
-
'tw-border',
|
|
16642
|
-
'tw-rounded-sm',
|
|
16643
|
-
'tw-border-sq-disabled-gray',
|
|
16644
|
-
'dark:tw-border-gray-500',
|
|
16645
|
-
].join(' ');
|
|
16646
|
-
const disabledClasses$1 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
16647
|
-
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 }) => {
|
|
16648
|
-
const tooltipData = getQTipData(tooltipProps);
|
|
16649
|
-
const Primitive = isHoverEnabled ? HoverPrimitive : PopoverPrimitive;
|
|
16650
|
-
return (React.createElement(Primitive.Root, { open: isOpen, defaultOpen: false, onOpenChange: onOpenChange, openDelay: isHoverEnabled ? 300 : undefined, closeDelay: isHoverEnabled ? 200 : undefined },
|
|
16651
|
-
React.createElement(Primitive.Trigger, { id: id, className: `tw-border-none`, disabled: disabled },
|
|
16652
|
-
React.createElement("div", { ...tooltipData, className: `tw-bg-transparent tw-flex tw-flex-col tw-items-center tw-justify-center ${disabled ? disabledClasses$1 : ''} ${extraTriggerClassNames || ''}` }, trigger)),
|
|
16653
|
-
React.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" },
|
|
16654
|
-
React.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
|
|
16655
|
-
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
|
|
16656
|
-
${extraPopoverClassNames || ''}` },
|
|
16657
|
-
hasArrow && (React.createElement(Primitive.Arrow, { asChild: true },
|
|
16658
|
-
React.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" }))),
|
|
16659
|
-
children))));
|
|
16660
|
-
};
|
|
16661
|
-
|
|
16662
|
-
const $6cc32821e9371a1c$var$SELECTION_KEYS = [
|
|
16663
|
-
'Enter',
|
|
16664
|
-
' '
|
|
16665
|
-
];
|
|
16666
|
-
const $6cc32821e9371a1c$var$FIRST_KEYS = [
|
|
16667
|
-
'ArrowDown',
|
|
16668
|
-
'PageUp',
|
|
16669
|
-
'Home'
|
|
16670
|
-
];
|
|
16671
|
-
const $6cc32821e9371a1c$var$LAST_KEYS = [
|
|
16672
|
-
'ArrowUp',
|
|
16673
|
-
'PageDown',
|
|
16674
|
-
'End'
|
|
16675
|
-
];
|
|
16676
|
-
const $6cc32821e9371a1c$var$FIRST_LAST_KEYS = [
|
|
16677
|
-
...$6cc32821e9371a1c$var$FIRST_KEYS,
|
|
16678
|
-
...$6cc32821e9371a1c$var$LAST_KEYS
|
|
16679
|
-
];
|
|
15036
|
+
const $6cc32821e9371a1c$var$SELECTION_KEYS = [
|
|
15037
|
+
'Enter',
|
|
15038
|
+
' '
|
|
15039
|
+
];
|
|
15040
|
+
const $6cc32821e9371a1c$var$FIRST_KEYS = [
|
|
15041
|
+
'ArrowDown',
|
|
15042
|
+
'PageUp',
|
|
15043
|
+
'Home'
|
|
15044
|
+
];
|
|
15045
|
+
const $6cc32821e9371a1c$var$LAST_KEYS = [
|
|
15046
|
+
'ArrowUp',
|
|
15047
|
+
'PageDown',
|
|
15048
|
+
'End'
|
|
15049
|
+
];
|
|
15050
|
+
const $6cc32821e9371a1c$var$FIRST_LAST_KEYS = [
|
|
15051
|
+
...$6cc32821e9371a1c$var$FIRST_KEYS,
|
|
15052
|
+
...$6cc32821e9371a1c$var$LAST_KEYS
|
|
15053
|
+
];
|
|
15054
|
+
const $6cc32821e9371a1c$var$SUB_OPEN_KEYS = {
|
|
15055
|
+
ltr: [
|
|
15056
|
+
...$6cc32821e9371a1c$var$SELECTION_KEYS,
|
|
15057
|
+
'ArrowRight'
|
|
15058
|
+
],
|
|
15059
|
+
rtl: [
|
|
15060
|
+
...$6cc32821e9371a1c$var$SELECTION_KEYS,
|
|
15061
|
+
'ArrowLeft'
|
|
15062
|
+
]
|
|
15063
|
+
};
|
|
15064
|
+
const $6cc32821e9371a1c$var$SUB_CLOSE_KEYS = {
|
|
15065
|
+
ltr: [
|
|
15066
|
+
'ArrowLeft'
|
|
15067
|
+
],
|
|
15068
|
+
rtl: [
|
|
15069
|
+
'ArrowRight'
|
|
15070
|
+
]
|
|
15071
|
+
};
|
|
16680
15072
|
/* -------------------------------------------------------------------------------------------------
|
|
16681
15073
|
* Menu
|
|
16682
15074
|
* -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$MENU_NAME = 'Menu';
|
|
16683
15075
|
const [$6cc32821e9371a1c$var$Collection, $6cc32821e9371a1c$var$useCollection, $6cc32821e9371a1c$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($6cc32821e9371a1c$var$MENU_NAME);
|
|
16684
|
-
const [$6cc32821e9371a1c$var$createMenuContext, $6cc32821e9371a1c$export$4027731b685e72eb] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
15076
|
+
const [$6cc32821e9371a1c$var$createMenuContext, $6cc32821e9371a1c$export$4027731b685e72eb] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($6cc32821e9371a1c$var$MENU_NAME, [
|
|
16685
15077
|
$6cc32821e9371a1c$var$createCollectionScope,
|
|
16686
|
-
$cf1ac5d9fe0e8206$export$722aac194ae923
|
|
15078
|
+
$cf1ac5d9fe0e8206$export$722aac194ae923,
|
|
16687
15079
|
$d7bdfb9eb0fdf311$export$c7109489551a4f4
|
|
16688
15080
|
]);
|
|
16689
|
-
const $6cc32821e9371a1c$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923
|
|
15081
|
+
const $6cc32821e9371a1c$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923();
|
|
16690
15082
|
const $6cc32821e9371a1c$var$useRovingFocusGroupScope = $d7bdfb9eb0fdf311$export$c7109489551a4f4();
|
|
16691
15083
|
const [$6cc32821e9371a1c$var$MenuProvider, $6cc32821e9371a1c$var$useMenuContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$MENU_NAME);
|
|
16692
15084
|
const [$6cc32821e9371a1c$var$MenuRootProvider, $6cc32821e9371a1c$var$useMenuRootContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$MENU_NAME);
|
|
@@ -16695,7 +15087,7 @@ const $6cc32821e9371a1c$export$d9b273488cd8ce6f = (props)=>{
|
|
|
16695
15087
|
const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);
|
|
16696
15088
|
const [content, setContent] = useState(null);
|
|
16697
15089
|
const isUsingKeyboardRef = useRef(false);
|
|
16698
|
-
const handleOpenChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a
|
|
15090
|
+
const handleOpenChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onOpenChange);
|
|
16699
15091
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
16700
15092
|
useEffect(()=>{
|
|
16701
15093
|
// Capture phase ensures we set the boolean before any side effects execute
|
|
@@ -16728,7 +15120,7 @@ const $6cc32821e9371a1c$export$d9b273488cd8ce6f = (props)=>{
|
|
|
16728
15120
|
});
|
|
16729
15121
|
};
|
|
16730
15122
|
}, []);
|
|
16731
|
-
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9
|
|
15123
|
+
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ createElement($6cc32821e9371a1c$var$MenuProvider, {
|
|
16732
15124
|
scope: __scopeMenu,
|
|
16733
15125
|
open: open,
|
|
16734
15126
|
onOpenChange: handleOpenChange,
|
|
@@ -16748,7 +15140,7 @@ const $6cc32821e9371a1c$export$d9b273488cd8ce6f = (props)=>{
|
|
|
16748
15140
|
const $6cc32821e9371a1c$export$9fa5ebd18bee4d43 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
16749
15141
|
const { __scopeMenu: __scopeMenu , ...anchorProps } = props;
|
|
16750
15142
|
const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);
|
|
16751
|
-
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7
|
|
15143
|
+
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({}, popperScope, anchorProps, {
|
|
16752
15144
|
ref: forwardedRef
|
|
16753
15145
|
}));
|
|
16754
15146
|
});
|
|
@@ -16769,7 +15161,7 @@ const $6cc32821e9371a1c$export$479f0f2f71193efe = /*#__PURE__*/ forwardRef((prop
|
|
|
16769
15161
|
const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);
|
|
16770
15162
|
return /*#__PURE__*/ createElement($6cc32821e9371a1c$var$Collection.Provider, {
|
|
16771
15163
|
scope: props.__scopeMenu
|
|
16772
|
-
}, /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b
|
|
15164
|
+
}, /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
16773
15165
|
present: forceMount || context.open
|
|
16774
15166
|
}, /*#__PURE__*/ createElement($6cc32821e9371a1c$var$Collection.Slot, {
|
|
16775
15167
|
scope: props.__scopeMenu
|
|
@@ -16782,7 +15174,7 @@ const $6cc32821e9371a1c$export$479f0f2f71193efe = /*#__PURE__*/ forwardRef((prop
|
|
|
16782
15174
|
/* ---------------------------------------------------------------------------------------------- */ const $6cc32821e9371a1c$var$MenuRootContentModal = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
16783
15175
|
const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);
|
|
16784
15176
|
const ref = useRef(null);
|
|
16785
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
15177
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref); // Hide everything from ARIA except the `MenuContent`
|
|
16786
15178
|
useEffect(()=>{
|
|
16787
15179
|
const content = ref.current;
|
|
16788
15180
|
if (content) return hideOthers(content);
|
|
@@ -16795,7 +15187,7 @@ const $6cc32821e9371a1c$export$479f0f2f71193efe = /*#__PURE__*/ forwardRef((prop
|
|
|
16795
15187
|
disableOutsidePointerEvents: context.open,
|
|
16796
15188
|
disableOutsideScroll: true // When focus is trapped, a `focusout` event may still happen.
|
|
16797
15189
|
,
|
|
16798
|
-
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15190
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault()
|
|
16799
15191
|
, {
|
|
16800
15192
|
checkForDefaultPrevented: false
|
|
16801
15193
|
}),
|
|
@@ -16821,7 +15213,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ forwardRef((
|
|
|
16821
15213
|
const getItems = $6cc32821e9371a1c$var$useCollection(__scopeMenu);
|
|
16822
15214
|
const [currentItemId, setCurrentItemId] = useState(null);
|
|
16823
15215
|
const contentRef = useRef(null);
|
|
16824
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
15216
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef, context.onContentChange);
|
|
16825
15217
|
const timerRef = useRef(0);
|
|
16826
15218
|
const searchRef = useRef('');
|
|
16827
15219
|
const pointerGraceTimerRef = useRef(0);
|
|
@@ -16830,7 +15222,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ forwardRef((
|
|
|
16830
15222
|
const lastPointerXRef = useRef(0);
|
|
16831
15223
|
const ScrollLockWrapper = disableOutsideScroll ? $epM9y$RemoveScroll : Fragment;
|
|
16832
15224
|
const scrollLockWrapperProps = disableOutsideScroll ? {
|
|
16833
|
-
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360
|
|
15225
|
+
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
16834
15226
|
allowPinchZoom: true
|
|
16835
15227
|
} : undefined;
|
|
16836
15228
|
const handleTypeaheadSearch = (key)=>{
|
|
@@ -16897,7 +15289,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ forwardRef((
|
|
|
16897
15289
|
}, /*#__PURE__*/ createElement(ScrollLockWrapper, scrollLockWrapperProps, /*#__PURE__*/ createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
16898
15290
|
asChild: true,
|
|
16899
15291
|
trapped: trapFocus,
|
|
16900
|
-
onMountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15292
|
+
onMountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onOpenAutoFocus, (event)=>{
|
|
16901
15293
|
var _contentRef$current2;
|
|
16902
15294
|
// when opening, explicitly focus the content area only and leave
|
|
16903
15295
|
// `onEntryFocus` in control of focusing first item
|
|
@@ -16905,7 +15297,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ forwardRef((
|
|
|
16905
15297
|
(_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 || _contentRef$current2.focus();
|
|
16906
15298
|
}),
|
|
16907
15299
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
16908
|
-
}, /*#__PURE__*/ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22
|
|
15300
|
+
}, /*#__PURE__*/ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, {
|
|
16909
15301
|
asChild: true,
|
|
16910
15302
|
disableOutsidePointerEvents: disableOutsidePointerEvents,
|
|
16911
15303
|
onEscapeKeyDown: onEscapeKeyDown,
|
|
@@ -16921,11 +15313,11 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ forwardRef((
|
|
|
16921
15313
|
loop: loop,
|
|
16922
15314
|
currentTabStopId: currentItemId,
|
|
16923
15315
|
onCurrentTabStopIdChange: setCurrentItemId,
|
|
16924
|
-
onEntryFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15316
|
+
onEntryFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onEntryFocus, (event)=>{
|
|
16925
15317
|
// only focus first item when using keyboard
|
|
16926
15318
|
if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
|
|
16927
15319
|
})
|
|
16928
|
-
}), /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2
|
|
15320
|
+
}), /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({
|
|
16929
15321
|
role: "menu",
|
|
16930
15322
|
"aria-orientation": "vertical",
|
|
16931
15323
|
"data-state": $6cc32821e9371a1c$var$getOpenState(context.open),
|
|
@@ -16937,7 +15329,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ forwardRef((
|
|
|
16937
15329
|
outline: 'none',
|
|
16938
15330
|
...contentProps.style
|
|
16939
15331
|
},
|
|
16940
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15332
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onKeyDown, (event)=>{
|
|
16941
15333
|
// submenu key events bubble through portals. We only care about keys in this menu.
|
|
16942
15334
|
const target = event.target;
|
|
16943
15335
|
const isKeyDownInside = target.closest('[data-radix-menu-content]') === event.currentTarget;
|
|
@@ -16959,14 +15351,14 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ forwardRef((
|
|
|
16959
15351
|
if ($6cc32821e9371a1c$var$LAST_KEYS.includes(event.key)) candidateNodes.reverse();
|
|
16960
15352
|
$6cc32821e9371a1c$var$focusFirst(candidateNodes);
|
|
16961
15353
|
}),
|
|
16962
|
-
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15354
|
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, (event)=>{
|
|
16963
15355
|
// clear search buffer when leaving the menu
|
|
16964
15356
|
if (!event.currentTarget.contains(event.target)) {
|
|
16965
15357
|
window.clearTimeout(timerRef.current);
|
|
16966
15358
|
searchRef.current = '';
|
|
16967
15359
|
}
|
|
16968
15360
|
}),
|
|
16969
|
-
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15361
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse((event)=>{
|
|
16970
15362
|
const target = event.target;
|
|
16971
15363
|
const pointerXHasChanged = lastPointerXRef.current !== event.clientX; // We don't use `event.movementX` for this check because Safari will
|
|
16972
15364
|
// always return `0` on a pointer event.
|
|
@@ -16980,7 +15372,7 @@ const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ forwardRef((
|
|
|
16980
15372
|
});
|
|
16981
15373
|
const $6cc32821e9371a1c$export$dd37bec0e8a99143 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
16982
15374
|
const { __scopeMenu: __scopeMenu , ...labelProps } = props;
|
|
16983
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
15375
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, labelProps, {
|
|
16984
15376
|
ref: forwardedRef
|
|
16985
15377
|
}));
|
|
16986
15378
|
});
|
|
@@ -16993,7 +15385,7 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ forwardRef((prop
|
|
|
16993
15385
|
const ref = useRef(null);
|
|
16994
15386
|
const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$ITEM_NAME, props.__scopeMenu);
|
|
16995
15387
|
const contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$ITEM_NAME, props.__scopeMenu);
|
|
16996
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
15388
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
16997
15389
|
const isPointerDownRef = useRef(false);
|
|
16998
15390
|
const handleSelect = ()=>{
|
|
16999
15391
|
const menuItem = ref.current;
|
|
@@ -17006,7 +15398,7 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ forwardRef((prop
|
|
|
17006
15398
|
, {
|
|
17007
15399
|
once: true
|
|
17008
15400
|
});
|
|
17009
|
-
$8927f6f2acc4f386$export$6d1a0317bde7de7f
|
|
15401
|
+
$8927f6f2acc4f386$export$6d1a0317bde7de7f(menuItem, itemSelectEvent);
|
|
17010
15402
|
if (itemSelectEvent.defaultPrevented) isPointerDownRef.current = false;
|
|
17011
15403
|
else rootContext.onClose();
|
|
17012
15404
|
}
|
|
@@ -17014,20 +15406,20 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ forwardRef((prop
|
|
|
17014
15406
|
return /*#__PURE__*/ createElement($6cc32821e9371a1c$var$MenuItemImpl, _extends({}, itemProps, {
|
|
17015
15407
|
ref: composedRefs,
|
|
17016
15408
|
disabled: disabled,
|
|
17017
|
-
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15409
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, handleSelect),
|
|
17018
15410
|
onPointerDown: (event)=>{
|
|
17019
15411
|
var _props$onPointerDown;
|
|
17020
15412
|
(_props$onPointerDown = props.onPointerDown) === null || _props$onPointerDown === void 0 || _props$onPointerDown.call(props, event);
|
|
17021
15413
|
isPointerDownRef.current = true;
|
|
17022
15414
|
},
|
|
17023
|
-
onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15415
|
+
onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerUp, (event)=>{
|
|
17024
15416
|
var _event$currentTarget;
|
|
17025
15417
|
// Pointer down can move to a different menu item which should activate it on pointer up.
|
|
17026
15418
|
// We dispatch a click for selection to allow composition with click based triggers and to
|
|
17027
15419
|
// prevent Firefox from getting stuck in text selection mode when the menu closes.
|
|
17028
15420
|
if (!isPointerDownRef.current) (_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 || _event$currentTarget.click();
|
|
17029
15421
|
}),
|
|
17030
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15422
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
17031
15423
|
const isTypingAhead = contentContext.searchRef.current !== '';
|
|
17032
15424
|
if (disabled || isTypingAhead && event.key === ' ') return;
|
|
17033
15425
|
if ($6cc32821e9371a1c$var$SELECTION_KEYS.includes(event.key)) {
|
|
@@ -17047,7 +15439,7 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ forwardRef((prop
|
|
|
17047
15439
|
const contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$ITEM_NAME, __scopeMenu);
|
|
17048
15440
|
const rovingFocusGroupScope = $6cc32821e9371a1c$var$useRovingFocusGroupScope(__scopeMenu);
|
|
17049
15441
|
const ref = useRef(null);
|
|
17050
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05
|
|
15442
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
17051
15443
|
const [isFocused, setIsFocused] = useState(false); // get the item's `.textContent` as default strategy for typeahead `textValue`
|
|
17052
15444
|
const [textContent, setTextContent] = useState('');
|
|
17053
15445
|
useEffect(()=>{
|
|
@@ -17067,14 +15459,14 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ forwardRef((prop
|
|
|
17067
15459
|
asChild: true
|
|
17068
15460
|
}, rovingFocusGroupScope, {
|
|
17069
15461
|
focusable: !disabled
|
|
17070
|
-
}), /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
15462
|
+
}), /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
17071
15463
|
role: "menuitem",
|
|
17072
15464
|
"data-highlighted": isFocused ? '' : undefined,
|
|
17073
15465
|
"aria-disabled": disabled || undefined,
|
|
17074
15466
|
"data-disabled": disabled ? '' : undefined
|
|
17075
15467
|
}, itemProps, {
|
|
17076
15468
|
ref: composedRefs,
|
|
17077
|
-
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15469
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse((event)=>{
|
|
17078
15470
|
if (disabled) contentContext.onItemLeave(event);
|
|
17079
15471
|
else {
|
|
17080
15472
|
contentContext.onItemEnter(event);
|
|
@@ -17084,11 +15476,11 @@ const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ forwardRef((prop
|
|
|
17084
15476
|
}
|
|
17085
15477
|
}
|
|
17086
15478
|
})),
|
|
17087
|
-
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15479
|
+
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerLeave, $6cc32821e9371a1c$var$whenMouse((event)=>contentContext.onItemLeave(event)
|
|
17088
15480
|
)),
|
|
17089
|
-
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15481
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, ()=>setIsFocused(true)
|
|
17090
15482
|
),
|
|
17091
|
-
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15483
|
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, ()=>setIsFocused(false)
|
|
17092
15484
|
)
|
|
17093
15485
|
}))));
|
|
17094
15486
|
});
|
|
@@ -17107,7 +15499,7 @@ $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$ITEM_INDICATOR_NAM
|
|
|
17107
15499
|
});
|
|
17108
15500
|
const $6cc32821e9371a1c$export$1cec7dcdd713e220 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
17109
15501
|
const { __scopeMenu: __scopeMenu , ...separatorProps } = props;
|
|
17110
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
15502
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
17111
15503
|
role: "separator",
|
|
17112
15504
|
"aria-orientation": "horizontal"
|
|
17113
15505
|
}, separatorProps, {
|
|
@@ -17117,14 +15509,225 @@ const $6cc32821e9371a1c$export$1cec7dcdd713e220 = /*#__PURE__*/ forwardRef((prop
|
|
|
17117
15509
|
const $6cc32821e9371a1c$export$bcdda4773debf5fa = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
17118
15510
|
const { __scopeMenu: __scopeMenu , ...arrowProps } = props;
|
|
17119
15511
|
const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);
|
|
17120
|
-
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5
|
|
15512
|
+
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5, _extends({}, popperScope, arrowProps, {
|
|
17121
15513
|
ref: forwardedRef
|
|
17122
15514
|
}));
|
|
17123
15515
|
});
|
|
17124
15516
|
/* -------------------------------------------------------------------------------------------------
|
|
17125
15517
|
* MenuSub
|
|
17126
15518
|
* -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$SUB_NAME = 'MenuSub';
|
|
17127
|
-
$6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$SUB_NAME);
|
|
15519
|
+
const [$6cc32821e9371a1c$var$MenuSubProvider, $6cc32821e9371a1c$var$useMenuSubContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$SUB_NAME);
|
|
15520
|
+
const $6cc32821e9371a1c$export$71bdb9d1e2909932 = (props)=>{
|
|
15521
|
+
const { __scopeMenu: __scopeMenu , children: children , open: open = false , onOpenChange: onOpenChange } = props;
|
|
15522
|
+
const parentMenuContext = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$SUB_NAME, __scopeMenu);
|
|
15523
|
+
const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);
|
|
15524
|
+
const [trigger, setTrigger] = useState(null);
|
|
15525
|
+
const [content, setContent] = useState(null);
|
|
15526
|
+
const handleOpenChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onOpenChange); // Prevent the parent menu from reopening with open submenus.
|
|
15527
|
+
useEffect(()=>{
|
|
15528
|
+
if (parentMenuContext.open === false) handleOpenChange(false);
|
|
15529
|
+
return ()=>handleOpenChange(false)
|
|
15530
|
+
;
|
|
15531
|
+
}, [
|
|
15532
|
+
parentMenuContext.open,
|
|
15533
|
+
handleOpenChange
|
|
15534
|
+
]);
|
|
15535
|
+
return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ createElement($6cc32821e9371a1c$var$MenuProvider, {
|
|
15536
|
+
scope: __scopeMenu,
|
|
15537
|
+
open: open,
|
|
15538
|
+
onOpenChange: handleOpenChange,
|
|
15539
|
+
content: content,
|
|
15540
|
+
onContentChange: setContent
|
|
15541
|
+
}, /*#__PURE__*/ createElement($6cc32821e9371a1c$var$MenuSubProvider, {
|
|
15542
|
+
scope: __scopeMenu,
|
|
15543
|
+
contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
15544
|
+
triggerId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
15545
|
+
trigger: trigger,
|
|
15546
|
+
onTriggerChange: setTrigger
|
|
15547
|
+
}, children)));
|
|
15548
|
+
};
|
|
15549
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15550
|
+
* MenuSubTrigger
|
|
15551
|
+
* -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$SUB_TRIGGER_NAME = 'MenuSubTrigger';
|
|
15552
|
+
const $6cc32821e9371a1c$export$5fbbb3ba7297405f = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
15553
|
+
const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15554
|
+
const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15555
|
+
const subContext = $6cc32821e9371a1c$var$useMenuSubContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15556
|
+
const contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15557
|
+
const openTimerRef = useRef(null);
|
|
15558
|
+
const { pointerGraceTimerRef: pointerGraceTimerRef , onPointerGraceIntentChange: onPointerGraceIntentChange } = contentContext;
|
|
15559
|
+
const scope = {
|
|
15560
|
+
__scopeMenu: props.__scopeMenu
|
|
15561
|
+
};
|
|
15562
|
+
const clearOpenTimer = useCallback(()=>{
|
|
15563
|
+
if (openTimerRef.current) window.clearTimeout(openTimerRef.current);
|
|
15564
|
+
openTimerRef.current = null;
|
|
15565
|
+
}, []);
|
|
15566
|
+
useEffect(()=>clearOpenTimer
|
|
15567
|
+
, [
|
|
15568
|
+
clearOpenTimer
|
|
15569
|
+
]);
|
|
15570
|
+
useEffect(()=>{
|
|
15571
|
+
const pointerGraceTimer = pointerGraceTimerRef.current;
|
|
15572
|
+
return ()=>{
|
|
15573
|
+
window.clearTimeout(pointerGraceTimer);
|
|
15574
|
+
onPointerGraceIntentChange(null);
|
|
15575
|
+
};
|
|
15576
|
+
}, [
|
|
15577
|
+
pointerGraceTimerRef,
|
|
15578
|
+
onPointerGraceIntentChange
|
|
15579
|
+
]);
|
|
15580
|
+
return /*#__PURE__*/ createElement($6cc32821e9371a1c$export$9fa5ebd18bee4d43, _extends({
|
|
15581
|
+
asChild: true
|
|
15582
|
+
}, scope), /*#__PURE__*/ createElement($6cc32821e9371a1c$var$MenuItemImpl, _extends({
|
|
15583
|
+
id: subContext.triggerId,
|
|
15584
|
+
"aria-haspopup": "menu",
|
|
15585
|
+
"aria-expanded": context.open,
|
|
15586
|
+
"aria-controls": subContext.contentId,
|
|
15587
|
+
"data-state": $6cc32821e9371a1c$var$getOpenState(context.open)
|
|
15588
|
+
}, props, {
|
|
15589
|
+
ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, subContext.onTriggerChange) // This is redundant for mouse users but we cannot determine pointer type from
|
|
15590
|
+
,
|
|
15591
|
+
onClick: (event)=>{
|
|
15592
|
+
var _props$onClick;
|
|
15593
|
+
(_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, event);
|
|
15594
|
+
if (props.disabled || event.defaultPrevented) return;
|
|
15595
|
+
/**
|
|
15596
|
+
* We manually focus because iOS Safari doesn't always focus on click (e.g. buttons)
|
|
15597
|
+
* and we rely heavily on `onFocusOutside` for submenus to close when switching
|
|
15598
|
+
* between separate submenus.
|
|
15599
|
+
*/ event.currentTarget.focus();
|
|
15600
|
+
if (!context.open) context.onOpenChange(true);
|
|
15601
|
+
},
|
|
15602
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse((event)=>{
|
|
15603
|
+
contentContext.onItemEnter(event);
|
|
15604
|
+
if (event.defaultPrevented) return;
|
|
15605
|
+
if (!props.disabled && !context.open && !openTimerRef.current) {
|
|
15606
|
+
contentContext.onPointerGraceIntentChange(null);
|
|
15607
|
+
openTimerRef.current = window.setTimeout(()=>{
|
|
15608
|
+
context.onOpenChange(true);
|
|
15609
|
+
clearOpenTimer();
|
|
15610
|
+
}, 100);
|
|
15611
|
+
}
|
|
15612
|
+
})),
|
|
15613
|
+
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerLeave, $6cc32821e9371a1c$var$whenMouse((event)=>{
|
|
15614
|
+
var _context$content;
|
|
15615
|
+
clearOpenTimer();
|
|
15616
|
+
const contentRect = (_context$content = context.content) === null || _context$content === void 0 ? void 0 : _context$content.getBoundingClientRect();
|
|
15617
|
+
if (contentRect) {
|
|
15618
|
+
var _context$content2;
|
|
15619
|
+
// TODO: make sure to update this when we change positioning logic
|
|
15620
|
+
const side = (_context$content2 = context.content) === null || _context$content2 === void 0 ? void 0 : _context$content2.dataset.side;
|
|
15621
|
+
const rightSide = side === 'right';
|
|
15622
|
+
const bleed = rightSide ? -5 : 5;
|
|
15623
|
+
const contentNearEdge = contentRect[rightSide ? 'left' : 'right'];
|
|
15624
|
+
const contentFarEdge = contentRect[rightSide ? 'right' : 'left'];
|
|
15625
|
+
contentContext.onPointerGraceIntentChange({
|
|
15626
|
+
area: [
|
|
15627
|
+
// consistently within polygon bounds
|
|
15628
|
+
{
|
|
15629
|
+
x: event.clientX + bleed,
|
|
15630
|
+
y: event.clientY
|
|
15631
|
+
},
|
|
15632
|
+
{
|
|
15633
|
+
x: contentNearEdge,
|
|
15634
|
+
y: contentRect.top
|
|
15635
|
+
},
|
|
15636
|
+
{
|
|
15637
|
+
x: contentFarEdge,
|
|
15638
|
+
y: contentRect.top
|
|
15639
|
+
},
|
|
15640
|
+
{
|
|
15641
|
+
x: contentFarEdge,
|
|
15642
|
+
y: contentRect.bottom
|
|
15643
|
+
},
|
|
15644
|
+
{
|
|
15645
|
+
x: contentNearEdge,
|
|
15646
|
+
y: contentRect.bottom
|
|
15647
|
+
}
|
|
15648
|
+
],
|
|
15649
|
+
side: side
|
|
15650
|
+
});
|
|
15651
|
+
window.clearTimeout(pointerGraceTimerRef.current);
|
|
15652
|
+
pointerGraceTimerRef.current = window.setTimeout(()=>contentContext.onPointerGraceIntentChange(null)
|
|
15653
|
+
, 300);
|
|
15654
|
+
} else {
|
|
15655
|
+
contentContext.onTriggerLeave(event);
|
|
15656
|
+
if (event.defaultPrevented) return; // There's 100ms where the user may leave an item before the submenu was opened.
|
|
15657
|
+
contentContext.onPointerGraceIntentChange(null);
|
|
15658
|
+
}
|
|
15659
|
+
})),
|
|
15660
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
15661
|
+
const isTypingAhead = contentContext.searchRef.current !== '';
|
|
15662
|
+
if (props.disabled || isTypingAhead && event.key === ' ') return;
|
|
15663
|
+
if ($6cc32821e9371a1c$var$SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {
|
|
15664
|
+
var _context$content3;
|
|
15665
|
+
context.onOpenChange(true); // The trigger may hold focus if opened via pointer interaction
|
|
15666
|
+
// so we ensure content is given focus again when switching to keyboard.
|
|
15667
|
+
(_context$content3 = context.content) === null || _context$content3 === void 0 || _context$content3.focus(); // prevent window from scrolling
|
|
15668
|
+
event.preventDefault();
|
|
15669
|
+
}
|
|
15670
|
+
})
|
|
15671
|
+
})));
|
|
15672
|
+
});
|
|
15673
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15674
|
+
* MenuSubContent
|
|
15675
|
+
* -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$SUB_CONTENT_NAME = 'MenuSubContent';
|
|
15676
|
+
const $6cc32821e9371a1c$export$e7142ab31822bde6 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
15677
|
+
const portalContext = $6cc32821e9371a1c$var$usePortalContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);
|
|
15678
|
+
const { forceMount: forceMount = portalContext.forceMount , ...subContentProps } = props;
|
|
15679
|
+
const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);
|
|
15680
|
+
const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);
|
|
15681
|
+
const subContext = $6cc32821e9371a1c$var$useMenuSubContext($6cc32821e9371a1c$var$SUB_CONTENT_NAME, props.__scopeMenu);
|
|
15682
|
+
const ref = useRef(null);
|
|
15683
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
15684
|
+
return /*#__PURE__*/ createElement($6cc32821e9371a1c$var$Collection.Provider, {
|
|
15685
|
+
scope: props.__scopeMenu
|
|
15686
|
+
}, /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
15687
|
+
present: forceMount || context.open
|
|
15688
|
+
}, /*#__PURE__*/ createElement($6cc32821e9371a1c$var$Collection.Slot, {
|
|
15689
|
+
scope: props.__scopeMenu
|
|
15690
|
+
}, /*#__PURE__*/ createElement($6cc32821e9371a1c$var$MenuContentImpl, _extends({
|
|
15691
|
+
id: subContext.contentId,
|
|
15692
|
+
"aria-labelledby": subContext.triggerId
|
|
15693
|
+
}, subContentProps, {
|
|
15694
|
+
ref: composedRefs,
|
|
15695
|
+
align: "start",
|
|
15696
|
+
side: rootContext.dir === 'rtl' ? 'left' : 'right',
|
|
15697
|
+
disableOutsidePointerEvents: false,
|
|
15698
|
+
disableOutsideScroll: false,
|
|
15699
|
+
trapFocus: false,
|
|
15700
|
+
onOpenAutoFocus: (event)=>{
|
|
15701
|
+
var _ref$current;
|
|
15702
|
+
// when opening a submenu, focus content for keyboard users only
|
|
15703
|
+
if (rootContext.isUsingKeyboardRef.current) (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.focus();
|
|
15704
|
+
event.preventDefault();
|
|
15705
|
+
} // The menu might close because of focusing another menu item in the parent menu. We
|
|
15706
|
+
,
|
|
15707
|
+
onCloseAutoFocus: (event)=>event.preventDefault()
|
|
15708
|
+
,
|
|
15709
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>{
|
|
15710
|
+
// We prevent closing when the trigger is focused to avoid triggering a re-open animation
|
|
15711
|
+
// on pointer interaction.
|
|
15712
|
+
if (event.target !== subContext.trigger) context.onOpenChange(false);
|
|
15713
|
+
}),
|
|
15714
|
+
onEscapeKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onEscapeKeyDown, (event)=>{
|
|
15715
|
+
rootContext.onClose(); // ensure pressing escape in submenu doesn't escape full screen mode
|
|
15716
|
+
event.preventDefault();
|
|
15717
|
+
}),
|
|
15718
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
15719
|
+
// Submenu key events bubble through portals. We only care about keys in this menu.
|
|
15720
|
+
const isKeyDownInside = event.currentTarget.contains(event.target);
|
|
15721
|
+
const isCloseKey = $6cc32821e9371a1c$var$SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);
|
|
15722
|
+
if (isKeyDownInside && isCloseKey) {
|
|
15723
|
+
var _subContext$trigger;
|
|
15724
|
+
context.onOpenChange(false); // We focus manually because we prevented it in `onCloseAutoFocus`
|
|
15725
|
+
(_subContext$trigger = subContext.trigger) === null || _subContext$trigger === void 0 || _subContext$trigger.focus(); // prevent window from scrolling
|
|
15726
|
+
event.preventDefault();
|
|
15727
|
+
}
|
|
15728
|
+
})
|
|
15729
|
+
})))));
|
|
15730
|
+
});
|
|
17128
15731
|
/* -----------------------------------------------------------------------------------------------*/ function $6cc32821e9371a1c$var$getOpenState(open) {
|
|
17129
15732
|
return open ? 'open' : 'closed';
|
|
17130
15733
|
}
|
|
@@ -17207,11 +15810,14 @@ const $6cc32821e9371a1c$export$b04be29aa201d4f5 = $6cc32821e9371a1c$export$dd37b
|
|
|
17207
15810
|
const $6cc32821e9371a1c$export$6d08773d2e66f8f2 = $6cc32821e9371a1c$export$2ce376c2cc3355c8;
|
|
17208
15811
|
const $6cc32821e9371a1c$export$1ff3c3f08ae963c0 = $6cc32821e9371a1c$export$1cec7dcdd713e220;
|
|
17209
15812
|
const $6cc32821e9371a1c$export$21b07c8f274aebd5 = $6cc32821e9371a1c$export$bcdda4773debf5fa;
|
|
15813
|
+
const $6cc32821e9371a1c$export$d7a01e11500dfb6f = $6cc32821e9371a1c$export$71bdb9d1e2909932;
|
|
15814
|
+
const $6cc32821e9371a1c$export$2ea8a7a591ac5eac = $6cc32821e9371a1c$export$5fbbb3ba7297405f;
|
|
15815
|
+
const $6cc32821e9371a1c$export$6d4de93b380beddf = $6cc32821e9371a1c$export$e7142ab31822bde6;
|
|
17210
15816
|
|
|
17211
15817
|
/* -------------------------------------------------------------------------------------------------
|
|
17212
15818
|
* DropdownMenu
|
|
17213
15819
|
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$DROPDOWN_MENU_NAME = 'DropdownMenu';
|
|
17214
|
-
const [$d08ef79370b62062$var$createDropdownMenuContext, $d08ef79370b62062$export$c0623cd925aeb687] = $c512c27ab02ef895$export$50c7b4e9d9f19c1
|
|
15820
|
+
const [$d08ef79370b62062$var$createDropdownMenuContext, $d08ef79370b62062$export$c0623cd925aeb687] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($d08ef79370b62062$var$DROPDOWN_MENU_NAME, [
|
|
17215
15821
|
$6cc32821e9371a1c$export$4027731b685e72eb
|
|
17216
15822
|
]);
|
|
17217
15823
|
const $d08ef79370b62062$var$useMenuScope = $6cc32821e9371a1c$export$4027731b685e72eb();
|
|
@@ -17220,7 +15826,7 @@ const $d08ef79370b62062$export$e44a253a59704894 = (props)=>{
|
|
|
17220
15826
|
const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , dir: dir , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props;
|
|
17221
15827
|
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
17222
15828
|
const triggerRef = useRef(null);
|
|
17223
|
-
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3
|
|
15829
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
17224
15830
|
prop: openProp,
|
|
17225
15831
|
defaultProp: defaultOpen,
|
|
17226
15832
|
onChange: onOpenChange
|
|
@@ -17254,7 +15860,7 @@ const $d08ef79370b62062$export$d2469213b3befba9 = /*#__PURE__*/ forwardRef((prop
|
|
|
17254
15860
|
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
17255
15861
|
return /*#__PURE__*/ createElement($6cc32821e9371a1c$export$b688253958b8dfe7, _extends({
|
|
17256
15862
|
asChild: true
|
|
17257
|
-
}, menuScope), /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034
|
|
15863
|
+
}, menuScope), /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
17258
15864
|
type: "button",
|
|
17259
15865
|
id: context.triggerId,
|
|
17260
15866
|
"aria-haspopup": "menu",
|
|
@@ -17264,8 +15870,8 @@ const $d08ef79370b62062$export$d2469213b3befba9 = /*#__PURE__*/ forwardRef((prop
|
|
|
17264
15870
|
"data-disabled": disabled ? '' : undefined,
|
|
17265
15871
|
disabled: disabled
|
|
17266
15872
|
}, triggerProps, {
|
|
17267
|
-
ref: $6ed0406888f73fc4$export$43e446d32b3d21af
|
|
17268
|
-
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15873
|
+
ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, context.triggerRef),
|
|
15874
|
+
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDown, (event)=>{
|
|
17269
15875
|
// only call handler if it's the left button (mousedown gets triggered by all mouse buttons)
|
|
17270
15876
|
// but not when the control key is pressed (avoiding MacOS right click)
|
|
17271
15877
|
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
@@ -17274,7 +15880,7 @@ const $d08ef79370b62062$export$d2469213b3befba9 = /*#__PURE__*/ forwardRef((prop
|
|
|
17274
15880
|
if (!context.open) event.preventDefault();
|
|
17275
15881
|
}
|
|
17276
15882
|
}),
|
|
17277
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15883
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
17278
15884
|
if (disabled) return;
|
|
17279
15885
|
if ([
|
|
17280
15886
|
'Enter',
|
|
@@ -17303,13 +15909,13 @@ const $d08ef79370b62062$export$6e76d93a37c01248 = /*#__PURE__*/ forwardRef((prop
|
|
|
17303
15909
|
"aria-labelledby": context.triggerId
|
|
17304
15910
|
}, menuScope, contentProps, {
|
|
17305
15911
|
ref: forwardedRef,
|
|
17306
|
-
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15912
|
+
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{
|
|
17307
15913
|
var _context$triggerRef$c;
|
|
17308
15914
|
if (!hasInteractedOutsideRef.current) (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
17309
15915
|
hasInteractedOutsideRef.current = false; // Always prevent auto focus because we either focus manually or want user agent focus
|
|
17310
15916
|
event.preventDefault();
|
|
17311
15917
|
}),
|
|
17312
|
-
onInteractOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10
|
|
15918
|
+
onInteractOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onInteractOutside, (event)=>{
|
|
17313
15919
|
const originalEvent = event.detail.originalEvent;
|
|
17314
15920
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
17315
15921
|
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
@@ -17353,6 +15959,43 @@ const $d08ef79370b62062$export$34b8980744021ec5 = /*#__PURE__*/ forwardRef((prop
|
|
|
17353
15959
|
ref: forwardedRef
|
|
17354
15960
|
}));
|
|
17355
15961
|
});
|
|
15962
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15963
|
+
* DropdownMenuSub
|
|
15964
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$export$2f307d81a64f5442 = (props)=>{
|
|
15965
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , open: openProp , onOpenChange: onOpenChange , defaultOpen: defaultOpen } = props;
|
|
15966
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
15967
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
15968
|
+
prop: openProp,
|
|
15969
|
+
defaultProp: defaultOpen,
|
|
15970
|
+
onChange: onOpenChange
|
|
15971
|
+
});
|
|
15972
|
+
return /*#__PURE__*/ createElement($6cc32821e9371a1c$export$d7a01e11500dfb6f, _extends({}, menuScope, {
|
|
15973
|
+
open: open,
|
|
15974
|
+
onOpenChange: setOpen
|
|
15975
|
+
}), children);
|
|
15976
|
+
};
|
|
15977
|
+
const $d08ef79370b62062$export$21dcb7ec56f874cf = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
15978
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...subTriggerProps } = props;
|
|
15979
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
15980
|
+
return /*#__PURE__*/ createElement($6cc32821e9371a1c$export$2ea8a7a591ac5eac, _extends({}, menuScope, subTriggerProps, {
|
|
15981
|
+
ref: forwardedRef
|
|
15982
|
+
}));
|
|
15983
|
+
});
|
|
15984
|
+
const $d08ef79370b62062$export$f34ec8bc2482cc5f = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
15985
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...subContentProps } = props;
|
|
15986
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
15987
|
+
return /*#__PURE__*/ createElement($6cc32821e9371a1c$export$6d4de93b380beddf, _extends({}, menuScope, subContentProps, {
|
|
15988
|
+
ref: forwardedRef,
|
|
15989
|
+
style: {
|
|
15990
|
+
...props.style,
|
|
15991
|
+
'--radix-dropdown-menu-content-transform-origin': 'var(--radix-popper-transform-origin)',
|
|
15992
|
+
'--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)',
|
|
15993
|
+
'--radix-dropdown-menu-content-available-height': 'var(--radix-popper-available-height)',
|
|
15994
|
+
'--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)',
|
|
15995
|
+
'--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)'
|
|
15996
|
+
}
|
|
15997
|
+
}));
|
|
15998
|
+
});
|
|
17356
15999
|
/* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$export$be92b6f5f03c0fe9 = $d08ef79370b62062$export$e44a253a59704894;
|
|
17357
16000
|
const $d08ef79370b62062$export$41fb9f06171c75f4 = $d08ef79370b62062$export$d2469213b3befba9;
|
|
17358
16001
|
const $d08ef79370b62062$export$7c6e2c02157bb7d2 = $d08ef79370b62062$export$6e76d93a37c01248;
|
|
@@ -17360,6 +16003,9 @@ const $d08ef79370b62062$export$b04be29aa201d4f5 = $d08ef79370b62062$export$76e48
|
|
|
17360
16003
|
const $d08ef79370b62062$export$6d08773d2e66f8f2 = $d08ef79370b62062$export$ed97964d1871885d;
|
|
17361
16004
|
const $d08ef79370b62062$export$1ff3c3f08ae963c0 = $d08ef79370b62062$export$da160178fd3bc7e9;
|
|
17362
16005
|
const $d08ef79370b62062$export$21b07c8f274aebd5 = $d08ef79370b62062$export$34b8980744021ec5;
|
|
16006
|
+
const $d08ef79370b62062$export$d7a01e11500dfb6f = $d08ef79370b62062$export$2f307d81a64f5442;
|
|
16007
|
+
const $d08ef79370b62062$export$2ea8a7a591ac5eac = $d08ef79370b62062$export$21dcb7ec56f874cf;
|
|
16008
|
+
const $d08ef79370b62062$export$6d4de93b380beddf = $d08ef79370b62062$export$f34ec8bc2482cc5f;
|
|
17363
16009
|
|
|
17364
16010
|
const borderStyles = [
|
|
17365
16011
|
'tw-border-solid',
|
|
@@ -17377,18 +16023,39 @@ const ButtonWithDropdown = ({ dropdownItems, triggerIcon, id, extraClassNames, c
|
|
|
17377
16023
|
React.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)),
|
|
17378
16024
|
React.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" },
|
|
17379
16025
|
React.createElement("div", { "data-testid": containerTestId, className: bgStyles +
|
|
17380
|
-
' tw-relative tw-z-[1000] tw-min-w-6 tw-
|
|
16026
|
+
' tw-relative tw-z-[1000] tw-min-w-6 tw-py-2 focus-visible:tw-outline-none tw-outline-none' +
|
|
16027
|
+
' data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out' +
|
|
17381
16028
|
' 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 ' +
|
|
17382
16029
|
borderStyles },
|
|
17383
16030
|
hasArrow && (React.createElement($d08ef79370b62062$export$21b07c8f274aebd5, { asChild: true },
|
|
17384
16031
|
React.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]" }))),
|
|
17385
16032
|
dropdownItems.map((item, index) => {
|
|
17386
|
-
|
|
17387
|
-
|
|
17388
|
-
|
|
16033
|
+
if (item.isLabel) {
|
|
16034
|
+
return (React.createElement($d08ef79370b62062$export$b04be29aa201d4f5, { key: (item.label || '') + index, className: item.containerExtraClassNames },
|
|
16035
|
+
item.icon && (React.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]" })),
|
|
16036
|
+
React.createElement("div", { "data-testid": item.labelTestId, className: "tw-text-[13px] tw-ml-1" }, item.label)));
|
|
16037
|
+
}
|
|
16038
|
+
if (Array.isArray(item.subMenuItems) && item.subMenuItems.length > 0) {
|
|
16039
|
+
return (React.createElement($d08ef79370b62062$export$d7a01e11500dfb6f, { key: item.label + index },
|
|
16040
|
+
React.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 },
|
|
16041
|
+
React.createElement("div", { className: "tw-flex" },
|
|
16042
|
+
item.icon && (React.createElement(Icon, { icon: item.icon, extraClassNames: `tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px] ${item.iconExtraClassNames || ''}` })),
|
|
16043
|
+
React.createElement("div", { "data-testid": item.labelTestId, "data-customid": item.labelCustomId, className: `tw-text-[13px] tw-ml-1 ${item.labelClasses}` }, item.label)),
|
|
16044
|
+
React.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" })),
|
|
16045
|
+
React.createElement($d08ef79370b62062$export$6d4de93b380beddf, { className: "focus-visible:tw-outline-none tw-outline-none" },
|
|
16046
|
+
React.createElement("div", { "data-testid": containerTestId, className: bgStyles +
|
|
16047
|
+
' 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' +
|
|
16048
|
+
' 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 ' +
|
|
16049
|
+
borderStyles }, item.subMenuItems.map((subItem, subIndex) => {
|
|
16050
|
+
return (React.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 },
|
|
16051
|
+
subItem.iconClass && (React.createElement(Icon, { icon: subItem.iconClass, extraClassNames: `tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px]` })),
|
|
16052
|
+
React.createElement("div", { className: `tw-text-[13px] tw-ml-1` }, subItem.label)));
|
|
16053
|
+
})))));
|
|
16054
|
+
}
|
|
16055
|
+
return (React.createElement("div", { key: item.label + index },
|
|
17389
16056
|
React.createElement($d08ef79370b62062$export$6d08773d2e66f8f2, { key: item.label + index, "data-customid": item.itemCustomId, onSelect: (e) => {
|
|
17390
16057
|
item.onClick(e);
|
|
17391
|
-
}, className: `tw-cursor-pointer tw-flex dark:tw-text-sq-white hover:tw-bg-sq-
|
|
16058
|
+
}, 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 },
|
|
17392
16059
|
item.icon && (React.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 || ''}` })),
|
|
17393
16060
|
React.createElement("div", { "data-testid": item.labelTestId, "data-customid": item.labelCustomId, className: `tw-text-[13px] tw-ml-1 ${item.labelClasses}` }, item.label)),
|
|
17394
16061
|
item.hasDivider && (React.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]" }))));
|