@consta/uikit 3.7.0 → 3.8.0

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 (329) hide show
  1. package/Attach/package.json +1 -1
  2. package/Attachment/package.json +1 -1
  3. package/Avatar/package.json +1 -1
  4. package/Badge/package.json +1 -1
  5. package/BasicSelectDeprecated/package.json +1 -1
  6. package/Breadcrumbs/package.json +1 -1
  7. package/Button/package.json +1 -1
  8. package/CHANGELOG.md +16 -11
  9. package/Calendar/package.json +1 -1
  10. package/Card/package.json +1 -1
  11. package/Checkbox/package.json +1 -1
  12. package/CheckboxGroup/package.json +1 -1
  13. package/ChoiceGroup/package.json +1 -1
  14. package/Collapse/package.json +1 -1
  15. package/CollapseGroup/package.json +1 -1
  16. package/Combobox/package.json +1 -1
  17. package/ComboboxDeprecated/package.json +1 -1
  18. package/ContextMenu/package.json +1 -1
  19. package/DatePickerCanary/package.json +1 -1
  20. package/DateTimeCanary/package.json +1 -1
  21. package/DragNDropField/package.json +1 -1
  22. package/EventInterceptor/package.json +1 -1
  23. package/FieldCaption/package.json +1 -1
  24. package/FieldLabel/package.json +1 -1
  25. package/File/package.json +1 -1
  26. package/FileField/package.json +1 -1
  27. package/FileIcon/package.json +1 -1
  28. package/FileIconAvi/package.json +1 -1
  29. package/FileIconBmp/package.json +1 -1
  30. package/FileIconCsv/package.json +1 -1
  31. package/FileIconDoc/package.json +1 -1
  32. package/FileIconExe/package.json +1 -1
  33. package/FileIconGif/package.json +1 -1
  34. package/FileIconJpg/package.json +1 -1
  35. package/FileIconJson/package.json +1 -1
  36. package/FileIconLoading/package.json +1 -1
  37. package/FileIconMov/package.json +1 -1
  38. package/FileIconMp3/package.json +1 -1
  39. package/FileIconMp4/package.json +1 -1
  40. package/FileIconPdf/package.json +1 -1
  41. package/FileIconPng/package.json +1 -1
  42. package/FileIconPtt/package.json +1 -1
  43. package/FileIconRar/package.json +1 -1
  44. package/FileIconRtf/package.json +1 -1
  45. package/FileIconTiff/package.json +1 -1
  46. package/FileIconTxt/package.json +1 -1
  47. package/FileIconUndefined/package.json +1 -1
  48. package/FileIconWav/package.json +1 -1
  49. package/FileIconXls/package.json +1 -1
  50. package/FileIconZip/package.json +1 -1
  51. package/Grid/package.json +1 -1
  52. package/Header/package.json +1 -1
  53. package/Icon/package.json +1 -1
  54. package/IconAdd/package.json +1 -1
  55. package/IconAddToComparison/package.json +1 -1
  56. package/IconAlert/package.json +1 -1
  57. package/IconAlignBlocksLeft/package.json +1 -1
  58. package/IconAlignBlocksRight/package.json +1 -1
  59. package/IconAlignCenter/package.json +1 -1
  60. package/IconAlignJustify/package.json +1 -1
  61. package/IconAlignLeft/package.json +1 -1
  62. package/IconAlignRight/package.json +1 -1
  63. package/IconAllDone/package.json +1 -1
  64. package/IconArrowDown/package.json +1 -1
  65. package/IconArrowLeft/package.json +1 -1
  66. package/IconArrowRight/package.json +1 -1
  67. package/IconArrowUp/package.json +1 -1
  68. package/IconArtBrush/package.json +1 -1
  69. package/IconAttach/package.json +1 -1
  70. package/IconBackward/package.json +1 -1
  71. package/IconBag/package.json +1 -1
  72. package/IconBarrier/package.json +1 -1
  73. package/IconBento/package.json +1 -1
  74. package/IconBold/package.json +1 -1
  75. package/IconBook/package.json +1 -1
  76. package/IconBookmarkFilled/package.json +1 -1
  77. package/IconBookmarkStroked/package.json +1 -1
  78. package/IconCalculator/package.json +1 -1
  79. package/IconCalendar/package.json +1 -1
  80. package/IconCamera/package.json +1 -1
  81. package/IconCancel/package.json +1 -1
  82. package/IconCards/package.json +1 -1
  83. package/IconChat/package.json +1 -1
  84. package/IconCheck/package.json +1 -1
  85. package/IconClose/package.json +1 -1
  86. package/IconCollapse/package.json +1 -1
  87. package/IconColorFill/package.json +1 -1
  88. package/IconColorText/package.json +1 -1
  89. package/IconColumns/package.json +1 -1
  90. package/IconComment/package.json +1 -1
  91. package/IconConnection/package.json +1 -1
  92. package/IconCopy/package.json +1 -1
  93. package/IconCrown/package.json +1 -1
  94. package/IconCursorMouse/package.json +1 -1
  95. package/IconDataNull/package.json +1 -1
  96. package/IconDiamond/package.json +1 -1
  97. package/IconDinosaur/package.json +1 -1
  98. package/IconDisconnection/package.json +1 -1
  99. package/IconDocAdd/package.json +1 -1
  100. package/IconDocBlank/package.json +1 -1
  101. package/IconDocDelete/package.json +1 -1
  102. package/IconDocExport/package.json +1 -1
  103. package/IconDocFilled/package.json +1 -1
  104. package/IconDown/package.json +1 -1
  105. package/IconDownload/package.json +1 -1
  106. package/IconDrag/package.json +1 -1
  107. package/IconDraggable/package.json +1 -1
  108. package/IconDrillingRig/package.json +1 -1
  109. package/IconDrop/package.json +1 -1
  110. package/IconEdit/package.json +1 -1
  111. package/IconExit/package.json +1 -1
  112. package/IconExpand/package.json +1 -1
  113. package/IconEye/package.json +1 -1
  114. package/IconEyeClose/package.json +1 -1
  115. package/IconFavorite/package.json +1 -1
  116. package/IconFilter/package.json +1 -1
  117. package/IconFitToDefault/package.json +1 -1
  118. package/IconFlagFilled/package.json +1 -1
  119. package/IconFlagStroked/package.json +1 -1
  120. package/IconFolders/package.json +1 -1
  121. package/IconForward/package.json +1 -1
  122. package/IconFunnel/package.json +1 -1
  123. package/IconGas/package.json +1 -1
  124. package/IconGeo/package.json +1 -1
  125. package/IconGrouping/package.json +1 -1
  126. package/IconHamburger/package.json +1 -1
  127. package/IconHand/package.json +1 -1
  128. package/IconHealth/package.json +1 -1
  129. package/IconInComparison/package.json +1 -1
  130. package/IconInfo/package.json +1 -1
  131. package/IconIntroduction/package.json +1 -1
  132. package/IconIpad/package.json +1 -1
  133. package/IconItalic/package.json +1 -1
  134. package/IconKebab/package.json +1 -1
  135. package/IconLaptop/package.json +1 -1
  136. package/IconLayers/package.json +1 -1
  137. package/IconLeaf/package.json +1 -1
  138. package/IconLightningBolt/package.json +1 -1
  139. package/IconLineAndBarChart/package.json +1 -1
  140. package/IconLink/package.json +1 -1
  141. package/IconList/package.json +1 -1
  142. package/IconListNumbered/package.json +1 -1
  143. package/IconLock/package.json +1 -1
  144. package/IconLogicalElement/package.json +1 -1
  145. package/IconMBU/package.json +1 -1
  146. package/IconMGRP/package.json +1 -1
  147. package/IconMLSP/package.json +1 -1
  148. package/IconMMP/package.json +1 -1
  149. package/IconMail/package.json +1 -1
  150. package/IconMap/package.json +1 -1
  151. package/IconMaxHeight/package.json +1 -1
  152. package/IconMaxWidth/package.json +1 -1
  153. package/IconMeatball/package.json +1 -1
  154. package/IconMic/package.json +1 -1
  155. package/IconMolecules/package.json +1 -1
  156. package/IconMoon/package.json +1 -1
  157. package/IconNodeEnd/package.json +1 -1
  158. package/IconNodeStart/package.json +1 -1
  159. package/IconNodeStep/package.json +1 -1
  160. package/IconNodes/package.json +1 -1
  161. package/IconOpenInNew/package.json +1 -1
  162. package/IconPanelBottom/package.json +1 -1
  163. package/IconPanelLeft/package.json +1 -1
  164. package/IconPanelRight/package.json +1 -1
  165. package/IconPanelTop/package.json +1 -1
  166. package/IconPaste/package.json +1 -1
  167. package/IconPause/package.json +1 -1
  168. package/IconPhone/package.json +1 -1
  169. package/IconPhoto/package.json +1 -1
  170. package/IconPlay/package.json +1 -1
  171. package/IconPressure/package.json +1 -1
  172. package/IconProcessing/package.json +1 -1
  173. package/IconQuestion/package.json +1 -1
  174. package/IconQuote/package.json +1 -1
  175. package/IconRUO/package.json +1 -1
  176. package/IconRUS/package.json +1 -1
  177. package/IconRecord/package.json +1 -1
  178. package/IconRemove/package.json +1 -1
  179. package/IconRemoveFromComparison/package.json +1 -1
  180. package/IconReply/package.json +1 -1
  181. package/IconResize/package.json +1 -1
  182. package/IconRestart/package.json +1 -1
  183. package/IconRevert/package.json +1 -1
  184. package/IconRing/package.json +1 -1
  185. package/IconRouble/package.json +1 -1
  186. package/IconRuler/package.json +1 -1
  187. package/IconScreen/package.json +1 -1
  188. package/IconSearch/package.json +1 -1
  189. package/IconSelect/package.json +1 -1
  190. package/IconSelectOpen/package.json +1 -1
  191. package/IconSettings/package.json +1 -1
  192. package/IconShape/package.json +1 -1
  193. package/IconShuffle/package.json +1 -1
  194. package/IconSmile/package.json +1 -1
  195. package/IconSortDown/package.json +1 -1
  196. package/IconSortDownCenter/package.json +1 -1
  197. package/IconSortUp/package.json +1 -1
  198. package/IconSortUpCenter/package.json +1 -1
  199. package/IconStop/package.json +1 -1
  200. package/IconStorage/package.json +1 -1
  201. package/IconStrikethrough/package.json +1 -1
  202. package/IconSun/package.json +1 -1
  203. package/IconTable/package.json +1 -1
  204. package/IconTarget/package.json +1 -1
  205. package/IconTeam/package.json +1 -1
  206. package/IconTest/package.json +1 -1
  207. package/IconThumbUp/package.json +1 -1
  208. package/IconTie/package.json +1 -1
  209. package/IconTop/package.json +1 -1
  210. package/IconTrash/package.json +1 -1
  211. package/IconType/package.json +1 -1
  212. package/IconUnderline/package.json +1 -1
  213. package/IconUnlock/package.json +1 -1
  214. package/IconUnsort/package.json +1 -1
  215. package/IconUnsortCenter/package.json +1 -1
  216. package/IconUpload/package.json +1 -1
  217. package/IconUser/package.json +1 -1
  218. package/IconVZD/package.json +1 -1
  219. package/IconVideo/package.json +1 -1
  220. package/IconWarning/package.json +1 -1
  221. package/IconWatch/package.json +1 -1
  222. package/IconWideScreen/package.json +1 -1
  223. package/IconWorld/package.json +1 -1
  224. package/Informer/package.json +1 -1
  225. package/LayoutCanary/package.json +1 -1
  226. package/Loader/package.json +1 -1
  227. package/MixCard/package.json +1 -1
  228. package/MixFocus/package.json +1 -1
  229. package/MixVisuallyHidden/package.json +1 -1
  230. package/Modal/package.json +1 -1
  231. package/MultiComboboxDeprecated/package.json +1 -1
  232. package/Pagination/package.json +1 -1
  233. package/Popover/package.json +1 -1
  234. package/PortalWithTheme/package.json +1 -1
  235. package/ProgressSpin/package.json +1 -1
  236. package/ProgressStepBarCanary/es.js +1 -0
  237. package/ProgressStepBarCanary/index.d.ts +1 -0
  238. package/ProgressStepBarCanary/index.js +4 -0
  239. package/ProgressStepBarCanary/package.json +9 -0
  240. package/Radio/package.json +1 -1
  241. package/RadioGroup/package.json +1 -1
  242. package/Responses/package.json +1 -1
  243. package/Responses403/package.json +1 -1
  244. package/Responses404/package.json +1 -1
  245. package/Responses500/package.json +1 -1
  246. package/Responses503/package.json +1 -1
  247. package/ResponsesConnectionError/package.json +1 -1
  248. package/ResponsesDeleted/package.json +1 -1
  249. package/ResponsesEmptyBox/package.json +1 -1
  250. package/ResponsesEmptyPockets/package.json +1 -1
  251. package/ResponsesImage/package.json +1 -1
  252. package/ResponsesImage403/package.json +1 -1
  253. package/ResponsesImage404/package.json +1 -1
  254. package/ResponsesImage500/package.json +1 -1
  255. package/ResponsesImage503/package.json +1 -1
  256. package/ResponsesImageConnectionError/package.json +1 -1
  257. package/ResponsesImageDeleted/package.json +1 -1
  258. package/ResponsesImageEmptyBox/package.json +1 -1
  259. package/ResponsesImageEmptyPockets/package.json +1 -1
  260. package/ResponsesImageNothingFound/package.json +1 -1
  261. package/ResponsesImageSuccess/package.json +1 -1
  262. package/ResponsesNothingFound/package.json +1 -1
  263. package/ResponsesSuccess/package.json +1 -1
  264. package/Select/package.json +1 -1
  265. package/Sidebar/package.json +1 -1
  266. package/Skeleton/package.json +1 -1
  267. package/SnackBar/package.json +1 -1
  268. package/Steps/package.json +1 -1
  269. package/Switch/package.json +1 -1
  270. package/SwitchGroup/package.json +1 -1
  271. package/Table/package.json +1 -1
  272. package/Tabs/package.json +1 -1
  273. package/Tag/package.json +1 -1
  274. package/TagBase/package.json +1 -1
  275. package/Text/package.json +1 -1
  276. package/TextField/package.json +1 -1
  277. package/Theme/package.json +1 -1
  278. package/ThemeToggler/package.json +1 -1
  279. package/Timer/package.json +1 -1
  280. package/Tooltip/package.json +1 -1
  281. package/User/package.json +1 -1
  282. package/UserSelect/package.json +1 -1
  283. package/UserSelectDeprecated/package.json +1 -1
  284. package/__internal__/cjs-src/components/Modal/Modal.css +5 -0
  285. package/__internal__/cjs-src/components/Modal/Modal.js +1 -1
  286. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBar.css +25 -0
  287. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarCanary.d.ts +3 -0
  288. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarCanary.js +72 -0
  289. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.css +170 -0
  290. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.d.ts +3 -0
  291. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.js +67 -0
  292. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.css +50 -0
  293. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.d.ts +11 -0
  294. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.js +45 -0
  295. package/__internal__/cjs-src/components/ProgressStepBarCanary/helpers.d.ts +106 -0
  296. package/__internal__/cjs-src/components/ProgressStepBarCanary/helpers.js +30 -0
  297. package/__internal__/src/components/Modal/Modal.css +5 -0
  298. package/__internal__/src/components/Modal/Modal.js +1 -1
  299. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBar.css +25 -0
  300. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarCanary.d.ts +3 -0
  301. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarCanary.js +69 -0
  302. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.css +170 -0
  303. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.d.ts +3 -0
  304. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.js +64 -0
  305. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.css +50 -0
  306. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.d.ts +11 -0
  307. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.js +42 -0
  308. package/__internal__/src/components/ProgressStepBarCanary/helpers.d.ts +106 -0
  309. package/__internal__/src/components/ProgressStepBarCanary/helpers.js +26 -0
  310. package/createIcon/package.json +1 -1
  311. package/createResponsesImage/package.json +1 -1
  312. package/package.json +2 -1
  313. package/useChoiceGroup/package.json +1 -1
  314. package/useChoiceGroupIndexed/package.json +1 -1
  315. package/useClickOutside/package.json +1 -1
  316. package/useComponentSize/package.json +1 -1
  317. package/useDebounce/package.json +1 -1
  318. package/useFlag/package.json +1 -1
  319. package/useForkRef/package.json +1 -1
  320. package/useGlobalKeys/package.json +1 -1
  321. package/useKeys/package.json +1 -1
  322. package/useMutableRef/package.json +1 -1
  323. package/usePrevious/package.json +1 -1
  324. package/useResizeObserved/package.json +1 -1
  325. package/useScrollPosition/package.json +1 -1
  326. package/useSelect/package.json +1 -1
  327. package/useThemeVars/package.json +1 -1
  328. package/useTimer/package.json +1 -1
  329. package/withTooltip/package.json +1 -1
