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
package/radio/types.js.flow
CHANGED
|
@@ -28,15 +28,9 @@ export type RadioGroupOverridesT = {
|
|
|
28
28
|
RadioGroupRoot?: OverrideT,
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export type OverridesT = {
|
|
32
|
-
...$Exact<RadioOverridesT>,
|
|
33
|
-
...$Exact<RadioGroupOverridesT>,
|
|
34
|
-
};
|
|
35
|
-
|
|
36
31
|
export type DefaultPropsT = {
|
|
37
32
|
value: string,
|
|
38
33
|
disabled: boolean,
|
|
39
|
-
isError: boolean,
|
|
40
34
|
error: boolean,
|
|
41
35
|
autoFocus: boolean,
|
|
42
36
|
labelPlacement: LabelPlacementT,
|
|
@@ -59,7 +53,7 @@ export type PropsT = {
|
|
|
59
53
|
*/
|
|
60
54
|
'aria-labelledby'?: string,
|
|
61
55
|
// This prop will be deprecated in the next major update. Pass overrides to the 'Radio' component instead.
|
|
62
|
-
overrides?:
|
|
56
|
+
overrides?: RadioGroupOverridesT,
|
|
63
57
|
/** As `children` in React native approach represents radio buttons inside of Radio Group. Can use `Radio` from this package. */
|
|
64
58
|
children?: Array<React.Node>,
|
|
65
59
|
/** The value of radio button, which is preselected. */
|
|
@@ -70,8 +64,6 @@ export type PropsT = {
|
|
|
70
64
|
required?: boolean,
|
|
71
65
|
/** Sets radio group into error state. */
|
|
72
66
|
error?: boolean,
|
|
73
|
-
/** You should use the error prop instead. */
|
|
74
|
-
isError?: boolean,
|
|
75
67
|
/** Set to be focused (active) on selected\checked radio. */
|
|
76
68
|
autoFocus?: boolean,
|
|
77
69
|
/** How to position radio buttons in the group. */
|
|
@@ -117,8 +109,6 @@ export type RadioPropsT = {
|
|
|
117
109
|
inputRef?: ReactRefT<HTMLInputElement>,
|
|
118
110
|
/** Renders checkbox in errored state. */
|
|
119
111
|
error?: boolean,
|
|
120
|
-
/** You should use the error prop instead. */
|
|
121
|
-
isError?: boolean,
|
|
122
112
|
/** Is radio focused / active? */
|
|
123
113
|
isFocused?: boolean,
|
|
124
114
|
/** Is parent RadioGroup focused by keyboard? */
|
|
@@ -141,7 +131,7 @@ export type RadioPropsT = {
|
|
|
141
131
|
onMouseDown?: (e: SyntheticInputEvent<HTMLInputElement>) => mixed,
|
|
142
132
|
/** Handler for mouseup events on trigger element. */
|
|
143
133
|
onMouseUp?: (e: SyntheticInputEvent<HTMLInputElement>) => mixed,
|
|
144
|
-
overrides?:
|
|
134
|
+
overrides?: RadioOverridesT,
|
|
145
135
|
/** Marks the checkbox as required. */
|
|
146
136
|
required?: boolean,
|
|
147
137
|
/** Passed to the input element value attribute */
|
|
@@ -175,7 +165,7 @@ export type DefaultStatefulPropsT = {
|
|
|
175
165
|
};
|
|
176
166
|
|
|
177
167
|
export type StatefulContainerPropsT = {
|
|
178
|
-
overrides?:
|
|
168
|
+
overrides?: RadioGroupOverridesT,
|
|
179
169
|
/** Should return `RadioGroup` instance with standard or customized inner elements. */
|
|
180
170
|
children?: (props: PropsT) => React.Node,
|
|
181
171
|
/** Initial state populated into the component */
|
|
@@ -189,7 +179,7 @@ export type StatefulContainerPropsT = {
|
|
|
189
179
|
};
|
|
190
180
|
|
|
191
181
|
export type StatefulRadioGroupPropsT = {
|
|
192
|
-
overrides?:
|
|
182
|
+
overrides?: RadioGroupOverridesT,
|
|
193
183
|
/** A list of `Radio` components. */
|
|
194
184
|
children?: Array<React.Node>,
|
|
195
185
|
/** Initial state populated into the component */
|
|
@@ -206,7 +196,6 @@ export type StylePropsT = {
|
|
|
206
196
|
$disabled: boolean,
|
|
207
197
|
$hasDescription: boolean,
|
|
208
198
|
$isActive: boolean,
|
|
209
|
-
$isError: boolean,
|
|
210
199
|
$error: boolean,
|
|
211
200
|
$isFocused: boolean,
|
|
212
201
|
$isFocusVisible: boolean,
|
|
@@ -48,11 +48,11 @@ var StyledStar = (0, _index.styled)('li', function (_ref2) {
|
|
|
48
48
|
var prePartialStarFill;
|
|
49
49
|
|
|
50
50
|
if ($isActive) {
|
|
51
|
-
starStroke = starFill = $theme.colors.
|
|
51
|
+
starStroke = starFill = $theme.colors.warning400;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
if ($isPartialActive && !$isActive) {
|
|
55
|
-
prePartialStarStroke = prePartialStarFill = $theme.colors.
|
|
55
|
+
prePartialStarStroke = prePartialStarFill = $theme.colors.warning400;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
var styles = {
|
|
@@ -110,7 +110,7 @@ var StyledEmoticon = (0, _index.styled)('li', function (_ref3) {
|
|
|
110
110
|
var emoticonFill = $theme.colors.ratingInactiveFill;
|
|
111
111
|
|
|
112
112
|
if ($isActive) {
|
|
113
|
-
emoticonFill = $theme.colors.
|
|
113
|
+
emoticonFill = $theme.colors.warning400;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
var ratingIcons = [(0, _svgIcons.angryRatingSVG)(emoticonFill, $size), (0, _svgIcons.sadRatingSVG)(emoticonFill, $size), (0, _svgIcons.neutralRatingSVG)(emoticonFill, $size), (0, _svgIcons.happyRatingSVG)(emoticonFill, $size), (0, _svgIcons.veryHappyRatingSVG)(emoticonFill, $size)];
|
|
@@ -44,10 +44,10 @@ export const StyledStar = styled<StyledRatingItemPropsT>(
|
|
|
44
44
|
let prePartialStarFill;
|
|
45
45
|
|
|
46
46
|
if ($isActive) {
|
|
47
|
-
starStroke = starFill = $theme.colors.
|
|
47
|
+
starStroke = starFill = $theme.colors.warning400;
|
|
48
48
|
}
|
|
49
49
|
if ($isPartialActive && !$isActive) {
|
|
50
|
-
prePartialStarStroke = prePartialStarFill = $theme.colors.
|
|
50
|
+
prePartialStarStroke = prePartialStarFill = $theme.colors.warning400;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
const styles = {
|
|
@@ -106,7 +106,7 @@ export const StyledEmoticon = styled<StyledRatingItemPropsT>(
|
|
|
106
106
|
let emoticonFill = $theme.colors.ratingInactiveFill;
|
|
107
107
|
|
|
108
108
|
if ($isActive) {
|
|
109
|
-
emoticonFill = $theme.colors.
|
|
109
|
+
emoticonFill = $theme.colors.warning400;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
const ratingIcons = [
|
package/select/index.d.ts
CHANGED
|
@@ -47,6 +47,13 @@ export type filterOptions = (
|
|
|
47
47
|
}
|
|
48
48
|
) => Value;
|
|
49
49
|
|
|
50
|
+
export interface ImperativeMethods {
|
|
51
|
+
setInputFocus: () => void;
|
|
52
|
+
setInputBlur: () => void;
|
|
53
|
+
setDropdownOpen: (d: boolean) => void;
|
|
54
|
+
setInputValue: (s: string) => void;
|
|
55
|
+
}
|
|
56
|
+
|
|
50
57
|
export interface SelectOverrides {
|
|
51
58
|
Root?: Override<any>;
|
|
52
59
|
ControlContainer?: Override<any>;
|
|
@@ -104,7 +111,7 @@ export interface SelectProps {
|
|
|
104
111
|
}) => React.ReactNode;
|
|
105
112
|
getValueLabel?: (args: { option: Option }) => React.ReactNode;
|
|
106
113
|
id?: string;
|
|
107
|
-
controlRef?: React.Ref<
|
|
114
|
+
controlRef?: React.Ref<ImperativeMethods>;
|
|
108
115
|
isLoading?: boolean;
|
|
109
116
|
labelKey?: string;
|
|
110
117
|
startOpen?: boolean;
|
|
@@ -312,8 +319,6 @@ export const StyledIconsContainer: StyletronComponent<any>;
|
|
|
312
319
|
export const StyledSelectArrow: StyletronComponent<any>;
|
|
313
320
|
export const StyledClearIcon: StyletronComponent<any>;
|
|
314
321
|
export const StyledSearchIconContainer: StyletronComponent<any>;
|
|
315
|
-
// TODO(v11): remove StyledSearchIcon
|
|
316
|
-
export const StyledSearchIcon: StyletronComponent<any>;
|
|
317
322
|
export const StyledDropdownContainer: StyletronComponent<any>;
|
|
318
323
|
export const StyledDropdown: StyletronComponent<any>;
|
|
319
324
|
export const StyledDropdownListItem: StyletronComponent<any>;
|
package/select/index.js
CHANGED
|
@@ -123,12 +123,6 @@ Object.defineProperty(exports, "StyledClearIcon", {
|
|
|
123
123
|
return _styledComponents.StyledClearIcon;
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
|
-
Object.defineProperty(exports, "StyledSearchIcon", {
|
|
127
|
-
enumerable: true,
|
|
128
|
-
get: function get() {
|
|
129
|
-
return _styledComponents.StyledSearchIconContainer;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
126
|
Object.defineProperty(exports, "StyledSearchIconContainer", {
|
|
133
127
|
enumerable: true,
|
|
134
128
|
get: function get() {
|
package/select/index.js.flow
CHANGED
|
@@ -27,8 +27,6 @@ export {
|
|
|
27
27
|
StyledIconsContainer,
|
|
28
28
|
StyledSelectArrow,
|
|
29
29
|
StyledClearIcon,
|
|
30
|
-
// TODO(v11): remove StyledSearchIconContainer as StyledSearchIcon
|
|
31
|
-
StyledSearchIconContainer as StyledSearchIcon,
|
|
32
30
|
StyledSearchIconContainer,
|
|
33
31
|
StyledDropdownContainer,
|
|
34
32
|
StyledDropdown,
|
|
@@ -532,12 +532,8 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
532
532
|
_defineProperty(_assertThisInitialized(_this), "handleInputRef", function (input) {
|
|
533
533
|
_this.input = input;
|
|
534
534
|
|
|
535
|
-
if (_this.props.controlRef) {
|
|
536
|
-
|
|
537
|
-
_this.props.controlRef(input);
|
|
538
|
-
} else {
|
|
539
|
-
_this.props.controlRef.current = input;
|
|
540
|
-
}
|
|
535
|
+
if (_this.props.controlRef && typeof _this.props.controlRef === 'function') {
|
|
536
|
+
_this.props.controlRef(input);
|
|
541
537
|
}
|
|
542
538
|
});
|
|
543
539
|
|
|
@@ -676,11 +672,17 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
676
672
|
}
|
|
677
673
|
|
|
678
674
|
this.isItMounted = true;
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
setDropdownOpen: this.handleDropdownOpen.bind(this)
|
|
675
|
+
var controlRef = this.props.controlRef;
|
|
676
|
+
|
|
677
|
+
if (controlRef && typeof controlRef !== 'function') {
|
|
678
|
+
controlRef.current = {
|
|
679
|
+
setDropdownOpen: this.handleDropdownOpen.bind(this),
|
|
680
|
+
setInputValue: this.handleSetInputValue.bind(this),
|
|
681
|
+
setInputFocus: this.handleSetInputFocus.bind(this),
|
|
682
|
+
setInputBlur: this.handleSetInputBlur.bind(this),
|
|
683
|
+
// `focus` & `blur` below are for backwards compatibility and may be removed. Use setInputFocus and setInputBlur instead.
|
|
684
|
+
focus: this.handleSetInputFocus.bind(this),
|
|
685
|
+
blur: this.handleSetInputBlur.bind(this)
|
|
684
686
|
};
|
|
685
687
|
}
|
|
686
688
|
}
|
|
@@ -725,6 +727,23 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
725
727
|
this.setState({
|
|
726
728
|
isOpen: nextOpenState
|
|
727
729
|
});
|
|
730
|
+
}
|
|
731
|
+
}, {
|
|
732
|
+
key: "handleSetInputValue",
|
|
733
|
+
value: function handleSetInputValue(newInputValue) {
|
|
734
|
+
this.setState({
|
|
735
|
+
inputValue: newInputValue
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
}, {
|
|
739
|
+
key: "handleSetInputFocus",
|
|
740
|
+
value: function handleSetInputFocus() {
|
|
741
|
+
this.input.focus();
|
|
742
|
+
}
|
|
743
|
+
}, {
|
|
744
|
+
key: "handleSetInputBlur",
|
|
745
|
+
value: function handleSetInputBlur() {
|
|
746
|
+
this.input.blur();
|
|
728
747
|
} // Handle touch outside on mobile to dismiss menu, ensures that the
|
|
729
748
|
// touch target is not within the anchor DOM node.
|
|
730
749
|
|
|
@@ -1003,14 +1022,10 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
1003
1022
|
searchIconProps = _getOverrides12[1];
|
|
1004
1023
|
|
|
1005
1024
|
var sharedProps = this.getSharedProps();
|
|
1006
|
-
return (
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
size: 16,
|
|
1011
|
-
title: 'search'
|
|
1012
|
-
}, searchIconProps)))
|
|
1013
|
-
);
|
|
1025
|
+
return /*#__PURE__*/React.createElement(SearchIconContainer, _extends({}, sharedProps, searchIconContainerProps), /*#__PURE__*/React.createElement(SearchIcon, _extends({
|
|
1026
|
+
size: 16,
|
|
1027
|
+
title: 'search'
|
|
1028
|
+
}, sharedProps, searchIconProps)));
|
|
1014
1029
|
}
|
|
1015
1030
|
}, {
|
|
1016
1031
|
key: "filterOptions",
|
|
@@ -118,11 +118,16 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
118
118
|
}
|
|
119
119
|
this.isItMounted = true;
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
methodsRef.current = {
|
|
121
|
+
const { controlRef } = this.props;
|
|
122
|
+
if (controlRef && typeof controlRef !== 'function') {
|
|
123
|
+
controlRef.current = {
|
|
125
124
|
setDropdownOpen: this.handleDropdownOpen.bind(this),
|
|
125
|
+
setInputValue: this.handleSetInputValue.bind(this),
|
|
126
|
+
setInputFocus: this.handleSetInputFocus.bind(this),
|
|
127
|
+
setInputBlur: this.handleSetInputBlur.bind(this),
|
|
128
|
+
// `focus` & `blur` below are for backwards compatibility and may be removed. Use setInputFocus and setInputBlur instead.
|
|
129
|
+
focus: this.handleSetInputFocus.bind(this),
|
|
130
|
+
blur: this.handleSetInputBlur.bind(this),
|
|
126
131
|
};
|
|
127
132
|
}
|
|
128
133
|
}
|
|
@@ -164,6 +169,20 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
164
169
|
});
|
|
165
170
|
}
|
|
166
171
|
|
|
172
|
+
handleSetInputValue(newInputValue: string) {
|
|
173
|
+
this.setState({
|
|
174
|
+
inputValue: newInputValue,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
handleSetInputFocus() {
|
|
179
|
+
this.input.focus();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
handleSetInputBlur() {
|
|
183
|
+
this.input.blur();
|
|
184
|
+
}
|
|
185
|
+
|
|
167
186
|
// Handle touch outside on mobile to dismiss menu, ensures that the
|
|
168
187
|
// touch target is not within the anchor DOM node.
|
|
169
188
|
handleTouchOutside = (event: TouchEvent) => {
|
|
@@ -479,15 +498,13 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
479
498
|
}
|
|
480
499
|
};
|
|
481
500
|
|
|
501
|
+
// This method is to preserve backwards compatibility for users using controlRef to directly
|
|
502
|
+
// access the input element. This capability is not documented, and may be removed in the future.
|
|
482
503
|
//flowlint-next-line unclear-type:off
|
|
483
504
|
handleInputRef = (input: React.ElementRef<any>) => {
|
|
484
505
|
this.input = input;
|
|
485
|
-
if (this.props.controlRef) {
|
|
486
|
-
|
|
487
|
-
this.props.controlRef(input);
|
|
488
|
-
} else {
|
|
489
|
-
this.props.controlRef.current = input;
|
|
490
|
-
}
|
|
506
|
+
if (this.props.controlRef && typeof this.props.controlRef === 'function') {
|
|
507
|
+
this.props.controlRef(input);
|
|
491
508
|
}
|
|
492
509
|
};
|
|
493
510
|
|
|
@@ -823,9 +840,8 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
823
840
|
const sharedProps = this.getSharedProps();
|
|
824
841
|
|
|
825
842
|
return (
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
<SearchIcon size={16} title={'search'} {...searchIconProps} />
|
|
843
|
+
<SearchIconContainer {...sharedProps} {...searchIconContainerProps}>
|
|
844
|
+
<SearchIcon size={16} title={'search'} {...sharedProps} {...searchIconProps} />
|
|
829
845
|
</SearchIconContainer>
|
|
830
846
|
);
|
|
831
847
|
}
|
|
@@ -111,10 +111,10 @@ function getControlContainerColors($disabled, $isFocused, $isPseudoFocused, $pos
|
|
|
111
111
|
if ($isFocused || $isPseudoFocused) {
|
|
112
112
|
return {
|
|
113
113
|
color: colors.contentPrimary,
|
|
114
|
-
borderLeftColor: colors.
|
|
115
|
-
borderRightColor: colors.
|
|
116
|
-
borderTopColor: colors.
|
|
117
|
-
borderBottomColor: colors.
|
|
114
|
+
borderLeftColor: colors.borderSelected,
|
|
115
|
+
borderRightColor: colors.borderSelected,
|
|
116
|
+
borderTopColor: colors.borderSelected,
|
|
117
|
+
borderBottomColor: colors.borderSelected,
|
|
118
118
|
backgroundColor: colors.inputFillActive
|
|
119
119
|
};
|
|
120
120
|
}
|
|
@@ -135,10 +135,10 @@ function getControlContainerColors(
|
|
|
135
135
|
if ($isFocused || $isPseudoFocused) {
|
|
136
136
|
return {
|
|
137
137
|
color: colors.contentPrimary,
|
|
138
|
-
borderLeftColor: colors.
|
|
139
|
-
borderRightColor: colors.
|
|
140
|
-
borderTopColor: colors.
|
|
141
|
-
borderBottomColor: colors.
|
|
138
|
+
borderLeftColor: colors.borderSelected,
|
|
139
|
+
borderRightColor: colors.borderSelected,
|
|
140
|
+
borderTopColor: colors.borderSelected,
|
|
141
|
+
borderBottomColor: colors.borderSelected,
|
|
142
142
|
backgroundColor: colors.inputFillActive,
|
|
143
143
|
};
|
|
144
144
|
}
|
package/select/types.js.flow
CHANGED
|
@@ -73,11 +73,17 @@ export type OverridesDropdownT = {
|
|
|
73
73
|
StatefulMenu?: OverrideT,
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
-
type
|
|
76
|
+
type ImperativeMethodsT = {|
|
|
77
77
|
setDropdownOpen: (boolean) => mixed,
|
|
78
|
+
setInputValue: (string) => void,
|
|
79
|
+
setInputFocus: () => void,
|
|
80
|
+
setInputBlur: () => void,
|
|
81
|
+
// these below are for backwards compatibility and may be removed. Don't use them.
|
|
82
|
+
focus: () => void,
|
|
83
|
+
blur: () => void,
|
|
78
84
|
|};
|
|
79
|
-
export type
|
|
80
|
-
current:
|
|
85
|
+
export type ControlRefT = {
|
|
86
|
+
current: ImperativeMethodsT | null,
|
|
81
87
|
};
|
|
82
88
|
|
|
83
89
|
export type PropsT = {
|
|
@@ -132,8 +138,8 @@ export type PropsT = {
|
|
|
132
138
|
id?: string,
|
|
133
139
|
/** Defines if the comparison for a new creatable value should be case-insensitive. */
|
|
134
140
|
ignoreCase?: boolean,
|
|
135
|
-
/**
|
|
136
|
-
controlRef?:
|
|
141
|
+
/** An imperative handle exposing internal methods. */
|
|
142
|
+
controlRef?: ControlRefT,
|
|
137
143
|
/** Defines if the select is in a loading (async) state. */
|
|
138
144
|
isLoading: boolean,
|
|
139
145
|
/** Defines an option key for a default label value. */
|
|
@@ -142,8 +148,6 @@ export type PropsT = {
|
|
|
142
148
|
maxDropdownHeight: string,
|
|
143
149
|
/** Defines if multiple options can be selected. */
|
|
144
150
|
multi: boolean,
|
|
145
|
-
/** Handle for accessing internal methods. */
|
|
146
|
-
methodsRef?: MethodsRefT,
|
|
147
151
|
/** Message to be displayed if no options is found for a search query. */
|
|
148
152
|
noResultsMsg?: React.Node,
|
|
149
153
|
onBlur: (e: Event) => mixed,
|
|
@@ -51,7 +51,7 @@ var StyledStartEnhancerContainer = (0, _index2.styled)('span', function (_ref2)
|
|
|
51
51
|
});
|
|
52
52
|
exports.StyledStartEnhancerContainer = StyledStartEnhancerContainer;
|
|
53
53
|
StyledStartEnhancerContainer.displayName = "StyledStartEnhancerContainer";
|
|
54
|
-
var StyledSpinner = (0, _index2.withStyle)(_index.
|
|
54
|
+
var StyledSpinner = (0, _index2.withStyle)(_index.Spinner, function (_ref4) {
|
|
55
55
|
var $height = _ref4.$height,
|
|
56
56
|
$width = _ref4.$width;
|
|
57
57
|
return {
|
|
@@ -7,7 +7,7 @@ LICENSE file in the root directory of this source tree.
|
|
|
7
7
|
|
|
8
8
|
// @flow
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { Spinner } from '../spinner/index.js';
|
|
11
11
|
import { styled, withStyle } from '../styles/index.js';
|
|
12
12
|
|
|
13
13
|
import { PLACEMENT } from './constants.js';
|
|
@@ -43,16 +43,16 @@ export const StyledStartEnhancerContainer = styled<{}>('span', ({ $theme }) => {
|
|
|
43
43
|
};
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
export const StyledSpinner = withStyle<
|
|
47
|
-
|
|
48
|
-
{ $height
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
46
|
+
export const StyledSpinner = withStyle<typeof Spinner, { $height: number, $width: number }>(
|
|
47
|
+
Spinner,
|
|
48
|
+
({ $height, $width }) => {
|
|
49
|
+
return {
|
|
50
|
+
boxSizing: 'border-box',
|
|
51
|
+
height: `${$height}px`,
|
|
52
|
+
width: `${$width}px`,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
56
|
|
|
57
57
|
export const StyledMessage = styled<{ $hasSuffix: boolean }>(
|
|
58
58
|
'p',
|
package/spinner/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import {StyletronComponent} from 'styletron-react';
|
|
3
|
-
import {
|
|
2
|
+
import {Sizing} from '../theme.ts';
|
|
4
3
|
|
|
5
4
|
export enum SIZE {
|
|
6
5
|
small = 'small',
|
|
@@ -8,22 +7,10 @@ export enum SIZE {
|
|
|
8
7
|
large = 'large',
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
export interface SpinnerOverrides {
|
|
12
|
-
Svg?: Override<any>;
|
|
13
|
-
ActivePath?: Override<any>;
|
|
14
|
-
TrackPath?: Override<any>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
10
|
export interface SpinnerProps {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
title?: string;
|
|
22
|
-
overrides?: SpinnerOverrides;
|
|
11
|
+
$color?: string;
|
|
12
|
+
$borderWidth?: number | string | SIZE | Sizing;
|
|
13
|
+
$size?: number | string | SIZE | Sizing;
|
|
23
14
|
}
|
|
24
|
-
export class Spinner extends React.Component<SpinnerProps> {}
|
|
25
15
|
|
|
26
|
-
export const
|
|
27
|
-
export const StyledTrackPath: StyletronComponent<any>;
|
|
28
|
-
export const StyledActivePath: StyletronComponent<any>;
|
|
29
|
-
export const StyledSpinnerNext: StyletronComponent<any>;
|
|
16
|
+
export const Spinner: StyletronComponent<SpinnerProps>;
|
package/spinner/index.js
CHANGED
|
@@ -3,70 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "SpinnerDeterminate", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _index.ProgressBarRounded;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "StyledSpinnerDeterminateRoot", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _index.StyledProgressBarRoundedRoot;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "StyledSpinnerDeterminateSvg", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _index.StyledProgressBarRoundedSvg;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "StyledSpinnerDeterminateText", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _index.StyledProgressBarRoundedText;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "StyledSpinnerDeterminateTrackBackground", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function get() {
|
|
33
|
-
return _index.StyledProgressBarRoundedTrackBackground;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "StyledSpinnerDeterminateTrackForeground", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function get() {
|
|
39
|
-
return _index.StyledProgressBarRoundedTrackForeground;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
6
|
Object.defineProperty(exports, "Spinner", {
|
|
43
7
|
enumerable: true,
|
|
44
8
|
get: function get() {
|
|
45
|
-
return
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "StyledSvg", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function get() {
|
|
51
|
-
return _styledComponents.Svg;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(exports, "StyledTrackPath", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function get() {
|
|
57
|
-
return _styledComponents.StyledTrackPath;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(exports, "StyledActivePath", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function get() {
|
|
63
|
-
return _styledComponents.StyledActivePath;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
Object.defineProperty(exports, "StyledSpinnerNext", {
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function get() {
|
|
69
|
-
return _styledComponents.StyledSpinnerNext;
|
|
9
|
+
return _styledComponents.StyledSpinner;
|
|
70
10
|
}
|
|
71
11
|
});
|
|
72
12
|
Object.defineProperty(exports, "SIZE", {
|
|
@@ -76,12 +16,6 @@ Object.defineProperty(exports, "SIZE", {
|
|
|
76
16
|
}
|
|
77
17
|
});
|
|
78
18
|
|
|
79
|
-
var _index = require("../progress-bar/index.js");
|
|
80
|
-
|
|
81
|
-
var _spinner = _interopRequireDefault(require("./spinner.js"));
|
|
82
|
-
|
|
83
19
|
var _styledComponents = require("./styled-components.js");
|
|
84
20
|
|
|
85
|
-
var _constants = require("./constants.js");
|
|
86
|
-
|
|
87
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
var _constants = require("./constants.js");
|
package/spinner/index.js.flow
CHANGED
|
@@ -5,38 +5,13 @@ 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
|
// @flow
|
|
8
|
-
import {
|
|
9
|
-
ProgressBarRounded,
|
|
10
|
-
StyledProgressBarRoundedRoot,
|
|
11
|
-
StyledProgressBarRoundedSvg,
|
|
12
|
-
StyledProgressBarRoundedText,
|
|
13
|
-
StyledProgressBarRoundedTrackBackground,
|
|
14
|
-
StyledProgressBarRoundedTrackForeground,
|
|
15
|
-
} from '../progress-bar/index.js';
|
|
8
|
+
import { StyledSpinner } from './styled-components.js';
|
|
16
9
|
|
|
17
|
-
export {
|
|
18
|
-
// Styled elements
|
|
19
|
-
export {
|
|
20
|
-
Svg as StyledSvg,
|
|
21
|
-
StyledTrackPath,
|
|
22
|
-
StyledActivePath,
|
|
23
|
-
StyledSpinnerNext,
|
|
24
|
-
} from './styled-components.js';
|
|
10
|
+
export { StyledSpinner as Spinner };
|
|
25
11
|
export { SIZE } from './constants.js';
|
|
26
12
|
// Flow
|
|
27
13
|
export type * from './types.js';
|
|
28
14
|
|
|
29
|
-
// Backward compatibility with SpinnerDeterminate
|
|
30
|
-
// Deprecated
|
|
31
|
-
export {
|
|
32
|
-
ProgressBarRounded as SpinnerDeterminate,
|
|
33
|
-
StyledProgressBarRoundedRoot as StyledSpinnerDeterminateRoot,
|
|
34
|
-
StyledProgressBarRoundedSvg as StyledSpinnerDeterminateSvg,
|
|
35
|
-
StyledProgressBarRoundedTrackBackground as StyledSpinnerDeterminateTrackBackground,
|
|
36
|
-
StyledProgressBarRoundedTrackForeground as StyledSpinnerDeterminateTrackForeground,
|
|
37
|
-
StyledProgressBarRoundedText as StyledSpinnerDeterminateText,
|
|
38
|
-
};
|
|
39
|
-
|
|
40
15
|
declare var __DEV__: boolean;
|
|
41
16
|
declare var __NODE__: boolean;
|
|
42
17
|
declare var __BROWSER__: boolean;
|