baseui 10.7.4 → 10.9.1

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 (164) hide show
  1. package/a11y/a11y.js +2 -2
  2. package/a11y/a11y.js.flow +3 -3
  3. package/button/styled-components.js +47 -18
  4. package/button/styled-components.js.flow +25 -5
  5. package/combobox/combobox.js +6 -3
  6. package/combobox/combobox.js.flow +4 -2
  7. package/combobox/types.js.flow +2 -0
  8. package/data-table/column-categorical.js +1 -1
  9. package/data-table/column-categorical.js.flow +2 -2
  10. package/data-table/column-numerical.js +1 -1
  11. package/data-table/column-numerical.js.flow +3 -3
  12. package/datepicker/styled-components.js +1 -1
  13. package/datepicker/styled-components.js.flow +4 -1
  14. package/drawer/drawer.js +3 -1
  15. package/drawer/drawer.js.flow +7 -1
  16. package/es/a11y/a11y.js +2 -2
  17. package/es/button/styled-components.js +32 -2
  18. package/es/combobox/combobox.js +6 -3
  19. package/es/data-table/column-categorical.js +2 -2
  20. package/es/data-table/column-numerical.js +2 -2
  21. package/es/datepicker/styled-components.js +1 -1
  22. package/es/drawer/drawer.js +3 -1
  23. package/es/form-control/form-control.js +58 -7
  24. package/es/form-control/styled-components.js +27 -6
  25. package/es/index.js +1 -1
  26. package/es/map-marker/badge-enhancer.js +61 -0
  27. package/es/map-marker/constants.js +146 -2
  28. package/es/map-marker/drag-shadow.js +32 -0
  29. package/es/map-marker/fixed-marker.js +54 -48
  30. package/es/map-marker/floating-marker.js +21 -12
  31. package/es/map-marker/index.js +1 -1
  32. package/es/map-marker/label-enhancer.js +39 -0
  33. package/es/map-marker/needle.js +26 -0
  34. package/es/map-marker/pin-head.js +42 -40
  35. package/es/map-marker/styled-components.js +177 -32
  36. package/es/map-marker/types.js +1 -1
  37. package/es/menu/maybe-child-menu.js +0 -2
  38. package/es/menu/nested-menus.js +49 -3
  39. package/es/menu/stateful-container.js +13 -12
  40. package/es/modal/modal.js +3 -1
  41. package/es/popover/popover.js +4 -2
  42. package/es/progress-bar/index.js +1 -1
  43. package/es/progress-bar/progressbar.js +25 -10
  44. package/es/progress-bar/styled-components.js +9 -5
  45. package/es/select/select-component.js +2 -10
  46. package/es/spinner/styled-components.js +34 -16
  47. package/es/table/filter.js +3 -1
  48. package/es/themes/dark-theme/color-component-tokens.js +19 -10
  49. package/es/themes/light-theme/color-component-tokens.js +19 -10
  50. package/es/timezonepicker/timezone-picker.js +53 -36
  51. package/es/timezonepicker/tzdata.js +2 -0
  52. package/es/timezonepicker/update-tzdata.js +69 -0
  53. package/es/toast/styled-components.js +18 -7
  54. package/esm/a11y/a11y.js +3 -3
  55. package/esm/button/styled-components.js +47 -18
  56. package/esm/combobox/combobox.js +6 -3
  57. package/esm/data-table/column-categorical.js +2 -2
  58. package/esm/data-table/column-numerical.js +2 -2
  59. package/esm/datepicker/styled-components.js +1 -1
  60. package/esm/drawer/drawer.js +3 -1
  61. package/esm/form-control/form-control.js +60 -9
  62. package/esm/form-control/styled-components.js +23 -3
  63. package/esm/index.js +1 -1
  64. package/esm/map-marker/badge-enhancer.js +79 -0
  65. package/esm/map-marker/constants.js +94 -4
  66. package/esm/map-marker/drag-shadow.js +53 -0
  67. package/esm/map-marker/fixed-marker.js +84 -80
  68. package/esm/map-marker/floating-marker.js +22 -13
  69. package/esm/map-marker/index.js +1 -1
  70. package/esm/map-marker/label-enhancer.js +60 -0
  71. package/esm/map-marker/needle.js +43 -0
  72. package/esm/map-marker/pin-head.js +77 -66
  73. package/esm/map-marker/styled-components.js +182 -51
  74. package/esm/map-marker/types.js +1 -1
  75. package/esm/menu/maybe-child-menu.js +0 -2
  76. package/esm/menu/nested-menus.js +66 -5
  77. package/esm/menu/stateful-container.js +15 -13
  78. package/esm/modal/modal.js +3 -1
  79. package/esm/popover/popover.js +4 -2
  80. package/esm/progress-bar/index.js +1 -1
  81. package/esm/progress-bar/progressbar.js +32 -10
  82. package/esm/progress-bar/styled-components.js +9 -4
  83. package/esm/select/select-component.js +2 -11
  84. package/esm/spinner/styled-components.js +35 -16
  85. package/esm/table/filter.js +3 -1
  86. package/esm/themes/dark-theme/color-component-tokens.js +19 -10
  87. package/esm/themes/light-theme/color-component-tokens.js +19 -10
  88. package/esm/timezonepicker/timezone-picker.js +64 -36
  89. package/esm/timezonepicker/tzdata.js +2 -0
  90. package/esm/timezonepicker/update-tzdata.js +160 -0
  91. package/esm/toast/styled-components.js +13 -5
  92. package/form-control/form-control.js +61 -8
  93. package/form-control/form-control.js.flow +82 -10
  94. package/form-control/index.d.ts +1 -0
  95. package/form-control/styled-components.js +27 -5
  96. package/form-control/styled-components.js.flow +25 -3
  97. package/form-control/types.js.flow +20 -8
  98. package/index.js +6 -0
  99. package/index.js.flow +1 -1
  100. package/map-marker/badge-enhancer.js +90 -0
  101. package/map-marker/badge-enhancer.js.flow +86 -0
  102. package/map-marker/constants.js +103 -5
  103. package/map-marker/constants.js.flow +152 -0
  104. package/map-marker/drag-shadow.js +64 -0
  105. package/map-marker/drag-shadow.js.flow +52 -0
  106. package/map-marker/fixed-marker.js +84 -78
  107. package/map-marker/fixed-marker.js.flow +78 -66
  108. package/map-marker/floating-marker.js +22 -13
  109. package/map-marker/floating-marker.js.flow +30 -17
  110. package/map-marker/index.d.ts +125 -24
  111. package/map-marker/index.js +18 -0
  112. package/map-marker/index.js.flow +3 -0
  113. package/map-marker/label-enhancer.js +71 -0
  114. package/map-marker/label-enhancer.js.flow +63 -0
  115. package/map-marker/needle.js +54 -0
  116. package/map-marker/needle.js.flow +29 -0
  117. package/map-marker/pin-head.js +80 -69
  118. package/map-marker/pin-head.js.flow +122 -84
  119. package/map-marker/styled-components.js +200 -62
  120. package/map-marker/styled-components.js.flow +172 -22
  121. package/map-marker/types.js.flow +69 -20
  122. package/menu/index.d.ts +9 -4
  123. package/menu/maybe-child-menu.js +0 -2
  124. package/menu/maybe-child-menu.js.flow +0 -2
  125. package/menu/nested-menus.js +66 -5
  126. package/menu/nested-menus.js.flow +50 -5
  127. package/menu/stateful-container.js +15 -13
  128. package/menu/stateful-container.js.flow +19 -13
  129. package/menu/types.js.flow +7 -1
  130. package/modal/modal.js +3 -1
  131. package/modal/modal.js.flow +2 -0
  132. package/package.json +4 -4
  133. package/popover/popover.js +4 -2
  134. package/popover/popover.js.flow +3 -1
  135. package/progress-bar/index.d.ts +2 -0
  136. package/progress-bar/index.js +6 -0
  137. package/progress-bar/index.js.flow +1 -0
  138. package/progress-bar/progressbar.js +32 -10
  139. package/progress-bar/progressbar.js.flow +35 -9
  140. package/progress-bar/styled-components.js +9 -4
  141. package/progress-bar/styled-components.js.flow +15 -4
  142. package/progress-bar/types.js.flow +12 -2
  143. package/select/select-component.js +2 -11
  144. package/select/select-component.js.flow +5 -7
  145. package/spinner/styled-components.js +35 -16
  146. package/spinner/styled-components.js.flow +37 -19
  147. package/spinner/types.js.flow +10 -0
  148. package/styles/index.js.flow +1 -1
  149. package/table/filter.js +3 -1
  150. package/table/filter.js.flow +5 -1
  151. package/themes/dark-theme/color-component-tokens.js +19 -10
  152. package/themes/dark-theme/color-component-tokens.js.flow +19 -10
  153. package/themes/light-theme/color-component-tokens.js +19 -10
  154. package/themes/light-theme/color-component-tokens.js.flow +19 -10
  155. package/themes/types.js.flow +9 -0
  156. package/timezonepicker/timezone-picker.js +69 -41
  157. package/timezonepicker/timezone-picker.js.flow +52 -46
  158. package/timezonepicker/types.js.flow +1 -1
  159. package/timezonepicker/tzdata.js +10 -0
  160. package/timezonepicker/tzdata.js.flow +347 -0
  161. package/timezonepicker/update-tzdata.js +164 -0
  162. package/timezonepicker/update-tzdata.js.flow +70 -0
  163. package/toast/styled-components.js +13 -5
  164. package/toast/styled-components.js.flow +17 -7
