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
|
@@ -32,10 +32,16 @@ class ProgressBar extends React.Component {
|
|
|
32
32
|
size,
|
|
33
33
|
steps,
|
|
34
34
|
successValue,
|
|
35
|
+
minValue,
|
|
36
|
+
maxValue,
|
|
35
37
|
showLabel,
|
|
36
38
|
infinite,
|
|
37
|
-
errorMessage
|
|
38
|
-
|
|
39
|
+
errorMessage,
|
|
40
|
+
forwardedRef,
|
|
41
|
+
...restProps
|
|
42
|
+
} = this.props; // fallback on successValue (and it's default) if maxValue is not set by user
|
|
43
|
+
|
|
44
|
+
const maximumValue = maxValue !== 100 ? maxValue : successValue;
|
|
39
45
|
const [Root, rootProps] = getOverrides(overrides.Root, StyledRoot);
|
|
40
46
|
const [BarContainer, barContainerProps] = getOverrides(overrides.BarContainer, StyledBarContainer);
|
|
41
47
|
const [Bar, barProps] = getOverrides(overrides.Bar, StyledBar);
|
|
@@ -46,7 +52,9 @@ class ProgressBar extends React.Component {
|
|
|
46
52
|
$infinite: infinite,
|
|
47
53
|
$size: size,
|
|
48
54
|
$steps: steps,
|
|
49
|
-
$successValue:
|
|
55
|
+
$successValue: maximumValue,
|
|
56
|
+
$minValue: minValue,
|
|
57
|
+
$maxValue: maximumValue,
|
|
50
58
|
$value: value
|
|
51
59
|
};
|
|
52
60
|
|
|
@@ -68,34 +76,41 @@ class ProgressBar extends React.Component {
|
|
|
68
76
|
/*#__PURE__*/
|
|
69
77
|
// eslint-disable-next-line jsx-a11y/role-supports-aria-props
|
|
70
78
|
React.createElement(Root, _extends({
|
|
79
|
+
ref: forwardedRef,
|
|
71
80
|
"data-baseweb": "progress-bar",
|
|
72
81
|
role: "progressbar",
|
|
73
|
-
"aria-label": ariaLabel || getProgressLabel(value,
|
|
82
|
+
"aria-label": ariaLabel || getProgressLabel(value, maximumValue, minValue),
|
|
74
83
|
"aria-valuenow": infinite ? null : value,
|
|
75
|
-
"aria-valuemin": infinite ? null :
|
|
76
|
-
"aria-valuemax": infinite ? null :
|
|
84
|
+
"aria-valuemin": infinite ? null : minValue,
|
|
85
|
+
"aria-valuemax": infinite ? null : maximumValue,
|
|
77
86
|
"aria-invalid": errorMessage ? true : null,
|
|
78
87
|
"aria-errormessage": errorMessage
|
|
79
|
-
}, sharedProps, rootProps), /*#__PURE__*/React.createElement(BarContainer, _extends({}, sharedProps, barContainerProps), infinite ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InfiniteBar, _extends({
|
|
88
|
+
}, restProps, sharedProps, rootProps), /*#__PURE__*/React.createElement(BarContainer, _extends({}, sharedProps, barContainerProps), infinite ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InfiniteBar, _extends({
|
|
80
89
|
$isLeft: true,
|
|
81
90
|
$size: sharedProps.$size
|
|
82
91
|
}, infiniteBarProps)), /*#__PURE__*/React.createElement(InfiniteBar, _extends({
|
|
83
92
|
$size: sharedProps.$size
|
|
84
|
-
}, infiniteBarProps))) : renderProgressBar()), showLabel && /*#__PURE__*/React.createElement(Label, _extends({}, sharedProps, labelProps), getProgressLabel(value,
|
|
93
|
+
}, infiniteBarProps))) : renderProgressBar()), showLabel && /*#__PURE__*/React.createElement(Label, _extends({}, sharedProps, labelProps), getProgressLabel(value, maximumValue, minValue)))
|
|
85
94
|
);
|
|
86
95
|
}
|
|
87
96
|
|
|
88
97
|
}
|
|
89
98
|
|
|
90
99
|
_defineProperty(ProgressBar, "defaultProps", {
|
|
91
|
-
getProgressLabel: (value,
|
|
100
|
+
getProgressLabel: (value, maxValue, minValue) => `${Math.round((value - minValue) / (maxValue - minValue) * 100)}% Loaded`,
|
|
92
101
|
infinite: false,
|
|
93
102
|
overrides: {},
|
|
94
103
|
showLabel: false,
|
|
95
104
|
size: SIZE.medium,
|
|
96
105
|
steps: 1,
|
|
97
106
|
successValue: 100,
|
|
107
|
+
minValue: 0,
|
|
108
|
+
maxValue: 100,
|
|
98
109
|
value: 0
|
|
99
110
|
});
|
|
100
111
|
|
|
101
|
-
|
|
112
|
+
const ForwardedProgressBar = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(ProgressBar, _extends({
|
|
113
|
+
forwardedRef: ref
|
|
114
|
+
}, props)));
|
|
115
|
+
ForwardedProgressBar.displayName = 'ProgressBar';
|
|
116
|
+
export default ForwardedProgressBar;
|
|
@@ -76,14 +76,18 @@ export const StyledBarProgress = styled('div', props => {
|
|
|
76
76
|
$value,
|
|
77
77
|
$successValue,
|
|
78
78
|
$steps,
|
|
79
|
-
$index
|
|
80
|
-
|
|
79
|
+
$index,
|
|
80
|
+
$maxValue,
|
|
81
|
+
$minValue = 0
|
|
82
|
+
} = props; // making sure this doesn't break existing use that use StyledBarProgress directly
|
|
83
|
+
|
|
84
|
+
const maxValue = $maxValue ? $maxValue : $successValue;
|
|
81
85
|
const {
|
|
82
86
|
colors,
|
|
83
87
|
sizing,
|
|
84
88
|
borders
|
|
85
89
|
} = $theme;
|
|
86
|
-
const width = `${100 - $value
|
|
90
|
+
const width = `${100 - ($value - $minValue) * 100 / (maxValue - $minValue)}%`;
|
|
87
91
|
const stepStates = {
|
|
88
92
|
default: 'default',
|
|
89
93
|
awaits: 'awaits',
|
|
@@ -93,8 +97,8 @@ export const StyledBarProgress = styled('div', props => {
|
|
|
93
97
|
let stepState = stepStates.default;
|
|
94
98
|
|
|
95
99
|
if ($steps > 1) {
|
|
96
|
-
const stepValue = $
|
|
97
|
-
const currentValue = $value / $
|
|
100
|
+
const stepValue = (maxValue - $minValue) / $steps;
|
|
101
|
+
const currentValue = ($value - $minValue) / (maxValue - $minValue) * 100;
|
|
98
102
|
const completedSteps = Math.floor(currentValue / stepValue);
|
|
99
103
|
|
|
100
104
|
if ($index < completedSteps) {
|
|
@@ -124,11 +124,6 @@ class Select extends React.Component {
|
|
|
124
124
|
this.handleClick(event);
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
_defineProperty(this, "handleTouchEndClearValue", event => {
|
|
128
|
-
if (this.dragging) return;
|
|
129
|
-
this.clearValue(event);
|
|
130
|
-
});
|
|
131
|
-
|
|
132
127
|
_defineProperty(this, "handleClick", event => {
|
|
133
128
|
if (this.props.disabled || !isClick(event) && !isLeftClick(event)) {
|
|
134
129
|
return;
|
|
@@ -741,7 +736,7 @@ class Select extends React.Component {
|
|
|
741
736
|
"aria-required": this.props.required || null,
|
|
742
737
|
onFocus: this.handleInputFocus,
|
|
743
738
|
tabIndex: 0
|
|
744
|
-
}, sharedProps, inputContainerProps), /*#__PURE__*/React.createElement("input", {
|
|
739
|
+
}, sharedProps, inputContainerProps), /*#__PURE__*/React.createElement("input", _extends({
|
|
745
740
|
"aria-hidden": true,
|
|
746
741
|
id: this.props.id || null,
|
|
747
742
|
ref: this.handleInputRef,
|
|
@@ -753,7 +748,7 @@ class Select extends React.Component {
|
|
|
753
748
|
padding: 0
|
|
754
749
|
},
|
|
755
750
|
tabIndex: -1
|
|
756
|
-
}));
|
|
751
|
+
}, overrides.Input ? overrides.Input.props ? overrides.Input.props : {} : {})));
|
|
757
752
|
}
|
|
758
753
|
|
|
759
754
|
return /*#__PURE__*/React.createElement(InputContainer, _extends({}, sharedProps, inputContainerProps), /*#__PURE__*/React.createElement(AutosizeInput, _extends({
|
|
@@ -800,9 +795,6 @@ class Select extends React.Component {
|
|
|
800
795
|
title: ariaLabel,
|
|
801
796
|
"aria-label": ariaLabel,
|
|
802
797
|
onClick: this.clearValue,
|
|
803
|
-
onTouchEnd: this.handleTouchEndClearValue,
|
|
804
|
-
onTouchMove: this.handleTouchMove,
|
|
805
|
-
onTouchStart: this.handleTouchStart,
|
|
806
798
|
role: "button",
|
|
807
799
|
overrides: {
|
|
808
800
|
Svg: {
|
|
@@ -46,13 +46,39 @@ export const StyledActivePath = styled('path', props => ({
|
|
|
46
46
|
StyledActivePath.displayName = "StyledActivePath";
|
|
47
47
|
export const StyledSpinnerNext = styled('i', ({
|
|
48
48
|
$theme,
|
|
49
|
+
$color = $theme.colors.contentAccent,
|
|
50
|
+
$borderWidth,
|
|
49
51
|
$size = SIZE.medium
|
|
50
52
|
}) => {
|
|
51
|
-
|
|
53
|
+
//$FlowFixMe
|
|
54
|
+
let borderSize = {
|
|
52
55
|
large: $theme.sizing.scale300,
|
|
53
56
|
medium: $theme.sizing.scale100,
|
|
54
57
|
small: $theme.sizing.scale0
|
|
58
|
+
}[$borderWidth || $size];
|
|
59
|
+
let boxSize = {
|
|
60
|
+
large: $theme.sizing.scale1000,
|
|
61
|
+
medium: $theme.sizing.scale900,
|
|
62
|
+
small: $theme.sizing.scale800
|
|
55
63
|
}[$size];
|
|
64
|
+
|
|
65
|
+
if (!borderSize) {
|
|
66
|
+
borderSize = $theme.sizing[$borderWidth];
|
|
67
|
+
|
|
68
|
+
if (!borderSize) {
|
|
69
|
+
borderSize = `${parseInt($borderWidth)}px`;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!boxSize) {
|
|
74
|
+
//$FlowFixMe
|
|
75
|
+
boxSize = $theme.sizing[$size];
|
|
76
|
+
|
|
77
|
+
if (!boxSize) {
|
|
78
|
+
boxSize = `${parseInt($size)}px`;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
56
82
|
return {
|
|
57
83
|
display: 'block',
|
|
58
84
|
animationName: spin,
|
|
@@ -64,24 +90,16 @@ export const StyledSpinnerNext = styled('i', ({
|
|
|
64
90
|
borderTopStyle: 'solid',
|
|
65
91
|
borderBottomStyle: 'solid',
|
|
66
92
|
borderRadius: '50%',
|
|
67
|
-
borderTopColor: $
|
|
93
|
+
borderTopColor: $color,
|
|
68
94
|
borderRightColor: $theme.colors.backgroundTertiary,
|
|
69
95
|
borderBottomColor: $theme.colors.backgroundTertiary,
|
|
70
96
|
borderLeftColor: $theme.colors.backgroundTertiary,
|
|
71
|
-
borderLeftWidth:
|
|
72
|
-
borderRightWidth:
|
|
73
|
-
borderTopWidth:
|
|
74
|
-
borderBottomWidth:
|
|
75
|
-
width:
|
|
76
|
-
|
|
77
|
-
medium: $theme.sizing.scale900,
|
|
78
|
-
small: $theme.sizing.scale800
|
|
79
|
-
}[$size],
|
|
80
|
-
height: {
|
|
81
|
-
large: $theme.sizing.scale1000,
|
|
82
|
-
medium: $theme.sizing.scale900,
|
|
83
|
-
small: $theme.sizing.scale800
|
|
84
|
-
}[$size],
|
|
97
|
+
borderLeftWidth: borderSize,
|
|
98
|
+
borderRightWidth: borderSize,
|
|
99
|
+
borderTopWidth: borderSize,
|
|
100
|
+
borderBottomWidth: borderSize,
|
|
101
|
+
width: boxSize,
|
|
102
|
+
height: boxSize,
|
|
85
103
|
cursor: 'wait'
|
|
86
104
|
};
|
|
87
105
|
});
|
package/es/table/filter.js
CHANGED
|
@@ -39,7 +39,9 @@ export default function Filter(props) {
|
|
|
39
39
|
content: ({
|
|
40
40
|
close
|
|
41
41
|
}) => /*#__PURE__*/React.createElement(FocusLock, {
|
|
42
|
-
autoFocus: false
|
|
42
|
+
autoFocus: false // Allow focus to escape when UI is within an iframe
|
|
43
|
+
,
|
|
44
|
+
crossFrame: false
|
|
43
45
|
}, /*#__PURE__*/React.createElement(Heading, headingProps, "Filter Column"), /*#__PURE__*/React.createElement(Content, contentProps, props.children), /*#__PURE__*/React.createElement(Footer, footerProps, /*#__PURE__*/React.createElement(Button, {
|
|
44
46
|
kind: KIND.minimal,
|
|
45
47
|
size: SIZE.compact,
|
|
@@ -36,6 +36,8 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
36
36
|
buttonTertiaryActive: themePrimitives.primary600,
|
|
37
37
|
buttonTertiarySelectedText: themePrimitives.primary,
|
|
38
38
|
buttonTertiarySelectedFill: themePrimitives.primary600,
|
|
39
|
+
buttonTertiaryDisabledActiveFill: themePrimitives.primary700,
|
|
40
|
+
buttonTertiaryDisabledActiveText: themePrimitives.mono300,
|
|
39
41
|
buttonTertiarySpinnerForeground: themePrimitives.primary50,
|
|
40
42
|
buttonTertiarySpinnerBackground: themePrimitives.primary500,
|
|
41
43
|
buttonMinimalFill: 'transparent',
|
|
@@ -48,6 +50,8 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
48
50
|
buttonMinimalSpinnerBackground: themePrimitives.primary500,
|
|
49
51
|
buttonDisabledFill: themePrimitives.mono600,
|
|
50
52
|
buttonDisabledText: themePrimitives.mono300,
|
|
53
|
+
buttonDisabledActiveFill: themePrimitives.mono200,
|
|
54
|
+
buttonDisabledActiveText: themePrimitives.primary500,
|
|
51
55
|
buttonDisabledSpinnerForeground: themePrimitives.mono200,
|
|
52
56
|
buttonDisabledSpinnerBackground: themePrimitives.mono400,
|
|
53
57
|
// Breadcrumbs
|
|
@@ -106,15 +110,15 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
106
110
|
modalCloseColorFocus: themePrimitives.mono400,
|
|
107
111
|
// Notification
|
|
108
112
|
notificationPrimaryBackground: themePrimitives.primary700,
|
|
109
|
-
notificationPrimaryText: themePrimitives.
|
|
113
|
+
notificationPrimaryText: themePrimitives.primaryA,
|
|
110
114
|
notificationInfoBackground: themePrimitives.accent700,
|
|
111
|
-
notificationInfoText: themePrimitives.
|
|
115
|
+
notificationInfoText: themePrimitives.primaryA,
|
|
112
116
|
notificationPositiveBackground: themePrimitives.positive700,
|
|
113
|
-
notificationPositiveText: themePrimitives.
|
|
117
|
+
notificationPositiveText: themePrimitives.primaryA,
|
|
114
118
|
notificationWarningBackground: themePrimitives.warning700,
|
|
115
|
-
notificationWarningText: themePrimitives.
|
|
119
|
+
notificationWarningText: themePrimitives.primaryA,
|
|
116
120
|
notificationNegativeBackground: themePrimitives.negative700,
|
|
117
|
-
notificationNegativeText: themePrimitives.
|
|
121
|
+
notificationNegativeText: themePrimitives.primaryA,
|
|
118
122
|
// Tag
|
|
119
123
|
// Custom ramps
|
|
120
124
|
tagFontDisabledRampUnit: '600',
|
|
@@ -274,11 +278,16 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
274
278
|
tableFilterFooterBackground: themePrimitives.mono800,
|
|
275
279
|
// Toast
|
|
276
280
|
toastText: themePrimitives.white,
|
|
277
|
-
toastPrimaryBackground: themePrimitives.
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
281
|
+
toastPrimaryBackground: themePrimitives.primary400,
|
|
282
|
+
toastPrimaryText: themePrimitives.white,
|
|
283
|
+
toastInfoBackground: themePrimitives.accent400,
|
|
284
|
+
toastInfoText: themePrimitives.white,
|
|
285
|
+
toastPositiveBackground: themePrimitives.positive400,
|
|
286
|
+
toastPositiveText: themePrimitives.white,
|
|
287
|
+
toastWarningBackground: themePrimitives.warning400,
|
|
288
|
+
toastWarningText: themePrimitives.black,
|
|
289
|
+
toastNegativeBackground: themePrimitives.negative400,
|
|
290
|
+
toastNegativeText: themePrimitives.white,
|
|
282
291
|
// Toggle
|
|
283
292
|
toggleFill: themePrimitives.mono300,
|
|
284
293
|
toggleFillChecked: themePrimitives.primary,
|
|
@@ -36,6 +36,8 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
36
36
|
buttonTertiaryActive: themePrimitives.primary100,
|
|
37
37
|
buttonTertiarySelectedFill: themePrimitives.primary100,
|
|
38
38
|
buttonTertiarySelectedText: themePrimitives.primary,
|
|
39
|
+
buttonTertiaryDisabledActiveFill: themePrimitives.primary50,
|
|
40
|
+
buttonTertiaryDisabledActiveText: themePrimitives.mono600,
|
|
39
41
|
buttonTertiarySpinnerForeground: themePrimitives.accent,
|
|
40
42
|
buttonTertiarySpinnerBackground: themePrimitives.primary100,
|
|
41
43
|
buttonMinimalFill: 'transparent',
|
|
@@ -48,6 +50,8 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
48
50
|
buttonMinimalSpinnerBackground: themePrimitives.primary100,
|
|
49
51
|
buttonDisabledFill: themePrimitives.mono200,
|
|
50
52
|
buttonDisabledText: themePrimitives.mono600,
|
|
53
|
+
buttonDisabledActiveFill: themePrimitives.mono700,
|
|
54
|
+
buttonDisabledActiveText: themePrimitives.mono100,
|
|
51
55
|
buttonDisabledSpinnerForeground: themePrimitives.mono600,
|
|
52
56
|
buttonDisabledSpinnerBackground: themePrimitives.mono400,
|
|
53
57
|
// Breadcrumbs
|
|
@@ -182,15 +186,15 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
182
186
|
tabColor: themePrimitives.mono800,
|
|
183
187
|
// Notification
|
|
184
188
|
notificationPrimaryBackground: themePrimitives.primary50,
|
|
185
|
-
notificationPrimaryText: themePrimitives.
|
|
189
|
+
notificationPrimaryText: themePrimitives.primaryA,
|
|
186
190
|
notificationInfoBackground: themePrimitives.accent50,
|
|
187
|
-
notificationInfoText: themePrimitives.
|
|
191
|
+
notificationInfoText: themePrimitives.primaryA,
|
|
188
192
|
notificationPositiveBackground: themePrimitives.positive50,
|
|
189
|
-
notificationPositiveText: themePrimitives.
|
|
193
|
+
notificationPositiveText: themePrimitives.primaryA,
|
|
190
194
|
notificationWarningBackground: themePrimitives.warning50,
|
|
191
|
-
notificationWarningText: themePrimitives.
|
|
195
|
+
notificationWarningText: themePrimitives.primaryA,
|
|
192
196
|
notificationNegativeBackground: themePrimitives.negative50,
|
|
193
|
-
notificationNegativeText: themePrimitives.
|
|
197
|
+
notificationNegativeText: themePrimitives.primaryA,
|
|
194
198
|
// Tag
|
|
195
199
|
// Custom ramps
|
|
196
200
|
tagFontDisabledRampUnit: '100',
|
|
@@ -349,11 +353,16 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
349
353
|
tableFilterFooterBackground: themePrimitives.mono200,
|
|
350
354
|
// Toast
|
|
351
355
|
toastText: themePrimitives.white,
|
|
352
|
-
toastPrimaryBackground: themePrimitives.
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
356
|
+
toastPrimaryBackground: themePrimitives.primary400,
|
|
357
|
+
toastPrimaryText: themePrimitives.white,
|
|
358
|
+
toastInfoBackground: themePrimitives.accent400,
|
|
359
|
+
toastInfoText: themePrimitives.white,
|
|
360
|
+
toastPositiveBackground: themePrimitives.positive400,
|
|
361
|
+
toastPositiveText: themePrimitives.white,
|
|
362
|
+
toastWarningBackground: themePrimitives.warning400,
|
|
363
|
+
toastWarningText: themePrimitives.black,
|
|
364
|
+
toastNegativeBackground: themePrimitives.negative400,
|
|
365
|
+
toastNegativeText: themePrimitives.white,
|
|
357
366
|
// Spinner
|
|
358
367
|
spinnerTrackFill: themePrimitives.mono900,
|
|
359
368
|
// Progress bar
|
|
@@ -10,11 +10,11 @@ LICENSE file in the root directory of this source tree.
|
|
|
10
10
|
*/
|
|
11
11
|
// global Intl
|
|
12
12
|
import * as React from 'react';
|
|
13
|
-
import {
|
|
14
|
-
import { formatZonedTime } from 'timezone-support/dist/parse-format.js';
|
|
13
|
+
import { format, getTimezoneOffset } from 'date-fns-tz';
|
|
15
14
|
import { getOverrides, mergeOverrides } from '../helpers/overrides.js';
|
|
16
15
|
import { LocaleContext } from '../locale/index.js';
|
|
17
16
|
import { Select } from '../select/index.js';
|
|
17
|
+
import { zones } from './tzdata.js';
|
|
18
18
|
|
|
19
19
|
class TimezonePicker extends React.Component {
|
|
20
20
|
constructor(...args) {
|
|
@@ -25,42 +25,49 @@ class TimezonePicker extends React.Component {
|
|
|
25
25
|
value: null
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
_defineProperty(this, "buildTimezones", compareDate =>
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
_defineProperty(this, "buildTimezones", compareDate => {
|
|
29
|
+
const timezones = [];
|
|
30
|
+
|
|
31
|
+
for (const zoneName of zones) {
|
|
32
|
+
try {
|
|
33
|
+
const offset = getTimezoneOffset(zoneName, compareDate) / 3_600_000;
|
|
34
|
+
const offsetFormatted = `${offset >= 0 ? '+' : '-'}${Math.abs(offset)}`;
|
|
35
|
+
let label = `(GMT${offsetFormatted}) ${zoneName.replace('_', ' ')}`;
|
|
36
|
+
|
|
37
|
+
if (this.props.includeAbbreviations) {
|
|
38
|
+
const abbreviation = format(compareDate, 'zzz', {
|
|
39
|
+
timeZone: zoneName
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
if (abbreviation) {
|
|
43
|
+
label += ` - ${abbreviation}`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
timezones.push({
|
|
48
|
+
id: zoneName,
|
|
49
|
+
label,
|
|
50
|
+
offset
|
|
51
|
+
});
|
|
52
|
+
} catch (error) {
|
|
53
|
+
// Ignores timezones that are not available within a user's browser/operating system
|
|
54
|
+
console.error(`failed to format zone name ${zoneName}`);
|
|
55
|
+
}
|
|
56
|
+
} // Sorts W -> E, prioritizes america. could be more nuanced based on system tz but simple for now
|
|
43
57
|
|
|
44
|
-
return option;
|
|
45
|
-
}) // Formats 'noisy' timezones without a letter acronym.
|
|
46
|
-
.map(option => {
|
|
47
|
-
const rgx = /(\s-\s(\+|-)\d\d\d?\d?)$/;
|
|
48
|
-
const matches = option.label.match(rgx);
|
|
49
58
|
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
return timezones.sort((a, b) => {
|
|
60
|
+
const offsetDelta = b.offset - a.offset;
|
|
61
|
+
if (offsetDelta !== 0) return offsetDelta;
|
|
62
|
+
|
|
63
|
+
if (typeof a.label === 'string' && typeof b.label === 'string') {
|
|
64
|
+
if (a.label < b.label) return -1;
|
|
65
|
+
if (a.label > b.label) return 1;
|
|
66
|
+
}
|
|
54
67
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const offsetDelta = b.offset - a.offset;
|
|
59
|
-
if (offsetDelta !== 0) return offsetDelta;
|
|
60
|
-
if (a.label < b.label) return -1;
|
|
61
|
-
if (a.label > b.label) return 1;
|
|
62
|
-
return 0;
|
|
63
|
-
}));
|
|
68
|
+
return 0;
|
|
69
|
+
});
|
|
70
|
+
});
|
|
64
71
|
}
|
|
65
72
|
|
|
66
73
|
componentDidMount() {
|
|
@@ -116,9 +123,19 @@ class TimezonePicker extends React.Component {
|
|
|
116
123
|
selectProps.overrides); // $FlowFixMe
|
|
117
124
|
|
|
118
125
|
selectProps.overrides = selectOverrides;
|
|
126
|
+
let options = this.state.timezones;
|
|
127
|
+
|
|
128
|
+
if (this.props.mapLabels) {
|
|
129
|
+
options = options.map(option => {
|
|
130
|
+
// $FlowFixMe - TimezoneT.label is a string, but mapLabels can return a React.Node
|
|
131
|
+
option.label = this.props.mapLabels(option);
|
|
132
|
+
return option;
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
119
136
|
return /*#__PURE__*/React.createElement(LocaleContext.Consumer, null, locale => /*#__PURE__*/React.createElement(OverriddenSelect, _extends({
|
|
120
137
|
"aria-label": locale.datepicker.timezonePickerAriaLabel,
|
|
121
|
-
options:
|
|
138
|
+
options: options,
|
|
122
139
|
clearable: false,
|
|
123
140
|
disabled: this.props.disabled,
|
|
124
141
|
error: this.props.error,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* eslint-disable header/header */
|
|
2
|
+
export const zones = ['Europe/Andorra', 'Asia/Dubai', 'Asia/Kabul', 'Europe/Tirane', 'Asia/Yerevan', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/Mawson', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/Troll', 'Antarctica/Vostok', 'America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Salta', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/San_Luis', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuaia', 'Pacific/Pago_Pago', 'Europe/Vienna', 'Australia/Lord_Howe', 'Antarctica/Macquarie', 'Australia/Hobart', 'Australia/Melbourne', 'Australia/Sydney', 'Australia/Broken_Hill', 'Australia/Brisbane', 'Australia/Lindeman', 'Australia/Adelaide', 'Australia/Darwin', 'Australia/Perth', 'Australia/Eucla', 'Asia/Baku', 'America/Barbados', 'Asia/Dhaka', 'Europe/Brussels', 'Europe/Sofia', 'Atlantic/Bermuda', 'Asia/Brunei', 'America/La_Paz', 'America/Noronha', 'America/Belem', 'America/Fortaleza', 'America/Recife', 'America/Araguaina', 'America/Maceio', 'America/Bahia', 'America/Sao_Paulo', 'America/Campo_Grande', 'America/Cuiaba', 'America/Santarem', 'America/Porto_Velho', 'America/Boa_Vista', 'America/Manaus', 'America/Eirunepe', 'America/Rio_Branco', 'Asia/Thimphu', 'Europe/Minsk', 'America/Belize', 'America/St_Johns', 'America/Halifax', 'America/Glace_Bay', 'America/Moncton', 'America/Goose_Bay', 'America/Toronto', 'America/Nipigon', 'America/Thunder_Bay', 'America/Iqaluit', 'America/Pangnirtung', 'America/Winnipeg', 'America/Rainy_River', 'America/Resolute', 'America/Rankin_Inlet', 'America/Regina', 'America/Swift_Current', 'America/Edmonton', 'America/Cambridge_Bay', 'America/Yellowknife', 'America/Inuvik', 'America/Dawson_Creek', 'America/Fort_Nelson', 'America/Whitehorse', 'America/Dawson', 'America/Vancouver', 'Indian/Cocos', 'Europe/Zurich', 'Africa/Abidjan', 'Pacific/Rarotonga', 'America/Santiago', 'America/Punta_Arenas', 'Pacific/Easter', 'Asia/Shanghai', 'Asia/Urumqi', 'America/Bogota', 'America/Costa_Rica', 'America/Havana', 'Atlantic/Cape_Verde', 'Indian/Christmas', 'Asia/Nicosia', 'Asia/Famagusta', 'Europe/Prague', 'Europe/Berlin', 'Europe/Copenhagen', 'America/Santo_Domingo', 'Africa/Algiers', 'America/Guayaquil', 'Pacific/Galapagos', 'Europe/Tallinn', 'Africa/Cairo', 'Africa/El_Aaiun', 'Europe/Madrid', 'Africa/Ceuta', 'Atlantic/Canary', 'Europe/Helsinki', 'Pacific/Fiji', 'Atlantic/Stanley', 'Pacific/Chuuk', 'Pacific/Pohnpei', 'Pacific/Kosrae', 'Atlantic/Faroe', 'Europe/Paris', 'Europe/London', 'Asia/Tbilisi', 'America/Cayenne', 'Europe/Gibraltar', 'America/Nuuk', 'America/Danmarkshavn', 'America/Scoresbysund', 'America/Thule', 'Europe/Athens', 'Atlantic/South_Georgia', 'America/Guatemala', 'Pacific/Guam', 'Africa/Bissau', 'America/Guyana', 'Asia/Hong_Kong', 'America/Tegucigalpa', 'America/Port-au-Prince', 'Europe/Budapest', 'Asia/Jakarta', 'Asia/Pontianak', 'Asia/Makassar', 'Asia/Jayapura', 'Europe/Dublin', 'Asia/Jerusalem', 'Asia/Kolkata', 'Indian/Chagos', 'Asia/Baghdad', 'Asia/Tehran', 'Atlantic/Reykjavik', 'Europe/Rome', 'America/Jamaica', 'Asia/Amman', 'Asia/Tokyo', 'Africa/Nairobi', 'Asia/Bishkek', 'Pacific/Tarawa', 'Pacific/Kanton', 'Pacific/Kiritimati', 'Asia/Pyongyang', 'Asia/Seoul', 'Asia/Almaty', 'Asia/Qyzylorda', 'Asia/Qostanay', 'Asia/Aqtobe', 'Asia/Aqtau', 'Asia/Atyrau', 'Asia/Oral', 'Asia/Beirut', 'Asia/Colombo', 'Africa/Monrovia', 'Europe/Vilnius', 'Europe/Luxembourg', 'Europe/Riga', 'Africa/Tripoli', 'Africa/Casablanca', 'Europe/Monaco', 'Europe/Chisinau', 'Pacific/Majuro', 'Pacific/Kwajalein', 'Asia/Yangon', 'Asia/Ulaanbaatar', 'Asia/Hovd', 'Asia/Choibalsan', 'Asia/Macau', 'America/Martinique', 'Europe/Malta', 'Indian/Mauritius', 'Indian/Maldives', 'America/Mexico_City', 'America/Cancun', 'America/Merida', 'America/Monterrey', 'America/Matamoros', 'America/Mazatlan', 'America/Chihuahua', 'America/Ojinaga', 'America/Hermosillo', 'America/Tijuana', 'America/Bahia_Banderas', 'Asia/Kuala_Lumpur', 'Asia/Kuching', 'Africa/Maputo', 'Africa/Windhoek', 'Pacific/Noumea', 'Pacific/Norfolk', 'Africa/Lagos', 'America/Managua', 'Europe/Amsterdam', 'Europe/Oslo', 'Asia/Kathmandu', 'Pacific/Nauru', 'Pacific/Niue', 'Pacific/Auckland', 'Pacific/Chatham', 'America/Panama', 'America/Lima', 'Pacific/Tahiti', 'Pacific/Marquesas', 'Pacific/Gambier', 'Pacific/Port_Moresby', 'Pacific/Bougainville', 'Asia/Manila', 'Asia/Karachi', 'Europe/Warsaw', 'America/Miquelon', 'Pacific/Pitcairn', 'America/Puerto_Rico', 'Asia/Gaza', 'Asia/Hebron', 'Europe/Lisbon', 'Atlantic/Madeira', 'Atlantic/Azores', 'Pacific/Palau', 'America/Asuncion', 'Asia/Qatar', 'Indian/Reunion', 'Europe/Bucharest', 'Europe/Belgrade', 'Europe/Kaliningrad', 'Europe/Moscow', 'Europe/Simferopol', 'Europe/Kirov', 'Europe/Volgograd', 'Europe/Astrakhan', 'Europe/Saratov', 'Europe/Ulyanovsk', 'Europe/Samara', 'Asia/Yekaterinburg', 'Asia/Omsk', 'Asia/Novosibirsk', 'Asia/Barnaul', 'Asia/Tomsk', 'Asia/Novokuznetsk', 'Asia/Krasnoyarsk', 'Asia/Irkutsk', 'Asia/Chita', 'Asia/Yakutsk', 'Asia/Khandyga', 'Asia/Vladivostok', 'Asia/Ust-Nera', 'Asia/Magadan', 'Asia/Sakhalin', 'Asia/Srednekolymsk', 'Asia/Kamchatka', 'Asia/Anadyr', 'Asia/Riyadh', 'Pacific/Guadalcanal', 'Indian/Mahe', 'Africa/Khartoum', 'Europe/Stockholm', 'Asia/Singapore', 'America/Paramaribo', 'Africa/Juba', 'Africa/Sao_Tome', 'America/El_Salvador', 'Asia/Damascus', 'America/Grand_Turk', 'Africa/Ndjamena', 'Indian/Kerguelen', 'Asia/Bangkok', 'Asia/Dushanbe', 'Pacific/Fakaofo', 'Asia/Dili', 'Asia/Ashgabat', 'Africa/Tunis', 'Pacific/Tongatapu', 'Europe/Istanbul', 'Pacific/Funafuti', 'Asia/Taipei', 'Europe/Kiev', 'Europe/Uzhgorod', 'Europe/Zaporozhye', 'Pacific/Wake', 'America/New_York', 'America/Detroit', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Indiana/Indianapolis', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Vevay', 'America/Chicago', 'America/Indiana/Tell_City', 'America/Indiana/Knox', 'America/Menominee', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/North_Dakota/Beulah', 'America/Denver', 'America/Boise', 'America/Phoenix', 'America/Los_Angeles', 'America/Anchorage', 'America/Juneau', 'America/Sitka', 'America/Metlakatla', 'America/Yakutat', 'America/Nome', 'America/Adak', 'Pacific/Honolulu', 'America/Montevideo', 'Asia/Samarkand', 'Asia/Tashkent', 'America/Caracas', 'Asia/Ho_Chi_Minh', 'Pacific/Efate', 'Pacific/Wallis', 'Pacific/Apia', 'Africa/Johannesburg'];
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) Uber Technologies, Inc.
|
|
3
|
+
|
|
4
|
+
This source code is licensed under the MIT license found in the
|
|
5
|
+
LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/* eslint-env node */
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
|
|
11
|
+
const path = require('path');
|
|
12
|
+
|
|
13
|
+
const util = require('util');
|
|
14
|
+
|
|
15
|
+
const exec = util.promisify(require('child_process').exec); // Download tzdata and collect a list of timezones. Baseui previously used a library
|
|
16
|
+
// to do this, but it grew stale and unmaintained. This approach is straightforward
|
|
17
|
+
// enough to update whenever necessary, but future improvements could include building
|
|
18
|
+
// this data set before baseui is published so that the data is always fresh.
|
|
19
|
+
|
|
20
|
+
async function main() {
|
|
21
|
+
try {
|
|
22
|
+
const tmpDir = path.join(__dirname, 'tmp'); // $FlowFixMe - flow is not aware of recursive option
|
|
23
|
+
|
|
24
|
+
await fs.promises.rmdir(tmpDir, {
|
|
25
|
+
recursive: true
|
|
26
|
+
});
|
|
27
|
+
await fs.promises.mkdir(tmpDir);
|
|
28
|
+
const src = `https://www.iana.org/time-zones/repository/tzdata-latest.tar.gz`;
|
|
29
|
+
await exec(`curl -L ${src} | gzip -dc | tar -xf - --directory ${tmpDir}`);
|
|
30
|
+
const zoneTabPath = path.join(tmpDir, 'zone1970.tab');
|
|
31
|
+
const content = await fs.promises.readFile(zoneTabPath, 'utf-8');
|
|
32
|
+
const lines = content.split('\n');
|
|
33
|
+
const zones = [];
|
|
34
|
+
|
|
35
|
+
for (const line of lines) {
|
|
36
|
+
if (line[0] === '#') {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const parts = line.split(/\s+/);
|
|
41
|
+
|
|
42
|
+
if (parts.length >= 3) {
|
|
43
|
+
zones.push(parts[2]);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const file = [];
|
|
48
|
+
file.push('/* eslint-disable header/header */');
|
|
49
|
+
file.push('// @flow');
|
|
50
|
+
file.push('');
|
|
51
|
+
file.push('export const zones = [');
|
|
52
|
+
|
|
53
|
+
for (const zone of zones) {
|
|
54
|
+
file.push(` '${zone}',`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
file.push('];');
|
|
58
|
+
const tzdataPath = path.join(__dirname, 'tzdata.js');
|
|
59
|
+
await fs.promises.writeFile(tzdataPath, file.join('\n')); // $FlowFixMe - flow is not aware of recursive option
|
|
60
|
+
|
|
61
|
+
await fs.promises.rmdir(tmpDir, {
|
|
62
|
+
recursive: true
|
|
63
|
+
});
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error(error);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
main();
|
|
@@ -18,12 +18,23 @@ function getBackgroundColor(kind, type, theme) {
|
|
|
18
18
|
}[kind];
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function getFontColor(kind, theme) {
|
|
21
|
+
function getFontColor(kind, type, theme) {
|
|
22
|
+
const isInline = type === TYPE.inline;
|
|
23
|
+
|
|
24
|
+
if (isInline) {
|
|
25
|
+
return {
|
|
26
|
+
[KIND.info]: theme.colors.notificationInfoText,
|
|
27
|
+
[KIND.positive]: theme.colors.notificationPositiveText,
|
|
28
|
+
[KIND.warning]: theme.colors.notificationWarningText,
|
|
29
|
+
[KIND.negative]: theme.colors.notificationNegativeText
|
|
30
|
+
}[kind];
|
|
31
|
+
}
|
|
32
|
+
|
|
22
33
|
return {
|
|
23
|
-
[KIND.info]: theme.colors.
|
|
24
|
-
[KIND.positive]: theme.colors.
|
|
25
|
-
[KIND.warning]: theme.colors.
|
|
26
|
-
[KIND.negative]: theme.colors.
|
|
34
|
+
[KIND.info]: theme.colors.toastInfoText,
|
|
35
|
+
[KIND.positive]: theme.colors.toastPositiveText,
|
|
36
|
+
[KIND.warning]: theme.colors.toastWarningText,
|
|
37
|
+
[KIND.negative]: theme.colors.toastNegativeText
|
|
27
38
|
}[kind];
|
|
28
39
|
}
|
|
29
40
|
|
|
@@ -99,9 +110,9 @@ export const Body = styled('div', props => {
|
|
|
99
110
|
$theme
|
|
100
111
|
} = props;
|
|
101
112
|
const isInline = $type === TYPE.inline;
|
|
102
|
-
return { ...$theme.typography.
|
|
113
|
+
return { ...$theme.typography.font300,
|
|
103
114
|
pointerEvents: 'auto',
|
|
104
|
-
color:
|
|
115
|
+
color: getFontColor($kind, $type, $theme),
|
|
105
116
|
height: 'auto',
|
|
106
117
|
width: '288px',
|
|
107
118
|
paddingTop: $theme.sizing.scale600,
|
package/esm/a11y/a11y.js
CHANGED
|
@@ -21,7 +21,7 @@ LICENSE file in the root directory of this source tree.
|
|
|
21
21
|
import * as React from 'react';
|
|
22
22
|
import axe from 'axe-core';
|
|
23
23
|
import { Layer, TetherBehavior, TETHER_PLACEMENT } from '../layer/index.js';
|
|
24
|
-
import {
|
|
24
|
+
import { ParagraphSmall, ParagraphXSmall } from '../typography/index.js';
|
|
25
25
|
import { styled } from '../styles/index.js';
|
|
26
26
|
import { ThemeContext } from '../styles/theme-provider.js';
|
|
27
27
|
|
|
@@ -128,8 +128,8 @@ function Violation(props) {
|
|
|
128
128
|
ref: setPopper,
|
|
129
129
|
$top: "".concat(offset.top, "px") || '0px',
|
|
130
130
|
$left: "".concat(offset.left, "px") || '0px'
|
|
131
|
-
}, /*#__PURE__*/React.createElement(
|
|
132
|
-
return /*#__PURE__*/React.createElement(
|
|
131
|
+
}, /*#__PURE__*/React.createElement(ParagraphXSmall, null, props.target), props.violations.map(function (violation, index) {
|
|
132
|
+
return /*#__PURE__*/React.createElement(ParagraphSmall, {
|
|
133
133
|
key: index
|
|
134
134
|
}, violation.description);
|
|
135
135
|
}))));
|