@@ -0,0 +1,106 @@
1
+ import React from 'react';
2
+ import { IconProps } from '../../icons/Icon/Icon';
3
+ import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
4
+ export declare const propSize: readonly ["s", "xs", "m"];
5
+ export declare type PropSize = typeof propSize[number];
6
+ export declare const propSizeDefault: "s";
7
+ export declare const propDirection: readonly ["horizontal", "vertical"];
8
+ export declare type PropDirection = typeof propDirection[number];
9
+ export declare const propDirectionDefault: "horizontal";
10
+ export declare const propStatus: readonly ["normal", "success", "warning", "alert"];
11
+ export declare type PropStatus = typeof propStatus[number];
12
+ export declare const propStatusDefault: "normal";
13
+ export declare const pointNumbersMap: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
14
+ export declare type PointNumbersMap = typeof pointNumbersMap[number];
15
+ export declare const propPosition: readonly ["center", "start", "end"];
16
+ export declare type PropPosition = typeof propPosition[number];
17
+ export declare const propPositionDefault: PropPosition;
18
+ export declare type PropGetItemLabel<ITEM> = (item: ITEM) => string;
19
+ export declare type PropGetItemKey<ITEM> = (item: ITEM) => string | number;
20
+ export declare type PropGetItemTooltipContent<ITEM> = (item: ITEM) => string | undefined;
21
+ export declare type PropGetItemLineStatus<ITEM> = (item: ITEM) => PropStatus | undefined;
22
+ export declare type PropGetItemPoint<ITEM> = (item: ITEM) => PointNumbersMap | React.FC<IconProps> | undefined;
23
+ export declare type PropGetItemProgress<ITEM> = (item: ITEM) => boolean | undefined;
24
+ export declare type PropGetItemContent<ITEM> = (item: ITEM) => React.ReactNode | undefined;
25
+ export declare type PropGetItemStatus<ITEM> = (item: ITEM) => PropStatus | 'system' | undefined;
26
+ export declare type PropGetItemOnCLick<ITEM> = (item: ITEM) => React.EventHandler<React.MouseEvent> | undefined;
27
+ export declare type DefaultItem = {
28
+ label: string;
29
+ tooltipContent?: string;
30
+ lineStatus?: PropStatus;
31
+ point?: PointNumbersMap | React.FC<IconProps>;
32
+ status?: PropStatus | 'system';
33
+ progress?: boolean;
34
+ content?: React.ReactNode;
35
+ };
36
+ export declare type Line = {
37
+ status: PropStatus;
38
+ size: number;
39
+ };
40
+ export declare type ProgressStepBarProps<ITEM = DefaultItem> = PropsWithHTMLAttributesAndRef<{
41
+ steps: ITEM[];
42
+ direction?: PropDirection;
43
+ size?: PropSize;
44
+ activeStepIndex?: number;
45
+ onClick?: (e: React.MouseEvent, item: ITEM, index: number) => void;
46
+ getItemLabel?: PropGetItemLabel<ITEM>;
47
+ getItemLineStatus?: PropGetItemLineStatus<ITEM>;
48
+ getItemTooltipContent?: PropGetItemTooltipContent<ITEM>;
49
+ getItemPoint?: PropGetItemPoint<ITEM>;
50
+ getItemProgress?: PropGetItemProgress<ITEM>;
51
+ getItemContent?: PropGetItemContent<ITEM>;
52
+ getItemStatus?: PropGetItemStatus<ITEM>;
53
+ }, HTMLDivElement> & (ITEM extends {
54
+ label: DefaultItem['label'];
55
+ } ? {} : {
56
+ getItemLabel: PropGetItemLabel<ITEM>;
57
+ });
58
+ export declare type ProgressStepBarItemProps = {
59
+ content?: React.ReactNode;
60
+ label: string;
61
+ point?: PointNumbersMap | React.FC<IconProps>;
62
+ progress?: boolean;
63
+ status?: PropStatus | 'system';
64
+ tooltipContent?: string;
65
+ position?: PropPosition;
66
+ direction: PropDirection;
67
+ size: PropSize;
68
+ onClick?: (e: React.MouseEvent) => void;
69
+ pointRef?: React.RefObject<HTMLButtonElement> | React.RefObject<HTMLDivElement>;
70
+ };
71
+ export declare const cnProgressStepBar: import("@bem-react/classname").ClassNameFormatter;
72
+ export declare const defaultGetItemLabel: PropGetItemLabel<DefaultItem>;
73
+ export declare const defaultGetItemTooltipContent: PropGetItemTooltipContent<DefaultItem>;
74
+ export declare const defaultGetItemPoint: PropGetItemPoint<DefaultItem>;
75
+ export declare const defaultGetItemLineStatus: PropGetItemLineStatus<DefaultItem>;
76
+ export declare const defaultGetItemProgress: PropGetItemProgress<DefaultItem>;
77
+ export declare const defaultGetItemContent: PropGetItemContent<DefaultItem>;
78
+ export declare const defaultGetItemStatus: PropGetItemStatus<DefaultItem>;
79
+ export declare type ProgressStepBarComponent = <ITEM = DefaultItem>(props: ProgressStepBarProps<ITEM>) => React.ReactElement | null;
80
+ export declare type ProgressStepBarItemComponent = (props: ProgressStepBarItemProps) => React.ReactElement | null;
81
+ export declare function withDefaultGetters<ITEM>(props: ProgressStepBarProps<ITEM>): {
82
+ steps: ITEM[];
83
+ direction?: "horizontal" | "vertical" | undefined;
84
+ size?: "xs" | "s" | "m" | undefined;
85
+ activeStepIndex?: number | undefined;
86
+ onClick?: ((e: React.MouseEvent<Element, MouseEvent>, item: ITEM, index: number) => void) | undefined;
87
+ getItemLabel?: PropGetItemLabel<ITEM> | undefined;
88
+ getItemLineStatus?: PropGetItemLineStatus<ITEM> | undefined;
89
+ getItemTooltipContent?: PropGetItemTooltipContent<ITEM> | undefined;
90
+ getItemPoint?: PropGetItemPoint<ITEM> | undefined;
91
+ getItemProgress?: PropGetItemProgress<ITEM> | undefined;
92
+ getItemContent?: PropGetItemContent<ITEM> | undefined;
93
+ getItemStatus?: PropGetItemStatus<ITEM> | undefined;
94
+ } & Pick<React.HTMLAttributes<HTMLDivElement>, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLDivElement> & (ITEM extends {
95
+ label: string;
96
+ } ? {} : {
97
+ getItemLabel: PropGetItemLabel<ITEM>;
98
+ }) & {
99
+ getItemLabel: PropGetItemLabel<DefaultItem> | PropGetItemLabel<ITEM>;
100
+ getItemTooltipContent: PropGetItemTooltipContent<DefaultItem> | PropGetItemTooltipContent<ITEM>;
101
+ getItemPoint: PropGetItemPoint<DefaultItem> | PropGetItemPoint<ITEM>;
102
+ getItemProgress: PropGetItemProgress<DefaultItem> | PropGetItemProgress<ITEM>;
103
+ getItemContent: PropGetItemContent<DefaultItem> | PropGetItemContent<ITEM>;
104
+ getItemStatus: PropGetItemStatus<DefaultItem> | PropGetItemStatus<ITEM>;
105
+ getItemLineStatus: PropGetItemLineStatus<DefaultItem> | PropGetItemLineStatus<ITEM>;
106
+ };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.withDefaultGetters = exports.defaultGetItemStatus = exports.defaultGetItemContent = exports.defaultGetItemProgress = exports.defaultGetItemLineStatus = exports.defaultGetItemPoint = exports.defaultGetItemTooltipContent = exports.defaultGetItemLabel = exports.cnProgressStepBar = exports.propPositionDefault = exports.propPosition = exports.pointNumbersMap = exports.propStatusDefault = exports.propStatus = exports.propDirectionDefault = exports.propDirection = exports.propSizeDefault = exports.propSize = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var bem_1 = require("../../utils/bem");
6
+ exports.propSize = ['s', 'xs', 'm'];
7
+ exports.propSizeDefault = exports.propSize[0];
8
+ exports.propDirection = ['horizontal', 'vertical'];
9
+ exports.propDirectionDefault = exports.propDirection[0];
10
+ exports.propStatus = ['normal', 'success', 'warning', 'alert'];
11
+ exports.propStatusDefault = exports.propStatus[0];
12
+ exports.pointNumbersMap = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
13
+ exports.propPosition = ['center', 'start', 'end'];
14
+ exports.propPositionDefault = exports.propPosition[0];
15
+ exports.cnProgressStepBar = bem_1.cn('ProgressStepBar');
16
+ exports.defaultGetItemLabel = function (item) { return item.label; };
17
+ exports.defaultGetItemTooltipContent = function (item) {
18
+ return item.tooltipContent;
19
+ };
20
+ exports.defaultGetItemPoint = function (item) { return item.point; };
21
+ exports.defaultGetItemLineStatus = function (item) {
22
+ return item.lineStatus;
23
+ };
24
+ exports.defaultGetItemProgress = function (item) { return item.progress; };
25
+ exports.defaultGetItemContent = function (item) { return item.content; };
26
+ exports.defaultGetItemStatus = function (item) { return item.status; };
27
+ function withDefaultGetters(props) {
28
+ return tslib_1.__assign(tslib_1.__assign({}, props), { getItemLabel: props.getItemLabel || exports.defaultGetItemLabel, getItemTooltipContent: props.getItemTooltipContent || exports.defaultGetItemTooltipContent, getItemPoint: props.getItemPoint || exports.defaultGetItemPoint, getItemProgress: props.getItemProgress || exports.defaultGetItemProgress, getItemContent: props.getItemContent || exports.defaultGetItemContent, getItemStatus: props.getItemStatus || exports.defaultGetItemStatus, getItemLineStatus: props.getItemLineStatus || exports.defaultGetItemLineStatus });
29
+ }
30
+ exports.withDefaultGetters = withDefaultGetters;
@@ -13,6 +13,10 @@
13
13
  padding: var(--space-5xl);
