@ultraviolet/ui 1.28.0 → 1.29.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 (111) hide show
  1. package/README.md +14 -7
  2. package/dist/index.d.ts +51 -2
  3. package/dist/src/components/ActionBar/index.js +22 -37
  4. package/dist/src/components/Alert/index.js +27 -41
  5. package/dist/src/components/Avatar/index.js +48 -69
  6. package/dist/src/components/Badge/index.js +29 -49
  7. package/dist/src/components/Banner/index.js +42 -62
  8. package/dist/src/components/BarChart/Tooltip.js +35 -50
  9. package/dist/src/components/BarChart/index.js +13 -14
  10. package/dist/src/components/BarStack/index.js +100 -191
  11. package/dist/src/components/Breadcrumbs/index.js +29 -39
  12. package/dist/src/components/Bullet/index.js +42 -55
  13. package/dist/src/components/Button/index.js +73 -99
  14. package/dist/src/components/Card/index.js +39 -57
  15. package/dist/src/components/Carousel/index.js +32 -60
  16. package/dist/src/components/Checkbox/index.js +153 -341
  17. package/dist/src/components/CheckboxGroup/index.js +25 -27
  18. package/dist/src/components/CopyButton/index.js +11 -12
  19. package/dist/src/components/DateInput/index.js +141 -268
  20. package/dist/src/components/EmptyState/index.js +68 -83
  21. package/dist/src/components/Expandable/index.js +13 -20
  22. package/dist/src/components/GlobalAlert/GlobalAlertLink.js +12 -13
  23. package/dist/src/components/GlobalAlert/index.js +19 -32
  24. package/dist/src/components/LineChart/CustomLegend.js +80 -89
  25. package/dist/src/components/LineChart/Tooltip.js +32 -47
  26. package/dist/src/components/LineChart/helpers.js +15 -50
  27. package/dist/src/components/LineChart/index.js +23 -33
  28. package/dist/src/components/Link/index.js +46 -65
  29. package/dist/src/components/List/Body.js +9 -15
  30. package/dist/src/components/List/Cell.js +6 -7
  31. package/dist/src/components/List/HeaderCell.js +28 -56
  32. package/dist/src/components/List/HeaderRow.js +9 -16
  33. package/dist/src/components/List/ListContext.js +5 -6
  34. package/dist/src/components/List/Row.js +44 -90
  35. package/dist/src/components/List/SelectBar.js +9 -13
  36. package/dist/src/components/List/SkeletonRows.js +5 -6
  37. package/dist/src/components/List/index.js +15 -25
  38. package/dist/src/components/Loader/index.js +18 -25
  39. package/dist/src/components/Menu/Item.js +39 -49
  40. package/dist/src/components/Menu/index.js +31 -56
  41. package/dist/src/components/MenuV2/Item.js +39 -49
  42. package/dist/src/components/MenuV2/index.js +28 -47
  43. package/dist/src/components/Meter/index.js +25 -47
  44. package/dist/src/components/Modal/Dialog.js +33 -58
  45. package/dist/src/components/Modal/Disclosure.js +8 -9
  46. package/dist/src/components/Modal/index.js +26 -33
  47. package/dist/src/components/Notice/index.js +21 -27
  48. package/dist/src/components/NumberInput/index.js +73 -137
  49. package/dist/src/components/Pagination/getPageNumbers.js +1 -4
  50. package/dist/src/components/Pagination/index.js +17 -27
  51. package/dist/src/components/PasswordCheck/index.js +26 -32
  52. package/dist/src/components/PasswordStrengthMeter/index.js +25 -44
  53. package/dist/src/components/PieChart/Legends.js +71 -107
  54. package/dist/src/components/PieChart/Tooltip.js +33 -36
  55. package/dist/src/components/PieChart/index.js +13 -17
  56. package/dist/src/components/Popover/index.js +58 -75
  57. package/dist/src/components/Popup/helpers.js +13 -15
  58. package/dist/src/components/Popup/index.js +55 -98
  59. package/dist/src/components/ProgressBar/index.js +31 -49
  60. package/dist/src/components/Radio/index.js +58 -113
  61. package/dist/src/components/RadioGroup/index.js +26 -28
  62. package/dist/src/components/Row/index.js +25 -31
  63. package/dist/src/components/SelectInput/index.js +357 -410
  64. package/dist/src/components/SelectableCard/index.js +73 -115
  65. package/dist/src/components/Separator/index.js +52 -73
  66. package/dist/src/components/Skeleton/Block.js +23 -41
  67. package/dist/src/components/Skeleton/Blocks.js +23 -41
  68. package/dist/src/components/Skeleton/BoxWithIcon.js +21 -36
  69. package/dist/src/components/Skeleton/Donut.js +3 -6
  70. package/dist/src/components/Skeleton/IconSkeleton.js +13 -31
  71. package/dist/src/components/Skeleton/Line.js +5 -11
  72. package/dist/src/components/Skeleton/List.js +22 -31
  73. package/dist/src/components/Skeleton/Slider.js +25 -46
  74. package/dist/src/components/Skeleton/Square.js +3 -6
  75. package/dist/src/components/Skeleton/index.js +17 -33
  76. package/dist/src/components/Snippet/index.js +82 -137
  77. package/dist/src/components/Stack/index.js +11 -14
  78. package/dist/src/components/Status/index.js +48 -78
  79. package/dist/src/components/StepList/index.js +45 -63
  80. package/dist/src/components/Stepper/index.js +74 -129
  81. package/dist/src/components/SwitchButton/FocusOverlay.js +13 -23
  82. package/dist/src/components/SwitchButton/index.js +36 -62
  83. package/dist/src/components/Table/Body.js +5 -8
  84. package/dist/src/components/Table/Cell.js +14 -20
  85. package/dist/src/components/Table/Header.js +8 -14
  86. package/dist/src/components/Table/HeaderCell.js +40 -56
  87. package/dist/src/components/Table/HeaderRow.js +4 -5
  88. package/dist/src/components/Table/Row.js +10 -14
  89. package/dist/src/components/Table/SelectBar.js +9 -13
  90. package/dist/src/components/Table/SkeletonRows.js +5 -6
  91. package/dist/src/components/Table/TableContext.js +6 -7
  92. package/dist/src/components/Table/index.js +44 -50
  93. package/dist/src/components/Tabs/Tab.js +57 -118
  94. package/dist/src/components/Tabs/TabMenu.js +32 -38
  95. package/dist/src/components/Tabs/TabMenuItem.js +9 -13
  96. package/dist/src/components/Tabs/index.js +24 -43
  97. package/dist/src/components/Tag/index.js +57 -74
  98. package/dist/src/components/TagInput/index.js +63 -94
  99. package/dist/src/components/TagList/index.js +22 -35
  100. package/dist/src/components/Text/index.js +29 -31
  101. package/dist/src/components/TextArea/index.js +240 -0
  102. package/dist/src/components/TextInput/index.js +166 -260
  103. package/dist/src/components/TimeInput/index.js +10 -13
  104. package/dist/src/components/Toaster/index.js +51 -67
  105. package/dist/src/components/Toggle/index.js +62 -129
  106. package/dist/src/components/ToggleGroup/index.js +21 -23
  107. package/dist/src/components/Tooltip/index.js +28 -31
  108. package/dist/src/components/VerificationCode/index.js +55 -90
  109. package/dist/src/index.js +1 -0
  110. package/dist/src/utils/ids.js +1 -6
  111. package/package.json +3 -3
