@skbkontur/react-ui 0.0.0-a5ba2462c5 → 0.0.0-a6f09fbded

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 (246) hide show
  1. package/CHANGELOG.md +0 -30
  2. package/cjs/components/Autocomplete/Autocomplete.md +113 -0
  3. package/cjs/components/Button/Button.md +261 -0
  4. package/cjs/components/Calendar/Calendar.md +276 -0
  5. package/cjs/components/Calendar/CalendarDay.md +70 -0
  6. package/cjs/components/Center/Center.md +26 -0
  7. package/cjs/components/Checkbox/Checkbox.md +171 -0
  8. package/cjs/components/ComboBox/ComboBox.d.ts +11 -5
  9. package/cjs/components/ComboBox/ComboBox.js +10 -1
  10. package/cjs/components/ComboBox/ComboBox.js.map +1 -1
  11. package/cjs/components/ComboBox/ComboBox.md +574 -0
  12. package/cjs/components/CurrencyInput/CurrencyInput.md +39 -0
  13. package/cjs/components/CurrencyLabel/CurrencyLabel.js +2 -2
  14. package/cjs/components/CurrencyLabel/CurrencyLabel.js.map +1 -1
  15. package/cjs/components/CurrencyLabel/CurrencyLabel.md +29 -0
  16. package/cjs/components/DateInput/DateInput.md +111 -0
  17. package/cjs/components/DatePicker/DatePicker.md +368 -0
  18. package/cjs/components/Dropdown/Dropdown.md +45 -0
  19. package/cjs/components/DropdownMenu/DropdownMenu.md +290 -0
  20. package/cjs/components/FileUploader/FileUploader.md +131 -0
  21. package/cjs/components/FxInput/FxInput.md +31 -0
  22. package/cjs/components/Gapped/Gapped.md +44 -0
  23. package/cjs/components/GlobalLoader/GlobalLoader.md +97 -0
  24. package/cjs/components/Group/Group.md +19 -0
  25. package/cjs/components/Hint/Hint.md +86 -0
  26. package/cjs/components/Input/Input.md +86 -0
  27. package/cjs/components/Input/InputLayout/InputLayout.d.ts +1 -0
  28. package/cjs/components/Input/InputLayout/InputLayout.js +4 -2
  29. package/cjs/components/Input/InputLayout/InputLayout.js.map +1 -1
  30. package/cjs/components/Kebab/Kebab.md +306 -0
  31. package/cjs/components/Link/Link.md +182 -0
  32. package/cjs/components/Loader/Loader.md +33 -0
  33. package/cjs/components/MaskedInput/MaskedInput.d.ts +0 -8
  34. package/cjs/components/MaskedInput/MaskedInput.js +2 -23
  35. package/cjs/components/MaskedInput/MaskedInput.js.map +1 -1
  36. package/cjs/components/MaskedInput/MaskedInput.md +114 -0
  37. package/cjs/components/MenuFooter/MenuFooter.md +27 -0
  38. package/cjs/components/MenuHeader/MenuHeader.md +35 -0
  39. package/cjs/components/MenuItem/MenuItem.md +139 -0
  40. package/cjs/components/MenuSeparator/MenuSeparator.md +14 -0
  41. package/cjs/components/MiniModal/MiniModal.md +231 -0
  42. package/cjs/components/Modal/Modal.md +56 -0
  43. package/cjs/components/Paging/Paging.md +57 -0
  44. package/cjs/components/PasswordInput/PasswordInput.md +29 -0
  45. package/cjs/components/Radio/Radio.md +57 -0
  46. package/cjs/components/RadioGroup/RadioGroup.md +44 -0
  47. package/cjs/components/ResponsiveLayout/ResponsiveLayout.md +75 -0
  48. package/cjs/components/ScrollContainer/ScrollContainer.md +224 -0
  49. package/cjs/components/Select/Select.md +113 -0
  50. package/cjs/components/SidePage/SidePage.md +65 -0
  51. package/cjs/components/SingleToast/SingleToast.md +36 -0
  52. package/cjs/components/Spinner/Spinner.md +36 -0
  53. package/cjs/components/Sticky/Sticky.md +28 -0
  54. package/cjs/components/Switcher/Switcher.md +111 -0
  55. package/cjs/components/Tabs/Tab.md +73 -0
  56. package/cjs/components/Tabs/Tabs.md +54 -0
  57. package/cjs/components/Textarea/Textarea.d.ts +6 -1
  58. package/cjs/components/Textarea/Textarea.js +16 -3
  59. package/cjs/components/Textarea/Textarea.js.map +1 -1
  60. package/cjs/components/Textarea/Textarea.md +58 -0
  61. package/cjs/components/Textarea/Textarea.styles.js +2 -1
  62. package/cjs/components/Textarea/Textarea.styles.js.map +1 -1
  63. package/cjs/components/Toast/Toast.md +69 -0
  64. package/cjs/components/Toggle/Toggle.md +110 -0
  65. package/cjs/components/Token/Token.md +48 -0
  66. package/cjs/components/TokenInput/TokenInput.md +277 -0
  67. package/cjs/components/Tooltip/Tooltip.d.ts +1 -1
  68. package/cjs/components/Tooltip/Tooltip.js +6 -8
  69. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  70. package/cjs/components/Tooltip/Tooltip.md +322 -0
  71. package/cjs/components/TooltipMenu/TooltipMenu.md +241 -0
  72. package/cjs/internal/ClearCrossIcon/ClearCrossIcon.d.ts +1 -0
  73. package/cjs/internal/ClearCrossIcon/ClearCrossIcon.js +16 -7
  74. package/cjs/internal/ClearCrossIcon/ClearCrossIcon.js.map +1 -1
  75. package/cjs/internal/ClearCrossIcon/ClearCrossIcon.styles.d.ts +3 -0
  76. package/cjs/internal/ClearCrossIcon/ClearCrossIcon.styles.js +27 -9
  77. package/cjs/internal/ClearCrossIcon/ClearCrossIcon.styles.js.map +1 -1
  78. package/cjs/internal/CustomComboBox/ComboBoxView.d.ts +7 -6
  79. package/cjs/internal/CustomComboBox/ComboBoxView.js +2 -7
  80. package/cjs/internal/CustomComboBox/ComboBoxView.js.map +1 -1
  81. package/cjs/internal/CustomComboBox/CustomComboBox.d.ts +6 -5
  82. package/cjs/internal/CustomComboBox/CustomComboBox.js +1 -3
  83. package/cjs/internal/CustomComboBox/CustomComboBox.js.map +1 -1
  84. package/cjs/internal/CustomComboBox/getComboBoxTheme.d.ts +2 -1
  85. package/cjs/internal/CustomComboBox/getComboBoxTheme.js +10 -7
  86. package/cjs/internal/CustomComboBox/getComboBoxTheme.js.map +1 -1
  87. package/cjs/internal/DataTids/DATATIDS.md +12 -0
  88. package/cjs/internal/DataTids/DataTids.d.ts +12 -0
  89. package/cjs/internal/DataTids/DataTids.js +50 -0
  90. package/cjs/internal/DataTids/DataTids.js.map +1 -0
  91. package/cjs/internal/DataTids/DataTids.styles.d.ts +7 -0
  92. package/cjs/internal/DataTids/DataTids.styles.js +42 -0
  93. package/cjs/internal/DataTids/DataTids.styles.js.map +1 -0
  94. package/cjs/internal/DataTids/componentsDataTids.d.ts +5 -0
  95. package/cjs/internal/DataTids/componentsDataTids.js +15 -0
  96. package/cjs/internal/DataTids/componentsDataTids.js.map +1 -0
  97. package/cjs/internal/InputLikeText/InputLikeText.styles.d.ts +1 -0
  98. package/cjs/internal/InputLikeText/InputLikeText.styles.js +12 -4
  99. package/cjs/internal/InputLikeText/InputLikeText.styles.js.map +1 -1
  100. package/cjs/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.d.ts +37 -0
  101. package/cjs/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.js +235 -0
  102. package/cjs/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.js.map +1 -0
  103. package/cjs/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.styles.d.ts +3 -0
  104. package/cjs/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.styles.js +10 -0
  105. package/cjs/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.styles.js.map +1 -0
  106. package/cjs/internal/ThemePlayground/Playground.md +7 -0
  107. package/cjs/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
  108. package/cjs/internal/themes/BasicTheme.d.ts +2 -0
  109. package/cjs/internal/themes/BasicTheme.js +11 -6
  110. package/cjs/internal/themes/BasicTheme.js.map +1 -1
  111. package/cjs/internal/themes/DarkTheme5_4.js +10 -3
  112. package/cjs/internal/themes/DarkTheme5_4.js.map +1 -1
  113. package/cjs/internal/themes/LightTheme5_4.js +10 -3
  114. package/cjs/internal/themes/LightTheme5_4.js.map +1 -1
  115. package/cjs/internal/themes/consts.d.ts +7 -0
  116. package/cjs/internal/themes/consts.js +7 -0
  117. package/cjs/internal/themes/consts.js.map +1 -0
  118. package/cjs/lib/featureFlagsContext/FEATUREFLAGSCONTEXT.md +64 -0
  119. package/cjs/lib/locale/LOCALECONTEXT.md +222 -0
  120. package/cjs/lib/theming/ThemeContext.md +265 -0
  121. package/components/Autocomplete/Autocomplete.md +113 -0
  122. package/components/Button/Button.md +261 -0
  123. package/components/Calendar/Calendar.md +276 -0
  124. package/components/Calendar/CalendarDay.md +70 -0
  125. package/components/Center/Center.md +26 -0
  126. package/components/Checkbox/Checkbox.md +171 -0
  127. package/components/ComboBox/ComboBox/ComboBox.js +2 -1
  128. package/components/ComboBox/ComboBox/ComboBox.js.map +1 -1
  129. package/components/ComboBox/ComboBox.d.ts +11 -5
  130. package/components/ComboBox/ComboBox.md +574 -0
  131. package/components/CurrencyInput/CurrencyInput.md +39 -0
  132. package/components/CurrencyLabel/CurrencyLabel/CurrencyLabel.js +1 -1
  133. package/components/CurrencyLabel/CurrencyLabel/CurrencyLabel.js.map +1 -1
  134. package/components/CurrencyLabel/CurrencyLabel.md +29 -0
  135. package/components/DateInput/DateInput.md +111 -0
  136. package/components/DatePicker/DatePicker.md +368 -0
  137. package/components/Dropdown/Dropdown.md +45 -0
  138. package/components/DropdownMenu/DropdownMenu.md +290 -0
  139. package/components/FileUploader/FileUploader.md +131 -0
  140. package/components/FxInput/FxInput.md +31 -0
  141. package/components/Gapped/Gapped.md +44 -0
  142. package/components/GlobalLoader/GlobalLoader.md +97 -0
  143. package/components/Group/Group.md +19 -0
  144. package/components/Hint/Hint.md +86 -0
  145. package/components/Input/Input.md +86 -0
  146. package/components/Input/InputLayout/InputLayout/InputLayout.js +5 -2
  147. package/components/Input/InputLayout/InputLayout/InputLayout.js.map +1 -1
  148. package/components/Input/InputLayout/InputLayout.d.ts +1 -0
  149. package/components/Kebab/Kebab.md +306 -0
  150. package/components/Link/Link.md +182 -0
  151. package/components/Loader/Loader.md +33 -0
  152. package/components/MaskedInput/MaskedInput/MaskedInput.js +1 -11
  153. package/components/MaskedInput/MaskedInput/MaskedInput.js.map +1 -1
  154. package/components/MaskedInput/MaskedInput.d.ts +0 -8
  155. package/components/MaskedInput/MaskedInput.md +114 -0
  156. package/components/MenuFooter/MenuFooter.md +27 -0
  157. package/components/MenuHeader/MenuHeader.md +35 -0
  158. package/components/MenuItem/MenuItem.md +139 -0
  159. package/components/MenuSeparator/MenuSeparator.md +14 -0
  160. package/components/MiniModal/MiniModal.md +231 -0
  161. package/components/Modal/Modal.md +56 -0
  162. package/components/Paging/Paging.md +57 -0
  163. package/components/PasswordInput/PasswordInput.md +29 -0
  164. package/components/Radio/Radio.md +57 -0
  165. package/components/RadioGroup/RadioGroup.md +44 -0
  166. package/components/ResponsiveLayout/ResponsiveLayout.md +75 -0
  167. package/components/ScrollContainer/ScrollContainer.md +224 -0
  168. package/components/Select/Select.md +113 -0
  169. package/components/SidePage/SidePage.md +65 -0
  170. package/components/SingleToast/SingleToast.md +36 -0
  171. package/components/Spinner/Spinner.md +36 -0
  172. package/components/Sticky/Sticky.md +28 -0
  173. package/components/Switcher/Switcher.md +111 -0
  174. package/components/Tabs/Tab.md +73 -0
  175. package/components/Tabs/Tabs.md +54 -0
  176. package/components/Textarea/Textarea/Textarea.js +11 -2
  177. package/components/Textarea/Textarea/Textarea.js.map +1 -1
  178. package/components/Textarea/Textarea.d.ts +6 -1
  179. package/components/Textarea/Textarea.md +58 -0
  180. package/components/Textarea/Textarea.styles/Textarea.styles.js +1 -1
  181. package/components/Textarea/Textarea.styles/Textarea.styles.js.map +1 -1
  182. package/components/Toast/Toast.md +69 -0
  183. package/components/Toggle/Toggle.md +110 -0
  184. package/components/Token/Token.md +48 -0
  185. package/components/TokenInput/TokenInput.md +277 -0
  186. package/components/Tooltip/Tooltip/Tooltip.js +4 -7
  187. package/components/Tooltip/Tooltip/Tooltip.js.map +1 -1
  188. package/components/Tooltip/Tooltip.d.ts +1 -1
  189. package/components/Tooltip/Tooltip.md +322 -0
  190. package/components/TooltipMenu/TooltipMenu.md +241 -0
  191. package/internal/ClearCrossIcon/ClearCrossIcon/ClearCrossIcon.js +21 -7
  192. package/internal/ClearCrossIcon/ClearCrossIcon/ClearCrossIcon.js.map +1 -1
  193. package/internal/ClearCrossIcon/ClearCrossIcon.d.ts +1 -0
  194. package/internal/ClearCrossIcon/ClearCrossIcon.styles/ClearCrossIcon.styles.js +14 -5
  195. package/internal/ClearCrossIcon/ClearCrossIcon.styles/ClearCrossIcon.styles.js.map +1 -1
  196. package/internal/ClearCrossIcon/ClearCrossIcon.styles.d.ts +3 -0
  197. package/internal/CustomComboBox/ComboBoxView/ComboBoxView.js +44 -51
  198. package/internal/CustomComboBox/ComboBoxView/ComboBoxView.js.map +1 -1
  199. package/internal/CustomComboBox/ComboBoxView.d.ts +7 -6
  200. package/internal/CustomComboBox/CustomComboBox/CustomComboBox.js +3 -5
  201. package/internal/CustomComboBox/CustomComboBox/CustomComboBox.js.map +1 -1
  202. package/internal/CustomComboBox/CustomComboBox.d.ts +6 -5
  203. package/internal/CustomComboBox/getComboBoxTheme/getComboBoxTheme.js +5 -3
  204. package/internal/CustomComboBox/getComboBoxTheme/getComboBoxTheme.js.map +1 -1
  205. package/internal/CustomComboBox/getComboBoxTheme.d.ts +2 -1
  206. package/internal/DataTids/DATATIDS.md +12 -0
  207. package/internal/DataTids/DataTids/DataTids.js +69 -0
  208. package/internal/DataTids/DataTids/DataTids.js.map +1 -0
  209. package/internal/DataTids/DataTids/package.json +6 -0
  210. package/internal/DataTids/DataTids.d.ts +12 -0
  211. package/internal/DataTids/DataTids.styles/DataTids.styles.js +20 -0
  212. package/internal/DataTids/DataTids.styles/DataTids.styles.js.map +1 -0
  213. package/internal/DataTids/DataTids.styles/package.json +6 -0
  214. package/internal/DataTids/DataTids.styles.d.ts +7 -0
  215. package/internal/DataTids/componentsDataTids/componentsDataTids.js +12 -0
  216. package/internal/DataTids/componentsDataTids/componentsDataTids.js.map +1 -0
  217. package/internal/DataTids/componentsDataTids/package.json +6 -0
  218. package/internal/DataTids/componentsDataTids.d.ts +5 -0
  219. package/internal/InputLikeText/InputLikeText.styles/InputLikeText.styles.js +7 -4
  220. package/internal/InputLikeText/InputLikeText.styles/InputLikeText.styles.js.map +1 -1
  221. package/internal/InputLikeText/InputLikeText.styles.d.ts +1 -0
  222. package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout/InternalTextareaWithLayout.js +249 -0
  223. package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout/InternalTextareaWithLayout.js.map +1 -0
  224. package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout/package.json +6 -0
  225. package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.d.ts +37 -0
  226. package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.styles/InternalTextareaWithLayout.styles.js +8 -0
  227. package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.styles/InternalTextareaWithLayout.styles.js.map +1 -0
  228. package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.styles/package.json +6 -0
  229. package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.styles.d.ts +3 -0
  230. package/internal/ThemePlayground/Playground.md +7 -0
  231. package/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
  232. package/internal/themes/BasicTheme/BasicTheme.js +4 -4
  233. package/internal/themes/BasicTheme/BasicTheme.js.map +1 -1
  234. package/internal/themes/BasicTheme.d.ts +2 -0
  235. package/internal/themes/DarkTheme5_4/DarkTheme5_4.js +4 -2
  236. package/internal/themes/DarkTheme5_4/DarkTheme5_4.js.map +1 -1
  237. package/internal/themes/LightTheme5_4/LightTheme5_4.js +4 -2
  238. package/internal/themes/LightTheme5_4/LightTheme5_4.js.map +1 -1
  239. package/internal/themes/consts/consts.js +7 -0
  240. package/internal/themes/consts/consts.js.map +1 -0
  241. package/internal/themes/consts/package.json +6 -0
  242. package/internal/themes/consts.d.ts +7 -0
  243. package/lib/featureFlagsContext/FEATUREFLAGSCONTEXT.md +64 -0
  244. package/lib/locale/LOCALECONTEXT.md +222 -0
  245. package/lib/theming/ThemeContext.md +265 -0
  246. package/package.json +6 -1