14
14
  }
15
15
 
16
+ .Modal:not(.Modal_hasOverlay) {
17
+ pointer-events: none;
18
+ }
19
+
16
20
  .Modal-Window {
17
21
  z-index: 100;
18
22
  overflow: auto;
@@ -24,6 +28,7 @@
24
28
  border-radius: var(--control-radius);
25
29
  -webkit-box-shadow: var(--shadow-modal);
26
30
  box-shadow: var(--shadow-modal);
31
+ pointer-events: auto;
27
32
  }
28
33
 
29
34
  .Modal-Window_position_center {
@@ -45,7 +45,7 @@ export var Modal = function (props) {
45
45
  Escape: function (e) { return isOpen && onEsc && onEsc(e); }
46
46
  });
47
47
  return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, appear: true, classNames: cnForCssTransition(cnModal), timeout: 200, nodeRef: portalRef },
48
- React.createElement(PortalWithTheme, { preset: theme, container: container, className: cnModal(null, [rootClassName]), ref: portalRef },
48
+ React.createElement(PortalWithTheme, { preset: theme, container: container, className: cnModal({ hasOverlay: hasOverlay }, [rootClassName]), ref: portalRef },
49
49
  hasOverlay && React.createElement("div", { className: cnModal('Overlay'), "aria-label": "Overlay" }),
50
50
  React.createElement("div", __assign({ className: cnModal('Window', { width: width, position: position }, [className]), ref: ref }, rest),
51
51
  React.createElement(ContextConsumer, { onClickOutside: onClickOutside || onOverlayClick, ignoreClicksInsideRefs: __spread((refsForExcludeClickOutside || []), [ref]) }, children)))));
