@alfalab/core-components-picker-button 10.3.30 → 11.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/Component-50136800.d.ts +6 -0
  2. package/Component-5e1b8383.d.ts +72 -0
  3. package/Component-63dec22f.d.ts +167 -0
  4. package/Component-bdb4c6b9.d.ts +12 -0
  5. package/Component-c76d6398.d.ts +5 -0
  6. package/Component-ebda875c.d.ts +12 -0
  7. package/Component.desktop-785df74d.d.ts +6 -0
  8. package/{Component.d.ts → Component.desktop.d.ts} +4 -5
  9. package/Component.desktop.js +47 -0
  10. package/Component.mobile-06ffd24b.d.ts +41 -0
  11. package/Component.mobile-d7e9f69d.d.ts +6 -0
  12. package/Component.mobile-ebda875c.d.ts +6 -0
  13. package/Component.mobile-f1f15074.d.ts +34 -0
  14. package/Component.mobile.d.ts +16 -4
  15. package/Component.mobile.js +6 -4
  16. package/Component.modal.mobile-5e1b8383.d.ts +60 -0
  17. package/Component.responsive-3109f463.d.ts +26 -0
  18. package/Component.responsive.d.ts +6 -6
  19. package/Component.responsive.js +4 -3
  20. package/Context-bdb4c6b9.d.ts +4 -0
  21. package/ResponsiveContext-baf4875b.d.ts +5 -0
  22. package/component-50136800.d.ts +44 -0
  23. package/consts-f777ba1a.d.ts +2 -0
  24. package/createPaddingStyle-72dda473.d.ts +5 -0
  25. package/cssm/Component-50136800.d.ts +6 -0
  26. package/cssm/Component-5e1b8383.d.ts +72 -0
  27. package/cssm/Component-63dec22f.d.ts +167 -0
  28. package/cssm/Component-bdb4c6b9.d.ts +12 -0
  29. package/cssm/Component-c76d6398.d.ts +5 -0
  30. package/cssm/Component-ebda875c.d.ts +12 -0
  31. package/cssm/Component.desktop-785df74d.d.ts +6 -0
  32. package/{modern/Component.d.ts → cssm/Component.desktop.d.ts} +4 -5
  33. package/cssm/{Component.js → Component.desktop.js} +5 -4
  34. package/cssm/Component.mobile-06ffd24b.d.ts +41 -0
  35. package/cssm/Component.mobile-d7e9f69d.d.ts +6 -0
  36. package/cssm/Component.mobile-ebda875c.d.ts +6 -0
  37. package/cssm/Component.mobile-f1f15074.d.ts +34 -0
  38. package/cssm/Component.mobile.d.ts +16 -4
  39. package/cssm/Component.mobile.js +6 -4
  40. package/cssm/Component.modal.mobile-5e1b8383.d.ts +60 -0
  41. package/cssm/Component.responsive-3109f463.d.ts +26 -0
  42. package/cssm/Component.responsive.d.ts +6 -6
  43. package/cssm/Component.responsive.js +4 -3
  44. package/cssm/Context-bdb4c6b9.d.ts +4 -0
  45. package/cssm/ResponsiveContext-baf4875b.d.ts +5 -0
  46. package/cssm/component-50136800.d.ts +44 -0
  47. package/cssm/consts-f777ba1a.d.ts +2 -0
  48. package/cssm/createPaddingStyle-72dda473.d.ts +5 -0
  49. package/cssm/desktop-63dec22f.d.ts +6 -0
  50. package/cssm/desktop.d.ts +2 -1
  51. package/cssm/desktop.js +3 -3
  52. package/cssm/field/Component.d.ts +1 -1
  53. package/cssm/hook-9ea9e32c.d.ts +75 -0
  54. package/cssm/index-136acbb1.d.ts +28 -0
  55. package/cssm/index-3109f463.d.ts +62 -0
  56. package/cssm/index-50136800.d.ts +8 -0
  57. package/cssm/index-72dda473.d.ts +12 -0
  58. package/cssm/index-bdb4c6b9.d.ts +2 -0
  59. package/cssm/index-c44170fe.d.ts +160 -0
  60. package/cssm/index-c76d6398.d.ts +2 -0
  61. package/cssm/index-ebda875c.d.ts +81 -0
  62. package/cssm/index-f12ee135.d.ts +3 -0
  63. package/cssm/index.d.ts +2 -4
  64. package/cssm/index.js +8 -8
  65. package/cssm/mobile-96988a65.d.ts +2 -0
  66. package/cssm/mobile.d.ts +1 -1
  67. package/cssm/mobile.js +2 -1
  68. package/cssm/option/Component.d.ts +2 -2
  69. package/cssm/option/Component.js +2 -2
  70. package/cssm/option/index.js +1 -1
  71. package/cssm/shared-4cd3936b.d.ts +93 -0
  72. package/cssm/shared.d.ts +2 -0
  73. package/cssm/shared.js +13 -0
  74. package/cssm/types-72dda473.d.ts +259 -0
  75. package/cssm/types-83e2bd9e.d.ts +113 -0
  76. package/cssm/types.d.ts +3 -0
  77. package/cssm/types.js +2 -0
  78. package/cssm/typings-5e1b8383.d.ts +4 -459
  79. package/cssm/typings-9211a437.d.ts +95 -0
  80. package/cssm/typings-bdb4c6b9.d.ts +52 -0
  81. package/cssm/utils/index.d.ts +1 -1
  82. package/cssm/utils-1574ad8b.d.ts +29 -0
  83. package/cssm/utils-49cc3c24.d.ts +8 -0
  84. package/cssm/utils-5e1b8383.d.ts +38 -0
  85. package/desktop-63dec22f.d.ts +6 -0
  86. package/desktop.d.ts +2 -1
  87. package/desktop.js +3 -3
  88. package/esm/Component-50136800.d.ts +6 -0
  89. package/esm/Component-5e1b8383.d.ts +72 -0
  90. package/esm/Component-63dec22f.d.ts +167 -0
  91. package/esm/Component-bdb4c6b9.d.ts +12 -0
  92. package/esm/Component-c76d6398.d.ts +5 -0
  93. package/esm/Component-ebda875c.d.ts +12 -0
  94. package/esm/Component.desktop-785df74d.d.ts +6 -0
  95. package/{cssm/Component.d.ts → esm/Component.desktop.d.ts} +4 -5
  96. package/esm/{Component.js → Component.desktop.js} +5 -4
  97. package/esm/Component.mobile-06ffd24b.d.ts +41 -0
  98. package/esm/Component.mobile-d7e9f69d.d.ts +6 -0
  99. package/esm/Component.mobile-ebda875c.d.ts +6 -0
  100. package/esm/Component.mobile-f1f15074.d.ts +34 -0
  101. package/esm/Component.mobile.d.ts +16 -4
  102. package/esm/Component.mobile.js +6 -4
  103. package/esm/Component.modal.mobile-5e1b8383.d.ts +60 -0
  104. package/esm/Component.responsive-3109f463.d.ts +26 -0
  105. package/esm/Component.responsive.d.ts +6 -6
  106. package/esm/Component.responsive.js +4 -3
  107. package/esm/Context-bdb4c6b9.d.ts +4 -0
  108. package/esm/ResponsiveContext-baf4875b.d.ts +5 -0
  109. package/esm/component-50136800.d.ts +44 -0
  110. package/esm/consts-f777ba1a.d.ts +2 -0
  111. package/esm/createPaddingStyle-72dda473.d.ts +5 -0
  112. package/esm/desktop-63dec22f.d.ts +6 -0
  113. package/esm/desktop.d.ts +2 -1
  114. package/esm/desktop.js +2 -2
  115. package/esm/field/Component.d.ts +1 -1
  116. package/esm/field/Component.js +1 -1
  117. package/esm/field/index.css +5 -5
  118. package/esm/hook-9ea9e32c.d.ts +75 -0
  119. package/esm/index-136acbb1.d.ts +28 -0
  120. package/esm/index-3109f463.d.ts +62 -0
  121. package/esm/index-50136800.d.ts +8 -0
  122. package/esm/index-72dda473.d.ts +12 -0
  123. package/esm/index-bdb4c6b9.d.ts +2 -0
  124. package/esm/index-c44170fe.d.ts +160 -0
  125. package/esm/index-c76d6398.d.ts +2 -0
  126. package/esm/index-ebda875c.d.ts +81 -0
  127. package/esm/index-f12ee135.d.ts +3 -0
  128. package/esm/index.css +5 -5
  129. package/esm/index.d.ts +2 -4
  130. package/esm/index.js +6 -5
  131. package/esm/mobile-96988a65.d.ts +2 -0
  132. package/esm/mobile.d.ts +1 -1
  133. package/esm/mobile.js +2 -1
  134. package/esm/option/Component.d.ts +2 -2
  135. package/esm/option/Component.js +2 -2
  136. package/esm/option/index.css +4 -4
  137. package/esm/option/index.js +1 -1
  138. package/esm/shared-4cd3936b.d.ts +93 -0
  139. package/esm/shared.d.ts +2 -0
  140. package/esm/shared.js +5 -0
  141. package/esm/types-72dda473.d.ts +259 -0
  142. package/esm/types-83e2bd9e.d.ts +113 -0
  143. package/esm/types.d.ts +3 -0
  144. package/esm/types.js +1 -0
  145. package/esm/typings-5e1b8383.d.ts +4 -459
  146. package/esm/typings-9211a437.d.ts +95 -0
  147. package/esm/typings-bdb4c6b9.d.ts +52 -0
  148. package/esm/utils/index.d.ts +1 -1
  149. package/esm/utils-1574ad8b.d.ts +29 -0
  150. package/esm/utils-49cc3c24.d.ts +8 -0
  151. package/esm/utils-5e1b8383.d.ts +38 -0
  152. package/field/Component.d.ts +1 -1
  153. package/field/Component.js +1 -1
  154. package/field/index.css +5 -5
  155. package/hook-9ea9e32c.d.ts +75 -0
  156. package/index-136acbb1.d.ts +28 -0
  157. package/index-3109f463.d.ts +62 -0
  158. package/index-50136800.d.ts +8 -0
  159. package/index-72dda473.d.ts +12 -0
  160. package/index-bdb4c6b9.d.ts +2 -0
  161. package/index-c44170fe.d.ts +160 -0
  162. package/index-c76d6398.d.ts +2 -0
  163. package/index-ebda875c.d.ts +81 -0
  164. package/index-f12ee135.d.ts +3 -0
  165. package/index.css +5 -5
  166. package/index.d.ts +2 -4
  167. package/index.js +6 -6
  168. package/mobile-96988a65.d.ts +2 -0
  169. package/mobile.d.ts +1 -1
  170. package/mobile.js +2 -1
  171. package/modern/Component-50136800.d.ts +6 -0
  172. package/modern/Component-5e1b8383.d.ts +72 -0
  173. package/modern/Component-63dec22f.d.ts +167 -0
  174. package/modern/Component-bdb4c6b9.d.ts +12 -0
  175. package/modern/Component-c76d6398.d.ts +5 -0
  176. package/modern/Component-ebda875c.d.ts +12 -0
  177. package/modern/Component.desktop-785df74d.d.ts +6 -0
  178. package/{esm/Component.d.ts → modern/Component.desktop.d.ts} +4 -5
  179. package/modern/{Component.js → Component.desktop.js} +5 -4
  180. package/modern/Component.mobile-06ffd24b.d.ts +41 -0
  181. package/modern/Component.mobile-d7e9f69d.d.ts +6 -0
  182. package/modern/Component.mobile-ebda875c.d.ts +6 -0
  183. package/modern/Component.mobile-f1f15074.d.ts +34 -0
  184. package/modern/Component.mobile.d.ts +16 -4
  185. package/modern/Component.mobile.js +6 -4
  186. package/modern/Component.modal.mobile-5e1b8383.d.ts +60 -0
  187. package/modern/Component.responsive-3109f463.d.ts +26 -0
  188. package/modern/Component.responsive.d.ts +6 -6
  189. package/modern/Component.responsive.js +4 -3
  190. package/modern/Context-bdb4c6b9.d.ts +4 -0
  191. package/modern/ResponsiveContext-baf4875b.d.ts +5 -0
  192. package/modern/component-50136800.d.ts +44 -0
  193. package/modern/consts-f777ba1a.d.ts +2 -0
  194. package/modern/createPaddingStyle-72dda473.d.ts +5 -0
  195. package/modern/desktop-63dec22f.d.ts +6 -0
  196. package/modern/desktop.d.ts +2 -1
  197. package/modern/desktop.js +2 -2
  198. package/modern/field/Component.d.ts +1 -1
  199. package/modern/field/Component.js +1 -1
  200. package/modern/field/index.css +5 -5
  201. package/modern/hook-9ea9e32c.d.ts +75 -0
  202. package/modern/index-136acbb1.d.ts +28 -0
  203. package/modern/index-3109f463.d.ts +62 -0
  204. package/modern/index-50136800.d.ts +8 -0
  205. package/modern/index-72dda473.d.ts +12 -0
  206. package/modern/index-bdb4c6b9.d.ts +2 -0
  207. package/modern/index-c44170fe.d.ts +160 -0
  208. package/modern/index-c76d6398.d.ts +2 -0
  209. package/modern/index-ebda875c.d.ts +81 -0
  210. package/modern/index-f12ee135.d.ts +3 -0
  211. package/modern/index.css +5 -5
  212. package/modern/index.d.ts +2 -4
  213. package/modern/index.js +6 -5
  214. package/modern/mobile-96988a65.d.ts +2 -0
  215. package/modern/mobile.d.ts +1 -1
  216. package/modern/mobile.js +2 -1
  217. package/modern/option/Component.d.ts +2 -2
  218. package/modern/option/Component.js +2 -2
  219. package/modern/option/index.css +4 -4
  220. package/modern/option/index.js +1 -1
  221. package/modern/shared-4cd3936b.d.ts +93 -0
  222. package/modern/shared.d.ts +2 -0
  223. package/modern/shared.js +5 -0
  224. package/modern/types-72dda473.d.ts +259 -0
  225. package/modern/types-83e2bd9e.d.ts +113 -0
  226. package/modern/types.d.ts +3 -0
  227. package/modern/types.js +1 -0
  228. package/modern/typings-5e1b8383.d.ts +4 -459
  229. package/modern/typings-9211a437.d.ts +95 -0
  230. package/modern/typings-bdb4c6b9.d.ts +52 -0
  231. package/modern/utils/index.d.ts +1 -1
  232. package/modern/utils-1574ad8b.d.ts +29 -0
  233. package/modern/utils-49cc3c24.d.ts +8 -0
  234. package/modern/utils-5e1b8383.d.ts +38 -0
  235. package/option/Component.d.ts +2 -2
  236. package/option/Component.js +3 -3
  237. package/option/index.css +4 -4
  238. package/option/index.js +1 -1
  239. package/package.json +27 -3
  240. package/shared-4cd3936b.d.ts +93 -0
  241. package/shared.d.ts +2 -0
  242. package/shared.js +13 -0
  243. package/src/Component.desktop.tsx +122 -0
  244. package/src/Component.mobile.tsx +83 -0
  245. package/src/Component.responsive.tsx +61 -0
  246. package/src/desktop.ts +1 -0
  247. package/src/field/Component.tsx +86 -0
  248. package/src/field/index.module.css +18 -0
  249. package/src/field/index.ts +1 -0
  250. package/src/index.module.css +22 -0
  251. package/src/index.ts +4 -0
  252. package/src/mobile.ts +1 -0
  253. package/src/option/Component.tsx +30 -0
  254. package/src/option/index.module.css +17 -0
  255. package/src/option/index.ts +1 -0
  256. package/src/shared.ts +2 -0
  257. package/src/types.ts +3 -0
  258. package/src/utils/index.ts +19 -0
  259. package/types-72dda473.d.ts +259 -0
  260. package/types-83e2bd9e.d.ts +113 -0
  261. package/types.d.ts +3 -0
  262. package/types.js +2 -0
  263. package/typings-5e1b8383.d.ts +4 -459
  264. package/typings-9211a437.d.ts +95 -0
  265. package/typings-bdb4c6b9.d.ts +52 -0
  266. package/utils/index.d.ts +1 -1
  267. package/utils-1574ad8b.d.ts +29 -0
  268. package/utils-49cc3c24.d.ts +8 -0
  269. package/utils-5e1b8383.d.ts +38 -0
  270. package/Component.js +0 -46
  271. package/cssm/responsive.d.ts +0 -2
  272. package/cssm/responsive.js +0 -27
  273. package/esm/responsive.d.ts +0 -2
  274. package/esm/responsive.js +0 -16
  275. package/modern/responsive.d.ts +0 -2
  276. package/modern/responsive.js +0 -15
  277. package/responsive.d.ts +0 -2
  278. package/responsive.js +0 -24