@@ -11,13 +11,13 @@ This source code is licensed under the MIT license found in the
11
11
  LICENSE file in the root directory of this source tree.
12
12
  */
13
13
  import { styled } from '../styles/index.js';
14
- import { FLOATING_MARKER_ANCHOR_POSITIONS, xSmallPinheadDimension } from './constants.js';
14
+ import { BADGE_ENHANCER_STYLES, FLOATING_MARKER_ANCHOR_POSITIONS, LABEL_SIZES } from './constants.js';
15
15
  export var getAnchorTransform = function getAnchorTransform(anchor, anchorSize) {
16
16
  var _FLOATING_MARKER_ANCH;
17
17
 
18
18
  return (_FLOATING_MARKER_ANCH = {}, _defineProperty(_FLOATING_MARKER_ANCH, FLOATING_MARKER_ANCHOR_POSITIONS.none, ""), _defineProperty(_FLOATING_MARKER_ANCH, FLOATING_MARKER_ANCHOR_POSITIONS.topLeft, "translate(".concat(anchorSize, "px, ").concat(anchorSize, "px)")), _defineProperty(_FLOATING_MARKER_ANCH, FLOATING_MARKER_ANCHOR_POSITIONS.topRight, "translate(-100%, ".concat(anchorSize, "px)")), _defineProperty(_FLOATING_MARKER_ANCH, FLOATING_MARKER_ANCHOR_POSITIONS.bottomLeft, "translate(".concat(anchorSize, "px, -100%)")), _defineProperty(_FLOATING_MARKER_ANCH, FLOATING_MARKER_ANCHOR_POSITIONS.bottomRight, "translate(-100%, -100%)"), _FLOATING_MARKER_ANCH)[anchor];
19
19
  };
