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.
- package/a11y/a11y.js +2 -2
- package/a11y/a11y.js.flow +3 -3
- package/button/styled-components.js +47 -18
- package/button/styled-components.js.flow +25 -5
- package/combobox/combobox.js +6 -3
- package/combobox/combobox.js.flow +4 -2
- package/combobox/types.js.flow +2 -0
- package/data-table/column-categorical.js +1 -1
- package/data-table/column-categorical.js.flow +2 -2
- package/data-table/column-numerical.js +1 -1
- package/data-table/column-numerical.js.flow +3 -3
- package/datepicker/styled-components.js +1 -1
- package/datepicker/styled-components.js.flow +4 -1
- package/drawer/drawer.js +3 -1
- package/drawer/drawer.js.flow +7 -1
- package/es/a11y/a11y.js +2 -2
- package/es/button/styled-components.js +32 -2
- package/es/combobox/combobox.js +6 -3
- package/es/data-table/column-categorical.js +2 -2
- package/es/data-table/column-numerical.js +2 -2
- package/es/datepicker/styled-components.js +1 -1
- package/es/drawer/drawer.js +3 -1
- package/es/form-control/form-control.js +58 -7
- package/es/form-control/styled-components.js +27 -6
- package/es/index.js +1 -1
- package/es/map-marker/badge-enhancer.js +61 -0
- package/es/map-marker/constants.js +146 -2
- package/es/map-marker/drag-shadow.js +32 -0
- package/es/map-marker/fixed-marker.js +54 -48
- package/es/map-marker/floating-marker.js +21 -12
- package/es/map-marker/index.js +1 -1
- package/es/map-marker/label-enhancer.js +39 -0
- package/es/map-marker/needle.js +26 -0
- package/es/map-marker/pin-head.js +42 -40
- package/es/map-marker/styled-components.js +177 -32
- package/es/map-marker/types.js +1 -1
- package/es/menu/maybe-child-menu.js +0 -2
- package/es/menu/nested-menus.js +49 -3
- package/es/menu/stateful-container.js +13 -12
- package/es/modal/modal.js +3 -1
- package/es/popover/popover.js +4 -2
- package/es/progress-bar/index.js +1 -1
- package/es/progress-bar/progressbar.js +25 -10
- package/es/progress-bar/styled-components.js +9 -5
- package/es/select/select-component.js +2 -10
- package/es/spinner/styled-components.js +34 -16
- package/es/table/filter.js +3 -1
- package/es/themes/dark-theme/color-component-tokens.js +19 -10
- package/es/themes/light-theme/color-component-tokens.js +19 -10
- package/es/timezonepicker/timezone-picker.js +53 -36
- package/es/timezonepicker/tzdata.js +2 -0
- package/es/timezonepicker/update-tzdata.js +69 -0
- package/es/toast/styled-components.js +18 -7
- package/esm/a11y/a11y.js +3 -3
- package/esm/button/styled-components.js +47 -18
- package/esm/combobox/combobox.js +6 -3
- package/esm/data-table/column-categorical.js +2 -2
- package/esm/data-table/column-numerical.js +2 -2
- package/esm/datepicker/styled-components.js +1 -1
- package/esm/drawer/drawer.js +3 -1
- package/esm/form-control/form-control.js +60 -9
- package/esm/form-control/styled-components.js +23 -3
- package/esm/index.js +1 -1
- package/esm/map-marker/badge-enhancer.js +79 -0
- package/esm/map-marker/constants.js +94 -4
- package/esm/map-marker/drag-shadow.js +53 -0
- package/esm/map-marker/fixed-marker.js +84 -80
- package/esm/map-marker/floating-marker.js +22 -13
- package/esm/map-marker/index.js +1 -1
- package/esm/map-marker/label-enhancer.js +60 -0
- package/esm/map-marker/needle.js +43 -0
- package/esm/map-marker/pin-head.js +77 -66
- package/esm/map-marker/styled-components.js +182 -51
- package/esm/map-marker/types.js +1 -1
- package/esm/menu/maybe-child-menu.js +0 -2
- package/esm/menu/nested-menus.js +66 -5
- package/esm/menu/stateful-container.js +15 -13
- package/esm/modal/modal.js +3 -1
- package/esm/popover/popover.js +4 -2
- package/esm/progress-bar/index.js +1 -1
- package/esm/progress-bar/progressbar.js +32 -10
- package/esm/progress-bar/styled-components.js +9 -4
- package/esm/select/select-component.js +2 -11
- package/esm/spinner/styled-components.js +35 -16
- package/esm/table/filter.js +3 -1
- package/esm/themes/dark-theme/color-component-tokens.js +19 -10
- package/esm/themes/light-theme/color-component-tokens.js +19 -10
- package/esm/timezonepicker/timezone-picker.js +64 -36
- package/esm/timezonepicker/tzdata.js +2 -0
- package/esm/timezonepicker/update-tzdata.js +160 -0
- package/esm/toast/styled-components.js +13 -5
- package/form-control/form-control.js +61 -8
- package/form-control/form-control.js.flow +82 -10
- package/form-control/index.d.ts +1 -0
- package/form-control/styled-components.js +27 -5
- package/form-control/styled-components.js.flow +25 -3
- package/form-control/types.js.flow +20 -8
- package/index.js +6 -0
- package/index.js.flow +1 -1
- package/map-marker/badge-enhancer.js +90 -0
- package/map-marker/badge-enhancer.js.flow +86 -0
- package/map-marker/constants.js +103 -5
- package/map-marker/constants.js.flow +152 -0
- package/map-marker/drag-shadow.js +64 -0
- package/map-marker/drag-shadow.js.flow +52 -0
- package/map-marker/fixed-marker.js +84 -78
- package/map-marker/fixed-marker.js.flow +78 -66
- package/map-marker/floating-marker.js +22 -13
- package/map-marker/floating-marker.js.flow +30 -17
- package/map-marker/index.d.ts +125 -24
- package/map-marker/index.js +18 -0
- package/map-marker/index.js.flow +3 -0
- package/map-marker/label-enhancer.js +71 -0
- package/map-marker/label-enhancer.js.flow +63 -0
- package/map-marker/needle.js +54 -0
- package/map-marker/needle.js.flow +29 -0
- package/map-marker/pin-head.js +80 -69
- package/map-marker/pin-head.js.flow +122 -84
- package/map-marker/styled-components.js +200 -62
- package/map-marker/styled-components.js.flow +172 -22
- package/map-marker/types.js.flow +69 -20
- package/menu/index.d.ts +9 -4
- package/menu/maybe-child-menu.js +0 -2
- package/menu/maybe-child-menu.js.flow +0 -2
- package/menu/nested-menus.js +66 -5
- package/menu/nested-menus.js.flow +50 -5
- package/menu/stateful-container.js +15 -13
- package/menu/stateful-container.js.flow +19 -13
- package/menu/types.js.flow +7 -1
- package/modal/modal.js +3 -1
- package/modal/modal.js.flow +2 -0
- package/package.json +4 -4
- package/popover/popover.js +4 -2
- package/popover/popover.js.flow +3 -1
- package/progress-bar/index.d.ts +2 -0
- package/progress-bar/index.js +6 -0
- package/progress-bar/index.js.flow +1 -0
- package/progress-bar/progressbar.js +32 -10
- package/progress-bar/progressbar.js.flow +35 -9
- package/progress-bar/styled-components.js +9 -4
- package/progress-bar/styled-components.js.flow +15 -4
- package/progress-bar/types.js.flow +12 -2
- package/select/select-component.js +2 -11
- package/select/select-component.js.flow +5 -7
- package/spinner/styled-components.js +35 -16
- package/spinner/styled-components.js.flow +37 -19
- package/spinner/types.js.flow +10 -0
- package/styles/index.js.flow +1 -1
- package/table/filter.js +3 -1
- package/table/filter.js.flow +5 -1
- package/themes/dark-theme/color-component-tokens.js +19 -10
- package/themes/dark-theme/color-component-tokens.js.flow +19 -10
- package/themes/light-theme/color-component-tokens.js +19 -10
- package/themes/light-theme/color-component-tokens.js.flow +19 -10
- package/themes/types.js.flow +9 -0
- package/timezonepicker/timezone-picker.js +69 -41
- package/timezonepicker/timezone-picker.js.flow +52 -46
- package/timezonepicker/types.js.flow +1 -1
- package/timezonepicker/tzdata.js +10 -0
- package/timezonepicker/tzdata.js.flow +347 -0
- package/timezonepicker/update-tzdata.js +164 -0
- package/timezonepicker/update-tzdata.js.flow +70 -0
- package/toast/styled-components.js +13 -5
- 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,
|
|
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
|
|
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
|
-
|
|
36
|
-
export var
|
|
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
|
-
|
|
41
|
+
backgroundColor: $background,
|
|
42
42
|
borderRadius: '50%',
|
|
43
43
|
width: "".concat($width, "px"),
|
|
44
|
-
height:
|
|
44
|
+
height: '4px',
|
|
45
45
|
position: 'absolute',
|
|
46
46
|
bottom: 0
|
|
47
47
|
};
|
|
48
48
|
});
|
|
49
|
-
|
|
50
|
-
export var
|
|
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
|
-
|
|
55
|
+
backgroundColor: $background,
|
|
56
56
|
width: '4px',
|
|
57
57
|
height: "".concat($height, "px"),
|
|
58
58
|
boxShadow: $theme.lighting.shadow600
|
|
59
59
|
};
|
|
60
60
|
});
|
|
61
|
-
|
|
62
|
-
export var
|
|
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(
|
|
66
|
-
width: "".concat(
|
|
66
|
+
height: "".concat($size, "px"),
|
|
67
|
+
width: "".concat($size, "px")
|
|
67
68
|
};
|
|
68
69
|
});
|
|
69
|
-
|
|
70
|
-
export var
|
|
71
|
-
var $theme =
|
|
72
|
-
$anchor =
|
|
73
|
-
$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
|
-
|
|
81
|
-
export var
|
|
81
|
+
StyledFloatingMarkerPinHeadContainer.displayName = "StyledFloatingMarkerPinHeadContainer";
|
|
82
|
+
export var StyledFloatingMarkerAnchorContainer = styled('div', function () {
|
|
82
83
|
return {
|
|
83
84
|
position: 'absolute'
|
|
84
85
|
};
|
|
85
86
|
});
|
|
86
|
-
|
|
87
|
-
export var
|
|
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
|
-
|
|
95
|
-
export var
|
|
96
|
-
var $theme =
|
|
97
|
-
$translateAmount =
|
|
98
|
-
$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 ?
|
|
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
|
-
|
|
108
|
-
export var
|
|
109
|
-
var $theme =
|
|
110
|
-
$round =
|
|
111
|
-
$background =
|
|
112
|
-
$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
|
-
|
|
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
|
-
|
|
125
|
-
export var
|
|
126
|
-
var $round =
|
|
127
|
-
$color =
|
|
128
|
-
$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
|
-
|
|
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
|
-
|
|
137
|
-
export var
|
|
138
|
-
var $theme =
|
|
139
|
-
$height =
|
|
140
|
-
$background =
|
|
141
|
-
$gridTemplateColumns =
|
|
142
|
-
$type =
|
|
143
|
-
$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
|
-
|
|
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
|
-
|
|
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";
|
package/esm/map-marker/types.js
CHANGED
|
@@ -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.
|
package/esm/menu/nested-menus.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
394
|
+
if (this.props.removeMenuFromNesting) {
|
|
395
|
+
this.props.removeMenuFromNesting(rootRef);
|
|
396
|
+
}
|
|
401
397
|
}
|
|
402
398
|
}, {
|
|
403
399
|
key: "componentDidUpdate",
|
|
404
|
-
value: function componentDidUpdate(
|
|
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
|
}, {
|
package/esm/modal/modal.js
CHANGED
|
@@ -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({
|
package/esm/popover/popover.js
CHANGED
|
@@ -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
|
|
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:
|
|
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,
|
|
159
|
+
"aria-label": ariaLabel || getProgressLabel(value, maximumValue, minValue),
|
|
146
160
|
"aria-valuenow": infinite ? null : value,
|
|
147
|
-
"aria-valuemin": infinite ? null :
|
|
148
|
-
"aria-valuemax": infinite ? null :
|
|
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,
|
|
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,
|
|
166
|
-
return "".concat(Math.round(value /
|
|
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
|
-
|
|
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;
|