@@ -0,0 +1,81 @@
1
+ /// <reference types="react" />
2
+ /// <reference types="react-transition-group" />
3
+ import React from "react";
4
+ import { ButtonHTMLAttributes, ElementType, FC, AnchorHTMLAttributes, ReactElement } from "react";
5
+ import { ButtonProps } from "@alfalab/core-components-button";
6
+ interface CloserProps extends ButtonHTMLAttributes<HTMLButtonElement> {
7
+ /**
8
+ * Вид компонента
9
+ */
10
+ view: "desktop" | "mobile";
11
+ /**
12
+ * Дополнительный класс
13
+ */
14
+ className?: string;
15
+ /**
16
+ * Позиция крестика
17
+ */
18
+ align?: "left" | "right";
19
+ /**
20
+ * Фиксирует крестик
21
+ */
22
+ sticky?: boolean;
23
+ /**
24
+ * Иконка
25
+ */
26
+ icon?: ElementType;
27
+ /**
28
+ * Идентификатор для систем автоматизированного тестирования
29
+ */
30
+ dataTestId?: string;
31
+ /**
32
+ * Коллбэк закрытия.
33
+ */
34
+ onClose?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>, reason?: "backdropClick" | "escapeKeyDown" | "closerClick") => void;
35
+ }
36
+ declare const Closer: FC<CloserProps>;
37
+ type IconButtonProps = {
38
+ /**
39
+ * Компонент иконки
40
+ */
41
+ icon: ElementType<{
42
+ className?: string;
43
+ }> | ReactElement;
44
+ /**
45
+ * Тип кнопки
46
+ */
47
+ view?: "primary" | "secondary" | "transparent" | "tertiary" | "negative";
48
+ /**
49
+ * Размер компонента
50
+ */
51
+ size?: "xxs" | "xs" | "s";
52
+ /**
53
+ * Дополнительный класс
54
+ */
55
+ className?: string;
56
+ /**
57
+ * Выравнивание иконки
58
+ * @default 'center'
59
+ */
60
+ alignIcon?: "left" | "center" | "right";
61
+ /**
62
+ * Идентификатор для систем автоматизированного тестирования
63
+ */
64
+ dataTestId?: string;
65
+ /**
66
+ * Набор цветов для компонента
67
+ */
68
+ colors?: "default" | "inverted";
69
+ } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "loading" | "breakpoint"> & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "target" | "download">;
70
+ declare const IconButton: React.ForwardRefExoticComponent<{
71
+ icon: ElementType<{
72
+ className?: string;
73
+ }> | ReactElement;
74
+ view?: "primary" | "secondary" | "tertiary" | "negative" | "transparent" | undefined;
75
+ size?: "s" | "xs" | "xxs" | undefined;
76
+ className?: string | undefined;
77
+ alignIcon?: "center" | "right" | "left" | undefined;
78
+ dataTestId?: string | undefined;
79
+ colors?: "default" | "inverted" | undefined;
80
+ } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "loading" | "breakpoint"> & Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, "download" | "target"> & React.RefAttributes<HTMLButtonElement>>;
81
+ export { CloserProps, Closer, IconButtonProps, IconButton };
@@ -0,0 +1,3 @@
1
+ export * from "./component-50136800";
2
+ export type { BottomSheetProps, BottomSheetTitleAlign } from "./types-72dda473";
3
+ export { CLOSE_OFFSET, HEADER_OFFSET } from "./utils-49cc3c24";
package/cssm/index.d.ts CHANGED
@@ -1,4 +1,2 @@
1
- export { PickerButtonResponsive as PickerButton } from "./responsive";
2
- export type { PickerButtonResponsiveProps as PickerButtonProps } from "./responsive";
3
- export type { PickerButtonDesktopProps, PickerButtonSize, PickerButtonVariant } from "./Component";
4
- export { getIcon } from "./utils/index";
1
+ export { PickerButtonResponsive as PickerButton, PickerButtonResponsiveProps as PickerButtonProps } from "./Component.responsive";
2
+ export {};
package/cssm/index.js CHANGED
@@ -3,26 +3,26 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var Component_responsive = require('./Component.responsive.js');
6
- var utils_index = require('./utils/index.js');
7
6
  require('tslib');
