baseui 11.0.3 → 11.1.2

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 (240) 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 +83 -29
  7. package/app-nav-bar/styled-components.js.flow +59 -9
  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/utils/date-helpers.js +1 -1
  55. package/datepicker/utils/date-helpers.js.flow +1 -1
  56. package/dnd-list/index.d.ts +22 -35
  57. package/drawer/index.d.ts +22 -27
  58. package/es/app-nav-bar/app-nav-bar.js +9 -19
  59. package/es/app-nav-bar/styled-components.js +64 -13
  60. package/es/badge/badge.js +70 -0
  61. package/es/badge/constants.js +42 -0
  62. package/es/badge/hint-dot.js +55 -0
  63. package/es/badge/index.js +11 -0
  64. package/es/badge/notification-circle.js +65 -0
  65. package/es/badge/styled-components.js +296 -0
  66. package/es/badge/types.js +8 -0
  67. package/es/badge/utils.js +17 -0
  68. package/es/banner/banner.js +213 -0
  69. package/es/banner/constants.js +24 -0
  70. package/es/banner/index.js +9 -0
  71. package/es/banner/styled-components.js +122 -0
  72. package/es/banner/types.js +8 -0
  73. package/es/breadcrumbs/breadcrumbs.js +5 -1
  74. package/es/button/button.js +1 -0
  75. package/es/datepicker/utils/date-helpers.js +1 -1
  76. package/es/file-uploader/file-uploader.js +8 -5
  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 +38 -21
  92. package/es/table-semantic/styled-components.js +14 -0
  93. package/es/table-semantic/table-builder.js +12 -5
  94. package/es/textarea/textarea.js +15 -9
  95. package/es/themes/dark-theme/color-component-tokens.js +8 -0
  96. package/es/themes/light-theme/color-component-tokens.js +8 -0
  97. package/es/tree-view/tree-label.js +9 -1
  98. package/esm/app-nav-bar/app-nav-bar.js +32 -38
  99. package/esm/app-nav-bar/styled-components.js +79 -28
  100. package/esm/badge/badge.js +97 -0
  101. package/esm/badge/constants.js +42 -0
  102. package/esm/badge/hint-dot.js +83 -0
  103. package/esm/badge/index.js +11 -0
  104. package/esm/badge/notification-circle.js +91 -0
  105. package/esm/badge/styled-components.js +235 -0
  106. package/esm/badge/types.js +8 -0
  107. package/esm/badge/utils.js +17 -0
  108. package/esm/banner/banner.js +271 -0
  109. package/esm/banner/constants.js +24 -0
  110. package/esm/banner/index.js +9 -0
  111. package/esm/banner/styled-components.js +113 -0
  112. package/esm/banner/types.js +8 -0
  113. package/esm/breadcrumbs/breadcrumbs.js +5 -1
  114. package/esm/button/button.js +2 -1
  115. package/esm/datepicker/utils/date-helpers.js +1 -1
  116. package/esm/file-uploader/file-uploader.js +23 -8
  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 +75 -57
  132. package/esm/table-semantic/styled-components.js +31 -18
  133. package/esm/table-semantic/table-builder.js +34 -23
  134. package/esm/textarea/textarea.js +15 -9
  135. package/esm/themes/dark-theme/color-component-tokens.js +8 -0
  136. package/esm/themes/light-theme/color-component-tokens.js +8 -0
  137. package/esm/tree-view/tree-label.js +10 -2
  138. package/file-uploader/file-uploader.js +23 -8
  139. package/file-uploader/file-uploader.js.flow +18 -5
  140. package/file-uploader/index.d.ts +11 -11
  141. package/file-uploader/types.js.flow +3 -0
  142. package/flex-grid/index.d.ts +3 -3
  143. package/form-control/index.d.ts +7 -19
  144. package/header-navigation/index.d.ts +8 -9
  145. package/heading/index.d.ts +3 -4
  146. package/helper/helper-steps.js +19 -13
  147. package/helper/helper-steps.js.flow +3 -1
  148. package/helper/index.d.ts +7 -7
  149. package/helpers/base-provider.d.ts +16 -0
  150. package/helpers/overrides.d.ts +23 -0
  151. package/icon/index.d.ts +32 -32
  152. package/index.d.ts +34 -99
  153. package/input/base-input.js +18 -11
  154. package/input/base-input.js.flow +18 -6
  155. package/input/index.d.ts +29 -32
  156. package/input/input.js +15 -10
  157. package/input/input.js.flow +10 -5
  158. package/input/masked-input.js +6 -3
  159. package/input/masked-input.js.flow +3 -0
  160. package/input/types.js.flow +4 -0
  161. package/input/utils.js +4 -2
  162. package/input/utils.js.flow +2 -1
  163. package/layer/index.d.ts +6 -11
  164. package/layout-grid/index.d.ts +25 -7
  165. package/link/index.d.ts +2 -2
  166. package/list/index.d.ts +26 -31
  167. package/{locale.ts → locale/index.d.ts} +8 -0
  168. package/locale/tr_TR.js +123 -0
  169. package/locale/tr_TR.js.flow +124 -0
  170. package/map-marker/index.d.ts +41 -47
  171. package/menu/index.d.ts +27 -37
  172. package/modal/index.d.ts +28 -38
  173. package/notification/index.d.ts +2 -3
  174. package/notification/notification.js +18 -1
  175. package/notification/notification.js.flow +15 -1
  176. package/overrides.ts +2 -22
  177. package/package.json +26 -17
  178. package/pagination/index.d.ts +22 -26
  179. package/payment-card/custom-cards.config.js +30 -0
  180. package/payment-card/custom-cards.config.js.flow +29 -0
  181. package/payment-card/icons/uatp.js +67 -0
  182. package/payment-card/icons/uatp.js.flow +62 -0
  183. package/payment-card/index.d.ts +8 -8
  184. package/payment-card/payment-card.js +12 -7
  185. package/payment-card/payment-card.js.flow +12 -0
  186. package/phone-input/index.d.ts +261 -269
  187. package/pin-code/index.d.ts +11 -18
  188. package/popover/index.d.ts +39 -55
  189. package/popover/popover.js +2 -1
  190. package/popover/popover.js.flow +2 -1
  191. package/popover/stateful-container.js +2 -0
  192. package/popover/stateful-container.js.flow +2 -0
  193. package/popover/styled-components.js +3 -2
  194. package/popover/styled-components.js.flow +2 -1
  195. package/popover/types.js.flow +1 -0
  196. package/progress-bar/index.d.ts +11 -12
  197. package/progress-steps/index.d.ts +16 -16
  198. package/progress-steps/numbered-step.js.flow +2 -2
  199. package/radio/index.d.ts +12 -15
  200. package/rating/index.d.ts +9 -12
  201. package/select/index.d.ts +33 -36
  202. package/select/select-component.js +72 -54
  203. package/select/select-component.js.flow +35 -30
  204. package/side-navigation/index.d.ts +11 -13
  205. package/skeleton/index.d.ts +1 -1
  206. package/slider/index.d.ts +17 -26
  207. package/snackbar/index.d.ts +8 -8
  208. package/spinner/index.d.ts +2 -2
  209. package/styles/index.d.ts +82 -2
  210. package/table/index.d.ts +16 -16
  211. package/table-grid/index.d.ts +6 -8
  212. package/table-semantic/index.d.ts +26 -32
  213. package/table-semantic/styled-components.js +33 -19
  214. package/table-semantic/styled-components.js.flow +12 -0
  215. package/table-semantic/table-builder.js +38 -22
  216. package/table-semantic/table-builder.js.flow +32 -17
  217. package/table-semantic/types.js.flow +1 -0
  218. package/tabs/index.d.ts +20 -23
  219. package/tabs-motion/index.d.ts +23 -23
  220. package/tag/index.d.ts +14 -18
  221. package/textarea/index.d.ts +11 -14
  222. package/textarea/textarea.js +15 -9
  223. package/textarea/textarea.js.flow +11 -5
  224. package/textarea/types.js.flow +1 -0
  225. package/theme.ts +36 -777
  226. package/themes/dark-theme/color-component-tokens.js +8 -0
  227. package/themes/dark-theme/color-component-tokens.js.flow +9 -0
  228. package/themes/index.d.ts +765 -0
  229. package/themes/light-theme/color-component-tokens.js +8 -0
  230. package/themes/light-theme/color-component-tokens.js.flow +9 -0
  231. package/themes/types.js.flow +9 -0
  232. package/timepicker/index.d.ts +5 -8
  233. package/timezonepicker/index.d.ts +5 -8
  234. package/toast/index.d.ts +26 -40
  235. package/tokens/index.d.ts +1 -1
  236. package/tooltip/index.d.ts +7 -9
  237. package/tree-view/index.d.ts +15 -19
  238. package/tree-view/tree-label.js +10 -2
  239. package/tree-view/tree-label.js.flow +4 -4
  240. package/typography/index.d.ts +37 -37
