baseui 11.0.2 → 11.1.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.
Files changed (241) hide show
  1. package/a11y/index.d.ts +1 -1
  2. package/accordion/index.d.ts +25 -28
  3. package/app-nav-bar/app-nav-bar.js +33 -40
  4. package/app-nav-bar/app-nav-bar.js.flow +46 -62
  5. package/app-nav-bar/index.d.ts +9 -8
  6. package/app-nav-bar/styled-components.js +49 -29
  7. package/app-nav-bar/styled-components.js.flow +25 -8
  8. package/app-nav-bar/types.js.flow +2 -0
  9. package/aspect-ratio-box/index.d.ts +2 -4
  10. package/avatar/index.d.ts +6 -12
  11. package/badge/badge.js +109 -0
  12. package/badge/badge.js.flow +91 -0
  13. package/badge/constants.js +54 -0
  14. package/badge/constants.js.flow +52 -0
  15. package/badge/hint-dot.js +96 -0
  16. package/badge/hint-dot.js.flow +68 -0
  17. package/badge/index.d.ts +97 -0
  18. package/badge/index.js +80 -0
  19. package/badge/index.js.flow +20 -0
  20. package/badge/notification-circle.js +103 -0
  21. package/badge/notification-circle.js.flow +81 -0
  22. package/badge/package.json +4 -0
  23. package/badge/styled-components.js +242 -0
  24. package/badge/styled-components.js.flow +325 -0
  25. package/badge/types.js +11 -0
  26. package/badge/types.js.flow +59 -0
  27. package/badge/utils.js +33 -0
  28. package/badge/utils.js.flow +23 -0
  29. package/banner/banner.js +283 -0
  30. package/banner/banner.js.flow +253 -0
  31. package/banner/constants.js +35 -0
  32. package/banner/constants.js.flow +33 -0
  33. package/banner/index.d.ts +75 -0
  34. package/banner/index.js +44 -0
  35. package/banner/index.js.flow +16 -0
  36. package/banner/package.json +4 -0
  37. package/banner/styled-components.js +131 -0
  38. package/banner/styled-components.js.flow +119 -0
  39. package/banner/types.js +11 -0
  40. package/banner/types.js.flow +66 -0
  41. package/block/index.d.ts +4 -4
  42. package/breadcrumbs/breadcrumbs.js +5 -1
  43. package/breadcrumbs/breadcrumbs.js.flow +2 -2
  44. package/breadcrumbs/index.d.ts +5 -5
  45. package/button/button.js +2 -1
  46. package/button/button.js.flow +1 -0
  47. package/button/index.d.ts +19 -29
  48. package/button-group/index.d.ts +18 -24
  49. package/card/index.d.ts +16 -14
  50. package/checkbox/index.d.ts +17 -21
  51. package/combobox/index.d.ts +7 -11
  52. package/data-table/index.d.ts +7 -10
  53. package/datepicker/index.d.ts +42 -63
  54. package/datepicker/types.js.flow +2 -2
  55. package/datepicker/utils/date-helpers.js +1 -1
  56. package/datepicker/utils/date-helpers.js.flow +1 -1
  57. package/dnd-list/index.d.ts +22 -35
  58. package/drawer/index.d.ts +22 -27
  59. package/es/app-nav-bar/app-nav-bar.js +9 -19
  60. package/es/app-nav-bar/styled-components.js +32 -13
  61. package/es/badge/badge.js +70 -0
  62. package/es/badge/constants.js +42 -0
  63. package/es/badge/hint-dot.js +55 -0
  64. package/es/badge/index.js +11 -0
  65. package/es/badge/notification-circle.js +65 -0
  66. package/es/badge/styled-components.js +296 -0
  67. package/es/badge/types.js +8 -0
  68. package/es/badge/utils.js +17 -0
  69. package/es/banner/banner.js +213 -0
  70. package/es/banner/constants.js +24 -0
  71. package/es/banner/index.js +9 -0
  72. package/es/banner/styled-components.js +122 -0
  73. package/es/banner/types.js +8 -0
  74. package/es/breadcrumbs/breadcrumbs.js +5 -1
  75. package/es/button/button.js +1 -0
  76. package/es/datepicker/utils/date-helpers.js +1 -1
  77. package/es/helper/helper-steps.js +3 -1
  78. package/es/input/base-input.js +18 -11
  79. package/es/input/input.js +15 -10
  80. package/es/input/masked-input.js +5 -2
  81. package/es/input/utils.js +4 -2
  82. package/es/locale/tr_TR.js +115 -0
  83. package/es/notification/notification.js +16 -1
  84. package/es/payment-card/custom-cards.config.js +22 -0
  85. package/es/payment-card/icons/uatp.js +52 -0
  86. package/es/payment-card/payment-card.js +8 -3
  87. package/es/popover/popover.js +2 -1
  88. package/es/popover/stateful-container.js +2 -0
  89. package/es/popover/styled-components.js +2 -1
  90. package/es/progress-steps/numbered-step.js +2 -2
  91. package/es/select/select-component.js +44 -21
  92. package/es/select/utils/default-filter-options.js +1 -1
  93. package/es/table-semantic/styled-components.js +14 -0
  94. package/es/table-semantic/table-builder.js +12 -5
  95. package/es/textarea/textarea.js +15 -9
  96. package/es/themes/dark-theme/color-component-tokens.js +8 -0
  97. package/es/themes/light-theme/color-component-tokens.js +8 -0
  98. package/es/tree-view/tree-label.js +9 -1
  99. package/esm/app-nav-bar/app-nav-bar.js +32 -38
  100. package/esm/app-nav-bar/styled-components.js +46 -28
  101. package/esm/badge/badge.js +97 -0
  102. package/esm/badge/constants.js +42 -0
  103. package/esm/badge/hint-dot.js +83 -0
  104. package/esm/badge/index.js +11 -0
  105. package/esm/badge/notification-circle.js +91 -0
  106. package/esm/badge/styled-components.js +235 -0
  107. package/esm/badge/types.js +8 -0
  108. package/esm/badge/utils.js +17 -0
  109. package/esm/banner/banner.js +271 -0
  110. package/esm/banner/constants.js +24 -0
  111. package/esm/banner/index.js +9 -0
  112. package/esm/banner/styled-components.js +113 -0
  113. package/esm/banner/types.js +8 -0
  114. package/esm/breadcrumbs/breadcrumbs.js +5 -1
  115. package/esm/button/button.js +2 -1
  116. package/esm/datepicker/utils/date-helpers.js +1 -1
  117. package/esm/helper/helper-steps.js +3 -1
  118. package/esm/input/base-input.js +18 -11
  119. package/esm/input/input.js +15 -10
  120. package/esm/input/masked-input.js +6 -3
  121. package/esm/input/utils.js +4 -2
  122. package/esm/locale/tr_TR.js +115 -0
  123. package/esm/notification/notification.js +17 -1
  124. package/esm/payment-card/custom-cards.config.js +22 -0
  125. package/esm/payment-card/icons/uatp.js +53 -0
  126. package/esm/payment-card/payment-card.js +9 -7
  127. package/esm/popover/popover.js +2 -1
  128. package/esm/popover/stateful-container.js +2 -0
  129. package/esm/popover/styled-components.js +3 -2
  130. package/esm/progress-steps/numbered-step.js +2 -2
  131. package/esm/select/select-component.js +81 -57
  132. package/esm/select/utils/default-filter-options.js +1 -1
  133. package/esm/table-semantic/styled-components.js +31 -18
  134. package/esm/table-semantic/table-builder.js +34 -23
  135. package/esm/textarea/textarea.js +15 -9
  136. package/esm/themes/dark-theme/color-component-tokens.js +8 -0
  137. package/esm/themes/light-theme/color-component-tokens.js +8 -0
  138. package/esm/tree-view/tree-label.js +10 -2
  139. package/file-uploader/index.d.ts +11 -11
  140. package/flex-grid/index.d.ts +3 -3
  141. package/form-control/index.d.ts +7 -19
  142. package/header-navigation/index.d.ts +8 -9
  143. package/heading/index.d.ts +3 -4
  144. package/helper/helper-steps.js +19 -13
  145. package/helper/helper-steps.js.flow +3 -1
  146. package/helper/index.d.ts +7 -7
  147. package/helpers/base-provider.d.ts +16 -0
  148. package/helpers/overrides.d.ts +23 -0
  149. package/icon/index.d.ts +32 -32
  150. package/index.d.ts +34 -114
  151. package/input/base-input.js +18 -11
  152. package/input/base-input.js.flow +18 -6
  153. package/input/index.d.ts +29 -32
  154. package/input/input.js +15 -10
  155. package/input/input.js.flow +10 -5
  156. package/input/masked-input.js +6 -3
  157. package/input/masked-input.js.flow +3 -0
  158. package/input/types.js.flow +4 -0
  159. package/input/utils.js +4 -2
  160. package/input/utils.js.flow +2 -1
  161. package/layer/index.d.ts +6 -11
  162. package/layout-grid/index.d.ts +25 -7
  163. package/link/index.d.ts +2 -2
  164. package/list/index.d.ts +26 -31
  165. package/{locale.ts → locale/index.d.ts} +8 -0
  166. package/locale/tr_TR.js +123 -0
  167. package/locale/tr_TR.js.flow +124 -0
  168. package/map-marker/index.d.ts +41 -47
  169. package/menu/index.d.ts +27 -37
  170. package/modal/index.d.ts +28 -38
  171. package/notification/index.d.ts +2 -3
  172. package/notification/notification.js +18 -1
  173. package/notification/notification.js.flow +15 -1
  174. package/overrides.ts +2 -22
  175. package/package.json +26 -17
  176. package/pagination/index.d.ts +22 -26
  177. package/payment-card/custom-cards.config.js +30 -0
  178. package/payment-card/custom-cards.config.js.flow +29 -0
  179. package/payment-card/icons/uatp.js +67 -0
  180. package/payment-card/icons/uatp.js.flow +62 -0
  181. package/payment-card/index.d.ts +8 -8
  182. package/payment-card/payment-card.js +12 -7
  183. package/payment-card/payment-card.js.flow +12 -0
  184. package/phone-input/index.d.ts +261 -269
  185. package/pin-code/index.d.ts +11 -18
  186. package/popover/index.d.ts +39 -55
  187. package/popover/popover.js +2 -1
  188. package/popover/popover.js.flow +2 -1
  189. package/popover/stateful-container.js +2 -0
  190. package/popover/stateful-container.js.flow +2 -0
  191. package/popover/styled-components.js +3 -2
  192. package/popover/styled-components.js.flow +2 -1
  193. package/popover/types.js.flow +1 -0
  194. package/progress-bar/index.d.ts +11 -12
  195. package/progress-steps/index.d.ts +16 -16
  196. package/progress-steps/numbered-step.js.flow +2 -2
  197. package/radio/index.d.ts +12 -15
  198. package/rating/index.d.ts +9 -12
  199. package/select/index.d.ts +34 -36
  200. package/select/select-component.js +78 -54
  201. package/select/select-component.js.flow +42 -32
  202. package/select/types.js.flow +1 -0
  203. package/select/utils/default-filter-options.js +1 -1
  204. package/select/utils/default-filter-options.js.flow +1 -1
  205. package/side-navigation/index.d.ts +11 -13
  206. package/skeleton/index.d.ts +1 -1
  207. package/slider/index.d.ts +17 -26
  208. package/snackbar/index.d.ts +8 -8
  209. package/spinner/index.d.ts +4 -3
  210. package/styles/index.d.ts +82 -2
  211. package/table/index.d.ts +16 -16
  212. package/table-grid/index.d.ts +6 -8
  213. package/table-semantic/index.d.ts +26 -32
  214. package/table-semantic/styled-components.js +33 -19
  215. package/table-semantic/styled-components.js.flow +12 -0
  216. package/table-semantic/table-builder.js +38 -22
  217. package/table-semantic/table-builder.js.flow +32 -17
  218. package/table-semantic/types.js.flow +1 -0
  219. package/tabs/index.d.ts +20 -23
  220. package/tabs-motion/index.d.ts +23 -23
  221. package/tag/index.d.ts +14 -18
  222. package/textarea/index.d.ts +11 -14
  223. package/textarea/textarea.js +15 -9
  224. package/textarea/textarea.js.flow +11 -5
  225. package/textarea/types.js.flow +1 -0
  226. package/theme.ts +36 -777
  227. package/themes/dark-theme/color-component-tokens.js +8 -0
  228. package/themes/dark-theme/color-component-tokens.js.flow +9 -0
  229. package/themes/index.d.ts +765 -0
  230. package/themes/light-theme/color-component-tokens.js +8 -0
  231. package/themes/light-theme/color-component-tokens.js.flow +9 -0
  232. package/themes/types.js.flow +9 -0
  233. package/timepicker/index.d.ts +5 -8
  234. package/timezonepicker/index.d.ts +5 -8
  235. package/toast/index.d.ts +26 -40
  236. package/tokens/index.d.ts +1 -1
  237. package/tooltip/index.d.ts +7 -9
  238. package/tree-view/index.d.ts +15 -19
  239. package/tree-view/tree-label.js +10 -2
  240. package/tree-view/tree-label.js.flow +4 -4
  241. package/typography/index.d.ts +37 -37
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 interface STATE_CHANGE_TYPE {
5
+ export declare const STATE_CHANGE_TYPE: {
6
6
  change: 'change';
7
- }
8
- export interface ADJOINED {
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 interface SIZE {
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 interface CUSTOM_INPUT_TYPE {
21
+ export declare const CUSTOM_INPUT_TYPE: {
22
22
  textarea: 'textarea';
23
- }
23
+ };
24
24
 
25
- export interface ENHANCER_POSITION {
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.setState({
90
- isFocused: true
91
- });
89
+ if (!_this.props.readOnly) {
90
+ _this.setState({
91
+ isFocused: true
92
+ });
92
93
 
93
- _this.props.onFocus(e);
94
+ _this.props.onFocus(e);
95
+ }
94
96
  });
95
97
 
96
98
  _defineProperty(_assertThisInitialized(_this), "onBlur", function (e) {
97
- _this.setState({
98
- isFocused: false
99
- });
99
+ if (!_this.props.readOnly) {
100
+ _this.setState({
101
+ isFocused: false
102
+ });
100
103
 
101
- _this.props.onBlur(e);
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) {
@@ -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.setState({ isFocused: true });
43
- this.props.onFocus(e);
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.setState({ isFocused: false });
48
- this.props.onBlur(e);
50
+ if (!this.props.readOnly) {
51
+ this.setState({ isFocused: false });
52
+ this.props.onBlur(e);
53
+ }
49
54
  };
50
55
 
51
56
  render() {
@@ -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
- restProps = _objectWithoutProperties(_ref, ["startEnhancer", "endEnhancer", "error", "positive", "onChange", "onFocus", "onBlur", "value", "disabled"]);
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
  )}
@@ -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
  }
@@ -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 interface TETHER_PLACEMENT {
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
- offsets: NormalizedOffsets,
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>;
@@ -1,7 +1,25 @@
1
1
  import * as React from 'react';
2
- import {StyletronComponent} from 'styletron-react';
3
- import {CSSLengthUnitT} from '../theme';
4
- import {Override} from '../overrides';
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 'baseui/header-navigation';
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 interface ARTWORK_SIZES {
6
+ export declare const ARTWORK_SIZES: {
7
7
  SMALL: 'SMALL';
8
8
  MEDIUM: 'MEDIUM';
9
9
  LARGE: 'LARGE';
10
- }
11
- export const ARTWORK_SIZES: ARTWORK_SIZES;
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 interface SHAPE {
13
+ export declare const SHAPE: {
18
14
  DEFAULT: 'DEFAULT';
19
15
  ROUND: 'ROUND';
20
- }
21
- export const SHAPE: SHAPE;
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>;
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ /*
9
+ Copyright (c) Uber Technologies, Inc.
10
+
11
+ This source code is licensed under the MIT license found in the
12
+ LICENSE file in the root directory of this source tree.
13
+ */
14
+ var _default = {
15
+ accordion: {
16
+ collapse: 'Daralt',
17
+ expand: 'Genişlet'
18
+ },
19
+ breadcrumbs: {
20
+ ariaLabel: 'Navigasyon'
21
+ },
22
+ datepicker: {
23
+ ariaLabel: 'Bir tarih seçin.',
24
+ ariaLabelRange: 'Bir tarih aralığı seçin',
25
+ ariaLabelCalendar: 'Takvim',
26
+ ariaRoleDescriptionCalendarMonth: 'Aylık Takvim',
27
+ previousMonth: 'Geçtiğimiz ay.',
28
+ nextMonth: 'Gelecek ay.',
29
+ pastWeek: 'Geçen Hafta',
30
+ pastMonth: 'Geçen Ay',
31
+ pastThreeMonths: 'Son 3 Ay',
32
+ pastSixMonths: 'Son 6 Ay',
33
+ pastYear: 'Geçen Yıl',
34
+ pastTwoYears: 'Son 2 Yıl',
35
+ screenReaderMessageInput: 'Takvimle etkileşim kurmak ve bir tarih seçmek için aşağı ok tuşuna basın. Takvimi kapatmak için kaçış (ESC) düğmesine basın.',
36
+ selectedDate: 'Seçilen tarih ${date}.',
37
+ selectedDateRange: 'Seçilen tarih aralığı ${startDate} ile ${endDate} arasındadır.',
38
+ selectSecondDatePrompt: 'İkinci tarihi seçin.',
39
+ quickSelectLabel: 'Bir tarih aralığı seçin',
40
+ quickSelectAriaLabel: 'Bir tarih aralığı seçin',
41
+ quickSelectPlaceholder: 'Hiçbiri',
42
+ timeSelectEndLabel: 'Bitiş zamanı',
43
+ timeSelectStartLabel: 'Başlangıç zamanı',
44
+ timePickerAriaLabel12Hour: 'Bir zaman seçin, 12-saat formatında.',
45
+ timePickerAriaLabel24Hour: 'Bir zaman seçin, 24-saat formatında.',
46
+ timezonePickerAriaLabel: 'Bir saat dilimi seçin.',
47
+ selectedStartDateLabel: 'Seçilen başlangıç tarihi.',
48
+ selectedEndDateLabel: 'Seçilen bitiş tarihi.',
49
+ dateNotAvailableLabel: 'Kullanılabilir değil.',
50
+ dateAvailableLabel: 'Kullanılabilir.',
51
+ selectedLabel: 'Seçildi.',
52
+ chooseLabel: 'Seç'
53
+ },
54
+ datatable: {
55
+ emptyState: 'Tanımlanan filtre kriterleriyle eşleşen satır yok. Daha fazla veri görüntülemek için lütfen bir veya daha fazla filtreyi kaldırın.',
56
+ loadingState: 'Satır yükleniyor.',
57
+ searchAriaLabel: 'Metne göre ara',
58
+ filterAdd: 'Filtre Ekle',
59
+ filterExclude: 'Dahil etme',
60
+ filterApply: 'Uygula',
61
+ filterExcludeRange: 'Exclude range',
62
+ filterExcludeValue: 'Exclude value',
63
+ filterAppliedTo: 'uygulanan filtre',
64
+ optionsLabel: 'Filtrelenecek sütunu seçin',
65
+ optionsSearch: 'Filtrelemek için bir sütun arayın...',
66
+ optionsEmpty: 'Sütun yok.',
67
+ categoricalFilterSelectAll: 'Tümünü Seç',
68
+ categoricalFilterSelectClear: 'Temizle',
69
+ categoricalFilterEmpty: 'Kategori bulunamadı',
70
+ datetimeFilterRange: 'Aralık',
71
+ datetimeFilterRangeDatetime: 'Tarih, Zaman',
72
+ datetimeFilterRangeDate: 'Tarih',
73
+ datetimeFilterRangeTime: 'Zaman',
74
+ datetimeFilterCategorical: 'Kategorik',
75
+ datetimeFilterCategoricalWeekday: 'Hafta içi',
76
+ datetimeFilterCategoricalMonth: 'Ay',
77
+ datetimeFilterCategoricalQuarter: 'Çeyrek',
78
+ datetimeFilterCategoricalHalf: 'Yarım',
79
+ datetimeFilterCategoricalFirstHalf: 'H1',
80
+ datetimeFilterCategoricalSecondHalf: 'H2',
81
+ datetimeFilterCategoricalYear: 'Yıl',
82
+ numericalFilterRange: 'Aralık',
83
+ numericalFilterSingleValue: 'Single Value',
84
+ booleanFilterTrue: 'doğru',
85
+ booleanFilterFalse: 'yanlış',
86
+ booleanColumnTrueShort: 'D',
87
+ booleanColumnFalseShort: 'Y'
88
+ },
89
+ buttongroup: {
90
+ ariaLabel: 'buton grup'
91
+ },
92
+ fileuploader: {
93
+ dropFilesToUpload: 'Dosyaları yüklemek için buraya bırakın...',
94
+ or: '',
95
+ browseFiles: 'Dosyalara göz atın',
96
+ retry: 'Yüklemeyi Yeniden Dene',
97
+ cancel: 'İptal'
98
+ },
99
+ menu: {
100
+ noResultsMsg: 'Sonuç yok',
101
+ parentMenuItemAriaLabel: 'Şu anda iç içe bir liste kutusu açan bir öğedesiniz. Bu öğeye girmek için sağ ok ve geri dönmek için sol ok tuşuna basın.'
102
+ },
103
+ modal: {
104
+ close: 'Kapat'
105
+ },
106
+ drawer: {
107
+ close: 'Kapat'
108
+ },
109
+ pagination: {
110
+ prev: 'Önceki',
111
+ next: 'Sonraki',
112
+ preposition: 'nın'
113
+ },
114
+ select: {
115
+ noResultsMsg: 'Sonuç bulunamadı',
116
+ placeholder: 'Seç...',
117
+ create: 'Oluştur'
118
+ },
119
+ toast: {
120
+ close: 'Kapat'
121
+ }
122
+ };
123
+ exports.default = _default;