@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
package/CHANGELOG.md CHANGED
@@ -3,36 +3,6 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [5.3.3](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@5.3.2...@skbkontur/react-ui@5.3.3) (2025-09-22)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * **Tooltip:** fix incorrect import ([58206c9](https://github.com/skbkontur/retail-ui/commit/58206c91875e3180180be91800e302031b1b3266))
12
-
13
-
14
-
15
-
16
-
17
- ## [5.3.2](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@5.3.1...@skbkontur/react-ui@5.3.2) (2025-09-10)
18
-
19
- **Note:** Version bump only for package @skbkontur/react-ui
20
-
21
-
22
-
23
-
24
-
25
- ## [5.3.1](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@5.3.0...@skbkontur/react-ui@5.3.1) (2025-09-01)
26
-
27
-
28
- ### Bug Fixes
29
-
30
- * **select:** fix pass empty placeholder ([eb5b0ed](https://github.com/skbkontur/retail-ui/commit/eb5b0ed94c5133ab4a0a461ca656512583c292ff))
31
-
32
-
33
-
34
-
35
-
36
6
  # [5.3.0](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@5.2.1...@skbkontur/react-ui@5.3.0) (2025-08-25)
37
7
 
38
8
 
@@ -0,0 +1,113 @@
1
+ ### Базовый пример
2
+ ```jsx harmony
3
+ import { Autocomplete } from '@skbkontur/react-ui';
4
+
5
+ const items = ['Grey Face', 'Grey Space', 'Kappa', 'Keepo', 'Resident Sleeper'];
6
+
7
+ const [value, setValue] = React.useState('Kappa');
8
+
9
+ <Autocomplete source={items} value={value} onValueChange={setValue} />;
10
+ ```
11
+
12
+ ### Очистка Autocomplete
13
+ Очистить значение в `Autocomplete` можно только с помощью пустой строки.
14
+ ```jsx harmony
15
+ import { Autocomplete, Button, Group } from '@skbkontur/react-ui';
16
+
17
+ const items = ['Grey Face', 'Grey Space', 'Kappa', 'Keepo', 'Resident Sleeper'];
18
+
19
+ const [value, setValue] = React.useState('Kappa');
20
+
21
+ <Group>
22
+ <Autocomplete source={items} value={value} onValueChange={setValue} />
23
+ <Button onClick={() => setValue('')}>Очистить</Button>
24
+ </Group>
25
+ ```
26
+
27
+ ### Размер
28
+ ```jsx harmony
29
+ import { Autocomplete, Gapped } from '@skbkontur/react-ui';
30
+
31
+ const items = ['Маленький', 'Средний', 'Большой'];
32
+
33
+ const [valueSmall, setValueSmall] = React.useState('Маленький');
34
+ const [valueMedium, setValueMedium] = React.useState('Средний');
35
+ const [valueLarge, setValueLarge] = React.useState('Большой');
36
+
37
+ <Gapped vertical>
38
+ <Autocomplete source={items} value={valueSmall} onValueChange={setValueSmall} size={'small'} />
39
+ <Autocomplete source={items} value={valueMedium} onValueChange={setValueMedium} size={'medium'} />
40
+ <Autocomplete source={items} value={valueLarge} onValueChange={setValueLarge} size={'large'} />
41
+ </Gapped>
42
+ ```
43
+
44
+ ### Выделение введеного значения при фокусе
45
+ ```jsx harmony
46
+ import { Autocomplete } from '@skbkontur/react-ui';
47
+
48
+ const items = ['Grey Face', 'Grey Space', 'Kappa', 'Keepo', 'Resident Sleeper'];
49
+
50
+ const [value, setValue] = React.useState('');
51
+
52
+ <Autocomplete source={items} value={value} onValueChange={setValue} selectAllOnFocus />
53
+ ```
54
+
55
+ ### Иконка
56
+ ```jsx harmony
57
+ import { Autocomplete, Gapped } from '@skbkontur/react-ui';
58
+ import { SearchLoupeIcon16Regular } from '@skbkontur/icons/SearchLoupeIcon16Regular';
59
+
60
+ const items = ['Grey Face', 'Grey Space', 'Kappa', 'Keepo', 'Resident Sleeper'];
61
+
62
+ const [valueLeft, setValueLeft] = React.useState('');
63
+ const [valueRight, setValueRight] = React.useState('');
64
+
65
+ <Gapped>
66
+ <Autocomplete source={items} value={valueLeft} onValueChange={setValueLeft} leftIcon={<SearchLoupeIcon16Regular />} />
67
+ <Autocomplete source={items} value={valueRight} onValueChange={setValueRight} rightIcon={<SearchLoupeIcon16Regular />} />
68
+ </Gapped>
69
+ ```
70
+
71
+ ### Ширина меню
72
+ ```jsx harmony
73
+ import { Autocomplete } from '@skbkontur/react-ui';
74
+
75
+ const items = ['Grey Face', 'Grey Space', 'Kappa', 'Keepo', 'Resident Sleeper'];
76
+
77
+ const [value, setValue] = React.useState('');
78
+
79
+ <Autocomplete source={items} value={value} onValueChange={setValue} menuWidth={'80%'} />
80
+ ```
81
+
82
+ ### Расположение выпадающего окна Autocomplete
83
+ ```jsx harmony
84
+ import { Autocomplete } from '@skbkontur/react-ui';
85
+
86
+ const items = ['Grey Face', 'Grey Space', 'Kappa', 'Keepo', 'Resident Sleeper'];
87
+
88
+ const [value, setValue] = React.useState('');
89
+
90
+ <Autocomplete source={items} value={value} onValueChange={setValue} menuPos={'top'} />
91
+ ```
92
+
93
+ ### Тень у выпадающего меню
94
+ ```jsx harmony
95
+ import { Autocomplete } from '@skbkontur/react-ui';
96
+
97
+ const items = ['Grey Face', 'Grey Space', 'Kappa', 'Keepo', 'Resident Sleeper'];
98
+
99
+ const [value, setValue] = React.useState('');
100
+
101
+ <Autocomplete source={items} value={value} onValueChange={setValue} hasShadow />
102
+ ```
103
+
104
+ ### Режима прозрачной рамки
105
+ ```jsx harmony
106
+ import { Autocomplete } from '@skbkontur/react-ui';
107
+
108
+ const items = ['Grey Face', 'Grey Space', 'Kappa', 'Keepo', 'Resident Sleeper'];
109
+
110
+ const [value, setValue] = React.useState('Kappa');
111
+
112
+ <Autocomplete source={items} value={value} onValueChange={setValue} borderless />
113
+ ```
@@ -0,0 +1,261 @@
1
+ ### Базовый пример
2
+ По умолчанию, кнопка принимает все пропы `HTMLButtonElement`.
3
+
4
+ ```jsx harmony
5
+ import { Button } from '@skbkontur/react-ui';
6
+
7
+ <Button onClick={alert} name="report">Создать отчёт</Button>;
8
+ ```
9
+
10
+ ### Корневой компонент
11
+ Кнопка может рендерить ссылку в качестве корневого элемента, c помощью пропа `component`. Кнопка принимает все пропы переданного в `component` компонента.
12
+
13
+ ```jsx harmony
14
+ import { Button } from '@skbkontur/react-ui';
15
+
16
+ <Button component='a' href='https://kontur.ru' target="_blank">Ссылка, но выглядит как кнопка</Button>
17
+ ```
18
+
19
+ ### Различные стили
20
+
21
+ ```jsx harmony
22
+ import { Gapped } from '@skbkontur/react-ui';
23
+
24
+ const bgStyle = {
25
+ backgroundImage: `linear-gradient(to right, rgba(130, 130, 130, 0.5) 1px, transparent 1px),
26
+ linear-gradient(to bottom, rgba(130, 130, 130, 0.5) 1px, transparent 1px)`,
27
+ backgroundSize: `16px 16px`,
28
+ backgroundPosition: `-8px -8px`,
29
+ padding: 16
30
+ };
31
+
32
+ <Gapped vertical>
33
+ <Gapped>
34
+ <Button use="default">Default</Button>
35
+ <Button use="primary">Primary</Button>
36
+ <Button use="success">Success</Button>
37
+ <Button use="danger">Danger</Button>
38
+ <Button use="pay">Pay</Button>
39
+ <Button use="text">Text</Button>
40
+ <Button use="backless">Backless</Button>
41
+ <Button use="link">Link</Button>
42
+ </Gapped>
43
+ <Gapped style={bgStyle}>
44
+ <Button use="default">Default</Button>
45
+ <Button use="primary">Primary</Button>
46
+ <Button use="success">Success</Button>
47
+ <Button use="danger">Danger</Button>
48
+ <Button use="pay">Pay</Button>
49
+ <Button use="text">Text</Button>
50
+ <Button use="backless">Backless</Button>
51
+ <Button use="link">Link</Button>
52
+ </Gapped>
53
+ </Gapped>
54
+ ```
55
+
56
+ ### Иконка
57
+ В кнопку можно передать иконку. Иконка может находиться как слева от текста кнопки, так и справа и даже в обоих позициях одновременно.
58
+
59
+ ```jsx harmony
60
+ import { Button, Gapped } from '@skbkontur/react-ui';
61
+ import { XIcon16Regular } from '@skbkontur/icons/XIcon16Regular';
62
+
63
+ <Gapped gap={5}>
64
+ <Button icon={<XIcon16Regular />}>Закрыть</Button>
65
+ <Button icon={<XIcon16Regular />} rightIcon={<XIcon16Regular />}>Закрыть</Button>
66
+ <Button rightIcon={<XIcon16Regular />}>Закрыть</Button>
67
+ </Gapped>
68
+ ```
69
+
70
+ ### Размер
71
+
72
+ ```jsx harmony
73
+ <div
74
+ style={{
75
+ display: "flex",
76
+ alignItems: "end",
77
+ gap: '10px',
78
+ }}
79
+ >
80
+ <Button size="small">Маленькая</Button>
81
+ <Button size="medium">Средняя</Button>
82
+ <Button size="large">Большая</Button>
83
+ </div>
84
+ ```
85
+
86
+ ### Ширина
87
+
88
+ ```jsx harmony
89
+ <Button width={40}>Закрыть</Button>
90
+ ```
91
+
92
+ ### Состояние валидации
93
+
94
+ ```jsx harmony
95
+ import { Gapped, Button } from '@skbkontur/react-ui';
96
+ <Gapped gap={5}>
97
+ <Button warning>Закрыть</Button>
98
+ <Button error>Закрыть</Button>
99
+ </Gapped>
100
+ ```
101
+
102
+ ### Стрелка
103
+
104
+ ```jsx harmony
105
+ import { Gapped, Button } from '@skbkontur/react-ui';
106
+
107
+ <Gapped gap={5}>
108
+ <Button arrow="left" size="medium">
109
+ Назад
110
+ </Button>
111
+ <Button arrow size="medium">
112
+ Далее
113
+ </Button>
114
+ </Gapped>
115
+ ```
116
+
117
+ ### Состояние загрузки
118
+
119
+ **Поведение:**
120
+ Кнопка на время нахождения в состоянии загрузки отключается.
121
+ Если в кнопке есть иконка, на время загрузки иконка заменяется на спиннер, если иконки нет — весь контент кнопки заменяется на спиннер. Когда иконки две — заменяется только левая.
122
+
123
+ ```jsx harmony
124
+ import { Button, Gapped } from '@skbkontur/react-ui';
125
+ import { MinusCircleIcon16Light } from '@skbkontur/icons/MinusCircleIcon16Light';
126
+
127
+ const [loading, setLoading] = React.useState(false);
128
+
129
+ const delay = time => args => new Promise(resolve => setTimeout(resolve, time, args));
130
+
131
+ const handleLoadingStart = () => {
132
+ delay(2000)()
133
+ .then(() => {
134
+ setLoading(false);
135
+ })
136
+ };
137
+
138
+ const handleClick = () => {
139
+ setLoading(true);
140
+ handleLoadingStart();
141
+ };
142
+
143
+ <Gapped>
144
+ <Button width={150} onClick={handleClick} loading={loading}>
145
+ Удалить
146
+ </Button>
147
+ <Button icon={<MinusCircleIcon16Light />} width={150} onClick={handleClick} loading={loading}>
148
+ Удалить
149
+ </Button>
150
+ <Button rightIcon={<MinusCircleIcon16Light />} width={150} onClick={handleClick} loading={loading}>
151
+ Удалить
152
+ </Button>
153
+ <Button icon={<MinusCircleIcon16Light />} rightIcon={<MinusCircleIcon16Light />} width={150} onClick={handleClick} loading={loading}>
154
+ Удалить
155
+ </Button>
156
+ </Gapped>
157
+
158
+ ```
159
+
160
+ ### Проп темы
161
+
162
+ ```jsx harmony
163
+ import { Button, Gapped } from '@skbkontur/react-ui';
164
+
165
+ <Gapped>
166
+ <Button theme={{textColorDefault: '#C00000'}}>Ok</Button>
167
+ <Button use="link" theme={{linkColor: '#C00000'}}>Ok</Button>
168
+ <Button>Ok</Button>
169
+ </Gapped>
170
+ ```
171
+
172
+ ### Кастомизация кнопки-ссылки
173
+
174
+ ```jsx harmony
175
+ import { Toast } from "@skbkontur/react-ui";
176
+ import { CopyIcon16Regular } from "@skbkontur/icons/CopyIcon16Regular"
177
+
178
+ const textDecorationStyles = {
179
+ btnLinkTextUnderlineOffset: '1px',
180
+ }
181
+
182
+ const underlineOnHoverStyles = {
183
+ btnLinkTextDecorationColor: 'transparent',
184
+ }
185
+
186
+ const differentColorStyles = {
187
+ btnLinkColor: 'blue',
188
+ btnLinkHoverColor: 'blue',
189
+ btnLinkActiveColor: 'blue',
190
+ }
191
+
192
+ const stringify = (styles) => {
193
+ return `${Object.entries(styles).map(([key, value]) => `${key}: "${value}"`).join(", ")}`
194
+ }
195
+
196
+ const copyStyles = (styles) => {
197
+ navigator.clipboard.writeText(stringify(styles));
198
+ Toast.push('Copied');
199
+ }
200
+
201
+ const tableStyle = {
202
+ borderCollapse: 'collapse',
203
+ width: '100%',
204
+ };
205
+
206
+ const tdStyle = {
207
+ border: '1px solid',
208
+ padding: '8px',
209
+ };
210
+
211
+ const renderExampleRow = (title, styles) => {
212
+ return (
213
+ <tr>
214
+ <td style={tdStyle}>{title}</td>
215
+ <td style={tdStyle}><Button use={'link'} theme={styles}>Button-link</Button></td>
216
+ <td style={tdStyle}>
217
+ <div style={{display: 'flex'}}>
218
+ <div style={{width: '80%', whiteSpace: 'pre-line'}}>{stringify(styles).replace(/, /g, '\n')}</div>
219
+ <Button icon={<CopyIcon16Regular />} use={'text'} onClick={() => copyStyles(styles)}/>
220
+ </div>
221
+ </td>
222
+ </tr>
223
+ )
224
+ }
225
+
226
+ <table style={tableStyle}>
227
+ <tr style={{textAlign: 'left'}}>
228
+ <th style={tdStyle}></th>
229
+ <th style={tdStyle}>Пример</th>
230
+ <th style={tdStyle}>Переменные темы</th>
231
+ </tr>
232
+ {renderExampleRow('Ссылка с подчеркиванием без отступа', textDecorationStyles)}
233
+ {renderExampleRow('Ссылка с подчеркиванием при наведении', underlineOnHoverStyles)}
234
+ {renderExampleRow('Изменение цвета ссылки', differentColorStyles)}
235
+ </table>
236
+ ```
237
+
238
+ ### Узкая Кнопка
239
+
240
+ ```jsx harmony
241
+ import { Button } from '@skbkontur/react-ui';
242
+
243
+ <Button narrow>
244
+ Создать отчет
245
+ </Button>
246
+ ```
247
+
248
+ ### Состояния валидации
249
+
250
+ ```jsx harmony
251
+ import { Button, Gapped } from '@skbkontur/react-ui';
252
+
253
+ <Gapped gap={5}>
254
+ <Button warning>
255
+ Warning
256
+ </Button>
257
+ <Button error>
258
+ Error
259
+ </Button>
260
+ </Gapped>
261
+ ```
@@ -0,0 +1,276 @@
1
+ ### Календарь с заданной датой
2
+
3
+ ```jsx harmony
4
+ const [date, setDate] = React.useState("01.11.2021");
5
+
6
+ <Calendar
7
+ value={date}
8
+ onValueChange={setDate}
9
+ />
10
+ ```
11
+
12
+ ### initialMonth и initialYear
13
+ Вне зависимости от того, какая дата выбрана в календаре в данный момент - можно изменить отображение начального года и месяца с помощью пропов `initialMonth` и `initialYear`
14
+
15
+ ```jsx harmony
16
+ import { Checkbox } from '@skbkontur/react-ui';
17
+
18
+ const [date, setDate] = React.useState("11.12.2021");
19
+ const initialMonth = 7;
20
+ const initialYear = 2000;
21
+
22
+ <div style={{ display: 'flex' }}>
23
+ <Calendar
24
+ value={date}
25
+ onValueChange={setDate}
26
+ initialMonth={initialMonth}
27
+ initialYear={initialYear}
28
+ />
29
+ <div style={{ fontSize: '16px' }}>
30
+ <p>Выбранная дата: {date}</p>
31
+ <p>Начальный месяц: {initialMonth}</p>
32
+ <p>Начальный год: {initialYear}</p>
33
+ </div>
34
+ </div>
35
+ ```
36
+
37
+ ### isHoliday
38
+
39
+ В компонент можно передать функцию `isHoliday`, которая будет получать день строкой формата `dd.mm.yyyy` и флаг `isWeekend`, и должна вернуть `true` для выходного и `false` для рабочего дня.
40
+
41
+ ```jsx harmony
42
+ import * as DatePickerHelpers from '@skbkontur/react-ui/components/DatePicker/DatePickerHelpers';
43
+
44
+ const [date, setDate] = React.useState();
45
+
46
+ const createRandomHolidays = () => {
47
+ const holidays = new Array(10);
48
+ const today = new Date();
49
+
50
+ for (let index = 0; index < holidays.length; index++) {
51
+ const day = new Date(today.setDate(today.getDate() + 1 + index).valueOf());
52
+
53
+ const holiday = {
54
+ date: day.getDate(),
55
+ month: day.getMonth(),
56
+ year: day.getFullYear(),
57
+ };
58
+
59
+ holidays[index] = DatePickerHelpers.formatDate(holiday);
60
+ }
61
+
62
+ return holidays;
63
+ };
64
+ const holidays = createRandomHolidays();
65
+
66
+ const isHoliday = (day, isWeekend) => {
67
+ const today = new Date();
68
+ const holiday = {
69
+ date: today.getDate(),
70
+ month: today.getMonth(),
71
+ year: today.getFullYear(),
72
+ };
73
+
74
+ if (holidays.includes(day)) {
75
+ return !isWeekend;
76
+ }
77
+
78
+ return isWeekend;
79
+ };
80
+
81
+ <Calendar isHoliday={isHoliday} value={date} onValueChange={setDate} />;
82
+ ```
83
+
84
+ ### Высота
85
+ Календарю можно задать кастомную высоту с помощью переменной темы `calendarWrapperHeight`
86
+
87
+ - Базовая высота календаря - `330px`
88
+ - Максимальная высота календаря - `450px`
89
+
90
+ ```jsx harmony
91
+ import { ThemeContext } from '@skbkontur/react-ui/lib/theming/ThemeContext';
92
+ import { ThemeFactory } from '@skbkontur/react-ui/lib/theming/ThemeFactory';
93
+
94
+ const [date, setDate] = React.useState("01.11.2021");
95
+ const theme = React.useContext(ThemeContext);
96
+
97
+ <ThemeContext.Provider
98
+ value={ThemeFactory.create({ calendarWrapperHeight: '450px' }, theme)}
99
+ >
100
+ <Calendar
101
+ value={date}
102
+ onValueChange={setDate}
103
+ />
104
+ </ThemeContext.Provider>
105
+ ```
106
+
107
+ ### Кастомный рендер дня
108
+ Для кастомнизации дней в календаре используется метод `renderDay` и компонент [Calendar.Day](#/Components/Calendar/Calendar.Day)
109
+
110
+ ```jsx harmony
111
+ import { Tooltip, Hint, CalendarDay } from '@skbkontur/react-ui';
112
+
113
+ const initialValue = "02.09.2023";
114
+
115
+ const [value, setValue] = React.useState(initialValue);
116
+
117
+ const renderDay = (props) => {
118
+ const [date, month, year] = props.date.split('.').map(Number);
119
+
120
+ if (month == 9 && date > 12 && date < 16) {
121
+ return (
122
+ <Tooltip render={() => "Кастомный день"}>
123
+ <CalendarDay {...props} style={{ background: 'darkgray' }} />
124
+ </Tooltip>
125
+ );
126
+ }
127
+
128
+ if (month == 8 && date == 20) {
129
+ return (
130
+ <Hint text={date} pos="right middle">
131
+ <CalendarDay {...props}>
132
+ <b style={{color: 'orange'}}>#</b>
133
+ </CalendarDay>
134
+ </Hint>
135
+ );
136
+ }
137
+
138
+ return <CalendarDay {...props} />
139
+ };
140
+
141
+ <Calendar
142
+ value={value}
143
+ onValueChange={setValue}
144
+ renderDay={renderDay}
145
+ />;
146
+ ```
147
+
148
+ ### Календарь с ценами
149
+ Пример с кастомизацией темы и кастомным рендером дня.
150
+
151
+ ```jsx harmony
152
+ import { CalendarDay } from '@skbkontur/react-ui';
153
+ import { ThemeContext } from '@skbkontur/react-ui/lib/theming/ThemeContext';
154
+ import { ThemeFactory } from '@skbkontur/react-ui/lib/theming/ThemeFactory';
155
+
156
+ const theme = React.useContext(ThemeContext);
157
+
158
+ function renderDay(props) {
159
+ const [date, month] = props.date.split('.').map(Number);
160
+ const randomDay = date % 6 === 0 || date % 7 === 0 || date % 8 === 0;
161
+ const randomPrice = Math.round((date / month) * 1000);
162
+
163
+ return (
164
+ <CalendarDay {...props}>
165
+ <div style={{ fontSize: theme.calendarCellFontSize }}>{date}</div>
166
+ <div style={{ fontSize: '11px', fontFeatureSettings: 'tnum', fontVariantNumeric: 'tabular-nums' }}>
167
+ {randomDay ? <>{randomPrice}&thinsp;₽</> : <span style={{ color: theme.tokenTextColorDisabled }}>—</span>}
168
+ </div>
169
+ </CalendarDay>
170
+ );
171
+ }
172
+
173
+ const [value, setValue] = React.useState(null);
174
+
175
+ <ThemeContext.Provider
176
+ value={ThemeFactory.create({
177
+ calendarCellWidth: '56px',
178
+ calendarCellHeight: '56px',
179
+ calendarCellLineHeight: '1.5',
180
+ calendarWrapperHeight: '600px',
181
+ calendarCellBorderRadius: '8px'
182
+ }, theme)}
183
+ >
184
+ <Calendar value={value} renderDay={renderDay} onValueChange={setValue} />
185
+ </ThemeContext.Provider>
186
+ ```
187
+
188
+ ### Локали по умолчанию
189
+
190
+ ```typescript static
191
+ interface CalendarLocale {
192
+ months?: string[];
193
+ selectMonthAriaLabel?: string;
194
+ selectYearAriaLabel?: string;
195
+ selectChosenAriaLabel?: string;
196
+ dayCellChooseDateAriaLabel?: string;
197
+ }
198
+
199
+ const ru_RU = {
200
+ months: [
201
+ 'Январь',
202
+ 'Февраль',
203
+ 'Март',
204
+ 'Апрель',
205
+ 'Май',
206
+ 'Июнь',
207
+ 'Июль',
208
+ 'Август',
209
+ 'Сентябрь',
210
+ 'Октябрь',
211
+ 'Ноябрь',
212
+ 'Декабрь',
213
+ ],
214
+ selectMonthAriaLabel: 'месяц',
215
+ selectYearAriaLabel: 'год',
216
+ selectChosenAriaLabel: 'Выбранный',
217
+ dayCellChooseDateAriaLabel: 'Выбрать дату',
218
+ };
219
+
220
+ const en_GB = {
221
+ months: [
222
+ 'January',
223
+ 'February',
224
+ 'March',
225
+ 'April',
226
+ 'May',
227
+ 'June',
228
+ 'July',
229
+ 'August',
230
+ 'September',
231
+ 'October',
232
+ 'November',
233
+ 'December',
234
+ ],
235
+ selectMonthAriaLabel: 'месяц',
236
+ selectYearAriaLabel: 'год',
237
+ selectChosenAriaLabel: 'Выбранный',
238
+ dayCellChooseDateAriaLabel: 'Выбрать дату',
239
+ };
240
+ ```
241
+
242
+
243
+ ### Скролл к месяцу
244
+
245
+ ```jsx harmony
246
+ import { Button, Gapped } from '@skbkontur/react-ui';
247
+
248
+ const initialValue = "02.09.2023";
249
+ const [value, setValue] = React.useState(initialValue);
250
+ const calendarRef = React.useRef(null);
251
+
252
+ <>
253
+ <Gapped gap={8} verticalAlign="top">
254
+ <Calendar
255
+ value={value}
256
+ ref={calendarRef}
257
+ onValueChange={setValue}
258
+ />
259
+
260
+ <Gapped vertical gap={8}>
261
+ <Button onClick={() => calendarRef.current.scrollToMonth(1, 2023)}>
262
+ I квартал
263
+ </Button>
264
+ <Button onClick={() => calendarRef.current.scrollToMonth(4, 2023)}>
265
+ II квартал
266
+ </Button>
267
+ <Button onClick={() => calendarRef.current.scrollToMonth(7, 2023)}>
268
+ III квартал
269
+ </Button>
270
+ <Button onClick={() => calendarRef.current.scrollToMonth(10, 2023)}>
271
+ IV квартал
272
+ </Button>
273
+ </Gapped>
274
+ </Gapped>
275
+ </>;
276
+ ```