package/tabs/index.d.ts CHANGED
@@ -1,23 +1,23 @@
1
1
  import * as React from 'react';
2
- import {StyletronComponent} from 'styletron-react';
3
- import {Override} from '../overrides';
2
+ import { StyletronComponent } from 'styletron-react';
3
+ import { Override } from '../overrides';
4
4
 
5
- export interface ORIENTATION {
5
+ export declare const ORIENTATION: {
6
6
  horizontal: 'horizontal';
7
7
  vertical: 'vertical';
8
- }
9
- export interface STATE_CHANGE_TYPE {
8
+ };
9
+ export declare const STATE_CHANGE_TYPE: {
10
10
  change: 'change';
11
- }
11
+ };
12
12
 
13
13
  export interface State {
14
14
  activeKey: React.Key;
15
15
  }
16
16
 
17
17
  export type StateReducer = (
18
- stateChangeType: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE],
18
+ stateChangeType: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE],
19
19
  nextState: State,
20
- currentState: State,
20
+ currentState: State
21
21
  ) => State;
22
22
 
23
23
  export interface TabsOverrides<T> {
@@ -32,12 +32,12 @@ export interface TabsProps {
32
32
  activeKey?: React.Key;
33
33
  disabled?: boolean;
34
34
  renderAll?: boolean;
35
- onChange?: (args: {activeKey: React.Key}) => any;
36
- orientation?: ORIENTATION[keyof ORIENTATION];
37
- overrides?: TabsOverrides<SharedProps & {$active?: boolean}>;
35
+ onChange?: (args: { activeKey: React.Key }) => any;
36
+ orientation?: typeof ORIENTATION[keyof typeof ORIENTATION];
37
+ overrides?: TabsOverrides<SharedProps & { $active?: boolean }>;
38
38
  }
39
39
 
40
- export const Tabs: React.FC<TabsProps>;
40
+ export declare const Tabs: React.FC<TabsProps>;
41
41
 
42
42
  export type StatefulTabsProps = TabsProps & {
43
43
  activeKey?: never;
@@ -49,8 +49,8 @@ export type StatefulTabsProps = TabsProps & {
49
49
  export class StatefulTabs extends React.Component<StatefulTabsProps, State> {
50
50
  onTabChange(newState: State): void;
51
51
  internalSetState(
52
- type: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE],
53
- changes: State,
52
+ type: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE],
53
+ changes: State
54
54
  ): void;
55
55
  getInitialKey(): any;
56
56
  }
@@ -62,7 +62,7 @@ export interface TabOverrides<T> {
62
62
  export interface SharedProps {
63
63
  $disabled?: boolean;
64
64
  $active?: boolean;
65
- $orientation?: ORIENTATION[keyof ORIENTATION];
65
+ $orientation?: typeof ORIENTATION[keyof typeof ORIENTATION];
66
66
  }
67
67
 
68
68
  export interface TabProps {
@@ -76,7 +76,7 @@ export interface TabProps {
76
76
  overrides?: TabOverrides<SharedProps>;
77
77
  title?: React.ReactNode;
78
78
  id?: string;
79
- $orientation?: ORIENTATION[keyof ORIENTATION];
79
+ $orientation?: typeof ORIENTATION[keyof typeof ORIENTATION];
80
80
  }
81
81
 
82
82
  export class Tab extends React.Component<TabProps> {
@@ -85,10 +85,7 @@ export class Tab extends React.Component<TabProps> {
85
85
  getSharedProps(): SharedProps;
86
86
  }
87
87
 
88
- export const StyledRoot: StyletronComponent<any>;
89
- export const StyledTab: StyletronComponent<any>;
90
- export const StyledTabBar: StyletronComponent<any>;
91
- export const StyledTabContent: StyletronComponent<any>;
92
-
93
- export const ORIENTATION: ORIENTATION;
94
- export const STATE_CHANGE_TYPE: STATE_CHANGE_TYPE;
88
+ export declare const StyledRoot: StyletronComponent<any>;
89
+ export declare const StyledTab: StyletronComponent<any>;
90
+ export declare const StyledTabBar: StyletronComponent<any>;
91
+ export declare const StyledTabContent: StyletronComponent<any>;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import {StyletronComponent} from 'styletron-react';
3
- import {Override} from '../overrides';
2
+ import { StyletronComponent } from 'styletron-react';
3
+ import { Override } from '../overrides';
4
4
 
5
5
  // constants
6
6
 
@@ -20,23 +20,23 @@ export enum STATE_CHANGE_TYPE {
20
20
 
21
21
  // utils
22
22
 
23
- export const getTabId: (uid: string, key: React.Key) => string;
24
- export const getTabPanelId: (uid: string, key: React.Key) => string;
25
- export const isHorizontal: (orientation: ORIENTATION) => boolean;
26
- export const isVertical: (orientation: ORIENTATION) => boolean;
27
- export const isIntrinsic: (fill: FILL) => boolean;
28
- export const isFixed: (fill: FILL) => boolean;
29
- export const isRTL: (direction: string) => boolean;
23
+ export declare const getTabId: (uid: string, key: React.Key) => string;
24
+ export declare const getTabPanelId: (uid: string, key: React.Key) => string;
25
+ export declare const isHorizontal: (orientation: ORIENTATION) => boolean;
26
+ export declare const isVertical: (orientation: ORIENTATION) => boolean;
27
+ export declare const isIntrinsic: (fill: FILL) => boolean;
28
+ export declare const isFixed: (fill: FILL) => boolean;
29
+ export declare const isRTL: (direction: string) => boolean;
30
30
 
31
31
  // styled-components
32
32
 
33
- export const StyledRoot: StyletronComponent<any>;
34
- export const StyledTabList: StyletronComponent<any>;
35
- export const StyledTab: StyletronComponent<any>;
36
- export const StyledArtworkContainer: StyletronComponent<any>;
37
- export const StyledTabBorder: StyletronComponent<any>;
38
- export const StyledTabHighlight: StyletronComponent<any>;
39
- export const StyledTabPanel: StyletronComponent<any>;
33
+ export declare const StyledRoot: StyletronComponent<any>;
34
+ export declare const StyledTabList: StyletronComponent<any>;
35
+ export declare const StyledTab: StyletronComponent<any>;
36
+ export declare const StyledArtworkContainer: StyletronComponent<any>;
37
+ export declare const StyledTabBorder: StyletronComponent<any>;
38
+ export declare const StyledTabHighlight: StyletronComponent<any>;
39
+ export declare const StyledTabPanel: StyletronComponent<any>;
40
40
 
41
41
  // tabs
42
42
 
@@ -63,16 +63,16 @@ interface TabsProps {
63
63
  children: React.ReactNode;
64
64
  activeKey?: React.Key;
65
65
  disabled?: boolean;
66
- fill?: FILL[keyof FILL];
67
- orientation?: ORIENTATION[keyof ORIENTATION];
66
+ fill?: typeof FILL[keyof typeof FILL];
67
+ orientation?: typeof ORIENTATION[keyof typeof ORIENTATION];
68
68
  activateOnFocus?: boolean;
69
69
  renderAll?: boolean;
70
- onChange?: (params: {activeKey: React.Key}) => void;
70
+ onChange?: (params: { activeKey: React.Key }) => void;
71
71
  overrides?: TabsOverrides;
72
72
  uid?: string;
73
73
  }
74
74
 
75
- export const Tabs: React.FC<TabsProps>;
75
+ export declare const Tabs: React.FC<TabsProps>;
76
76
 
77
77
  // tab
78
78
 
@@ -101,7 +101,7 @@ interface TabProps {
101
101
  tabRef?: React.MutableRefObject<HTMLButtonElement | undefined>;
102
102
  }
103
103
 
104
- export const Tab: React.FC<TabProps>;
104
+ export declare const Tab: React.FC<TabProps>;
105
105
 
106
106
  // stateful-tabs
107
107
 
@@ -110,7 +110,7 @@ interface State {
110
110
  }
111
111
 
112
112
  interface Action {
113
- type: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE];
113
+ type: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE];
114
114
  payload: React.Key;
115
115
  }
116
116
 
@@ -121,4 +121,4 @@ type StatefulTabsProps = TabsProps & {
121
121
  stateReducer?: StateReducer;
122
122
  };
123
123
 
124
- export const StatefulTabs: React.FC<StatefulTabsProps>;
124
+ export declare const StatefulTabs: React.FC<StatefulTabsProps>;
package/tag/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
- import {StyletronComponent} from 'styletron-react';
3
- import {Override} from '../overrides';
2
+ import { StyletronComponent } from 'styletron-react';
3
+ import { Override } from '../overrides';
4
4
 
5
- export interface KIND {
5
+ export declare const KIND: {
6
6
  custom: 'custom';
7
7
  neutral: 'neutral';
8
8
  primary: 'primary';
@@ -19,19 +19,19 @@ export interface KIND {
19
19
  green: 'green';
20
20
  purple: 'purple';
21
21
  brown: 'brown';
22
- }
22
+ };
23
23
 
24
- export interface VARIANT {
24
+ export declare const VARIANT: {
25
25
  solid: 'solid';
26
26
  light: 'light';
27
27
  outlined: 'outlined';
28
- }
28
+ };
29
29
 
30
- export interface SIZE {
30
+ export declare const SIZE: {
31
31
  small: 'small';
32
32
  medium: 'medium';
33
33
  large: 'large';
34
- }
34
+ };
35
35
 
36
36
  export interface TagOverrides {
37
37
  Root?: Override<any>;
@@ -47,12 +47,12 @@ export interface TagProps {
47
47
  disabled?: boolean;
48
48
  isFocused?: boolean;
49
49
  isHovered?: boolean;
50
- kind?: KIND[keyof KIND];
51
- variant?: VARIANT[keyof VARIANT];
50
+ kind?: typeof KIND[keyof typeof KIND];
51
+ variant?: typeof VARIANT[keyof typeof VARIANT];
52
52
  children?: React.ReactNode;
53
53
  title?: string;
54
54
  color?: string;
55
- size?: SIZE[keyof SIZE];
55
+ size?: typeof SIZE[keyof typeof SIZE];
56
56
  onActionClick?: (e: Event, children?: React.ReactNode) => any;
57
57
  onActionKeyDown?: (e: Event, children?: React.ReactNode) => any;
58
58
  onClick?: (event: Event) => any;
@@ -65,10 +65,6 @@ export class Tag extends React.Component<TagProps> {
65
65
  handleActionKeyDown(event: KeyboardEvent): void;
66
66
  }
67
67
 
68
- export const StyledRoot: StyletronComponent<any>;
69
- export const StyledAction: StyletronComponent<any>;
70
- export const StyledText: StyletronComponent<any>;
71
-
72
- export const KIND: KIND;
73
- export const VARIANT: VARIANT;
74
- export const SIZE: SIZE;
68
+ export declare const StyledRoot: StyletronComponent<any>;
69
+ export declare const StyledAction: StyletronComponent<any>;
70
+ export declare const StyledText: StyletronComponent<any>;
@@ -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
  import {
4
4
  BaseInputProps,
5
5
  StatefulContainer,
@@ -13,30 +13,27 @@ export interface TextareaProps extends BaseInputProps<HTMLTextAreaElement> {
13
13
  maxLength?: number;
14
14
  }
15
15
 
16
- export interface ADJOINED {
16
+ export declare const ADJOINED: {
17
17
  none: 'none';
18
18
  left: 'left';
19
19
  right: 'right';
20
20
  both: 'both';
21
- }
22
- export interface SIZE {
21
+ };
22
+ export declare const SIZE: {
23
23
  default: 'default';
24
24
  compact: 'compact';
25
25
  large: 'large';
26
- }
26
+ };
27
27
 
28
28
  export class Textarea extends React.Component<TextareaProps> {}
29
29
 
30
- export type StatefulTextareaProps = TextareaProps &
31
- StatefulContainerProps & {children?: never};
30
+ export type StatefulTextareaProps = TextareaProps & StatefulContainerProps & { children?: never };
32
31
 
33
- export const StatefulTextarea: React.FC<StatefulTextareaProps>;
32
+ export declare const StatefulTextarea: React.FC<StatefulTextareaProps>;
34
33
 
35
- export {StatefulContainer};
34
+ export { StatefulContainer };
36
35
 
37
- export const StyledTextareaContainer: StyletronComponent<any>;
38
- export const StyledTextarea: StyletronComponent<any>;
36
+ export declare const StyledTextareaContainer: StyletronComponent<any>;
37
+ export declare const StyledTextarea: StyletronComponent<any>;
39
38
 
40
- export const ADJOINED: ADJOINED;
41
- export const SIZE: SIZE;
42
- export {STATE_CHANGE_TYPE};
39
+ export { STATE_CHANGE_TYPE };
@@ -72,23 +72,27 @@ var Textarea = /*#__PURE__*/function (_React$Component) {
72
72
  _this = _super.call.apply(_super, [this].concat(args));
73
73
 
74
74
  _defineProperty(_assertThisInitialized(_this), "state", {
75
- isFocused: _this.props.autoFocus || false
75
+ isFocused: _this.props.autoFocus && !_this.props.readOnly || false
76
76
  });
77
77
 
78
78
  _defineProperty(_assertThisInitialized(_this), "onFocus", function (e) {
79
- _this.setState({
80
- isFocused: true
81
- });
79
+ if (!_this.props.readOnly) {
80
+ _this.setState({
81
+ isFocused: true
82
+ });
82
83
 
83
- _this.props.onFocus(e);
84
+ _this.props.onFocus(e);
85
+ }
84
86
  });
85
87
 
86
88
  _defineProperty(_assertThisInitialized(_this), "onBlur", function (e) {
87
- _this.setState({
88
- isFocused: false
89
- });
89
+ if (!_this.props.readOnly) {
90
+ _this.setState({
91
+ isFocused: false
92
+ });
90
93
 
91
- _this.props.onBlur(e);
94
+ _this.props.onBlur(e);
95
+ }
92
96
  });
93
97
 
94
98
  return _this;
@@ -116,6 +120,7 @@ var Textarea = /*#__PURE__*/function (_React$Component) {
116
120
  return /*#__PURE__*/React.createElement(Root, _extends({
117
121
  "data-baseweb": "textarea",
118
122
  $isFocused: this.state.isFocused,
123
+ $isReadOnly: this.props.readOnly,
119
124
  $disabled: this.props.disabled,
120
125
  $error: this.props.error,
121
126
  $positive: this.props.positive,
@@ -136,6 +141,7 @@ var Textarea = /*#__PURE__*/function (_React$Component) {
136
141
  _defineProperty(Textarea, "defaultProps", {
137
142
  autoFocus: false,
138
143
  disabled: false,
144
+ readOnly: false,
139
145
  error: false,
140
146
  name: '',
141
147
  onBlur: function onBlur() {},
@@ -19,6 +19,7 @@ class Textarea extends React.Component<TextareaPropsT, { isFocused: boolean }> {
19
19
  static defaultProps = {
20
20
  autoFocus: false,
21
21
  disabled: false,
22
+ readOnly: false,
22
23
  error: false,
23
24
  name: '',
24
25
  onBlur: () => {},
@@ -35,17 +36,21 @@ class Textarea extends React.Component<TextareaPropsT, { isFocused: boolean }> {
35
36
  };
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<HTMLTextAreaElement>) => {
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<HTMLTextAreaElement>) => {
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() {
@@ -63,6 +68,7 @@ class Textarea extends React.Component<TextareaPropsT, { isFocused: boolean }> {
63
68
  <Root
64
69
  data-baseweb="textarea"
65
70
  $isFocused={this.state.isFocused}
71
+ $isReadOnly={this.props.readOnly}
66
72
  $disabled={this.props.disabled}
67
73
  $error={this.props.error}
68
74
  $positive={this.props.positive}
@@ -20,6 +20,7 @@ export type SharedStylePropsT = {
20
20
  $disabled: boolean,
21
21
  $error: boolean,
22
22
  $isFocused: boolean,
23
+ $isReadOnly: boolean,
23
24
  $positive?: boolean,
24
25
  $required: boolean,
25
26
  $size: SizeT,