@indico-data/design-system 2.19.0 → 2.21.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.
Files changed (40) hide show
  1. package/lib/index.css +58 -3
  2. package/lib/index.d.ts +18 -1
  3. package/lib/index.esm.css +58 -3
  4. package/lib/index.esm.js +1567 -8
  5. package/lib/index.esm.js.map +1 -1
  6. package/lib/index.js +1567 -6
  7. package/lib/index.js.map +1 -1
  8. package/lib/src/components/index.d.ts +2 -0
  9. package/lib/src/components/menu/Menu.d.ts +5 -0
  10. package/lib/src/components/menu/Menu.stories.d.ts +6 -0
  11. package/lib/src/components/menu/Menu.test.d.ts +1 -0
  12. package/lib/src/components/menu/index.d.ts +1 -0
  13. package/lib/src/components/popper/Popper.d.ts +12 -0
  14. package/lib/src/components/popper/Popper.stories.d.ts +6 -0
  15. package/lib/src/components/popper/Popper.test.d.ts +1 -0
  16. package/lib/src/components/popper/index.d.ts +1 -0
  17. package/lib/src/hooks/useClickOutside.d.ts +2 -0
  18. package/lib/src/index.d.ts +2 -0
  19. package/package.json +2 -1
  20. package/src/components/index.ts +2 -0
  21. package/src/components/menu/Menu.mdx +15 -0
  22. package/src/components/menu/Menu.stories.tsx +56 -0
  23. package/src/components/menu/Menu.test.tsx +88 -0
  24. package/src/components/menu/Menu.tsx +20 -0
  25. package/src/components/menu/index.ts +1 -0
  26. package/src/components/menu/styles/Menu.scss +19 -0
  27. package/src/components/menu/styles/_variables.scss +15 -0
  28. package/src/components/popper/Popper.mdx +79 -0
  29. package/src/components/popper/Popper.stories.tsx +161 -0
  30. package/src/components/popper/Popper.test.tsx +68 -0
  31. package/src/components/popper/Popper.tsx +57 -0
  32. package/src/components/popper/index.ts +1 -0
  33. package/src/components/popper/styles/Popper.scss +11 -0
  34. package/src/components/popper/styles/_variables.scss +15 -0
  35. package/src/hooks/useClickOutside.tsx +22 -0
  36. package/src/index.ts +2 -0
  37. package/src/legacy/components/buttons/commonStyles.ts +0 -4
  38. package/src/styles/_typography.scss +1 -1
  39. package/src/styles/index.scss +2 -0
  40. package/src/styles/variables/_typography.scss +2 -4
package/lib/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import styled, { css as css$1, createGlobalStyle, ThemeProvider, keyframes } from 'styled-components';
3
3
  import * as e from 'react';
4
- import e__default, { cloneElement, forwardRef, useState, useEffect, useRef, useCallback, useContext, useMemo, createContext, useLayoutEffect, useImperativeHandle } from 'react';
4
+ import e__default, { cloneElement, forwardRef, useState, useLayoutEffect, useEffect, useRef, useCallback, useContext, useMemo, createContext, useImperativeHandle } from 'react';
5
5
  import ReactSelect, { components } from 'react-select';
6
6
  import { Link } from 'react-router-dom';
7
7
  import * as ReactDOM from 'react-dom';
@@ -104,7 +104,7 @@ const round10 = (value, exp) => {
104
104
  return decimalAdjust('round', value, exp);
105
105
  };
106
106
 
