baseui 10.11.1 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/accordion/accordion.js +60 -13
- package/accordion/accordion.js.flow +49 -12
- package/accordion/index.d.ts +0 -3
- package/accordion/panel.js +7 -6
- package/accordion/panel.js.flow +20 -20
- package/accordion/stateless-accordion.js +2 -4
- package/accordion/stateless-accordion.js.flow +0 -2
- package/accordion/types.js.flow +0 -5
- package/button/constants.js +1 -2
- package/button/constants.js.flow +0 -1
- package/button/index.d.ts +0 -1
- package/button/styled-components.js +2 -29
- package/button/styled-components.js.flow +2 -30
- package/checkbox/checkbox.js +6 -30
- package/checkbox/checkbox.js.flow +7 -38
- package/checkbox/constants.js +2 -1
- package/checkbox/constants.js.flow +2 -1
- package/checkbox/index.d.ts +4 -6
- package/checkbox/index.js +0 -6
- package/checkbox/index.js.flow +0 -1
- package/checkbox/styled-components.js +52 -149
- package/checkbox/styled-components.js.flow +59 -165
- package/checkbox/types.js.flow +0 -5
- package/data-table/column-categorical.js +1 -1
- package/data-table/column-categorical.js.flow +1 -1
- package/data-table/column-datetime.js +1 -1
- package/data-table/column-datetime.js.flow +3 -1
- package/data-table/column.js +6 -2
- package/data-table/column.js.flow +9 -7
- package/data-table/data-table.js +1 -1
- package/data-table/data-table.js.flow +1 -1
- package/data-table/header-cell.js +3 -0
- package/data-table/header-cell.js.flow +1 -1
- package/datepicker/calendar.js +15 -7
- package/datepicker/calendar.js.flow +23 -9
- package/datepicker/constants.js +12 -2
- package/datepicker/constants.js.flow +10 -0
- package/datepicker/datepicker.js +61 -30
- package/datepicker/datepicker.js.flow +77 -37
- package/datepicker/day.js +85 -34
- package/datepicker/day.js.flow +118 -54
- package/datepicker/locale.js.flow +0 -1
- package/datepicker/month.js +3 -1
- package/datepicker/month.js.flow +2 -0
- package/datepicker/stateful-container.js.flow +2 -1
- package/datepicker/styled-components.js +23 -1
- package/datepicker/styled-components.js.flow +12 -2
- package/datepicker/types.js.flow +35 -10
- package/datepicker/utils/date-helpers.js +30 -0
- package/datepicker/utils/date-helpers.js.flow +12 -0
- package/datepicker/week.js +3 -1
- package/datepicker/week.js.flow +2 -0
- package/es/accordion/accordion.js +52 -12
- package/es/accordion/panel.js +7 -5
- package/es/accordion/stateless-accordion.js +2 -4
- package/es/button/constants.js +1 -2
- package/es/button/styled-components.js +2 -29
- package/es/checkbox/checkbox.js +7 -32
- package/es/checkbox/constants.js +2 -1
- package/es/checkbox/index.js +1 -1
- package/es/checkbox/styled-components.js +51 -146
- package/es/data-table/column-categorical.js +1 -1
- package/es/data-table/column-datetime.js +1 -1
- package/es/data-table/column.js +6 -2
- package/es/data-table/data-table.js +1 -1
- package/es/data-table/header-cell.js +3 -0
- package/es/datepicker/calendar.js +15 -7
- package/es/datepicker/constants.js +8 -0
- package/es/datepicker/datepicker.js +56 -29
- package/es/datepicker/day.js +77 -34
- package/es/datepicker/month.js +3 -1
- package/es/datepicker/styled-components.js +8 -2
- package/es/datepicker/types.js +1 -1
- package/es/datepicker/utils/date-helpers.js +16 -0
- package/es/datepicker/week.js +3 -1
- package/es/file-uploader/file-uploader.js +4 -4
- package/es/header-navigation/styled-components.js +3 -3
- package/es/helpers/overrides.js +1 -2
- package/es/input/styled-components.js +4 -4
- package/es/layer/layer.js +4 -4
- package/es/locale/index.js +0 -7
- package/es/menu/stateful-container.js +0 -1
- package/es/menu/styled-components.js +1 -1
- package/es/modal/index.js +1 -1
- package/es/modal/modal.js +19 -65
- package/es/modal/styled-components.js +12 -48
- package/es/phone-input/default-props.js +1 -1
- package/es/phone-input/index.js +0 -4
- package/es/phone-input/phone-input-lite.js +55 -31
- package/es/radio/radio.js +1 -7
- package/es/radio/radiogroup.js +3 -28
- package/es/radio/styled-components.js +4 -5
- package/es/rating/styled-components.js +3 -3
- package/es/select/index.js +1 -2
- package/es/select/select-component.js +32 -20
- package/es/select/styled-components.js +4 -4
- package/es/snackbar/styled-components.js +2 -2
- package/es/spinner/index.js +3 -9
- package/es/spinner/styled-components.js +2 -32
- package/es/table/filter.js +3 -3
- package/es/tag/styled-components.js +1 -1
- package/es/themes/dark-theme/color-component-tokens.js +0 -38
- package/es/themes/dark-theme/color-tokens.js +0 -2
- package/es/themes/dark-theme/create-dark-theme.js +0 -2
- package/es/themes/dark-theme/dark-theme.js +0 -2
- package/es/themes/light-theme/color-component-tokens.js +0 -38
- package/es/themes/light-theme/color-tokens.js +0 -2
- package/es/themes/light-theme/create-light-theme.js +0 -2
- package/es/themes/light-theme/light-theme.js +0 -2
- package/es/timepicker/timepicker.js +1 -8
- package/es/typography/index.js +1 -31
- package/esm/accordion/accordion.js +60 -13
- package/esm/accordion/panel.js +7 -6
- package/esm/accordion/stateless-accordion.js +2 -4
- package/esm/button/constants.js +1 -2
- package/esm/button/styled-components.js +2 -29
- package/esm/checkbox/checkbox.js +7 -30
- package/esm/checkbox/constants.js +2 -1
- package/esm/checkbox/index.js +1 -1
- package/esm/checkbox/styled-components.js +52 -147
- package/esm/data-table/column-categorical.js +1 -1
- package/esm/data-table/column-datetime.js +1 -1
- package/esm/data-table/column.js +6 -2
- package/esm/data-table/data-table.js +1 -1
- package/esm/data-table/header-cell.js +3 -0
- package/esm/datepicker/calendar.js +15 -7
- package/esm/datepicker/constants.js +8 -0
- package/esm/datepicker/datepicker.js +60 -30
- package/esm/datepicker/day.js +84 -34
- package/esm/datepicker/month.js +3 -1
- package/esm/datepicker/styled-components.js +24 -2
- package/esm/datepicker/types.js +1 -1
- package/esm/datepicker/utils/date-helpers.js +30 -0
- package/esm/datepicker/week.js +3 -1
- package/esm/file-uploader/file-uploader.js +4 -4
- package/esm/header-navigation/styled-components.js +3 -3
- package/esm/helpers/overrides.js +1 -2
- package/esm/input/styled-components.js +4 -4
- package/esm/layer/layer.js +4 -4
- package/esm/locale/index.js +0 -7
- package/esm/menu/stateful-container.js +0 -1
- package/esm/menu/styled-components.js +1 -1
- package/esm/modal/index.js +1 -1
- package/esm/modal/modal.js +28 -71
- package/esm/modal/styled-components.js +6 -38
- package/esm/phone-input/default-props.js +1 -1
- package/esm/phone-input/index.js +0 -4
- package/esm/phone-input/phone-input-lite.js +60 -37
- package/esm/radio/radio.js +1 -7
- package/esm/radio/radiogroup.js +3 -28
- package/esm/radio/styled-components.js +4 -5
- package/esm/rating/styled-components.js +3 -3
- package/esm/select/index.js +1 -2
- package/esm/select/select-component.js +34 -19
- package/esm/select/styled-components.js +4 -4
- package/esm/snackbar/styled-components.js +2 -2
- package/esm/spinner/index.js +3 -9
- package/esm/spinner/styled-components.js +2 -40
- package/esm/table/filter.js +3 -3
- package/esm/tag/styled-components.js +1 -1
- package/esm/themes/dark-theme/color-component-tokens.js +0 -38
- package/esm/themes/dark-theme/color-tokens.js +0 -2
- package/esm/themes/dark-theme/create-dark-theme.js +1 -2
- package/esm/themes/dark-theme/dark-theme.js +1 -2
- package/esm/themes/light-theme/color-component-tokens.js +0 -38
- package/esm/themes/light-theme/color-tokens.js +0 -2
- package/esm/themes/light-theme/create-light-theme.js +1 -2
- package/esm/themes/light-theme/light-theme.js +1 -2
- package/esm/timepicker/timepicker.js +1 -8
- package/esm/typography/index.js +1 -35
- package/file-uploader/file-uploader.js +3 -3
- package/file-uploader/file-uploader.js.flow +4 -4
- package/header-navigation/styled-components.js +3 -3
- package/header-navigation/styled-components.js.flow +3 -3
- package/helpers/overrides.js +1 -2
- package/helpers/overrides.js.flow +1 -1
- package/input/index.d.ts +5 -9
- package/input/styled-components.js +4 -4
- package/input/styled-components.js.flow +4 -4
- package/layer/layer.js +4 -4
- package/layer/layer.js.flow +4 -3
- package/locale/index.js +0 -7
- package/locale/index.js.flow +0 -7
- package/locale.ts +0 -1
- package/menu/index.d.ts +1 -3
- package/menu/stateful-container.js +0 -1
- package/menu/stateful-container.js.flow +0 -1
- package/menu/styled-components.js +1 -1
- package/menu/styled-components.js.flow +1 -1
- package/modal/index.d.ts +4 -6
- package/modal/index.js +0 -6
- package/modal/index.js.flow +0 -1
- package/modal/modal.js +27 -70
- package/modal/modal.js.flow +17 -83
- package/modal/styled-components.js +7 -40
- package/modal/styled-components.js.flow +12 -44
- package/modal/types.js.flow +1 -10
- package/package.json +10 -10
- package/phone-input/default-props.js +1 -1
- package/phone-input/default-props.js.flow +1 -1
- package/phone-input/index.d.ts +0 -1
- package/phone-input/index.js +0 -36
- package/phone-input/index.js.flow +0 -4
- package/phone-input/phone-input-lite.js +63 -38
- package/phone-input/phone-input-lite.js.flow +66 -44
- package/progress-bar/index.d.ts +3 -3
- package/radio/index.d.ts +4 -9
- package/radio/radio.js +1 -7
- package/radio/radio.js.flow +1 -8
- package/radio/radiogroup.js +3 -28
- package/radio/radiogroup.js.flow +2 -26
- package/radio/styled-components.js +4 -5
- package/radio/styled-components.js.flow +3 -4
- package/radio/types.js.flow +4 -15
- package/rating/styled-components.js +3 -3
- package/rating/styled-components.js.flow +3 -3
- package/select/index.d.ts +8 -3
- package/select/index.js +0 -6
- package/select/index.js.flow +0 -2
- package/select/select-component.js +34 -19
- package/select/select-component.js.flow +29 -13
- package/select/styled-components.js +4 -4
- package/select/styled-components.js.flow +4 -4
- package/select/types.js.flow +11 -7
- package/snackbar/styled-components.js +1 -1
- package/snackbar/styled-components.js.flow +11 -11
- package/spinner/index.d.ts +5 -18
- package/spinner/index.js +2 -68
- package/spinner/index.js.flow +2 -27
- package/spinner/styled-components.js +9 -45
- package/spinner/styled-components.js.flow +2 -34
- package/spinner/types.js.flow +1 -19
- package/styles/types.js.flow +0 -2
- package/table/filter.js +3 -3
- package/table/filter.js.flow +3 -3
- package/tag/styled-components.js +1 -1
- package/tag/styled-components.js.flow +1 -1
- package/theme.ts +0 -81
- package/themes/dark-theme/color-component-tokens.js +0 -38
- package/themes/dark-theme/color-component-tokens.js.flow +0 -42
- package/themes/dark-theme/color-tokens.js +0 -2
- package/themes/dark-theme/color-tokens.js.flow +0 -2
- package/themes/dark-theme/create-dark-theme.js +1 -3
- package/themes/dark-theme/create-dark-theme.js.flow +0 -2
- package/themes/dark-theme/dark-theme.js +1 -3
- package/themes/dark-theme/dark-theme.js.flow +0 -2
- package/themes/light-theme/color-component-tokens.js +0 -38
- package/themes/light-theme/color-component-tokens.js.flow +0 -43
- package/themes/light-theme/color-tokens.js +0 -2
- package/themes/light-theme/color-tokens.js.flow +0 -2
- package/themes/light-theme/create-light-theme.js +1 -3
- package/themes/light-theme/create-light-theme.js.flow +0 -2
- package/themes/light-theme/light-theme.js +1 -3
- package/themes/light-theme/light-theme.js.flow +0 -2
- package/themes/types.js.flow +0 -68
- package/timepicker/timepicker.js +1 -8
- package/timepicker/timepicker.js.flow +4 -10
- package/typography/index.d.ts +0 -23
- package/typography/index.js +2 -57
- package/typography/index.js.flow +0 -31
- package/es/spinner/spinner.js +0 -68
- package/es/themes/dark-theme/color-deprecated-semantic-tokens.js +0 -35
- package/es/themes/light-theme/color-deprecated-semantic-tokens.js +0 -35
- package/esm/spinner/spinner.js +0 -125
- package/esm/themes/dark-theme/color-deprecated-semantic-tokens.js +0 -38
- package/esm/themes/light-theme/color-deprecated-semantic-tokens.js +0 -38
- package/spinner/spinner.js +0 -136
- package/spinner/spinner.js.flow +0 -75
- package/themes/dark-theme/color-deprecated-semantic-tokens.js +0 -50
- package/themes/dark-theme/color-deprecated-semantic-tokens.js.flow +0 -42
- package/themes/light-theme/color-deprecated-semantic-tokens.js +0 -50
- package/themes/light-theme/color-deprecated-semantic-tokens.js.flow +0 -42
|
@@ -43,67 +43,31 @@ export const Root = styled('div', props => {
|
|
|
43
43
|
};
|
|
44
44
|
});
|
|
45
45
|
Root.displayName = "Root";
|
|
46
|
-
export const Backdrop = styled('div', props => {
|
|
47
|
-
const {
|
|
48
|
-
$animate,
|
|
49
|
-
$isOpen,
|
|
50
|
-
$isVisible,
|
|
51
|
-
$theme,
|
|
52
|
-
$unstable_ModalBackdropScroll
|
|
53
|
-
} = props;
|
|
54
|
-
|
|
55
|
-
if ($unstable_ModalBackdropScroll) {
|
|
56
|
-
return {};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return {
|
|
60
|
-
position: 'fixed',
|
|
61
|
-
right: 0,
|
|
62
|
-
bottom: 0,
|
|
63
|
-
top: 0,
|
|
64
|
-
left: 0,
|
|
65
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
66
|
-
// Remove grey highlight
|
|
67
|
-
WebkitTapHighlightColor: 'transparent',
|
|
68
|
-
// Disable scroll capabilities.
|
|
69
|
-
touchAction: 'none',
|
|
70
|
-
opacity: $isVisible && $isOpen ? 1 : 0,
|
|
71
|
-
...($animate ? {
|
|
72
|
-
transitionProperty: 'opacity',
|
|
73
|
-
transitionDuration: $theme.animation.timing400,
|
|
74
|
-
transitionTimingFunction: $theme.animation.easeOutCurve
|
|
75
|
-
} : null)
|
|
76
|
-
};
|
|
77
|
-
});
|
|
78
|
-
Backdrop.displayName = "Backdrop";
|
|
79
46
|
export const DialogContainer = styled('div', props => {
|
|
80
47
|
const {
|
|
81
48
|
$animate,
|
|
82
49
|
$isOpen,
|
|
83
50
|
$isVisible,
|
|
84
|
-
$theme
|
|
85
|
-
$unstable_ModalBackdropScroll
|
|
51
|
+
$theme
|
|
86
52
|
} = props;
|
|
53
|
+
const animationRules = {
|
|
54
|
+
transitionProperty: 'opacity',
|
|
55
|
+
transitionDuration: $theme.animation.timing400,
|
|
56
|
+
transitionTimingFunction: $theme.animation.easeOutCurve
|
|
57
|
+
};
|
|
87
58
|
return {
|
|
88
59
|
display: 'flex',
|
|
89
60
|
alignItems: 'center',
|
|
90
61
|
justifyContent: 'center',
|
|
91
62
|
width: '100%',
|
|
92
63
|
minHeight: '100%',
|
|
93
|
-
pointerEvents: 'none',
|
|
94
64
|
userSelect: 'none',
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
...($animate ? {
|
|
102
|
-
transitionProperty: 'opacity',
|
|
103
|
-
transitionDuration: $theme.animation.timing400,
|
|
104
|
-
transitionTimingFunction: $theme.animation.easeOutCurve
|
|
105
|
-
} : null)
|
|
106
|
-
} : {})
|
|
65
|
+
pointerEvents: 'auto',
|
|
66
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
67
|
+
// Remove grey highlight
|
|
68
|
+
WebkitTapHighlightColor: 'transparent',
|
|
69
|
+
opacity: $isVisible && $isOpen ? 1 : 0,
|
|
70
|
+
...($animate ? animationRules : null)
|
|
107
71
|
};
|
|
108
72
|
});
|
|
109
73
|
DialogContainer.displayName = "DialogContainer";
|
package/es/phone-input/index.js
CHANGED
|
@@ -6,13 +6,9 @@ LICENSE file in the root directory of this source tree.
|
|
|
6
6
|
*/
|
|
7
7
|
export { default as PhoneInput } from './phone-input.js';
|
|
8
8
|
export { default as PhoneInputLite } from './phone-input-lite.js';
|
|
9
|
-
export { default as PhoneInputNext } from './phone-input-next.js';
|
|
10
9
|
export { default as StatefulPhoneInput } from './stateful-phone-input.js';
|
|
11
|
-
export { default as StatefulPhoneInputNext } from './stateful-phone-input-next.js';
|
|
12
10
|
export { default as StatefulPhoneInputContainer } from './stateful-phone-input-container.js';
|
|
13
11
|
export { default as CountryPicker } from './country-picker.js';
|
|
14
|
-
export { default as CountrySelect } from './country-select.js';
|
|
15
|
-
export { default as CountrySelectDropdown } from './country-select-dropdown.js';
|
|
16
12
|
export { default as Flag, StyledFlag } from './flag.js';
|
|
17
13
|
export * from './constants.js';
|
|
18
14
|
export * from './styled-components.js';
|
|
@@ -7,20 +7,18 @@ This source code is licensed under the MIT license found in the
|
|
|
7
7
|
LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
import React, { useRef } from 'react';
|
|
10
|
+
import CountryPicker from './country-picker.js';
|
|
11
|
+
import defaultProps from './default-props.js';
|
|
12
|
+
import { StyledPhoneInputRoot, StyledDialCode } from './styled-components.js';
|
|
10
13
|
import { Input as DefaultInput } from '../input/index.js';
|
|
11
|
-
import CountrySelect from './country-select.js';
|
|
12
14
|
import { getOverrides, mergeOverrides } from '../helpers/overrides.js';
|
|
13
|
-
|
|
14
|
-
const {
|
|
15
|
-
country,
|
|
16
|
-
...lightDefaultProps
|
|
17
|
-
} = defaultProps;
|
|
18
|
-
PhoneInputLite.defaultProps = lightDefaultProps;
|
|
15
|
+
PhoneInputLite.defaultProps = defaultProps;
|
|
19
16
|
export default function PhoneInputLite(props) {
|
|
20
17
|
const {
|
|
21
18
|
'aria-label': ariaLabel,
|
|
22
19
|
'aria-labelledby': ariaLabelledBy,
|
|
23
20
|
'aria-describedby': ariaDescribedBy,
|
|
21
|
+
clearable,
|
|
24
22
|
countries,
|
|
25
23
|
country,
|
|
26
24
|
disabled,
|
|
@@ -41,38 +39,63 @@ export default function PhoneInputLite(props) {
|
|
|
41
39
|
...restProps
|
|
42
40
|
} = props;
|
|
43
41
|
const inputRef = useRef(null);
|
|
42
|
+
const baseDialCodeOverride = {
|
|
43
|
+
component: StyledDialCode,
|
|
44
|
+
style: ({
|
|
45
|
+
$theme: {
|
|
46
|
+
direction,
|
|
47
|
+
sizing
|
|
48
|
+
}
|
|
49
|
+
}) => {
|
|
50
|
+
const marginDir = direction === 'rtl' ? 'marginRight' : 'marginLeft';
|
|
51
|
+
return {
|
|
52
|
+
[marginDir]: sizing.scale600
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
props: {
|
|
56
|
+
children: country.dialCode
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const mergedDialCodeOverride = mergeOverrides({
|
|
60
|
+
DialCode: baseDialCodeOverride
|
|
61
|
+
}, {
|
|
62
|
+
DialCode: overrides.DialCode || {}
|
|
63
|
+
});
|
|
44
64
|
const baseOverrides = {
|
|
45
65
|
Input: {
|
|
46
66
|
style: ({
|
|
47
67
|
$theme: {
|
|
68
|
+
direction,
|
|
48
69
|
sizing
|
|
49
70
|
}
|
|
50
|
-
}) =>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
component: CountrySelect,
|
|
56
|
-
props: {
|
|
57
|
-
countries,
|
|
58
|
-
country,
|
|
59
|
-
disabled,
|
|
60
|
-
error,
|
|
61
|
-
inputRef,
|
|
62
|
-
mapIsoToLabel,
|
|
63
|
-
maxDropdownHeight,
|
|
64
|
-
maxDropdownWidth,
|
|
65
|
-
onCountryChange,
|
|
66
|
-
overrides,
|
|
67
|
-
positive,
|
|
68
|
-
required,
|
|
69
|
-
size
|
|
71
|
+
}) => {
|
|
72
|
+
const paddingDir = direction === 'rtl' ? 'paddingRight' : 'paddingLeft';
|
|
73
|
+
return {
|
|
74
|
+
[paddingDir]: sizing.scale100
|
|
75
|
+
};
|
|
70
76
|
}
|
|
71
|
-
}
|
|
77
|
+
},
|
|
78
|
+
Before: mergedDialCodeOverride.DialCode
|
|
72
79
|
};
|
|
80
|
+
const [Root, rootProps] = getOverrides(overrides.Root, StyledPhoneInputRoot);
|
|
73
81
|
const [Input, inputProps] = getOverrides(overrides.Input, DefaultInput);
|
|
74
82
|
inputProps.overrides = mergeOverrides(baseOverrides, inputProps.overrides);
|
|
75
|
-
return /*#__PURE__*/React.createElement(
|
|
83
|
+
return /*#__PURE__*/React.createElement(Root, _extends({}, rootProps, {
|
|
84
|
+
"data-baseweb": "phone-input"
|
|
85
|
+
}), /*#__PURE__*/React.createElement(CountryPicker, {
|
|
86
|
+
country: country,
|
|
87
|
+
countries: countries,
|
|
88
|
+
disabled: disabled,
|
|
89
|
+
error: error,
|
|
90
|
+
mapIsoToLabel: mapIsoToLabel,
|
|
91
|
+
maxDropdownHeight: maxDropdownHeight,
|
|
92
|
+
maxDropdownWidth: maxDropdownWidth,
|
|
93
|
+
onCountryChange: onCountryChange,
|
|
94
|
+
overrides: overrides,
|
|
95
|
+
positive: positive,
|
|
96
|
+
required: required,
|
|
97
|
+
size: size
|
|
98
|
+
}), /*#__PURE__*/React.createElement(Input, _extends({
|
|
76
99
|
"aria-label": ariaLabel,
|
|
77
100
|
"aria-labelledby": ariaLabelledBy,
|
|
78
101
|
"aria-describedby": ariaDescribedBy,
|
|
@@ -89,6 +112,7 @@ export default function PhoneInputLite(props) {
|
|
|
89
112
|
placeholder: placeholder,
|
|
90
113
|
size: size,
|
|
91
114
|
type: "text",
|
|
92
|
-
value: text
|
|
93
|
-
|
|
115
|
+
value: text,
|
|
116
|
+
clearable: clearable
|
|
117
|
+
}, restProps, inputProps)));
|
|
94
118
|
}
|
package/es/radio/radio.js
CHANGED
|
@@ -64,10 +64,6 @@ class Radio extends React.Component {
|
|
|
64
64
|
if (this.props.autoFocus && this.props.inputRef?.current) {
|
|
65
65
|
this.props.inputRef.current.focus();
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
if (process.env.NODE_ENV !== "production" && this.props.isError) {
|
|
69
|
-
console.warn('baseui:Radio Property "isError" will be removed in the next major version. Use "error" property instead.');
|
|
70
|
-
}
|
|
71
67
|
}
|
|
72
68
|
|
|
73
69
|
render() {
|
|
@@ -86,7 +82,6 @@ class Radio extends React.Component {
|
|
|
86
82
|
$disabled: this.props.disabled,
|
|
87
83
|
$hasDescription: !!this.props.description,
|
|
88
84
|
$isActive: this.state.isActive,
|
|
89
|
-
$isError: this.props.isError,
|
|
90
85
|
$error: this.props.error,
|
|
91
86
|
$isFocused: this.props.isFocused,
|
|
92
87
|
$isFocusVisible: this.props.isFocused && this.props.isFocusVisible,
|
|
@@ -109,7 +104,7 @@ class Radio extends React.Component {
|
|
|
109
104
|
onMouseDown: this.onMouseDown,
|
|
110
105
|
onMouseUp: this.onMouseUp
|
|
111
106
|
}, sharedProps, rootProps), isLabelTopLeft(this.props.labelPlacement) && label, /*#__PURE__*/React.createElement(RadioMarkOuter, _extends({}, sharedProps, radioMarkOuterProps), /*#__PURE__*/React.createElement(RadioMarkInner, _extends({}, sharedProps, radioMarkInnerProps))), /*#__PURE__*/React.createElement(Input, _extends({
|
|
112
|
-
"aria-invalid": this.props.error ||
|
|
107
|
+
"aria-invalid": this.props.error || null,
|
|
113
108
|
checked: this.props.checked,
|
|
114
109
|
disabled: this.props.disabled,
|
|
115
110
|
name: this.props.name,
|
|
@@ -137,7 +132,6 @@ _defineProperty(Radio, "defaultProps", {
|
|
|
137
132
|
autoFocus: false,
|
|
138
133
|
inputRef: /*#__PURE__*/React.createRef(),
|
|
139
134
|
align: 'vertical',
|
|
140
|
-
isError: false,
|
|
141
135
|
error: false,
|
|
142
136
|
onChange: () => {},
|
|
143
137
|
onMouseEnter: () => {},
|
package/es/radio/radiogroup.js
CHANGED
|
@@ -49,41 +49,22 @@ class StatelessRadioGroup extends React.Component {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
componentDidMount() {
|
|
53
|
-
if (process.env.NODE_ENV !== "production" && this.props.isError) {
|
|
54
|
-
console.warn('baseui:Radio Property "isError" will be removed in the next major version. Use "error" property instead.');
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
52
|
render() {
|
|
59
53
|
const {
|
|
60
54
|
overrides = {}
|
|
61
55
|
} = this.props;
|
|
62
56
|
const [RadioGroupRoot, radioGroupRootProps] = getOverrides(overrides.RadioGroupRoot, StyledRadioGroupRoot);
|
|
63
|
-
|
|
64
|
-
if (process.env.NODE_ENV !== "production") {
|
|
65
|
-
const overrideKeys = Object.keys(overrides); // TODO(v11)
|
|
66
|
-
|
|
67
|
-
if (Boolean(overrideKeys.length) && !overrideKeys.includes('RadioGroupRoot')) {
|
|
68
|
-
// eslint-disable-next-line no-console
|
|
69
|
-
console.warn(`All overrides beside 'RadioGroupRoot' will be deprecated in the next major version update.
|
|
70
|
-
Pass other overrides to the 'Radio' children instead.
|
|
71
|
-
`);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
57
|
return /*#__PURE__*/React.createElement(RadioGroupRoot, _extends({
|
|
76
58
|
id: this.props.id,
|
|
77
59
|
role: "radiogroup",
|
|
78
60
|
"aria-describedby": this.props['aria-describedby'],
|
|
79
61
|
"aria-errormessage": this.props['aria-errormessage'],
|
|
80
|
-
"aria-invalid": this.props.error ||
|
|
62
|
+
"aria-invalid": this.props.error || null,
|
|
81
63
|
"aria-label": this.props['aria-label'],
|
|
82
64
|
"aria-labelledby": this.props['aria-labelledby'],
|
|
83
65
|
$align: this.props.align,
|
|
84
66
|
$disabled: this.props.disabled,
|
|
85
|
-
$
|
|
86
|
-
$error: this.props.error || this.props.isError,
|
|
67
|
+
$error: this.props.error,
|
|
87
68
|
$required: this.props.required
|
|
88
69
|
}, radioGroupRootProps), React.Children.map(this.props.children, (child, index) => {
|
|
89
70
|
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
@@ -96,7 +77,6 @@ class StatelessRadioGroup extends React.Component {
|
|
|
96
77
|
autoFocus: this.props.autoFocus,
|
|
97
78
|
checked,
|
|
98
79
|
disabled: this.props.disabled || child.props.disabled,
|
|
99
|
-
isError: this.props.isError,
|
|
100
80
|
error: this.props.error,
|
|
101
81
|
isFocused: this.state.focusedRadioIndex === index,
|
|
102
82
|
isFocusVisible: this.state.isFocusVisible,
|
|
@@ -107,11 +87,7 @@ class StatelessRadioGroup extends React.Component {
|
|
|
107
87
|
onFocus: e => this.handleFocus(e, index),
|
|
108
88
|
onChange: this.props.onChange,
|
|
109
89
|
onMouseEnter: this.props.onMouseEnter,
|
|
110
|
-
onMouseLeave: this.props.onMouseLeave
|
|
111
|
-
// will need to remove overrides pass-through on next major version
|
|
112
|
-
overrides: { ...this.props.overrides,
|
|
113
|
-
...child.props.overrides
|
|
114
|
-
}
|
|
90
|
+
onMouseLeave: this.props.onMouseLeave
|
|
115
91
|
});
|
|
116
92
|
}));
|
|
117
93
|
}
|
|
@@ -125,7 +101,6 @@ _defineProperty(StatelessRadioGroup, "defaultProps", {
|
|
|
125
101
|
autoFocus: false,
|
|
126
102
|
labelPlacement: 'right',
|
|
127
103
|
align: 'vertical',
|
|
128
|
-
isError: false,
|
|
129
104
|
error: false,
|
|
130
105
|
required: false,
|
|
131
106
|
onChange: () => {},
|
|
@@ -23,17 +23,16 @@ function getOuterColor(props) {
|
|
|
23
23
|
$disabled,
|
|
24
24
|
$checked,
|
|
25
25
|
$isFocusVisible,
|
|
26
|
-
$error
|
|
27
|
-
$isError
|
|
26
|
+
$error
|
|
28
27
|
} = props;
|
|
29
28
|
if ($disabled) return colors.tickFillDisabled;
|
|
30
29
|
|
|
31
30
|
if (!$checked) {
|
|
32
31
|
if ($isFocusVisible) return colors.borderSelected;
|
|
33
|
-
if ($error
|
|
32
|
+
if ($error) return colors.tickBorderError;
|
|
34
33
|
return colors.tickBorder;
|
|
35
34
|
} else {
|
|
36
|
-
if ($error
|
|
35
|
+
if ($error) {
|
|
37
36
|
switch (getState(props)) {
|
|
38
37
|
case DEFAULT:
|
|
39
38
|
return colors.tickFillErrorSelected;
|
|
@@ -71,7 +70,7 @@ function getInnerColor(props) {
|
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
if (!props.$checked) {
|
|
74
|
-
if (props.$error
|
|
73
|
+
if (props.$error) {
|
|
75
74
|
switch (getState(props)) {
|
|
76
75
|
case DEFAULT:
|
|
77
76
|
return colors.tickFillError;
|
|
@@ -40,11 +40,11 @@ export const StyledStar = styled('li', ({
|
|
|
40
40
|
let prePartialStarFill;
|
|
41
41
|
|
|
42
42
|
if ($isActive) {
|
|
43
|
-
starStroke = starFill = $theme.colors.
|
|
43
|
+
starStroke = starFill = $theme.colors.warning400;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
if ($isPartialActive && !$isActive) {
|
|
47
|
-
prePartialStarStroke = prePartialStarFill = $theme.colors.
|
|
47
|
+
prePartialStarStroke = prePartialStarFill = $theme.colors.warning400;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
const styles = {
|
|
@@ -101,7 +101,7 @@ export const StyledEmoticon = styled('li', ({
|
|
|
101
101
|
let emoticonFill = $theme.colors.ratingInactiveFill;
|
|
102
102
|
|
|
103
103
|
if ($isActive) {
|
|
104
|
-
emoticonFill = $theme.colors.
|
|
104
|
+
emoticonFill = $theme.colors.warning400;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
const ratingIcons = [angryRatingSVG(emoticonFill, $size), sadRatingSVG(emoticonFill, $size), neutralRatingSVG(emoticonFill, $size), happyRatingSVG(emoticonFill, $size), veryHappyRatingSVG(emoticonFill, $size)];
|
package/es/select/index.js
CHANGED
|
@@ -14,7 +14,6 @@ export { default as SelectDropdown } from './dropdown.js';
|
|
|
14
14
|
export { default as StatefulSelect } from './stateful-select.js';
|
|
15
15
|
export { default as StatefulSelectContainer } from './stateful-select-container.js'; // Styled elements
|
|
16
16
|
|
|
17
|
-
export { StyledRoot, StyledControlContainer, StyledValueContainer, StyledPlaceholder, StyledSingleValue, StyledInputContainer, StyledInput, StyledInputSizer, StyledIconsContainer, StyledSelectArrow, StyledClearIcon
|
|
18
|
-
, StyledSearchIconContainer as StyledSearchIcon, StyledSearchIconContainer, StyledDropdownContainer, StyledDropdown, StyledDropdownListItem, StyledOptionContent } from './styled-components.js';
|
|
17
|
+
export { StyledRoot, StyledControlContainer, StyledValueContainer, StyledPlaceholder, StyledSingleValue, StyledInputContainer, StyledInput, StyledInputSizer, StyledIconsContainer, StyledSelectArrow, StyledClearIcon, StyledSearchIconContainer, StyledDropdownContainer, StyledDropdown, StyledDropdownListItem, StyledOptionContent } from './styled-components.js';
|
|
19
18
|
export { default as filterOptions } from './utils/default-filter-options.js';
|
|
20
19
|
export { SIZE, TYPE, STATE_CHANGE_TYPE } from './constants.js';
|
|
@@ -437,12 +437,8 @@ class Select extends React.Component {
|
|
|
437
437
|
_defineProperty(this, "handleInputRef", input => {
|
|
438
438
|
this.input = input;
|
|
439
439
|
|
|
440
|
-
if (this.props.controlRef) {
|
|
441
|
-
|
|
442
|
-
this.props.controlRef(input);
|
|
443
|
-
} else {
|
|
444
|
-
this.props.controlRef.current = input;
|
|
445
|
-
}
|
|
440
|
+
if (this.props.controlRef && typeof this.props.controlRef === 'function') {
|
|
441
|
+
this.props.controlRef(input);
|
|
446
442
|
}
|
|
447
443
|
});
|
|
448
444
|
|
|
@@ -561,13 +557,19 @@ class Select extends React.Component {
|
|
|
561
557
|
}
|
|
562
558
|
|
|
563
559
|
this.isItMounted = true;
|
|
560
|
+
const {
|
|
561
|
+
controlRef
|
|
562
|
+
} = this.props;
|
|
564
563
|
|
|
565
|
-
if (
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
564
|
+
if (controlRef && typeof controlRef !== 'function') {
|
|
565
|
+
controlRef.current = {
|
|
566
|
+
setDropdownOpen: this.handleDropdownOpen.bind(this),
|
|
567
|
+
setInputValue: this.handleSetInputValue.bind(this),
|
|
568
|
+
setInputFocus: this.handleSetInputFocus.bind(this),
|
|
569
|
+
setInputBlur: this.handleSetInputBlur.bind(this),
|
|
570
|
+
// `focus` & `blur` below are for backwards compatibility and may be removed. Use setInputFocus and setInputBlur instead.
|
|
571
|
+
focus: this.handleSetInputFocus.bind(this),
|
|
572
|
+
blur: this.handleSetInputBlur.bind(this)
|
|
571
573
|
};
|
|
572
574
|
}
|
|
573
575
|
}
|
|
@@ -608,6 +610,20 @@ class Select extends React.Component {
|
|
|
608
610
|
this.setState({
|
|
609
611
|
isOpen: nextOpenState
|
|
610
612
|
});
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
handleSetInputValue(newInputValue) {
|
|
616
|
+
this.setState({
|
|
617
|
+
inputValue: newInputValue
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
handleSetInputFocus() {
|
|
622
|
+
this.input.focus();
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
handleSetInputBlur() {
|
|
626
|
+
this.input.blur();
|
|
611
627
|
} // Handle touch outside on mobile to dismiss menu, ensures that the
|
|
612
628
|
// touch target is not within the anchor DOM node.
|
|
613
629
|
|
|
@@ -841,14 +857,10 @@ class Select extends React.Component {
|
|
|
841
857
|
const [SearchIconContainer, searchIconContainerProps] = getOverrides(overrides.SearchIconContainer, StyledSearchIconContainer);
|
|
842
858
|
const [SearchIcon, searchIconProps] = getOverrides(overrides.SearchIcon, SearchIconComponent);
|
|
843
859
|
const sharedProps = this.getSharedProps();
|
|
844
|
-
return (
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
size: 16,
|
|
849
|
-
title: 'search'
|
|
850
|
-
}, searchIconProps)))
|
|
851
|
-
);
|
|
860
|
+
return /*#__PURE__*/React.createElement(SearchIconContainer, _extends({}, sharedProps, searchIconContainerProps), /*#__PURE__*/React.createElement(SearchIcon, _extends({
|
|
861
|
+
size: 16,
|
|
862
|
+
title: 'search'
|
|
863
|
+
}, sharedProps, searchIconProps)));
|
|
852
864
|
}
|
|
853
865
|
|
|
854
866
|
filterOptions(excludeOptions) {
|
|
@@ -117,10 +117,10 @@ function getControlContainerColors($disabled, $isFocused, $isPseudoFocused, $pos
|
|
|
117
117
|
if ($isFocused || $isPseudoFocused) {
|
|
118
118
|
return {
|
|
119
119
|
color: colors.contentPrimary,
|
|
120
|
-
borderLeftColor: colors.
|
|
121
|
-
borderRightColor: colors.
|
|
122
|
-
borderTopColor: colors.
|
|
123
|
-
borderBottomColor: colors.
|
|
120
|
+
borderLeftColor: colors.borderSelected,
|
|
121
|
+
borderRightColor: colors.borderSelected,
|
|
122
|
+
borderTopColor: colors.borderSelected,
|
|
123
|
+
borderBottomColor: colors.borderSelected,
|
|
124
124
|
backgroundColor: colors.inputFillActive
|
|
125
125
|
};
|
|
126
126
|
}
|
|
@@ -4,7 +4,7 @@ Copyright (c) Uber Technologies, Inc.
|
|
|
4
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
|
-
import {
|
|
7
|
+
import { Spinner } from '../spinner/index.js';
|
|
8
8
|
import { styled, withStyle } from '../styles/index.js';
|
|
9
9
|
import { PLACEMENT } from './constants.js';
|
|
10
10
|
export const StyledRoot = styled('div', ({
|
|
@@ -41,7 +41,7 @@ export const StyledStartEnhancerContainer = styled('span', ({
|
|
|
41
41
|
};
|
|
42
42
|
});
|
|
43
43
|
StyledStartEnhancerContainer.displayName = "StyledStartEnhancerContainer";
|
|
44
|
-
export const StyledSpinner = withStyle(
|
|
44
|
+
export const StyledSpinner = withStyle(Spinner, ({
|
|
45
45
|
$height,
|
|
46
46
|
$width
|
|
47
47
|
}) => {
|
package/es/spinner/index.js
CHANGED
|
@@ -4,12 +4,6 @@ Copyright (c) Uber Technologies, Inc.
|
|
|
4
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
|
-
import {
|
|
8
|
-
export {
|
|
9
|
-
|
|
10
|
-
export { Svg as StyledSvg, StyledTrackPath, StyledActivePath, StyledSpinnerNext } from './styled-components.js';
|
|
11
|
-
export { SIZE } from './constants.js'; // Flow
|
|
12
|
-
|
|
13
|
-
// Backward compatibility with SpinnerDeterminate
|
|
14
|
-
// Deprecated
|
|
15
|
-
export { ProgressBarRounded as SpinnerDeterminate, StyledProgressBarRoundedRoot as StyledSpinnerDeterminateRoot, StyledProgressBarRoundedSvg as StyledSpinnerDeterminateSvg, StyledProgressBarRoundedTrackBackground as StyledSpinnerDeterminateTrackBackground, StyledProgressBarRoundedTrackForeground as StyledSpinnerDeterminateTrackForeground, StyledProgressBarRoundedText as StyledSpinnerDeterminateText };
|
|
7
|
+
import { StyledSpinner } from './styled-components.js';
|
|
8
|
+
export { StyledSpinner as Spinner };
|
|
9
|
+
export { SIZE } from './constants.js'; // Flow
|
|
@@ -5,7 +5,6 @@ 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 { styled } from '../styles/index.js';
|
|
8
|
-
import { getSvgStyles } from '../icon/styled-components.js';
|
|
9
8
|
import { SIZE } from './constants.js';
|
|
10
9
|
const spin = {
|
|
11
10
|
from: {
|
|
@@ -15,36 +14,7 @@ const spin = {
|
|
|
15
14
|
transform: 'rotate(360deg)'
|
|
16
15
|
}
|
|
17
16
|
};
|
|
18
|
-
|
|
19
|
-
* Spinner icon overrides
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
export const Svg = styled('svg', props => {
|
|
23
|
-
const {
|
|
24
|
-
$theme,
|
|
25
|
-
$color
|
|
26
|
-
} = props;
|
|
27
|
-
return { ...getSvgStyles(props),
|
|
28
|
-
fill: $color || $theme.colors.accent,
|
|
29
|
-
cursor: 'wait',
|
|
30
|
-
animationName: spin,
|
|
31
|
-
animationDuration: $theme.animation.timing1000,
|
|
32
|
-
animationIterationCount: 'infinite',
|
|
33
|
-
animationTimingFunction: 'linear'
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
Svg.displayName = "Svg";
|
|
37
|
-
export const StyledTrackPath = styled('path', props => ({
|
|
38
|
-
fill: props.$theme.colors.spinnerTrackFill,
|
|
39
|
-
opacity: 0.16
|
|
40
|
-
}));
|
|
41
|
-
StyledTrackPath.displayName = "StyledTrackPath";
|
|
42
|
-
export const StyledActivePath = styled('path', props => ({
|
|
43
|
-
fill: props.$color || props.$theme.colors.accent
|
|
44
|
-
})); // TODO(v11): Replace Spinner with SpinnerNext
|
|
45
|
-
|
|
46
|
-
StyledActivePath.displayName = "StyledActivePath";
|
|
47
|
-
export const StyledSpinnerNext = styled('i', ({
|
|
17
|
+
export const StyledSpinner = styled('i', ({
|
|
48
18
|
//$FlowFixMe
|
|
49
19
|
$theme,
|
|
50
20
|
$color = $theme.colors.contentAccent,
|
|
@@ -104,4 +74,4 @@ export const StyledSpinnerNext = styled('i', ({
|
|
|
104
74
|
cursor: 'wait'
|
|
105
75
|
};
|
|
106
76
|
});
|
|
107
|
-
|
|
77
|
+
StyledSpinner.displayName = "StyledSpinner";
|
package/es/table/filter.js
CHANGED
|
@@ -43,19 +43,19 @@ export default function Filter(props) {
|
|
|
43
43
|
,
|
|
44
44
|
crossFrame: false
|
|
45
45
|
}, /*#__PURE__*/React.createElement(Heading, headingProps, "Filter Column"), /*#__PURE__*/React.createElement(Content, contentProps, props.children), /*#__PURE__*/React.createElement(Footer, footerProps, /*#__PURE__*/React.createElement(Button, {
|
|
46
|
-
kind: KIND.
|
|
46
|
+
kind: KIND.tertiary,
|
|
47
47
|
size: SIZE.compact,
|
|
48
48
|
onClick: () => {
|
|
49
49
|
onSelectAll();
|
|
50
50
|
}
|
|
51
51
|
}, "Select All"), /*#__PURE__*/React.createElement(Button, {
|
|
52
|
-
kind: KIND.
|
|
52
|
+
kind: KIND.tertiary,
|
|
53
53
|
size: SIZE.compact,
|
|
54
54
|
onClick: () => {
|
|
55
55
|
onReset();
|
|
56
56
|
}
|
|
57
57
|
}, "Reset"), props.hasCloseButton && /*#__PURE__*/React.createElement(Button, {
|
|
58
|
-
kind: KIND.
|
|
58
|
+
kind: KIND.tertiary,
|
|
59
59
|
size: SIZE.compact,
|
|
60
60
|
onClick: close
|
|
61
61
|
}, "Close"))),
|
|
@@ -213,7 +213,7 @@ const customColorStates = {
|
|
|
213
213
|
[COLOR_STATE.disabled]: (theme, color) => ({
|
|
214
214
|
color: customOnRamp(color, theme.colors.tagFontDisabledRampUnit),
|
|
215
215
|
backgroundColor: null,
|
|
216
|
-
borderColor: customOnRamp(color, theme.colors.
|
|
216
|
+
borderColor: customOnRamp(color, theme.colors.tagSolidDisabledRampUnit)
|
|
217
217
|
}),
|
|
218
218
|
[COLOR_STATE.solid]: (theme, color) => ({
|
|
219
219
|
color: customOnRamp(color, theme.colors.tagSolidFontRampUnit),
|