baseui 10.12.0 → 11.0.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/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 +10 -2
- package/data-table/data-table.js.flow +4 -1
- package/data-table/header-cell.js +3 -0
- package/data-table/header-cell.js.flow +1 -1
- package/data-table/index.d.ts +7 -8
- package/data-table/stateful-data-table.js +2 -1
- package/data-table/stateful-data-table.js.flow +1 -0
- package/data-table/types.js.flow +8 -0
- 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 +6 -2
- package/es/data-table/header-cell.js +3 -0
- package/es/data-table/stateful-data-table.js +2 -1
- 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/form-control/styled-components.js +0 -1
- 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/list/list-item.js +5 -1
- package/es/list/menu-adapter.js +4 -0
- 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 +20 -20
- package/es/select/styled-components.js +21 -17
- 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 +10 -2
- package/esm/data-table/header-cell.js +3 -0
- package/esm/data-table/stateful-data-table.js +2 -1
- 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/form-control/styled-components.js +0 -1
- 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/list/list-item.js +5 -1
- package/esm/list/menu-adapter.js +4 -0
- 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 +20 -20
- package/esm/select/styled-components.js +21 -14
- 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/form-control/index.d.ts +9 -0
- package/form-control/styled-components.js +0 -1
- package/form-control/styled-components.js.flow +0 -1
- 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/list/list-item.js +5 -1
- package/list/list-item.js.flow +4 -0
- package/list/menu-adapter.js +4 -0
- package/list/menu-adapter.js.flow +4 -0
- package/list/types.js.flow +4 -0
- 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 +3 -2
- 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/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 +0 -2
- package/select/index.js +0 -6
- package/select/index.js.flow +0 -2
- package/select/select-component.js +23 -24
- package/select/select-component.js.flow +25 -14
- package/select/styled-components.js +23 -17
- package/select/styled-components.js.flow +17 -12
- 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/radiogroup.js.flow
CHANGED
|
@@ -21,7 +21,6 @@ class StatelessRadioGroup extends React.Component<PropsT, StatelessStateT> {
|
|
|
21
21
|
autoFocus: false,
|
|
22
22
|
labelPlacement: 'right',
|
|
23
23
|
align: 'vertical',
|
|
24
|
-
isError: false,
|
|
25
24
|
error: false,
|
|
26
25
|
required: false,
|
|
27
26
|
onChange: () => {},
|
|
@@ -34,14 +33,6 @@ class StatelessRadioGroup extends React.Component<PropsT, StatelessStateT> {
|
|
|
34
33
|
|
|
35
34
|
state = { isFocusVisible: false, focusedRadioIndex: -1 };
|
|
36
35
|
|
|
37
|
-
componentDidMount() {
|
|
38
|
-
if (__DEV__ && this.props.isError) {
|
|
39
|
-
console.warn(
|
|
40
|
-
'baseui:Radio Property "isError" will be removed in the next major version. Use "error" property instead.'
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
36
|
handleFocus = (event: SyntheticInputEvent<HTMLInputElement>, index: number) => {
|
|
46
37
|
if (isFocusVisible(event)) {
|
|
47
38
|
this.setState({ isFocusVisible: true });
|
|
@@ -65,30 +56,18 @@ class StatelessRadioGroup extends React.Component<PropsT, StatelessStateT> {
|
|
|
65
56
|
StyledRadioGroupRoot
|
|
66
57
|
);
|
|
67
58
|
|
|
68
|
-
if (__DEV__) {
|
|
69
|
-
const overrideKeys = Object.keys(overrides);
|
|
70
|
-
// TODO(v11)
|
|
71
|
-
if (Boolean(overrideKeys.length) && !overrideKeys.includes('RadioGroupRoot')) {
|
|
72
|
-
// eslint-disable-next-line no-console
|
|
73
|
-
console.warn(`All overrides beside 'RadioGroupRoot' will be deprecated in the next major version update.
|
|
74
|
-
Pass other overrides to the 'Radio' children instead.
|
|
75
|
-
`);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
59
|
return (
|
|
80
60
|
<RadioGroupRoot
|
|
81
61
|
id={this.props.id}
|
|
82
62
|
role="radiogroup"
|
|
83
63
|
aria-describedby={this.props['aria-describedby']}
|
|
84
64
|
aria-errormessage={this.props['aria-errormessage']}
|
|
85
|
-
aria-invalid={this.props.error ||
|
|
65
|
+
aria-invalid={this.props.error || null}
|
|
86
66
|
aria-label={this.props['aria-label']}
|
|
87
67
|
aria-labelledby={this.props['aria-labelledby']}
|
|
88
68
|
$align={this.props.align}
|
|
89
69
|
$disabled={this.props.disabled}
|
|
90
|
-
$
|
|
91
|
-
$error={this.props.error || this.props.isError}
|
|
70
|
+
$error={this.props.error}
|
|
92
71
|
$required={this.props.required}
|
|
93
72
|
{...radioGroupRootProps}
|
|
94
73
|
>
|
|
@@ -102,7 +81,6 @@ class StatelessRadioGroup extends React.Component<PropsT, StatelessStateT> {
|
|
|
102
81
|
autoFocus: this.props.autoFocus,
|
|
103
82
|
checked,
|
|
104
83
|
disabled: this.props.disabled || child.props.disabled,
|
|
105
|
-
isError: this.props.isError,
|
|
106
84
|
error: this.props.error,
|
|
107
85
|
isFocused: this.state.focusedRadioIndex === index,
|
|
108
86
|
isFocusVisible: this.state.isFocusVisible,
|
|
@@ -114,8 +92,6 @@ class StatelessRadioGroup extends React.Component<PropsT, StatelessStateT> {
|
|
|
114
92
|
onChange: this.props.onChange,
|
|
115
93
|
onMouseEnter: this.props.onMouseEnter,
|
|
116
94
|
onMouseLeave: this.props.onMouseLeave,
|
|
117
|
-
// will need to remove overrides pass-through on next major version
|
|
118
|
-
overrides: { ...this.props.overrides, ...child.props.overrides },
|
|
119
95
|
});
|
|
120
96
|
})}
|
|
121
97
|
</RadioGroupRoot>
|
|
@@ -28,16 +28,15 @@ function getOuterColor(props) {
|
|
|
28
28
|
$disabled = props.$disabled,
|
|
29
29
|
$checked = props.$checked,
|
|
30
30
|
$isFocusVisible = props.$isFocusVisible,
|
|
31
|
-
$error = props.$error
|
|
32
|
-
$isError = props.$isError;
|
|
31
|
+
$error = props.$error;
|
|
33
32
|
if ($disabled) return colors.tickFillDisabled;
|
|
34
33
|
|
|
35
34
|
if (!$checked) {
|
|
36
35
|
if ($isFocusVisible) return colors.borderSelected;
|
|
37
|
-
if ($error
|
|
36
|
+
if ($error) return colors.tickBorderError;
|
|
38
37
|
return colors.tickBorder;
|
|
39
38
|
} else {
|
|
40
|
-
if ($error
|
|
39
|
+
if ($error) {
|
|
41
40
|
switch (getState(props)) {
|
|
42
41
|
case DEFAULT:
|
|
43
42
|
return colors.tickFillErrorSelected;
|
|
@@ -73,7 +72,7 @@ function getInnerColor(props) {
|
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
if (!props.$checked) {
|
|
76
|
-
if (props.$error
|
|
75
|
+
if (props.$error) {
|
|
77
76
|
switch (getState(props)) {
|
|
78
77
|
case DEFAULT:
|
|
79
78
|
return colors.tickFillError;
|
|
@@ -26,15 +26,14 @@ function getOuterColor(props) {
|
|
|
26
26
|
$checked,
|
|
27
27
|
$isFocusVisible,
|
|
28
28
|
$error,
|
|
29
|
-
$isError,
|
|
30
29
|
} = props;
|
|
31
30
|
if ($disabled) return colors.tickFillDisabled;
|
|
32
31
|
if (!$checked) {
|
|
33
32
|
if ($isFocusVisible) return colors.borderSelected;
|
|
34
|
-
if ($error
|
|
33
|
+
if ($error) return colors.tickBorderError;
|
|
35
34
|
return colors.tickBorder;
|
|
36
35
|
} else {
|
|
37
|
-
if ($error
|
|
36
|
+
if ($error) {
|
|
38
37
|
switch (getState(props)) {
|
|
39
38
|
case DEFAULT:
|
|
40
39
|
return colors.tickFillErrorSelected;
|
|
@@ -66,7 +65,7 @@ function getInnerColor(props) {
|
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
if (!props.$checked) {
|
|
69
|
-
if (props.$error
|
|
68
|
+
if (props.$error) {
|
|
70
69
|
switch (getState(props)) {
|
|
71
70
|
case DEFAULT:
|
|
72
71
|
return colors.tickFillError;
|
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
|
@@ -319,8 +319,6 @@ export const StyledIconsContainer: StyletronComponent<any>;
|
|
|
319
319
|
export const StyledSelectArrow: StyletronComponent<any>;
|
|
320
320
|
export const StyledClearIcon: StyletronComponent<any>;
|
|
321
321
|
export const StyledSearchIconContainer: StyletronComponent<any>;
|
|
322
|
-
// TODO(v11): remove StyledSearchIcon
|
|
323
|
-
export const StyledSearchIcon: StyletronComponent<any>;
|
|
324
322
|
export const StyledDropdownContainer: StyletronComponent<any>;
|
|
325
323
|
export const StyledDropdown: StyletronComponent<any>;
|
|
326
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,
|
|
@@ -22,8 +22,6 @@ var _index = require("../locale/index.js");
|
|
|
22
22
|
|
|
23
23
|
var _index2 = require("../popover/index.js");
|
|
24
24
|
|
|
25
|
-
var _index3 = require("../spinner/index.js");
|
|
26
|
-
|
|
27
25
|
var _reactUid = require("react-uid");
|
|
28
26
|
|
|
29
27
|
var _autosizeInput = _interopRequireDefault(require("./autosize-input.js"));
|
|
@@ -36,7 +34,7 @@ var _dropdown = _interopRequireDefault(require("./dropdown.js"));
|
|
|
36
34
|
|
|
37
35
|
var _styledComponents = require("./styled-components.js");
|
|
38
36
|
|
|
39
|
-
var
|
|
37
|
+
var _index3 = require("./utils/index.js");
|
|
40
38
|
|
|
41
39
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
42
40
|
|
|
@@ -660,7 +658,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
660
658
|
return !_this.state.inputValue;
|
|
661
659
|
});
|
|
662
660
|
|
|
663
|
-
_this.options = (0,
|
|
661
|
+
_this.options = (0, _index3.normalizeOptions)(props.options);
|
|
664
662
|
return _this;
|
|
665
663
|
}
|
|
666
664
|
|
|
@@ -778,7 +776,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
778
776
|
}
|
|
779
777
|
|
|
780
778
|
return value.map(function (value) {
|
|
781
|
-
return (0,
|
|
779
|
+
return (0, _index3.expandValue)(value, _this2.props);
|
|
782
780
|
});
|
|
783
781
|
}
|
|
784
782
|
}, {
|
|
@@ -796,24 +794,29 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
796
794
|
key: "renderLoading",
|
|
797
795
|
value: function renderLoading() {
|
|
798
796
|
if (!this.props.isLoading) return;
|
|
799
|
-
var sharedProps = this.getSharedProps();
|
|
800
797
|
var _this$props$overrides = this.props.overrides,
|
|
801
798
|
overrides = _this$props$overrides === void 0 ? {} : _this$props$overrides;
|
|
802
799
|
|
|
803
|
-
var _getOverrides = (0, _overrides.getOverrides)(overrides.LoadingIndicator,
|
|
800
|
+
var _getOverrides = (0, _overrides.getOverrides)(overrides.LoadingIndicator, _styledComponents.StyledLoadingIndicator),
|
|
804
801
|
_getOverrides2 = _slicedToArray(_getOverrides, 2),
|
|
805
802
|
LoadingIndicator = _getOverrides2[0],
|
|
806
803
|
loadingIndicatorProps = _getOverrides2[1];
|
|
807
804
|
|
|
808
805
|
return /*#__PURE__*/React.createElement(LoadingIndicator, _extends({
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
806
|
+
role: "status"
|
|
807
|
+
}, loadingIndicatorProps), /*#__PURE__*/React.createElement("span", {
|
|
808
|
+
style: {
|
|
809
|
+
position: 'absolute',
|
|
810
|
+
width: '1px',
|
|
811
|
+
height: '1px',
|
|
812
|
+
padding: 0,
|
|
813
|
+
margin: '-1px',
|
|
814
|
+
overflow: 'hidden',
|
|
815
|
+
clip: 'rect(0,0,0,0)',
|
|
816
|
+
whiteSpace: 'nowrap',
|
|
817
|
+
border: 0
|
|
818
|
+
}
|
|
819
|
+
}, "Loading"));
|
|
817
820
|
}
|
|
818
821
|
}, {
|
|
819
822
|
key: "renderValue",
|
|
@@ -1022,14 +1025,10 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
1022
1025
|
searchIconProps = _getOverrides12[1];
|
|
1023
1026
|
|
|
1024
1027
|
var sharedProps = this.getSharedProps();
|
|
1025
|
-
return (
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
size: 16,
|
|
1030
|
-
title: 'search'
|
|
1031
|
-
}, searchIconProps)))
|
|
1032
|
-
);
|
|
1028
|
+
return /*#__PURE__*/React.createElement(SearchIconContainer, _extends({}, sharedProps, searchIconContainerProps), /*#__PURE__*/React.createElement(SearchIcon, _extends({
|
|
1029
|
+
size: 16,
|
|
1030
|
+
title: 'search'
|
|
1031
|
+
}, sharedProps, searchIconProps)));
|
|
1033
1032
|
}
|
|
1034
1033
|
}, {
|
|
1035
1034
|
key: "filterOptions",
|
|
@@ -1106,7 +1105,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
1106
1105
|
value: function render() {
|
|
1107
1106
|
var _this6 = this;
|
|
1108
1107
|
|
|
1109
|
-
this.options = (0,
|
|
1108
|
+
this.options = (0, _index3.normalizeOptions)(this.props.options);
|
|
1110
1109
|
var _this$props2 = this.props,
|
|
1111
1110
|
_this$props2$override = _this$props2.overrides,
|
|
1112
1111
|
overrides = _this$props2$override === void 0 ? {} : _this$props2$override,
|
|
@@ -15,7 +15,6 @@ import SearchIconComponent from '../icon/search.js';
|
|
|
15
15
|
import { LocaleContext } from '../locale/index.js';
|
|
16
16
|
import type { LocaleT } from '../locale/types.js';
|
|
17
17
|
import { Popover, PLACEMENT } from '../popover/index.js';
|
|
18
|
-
import { Spinner } from '../spinner/index.js';
|
|
19
18
|
import { UIDConsumer } from 'react-uid';
|
|
20
19
|
|
|
21
20
|
import AutosizeInput from './autosize-input.js';
|
|
@@ -31,8 +30,8 @@ import {
|
|
|
31
30
|
StyledIconsContainer,
|
|
32
31
|
StyledSelectArrow,
|
|
33
32
|
StyledClearIcon,
|
|
34
|
-
getLoadingIconStyles,
|
|
35
33
|
StyledSearchIconContainer,
|
|
34
|
+
StyledLoadingIndicator,
|
|
36
35
|
} from './styled-components.js';
|
|
37
36
|
import type { PropsT, SelectStateT, ValueT, OptionT, ChangeActionT, ReactRefT } from './types.js';
|
|
38
37
|
import { expandValue, normalizeOptions } from './utils/index.js';
|
|
@@ -616,20 +615,33 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
616
615
|
|
|
617
616
|
renderLoading() {
|
|
618
617
|
if (!this.props.isLoading) return;
|
|
619
|
-
const sharedProps = this.getSharedProps();
|
|
620
618
|
const { overrides = {} } = this.props;
|
|
621
619
|
const [LoadingIndicator, loadingIndicatorProps] = getOverrides(
|
|
622
620
|
overrides.LoadingIndicator,
|
|
623
|
-
|
|
621
|
+
StyledLoadingIndicator
|
|
624
622
|
);
|
|
623
|
+
|
|
625
624
|
return (
|
|
626
|
-
<LoadingIndicator
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
625
|
+
<LoadingIndicator role="status" {...loadingIndicatorProps}>
|
|
626
|
+
{/* Offscreen content could be defined as styled-component and
|
|
627
|
+
overridable, but I can't think of a good reason for doing so.
|
|
628
|
+
LoadingIndicator children can be overriden if required. */}
|
|
629
|
+
<span
|
|
630
|
+
style={{
|
|
631
|
+
position: 'absolute',
|
|
632
|
+
width: '1px',
|
|
633
|
+
height: '1px',
|
|
634
|
+
padding: 0,
|
|
635
|
+
margin: '-1px',
|
|
636
|
+
overflow: 'hidden',
|
|
637
|
+
clip: 'rect(0,0,0,0)',
|
|
638
|
+
whiteSpace: 'nowrap',
|
|
639
|
+
border: 0,
|
|
640
|
+
}}
|
|
641
|
+
>
|
|
642
|
+
Loading
|
|
643
|
+
</span>
|
|
644
|
+
</LoadingIndicator>
|
|
633
645
|
);
|
|
634
646
|
}
|
|
635
647
|
|
|
@@ -840,9 +852,8 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
840
852
|
const sharedProps = this.getSharedProps();
|
|
841
853
|
|
|
842
854
|
return (
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
<SearchIcon size={16} title={'search'} {...searchIconProps} />
|
|
855
|
+
<SearchIconContainer {...sharedProps} {...searchIconContainerProps}>
|
|
856
|
+
<SearchIcon size={16} title={'search'} {...sharedProps} {...searchIconProps} />
|
|
846
857
|
</SearchIconContainer>
|
|
847
858
|
);
|
|
848
859
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.StyledSearchIconContainer = exports.
|
|
6
|
+
exports.StyledSearchIconContainer = exports.StyledLoadingIndicator = exports.StyledClearIcon = exports.StyledSelectArrow = exports.StyledIconsContainer = exports.StyledInputSizer = exports.StyledInput = exports.StyledInputContainer = exports.StyledSingleValue = exports.StyledPlaceholder = exports.StyledValueContainer = exports.StyledControlContainer = exports.StyledRoot = exports.StyledOptionContent = exports.StyledDropdownListItem = exports.StyledDropdown = exports.StyledDropdownContainer = void 0;
|
|
7
7
|
|
|
8
8
|
var _index = require("../styles/index.js");
|
|
9
9
|
|
|
@@ -11,6 +11,8 @@ var _constants = require("./constants.js");
|
|
|
11
11
|
|
|
12
12
|
var _index2 = require("../menu/index.js");
|
|
13
13
|
|
|
14
|
+
var _index3 = require("../spinner/index.js");
|
|
15
|
+
|
|
14
16
|
var _util = require("../styles/util.js");
|
|
15
17
|
|
|
16
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -111,10 +113,10 @@ function getControlContainerColors($disabled, $isFocused, $isPseudoFocused, $pos
|
|
|
111
113
|
if ($isFocused || $isPseudoFocused) {
|
|
112
114
|
return {
|
|
113
115
|
color: colors.contentPrimary,
|
|
114
|
-
borderLeftColor: colors.
|
|
115
|
-
borderRightColor: colors.
|
|
116
|
-
borderTopColor: colors.
|
|
117
|
-
borderBottomColor: colors.
|
|
116
|
+
borderLeftColor: colors.borderSelected,
|
|
117
|
+
borderRightColor: colors.borderSelected,
|
|
118
|
+
borderTopColor: colors.borderSelected,
|
|
119
|
+
borderBottomColor: colors.borderSelected,
|
|
118
120
|
backgroundColor: colors.inputFillActive
|
|
119
121
|
};
|
|
120
122
|
}
|
|
@@ -390,18 +392,22 @@ var StyledClearIcon = (0, _index.styled)('svg', function (props) {
|
|
|
390
392
|
});
|
|
391
393
|
exports.StyledClearIcon = StyledClearIcon;
|
|
392
394
|
StyledClearIcon.displayName = "StyledClearIcon";
|
|
393
|
-
|
|
394
|
-
var
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
395
|
+
var StyledLoadingIndicator = (0, _index.withStyle)(_index3.Spinner, function (_ref5) {
|
|
396
|
+
var $theme = _ref5.$theme;
|
|
397
|
+
return {
|
|
398
|
+
borderTopWidth: '2px',
|
|
399
|
+
borderRightWidth: '2px',
|
|
400
|
+
borderBottomWidth: '2px',
|
|
401
|
+
borderLeftWidth: '2px',
|
|
402
|
+
borderRightColor: $theme.colors.borderOpaque,
|
|
403
|
+
borderBottomColor: $theme.colors.borderOpaque,
|
|
404
|
+
borderLeftColor: $theme.colors.borderOpaque,
|
|
405
|
+
width: '16px',
|
|
406
|
+
height: '16px'
|
|
407
|
+
};
|
|
408
|
+
});
|
|
409
|
+
exports.StyledLoadingIndicator = StyledLoadingIndicator;
|
|
410
|
+
StyledLoadingIndicator.displayName = "StyledLoadingIndicator";
|
|
405
411
|
var StyledSearchIconContainer = (0, _index.styled)('div', function (props) {
|
|
406
412
|
var _objectSpread4;
|
|
407
413
|
|
|
@@ -6,13 +6,13 @@ LICENSE file in the root directory of this source tree.
|
|
|
6
6
|
*/
|
|
7
7
|
// @flow
|
|
8
8
|
|
|
9
|
-
import { styled } from '../styles/index.js';
|
|
9
|
+
import { styled, withStyle } from '../styles/index.js';
|
|
10
10
|
import { TYPE, SIZE } from './constants.js';
|
|
11
11
|
import { StyledList, StyledListItem } from '../menu/index.js';
|
|
12
|
+
import { Spinner } from '../spinner/index.js';
|
|
12
13
|
|
|
13
14
|
import type { SharedStylePropsArgT } from './types.js';
|
|
14
15
|
import { ellipsisText } from '../styles/util.js';
|
|
15
|
-
import type { ThemeT } from '../styles/types.js';
|
|
16
16
|
|
|
17
17
|
function getFont(size = SIZE.default, typography) {
|
|
18
18
|
return {
|
|
@@ -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
|
}
|
|
@@ -424,14 +424,19 @@ export const StyledClearIcon = styled<SharedStylePropsArgT>('svg', (props) => {
|
|
|
424
424
|
};
|
|
425
425
|
});
|
|
426
426
|
|
|
427
|
-
export const
|
|
428
|
-
const { $theme } = props;
|
|
429
|
-
const { colors } = $theme;
|
|
427
|
+
export const StyledLoadingIndicator = withStyle<typeof Spinner, {}>(Spinner, ({ $theme }) => {
|
|
430
428
|
return {
|
|
431
|
-
|
|
432
|
-
|
|
429
|
+
borderTopWidth: '2px',
|
|
430
|
+
borderRightWidth: '2px',
|
|
431
|
+
borderBottomWidth: '2px',
|
|
432
|
+
borderLeftWidth: '2px',
|
|
433
|
+
borderRightColor: $theme.colors.borderOpaque,
|
|
434
|
+
borderBottomColor: $theme.colors.borderOpaque,
|
|
435
|
+
borderLeftColor: $theme.colors.borderOpaque,
|
|
436
|
+
width: '16px',
|
|
437
|
+
height: '16px',
|
|
433
438
|
};
|
|
434
|
-
};
|
|
439
|
+
});
|
|
435
440
|
|
|
436
441
|
export const StyledSearchIconContainer = styled<SharedStylePropsArgT>('div', (props) => {
|
|
437
442
|
const { $disabled, $theme } = props;
|
|
@@ -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>;
|