107
- const clamp$1 = (value, min, max) => {
107
+ const clamp$2 = (value, min, max) => {
108
108
  value = value < min ? min : value;
109
109
  value = value > max ? max : value;
110
110
  return value;
@@ -117,7 +117,7 @@ const numberWithCommas$1 = (x) => {
117
117
  const MATH = {
118
118
  decimalAdjust,
119
119
  round10,
120
- clamp: clamp$1,
120
+ clamp: clamp$2,
121
121
  numberWithCommas: numberWithCommas$1,
122
122
  };
123
123
 
@@ -18707,6 +18707,1569 @@ const Card = (_a) => {
18707
18707
  return (jsxs("div", Object.assign({ className: cardClasses }, rest, { children: [(title || subtitle) && (jsxs("div", { className: "card__header", children: [title && jsx("h2", { children: title }), subtitle && jsx("p", { children: subtitle })] })), jsx("div", { className: "card__content", children: children })] })));
18708
18708
  };
18709
18709
 
18710
+ /**
18711
+ * Custom positioning reference element.
18712
+ * @see https://floating-ui.com/docs/virtual-elements
18713
+ */
18714
+
18715
+ const min$3 = Math.min;
18716
+ const max$3 = Math.max;
18717
+ const round$2 = Math.round;
18718
+ const createCoords$1 = v => ({
18719
+ x: v,
18720
+ y: v
18721
+ });
18722
+ const oppositeSideMap$1 = {
18723
+ left: 'right',
18724
+ right: 'left',
18725
+ bottom: 'top',
18726
+ top: 'bottom'
18727
+ };
18728
+ const oppositeAlignmentMap$1 = {
18729
+ start: 'end',
18730
+ end: 'start'
18731
+ };
18732
+ function clamp$1(start, value, end) {
18733
+ return max$3(start, min$3(value, end));
18734
+ }
18735
+ function evaluate$1(value, param) {
18736
+ return typeof value === 'function' ? value(param) : value;
18737
+ }
18738
+ function getSide$1(placement) {
18739
+ return placement.split('-')[0];
18740
+ }
18741
+ function getAlignment$1(placement) {
18742
+ return placement.split('-')[1];
18743
+ }
18744
+ function getOppositeAxis$1(axis) {
18745
+ return axis === 'x' ? 'y' : 'x';
18746
+ }
18747
+ function getAxisLength$1(axis) {
18748
+ return axis === 'y' ? 'height' : 'width';
18749
+ }
18750
+ function getSideAxis$1(placement) {
18751
+ return ['top', 'bottom'].includes(getSide$1(placement)) ? 'y' : 'x';
18752
+ }
18753
+ function getAlignmentAxis$1(placement) {
18754
+ return getOppositeAxis$1(getSideAxis$1(placement));
18755
+ }
18756
+ function getAlignmentSides$1(placement, rects, rtl) {
18757
+ if (rtl === void 0) {
18758
+ rtl = false;
18759
+ }
18760
+ const alignment = getAlignment$1(placement);
18761
+ const alignmentAxis = getAlignmentAxis$1(placement);
18762
+ const length = getAxisLength$1(alignmentAxis);
18763
+ let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
18764
+ if (rects.reference[length] > rects.floating[length]) {
18765
+ mainAlignmentSide = getOppositePlacement$2(mainAlignmentSide);
18766
+ }
18767
+ return [mainAlignmentSide, getOppositePlacement$2(mainAlignmentSide)];
18768
+ }
18769
+ function getExpandedPlacements$1(placement) {
18770
+ const oppositePlacement = getOppositePlacement$2(placement);
18771
+ return [getOppositeAlignmentPlacement$1(placement), oppositePlacement, getOppositeAlignmentPlacement$1(oppositePlacement)];
18772
+ }
18773
+ function getOppositeAlignmentPlacement$1(placement) {
18774
+ return placement.replace(/start|end/g, alignment => oppositeAlignmentMap$1[alignment]);
18775
+ }
18776
+ function getSideList$1(side, isStart, rtl) {
18777
+ const lr = ['left', 'right'];
18778
+ const rl = ['right', 'left'];
18779
+ const tb = ['top', 'bottom'];
18780
+ const bt = ['bottom', 'top'];
18781
+ switch (side) {
18782
+ case 'top':
18783
+ case 'bottom':
18784
+ if (rtl) return isStart ? rl : lr;
18785
+ return isStart ? lr : rl;
18786
+ case 'left':
18787
+ case 'right':
18788
+ return isStart ? tb : bt;
18789
+ default:
18790
+ return [];
18791
+ }
18792
+ }
18793
+ function getOppositeAxisPlacements$1(placement, flipAlignment, direction, rtl) {
18794
+ const alignment = getAlignment$1(placement);
18795
+ let list = getSideList$1(getSide$1(placement), direction === 'start', rtl);
18796
+ if (alignment) {
18797
+ list = list.map(side => side + "-" + alignment);
18798
+ if (flipAlignment) {
18799
+ list = list.concat(list.map(getOppositeAlignmentPlacement$1));
18800
+ }
18801
+ }
18802
+ return list;
18803
+ }
18804
+ function getOppositePlacement$2(placement) {
18805
+ return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap$1[side]);
18806
+ }
18807
+ function expandPaddingObject$1(padding) {
18808
+ return {
18809
+ top: 0,
18810
+ right: 0,
18811
+ bottom: 0,
18812
+ left: 0,
18813
+ ...padding
18814
+ };
18815
+ }
18816
+ function getPaddingObject$1(padding) {
18817
+ return typeof padding !== 'number' ? expandPaddingObject$1(padding) : {
18818
+ top: padding,
18819
+ right: padding,
18820
+ bottom: padding,
18821
+ left: padding
18822
+ };
18823
+ }
18824
+ function rectToClientRect$2(rect) {
18825
+ const {
18826
+ x,
18827
+ y,
18828
+ width,
18829
+ height
18830
+ } = rect;
18831
+ return {
18832
+ width,
18833
+ height,
18834
+ top: y,
18835
+ left: x,
18836
+ right: x + width,
18837
+ bottom: y + height,
18838
+ x,
18839
+ y
18840
+ };
18841
+ }
18842
+
18843
+ function computeCoordsFromPlacement$1(_ref, placement, rtl) {
18844
+ let {
18845
+ reference,
18846
+ floating
18847
+ } = _ref;
18848
+ const sideAxis = getSideAxis$1(placement);
18849
+ const alignmentAxis = getAlignmentAxis$1(placement);
18850
+ const alignLength = getAxisLength$1(alignmentAxis);
18851
+ const side = getSide$1(placement);
18852
+ const isVertical = sideAxis === 'y';
18853
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
18854
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
18855
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
18856
+ let coords;
18857
+ switch (side) {
18858
+ case 'top':
18859
+ coords = {
18860
+ x: commonX,
18861
+ y: reference.y - floating.height
18862
+ };
18863
+ break;
18864
+ case 'bottom':
18865
+ coords = {
18866
+ x: commonX,
18867
+ y: reference.y + reference.height
18868
+ };
18869
+ break;
18870
+ case 'right':
18871
+ coords = {
18872
+ x: reference.x + reference.width,
18873
+ y: commonY
18874
+ };
18875
+ break;
18876
+ case 'left':
18877
+ coords = {
18878
+ x: reference.x - floating.width,
18879
+ y: commonY
18880
+ };
18881
+ break;
18882
+ default:
18883
+ coords = {
18884
+ x: reference.x,
18885
+ y: reference.y
18886
+ };
18887
+ }
18888
+ switch (getAlignment$1(placement)) {
18889
+ case 'start':
18890
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
18891
+ break;
18892
+ case 'end':
18893
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
18894
+ break;
18895
+ }
18896
+ return coords;
18897
+ }
18898
+
18899
+ /**
18900
+ * Computes the `x` and `y` coordinates that will place the floating element
18901
+ * next to a given reference element.
18902
+ *
18903
+ * This export does not have any `platform` interface logic. You will need to
18904
+ * write one for the platform you are using Floating UI with.
18905
+ */
18906
+ const computePosition$3 = async (reference, floating, config) => {
18907
+ const {
18908
+ placement = 'bottom',
18909
+ strategy = 'absolute',
18910
+ middleware = [],
18911
+ platform
18912
+ } = config;
18913
+ const validMiddleware = middleware.filter(Boolean);
18914
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
18915
+ let rects = await platform.getElementRects({
18916
+ reference,
18917
+ floating,
18918
+ strategy
18919
+ });
18920
+ let {
18921
+ x,
18922
+ y
18923
+ } = computeCoordsFromPlacement$1(rects, placement, rtl);
18924
+ let statefulPlacement = placement;
18925
+ let middlewareData = {};
18926
+ let resetCount = 0;
18927
+ for (let i = 0; i < validMiddleware.length; i++) {
18928
+ const {
18929
+ name,
18930
+ fn
18931
+ } = validMiddleware[i];
18932
+ const {
18933
+ x: nextX,
18934
+ y: nextY,
18935
+ data,
18936
+ reset
18937
+ } = await fn({
18938
+ x,
18939
+ y,
18940
+ initialPlacement: placement,
18941
+ placement: statefulPlacement,
18942
+ strategy,
18943
+ middlewareData,
18944
+ rects,
18945
+ platform,
18946
+ elements: {
18947
+ reference,
18948
+ floating
18949
+ }
18950
+ });
18951
+ x = nextX != null ? nextX : x;
18952
+ y = nextY != null ? nextY : y;
18953
+ middlewareData = {
18954
+ ...middlewareData,
18955
+ [name]: {
18956
+ ...middlewareData[name],
18957
+ ...data
18958
+ }
18959
+ };
18960
+ if (reset && resetCount <= 50) {
18961
+ resetCount++;
18962
+ if (typeof reset === 'object') {
18963
+ if (reset.placement) {
18964
+ statefulPlacement = reset.placement;
18965
+ }
18966
+ if (reset.rects) {
18967
+ rects = reset.rects === true ? await platform.getElementRects({
18968
+ reference,
18969
+ floating,
18970
+ strategy
18971
+ }) : reset.rects;
18972
+ }
18973
+ ({
18974
+ x,
18975
+ y
18976
+ } = computeCoordsFromPlacement$1(rects, statefulPlacement, rtl));
18977
+ }
18978
+ i = -1;
18979
+ }
18980
+ }
18981
+ return {
18982
+ x,
18983
+ y,
18984
+ placement: statefulPlacement,
18985
+ strategy,
18986
+ middlewareData
18987
+ };
18988
+ };
18989
+
18990
+ /**
18991
+ * Resolves with an object of overflow side offsets that determine how much the
18992
+ * element is overflowing a given clipping boundary on each side.
18993
+ * - positive = overflowing the boundary by that number of pixels
18994
+ * - negative = how many pixels left before it will overflow
18995
+ * - 0 = lies flush with the boundary
18996
+ * @see https://floating-ui.com/docs/detectOverflow
18997
+ */
18998
+ async function detectOverflow$2(state, options) {
18999
+ var _await$platform$isEle;
19000
+ if (options === void 0) {
19001
+ options = {};
19002
+ }
19003
+ const {
19004
+ x,
19005
+ y,
19006
+ platform,
19007
+ rects,
19008
+ elements,
19009
+ strategy
19010
+ } = state;
19011
+ const {
19012
+ boundary = 'clippingAncestors',
19013
+ rootBoundary = 'viewport',
19014
+ elementContext = 'floating',
19015
+ altBoundary = false,
19016
+ padding = 0
19017
+ } = evaluate$1(options, state);
19018
+ const paddingObject = getPaddingObject$1(padding);
19019
+ const altContext = elementContext === 'floating' ? 'reference' : 'floating';
19020
+ const element = elements[altBoundary ? altContext : elementContext];
19021
+ const clippingClientRect = rectToClientRect$2(await platform.getClippingRect({
19022
+ 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))),
19023
+ boundary,
19024
+ rootBoundary,
19025
+ strategy
19026
+ }));
19027
+ const rect = elementContext === 'floating' ? {
19028
+ x,
19029
+ y,
19030
+ width: rects.floating.width,
19031
+ height: rects.floating.height
19032
+ } : rects.reference;
19033
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
19034
+ const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
19035
+ x: 1,
19036
+ y: 1
19037
+ } : {
19038
+ x: 1,
19039
+ y: 1
19040
+ };
19041
+ const elementClientRect = rectToClientRect$2(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
19042
+ elements,
19043
+ rect,
19044
+ offsetParent,
19045
+ strategy
19046
+ }) : rect);
19047
+ return {
19048
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
19049
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
19050
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
19051
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
19052
+ };
19053
+ }
19054
+
19055
+ /**
19056
+ * Optimizes the visibility of the floating element by flipping the `placement`
19057
+ * in order to keep it in view when the preferred placement(s) will overflow the
19058
+ * clipping boundary. Alternative to `autoPlacement`.
19059
+ * @see https://floating-ui.com/docs/flip
19060
+ */
19061
+ const flip$6 = function (options) {
19062
+ if (options === void 0) {
19063
+ options = {};
19064
+ }
19065
+ return {
19066
+ name: 'flip',
19067
+ options,
19068
+ async fn(state) {
19069
+ var _middlewareData$arrow, _middlewareData$flip;
19070
+ const {
19071
+ placement,
19072
+ middlewareData,
19073
+ rects,
19074
+ initialPlacement,
19075
+ platform,
19076
+ elements
19077
+ } = state;
19078
+ const {
19079
+ mainAxis: checkMainAxis = true,
19080
+ crossAxis: checkCrossAxis = true,
19081
+ fallbackPlacements: specifiedFallbackPlacements,
19082
+ fallbackStrategy = 'bestFit',
19083
+ fallbackAxisSideDirection = 'none',
19084
+ flipAlignment = true,
19085
+ ...detectOverflowOptions
19086
+ } = evaluate$1(options, state);
19087
+
19088
+ // If a reset by the arrow was caused due to an alignment offset being
19089
+ // added, we should skip any logic now since `flip()` has already done its
19090
+ // work.
19091
+ // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
19092
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
19093
+ return {};
19094
+ }
19095
+ const side = getSide$1(placement);
19096
+ const initialSideAxis = getSideAxis$1(initialPlacement);
19097
+ const isBasePlacement = getSide$1(initialPlacement) === initialPlacement;
19098
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
19099
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement$2(initialPlacement)] : getExpandedPlacements$1(initialPlacement));
19100
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
19101
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
19102
+ fallbackPlacements.push(...getOppositeAxisPlacements$1(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
19103
+ }
19104
+ const placements = [initialPlacement, ...fallbackPlacements];
19105
+ const overflow = await detectOverflow$2(state, detectOverflowOptions);
19106
+ const overflows = [];
19107
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
19108
+ if (checkMainAxis) {
19109
+ overflows.push(overflow[side]);
19110
+ }
19111
+ if (checkCrossAxis) {
19112
+ const sides = getAlignmentSides$1(placement, rects, rtl);
19113
+ overflows.push(overflow[sides[0]], overflow[sides[1]]);
19114
+ }
19115
+ overflowsData = [...overflowsData, {
19116
+ placement,
19117
+ overflows
19118
+ }];
19119
+
19120
+ // One or more sides is overflowing.
19121
+ if (!overflows.every(side => side <= 0)) {
19122
+ var _middlewareData$flip2, _overflowsData$filter;
19123
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
19124
+ const nextPlacement = placements[nextIndex];
19125
+ if (nextPlacement) {
19126
+ // Try next placement and re-run the lifecycle.
19127
+ return {
19128
+ data: {
19129
+ index: nextIndex,
19130
+ overflows: overflowsData
19131
+ },
19132
+ reset: {
19133
+ placement: nextPlacement
19134
+ }
19135
+ };
19136
+ }
19137
+
19138
+ // First, find the candidates that fit on the mainAxis side of overflow,
19139
+ // then find the placement that fits the best on the main crossAxis side.
19140
+ 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;
19141
+
19142
+ // Otherwise fallback.
19143
+ if (!resetPlacement) {
19144
+ switch (fallbackStrategy) {
19145
+ case 'bestFit':
19146
+ {
19147
+ var _overflowsData$filter2;
19148
+ const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
19149
+ if (hasFallbackAxisSideDirection) {
19150
+ const currentSideAxis = getSideAxis$1(d.placement);
19151
+ return currentSideAxis === initialSideAxis ||
19152
+ // Create a bias to the `y` side axis due to horizontal
19153
+ // reading directions favoring greater width.
19154
+ currentSideAxis === 'y';
19155
+ }
19156
+ return true;
19157
+ }).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$filter2[0];
19158
+ if (placement) {
19159
+ resetPlacement = placement;
19160
+ }
19161
+ break;
19162
+ }
19163
+ case 'initialPlacement':
19164
+ resetPlacement = initialPlacement;
19165
+ break;
19166
+ }
19167
+ }
19168
+ if (placement !== resetPlacement) {
19169
+ return {
19170
+ reset: {
19171
+ placement: resetPlacement
19172
+ }
19173
+ };
19174
+ }
19175
+ }
19176
+ return {};
19177
+ }
19178
+ };
19179
+ };
19180
+
19181
+ // For type backwards-compatibility, the `OffsetOptions` type was also
19182
+ // Derivable.
19183
+
19184
+ async function convertValueToCoords$1(state, options) {
19185
+ const {
19186
+ placement,
19187
+ platform,
19188
+ elements
19189
+ } = state;
19190
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
19191
+ const side = getSide$1(placement);
19192
+ const alignment = getAlignment$1(placement);
19193
+ const isVertical = getSideAxis$1(placement) === 'y';
19194
+ const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
19195
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
19196
+ const rawValue = evaluate$1(options, state);
19197
+
19198
+ // eslint-disable-next-line prefer-const
19199
+ let {
19200
+ mainAxis,
19201
+ crossAxis,
19202
+ alignmentAxis
19203
+ } = typeof rawValue === 'number' ? {
19204
+ mainAxis: rawValue,
19205
+ crossAxis: 0,
19206
+ alignmentAxis: null
19207
+ } : {
19208
+ mainAxis: 0,
19209
+ crossAxis: 0,
19210
+ alignmentAxis: null,
19211
+ ...rawValue
19212
+ };
19213
+ if (alignment && typeof alignmentAxis === 'number') {
19214
+ crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
19215
+ }
19216
+ return isVertical ? {
19217
+ x: crossAxis * crossAxisMulti,
19218
+ y: mainAxis * mainAxisMulti
19219
+ } : {
19220
+ x: mainAxis * mainAxisMulti,
19221
+ y: crossAxis * crossAxisMulti
19222
+ };
19223
+ }
19224
+
19225
+ /**
19226
+ * Modifies the placement by translating the floating element along the
19227
+ * specified axes.
19228
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
19229
+ * object may be passed.
19230
+ * @see https://floating-ui.com/docs/offset
19231
+ */
19232
+ const offset$6 = function (options) {
19233
+ if (options === void 0) {
19234
+ options = 0;
19235
+ }
19236
+ return {
19237
+ name: 'offset',
19238
+ options,
19239
+ async fn(state) {
19240
+ var _middlewareData$offse, _middlewareData$arrow;
19241
+ const {
19242
+ x,
19243
+ y,
19244
+ placement,
19245
+ middlewareData
19246
+ } = state;
19247
+ const diffCoords = await convertValueToCoords$1(state, options);
19248
+
19249
+ // If the placement is the same and the arrow caused an alignment offset
19250
+ // then we don't need to change the positioning coordinates.
19251
+ if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
19252
+ return {};
19253
+ }
19254
+ return {
19255
+ x: x + diffCoords.x,
19256
+ y: y + diffCoords.y,
19257
+ data: {
19258
+ ...diffCoords,
19259
+ placement
19260
+ }
19261
+ };
19262
+ }
19263
+ };
19264
+ };
19265
+
19266
+ /**
19267
+ * Optimizes the visibility of the floating element by shifting it in order to
19268
+ * keep it in view when it will overflow the clipping boundary.
19269
+ * @see https://floating-ui.com/docs/shift
19270
+ */
19271
+ const shift$4 = function (options) {
19272
+ if (options === void 0) {
19273
+ options = {};
19274
+ }
19275
+ return {
19276
+ name: 'shift',
19277
+ options,
19278
+ async fn(state) {
19279
+ const {
19280
+ x,
19281
+ y,
19282
+ placement
19283
+ } = state;
19284
+ const {
19285
+ mainAxis: checkMainAxis = true,
19286
+ crossAxis: checkCrossAxis = false,
19287
+ limiter = {
19288
+ fn: _ref => {
19289
+ let {
19290
+ x,
19291
+ y
19292
+ } = _ref;
19293
+ return {
19294
+ x,
19295
+ y
19296
+ };
19297
+ }
19298
+ },
19299
+ ...detectOverflowOptions
19300
+ } = evaluate$1(options, state);
19301
+ const coords = {
19302
+ x,
19303
+ y
19304
+ };
19305
+ const overflow = await detectOverflow$2(state, detectOverflowOptions);
19306
+ const crossAxis = getSideAxis$1(getSide$1(placement));
19307
+ const mainAxis = getOppositeAxis$1(crossAxis);
19308
+ let mainAxisCoord = coords[mainAxis];
19309
+ let crossAxisCoord = coords[crossAxis];
19310
+ if (checkMainAxis) {
19311
+ const minSide = mainAxis === 'y' ? 'top' : 'left';
19312
+ const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
19313
+ const min = mainAxisCoord + overflow[minSide];
19314
+ const max = mainAxisCoord - overflow[maxSide];
19315
+ mainAxisCoord = clamp$1(min, mainAxisCoord, max);
19316
+ }
19317
+ if (checkCrossAxis) {
19318
+ const minSide = crossAxis === 'y' ? 'top' : 'left';
19319
+ const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
19320
+ const min = crossAxisCoord + overflow[minSide];
19321
+ const max = crossAxisCoord - overflow[maxSide];
19322
+ crossAxisCoord = clamp$1(min, crossAxisCoord, max);
19323
+ }
19324
+ const limitedCoords = limiter.fn({
19325
+ ...state,
19326
+ [mainAxis]: mainAxisCoord,
19327
+ [crossAxis]: crossAxisCoord
19328
+ });
19329
+ return {
19330
+ ...limitedCoords,
19331
+ data: {
19332
+ x: limitedCoords.x - x,
19333
+ y: limitedCoords.y - y
19334
+ }
19335
+ };
19336
+ }
19337
+ };
19338
+ };
19339
+
19340
+ function getNodeName$2(node) {
19341
+ if (isNode$1(node)) {
19342
+ return (node.nodeName || '').toLowerCase();
19343
+ }
19344
+ // Mocked nodes in testing environments may not be instances of Node. By
19345
+ // returning `#document` an infinite loop won't occur.
19346
+ // https://github.com/floating-ui/floating-ui/issues/2317
19347
+ return '#document';
19348
+ }
19349
+ function getWindow$2(node) {
19350
+ var _node$ownerDocument;
19351
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
19352
+ }
19353
+ function getDocumentElement$2(node) {
19354
+ var _ref;
19355
+ return (_ref = (isNode$1(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
19356
+ }
19357
+ function isNode$1(value) {
19358
+ return value instanceof Node || value instanceof getWindow$2(value).Node;
19359
+ }
19360
+ function isElement$2(value) {
19361
+ return value instanceof Element || value instanceof getWindow$2(value).Element;
19362
+ }
19363
+ function isHTMLElement$2(value) {
19364
+ return value instanceof HTMLElement || value instanceof getWindow$2(value).HTMLElement;
19365
+ }
19366
+ function isShadowRoot$2(value) {
19367
+ // Browsers without `ShadowRoot` support.
19368
+ if (typeof ShadowRoot === 'undefined') {
19369
+ return false;
19370
+ }
19371
+ return value instanceof ShadowRoot || value instanceof getWindow$2(value).ShadowRoot;
19372
+ }
19373
+ function isOverflowElement$1(element) {
19374
+ const {
19375
+ overflow,
19376
+ overflowX,
19377
+ overflowY,
19378
+ display
19379
+ } = getComputedStyle$3(element);
19380
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
19381
+ }
19382
+ function isTableElement$2(element) {
19383
+ return ['table', 'td', 'th'].includes(getNodeName$2(element));
19384
+ }
19385
+ function isTopLayer$1(element) {
19386
+ return [':popover-open', ':modal'].some(selector => {
19387
+ try {
19388
+ return element.matches(selector);
19389
+ } catch (e) {
19390
+ return false;
19391
+ }
19392
+ });
19393
+ }
19394
+ function isContainingBlock$1(elementOrCss) {
19395
+ const webkit = isWebKit$1();
19396
+ const css = isElement$2(elementOrCss) ? getComputedStyle$3(elementOrCss) : elementOrCss;
19397
+
19398
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
19399
+ 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));
19400
+ }
19401
+ function getContainingBlock$2(element) {
19402
+ let currentNode = getParentNode$2(element);
19403
+ while (isHTMLElement$2(currentNode) && !isLastTraversableNode$1(currentNode)) {
19404
+ if (isContainingBlock$1(currentNode)) {
19405
+ return currentNode;
19406
+ } else if (isTopLayer$1(currentNode)) {
19407
+ return null;
19408
+ }
19409
+ currentNode = getParentNode$2(currentNode);
19410
+ }
19411
+ return null;
19412
+ }
19413
+ function isWebKit$1() {
19414
+ if (typeof CSS === 'undefined' || !CSS.supports) return false;
19415
+ return CSS.supports('-webkit-backdrop-filter', 'none');
19416
+ }
19417
+ function isLastTraversableNode$1(node) {
19418
+ return ['html', 'body', '#document'].includes(getNodeName$2(node));
19419
+ }
19420
+ function getComputedStyle$3(element) {
19421
+ return getWindow$2(element).getComputedStyle(element);
19422
+ }
19423
+ function getNodeScroll$2(element) {
19424
+ if (isElement$2(element)) {
19425
+ return {
19426
+ scrollLeft: element.scrollLeft,
19427
+ scrollTop: element.scrollTop
19428
+ };
19429
+ }
19430
+ return {
19431
+ scrollLeft: element.scrollX,
19432
+ scrollTop: element.scrollY
19433
+ };
19434
+ }
19435
+ function getParentNode$2(node) {
19436
+ if (getNodeName$2(node) === 'html') {
19437
+ return node;
19438
+ }
19439
+ const result =
19440
+ // Step into the shadow DOM of the parent of a slotted node.
19441
+ node.assignedSlot ||
19442
+ // DOM Element detected.
19443
+ node.parentNode ||
19444
+ // ShadowRoot detected.
19445
+ isShadowRoot$2(node) && node.host ||
19446
+ // Fallback.
19447
+ getDocumentElement$2(node);
19448
+ return isShadowRoot$2(result) ? result.host : result;
19449
+ }
19450
+ function getNearestOverflowAncestor$1(node) {
19451
+ const parentNode = getParentNode$2(node);
19452
+ if (isLastTraversableNode$1(parentNode)) {
19453
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
19454
+ }
19455
+ if (isHTMLElement$2(parentNode) && isOverflowElement$1(parentNode)) {
19456
+ return parentNode;
19457
+ }
19458
+ return getNearestOverflowAncestor$1(parentNode);
19459
+ }
19460
+ function getOverflowAncestors$1(node, list, traverseIframes) {
19461
+ var _node$ownerDocument2;
19462
+ if (list === void 0) {
19463
+ list = [];
19464
+ }
19465
+ if (traverseIframes === void 0) {
19466
+ traverseIframes = true;
19467
+ }
19468
+ const scrollableAncestor = getNearestOverflowAncestor$1(node);
19469
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
19470
+ const win = getWindow$2(scrollableAncestor);
19471
+ if (isBody) {
19472
+ const frameElement = getFrameElement(win);
19473
+ return list.concat(win, win.visualViewport || [], isOverflowElement$1(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors$1(frameElement) : []);
19474
+ }
19475
+ return list.concat(scrollableAncestor, getOverflowAncestors$1(scrollableAncestor, [], traverseIframes));
19476
+ }
19477
+ function getFrameElement(win) {
19478
+ return Object.getPrototypeOf(win.parent) ? win.frameElement : null;
19479
+ }
19480
+
19481
+ function getCssDimensions$1(element) {
19482
+ const css = getComputedStyle$3(element);
19483
+ // In testing environments, the `width` and `height` properties are empty
19484
+ // strings for SVG elements, returning NaN. Fallback to `0` in this case.
19485
+ let width = parseFloat(css.width) || 0;
19486
+ let height = parseFloat(css.height) || 0;
19487
+ const hasOffset = isHTMLElement$2(element);
19488
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
19489
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
19490
+ const shouldFallback = round$2(width) !== offsetWidth || round$2(height) !== offsetHeight;
19491
+ if (shouldFallback) {
19492
+ width = offsetWidth;
19493
+ height = offsetHeight;
19494
+ }
19495
+ return {
19496
+ width,
19497
+ height,
19498
+ $: shouldFallback
19499
+ };
19500
+ }
19501
+
19502
+ function unwrapElement$1(element) {
19503
+ return !isElement$2(element) ? element.contextElement : element;
19504
+ }
19505
+
19506
+ function getScale$1(element) {
19507
+ const domElement = unwrapElement$1(element);
19508
+ if (!isHTMLElement$2(domElement)) {
19509
+ return createCoords$1(1);
19510
+ }
19511
+ const rect = domElement.getBoundingClientRect();
19512
+ const {
19513
+ width,
19514
+ height,
19515
+ $
19516
+ } = getCssDimensions$1(domElement);
19517
+ let x = ($ ? round$2(rect.width) : rect.width) / width;
19518
+ let y = ($ ? round$2(rect.height) : rect.height) / height;
19519
+
19520
+ // 0, NaN, or Infinity should always fallback to 1.
19521
+
19522
+ if (!x || !Number.isFinite(x)) {
19523
+ x = 1;
19524
+ }
19525
+ if (!y || !Number.isFinite(y)) {
19526
+ y = 1;
19527
+ }
19528
+ return {
19529
+ x,
19530
+ y
19531
+ };
19532
+ }
19533
+
19534
+ const noOffsets$1 = /*#__PURE__*/createCoords$1(0);
19535
+ function getVisualOffsets$1(element) {
19536
+ const win = getWindow$2(element);
19537
+ if (!isWebKit$1() || !win.visualViewport) {
19538
+ return noOffsets$1;
19539
+ }
19540
+ return {
19541
+ x: win.visualViewport.offsetLeft,
19542
+ y: win.visualViewport.offsetTop
19543
+ };
19544
+ }
19545
+ function shouldAddVisualOffsets$1(element, isFixed, floatingOffsetParent) {
19546
+ if (isFixed === void 0) {
19547
+ isFixed = false;
19548
+ }
19549
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow$2(element)) {
19550
+ return false;
19551
+ }
19552
+ return isFixed;
19553
+ }
19554
+
19555
+ function getBoundingClientRect$2(element, includeScale, isFixedStrategy, offsetParent) {
19556
+ if (includeScale === void 0) {
19557
+ includeScale = false;
19558
+ }
19559
+ if (isFixedStrategy === void 0) {
19560
+ isFixedStrategy = false;
19561
+ }
19562
+ const clientRect = element.getBoundingClientRect();
19563
+ const domElement = unwrapElement$1(element);
19564
+ let scale = createCoords$1(1);
19565
+ if (includeScale) {
19566
+ if (offsetParent) {
19567
+ if (isElement$2(offsetParent)) {
19568
+ scale = getScale$1(offsetParent);
19569
+ }
19570
+ } else {
19571
+ scale = getScale$1(element);
19572
+ }
19573
+ }
19574
+ const visualOffsets = shouldAddVisualOffsets$1(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets$1(domElement) : createCoords$1(0);
19575
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
19576
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
19577
+ let width = clientRect.width / scale.x;
19578
+ let height = clientRect.height / scale.y;
19579
+ if (domElement) {
19580
+ const win = getWindow$2(domElement);
19581
+ const offsetWin = offsetParent && isElement$2(offsetParent) ? getWindow$2(offsetParent) : offsetParent;
19582
+ let currentWin = win;
19583
+ let currentIFrame = getFrameElement(currentWin);
19584
+ while (currentIFrame && offsetParent && offsetWin !== currentWin) {
19585
+ const iframeScale = getScale$1(currentIFrame);
19586
+ const iframeRect = currentIFrame.getBoundingClientRect();
19587
+ const css = getComputedStyle$3(currentIFrame);
19588
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
19589
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
19590
+ x *= iframeScale.x;
19591
+ y *= iframeScale.y;
19592
+ width *= iframeScale.x;
19593
+ height *= iframeScale.y;
19594
+ x += left;
19595
+ y += top;
19596
+ currentWin = getWindow$2(currentIFrame);
19597
+ currentIFrame = getFrameElement(currentWin);
19598
+ }
19599
+ }
19600
+ return rectToClientRect$2({
19601
+ width,
19602
+ height,
19603
+ x,
19604
+ y
19605
+ });
19606
+ }
19607
+
19608
+ function convertOffsetParentRelativeRectToViewportRelativeRect$1(_ref) {
19609
+ let {
19610
+ elements,
19611
+ rect,
19612
+ offsetParent,
19613
+ strategy
19614
+ } = _ref;
19615
+ const isFixed = strategy === 'fixed';
19616
+ const documentElement = getDocumentElement$2(offsetParent);
19617
+ const topLayer = elements ? isTopLayer$1(elements.floating) : false;
19618
+ if (offsetParent === documentElement || topLayer && isFixed) {
19619
+ return rect;
19620
+ }
19621
+ let scroll = {
19622
+ scrollLeft: 0,
19623
+ scrollTop: 0
19624
+ };
19625
+ let scale = createCoords$1(1);
19626
+ const offsets = createCoords$1(0);
19627
+ const isOffsetParentAnElement = isHTMLElement$2(offsetParent);
19628
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
19629
+ if (getNodeName$2(offsetParent) !== 'body' || isOverflowElement$1(documentElement)) {
19630
+ scroll = getNodeScroll$2(offsetParent);
19631
+ }
19632
+ if (isHTMLElement$2(offsetParent)) {
19633
+ const offsetRect = getBoundingClientRect$2(offsetParent);
19634
+ scale = getScale$1(offsetParent);
19635
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
19636
+ offsets.y = offsetRect.y + offsetParent.clientTop;
19637
+ }
19638
+ }
19639
+ return {
19640
+ width: rect.width * scale.x,
19641
+ height: rect.height * scale.y,
19642
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
19643
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
19644
+ };
19645
+ }
19646
+
19647
+ function getClientRects$1(element) {
19648
+ return Array.from(element.getClientRects());
19649
+ }
19650
+
19651
+ function getWindowScrollBarX$2(element) {
19652
+ // If <html> has a CSS width greater than the viewport, then this will be
19653
+ // incorrect for RTL.
19654
+ return getBoundingClientRect$2(getDocumentElement$2(element)).left + getNodeScroll$2(element).scrollLeft;
19655
+ }
19656
+
19657
+ // Gets the entire size of the scrollable document area, even extending outside
19658
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
19659
+ function getDocumentRect$2(element) {
19660
+ const html = getDocumentElement$2(element);
19661
+ const scroll = getNodeScroll$2(element);
19662
+ const body = element.ownerDocument.body;
19663
+ const width = max$3(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
19664
+ const height = max$3(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
19665
+ let x = -scroll.scrollLeft + getWindowScrollBarX$2(element);
19666
+ const y = -scroll.scrollTop;
19667
+ if (getComputedStyle$3(body).direction === 'rtl') {
19668
+ x += max$3(html.clientWidth, body.clientWidth) - width;
19669
+ }
19670
+ return {
19671
+ width,
19672
+ height,
19673
+ x,
19674
+ y
19675
+ };
19676
+ }
19677
+
19678
+ function getViewportRect$2(element, strategy) {
19679
+ const win = getWindow$2(element);
19680
+ const html = getDocumentElement$2(element);
19681
+ const visualViewport = win.visualViewport;
19682
+ let width = html.clientWidth;
19683
+ let height = html.clientHeight;
19684
+ let x = 0;
19685
+ let y = 0;
19686
+ if (visualViewport) {
19687
+ width = visualViewport.width;
19688
+ height = visualViewport.height;
19689
+ const visualViewportBased = isWebKit$1();
19690
+ if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
19691
+ x = visualViewport.offsetLeft;
19692
+ y = visualViewport.offsetTop;
19693
+ }
19694
+ }
19695
+ return {
19696
+ width,
19697
+ height,
19698
+ x,
19699
+ y
19700
+ };
19701
+ }
19702
+
19703
+ // Returns the inner client rect, subtracting scrollbars if present.
19704
+ function getInnerBoundingClientRect$2(element, strategy) {
19705
+ const clientRect = getBoundingClientRect$2(element, true, strategy === 'fixed');
19706
+ const top = clientRect.top + element.clientTop;
19707
+ const left = clientRect.left + element.clientLeft;
19708
+ const scale = isHTMLElement$2(element) ? getScale$1(element) : createCoords$1(1);
19709
+ const width = element.clientWidth * scale.x;
19710
+ const height = element.clientHeight * scale.y;
19711
+ const x = left * scale.x;
19712
+ const y = top * scale.y;
19713
+ return {
19714
+ width,
19715
+ height,
19716
+ x,
19717
+ y
19718
+ };
19719
+ }
19720
+ function getClientRectFromClippingAncestor$1(element, clippingAncestor, strategy) {
19721
+ let rect;
19722
+ if (clippingAncestor === 'viewport') {
19723
+ rect = getViewportRect$2(element, strategy);
19724
+ } else if (clippingAncestor === 'document') {
19725
+ rect = getDocumentRect$2(getDocumentElement$2(element));
19726
+ } else if (isElement$2(clippingAncestor)) {
19727
+ rect = getInnerBoundingClientRect$2(clippingAncestor, strategy);
19728
+ } else {
19729
+ const visualOffsets = getVisualOffsets$1(element);
19730
+ rect = {
19731
+ ...clippingAncestor,
19732
+ x: clippingAncestor.x - visualOffsets.x,
19733
+ y: clippingAncestor.y - visualOffsets.y
19734
+ };
19735
+ }
19736
+ return rectToClientRect$2(rect);
19737
+ }
19738
+ function hasFixedPositionAncestor$1(element, stopNode) {
19739
+ const parentNode = getParentNode$2(element);
19740
+ if (parentNode === stopNode || !isElement$2(parentNode) || isLastTraversableNode$1(parentNode)) {
19741
+ return false;
19742
+ }
19743
+ return getComputedStyle$3(parentNode).position === 'fixed' || hasFixedPositionAncestor$1(parentNode, stopNode);
19744
+ }
19745
+
19746
+ // A "clipping ancestor" is an `overflow` element with the characteristic of
19747
+ // clipping (or hiding) child elements. This returns all clipping ancestors
19748
+ // of the given element up the tree.
19749
+ function getClippingElementAncestors$1(element, cache) {
19750
+ const cachedResult = cache.get(element);
19751
+ if (cachedResult) {
19752
+ return cachedResult;
19753
+ }
19754
+ let result = getOverflowAncestors$1(element, [], false).filter(el => isElement$2(el) && getNodeName$2(el) !== 'body');
19755
+ let currentContainingBlockComputedStyle = null;
19756
+ const elementIsFixed = getComputedStyle$3(element).position === 'fixed';
19757
+ let currentNode = elementIsFixed ? getParentNode$2(element) : element;
19758
+
19759
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
19760
+ while (isElement$2(currentNode) && !isLastTraversableNode$1(currentNode)) {
19761
+ const computedStyle = getComputedStyle$3(currentNode);
19762
+ const currentNodeIsContaining = isContainingBlock$1(currentNode);
19763
+ if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
19764
+ currentContainingBlockComputedStyle = null;
19765
+ }
19766
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement$1(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor$1(element, currentNode);
19767
+ if (shouldDropCurrentNode) {
19768
+ // Drop non-containing blocks.
19769
+ result = result.filter(ancestor => ancestor !== currentNode);
19770
+ } else {
19771
+ // Record last containing block for next iteration.
19772
+ currentContainingBlockComputedStyle = computedStyle;
19773
+ }
19774
+ currentNode = getParentNode$2(currentNode);
19775
+ }
19776
+ cache.set(element, result);
19777
+ return result;
19778
+ }
19779
+
19780
+ // Gets the maximum area that the element is visible in due to any number of
19781
+ // clipping ancestors.
19782
+ function getClippingRect$2(_ref) {
19783
+ let {
19784
+ element,
19785
+ boundary,
19786
+ rootBoundary,
19787
+ strategy
19788
+ } = _ref;
19789
+ const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer$1(element) ? [] : getClippingElementAncestors$1(element, this._c) : [].concat(boundary);
19790
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
19791
+ const firstClippingAncestor = clippingAncestors[0];
19792
+ const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
19793
+ const rect = getClientRectFromClippingAncestor$1(element, clippingAncestor, strategy);
19794
+ accRect.top = max$3(rect.top, accRect.top);
19795
+ accRect.right = min$3(rect.right, accRect.right);
19796
+ accRect.bottom = min$3(rect.bottom, accRect.bottom);
19797
+ accRect.left = max$3(rect.left, accRect.left);
19798
+ return accRect;
19799
+ }, getClientRectFromClippingAncestor$1(element, firstClippingAncestor, strategy));
19800
+ return {
19801
+ width: clippingRect.right - clippingRect.left,
19802
+ height: clippingRect.bottom - clippingRect.top,
19803
+ x: clippingRect.left,
19804
+ y: clippingRect.top
19805
+ };
19806
+ }
19807
+
19808
+ function getDimensions$1(element) {
19809
+ const {
19810
+ width,
19811
+ height
19812
+ } = getCssDimensions$1(element);
19813
+ return {
19814
+ width,
19815
+ height
19816
+ };
19817
+ }
19818
+
19819
+ function getRectRelativeToOffsetParent$1(element, offsetParent, strategy) {
19820
+ const isOffsetParentAnElement = isHTMLElement$2(offsetParent);
19821
+ const documentElement = getDocumentElement$2(offsetParent);
19822
+ const isFixed = strategy === 'fixed';
19823
+ const rect = getBoundingClientRect$2(element, true, isFixed, offsetParent);
19824
+ let scroll = {
19825
+ scrollLeft: 0,
19826
+ scrollTop: 0
19827
+ };
19828
+ const offsets = createCoords$1(0);
19829
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
19830
+ if (getNodeName$2(offsetParent) !== 'body' || isOverflowElement$1(documentElement)) {
19831
+ scroll = getNodeScroll$2(offsetParent);
19832
+ }
19833
+ if (isOffsetParentAnElement) {
19834
+ const offsetRect = getBoundingClientRect$2(offsetParent, true, isFixed, offsetParent);
19835
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
19836
+ offsets.y = offsetRect.y + offsetParent.clientTop;
19837
+ } else if (documentElement) {
19838
+ offsets.x = getWindowScrollBarX$2(documentElement);
19839
+ }
19840
+ }
19841
+ const x = rect.left + scroll.scrollLeft - offsets.x;
19842
+ const y = rect.top + scroll.scrollTop - offsets.y;
19843
+ return {
19844
+ x,
19845
+ y,
19846
+ width: rect.width,
19847
+ height: rect.height
19848
+ };
19849
+ }
19850
+
19851
+ function isStaticPositioned$1(element) {
19852
+ return getComputedStyle$3(element).position === 'static';
19853
+ }
19854
+
19855
+ function getTrueOffsetParent$2(element, polyfill) {
19856
+ if (!isHTMLElement$2(element) || getComputedStyle$3(element).position === 'fixed') {
19857
+ return null;
19858
+ }
19859
+ if (polyfill) {
19860
+ return polyfill(element);
19861
+ }
19862
+ return element.offsetParent;
19863
+ }
19864
+
19865
+ // Gets the closest ancestor positioned element. Handles some edge cases,
19866
+ // such as table ancestors and cross browser bugs.
19867
+ function getOffsetParent$2(element, polyfill) {
19868
+ const win = getWindow$2(element);
19869
+ if (isTopLayer$1(element)) {
19870
+ return win;
19871
+ }
19872
+ if (!isHTMLElement$2(element)) {
19873
+ let svgOffsetParent = getParentNode$2(element);
19874
+ while (svgOffsetParent && !isLastTraversableNode$1(svgOffsetParent)) {
19875
+ if (isElement$2(svgOffsetParent) && !isStaticPositioned$1(svgOffsetParent)) {
19876
+ return svgOffsetParent;
19877
+ }
19878
+ svgOffsetParent = getParentNode$2(svgOffsetParent);
19879
+ }
19880
+ return win;
19881
+ }
19882
+ let offsetParent = getTrueOffsetParent$2(element, polyfill);
19883
+ while (offsetParent && isTableElement$2(offsetParent) && isStaticPositioned$1(offsetParent)) {
19884
+ offsetParent = getTrueOffsetParent$2(offsetParent, polyfill);
19885
+ }
19886
+ if (offsetParent && isLastTraversableNode$1(offsetParent) && isStaticPositioned$1(offsetParent) && !isContainingBlock$1(offsetParent)) {
19887
+ return win;
19888
+ }
19889
+ return offsetParent || getContainingBlock$2(element) || win;
19890
+ }
19891
+
19892
+ const getElementRects$1 = async function (data) {
19893
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent$2;
19894
+ const getDimensionsFn = this.getDimensions;
19895
+ const floatingDimensions = await getDimensionsFn(data.floating);
19896
+ return {
19897
+ reference: getRectRelativeToOffsetParent$1(data.reference, await getOffsetParentFn(data.floating), data.strategy),
19898
+ floating: {
19899
+ x: 0,
19900
+ y: 0,
19901
+ width: floatingDimensions.width,
19902
+ height: floatingDimensions.height
19903
+ }
19904
+ };
19905
+ };
19906
+
19907
+ function isRTL$1(element) {
19908
+ return getComputedStyle$3(element).direction === 'rtl';
19909
+ }
19910
+
19911
+ const platform$1 = {
19912
+ convertOffsetParentRelativeRectToViewportRelativeRect: convertOffsetParentRelativeRectToViewportRelativeRect$1,
19913
+ getDocumentElement: getDocumentElement$2,
19914
+ getClippingRect: getClippingRect$2,
19915
+ getOffsetParent: getOffsetParent$2,
19916
+ getElementRects: getElementRects$1,
19917
+ getClientRects: getClientRects$1,
19918
+ getDimensions: getDimensions$1,
19919
+ getScale: getScale$1,
19920
+ isElement: isElement$2,
19921
+ isRTL: isRTL$1
19922
+ };
19923
+
19924
+ /**
19925
+ * Modifies the placement by translating the floating element along the
19926
+ * specified axes.
19927
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
19928
+ * object may be passed.
19929
+ * @see https://floating-ui.com/docs/offset
19930
+ */
19931
+ const offset$5 = offset$6;
19932
+
19933
+ /**
19934
+ * Optimizes the visibility of the floating element by shifting it in order to
19935
+ * keep it in view when it will overflow the clipping boundary.
19936
+ * @see https://floating-ui.com/docs/shift
19937
+ */
19938
+ const shift$3 = shift$4;
19939
+
19940
+ /**
19941
+ * Optimizes the visibility of the floating element by flipping the `placement`
19942
+ * in order to keep it in view when the preferred placement(s) will overflow the
19943
+ * clipping boundary. Alternative to `autoPlacement`.
19944
+ * @see https://floating-ui.com/docs/flip
19945
+ */
19946
+ const flip$5 = flip$6;
19947
+
19948
+ /**
19949
+ * Computes the `x` and `y` coordinates that will place the floating element
19950
+ * next to a given reference element.
19951
+ */
19952
+ const computePosition$2 = (reference, floating, options) => {
19953
+ // This caches the expensive `getClippingElementAncestors` function so that
19954
+ // multiple lifecycle resets re-use the same result. It only lives for a
19955
+ // single call. If other functions become expensive, we can add them as well.
19956
+ const cache = new Map();
19957
+ const mergedOptions = {
19958
+ platform: platform$1,
19959
+ ...options
19960
+ };
19961
+ const platformWithCache = {
19962
+ ...mergedOptions.platform,
19963
+ _c: cache
19964
+ };
19965
+ return computePosition$3(reference, floating, {
19966
+ ...mergedOptions,
19967
+ platform: platformWithCache
19968
+ });
19969
+ };
19970
+
19971
+ var index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;
19972
+
19973
+ // Fork of `fast-deep-equal` that only does the comparisons we need and compares
19974
+ // functions
19975
+ function deepEqual(a, b) {
19976
+ if (a === b) {
19977
+ return true;
19978
+ }
19979
+ if (typeof a !== typeof b) {
19980
+ return false;
19981
+ }
19982
+ if (typeof a === 'function' && a.toString() === b.toString()) {
19983
+ return true;
19984
+ }
19985
+ let length;
19986
+ let i;
19987
+ let keys;
19988
+ if (a && b && typeof a === 'object') {
19989
+ if (Array.isArray(a)) {
19990
+ length = a.length;
19991
+ if (length !== b.length) return false;
19992
+ for (i = length; i-- !== 0;) {
19993
+ if (!deepEqual(a[i], b[i])) {
19994
+ return false;
19995
+ }
19996
+ }
19997
+ return true;
19998
+ }
19999
+ keys = Object.keys(a);
20000
+ length = keys.length;
20001
+ if (length !== Object.keys(b).length) {
20002
+ return false;
20003
+ }
20004
+ for (i = length; i-- !== 0;) {
20005
+ if (!{}.hasOwnProperty.call(b, keys[i])) {
20006
+ return false;
20007
+ }
20008
+ }
20009
+ for (i = length; i-- !== 0;) {
20010
+ const key = keys[i];
20011
+ if (key === '_owner' && a.$$typeof) {
20012
+ continue;
20013
+ }
20014
+ if (!deepEqual(a[key], b[key])) {
20015
+ return false;
20016
+ }
20017
+ }
20018
+ return true;
20019
+ }
20020
+ return a !== a && b !== b;
20021
+ }
20022
+
20023
+ function getDPR(element) {
20024
+ if (typeof window === 'undefined') {
20025
+ return 1;
20026
+ }
20027
+ const win = element.ownerDocument.defaultView || window;
20028
+ return win.devicePixelRatio || 1;
20029
+ }
20030
+
20031
+ function roundByDPR(element, value) {
20032
+ const dpr = getDPR(element);
20033
+ return Math.round(value * dpr) / dpr;
20034
+ }
20035
+
20036
+ function useLatestRef(value) {
20037
+ const ref = e.useRef(value);
20038
+ index(() => {
20039
+ ref.current = value;
20040
+ });
20041
+ return ref;
20042
+ }
20043
+
20044
+ /**
20045
+ * Provides data to position a floating element.
20046
+ * @see https://floating-ui.com/docs/useFloating
20047
+ */
20048
+ function useFloating(options) {
20049
+ if (options === void 0) {
20050
+ options = {};
20051
+ }
20052
+ const {
20053
+ placement = 'bottom',
20054
+ strategy = 'absolute',
20055
+ middleware = [],
20056
+ platform,
20057
+ elements: {
20058
+ reference: externalReference,
20059
+ floating: externalFloating
20060
+ } = {},
20061
+ transform = true,
20062
+ whileElementsMounted,
20063
+ open
20064
+ } = options;
20065
+ const [data, setData] = e.useState({
20066
+ x: 0,
20067
+ y: 0,
20068
+ strategy,
20069
+ placement,
20070
+ middlewareData: {},
20071
+ isPositioned: false
20072
+ });
20073
+ const [latestMiddleware, setLatestMiddleware] = e.useState(middleware);
20074
+ if (!deepEqual(latestMiddleware, middleware)) {
20075
+ setLatestMiddleware(middleware);
20076
+ }
20077
+ const [_reference, _setReference] = e.useState(null);
20078
+ const [_floating, _setFloating] = e.useState(null);
20079
+ const setReference = e.useCallback(node => {
20080
+ if (node !== referenceRef.current) {
20081
+ referenceRef.current = node;
20082
+ _setReference(node);
20083
+ }
20084
+ }, []);
20085
+ const setFloating = e.useCallback(node => {
20086
+ if (node !== floatingRef.current) {
20087
+ floatingRef.current = node;
20088
+ _setFloating(node);
20089
+ }
20090
+ }, []);
20091
+ const referenceEl = externalReference || _reference;
20092
+ const floatingEl = externalFloating || _floating;
20093
+ const referenceRef = e.useRef(null);
20094
+ const floatingRef = e.useRef(null);
20095
+ const dataRef = e.useRef(data);
20096
+ const hasWhileElementsMounted = whileElementsMounted != null;
20097
+ const whileElementsMountedRef = useLatestRef(whileElementsMounted);
20098
+ const platformRef = useLatestRef(platform);
20099
+ const update = e.useCallback(() => {
20100
+ if (!referenceRef.current || !floatingRef.current) {
20101
+ return;
20102
+ }
20103
+ const config = {
20104
+ placement,
20105
+ strategy,
20106
+ middleware: latestMiddleware
20107
+ };
20108
+ if (platformRef.current) {
20109
+ config.platform = platformRef.current;
20110
+ }
20111
+ computePosition$2(referenceRef.current, floatingRef.current, config).then(data => {
20112
+ const fullData = {
20113
+ ...data,
20114
+ isPositioned: true
20115
+ };
20116
+ if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
20117
+ dataRef.current = fullData;
20118
+ ReactDOM.flushSync(() => {
20119
+ setData(fullData);
20120
+ });
20121
+ }
20122
+ });
20123
+ }, [latestMiddleware, placement, strategy, platformRef]);
20124
+ index(() => {
20125
+ if (open === false && dataRef.current.isPositioned) {
20126
+ dataRef.current.isPositioned = false;
20127
+ setData(data => ({
20128
+ ...data,
20129
+ isPositioned: false
20130
+ }));
20131
+ }
20132
+ }, [open]);
20133
+ const isMountedRef = e.useRef(false);
20134
+ index(() => {
20135
+ isMountedRef.current = true;
20136
+ return () => {
20137
+ isMountedRef.current = false;
20138
+ };
20139
+ }, []);
20140
+ index(() => {
20141
+ if (referenceEl) referenceRef.current = referenceEl;
20142
+ if (floatingEl) floatingRef.current = floatingEl;
20143
+ if (referenceEl && floatingEl) {
20144
+ if (whileElementsMountedRef.current) {
20145
+ return whileElementsMountedRef.current(referenceEl, floatingEl, update);
20146
+ }
20147
+ update();
20148
+ }
20149
+ }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
20150
+ const refs = e.useMemo(() => ({
20151
+ reference: referenceRef,
20152
+ floating: floatingRef,
20153
+ setReference,
20154
+ setFloating
20155
+ }), [setReference, setFloating]);
20156
+ const elements = e.useMemo(() => ({
20157
+ reference: referenceEl,
20158
+ floating: floatingEl
20159
+ }), [referenceEl, floatingEl]);
20160
+ const floatingStyles = e.useMemo(() => {
20161
+ const initialStyles = {
20162
+ position: strategy,
20163
+ left: 0,
20164
+ top: 0
20165
+ };
20166
+ if (!elements.floating) {
20167
+ return initialStyles;
20168
+ }
20169
+ const x = roundByDPR(elements.floating, data.x);
20170
+ const y = roundByDPR(elements.floating, data.y);
20171
+ if (transform) {
20172
+ return {
20173
+ ...initialStyles,
20174
+ transform: "translate(" + x + "px, " + y + "px)",
20175
+ ...(getDPR(elements.floating) >= 1.5 && {
20176
+ willChange: 'transform'
20177
+ })
20178
+ };
20179
+ }
20180
+ return {
20181
+ position: strategy,
20182
+ left: x,
20183
+ top: y
20184
+ };
20185
+ }, [strategy, transform, elements.floating, data.x, data.y]);
20186
+ return e.useMemo(() => ({
20187
+ ...data,
20188
+ update,
20189
+ refs,
20190
+ elements,
20191
+ floatingStyles
20192
+ }), [data, update, refs, elements, floatingStyles]);
20193
+ }
20194
+
20195
+ /**
20196
+ * Modifies the placement by translating the floating element along the
20197
+ * specified axes.
20198
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
20199
+ * object may be passed.
20200
+ * @see https://floating-ui.com/docs/offset
20201
+ */
20202
+ const offset$4 = (options, deps) => ({
20203
+ ...offset$5(options),
20204
+ options: [options, deps]
20205
+ });
20206
+
20207
+ /**
20208
+ * Optimizes the visibility of the floating element by shifting it in order to
20209
+ * keep it in view when it will overflow the clipping boundary.
20210
+ * @see https://floating-ui.com/docs/shift
20211
+ */
20212
+ const shift$2 = (options, deps) => ({
20213
+ ...shift$3(options),
20214
+ options: [options, deps]
20215
+ });
20216
+
20217
+ /**
20218
+ * Optimizes the visibility of the floating element by flipping the `placement`
20219
+ * in order to keep it in view when the preferred placement(s) will overflow the
20220
+ * clipping boundary. Alternative to `autoPlacement`.
20221
+ * @see https://floating-ui.com/docs/flip
20222
+ */
20223
+ const flip$4 = (options, deps) => ({
20224
+ ...flip$5(options),
20225
+ options: [options, deps]
20226
+ });
20227
+
20228
+ const useClickOutside = (ref, handler) => {
20229
+ useEffect(() => {
20230
+ const listener = (e) => {
20231
+ if (!ref.current || ref.current.contains(e.target)) {
20232
+ return;
20233
+ }
20234
+ handler(e);
20235
+ };
20236
+ document.addEventListener('mousedown', listener);
20237
+ document.addEventListener('touchstart', listener);
20238
+ return () => {
20239
+ document.removeEventListener('mousedown', listener);
20240
+ document.removeEventListener('touchstart', listener);
20241
+ };
20242
+ }, [ref, handler]);
20243
+ };
20244
+
20245
+ function Popper({ children, referenceElement, isOpen, onClose, ariaLabel, placement = 'bottom-start', offsetValue = 5, }) {
20246
+ const popperContentRef = useRef();
20247
+ const { x, y, strategy, refs } = useFloating({
20248
+ placement,
20249
+ middleware: [offset$4(offsetValue), flip$4(), shift$2()],
20250
+ elements: {
20251
+ reference: referenceElement,
20252
+ },
20253
+ });
20254
+ useClickOutside(popperContentRef, onClose);
20255
+ if (!isOpen) {
20256
+ return null;
20257
+ }
20258
+ return (jsx("div", { ref: refs.setFloating, style: {
20259
+ position: strategy,
20260
+ top: y !== null && y !== void 0 ? y : '',
20261
+ left: x !== null && x !== void 0 ? x : '',
20262
+ }, role: "dialog", "aria-label": ariaLabel, className: "popper-container", children: jsx("div", { ref: popperContentRef, className: "popper-content", children: children }) }));
20263
+ }
20264
+
20265
+ function Menu({ children }) {
20266
+ return (jsx("div", { className: "menu", children: e__default.Children.map(children, (child) => e__default.isValidElement(child)
20267
+ ? e__default.cloneElement(child, {
20268
+ className: y$1(child.props.className, 'menu-item'),
20269
+ })
20270
+ : child) }));
20271
+ }
20272
+
18710
20273
  const StyledAccordion = styled.details `
18711
20274
  summary {
18712
20275
  display: inherit;
@@ -22699,10 +24262,6 @@ const defaults = css$1 `
22699
24262
  font-family: ${typography.fontFamily.base};