20
- export var DragShadowContainer = styled('div', function (_ref) {
20
+ export var StyledDragShadowContainer = styled('div', function (_ref) {
21
21
  var $theme = _ref.$theme,
22
22
  $height = _ref.$height,
23
23
  $width = _ref.$width,
@@ -32,86 +32,87 @@ export var DragShadowContainer = styled('div', function (_ref) {
32
32
  boxShadow: $theme.lighting.shadow600
33
33
  };
34
34
  });
35
- DragShadowContainer.displayName = "DragShadowContainer";
36
- export var DragShadow = styled('div', function (_ref2) {
35
+ StyledDragShadowContainer.displayName = "StyledDragShadowContainer";
36
+ export var StyledDragShadow = styled('div', function (_ref2) {
37
37
  var $theme = _ref2.$theme,
38
38
  $background = _ref2.$background,
39
39
  $width = _ref2.$width;
40
40
  return {
41
- background: $background,
41
+ backgroundColor: $background,
42
42
  borderRadius: '50%',
43
43
  width: "".concat($width, "px"),
44
- height: "".concat(4, "px"),
44
+ height: '4px',
45
45
  position: 'absolute',
46
46
  bottom: 0
47
47
  };
48
48
  });
49
- DragShadow.displayName = "DragShadow";
50
- export var Needle = styled('div', function (_ref3) {
49
+ StyledDragShadow.displayName = "StyledDragShadow";
50
+ export var StyledNeedle = styled('div', function (_ref3) {
51
51
  var $theme = _ref3.$theme,
52
52
  $background = _ref3.$background,
53
53
  $height = _ref3.$height;
54
54
  return {
55
- background: $background,
55
+ backgroundColor: $background,
56
56
  width: '4px',
57
57
  height: "".concat($height, "px"),
58
58
  boxShadow: $theme.lighting.shadow600
59
59
  };
60
60
  });
61
- Needle.displayName = "Needle";
62
- export var FloatingMarkerRoot = styled('div', function () {
61
+ StyledNeedle.displayName = "StyledNeedle";
62
+ export var StyledFloatingMarkerRoot = styled('div', function (_ref4) {
63
+ var $size = _ref4.$size;
63
64
  return {
64
65
  position: 'relative',
65
- height: "".concat(xSmallPinheadDimension.height, "px"),
66
- width: "".concat(xSmallPinheadDimension.height, "px")
66
+ height: "".concat($size, "px"),
67
+ width: "".concat($size, "px")
67
68
  };
68
69
  });
69
- FloatingMarkerRoot.displayName = "FloatingMarkerRoot";
70
- export var FloatingMarkerPinHeadContainer = styled('div', function (_ref4) {
71
- var $theme = _ref4.$theme,
72
- $anchor = _ref4.$anchor,
73
- $anchorSize = _ref4.$anchorSize;
70
+ StyledFloatingMarkerRoot.displayName = "StyledFloatingMarkerRoot";
71
+ export var StyledFloatingMarkerPinHeadContainer = styled('div', function (_ref5) {
72
+ var $theme = _ref5.$theme,
73
+ $anchor = _ref5.$anchor,
74
+ $anchorSize = _ref5.$anchorSize;
74
75
  return {
75
76
  position: 'absolute',
76
77
  transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all"),
77
78
  transform: getAnchorTransform($anchor, $anchorSize)
78
79
  };
79
80
  });
80
- FloatingMarkerPinHeadContainer.displayName = "FloatingMarkerPinHeadContainer";
81
- export var FloatingMarkerAnchorContainer = styled('div', function () {
81
+ StyledFloatingMarkerPinHeadContainer.displayName = "StyledFloatingMarkerPinHeadContainer";
82
+ export var StyledFloatingMarkerAnchorContainer = styled('div', function () {
82
83
  return {
83
84
  position: 'absolute'
84
85
  };
85
86
  });
86
- FloatingMarkerAnchorContainer.displayName = "FloatingMarkerAnchorContainer";
87
- export var FixedMarkerRoot = styled('div', function () {
87
+ StyledFloatingMarkerAnchorContainer.displayName = "StyledFloatingMarkerAnchorContainer";
88
+ export var StyledFixedMarkerRoot = styled('div', function () {
88
89
  return {
89
90
  display: 'flex',
90
91
  alignItems: 'center',
91
92
  flexDirection: 'column'
92
93
  };
93
94
  });
94
- FixedMarkerRoot.displayName = "FixedMarkerRoot";
95
- export var FixedMarkerDragContainer = styled('div', function (_ref5) {
96
- var $theme = _ref5.$theme,
97
- $translateAmount = _ref5.$translateAmount,
98
- $performTranslate = _ref5.$performTranslate;
95
+ StyledFixedMarkerRoot.displayName = "StyledFixedMarkerRoot";
96
+ export var StyledFixedMarkerDragContainer = styled('div', function (_ref6) {
97
+ var $theme = _ref6.$theme,
98
+ $translateAmount = _ref6.$translateAmount,
99
+ $performTranslate = _ref6.$performTranslate;
99
100
  return {
100
- transform: "translateY(".concat($performTranslate ? '0px' : "".concat($translateAmount, "px"), ")"),
101
+ transform: "translateY(".concat($performTranslate ? "".concat($translateAmount, "px") : '0px', ")"),
101
102
  transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all"),
102
103
  display: 'flex',
103
104
  alignItems: 'center',
104
105
  flexDirection: 'column'
105
106
  };
106
107
  });
107
- FixedMarkerDragContainer.displayName = "FixedMarkerDragContainer";
108
- export var OuterXSmallAnchor = styled('div', function (_ref6) {
109
- var $theme = _ref6.$theme,
110
- $round = _ref6.$round,
111
- $background = _ref6.$background,
112
- $size = _ref6.$size;
108
+ StyledFixedMarkerDragContainer.displayName = "StyledFixedMarkerDragContainer";
109
+ export var StyledOuterXXSmallAnchor = styled('div', function (_ref7) {
110
+ var $theme = _ref7.$theme,
111
+ $round = _ref7.$round,
112
+ $background = _ref7.$background,
113
+ $size = _ref7.$size;
113
114
  return {
114
- background: $background,
115
+ backgroundColor: $background,
115
116
  display: 'flex',
116
117
  alignItems: 'center',
117
118
  justifyContent: 'center',
@@ -121,26 +122,55 @@ export var OuterXSmallAnchor = styled('div', function (_ref6) {
121
122
  boxShadow: $theme.lighting.shadow600
122
123
  };
123
124
  });
124
- OuterXSmallAnchor.displayName = "OuterXSmallAnchor";
125
- export var InnerXSmallAnchor = styled('div', function (_ref7) {
126
- var $round = _ref7.$round,
127
- $color = _ref7.$color,
128
- $size = _ref7.$size;
125
+ StyledOuterXXSmallAnchor.displayName = "StyledOuterXXSmallAnchor";
126
+ export var StyledInnerXXSmallAnchor = styled('div', function (_ref8) {
127
+ var $round = _ref8.$round,
128
+ $color = _ref8.$color,
129
+ $size = _ref8.$size;
130
+ return {
131
+ backgroundColor: $color,
132
+ height: "".concat($size, "px"),
133
+ width: "".concat($size, "px"),
134
+ borderRadius: $round ? '50%' : 0
135
+ };
136
+ });
137
+ StyledInnerXXSmallAnchor.displayName = "StyledInnerXXSmallAnchor";
138
+ export var StyledOuterXSmallAnchor = styled('div', function (_ref9) {
139
+ var $theme = _ref9.$theme,
140
+ $round = _ref9.$round,
141
+ $background = _ref9.$background,
142
+ $size = _ref9.$size;
143
+ return {
144
+ backgroundColor: $background,
145
+ display: 'flex',
146
+ alignItems: 'center',
147
+ justifyContent: 'center',
148
+ height: "".concat($size, "px"),
149
+ width: "".concat($size, "px"),
150
+ borderRadius: $round ? '50%' : 0,
151
+ boxShadow: $theme.lighting.shadow600
152
+ };
153
+ });
154
+ StyledOuterXSmallAnchor.displayName = "StyledOuterXSmallAnchor";
155
+ export var StyledInnerXSmallAnchor = styled('div', function (_ref10) {
156
+ var $round = _ref10.$round,
157
+ $color = _ref10.$color,
158
+ $size = _ref10.$size;
129
159
  return {
130
- background: $color,
160
+ backgroundColor: $color,
131
161
  height: "".concat($size, "px"),
132
162
  width: "".concat($size, "px"),
133
163
  borderRadius: $round ? '50%' : 0
134
164
  };
135
165
  });
136
- InnerXSmallAnchor.displayName = "InnerXSmallAnchor";
137
- export var PinHead = styled('div', function (_ref8) {
138
- var $theme = _ref8.$theme,
139
- $height = _ref8.$height,
140
- $background = _ref8.$background,
141
- $gridTemplateColumns = _ref8.$gridTemplateColumns,
142
- $type = _ref8.$type,
143
- $forceCircle = _ref8.$forceCircle;
166
+ StyledInnerXSmallAnchor.displayName = "StyledInnerXSmallAnchor";
167
+ export var StyledPinHead = styled('div', function (_ref11) {
168
+ var $theme = _ref11.$theme,
169
+ $height = _ref11.$height,
170
+ $background = _ref11.$background,
171
+ $gridTemplateColumns = _ref11.$gridTemplateColumns,
172
+ $type = _ref11.$type,
173
+ $forceCircle = _ref11.$forceCircle;
144
174
  var sharedStyles = {
145
175
  fixed: {
146
176
  padding: '0px 12px',
@@ -151,7 +181,7 @@ export var PinHead = styled('div', function (_ref8) {
151
181
  }
152
182
  };
153
183
  return _objectSpread(_objectSpread({
154
- background: $background,
184
+ backgroundColor: $background,
155
185
  height: "".concat($height, "px"),
156
186
  display: 'grid',
157
187
  gridTemplateColumns: $gridTemplateColumns,
@@ -165,4 +195,105 @@ export var PinHead = styled('div', function (_ref8) {
165
195
  boxSizing: 'border-box'
166
196
  });
167
197
  });
168
- PinHead.displayName = "PinHead";
198
+ StyledPinHead.displayName = "StyledPinHead";
199
+ export var StyledStrokedLabelContainer = styled('div', function (_ref12) {
200
+ var $position = _ref12.$position,
201
+ $theme = _ref12.$theme,
202
+ $labelOffset = _ref12.$labelOffset;
203
+ var staticLabelOffset = 4;
204
+ var positions = {
205
+ top: {
206
+ left: "calc(50% + ".concat(staticLabelOffset, "px)"),
207
+ bottom: '100%',
208
+ alignItems: 'flex-end',
209
+ justifyContent: 'center',
210
+ textAlign: 'center'
211
+ },
212
+ bottom: {
213
+ left: '50%',
214
+ top: "calc(100% + ".concat(staticLabelOffset, "px + ").concat($labelOffset, "px)"),
215
+ alignItems: 'flex-start',
216
+ justifyContent: 'center',
217
+ textAlign: 'center'
218
+ },
219
+ right: {
220
+ left: "calc(100% + ".concat(staticLabelOffset, "px)"),
221
+ top: '50%',
222
+ alignItems: 'center',
223
+ justifyContent: 'flex-start'
224
+ },
225
+ left: {
226
+ right: "calc(100% + ".concat(staticLabelOffset, "px)"),
227
+ top: '50%',
228
+ alignItems: 'center',
229
+ justifyContent: 'flex-end',
230
+ textAlign: 'right'
231
+ },
232
+ none: {}
233
+ };
234
+ return _objectSpread({
235
+ position: 'absolute',
236
+ width: '0px',
237
+ height: '0px',
238
+ pointerEvents: 'none',
239
+ display: 'flex'
240
+ }, positions[$position]);
241
+ });
242
+ StyledStrokedLabelContainer.displayName = "StyledStrokedLabelContainer";
243
+ export var StyledStrokedLabel = styled('div', function (_ref13) {
244
+ var $theme = _ref13.$theme,
245
+ $size = _ref13.$size;
246
+ var strokeWidth = 1.5;
247
+ var strokeColor = $theme.colors.backgroundPrimary;
248
+ var textShadow = "-".concat(strokeWidth, "px -").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n 0 -").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n ").concat(strokeWidth, "px -").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n ").concat(strokeWidth, "px 0 0 ").concat(strokeColor, ",\n ").concat(strokeWidth, "px ").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n 0 ").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n -").concat(strokeWidth, "px ").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n -").concat(strokeWidth, "px 0 0 ").concat(strokeColor);
249
+ return _objectSpread(_objectSpread({
250
+ display: 'flex'
251
+ }, $theme.typography[LABEL_SIZES[$size]]), {}, {
252
+ color: $theme.colors.primaryA,
253
+ transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all"),
254
+ textShadow: textShadow,
255
+ pointerEvents: 'auto',
256
+ width: 'max-content',
257
+ maxWidth: '200px'
258
+ });
259
+ });
260
+ StyledStrokedLabel.displayName = "StyledStrokedLabel";
261
+ export var StyledBadgeEnhancerRoot = styled('div', function (_ref14) {
262
+ var $theme = _ref14.$theme,
263
+ $size = _ref14.$size,
264
+ $position = _ref14.$position;
265
+ var x = $position.x,
266
+ y = $position.y;
267
+ return _objectSpread(_objectSpread({
268
+ position: 'absolute'
269
+ }, $theme.typography.LabelSmall), {}, {
270
+ backgroundColor: $theme.colors.backgroundAccent,
271
+ color: $theme.colors.primaryB,
272
+ boxSizing: 'border-box',
273
+ right: 0,
274
+ transform: "translate(calc(100% + ".concat(x, "px), ").concat(y, "px)"),
275
+ transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all")
276
+ }, BADGE_ENHANCER_STYLES[$size]);
277
+ });
278
+ StyledBadgeEnhancerRoot.displayName = "StyledBadgeEnhancerRoot";
279
+ export var RelativeContainer = styled('div', function () {
280
+ return {
281
+ position: 'relative'
282
+ };
283
+ });
284
+ RelativeContainer.displayName = "RelativeContainer";
285
+ export var StyledContentItem = styled('div', function (_ref15) {
286
+ var $theme = _ref15.$theme,
287
+ $color = _ref15.$color,
288
+ $height = _ref15.$height,
289
+ $size = _ref15.$size;
290
+ return _objectSpread(_objectSpread({}, $theme.typography[LABEL_SIZES[$size]]), {}, {
291
+ display: 'flex',
292
+ alignItems: 'center',
293
+ textAlign: 'center',
294
+ lineHeight: "".concat($height, "px"),
295
+ height: "".concat($height, "px"),
296
+ color: $color
297
+ });
298
+ });
299
+ StyledContentItem.displayName = "StyledContentItem";
@@ -5,4 +5,4 @@ This source code is licensed under the MIT license found in the
5
5
  LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import * as React from 'react';
8
- import { FLOATING_MARKER_ANCHOR_POSITIONS, NEEDLE_SIZES, PINHEAD_SIZES_SHAPES, FLOATING_MARKER_SIZES, PINHEAD_TYPES, FLOATING_MARKER_ANCHOR_TYPES } from './constants.js';
8
+ import { FLOATING_MARKER_ANCHOR_POSITIONS, NEEDLE_SIZES, PINHEAD_SIZES_SHAPES, FLOATING_MARKER_SIZES, PINHEAD_TYPES, FLOATING_MARKER_ANCHOR_TYPES, BADGE_ENHANCER_SIZES, LABEL_ENHANCER_POSITIONS, KIND } from './constants.js';
@@ -59,8 +59,6 @@ export default function MaybeChildMenu(props) {
59
59
  overrides: mergeOverrides({
60
60
  Body: {
61
61
  props: {
62
- // Adds mouseleave to popover body so that child menu closes when user mouses out.
63
- onMouseLeave: props.resetParentMenu,
64
62
  // Trap tabbing when focused on a child menu. Popover mounts the element at the end of
65
63
  // the html body by default. If a user was to tab to the next element it would navigate
66
64
  // to elements not within the immediate area surrounding the menu.
@@ -1,5 +1,7 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
2
 
3
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
4
+
3
5
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
6
 
5
7
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -46,6 +48,10 @@ export var NestedMenuContext = /*#__PURE__*/React.createContext({
46
48
  removeMenuFromNesting: function removeMenuFromNesting() {},
47
49
  getParentMenu: function getParentMenu() {},
48
50
  getChildMenu: function getChildMenu() {},
51
+ nestedMenuHoverIndex: -1,
52
+ isNestedMenuVisible: function isNestedMenuVisible() {
53
+ return false;
54
+ },
49
55
  mountRef: {
50
56
  current: null
51
57
  }
@@ -76,16 +82,46 @@ var NestedMenus = /*#__PURE__*/function (_React$Component) {
76
82
  _this = _super.call.apply(_super, [this].concat(args));
77
83
 
78
84
  _defineProperty(_assertThisInitialized(_this), "state", {
79
- menus: []
85
+ menus: [],
86
+ nestedMenuHoverIndex: -1
80
87
  });
81
88
 
82
89
  _defineProperty(_assertThisInitialized(_this), "mountRef", /*#__PURE__*/React.createRef());
83
90
 
91
+ _defineProperty(_assertThisInitialized(_this), "mouseLeaveTimeoueId", null);
92
+
93
+ _defineProperty(_assertThisInitialized(_this), "handleMenuMouseLeave", function (event) {
94
+ _this.mouseLeaveTimeoueId = setTimeout(function () {
95
+ _this.setState({
96
+ nestedMenuHoverIndex: -1
97
+ });
98
+ }, 200);
99
+ });
100
+
101
+ _defineProperty(_assertThisInitialized(_this), "handleMenuMouseEnter", function (event) {
102
+ if (typeof document !== 'undefined') {
103
+ clearTimeout(_this.mouseLeaveTimeoueId);
104
+
105
+ var index = _this.state.menus.findIndex(function (m) {
106
+ return m.current && event.currentTarget instanceof Node && m.current.contains(event.currentTarget);
107
+ });
108
+
109
+ _this.setState({
110
+ nestedMenuHoverIndex: index
111
+ });
112
+ }
113
+ });
114
+
84
115
  _defineProperty(_assertThisInitialized(_this), "addMenuToNesting", function (ref) {
85
116
  // check offsetHeight to determine if component is visible in the dom (0 means hidden)
86
117
  // we need to do this so that when we renderAll, the hidden seo-only child-menus don't
87
118
  // register themselves which would break the nesting logic
88
- if (ref.current && ref.current.offsetHeight) {
119
+ var element = ref.current;
120
+
121
+ if (element && element.offsetHeight) {
122
+ element.addEventListener('mouseenter', _this.handleMenuMouseEnter);
123
+ element.addEventListener('mouseleave', _this.handleMenuMouseLeave);
124
+
89
125
  _this.setState(function (state) {
90
126
  return {
91
127
  menus: [].concat(_toConsumableArray(state.menus), [ref])
@@ -96,10 +132,27 @@ var NestedMenus = /*#__PURE__*/function (_React$Component) {
96
132
 
97
133
  _defineProperty(_assertThisInitialized(_this), "removeMenuFromNesting", function (ref) {
98
134
  _this.setState(function (state) {
135
+ var _iterator = _createForOfIteratorHelper(_this.state.menus),
136
+ _step;
137
+
138
+ try {
139
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
140
+ var r = _step.value;
141
+
142
+ if (r.current && isSame(r.current, ref.current)) {
143
+ var element = r.current;
144
+ element.removeEventListener('mouseenter', _this.handleMenuMouseEnter);
145
+ element.removeEventListener('mouseleave', _this.handleMenuMouseLeave);
146
+ }
147
+ }
148
+ } catch (err) {
149
+ _iterator.e(err);
150
+ } finally {
151
+ _iterator.f();
152
+ }
153
+
99
154
  var nextMenus = state.menus.filter(function (r) {
100
- return r.current;
101
- }).filter(function (r) {
102
- return !isSame(r.current, ref.current);
155
+ return r.current && !isSame(r.current, ref.current);
103
156
  });
104
157
  return {
105
158
  menus: nextMenus
@@ -123,6 +176,12 @@ var NestedMenus = /*#__PURE__*/function (_React$Component) {
123
176
  return _this.state.menus[index];
124
177
  });
125
178
 
179
+ _defineProperty(_assertThisInitialized(_this), "isNestedMenuVisible", function (ref) {
180
+ var index = _this.findMenuIndexByRef(ref);
181
+
182
+ return index <= _this.state.nestedMenuHoverIndex;
183
+ });
184
+
126
185
  return _this;
127
186
  }
128
187
 
@@ -135,6 +194,8 @@ var NestedMenus = /*#__PURE__*/function (_React$Component) {
135
194
  removeMenuFromNesting: this.removeMenuFromNesting,
136
195
  getParentMenu: this.getParentMenu,
137
196
  getChildMenu: this.getChildMenu,
197
+ isNestedMenuVisible: this.isNestedMenuVisible,
198
+ nestedMenuHoverIndex: this.state.nestedMenuHoverIndex,
138
199
  mountRef: this.mountRef
139
200
  }
140
201
  }, /*#__PURE__*/React.createElement(React.Fragment, null, this.props.children, /*#__PURE__*/React.createElement("span", {
@@ -70,6 +70,10 @@ var DEFAULT_PROPS = {
70
70
  removeMenuFromNesting: function removeMenuFromNesting() {},
71
71
  getParentMenu: function getParentMenu() {},
72
72
  getChildMenu: function getChildMenu() {},
73
+ nestedMenuHoverIndex: -1,
74
+ isNestedMenuVisible: function isNestedMenuVisible() {
75
+ return false;
76
+ },
73
77
  forceHighlight: false
74
78
  };
75
79
 
@@ -276,17 +280,7 @@ var MenuStatefulContainerInner = /*#__PURE__*/function (_React$Component) {
276
280
  });
277
281
  });
278
282
 
279
- _defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function () {
280
- var rootRef = _this.props.rootRef ? _this.props.rootRef : _this.rootRef;
281
-
282
- var childMenu = _this.props.getChildMenu && _this.props.getChildMenu(rootRef);
283
-
284
- if (!_this.props.forceHighlight && !childMenu) {
285
- _this.internalSetState(STATE_CHANGE_TYPES.mouseLeave, {
286
- highlightedIndex: -1
287
- });
288
- }
289
- });
283
+ _defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function (event) {});
290
284
 
291
285
  _defineProperty(_assertThisInitialized(_this), "getRequiredItemProps", function (item, index) {
292
286
  var itemRef = _this.refList[index];
@@ -397,11 +391,13 @@ var MenuStatefulContainerInner = /*#__PURE__*/function (_React$Component) {
397
391
  if (this.keyboardControlNode) this.keyboardControlNode.removeEventListener('keydown', this.onKeyDown);
398
392
  }
399
393
 
400
- this.props.removeMenuFromNesting && this.props.removeMenuFromNesting(rootRef);
394
+ if (this.props.removeMenuFromNesting) {
395
+ this.props.removeMenuFromNesting(rootRef);
396
+ }
401
397
  }
402
398
  }, {
403
399
  key: "componentDidUpdate",
404
- value: function componentDidUpdate(_, prevState) {
400
+ value: function componentDidUpdate(prevProps, prevState) {
405
401
  if (typeof document !== 'undefined') {
406
402
  if (!prevState.isFocused && this.state.isFocused) {
407
403
  if (this.keyboardControlNode) this.keyboardControlNode.addEventListener('keydown', this.onKeyDown);
@@ -427,6 +423,12 @@ var MenuStatefulContainerInner = /*#__PURE__*/function (_React$Component) {
427
423
  highlightedIndex: 0
428
424
  });
429
425
  }
426
+
427
+ if (this.props.isNestedMenuVisible && this.props.nestedMenuHoverIndex !== prevProps.nestedMenuHoverIndex && !this.props.isNestedMenuVisible(this.rootRef) && !this.props.forceHighlight) {
428
+ this.setState({
429
+ highlightedIndex: -1
430
+ });
431
+ }
430
432
  } // One array to hold all of list item refs
431
433
 
432
434
  }, {
@@ -372,7 +372,9 @@ var Modal = /*#__PURE__*/function (_React$Component) {
372
372
  } : {};
373
373
  return /*#__PURE__*/React.createElement(LocaleContext.Consumer, null, function (locale) {
374
374
  return /*#__PURE__*/React.createElement(FocusLock, {
375
- disabled: !focusLock,
375
+ disabled: !focusLock // Allow focus to escape when UI is within an iframe
376
+ ,
377
+ crossFrame: false,
376
378
  returnFocus: returnFocus,
377
379
  autoFocus: autofocus !== null ? autofocus : autoFocus
378
380
  }, /*#__PURE__*/React.createElement(Root, _extends({
@@ -515,10 +515,12 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
515
515
  noFocusGuards: false // see popover-focus-loop.scenario.js for why hover cannot return focus
516
516
  ,
517
517
  returnFocus: !this.isHoverTrigger() && this.props.returnFocus,
518
- autoFocus: this.state.autoFocusAfterPositioning,
518
+ autoFocus: this.state.autoFocusAfterPositioning // Allow focus to escape when UI is within an iframe
519
+ ,
520
+ crossFrame: false,
519
521
  focusOptions: this.props.focusOptions
520
522
  }, this.renderPopover(renderedContent)) : /*#__PURE__*/React.createElement(MoveFocusInside, {
521
- disabled: !this.props.autoFocus && !this.state.autoFocusAfterPositioning
523
+ disabled: !this.props.autoFocus || !this.state.autoFocusAfterPositioning
522
524
  }, this.renderPopover(renderedContent)))));
523
525
  } else {
524
526
  rendered.push( /*#__PURE__*/React.createElement(Hidden, {
@@ -8,4 +8,4 @@ export { default as ProgressBar } from './progressbar.js';
8
8
  export { default as ProgressBarRounded } from './progressbar-rounded.js';
9
9
  export { SIZE } from './constants.js'; // Styled elements
10
10
 
11
- export { StyledRoot, StyledBarContainer, StyledBar, StyledBarProgress, StyledLabel, StyledProgressBarRoundedRoot, StyledProgressBarRoundedSvg, StyledProgressBarRoundedTrackBackground, StyledProgressBarRoundedTrackForeground, StyledProgressBarRoundedText } from './styled-components.js'; // Flow
11
+ export { StyledRoot, StyledBarContainer, StyledBar, StyledBarProgress, StyledInfiniteBar, StyledLabel, StyledProgressBarRoundedRoot, StyledProgressBarRoundedSvg, StyledProgressBarRoundedTrackBackground, StyledProgressBarRoundedTrackForeground, StyledProgressBarRoundedText } from './styled-components.js'; // Flow
@@ -14,6 +14,10 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
14
14
 
15
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
16
 
17
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
18
+
19
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
20
+
17
21
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18
22
 
19
23
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -80,9 +84,16 @@ var ProgressBar = /*#__PURE__*/function (_React$Component) {
80
84
  size = _this$props.size,
81
85
  steps = _this$props.steps,
82
86
  successValue = _this$props.successValue,
87
+ minValue = _this$props.minValue,
88
+ maxValue = _this$props.maxValue,
83
89
  showLabel = _this$props.showLabel,
84
90
  infinite = _this$props.infinite,
85
- errorMessage = _this$props.errorMessage;
91
+ errorMessage = _this$props.errorMessage,
92
+ forwardedRef = _this$props.forwardedRef,
93
+ restProps = _objectWithoutProperties(_this$props, ["ariaLabel", "overrides", "getProgressLabel", "value", "size", "steps", "successValue", "minValue", "maxValue", "showLabel", "infinite", "errorMessage", "forwardedRef"]); // fallback on successValue (and it's default) if maxValue is not set by user
94
+
95
+
96
+ var maximumValue = maxValue !== 100 ? maxValue : successValue;
86
97
 
87
98
  var _getOverrides = getOverrides(overrides.Root, StyledRoot),
88
99
  _getOverrides2 = _slicedToArray(_getOverrides, 2),
@@ -118,7 +129,9 @@ var ProgressBar = /*#__PURE__*/function (_React$Component) {
118
129
  $infinite: infinite,
119
130
  $size: size,
120
131
  $steps: steps,
121
- $successValue: successValue,
132
+ $successValue: maximumValue,
133
+ $minValue: minValue,
134
+ $maxValue: maximumValue,
122
135
  $value: value
123
136
  };
124
137
 
@@ -140,20 +153,21 @@ var ProgressBar = /*#__PURE__*/function (_React$Component) {
140
153
  /*#__PURE__*/
141
154
  // eslint-disable-next-line jsx-a11y/role-supports-aria-props
142
155
  React.createElement(Root, _extends({
156
+ ref: forwardedRef,
143
157
  "data-baseweb": "progress-bar",
144
158
  role: "progressbar",
145
- "aria-label": ariaLabel || getProgressLabel(value, successValue),
159
+ "aria-label": ariaLabel || getProgressLabel(value, maximumValue, minValue),
146
160
  "aria-valuenow": infinite ? null : value,
147
- "aria-valuemin": infinite ? null : 0,
148
- "aria-valuemax": infinite ? null : successValue,
161
+ "aria-valuemin": infinite ? null : minValue,
162
+ "aria-valuemax": infinite ? null : maximumValue,
149
163
  "aria-invalid": errorMessage ? true : null,
150
164
  "aria-errormessage": errorMessage
151
- }, sharedProps, rootProps), /*#__PURE__*/React.createElement(BarContainer, _extends({}, sharedProps, barContainerProps), infinite ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InfiniteBar, _extends({
165
+ }, restProps, sharedProps, rootProps), /*#__PURE__*/React.createElement(BarContainer, _extends({}, sharedProps, barContainerProps), infinite ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InfiniteBar, _extends({
152
166
  $isLeft: true,
153
167
  $size: sharedProps.$size
154
168
  }, infiniteBarProps)), /*#__PURE__*/React.createElement(InfiniteBar, _extends({
155
169
  $size: sharedProps.$size
156
- }, infiniteBarProps))) : renderProgressBar()), showLabel && /*#__PURE__*/React.createElement(Label, _extends({}, sharedProps, labelProps), getProgressLabel(value, successValue)))
170
+ }, infiniteBarProps))) : renderProgressBar()), showLabel && /*#__PURE__*/React.createElement(Label, _extends({}, sharedProps, labelProps), getProgressLabel(value, maximumValue, minValue)))
157
171
  );
158
172
  }
159
173
  }]);
@@ -162,8 +176,8 @@ var ProgressBar = /*#__PURE__*/function (_React$Component) {
162
176
  }(React.Component);
163
177
 
164
178
  _defineProperty(ProgressBar, "defaultProps", {
165
- getProgressLabel: function getProgressLabel(value, successValue) {
166
- return "".concat(Math.round(value / successValue * 100), "% Loaded");
179
+ getProgressLabel: function getProgressLabel(value, maxValue, minValue) {
180
+ return "".concat(Math.round((value - minValue) / (maxValue - minValue) * 100), "% Loaded");
167
181
  },
168
182
  infinite: false,
169
183
  overrides: {},
@@ -171,7 +185,15 @@ _defineProperty(ProgressBar, "defaultProps", {
171
185
  size: SIZE.medium,
172
186
  steps: 1,
173
187
  successValue: 100,
188
+ minValue: 0,
189
+ maxValue: 100,
174
190
  value: 0
175
191
  });
176
192
 
177
- export default ProgressBar;
193
+ var ForwardedProgressBar = /*#__PURE__*/React.forwardRef(function (props, ref) {
194
+ return /*#__PURE__*/React.createElement(ProgressBar, _extends({
195
+ forwardedRef: ref
196
+ }, props));
197
+ });
198
+ ForwardedProgressBar.displayName = 'ProgressBar';
199
+ export default ForwardedProgressBar;