@@ -29,41 +29,23 @@ const List = /*#__PURE__*/_styled("ul", {
29
29
  });
30
30
  const ListItem = /*#__PURE__*/_styled("li", {
31
31
  target: "e12qyakg7"
32
- })("display:flex;align-items:center;margin-top:", _ref => {
33
- let {
34
- theme
35
- } = _ref;
36
- return theme.space['1'];
37
- }, ";width:100%;color:", _ref2 => {
38
- let {
39
- isFocused,
40
- theme
41
- } = _ref2;
42
- return isFocused ? theme.colors.primary.text : theme.colors.neutral.text;
43
- }, ";");
32
+ })("display:flex;align-items:center;margin-top:", ({
33
+ theme
34
+ }) => theme.space['1'], ";width:100%;color:", ({
35
+ isFocused,
36
+ theme
37
+ }) => isFocused ? theme.colors.primary.text : theme.colors.neutral.text, ";");
44
38
  const Bullet = /*#__PURE__*/_styled("div", {
45
39
  target: "e12qyakg6"
46
- })("display:inline-block;border-radius:", _ref3 => {
47
- let {
48
- theme
49
- } = _ref3;
50
- return theme.radii.circle;
51
- }, ";width:10px;height:10px;margin:0 ", _ref4 => {
52
- let {
53
- theme
54
- } = _ref4;
55
- return theme.space['1'];
56
- }, ";background:", _ref5 => {
57
- let {
58
- color
59
- } = _ref5;
60
- return color;
61
- }, ";", _ref6 => {
62
- let {
63
- isFocused
64
- } = _ref6;
65
- return animationFlash(isFocused);
66
- }, ";");
40
+ })("display:inline-block;border-radius:", ({
41
+ theme
42
+ }) => theme.radii.circle, ";width:10px;height:10px;margin:0 ", ({
43
+ theme
44
+ }) => theme.space['1'], ";background:", ({
45
+ color
46
+ }) => color, ";", ({
47
+ isFocused
48
+ }) => animationFlash(isFocused), ";");
67
49
  const Label = /*#__PURE__*/_styled("div", {
68
50
  target: "e12qyakg5"
69
51
  })(process.env.NODE_ENV === "production" ? {
@@ -76,20 +58,14 @@ const Label = /*#__PURE__*/_styled("div", {
76
58
  });
77
59
  const Value = /*#__PURE__*/_styled("div", {
78
60
  target: "e12qyakg4"
79
- })("margin-left:6px;font-weight:", _ref7 => {
80
- let {
81
- isFocused
82
- } = _ref7;
83
- return isFocused ? 500 : 400;
84
- }, ";");
61
+ })("margin-left:6px;font-weight:", ({
62
+ isFocused
63
+ }) => isFocused ? 500 : 400, ";");
85
64
  const Text = /*#__PURE__*/_styled("span", {
86
65
  target: "e12qyakg3"
87
- })("flex:none;margin-right:6px;font-weight:", _ref8 => {
88
- let {
89
- isFocused
90
- } = _ref8;
91
- return isFocused ? 500 : 400;
92
- }, ";");
66
+ })("flex:none;margin-right:6px;font-weight:", ({
67
+ isFocused
68
+ }) => isFocused ? 500 : 400, ";");
93
69
  const ToggleBox = /*#__PURE__*/_styled("div", {
94
70
  target: "e12qyakg2"
95
71
  })(process.env.NODE_ENV === "production" ? {
@@ -102,73 +78,61 @@ const ToggleBox = /*#__PURE__*/_styled("div", {
102
78
  });
103
79
  const Line = /*#__PURE__*/_styled("span", {
104
80
  target: "e12qyakg1"
105
- })("border-bottom:1px solid ", _ref9 => {
106
- let {
107
- theme
108
- } = _ref9;
109
- return theme.colors.neutral.border;
110
- }, ";position:relative;width:100%;");
81
+ })("border-bottom:1px solid ", ({
82
+ theme
83
+ }) => theme.colors.neutral.border, ";position:relative;width:100%;");
111
84
  const ProgressiveLine = /*#__PURE__*/_styled("span", {
112
85
  target: "e12qyakg0"
113
- })("border-bottom:1px solid ", _ref10 => {
114
- let {
115
- theme
116
- } = _ref10;
117
- return theme.colors.primary.border;
118
- }, ";position:absolute;left:0;top:0;bottom:-1px;transition:width 500ms ease;width:", _ref11 => {
119
- let {
120
- isFocused
121
- } = _ref11;
122
- return isFocused ? 100 : 0;
123
- }, "%;");
124
- const Legends = _ref12 => {
125
- let {
126
- focused,
127
- data,
128
- onFocusChange,
129
- colors
130
- } = _ref12;
131
- return jsx(List, {
132
- children: data?.map((item, index) => {
133
- const isSegmentFocused = focused !== undefined && item.id === focused;
134
- const id = `chart-legend-${item.id}`;
135
- return jsx(Tooltip, {
136
- visible: isSegmentFocused,
137
- id: id,
138
- text: jsx(TooltipContainer, {
139
- data: item
140
- }),
141
- children: jsxs(ListItem, {
86
+ })("border-bottom:1px solid ", ({
87
+ theme
88
+ }) => theme.colors.primary.border, ";position:absolute;left:0;top:0;bottom:-1px;transition:width 500ms ease;width:", ({
89
+ isFocused
90
+ }) => isFocused ? 100 : 0, "%;");
91
+ const Legends = ({
92
+ focused,
93
+ data,
94
+ onFocusChange,
95
+ colors
96
+ }) => jsx(List, {
97
+ children: data?.map((item, index) => {
98
+ const isSegmentFocused = focused !== undefined && item.id === focused;
99
+ const id = `chart-legend-${item.id}`;
100
+ return jsx(Tooltip, {
101
+ visible: isSegmentFocused,
102
+ id: id,
103
+ text: jsx(TooltipContainer, {
104
+ data: item
105
+ }),
106
+ children: jsxs(ListItem, {
107
+ isFocused: isSegmentFocused,
108
+ children: [jsx(ToggleBox, {
109
+ "data-testid": id,
110
+ onMouseOver: () => onFocusChange(item.id),
111
+ onFocus: () => onFocusChange(item.id),
112
+ onMouseOut: () => onFocusChange(),
113
+ onBlur: () => onFocusChange()
114
+ }), jsx(Bullet, {
115
+ color: colors[index],
142
116
  isFocused: isSegmentFocused,
143
- children: [jsx(ToggleBox, {
144
- "data-testid": id,
145
- onMouseOver: () => onFocusChange(item.id),
146
- onFocus: () => onFocusChange(item.id),
147
- onMouseOut: () => onFocusChange(),
148
- onBlur: () => onFocusChange()
149
- }), jsx(Bullet, {
150
- color: colors[index],
117
+ needPattern: item.needPattern,
118
+ id: `chart-legend-${item.id}`
119
+ }), jsxs(Label, {
120
+ children: [jsx(Text, {
151
121
  isFocused: isSegmentFocused,
152
- needPattern: item.needPattern,
153
- id: `chart-legend-${item.id}`
154
- }), jsxs(Label, {
155
- children: [jsx(Text, {
156
- isFocused: isSegmentFocused,
157
- children: item.name
158
- }), jsx(Line, {
159
- children: jsx(ProgressiveLine, {
160
- isFocused: isSegmentFocused
161
- })
162
- })]
163
- }), jsx(Value, {
164
- isFocused: isSegmentFocused,
165
- children: item.value
122
+ children: item.name
123
+ }), jsx(Line, {
124
+ children: jsx(ProgressiveLine, {
125
+ isFocused: isSegmentFocused
126
+ })
166
127
  })]
167
- })
168
- }, item.id);
169
- })
170
- });
171
- };
128
+ }), jsx(Value, {
129
+ isFocused: isSegmentFocused,
130
+ children: item.value
131
+ })]
132
+ })
133
+ }, item.id);
134
+ })
135
+ });
172
136
  var Legends$1 = Legends;
173
137
 
174
138
  export { Legends$1 as default };
@@ -23,42 +23,39 @@ const StyledItem = /*#__PURE__*/_styled("li", {
23
23
  styles: "display:flex;margin-top:6px;width:100%;justify-content:space-between;text-align:left;gap:8px",
24
24
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
25
25
  });
26
- const Tooltip = _ref => {
27
- let {
28
- data
29
- } = _ref;
30
- return jsx("div", {
31
- tabIndex: -1,
32
- role: "tooltip",
33
- children: jsxs(StyledList, {
34
- children: [jsxs(StyledItem, {
35
- children: [jsx(Text, {
36
- as: "p",
37
- variant: "body",
38
- prominence: "stronger",
39
- children: data.name
40
- }), jsx(Text, {
41
- as: "p",
42
- variant: "body",
43
- prominence: "stronger",
44
- children: data.value
45
- })]
46
- }), data.details?.map(detail => jsxs(StyledItem, {
47
- children: [jsx(Text, {
48
- as: "p",
49
- variant: "bodySmall",
50
- prominence: "stronger",
51
- children: detail.name
52
- }), jsx(Text, {
53
- as: "p",
54
- variant: "bodySmall",
55
- prominence: "stronger",
56
- children: detail.value
57
- })]
58
- }, detail.name))]
59
- })
60
- });
61
- };
26
+ const Tooltip = ({
27
+ data
28
+ }) => jsx("div", {
29
+ tabIndex: -1,
30
+ role: "tooltip",
31
+ children: jsxs(StyledList, {
32
+ children: [jsxs(StyledItem, {
33
+ children: [jsx(Text, {
34
+ as: "p",
35
+ variant: "body",
36
+ prominence: "stronger",
37
+ children: data.name
38
+ }), jsx(Text, {
39
+ as: "p",
40
+ variant: "body",
41
+ prominence: "stronger",
42
+ children: data.value
43
+ })]
44
+ }), data.details?.map(detail => jsxs(StyledItem, {
45
+ children: [jsx(Text, {
46
+ as: "p",
47
+ variant: "bodySmall",
48
+ prominence: "stronger",
49
+ children: detail.name
50
+ }), jsx(Text, {
51
+ as: "p",
52
+ variant: "bodySmall",
53
+ prominence: "stronger",
54
+ children: detail.value
55
+ })]
56
+ }, detail.name))]
57
+ })
58
+ });
62
59
  var TooltipContainer = Tooltip;
63
60
 
64
61
  export { TooltipContainer as default };
@@ -10,12 +10,9 @@ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
10
10
  function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
11
11
  const Container = /*#__PURE__*/_styled("div", {
12
12
  target: "epjfe5p2"
13
- })("display:flex;align-items:center;height:", _ref => {
14
- let {
15
- height
16
- } = _ref;
17
- return `${height}px`;
18
- }, ";");
13
+ })("display:flex;align-items:center;height:", ({
14
+ height
15
+ }) => `${height}px`, ";");
19
16
  const EmptyLegend = /*#__PURE__*/_styled("div", {
20
17
  target: "epjfe5p1"
21
18
  })(process.env.NODE_ENV === "production" ? {
@@ -49,17 +46,16 @@ const DEFAULT_MARGIN = {
49
46
  * See https://nivo.rocks/pie/ for more information.
50
47
  * @experimental This component is experimental and may be subject to breaking changes in the future.
51
48
  */
52
- const PieChart = _ref2 => {
53
- let {
54
- height = 206,
55
- width = 206,
56
- data = undefined,
57
- emptyLegend,
58
- content,
59
- withLegend = false,
60
- margin = DEFAULT_MARGIN,
61
- chartProps = DEFAULT_CHARTPROPS
62
- } = _ref2;
49
+ const PieChart = ({
50
+ height = 206,
51
+ width = 206,
52
+ data = undefined,
53
+ emptyLegend,
54
+ content,
55
+ withLegend = false,
56
+ margin = DEFAULT_MARGIN,
57
+ chartProps = DEFAULT_CHARTPROPS
58
+ }) => {
63
59
  const theme = useTheme();
64
60
  const [currentFocusIndex, setCurrentFocusIndex] = useState();
65
61
  const emptyTooltip = useCallback(() => jsx("span", {}), []);
@@ -14,26 +14,16 @@ const SIZES_WIDTH = {
14
14
  const StyledPopup = /*#__PURE__*/_styled(Popup, {
15
15
  shouldForwardProp: prop => !['sentiment', 'size'].includes(prop),
16
16
  target: "ejpxv5a1"
17
- })("padding:", _ref => {
18
- let {
19
- theme
20
- } = _ref;
21
- return theme.space['2'];
22
- }, ";width:", _ref2 => {
23
- let {
24
- size
25
- } = _ref2;
26
- return SIZES_WIDTH[size];
27
- }, "px;max-width:", _ref3 => {
28
- let {
29
- size
30
- } = _ref3;
31
- return SIZES_WIDTH[size];
32
- }, "px;text-align:initial;", _ref4 => {
33
- let {
34
- theme,
35
- sentiment
36
- } = _ref4;
17
+ })("padding:", ({
18
+ theme
19
+ }) => theme.space['2'], ";width:", ({
20
+ size
21
+ }) => SIZES_WIDTH[size], "px;max-width:", ({
22
+ size
23
+ }) => SIZES_WIDTH[size], "px;text-align:initial;", ({
24
+ theme,
25
+ sentiment
26
+ }) => {
37
27
  if (sentiment === 'neutral') {
38
28
  return `
39
29
  background: ${theme.colors.neutral.background};
@@ -59,67 +49,60 @@ const StyledPopup = /*#__PURE__*/_styled(Popup, {
59
49
  // This is to avoid having text inherit color from popup (which is white on white background)
60
50
  const StyledStack = /*#__PURE__*/_styled(Stack, {
61
51
  target: "ejpxv5a0"
62
- })("color:", _ref5 => {
63
- let {
64
- theme
65
- } = _ref5;
66
- return theme.colors.neutral.text;
67
- }, ";");
68
- const ContentWrapper = _ref6 => {
69
- let {
70
- title,
71
- onClose,
72
- children,
73
- sentiment
74
- } = _ref6;
75
- return jsxs(StyledStack, {
76
- gap: 1,
77
- children: [jsxs(Stack, {
78
- direction: "row",
79
- justifyContent: "space-between",
80
- children: [jsx(Text, {
81
- variant: "bodyStrong",
82
- as: "h3",
83
- sentiment: "neutral",
84
- prominence: sentiment === 'neutral' ? 'strong' : 'stronger',
85
- children: title
86
- }), jsx(Button, {
87
- variant: sentiment === 'neutral' ? 'ghost' : 'filled',
88
- sentiment: sentiment === 'neutral' ? 'neutral' : 'primary',
89
- onClick: onClose,
90
- size: "small",
91
- icon: "close",
92
- "aria-label": "close"
93
- })]
94
- }), typeof children === 'string' ? jsx(Text, {
95
- variant: "bodySmall",
96
- as: "p",
52
+ })("color:", ({
53
+ theme
54
+ }) => theme.colors.neutral.text, ";");
55
+ const ContentWrapper = ({
56
+ title,
57
+ onClose,
58
+ children,
59
+ sentiment
60
+ }) => jsxs(StyledStack, {
61
+ gap: 1,
62
+ children: [jsxs(Stack, {
63
+ direction: "row",
64
+ justifyContent: "space-between",
65
+ children: [jsx(Text, {
66
+ variant: "bodyStrong",
67
+ as: "h3",
97
68
  sentiment: "neutral",
98
69
  prominence: sentiment === 'neutral' ? 'strong' : 'stronger',
99
- children: children
100
- }) : children]
101
- });
102
- };
70
+ children: title
71
+ }), jsx(Button, {
72
+ variant: sentiment === 'neutral' ? 'ghost' : 'filled',
73
+ sentiment: sentiment === 'neutral' ? 'neutral' : 'primary',
74
+ onClick: onClose,
75
+ size: "small",
76
+ icon: "close",
77
+ "aria-label": "close"
78
+ })]
79
+ }), typeof children === 'string' ? jsx(Text, {
80
+ variant: "bodySmall",
81
+ as: "p",
82
+ sentiment: "neutral",
83
+ prominence: sentiment === 'neutral' ? 'strong' : 'stronger',
84
+ children: children
85
+ }) : children]
86
+ });
103
87
  /**
104
88
  * Popover component is used to display additional information or actions on top of the main content of the page.
105
89
  * It is usually triggered by clicking on a button. It includes a title, a close button and a content area.
106
90
  */
107
- const Popover = /*#__PURE__*/forwardRef((_ref7, ref) => {
108
- let {
109
- visible = false,
110
- children,
111
- placement,
112
- content,
113
- title,
114
- sentiment = 'neutral',
115
- size = 'medium',
116
- onClose,
117
- className,
118
- maxWidth,
119
- maxHeight,
120
- 'data-testid': dataTestId,
121
- portalTarget
122
- } = _ref7;
91
+ const Popover = /*#__PURE__*/forwardRef(({
92
+ visible = false,
93
+ children,
94
+ placement,
95
+ content,
96
+ title,
97
+ sentiment = 'neutral',
98
+ size = 'medium',
99
+ onClose,
100
+ className,
101
+ maxWidth,
102
+ maxHeight,
103
+ 'data-testid': dataTestId,
104
+ portalTarget
105
+ }, ref) => {
123
106
  const innerRef = useRef(null);
124
107
  const [localVisible, setLocalVisible] = useState(visible);
125
108
 
@@ -13,14 +13,13 @@ const DEFAULT_POSITIONS = {
13
13
  /**
14
14
  * This function will find the best placement in a window for popup based on children position and popup size
15
15
  */
16
- const computePlacement = _ref => {
17
- let {
18
- childrenStructuredRef,
19
- popupStructuredRef,
20
- offsetParentRect,
21
- offsetParent,
22
- popupPortalTarget
23
- } = _ref;
16
+ const computePlacement = ({
17
+ childrenStructuredRef,
18
+ popupStructuredRef,
19
+ offsetParentRect,
20
+ offsetParent,
21
+ popupPortalTarget
22
+ }) => {
24
23
  const {
25
24
  top: childrenTop,
26
25
  left: childrenLeft,
@@ -82,13 +81,12 @@ const findOffsetParent = element => {
82
81
  /**
83
82
  * This function will compute the positions of popup and arrow based on children position and popup size
84
83
  */
85
- const computePositions = _ref2 => {
86
- let {
87
- placement,
88
- childrenRef,
89
- popupRef,
90
- popupPortalTarget
91
- } = _ref2;
84
+ const computePositions = ({
85
+ placement,
86
+ childrenRef,
87
+ popupRef,
88
+ popupPortalTarget
89
+ }) => {
92
90
  const childrenRect = childrenRef.current.getBoundingClientRect();
93
91
  const offsetParent = findOffsetParent(childrenRef);
94
92
  const offsetParentRect = offsetParent?.getBoundingClientRect() ?? {