22700
24263
 
22701
24264
  padding: 0 1em !important;
22702
-
22703
- & + button {
22704
- margin-left: 14px;
22705
- }
22706
24265
  `;
22707
24266
  const sizeLarge = css$1 `
22708
24267
  height: ${largeHeight};
@@ -41075,5 +42634,5 @@ const Tooltip = (props) => {
41075
42634
  openOnClick: props.clickToShow, id: props.for, delayShow: props.delayShow, delayHide: props.delayHide, children: props.children })] }));
41076
42635
  };
41077
42636
 
41078
- export { animation as ANIMATION, Radio$1 as AbstractRadio, RadioGroup$1 as AbstractRadioGroup, Accordion, breakpoints as BREAKPOINT, BarSpinner, BorderSelect, Button$2 as Button, allColors as COLORS, Card, Checkbox, CirclePulse, CircleSpinner, Col, ConfirmModal, Container, DatePicker, EditableInput, Form, GlobalStyles, Icon, IconButton, LabeledInput as Input, Button$1 as LegacyButton, ListTable, LoadingAwareContainer, LoadingList, margin as MARGINS, MATH, mediaQueries as MEDIA_QUERIES, ModalBase, MultiCombobox, NoInputDatePicker, NumberInput, padding as PADDINGS, Pagination, LabeledPasswordInput as PasswordInput, PercentageRing, Radio, RadioGroup, Radio$2 as RadioInput, RandomLoadingMessage, Row$1 as Row, spacings as SPACING, SearchInput, Section, SectionBlock, SectionBody, SectionHeader, SectionTable, Select, Select$1 as SelectInput, Shrug, SingleCombobox, Skeleton, typography as TYPOGRAPHY, Table$1 as Table, TextInput, TextTruncate, LabeledTextarea as Textarea, Toggle, Toggle$1 as ToggleInput, Tooltip, color as colorUtils, number as numberUtils, string as stringUtils };
42637
+ export { animation as ANIMATION, Radio$1 as AbstractRadio, RadioGroup$1 as AbstractRadioGroup, Accordion, breakpoints as BREAKPOINT, BarSpinner, BorderSelect, Button$2 as Button, allColors as COLORS, Card, Checkbox, CirclePulse, CircleSpinner, Col, ConfirmModal, Container, DatePicker, EditableInput, Form, GlobalStyles, Icon, IconButton, LabeledInput as Input, Button$1 as LegacyButton, ListTable, LoadingAwareContainer, LoadingList, margin as MARGINS, MATH, mediaQueries as MEDIA_QUERIES, Menu, ModalBase, MultiCombobox, NoInputDatePicker, NumberInput, padding as PADDINGS, Pagination, LabeledPasswordInput as PasswordInput, PercentageRing, Popper, Radio, RadioGroup, Radio$2 as RadioInput, RandomLoadingMessage, Row$1 as Row, spacings as SPACING, SearchInput, Section, SectionBlock, SectionBody, SectionHeader, SectionTable, Select, Select$1 as SelectInput, Shrug, SingleCombobox, Skeleton, typography as TYPOGRAPHY, Table$1 as Table, TextInput, TextTruncate, LabeledTextarea as Textarea, Toggle, Toggle$1 as ToggleInput, Tooltip, color as colorUtils, number as numberUtils, string as stringUtils };
41079
42638
  //# sourceMappingURL=index.esm.js.map