@@ -0,0 +1,73 @@
1
+ У компонента `<Tabs.Tab />` есть несколько визуальных состояний, в которых компонент может находиться: `primary`, `success`, `warning` и `error`. Чтобы перевести контрол в нужное состояние передайте компоненту булевый проп с соответсвующим названием.
2
+
3
+ ### Кастомизация
4
+ Используя переменные `tabColorPrimary`, `tabColorSuccess`, `tabColorWarning` и `tabColorError` можно изменить активный цвет состояния, а библиотека автоматически подберёт цвет подчёркивания при наведении.
5
+ ```jsx harmony
6
+ import { ThemeContext, ThemeFactory, Button, Tabs } from '@skbkontur/react-ui';
7
+
8
+ const getRandomColor = () => '#' + Math.random().toString(16).substr(-6);
9
+ const updateColors = () => {
10
+ return {
11
+ tabColorPrimary: getRandomColor(),
12
+ tabColorSuccess: getRandomColor(),
13
+ tabColorWarning: getRandomColor(),
14
+ tabColorError: getRandomColor(),
15
+ }
16
+ };
17
+
18
+ const [activeBase, setActiveBase] = React.useState('error');
19
+ const [activeRandom, setActiveRandom] = React.useState('error');
20
+ const [colors, setColors] = React.useState(updateColors());
21
+
22
+ <>
23
+ <p style={{ fontSize: '17px' }}>C цветами по умолчанию</p>
24
+ <Tabs value={activeBase} onValueChange={setActiveBase}>
25
+ <Tabs.Tab primary id="primary">Primary</Tabs.Tab>
26
+ <Tabs.Tab success id="success">Success</Tabs.Tab>
27
+ <Tabs.Tab warning id="warning">Warning</Tabs.Tab>
28
+ <Tabs.Tab error id="error">Error</Tabs.Tab>
29
+ </Tabs>
30
+
31
+ <p style={{ fontSize: '17px' }}>Со случайным основным цветом</p>
32
+ <div style={{ display: 'inline-flex', flexDirection: 'column', justifyContent: 'space-between', height: '100px' }}>
33
+ <ThemeContext.Consumer>
34
+ {(theme) => {
35
+ return (
36
+ <ThemeContext.Provider
37
+ value={ThemeFactory.create(colors,theme)}
38
+ >
39
+ <Tabs value={activeRandom} onValueChange={setActiveRandom}>
40
+ <Tabs.Tab primary id="primary">Primary</Tabs.Tab>
41
+ <Tabs.Tab success id="success">Success</Tabs.Tab>
42
+ <Tabs.Tab warning id="warning">Warning</Tabs.Tab>
43
+ <Tabs.Tab error id="error">Error</Tabs.Tab>
44
+ </Tabs>
45
+ </ThemeContext.Provider>
46
+ );
47
+ }}
48
+ </ThemeContext.Consumer>
49
+ <Button onClick={() => setColors(updateColors)}>Получить новый набор цветов</Button>
50
+ </div>
51
+ </>
52
+ ```
53
+
54
+ ### Изменение корневого компонента Tab
55
+ С помощью пропа `component` можно изменять корневой элемент `<Tab />`.
56
+
57
+ Проп может принимать: компоненты, функции и строки.
58
+ ```jsx harmony
59
+ import { Tabs } from '@skbkontur/react-ui';
60
+
61
+ const [active, setActive] = React.useState('/fuji');
62
+
63
+ const NavLink = props => <a {...props} />;
64
+
65
+ <Tabs value={active} onValueChange={setActive}>
66
+ {/** Кастомный компонент **/}
67
+ <Tabs.Tab component={(props) => <NavLink {...props} />} id="/fuji">🌋 Fuji</Tabs.Tab>
68
+ {/** Функция **/}
69
+ <Tabs.Tab component={(props) => <a {...props} />} id="/tahat">⛰ Tahat</Tabs.Tab>
70
+ {/** Строка **/}
71
+ <Tabs.Tab component="a" id="/alps">🗻 Alps</Tabs.Tab>
72
+ </Tabs>;
73
+ ```
@@ -0,0 +1,54 @@
1
+ ### Базовый пример
2
+ ```jsx harmony
3
+ const [active, setActive] = React.useState('fuji');
4
+
5
+ <Tabs value={active} onValueChange={setActive}>
6
+ <Tabs.Tab id="fuji">🌋 Fuji</Tabs.Tab>
7
+ <Tabs.Tab id="tahat">⛰ Tahat</Tabs.Tab>
8
+ <Tabs.Tab id="alps">🗻 Alps</Tabs.Tab>
9
+ </Tabs>;
10
+ ```
11
+
12
+ ### Расположение табов
13
+ Компонент может отображать табы двумя способами: горизонтально (по умолчанию) и вертикально.
14
+ ```jsx harmony
15
+ const [active, setActive] = React.useState('fuji');
16
+
17
+ <Tabs vertical value={active} onValueChange={setActive}>
18
+ <Tabs.Tab id="fuji">🌋 Fuji</Tabs.Tab>
19
+ <Tabs.Tab id="tahat">⛰ Tahat</Tabs.Tab>
20
+ <Tabs.Tab id="alps">🗻 Alps</Tabs.Tab>
21
+ </Tabs>;
22
+ ```
23
+
24
+ ### Размер
25
+ ```jsx harmony
26
+ const [active, setActive] = React.useState('fuji');
27
+ const renderCaption = (caption) => <span style={{display: "inline-block", width: 60}}>{caption}</span>;
28
+ <div>
29
+ <div>
30
+ {renderCaption("small")}
31
+ <Tabs value={active} onValueChange={setActive} size="small">
32
+ <Tabs.Tab id="fuji">🌋 Fuji</Tabs.Tab>
33
+ <Tabs.Tab id="tahat">⛰ Tahat</Tabs.Tab>
34
+ <Tabs.Tab id="alps">🗻 Alps</Tabs.Tab>
35
+ </Tabs>
36
+ </div>
37
+ <div>
38
+ {renderCaption("medium")}
39
+ <Tabs value={active} onValueChange={setActive} size="medium">
40
+ <Tabs.Tab id="fuji">🌋 Fuji</Tabs.Tab>
41
+ <Tabs.Tab id="tahat">⛰ Tahat</Tabs.Tab>
42
+ <Tabs.Tab id="alps">🗻 Alps</Tabs.Tab>
43
+ </Tabs>
44
+ </div>
45
+ <div>
46
+ {renderCaption("large")}
47
+ <Tabs value={active} onValueChange={setActive} size="large">
48
+ <Tabs.Tab id="fuji">🌋 Fuji</Tabs.Tab>
49
+ <Tabs.Tab id="tahat">⛰ Tahat</Tabs.Tab>
50
+ <Tabs.Tab id="alps">🗻 Alps</Tabs.Tab>
51
+ </Tabs>
52
+ </div>
53
+ </div>;
54
+ ```
@@ -4,7 +4,9 @@ import type { Override } from '../../typings/utility-types';
4
4
  import type { CommonProps } from '../../internal/CommonWrapper';