@@ -0,0 +1,25 @@
1
+ .ProgressStepBar {
2
+ position: relative;
3
+ display: -webkit-inline-box;
4
+ display: -ms-inline-flexbox;
5
+ display: inline-flex;
6
+ -webkit-box-pack: justify;
7
+ -ms-flex-pack: justify;
8
+ justify-content: space-between;
9
+ }
10
+
11
+ .ProgressStepBar_direction_horizontal {
12
+ -webkit-box-orient: horizontal;
13
+ -webkit-box-direction: normal;
14
+ -ms-flex-direction: row;
15
+ flex-direction: row;
16
+ width: 100%;
17
+ }
18
+
19
+ .ProgressStepBar_direction_vertical {
20
+ -webkit-box-orient: vertical;
21
+ -webkit-box-direction: normal;
22
+ -ms-flex-direction: column;
23
+ flex-direction: column;
24
+ height: 100%;
25
+ }
@@ -0,0 +1,3 @@
1
+ import './ProgressStepBar.css';
2
+ import { ProgressStepBarComponent } from './helpers';
3
+ export declare const ProgressStepBar: ProgressStepBarComponent;
@@ -0,0 +1,69 @@
1
+ import { __assign, __read, __rest } from "tslib";
2
+ import './ProgressStepBar.css';
3
+ import React, { createRef, forwardRef, useEffect, useMemo, useRef, useState } from 'react';
4
+ import { useComponentSize } from '../../hooks/useComponentSize/useComponentSize';
5
+ import { useForkRef } from '../../hooks/useForkRef/useForkRef';
6
+ import { ProgressStepBarItem } from './ProgressStepBarItem/ProgressStepBarItem';
7
+ import { ProgressStepBarLine } from './ProgressStepBarLine/ProgressStepBarLine';
8
+ import { cnProgressStepBar, propDirectionDefault, propSizeDefault, withDefaultGetters, } from './helpers';
9
+ function ProgressStepBarRender(props, ref) {
10
+ var _a = withDefaultGetters(props), _b = _a.steps, steps = _b === void 0 ? [] : _b, _c = _a.direction, direction = _c === void 0 ? propDirectionDefault : _c, _d = _a.size, size = _d === void 0 ? propSizeDefault : _d, className = _a.className, activeStepIndex = _a.activeStepIndex, onClick = _a.onClick, getItemContent = _a.getItemContent, getItemLabel = _a.getItemLabel, getItemPoint = _a.getItemPoint, getItemProgress = _a.getItemProgress, getItemStatus = _a.getItemStatus, getItemTooltipContent = _a.getItemTooltipContent, getItemLineStatus = _a.getItemLineStatus, otherProps = __rest(_a, ["steps", "direction", "size", "className", "activeStepIndex", "onClick", "getItemContent", "getItemLabel", "getItemPoint", "getItemProgress", "getItemStatus", "getItemTooltipContent", "getItemLineStatus"]);
11
+ var _e = __read(useState([]), 2), lines = _e[0], setLines = _e[1];
12
+ var containerRef = useRef(null);
13
+ var _f = useComponentSize(containerRef), width = _f.width, height = _f.height;
14
+ useEffect(function () {
15
+ if (steps.length > 0) {
16
+ var linesArray_1 = [];
17
+ steps.forEach(function (step, index) {
18
+ if (index !== steps.length - 1)
19
+ linesArray_1.push({
20
+ status: getItemLineStatus(step) || 'normal',
21
+ size: getLineSize(containerRef, stepsRef[index + 1])
22
+ });
23
+ });
24
+ setLines(linesArray_1);
25
+ }
26
+ }, [activeStepIndex, steps, direction, size, width, height]);
27
+ var stepsRef = useMemo(function () { return new Array(steps.length).fill(null).map(function () { return createRef(); }); }, [steps.length]);
28
+ var getLineSize = function (container, activeElement) {
29
+ var size = 0;
30
+ if (container && container.current && activeElement && activeElement.current) {
31
+ var containerPosition = container.current.getBoundingClientRect();
32
+ var activeElementPosition = activeElement.current.getBoundingClientRect();
33
+ if (direction === 'vertical')
34
+ size = activeElementPosition.y - containerPosition.y + activeElementPosition.height;
35
+ else
36
+ size = activeElementPosition.x - containerPosition.x;
37
+ }
38
+ return size;
39
+ };
40
+ var getStepItem = function (item, index) {
41
+ var position = 'center';
42
+ if (index === steps.length - 1)
43
+ position = 'end';
44
+ if (index === 0)
45
+ position = 'start';
46
+ return {
47
+ content: getItemContent(item),
48
+ label: getItemLabel(item),
49
+ point: getItemPoint(item),
50
+ progress: getItemProgress(item),
51
+ status: typeof activeStepIndex === 'number' && activeStepIndex >= index
52
+ ? getItemStatus(item)
53
+ : 'system',
54
+ tooltipContent: getItemTooltipContent(item),
55
+ size: size,
56
+ position: position,
57
+ pointRef: stepsRef[index],
58
+ direction: direction,
59
+ onClick: function (e) { return onClick === null || onClick === void 0 ? void 0 : onClick(e, item, index); }
60
+ };
61
+ };
62
+ return (React.createElement("div", __assign({ ref: useForkRef([ref, containerRef]) }, otherProps, { className: cnProgressStepBar({ direction: direction }, [className]) }),
63
+ React.createElement(ProgressStepBarLine, { lines: lines, size: size, direction: direction, activeStepIndex: activeStepIndex }),
64
+ steps.map(function (step, index) {
65
+ var item = getStepItem(step, index);
66
+ return React.createElement(ProgressStepBarItem, __assign({}, item));
67
+ })));
68
+ }
69
+ export var ProgressStepBar = forwardRef(ProgressStepBarRender);
@@ -0,0 +1,170 @@
1
+ .ProgressStepBarItem {
2
+ position: relative;
3
+ display: -webkit-inline-box;
4
+ display: -ms-inline-flexbox;
5
+ display: inline-flex;
6
+ -webkit-box-align: start;
7
+ -ms-flex-align: start;
8
+ align-items: flex-start;
9
+ width: 100%;
10
+ height: 100%;
11
+ }
12
+
13
+ .ProgressStepBarItem_direction_horizontal {
14
+ -webkit-box-orient: vertical;
15
+ -webkit-box-direction: normal;
16
+ -ms-flex-direction: column;
17
+ flex-direction: column;
18
+ }
19
+
20
+ .ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_xs {
21
+ margin-bottom: var(--space-2xs);
22
+ }
23
+
24
+ .ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_s,
25
+ .ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_m {
26
+ margin-bottom: var(--space-xs);
27
+ }
28
+
29
+ .ProgressStepBarItem_direction_vertical {
30
+ -webkit-box-orient: horizontal;
31
+ -webkit-box-direction: normal;
32
+ -ms-flex-direction: row;
33
+ flex-direction: row;
34
+ }
35
+
36
+ .ProgressStepBarItem_direction_vertical .ProgressStepBarItem-Point {
37
+ margin-right: var(--space-xs);
38
+ }
39
+
40
+ .ProgressStepBarItem_direction_vertical .ProgressStepBarItem-Content_size_xs {
41
+ margin-top: -4px;
42
+ }
43
+
44
+ .ProgressStepBarItem_size_xs {
45
+ --progress-step-bar-item-point-size: var(--space-xs);
46
+ --progress-step-bar-item-label-margin: var(--space-2xs);
47
+ }
48
+
49
+ .ProgressStepBarItem_size_s {
50
+ --progress-step-bar-item-point-size: var(--space-m);
51
+ --progress-step-bar-item-label-margin: var(--space-xs);
52
+ }
53
+
54
+ .ProgressStepBarItem_size_m {
55
+ --progress-step-bar-item-point-size: var(--space-xl);
56
+ --progress-step-bar-item-label-margin: var(--space-xs);
57
+ }
58
+
59
+ .ProgressStepBarItem_position_start {
60
+ -webkit-box-flex: 1;
61
+ -ms-flex: 1;
62
+ flex: 1;
63
+ }
64
+
65
+ .ProgressStepBarItem_position_start.ProgressStepBarItem_direction_horizontal,
66
+ .ProgressStepBarItem_position_start .ProgressStepBarItem-Content {
67
+ -webkit-box-align: start;
68
+ -ms-flex-align: start;
69
+ align-items: flex-start;
70
+ text-align: left;
71
+ }
72
+
73
+ .ProgressStepBarItem_position_center {
74
+ -webkit-box-flex: 2;
75
+ -ms-flex: 2;
76
+ flex: 2;
77
+ }
78
+
79
+ .ProgressStepBarItem_position_center.ProgressStepBarItem_direction_horizontal,
80
+ .ProgressStepBarItem_position_center .ProgressStepBarItemr-Content {
81
+ -webkit-box-align: center;
82
+ -ms-flex-align: center;
83
+ align-items: center;
84
+ text-align: center;
85
+ }
86
+
87
+ .ProgressStepBarItem_position_end {
88
+ -webkit-box-flex: 1;
89
+ -ms-flex: 1;
90
+ flex: 1;
91
+ }
92
+
93
+ .ProgressStepBarItem_position_end.ProgressStepBarItem_direction_horizontal,
94
+ .ProgressStepBarItem_position_end .ProgressStepBarItem-Content {
95
+ -webkit-box-align: end;
96
+ -ms-flex-align: end;
97
+ align-items: flex-end;
98
+ text-align: right;
99
+ }
100
+
101
+ .ProgressStepBarItem_status_system {
102
+ --progress-step-bar-item-point-background: var(--color-bg-system);
103
+ --progress-step-bar-item-point-content-color: var(--color-typo-secondary);
104
+ }
105
+
106
+ .ProgressStepBarItem_status_normal {
107
+ --progress-step-bar-item-point-background: var(--color-bg-normal);
108
+ --progress-step-bar-item-point-content-color: var(--color-bg-default);
109
+ }
110
+
111
+ .ProgressStepBarItem_status_success {
112
+ --progress-step-bar-item-point-background: var(--color-bg-success);
113
+ --progress-step-bar-item-point-content-color: var(--color-bg-default);
114
+ }
115
+
116
+ .ProgressStepBarItem_status_warning {
117
+ --progress-step-bar-item-point-background: var(--color-bg-warning);
118
+ --progress-step-bar-item-point-content-color: var(--color-bg-default);
119
+ }
120
+
121
+ .ProgressStepBarItem_status_alert {
122
+ --progress-step-bar-item-point-background: var(--color-bg-alert);
123
+ --progress-step-bar-item-point-content-color: var(--color-bg-default);
124
+ }
125
+
126
+ .ProgressStepBarItem .ProgressStepBarItem-PointText,
127
+ .ProgressStepBarItem .Icon {
128
+ color: var(--progress-step-bar-item-point-content-color);
129
+ }
130
+
131
+ .ProgressStepBarItem .ProgressSpin {
132
+ stroke: var(--progress-step-bar-item-point-content-color);
133
+ }
134
+
135
+ .ProgressStepBarItem-Point {
136
+ display: -webkit-box;
137
+ display: -ms-flexbox;
138
+ display: flex;
139
+ -webkit-box-pack: center;
140
+ -ms-flex-pack: center;
141
+ justify-content: center;
142
+ -webkit-box-align: center;
143
+ -ms-flex-align: center;
144
+ align-items: center;
145
+ min-width: var(--progress-step-bar-item-point-size);
146
+ min-height: var(--progress-step-bar-item-point-size);
147
+ margin: 0;
148
+ padding: 0;
149
+ color: var(--color-bg-default);
150
+ background-color: var(--progress-step-bar-item-point-background);
151
+ border: none;
152
+ border-radius: calc(var(--progress-step-bar-item-point-size) * 0.5);
153
+ cursor: pointer;
154
+ -webkit-transition: background-color 0.3s;
155
+ transition: background-color 0.3s;
156
+ }
157
+
158
+ .ProgressStepBarItem-PointText {
159
+ color: var(--color-typo-secondary);
160
+ -webkit-transition: color 0.3s;
161
+ transition: color 0.3s;
162
+ }
163
+
164
+ .ProgressStepBarItem-Label {
165
+ margin-bottom: var(--progress-step-bar-item-label-margin);
166
+ }
167
+
168
+ .ProgressStepBarItem-Content_bottomOffset {
169
+ margin-bottom: var(--progress-step-bar-item-label-margin);
170
+ }
@@ -0,0 +1,3 @@
1
+ import './ProgressStepBarItem.css';
2
+ import { ProgressStepBarItemComponent } from '../helpers';
3
+ export declare const ProgressStepBarItem: ProgressStepBarItemComponent;
@@ -0,0 +1,64 @@
1
+ import { __assign, __read, __rest } from "tslib";
2
+ import './ProgressStepBarItem.css';
3
+ import React, { useRef, useState } from 'react';
4
+ import { cnMixFocus } from '../../../mixs/MixFocus/MixFocus';
5
+ import { cn } from '../../../utils/bem';
6
+ import { ProgressSpin } from '../../ProgressSpin/ProgressSpin';
7
+ import { Text } from '../../Text/Text';
8
+ import { Tooltip } from '../../Tooltip/Tooltip';
9
+ import { propPositionDefault, propStatusDefault, } from '../helpers';
10
+ var cnProgressStepBarItem = cn('ProgressStepBarItem');
11
+ var possibleVerticalDirections = [
12
+ 'leftCenter',
13
+ 'rightCenter',
14
+ 'rightUp',
15
+ 'downCenter',
16
+ ];
17
+ var possibleHorizontalDirections = [
18
+ 'downCenter',
19
+ 'upCenter',
20
+ 'downStartLeft',
21
+ 'downStartRight',
22
+ ];
23
+ var renderPointContent = function (point, size, progress) {
24
+ if (!point)
25
+ return null;
26
+ if (progress)
27
+ return React.createElement(ProgressSpin, { size: size });
28
+ if (typeof point === 'number' || !point)
29
+ return (React.createElement(Text, { className: cnProgressStepBarItem('PointText'), size: size === 's' ? '2xs' : 'xs', weight: "bold" }, point));
30
+ var Icon = point;
31
+ return React.createElement(Icon, { size: "xs" });
32
+ };
33
+ export var ProgressStepBarItem = function (props) {
34
+ var content = props.content, tooltipContent = props.tooltipContent, label = props.label, point = props.point, status = props.status, progress = props.progress, direction = props.direction, size = props.size, pointRef = props.pointRef, onClick = props.onClick, _a = props.position, position = _a === void 0 ? propPositionDefault : _a, otherProps = __rest(props, ["content", "tooltipContent", "label", "point", "status", "progress", "direction", "size", "pointRef", "onClick", "position"]);
35
+ var _b = __read(useState(true), 2), isTooltipHidden = _b[0], setIsTooltipHidden = _b[1];
36
+ var anchorRef = useRef(null);
37
+ var pointProps = {
38
+ onMouseEnter: function () { return setIsTooltipHidden(false); },
39
+ onMouseLeave: function () { return setIsTooltipHidden(true); },
40
+ className: cnProgressStepBarItem('Point', {
41
+ size: size
42
+ }, [cnMixFocus()]),
43
+ children: size !== 'xs' && renderPointContent(point, size, progress)
44
+ };
45
+ var pointButtonProps = {
46
+ ref: pointRef,
47
+ onClick: function (e) { return onClick === null || onClick === void 0 ? void 0 : onClick(e); }
48
+ };
49
+ var pointDivButton = {
50
+ ref: pointRef
51
+ };
52
+ return (React.createElement(React.Fragment, null,
53
+ React.createElement("div", __assign({ className: cnProgressStepBarItem({
54
+ direction: direction,
55
+ position: position,
56
+ status: status || propStatusDefault,
57
+ size: size
58
+ }) }, otherProps),
59
+ onClick ? (React.createElement("button", __assign({ type: "button" }, pointButtonProps, pointProps))) : (React.createElement("div", __assign({}, pointProps, pointDivButton))),
60
+ React.createElement("div", { className: cnProgressStepBarItem('Content', { bottomOffset: !!content }) },
61
+ React.createElement(Text, { className: cnProgressStepBarItem('Label'), ref: anchorRef, size: size, onMouseEnter: function () { return setIsTooltipHidden(false); }, onMouseLeave: function () { return setIsTooltipHidden(true); }, lineHeight: size === 's' ? 'xs' : size, view: "primary" }, label),
62
+ content)),
63
+ tooltipContent && !isTooltipHidden && (React.createElement(Tooltip, { anchorRef: anchorRef, className: cnProgressStepBarItem('Tooltip'), direction: direction === 'horizontal' ? 'downCenter' : 'leftUp', possibleDirections: direction === 'horizontal' ? possibleHorizontalDirections : possibleVerticalDirections }, tooltipContent))));
64
+ };
@@ -0,0 +1,50 @@
1
+ .ProgressStepBarLine {
2
+ position: absolute;
3
+ top: var(--progress-step-bar-line-top);
4
+ left: var(--progress-step-bar-line-left);
5
+ overflow: hidden;
6
+ width: var(--progress-step-bar-line-width);
7
+ height: var(--progress-step-bar-line-height);
8
+ background: var(--line-background);
9
+ }
10
+
11
+ .ProgressStepBarLine_direction_horizontal {
12
+ --progress-step-bar-line-top: var(--progress-step-bar-line-padding);
13
+ --progress-step-bar-line-left: 0;
14
+ --progress-step-bar-line-width: var(--line-size);
15
+ --progress-step-bar-line-height: var(--progress-step-bar-line-size);
16
+ }
17
+
18
+ .ProgressStepBarLine_direction_vertical {
19
+ --progress-step-bar-line-top: 0;
20
+ --progress-step-bar-line-left: var(--progress-step-bar-line-padding);
21
+ --progress-step-bar-line-width: var(--progress-step-bar-line-size);
22
+ --progress-step-bar-line-height: var(--line-size);
23
+ }
24
+
25
+ .ProgressStepBarLine_size_xs {
26
+ --progress-step-bar-line-size: var(--space-3xs);
27
+ --progress-step-bar-line-padding: calc((var(--space-xs) - var(--space-3xs)) * 0.5);
28
+ }
29
+
30
+ .ProgressStepBarLine_size_s {
31
+ --progress-step-bar-line-size: var(--space-2xs);
32
+ --progress-step-bar-line-padding: calc((var(--space-m) - var(--space-2xs)) * 0.5);
33
+ }
34
+
35
+ .ProgressStepBarLine_size_m {
36
+ --progress-step-bar-line-size: var(--space-2xs);
37
+ --progress-step-bar-line-padding: calc((var(--space-xl) - var(--space-2xs)) * 0.5);
38
+ }
39
+
40
+ .ProgressStepBarLine::after {
41
+ content: '';
42
+ position: absolute;
43
+ top: 0;
44
+ right: 0;
45
+ left: var(--line-active-size);
46
+ bottom: 0;
47
+ background: var(--color-bg-system);
48
+ -webkit-transition: left 0.3s;
49
+ transition: left 0.3s;
50
+ }
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import './ProgressStepBarLine.css';
3
+ import { Line, PropDirection, PropSize } from '../helpers';
4
+ declare type ProgressStepBarLineProps = {
5
+ lines: Line[];
6
+ size: PropSize;
7
+ direction: PropDirection;
8
+ activeStepIndex?: number;
9
+ };
10
+ export declare const ProgressStepBarLine: (props: ProgressStepBarLineProps) => JSX.Element;
11
+ export {};
@@ -0,0 +1,42 @@
1
+ import { __assign, __rest } from "tslib";
2
+ import './ProgressStepBarLine.css';
3
+ import React from 'react';
4
+ import { cn } from '../../../utils/bem';
5
+ import { getSizeByMap } from '../../../utils/getSizeByMap';
6
+ var cnProgressStepBarLine = cn('ProgressStepBarLine');
7
+ var mapVarsByStatus = {
8
+ normal: 'var(--color-bg-normal)',
9
+ success: 'var(--color-bg-success)',
10
+ warning: 'var(--color-bg-warning)',
11
+ alert: 'var(--color-bg-alert)'
12
+ };
13
+ var backgroundGenerate = function (lines, direction) {
14
+ var background = "linear-gradient(" + (direction === 'horizontal' ? '90' : '180') + "deg, ";
15
+ var length = lines.length;
16
+ for (var index = 0; index < length; index++) {
17
+ var line = lines[index];
18
+ var color = getSizeByMap(mapVarsByStatus, line.status || 'normal');
19
+ var from = lines[index - 1] ? lines[index - 1].size : 0;
20
+ var to = line.size;
21
+ background += color + " " + from + "px, " + color + " " + to + "px" + (index < length - 1 ? ', ' : ')');
22
+ }
23
+ return background;
24
+ };
25
+ var getActiveLineSize = function (activeStepIndex, lines, lineSize) {
26
+ if (typeof activeStepIndex !== 'number') {
27
+ return 0;
28
+ }
29
+ return lines[activeStepIndex] ? lines[activeStepIndex].size : lineSize;
30
+ };
31
+ export var ProgressStepBarLine = function (props) {
32
+ var _a;
33
+ var lines = props.lines, activeStepIndex = props.activeStepIndex, size = props.size, direction = props.direction, otherProps = __rest(props, ["lines", "activeStepIndex", "size", "direction"]);
34
+ var background = backgroundGenerate(lines, direction);
35
+ var lineSize = lines.length > 0 ? lines[lines.length - 1].size : 0;
36
+ var activeLineSize = getActiveLineSize(activeStepIndex, lines, lineSize);
37
+ return (React.createElement("div", __assign({}, otherProps, { className: cnProgressStepBarLine({ size: size, direction: direction }), style: (_a = {},
38
+ _a['--line-size'] = lineSize + "px",
39
+ _a['--line-background'] = background,
40
+ _a['--line-active-size'] = activeLineSize + "px",
41
+ _a) })));
42
+ };