8
7
  require('react');
9
8
  require('@alfalab/hooks');
10
- require('./Component.js');
9
+ require('./Component.desktop.js');
11
10
  require('classnames');
12
- require('@alfalab/core-components-select/cssm');
11
+ require('@alfalab/core-components-select/cssm/shared');
13
12
  require('./field/Component.js');
14
13
  require('@alfalab/core-components-button/cssm');
14
+ require('./utils/index.js');
15
+ require('@alfalab/icons-glyph/ChevronDownCompactSIcon');
16
+ require('@alfalab/icons-glyph/ChevronDownMIcon');
17
+ require('@alfalab/icons-glyph/MoreMIcon');
18
+ require('@alfalab/icons-glyph/MoreSIcon');
15
19
  require('./field/index.module.css');
16
20
  require('./option/Component.js');
17
21
  require('./option/index.module.css');
18
22
  require('./index.module.css');
19
23
  require('./Component.mobile.js');
20
- require('@alfalab/icons-glyph/ChevronDownCompactSIcon');
21
- require('@alfalab/icons-glyph/ChevronDownMIcon');
22
- require('@alfalab/icons-glyph/MoreMIcon');
23
- require('@alfalab/icons-glyph/MoreSIcon');
24
+ require('@alfalab/core-components-select/cssm/mobile');
24
25
 
