baseui 11.0.1 → 11.1.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/a11y/index.d.ts +1 -1
- package/accordion/index.d.ts +25 -28
- package/app-nav-bar/app-nav-bar.js +33 -40
- package/app-nav-bar/app-nav-bar.js.flow +46 -62
- package/app-nav-bar/index.d.ts +9 -8
- package/app-nav-bar/styled-components.js +49 -29
- package/app-nav-bar/styled-components.js.flow +25 -8
- package/app-nav-bar/types.js.flow +2 -0
- package/aspect-ratio-box/index.d.ts +2 -4
- package/avatar/index.d.ts +6 -12
- package/badge/badge.js +109 -0
- package/badge/badge.js.flow +91 -0
- package/badge/constants.js +54 -0
- package/badge/constants.js.flow +52 -0
- package/badge/hint-dot.js +96 -0
- package/badge/hint-dot.js.flow +68 -0
- package/badge/index.d.ts +97 -0
- package/badge/index.js +80 -0
- package/badge/index.js.flow +20 -0
- package/badge/notification-circle.js +103 -0
- package/badge/notification-circle.js.flow +81 -0
- package/badge/package.json +4 -0
- package/badge/styled-components.js +242 -0
- package/badge/styled-components.js.flow +325 -0
- package/badge/types.js +11 -0
- package/badge/types.js.flow +59 -0
- package/badge/utils.js +33 -0
- package/badge/utils.js.flow +23 -0
- package/banner/banner.js +283 -0
- package/banner/banner.js.flow +253 -0
- package/banner/constants.js +35 -0
- package/banner/constants.js.flow +33 -0
- package/banner/index.d.ts +75 -0
- package/banner/index.js +44 -0
- package/banner/index.js.flow +16 -0
- package/banner/package.json +4 -0
- package/banner/styled-components.js +131 -0
- package/banner/styled-components.js.flow +119 -0
- package/banner/types.js +11 -0
- package/banner/types.js.flow +66 -0
- package/block/index.d.ts +4 -4
- package/breadcrumbs/breadcrumbs.js +5 -1
- package/breadcrumbs/breadcrumbs.js.flow +2 -2
- package/breadcrumbs/index.d.ts +5 -5
- package/button/button.js +2 -1
- package/button/button.js.flow +1 -0
- package/button/index.d.ts +19 -29
- package/button-group/index.d.ts +18 -24
- package/card/index.d.ts +16 -14
- package/checkbox/index.d.ts +17 -21
- package/combobox/index.d.ts +7 -11
- package/data-table/index.d.ts +7 -10
- package/datepicker/calendar.js +16 -11
- package/datepicker/calendar.js.flow +12 -9
- package/datepicker/datepicker.js +58 -58
- package/datepicker/datepicker.js.flow +51 -34
- package/datepicker/index.d.ts +42 -63
- package/datepicker/stateful-calendar.js +6 -1
- package/datepicker/stateful-calendar.js.flow +8 -1
- package/datepicker/stateful-container.js +23 -2
- package/datepicker/stateful-container.js.flow +17 -4
- package/datepicker/stateful-datepicker.js +6 -1
- package/datepicker/stateful-datepicker.js.flow +7 -1
- package/datepicker/types.js.flow +21 -43
- package/datepicker/utils/date-helpers.js +1 -1
- package/datepicker/utils/date-helpers.js.flow +1 -1
- package/dnd-list/index.d.ts +22 -35
- package/drawer/index.d.ts +22 -27
- package/es/app-nav-bar/app-nav-bar.js +9 -19
- package/es/app-nav-bar/styled-components.js +32 -13
- package/es/badge/badge.js +70 -0
- package/es/badge/constants.js +42 -0
- package/es/badge/hint-dot.js +55 -0
- package/es/badge/index.js +11 -0
- package/es/badge/notification-circle.js +65 -0
- package/es/badge/styled-components.js +296 -0
- package/es/badge/types.js +8 -0
- package/es/badge/utils.js +17 -0
- package/es/banner/banner.js +213 -0
- package/es/banner/constants.js +24 -0
- package/es/banner/index.js +9 -0
- package/es/banner/styled-components.js +122 -0
- package/es/banner/types.js +8 -0
- package/es/breadcrumbs/breadcrumbs.js +5 -1
- package/es/button/button.js +1 -0
- package/es/datepicker/calendar.js +15 -10
- package/es/datepicker/datepicker.js +52 -52
- package/es/datepicker/stateful-calendar.js +6 -1
- package/es/datepicker/stateful-container.js +22 -2
- package/es/datepicker/stateful-datepicker.js +6 -1
- package/es/datepicker/utils/date-helpers.js +1 -1
- package/es/helper/helper-steps.js +3 -1
- package/es/input/base-input.js +18 -11
- package/es/input/input.js +15 -10
- package/es/input/masked-input.js +5 -2
- package/es/input/utils.js +4 -2
- package/es/locale/tr_TR.js +115 -0
- package/es/notification/notification.js +16 -1
- package/es/payment-card/custom-cards.config.js +22 -0
- package/es/payment-card/icons/uatp.js +52 -0
- package/es/payment-card/payment-card.js +8 -3
- package/es/popover/popover.js +2 -1
- package/es/popover/stateful-container.js +2 -0
- package/es/popover/styled-components.js +2 -1
- package/es/progress-steps/numbered-step.js +2 -2
- package/es/select/select-component.js +48 -23
- package/es/select/utils/default-filter-options.js +1 -1
- package/es/snackbar/snackbar-context.js +1 -1
- package/es/table-semantic/styled-components.js +14 -0
- package/es/table-semantic/table-builder.js +12 -5
- package/es/textarea/textarea.js +15 -9
- package/es/themes/dark-theme/color-component-tokens.js +8 -0
- package/es/themes/light-theme/color-component-tokens.js +8 -0
- package/es/tree-view/tree-label.js +9 -1
- package/esm/app-nav-bar/app-nav-bar.js +32 -38
- package/esm/app-nav-bar/styled-components.js +46 -28
- package/esm/badge/badge.js +97 -0
- package/esm/badge/constants.js +42 -0
- package/esm/badge/hint-dot.js +83 -0
- package/esm/badge/index.js +11 -0
- package/esm/badge/notification-circle.js +91 -0
- package/esm/badge/styled-components.js +235 -0
- package/esm/badge/types.js +8 -0
- package/esm/badge/utils.js +17 -0
- package/esm/banner/banner.js +271 -0
- package/esm/banner/constants.js +24 -0
- package/esm/banner/index.js +9 -0
- package/esm/banner/styled-components.js +113 -0
- package/esm/banner/types.js +8 -0
- package/esm/breadcrumbs/breadcrumbs.js +5 -1
- package/esm/button/button.js +2 -1
- package/esm/datepicker/calendar.js +16 -11
- package/esm/datepicker/datepicker.js +58 -58
- package/esm/datepicker/stateful-calendar.js +6 -1
- package/esm/datepicker/stateful-container.js +23 -2
- package/esm/datepicker/stateful-datepicker.js +6 -1
- package/esm/datepicker/utils/date-helpers.js +1 -1
- package/esm/helper/helper-steps.js +3 -1
- package/esm/input/base-input.js +18 -11
- package/esm/input/input.js +15 -10
- package/esm/input/masked-input.js +6 -3
- package/esm/input/utils.js +4 -2
- package/esm/locale/tr_TR.js +115 -0
- package/esm/notification/notification.js +17 -1
- package/esm/payment-card/custom-cards.config.js +22 -0
- package/esm/payment-card/icons/uatp.js +53 -0
- package/esm/payment-card/payment-card.js +9 -7
- package/esm/popover/popover.js +2 -1
- package/esm/popover/stateful-container.js +2 -0
- package/esm/popover/styled-components.js +3 -2
- package/esm/progress-steps/numbered-step.js +2 -2
- package/esm/select/select-component.js +85 -59
- package/esm/select/utils/default-filter-options.js +1 -1
- package/esm/snackbar/snackbar-context.js +1 -1
- package/esm/table-semantic/styled-components.js +31 -18
- package/esm/table-semantic/table-builder.js +34 -23
- package/esm/textarea/textarea.js +15 -9
- package/esm/themes/dark-theme/color-component-tokens.js +8 -0
- package/esm/themes/light-theme/color-component-tokens.js +8 -0
- package/esm/tree-view/tree-label.js +10 -2
- package/file-uploader/index.d.ts +11 -11
- package/flex-grid/index.d.ts +3 -3
- package/form-control/index.d.ts +7 -19
- package/header-navigation/index.d.ts +8 -9
- package/heading/index.d.ts +3 -4
- package/helper/helper-steps.js +19 -13
- package/helper/helper-steps.js.flow +3 -1
- package/helper/index.d.ts +7 -7
- package/helpers/base-provider.d.ts +16 -0
- package/helpers/overrides.d.ts +23 -0
- package/icon/index.d.ts +32 -32
- package/index.d.ts +34 -114
- package/input/base-input.js +18 -11
- package/input/base-input.js.flow +18 -6
- package/input/index.d.ts +29 -32
- package/input/input.js +15 -10
- package/input/input.js.flow +10 -5
- package/input/masked-input.js +6 -3
- package/input/masked-input.js.flow +3 -0
- package/input/types.js.flow +4 -0
- package/input/utils.js +4 -2
- package/input/utils.js.flow +2 -1
- package/layer/index.d.ts +6 -11
- package/layout-grid/index.d.ts +25 -7
- package/link/index.d.ts +2 -2
- package/list/index.d.ts +26 -31
- package/{locale.ts → locale/index.d.ts} +8 -0
- package/locale/tr_TR.js +123 -0
- package/locale/tr_TR.js.flow +124 -0
- package/map-marker/index.d.ts +41 -47
- package/menu/index.d.ts +27 -37
- package/modal/index.d.ts +28 -38
- package/notification/index.d.ts +2 -3
- package/notification/notification.js +18 -1
- package/notification/notification.js.flow +15 -1
- package/overrides.ts +2 -22
- package/package.json +26 -17
- package/pagination/index.d.ts +22 -26
- package/payment-card/custom-cards.config.js +30 -0
- package/payment-card/custom-cards.config.js.flow +29 -0
- package/payment-card/icons/uatp.js +67 -0
- package/payment-card/icons/uatp.js.flow +62 -0
- package/payment-card/index.d.ts +8 -8
- package/payment-card/payment-card.js +12 -7
- package/payment-card/payment-card.js.flow +12 -0
- package/phone-input/index.d.ts +261 -269
- package/pin-code/index.d.ts +11 -18
- package/popover/index.d.ts +39 -55
- package/popover/popover.js +2 -1
- package/popover/popover.js.flow +2 -1
- package/popover/stateful-container.js +2 -0
- package/popover/stateful-container.js.flow +2 -0
- package/popover/styled-components.js +3 -2
- package/popover/styled-components.js.flow +2 -1
- package/popover/types.js.flow +1 -0
- package/progress-bar/index.d.ts +11 -12
- package/progress-steps/index.d.ts +16 -16
- package/progress-steps/numbered-step.js.flow +2 -2
- package/radio/index.d.ts +12 -15
- package/rating/index.d.ts +9 -12
- package/select/index.d.ts +34 -36
- package/select/select-component.js +82 -56
- package/select/select-component.js.flow +46 -34
- package/select/types.js.flow +1 -0
- package/select/utils/default-filter-options.js +1 -1
- package/select/utils/default-filter-options.js.flow +1 -1
- package/side-navigation/index.d.ts +11 -13
- package/skeleton/index.d.ts +1 -1
- package/slider/index.d.ts +17 -26
- package/snackbar/index.d.ts +8 -8
- package/snackbar/snackbar-context.js +1 -1
- package/snackbar/snackbar-context.js.flow +1 -1
- package/spinner/index.d.ts +4 -3
- package/styles/index.d.ts +82 -2
- package/table/index.d.ts +16 -16
- package/table-grid/index.d.ts +6 -8
- package/table-semantic/index.d.ts +26 -32
- package/table-semantic/styled-components.js +33 -19
- package/table-semantic/styled-components.js.flow +12 -0
- package/table-semantic/table-builder.js +38 -22
- package/table-semantic/table-builder.js.flow +32 -17
- package/table-semantic/types.js.flow +1 -0
- package/tabs/index.d.ts +20 -23
- package/tabs-motion/index.d.ts +23 -23
- package/tag/index.d.ts +14 -18
- package/tag/types.js.flow +1 -1
- package/textarea/index.d.ts +11 -14
- package/textarea/textarea.js +15 -9
- package/textarea/textarea.js.flow +11 -5
- package/textarea/types.js.flow +1 -0
- package/theme.ts +36 -777
- package/themes/dark-theme/color-component-tokens.js +8 -0
- package/themes/dark-theme/color-component-tokens.js.flow +9 -0
- package/themes/index.d.ts +765 -0
- package/themes/light-theme/color-component-tokens.js +8 -0
- package/themes/light-theme/color-component-tokens.js.flow +9 -0
- package/themes/types.js.flow +9 -0
- package/timepicker/index.d.ts +5 -8
- package/timezonepicker/index.d.ts +5 -8
- package/toast/index.d.ts +26 -40
- package/tokens/index.d.ts +1 -1
- package/tooltip/index.d.ts +7 -9
- package/tree-view/index.d.ts +15 -19
- package/tree-view/tree-label.js +10 -2
- package/tree-view/tree-label.js.flow +4 -4
- package/typography/index.d.ts +37 -37
package/input/base-input.js.flow
CHANGED
|
@@ -64,6 +64,7 @@ class BaseInput<T: HTMLInputElement | HTMLTextAreaElement> extends React.Compone
|
|
|
64
64
|
role: null,
|
|
65
65
|
size: SIZE.default,
|
|
66
66
|
type: 'text',
|
|
67
|
+
readOnly: false,
|
|
67
68
|
};
|
|
68
69
|
|
|
69
70
|
inputRef = this.props.inputRef || React.createRef<T>();
|
|
@@ -117,7 +118,12 @@ class BaseInput<T: HTMLInputElement | HTMLTextAreaElement> extends React.Compone
|
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
onInputKeyDown = (e: KeyboardEvent) => {
|
|
120
|
-
if (
|
|
121
|
+
if (
|
|
122
|
+
this.props.clearOnEscape &&
|
|
123
|
+
e.key === 'Escape' &&
|
|
124
|
+
this.inputRef.current &&
|
|
125
|
+
!this.props.readOnly
|
|
126
|
+
) {
|
|
121
127
|
this.clearValue();
|
|
122
128
|
// prevent event from closing modal or doing something unexpected
|
|
123
129
|
e.stopPropagation();
|
|
@@ -131,13 +137,17 @@ class BaseInput<T: HTMLInputElement | HTMLTextAreaElement> extends React.Compone
|
|
|
131
137
|
};
|
|
132
138
|
|
|
133
139
|
onFocus = (e: SyntheticFocusEvent<T>) => {
|
|
134
|
-
this.
|
|
135
|
-
|
|
140
|
+
if (!this.props.readOnly) {
|
|
141
|
+
this.setState({ isFocused: true });
|
|
142
|
+
this.props.onFocus(e);
|
|
143
|
+
}
|
|
136
144
|
};
|
|
137
145
|
|
|
138
146
|
onBlur = (e: SyntheticFocusEvent<T>) => {
|
|
139
|
-
this.
|
|
140
|
-
|
|
147
|
+
if (!this.props.readOnly) {
|
|
148
|
+
this.setState({ isFocused: false });
|
|
149
|
+
this.props.onBlur(e);
|
|
150
|
+
}
|
|
141
151
|
};
|
|
142
152
|
|
|
143
153
|
getInputType() {
|
|
@@ -219,9 +229,10 @@ class BaseInput<T: HTMLInputElement | HTMLTextAreaElement> extends React.Compone
|
|
|
219
229
|
};
|
|
220
230
|
|
|
221
231
|
renderClear() {
|
|
222
|
-
const { clearable, value, disabled, overrides = {} } = this.props;
|
|
232
|
+
const { clearable, value, disabled, readOnly, overrides = {} } = this.props;
|
|
223
233
|
if (
|
|
224
234
|
disabled ||
|
|
235
|
+
readOnly ||
|
|
225
236
|
!clearable ||
|
|
226
237
|
value == null ||
|
|
227
238
|
(typeof value === 'string' && value.length === 0)
|
|
@@ -320,6 +331,7 @@ class BaseInput<T: HTMLInputElement | HTMLTextAreaElement> extends React.Compone
|
|
|
320
331
|
aria-required={this.props.required}
|
|
321
332
|
autoComplete={autoComplete}
|
|
322
333
|
disabled={this.props.disabled}
|
|
334
|
+
readOnly={this.props.readOnly}
|
|
323
335
|
id={this.props.id}
|
|
324
336
|
inputMode={this.props.inputMode}
|
|
325
337
|
maxLength={this.props.maxLength}
|
package/input/index.d.ts
CHANGED
|
@@ -2,30 +2,30 @@ import * as React from 'react';
|
|
|
2
2
|
import { StyletronComponent } from 'styletron-react';
|
|
3
3
|
import { Override } from '../overrides';
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export declare const STATE_CHANGE_TYPE: {
|
|
6
6
|
change: 'change';
|
|
7
|
-
}
|
|
8
|
-
export
|
|
7
|
+
};
|
|
8
|
+
export declare const ADJOINED: {
|
|
9
9
|
none: 'none';
|
|
10
10
|
left: 'left';
|
|
11
11
|
right: 'right';
|
|
12
12
|
both: 'both';
|
|
13
|
-
}
|
|
14
|
-
export
|
|
13
|
+
};
|
|
14
|
+
export declare const SIZE: {
|
|
15
15
|
mini: 'mini';
|
|
16
16
|
default: 'default';
|
|
17
17
|
compact: 'compact';
|
|
18
18
|
large: 'large';
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
|
|
21
|
-
export
|
|
21
|
+
export declare const CUSTOM_INPUT_TYPE: {
|
|
22
22
|
textarea: 'textarea';
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
24
|
|
|
25
|
-
export
|
|
25
|
+
export declare const ENHANCER_POSITION: {
|
|
26
26
|
start: 'start';
|
|
27
27
|
end: 'end';
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
|
|
30
30
|
export interface BaseInputOverrides<T> {
|
|
31
31
|
InputContainer?: Override<T>;
|
|
@@ -39,7 +39,7 @@ export interface BaseInputProps<T> {
|
|
|
39
39
|
'aria-label'?: string;
|
|
40
40
|
'aria-labelledby'?: string;
|
|
41
41
|
'aria-describedby'?: string;
|
|
42
|
-
adjoined?: ADJOINED[keyof ADJOINED];
|
|
42
|
+
adjoined?: typeof ADJOINED[keyof typeof ADJOINED];
|
|
43
43
|
autoComplete?: string;
|
|
44
44
|
autoFocus?: boolean;
|
|
45
45
|
clearable?: boolean;
|
|
@@ -63,13 +63,14 @@ export interface BaseInputProps<T> {
|
|
|
63
63
|
overrides?: BaseInputOverrides<SharedProps>;
|
|
64
64
|
placeholder?: string;
|
|
65
65
|
required?: boolean;
|
|
66
|
-
size?: SIZE[keyof SIZE];
|
|
66
|
+
size?: typeof SIZE[keyof typeof SIZE];
|
|
67
67
|
type?: string;
|
|
68
68
|
value?: string | number;
|
|
69
69
|
rows?: number;
|
|
70
70
|
min?: number;
|
|
71
71
|
max?: number;
|
|
72
72
|
step?: number | 'any';
|
|
73
|
+
readOnly?: boolean;
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
export interface State {
|
|
@@ -90,6 +91,8 @@ export type InputOverrides = BaseInputOverrides<SharedProps> & {
|
|
|
90
91
|
export type SharedProps = {
|
|
91
92
|
/** Renders UI in 'focus' state */
|
|
92
93
|
$isFocused: boolean;
|
|
94
|
+
/** Renders UI in 'readOnly' state */
|
|
95
|
+
$isReadOnly: boolean;
|
|
93
96
|
/** Renders UI in 'disabled' state */
|
|
94
97
|
$disabled: boolean;
|
|
95
98
|
/** Renders UI in 'error' state */
|
|
@@ -97,12 +100,12 @@ export type SharedProps = {
|
|
|
97
100
|
/** Renders UI in 'positive' state */
|
|
98
101
|
$positive: boolean;
|
|
99
102
|
/** Defines styles for inputs that are grouped with other controls. */
|
|
100
|
-
$adjoined: keyof ADJOINED;
|
|
103
|
+
$adjoined: typeof ADJOINED[keyof typeof ADJOINED];
|
|
101
104
|
/** Renders UI in provided size. */
|
|
102
|
-
$size: keyof SIZE;
|
|
105
|
+
$size: typeof SIZE[keyof typeof SIZE];
|
|
103
106
|
/** Renders UI in 'required' state */
|
|
104
107
|
$required: boolean;
|
|
105
|
-
$position: keyof ENHANCER_POSITION;
|
|
108
|
+
$position: typeof ENHANCER_POSITION[keyof typeof ENHANCER_POSITION];
|
|
106
109
|
/** Defines if has a clearable or MaskToggleButton at the end */
|
|
107
110
|
$hasIconTrailing: boolean;
|
|
108
111
|
};
|
|
@@ -133,13 +136,13 @@ export interface MaskedInputProps extends InputProps {
|
|
|
133
136
|
maskChar?: string;
|
|
134
137
|
}
|
|
135
138
|
|
|
136
|
-
export const MaskedInput: React.FC<MaskedInputProps>;
|
|
139
|
+
export declare const MaskedInput: React.FC<MaskedInputProps>;
|
|
137
140
|
|
|
138
141
|
export interface StatefulContainerProps {
|
|
139
142
|
children?: React.ReactNode;
|
|
140
143
|
initialState?: State;
|
|
141
144
|
stateReducer?: (
|
|
142
|
-
stateType: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE],
|
|
145
|
+
stateType: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE],
|
|
143
146
|
nextState: State,
|
|
144
147
|
currentState: State
|
|
145
148
|
) => State;
|
|
@@ -148,18 +151,12 @@ export interface StatefulContainerProps {
|
|
|
148
151
|
|
|
149
152
|
export type StatefulInputProps = InputProps & StatefulContainerProps & { children?: never };
|
|
150
153
|
|
|
151
|
-
export const StatefulInput: React.FC<StatefulInputProps>;
|
|
152
|
-
export const StatefulContainer: React.FC<StatefulContainerProps>;
|
|
153
|
-
|
|
154
|
-
export const StyledRoot: StyletronComponent<any>;
|
|
155
|
-
export const StyledInputEnhancer: StyletronComponent<any>;
|
|
156
|
-
export const StyledStartEnhancer: StyletronComponent<any>;
|
|
157
|
-
export const StyledEndEnhancer: StyletronComponent<any>;
|
|
158
|
-
export const StyledInputContainer: StyletronComponent<any>;
|
|
159
|
-
export const StyledInput: StyletronComponent<any>;
|
|
160
|
-
|
|
161
|
-
export const STATE_CHANGE_TYPE: STATE_CHANGE_TYPE;
|
|
162
|
-
export const CUSTOM_INPUT_TYPE: CUSTOM_INPUT_TYPE;
|
|
163
|
-
export const ADJOINED: ADJOINED;
|
|
164
|
-
export const SIZE: SIZE;
|
|
165
|
-
export const ENHANCER_POSITION: ENHANCER_POSITION;
|
|
154
|
+
export declare const StatefulInput: React.FC<StatefulInputProps>;
|
|
155
|
+
export declare const StatefulContainer: React.FC<StatefulContainerProps>;
|
|
156
|
+
|
|
157
|
+
export declare const StyledRoot: StyletronComponent<any>;
|
|
158
|
+
export declare const StyledInputEnhancer: StyletronComponent<any>;
|
|
159
|
+
export declare const StyledStartEnhancer: StyletronComponent<any>;
|
|
160
|
+
export declare const StyledEndEnhancer: StyletronComponent<any>;
|
|
161
|
+
export declare const StyledInputContainer: StyletronComponent<any>;
|
|
162
|
+
export declare const StyledInput: StyletronComponent<any>;
|
package/input/input.js
CHANGED
|
@@ -82,23 +82,27 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
82
82
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
83
83
|
|
|
84
84
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
85
|
-
isFocused: _this.props.autoFocus || false
|
|
85
|
+
isFocused: _this.props.autoFocus && !_this.props.readOnly || false
|
|
86
86
|
});
|
|
87
87
|
|
|
88
88
|
_defineProperty(_assertThisInitialized(_this), "onFocus", function (e) {
|
|
89
|
-
_this.
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
if (!_this.props.readOnly) {
|
|
90
|
+
_this.setState({
|
|
91
|
+
isFocused: true
|
|
92
|
+
});
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
_this.props.onFocus(e);
|
|
95
|
+
}
|
|
94
96
|
});
|
|
95
97
|
|
|
96
98
|
_defineProperty(_assertThisInitialized(_this), "onBlur", function (e) {
|
|
97
|
-
_this.
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
if (!_this.props.readOnly) {
|
|
100
|
+
_this.setState({
|
|
101
|
+
isFocused: false
|
|
102
|
+
});
|
|
100
103
|
|
|
101
|
-
|
|
104
|
+
_this.props.onBlur(e);
|
|
105
|
+
}
|
|
102
106
|
});
|
|
103
107
|
|
|
104
108
|
return _this;
|
|
@@ -175,7 +179,8 @@ _defineProperty(Input, "defaultProps", {
|
|
|
175
179
|
startEnhancer: null,
|
|
176
180
|
endEnhancer: null,
|
|
177
181
|
clearable: false,
|
|
178
|
-
type: 'text'
|
|
182
|
+
type: 'text',
|
|
183
|
+
readOnly: false
|
|
179
184
|
});
|
|
180
185
|
|
|
181
186
|
function getAdjoinedProp(startEnhancer, endEnhancer) {
|
package/input/input.js.flow
CHANGED
|
@@ -28,6 +28,7 @@ class Input extends React.Component<InputPropsT, InternalStateT> {
|
|
|
28
28
|
endEnhancer: null,
|
|
29
29
|
clearable: false,
|
|
30
30
|
type: 'text',
|
|
31
|
+
readOnly: false,
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
/**
|
|
@@ -35,17 +36,21 @@ class Input extends React.Component<InputPropsT, InternalStateT> {
|
|
|
35
36
|
* customers shouldn't have to manage themselves, such as input's focus state.
|
|
36
37
|
*/
|
|
37
38
|
state = {
|
|
38
|
-
isFocused: this.props.autoFocus || false,
|
|
39
|
+
isFocused: (this.props.autoFocus && !this.props.readOnly) || false,
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
onFocus = (e: SyntheticFocusEvent<HTMLInputElement>) => {
|
|
42
|
-
this.
|
|
43
|
-
|
|
43
|
+
if (!this.props.readOnly) {
|
|
44
|
+
this.setState({ isFocused: true });
|
|
45
|
+
this.props.onFocus(e);
|
|
46
|
+
}
|
|
44
47
|
};
|
|
45
48
|
|
|
46
49
|
onBlur = (e: SyntheticFocusEvent<HTMLInputElement>) => {
|
|
47
|
-
this.
|
|
48
|
-
|
|
50
|
+
if (!this.props.readOnly) {
|
|
51
|
+
this.setState({ isFocused: false });
|
|
52
|
+
this.props.onBlur(e);
|
|
53
|
+
}
|
|
49
54
|
};
|
|
50
55
|
|
|
51
56
|
render() {
|
package/input/masked-input.js
CHANGED
|
@@ -43,14 +43,16 @@ var MaskOverride = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
43
43
|
onBlur = _ref.onBlur,
|
|
44
44
|
value = _ref.value,
|
|
45
45
|
disabled = _ref.disabled,
|
|
46
|
-
|
|
46
|
+
readOnly = _ref.readOnly,
|
|
47
|
+
restProps = _objectWithoutProperties(_ref, ["startEnhancer", "endEnhancer", "error", "positive", "onChange", "onFocus", "onBlur", "value", "disabled", "readOnly"]);
|
|
47
48
|
|
|
48
49
|
return /*#__PURE__*/React.createElement(_reactInputMask.default, _extends({
|
|
49
50
|
onChange: onChange,
|
|
50
51
|
onFocus: onFocus,
|
|
51
52
|
onBlur: onBlur,
|
|
52
53
|
value: value,
|
|
53
|
-
disabled: disabled
|
|
54
|
+
disabled: disabled,
|
|
55
|
+
readOnly: readOnly
|
|
54
56
|
}, restProps), function (props) {
|
|
55
57
|
return /*#__PURE__*/React.createElement(_styledComponents.Input, _extends({
|
|
56
58
|
ref: ref,
|
|
@@ -58,7 +60,8 @@ var MaskOverride = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
58
60
|
onFocus: onFocus,
|
|
59
61
|
onBlur: onBlur,
|
|
60
62
|
value: value,
|
|
61
|
-
disabled: disabled
|
|
63
|
+
disabled: disabled,
|
|
64
|
+
readOnly: readOnly
|
|
62
65
|
}, props));
|
|
63
66
|
});
|
|
64
67
|
});
|
|
@@ -28,6 +28,7 @@ const MaskOverride = React.forwardRef<MaskedInputPropsT, HTMLInputElement>(
|
|
|
28
28
|
onBlur,
|
|
29
29
|
value,
|
|
30
30
|
disabled,
|
|
31
|
+
readOnly,
|
|
31
32
|
...restProps
|
|
32
33
|
}: MaskedInputPropsT,
|
|
33
34
|
ref
|
|
@@ -39,6 +40,7 @@ const MaskOverride = React.forwardRef<MaskedInputPropsT, HTMLInputElement>(
|
|
|
39
40
|
onBlur={onBlur}
|
|
40
41
|
value={value}
|
|
41
42
|
disabled={disabled}
|
|
43
|
+
readOnly={readOnly}
|
|
42
44
|
{...restProps}
|
|
43
45
|
>
|
|
44
46
|
{(props) => (
|
|
@@ -49,6 +51,7 @@ const MaskOverride = React.forwardRef<MaskedInputPropsT, HTMLInputElement>(
|
|
|
49
51
|
onBlur={onBlur}
|
|
50
52
|
value={value}
|
|
51
53
|
disabled={disabled}
|
|
54
|
+
readOnly={readOnly}
|
|
52
55
|
{...props}
|
|
53
56
|
/>
|
|
54
57
|
)}
|
package/input/types.js.flow
CHANGED
|
@@ -38,6 +38,8 @@ export type StateReducerT = (
|
|
|
38
38
|
export type SharedPropsT = {|
|
|
39
39
|
/** Renders UI in 'focus' state */
|
|
40
40
|
$isFocused: boolean,
|
|
41
|
+
/** Renders UI in 'readOnly' state */
|
|
42
|
+
$isReadOnly: boolean,
|
|
41
43
|
/** Renders UI in 'disabled' state */
|
|
42
44
|
$disabled: boolean,
|
|
43
45
|
/** Renders UI in 'error' state */
|
|
@@ -141,6 +143,8 @@ export type BaseInputPropsT<T> = {|
|
|
|
141
143
|
max?: number,
|
|
142
144
|
/** step value when used as input type=number */
|
|
143
145
|
step?: number | 'any',
|
|
146
|
+
/** Renders component in 'readOnly' state. */
|
|
147
|
+
readOnly?: boolean,
|
|
144
148
|
|};
|
|
145
149
|
|
|
146
150
|
export type InputPropsT = {|
|
package/input/utils.js
CHANGED
|
@@ -17,7 +17,8 @@ function getSharedProps(props, state) {
|
|
|
17
17
|
positive = props.positive,
|
|
18
18
|
adjoined = props.adjoined,
|
|
19
19
|
size = props.size,
|
|
20
|
-
required = props.required
|
|
20
|
+
required = props.required,
|
|
21
|
+
readOnly = props.readOnly;
|
|
21
22
|
var isFocused = state.isFocused;
|
|
22
23
|
return {
|
|
23
24
|
$isFocused: isFocused,
|
|
@@ -26,6 +27,7 @@ function getSharedProps(props, state) {
|
|
|
26
27
|
$positive: positive,
|
|
27
28
|
$adjoined: adjoined,
|
|
28
29
|
$size: size,
|
|
29
|
-
$required: required
|
|
30
|
+
$required: required,
|
|
31
|
+
$isReadOnly: readOnly
|
|
30
32
|
};
|
|
31
33
|
}
|
package/input/utils.js.flow
CHANGED
|
@@ -11,7 +11,7 @@ export function getSharedProps<T>(
|
|
|
11
11
|
props: BaseInputPropsT<T> | InputPropsT,
|
|
12
12
|
state: InternalStateT
|
|
13
13
|
): $Shape<SharedPropsT> {
|
|
14
|
-
const { disabled, error, positive, adjoined, size, required } = props;
|
|
14
|
+
const { disabled, error, positive, adjoined, size, required, readOnly } = props;
|
|
15
15
|
const { isFocused } = state;
|
|
16
16
|
return {
|
|
17
17
|
$isFocused: isFocused,
|
|
@@ -21,6 +21,7 @@ export function getSharedProps<T>(
|
|
|
21
21
|
$adjoined: adjoined,
|
|
22
22
|
$size: size,
|
|
23
23
|
$required: required,
|
|
24
|
+
$isReadOnly: readOnly,
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
|
package/layer/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export declare const TETHER_PLACEMENT: {
|
|
4
4
|
auto: 'auto';
|
|
5
5
|
topLeft: 'topLeft';
|
|
6
6
|
top: 'top';
|
|
@@ -14,9 +14,9 @@ export interface TETHER_PLACEMENT {
|
|
|
14
14
|
leftBottom: 'leftBottom';
|
|
15
15
|
left: 'left';
|
|
16
16
|
leftTop: 'leftTop';
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
18
|
|
|
19
|
-
export type TetherPlacement = TETHER_PLACEMENT;
|
|
19
|
+
export type TetherPlacement = typeof TETHER_PLACEMENT[keyof typeof TETHER_PLACEMENT];
|
|
20
20
|
|
|
21
21
|
export interface NormalizedOffset {
|
|
22
22
|
top: number;
|
|
@@ -46,11 +46,8 @@ export interface TetherProps {
|
|
|
46
46
|
arrowRef?: React.Ref<HTMLElement>;
|
|
47
47
|
popperRef?: React.Ref<HTMLElement>;
|
|
48
48
|
children: React.ReactNode;
|
|
49
|
-
onPopperUpdate?: (
|
|
50
|
-
|
|
51
|
-
popper: PopperDataObject,
|
|
52
|
-
) => any;
|
|
53
|
-
placement?: TETHER_PLACEMENT[keyof TETHER_PLACEMENT];
|
|
49
|
+
onPopperUpdate?: (offsets: NormalizedOffsets, popper: PopperDataObject) => any;
|
|
50
|
+
placement?: typeof TETHER_PLACEMENT[keyof typeof TETHER_PLACEMENT];
|
|
54
51
|
popperOptions?: any;
|
|
55
52
|
}
|
|
56
53
|
export interface TetherState {
|
|
@@ -81,6 +78,4 @@ export interface LayerProps {
|
|
|
81
78
|
export class LayersManager extends React.Component<LayersManagerProps> {
|
|
82
79
|
host: React.Ref<HTMLElement>;
|
|
83
80
|
}
|
|
84
|
-
export const Layer: React.FC<LayerProps>;
|
|
85
|
-
|
|
86
|
-
export const TETHER_PLACEMENT: TETHER_PLACEMENT;
|
|
81
|
+
export declare const Layer: React.FC<LayerProps>;
|
package/layout-grid/index.d.ts
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {StyletronComponent} from 'styletron-react';
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { StyletronComponent } from 'styletron-react';
|
|
3
|
+
import { Override } from '../overrides';
|
|
4
|
+
|
|
5
|
+
export type CSSLengthUnitT =
|
|
6
|
+
| 'cm'
|
|
7
|
+
| 'mm'
|
|
8
|
+
| 'Q'
|
|
9
|
+
| 'in'
|
|
10
|
+
| 'pc'
|
|
11
|
+
| 'px'
|
|
12
|
+
| 'pt'
|
|
13
|
+
| 'em'
|
|
14
|
+
| 'ex'
|
|
15
|
+
| 'ch'
|
|
16
|
+
| 'rem'
|
|
17
|
+
| 'lh'
|
|
18
|
+
| 'vw'
|
|
19
|
+
| 'vh'
|
|
20
|
+
| 'vmin'
|
|
21
|
+
| 'vmax'
|
|
22
|
+
| '%';
|
|
5
23
|
|
|
6
24
|
export enum ALIGNMENT {
|
|
7
25
|
start = 'flex-start',
|
|
@@ -74,7 +92,7 @@ export type StyledCellProps = {
|
|
|
74
92
|
$span?: Responsive<number>;
|
|
75
93
|
};
|
|
76
94
|
|
|
77
|
-
export const Grid: React.FunctionComponent<GridProps>;
|
|
78
|
-
export const Cell: React.FunctionComponent<CellProps>;
|
|
79
|
-
export const StyledGrid: StyletronComponent<StyledGridProps>;
|
|
80
|
-
export const StyledCell: StyletronComponent<StyledCellProps>;
|
|
95
|
+
export declare const Grid: React.FunctionComponent<GridProps>;
|
|
96
|
+
export declare const Cell: React.FunctionComponent<CellProps>;
|
|
97
|
+
export declare const StyledGrid: StyletronComponent<StyledGridProps>;
|
|
98
|
+
export declare const StyledCell: StyletronComponent<StyledCellProps>;
|
package/link/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {StyletronComponent} from 'styletron-react';
|
|
2
|
+
import { StyletronComponent } from 'styletron-react';
|
|
3
3
|
|
|
4
4
|
export interface LinkProps
|
|
5
5
|
extends React.DetailedHTMLProps<
|
|
@@ -10,4 +10,4 @@ export interface LinkProps
|
|
|
10
10
|
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export const StyledLink: StyletronComponent<LinkProps>;
|
|
13
|
+
export declare const StyledLink: StyletronComponent<LinkProps>;
|
package/list/index.d.ts
CHANGED
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import {HeaderNavigationOverrides} from '
|
|
1
|
+
import { HeaderNavigationOverrides } from '../header-navigation';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {StyletronComponent} from 'styletron-react';
|
|
4
|
-
import {Override} from '../overrides';
|
|
3
|
+
import { StyletronComponent } from 'styletron-react';
|
|
4
|
+
import { Override } from '../overrides';
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export declare const ARTWORK_SIZES: {
|
|
7
7
|
SMALL: 'SMALL';
|
|
8
8
|
MEDIUM: 'MEDIUM';
|
|
9
9
|
LARGE: 'LARGE';
|
|
10
|
-
}
|
|
11
|
-
export
|
|
12
|
-
export type ArtworkSizesT =
|
|
13
|
-
| ARTWORK_SIZES['SMALL']
|
|
14
|
-
| ARTWORK_SIZES['MEDIUM']
|
|
15
|
-
| ARTWORK_SIZES['LARGE'];
|
|
10
|
+
};
|
|
11
|
+
export type ArtworkSizesT = typeof ARTWORK_SIZES[keyof typeof ARTWORK_SIZES];
|
|
16
12
|
|
|
17
|
-
export
|
|
13
|
+
export declare const SHAPE: {
|
|
18
14
|
DEFAULT: 'DEFAULT';
|
|
19
15
|
ROUND: 'ROUND';
|
|
20
|
-
}
|
|
21
|
-
export
|
|
22
|
-
export type ShapeT = SHAPE['DEFAULT'] | SHAPE['ROUND'];
|
|
16
|
+
};
|
|
17
|
+
export type ShapeT = typeof SHAPE[keyof typeof SHAPE];
|
|
23
18
|
|
|
24
19
|
export interface StyledRootPropsT {
|
|
25
20
|
$shape: ShapeT;
|
|
@@ -47,11 +42,11 @@ export interface LabelOverrides {
|
|
|
47
42
|
}
|
|
48
43
|
|
|
49
44
|
export interface PropsT {
|
|
50
|
-
artwork?: React.ReactNode;
|
|
45
|
+
artwork?: (args: { size: number }) => React.ReactNode;
|
|
51
46
|
artworkSize?: ArtworkSizesT | number;
|
|
52
47
|
shape?: ShapeT;
|
|
53
48
|
children: React.ReactNode;
|
|
54
|
-
endEnhancer?: React.ReactNode;
|
|
49
|
+
endEnhancer?: () => React.ReactNode;
|
|
55
50
|
overrides?: ListOverrides;
|
|
56
51
|
sublist?: boolean;
|
|
57
52
|
}
|
|
@@ -72,16 +67,16 @@ export interface MenuAdapterPropsT extends PropsT {
|
|
|
72
67
|
$disabled: boolean;
|
|
73
68
|
}
|
|
74
69
|
|
|
75
|
-
export const ListItem: React.ForwardRefExoticComponent<
|
|
70
|
+
export declare const ListItem: React.ForwardRefExoticComponent<
|
|
76
71
|
PropsT & React.RefAttributes<HTMLLIElement>
|
|
77
72
|
>;
|
|
78
|
-
export const ListItemLabel: React.FC<LabelPropsT>;
|
|
79
|
-
export const MenuAdapter: React.FC<MenuAdapterPropsT>;
|
|
73
|
+
export declare const ListItemLabel: React.FC<LabelPropsT>;
|
|
74
|
+
export declare const MenuAdapter: React.FC<MenuAdapterPropsT>;
|
|
80
75
|
|
|
81
|
-
export const StyledRoot: StyletronComponent<{}>;
|
|
82
|
-
export const StyledContent: StyletronComponent<StyledContentPropsT>;
|
|
83
|
-
export const StyledEndEnhancerContainer: StyletronComponent<{}>;
|
|
84
|
-
export const StyledArtworkContainer: StyletronComponent<StyledArtworkContainerPropsT>;
|
|
76
|
+
export declare const StyledRoot: StyletronComponent<{}>;
|
|
77
|
+
export declare const StyledContent: StyletronComponent<StyledContentPropsT>;
|
|
78
|
+
export declare const StyledEndEnhancerContainer: StyletronComponent<{}>;
|
|
79
|
+
export declare const StyledArtworkContainer: StyletronComponent<StyledArtworkContainerPropsT>;
|
|
85
80
|
|
|
86
81
|
export interface HeadingPropsT {
|
|
87
82
|
heading: React.ReactNode;
|
|
@@ -100,14 +95,14 @@ export type StyledHeadingHeadingPropsT = {
|
|
|
100
95
|
$maxLines: 1 | 2;
|
|
101
96
|
};
|
|
102
97
|
|
|
103
|
-
export const ListHeading: React.ForwardRefExoticComponent<
|
|
98
|
+
export declare const ListHeading: React.ForwardRefExoticComponent<
|
|
104
99
|
HeadingPropsT & React.RefAttributes<HTMLLIElement>
|
|
105
100
|
>;
|
|
106
101
|
|
|
107
|
-
export const StyledHeadingRoot: StyletronComponent<{}>;
|
|
108
|
-
export const StyledHeadingContent: StyletronComponent<{}>;
|
|
109
|
-
export const StyledHeadingContentRow: StyletronComponent<{}>;
|
|
110
|
-
export const StyledHeadingMainHeading: StyletronComponent<StyledHeadingHeadingPropsT>;
|
|
111
|
-
export const StyledHeadingSubHeading: StyletronComponent<StyledHeadingHeadingPropsT>;
|
|
112
|
-
export const StyledHeadingEndEnhancerContainer: StyletronComponent<StyledHeadingEndEnhancerContainerPropsT>;
|
|
113
|
-
export const StyledHeadingEndEnhancerDescriptionContainer: StyletronComponent<{}>;
|
|
102
|
+
export declare const StyledHeadingRoot: StyletronComponent<{}>;
|
|
103
|
+
export declare const StyledHeadingContent: StyletronComponent<{}>;
|
|
104
|
+
export declare const StyledHeadingContentRow: StyletronComponent<{}>;
|
|
105
|
+
export declare const StyledHeadingMainHeading: StyletronComponent<StyledHeadingHeadingPropsT>;
|
|
106
|
+
export declare const StyledHeadingSubHeading: StyletronComponent<StyledHeadingHeadingPropsT>;
|
|
107
|
+
export declare const StyledHeadingEndEnhancerContainer: StyletronComponent<StyledHeadingEndEnhancerContainerPropsT>;
|
|
108
|
+
export declare const StyledHeadingEndEnhancerDescriptionContainer: StyletronComponent<{}>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
1
3
|
interface AccordionLocale {
|
|
2
4
|
collapse: string;
|
|
3
5
|
expand: string;
|
|
@@ -101,3 +103,9 @@ export interface Locale {
|
|
|
101
103
|
select: SelectLocale;
|
|
102
104
|
toast: ToastLocale;
|
|
103
105
|
}
|
|
106
|
+
|
|
107
|
+
export interface LocaleProviderProps {
|
|
108
|
+
locale: Partial<Locale>;
|
|
109
|
+
children?: React.ReactNode;
|
|
110
|
+
}
|
|
111
|
+
export declare const LocaleProvider: React.FC<LocaleProviderProps>;
|