@teamturing/react-kit 2.12.0 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Overlay/index.d.ts +18 -0
- package/dist/core/OverlayPopper/index.d.ts +16 -0
- package/dist/core/Pagination/index.d.ts +327 -0
- package/dist/core/Pill/index.d.ts +47 -0
- package/dist/hook/useFocusTrap.d.ts +13 -0
- package/dist/hook/useFocusZone.d.ts +15 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +3323 -581
- package/esm/core/Dialog/index.js +8 -36
- package/esm/core/Overlay/index.js +92 -0
- package/esm/core/OverlayPopper/index.js +69 -0
- package/esm/core/Pagination/index.js +273 -0
- package/esm/core/Pill/index.js +129 -0
- package/esm/hook/useFocusTrap.js +39 -0
- package/esm/hook/useFocusZone.js +35 -0
- package/esm/index.js +8 -0
- package/esm/node_modules/@floating-ui/core/dist/floating-ui.core.js +475 -0
- package/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +599 -0
- package/esm/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +229 -0
- package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +121 -0
- package/esm/node_modules/@floating-ui/utils/dom/dist/floating-ui.utils.dom.js +128 -0
- package/esm/node_modules/@primer/behaviors/dist/esm/focus-trap.js +105 -0
- package/esm/node_modules/@primer/behaviors/dist/esm/focus-zone.js +436 -0
- package/esm/node_modules/@primer/behaviors/dist/esm/polyfills/event-listener-signal.js +38 -0
- package/esm/node_modules/@primer/behaviors/dist/esm/utils/iterate-focusable-elements.js +65 -0
- package/esm/node_modules/@primer/behaviors/dist/esm/utils/unique-id.js +6 -0
- package/esm/node_modules/@primer/behaviors/dist/esm/utils/user-agent.js +9 -0
- package/esm/packages/utils/esm/noop.js +6 -0
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var styled = require('styled-components');
|
|
5
|
+
var ReactDOM = require('react-dom');
|
|
5
6
|
|
|
6
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
8
|
|
|
@@ -25,6 +26,7 @@ function _interopNamespace(e) {
|
|
|
25
26
|
|
|
26
27
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
28
|
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
29
|
+
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
28
30
|
|
|
29
31
|
/**
|
|
30
32
|
* @public
|
|
@@ -509,7 +511,7 @@ const getValueAsType = (value, type) => {
|
|
|
509
511
|
: value;
|
|
510
512
|
};
|
|
511
513
|
|
|
512
|
-
const clamp = (min, max, v) => Math.min(Math.max(v, min), max);
|
|
514
|
+
const clamp$1 = (min, max, v) => Math.min(Math.max(v, min), max);
|
|
513
515
|
|
|
514
516
|
const number = {
|
|
515
517
|
test: (v) => typeof v === "number",
|
|
@@ -518,7 +520,7 @@ const number = {
|
|
|
518
520
|
};
|
|
519
521
|
const alpha = {
|
|
520
522
|
...number,
|
|
521
|
-
transform: (v) => clamp(0, 1, v),
|
|
523
|
+
transform: (v) => clamp$1(0, 1, v),
|
|
522
524
|
};
|
|
523
525
|
const scale = {
|
|
524
526
|
...number,
|
|
@@ -1215,7 +1217,7 @@ function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
|
|
|
1215
1217
|
return values;
|
|
1216
1218
|
}
|
|
1217
1219
|
|
|
1218
|
-
const noop = (any) => any;
|
|
1220
|
+
const noop$2 = (any) => any;
|
|
1219
1221
|
|
|
1220
1222
|
class Queue {
|
|
1221
1223
|
constructor() {
|
|
@@ -1377,7 +1379,7 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
|
|
|
1377
1379
|
return { schedule, cancel, state, steps };
|
|
1378
1380
|
}
|
|
1379
1381
|
|
|
1380
|
-
const { schedule: frame, cancel: cancelFrame, state: frameData, steps, } = createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true);
|
|
1382
|
+
const { schedule: frame, cancel: cancelFrame, state: frameData, steps, } = createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop$2, true);
|
|
1381
1383
|
|
|
1382
1384
|
const svgMotionConfig = {
|
|
1383
1385
|
useVisualState: makeUseVisualState({
|
|
@@ -1627,9 +1629,9 @@ function fireSyntheticPointerEvent(name, handler) {
|
|
|
1627
1629
|
class PressGesture extends Feature {
|
|
1628
1630
|
constructor() {
|
|
1629
1631
|
super(...arguments);
|
|
1630
|
-
this.removeStartListeners = noop;
|
|
1631
|
-
this.removeEndListeners = noop;
|
|
1632
|
-
this.removeAccessibleListeners = noop;
|
|
1632
|
+
this.removeStartListeners = noop$2;
|
|
1633
|
+
this.removeEndListeners = noop$2;
|
|
1634
|
+
this.removeAccessibleListeners = noop$2;
|
|
1633
1635
|
this.startPointerPress = (startEvent, startInfo) => {
|
|
1634
1636
|
this.removeEndListeners();
|
|
1635
1637
|
if (this.isPressing)
|
|
@@ -1895,8 +1897,8 @@ function resolveVariant(visualElement, definition, custom) {
|
|
|
1895
1897
|
const optimizedAppearDataId = "framerAppearId";
|
|
1896
1898
|
const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId);
|
|
1897
1899
|
|
|
1898
|
-
let warning = noop;
|
|
1899
|
-
let invariant = noop;
|
|
1900
|
+
let warning = noop$2;
|
|
1901
|
+
let invariant = noop$2;
|
|
1900
1902
|
if (process.env.NODE_ENV !== "production") {
|
|
1901
1903
|
warning = (check, message) => {
|
|
1902
1904
|
if (!check && typeof console !== "undefined") {
|
|
@@ -2022,7 +2024,7 @@ function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {
|
|
|
2022
2024
|
function cubicBezier(mX1, mY1, mX2, mY2) {
|
|
2023
2025
|
// If this is a linear gradient, return linear easing
|
|
2024
2026
|
if (mX1 === mY1 && mX2 === mY2)
|
|
2025
|
-
return noop;
|
|
2027
|
+
return noop$2;
|
|
2026
2028
|
const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);
|
|
2027
2029
|
// If animation is at start/end, return t without easing
|
|
2028
2030
|
return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);
|
|
@@ -2055,7 +2057,7 @@ const backInOut = mirrorEasing(backIn);
|
|
|
2055
2057
|
const anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));
|
|
2056
2058
|
|
|
2057
2059
|
const easingLookup = {
|
|
2058
|
-
linear: noop,
|
|
2060
|
+
linear: noop$2,
|
|
2059
2061
|
easeIn,
|
|
2060
2062
|
easeInOut,
|
|
2061
2063
|
easeOut,
|
|
@@ -2102,7 +2104,7 @@ const splitColor = (aName, bName, cName) => (v) => {
|
|
|
2102
2104
|
};
|
|
2103
2105
|
};
|
|
2104
2106
|
|
|
2105
|
-
const clampRgbUnit = (v) => clamp(0, 255, v);
|
|
2107
|
+
const clampRgbUnit = (v) => clamp$1(0, 255, v);
|
|
2106
2108
|
const rgbUnit = {
|
|
2107
2109
|
...number,
|
|
2108
2110
|
transform: (v) => Math.round(clampRgbUnit(v)),
|
|
@@ -2303,7 +2305,7 @@ const cssVarTokeniser = {
|
|
|
2303
2305
|
regex: cssVariableRegex,
|
|
2304
2306
|
countKey: "Vars",
|
|
2305
2307
|
token: "${v}",
|
|
2306
|
-
parse: noop,
|
|
2308
|
+
parse: noop$2,
|
|
2307
2309
|
};
|
|
2308
2310
|
const colorTokeniser = {
|
|
2309
2311
|
regex: colorRegex,
|
|
@@ -2472,7 +2474,7 @@ function createMixers(output, ease, customMixer) {
|
|
|
2472
2474
|
for (let i = 0; i < numMixers; i++) {
|
|
2473
2475
|
let mixer = mixerFactory(output[i], output[i + 1]);
|
|
2474
2476
|
if (ease) {
|
|
2475
|
-
const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;
|
|
2477
|
+
const easingFunction = Array.isArray(ease) ? ease[i] || noop$2 : ease;
|
|
2476
2478
|
mixer = pipe(easingFunction, mixer);
|
|
2477
2479
|
}
|
|
2478
2480
|
mixers.push(mixer);
|
|
@@ -2526,7 +2528,7 @@ function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {})
|
|
|
2526
2528
|
return mixers[i](progressInRange);
|
|
2527
2529
|
};
|
|
2528
2530
|
return isClamp
|
|
2529
|
-
? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))
|
|
2531
|
+
? (v) => interpolator(clamp$1(input[0], input[inputLength - 1], v))
|
|
2530
2532
|
: interpolator;
|
|
2531
2533
|
}
|
|
2532
2534
|
|
|
@@ -2620,8 +2622,8 @@ function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, })
|
|
|
2620
2622
|
/**
|
|
2621
2623
|
* Restrict dampingRatio and duration to within acceptable ranges.
|
|
2622
2624
|
*/
|
|
2623
|
-
dampingRatio = clamp(minDamping, maxDamping, dampingRatio);
|
|
2624
|
-
duration = clamp(minDuration, maxDuration$1, millisecondsToSeconds(duration));
|
|
2625
|
+
dampingRatio = clamp$1(minDamping, maxDamping, dampingRatio);
|
|
2626
|
+
duration = clamp$1(minDuration, maxDuration$1, millisecondsToSeconds(duration));
|
|
2625
2627
|
if (dampingRatio < 1) {
|
|
2626
2628
|
/**
|
|
2627
2629
|
* Underdamped spring
|
|
@@ -3080,7 +3082,7 @@ function animateValue({ autoplay = true, delay = 0, driver = frameloopDriver, ke
|
|
|
3080
3082
|
frameGenerator = mirroredGenerator;
|
|
3081
3083
|
}
|
|
3082
3084
|
}
|
|
3083
|
-
let p = clamp(0, 1, iterationProgress);
|
|
3085
|
+
let p = clamp$1(0, 1, iterationProgress);
|
|
3084
3086
|
if (currentTime > totalDuration) {
|
|
3085
3087
|
p = repeatType === "reverse" && iterationIsOdd ? 1 : 0;
|
|
3086
3088
|
}
|
|
@@ -3363,7 +3365,7 @@ function createAcceleratedAnimation(value, valueName, { onUpdate, onComplete, ..
|
|
|
3363
3365
|
attachTimeline(timeline) {
|
|
3364
3366
|
animation.timeline = timeline;
|
|
3365
3367
|
animation.onfinish = null;
|
|
3366
|
-
return noop;
|
|
3368
|
+
return noop$2;
|
|
3367
3369
|
},
|
|
3368
3370
|
get time() {
|
|
3369
3371
|
return millisecondsToSeconds(animation.currentTime || 0);
|
|
@@ -3433,15 +3435,15 @@ function createInstantAnimation({ keyframes, delay, onUpdate, onComplete, }) {
|
|
|
3433
3435
|
time: 0,
|
|
3434
3436
|
speed: 1,
|
|
3435
3437
|
duration: 0,
|
|
3436
|
-
play: (noop),
|
|
3437
|
-
pause: (noop),
|
|
3438
|
-
stop: (noop),
|
|
3438
|
+
play: (noop$2),
|
|
3439
|
+
pause: (noop$2),
|
|
3440
|
+
stop: (noop$2),
|
|
3439
3441
|
then: (resolve) => {
|
|
3440
3442
|
resolve();
|
|
3441
3443
|
return Promise.resolve();
|
|
3442
3444
|
},
|
|
3443
|
-
cancel: (noop),
|
|
3444
|
-
complete: (noop),
|
|
3445
|
+
cancel: (noop$2),
|
|
3446
|
+
complete: (noop$2),
|
|
3445
3447
|
};
|
|
3446
3448
|
};
|
|
3447
3449
|
return delay
|
|
@@ -5029,7 +5031,7 @@ function calcOrigin(source, target) {
|
|
|
5029
5031
|
else if (sourceLength > targetLength) {
|
|
5030
5032
|
origin = progress(source.min, source.max - targetLength, target.min);
|
|
5031
5033
|
}
|
|
5032
|
-
return clamp(0, 1, origin);
|
|
5034
|
+
return clamp$1(0, 1, origin);
|
|
5033
5035
|
}
|
|
5034
5036
|
/**
|
|
5035
5037
|
* Rebase the calculated viewport constraints relative to the layout.min point.
|
|
@@ -5719,8 +5721,8 @@ function getCurrentDirection(offset, lockThreshold = 10) {
|
|
|
5719
5721
|
class DragGesture extends Feature {
|
|
5720
5722
|
constructor(node) {
|
|
5721
5723
|
super(node);
|
|
5722
|
-
this.removeGroupControls = noop;
|
|
5723
|
-
this.removeListeners = noop;
|
|
5724
|
+
this.removeGroupControls = noop$2;
|
|
5725
|
+
this.removeListeners = noop$2;
|
|
5724
5726
|
this.controls = new VisualElementDragControls(node);
|
|
5725
5727
|
}
|
|
5726
5728
|
mount() {
|
|
@@ -5730,7 +5732,7 @@ class DragGesture extends Feature {
|
|
|
5730
5732
|
if (dragControls) {
|
|
5731
5733
|
this.removeGroupControls = dragControls.subscribe(this.controls);
|
|
5732
5734
|
}
|
|
5733
|
-
this.removeListeners = this.controls.addListeners() || noop;
|
|
5735
|
+
this.removeListeners = this.controls.addListeners() || noop$2;
|
|
5734
5736
|
}
|
|
5735
5737
|
unmount() {
|
|
5736
5738
|
this.removeGroupControls();
|
|
@@ -5746,7 +5748,7 @@ const asyncHandler = (handler) => (event, info) => {
|
|
|
5746
5748
|
class PanGesture extends Feature {
|
|
5747
5749
|
constructor() {
|
|
5748
5750
|
super(...arguments);
|
|
5749
|
-
this.removePointerDownListener = noop;
|
|
5751
|
+
this.removePointerDownListener = noop$2;
|
|
5750
5752
|
}
|
|
5751
5753
|
onPointerDown(pointerDownEvent) {
|
|
5752
5754
|
this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { transformPagePoint: this.node.getTransformPagePoint() });
|
|
@@ -6094,7 +6096,7 @@ function getRadius(values, radiusName) {
|
|
|
6094
6096
|
// )(p)
|
|
6095
6097
|
// }
|
|
6096
6098
|
const easeCrossfadeIn = compress(0, 0.5, circOut);
|
|
6097
|
-
const easeCrossfadeOut = compress(0.5, 0.95, noop);
|
|
6099
|
+
const easeCrossfadeOut = compress(0.5, 0.95, noop$2);
|
|
6098
6100
|
function compress(min, max, easing) {
|
|
6099
6101
|
return (p) => {
|
|
6100
6102
|
// Could replace ifs with clamp
|
|
@@ -6767,7 +6769,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6767
6769
|
* to leave a flash of incorrectly styled content.
|
|
6768
6770
|
*/
|
|
6769
6771
|
const now = performance.now();
|
|
6770
|
-
frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp);
|
|
6772
|
+
frameData.delta = clamp$1(0, 1000 / 60, now - frameData.timestamp);
|
|
6771
6773
|
frameData.timestamp = now;
|
|
6772
6774
|
frameData.isProcessing = true;
|
|
6773
6775
|
steps.update.process(frameData);
|
|
@@ -7851,7 +7853,7 @@ const userAgentContains = (string) => typeof navigator !== "undefined" &&
|
|
|
7851
7853
|
*/
|
|
7852
7854
|
const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/")
|
|
7853
7855
|
? Math.round
|
|
7854
|
-
: noop;
|
|
7856
|
+
: noop$2;
|
|
7855
7857
|
function roundAxis(axis) {
|
|
7856
7858
|
// Round to the nearest .5 pixels to support subpixel layouts
|
|
7857
7859
|
axis.min = roundPoint(axis.min);
|
|
@@ -8833,7 +8835,7 @@ class DOMVisualElement extends VisualElement {
|
|
|
8833
8835
|
}
|
|
8834
8836
|
}
|
|
8835
8837
|
|
|
8836
|
-
function getComputedStyle$
|
|
8838
|
+
function getComputedStyle$2(element) {
|
|
8837
8839
|
return window.getComputedStyle(element);
|
|
8838
8840
|
}
|
|
8839
8841
|
class HTMLVisualElement extends DOMVisualElement {
|
|
@@ -8843,7 +8845,7 @@ class HTMLVisualElement extends DOMVisualElement {
|
|
|
8843
8845
|
return defaultType ? defaultType.default || 0 : 0;
|
|
8844
8846
|
}
|
|
8845
8847
|
else {
|
|
8846
|
-
const computedStyle = getComputedStyle$
|
|
8848
|
+
const computedStyle = getComputedStyle$2(instance);
|
|
8847
8849
|
const value = (isCSSVariableName(key)
|
|
8848
8850
|
? computedStyle.getPropertyValue(key)
|
|
8849
8851
|
: computedStyle[key]) || 0;
|
|
@@ -11862,7 +11864,7 @@ const BreadcrumbsItemWrapper = styled__default.default.span`
|
|
|
11862
11864
|
}
|
|
11863
11865
|
}
|
|
11864
11866
|
`;
|
|
11865
|
-
var index$
|
|
11867
|
+
var index$6 = Object.assign(Breadcrumbs, {
|
|
11866
11868
|
Item: BreadcrumbsItem
|
|
11867
11869
|
});
|
|
11868
11870
|
|
|
@@ -16543,15 +16545,695 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
16543
16545
|
}
|
|
16544
16546
|
}));
|
|
16545
16547
|
|
|
16546
|
-
|
|
16548
|
+
function* iterateFocusableElements(container, options = {}) {
|
|
16549
|
+
var _a, _b;
|
|
16550
|
+
const strict = (_a = options.strict) !== null && _a !== void 0 ? _a : false;
|
|
16551
|
+
const acceptFn = ((_b = options.onlyTabbable) !== null && _b !== void 0 ? _b : false) ? isTabbable : isFocusable;
|
|
16552
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
16553
|
+
acceptNode: node => node instanceof HTMLElement && acceptFn(node, strict) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
|
|
16554
|
+
});
|
|
16555
|
+
let nextNode = null;
|
|
16556
|
+
if (!options.reverse && acceptFn(container, strict)) {
|
|
16557
|
+
yield container;
|
|
16558
|
+
}
|
|
16559
|
+
if (options.reverse) {
|
|
16560
|
+
let lastChild = walker.lastChild();
|
|
16561
|
+
while (lastChild) {
|
|
16562
|
+
nextNode = lastChild;
|
|
16563
|
+
lastChild = walker.lastChild();
|
|
16564
|
+
}
|
|
16565
|
+
} else {
|
|
16566
|
+
nextNode = walker.firstChild();
|
|
16567
|
+
}
|
|
16568
|
+
while (nextNode instanceof HTMLElement) {
|
|
16569
|
+
yield nextNode;
|
|
16570
|
+
nextNode = options.reverse ? walker.previousNode() : walker.nextNode();
|
|
16571
|
+
}
|
|
16572
|
+
if (options.reverse && acceptFn(container, strict)) {
|
|
16573
|
+
yield container;
|
|
16574
|
+
}
|
|
16575
|
+
return undefined;
|
|
16576
|
+
}
|
|
16577
|
+
function getFocusableChild(container, lastChild = false) {
|
|
16578
|
+
return iterateFocusableElements(container, {
|
|
16579
|
+
reverse: lastChild,
|
|
16580
|
+
strict: true,
|
|
16581
|
+
onlyTabbable: true
|
|
16582
|
+
}).next().value;
|
|
16583
|
+
}
|
|
16584
|
+
function isFocusable(elem, strict = false) {
|
|
16585
|
+
const disabledAttrInert = ['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA', 'OPTGROUP', 'OPTION', 'FIELDSET'].includes(elem.tagName) && elem.disabled;
|
|
16586
|
+
const hiddenInert = elem.hidden;
|
|
16587
|
+
const hiddenInputInert = elem instanceof HTMLInputElement && elem.type === 'hidden';
|
|
16588
|
+
const sentinelInert = elem.classList.contains('sentinel');
|
|
16589
|
+
if (disabledAttrInert || hiddenInert || hiddenInputInert || sentinelInert) {
|
|
16590
|
+
return false;
|
|
16591
|
+
}
|
|
16592
|
+
if (strict) {
|
|
16593
|
+
const sizeInert = elem.offsetWidth === 0 || elem.offsetHeight === 0;
|
|
16594
|
+
const visibilityInert = ['hidden', 'collapse'].includes(getComputedStyle(elem).visibility);
|
|
16595
|
+
const clientRectsInert = elem.getClientRects().length === 0;
|
|
16596
|
+
if (sizeInert || visibilityInert || clientRectsInert) {
|
|
16597
|
+
return false;
|
|
16598
|
+
}
|
|
16599
|
+
}
|
|
16600
|
+
if (elem.getAttribute('tabindex') != null) {
|
|
16601
|
+
return true;
|
|
16602
|
+
}
|
|
16603
|
+
if (elem instanceof HTMLAnchorElement && elem.getAttribute('href') == null) {
|
|
16604
|
+
return false;
|
|
16605
|
+
}
|
|
16606
|
+
return elem.tabIndex !== -1;
|
|
16607
|
+
}
|
|
16608
|
+
function isTabbable(elem, strict = false) {
|
|
16609
|
+
return isFocusable(elem, strict) && elem.getAttribute('tabindex') !== '-1';
|
|
16610
|
+
}
|
|
16611
|
+
|
|
16612
|
+
let signalSupported = false;
|
|
16613
|
+
function noop$1() {}
|
|
16614
|
+
try {
|
|
16615
|
+
const options = Object.create({}, {
|
|
16616
|
+
signal: {
|
|
16617
|
+
get() {
|
|
16618
|
+
signalSupported = true;
|
|
16619
|
+
}
|
|
16620
|
+
}
|
|
16621
|
+
});
|
|
16622
|
+
window.addEventListener('test', noop$1, options);
|
|
16623
|
+
window.removeEventListener('test', noop$1, options);
|
|
16624
|
+
} catch (e) {}
|
|
16625
|
+
function featureSupported() {
|
|
16626
|
+
return signalSupported;
|
|
16627
|
+
}
|
|
16628
|
+
function monkeyPatch() {
|
|
16629
|
+
if (typeof window === 'undefined') {
|
|
16630
|
+
return;
|
|
16631
|
+
}
|
|
16632
|
+
const originalAddEventListener = EventTarget.prototype.addEventListener;
|
|
16633
|
+
EventTarget.prototype.addEventListener = function (name, originalCallback, optionsOrCapture) {
|
|
16634
|
+
if (typeof optionsOrCapture === 'object' && 'signal' in optionsOrCapture && optionsOrCapture.signal instanceof AbortSignal) {
|
|
16635
|
+
originalAddEventListener.call(optionsOrCapture.signal, 'abort', () => {
|
|
16636
|
+
this.removeEventListener(name, originalCallback, optionsOrCapture);
|
|
16637
|
+
});
|
|
16638
|
+
}
|
|
16639
|
+
return originalAddEventListener.call(this, name, originalCallback, optionsOrCapture);
|
|
16640
|
+
};
|
|
16641
|
+
}
|
|
16642
|
+
function polyfill() {
|
|
16643
|
+
if (!featureSupported()) {
|
|
16644
|
+
monkeyPatch();
|
|
16645
|
+
signalSupported = true;
|
|
16646
|
+
}
|
|
16647
|
+
}
|
|
16547
16648
|
|
|
16548
|
-
|
|
16549
|
-
|
|
16649
|
+
polyfill();
|
|
16650
|
+
const suspendedTrapStack = [];
|
|
16651
|
+
let activeTrap = undefined;
|
|
16652
|
+
function tryReactivate() {
|
|
16653
|
+
const trapToReactivate = suspendedTrapStack.pop();
|
|
16654
|
+
if (trapToReactivate) {
|
|
16655
|
+
focusTrap(trapToReactivate.container, trapToReactivate.initialFocus, trapToReactivate.originalSignal);
|
|
16656
|
+
}
|
|
16657
|
+
}
|
|
16658
|
+
function followSignal(signal) {
|
|
16659
|
+
const controller = new AbortController();
|
|
16660
|
+
signal.addEventListener('abort', () => {
|
|
16661
|
+
controller.abort();
|
|
16662
|
+
});
|
|
16663
|
+
return controller;
|
|
16664
|
+
}
|
|
16665
|
+
function focusTrap(container, initialFocus, abortSignal) {
|
|
16666
|
+
const controller = new AbortController();
|
|
16667
|
+
const signal = abortSignal !== null && abortSignal !== void 0 ? abortSignal : controller.signal;
|
|
16668
|
+
container.setAttribute('data-focus-trap', 'active');
|
|
16669
|
+
const sentinelStart = document.createElement('span');
|
|
16670
|
+
sentinelStart.setAttribute('class', 'sentinel');
|
|
16671
|
+
sentinelStart.setAttribute('tabindex', '0');
|
|
16672
|
+
sentinelStart.setAttribute('aria-hidden', 'true');
|
|
16673
|
+
sentinelStart.onfocus = () => {
|
|
16674
|
+
const lastFocusableChild = getFocusableChild(container, true);
|
|
16675
|
+
lastFocusableChild === null || lastFocusableChild === void 0 ? void 0 : lastFocusableChild.focus();
|
|
16676
|
+
};
|
|
16677
|
+
const sentinelEnd = document.createElement('span');
|
|
16678
|
+
sentinelEnd.setAttribute('class', 'sentinel');
|
|
16679
|
+
sentinelEnd.setAttribute('tabindex', '0');
|
|
16680
|
+
sentinelEnd.setAttribute('aria-hidden', 'true');
|
|
16681
|
+
sentinelEnd.onfocus = () => {
|
|
16682
|
+
const firstFocusableChild = getFocusableChild(container);
|
|
16683
|
+
firstFocusableChild === null || firstFocusableChild === void 0 ? void 0 : firstFocusableChild.focus();
|
|
16684
|
+
};
|
|
16685
|
+
container.prepend(sentinelStart);
|
|
16686
|
+
container.append(sentinelEnd);
|
|
16687
|
+
let lastFocusedChild = undefined;
|
|
16688
|
+
function ensureTrapZoneHasFocus(focusedElement) {
|
|
16689
|
+
if (focusedElement instanceof HTMLElement && document.contains(container)) {
|
|
16690
|
+
if (container.contains(focusedElement)) {
|
|
16691
|
+
lastFocusedChild = focusedElement;
|
|
16692
|
+
return;
|
|
16693
|
+
} else {
|
|
16694
|
+
if (lastFocusedChild && isTabbable(lastFocusedChild) && container.contains(lastFocusedChild)) {
|
|
16695
|
+
lastFocusedChild.focus();
|
|
16696
|
+
return;
|
|
16697
|
+
} else if (initialFocus && container.contains(initialFocus)) {
|
|
16698
|
+
initialFocus.focus();
|
|
16699
|
+
return;
|
|
16700
|
+
} else {
|
|
16701
|
+
const firstFocusableChild = getFocusableChild(container);
|
|
16702
|
+
firstFocusableChild === null || firstFocusableChild === void 0 ? void 0 : firstFocusableChild.focus();
|
|
16703
|
+
return;
|
|
16704
|
+
}
|
|
16705
|
+
}
|
|
16706
|
+
}
|
|
16707
|
+
}
|
|
16708
|
+
const wrappingController = followSignal(signal);
|
|
16709
|
+
if (activeTrap) {
|
|
16710
|
+
const suspendedTrap = activeTrap;
|
|
16711
|
+
activeTrap.container.setAttribute('data-focus-trap', 'suspended');
|
|
16712
|
+
activeTrap.controller.abort();
|
|
16713
|
+
suspendedTrapStack.push(suspendedTrap);
|
|
16714
|
+
}
|
|
16715
|
+
wrappingController.signal.addEventListener('abort', () => {
|
|
16716
|
+
activeTrap = undefined;
|
|
16717
|
+
});
|
|
16718
|
+
signal.addEventListener('abort', () => {
|
|
16719
|
+
container.removeAttribute('data-focus-trap');
|
|
16720
|
+
const sentinels = container.getElementsByClassName('sentinel');
|
|
16721
|
+
while (sentinels.length > 0) sentinels[0].remove();
|
|
16722
|
+
const suspendedTrapIndex = suspendedTrapStack.findIndex(t => t.container === container);
|
|
16723
|
+
if (suspendedTrapIndex >= 0) {
|
|
16724
|
+
suspendedTrapStack.splice(suspendedTrapIndex, 1);
|
|
16725
|
+
}
|
|
16726
|
+
tryReactivate();
|
|
16727
|
+
});
|
|
16728
|
+
document.addEventListener('focus', event => {
|
|
16729
|
+
ensureTrapZoneHasFocus(event.target);
|
|
16730
|
+
}, {
|
|
16731
|
+
signal: wrappingController.signal,
|
|
16732
|
+
capture: true
|
|
16733
|
+
});
|
|
16734
|
+
ensureTrapZoneHasFocus(document.activeElement);
|
|
16735
|
+
activeTrap = {
|
|
16736
|
+
container,
|
|
16737
|
+
controller: wrappingController,
|
|
16738
|
+
initialFocus,
|
|
16739
|
+
originalSignal: signal
|
|
16740
|
+
};
|
|
16741
|
+
const suspendedTrapIndex = suspendedTrapStack.findIndex(t => t.container === container);
|
|
16742
|
+
if (suspendedTrapIndex >= 0) {
|
|
16743
|
+
suspendedTrapStack.splice(suspendedTrapIndex, 1);
|
|
16744
|
+
}
|
|
16745
|
+
if (!abortSignal) {
|
|
16746
|
+
return controller;
|
|
16747
|
+
}
|
|
16748
|
+
}
|
|
16749
|
+
|
|
16750
|
+
let isMac = undefined;
|
|
16751
|
+
function isMacOS() {
|
|
16752
|
+
if (isMac === undefined) {
|
|
16753
|
+
isMac = /^mac/i.test(window.navigator.platform);
|
|
16754
|
+
}
|
|
16755
|
+
return isMac;
|
|
16756
|
+
}
|
|
16757
|
+
|
|
16758
|
+
let idSeed = 10000;
|
|
16759
|
+
function uniqueId() {
|
|
16760
|
+
return `__primer_id_${idSeed++}`;
|
|
16761
|
+
}
|
|
16762
|
+
|
|
16763
|
+
polyfill();
|
|
16764
|
+
var FocusKeys;
|
|
16765
|
+
(function (FocusKeys) {
|
|
16766
|
+
FocusKeys[FocusKeys["ArrowHorizontal"] = 1] = "ArrowHorizontal";
|
|
16767
|
+
FocusKeys[FocusKeys["ArrowVertical"] = 2] = "ArrowVertical";
|
|
16768
|
+
FocusKeys[FocusKeys["JK"] = 4] = "JK";
|
|
16769
|
+
FocusKeys[FocusKeys["HL"] = 8] = "HL";
|
|
16770
|
+
FocusKeys[FocusKeys["HomeAndEnd"] = 16] = "HomeAndEnd";
|
|
16771
|
+
FocusKeys[FocusKeys["PageUpDown"] = 256] = "PageUpDown";
|
|
16772
|
+
FocusKeys[FocusKeys["WS"] = 32] = "WS";
|
|
16773
|
+
FocusKeys[FocusKeys["AD"] = 64] = "AD";
|
|
16774
|
+
FocusKeys[FocusKeys["Tab"] = 128] = "Tab";
|
|
16775
|
+
FocusKeys[FocusKeys["Backspace"] = 512] = "Backspace";
|
|
16776
|
+
FocusKeys[FocusKeys["ArrowAll"] = 3] = "ArrowAll";
|
|
16777
|
+
FocusKeys[FocusKeys["HJKL"] = 12] = "HJKL";
|
|
16778
|
+
FocusKeys[FocusKeys["WASD"] = 96] = "WASD";
|
|
16779
|
+
FocusKeys[FocusKeys["All"] = 511] = "All";
|
|
16780
|
+
})(FocusKeys || (FocusKeys = {}));
|
|
16781
|
+
const KEY_TO_BIT = {
|
|
16782
|
+
ArrowLeft: FocusKeys.ArrowHorizontal,
|
|
16783
|
+
ArrowDown: FocusKeys.ArrowVertical,
|
|
16784
|
+
ArrowUp: FocusKeys.ArrowVertical,
|
|
16785
|
+
ArrowRight: FocusKeys.ArrowHorizontal,
|
|
16786
|
+
h: FocusKeys.HL,
|
|
16787
|
+
j: FocusKeys.JK,
|
|
16788
|
+
k: FocusKeys.JK,
|
|
16789
|
+
l: FocusKeys.HL,
|
|
16790
|
+
a: FocusKeys.AD,
|
|
16791
|
+
s: FocusKeys.WS,
|
|
16792
|
+
w: FocusKeys.WS,
|
|
16793
|
+
d: FocusKeys.AD,
|
|
16794
|
+
Tab: FocusKeys.Tab,
|
|
16795
|
+
Home: FocusKeys.HomeAndEnd,
|
|
16796
|
+
End: FocusKeys.HomeAndEnd,
|
|
16797
|
+
PageUp: FocusKeys.PageUpDown,
|
|
16798
|
+
PageDown: FocusKeys.PageUpDown,
|
|
16799
|
+
Backspace: FocusKeys.Backspace
|
|
16800
|
+
};
|
|
16801
|
+
const KEY_TO_DIRECTION = {
|
|
16802
|
+
ArrowLeft: 'previous',
|
|
16803
|
+
ArrowDown: 'next',
|
|
16804
|
+
ArrowUp: 'previous',
|
|
16805
|
+
ArrowRight: 'next',
|
|
16806
|
+
h: 'previous',
|
|
16807
|
+
j: 'next',
|
|
16808
|
+
k: 'previous',
|
|
16809
|
+
l: 'next',
|
|
16810
|
+
a: 'previous',
|
|
16811
|
+
s: 'next',
|
|
16812
|
+
w: 'previous',
|
|
16813
|
+
d: 'next',
|
|
16814
|
+
Tab: 'next',
|
|
16815
|
+
Home: 'start',
|
|
16816
|
+
End: 'end',
|
|
16817
|
+
PageUp: 'start',
|
|
16818
|
+
PageDown: 'end',
|
|
16819
|
+
Backspace: 'previous'
|
|
16820
|
+
};
|
|
16821
|
+
function getDirection(keyboardEvent) {
|
|
16822
|
+
const direction = KEY_TO_DIRECTION[keyboardEvent.key];
|
|
16823
|
+
if (keyboardEvent.key === 'Tab' && keyboardEvent.shiftKey) {
|
|
16824
|
+
return 'previous';
|
|
16825
|
+
}
|
|
16826
|
+
const isMac = isMacOS();
|
|
16827
|
+
if (isMac && keyboardEvent.metaKey || !isMac && keyboardEvent.ctrlKey) {
|
|
16828
|
+
if (keyboardEvent.key === 'ArrowLeft' || keyboardEvent.key === 'ArrowUp') {
|
|
16829
|
+
return 'start';
|
|
16830
|
+
} else if (keyboardEvent.key === 'ArrowRight' || keyboardEvent.key === 'ArrowDown') {
|
|
16831
|
+
return 'end';
|
|
16832
|
+
}
|
|
16833
|
+
}
|
|
16834
|
+
return direction;
|
|
16550
16835
|
}
|
|
16551
|
-
function
|
|
16552
|
-
const
|
|
16553
|
-
|
|
16836
|
+
function shouldIgnoreFocusHandling(keyboardEvent, activeElement) {
|
|
16837
|
+
const key = keyboardEvent.key;
|
|
16838
|
+
const keyLength = [...key].length;
|
|
16839
|
+
const isTextInput = activeElement instanceof HTMLInputElement && activeElement.type === 'text' || activeElement instanceof HTMLTextAreaElement;
|
|
16840
|
+
if (isTextInput && (keyLength === 1 || key === 'Home' || key === 'End')) {
|
|
16841
|
+
return true;
|
|
16842
|
+
}
|
|
16843
|
+
if (activeElement instanceof HTMLSelectElement) {
|
|
16844
|
+
if (keyLength === 1) {
|
|
16845
|
+
return true;
|
|
16846
|
+
}
|
|
16847
|
+
if (key === 'ArrowDown' && isMacOS() && !keyboardEvent.metaKey) {
|
|
16848
|
+
return true;
|
|
16849
|
+
}
|
|
16850
|
+
if (key === 'ArrowDown' && !isMacOS() && keyboardEvent.altKey) {
|
|
16851
|
+
return true;
|
|
16852
|
+
}
|
|
16853
|
+
}
|
|
16854
|
+
if (activeElement instanceof HTMLTextAreaElement && (key === 'PageUp' || key === 'PageDown')) {
|
|
16855
|
+
return true;
|
|
16856
|
+
}
|
|
16857
|
+
if (isTextInput) {
|
|
16858
|
+
const textInput = activeElement;
|
|
16859
|
+
const cursorAtStart = textInput.selectionStart === 0 && textInput.selectionEnd === 0;
|
|
16860
|
+
const cursorAtEnd = textInput.selectionStart === textInput.value.length && textInput.selectionEnd === textInput.value.length;
|
|
16861
|
+
if (key === 'ArrowLeft' && !cursorAtStart) {
|
|
16862
|
+
return true;
|
|
16863
|
+
}
|
|
16864
|
+
if (key === 'ArrowRight' && !cursorAtEnd) {
|
|
16865
|
+
return true;
|
|
16866
|
+
}
|
|
16867
|
+
if (textInput instanceof HTMLTextAreaElement) {
|
|
16868
|
+
if (key === 'ArrowUp' && !cursorAtStart) {
|
|
16869
|
+
return true;
|
|
16870
|
+
}
|
|
16871
|
+
if (key === 'ArrowDown' && !cursorAtEnd) {
|
|
16872
|
+
return true;
|
|
16873
|
+
}
|
|
16874
|
+
}
|
|
16875
|
+
}
|
|
16876
|
+
return false;
|
|
16877
|
+
}
|
|
16878
|
+
const isActiveDescendantAttribute = 'data-is-active-descendant';
|
|
16879
|
+
const activeDescendantActivatedDirectly = 'activated-directly';
|
|
16880
|
+
const activeDescendantActivatedIndirectly = 'activated-indirectly';
|
|
16881
|
+
const hasActiveDescendantAttribute = 'data-has-active-descendant';
|
|
16882
|
+
function focusZone(container, settings) {
|
|
16883
|
+
var _a, _b, _c, _d, _e;
|
|
16884
|
+
const focusableElements = [];
|
|
16885
|
+
const savedTabIndex = new WeakMap();
|
|
16886
|
+
const bindKeys = (_a = settings === null || settings === void 0 ? void 0 : settings.bindKeys) !== null && _a !== void 0 ? _a : ((settings === null || settings === void 0 ? void 0 : settings.getNextFocusable) ? FocusKeys.ArrowAll : FocusKeys.ArrowVertical) | FocusKeys.HomeAndEnd;
|
|
16887
|
+
const focusOutBehavior = (_b = settings === null || settings === void 0 ? void 0 : settings.focusOutBehavior) !== null && _b !== void 0 ? _b : 'stop';
|
|
16888
|
+
const focusInStrategy = (_c = settings === null || settings === void 0 ? void 0 : settings.focusInStrategy) !== null && _c !== void 0 ? _c : 'previous';
|
|
16889
|
+
const activeDescendantControl = settings === null || settings === void 0 ? void 0 : settings.activeDescendantControl;
|
|
16890
|
+
const activeDescendantCallback = settings === null || settings === void 0 ? void 0 : settings.onActiveDescendantChanged;
|
|
16891
|
+
let currentFocusedElement;
|
|
16892
|
+
const preventScroll = (_d = settings === null || settings === void 0 ? void 0 : settings.preventScroll) !== null && _d !== void 0 ? _d : false;
|
|
16893
|
+
function getFirstFocusableElement() {
|
|
16894
|
+
return focusableElements[0];
|
|
16895
|
+
}
|
|
16896
|
+
function isActiveDescendantInputFocused() {
|
|
16897
|
+
return document.activeElement === activeDescendantControl;
|
|
16898
|
+
}
|
|
16899
|
+
function updateFocusedElement(to, directlyActivated = false) {
|
|
16900
|
+
const from = currentFocusedElement;
|
|
16901
|
+
currentFocusedElement = to;
|
|
16902
|
+
if (activeDescendantControl) {
|
|
16903
|
+
if (to && isActiveDescendantInputFocused()) {
|
|
16904
|
+
setActiveDescendant(from, to, directlyActivated);
|
|
16905
|
+
} else {
|
|
16906
|
+
clearActiveDescendant();
|
|
16907
|
+
}
|
|
16908
|
+
return;
|
|
16909
|
+
}
|
|
16910
|
+
if (from && from !== to && savedTabIndex.has(from)) {
|
|
16911
|
+
from.setAttribute('tabindex', '-1');
|
|
16912
|
+
}
|
|
16913
|
+
to === null || to === void 0 ? void 0 : to.setAttribute('tabindex', '0');
|
|
16914
|
+
}
|
|
16915
|
+
function setActiveDescendant(from, to, directlyActivated = false) {
|
|
16916
|
+
if (!to.id) {
|
|
16917
|
+
to.setAttribute('id', uniqueId());
|
|
16918
|
+
}
|
|
16919
|
+
if (from && from !== to) {
|
|
16920
|
+
from.removeAttribute(isActiveDescendantAttribute);
|
|
16921
|
+
}
|
|
16922
|
+
if (!activeDescendantControl || !directlyActivated && activeDescendantControl.getAttribute('aria-activedescendant') === to.id) {
|
|
16923
|
+
return;
|
|
16924
|
+
}
|
|
16925
|
+
activeDescendantControl.setAttribute('aria-activedescendant', to.id);
|
|
16926
|
+
container.setAttribute(hasActiveDescendantAttribute, to.id);
|
|
16927
|
+
to.setAttribute(isActiveDescendantAttribute, directlyActivated ? activeDescendantActivatedDirectly : activeDescendantActivatedIndirectly);
|
|
16928
|
+
activeDescendantCallback === null || activeDescendantCallback === void 0 ? void 0 : activeDescendantCallback(to, from, directlyActivated);
|
|
16929
|
+
}
|
|
16930
|
+
function clearActiveDescendant(previouslyActiveElement = currentFocusedElement) {
|
|
16931
|
+
if (focusInStrategy === 'first') {
|
|
16932
|
+
currentFocusedElement = undefined;
|
|
16933
|
+
}
|
|
16934
|
+
activeDescendantControl === null || activeDescendantControl === void 0 ? void 0 : activeDescendantControl.removeAttribute('aria-activedescendant');
|
|
16935
|
+
container.removeAttribute(hasActiveDescendantAttribute);
|
|
16936
|
+
previouslyActiveElement === null || previouslyActiveElement === void 0 ? void 0 : previouslyActiveElement.removeAttribute(isActiveDescendantAttribute);
|
|
16937
|
+
activeDescendantCallback === null || activeDescendantCallback === void 0 ? void 0 : activeDescendantCallback(undefined, previouslyActiveElement, false);
|
|
16938
|
+
}
|
|
16939
|
+
function beginFocusManagement(...elements) {
|
|
16940
|
+
const filteredElements = elements.filter(e => {
|
|
16941
|
+
var _a, _b;
|
|
16942
|
+
return (_b = (_a = settings === null || settings === void 0 ? void 0 : settings.focusableElementFilter) === null || _a === void 0 ? void 0 : _a.call(settings, e)) !== null && _b !== void 0 ? _b : true;
|
|
16943
|
+
});
|
|
16944
|
+
if (filteredElements.length === 0) {
|
|
16945
|
+
return;
|
|
16946
|
+
}
|
|
16947
|
+
focusableElements.splice(findInsertionIndex(filteredElements), 0, ...filteredElements);
|
|
16948
|
+
for (const element of filteredElements) {
|
|
16949
|
+
if (!savedTabIndex.has(element)) {
|
|
16950
|
+
savedTabIndex.set(element, element.getAttribute('tabindex'));
|
|
16951
|
+
}
|
|
16952
|
+
element.setAttribute('tabindex', '-1');
|
|
16953
|
+
}
|
|
16954
|
+
if (!currentFocusedElement) {
|
|
16955
|
+
updateFocusedElement(getFirstFocusableElement());
|
|
16956
|
+
}
|
|
16957
|
+
}
|
|
16958
|
+
function findInsertionIndex(elementsToInsert) {
|
|
16959
|
+
const firstElementToInsert = elementsToInsert[0];
|
|
16960
|
+
if (focusableElements.length === 0) return 0;
|
|
16961
|
+
let iMin = 0;
|
|
16962
|
+
let iMax = focusableElements.length - 1;
|
|
16963
|
+
while (iMin <= iMax) {
|
|
16964
|
+
const i = Math.floor((iMin + iMax) / 2);
|
|
16965
|
+
const element = focusableElements[i];
|
|
16966
|
+
if (followsInDocument(firstElementToInsert, element)) {
|
|
16967
|
+
iMax = i - 1;
|
|
16968
|
+
} else {
|
|
16969
|
+
iMin = i + 1;
|
|
16970
|
+
}
|
|
16971
|
+
}
|
|
16972
|
+
return iMin;
|
|
16973
|
+
}
|
|
16974
|
+
function followsInDocument(first, second) {
|
|
16975
|
+
return (second.compareDocumentPosition(first) & Node.DOCUMENT_POSITION_PRECEDING) > 0;
|
|
16976
|
+
}
|
|
16977
|
+
function endFocusManagement(...elements) {
|
|
16978
|
+
for (const element of elements) {
|
|
16979
|
+
const focusableElementIndex = focusableElements.indexOf(element);
|
|
16980
|
+
if (focusableElementIndex >= 0) {
|
|
16981
|
+
focusableElements.splice(focusableElementIndex, 1);
|
|
16982
|
+
}
|
|
16983
|
+
const savedIndex = savedTabIndex.get(element);
|
|
16984
|
+
if (savedIndex !== undefined) {
|
|
16985
|
+
if (savedIndex === null) {
|
|
16986
|
+
element.removeAttribute('tabindex');
|
|
16987
|
+
} else {
|
|
16988
|
+
element.setAttribute('tabindex', savedIndex);
|
|
16989
|
+
}
|
|
16990
|
+
savedTabIndex.delete(element);
|
|
16991
|
+
}
|
|
16992
|
+
if (element === currentFocusedElement) {
|
|
16993
|
+
const nextElementToFocus = getFirstFocusableElement();
|
|
16994
|
+
updateFocusedElement(nextElementToFocus);
|
|
16995
|
+
}
|
|
16996
|
+
}
|
|
16997
|
+
}
|
|
16998
|
+
beginFocusManagement(...iterateFocusableElements(container));
|
|
16999
|
+
const initialElement = typeof focusInStrategy === 'function' ? focusInStrategy(document.body) : getFirstFocusableElement();
|
|
17000
|
+
updateFocusedElement(initialElement);
|
|
17001
|
+
const observer = new MutationObserver(mutations => {
|
|
17002
|
+
for (const mutation of mutations) {
|
|
17003
|
+
for (const removedNode of mutation.removedNodes) {
|
|
17004
|
+
if (removedNode instanceof HTMLElement) {
|
|
17005
|
+
endFocusManagement(...iterateFocusableElements(removedNode));
|
|
17006
|
+
}
|
|
17007
|
+
}
|
|
17008
|
+
}
|
|
17009
|
+
for (const mutation of mutations) {
|
|
17010
|
+
for (const addedNode of mutation.addedNodes) {
|
|
17011
|
+
if (addedNode instanceof HTMLElement) {
|
|
17012
|
+
beginFocusManagement(...iterateFocusableElements(addedNode));
|
|
17013
|
+
}
|
|
17014
|
+
}
|
|
17015
|
+
}
|
|
17016
|
+
});
|
|
17017
|
+
observer.observe(container, {
|
|
17018
|
+
subtree: true,
|
|
17019
|
+
childList: true
|
|
17020
|
+
});
|
|
17021
|
+
const controller = new AbortController();
|
|
17022
|
+
const signal = (_e = settings === null || settings === void 0 ? void 0 : settings.abortSignal) !== null && _e !== void 0 ? _e : controller.signal;
|
|
17023
|
+
signal.addEventListener('abort', () => {
|
|
17024
|
+
endFocusManagement(...focusableElements);
|
|
17025
|
+
});
|
|
17026
|
+
let elementIndexFocusedByClick = undefined;
|
|
17027
|
+
container.addEventListener('mousedown', event => {
|
|
17028
|
+
if (event.target instanceof HTMLElement && event.target !== document.activeElement) {
|
|
17029
|
+
elementIndexFocusedByClick = focusableElements.indexOf(event.target);
|
|
17030
|
+
}
|
|
17031
|
+
}, {
|
|
17032
|
+
signal
|
|
17033
|
+
});
|
|
17034
|
+
if (activeDescendantControl) {
|
|
17035
|
+
container.addEventListener('focusin', event => {
|
|
17036
|
+
if (event.target instanceof HTMLElement && focusableElements.includes(event.target)) {
|
|
17037
|
+
activeDescendantControl.focus({
|
|
17038
|
+
preventScroll
|
|
17039
|
+
});
|
|
17040
|
+
updateFocusedElement(event.target);
|
|
17041
|
+
}
|
|
17042
|
+
});
|
|
17043
|
+
container.addEventListener('mousemove', ({
|
|
17044
|
+
target
|
|
17045
|
+
}) => {
|
|
17046
|
+
if (!(target instanceof Node)) {
|
|
17047
|
+
return;
|
|
17048
|
+
}
|
|
17049
|
+
const focusableElement = focusableElements.find(element => element.contains(target));
|
|
17050
|
+
if (focusableElement) {
|
|
17051
|
+
updateFocusedElement(focusableElement);
|
|
17052
|
+
}
|
|
17053
|
+
}, {
|
|
17054
|
+
signal,
|
|
17055
|
+
capture: true
|
|
17056
|
+
});
|
|
17057
|
+
activeDescendantControl.addEventListener('focusin', () => {
|
|
17058
|
+
if (!currentFocusedElement) {
|
|
17059
|
+
updateFocusedElement(getFirstFocusableElement());
|
|
17060
|
+
} else {
|
|
17061
|
+
setActiveDescendant(undefined, currentFocusedElement);
|
|
17062
|
+
}
|
|
17063
|
+
});
|
|
17064
|
+
activeDescendantControl.addEventListener('focusout', () => {
|
|
17065
|
+
clearActiveDescendant();
|
|
17066
|
+
});
|
|
17067
|
+
} else {
|
|
17068
|
+
container.addEventListener('focusin', event => {
|
|
17069
|
+
if (event.target instanceof HTMLElement) {
|
|
17070
|
+
if (elementIndexFocusedByClick !== undefined) {
|
|
17071
|
+
if (elementIndexFocusedByClick >= 0) {
|
|
17072
|
+
if (focusableElements[elementIndexFocusedByClick] !== currentFocusedElement) {
|
|
17073
|
+
updateFocusedElement(focusableElements[elementIndexFocusedByClick]);
|
|
17074
|
+
}
|
|
17075
|
+
}
|
|
17076
|
+
elementIndexFocusedByClick = undefined;
|
|
17077
|
+
} else {
|
|
17078
|
+
if (focusInStrategy === 'previous') {
|
|
17079
|
+
updateFocusedElement(event.target);
|
|
17080
|
+
} else if (focusInStrategy === 'closest' || focusInStrategy === 'first') {
|
|
17081
|
+
if (event.relatedTarget instanceof Element && !container.contains(event.relatedTarget)) {
|
|
17082
|
+
const targetElementIndex = lastKeyboardFocusDirection === 'previous' ? focusableElements.length - 1 : 0;
|
|
17083
|
+
const targetElement = focusableElements[targetElementIndex];
|
|
17084
|
+
targetElement === null || targetElement === void 0 ? void 0 : targetElement.focus({
|
|
17085
|
+
preventScroll
|
|
17086
|
+
});
|
|
17087
|
+
return;
|
|
17088
|
+
} else {
|
|
17089
|
+
updateFocusedElement(event.target);
|
|
17090
|
+
}
|
|
17091
|
+
} else if (typeof focusInStrategy === 'function') {
|
|
17092
|
+
if (event.relatedTarget instanceof Element && !container.contains(event.relatedTarget)) {
|
|
17093
|
+
const elementToFocus = focusInStrategy(event.relatedTarget);
|
|
17094
|
+
const requestedFocusElementIndex = elementToFocus ? focusableElements.indexOf(elementToFocus) : -1;
|
|
17095
|
+
if (requestedFocusElementIndex >= 0 && elementToFocus instanceof HTMLElement) {
|
|
17096
|
+
elementToFocus.focus({
|
|
17097
|
+
preventScroll
|
|
17098
|
+
});
|
|
17099
|
+
return;
|
|
17100
|
+
} else {
|
|
17101
|
+
console.warn('Element requested is not a known focusable element.');
|
|
17102
|
+
}
|
|
17103
|
+
} else {
|
|
17104
|
+
updateFocusedElement(event.target);
|
|
17105
|
+
}
|
|
17106
|
+
}
|
|
17107
|
+
}
|
|
17108
|
+
}
|
|
17109
|
+
lastKeyboardFocusDirection = undefined;
|
|
17110
|
+
}, {
|
|
17111
|
+
signal
|
|
17112
|
+
});
|
|
17113
|
+
}
|
|
17114
|
+
const keyboardEventRecipient = activeDescendantControl !== null && activeDescendantControl !== void 0 ? activeDescendantControl : container;
|
|
17115
|
+
let lastKeyboardFocusDirection = undefined;
|
|
17116
|
+
if (focusInStrategy === 'closest') {
|
|
17117
|
+
document.addEventListener('keydown', event => {
|
|
17118
|
+
if (event.key === 'Tab') {
|
|
17119
|
+
lastKeyboardFocusDirection = getDirection(event);
|
|
17120
|
+
}
|
|
17121
|
+
}, {
|
|
17122
|
+
signal,
|
|
17123
|
+
capture: true
|
|
17124
|
+
});
|
|
17125
|
+
}
|
|
17126
|
+
function getCurrentFocusedIndex() {
|
|
17127
|
+
if (!currentFocusedElement) {
|
|
17128
|
+
return 0;
|
|
17129
|
+
}
|
|
17130
|
+
const focusedIndex = focusableElements.indexOf(currentFocusedElement);
|
|
17131
|
+
const fallbackIndex = currentFocusedElement === container ? -1 : 0;
|
|
17132
|
+
return focusedIndex !== -1 ? focusedIndex : fallbackIndex;
|
|
17133
|
+
}
|
|
17134
|
+
keyboardEventRecipient.addEventListener('keydown', event => {
|
|
17135
|
+
var _a;
|
|
17136
|
+
if (event.key in KEY_TO_DIRECTION) {
|
|
17137
|
+
const keyBit = KEY_TO_BIT[event.key];
|
|
17138
|
+
if (!event.defaultPrevented && (keyBit & bindKeys) > 0 && !shouldIgnoreFocusHandling(event, document.activeElement)) {
|
|
17139
|
+
const direction = getDirection(event);
|
|
17140
|
+
let nextElementToFocus = undefined;
|
|
17141
|
+
if (settings === null || settings === void 0 ? void 0 : settings.getNextFocusable) {
|
|
17142
|
+
nextElementToFocus = settings.getNextFocusable(direction, (_a = document.activeElement) !== null && _a !== void 0 ? _a : undefined, event);
|
|
17143
|
+
}
|
|
17144
|
+
if (!nextElementToFocus) {
|
|
17145
|
+
const lastFocusedIndex = getCurrentFocusedIndex();
|
|
17146
|
+
let nextFocusedIndex = lastFocusedIndex;
|
|
17147
|
+
if (direction === 'previous') {
|
|
17148
|
+
nextFocusedIndex -= 1;
|
|
17149
|
+
} else if (direction === 'start') {
|
|
17150
|
+
nextFocusedIndex = 0;
|
|
17151
|
+
} else if (direction === 'next') {
|
|
17152
|
+
nextFocusedIndex += 1;
|
|
17153
|
+
} else {
|
|
17154
|
+
nextFocusedIndex = focusableElements.length - 1;
|
|
17155
|
+
}
|
|
17156
|
+
if (nextFocusedIndex < 0) {
|
|
17157
|
+
if (focusOutBehavior === 'wrap' && event.key !== 'Tab') {
|
|
17158
|
+
nextFocusedIndex = focusableElements.length - 1;
|
|
17159
|
+
} else {
|
|
17160
|
+
nextFocusedIndex = 0;
|
|
17161
|
+
}
|
|
17162
|
+
}
|
|
17163
|
+
if (nextFocusedIndex >= focusableElements.length) {
|
|
17164
|
+
if (focusOutBehavior === 'wrap' && event.key !== 'Tab') {
|
|
17165
|
+
nextFocusedIndex = 0;
|
|
17166
|
+
} else {
|
|
17167
|
+
nextFocusedIndex = focusableElements.length - 1;
|
|
17168
|
+
}
|
|
17169
|
+
}
|
|
17170
|
+
if (lastFocusedIndex !== nextFocusedIndex) {
|
|
17171
|
+
nextElementToFocus = focusableElements[nextFocusedIndex];
|
|
17172
|
+
}
|
|
17173
|
+
}
|
|
17174
|
+
if (activeDescendantControl) {
|
|
17175
|
+
updateFocusedElement(nextElementToFocus || currentFocusedElement, true);
|
|
17176
|
+
} else if (nextElementToFocus) {
|
|
17177
|
+
lastKeyboardFocusDirection = direction;
|
|
17178
|
+
nextElementToFocus.focus({
|
|
17179
|
+
preventScroll
|
|
17180
|
+
});
|
|
17181
|
+
}
|
|
17182
|
+
if (event.key !== 'Tab' || nextElementToFocus) {
|
|
17183
|
+
event.preventDefault();
|
|
17184
|
+
}
|
|
17185
|
+
}
|
|
17186
|
+
}
|
|
17187
|
+
}, {
|
|
17188
|
+
signal
|
|
17189
|
+
});
|
|
17190
|
+
return controller;
|
|
16554
17191
|
}
|
|
17192
|
+
|
|
17193
|
+
/**
|
|
17194
|
+
* 제공된 `ref`가 없는 경우 새로운 `ref`를 만들어 사용하고, 있는 경우 제공된 ref를 사용할 수 있는 훅입니다.
|
|
17195
|
+
*/
|
|
17196
|
+
const useProvidedOrCreatedRef = providedRef => {
|
|
17197
|
+
const createdRef = React.useRef(null);
|
|
17198
|
+
return providedRef ?? createdRef;
|
|
17199
|
+
};
|
|
17200
|
+
|
|
17201
|
+
const useFocusTrap = (settings, dependencies = []) => {
|
|
17202
|
+
const containerRef = useProvidedOrCreatedRef(settings?.containerRef);
|
|
17203
|
+
const initialFocusRef = useProvidedOrCreatedRef(settings?.initialFocusRef);
|
|
17204
|
+
const disabled = settings?.disabled;
|
|
17205
|
+
const abortController = React__namespace.default.useRef();
|
|
17206
|
+
const previousFocusedElement = React__namespace.default.useRef(null);
|
|
17207
|
+
if (!previousFocusedElement.current && !settings?.disabled) {
|
|
17208
|
+
previousFocusedElement.current = document.activeElement;
|
|
17209
|
+
}
|
|
17210
|
+
const disableTrap = () => {
|
|
17211
|
+
abortController.current?.abort();
|
|
17212
|
+
if (settings?.restoreFocusOnCleanUp && previousFocusedElement.current instanceof HTMLElement) {
|
|
17213
|
+
previousFocusedElement.current.focus();
|
|
17214
|
+
previousFocusedElement.current = null;
|
|
17215
|
+
}
|
|
17216
|
+
};
|
|
17217
|
+
React__namespace.default.useEffect(() => {
|
|
17218
|
+
if (containerRef.current instanceof HTMLElement) {
|
|
17219
|
+
if (!disabled) {
|
|
17220
|
+
abortController.current = focusTrap(containerRef.current, initialFocusRef.current ?? undefined);
|
|
17221
|
+
return () => {
|
|
17222
|
+
disableTrap();
|
|
17223
|
+
};
|
|
17224
|
+
} else {
|
|
17225
|
+
disableTrap();
|
|
17226
|
+
}
|
|
17227
|
+
}
|
|
17228
|
+
}, [containerRef, initialFocusRef, disabled, ...dependencies]);
|
|
17229
|
+
return {
|
|
17230
|
+
containerRef,
|
|
17231
|
+
initialFocusRef
|
|
17232
|
+
};
|
|
17233
|
+
};
|
|
17234
|
+
|
|
17235
|
+
const MotionView = motion(View);
|
|
17236
|
+
|
|
16555
17237
|
const Dialog = ({
|
|
16556
17238
|
children,
|
|
16557
17239
|
isOpen,
|
|
@@ -16571,41 +17253,19 @@ const Dialog = ({
|
|
|
16571
17253
|
handleDismiss?.();
|
|
16572
17254
|
}
|
|
16573
17255
|
}, [handleDismiss, dialogRef, overlayRef]);
|
|
16574
|
-
const getFocusableItem = React.useCallback((e, movement) => {
|
|
16575
|
-
if (dialogRef.current) {
|
|
16576
|
-
const items = Array.from(dialogRef.current.querySelectorAll('*')).filter(focusable);
|
|
16577
|
-
if (items.length === 0) return;
|
|
16578
|
-
e.preventDefault();
|
|
16579
|
-
const focusedElement = document.activeElement;
|
|
16580
|
-
if (!focusedElement) {
|
|
16581
|
-
return;
|
|
16582
|
-
}
|
|
16583
|
-
const index = items.indexOf(focusedElement);
|
|
16584
|
-
const offsetIndex = index + movement;
|
|
16585
|
-
const fallbackIndex = movement === 1 ? 0 : items.length - 1;
|
|
16586
|
-
const focusableItem = items[offsetIndex] || items[fallbackIndex];
|
|
16587
|
-
return focusableItem;
|
|
16588
|
-
}
|
|
16589
|
-
}, [dialogRef]);
|
|
16590
|
-
const handleTab = React.useCallback(e => {
|
|
16591
|
-
const movement = e.shiftKey ? -1 : 1;
|
|
16592
|
-
const focusableItem = getFocusableItem(e, movement);
|
|
16593
|
-
if (!focusableItem) {
|
|
16594
|
-
return;
|
|
16595
|
-
}
|
|
16596
|
-
focusableItem.focus();
|
|
16597
|
-
}, [getFocusableItem]);
|
|
16598
17256
|
const handleKeyDown = React.useCallback(event => {
|
|
16599
17257
|
switch (event.key) {
|
|
16600
|
-
case 'Tab':
|
|
16601
|
-
handleTab(event);
|
|
16602
|
-
break;
|
|
16603
17258
|
case 'Escape':
|
|
16604
17259
|
handleDismiss?.();
|
|
16605
17260
|
event.stopPropagation();
|
|
16606
17261
|
break;
|
|
16607
17262
|
}
|
|
16608
17263
|
}, [handleDismiss]);
|
|
17264
|
+
useFocusTrap({
|
|
17265
|
+
containerRef: dialogRef,
|
|
17266
|
+
initialFocusRef: closeButtonRef,
|
|
17267
|
+
disabled: !isOpen
|
|
17268
|
+
});
|
|
16609
17269
|
React.useEffect(() => {
|
|
16610
17270
|
if (isOpen) {
|
|
16611
17271
|
document.addEventListener('click', handleOutsideClick);
|
|
@@ -16651,7 +17311,7 @@ const Dialog = ({
|
|
|
16651
17311
|
height: '100%',
|
|
16652
17312
|
zIndex: 9999
|
|
16653
17313
|
},
|
|
16654
|
-
children: [/*#__PURE__*/jsxRuntimeExports.jsx(
|
|
17314
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsx(Blanket, {
|
|
16655
17315
|
ref: overlayRef
|
|
16656
17316
|
}), /*#__PURE__*/jsxRuntimeExports.jsxs(BaseDialog, {
|
|
16657
17317
|
ref: dialogRef,
|
|
@@ -16695,7 +17355,7 @@ const Dialog = ({
|
|
|
16695
17355
|
}) : null
|
|
16696
17356
|
});
|
|
16697
17357
|
};
|
|
16698
|
-
const
|
|
17358
|
+
const Blanket = styled__default.default.span`
|
|
16699
17359
|
&:before {
|
|
16700
17360
|
position: fixed;
|
|
16701
17361
|
top: 0;
|
|
@@ -16716,7 +17376,7 @@ const BaseDialog = styled__default.default.div(() => ({
|
|
|
16716
17376
|
overflow: 'hidden',
|
|
16717
17377
|
margin: 'auto'
|
|
16718
17378
|
}), sx);
|
|
16719
|
-
var index$
|
|
17379
|
+
var index$5 = /*#__PURE__*/React.forwardRef(Dialog);
|
|
16720
17380
|
|
|
16721
17381
|
const useDialogHandler = () => {
|
|
16722
17382
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
@@ -17041,68 +17701,2512 @@ const ItemList = ({
|
|
|
17041
17701
|
});
|
|
17042
17702
|
};
|
|
17043
17703
|
|
|
17044
|
-
const
|
|
17045
|
-
width: inherit;
|
|
17046
|
-
${space$1};
|
|
17047
|
-
${sx}
|
|
17048
|
-
`;
|
|
17049
|
-
|
|
17050
|
-
const Stack = /*#__PURE__*/React.forwardRef(({
|
|
17051
|
-
gapX = 0,
|
|
17052
|
-
gapY = 0,
|
|
17053
|
-
children,
|
|
17054
|
-
alignItems = 'center',
|
|
17055
|
-
...props
|
|
17056
|
-
}, ref) => /*#__PURE__*/jsxRuntimeExports.jsx(BaseStack, {
|
|
17057
|
-
ref: ref,
|
|
17058
|
-
alignItems: alignItems,
|
|
17059
|
-
gapX: gapX,
|
|
17060
|
-
gapY: gapY,
|
|
17061
|
-
...props,
|
|
17062
|
-
children: children
|
|
17063
|
-
}));
|
|
17064
|
-
const BaseStack = styled__default.default(View)({
|
|
17065
|
-
display: 'flex',
|
|
17066
|
-
flexDirection: 'row',
|
|
17067
|
-
flexWrap: 'wrap'
|
|
17068
|
-
}, variant({
|
|
17069
|
-
prop: 'gapX',
|
|
17070
|
-
variants: Object.fromEntries(Object.entries(space).map(([key, value]) => {
|
|
17071
|
-
const styleValue = {
|
|
17072
|
-
'& > *': {
|
|
17073
|
-
px: forcePixelValue(value / 2)
|
|
17074
|
-
},
|
|
17075
|
-
'mx': forcePixelValue(-value / 2)
|
|
17076
|
-
};
|
|
17077
|
-
return [key, styleValue];
|
|
17078
|
-
}))
|
|
17079
|
-
}), variant({
|
|
17080
|
-
prop: 'gapY',
|
|
17081
|
-
variants: Object.fromEntries(Object.entries(space).map(([key, value]) => {
|
|
17082
|
-
const styleValue = {
|
|
17083
|
-
'& > *': {
|
|
17084
|
-
mt: forcePixelValue(value)
|
|
17085
|
-
},
|
|
17086
|
-
'mt': forcePixelValue(-value)
|
|
17087
|
-
};
|
|
17088
|
-
return [key, styleValue];
|
|
17089
|
-
}))
|
|
17090
|
-
}));
|
|
17091
|
-
const Item = ({
|
|
17704
|
+
const Overlay = ({
|
|
17092
17705
|
children,
|
|
17706
|
+
isOpen,
|
|
17707
|
+
onDismiss,
|
|
17708
|
+
size = 'm',
|
|
17709
|
+
ignoreOutsideClickRefs = [],
|
|
17710
|
+
...props
|
|
17711
|
+
}, ref) => {
|
|
17712
|
+
const overlayRef = React.useRef(null);
|
|
17713
|
+
React.useImperativeHandle(ref, () => overlayRef.current);
|
|
17714
|
+
const handleDismiss = React.useCallback(() => onDismiss?.(), [onDismiss]);
|
|
17715
|
+
const handleOutsideClick = React.useCallback(e => {
|
|
17716
|
+
if (overlayRef.current && e.target instanceof Node && !overlayRef.current.contains(e.target) && ignoreOutsideClickRefs && !ignoreOutsideClickRefs.some(({
|
|
17717
|
+
current
|
|
17718
|
+
}) => current?.contains(e.target))) {
|
|
17719
|
+
handleDismiss?.();
|
|
17720
|
+
}
|
|
17721
|
+
}, [handleDismiss, overlayRef]);
|
|
17722
|
+
const handleKeyDown = React.useCallback(event => {
|
|
17723
|
+
switch (event.key) {
|
|
17724
|
+
case 'Escape':
|
|
17725
|
+
handleDismiss?.();
|
|
17726
|
+
event.stopPropagation();
|
|
17727
|
+
break;
|
|
17728
|
+
}
|
|
17729
|
+
}, [handleDismiss]);
|
|
17730
|
+
React.useEffect(() => {
|
|
17731
|
+
if (overlayRef.current) {
|
|
17732
|
+
const firstItem = iterateFocusableElements(overlayRef.current).next().value;
|
|
17733
|
+
firstItem?.focus();
|
|
17734
|
+
}
|
|
17735
|
+
}, [isOpen]);
|
|
17736
|
+
React.useEffect(() => {
|
|
17737
|
+
if (isOpen) {
|
|
17738
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
17739
|
+
return () => {
|
|
17740
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
17741
|
+
};
|
|
17742
|
+
}
|
|
17743
|
+
}, [isOpen, handleKeyDown]);
|
|
17744
|
+
React.useEffect(() => {
|
|
17745
|
+
if (isOpen) {
|
|
17746
|
+
document.addEventListener('click', handleOutsideClick);
|
|
17747
|
+
return () => {
|
|
17748
|
+
document.removeEventListener('click', handleOutsideClick);
|
|
17749
|
+
};
|
|
17750
|
+
}
|
|
17751
|
+
}, [isOpen, handleOutsideClick]);
|
|
17752
|
+
return isOpen ? /*#__PURE__*/jsxRuntimeExports.jsx(BaseOverlay, {
|
|
17753
|
+
ref: overlayRef,
|
|
17754
|
+
size: size,
|
|
17755
|
+
...props,
|
|
17756
|
+
children: children
|
|
17757
|
+
}) : null;
|
|
17758
|
+
};
|
|
17759
|
+
const BaseOverlay = styled__default.default.div`
|
|
17760
|
+
position: absolute;
|
|
17761
|
+
box-shadow: ${({
|
|
17762
|
+
theme
|
|
17763
|
+
}) => theme.shadows['shadow/overlay']};
|
|
17764
|
+
background-color: ${({
|
|
17765
|
+
theme
|
|
17766
|
+
}) => theme.colors['surface/overlay']};
|
|
17767
|
+
border-radius: ${({
|
|
17768
|
+
theme
|
|
17769
|
+
}) => forcePixelValue(theme.radii.s)};
|
|
17770
|
+
overflow: hidden;
|
|
17771
|
+
margin: auto;
|
|
17772
|
+
z-index: 99999;
|
|
17773
|
+
|
|
17774
|
+
${variant({
|
|
17775
|
+
prop: 'size',
|
|
17776
|
+
variants: {
|
|
17777
|
+
m: {
|
|
17778
|
+
width: forcePixelValue(180)
|
|
17779
|
+
}
|
|
17780
|
+
}
|
|
17781
|
+
})}
|
|
17782
|
+
${sx}
|
|
17783
|
+
`;
|
|
17784
|
+
var Overlay$1 = /*#__PURE__*/React.forwardRef(Overlay);
|
|
17785
|
+
|
|
17786
|
+
const min = Math.min;
|
|
17787
|
+
const max = Math.max;
|
|
17788
|
+
const round = Math.round;
|
|
17789
|
+
const floor = Math.floor;
|
|
17790
|
+
const createCoords = v => ({
|
|
17791
|
+
x: v,
|
|
17792
|
+
y: v
|
|
17793
|
+
});
|
|
17794
|
+
const oppositeSideMap = {
|
|
17795
|
+
left: 'right',
|
|
17796
|
+
right: 'left',
|
|
17797
|
+
bottom: 'top',
|
|
17798
|
+
top: 'bottom'
|
|
17799
|
+
};
|
|
17800
|
+
const oppositeAlignmentMap = {
|
|
17801
|
+
start: 'end',
|
|
17802
|
+
end: 'start'
|
|
17803
|
+
};
|
|
17804
|
+
function clamp(start, value, end) {
|
|
17805
|
+
return max(start, min(value, end));
|
|
17806
|
+
}
|
|
17807
|
+
function evaluate(value, param) {
|
|
17808
|
+
return typeof value === 'function' ? value(param) : value;
|
|
17809
|
+
}
|
|
17810
|
+
function getSide(placement) {
|
|
17811
|
+
return placement.split('-')[0];
|
|
17812
|
+
}
|
|
17813
|
+
function getAlignment(placement) {
|
|
17814
|
+
return placement.split('-')[1];
|
|
17815
|
+
}
|
|
17816
|
+
function getOppositeAxis(axis) {
|
|
17817
|
+
return axis === 'x' ? 'y' : 'x';
|
|
17818
|
+
}
|
|
17819
|
+
function getAxisLength(axis) {
|
|
17820
|
+
return axis === 'y' ? 'height' : 'width';
|
|
17821
|
+
}
|
|
17822
|
+
function getSideAxis(placement) {
|
|
17823
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
17824
|
+
}
|
|
17825
|
+
function getAlignmentAxis(placement) {
|
|
17826
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
17827
|
+
}
|
|
17828
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
17829
|
+
if (rtl === void 0) {
|
|
17830
|
+
rtl = false;
|
|
17831
|
+
}
|
|
17832
|
+
const alignment = getAlignment(placement);
|
|
17833
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
17834
|
+
const length = getAxisLength(alignmentAxis);
|
|
17835
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
17836
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
17837
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
17838
|
+
}
|
|
17839
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
17840
|
+
}
|
|
17841
|
+
function getExpandedPlacements(placement) {
|
|
17842
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
17843
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
17844
|
+
}
|
|
17845
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
17846
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
17847
|
+
}
|
|
17848
|
+
function getSideList(side, isStart, rtl) {
|
|
17849
|
+
const lr = ['left', 'right'];
|
|
17850
|
+
const rl = ['right', 'left'];
|
|
17851
|
+
const tb = ['top', 'bottom'];
|
|
17852
|
+
const bt = ['bottom', 'top'];
|
|
17853
|
+
switch (side) {
|
|
17854
|
+
case 'top':
|
|
17855
|
+
case 'bottom':
|
|
17856
|
+
if (rtl) return isStart ? rl : lr;
|
|
17857
|
+
return isStart ? lr : rl;
|
|
17858
|
+
case 'left':
|
|
17859
|
+
case 'right':
|
|
17860
|
+
return isStart ? tb : bt;
|
|
17861
|
+
default:
|
|
17862
|
+
return [];
|
|
17863
|
+
}
|
|
17864
|
+
}
|
|
17865
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
17866
|
+
const alignment = getAlignment(placement);
|
|
17867
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
17868
|
+
if (alignment) {
|
|
17869
|
+
list = list.map(side => side + "-" + alignment);
|
|
17870
|
+
if (flipAlignment) {
|
|
17871
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
17872
|
+
}
|
|
17873
|
+
}
|
|
17874
|
+
return list;
|
|
17875
|
+
}
|
|
17876
|
+
function getOppositePlacement(placement) {
|
|
17877
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
17878
|
+
}
|
|
17879
|
+
function expandPaddingObject(padding) {
|
|
17880
|
+
return {
|
|
17881
|
+
top: 0,
|
|
17882
|
+
right: 0,
|
|
17883
|
+
bottom: 0,
|
|
17884
|
+
left: 0,
|
|
17885
|
+
...padding
|
|
17886
|
+
};
|
|
17887
|
+
}
|
|
17888
|
+
function getPaddingObject(padding) {
|
|
17889
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
17890
|
+
top: padding,
|
|
17891
|
+
right: padding,
|
|
17892
|
+
bottom: padding,
|
|
17893
|
+
left: padding
|
|
17894
|
+
};
|
|
17895
|
+
}
|
|
17896
|
+
function rectToClientRect(rect) {
|
|
17897
|
+
return {
|
|
17898
|
+
...rect,
|
|
17899
|
+
top: rect.y,
|
|
17900
|
+
left: rect.x,
|
|
17901
|
+
right: rect.x + rect.width,
|
|
17902
|
+
bottom: rect.y + rect.height
|
|
17903
|
+
};
|
|
17904
|
+
}
|
|
17905
|
+
|
|
17906
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
17907
|
+
let {
|
|
17908
|
+
reference,
|
|
17909
|
+
floating
|
|
17910
|
+
} = _ref;
|
|
17911
|
+
const sideAxis = getSideAxis(placement);
|
|
17912
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
17913
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
17914
|
+
const side = getSide(placement);
|
|
17915
|
+
const isVertical = sideAxis === 'y';
|
|
17916
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
17917
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
17918
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
17919
|
+
let coords;
|
|
17920
|
+
switch (side) {
|
|
17921
|
+
case 'top':
|
|
17922
|
+
coords = {
|
|
17923
|
+
x: commonX,
|
|
17924
|
+
y: reference.y - floating.height
|
|
17925
|
+
};
|
|
17926
|
+
break;
|
|
17927
|
+
case 'bottom':
|
|
17928
|
+
coords = {
|
|
17929
|
+
x: commonX,
|
|
17930
|
+
y: reference.y + reference.height
|
|
17931
|
+
};
|
|
17932
|
+
break;
|
|
17933
|
+
case 'right':
|
|
17934
|
+
coords = {
|
|
17935
|
+
x: reference.x + reference.width,
|
|
17936
|
+
y: commonY
|
|
17937
|
+
};
|
|
17938
|
+
break;
|
|
17939
|
+
case 'left':
|
|
17940
|
+
coords = {
|
|
17941
|
+
x: reference.x - floating.width,
|
|
17942
|
+
y: commonY
|
|
17943
|
+
};
|
|
17944
|
+
break;
|
|
17945
|
+
default:
|
|
17946
|
+
coords = {
|
|
17947
|
+
x: reference.x,
|
|
17948
|
+
y: reference.y
|
|
17949
|
+
};
|
|
17950
|
+
}
|
|
17951
|
+
switch (getAlignment(placement)) {
|
|
17952
|
+
case 'start':
|
|
17953
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
17954
|
+
break;
|
|
17955
|
+
case 'end':
|
|
17956
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
17957
|
+
break;
|
|
17958
|
+
}
|
|
17959
|
+
return coords;
|
|
17960
|
+
}
|
|
17961
|
+
|
|
17962
|
+
/**
|
|
17963
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
17964
|
+
* next to a reference element when it is given a certain positioning strategy.
|
|
17965
|
+
*
|
|
17966
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
17967
|
+
* write one for the platform you are using Floating UI with.
|
|
17968
|
+
*/
|
|
17969
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
17970
|
+
const {
|
|
17971
|
+
placement = 'bottom',
|
|
17972
|
+
strategy = 'absolute',
|
|
17973
|
+
middleware = [],
|
|
17974
|
+
platform
|
|
17975
|
+
} = config;
|
|
17976
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
17977
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
17978
|
+
let rects = await platform.getElementRects({
|
|
17979
|
+
reference,
|
|
17980
|
+
floating,
|
|
17981
|
+
strategy
|
|
17982
|
+
});
|
|
17983
|
+
let {
|
|
17984
|
+
x,
|
|
17985
|
+
y
|
|
17986
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
17987
|
+
let statefulPlacement = placement;
|
|
17988
|
+
let middlewareData = {};
|
|
17989
|
+
let resetCount = 0;
|
|
17990
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
17991
|
+
const {
|
|
17992
|
+
name,
|
|
17993
|
+
fn
|
|
17994
|
+
} = validMiddleware[i];
|
|
17995
|
+
const {
|
|
17996
|
+
x: nextX,
|
|
17997
|
+
y: nextY,
|
|
17998
|
+
data,
|
|
17999
|
+
reset
|
|
18000
|
+
} = await fn({
|
|
18001
|
+
x,
|
|
18002
|
+
y,
|
|
18003
|
+
initialPlacement: placement,
|
|
18004
|
+
placement: statefulPlacement,
|
|
18005
|
+
strategy,
|
|
18006
|
+
middlewareData,
|
|
18007
|
+
rects,
|
|
18008
|
+
platform,
|
|
18009
|
+
elements: {
|
|
18010
|
+
reference,
|
|
18011
|
+
floating
|
|
18012
|
+
}
|
|
18013
|
+
});
|
|
18014
|
+
x = nextX != null ? nextX : x;
|
|
18015
|
+
y = nextY != null ? nextY : y;
|
|
18016
|
+
middlewareData = {
|
|
18017
|
+
...middlewareData,
|
|
18018
|
+
[name]: {
|
|
18019
|
+
...middlewareData[name],
|
|
18020
|
+
...data
|
|
18021
|
+
}
|
|
18022
|
+
};
|
|
18023
|
+
if (reset && resetCount <= 50) {
|
|
18024
|
+
resetCount++;
|
|
18025
|
+
if (typeof reset === 'object') {
|
|
18026
|
+
if (reset.placement) {
|
|
18027
|
+
statefulPlacement = reset.placement;
|
|
18028
|
+
}
|
|
18029
|
+
if (reset.rects) {
|
|
18030
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
|
18031
|
+
reference,
|
|
18032
|
+
floating,
|
|
18033
|
+
strategy
|
|
18034
|
+
}) : reset.rects;
|
|
18035
|
+
}
|
|
18036
|
+
({
|
|
18037
|
+
x,
|
|
18038
|
+
y
|
|
18039
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
18040
|
+
}
|
|
18041
|
+
i = -1;
|
|
18042
|
+
continue;
|
|
18043
|
+
}
|
|
18044
|
+
}
|
|
18045
|
+
return {
|
|
18046
|
+
x,
|
|
18047
|
+
y,
|
|
18048
|
+
placement: statefulPlacement,
|
|
18049
|
+
strategy,
|
|
18050
|
+
middlewareData
|
|
18051
|
+
};
|
|
18052
|
+
};
|
|
18053
|
+
|
|
18054
|
+
/**
|
|
18055
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
18056
|
+
* element is overflowing a given clipping boundary on each side.
|
|
18057
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
18058
|
+
* - negative = how many pixels left before it will overflow
|
|
18059
|
+
* - 0 = lies flush with the boundary
|
|
18060
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
18061
|
+
*/
|
|
18062
|
+
async function detectOverflow(state, options) {
|
|
18063
|
+
var _await$platform$isEle;
|
|
18064
|
+
if (options === void 0) {
|
|
18065
|
+
options = {};
|
|
18066
|
+
}
|
|
18067
|
+
const {
|
|
18068
|
+
x,
|
|
18069
|
+
y,
|
|
18070
|
+
platform,
|
|
18071
|
+
rects,
|
|
18072
|
+
elements,
|
|
18073
|
+
strategy
|
|
18074
|
+
} = state;
|
|
18075
|
+
const {
|
|
18076
|
+
boundary = 'clippingAncestors',
|
|
18077
|
+
rootBoundary = 'viewport',
|
|
18078
|
+
elementContext = 'floating',
|
|
18079
|
+
altBoundary = false,
|
|
18080
|
+
padding = 0
|
|
18081
|
+
} = evaluate(options, state);
|
|
18082
|
+
const paddingObject = getPaddingObject(padding);
|
|
18083
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
18084
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
18085
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
18086
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
18087
|
+
boundary,
|
|
18088
|
+
rootBoundary,
|
|
18089
|
+
strategy
|
|
18090
|
+
}));
|
|
18091
|
+
const rect = elementContext === 'floating' ? {
|
|
18092
|
+
...rects.floating,
|
|
18093
|
+
x,
|
|
18094
|
+
y
|
|
18095
|
+
} : rects.reference;
|
|
18096
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
18097
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
18098
|
+
x: 1,
|
|
18099
|
+
y: 1
|
|
18100
|
+
} : {
|
|
18101
|
+
x: 1,
|
|
18102
|
+
y: 1
|
|
18103
|
+
};
|
|
18104
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
18105
|
+
rect,
|
|
18106
|
+
offsetParent,
|
|
18107
|
+
strategy
|
|
18108
|
+
}) : rect);
|
|
18109
|
+
return {
|
|
18110
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
18111
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
18112
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
18113
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
18114
|
+
};
|
|
18115
|
+
}
|
|
18116
|
+
|
|
18117
|
+
/**
|
|
18118
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
18119
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
18120
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
18121
|
+
* @see https://floating-ui.com/docs/flip
|
|
18122
|
+
*/
|
|
18123
|
+
const flip = function (options) {
|
|
18124
|
+
if (options === void 0) {
|
|
18125
|
+
options = {};
|
|
18126
|
+
}
|
|
18127
|
+
return {
|
|
18128
|
+
name: 'flip',
|
|
18129
|
+
options,
|
|
18130
|
+
async fn(state) {
|
|
18131
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
18132
|
+
const {
|
|
18133
|
+
placement,
|
|
18134
|
+
middlewareData,
|
|
18135
|
+
rects,
|
|
18136
|
+
initialPlacement,
|
|
18137
|
+
platform,
|
|
18138
|
+
elements
|
|
18139
|
+
} = state;
|
|
18140
|
+
const {
|
|
18141
|
+
mainAxis: checkMainAxis = true,
|
|
18142
|
+
crossAxis: checkCrossAxis = true,
|
|
18143
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
18144
|
+
fallbackStrategy = 'bestFit',
|
|
18145
|
+
fallbackAxisSideDirection = 'none',
|
|
18146
|
+
flipAlignment = true,
|
|
18147
|
+
...detectOverflowOptions
|
|
18148
|
+
} = evaluate(options, state);
|
|
18149
|
+
|
|
18150
|
+
// If a reset by the arrow was caused due to an alignment offset being
|
|
18151
|
+
// added, we should skip any logic now since `flip()` has already done its
|
|
18152
|
+
// work.
|
|
18153
|
+
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
18154
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
18155
|
+
return {};
|
|
18156
|
+
}
|
|
18157
|
+
const side = getSide(placement);
|
|
18158
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
18159
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
18160
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
18161
|
+
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
|
|
18162
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
18163
|
+
}
|
|
18164
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
18165
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
18166
|
+
const overflows = [];
|
|
18167
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
18168
|
+
if (checkMainAxis) {
|
|
18169
|
+
overflows.push(overflow[side]);
|
|
18170
|
+
}
|
|
18171
|
+
if (checkCrossAxis) {
|
|
18172
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
18173
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
18174
|
+
}
|
|
18175
|
+
overflowsData = [...overflowsData, {
|
|
18176
|
+
placement,
|
|
18177
|
+
overflows
|
|
18178
|
+
}];
|
|
18179
|
+
|
|
18180
|
+
// One or more sides is overflowing.
|
|
18181
|
+
if (!overflows.every(side => side <= 0)) {
|
|
18182
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
18183
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
18184
|
+
const nextPlacement = placements[nextIndex];
|
|
18185
|
+
if (nextPlacement) {
|
|
18186
|
+
// Try next placement and re-run the lifecycle.
|
|
18187
|
+
return {
|
|
18188
|
+
data: {
|
|
18189
|
+
index: nextIndex,
|
|
18190
|
+
overflows: overflowsData
|
|
18191
|
+
},
|
|
18192
|
+
reset: {
|
|
18193
|
+
placement: nextPlacement
|
|
18194
|
+
}
|
|
18195
|
+
};
|
|
18196
|
+
}
|
|
18197
|
+
|
|
18198
|
+
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
18199
|
+
// then find the placement that fits the best on the main crossAxis side.
|
|
18200
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
18201
|
+
|
|
18202
|
+
// Otherwise fallback.
|
|
18203
|
+
if (!resetPlacement) {
|
|
18204
|
+
switch (fallbackStrategy) {
|
|
18205
|
+
case 'bestFit':
|
|
18206
|
+
{
|
|
18207
|
+
var _overflowsData$map$so;
|
|
18208
|
+
const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
|
|
18209
|
+
if (placement) {
|
|
18210
|
+
resetPlacement = placement;
|
|
18211
|
+
}
|
|
18212
|
+
break;
|
|
18213
|
+
}
|
|
18214
|
+
case 'initialPlacement':
|
|
18215
|
+
resetPlacement = initialPlacement;
|
|
18216
|
+
break;
|
|
18217
|
+
}
|
|
18218
|
+
}
|
|
18219
|
+
if (placement !== resetPlacement) {
|
|
18220
|
+
return {
|
|
18221
|
+
reset: {
|
|
18222
|
+
placement: resetPlacement
|
|
18223
|
+
}
|
|
18224
|
+
};
|
|
18225
|
+
}
|
|
18226
|
+
}
|
|
18227
|
+
return {};
|
|
18228
|
+
}
|
|
18229
|
+
};
|
|
18230
|
+
};
|
|
18231
|
+
|
|
18232
|
+
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
18233
|
+
// Derivable.
|
|
18234
|
+
async function convertValueToCoords(state, options) {
|
|
18235
|
+
const {
|
|
18236
|
+
placement,
|
|
18237
|
+
platform,
|
|
18238
|
+
elements
|
|
18239
|
+
} = state;
|
|
18240
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
18241
|
+
const side = getSide(placement);
|
|
18242
|
+
const alignment = getAlignment(placement);
|
|
18243
|
+
const isVertical = getSideAxis(placement) === 'y';
|
|
18244
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
18245
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
18246
|
+
const rawValue = evaluate(options, state);
|
|
18247
|
+
|
|
18248
|
+
// eslint-disable-next-line prefer-const
|
|
18249
|
+
let {
|
|
18250
|
+
mainAxis,
|
|
18251
|
+
crossAxis,
|
|
18252
|
+
alignmentAxis
|
|
18253
|
+
} = typeof rawValue === 'number' ? {
|
|
18254
|
+
mainAxis: rawValue,
|
|
18255
|
+
crossAxis: 0,
|
|
18256
|
+
alignmentAxis: null
|
|
18257
|
+
} : {
|
|
18258
|
+
mainAxis: 0,
|
|
18259
|
+
crossAxis: 0,
|
|
18260
|
+
alignmentAxis: null,
|
|
18261
|
+
...rawValue
|
|
18262
|
+
};
|
|
18263
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
|
18264
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
18265
|
+
}
|
|
18266
|
+
return isVertical ? {
|
|
18267
|
+
x: crossAxis * crossAxisMulti,
|
|
18268
|
+
y: mainAxis * mainAxisMulti
|
|
18269
|
+
} : {
|
|
18270
|
+
x: mainAxis * mainAxisMulti,
|
|
18271
|
+
y: crossAxis * crossAxisMulti
|
|
18272
|
+
};
|
|
18273
|
+
}
|
|
18274
|
+
|
|
18275
|
+
/**
|
|
18276
|
+
* Modifies the placement by translating the floating element along the
|
|
18277
|
+
* specified axes.
|
|
18278
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
18279
|
+
* object may be passed.
|
|
18280
|
+
* @see https://floating-ui.com/docs/offset
|
|
18281
|
+
*/
|
|
18282
|
+
const offset = function (options) {
|
|
18283
|
+
if (options === void 0) {
|
|
18284
|
+
options = 0;
|
|
18285
|
+
}
|
|
18286
|
+
return {
|
|
18287
|
+
name: 'offset',
|
|
18288
|
+
options,
|
|
18289
|
+
async fn(state) {
|
|
18290
|
+
const {
|
|
18291
|
+
x,
|
|
18292
|
+
y
|
|
18293
|
+
} = state;
|
|
18294
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
18295
|
+
return {
|
|
18296
|
+
x: x + diffCoords.x,
|
|
18297
|
+
y: y + diffCoords.y,
|
|
18298
|
+
data: diffCoords
|
|
18299
|
+
};
|
|
18300
|
+
}
|
|
18301
|
+
};
|
|
18302
|
+
};
|
|
18303
|
+
|
|
18304
|
+
/**
|
|
18305
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
18306
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
18307
|
+
* @see https://floating-ui.com/docs/shift
|
|
18308
|
+
*/
|
|
18309
|
+
const shift = function (options) {
|
|
18310
|
+
if (options === void 0) {
|
|
18311
|
+
options = {};
|
|
18312
|
+
}
|
|
18313
|
+
return {
|
|
18314
|
+
name: 'shift',
|
|
18315
|
+
options,
|
|
18316
|
+
async fn(state) {
|
|
18317
|
+
const {
|
|
18318
|
+
x,
|
|
18319
|
+
y,
|
|
18320
|
+
placement
|
|
18321
|
+
} = state;
|
|
18322
|
+
const {
|
|
18323
|
+
mainAxis: checkMainAxis = true,
|
|
18324
|
+
crossAxis: checkCrossAxis = false,
|
|
18325
|
+
limiter = {
|
|
18326
|
+
fn: _ref => {
|
|
18327
|
+
let {
|
|
18328
|
+
x,
|
|
18329
|
+
y
|
|
18330
|
+
} = _ref;
|
|
18331
|
+
return {
|
|
18332
|
+
x,
|
|
18333
|
+
y
|
|
18334
|
+
};
|
|
18335
|
+
}
|
|
18336
|
+
},
|
|
18337
|
+
...detectOverflowOptions
|
|
18338
|
+
} = evaluate(options, state);
|
|
18339
|
+
const coords = {
|
|
18340
|
+
x,
|
|
18341
|
+
y
|
|
18342
|
+
};
|
|
18343
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
18344
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
18345
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
18346
|
+
let mainAxisCoord = coords[mainAxis];
|
|
18347
|
+
let crossAxisCoord = coords[crossAxis];
|
|
18348
|
+
if (checkMainAxis) {
|
|
18349
|
+
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
18350
|
+
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
18351
|
+
const min = mainAxisCoord + overflow[minSide];
|
|
18352
|
+
const max = mainAxisCoord - overflow[maxSide];
|
|
18353
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
18354
|
+
}
|
|
18355
|
+
if (checkCrossAxis) {
|
|
18356
|
+
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
18357
|
+
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
18358
|
+
const min = crossAxisCoord + overflow[minSide];
|
|
18359
|
+
const max = crossAxisCoord - overflow[maxSide];
|
|
18360
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
18361
|
+
}
|
|
18362
|
+
const limitedCoords = limiter.fn({
|
|
18363
|
+
...state,
|
|
18364
|
+
[mainAxis]: mainAxisCoord,
|
|
18365
|
+
[crossAxis]: crossAxisCoord
|
|
18366
|
+
});
|
|
18367
|
+
return {
|
|
18368
|
+
...limitedCoords,
|
|
18369
|
+
data: {
|
|
18370
|
+
x: limitedCoords.x - x,
|
|
18371
|
+
y: limitedCoords.y - y
|
|
18372
|
+
}
|
|
18373
|
+
};
|
|
18374
|
+
}
|
|
18375
|
+
};
|
|
18376
|
+
};
|
|
18377
|
+
|
|
18378
|
+
function getNodeName(node) {
|
|
18379
|
+
if (isNode(node)) {
|
|
18380
|
+
return (node.nodeName || '').toLowerCase();
|
|
18381
|
+
}
|
|
18382
|
+
// Mocked nodes in testing environments may not be instances of Node. By
|
|
18383
|
+
// returning `#document` an infinite loop won't occur.
|
|
18384
|
+
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
18385
|
+
return '#document';
|
|
18386
|
+
}
|
|
18387
|
+
function getWindow(node) {
|
|
18388
|
+
var _node$ownerDocument;
|
|
18389
|
+
return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
18390
|
+
}
|
|
18391
|
+
function getDocumentElement(node) {
|
|
18392
|
+
var _ref;
|
|
18393
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
18394
|
+
}
|
|
18395
|
+
function isNode(value) {
|
|
18396
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
18397
|
+
}
|
|
18398
|
+
function isElement(value) {
|
|
18399
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
18400
|
+
}
|
|
18401
|
+
function isHTMLElement(value) {
|
|
18402
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
18403
|
+
}
|
|
18404
|
+
function isShadowRoot(value) {
|
|
18405
|
+
// Browsers without `ShadowRoot` support.
|
|
18406
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
18407
|
+
return false;
|
|
18408
|
+
}
|
|
18409
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
18410
|
+
}
|
|
18411
|
+
function isOverflowElement(element) {
|
|
18412
|
+
const {
|
|
18413
|
+
overflow,
|
|
18414
|
+
overflowX,
|
|
18415
|
+
overflowY,
|
|
18416
|
+
display
|
|
18417
|
+
} = getComputedStyle$1(element);
|
|
18418
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
18419
|
+
}
|
|
18420
|
+
function isTableElement(element) {
|
|
18421
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
18422
|
+
}
|
|
18423
|
+
function isContainingBlock(element) {
|
|
18424
|
+
const webkit = isWebKit();
|
|
18425
|
+
const css = getComputedStyle$1(element);
|
|
18426
|
+
|
|
18427
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
18428
|
+
return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
|
|
18429
|
+
}
|
|
18430
|
+
function getContainingBlock(element) {
|
|
18431
|
+
let currentNode = getParentNode(element);
|
|
18432
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
18433
|
+
if (isContainingBlock(currentNode)) {
|
|
18434
|
+
return currentNode;
|
|
18435
|
+
} else {
|
|
18436
|
+
currentNode = getParentNode(currentNode);
|
|
18437
|
+
}
|
|
18438
|
+
}
|
|
18439
|
+
return null;
|
|
18440
|
+
}
|
|
18441
|
+
function isWebKit() {
|
|
18442
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
18443
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
18444
|
+
}
|
|
18445
|
+
function isLastTraversableNode(node) {
|
|
18446
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
18447
|
+
}
|
|
18448
|
+
function getComputedStyle$1(element) {
|
|
18449
|
+
return getWindow(element).getComputedStyle(element);
|
|
18450
|
+
}
|
|
18451
|
+
function getNodeScroll(element) {
|
|
18452
|
+
if (isElement(element)) {
|
|
18453
|
+
return {
|
|
18454
|
+
scrollLeft: element.scrollLeft,
|
|
18455
|
+
scrollTop: element.scrollTop
|
|
18456
|
+
};
|
|
18457
|
+
}
|
|
18458
|
+
return {
|
|
18459
|
+
scrollLeft: element.pageXOffset,
|
|
18460
|
+
scrollTop: element.pageYOffset
|
|
18461
|
+
};
|
|
18462
|
+
}
|
|
18463
|
+
function getParentNode(node) {
|
|
18464
|
+
if (getNodeName(node) === 'html') {
|
|
18465
|
+
return node;
|
|
18466
|
+
}
|
|
18467
|
+
const result =
|
|
18468
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
18469
|
+
node.assignedSlot ||
|
|
18470
|
+
// DOM Element detected.
|
|
18471
|
+
node.parentNode ||
|
|
18472
|
+
// ShadowRoot detected.
|
|
18473
|
+
isShadowRoot(node) && node.host ||
|
|
18474
|
+
// Fallback.
|
|
18475
|
+
getDocumentElement(node);
|
|
18476
|
+
return isShadowRoot(result) ? result.host : result;
|
|
18477
|
+
}
|
|
18478
|
+
function getNearestOverflowAncestor(node) {
|
|
18479
|
+
const parentNode = getParentNode(node);
|
|
18480
|
+
if (isLastTraversableNode(parentNode)) {
|
|
18481
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
18482
|
+
}
|
|
18483
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
18484
|
+
return parentNode;
|
|
18485
|
+
}
|
|
18486
|
+
return getNearestOverflowAncestor(parentNode);
|
|
18487
|
+
}
|
|
18488
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
18489
|
+
var _node$ownerDocument2;
|
|
18490
|
+
if (list === void 0) {
|
|
18491
|
+
list = [];
|
|
18492
|
+
}
|
|
18493
|
+
if (traverseIframes === void 0) {
|
|
18494
|
+
traverseIframes = true;
|
|
18495
|
+
}
|
|
18496
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
18497
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
18498
|
+
const win = getWindow(scrollableAncestor);
|
|
18499
|
+
if (isBody) {
|
|
18500
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
18501
|
+
}
|
|
18502
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
18503
|
+
}
|
|
18504
|
+
|
|
18505
|
+
function getCssDimensions(element) {
|
|
18506
|
+
const css = getComputedStyle$1(element);
|
|
18507
|
+
// In testing environments, the `width` and `height` properties are empty
|
|
18508
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
18509
|
+
let width = parseFloat(css.width) || 0;
|
|
18510
|
+
let height = parseFloat(css.height) || 0;
|
|
18511
|
+
const hasOffset = isHTMLElement(element);
|
|
18512
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
18513
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
18514
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
18515
|
+
if (shouldFallback) {
|
|
18516
|
+
width = offsetWidth;
|
|
18517
|
+
height = offsetHeight;
|
|
18518
|
+
}
|
|
18519
|
+
return {
|
|
18520
|
+
width,
|
|
18521
|
+
height,
|
|
18522
|
+
$: shouldFallback
|
|
18523
|
+
};
|
|
18524
|
+
}
|
|
18525
|
+
|
|
18526
|
+
function unwrapElement(element) {
|
|
18527
|
+
return !isElement(element) ? element.contextElement : element;
|
|
18528
|
+
}
|
|
18529
|
+
|
|
18530
|
+
function getScale(element) {
|
|
18531
|
+
const domElement = unwrapElement(element);
|
|
18532
|
+
if (!isHTMLElement(domElement)) {
|
|
18533
|
+
return createCoords(1);
|
|
18534
|
+
}
|
|
18535
|
+
const rect = domElement.getBoundingClientRect();
|
|
18536
|
+
const {
|
|
18537
|
+
width,
|
|
18538
|
+
height,
|
|
18539
|
+
$
|
|
18540
|
+
} = getCssDimensions(domElement);
|
|
18541
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
18542
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
18543
|
+
|
|
18544
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
|
18545
|
+
|
|
18546
|
+
if (!x || !Number.isFinite(x)) {
|
|
18547
|
+
x = 1;
|
|
18548
|
+
}
|
|
18549
|
+
if (!y || !Number.isFinite(y)) {
|
|
18550
|
+
y = 1;
|
|
18551
|
+
}
|
|
18552
|
+
return {
|
|
18553
|
+
x,
|
|
18554
|
+
y
|
|
18555
|
+
};
|
|
18556
|
+
}
|
|
18557
|
+
|
|
18558
|
+
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
18559
|
+
function getVisualOffsets(element) {
|
|
18560
|
+
const win = getWindow(element);
|
|
18561
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
18562
|
+
return noOffsets;
|
|
18563
|
+
}
|
|
18564
|
+
return {
|
|
18565
|
+
x: win.visualViewport.offsetLeft,
|
|
18566
|
+
y: win.visualViewport.offsetTop
|
|
18567
|
+
};
|
|
18568
|
+
}
|
|
18569
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
18570
|
+
if (isFixed === void 0) {
|
|
18571
|
+
isFixed = false;
|
|
18572
|
+
}
|
|
18573
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
18574
|
+
return false;
|
|
18575
|
+
}
|
|
18576
|
+
return isFixed;
|
|
18577
|
+
}
|
|
18578
|
+
|
|
18579
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
18580
|
+
if (includeScale === void 0) {
|
|
18581
|
+
includeScale = false;
|
|
18582
|
+
}
|
|
18583
|
+
if (isFixedStrategy === void 0) {
|
|
18584
|
+
isFixedStrategy = false;
|
|
18585
|
+
}
|
|
18586
|
+
const clientRect = element.getBoundingClientRect();
|
|
18587
|
+
const domElement = unwrapElement(element);
|
|
18588
|
+
let scale = createCoords(1);
|
|
18589
|
+
if (includeScale) {
|
|
18590
|
+
if (offsetParent) {
|
|
18591
|
+
if (isElement(offsetParent)) {
|
|
18592
|
+
scale = getScale(offsetParent);
|
|
18593
|
+
}
|
|
18594
|
+
} else {
|
|
18595
|
+
scale = getScale(element);
|
|
18596
|
+
}
|
|
18597
|
+
}
|
|
18598
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
18599
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
18600
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
18601
|
+
let width = clientRect.width / scale.x;
|
|
18602
|
+
let height = clientRect.height / scale.y;
|
|
18603
|
+
if (domElement) {
|
|
18604
|
+
const win = getWindow(domElement);
|
|
18605
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
18606
|
+
let currentIFrame = win.frameElement;
|
|
18607
|
+
while (currentIFrame && offsetParent && offsetWin !== win) {
|
|
18608
|
+
const iframeScale = getScale(currentIFrame);
|
|
18609
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
18610
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
18611
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
18612
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
18613
|
+
x *= iframeScale.x;
|
|
18614
|
+
y *= iframeScale.y;
|
|
18615
|
+
width *= iframeScale.x;
|
|
18616
|
+
height *= iframeScale.y;
|
|
18617
|
+
x += left;
|
|
18618
|
+
y += top;
|
|
18619
|
+
currentIFrame = getWindow(currentIFrame).frameElement;
|
|
18620
|
+
}
|
|
18621
|
+
}
|
|
18622
|
+
return rectToClientRect({
|
|
18623
|
+
width,
|
|
18624
|
+
height,
|
|
18625
|
+
x,
|
|
18626
|
+
y
|
|
18627
|
+
});
|
|
18628
|
+
}
|
|
18629
|
+
|
|
18630
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
18631
|
+
let {
|
|
18632
|
+
rect,
|
|
18633
|
+
offsetParent,
|
|
18634
|
+
strategy
|
|
18635
|
+
} = _ref;
|
|
18636
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
18637
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
18638
|
+
if (offsetParent === documentElement) {
|
|
18639
|
+
return rect;
|
|
18640
|
+
}
|
|
18641
|
+
let scroll = {
|
|
18642
|
+
scrollLeft: 0,
|
|
18643
|
+
scrollTop: 0
|
|
18644
|
+
};
|
|
18645
|
+
let scale = createCoords(1);
|
|
18646
|
+
const offsets = createCoords(0);
|
|
18647
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
18648
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
18649
|
+
scroll = getNodeScroll(offsetParent);
|
|
18650
|
+
}
|
|
18651
|
+
if (isHTMLElement(offsetParent)) {
|
|
18652
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
18653
|
+
scale = getScale(offsetParent);
|
|
18654
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
18655
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
18656
|
+
}
|
|
18657
|
+
}
|
|
18658
|
+
return {
|
|
18659
|
+
width: rect.width * scale.x,
|
|
18660
|
+
height: rect.height * scale.y,
|
|
18661
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
18662
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
18663
|
+
};
|
|
18664
|
+
}
|
|
18665
|
+
|
|
18666
|
+
function getClientRects(element) {
|
|
18667
|
+
return Array.from(element.getClientRects());
|
|
18668
|
+
}
|
|
18669
|
+
|
|
18670
|
+
function getWindowScrollBarX(element) {
|
|
18671
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
18672
|
+
// incorrect for RTL.
|
|
18673
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
18674
|
+
}
|
|
18675
|
+
|
|
18676
|
+
// Gets the entire size of the scrollable document area, even extending outside
|
|
18677
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
18678
|
+
function getDocumentRect(element) {
|
|
18679
|
+
const html = getDocumentElement(element);
|
|
18680
|
+
const scroll = getNodeScroll(element);
|
|
18681
|
+
const body = element.ownerDocument.body;
|
|
18682
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
18683
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
18684
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
18685
|
+
const y = -scroll.scrollTop;
|
|
18686
|
+
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
18687
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
18688
|
+
}
|
|
18689
|
+
return {
|
|
18690
|
+
width,
|
|
18691
|
+
height,
|
|
18692
|
+
x,
|
|
18693
|
+
y
|
|
18694
|
+
};
|
|
18695
|
+
}
|
|
18696
|
+
|
|
18697
|
+
function getViewportRect(element, strategy) {
|
|
18698
|
+
const win = getWindow(element);
|
|
18699
|
+
const html = getDocumentElement(element);
|
|
18700
|
+
const visualViewport = win.visualViewport;
|
|
18701
|
+
let width = html.clientWidth;
|
|
18702
|
+
let height = html.clientHeight;
|
|
18703
|
+
let x = 0;
|
|
18704
|
+
let y = 0;
|
|
18705
|
+
if (visualViewport) {
|
|
18706
|
+
width = visualViewport.width;
|
|
18707
|
+
height = visualViewport.height;
|
|
18708
|
+
const visualViewportBased = isWebKit();
|
|
18709
|
+
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
18710
|
+
x = visualViewport.offsetLeft;
|
|
18711
|
+
y = visualViewport.offsetTop;
|
|
18712
|
+
}
|
|
18713
|
+
}
|
|
18714
|
+
return {
|
|
18715
|
+
width,
|
|
18716
|
+
height,
|
|
18717
|
+
x,
|
|
18718
|
+
y
|
|
18719
|
+
};
|
|
18720
|
+
}
|
|
18721
|
+
|
|
18722
|
+
// Returns the inner client rect, subtracting scrollbars if present.
|
|
18723
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
18724
|
+
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
18725
|
+
const top = clientRect.top + element.clientTop;
|
|
18726
|
+
const left = clientRect.left + element.clientLeft;
|
|
18727
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
18728
|
+
const width = element.clientWidth * scale.x;
|
|
18729
|
+
const height = element.clientHeight * scale.y;
|
|
18730
|
+
const x = left * scale.x;
|
|
18731
|
+
const y = top * scale.y;
|
|
18732
|
+
return {
|
|
18733
|
+
width,
|
|
18734
|
+
height,
|
|
18735
|
+
x,
|
|
18736
|
+
y
|
|
18737
|
+
};
|
|
18738
|
+
}
|
|
18739
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
18740
|
+
let rect;
|
|
18741
|
+
if (clippingAncestor === 'viewport') {
|
|
18742
|
+
rect = getViewportRect(element, strategy);
|
|
18743
|
+
} else if (clippingAncestor === 'document') {
|
|
18744
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
18745
|
+
} else if (isElement(clippingAncestor)) {
|
|
18746
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
18747
|
+
} else {
|
|
18748
|
+
const visualOffsets = getVisualOffsets(element);
|
|
18749
|
+
rect = {
|
|
18750
|
+
...clippingAncestor,
|
|
18751
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
18752
|
+
y: clippingAncestor.y - visualOffsets.y
|
|
18753
|
+
};
|
|
18754
|
+
}
|
|
18755
|
+
return rectToClientRect(rect);
|
|
18756
|
+
}
|
|
18757
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
18758
|
+
const parentNode = getParentNode(element);
|
|
18759
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
18760
|
+
return false;
|
|
18761
|
+
}
|
|
18762
|
+
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
18763
|
+
}
|
|
18764
|
+
|
|
18765
|
+
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
18766
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
18767
|
+
// of the given element up the tree.
|
|
18768
|
+
function getClippingElementAncestors(element, cache) {
|
|
18769
|
+
const cachedResult = cache.get(element);
|
|
18770
|
+
if (cachedResult) {
|
|
18771
|
+
return cachedResult;
|
|
18772
|
+
}
|
|
18773
|
+
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
18774
|
+
let currentContainingBlockComputedStyle = null;
|
|
18775
|
+
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
18776
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
18777
|
+
|
|
18778
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
18779
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
18780
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
18781
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
18782
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
18783
|
+
currentContainingBlockComputedStyle = null;
|
|
18784
|
+
}
|
|
18785
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
18786
|
+
if (shouldDropCurrentNode) {
|
|
18787
|
+
// Drop non-containing blocks.
|
|
18788
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
18789
|
+
} else {
|
|
18790
|
+
// Record last containing block for next iteration.
|
|
18791
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
18792
|
+
}
|
|
18793
|
+
currentNode = getParentNode(currentNode);
|
|
18794
|
+
}
|
|
18795
|
+
cache.set(element, result);
|
|
18796
|
+
return result;
|
|
18797
|
+
}
|
|
18798
|
+
|
|
18799
|
+
// Gets the maximum area that the element is visible in due to any number of
|
|
18800
|
+
// clipping ancestors.
|
|
18801
|
+
function getClippingRect(_ref) {
|
|
18802
|
+
let {
|
|
18803
|
+
element,
|
|
18804
|
+
boundary,
|
|
18805
|
+
rootBoundary,
|
|
18806
|
+
strategy
|
|
18807
|
+
} = _ref;
|
|
18808
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
18809
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
18810
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
18811
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
18812
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
18813
|
+
accRect.top = max(rect.top, accRect.top);
|
|
18814
|
+
accRect.right = min(rect.right, accRect.right);
|
|
18815
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
18816
|
+
accRect.left = max(rect.left, accRect.left);
|
|
18817
|
+
return accRect;
|
|
18818
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
18819
|
+
return {
|
|
18820
|
+
width: clippingRect.right - clippingRect.left,
|
|
18821
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
18822
|
+
x: clippingRect.left,
|
|
18823
|
+
y: clippingRect.top
|
|
18824
|
+
};
|
|
18825
|
+
}
|
|
18826
|
+
|
|
18827
|
+
function getDimensions(element) {
|
|
18828
|
+
return getCssDimensions(element);
|
|
18829
|
+
}
|
|
18830
|
+
|
|
18831
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
18832
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
18833
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
18834
|
+
const isFixed = strategy === 'fixed';
|
|
18835
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
18836
|
+
let scroll = {
|
|
18837
|
+
scrollLeft: 0,
|
|
18838
|
+
scrollTop: 0
|
|
18839
|
+
};
|
|
18840
|
+
const offsets = createCoords(0);
|
|
18841
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
18842
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
18843
|
+
scroll = getNodeScroll(offsetParent);
|
|
18844
|
+
}
|
|
18845
|
+
if (isOffsetParentAnElement) {
|
|
18846
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
18847
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
18848
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
18849
|
+
} else if (documentElement) {
|
|
18850
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
18851
|
+
}
|
|
18852
|
+
}
|
|
18853
|
+
return {
|
|
18854
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
18855
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
18856
|
+
width: rect.width,
|
|
18857
|
+
height: rect.height
|
|
18858
|
+
};
|
|
18859
|
+
}
|
|
18860
|
+
|
|
18861
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
18862
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
18863
|
+
return null;
|
|
18864
|
+
}
|
|
18865
|
+
if (polyfill) {
|
|
18866
|
+
return polyfill(element);
|
|
18867
|
+
}
|
|
18868
|
+
return element.offsetParent;
|
|
18869
|
+
}
|
|
18870
|
+
|
|
18871
|
+
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
18872
|
+
// such as table ancestors and cross browser bugs.
|
|
18873
|
+
function getOffsetParent(element, polyfill) {
|
|
18874
|
+
const window = getWindow(element);
|
|
18875
|
+
if (!isHTMLElement(element)) {
|
|
18876
|
+
return window;
|
|
18877
|
+
}
|
|
18878
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
18879
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
|
|
18880
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
18881
|
+
}
|
|
18882
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
18883
|
+
return window;
|
|
18884
|
+
}
|
|
18885
|
+
return offsetParent || getContainingBlock(element) || window;
|
|
18886
|
+
}
|
|
18887
|
+
|
|
18888
|
+
const getElementRects = async function (_ref) {
|
|
18889
|
+
let {
|
|
18890
|
+
reference,
|
|
18891
|
+
floating,
|
|
18892
|
+
strategy
|
|
18893
|
+
} = _ref;
|
|
18894
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
18895
|
+
const getDimensionsFn = this.getDimensions;
|
|
18896
|
+
return {
|
|
18897
|
+
reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
|
|
18898
|
+
floating: {
|
|
18899
|
+
x: 0,
|
|
18900
|
+
y: 0,
|
|
18901
|
+
...(await getDimensionsFn(floating))
|
|
18902
|
+
}
|
|
18903
|
+
};
|
|
18904
|
+
};
|
|
18905
|
+
|
|
18906
|
+
function isRTL(element) {
|
|
18907
|
+
return getComputedStyle$1(element).direction === 'rtl';
|
|
18908
|
+
}
|
|
18909
|
+
|
|
18910
|
+
const platform = {
|
|
18911
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
18912
|
+
getDocumentElement,
|
|
18913
|
+
getClippingRect,
|
|
18914
|
+
getOffsetParent,
|
|
18915
|
+
getElementRects,
|
|
18916
|
+
getClientRects,
|
|
18917
|
+
getDimensions,
|
|
18918
|
+
getScale,
|
|
18919
|
+
isElement,
|
|
18920
|
+
isRTL
|
|
18921
|
+
};
|
|
18922
|
+
|
|
18923
|
+
// https://samthor.au/2021/observing-dom/
|
|
18924
|
+
function observeMove(element, onMove) {
|
|
18925
|
+
let io = null;
|
|
18926
|
+
let timeoutId;
|
|
18927
|
+
const root = getDocumentElement(element);
|
|
18928
|
+
function cleanup() {
|
|
18929
|
+
clearTimeout(timeoutId);
|
|
18930
|
+
io && io.disconnect();
|
|
18931
|
+
io = null;
|
|
18932
|
+
}
|
|
18933
|
+
function refresh(skip, threshold) {
|
|
18934
|
+
if (skip === void 0) {
|
|
18935
|
+
skip = false;
|
|
18936
|
+
}
|
|
18937
|
+
if (threshold === void 0) {
|
|
18938
|
+
threshold = 1;
|
|
18939
|
+
}
|
|
18940
|
+
cleanup();
|
|
18941
|
+
const {
|
|
18942
|
+
left,
|
|
18943
|
+
top,
|
|
18944
|
+
width,
|
|
18945
|
+
height
|
|
18946
|
+
} = element.getBoundingClientRect();
|
|
18947
|
+
if (!skip) {
|
|
18948
|
+
onMove();
|
|
18949
|
+
}
|
|
18950
|
+
if (!width || !height) {
|
|
18951
|
+
return;
|
|
18952
|
+
}
|
|
18953
|
+
const insetTop = floor(top);
|
|
18954
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
|
18955
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
|
18956
|
+
const insetLeft = floor(left);
|
|
18957
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
18958
|
+
const options = {
|
|
18959
|
+
rootMargin,
|
|
18960
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
18961
|
+
};
|
|
18962
|
+
let isFirstUpdate = true;
|
|
18963
|
+
function handleObserve(entries) {
|
|
18964
|
+
const ratio = entries[0].intersectionRatio;
|
|
18965
|
+
if (ratio !== threshold) {
|
|
18966
|
+
if (!isFirstUpdate) {
|
|
18967
|
+
return refresh();
|
|
18968
|
+
}
|
|
18969
|
+
if (!ratio) {
|
|
18970
|
+
timeoutId = setTimeout(() => {
|
|
18971
|
+
refresh(false, 1e-7);
|
|
18972
|
+
}, 100);
|
|
18973
|
+
} else {
|
|
18974
|
+
refresh(false, ratio);
|
|
18975
|
+
}
|
|
18976
|
+
}
|
|
18977
|
+
isFirstUpdate = false;
|
|
18978
|
+
}
|
|
18979
|
+
|
|
18980
|
+
// Older browsers don't support a `document` as the root and will throw an
|
|
18981
|
+
// error.
|
|
18982
|
+
try {
|
|
18983
|
+
io = new IntersectionObserver(handleObserve, {
|
|
18984
|
+
...options,
|
|
18985
|
+
// Handle <iframe>s
|
|
18986
|
+
root: root.ownerDocument
|
|
18987
|
+
});
|
|
18988
|
+
} catch (e) {
|
|
18989
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
18990
|
+
}
|
|
18991
|
+
io.observe(element);
|
|
18992
|
+
}
|
|
18993
|
+
refresh(true);
|
|
18994
|
+
return cleanup;
|
|
18995
|
+
}
|
|
18996
|
+
|
|
18997
|
+
/**
|
|
18998
|
+
* Automatically updates the position of the floating element when necessary.
|
|
18999
|
+
* Should only be called when the floating element is mounted on the DOM or
|
|
19000
|
+
* visible on the screen.
|
|
19001
|
+
* @returns cleanup function that should be invoked when the floating element is
|
|
19002
|
+
* removed from the DOM or hidden from the screen.
|
|
19003
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
19004
|
+
*/
|
|
19005
|
+
function autoUpdate(reference, floating, update, options) {
|
|
19006
|
+
if (options === void 0) {
|
|
19007
|
+
options = {};
|
|
19008
|
+
}
|
|
19009
|
+
const {
|
|
19010
|
+
ancestorScroll = true,
|
|
19011
|
+
ancestorResize = true,
|
|
19012
|
+
elementResize = typeof ResizeObserver === 'function',
|
|
19013
|
+
layoutShift = typeof IntersectionObserver === 'function',
|
|
19014
|
+
animationFrame = false
|
|
19015
|
+
} = options;
|
|
19016
|
+
const referenceEl = unwrapElement(reference);
|
|
19017
|
+
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
|
|
19018
|
+
ancestors.forEach(ancestor => {
|
|
19019
|
+
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
19020
|
+
passive: true
|
|
19021
|
+
});
|
|
19022
|
+
ancestorResize && ancestor.addEventListener('resize', update);
|
|
19023
|
+
});
|
|
19024
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
19025
|
+
let reobserveFrame = -1;
|
|
19026
|
+
let resizeObserver = null;
|
|
19027
|
+
if (elementResize) {
|
|
19028
|
+
resizeObserver = new ResizeObserver(_ref => {
|
|
19029
|
+
let [firstEntry] = _ref;
|
|
19030
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
19031
|
+
// Prevent update loops when using the `size` middleware.
|
|
19032
|
+
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
19033
|
+
resizeObserver.unobserve(floating);
|
|
19034
|
+
cancelAnimationFrame(reobserveFrame);
|
|
19035
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
19036
|
+
resizeObserver && resizeObserver.observe(floating);
|
|
19037
|
+
});
|
|
19038
|
+
}
|
|
19039
|
+
update();
|
|
19040
|
+
});
|
|
19041
|
+
if (referenceEl && !animationFrame) {
|
|
19042
|
+
resizeObserver.observe(referenceEl);
|
|
19043
|
+
}
|
|
19044
|
+
resizeObserver.observe(floating);
|
|
19045
|
+
}
|
|
19046
|
+
let frameId;
|
|
19047
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
19048
|
+
if (animationFrame) {
|
|
19049
|
+
frameLoop();
|
|
19050
|
+
}
|
|
19051
|
+
function frameLoop() {
|
|
19052
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
19053
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
19054
|
+
update();
|
|
19055
|
+
}
|
|
19056
|
+
prevRefRect = nextRefRect;
|
|
19057
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
19058
|
+
}
|
|
19059
|
+
update();
|
|
19060
|
+
return () => {
|
|
19061
|
+
ancestors.forEach(ancestor => {
|
|
19062
|
+
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
19063
|
+
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
19064
|
+
});
|
|
19065
|
+
cleanupIo && cleanupIo();
|
|
19066
|
+
resizeObserver && resizeObserver.disconnect();
|
|
19067
|
+
resizeObserver = null;
|
|
19068
|
+
if (animationFrame) {
|
|
19069
|
+
cancelAnimationFrame(frameId);
|
|
19070
|
+
}
|
|
19071
|
+
};
|
|
19072
|
+
}
|
|
19073
|
+
|
|
19074
|
+
/**
|
|
19075
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
19076
|
+
* next to a reference element when it is given a certain CSS positioning
|
|
19077
|
+
* strategy.
|
|
19078
|
+
*/
|
|
19079
|
+
const computePosition = (reference, floating, options) => {
|
|
19080
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
|
19081
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
19082
|
+
// single call. If other functions become expensive, we can add them as well.
|
|
19083
|
+
const cache = new Map();
|
|
19084
|
+
const mergedOptions = {
|
|
19085
|
+
platform,
|
|
19086
|
+
...options
|
|
19087
|
+
};
|
|
19088
|
+
const platformWithCache = {
|
|
19089
|
+
...mergedOptions.platform,
|
|
19090
|
+
_c: cache
|
|
19091
|
+
};
|
|
19092
|
+
return computePosition$1(reference, floating, {
|
|
19093
|
+
...mergedOptions,
|
|
19094
|
+
platform: platformWithCache
|
|
19095
|
+
});
|
|
19096
|
+
};
|
|
19097
|
+
|
|
19098
|
+
var index$4 = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
19099
|
+
|
|
19100
|
+
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
|
|
19101
|
+
// functions
|
|
19102
|
+
function deepEqual(a, b) {
|
|
19103
|
+
if (a === b) {
|
|
19104
|
+
return true;
|
|
19105
|
+
}
|
|
19106
|
+
if (typeof a !== typeof b) {
|
|
19107
|
+
return false;
|
|
19108
|
+
}
|
|
19109
|
+
if (typeof a === 'function' && a.toString() === b.toString()) {
|
|
19110
|
+
return true;
|
|
19111
|
+
}
|
|
19112
|
+
let length, i, keys;
|
|
19113
|
+
if (a && b && typeof a == 'object') {
|
|
19114
|
+
if (Array.isArray(a)) {
|
|
19115
|
+
length = a.length;
|
|
19116
|
+
if (length != b.length) return false;
|
|
19117
|
+
for (i = length; i-- !== 0;) {
|
|
19118
|
+
if (!deepEqual(a[i], b[i])) {
|
|
19119
|
+
return false;
|
|
19120
|
+
}
|
|
19121
|
+
}
|
|
19122
|
+
return true;
|
|
19123
|
+
}
|
|
19124
|
+
keys = Object.keys(a);
|
|
19125
|
+
length = keys.length;
|
|
19126
|
+
if (length !== Object.keys(b).length) {
|
|
19127
|
+
return false;
|
|
19128
|
+
}
|
|
19129
|
+
for (i = length; i-- !== 0;) {
|
|
19130
|
+
if (!{}.hasOwnProperty.call(b, keys[i])) {
|
|
19131
|
+
return false;
|
|
19132
|
+
}
|
|
19133
|
+
}
|
|
19134
|
+
for (i = length; i-- !== 0;) {
|
|
19135
|
+
const key = keys[i];
|
|
19136
|
+
if (key === '_owner' && a.$$typeof) {
|
|
19137
|
+
continue;
|
|
19138
|
+
}
|
|
19139
|
+
if (!deepEqual(a[key], b[key])) {
|
|
19140
|
+
return false;
|
|
19141
|
+
}
|
|
19142
|
+
}
|
|
19143
|
+
return true;
|
|
19144
|
+
}
|
|
19145
|
+
return a !== a && b !== b;
|
|
19146
|
+
}
|
|
19147
|
+
|
|
19148
|
+
function getDPR(element) {
|
|
19149
|
+
if (typeof window === 'undefined') {
|
|
19150
|
+
return 1;
|
|
19151
|
+
}
|
|
19152
|
+
const win = element.ownerDocument.defaultView || window;
|
|
19153
|
+
return win.devicePixelRatio || 1;
|
|
19154
|
+
}
|
|
19155
|
+
|
|
19156
|
+
function roundByDPR(element, value) {
|
|
19157
|
+
const dpr = getDPR(element);
|
|
19158
|
+
return Math.round(value * dpr) / dpr;
|
|
19159
|
+
}
|
|
19160
|
+
|
|
19161
|
+
function useLatestRef(value) {
|
|
19162
|
+
const ref = React__namespace.useRef(value);
|
|
19163
|
+
index$4(() => {
|
|
19164
|
+
ref.current = value;
|
|
19165
|
+
});
|
|
19166
|
+
return ref;
|
|
19167
|
+
}
|
|
19168
|
+
|
|
19169
|
+
/**
|
|
19170
|
+
* Provides data to position a floating element.
|
|
19171
|
+
* @see https://floating-ui.com/docs/react
|
|
19172
|
+
*/
|
|
19173
|
+
function useFloating(options) {
|
|
19174
|
+
if (options === void 0) {
|
|
19175
|
+
options = {};
|
|
19176
|
+
}
|
|
19177
|
+
const {
|
|
19178
|
+
placement = 'bottom',
|
|
19179
|
+
strategy = 'absolute',
|
|
19180
|
+
middleware = [],
|
|
19181
|
+
platform,
|
|
19182
|
+
elements: {
|
|
19183
|
+
reference: externalReference,
|
|
19184
|
+
floating: externalFloating
|
|
19185
|
+
} = {},
|
|
19186
|
+
transform = true,
|
|
19187
|
+
whileElementsMounted,
|
|
19188
|
+
open
|
|
19189
|
+
} = options;
|
|
19190
|
+
const [data, setData] = React__namespace.useState({
|
|
19191
|
+
x: 0,
|
|
19192
|
+
y: 0,
|
|
19193
|
+
strategy,
|
|
19194
|
+
placement,
|
|
19195
|
+
middlewareData: {},
|
|
19196
|
+
isPositioned: false
|
|
19197
|
+
});
|
|
19198
|
+
const [latestMiddleware, setLatestMiddleware] = React__namespace.useState(middleware);
|
|
19199
|
+
if (!deepEqual(latestMiddleware, middleware)) {
|
|
19200
|
+
setLatestMiddleware(middleware);
|
|
19201
|
+
}
|
|
19202
|
+
const [_reference, _setReference] = React__namespace.useState(null);
|
|
19203
|
+
const [_floating, _setFloating] = React__namespace.useState(null);
|
|
19204
|
+
const setReference = React__namespace.useCallback(node => {
|
|
19205
|
+
if (node != referenceRef.current) {
|
|
19206
|
+
referenceRef.current = node;
|
|
19207
|
+
_setReference(node);
|
|
19208
|
+
}
|
|
19209
|
+
}, [_setReference]);
|
|
19210
|
+
const setFloating = React__namespace.useCallback(node => {
|
|
19211
|
+
if (node !== floatingRef.current) {
|
|
19212
|
+
floatingRef.current = node;
|
|
19213
|
+
_setFloating(node);
|
|
19214
|
+
}
|
|
19215
|
+
}, [_setFloating]);
|
|
19216
|
+
const referenceEl = externalReference || _reference;
|
|
19217
|
+
const floatingEl = externalFloating || _floating;
|
|
19218
|
+
const referenceRef = React__namespace.useRef(null);
|
|
19219
|
+
const floatingRef = React__namespace.useRef(null);
|
|
19220
|
+
const dataRef = React__namespace.useRef(data);
|
|
19221
|
+
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
19222
|
+
const platformRef = useLatestRef(platform);
|
|
19223
|
+
const update = React__namespace.useCallback(() => {
|
|
19224
|
+
if (!referenceRef.current || !floatingRef.current) {
|
|
19225
|
+
return;
|
|
19226
|
+
}
|
|
19227
|
+
const config = {
|
|
19228
|
+
placement,
|
|
19229
|
+
strategy,
|
|
19230
|
+
middleware: latestMiddleware
|
|
19231
|
+
};
|
|
19232
|
+
if (platformRef.current) {
|
|
19233
|
+
config.platform = platformRef.current;
|
|
19234
|
+
}
|
|
19235
|
+
computePosition(referenceRef.current, floatingRef.current, config).then(data => {
|
|
19236
|
+
const fullData = {
|
|
19237
|
+
...data,
|
|
19238
|
+
isPositioned: true
|
|
19239
|
+
};
|
|
19240
|
+
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
19241
|
+
dataRef.current = fullData;
|
|
19242
|
+
ReactDOM__namespace.flushSync(() => {
|
|
19243
|
+
setData(fullData);
|
|
19244
|
+
});
|
|
19245
|
+
}
|
|
19246
|
+
});
|
|
19247
|
+
}, [latestMiddleware, placement, strategy, platformRef]);
|
|
19248
|
+
index$4(() => {
|
|
19249
|
+
if (open === false && dataRef.current.isPositioned) {
|
|
19250
|
+
dataRef.current.isPositioned = false;
|
|
19251
|
+
setData(data => ({
|
|
19252
|
+
...data,
|
|
19253
|
+
isPositioned: false
|
|
19254
|
+
}));
|
|
19255
|
+
}
|
|
19256
|
+
}, [open]);
|
|
19257
|
+
const isMountedRef = React__namespace.useRef(false);
|
|
19258
|
+
index$4(() => {
|
|
19259
|
+
isMountedRef.current = true;
|
|
19260
|
+
return () => {
|
|
19261
|
+
isMountedRef.current = false;
|
|
19262
|
+
};
|
|
19263
|
+
}, []);
|
|
19264
|
+
index$4(() => {
|
|
19265
|
+
if (referenceEl) referenceRef.current = referenceEl;
|
|
19266
|
+
if (floatingEl) floatingRef.current = floatingEl;
|
|
19267
|
+
if (referenceEl && floatingEl) {
|
|
19268
|
+
if (whileElementsMountedRef.current) {
|
|
19269
|
+
return whileElementsMountedRef.current(referenceEl, floatingEl, update);
|
|
19270
|
+
} else {
|
|
19271
|
+
update();
|
|
19272
|
+
}
|
|
19273
|
+
}
|
|
19274
|
+
}, [referenceEl, floatingEl, update, whileElementsMountedRef]);
|
|
19275
|
+
const refs = React__namespace.useMemo(() => ({
|
|
19276
|
+
reference: referenceRef,
|
|
19277
|
+
floating: floatingRef,
|
|
19278
|
+
setReference,
|
|
19279
|
+
setFloating
|
|
19280
|
+
}), [setReference, setFloating]);
|
|
19281
|
+
const elements = React__namespace.useMemo(() => ({
|
|
19282
|
+
reference: referenceEl,
|
|
19283
|
+
floating: floatingEl
|
|
19284
|
+
}), [referenceEl, floatingEl]);
|
|
19285
|
+
const floatingStyles = React__namespace.useMemo(() => {
|
|
19286
|
+
const initialStyles = {
|
|
19287
|
+
position: strategy,
|
|
19288
|
+
left: 0,
|
|
19289
|
+
top: 0
|
|
19290
|
+
};
|
|
19291
|
+
if (!elements.floating) {
|
|
19292
|
+
return initialStyles;
|
|
19293
|
+
}
|
|
19294
|
+
const x = roundByDPR(elements.floating, data.x);
|
|
19295
|
+
const y = roundByDPR(elements.floating, data.y);
|
|
19296
|
+
if (transform) {
|
|
19297
|
+
return {
|
|
19298
|
+
...initialStyles,
|
|
19299
|
+
transform: "translate(" + x + "px, " + y + "px)",
|
|
19300
|
+
...(getDPR(elements.floating) >= 1.5 && {
|
|
19301
|
+
willChange: 'transform'
|
|
19302
|
+
})
|
|
19303
|
+
};
|
|
19304
|
+
}
|
|
19305
|
+
return {
|
|
19306
|
+
position: strategy,
|
|
19307
|
+
left: x,
|
|
19308
|
+
top: y
|
|
19309
|
+
};
|
|
19310
|
+
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
19311
|
+
return React__namespace.useMemo(() => ({
|
|
19312
|
+
...data,
|
|
19313
|
+
update,
|
|
19314
|
+
refs,
|
|
19315
|
+
elements,
|
|
19316
|
+
floatingStyles
|
|
19317
|
+
}), [data, update, refs, elements, floatingStyles]);
|
|
19318
|
+
}
|
|
19319
|
+
|
|
19320
|
+
const useFocusZone = (settings = {}, dependencies = []) => {
|
|
19321
|
+
const containerRef = useProvidedOrCreatedRef(settings.containerRef);
|
|
19322
|
+
const useActiveDescendant = !!settings.activeDescendantFocus;
|
|
19323
|
+
const passedActiveDescendantRef = typeof settings.activeDescendantFocus === 'boolean' || !settings.activeDescendantFocus ? undefined : settings.activeDescendantFocus;
|
|
19324
|
+
const activeDescendantControlRef = useProvidedOrCreatedRef(passedActiveDescendantRef);
|
|
19325
|
+
const disabled = settings.disabled;
|
|
19326
|
+
const abortController = React.useRef();
|
|
19327
|
+
React.useEffect(() => {
|
|
19328
|
+
if (containerRef.current instanceof HTMLElement && (!useActiveDescendant || activeDescendantControlRef.current instanceof HTMLElement)) {
|
|
19329
|
+
if (!disabled) {
|
|
19330
|
+
const defaultSettings = {
|
|
19331
|
+
...settings,
|
|
19332
|
+
activeDescendantControl: activeDescendantControlRef.current ?? undefined
|
|
19333
|
+
};
|
|
19334
|
+
abortController.current = focusZone(containerRef.current, defaultSettings);
|
|
19335
|
+
return () => {
|
|
19336
|
+
abortController.current?.abort();
|
|
19337
|
+
};
|
|
19338
|
+
} else {
|
|
19339
|
+
abortController.current?.abort();
|
|
19340
|
+
}
|
|
19341
|
+
}
|
|
19342
|
+
}, [disabled, ...dependencies]);
|
|
19343
|
+
return {
|
|
19344
|
+
containerRef,
|
|
19345
|
+
activeDescendantControlRef
|
|
19346
|
+
};
|
|
19347
|
+
};
|
|
19348
|
+
|
|
19349
|
+
const useToggleHandler = ({
|
|
19350
|
+
initialState = false
|
|
19351
|
+
}) => {
|
|
19352
|
+
const [state, setState] = React.useState(initialState);
|
|
19353
|
+
const on = () => {
|
|
19354
|
+
setState(true);
|
|
19355
|
+
};
|
|
19356
|
+
const off = () => {
|
|
19357
|
+
setState(false);
|
|
19358
|
+
};
|
|
19359
|
+
const toggle = React.useCallback(() => {
|
|
19360
|
+
setState(prev => !prev);
|
|
19361
|
+
}, []);
|
|
19362
|
+
return {
|
|
19363
|
+
state,
|
|
19364
|
+
on,
|
|
19365
|
+
off,
|
|
19366
|
+
toggle
|
|
19367
|
+
};
|
|
19368
|
+
};
|
|
19369
|
+
|
|
19370
|
+
const OverlayPopper = ({
|
|
19371
|
+
children: propChildren,
|
|
19372
|
+
renderOverlay,
|
|
19373
|
+
placement = 'bottom-start',
|
|
19374
|
+
focusZoneSettings,
|
|
19375
|
+
focusTrapSettings
|
|
19376
|
+
}) => {
|
|
19377
|
+
const {
|
|
19378
|
+
refs,
|
|
19379
|
+
floatingStyles,
|
|
19380
|
+
isPositioned
|
|
19381
|
+
} = useFloating({
|
|
19382
|
+
placement,
|
|
19383
|
+
whileElementsMounted: autoUpdate,
|
|
19384
|
+
middleware: [offset(space[1]), flip(), shift()],
|
|
19385
|
+
strategy: 'fixed'
|
|
19386
|
+
});
|
|
19387
|
+
const {
|
|
19388
|
+
state: isOpen,
|
|
19389
|
+
toggle: toggleOverlay,
|
|
19390
|
+
off: closeOverlay
|
|
19391
|
+
} = useToggleHandler({
|
|
19392
|
+
initialState: false
|
|
19393
|
+
});
|
|
19394
|
+
const children = React.Children.map(propChildren, child => /*#__PURE__*/React.cloneElement(child, {
|
|
19395
|
+
onClick: toggleOverlay,
|
|
19396
|
+
tabIndex: 0,
|
|
19397
|
+
...{
|
|
19398
|
+
ref: refs.setReference
|
|
19399
|
+
}
|
|
19400
|
+
}));
|
|
19401
|
+
useFocusZone({
|
|
19402
|
+
containerRef: refs.floating,
|
|
19403
|
+
disabled: !isOpen || !isPositioned,
|
|
19404
|
+
...focusZoneSettings
|
|
19405
|
+
});
|
|
19406
|
+
useFocusTrap({
|
|
19407
|
+
containerRef: refs.floating,
|
|
19408
|
+
disabled: !isOpen || !isPositioned,
|
|
19409
|
+
...focusTrapSettings
|
|
19410
|
+
});
|
|
19411
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
19412
|
+
children: [children, /*#__PURE__*/jsxRuntimeExports.jsx(Overlay$1, {
|
|
19413
|
+
ref: refs.setFloating,
|
|
19414
|
+
isOpen: isOpen,
|
|
19415
|
+
onDismiss: closeOverlay,
|
|
19416
|
+
ignoreOutsideClickRefs: [refs.reference],
|
|
19417
|
+
style: floatingStyles,
|
|
19418
|
+
children: renderOverlay({
|
|
19419
|
+
isOpen,
|
|
19420
|
+
closeOverlay
|
|
19421
|
+
})
|
|
19422
|
+
})]
|
|
19423
|
+
});
|
|
19424
|
+
};
|
|
19425
|
+
|
|
19426
|
+
/**
|
|
19427
|
+
* 아무 행위도 하지 않는 함수입니다.
|
|
19428
|
+
*/
|
|
19429
|
+
function noop() {}
|
|
19430
|
+
|
|
19431
|
+
const Pagination = ({
|
|
19432
|
+
pages: propPages,
|
|
19433
|
+
currentPageIndex,
|
|
19434
|
+
aroundPageCount = 1,
|
|
19435
|
+
edgePageCount = 1,
|
|
19436
|
+
type = 'default',
|
|
19437
|
+
sx,
|
|
19438
|
+
onPageClick = noop,
|
|
19439
|
+
onPreviousClick = noop,
|
|
19440
|
+
onNextClick = noop,
|
|
19441
|
+
renderPage = (page, i) => /*#__PURE__*/jsxRuntimeExports.jsx(PaginationPage, {
|
|
19442
|
+
onClick: () => onPageClick(page, i),
|
|
19443
|
+
selected: i === currentPageIndex,
|
|
19444
|
+
children: page.label
|
|
19445
|
+
}),
|
|
19446
|
+
renderPageWrapper = (children, {
|
|
19447
|
+
label
|
|
19448
|
+
}, i) => /*#__PURE__*/jsxRuntimeExports.jsx(React.Fragment, {
|
|
19449
|
+
children: children
|
|
19450
|
+
}, [label, i].join('-')),
|
|
19451
|
+
renderPreviousPageDirection = ({
|
|
19452
|
+
previousPageDirectionProps
|
|
19453
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsxs(PaginationPageDirection, {
|
|
19454
|
+
...previousPageDirectionProps,
|
|
19455
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsx(SvgChevronLeft, {}), "\uC774\uC804"]
|
|
19456
|
+
}),
|
|
19457
|
+
renderNextPageDirection = ({
|
|
19458
|
+
nextPageDirectionProps
|
|
19459
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsxs(PaginationPageDirection, {
|
|
19460
|
+
...nextPageDirectionProps,
|
|
19461
|
+
children: ["\uB2E4\uC74C", /*#__PURE__*/jsxRuntimeExports.jsx(SvgChevronRight, {})]
|
|
19462
|
+
}),
|
|
19463
|
+
renderTruncationIndicator = () => /*#__PURE__*/jsxRuntimeExports.jsx(PaginationTruncationIndicator, {
|
|
19464
|
+
children: "\u2026"
|
|
19465
|
+
})
|
|
19466
|
+
}) => {
|
|
19467
|
+
const CURRENT_PAGE_COUNT = 1;
|
|
19468
|
+
const totalVisiblePageCount = CURRENT_PAGE_COUNT + 2 * aroundPageCount + 2 * edgePageCount;
|
|
19469
|
+
const pages = propPages.map((page, i) => ({
|
|
19470
|
+
page,
|
|
19471
|
+
originalIndex: i
|
|
19472
|
+
}));
|
|
19473
|
+
const totalPageCount = propPages.length;
|
|
19474
|
+
const isCurrentPageCloseToBeginEdge = currentPageIndex < edgePageCount + aroundPageCount + CURRENT_PAGE_COUNT;
|
|
19475
|
+
const isCurrentPageCloseToEndEdge = totalPageCount - (edgePageCount + aroundPageCount + CURRENT_PAGE_COUNT) < currentPageIndex + 1;
|
|
19476
|
+
const isTruncationNeeded = totalVisiblePageCount < totalPageCount;
|
|
19477
|
+
const renderPaginationPage = React.useCallback((page, i) => renderPageWrapper(renderPage(page, i), page, i), [currentPageIndex]);
|
|
19478
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs(BasePagination, {
|
|
19479
|
+
type: type,
|
|
19480
|
+
sx: sx,
|
|
19481
|
+
children: [renderPreviousPageDirection({
|
|
19482
|
+
previousPageDirectionProps: {
|
|
19483
|
+
onClick: () => onPreviousClick(currentPageIndex),
|
|
19484
|
+
disabled: currentPageIndex === 0
|
|
19485
|
+
}
|
|
19486
|
+
}), !isTruncationNeeded ? pages.map(({
|
|
19487
|
+
page,
|
|
19488
|
+
originalIndex
|
|
19489
|
+
}) => renderPaginationPage(page, originalIndex)) : isTruncationNeeded && isCurrentPageCloseToBeginEdge ? [pages.slice(0, edgePageCount + aroundPageCount * 2 + CURRENT_PAGE_COUNT).map(({
|
|
19490
|
+
page,
|
|
19491
|
+
originalIndex
|
|
19492
|
+
}) => renderPaginationPage(page, originalIndex)), /*#__PURE__*/jsxRuntimeExports.jsx(React.Fragment, {
|
|
19493
|
+
children: renderTruncationIndicator()
|
|
19494
|
+
}, 'end_truncation_indicator'), pages.slice(edgePageCount * -1).map(({
|
|
19495
|
+
page,
|
|
19496
|
+
originalIndex
|
|
19497
|
+
}) => renderPaginationPage(page, originalIndex))] : isTruncationNeeded && isCurrentPageCloseToEndEdge ? [pages.slice(0, edgePageCount).map(({
|
|
19498
|
+
page,
|
|
19499
|
+
originalIndex
|
|
19500
|
+
}) => renderPaginationPage(page, originalIndex)), /*#__PURE__*/jsxRuntimeExports.jsx(React.Fragment, {
|
|
19501
|
+
children: renderTruncationIndicator()
|
|
19502
|
+
}, 'begin_truncation_indicator'), pages.slice(totalPageCount - (edgePageCount + aroundPageCount * 2 + CURRENT_PAGE_COUNT)).map(({
|
|
19503
|
+
page,
|
|
19504
|
+
originalIndex
|
|
19505
|
+
}) => renderPaginationPage(page, originalIndex))] : [pages.slice(0, edgePageCount).map(({
|
|
19506
|
+
page,
|
|
19507
|
+
originalIndex
|
|
19508
|
+
}) => renderPaginationPage(page, originalIndex)), /*#__PURE__*/jsxRuntimeExports.jsx(React.Fragment, {
|
|
19509
|
+
children: renderTruncationIndicator()
|
|
19510
|
+
}, 'begin_truncation_indicator'), pages.slice(currentPageIndex - aroundPageCount, currentPageIndex + aroundPageCount + CURRENT_PAGE_COUNT).map(({
|
|
19511
|
+
page,
|
|
19512
|
+
originalIndex
|
|
19513
|
+
}) => renderPaginationPage(page, originalIndex)), /*#__PURE__*/jsxRuntimeExports.jsx(React.Fragment, {
|
|
19514
|
+
children: renderTruncationIndicator()
|
|
19515
|
+
}, 'end_truncation_indicator'), pages.slice(edgePageCount * -1).map(({
|
|
19516
|
+
page,
|
|
19517
|
+
originalIndex
|
|
19518
|
+
}) => renderPaginationPage(page, originalIndex))], renderNextPageDirection({
|
|
19519
|
+
nextPageDirectionProps: {
|
|
19520
|
+
onClick: () => onNextClick(currentPageIndex),
|
|
19521
|
+
disabled: currentPageIndex === totalPageCount - 1
|
|
19522
|
+
}
|
|
19523
|
+
})]
|
|
19524
|
+
});
|
|
19525
|
+
};
|
|
19526
|
+
const BasePagination = styled__default.default.nav`
|
|
19527
|
+
display: flex;
|
|
19528
|
+
align-items: center;
|
|
19529
|
+
justify-content: center;
|
|
19530
|
+
flex-wrap: nowrap;
|
|
19531
|
+
column-gap: ${({
|
|
19532
|
+
theme
|
|
19533
|
+
}) => forcePixelValue(theme.space[1])};
|
|
19534
|
+
|
|
19535
|
+
${variant({
|
|
19536
|
+
prop: 'type',
|
|
19537
|
+
variants: {
|
|
19538
|
+
default: {},
|
|
19539
|
+
simple: {
|
|
19540
|
+
'& > *:not(:first-child):not(:last-child)': {
|
|
19541
|
+
display: 'none !important'
|
|
19542
|
+
}
|
|
19543
|
+
}
|
|
19544
|
+
}
|
|
19545
|
+
})}
|
|
19546
|
+
${sx}
|
|
19547
|
+
`;
|
|
19548
|
+
const PaginationPage = styled__default.default(UnstyledButton)`
|
|
19549
|
+
transition: background-color 100ms;
|
|
19550
|
+
|
|
19551
|
+
height: ${forcePixelValue(32)};
|
|
19552
|
+
min-width: ${forcePixelValue(32)};
|
|
19553
|
+
|
|
19554
|
+
border-radius: ${({
|
|
19555
|
+
theme
|
|
19556
|
+
}) => forcePixelValue(theme.radii.xs)};
|
|
19557
|
+
padding: ${({
|
|
19558
|
+
theme
|
|
19559
|
+
}) => `${forcePixelValue(theme.space[0])} ${forcePixelValue(theme.space[3])}`};
|
|
19560
|
+
background-color: ${({
|
|
19561
|
+
theme
|
|
19562
|
+
}) => theme.colors['bg/neutral/subtler']};
|
|
19563
|
+
|
|
19564
|
+
font-size: ${({
|
|
19565
|
+
theme
|
|
19566
|
+
}) => forcePixelValue(theme.fontSizes.xs)};
|
|
19567
|
+
font-weight: ${({
|
|
19568
|
+
theme
|
|
19569
|
+
}) => theme.fontWeights.regular};
|
|
19570
|
+
line-height: ${({
|
|
19571
|
+
theme
|
|
19572
|
+
}) => theme.lineHeights[2]};
|
|
19573
|
+
color: ${({
|
|
19574
|
+
theme
|
|
19575
|
+
}) => theme.colors['text/neutral']};
|
|
19576
|
+
|
|
19577
|
+
${({
|
|
19578
|
+
selected
|
|
19579
|
+
}) => selected ? styled.css`
|
|
19580
|
+
background-color: ${({
|
|
19581
|
+
theme
|
|
19582
|
+
}) => theme.colors['bg/neutral/bolder']};
|
|
19583
|
+
color: ${({
|
|
19584
|
+
theme
|
|
19585
|
+
}) => theme.colors['text/inverse']};
|
|
19586
|
+
` : styled.css`
|
|
19587
|
+
&:hover {
|
|
19588
|
+
background-color: ${({
|
|
19589
|
+
theme
|
|
19590
|
+
}) => theme.colors['bg/neutral/subtler/hovered']};
|
|
19591
|
+
}
|
|
19592
|
+
`}
|
|
19593
|
+
`;
|
|
19594
|
+
const PaginationPageDirection = styled__default.default(UnstyledButton)`
|
|
19595
|
+
transition: background-color 100ms;
|
|
19596
|
+
|
|
19597
|
+
display: inline-flex;
|
|
19598
|
+
align-items: center;
|
|
19599
|
+
flex-wrap: nowrap;
|
|
19600
|
+
column-gap: ${({
|
|
19601
|
+
theme
|
|
19602
|
+
}) => forcePixelValue(theme.space[1])};
|
|
19603
|
+
|
|
19604
|
+
height: ${forcePixelValue(32)};
|
|
19605
|
+
min-width: ${forcePixelValue(32)};
|
|
19606
|
+
|
|
19607
|
+
border-radius: ${({
|
|
19608
|
+
theme
|
|
19609
|
+
}) => forcePixelValue(theme.radii.xs)};
|
|
19610
|
+
padding: ${({
|
|
19611
|
+
theme
|
|
19612
|
+
}) => `${forcePixelValue(theme.space[0])} ${forcePixelValue(theme.space[3])}`};
|
|
19613
|
+
background-color: ${({
|
|
19614
|
+
theme
|
|
19615
|
+
}) => theme.colors['bg/neutral/subtler']};
|
|
19616
|
+
|
|
19617
|
+
font-size: ${({
|
|
19618
|
+
theme
|
|
19619
|
+
}) => forcePixelValue(theme.fontSizes.xs)};
|
|
19620
|
+
font-weight: ${({
|
|
19621
|
+
theme
|
|
19622
|
+
}) => theme.fontWeights.regular};
|
|
19623
|
+
line-height: ${({
|
|
19624
|
+
theme
|
|
19625
|
+
}) => theme.lineHeights[2]};
|
|
19626
|
+
color: ${({
|
|
19627
|
+
theme
|
|
19628
|
+
}) => theme.colors['text/neutral']};
|
|
19629
|
+
|
|
19630
|
+
& svg {
|
|
19631
|
+
color: ${({
|
|
19632
|
+
theme
|
|
19633
|
+
}) => theme.colors['icon/accent/gray']};
|
|
19634
|
+
width: ${forcePixelValue(16)};
|
|
19635
|
+
height: ${forcePixelValue(16)};
|
|
19636
|
+
}
|
|
19637
|
+
|
|
19638
|
+
&:hover:not(:disabled) {
|
|
19639
|
+
background-color: ${({
|
|
19640
|
+
theme
|
|
19641
|
+
}) => theme.colors['bg/neutral/subtler/hovered']};
|
|
19642
|
+
}
|
|
19643
|
+
&:disabled {
|
|
19644
|
+
cursor: not-allowed;
|
|
19645
|
+
color: ${({
|
|
19646
|
+
theme
|
|
19647
|
+
}) => theme.colors['text/disabled']};
|
|
19648
|
+
& > svg {
|
|
19649
|
+
color: ${({
|
|
19650
|
+
theme
|
|
19651
|
+
}) => theme.colors['icon/disabled']};
|
|
19652
|
+
}
|
|
19653
|
+
}
|
|
19654
|
+
`;
|
|
19655
|
+
const PaginationTruncationIndicator = styled__default.default.div`
|
|
19656
|
+
min-width: ${forcePixelValue(32)};
|
|
19657
|
+
|
|
19658
|
+
border-radius: ${({
|
|
19659
|
+
theme
|
|
19660
|
+
}) => forcePixelValue(theme.radii.xs)};
|
|
19661
|
+
padding: ${({
|
|
19662
|
+
theme
|
|
19663
|
+
}) => `${forcePixelValue(theme.space[0])} ${forcePixelValue(theme.space[3])}`};
|
|
19664
|
+
background-color: ${({
|
|
19665
|
+
theme
|
|
19666
|
+
}) => theme.colors['bg/neutral/subtler']};
|
|
19667
|
+
|
|
19668
|
+
font-size: ${({
|
|
19669
|
+
theme
|
|
19670
|
+
}) => forcePixelValue(theme.fontSizes.xs)};
|
|
19671
|
+
font-weight: ${({
|
|
19672
|
+
theme
|
|
19673
|
+
}) => theme.fontWeights.regular};
|
|
19674
|
+
line-height: ${({
|
|
19675
|
+
theme
|
|
19676
|
+
}) => theme.lineHeights[2]};
|
|
19677
|
+
color: ${({
|
|
19678
|
+
theme
|
|
19679
|
+
}) => theme.colors['text/neutral']};
|
|
19680
|
+
|
|
19681
|
+
pointer-events: none;
|
|
19682
|
+
|
|
19683
|
+
${sx}
|
|
19684
|
+
`;
|
|
19685
|
+
var index$3 = Object.assign(Pagination, {
|
|
19686
|
+
Page: PaginationPage,
|
|
19687
|
+
PageDirection: PaginationPageDirection,
|
|
19688
|
+
TruncationIndicator: PaginationTruncationIndicator
|
|
19689
|
+
});
|
|
19690
|
+
|
|
19691
|
+
var reactIs = {exports: {}};
|
|
19692
|
+
|
|
19693
|
+
var reactIs_production_min = {};
|
|
19694
|
+
|
|
19695
|
+
/**
|
|
19696
|
+
* @license React
|
|
19697
|
+
* react-is.production.min.js
|
|
19698
|
+
*
|
|
19699
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
19700
|
+
*
|
|
19701
|
+
* This source code is licensed under the MIT license found in the
|
|
19702
|
+
* LICENSE file in the root directory of this source tree.
|
|
19703
|
+
*/
|
|
19704
|
+
var hasRequiredReactIs_production_min;
|
|
19705
|
+
function requireReactIs_production_min() {
|
|
19706
|
+
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
19707
|
+
hasRequiredReactIs_production_min = 1;
|
|
19708
|
+
var b = Symbol.for("react.element"),
|
|
19709
|
+
c = Symbol.for("react.portal"),
|
|
19710
|
+
d = Symbol.for("react.fragment"),
|
|
19711
|
+
e = Symbol.for("react.strict_mode"),
|
|
19712
|
+
f = Symbol.for("react.profiler"),
|
|
19713
|
+
g = Symbol.for("react.provider"),
|
|
19714
|
+
h = Symbol.for("react.context"),
|
|
19715
|
+
k = Symbol.for("react.server_context"),
|
|
19716
|
+
l = Symbol.for("react.forward_ref"),
|
|
19717
|
+
m = Symbol.for("react.suspense"),
|
|
19718
|
+
n = Symbol.for("react.suspense_list"),
|
|
19719
|
+
p = Symbol.for("react.memo"),
|
|
19720
|
+
q = Symbol.for("react.lazy"),
|
|
19721
|
+
t = Symbol.for("react.offscreen"),
|
|
19722
|
+
u;
|
|
19723
|
+
u = Symbol.for("react.module.reference");
|
|
19724
|
+
function v(a) {
|
|
19725
|
+
if ("object" === typeof a && null !== a) {
|
|
19726
|
+
var r = a.$$typeof;
|
|
19727
|
+
switch (r) {
|
|
19728
|
+
case b:
|
|
19729
|
+
switch (a = a.type, a) {
|
|
19730
|
+
case d:
|
|
19731
|
+
case f:
|
|
19732
|
+
case e:
|
|
19733
|
+
case m:
|
|
19734
|
+
case n:
|
|
19735
|
+
return a;
|
|
19736
|
+
default:
|
|
19737
|
+
switch (a = a && a.$$typeof, a) {
|
|
19738
|
+
case k:
|
|
19739
|
+
case h:
|
|
19740
|
+
case l:
|
|
19741
|
+
case q:
|
|
19742
|
+
case p:
|
|
19743
|
+
case g:
|
|
19744
|
+
return a;
|
|
19745
|
+
default:
|
|
19746
|
+
return r;
|
|
19747
|
+
}
|
|
19748
|
+
}
|
|
19749
|
+
case c:
|
|
19750
|
+
return r;
|
|
19751
|
+
}
|
|
19752
|
+
}
|
|
19753
|
+
}
|
|
19754
|
+
reactIs_production_min.ContextConsumer = h;
|
|
19755
|
+
reactIs_production_min.ContextProvider = g;
|
|
19756
|
+
reactIs_production_min.Element = b;
|
|
19757
|
+
reactIs_production_min.ForwardRef = l;
|
|
19758
|
+
reactIs_production_min.Fragment = d;
|
|
19759
|
+
reactIs_production_min.Lazy = q;
|
|
19760
|
+
reactIs_production_min.Memo = p;
|
|
19761
|
+
reactIs_production_min.Portal = c;
|
|
19762
|
+
reactIs_production_min.Profiler = f;
|
|
19763
|
+
reactIs_production_min.StrictMode = e;
|
|
19764
|
+
reactIs_production_min.Suspense = m;
|
|
19765
|
+
reactIs_production_min.SuspenseList = n;
|
|
19766
|
+
reactIs_production_min.isAsyncMode = function () {
|
|
19767
|
+
return !1;
|
|
19768
|
+
};
|
|
19769
|
+
reactIs_production_min.isConcurrentMode = function () {
|
|
19770
|
+
return !1;
|
|
19771
|
+
};
|
|
19772
|
+
reactIs_production_min.isContextConsumer = function (a) {
|
|
19773
|
+
return v(a) === h;
|
|
19774
|
+
};
|
|
19775
|
+
reactIs_production_min.isContextProvider = function (a) {
|
|
19776
|
+
return v(a) === g;
|
|
19777
|
+
};
|
|
19778
|
+
reactIs_production_min.isElement = function (a) {
|
|
19779
|
+
return "object" === typeof a && null !== a && a.$$typeof === b;
|
|
19780
|
+
};
|
|
19781
|
+
reactIs_production_min.isForwardRef = function (a) {
|
|
19782
|
+
return v(a) === l;
|
|
19783
|
+
};
|
|
19784
|
+
reactIs_production_min.isFragment = function (a) {
|
|
19785
|
+
return v(a) === d;
|
|
19786
|
+
};
|
|
19787
|
+
reactIs_production_min.isLazy = function (a) {
|
|
19788
|
+
return v(a) === q;
|
|
19789
|
+
};
|
|
19790
|
+
reactIs_production_min.isMemo = function (a) {
|
|
19791
|
+
return v(a) === p;
|
|
19792
|
+
};
|
|
19793
|
+
reactIs_production_min.isPortal = function (a) {
|
|
19794
|
+
return v(a) === c;
|
|
19795
|
+
};
|
|
19796
|
+
reactIs_production_min.isProfiler = function (a) {
|
|
19797
|
+
return v(a) === f;
|
|
19798
|
+
};
|
|
19799
|
+
reactIs_production_min.isStrictMode = function (a) {
|
|
19800
|
+
return v(a) === e;
|
|
19801
|
+
};
|
|
19802
|
+
reactIs_production_min.isSuspense = function (a) {
|
|
19803
|
+
return v(a) === m;
|
|
19804
|
+
};
|
|
19805
|
+
reactIs_production_min.isSuspenseList = function (a) {
|
|
19806
|
+
return v(a) === n;
|
|
19807
|
+
};
|
|
19808
|
+
reactIs_production_min.isValidElementType = function (a) {
|
|
19809
|
+
return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? !0 : !1;
|
|
19810
|
+
};
|
|
19811
|
+
reactIs_production_min.typeOf = v;
|
|
19812
|
+
return reactIs_production_min;
|
|
19813
|
+
}
|
|
19814
|
+
|
|
19815
|
+
var reactIs_development = {};
|
|
19816
|
+
|
|
19817
|
+
/**
|
|
19818
|
+
* @license React
|
|
19819
|
+
* react-is.development.js
|
|
19820
|
+
*
|
|
19821
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
19822
|
+
*
|
|
19823
|
+
* This source code is licensed under the MIT license found in the
|
|
19824
|
+
* LICENSE file in the root directory of this source tree.
|
|
19825
|
+
*/
|
|
19826
|
+
var hasRequiredReactIs_development;
|
|
19827
|
+
function requireReactIs_development() {
|
|
19828
|
+
if (hasRequiredReactIs_development) return reactIs_development;
|
|
19829
|
+
hasRequiredReactIs_development = 1;
|
|
19830
|
+
if (process.env.NODE_ENV !== "production") {
|
|
19831
|
+
(function () {
|
|
19832
|
+
|
|
19833
|
+
// ATTENTION
|
|
19834
|
+
// When adding new symbols to this file,
|
|
19835
|
+
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
19836
|
+
// The Symbol used to tag the ReactElement-like types.
|
|
19837
|
+
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
19838
|
+
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
19839
|
+
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
19840
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
19841
|
+
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
19842
|
+
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
19843
|
+
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
19844
|
+
var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
|
|
19845
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
19846
|
+
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
19847
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
19848
|
+
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
19849
|
+
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
19850
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
19851
|
+
|
|
19852
|
+
// -----------------------------------------------------------------------------
|
|
19853
|
+
|
|
19854
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
19855
|
+
var enableCacheElement = false;
|
|
19856
|
+
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
19857
|
+
|
|
19858
|
+
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
19859
|
+
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
19860
|
+
// issues in DEV builds.
|
|
19861
|
+
|
|
19862
|
+
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
19863
|
+
|
|
19864
|
+
var REACT_MODULE_REFERENCE;
|
|
19865
|
+
{
|
|
19866
|
+
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
19867
|
+
}
|
|
19868
|
+
function isValidElementType(type) {
|
|
19869
|
+
if (typeof type === 'string' || typeof type === 'function') {
|
|
19870
|
+
return true;
|
|
19871
|
+
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
19872
|
+
|
|
19873
|
+
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
19874
|
+
return true;
|
|
19875
|
+
}
|
|
19876
|
+
if (typeof type === 'object' && type !== null) {
|
|
19877
|
+
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
|
19878
|
+
// This needs to include all possible module reference object
|
|
19879
|
+
// types supported by any Flight configuration anywhere since
|
|
19880
|
+
// we don't know which Flight build this will end up being used
|
|
19881
|
+
// with.
|
|
19882
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
19883
|
+
return true;
|
|
19884
|
+
}
|
|
19885
|
+
}
|
|
19886
|
+
return false;
|
|
19887
|
+
}
|
|
19888
|
+
function typeOf(object) {
|
|
19889
|
+
if (typeof object === 'object' && object !== null) {
|
|
19890
|
+
var $$typeof = object.$$typeof;
|
|
19891
|
+
switch ($$typeof) {
|
|
19892
|
+
case REACT_ELEMENT_TYPE:
|
|
19893
|
+
var type = object.type;
|
|
19894
|
+
switch (type) {
|
|
19895
|
+
case REACT_FRAGMENT_TYPE:
|
|
19896
|
+
case REACT_PROFILER_TYPE:
|
|
19897
|
+
case REACT_STRICT_MODE_TYPE:
|
|
19898
|
+
case REACT_SUSPENSE_TYPE:
|
|
19899
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
19900
|
+
return type;
|
|
19901
|
+
default:
|
|
19902
|
+
var $$typeofType = type && type.$$typeof;
|
|
19903
|
+
switch ($$typeofType) {
|
|
19904
|
+
case REACT_SERVER_CONTEXT_TYPE:
|
|
19905
|
+
case REACT_CONTEXT_TYPE:
|
|
19906
|
+
case REACT_FORWARD_REF_TYPE:
|
|
19907
|
+
case REACT_LAZY_TYPE:
|
|
19908
|
+
case REACT_MEMO_TYPE:
|
|
19909
|
+
case REACT_PROVIDER_TYPE:
|
|
19910
|
+
return $$typeofType;
|
|
19911
|
+
default:
|
|
19912
|
+
return $$typeof;
|
|
19913
|
+
}
|
|
19914
|
+
}
|
|
19915
|
+
case REACT_PORTAL_TYPE:
|
|
19916
|
+
return $$typeof;
|
|
19917
|
+
}
|
|
19918
|
+
}
|
|
19919
|
+
return undefined;
|
|
19920
|
+
}
|
|
19921
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
19922
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
19923
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
19924
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
19925
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
19926
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
19927
|
+
var Memo = REACT_MEMO_TYPE;
|
|
19928
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
19929
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
19930
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
19931
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
19932
|
+
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
19933
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
19934
|
+
var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
|
|
19935
|
+
|
|
19936
|
+
function isAsyncMode(object) {
|
|
19937
|
+
{
|
|
19938
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
19939
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
19940
|
+
|
|
19941
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
19942
|
+
}
|
|
19943
|
+
}
|
|
19944
|
+
return false;
|
|
19945
|
+
}
|
|
19946
|
+
function isConcurrentMode(object) {
|
|
19947
|
+
{
|
|
19948
|
+
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
19949
|
+
hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
19950
|
+
|
|
19951
|
+
console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
19952
|
+
}
|
|
19953
|
+
}
|
|
19954
|
+
return false;
|
|
19955
|
+
}
|
|
19956
|
+
function isContextConsumer(object) {
|
|
19957
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
19958
|
+
}
|
|
19959
|
+
function isContextProvider(object) {
|
|
19960
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
19961
|
+
}
|
|
19962
|
+
function isElement(object) {
|
|
19963
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
19964
|
+
}
|
|
19965
|
+
function isForwardRef(object) {
|
|
19966
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
19967
|
+
}
|
|
19968
|
+
function isFragment(object) {
|
|
19969
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
19970
|
+
}
|
|
19971
|
+
function isLazy(object) {
|
|
19972
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
19973
|
+
}
|
|
19974
|
+
function isMemo(object) {
|
|
19975
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
19976
|
+
}
|
|
19977
|
+
function isPortal(object) {
|
|
19978
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
19979
|
+
}
|
|
19980
|
+
function isProfiler(object) {
|
|
19981
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
19982
|
+
}
|
|
19983
|
+
function isStrictMode(object) {
|
|
19984
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
19985
|
+
}
|
|
19986
|
+
function isSuspense(object) {
|
|
19987
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
19988
|
+
}
|
|
19989
|
+
function isSuspenseList(object) {
|
|
19990
|
+
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
19991
|
+
}
|
|
19992
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
19993
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
19994
|
+
reactIs_development.Element = Element;
|
|
19995
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
19996
|
+
reactIs_development.Fragment = Fragment;
|
|
19997
|
+
reactIs_development.Lazy = Lazy;
|
|
19998
|
+
reactIs_development.Memo = Memo;
|
|
19999
|
+
reactIs_development.Portal = Portal;
|
|
20000
|
+
reactIs_development.Profiler = Profiler;
|
|
20001
|
+
reactIs_development.StrictMode = StrictMode;
|
|
20002
|
+
reactIs_development.Suspense = Suspense;
|
|
20003
|
+
reactIs_development.SuspenseList = SuspenseList;
|
|
20004
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
20005
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
20006
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
20007
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
20008
|
+
reactIs_development.isElement = isElement;
|
|
20009
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
20010
|
+
reactIs_development.isFragment = isFragment;
|
|
20011
|
+
reactIs_development.isLazy = isLazy;
|
|
20012
|
+
reactIs_development.isMemo = isMemo;
|
|
20013
|
+
reactIs_development.isPortal = isPortal;
|
|
20014
|
+
reactIs_development.isProfiler = isProfiler;
|
|
20015
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
20016
|
+
reactIs_development.isSuspense = isSuspense;
|
|
20017
|
+
reactIs_development.isSuspenseList = isSuspenseList;
|
|
20018
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
20019
|
+
reactIs_development.typeOf = typeOf;
|
|
20020
|
+
})();
|
|
20021
|
+
}
|
|
20022
|
+
return reactIs_development;
|
|
20023
|
+
}
|
|
20024
|
+
|
|
20025
|
+
if (process.env.NODE_ENV === 'production') {
|
|
20026
|
+
reactIs.exports = requireReactIs_production_min();
|
|
20027
|
+
} else {
|
|
20028
|
+
reactIs.exports = requireReactIs_development();
|
|
20029
|
+
}
|
|
20030
|
+
var reactIsExports = reactIs.exports;
|
|
20031
|
+
|
|
20032
|
+
const Pill = ({
|
|
20033
|
+
text,
|
|
20034
|
+
size = 'm',
|
|
20035
|
+
variant = 'secondary',
|
|
20036
|
+
leadingVisual: LeadingVisual,
|
|
20037
|
+
onRemove,
|
|
20038
|
+
...props
|
|
20039
|
+
}, ref) => /*#__PURE__*/jsxRuntimeExports.jsxs(BasePill, {
|
|
20040
|
+
ref: ref,
|
|
20041
|
+
size: size,
|
|
20042
|
+
variant: variant,
|
|
20043
|
+
hasLeadingVisual: !isNullable(LeadingVisual),
|
|
20044
|
+
hasRemoveButton: !isNullable(onRemove),
|
|
20045
|
+
...props,
|
|
20046
|
+
children: [typeof LeadingVisual !== 'string' && reactIsExports.isValidElementType(LeadingVisual) ? /*#__PURE__*/jsxRuntimeExports.jsx(LeadingVisual, {}) : LeadingVisual, text, onRemove ? /*#__PURE__*/jsxRuntimeExports.jsx(UnstyledButton, {
|
|
20047
|
+
type: 'button',
|
|
20048
|
+
onClick: onRemove,
|
|
20049
|
+
"aria-label": 'Remove Pill',
|
|
20050
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(SvgClose, {})
|
|
20051
|
+
}) : null]
|
|
20052
|
+
});
|
|
20053
|
+
const BasePill = styled__default.default.span`
|
|
20054
|
+
display: inline-flex;
|
|
20055
|
+
align-items: center;
|
|
20056
|
+
border-radius: ${({
|
|
20057
|
+
theme
|
|
20058
|
+
}) => forcePixelValue(theme.radii.xxs)};
|
|
20059
|
+
|
|
20060
|
+
& > button {
|
|
20061
|
+
display: flex;
|
|
20062
|
+
transition: background-color 100ms;
|
|
20063
|
+
border-radius: ${({
|
|
20064
|
+
theme
|
|
20065
|
+
}) => forcePixelValue(theme.radii.full)};
|
|
20066
|
+
}
|
|
20067
|
+
|
|
20068
|
+
${({
|
|
20069
|
+
theme,
|
|
20070
|
+
hasLeadingVisual,
|
|
20071
|
+
hasRemoveButton
|
|
20072
|
+
}) => variant({
|
|
20073
|
+
prop: 'size',
|
|
20074
|
+
variants: {
|
|
20075
|
+
l: {
|
|
20076
|
+
'pl': hasLeadingVisual || hasRemoveButton ? 2 : 3,
|
|
20077
|
+
'pr': hasRemoveButton ? 0.5 : hasLeadingVisual ? 2 : 3,
|
|
20078
|
+
'py': 1,
|
|
20079
|
+
'fontSize': theme.fontSizes.s,
|
|
20080
|
+
'fontWeight': theme.fontWeights.medium,
|
|
20081
|
+
'lineHeight': theme.lineHeights[2],
|
|
20082
|
+
'columnGap': 1,
|
|
20083
|
+
'& svg': {
|
|
20084
|
+
width: 16,
|
|
20085
|
+
height: 16,
|
|
20086
|
+
color: theme.colors['icon/primary']
|
|
20087
|
+
},
|
|
20088
|
+
'& button': {
|
|
20089
|
+
p: 1
|
|
20090
|
+
}
|
|
20091
|
+
},
|
|
20092
|
+
m: {
|
|
20093
|
+
'pl': hasLeadingVisual || hasRemoveButton ? 2 : 3,
|
|
20094
|
+
'pr': hasRemoveButton ? 1 : hasLeadingVisual ? 2 : 3,
|
|
20095
|
+
'py': 1,
|
|
20096
|
+
'fontSize': theme.fontSizes.xs,
|
|
20097
|
+
'fontWeight': theme.fontWeights.medium,
|
|
20098
|
+
'lineHeight': theme.lineHeights[2],
|
|
20099
|
+
'columnGap': 0.5,
|
|
20100
|
+
'& svg': {
|
|
20101
|
+
width: 16,
|
|
20102
|
+
height: 16,
|
|
20103
|
+
color: theme.colors['icon/primary']
|
|
20104
|
+
},
|
|
20105
|
+
'& button': {
|
|
20106
|
+
p: 0.5
|
|
20107
|
+
}
|
|
20108
|
+
},
|
|
20109
|
+
s: {
|
|
20110
|
+
'pl': 2,
|
|
20111
|
+
'pr': hasRemoveButton ? 1 : 2,
|
|
20112
|
+
'py': 0.5,
|
|
20113
|
+
'fontSize': theme.fontSizes.xxs,
|
|
20114
|
+
'fontWeight': theme.fontWeights.medium,
|
|
20115
|
+
'lineHeight': theme.lineHeights[2],
|
|
20116
|
+
'columnGap': 0.5,
|
|
20117
|
+
'& svg': {
|
|
20118
|
+
width: 12,
|
|
20119
|
+
height: 12,
|
|
20120
|
+
color: theme.colors['icon/primary']
|
|
20121
|
+
},
|
|
20122
|
+
'& button': {
|
|
20123
|
+
p: 0.5
|
|
20124
|
+
}
|
|
20125
|
+
}
|
|
20126
|
+
}
|
|
20127
|
+
})}
|
|
20128
|
+
${({
|
|
20129
|
+
theme
|
|
20130
|
+
}) => variant({
|
|
20131
|
+
prop: 'variant',
|
|
20132
|
+
variants: {
|
|
20133
|
+
secondary: {
|
|
20134
|
+
'color': theme.colors['text/primary'],
|
|
20135
|
+
'backgroundColor': theme.colors['bg/secondary'],
|
|
20136
|
+
'& button': {
|
|
20137
|
+
'&:hover': {
|
|
20138
|
+
backgroundColor: theme.colors['bg/secondary/hovered']
|
|
20139
|
+
}
|
|
20140
|
+
}
|
|
20141
|
+
}
|
|
20142
|
+
}
|
|
20143
|
+
})}
|
|
20144
|
+
${sx}
|
|
20145
|
+
`;
|
|
20146
|
+
var index$2 = /*#__PURE__*/React.forwardRef(Pill);
|
|
20147
|
+
|
|
20148
|
+
const Space = styled__default.default.div`
|
|
20149
|
+
width: inherit;
|
|
20150
|
+
${space$1};
|
|
20151
|
+
${sx}
|
|
20152
|
+
`;
|
|
20153
|
+
|
|
20154
|
+
const Stack = /*#__PURE__*/React.forwardRef(({
|
|
20155
|
+
gapX = 0,
|
|
20156
|
+
gapY = 0,
|
|
20157
|
+
children,
|
|
20158
|
+
alignItems = 'center',
|
|
20159
|
+
...props
|
|
20160
|
+
}, ref) => /*#__PURE__*/jsxRuntimeExports.jsx(BaseStack, {
|
|
20161
|
+
ref: ref,
|
|
20162
|
+
alignItems: alignItems,
|
|
20163
|
+
gapX: gapX,
|
|
20164
|
+
gapY: gapY,
|
|
20165
|
+
...props,
|
|
20166
|
+
children: children
|
|
20167
|
+
}));
|
|
20168
|
+
const BaseStack = styled__default.default(View)({
|
|
20169
|
+
display: 'flex',
|
|
20170
|
+
flexDirection: 'row',
|
|
20171
|
+
flexWrap: 'wrap'
|
|
20172
|
+
}, variant({
|
|
20173
|
+
prop: 'gapX',
|
|
20174
|
+
variants: Object.fromEntries(Object.entries(space).map(([key, value]) => {
|
|
20175
|
+
const styleValue = {
|
|
20176
|
+
'& > *': {
|
|
20177
|
+
px: forcePixelValue(value / 2)
|
|
20178
|
+
},
|
|
20179
|
+
'mx': forcePixelValue(-value / 2)
|
|
20180
|
+
};
|
|
20181
|
+
return [key, styleValue];
|
|
20182
|
+
}))
|
|
20183
|
+
}), variant({
|
|
20184
|
+
prop: 'gapY',
|
|
20185
|
+
variants: Object.fromEntries(Object.entries(space).map(([key, value]) => {
|
|
20186
|
+
const styleValue = {
|
|
20187
|
+
'& > *': {
|
|
20188
|
+
mt: forcePixelValue(value)
|
|
20189
|
+
},
|
|
20190
|
+
'mt': forcePixelValue(-value)
|
|
20191
|
+
};
|
|
20192
|
+
return [key, styleValue];
|
|
20193
|
+
}))
|
|
20194
|
+
}));
|
|
20195
|
+
const Item = ({
|
|
20196
|
+
children,
|
|
20197
|
+
...props
|
|
20198
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsx(View, {
|
|
20199
|
+
...props,
|
|
20200
|
+
children: children
|
|
20201
|
+
});
|
|
20202
|
+
var Stack$1 = Object.assign(Stack, {
|
|
20203
|
+
Item
|
|
20204
|
+
});
|
|
20205
|
+
|
|
20206
|
+
const StyledIcon = ({
|
|
20207
|
+
icon: Icon,
|
|
20208
|
+
sx,
|
|
17093
20209
|
...props
|
|
17094
|
-
}) => /*#__PURE__*/jsxRuntimeExports.jsx(View, {
|
|
17095
|
-
...props,
|
|
17096
|
-
children: children
|
|
17097
|
-
});
|
|
17098
|
-
var Stack$1 = Object.assign(Stack, {
|
|
17099
|
-
Item
|
|
17100
|
-
});
|
|
17101
|
-
|
|
17102
|
-
const StyledIcon = ({
|
|
17103
|
-
icon: Icon,
|
|
17104
|
-
sx,
|
|
17105
|
-
...props
|
|
17106
20210
|
}) => /*#__PURE__*/jsxRuntimeExports.jsx(View, {
|
|
17107
20211
|
...props,
|
|
17108
20212
|
color: props.color,
|
|
@@ -18284,21 +21388,13 @@ const Tab = ({
|
|
|
18284
21388
|
})
|
|
18285
21389
|
})]
|
|
18286
21390
|
}) : null]
|
|
18287
|
-
})]
|
|
18288
|
-
})
|
|
18289
|
-
});
|
|
18290
|
-
};
|
|
18291
|
-
var index$1 = Object.assign(Tab, {
|
|
18292
|
-
Item: TabItem
|
|
18293
|
-
});
|
|
18294
|
-
|
|
18295
|
-
/**
|
|
18296
|
-
* 제공된 `ref`가 없는 경우 새로운 `ref`를 만들어 사용하고, 있는 경우 제공된 ref를 사용할 수 있는 훅입니다.
|
|
18297
|
-
*/
|
|
18298
|
-
const useProvidedOrCreatedRef = providedRef => {
|
|
18299
|
-
const createdRef = React.useRef(null);
|
|
18300
|
-
return providedRef ?? createdRef;
|
|
21391
|
+
})]
|
|
21392
|
+
})
|
|
21393
|
+
});
|
|
18301
21394
|
};
|
|
21395
|
+
var index$1 = Object.assign(Tab, {
|
|
21396
|
+
Item: TabItem
|
|
21397
|
+
});
|
|
18302
21398
|
|
|
18303
21399
|
const Textarea = /*#__PURE__*/React.forwardRef(({
|
|
18304
21400
|
disabled,
|
|
@@ -18362,434 +21458,93 @@ const TextareaWrapper = styled__default.default.div`
|
|
|
18362
21458
|
theme
|
|
18363
21459
|
}) => theme.lineHeights[2]};
|
|
18364
21460
|
color: ${({
|
|
18365
|
-
theme
|
|
18366
|
-
}) => theme.colors['text/neutral']};
|
|
18367
|
-
input::placeholder {
|
|
18368
|
-
color: ${({
|
|
18369
|
-
theme
|
|
18370
|
-
}) => theme.colors['text/neutral/subtlest']};
|
|
18371
|
-
}
|
|
18372
|
-
|
|
18373
|
-
height: 74px;
|
|
18374
|
-
|
|
18375
|
-
&:after {
|
|
18376
|
-
content: '';
|
|
18377
|
-
position: absolute;
|
|
18378
|
-
top: ${forcePixelValue(-1)};
|
|
18379
|
-
right: ${forcePixelValue(-1)};
|
|
18380
|
-
bottom: ${forcePixelValue(-1)};
|
|
18381
|
-
left: ${forcePixelValue(-1)};
|
|
18382
|
-
|
|
18383
|
-
border: ${forcePixelValue(2)} solid transparent;
|
|
18384
|
-
border-radius: ${({
|
|
18385
|
-
theme
|
|
18386
|
-
}) => forcePixelValue(theme.radii.s)};
|
|
18387
|
-
pointer-events: none;
|
|
18388
|
-
}
|
|
18389
|
-
|
|
18390
|
-
${props => props.validationStatus !== 'error' && !props.disabled && styled.css`
|
|
18391
|
-
&:hover:not(:focus-within) {
|
|
18392
|
-
&:after {
|
|
18393
|
-
border-color: ${({
|
|
18394
|
-
theme
|
|
18395
|
-
}) => theme.colors['border/hovered']};
|
|
18396
|
-
}
|
|
18397
|
-
}
|
|
18398
|
-
`}
|
|
18399
|
-
|
|
18400
|
-
${props => props.validationStatus === 'error' && styled.css`
|
|
18401
|
-
&:after {
|
|
18402
|
-
border-color: ${({
|
|
18403
|
-
theme
|
|
18404
|
-
}) => theme.colors['border/danger']};
|
|
18405
|
-
}
|
|
18406
|
-
`}
|
|
18407
|
-
|
|
18408
|
-
${props => props.validationStatus !== 'error' && styled.css`
|
|
18409
|
-
&:focus-within {
|
|
18410
|
-
&:after {
|
|
18411
|
-
border-color: ${({
|
|
18412
|
-
theme
|
|
18413
|
-
}) => theme.colors['border/focused']};
|
|
18414
|
-
}
|
|
18415
|
-
}
|
|
18416
|
-
`}
|
|
18417
|
-
|
|
18418
|
-
${props => props.disabled && styled.css`
|
|
18419
|
-
border-color: ${props.theme.colors['border/input']};
|
|
18420
|
-
background-color: ${props.theme.colors['bg/disabled']};
|
|
18421
|
-
color: ${props.theme.colors['text/disabled']};
|
|
18422
|
-
|
|
18423
|
-
textarea::placeholder {
|
|
18424
|
-
color: ${props.theme.colors['text/disabled']};
|
|
18425
|
-
}
|
|
18426
|
-
|
|
18427
|
-
&,
|
|
18428
|
-
textarea {
|
|
18429
|
-
cursor: not-allowed;
|
|
18430
|
-
}
|
|
18431
|
-
`};
|
|
18432
|
-
`;
|
|
18433
|
-
const UnstyledTextarea = styled__default.default.textarea`
|
|
18434
|
-
font-size: inherit;
|
|
18435
|
-
font-weight: inherit;
|
|
18436
|
-
line-height: inherit;
|
|
18437
|
-
font-family: inherit;
|
|
18438
|
-
border-radius: inherit;
|
|
18439
|
-
color: inherit;
|
|
18440
|
-
transition: inherit;
|
|
18441
|
-
|
|
18442
|
-
border: 0;
|
|
18443
|
-
background-color: transparent;
|
|
18444
|
-
width: 100%;
|
|
18445
|
-
&:focus {
|
|
18446
|
-
outline: 0;
|
|
18447
|
-
}
|
|
18448
|
-
`;
|
|
18449
|
-
const BaseTextarea = styled__default.default(UnstyledTextarea)`
|
|
18450
|
-
resize: none;
|
|
18451
|
-
`;
|
|
18452
|
-
|
|
18453
|
-
var reactIs = {exports: {}};
|
|
18454
|
-
|
|
18455
|
-
var reactIs_production_min = {};
|
|
18456
|
-
|
|
18457
|
-
/**
|
|
18458
|
-
* @license React
|
|
18459
|
-
* react-is.production.min.js
|
|
18460
|
-
*
|
|
18461
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
18462
|
-
*
|
|
18463
|
-
* This source code is licensed under the MIT license found in the
|
|
18464
|
-
* LICENSE file in the root directory of this source tree.
|
|
18465
|
-
*/
|
|
18466
|
-
var hasRequiredReactIs_production_min;
|
|
18467
|
-
function requireReactIs_production_min() {
|
|
18468
|
-
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
18469
|
-
hasRequiredReactIs_production_min = 1;
|
|
18470
|
-
var b = Symbol.for("react.element"),
|
|
18471
|
-
c = Symbol.for("react.portal"),
|
|
18472
|
-
d = Symbol.for("react.fragment"),
|
|
18473
|
-
e = Symbol.for("react.strict_mode"),
|
|
18474
|
-
f = Symbol.for("react.profiler"),
|
|
18475
|
-
g = Symbol.for("react.provider"),
|
|
18476
|
-
h = Symbol.for("react.context"),
|
|
18477
|
-
k = Symbol.for("react.server_context"),
|
|
18478
|
-
l = Symbol.for("react.forward_ref"),
|
|
18479
|
-
m = Symbol.for("react.suspense"),
|
|
18480
|
-
n = Symbol.for("react.suspense_list"),
|
|
18481
|
-
p = Symbol.for("react.memo"),
|
|
18482
|
-
q = Symbol.for("react.lazy"),
|
|
18483
|
-
t = Symbol.for("react.offscreen"),
|
|
18484
|
-
u;
|
|
18485
|
-
u = Symbol.for("react.module.reference");
|
|
18486
|
-
function v(a) {
|
|
18487
|
-
if ("object" === typeof a && null !== a) {
|
|
18488
|
-
var r = a.$$typeof;
|
|
18489
|
-
switch (r) {
|
|
18490
|
-
case b:
|
|
18491
|
-
switch (a = a.type, a) {
|
|
18492
|
-
case d:
|
|
18493
|
-
case f:
|
|
18494
|
-
case e:
|
|
18495
|
-
case m:
|
|
18496
|
-
case n:
|
|
18497
|
-
return a;
|
|
18498
|
-
default:
|
|
18499
|
-
switch (a = a && a.$$typeof, a) {
|
|
18500
|
-
case k:
|
|
18501
|
-
case h:
|
|
18502
|
-
case l:
|
|
18503
|
-
case q:
|
|
18504
|
-
case p:
|
|
18505
|
-
case g:
|
|
18506
|
-
return a;
|
|
18507
|
-
default:
|
|
18508
|
-
return r;
|
|
18509
|
-
}
|
|
18510
|
-
}
|
|
18511
|
-
case c:
|
|
18512
|
-
return r;
|
|
18513
|
-
}
|
|
18514
|
-
}
|
|
18515
|
-
}
|
|
18516
|
-
reactIs_production_min.ContextConsumer = h;
|
|
18517
|
-
reactIs_production_min.ContextProvider = g;
|
|
18518
|
-
reactIs_production_min.Element = b;
|
|
18519
|
-
reactIs_production_min.ForwardRef = l;
|
|
18520
|
-
reactIs_production_min.Fragment = d;
|
|
18521
|
-
reactIs_production_min.Lazy = q;
|
|
18522
|
-
reactIs_production_min.Memo = p;
|
|
18523
|
-
reactIs_production_min.Portal = c;
|
|
18524
|
-
reactIs_production_min.Profiler = f;
|
|
18525
|
-
reactIs_production_min.StrictMode = e;
|
|
18526
|
-
reactIs_production_min.Suspense = m;
|
|
18527
|
-
reactIs_production_min.SuspenseList = n;
|
|
18528
|
-
reactIs_production_min.isAsyncMode = function () {
|
|
18529
|
-
return !1;
|
|
18530
|
-
};
|
|
18531
|
-
reactIs_production_min.isConcurrentMode = function () {
|
|
18532
|
-
return !1;
|
|
18533
|
-
};
|
|
18534
|
-
reactIs_production_min.isContextConsumer = function (a) {
|
|
18535
|
-
return v(a) === h;
|
|
18536
|
-
};
|
|
18537
|
-
reactIs_production_min.isContextProvider = function (a) {
|
|
18538
|
-
return v(a) === g;
|
|
18539
|
-
};
|
|
18540
|
-
reactIs_production_min.isElement = function (a) {
|
|
18541
|
-
return "object" === typeof a && null !== a && a.$$typeof === b;
|
|
18542
|
-
};
|
|
18543
|
-
reactIs_production_min.isForwardRef = function (a) {
|
|
18544
|
-
return v(a) === l;
|
|
18545
|
-
};
|
|
18546
|
-
reactIs_production_min.isFragment = function (a) {
|
|
18547
|
-
return v(a) === d;
|
|
18548
|
-
};
|
|
18549
|
-
reactIs_production_min.isLazy = function (a) {
|
|
18550
|
-
return v(a) === q;
|
|
18551
|
-
};
|
|
18552
|
-
reactIs_production_min.isMemo = function (a) {
|
|
18553
|
-
return v(a) === p;
|
|
18554
|
-
};
|
|
18555
|
-
reactIs_production_min.isPortal = function (a) {
|
|
18556
|
-
return v(a) === c;
|
|
18557
|
-
};
|
|
18558
|
-
reactIs_production_min.isProfiler = function (a) {
|
|
18559
|
-
return v(a) === f;
|
|
18560
|
-
};
|
|
18561
|
-
reactIs_production_min.isStrictMode = function (a) {
|
|
18562
|
-
return v(a) === e;
|
|
18563
|
-
};
|
|
18564
|
-
reactIs_production_min.isSuspense = function (a) {
|
|
18565
|
-
return v(a) === m;
|
|
18566
|
-
};
|
|
18567
|
-
reactIs_production_min.isSuspenseList = function (a) {
|
|
18568
|
-
return v(a) === n;
|
|
18569
|
-
};
|
|
18570
|
-
reactIs_production_min.isValidElementType = function (a) {
|
|
18571
|
-
return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? !0 : !1;
|
|
18572
|
-
};
|
|
18573
|
-
reactIs_production_min.typeOf = v;
|
|
18574
|
-
return reactIs_production_min;
|
|
18575
|
-
}
|
|
18576
|
-
|
|
18577
|
-
var reactIs_development = {};
|
|
18578
|
-
|
|
18579
|
-
/**
|
|
18580
|
-
* @license React
|
|
18581
|
-
* react-is.development.js
|
|
18582
|
-
*
|
|
18583
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
18584
|
-
*
|
|
18585
|
-
* This source code is licensed under the MIT license found in the
|
|
18586
|
-
* LICENSE file in the root directory of this source tree.
|
|
18587
|
-
*/
|
|
18588
|
-
var hasRequiredReactIs_development;
|
|
18589
|
-
function requireReactIs_development() {
|
|
18590
|
-
if (hasRequiredReactIs_development) return reactIs_development;
|
|
18591
|
-
hasRequiredReactIs_development = 1;
|
|
18592
|
-
if (process.env.NODE_ENV !== "production") {
|
|
18593
|
-
(function () {
|
|
18594
|
-
|
|
18595
|
-
// ATTENTION
|
|
18596
|
-
// When adding new symbols to this file,
|
|
18597
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
18598
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
18599
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
18600
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
18601
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
18602
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
18603
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
18604
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
18605
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
18606
|
-
var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
|
|
18607
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
18608
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
18609
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
18610
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
18611
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
18612
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
18613
|
-
|
|
18614
|
-
// -----------------------------------------------------------------------------
|
|
21461
|
+
theme
|
|
21462
|
+
}) => theme.colors['text/neutral']};
|
|
21463
|
+
input::placeholder {
|
|
21464
|
+
color: ${({
|
|
21465
|
+
theme
|
|
21466
|
+
}) => theme.colors['text/neutral/subtlest']};
|
|
21467
|
+
}
|
|
18615
21468
|
|
|
18616
|
-
|
|
18617
|
-
var enableCacheElement = false;
|
|
18618
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
21469
|
+
height: 74px;
|
|
18619
21470
|
|
|
18620
|
-
|
|
18621
|
-
|
|
18622
|
-
|
|
21471
|
+
&:after {
|
|
21472
|
+
content: '';
|
|
21473
|
+
position: absolute;
|
|
21474
|
+
top: ${forcePixelValue(-1)};
|
|
21475
|
+
right: ${forcePixelValue(-1)};
|
|
21476
|
+
bottom: ${forcePixelValue(-1)};
|
|
21477
|
+
left: ${forcePixelValue(-1)};
|
|
18623
21478
|
|
|
18624
|
-
|
|
21479
|
+
border: ${forcePixelValue(2)} solid transparent;
|
|
21480
|
+
border-radius: ${({
|
|
21481
|
+
theme
|
|
21482
|
+
}) => forcePixelValue(theme.radii.s)};
|
|
21483
|
+
pointer-events: none;
|
|
21484
|
+
}
|
|
18625
21485
|
|
|
18626
|
-
|
|
18627
|
-
{
|
|
18628
|
-
|
|
21486
|
+
${props => props.validationStatus !== 'error' && !props.disabled && styled.css`
|
|
21487
|
+
&:hover:not(:focus-within) {
|
|
21488
|
+
&:after {
|
|
21489
|
+
border-color: ${({
|
|
21490
|
+
theme
|
|
21491
|
+
}) => theme.colors['border/hovered']};
|
|
21492
|
+
}
|
|
18629
21493
|
}
|
|
18630
|
-
|
|
18631
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
18632
|
-
return true;
|
|
18633
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
21494
|
+
`}
|
|
18634
21495
|
|
|
18635
|
-
|
|
18636
|
-
|
|
18637
|
-
|
|
18638
|
-
|
|
18639
|
-
|
|
18640
|
-
// This needs to include all possible module reference object
|
|
18641
|
-
// types supported by any Flight configuration anywhere since
|
|
18642
|
-
// we don't know which Flight build this will end up being used
|
|
18643
|
-
// with.
|
|
18644
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
18645
|
-
return true;
|
|
18646
|
-
}
|
|
18647
|
-
}
|
|
18648
|
-
return false;
|
|
21496
|
+
${props => props.validationStatus === 'error' && styled.css`
|
|
21497
|
+
&:after {
|
|
21498
|
+
border-color: ${({
|
|
21499
|
+
theme
|
|
21500
|
+
}) => theme.colors['border/danger']};
|
|
18649
21501
|
}
|
|
18650
|
-
|
|
18651
|
-
|
|
18652
|
-
|
|
18653
|
-
|
|
18654
|
-
|
|
18655
|
-
|
|
18656
|
-
|
|
18657
|
-
|
|
18658
|
-
case REACT_PROFILER_TYPE:
|
|
18659
|
-
case REACT_STRICT_MODE_TYPE:
|
|
18660
|
-
case REACT_SUSPENSE_TYPE:
|
|
18661
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
18662
|
-
return type;
|
|
18663
|
-
default:
|
|
18664
|
-
var $$typeofType = type && type.$$typeof;
|
|
18665
|
-
switch ($$typeofType) {
|
|
18666
|
-
case REACT_SERVER_CONTEXT_TYPE:
|
|
18667
|
-
case REACT_CONTEXT_TYPE:
|
|
18668
|
-
case REACT_FORWARD_REF_TYPE:
|
|
18669
|
-
case REACT_LAZY_TYPE:
|
|
18670
|
-
case REACT_MEMO_TYPE:
|
|
18671
|
-
case REACT_PROVIDER_TYPE:
|
|
18672
|
-
return $$typeofType;
|
|
18673
|
-
default:
|
|
18674
|
-
return $$typeof;
|
|
18675
|
-
}
|
|
18676
|
-
}
|
|
18677
|
-
case REACT_PORTAL_TYPE:
|
|
18678
|
-
return $$typeof;
|
|
18679
|
-
}
|
|
21502
|
+
`}
|
|
21503
|
+
|
|
21504
|
+
${props => props.validationStatus !== 'error' && styled.css`
|
|
21505
|
+
&:focus-within {
|
|
21506
|
+
&:after {
|
|
21507
|
+
border-color: ${({
|
|
21508
|
+
theme
|
|
21509
|
+
}) => theme.colors['border/focused']};
|
|
18680
21510
|
}
|
|
18681
|
-
return undefined;
|
|
18682
21511
|
}
|
|
18683
|
-
|
|
18684
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
18685
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
18686
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
18687
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
18688
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
18689
|
-
var Memo = REACT_MEMO_TYPE;
|
|
18690
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
18691
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
18692
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
18693
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
18694
|
-
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
18695
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
18696
|
-
var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
|
|
21512
|
+
`}
|
|
18697
21513
|
|
|
18698
|
-
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
|
|
21514
|
+
${props => props.disabled && styled.css`
|
|
21515
|
+
border-color: ${props.theme.colors['border/input']};
|
|
21516
|
+
background-color: ${props.theme.colors['bg/disabled']};
|
|
21517
|
+
color: ${props.theme.colors['text/disabled']};
|
|
18702
21518
|
|
|
18703
|
-
|
|
18704
|
-
|
|
18705
|
-
}
|
|
18706
|
-
return false;
|
|
21519
|
+
textarea::placeholder {
|
|
21520
|
+
color: ${props.theme.colors['text/disabled']};
|
|
18707
21521
|
}
|
|
18708
|
-
function isConcurrentMode(object) {
|
|
18709
|
-
{
|
|
18710
|
-
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
18711
|
-
hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
18712
21522
|
|
|
18713
|
-
|
|
18714
|
-
|
|
18715
|
-
|
|
18716
|
-
return false;
|
|
18717
|
-
}
|
|
18718
|
-
function isContextConsumer(object) {
|
|
18719
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
18720
|
-
}
|
|
18721
|
-
function isContextProvider(object) {
|
|
18722
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
18723
|
-
}
|
|
18724
|
-
function isElement(object) {
|
|
18725
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
18726
|
-
}
|
|
18727
|
-
function isForwardRef(object) {
|
|
18728
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
18729
|
-
}
|
|
18730
|
-
function isFragment(object) {
|
|
18731
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
18732
|
-
}
|
|
18733
|
-
function isLazy(object) {
|
|
18734
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
18735
|
-
}
|
|
18736
|
-
function isMemo(object) {
|
|
18737
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
18738
|
-
}
|
|
18739
|
-
function isPortal(object) {
|
|
18740
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
18741
|
-
}
|
|
18742
|
-
function isProfiler(object) {
|
|
18743
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
18744
|
-
}
|
|
18745
|
-
function isStrictMode(object) {
|
|
18746
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
18747
|
-
}
|
|
18748
|
-
function isSuspense(object) {
|
|
18749
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
18750
|
-
}
|
|
18751
|
-
function isSuspenseList(object) {
|
|
18752
|
-
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
21523
|
+
&,
|
|
21524
|
+
textarea {
|
|
21525
|
+
cursor: not-allowed;
|
|
18753
21526
|
}
|
|
18754
|
-
|
|
18755
|
-
|
|
18756
|
-
|
|
18757
|
-
|
|
18758
|
-
|
|
18759
|
-
|
|
18760
|
-
|
|
18761
|
-
|
|
18762
|
-
|
|
18763
|
-
|
|
18764
|
-
reactIs_development.Suspense = Suspense;
|
|
18765
|
-
reactIs_development.SuspenseList = SuspenseList;
|
|
18766
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
18767
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
18768
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
18769
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
18770
|
-
reactIs_development.isElement = isElement;
|
|
18771
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
18772
|
-
reactIs_development.isFragment = isFragment;
|
|
18773
|
-
reactIs_development.isLazy = isLazy;
|
|
18774
|
-
reactIs_development.isMemo = isMemo;
|
|
18775
|
-
reactIs_development.isPortal = isPortal;
|
|
18776
|
-
reactIs_development.isProfiler = isProfiler;
|
|
18777
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
18778
|
-
reactIs_development.isSuspense = isSuspense;
|
|
18779
|
-
reactIs_development.isSuspenseList = isSuspenseList;
|
|
18780
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
18781
|
-
reactIs_development.typeOf = typeOf;
|
|
18782
|
-
})();
|
|
18783
|
-
}
|
|
18784
|
-
return reactIs_development;
|
|
18785
|
-
}
|
|
21527
|
+
`};
|
|
21528
|
+
`;
|
|
21529
|
+
const UnstyledTextarea = styled__default.default.textarea`
|
|
21530
|
+
font-size: inherit;
|
|
21531
|
+
font-weight: inherit;
|
|
21532
|
+
line-height: inherit;
|
|
21533
|
+
font-family: inherit;
|
|
21534
|
+
border-radius: inherit;
|
|
21535
|
+
color: inherit;
|
|
21536
|
+
transition: inherit;
|
|
18786
21537
|
|
|
18787
|
-
|
|
18788
|
-
|
|
18789
|
-
|
|
18790
|
-
|
|
18791
|
-
|
|
18792
|
-
|
|
21538
|
+
border: 0;
|
|
21539
|
+
background-color: transparent;
|
|
21540
|
+
width: 100%;
|
|
21541
|
+
&:focus {
|
|
21542
|
+
outline: 0;
|
|
21543
|
+
}
|
|
21544
|
+
`;
|
|
21545
|
+
const BaseTextarea = styled__default.default(UnstyledTextarea)`
|
|
21546
|
+
resize: none;
|
|
21547
|
+
`;
|
|
18793
21548
|
|
|
18794
21549
|
const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
18795
21550
|
type = 'text',
|
|
@@ -19427,32 +22182,11 @@ const useOutsideClick = ({
|
|
|
19427
22182
|
});
|
|
19428
22183
|
};
|
|
19429
22184
|
|
|
19430
|
-
const useToggleHandler = ({
|
|
19431
|
-
initialState = false
|
|
19432
|
-
}) => {
|
|
19433
|
-
const [state, setState] = React.useState(initialState);
|
|
19434
|
-
const on = () => {
|
|
19435
|
-
setState(true);
|
|
19436
|
-
};
|
|
19437
|
-
const off = () => {
|
|
19438
|
-
setState(false);
|
|
19439
|
-
};
|
|
19440
|
-
const toggle = React.useCallback(() => {
|
|
19441
|
-
setState(prev => !prev);
|
|
19442
|
-
}, []);
|
|
19443
|
-
return {
|
|
19444
|
-
state,
|
|
19445
|
-
on,
|
|
19446
|
-
off,
|
|
19447
|
-
toggle
|
|
19448
|
-
};
|
|
19449
|
-
};
|
|
19450
|
-
|
|
19451
22185
|
exports.AnimatePresence = AnimatePresence;
|
|
19452
|
-
exports.Breadcrumbs = index$
|
|
22186
|
+
exports.Breadcrumbs = index$6;
|
|
19453
22187
|
exports.Button = Button;
|
|
19454
22188
|
exports.Chip = Chip;
|
|
19455
|
-
exports.Dialog = index$
|
|
22189
|
+
exports.Dialog = index$5;
|
|
19456
22190
|
exports.DialogHandler = DialogHandler;
|
|
19457
22191
|
exports.EnigmaUI = index;
|
|
19458
22192
|
exports.GradientText = GradientText;
|
|
@@ -19463,6 +22197,10 @@ exports.IconToggleButton = IconToggleButton;
|
|
|
19463
22197
|
exports.Image = Image;
|
|
19464
22198
|
exports.ItemList = ItemList;
|
|
19465
22199
|
exports.MotionView = MotionView;
|
|
22200
|
+
exports.Overlay = Overlay$1;
|
|
22201
|
+
exports.OverlayPopper = OverlayPopper;
|
|
22202
|
+
exports.Pagination = index$3;
|
|
22203
|
+
exports.Pill = index$2;
|
|
19466
22204
|
exports.Space = Space;
|
|
19467
22205
|
exports.Spinner = Spinner;
|
|
19468
22206
|
exports.Stack = Stack$1;
|
|
@@ -19481,6 +22219,10 @@ exports.sx = sx;
|
|
|
19481
22219
|
exports.textDecoration = textDecoration;
|
|
19482
22220
|
exports.theme = theme;
|
|
19483
22221
|
exports.useDevice = useDevice;
|
|
22222
|
+
exports.useDialogHandler = useDialogHandler;
|
|
22223
|
+
exports.useFocusTrap = useFocusTrap;
|
|
22224
|
+
exports.useFocusZone = useFocusZone;
|
|
22225
|
+
exports.useMediaQuery = useMediaQuery;
|
|
19484
22226
|
exports.useOutsideClick = useOutsideClick;
|
|
19485
22227
|
exports.useProvidedOrCreatedRef = useProvidedOrCreatedRef;
|
|
19486
22228
|
exports.useResize = useResize;
|