25
26
 
26
27
 
27
28
  exports.PickerButton = Component_responsive.PickerButtonResponsive;
28
- exports.getIcon = utils_index.getIcon;
@@ -0,0 +1,2 @@
1
+ export * from "./Component.mobile-d7e9f69d";
2
+ export {};
package/cssm/mobile.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./Component.mobile";
1
+ export { PickerButtonMobile, PickerButtonMobileProps } from "./Component.mobile";
2
2
  export {};
package/cssm/mobile.js CHANGED
@@ -5,7 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var Component_mobile = require('./Component.mobile.js');
6
6
  require('tslib');
7
7
  require('react');
8
- require('@alfalab/core-components-select/cssm');
8
+ require('@alfalab/core-components-select/cssm/mobile');
9
+ require('@alfalab/core-components-select/cssm/shared');
9
10
  require('./field/Component.js');
10
11
  require('classnames');
11
12
  require('@alfalab/core-components-button/cssm');
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { FC, SVGProps } from "react";
4
- import { OptionShape } from "../typings-5e1b8383";
5
- import { OptionProps as BaseOptionProps } from "../typings-5e1b8383";
4
+ import { OptionShape } from "../shared-4cd3936b";
5
+ import { OptionProps as BaseOptionProps } from "../shared-4cd3936b";
6
6
  type OptionProps = Omit<BaseOptionProps, 'option'> & {
7
7
  option: OptionShape & {
8
8
  icon?: FC<SVGProps<SVGSVGElement>>;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib = require('tslib');
6
6
  var React = require('react');
7
- var coreComponentsSelect = require('@alfalab/core-components-select/cssm');
7
+ var shared = require('@alfalab/core-components-select/cssm/shared');
8
8
  var styles = require('./index.module.css');
9
9
 
10
10
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
@@ -16,7 +16,7 @@ var Option = function (_a) {
16
16
  var option = _a.option, children = _a.children, restProps = tslib.__rest(_a, ["option", "children"]);
17
17
  var content = children || option.content || option.key;
18
18
  var Icon = option.icon;
19
- return (React__default.default.createElement(coreComponentsSelect.Option, tslib.__assign({ option: option }, restProps),
19
+ return (React__default.default.createElement(shared.Option, tslib.__assign({ option: option }, restProps),
20
20
  React__default.default.createElement("div", { className: styles__default.default.container },
21
21
  Icon && React__default.default.createElement(Icon, { className: styles__default.default.icon }),
22
22
  React__default.default.createElement("div", { className: styles__default.default.content }, content))));
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var option_Component = require('./Component.js');
6
6
  require('tslib');
7
7
  require('react');
8
- require('@alfalab/core-components-select/cssm');
8
+ require('@alfalab/core-components-select/cssm/shared');
9
9
  require('./index.module.css');
10
10
 
11
11
 
@@ -0,0 +1,93 @@
1
+ /// <reference types="react" />
2
+ import React from "react";
3
+ import { ReactNode } from "react";
4
+ import { BaseSelectProps, OptionProps, OptionShape } from "./typings-5e1b8383";
5
+ // eslint-disable-next-line @typescript-eslint/naming-convention
6
+ type useSelectWithLoadingProps = {
7
+ loading?: boolean;
8
+ visibleOptions?: BaseSelectProps["visibleOptions"];
9
+ Option?: React.FC<OptionProps>;
10
+ };
11
+ declare function useSelectWithLoading({ loading, visibleOptions, Option }: useSelectWithLoadingProps): {
12
+ Option: (props: OptionProps) => React.JSX.Element;
13
+ options: OptionShape[];
14
+ } | null;
15
+ type OptionsFetcherResponse = {
16
+ options: OptionShape[];
17
+ hasMore: boolean;
18
+ };
19
+ // eslint-disable-next-line @typescript-eslint/naming-convention
20
+ type useLazyLoadingProps = {
21
+ /** Количество элементов на "странице" */
22
+ limit?: number;
23
+ /** Начальный номер "страницы" */
24
+ initialOffset?: number;
25
+ /** Скелетон загружаемых элементов */
26
+ skeleton?: React.ReactNode;
27
+ /** Компонент пункта меню */
28
+ Option?: React.FC<OptionProps>;
29
+ /**
30
+ * Функция-загрузчик опций.
31
+ * @param offset - текущая страница
32
+ * @param limit - количество элементов на странице
33
+ * @param queryString - строчные данные, пробрасываемые для поиска из кастомного инпута, расположенного в заголовке OptionsList
34
+ * @returns Promise<{
35
+ * options - список опций следующей "страницы". Они аппендятся к предыдущим
36
+ * hasMore - указывает, есть ли еще незагруженные элементы (в случае false перестает загружать "следующую страницу")
37
+ * }>
38
+ */
39
+ optionsFetcher(offset: number, limit: number, queryString?: string): Promise<OptionsFetcherResponse>;
40
+ };
41
+ declare function useLazyLoading({ limit, initialOffset, optionsFetcher, skeleton, Option }: useLazyLoadingProps): {
42
+ optionsProps: {
43
+ Option: (props: OptionProps) => React.JSX.Element;
44
+ options: OptionShape[];
45
+ optionsListProps: {
46
+ ref: React.RefObject<HTMLDivElement>;
47
+ inputProps: {
48
+ onChange: (event: React.ChangeEvent<HTMLInputElement>, payload: {
49
+ value: string;
50
+ }) => void;
51
+ value: string;
52
+ };
53
+ };
54
+ onOpen: (payload: {
55
+ open?: boolean;
56
+ }) => void;
57
+ };
58
+ reset: () => void;
59
+ };
60
+ type SkeletonProps = {
61
+ /**
62
+ * Флаг, явно задающий состояние, при котором контент закрывается прелоадером
63
+ */
64
+ visible?: boolean;
65
+ /**
66
+ * Флаг явного включения анимации скелета
67
+ */
68
+ animate?: boolean;
69
+ /**
70
+ * Дополнительный класс
71
+ */
72
+ className?: string;
73
+ /**
74
+ * Дополнительные инлайн стили
75
+ */
76
+ style?: React.CSSProperties;
77
+ /**
78
+ * Идентификатор для систем автоматизированного тестирования
79
+ */
80
+ dataTestId?: string;
81
+ /**
82
+ * Дочерние элементы.
83
+ */
84
+ children?: ReactNode;
85
+ };
86
+ declare const Skeleton: React.FC<SkeletonProps>;
87
+ export * from "./index-ebda875c";
88
+ export * from "./Component-5e1b8383";
89
+ export { useSelectWithLoading, useLazyLoading, SkeletonProps, Skeleton };
90
+ export * from "./hook-9ea9e32c";
91
+ export * from "./typings-5e1b8383";
92
+ export * from "./utils-5e1b8383";
93
+ export type { AdditionalMobileProps } from "./Component.mobile-06ffd24b";
@@ -0,0 +1,2 @@
1
+ export { getIcon } from "./utils/index";
2
+ export * from "./types";
package/cssm/shared.js ADDED
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var utils_index = require('./utils/index.js');
6
+ require('@alfalab/icons-glyph/ChevronDownCompactSIcon');
7
+ require('@alfalab/icons-glyph/ChevronDownMIcon');
8
+ require('@alfalab/icons-glyph/MoreMIcon');
9
+ require('@alfalab/icons-glyph/MoreSIcon');
10
+
11
+
12
+
13
+ exports.getIcon = utils_index.getIcon;
@@ -0,0 +1,259 @@
1
+ /// <reference types="react-transition-group" />
2
+ import { HTMLAttributes, ReactNode, RefObject } from 'react';
3
+ import { TransitionProps } from 'react-transition-group/Transition';
4
+ import { BaseModalProps } from "./index-bdb4c6b9";
5
+ import { NavigationBarProps } from "./index-c76d6398";
6
+ import { BackgroundColorType } from "./index-72dda473";
7
+ type BottomSheetTitleAlign = 'center' | 'left';
8
+ type BottomSheetProps = {
9
+ /**
10
+ * Контент
11
+ */
12
+ children?: ReactNode;
13
+ /**
14
+ * Управление видимостью
15
+ */
16
+ open: boolean;
17
+ /**
18
+ * Заголовок
19
+ */
20
+ title?: ReactNode;
21
+ /**
22
+ * Размер заголовка
23
+ */
24
+ titleSize?: NavigationBarProps['titleSize'];
25
+ /**
26
+ * Подзаголовок.
27
+ */
28
+ subtitle?: NavigationBarProps['subtitle'];
29
+ /**
30
+ * Кнопка действия (обычно, это кнопка закрытия)
31
+ */
32
+ actionButton?: ReactNode;
33
+ /**
34
+ * Нода, компонент или функция возвращающая их
35
+ *
36
+ * Контейнер к которому будут добавляться порталы
37
+ */
38
+ container?: BaseModalProps['container'];
39
+ /**
40
+ * Рендерить ли в контейнер через портал.
41
+ */
42
+ usePortal?: BaseModalProps['usePortal'];
43
+ /**
44
+ * Дополнительный класс
45
+ */
46
+ className?: string;
47
+ /**
48
+ * Дополнительный класс
49
+ */
50
+ contentClassName?: string;
51
+ /**
52
+ * Дополнительные пропсы на контейнер.
53
+ */
54
+ containerProps?: HTMLAttributes<HTMLDivElement>;
55
+ /**
56
+ * Дополнительный класс
57
+ */
58
+ containerClassName?: string;
59
+ /**
60
+ * Цвет фона
61
+ */
62
+ backgroundColor?: Extract<BackgroundColorType, 'primary' | 'secondary'>;
63
+ /**
64
+ * Дополнительный класс шапки
65
+ */
66
+ headerClassName?: string;
67
+ /**
68
+ * Дополнительный класс футера
69
+ */
70
+ footerClassName?: string;
71
+ /**
72
+ * Дополнительный класс для аддонов
73
+ */
74
+ addonClassName?: string;
75
+ /**
76
+ * Дополнительный класс для компонента крестика
77
+ */
78
+ closerClassName?: string;
79
+ /**
80
+ * Дополнительный класс для компонента стрелки назад
81
+ */
82
+ backerClassName?: string;
83
+ /**
84
+ * Дополнительный класс для компонента модального окна
85
+ */
86
+ modalClassName?: string;
87
+ /**
88
+ * Дополнительный класс для обертки модального окна
89
+ */
90
+ modalWrapperClassName?: string;
91
+ /**
92
+ * TransitionProps, прокидываются в компонент CSSTransitionProps.
93
+ */
94
+ transitionProps?: Partial<TransitionProps>;
95
+ /**
96
+ * Идентификатор для систем автоматизированного тестирования
97
+ */
98
+ dataTestId?: string;
99
+ /**
100
+ * z-index компонента
101
+ */
102
+ zIndex?: number;
103
+ /**
104
+ * Будет ли свайпаться шторка
105
+ * @default true
106
+ */
107
+ swipeable?: boolean;
108
+ /**
109
+ * Будет ли свайпаться контент
110
+ */
111
+ swipeableContent?: boolean;
112
+ /**
113
+ * Порог свайпа
114
+ */
115
+ swipeThreshold?: number;
116
+ /**
117
+ * Слот слева
118
+ */
119
+ leftAddons?: ReactNode;
120
+ /**
121
+ * Слот справа
122
+ */
123
+ rightAddons?: ReactNode;
124
+ /**
125
+ * Слот снизу
126
+ */
127
+ bottomAddons?: ReactNode;
128
+ /**
129
+ * Наличие компонента крестика
130
+ */
131
+ hasCloser?: boolean;
132
+ /**
133
+ * Наличие компонента стрелки назад
134
+ */
135
+ hasBacker?: boolean;
136
+ /**
137
+ * Выравнивание заголовка
138
+ */
139
+ titleAlign?: BottomSheetTitleAlign;
140
+ /**
141
+ * Фиксирует шапку
142
+ */
143
+ stickyHeader?: boolean;
144
+ /**
145
+ * Фиксирует футер
146
+ */
147
+ stickyFooter?: boolean;
148
+ /**
149
+ * Высота шторки
150
+ */
151
+ initialHeight?: 'default' | 'full';
152
+ /**
153
+ * Будет ли виден оверлэй
154
+ */
155
+ hideOverlay?: boolean;
156
+ /**
157
+ * Будет ли видна шапка
158
+ */
159
+ hideHeader?: boolean;
160
+ /**
161
+ * Будет ли обрезан заголовок
162
+ */
163
+ trimTitle?: boolean;
164
+ /**
165
+ * Запретить закрытие шторки кликом на оверлэй
166
+ */
167
+ disableOverlayClick?: boolean;
168
+ /**
169
+ * Отключает блокировку скролла при открытии модального окна
170
+ */
171
+ disableBlockingScroll?: boolean;
172
+ /**
173
+ * Отключает ловушку фокуса
174
+ */
175
+ disableFocusLock?: boolean;
176
+ /**
177
+ * @deprecated данный проп больше не используется, временно оставлен для обратной совместимости
178
+ * Не анимировать шторку при изменении размера вьюпорта
179
+ */
180
+ ignoreScreenChange?: boolean;
181
+ /**
182
+ * Свойства для Бэкдропа
183
+ */
184
+ backdropProps?: BaseModalProps['backdropProps'];
185
+ /**
186
+ * Реф на контейнер, в котором происходит скролл
187
+ */
188
+ scrollableContainerRef?: RefObject<HTMLElement>;
189
+ /**
190
+ * Реф для управления компонентом.
191
+ */
192
+ bottomSheetInstanceRef?: RefObject<{
193
+ scrollToArea: (idx: number) => void;
194
+ }>;
195
+ /**
196
+ * Реф на контейнер, в котором находится шторка
197
+ */
198
+ sheetContainerRef?: RefObject<HTMLElement>;
199
+ /**
200
+ * Магнитные области видимой высоты шторки.
201
+ * Можно использовать значения в пикселях - 10(число), либо в процентах - 10%(строка).
202
+ * По-умолчанию -[0, window.innerHeight - '24px']
203
+ * массив должен состоять минимум из 2 элементов
204
+ */
205
+ magneticAreas?: Array<number | string>;
206
+ /**
207
+ * Индекс точки из magneticAreas, к которому нужно примагнититься при первом открытии шторки.
208
+ */
209
+ initialActiveAreaIndex?: number;
210
+ /**
211
+ * Отключает скролл контентной области.
212
+ */
213
+ scrollLocked?: boolean;
214
+ /**
215
+ * Скрыть скроллбар внутри шторки
216
+ */
217
+ hideScrollbar?: boolean;
218
+ /**
219
+ * Верхний отступ шторки, если она открыта на максимальную высоту
220
+ */
221
+ headerOffset?: number;
222
+ /**
223
+ * Содержимое bottom-sheet всегда в DOM
224
+ */
225
+ keepMounted?: boolean;
226
+ /**
227
+ * Отключает автоматический перевод фокуса на bottom-sheet при открытии
228
+ */
229
+ disableAutoFocus?: boolean;
230
+ /**
231
+ * Отключает восстановление фокуса на предыдущем элементе после закрытия bottom-sheet
232
+ */
233
+ disableRestoreFocus?: boolean;
234
+ /**
235
+ * Отключает вызов `onClose` при нажатии Escape
236
+ */
237
+ disableEscapeKeyDown?: boolean;
238
+ /**
239
+ * Обработчик закрытия
240
+ */
241
+ onClose: () => void;
242
+ /**
243
+ * Обработчик нажатия на стрелку назад
244
+ */
245
+ onBack?: () => void;
246
+ /**
247
+ * Вызывается в начале анимации притягивания к одной из `magneticAreas`
248
+ */
249
+ onMagnetize?: (index: number) => void;
250
+ /**
251
+ * Вызывается после окончания анимации притягивания
252
+ */
253
+ onMagnetizeEnd?: () => void;
254
+ /**
255
+ * Вызывается при изменении положения шторки
256
+ */
257
+ onOffsetChange?: (offset: number, percent: number) => void;
258
+ };
259
+ export { BottomSheetTitleAlign, BottomSheetProps };
@@ -0,0 +1,113 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { ReactNode } from "react";
4
+ import { CloserProps } from "./index-ebda875c";
5
+ type NavigationBarProps = {
6
+ /**
7
+ * Контент шапки
8
+ */
9
+ children?: ReactNode;
10
+ /**
11
+ * Заголовок шапки
12
+ */
13
+ title?: string;
14
+ /**
15
+ * Подзаголовок (доступен только в мобильной версии)
16
+ */
17
+ subtitle?: string;
18
+ /**
19
+ * Размер заголовка (compact доступен только в мобильной версии)
20
+ */
21
+ titleSize?: 'default' | 'compact';
22
+ /**
23
+ * Доп. класс для аддонов
24
+ */
25
+ addonClassName?: string;
26
+ /**
27
+ * Слот слева
28
+ */
29
+ leftAddons?: ReactNode;
30
+ /**
31
+ * Слот справа
32
+ */
33
+ rightAddons?: ReactNode;
34
+ /**
35
+ * Дополнительный класс для closer
36
+ */
37
+ closerClassName?: string;
38
+ /**
39
+ * Слот снизу
40
+ */
41
+ bottomAddons?: ReactNode;
42
+ /**
43
+ * Наличие компонента крестика
44
+ */
45
+ hasCloser?: boolean;
46
+ /**
47
+ * Наличие кнопки "Назад"
48
+ */
49
+ hasBackButton?: boolean;
50
+ /**
51
+ * Дополнительный класс для правого аддона
52
+ */
53
+ backButtonClassName?: string;
54
+ /**
55
+ * Дополнительный класс
56
+ */
57
+ className?: string;
58
+ /**
59
+ * Дополнительный класс для контента
60
+ */
61
+ contentClassName?: string;
62
+ /**
63
+ * Дополнительный класс для нижнего аддона
64
+ */
65
+ bottomAddonsClassName?: string;
66
+ /**
67
+ * Выравнивание заголовка
68
+ */
69
+ align?: 'left' | 'center';
70
+ /**
71
+ * Обрезать ли заголовок
72
+ */
73
+ trim?: boolean;
74
+ /**
75
+ * Фиксирует шапку
76
+ */
77
+ sticky?: boolean;
78
+ /**
79
+ * Идентификатор для систем автоматизированного тестирования
80
+ */
81
+ dataTestId?: string;
82
+ /**
83
+ * Фоновое изображение
84
+ */
85
+ imageUrl?: string;
86
+ /**
87
+ * Иконка closer.
88
+ */
89
+ closerIcon?: React.ElementType;
90
+ /**
91
+ * Обработчик закрытия
92
+ */
93
+ onClose?: CloserProps['onClose'];
94
+ /**
95
+ * обработчик клика по кнопке "назад"
96
+ */
97
+ onBack?: () => void;
98
+ /**
99
+ * Вид шапки - мобильный или десктоп
100
+ */
101
+ view: 'desktop' | 'mobile';
102
+ /**
103
+ * Ссылка на родительскую ноду overflow: auto
104
+ */
105
+ scrollableParentRef?: React.RefObject<HTMLDivElement>;
106
+ };
107
+ type ContentParams = {
108
+ extraClassName?: string;
109
+ wrapperRef?: React.RefObject<HTMLDivElement>;
110
+ style?: React.CSSProperties;
111
+ hidden?: boolean;
112
+ };
113
+ export { NavigationBarProps, ContentParams };
@@ -0,0 +1,3 @@
1
+ type PickerButtonSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl';
2
+ type PickerButtonVariant = 'default' | 'compact';
3
+ export { PickerButtonSize, PickerButtonVariant };