5
5
  import type { TGetRootNode } from '../../lib/rootNode';
6
6
  import type { SizeProp } from '../../lib/types/props';
7
- export interface TextareaProps extends Pick<AriaAttributes, 'aria-label'>, CommonProps, Override<React.TextareaHTMLAttributes<HTMLTextAreaElement>, {
7
+ import type { InputAlign } from '../Input';
8
+ export declare const DEFAULT_WIDTH = 250;
9
+ export interface TextareaProps extends Pick<AriaAttributes, 'aria-controls' | 'aria-label'>, CommonProps, Override<React.TextareaHTMLAttributes<HTMLTextAreaElement>, {
8
10
  /** Переводит контрол в состояние валидации "ошибка". */
9
11
  error?: boolean;
10
12
  /** Переводит контрол в состояние валидации "предупреждение". */
@@ -46,6 +48,8 @@ export interface TextareaProps extends Pick<AriaAttributes, 'aria-label'>, Commo
46
48
  extraRow?: boolean;
47
49
  /** Отключает анимацию при авто-ресайзе. Автоматически отключается когда в `extraRow` передан `false`. */
48
50
  disableAnimations?: boolean;
51
+ /** Выравнивание текста */
52
+ align?: InputAlign;
49
53
  }> {
50
54
  }
51
55
  export interface TextareaState {
@@ -68,6 +72,7 @@ export declare class Textarea extends React.Component<TextareaProps, TextareaSta
68
72
  static __KONTUR_REACT_UI__: string;
69
73
  static displayName: string;
70
74
  static defaultProps: DefaultProps;
75
+ clear: () => void;
71
76
  private getProps;
72
77
  private getRootSizeClassName;
73
78
  private getTextareaSizeClassName;
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;exports.__esModule = true;exports.TextareaDataTids = exports.Textarea = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
1
+ "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;exports.__esModule = true;exports.TextareaDataTids = exports.Textarea = exports.DEFAULT_WIDTH = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
2
2
  var _react = _interopRequireDefault(require("react"));
3
3
  var _lodash = _interopRequireDefault(require("lodash.throttle"));
4
4
  var _globalObject = require("@skbkontur/global-object");
@@ -21,13 +21,14 @@ var _rootNode = require("../../lib/rootNode");
21
21
  var _createPropsGetter = require("../../lib/createPropsGetter");
22
22
 
23
23
 
24
+
24
25
  var _TextareaHelpers = require("./TextareaHelpers");
25
26
  var _Textarea2 = require("./Textarea.styles");
26
27
 
27
28
  var _TextareaCounter = require("./TextareaCounter");
28
29
  var _TextareaWithSafari17Workaround = require("./TextareaWithSafari17Workaround");var _excluded = ["width", "error", "warning", "size", "autoResize", "resize", "onCut", "onPaste", "maxRows", "onFocus", "selectAllOnFocus", "placeholder", "onValueChange", "showLengthCounter", "lengthCounter", "counterHelp", "extraRow", "disableAnimations", "disabled"];var _class, _Textarea;
29
30
 
30
- var DEFAULT_WIDTH = 250;
31
+ var DEFAULT_WIDTH = exports.DEFAULT_WIDTH = 250;
31
32
  var AUTORESIZE_THROTTLE_DEFAULT_WAIT = 100;
32
33
 
33
34
 
@@ -97,6 +98,8 @@ var AUTORESIZE_THROTTLE_DEFAULT_WAIT = 100;
97
98
 
98
99
 
99
100
 
101
+
102
+
100
103
 
101
104
 
102
105
 
@@ -127,6 +130,15 @@ Textarea = exports.Textarea = (0, _rootNode.rootNode)(_class = (_Textarea = /*#_
127
130
 
128
131
 
129
132
 
133
+ clear = function () {
134
+ if (_this.node) {
135
+ _this.node.value = '';
136
+ }
137
+ if (_this.fakeNode) {
138
+ _this.fakeNode.value = '';
139
+ }
140
+ };_this.
141
+
130
142
  getProps = (0, _createPropsGetter.createPropsGetter)(Textarea.defaultProps);_this.
131
143
 
132
144
 
@@ -329,7 +341,8 @@ Textarea = exports.Textarea = (0, _rootNode.rootNode)(_class = (_Textarea = /*#_
329
341
  );
330
342
 
331
343
  var textareaStyle = {
332
- resize: autoResize ? 'none' : resize
344
+ resize: autoResize ? 'none' : resize,
345
+ textAlign: _this.props.align
333
346
  };
334
347
 
335
348
  var placeholderPolyfill = null;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_lodash","_globalObject","_identifiers","_needsPolyfillPlaceholder","LayoutEvents","_interopRequireWildcard","_ThemeContext","_RenderLayer","_ResizeDetector","_client","_CommonWrapper","_currentEnvironment","_Emotion","_rootNode","_createPropsGetter","_TextareaHelpers","_Textarea2","_TextareaCounter","_TextareaWithSafari17Workaround","_excluded","_class","_Textarea","DEFAULT_WIDTH","AUTORESIZE_THROTTLE_DEFAULT_WAIT","TextareaDataTids","exports","root","counter","helpIcon","Textarea","rootNode","_React$Component","_this","_len","arguments","length","args","Array","_key","call","apply","concat","getProps","createPropsGetter","defaultProps","state","needsPolyfillPlaceholder","isCounterVisible","reflowCounter","reflow","selectAllId","textareaObserver","globalObject","MutationObserver","setSelectionRange","start","end","_globalObject$documen","node","Error","document","activeElement","focus","selectAll","value","delaySelectAll","_globalObject$request","requestAnimationFrame","cancelDelayedSelectAll","cancelAnimationFrame","renderMain","props","_cx","_ref","_textareaProps$maxLen","_cx2","_props$width","width","error","warning","size","autoResize","resize","onCut","onPaste","maxRows","onFocus","selectAllOnFocus","placeholder","onValueChange","showLengthCounter","lengthCounter","counterHelp","extraRow","disableAnimations","disabled","textareaProps","_objectWithoutPropertiesLoose2","default","rootProps","style","textareaClassNames","cx","getTextareaSizeClassName","styles","textarea","theme","hovering","isAnimationsDisabled","textareaStyle","placeholderPolyfill","defaultValue","createElement","className","fakeTextarea","fakeProps","fake","readOnly","_extends2","ref","refFake","TextareaCounter","help","maxLength","onCloseHelp","handleCloseCounterHelp","refCounter","Component","isSafariWithTextareaBug","TextareaWithSafari17Workaround","RenderLayer","onFocusOutside","onClickOutside","active","getRootSizeClassName","ResizeDetector","onResize","undefined","onChange","handleChange","handleCut","handlePaste","handleFocus","onKeyDown","handleKeyDown","children","setState","e","toString","isBlockEnter","isKeyEnter","preventDefault","fieldIsEmpty","target","element","fakeNode","autoResizeHandler","_this$getProps","rows","_ref2","getTextAreaHeight","minRows","parseInt","height","exceededMaxHeight","overflowY","throttle","getAutoResizeThrottleWait","event","isIE11","_inheritsLoose2","_proto","prototype","rootLarge","rootMedium","rootSmall","textareaLarge","textareaMedium","textareaSmall","_temp","_ref3","componentDidMount","layoutEvents","addListener","observe","attributes","componentWillUnmount","remove","disconnect","componentDidUpdate","prevProps","cancel","_this$getProps2","render","_this2","ThemeContext","Consumer","CommonWrapper","rootNodeRef","setRootNode","blur","React","__KONTUR_REACT_UI__","displayName","isTestEnv"],"sources":["Textarea.tsx"],"sourcesContent":["import type { AriaAttributes, ReactNode } from 'react';\nimport React from 'react';\nimport throttle from 'lodash.throttle';\nimport { globalObject } from '@skbkontur/global-object';\n\nimport { isKeyEnter } from '../../lib/events/keyboard/identifiers';\nimport { needsPolyfillPlaceholder } from '../../lib/needsPolyfillPlaceholder';\nimport * as LayoutEvents from '../../lib/LayoutEvents';\nimport type { Nullable, Override } from '../../typings/utility-types';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport type { Theme } from '../../lib/theming/Theme';\nimport { RenderLayer } from '../../internal/RenderLayer';\nimport { ResizeDetector } from '../../internal/ResizeDetector';\nimport { isIE11, isSafariWithTextareaBug } from '../../lib/client';\nimport type { CommonProps, CommonWrapperRestProps } from '../../internal/CommonWrapper';\nimport { CommonWrapper } from '../../internal/CommonWrapper';\nimport { isTestEnv } from '../../lib/currentEnvironment';\nimport { cx } from '../../lib/theming/Emotion';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode';\nimport { rootNode } from '../../lib/rootNode';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\nimport type { SizeProp } from '../../lib/types/props';\n\nimport { getTextAreaHeight } from './TextareaHelpers';\nimport { styles } from './Textarea.styles';\nimport type { TextareaCounterRef } from './TextareaCounter';\nimport { TextareaCounter } from './TextareaCounter';\nimport { TextareaWithSafari17Workaround } from './TextareaWithSafari17Workaround';\n\nconst DEFAULT_WIDTH = 250;\nconst AUTORESIZE_THROTTLE_DEFAULT_WAIT = 100;\n\nexport interface TextareaProps\n extends Pick<AriaAttributes, 'aria-label'>,\n CommonProps,\n Override<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n {\n /** Переводит контрол в состояние валидации \"ошибка\". */\n error?: boolean;\n\n /** Переводит контрол в состояние валидации \"предупреждение\". */\n warning?: boolean;\n\n /** Делает компонент недоступным. */\n disabled?: boolean;\n\n /** Задает размер компонента. */\n size?: SizeProp;\n\n /** Выполняет автоматический ресайз в зависимости от содержимого. */\n autoResize?: boolean;\n\n /** Задает высоту текстарии в виде числа строк видимых без скролла. */\n rows?: number;\n\n /** Задает максимальное число строк при автоматическом ресайзе. */\n maxRows?: string | number;\n\n /** Задает направления ресайза компонента.\n * Попадает в `style`. */\n resize?: React.CSSProperties['resize'];\n\n /** Задает ширину текстэрии. */\n width?: React.CSSProperties['width'];\n\n /** Задает функцию, которая вызывается при изменении `value`. */\n onValueChange?: (value: string) => void;\n\n /** Определяет, нужно ли выделять введенное значение при фокусе. Работает с типами text, password, tel, search, url. */\n selectAllOnFocus?: boolean;\n\n /** Определяет, нужно ли показывать счетчик символов. */\n showLengthCounter?: boolean;\n\n /** Задает допустимое количество символов в поле. Отображается в счетчике.\n * @default maxLength */\n lengthCounter?: number;\n\n /** Задает подсказку к счетчику символов.\n * По умолчанию - тултип с содержимым из пропа, если передан `ReactNode`.\n * Передав функцию, можно переопределить подсказку целиком, вместе с иконкой.\n * @example\n * ```\n * counterHelp={() => <Tooltip render={...}><HelpIcon /></Tooltip>}\n * ``` */\n counterHelp?: ReactNode | (() => ReactNode);\n\n /** Добавляет дополнительную свободную строку при авто-ресайзе.\n * @see https://guides.kontur.ru/components/textarea/#04 */\n extraRow?: boolean;\n\n /** Отключает анимацию при авто-ресайзе. Автоматически отключается когда в `extraRow` передан `false`. */\n disableAnimations?: boolean;\n }\n > {}\n\nexport interface TextareaState {\n needsPolyfillPlaceholder: boolean;\n isCounterVisible: boolean;\n}\n\nexport const TextareaDataTids = {\n root: 'Textarea__root',\n counter: 'TextareaCounter__root',\n helpIcon: 'TextareaCounter__helpIcon',\n} as const;\n\ntype DefaultProps = Required<Pick<TextareaProps, 'rows' | 'maxRows' | 'extraRow' | 'disableAnimations' | 'size'>>;\n\n/**\n * Многострочное поле `Textarea` — это поле ввода, которое позволяет работать с несколькими строками текста.\n *\n * Принимает все атрибуты `React.TextareaHTMLAttributes<HTMLTextAreaElement>`.\n * Пропы **`className` и `style` игнорируются**.\n */\n@rootNode\nexport class Textarea extends React.Component<TextareaProps, TextareaState> {\n public static __KONTUR_REACT_UI__ = 'Textarea';\n public static displayName = 'Textarea';\n\n public static defaultProps: DefaultProps = {\n rows: 3,\n maxRows: 15,\n extraRow: true,\n size: 'small',\n disableAnimations: isTestEnv,\n };\n\n private getProps = createPropsGetter(Textarea.defaultProps);\n\n private getRootSizeClassName() {\n switch (this.getProps().size) {\n case 'large':\n return styles.rootLarge(this.theme);\n case 'medium':\n return styles.rootMedium(this.theme);\n case 'small':\n default:\n return styles.rootSmall(this.theme);\n }\n }\n\n private getTextareaSizeClassName() {\n switch (this.getProps().size) {\n case 'large':\n return styles.textareaLarge(this.theme);\n case 'medium':\n return styles.textareaMedium(this.theme);\n case 'small':\n default:\n return styles.textareaSmall(this.theme);\n }\n }\n\n public state = {\n needsPolyfillPlaceholder,\n isCounterVisible: false,\n };\n private reflowCounter = () => {\n if (this.counter) {\n this.counter.reflow();\n }\n };\n\n private theme!: Theme;\n private selectAllId: number | null = null;\n private node: Nullable<HTMLTextAreaElement>;\n private fakeNode: Nullable<HTMLTextAreaElement>;\n private counter: Nullable<TextareaCounterRef>;\n private layoutEvents: Nullable<{ remove: () => void }>;\n private textareaObserver = globalObject.MutationObserver\n ? new globalObject.MutationObserver(this.reflowCounter)\n : null;\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n private getAutoResizeThrottleWait(props: TextareaProps = this.props): number {\n // NOTE: При отключении анимации остается эффект дергания при авто-ресайзе из-за троттлинга расчета высоты\n // Поэтому выставляем таймаут троттла в ноль. Подробности - https://github.com/skbkontur/retail-ui/issues/2120\n return this.isAnimationsDisabled(props) ? 0 : AUTORESIZE_THROTTLE_DEFAULT_WAIT;\n }\n private isAnimationsDisabled({ disableAnimations, extraRow }: TextareaProps = this.props): boolean {\n return disableAnimations || !extraRow;\n }\n\n public componentDidMount() {\n if (this.props.autoResize) {\n this.autoResize();\n this.layoutEvents = LayoutEvents.addListener(this.autoResize);\n }\n\n if (this.node && this.props.showLengthCounter && this.textareaObserver) {\n this.textareaObserver.observe(this.node, { attributes: true });\n }\n }\n\n public componentWillUnmount() {\n if (this.layoutEvents) {\n this.layoutEvents.remove();\n }\n if (this.props.showLengthCounter && this.textareaObserver) {\n this.textareaObserver.disconnect();\n }\n this.cancelDelayedSelectAll();\n }\n\n public componentDidUpdate(prevProps: TextareaProps) {\n if (this.getAutoResizeThrottleWait() !== this.getAutoResizeThrottleWait(prevProps)) {\n this.autoResize.cancel();\n this.autoResize = throttle(this.autoResizeHandler, this.getAutoResizeThrottleWait());\n }\n const { rows, maxRows } = this.getProps();\n if (\n this.props.autoResize &&\n (rows !== prevProps.rows || maxRows !== prevProps.maxRows || this.props.value !== prevProps.value)\n ) {\n this.autoResize();\n }\n }\n\n public render() {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.getProps()}>\n {this.renderMain}\n </CommonWrapper>\n );\n }}\n </ThemeContext.Consumer>\n );\n }\n\n /**\n * @public\n */\n public focus() {\n if (this.node) {\n this.node.focus();\n }\n }\n\n /**\n * @public\n */\n public blur() {\n if (this.node) {\n this.node.blur();\n }\n }\n\n /**\n * @public\n * @param {number} start\n * @param {number} end\n */\n public setSelectionRange = (start: number, end: number) => {\n if (!this.node) {\n throw new Error('Cannot call \"setSelectionRange\" on unmounted Input');\n }\n\n if (globalObject.document?.activeElement !== this.node) {\n this.focus();\n }\n\n this.node.setSelectionRange(start, end);\n };\n\n /**\n * @public\n */\n public selectAll = () => {\n if (this.node) {\n this.setSelectionRange(0, this.node.value.length);\n }\n };\n\n private delaySelectAll = (): number | null =>\n (this.selectAllId = globalObject.requestAnimationFrame?.(this.selectAll) ?? null);\n\n private cancelDelayedSelectAll = (): void => {\n if (this.selectAllId) {\n globalObject.cancelAnimationFrame?.(this.selectAllId);\n this.selectAllId = null;\n }\n };\n\n private renderMain = (props: CommonWrapperRestProps<TextareaProps>) => {\n const {\n width = DEFAULT_WIDTH,\n error,\n warning,\n size,\n autoResize,\n resize,\n onCut,\n onPaste,\n maxRows,\n onFocus,\n selectAllOnFocus,\n placeholder,\n onValueChange,\n showLengthCounter,\n lengthCounter,\n counterHelp,\n extraRow,\n disableAnimations,\n disabled,\n ...textareaProps\n } = props;\n\n const { isCounterVisible } = this.state;\n\n const rootProps = {\n style: {\n width,\n },\n };\n\n const textareaClassNames = cx(this.getTextareaSizeClassName(), {\n [styles.textarea(this.theme)]: true,\n [styles.hovering(this.theme)]: !error && !warning,\n [styles.disabled(this.theme)]: disabled,\n [styles.error(this.theme)]: !!error,\n [styles.warning(this.theme)]: !!warning,\n [styles.disableAnimations()]: this.isAnimationsDisabled(),\n });\n\n const textareaStyle = {\n resize: autoResize ? 'none' : resize,\n };\n\n let placeholderPolyfill = null;\n\n if (this.state.needsPolyfillPlaceholder && !textareaProps.value && !textareaProps.defaultValue) {\n placeholderPolyfill = <span className={styles.placeholder()}>{placeholder}</span>;\n }\n\n let fakeTextarea = null;\n if (autoResize) {\n const fakeProps = {\n value: this.props.value,\n defaultValue: this.props.defaultValue,\n className: cx(textareaClassNames, styles.fake()),\n readOnly: true,\n };\n fakeTextarea = <textarea {...fakeProps} ref={this.refFake} />;\n }\n\n const counter = showLengthCounter && isCounterVisible && this.node && (\n <TextareaCounter\n textarea={this.node}\n size={this.getProps().size}\n help={counterHelp}\n value={textareaProps.value}\n length={textareaProps.maxLength ?? lengthCounter ?? 0}\n onCloseHelp={this.handleCloseCounterHelp}\n ref={this.refCounter}\n />\n );\n\n const Component = isSafariWithTextareaBug ? TextareaWithSafari17Workaround : 'textarea';\n\n return (\n <RenderLayer\n onFocusOutside={this.handleCloseCounterHelp}\n onClickOutside={this.handleCloseCounterHelp}\n active={this.state.isCounterVisible}\n >\n <label\n data-tid={TextareaDataTids.root}\n {...rootProps}\n className={cx(this.getRootSizeClassName(), {\n [styles.root()]: true,\n })}\n >\n {placeholderPolyfill}\n <ResizeDetector onResize={this.reflowCounter}>\n <Component\n {...textareaProps}\n className={textareaClassNames}\n style={textareaStyle}\n placeholder={!placeholderPolyfill ? placeholder : undefined}\n ref={this.ref}\n onChange={this.handleChange}\n onCut={this.handleCut}\n onPaste={this.handlePaste}\n onFocus={this.handleFocus}\n onKeyDown={this.handleKeyDown}\n disabled={disabled}\n >\n {this.props.children}\n </Component>\n </ResizeDetector>\n {fakeTextarea}\n {counter}\n </label>\n </RenderLayer>\n );\n };\n\n private handleCloseCounterHelp = () => this.setState({ isCounterVisible: false });\n\n private handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n // Edge bug: textarea maxlength doesn't work after new line\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/18833616/\n const value = this.props.value !== undefined ? this.props.value.toString() : null;\n const isBlockEnter = isKeyEnter(e) && value !== null && value.length === this.props.maxLength;\n\n if (isBlockEnter) {\n e.preventDefault();\n }\n\n if (this.props.onKeyDown) {\n this.props.onKeyDown(e);\n }\n };\n\n private handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (needsPolyfillPlaceholder) {\n const fieldIsEmpty = e.target.value === '';\n\n if (this.state.needsPolyfillPlaceholder !== fieldIsEmpty) {\n this.setState({ needsPolyfillPlaceholder: fieldIsEmpty });\n }\n }\n\n if (this.props.onValueChange) {\n this.props.onValueChange(e.target.value);\n }\n\n if (this.props.autoResize) {\n this.autoResize();\n }\n\n if (this.props.onChange) {\n this.props.onChange(e);\n }\n\n this.reflowCounter();\n };\n\n private ref = (element: HTMLTextAreaElement) => {\n this.node = element;\n };\n\n private refFake = (element: HTMLTextAreaElement) => {\n this.fakeNode = element;\n };\n\n private refCounter = (ref: TextareaCounterRef | null) => {\n this.counter = ref;\n };\n\n private autoResizeHandler = () => {\n const fakeNode = this.fakeNode;\n if (!fakeNode) {\n return;\n }\n const node = this.node;\n if (!node) {\n return;\n }\n if (this.props.value === undefined) {\n fakeNode.value = node.value;\n }\n\n const { rows, maxRows } = this.getProps();\n if (rows === undefined || maxRows === undefined) {\n return;\n }\n\n const { height, exceededMaxHeight } =\n getTextAreaHeight({\n node: fakeNode,\n minRows: typeof rows === 'number' ? rows : parseInt(rows, 10),\n maxRows: typeof maxRows === 'number' ? maxRows : parseInt(maxRows, 10),\n extraRow: this.getProps().extraRow,\n }) || {};\n\n if (height === undefined || exceededMaxHeight === undefined) {\n return;\n }\n\n node.style.height = height + 'px';\n node.style.overflowY = exceededMaxHeight ? 'scroll' : 'hidden';\n fakeNode.style.overflowY = exceededMaxHeight ? 'scroll' : 'hidden';\n };\n\n private autoResize = throttle(this.autoResizeHandler, this.getAutoResizeThrottleWait());\n\n private handleCut = (event: React.ClipboardEvent<HTMLTextAreaElement>) => {\n if (this.props.autoResize) {\n this.autoResize();\n }\n\n if (this.props.onCut) {\n this.props.onCut(event);\n }\n\n this.reflowCounter();\n };\n\n private handlePaste = (event: React.ClipboardEvent<HTMLTextAreaElement>) => {\n if (this.props.autoResize) {\n this.autoResize();\n }\n\n if (this.props.onPaste) {\n this.props.onPaste(event);\n }\n\n this.reflowCounter();\n };\n\n private handleFocus = (event: React.FocusEvent<HTMLTextAreaElement>) => {\n this.setState({ isCounterVisible: true });\n\n if (this.props.selectAllOnFocus) {\n // https://github.com/facebook/react/issues/7769\n this.node && !isIE11 ? this.selectAll() : this.delaySelectAll();\n }\n\n if (this.props.onFocus) {\n this.props.onFocus(event);\n }\n };\n}\n"],"mappings":";AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;;AAEA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,yBAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAC,uBAAA,CAAAN,OAAA;;AAE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1E,SAAS,GAAA1G,SAAA,CAC7BqL,mBAAmB,GAAG,UAAU,EAAArL,SAAA,CAChCsL,WAAW,GAAG,UAAU,EAAAtL,SAAA,CAExBuB,YAAY,GAAiB,EACzCkH,IAAI,EAAE,CAAC,EACPzE,OAAO,EAAE,EAAE,EACXQ,QAAQ,EAAE,IAAI,EACdb,IAAI,EAAE,OAAO,EACbc,iBAAiB,EAAE8G,6BAAS,CAC9B,CAAC,EAAAvL,SAAA,MAAAD,MAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_lodash","_globalObject","_identifiers","_needsPolyfillPlaceholder","LayoutEvents","_interopRequireWildcard","_ThemeContext","_RenderLayer","_ResizeDetector","_client","_CommonWrapper","_currentEnvironment","_Emotion","_rootNode","_createPropsGetter","_TextareaHelpers","_Textarea2","_TextareaCounter","_TextareaWithSafari17Workaround","_excluded","_class","_Textarea","DEFAULT_WIDTH","exports","AUTORESIZE_THROTTLE_DEFAULT_WAIT","TextareaDataTids","root","counter","helpIcon","Textarea","rootNode","_React$Component","_this","_len","arguments","length","args","Array","_key","call","apply","concat","clear","node","value","fakeNode","getProps","createPropsGetter","defaultProps","state","needsPolyfillPlaceholder","isCounterVisible","reflowCounter","reflow","selectAllId","textareaObserver","globalObject","MutationObserver","setSelectionRange","start","end","_globalObject$documen","Error","document","activeElement","focus","selectAll","delaySelectAll","_globalObject$request","requestAnimationFrame","cancelDelayedSelectAll","cancelAnimationFrame","renderMain","props","_cx","_ref","_textareaProps$maxLen","_cx2","_props$width","width","error","warning","size","autoResize","resize","onCut","onPaste","maxRows","onFocus","selectAllOnFocus","placeholder","onValueChange","showLengthCounter","lengthCounter","counterHelp","extraRow","disableAnimations","disabled","textareaProps","_objectWithoutPropertiesLoose2","default","rootProps","style","textareaClassNames","cx","getTextareaSizeClassName","styles","textarea","theme","hovering","isAnimationsDisabled","textareaStyle","textAlign","align","placeholderPolyfill","defaultValue","createElement","className","fakeTextarea","fakeProps","fake","readOnly","_extends2","ref","refFake","TextareaCounter","help","maxLength","onCloseHelp","handleCloseCounterHelp","refCounter","Component","isSafariWithTextareaBug","TextareaWithSafari17Workaround","RenderLayer","onFocusOutside","onClickOutside","active","getRootSizeClassName","ResizeDetector","onResize","undefined","onChange","handleChange","handleCut","handlePaste","handleFocus","onKeyDown","handleKeyDown","children","setState","e","toString","isBlockEnter","isKeyEnter","preventDefault","fieldIsEmpty","target","element","autoResizeHandler","_this$getProps","rows","_ref2","getTextAreaHeight","minRows","parseInt","height","exceededMaxHeight","overflowY","throttle","getAutoResizeThrottleWait","event","isIE11","_inheritsLoose2","_proto","prototype","rootLarge","rootMedium","rootSmall","textareaLarge","textareaMedium","textareaSmall","_temp","_ref3","componentDidMount","layoutEvents","addListener","observe","attributes","componentWillUnmount","remove","disconnect","componentDidUpdate","prevProps","cancel","_this$getProps2","render","_this2","ThemeContext","Consumer","CommonWrapper","rootNodeRef","setRootNode","blur","React","__KONTUR_REACT_UI__","displayName","isTestEnv"],"sources":["Textarea.tsx"],"sourcesContent":["import type { AriaAttributes, ReactNode } from 'react';\nimport React from 'react';\nimport throttle from 'lodash.throttle';\nimport { globalObject } from '@skbkontur/global-object';\n\nimport { isKeyEnter } from '../../lib/events/keyboard/identifiers';\nimport { needsPolyfillPlaceholder } from '../../lib/needsPolyfillPlaceholder';\nimport * as LayoutEvents from '../../lib/LayoutEvents';\nimport type { Nullable, Override } from '../../typings/utility-types';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport type { Theme } from '../../lib/theming/Theme';\nimport { RenderLayer } from '../../internal/RenderLayer';\nimport { ResizeDetector } from '../../internal/ResizeDetector';\nimport { isIE11, isSafariWithTextareaBug } from '../../lib/client';\nimport type { CommonProps, CommonWrapperRestProps } from '../../internal/CommonWrapper';\nimport { CommonWrapper } from '../../internal/CommonWrapper';\nimport { isTestEnv } from '../../lib/currentEnvironment';\nimport { cx } from '../../lib/theming/Emotion';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode';\nimport { rootNode } from '../../lib/rootNode';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\nimport type { SizeProp } from '../../lib/types/props';\nimport type { InputAlign } from '../Input';\n\nimport { getTextAreaHeight } from './TextareaHelpers';\nimport { styles } from './Textarea.styles';\nimport type { TextareaCounterRef } from './TextareaCounter';\nimport { TextareaCounter } from './TextareaCounter';\nimport { TextareaWithSafari17Workaround } from './TextareaWithSafari17Workaround';\n\nexport const DEFAULT_WIDTH = 250;\nconst AUTORESIZE_THROTTLE_DEFAULT_WAIT = 100;\n\nexport interface TextareaProps\n extends Pick<AriaAttributes, 'aria-controls' | 'aria-label'>,\n CommonProps,\n Override<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n {\n /** Переводит контрол в состояние валидации \"ошибка\". */\n error?: boolean;\n\n /** Переводит контрол в состояние валидации \"предупреждение\". */\n warning?: boolean;\n\n /** Делает компонент недоступным. */\n disabled?: boolean;\n\n /** Задает размер компонента. */\n size?: SizeProp;\n\n /** Выполняет автоматический ресайз в зависимости от содержимого. */\n autoResize?: boolean;\n\n /** Задает высоту текстарии в виде числа строк видимых без скролла. */\n rows?: number;\n\n /** Задает максимальное число строк при автоматическом ресайзе. */\n maxRows?: string | number;\n\n /** Задает направления ресайза компонента.\n * Попадает в `style`. */\n resize?: React.CSSProperties['resize'];\n\n /** Задает ширину текстэрии. */\n width?: React.CSSProperties['width'];\n\n /** Задает функцию, которая вызывается при изменении `value`. */\n onValueChange?: (value: string) => void;\n\n /** Определяет, нужно ли выделять введенное значение при фокусе. Работает с типами text, password, tel, search, url. */\n selectAllOnFocus?: boolean;\n\n /** Определяет, нужно ли показывать счетчик символов. */\n showLengthCounter?: boolean;\n\n /** Задает допустимое количество символов в поле. Отображается в счетчике.\n * @default maxLength */\n lengthCounter?: number;\n\n /** Задает подсказку к счетчику символов.\n * По умолчанию - тултип с содержимым из пропа, если передан `ReactNode`.\n * Передав функцию, можно переопределить подсказку целиком, вместе с иконкой.\n * @example\n * ```\n * counterHelp={() => <Tooltip render={...}><HelpIcon /></Tooltip>}\n * ``` */\n counterHelp?: ReactNode | (() => ReactNode);\n\n /** Добавляет дополнительную свободную строку при авто-ресайзе.\n * @see https://guides.kontur.ru/components/textarea/#04 */\n extraRow?: boolean;\n\n /** Отключает анимацию при авто-ресайзе. Автоматически отключается когда в `extraRow` передан `false`. */\n disableAnimations?: boolean;\n /** Выравнивание текста */\n align?: InputAlign;\n }\n > {}\n\nexport interface TextareaState {\n needsPolyfillPlaceholder: boolean;\n isCounterVisible: boolean;\n}\n\nexport const TextareaDataTids = {\n root: 'Textarea__root',\n counter: 'TextareaCounter__root',\n helpIcon: 'TextareaCounter__helpIcon',\n} as const;\n\ntype DefaultProps = Required<Pick<TextareaProps, 'rows' | 'maxRows' | 'extraRow' | 'disableAnimations' | 'size'>>;\n\n/**\n * Многострочное поле `Textarea` — это поле ввода, которое позволяет работать с несколькими строками текста.\n *\n * Принимает все атрибуты `React.TextareaHTMLAttributes<HTMLTextAreaElement>`.\n * Пропы **`className` и `style` игнорируются**.\n */\n@rootNode\nexport class Textarea extends React.Component<TextareaProps, TextareaState> {\n public static __KONTUR_REACT_UI__ = 'Textarea';\n public static displayName = 'Textarea';\n\n public static defaultProps: DefaultProps = {\n rows: 3,\n maxRows: 15,\n extraRow: true,\n size: 'small',\n disableAnimations: isTestEnv,\n };\n\n public clear = () => {\n if (this.node) {\n this.node.value = '';\n }\n if (this.fakeNode) {\n this.fakeNode.value = '';\n }\n };\n\n private getProps = createPropsGetter(Textarea.defaultProps);\n\n private getRootSizeClassName() {\n switch (this.getProps().size) {\n case 'large':\n return styles.rootLarge(this.theme);\n case 'medium':\n return styles.rootMedium(this.theme);\n case 'small':\n default:\n return styles.rootSmall(this.theme);\n }\n }\n\n private getTextareaSizeClassName() {\n switch (this.getProps().size) {\n case 'large':\n return styles.textareaLarge(this.theme);\n case 'medium':\n return styles.textareaMedium(this.theme);\n case 'small':\n default:\n return styles.textareaSmall(this.theme);\n }\n }\n\n public state = {\n needsPolyfillPlaceholder,\n isCounterVisible: false,\n };\n private reflowCounter = () => {\n if (this.counter) {\n this.counter.reflow();\n }\n };\n\n private theme!: Theme;\n private selectAllId: number | null = null;\n private node: Nullable<HTMLTextAreaElement>;\n private fakeNode: Nullable<HTMLTextAreaElement>;\n private counter: Nullable<TextareaCounterRef>;\n private layoutEvents: Nullable<{ remove: () => void }>;\n private textareaObserver = globalObject.MutationObserver\n ? new globalObject.MutationObserver(this.reflowCounter)\n : null;\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n private getAutoResizeThrottleWait(props: TextareaProps = this.props): number {\n // NOTE: При отключении анимации остается эффект дергания при авто-ресайзе из-за троттлинга расчета высоты\n // Поэтому выставляем таймаут троттла в ноль. Подробности - https://github.com/skbkontur/retail-ui/issues/2120\n return this.isAnimationsDisabled(props) ? 0 : AUTORESIZE_THROTTLE_DEFAULT_WAIT;\n }\n private isAnimationsDisabled({ disableAnimations, extraRow }: TextareaProps = this.props): boolean {\n return disableAnimations || !extraRow;\n }\n\n public componentDidMount() {\n if (this.props.autoResize) {\n this.autoResize();\n this.layoutEvents = LayoutEvents.addListener(this.autoResize);\n }\n\n if (this.node && this.props.showLengthCounter && this.textareaObserver) {\n this.textareaObserver.observe(this.node, { attributes: true });\n }\n }\n\n public componentWillUnmount() {\n if (this.layoutEvents) {\n this.layoutEvents.remove();\n }\n if (this.props.showLengthCounter && this.textareaObserver) {\n this.textareaObserver.disconnect();\n }\n this.cancelDelayedSelectAll();\n }\n\n public componentDidUpdate(prevProps: TextareaProps) {\n if (this.getAutoResizeThrottleWait() !== this.getAutoResizeThrottleWait(prevProps)) {\n this.autoResize.cancel();\n this.autoResize = throttle(this.autoResizeHandler, this.getAutoResizeThrottleWait());\n }\n const { rows, maxRows } = this.getProps();\n if (\n this.props.autoResize &&\n (rows !== prevProps.rows || maxRows !== prevProps.maxRows || this.props.value !== prevProps.value)\n ) {\n this.autoResize();\n }\n }\n\n public render() {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.getProps()}>\n {this.renderMain}\n </CommonWrapper>\n );\n }}\n </ThemeContext.Consumer>\n );\n }\n\n /**\n * @public\n */\n public focus() {\n if (this.node) {\n this.node.focus();\n }\n }\n\n /**\n * @public\n */\n public blur() {\n if (this.node) {\n this.node.blur();\n }\n }\n\n /**\n * @public\n * @param {number} start\n * @param {number} end\n */\n public setSelectionRange = (start: number, end: number) => {\n if (!this.node) {\n throw new Error('Cannot call \"setSelectionRange\" on unmounted Input');\n }\n\n if (globalObject.document?.activeElement !== this.node) {\n this.focus();\n }\n\n this.node.setSelectionRange(start, end);\n };\n\n /**\n * @public\n */\n public selectAll = () => {\n if (this.node) {\n this.setSelectionRange(0, this.node.value.length);\n }\n };\n\n private delaySelectAll = (): number | null =>\n (this.selectAllId = globalObject.requestAnimationFrame?.(this.selectAll) ?? null);\n\n private cancelDelayedSelectAll = (): void => {\n if (this.selectAllId) {\n globalObject.cancelAnimationFrame?.(this.selectAllId);\n this.selectAllId = null;\n }\n };\n\n private renderMain = (props: CommonWrapperRestProps<TextareaProps>) => {\n const {\n width = DEFAULT_WIDTH,\n error,\n warning,\n size,\n autoResize,\n resize,\n onCut,\n onPaste,\n maxRows,\n onFocus,\n selectAllOnFocus,\n placeholder,\n onValueChange,\n showLengthCounter,\n lengthCounter,\n counterHelp,\n extraRow,\n disableAnimations,\n disabled,\n ...textareaProps\n } = props;\n\n const { isCounterVisible } = this.state;\n\n const rootProps = {\n style: {\n width,\n },\n };\n\n const textareaClassNames = cx(this.getTextareaSizeClassName(), {\n [styles.textarea(this.theme)]: true,\n [styles.hovering(this.theme)]: !error && !warning,\n [styles.disabled(this.theme)]: disabled,\n [styles.error(this.theme)]: !!error,\n [styles.warning(this.theme)]: !!warning,\n [styles.disableAnimations()]: this.isAnimationsDisabled(),\n });\n\n const textareaStyle = {\n resize: autoResize ? 'none' : resize,\n textAlign: this.props.align,\n };\n\n let placeholderPolyfill = null;\n\n if (this.state.needsPolyfillPlaceholder && !textareaProps.value && !textareaProps.defaultValue) {\n placeholderPolyfill = <span className={styles.placeholder()}>{placeholder}</span>;\n }\n\n let fakeTextarea = null;\n if (autoResize) {\n const fakeProps = {\n value: this.props.value,\n defaultValue: this.props.defaultValue,\n className: cx(textareaClassNames, styles.fake()),\n readOnly: true,\n };\n fakeTextarea = <textarea {...fakeProps} ref={this.refFake} />;\n }\n\n const counter = showLengthCounter && isCounterVisible && this.node && (\n <TextareaCounter\n textarea={this.node}\n size={this.getProps().size}\n help={counterHelp}\n value={textareaProps.value}\n length={textareaProps.maxLength ?? lengthCounter ?? 0}\n onCloseHelp={this.handleCloseCounterHelp}\n ref={this.refCounter}\n />\n );\n\n const Component = isSafariWithTextareaBug ? TextareaWithSafari17Workaround : 'textarea';\n\n return (\n <RenderLayer\n onFocusOutside={this.handleCloseCounterHelp}\n onClickOutside={this.handleCloseCounterHelp}\n active={this.state.isCounterVisible}\n >\n <label\n data-tid={TextareaDataTids.root}\n {...rootProps}\n className={cx(this.getRootSizeClassName(), {\n [styles.root()]: true,\n })}\n >\n {placeholderPolyfill}\n <ResizeDetector onResize={this.reflowCounter}>\n <Component\n {...textareaProps}\n className={textareaClassNames}\n style={textareaStyle}\n placeholder={!placeholderPolyfill ? placeholder : undefined}\n ref={this.ref}\n onChange={this.handleChange}\n onCut={this.handleCut}\n onPaste={this.handlePaste}\n onFocus={this.handleFocus}\n onKeyDown={this.handleKeyDown}\n disabled={disabled}\n >\n {this.props.children}\n </Component>\n </ResizeDetector>\n {fakeTextarea}\n {counter}\n </label>\n </RenderLayer>\n );\n };\n\n private handleCloseCounterHelp = () => this.setState({ isCounterVisible: false });\n\n private handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n // Edge bug: textarea maxlength doesn't work after new line\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/18833616/\n const value = this.props.value !== undefined ? this.props.value.toString() : null;\n const isBlockEnter = isKeyEnter(e) && value !== null && value.length === this.props.maxLength;\n\n if (isBlockEnter) {\n e.preventDefault();\n }\n\n if (this.props.onKeyDown) {\n this.props.onKeyDown(e);\n }\n };\n\n private handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (needsPolyfillPlaceholder) {\n const fieldIsEmpty = e.target.value === '';\n\n if (this.state.needsPolyfillPlaceholder !== fieldIsEmpty) {\n this.setState({ needsPolyfillPlaceholder: fieldIsEmpty });\n }\n }\n\n if (this.props.onValueChange) {\n this.props.onValueChange(e.target.value);\n }\n\n if (this.props.autoResize) {\n this.autoResize();\n }\n\n if (this.props.onChange) {\n this.props.onChange(e);\n }\n\n this.reflowCounter();\n };\n\n private ref = (element: HTMLTextAreaElement) => {\n this.node = element;\n };\n\n private refFake = (element: HTMLTextAreaElement) => {\n this.fakeNode = element;\n };\n\n private refCounter = (ref: TextareaCounterRef | null) => {\n this.counter = ref;\n };\n\n private autoResizeHandler = () => {\n const fakeNode = this.fakeNode;\n if (!fakeNode) {\n return;\n }\n const node = this.node;\n if (!node) {\n return;\n }\n if (this.props.value === undefined) {\n fakeNode.value = node.value;\n }\n\n const { rows, maxRows } = this.getProps();\n if (rows === undefined || maxRows === undefined) {\n return;\n }\n\n const { height, exceededMaxHeight } =\n getTextAreaHeight({\n node: fakeNode,\n minRows: typeof rows === 'number' ? rows : parseInt(rows, 10),\n maxRows: typeof maxRows === 'number' ? maxRows : parseInt(maxRows, 10),\n extraRow: this.getProps().extraRow,\n }) || {};\n\n if (height === undefined || exceededMaxHeight === undefined) {\n return;\n }\n\n node.style.height = height + 'px';\n node.style.overflowY = exceededMaxHeight ? 'scroll' : 'hidden';\n fakeNode.style.overflowY = exceededMaxHeight ? 'scroll' : 'hidden';\n };\n\n private autoResize = throttle(this.autoResizeHandler, this.getAutoResizeThrottleWait());\n\n private handleCut = (event: React.ClipboardEvent<HTMLTextAreaElement>) => {\n if (this.props.autoResize) {\n this.autoResize();\n }\n\n if (this.props.onCut) {\n this.props.onCut(event);\n }\n\n this.reflowCounter();\n };\n\n private handlePaste = (event: React.ClipboardEvent<HTMLTextAreaElement>) => {\n if (this.props.autoResize) {\n this.autoResize();\n }\n\n if (this.props.onPaste) {\n this.props.onPaste(event);\n }\n\n this.reflowCounter();\n };\n\n private handleFocus = (event: React.FocusEvent<HTMLTextAreaElement>) => {\n this.setState({ isCounterVisible: true });\n\n if (this.props.selectAllOnFocus) {\n // https://github.com/facebook/react/issues/7769\n this.node && !isIE11 ? this.selectAll() : this.delaySelectAll();\n }\n\n if (this.props.onFocus) {\n this.props.onFocus(event);\n }\n };\n}\n"],"mappings":";AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;;AAEA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,yBAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAC,uBAAA,CAAAN,OAAA;;AAEA,IAAAO,aAAA,GAAAP,OAAA;;AAEA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;;AAEA,IAAAW,cAAA,GAAAX,OAAA;AACA,IAAAY,mBAAA,GAAAZ,OAAA;AACA,IAAAa,QAAA,GAAAb,OAAA;;AAEA,IAAAc,SAAA,GAAAd,OAAA;AACA,IAAAe,kBAAA,GAAAf,OAAA;;;;AAIA,IAAAgB,gBAAA,GAAAhB,OAAA;AACA,IAAAiB,UAAA,GAAAjB,OAAA;;AAEA,IAAAkB,gBAAA,GAAAlB,OAAA;AACA,IAAAmB,+BAAA,GAAAnB,OAAA,qCAAkF,IAAAoB,SAAA,qQAAAC,MAAA,EAAAC,SAAA;;AAE3E,IAAMC,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,GAAG;AAChC,IAAME,gCAAgC,GAAG,GAAG;;;;;;;;;;;;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G,6BAAS,CAC9B,CAAC,EAAA1L,SAAA,MAAAD,MAAA","ignoreList":[]}
@@ -0,0 +1,58 @@
1
+ ### Базовый пример
2
+ ```jsx harmony
3
+ const [value, setValue] = React.useState('');
4
+
5
+ <Textarea
6
+ value={value}
7
+ onValueChange={setValue}
8
+ autoResize
9
+ placeholder="Through faith we can reign in every area of life"
10
+ />;
11
+ ```
12
+
13
+ ### Очистка значения
14
+ Очистить значение в `Textarea` можно только с помощью пустой строки
15
+
16
+ ```jsx harmony
17
+ import { Group, Button } from '@skbkontur/react-ui';
18
+
19
+ const [value, setValue] = React.useState('Значение');
20
+
21
+ <Group>
22
+ <Textarea
23
+ value={value}
24
+ onValueChange={setValue}
25
+ autoResize
26
+ rows={1}
27
+ placeholder="Плейсхолдер"
28
+ />
29
+ <Button style={{ height: '52px' }} onClick={() => setValue('')}>Очистить значение</Button>
30
+ </Group>
31
+ ```
32
+
33
+ ### Счетчик введенных символов
34
+
35
+ ```jsx harmony
36
+ const [value, setValue] = React.useState('');
37
+
38
+ <Textarea
39
+ value={value}
40
+ onValueChange={setValue}
41
+ placeholder="Счетчик появляется при фокусе"
42
+ lengthCounter={10}
43
+ showLengthCounter
44
+ counterHelp="Hello 👋"
45
+ />;
46
+ ```
47
+
48
+ ### Размер
49
+
50
+ ```jsx harmony
51
+ import { Gapped } from '@skbkontur/react-ui';
52
+
53
+ <Gapped vertical>
54
+ <Textarea size={'small'} value={'Маленький'} autoResize rows={1} />
55
+ <Textarea size={'medium'} value={'Средний'} autoResize rows={1} />
56
+ <Textarea size={'large'} value={'Большой'} autoResize rows={1} />
57
+ </Gapped>
58
+ ```
@@ -27,7 +27,8 @@ var styles = exports.styles = (0, _Emotion.memoizeStyle)({
27
27
  },
28
28
 
29
29
  textarea: function textarea(t) {
30
- return (0, _Emotion.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteralLoose2.default)(["\n -webkit-appearance: none;\n background: ", ";\n background-clip: ", ";\n border: ", " solid ", ";\n border-top-color: ", ";\n box-shadow: ", ";\n box-sizing: border-box;\n color: ", ";\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n max-width: 100%;\n min-width: ", ";\n outline: none;\n transition:\n border-color ", " ", ",\n height 0.2s ease-out;\n vertical-align: middle;\n width: 100%;\n border-radius: ", ";\n white-space: pre-wrap;\n\n &:focus {\n border-color: ", ";\n box-shadow: 0 0 0 ", " ", ";\n position: relative;\n z-index: 2;\n\n &::placeholder {\n color: ", ";\n }\n }\n\n &::placeholder {\n color: ", ";\n }\n\n &:-moz-placeholder {\n color: ", ";\n }\n\n &::-moz-placeholder {\n color: ", ";\n }\n "])),
30
+ return (0, _Emotion.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteralLoose2.default)(["\n margin: ", ";\n -webkit-appearance: none;\n background: ", ";\n background-clip: ", ";\n border: ", " solid ", ";\n border-top-color: ", ";\n box-shadow: ", ";\n box-sizing: border-box;\n color: ", ";\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n max-width: 100%;\n min-width: ", ";\n outline: none;\n transition:\n border-color ", " ", ",\n height 0.2s ease-out;\n vertical-align: middle;\n width: 100%;\n border-radius: ", ";\n white-space: pre-wrap;\n\n &:focus {\n border-color: ", ";\n box-shadow: 0 0 0 ", " ", ";\n position: relative;\n z-index: 2;\n\n &::placeholder {\n color: ", ";\n }\n }\n\n &::placeholder {\n color: ", ";\n }\n\n &:-moz-placeholder {\n color: ", ";\n }\n\n &::-moz-placeholder {\n color: ", ";\n }\n "])),
31
+ t.textareaMargin,
31
32
 
32
33
  t.textareaBg,
33
34
  t.textareaBackgroundClip,
@@ -1 +1 @@
1
- {"version":3,"names":["_Emotion","require","_Textarea","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_templateObject12","_templateObject13","_templateObject14","_templateObject15","_templateObject16","_templateObject17","_templateObject18","_templateObject19","_templateObject20","_templateObject21","_templateObject22","styles","exports","memoizeStyle","root","css","_taggedTemplateLiteralLoose2","default","rootSmall","t","rootTextareaSizeMixin","textareaFontSizeSmall","textareaLineHeightSmall","rootMedium","textareaFontSizeMedium","textareaLineHeightMedium","rootLarge","textareaFontSizeLarge","textareaLineHeightLarge","textarea","textareaBg","textareaBackgroundClip","textareaBorderWidth","textareaBorderColor","textareaBorderTopColor","textareaShadow","textareaColor","textareaWidth","transitionDuration","transitionTimingFunction","textareaBorderRadius","textareaBorderColorFocus","textareaOutlineWidth","textareaPlaceholderColorLight","textareaPlaceholderColor","textareaSmall","textareaSizeMixin","textareaPaddingYSmall","textareaPaddingXSmall","textareaMinHeightSmall","textareaMedium","textareaPaddingYMedium","textareaPaddingXMedium","textareaMinHeightMedium","textareaLarge","textareaPaddingYLarge","textareaPaddingXLarge","textareaMinHeightLarge","hovering","textareaBorderColorHover","error","textareaBorderColorError","warning","textareaBorderColorWarning","disabled","textareaTextColorDisabled","textareaDisabledBg","textareaDisabledBorderColor","textareaPlaceholderColorDisabled","fake","placeholder","counterContainer","counter","textareaCounterBg","textareaCounterColor","counterSmall","counterSizeMixin","counterMedium","counterLarge","counterError","textareaCounterErrorColor","counterHelp","disableAnimations"],"sources":["Textarea.styles.ts"],"sourcesContent":["import { css, memoizeStyle } from '../../lib/theming/Emotion';\nimport type { Theme } from '../../lib/theming/Theme';\n\nimport { counterSizeMixin, rootTextareaSizeMixin, textareaSizeMixin } from './Textarea.mixins';\n\nexport const styles = memoizeStyle({\n root() {\n return css`\n display: inline-block;\n position: relative;\n `;\n },\n rootSmall(t: Theme) {\n return css`\n ${rootTextareaSizeMixin(t.textareaFontSizeSmall, t.textareaLineHeightSmall)};\n `;\n },\n rootMedium(t: Theme) {\n return css`\n ${rootTextareaSizeMixin(t.textareaFontSizeMedium, t.textareaLineHeightMedium)};\n `;\n },\n rootLarge(t: Theme) {\n return css`\n ${rootTextareaSizeMixin(t.textareaFontSizeLarge, t.textareaLineHeightLarge)};\n `;\n },\n\n textarea(t: Theme) {\n return css`\n -webkit-appearance: none;\n background: ${t.textareaBg};\n background-clip: ${t.textareaBackgroundClip};\n border: ${t.textareaBorderWidth} solid ${t.textareaBorderColor};\n border-top-color: ${t.textareaBorderTopColor};\n box-shadow: ${t.textareaShadow};\n box-sizing: border-box;\n color: ${t.textareaColor};\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n max-width: 100%;\n min-width: ${t.textareaWidth};\n outline: none;\n transition:\n border-color ${t.transitionDuration} ${t.transitionTimingFunction},\n height 0.2s ease-out;\n vertical-align: middle;\n width: 100%;\n border-radius: ${t.textareaBorderRadius};\n white-space: pre-wrap;\n\n &:focus {\n border-color: ${t.textareaBorderColorFocus};\n box-shadow: 0 0 0 ${t.textareaOutlineWidth} ${t.textareaBorderColorFocus};\n position: relative;\n z-index: 2;\n\n &::placeholder {\n color: ${t.textareaPlaceholderColorLight};\n }\n }\n\n &::placeholder {\n color: ${t.textareaPlaceholderColor};\n }\n\n &:-moz-placeholder {\n color: ${t.textareaPlaceholderColor};\n }\n\n &::-moz-placeholder {\n color: ${t.textareaPlaceholderColor};\n }\n `;\n },\n textareaSmall(t: Theme) {\n return css`\n ${textareaSizeMixin(t.textareaPaddingYSmall, t.textareaPaddingXSmall, t.textareaMinHeightSmall)};\n `;\n },\n textareaMedium(t: Theme) {\n return css`\n ${textareaSizeMixin(t.textareaPaddingYMedium, t.textareaPaddingXMedium, t.textareaMinHeightMedium)};\n `;\n },\n textareaLarge(t: Theme) {\n return css`\n ${textareaSizeMixin(t.textareaPaddingYLarge, t.textareaPaddingXLarge, t.textareaMinHeightLarge)};\n `;\n },\n\n hovering(t: Theme) {\n return css`\n &:enabled:hover:not(:focus) {\n border-color: ${t.textareaBorderColorHover};\n }\n `;\n },\n\n error(t: Theme) {\n return css`\n border-color: ${t.textareaBorderColorError};\n box-shadow: 0 0 0 ${t.textareaBorderWidth} ${t.textareaBorderColorError};\n\n &:focus {\n border-color: ${t.textareaBorderColorError};\n box-shadow: 0 0 0 ${t.textareaOutlineWidth} ${t.textareaBorderColorError};\n }\n `;\n },\n\n warning(t: Theme) {\n return css`\n border-color: ${t.textareaBorderColorWarning};\n box-shadow: 0 0 0 ${t.textareaOutlineWidth} ${t.textareaBorderColorWarning};\n\n &:focus {\n border-color: ${t.textareaBorderColorWarning};\n box-shadow: 0 0 0 ${t.textareaOutlineWidth} ${t.textareaBorderColorWarning};\n }\n `;\n },\n\n disabled(t: Theme) {\n return css`\n color: ${t.textareaTextColorDisabled};\n background: ${t.textareaDisabledBg};\n border-color: ${t.textareaDisabledBorderColor};\n box-shadow: none;\n\n &::placeholder {\n color: ${t.textareaPlaceholderColorDisabled};\n }\n `;\n },\n\n fake() {\n return css`\n height: 0;\n left: 0;\n position: absolute;\n top: 0;\n visibility: hidden;\n width: 100%;\n `;\n },\n\n placeholder() {\n return css`\n -ms-user-select: none;\n color: #aaa;\n left: 12px;\n overflow: hidden;\n position: absolute;\n right: 12px;\n top: 9px;\n user-select: none;\n z-index: 3;\n `;\n },\n\n counterContainer(t: Theme) {\n return css`\n position: absolute;\n top: 0;\n border: ${t.textareaBorderWidth} solid transparent;\n box-sizing: content-box;\n `;\n },\n\n counter(t: Theme) {\n return css`\n position: absolute;\n z-index: 3;\n text-align: right;\n background: ${t.textareaCounterBg};\n color: ${t.textareaCounterColor};\n border-radius: 2px;\n `;\n },\n counterSmall(t: Theme) {\n return css`\n ${counterSizeMixin(t.textareaPaddingYSmall, t.textareaPaddingXSmall)};\n `;\n },\n counterMedium(t: Theme) {\n return css`\n ${counterSizeMixin(t.textareaPaddingYMedium, t.textareaPaddingXMedium)};\n `;\n },\n counterLarge(t: Theme) {\n return css`\n ${counterSizeMixin(t.textareaPaddingYLarge, t.textareaPaddingXLarge)};\n `;\n },\n\n counterError(t: Theme) {\n return css`\n color: ${t.textareaCounterErrorColor};\n `;\n },\n\n counterHelp() {\n return css`\n margin-left: 4px;\n cursor: pointer;\n `;\n },\n\n disableAnimations() {\n return css`\n transition: none;\n `;\n },\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,KAAAA,iBAAA,OAAAS,4BAAA,CAAAC,OAAA;IACN,IAAA2D,0BAAgB,EAACzD,CAAC,CAACoC,qBAAqB,EAAEpC,CAAC,CAACqC,qBAAqB,CAAC;;EAExE,CAAC;;EAEDuB,YAAY,WAAAA,aAAC5D,CAAQ,EAAE;IACrB,WAAOJ,YAAG,EAAAP,iBAAA,KAAAA,iBAAA,OAAAQ,4BAAA,CAAAC,OAAA;IACCE,CAAC,CAAC6D,yBAAyB;;EAExC,CAAC;;EAEDC,WAAW,WAAAA,YAAA,EAAG;IACZ,WAAOlE,YAAG,EAAAN,iBAAA,KAAAA,iBAAA,OAAAO,4BAAA,CAAAC,OAAA;;;;EAIZ,CAAC;;EAEDiE,iBAAiB,WAAAA,kBAAA,EAAG;IAClB,WAAOnE,YAAG,EAAAL,iBAAA,KAAAA,iBAAA,OAAAM,4BAAA,CAAAC,OAAA;;;EAGZ;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_Emotion","require","_Textarea","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_templateObject12","_templateObject13","_templateObject14","_templateObject15","_templateObject16","_templateObject17","_templateObject18","_templateObject19","_templateObject20","_templateObject21","_templateObject22","styles","exports","memoizeStyle","root","css","_taggedTemplateLiteralLoose2","default","rootSmall","t","rootTextareaSizeMixin","textareaFontSizeSmall","textareaLineHeightSmall","rootMedium","textareaFontSizeMedium","textareaLineHeightMedium","rootLarge","textareaFontSizeLarge","textareaLineHeightLarge","textarea","textareaMargin","textareaBg","textareaBackgroundClip","textareaBorderWidth","textareaBorderColor","textareaBorderTopColor","textareaShadow","textareaColor","textareaWidth","transitionDuration","transitionTimingFunction","textareaBorderRadius","textareaBorderColorFocus","textareaOutlineWidth","textareaPlaceholderColorLight","textareaPlaceholderColor","textareaSmall","textareaSizeMixin","textareaPaddingYSmall","textareaPaddingXSmall","textareaMinHeightSmall","textareaMedium","textareaPaddingYMedium","textareaPaddingXMedium","textareaMinHeightMedium","textareaLarge","textareaPaddingYLarge","textareaPaddingXLarge","textareaMinHeightLarge","hovering","textareaBorderColorHover","error","textareaBorderColorError","warning","textareaBorderColorWarning","disabled","textareaTextColorDisabled","textareaDisabledBg","textareaDisabledBorderColor","textareaPlaceholderColorDisabled","fake","placeholder","counterContainer","counter","textareaCounterBg","textareaCounterColor","counterSmall","counterSizeMixin","counterMedium","counterLarge","counterError","textareaCounterErrorColor","counterHelp","disableAnimations"],"sources":["Textarea.styles.ts"],"sourcesContent":["import { css, memoizeStyle } from '../../lib/theming/Emotion';\nimport type { Theme } from '../../lib/theming/Theme';\n\nimport { counterSizeMixin, rootTextareaSizeMixin, textareaSizeMixin } from './Textarea.mixins';\n\nexport const styles = memoizeStyle({\n root() {\n return css`\n display: inline-block;\n position: relative;\n `;\n },\n rootSmall(t: Theme) {\n return css`\n ${rootTextareaSizeMixin(t.textareaFontSizeSmall, t.textareaLineHeightSmall)};\n `;\n },\n rootMedium(t: Theme) {\n return css`\n ${rootTextareaSizeMixin(t.textareaFontSizeMedium, t.textareaLineHeightMedium)};\n `;\n },\n rootLarge(t: Theme) {\n return css`\n ${rootTextareaSizeMixin(t.textareaFontSizeLarge, t.textareaLineHeightLarge)};\n `;\n },\n\n textarea(t: Theme) {\n return css`\n margin: ${t.textareaMargin};\n -webkit-appearance: none;\n background: ${t.textareaBg};\n background-clip: ${t.textareaBackgroundClip};\n border: ${t.textareaBorderWidth} solid ${t.textareaBorderColor};\n border-top-color: ${t.textareaBorderTopColor};\n box-shadow: ${t.textareaShadow};\n box-sizing: border-box;\n color: ${t.textareaColor};\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n max-width: 100%;\n min-width: ${t.textareaWidth};\n outline: none;\n transition:\n border-color ${t.transitionDuration} ${t.transitionTimingFunction},\n height 0.2s ease-out;\n vertical-align: middle;\n width: 100%;\n border-radius: ${t.textareaBorderRadius};\n white-space: pre-wrap;\n\n &:focus {\n border-color: ${t.textareaBorderColorFocus};\n box-shadow: 0 0 0 ${t.textareaOutlineWidth} ${t.textareaBorderColorFocus};\n position: relative;\n z-index: 2;\n\n &::placeholder {\n color: ${t.textareaPlaceholderColorLight};\n }\n }\n\n &::placeholder {\n color: ${t.textareaPlaceholderColor};\n }\n\n &:-moz-placeholder {\n color: ${t.textareaPlaceholderColor};\n }\n\n &::-moz-placeholder {\n color: ${t.textareaPlaceholderColor};\n }\n `;\n },\n textareaSmall(t: Theme) {\n return css`\n ${textareaSizeMixin(t.textareaPaddingYSmall, t.textareaPaddingXSmall, t.textareaMinHeightSmall)};\n `;\n },\n textareaMedium(t: Theme) {\n return css`\n ${textareaSizeMixin(t.textareaPaddingYMedium, t.textareaPaddingXMedium, t.textareaMinHeightMedium)};\n `;\n },\n textareaLarge(t: Theme) {\n return css`\n ${textareaSizeMixin(t.textareaPaddingYLarge, t.textareaPaddingXLarge, t.textareaMinHeightLarge)};\n `;\n },\n\n hovering(t: Theme) {\n return css`\n &:enabled:hover:not(:focus) {\n border-color: ${t.textareaBorderColorHover};\n }\n `;\n },\n\n error(t: Theme) {\n return css`\n border-color: ${t.textareaBorderColorError};\n box-shadow: 0 0 0 ${t.textareaBorderWidth} ${t.textareaBorderColorError};\n\n &:focus {\n border-color: ${t.textareaBorderColorError};\n box-shadow: 0 0 0 ${t.textareaOutlineWidth} ${t.textareaBorderColorError};\n }\n `;\n },\n\n warning(t: Theme) {\n return css`\n border-color: ${t.textareaBorderColorWarning};\n box-shadow: 0 0 0 ${t.textareaOutlineWidth} ${t.textareaBorderColorWarning};\n\n &:focus {\n border-color: ${t.textareaBorderColorWarning};\n box-shadow: 0 0 0 ${t.textareaOutlineWidth} ${t.textareaBorderColorWarning};\n }\n `;\n },\n\n disabled(t: Theme) {\n return css`\n color: ${t.textareaTextColorDisabled};\n background: ${t.textareaDisabledBg};\n border-color: ${t.textareaDisabledBorderColor};\n box-shadow: none;\n\n &::placeholder {\n color: ${t.textareaPlaceholderColorDisabled};\n }\n `;\n },\n\n fake() {\n return css`\n height: 0;\n left: 0;\n position: absolute;\n top: 0;\n visibility: hidden;\n width: 100%;\n `;\n },\n\n placeholder() {\n return css`\n -ms-user-select: none;\n color: #aaa;\n left: 12px;\n overflow: hidden;\n position: absolute;\n right: 12px;\n top: 9px;\n user-select: none;\n z-index: 3;\n `;\n },\n\n counterContainer(t: Theme) {\n return css`\n position: absolute;\n top: 0;\n border: ${t.textareaBorderWidth} solid transparent;\n box-sizing: content-box;\n `;\n },\n\n counter(t: Theme) {\n return css`\n position: absolute;\n z-index: 3;\n text-align: right;\n background: ${t.textareaCounterBg};\n color: ${t.textareaCounterColor};\n border-radius: 2px;\n `;\n },\n counterSmall(t: Theme) {\n return css`\n ${counterSizeMixin(t.textareaPaddingYSmall, t.textareaPaddingXSmall)};\n `;\n },\n counterMedium(t: Theme) {\n return css`\n ${counterSizeMixin(t.textareaPaddingYMedium, t.textareaPaddingXMedium)};\n `;\n },\n counterLarge(t: Theme) {\n return css`\n ${counterSizeMixin(t.textareaPaddingYLarge, t.textareaPaddingXLarge)};\n `;\n },\n\n counterError(t: Theme) {\n return css`\n color: ${t.textareaCounterErrorColor};\n `;\n },\n\n counterHelp() {\n return css`\n margin-left: 4px;\n cursor: pointer;\n `;\n },\n\n disableAnimations() {\n return css`\n transition: none;\n `;\n },\n});\n"],"mappings":"oRAAA,IAAAA,QAAA,GAAAC,OAAA;;;AAGA,IAAAC,SAAA,GAAAD,OAAA,sBAA+F,IAAAE,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAA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N,iBAAA,KAAAA,iBAAA,OAAAO,4BAAA,CAAAC,OAAA;;;;EAIZ,CAAC;;EAEDkE,iBAAiB,WAAAA,kBAAA,EAAG;IAClB,WAAOpE,YAAG,EAAAL,iBAAA,KAAAA,iBAAA,OAAAM,4BAAA,CAAAC,OAAA;;;EAGZ;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,69 @@
1
+ ### Вызов статических методов
2
+
3
+ ```jsx harmony
4
+ import { Button, Toast } from '@skbkontur/react-ui';
5
+
6
+ function showComplexNotification() {
7
+ Toast.push('Successfully saved', {
8
+ label: 'Cancel',
9
+ handler: () => Toast.push('Canceled'),
10
+ });
11
+ }
12
+
13
+ <Button onClick={showComplexNotification}>Show notification</Button>;
14
+ ```
15
+
16
+ ### Кастомный showTime
17
+
18
+ ```jsx harmony
19
+ import { Button, Toast } from '@skbkontur/react-ui';
20
+
21
+ function showComplexNotification() {
22
+ Toast.push('Successfully saved', {
23
+ label: 'Cancel',
24
+ handler: () => Toast.push('Canceled'),
25
+ }, 15000);
26
+ }
27
+
28
+ <Button onClick={showComplexNotification}>Show notification</Button>;
29
+ ```
30
+
31
+ ### Кастомный showTime без action
32
+
33
+
34
+ ```jsx harmony
35
+ import { Button, Toast } from '@skbkontur/react-ui';
36
+
37
+ function showComplexNotification() {
38
+ Toast.push('Successfully saved', null, 15000);
39
+ }
40
+
41
+ <Button onClick={showComplexNotification}>Show notification</Button>;
42
+ ```
43
+
44
+ ### Использование `ref`
45
+
46
+ ```jsx harmony
47
+ import { Button, Toast } from '@skbkontur/react-ui';
48
+
49
+ class Toaster extends React.Component {
50
+ showNotification() {
51
+ this.notifier.push('Successfully');
52
+ }
53
+
54
+ render() {
55
+ return (
56
+ <div>
57
+ <Toast
58
+ ref={el => {
59
+ this.notifier = el;
60
+ }}
61
+ />
62
+ <Button onClick={() => this.showNotification()}>Show notification</Button>
63
+ </div>
64
+ );
65
+ }
66
+ }
67
+
68
+ <Toaster />;
69
+ ```