@consta/uikit 3.10.0 → 3.11.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 (417) 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 +22 -5
  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/MixSpace/package.json +1 -1
  230. package/MixVisuallyHidden/package.json +1 -1
  231. package/Modal/package.json +1 -1
  232. package/MultiComboboxDeprecated/package.json +1 -1
  233. package/Pagination/package.json +1 -1
  234. package/Popover/package.json +1 -1
  235. package/PortalWithTheme/package.json +1 -1
  236. package/ProgressSpin/package.json +1 -1
  237. package/ProgressStepBarCanary/package.json +1 -1
  238. package/Radio/package.json +1 -1
  239. package/RadioGroup/package.json +1 -1
  240. package/Responses/package.json +1 -1
  241. package/Responses403/package.json +1 -1
  242. package/Responses404/package.json +1 -1
  243. package/Responses500/package.json +1 -1
  244. package/Responses503/package.json +1 -1
  245. package/ResponsesConnectionError/package.json +1 -1
  246. package/ResponsesDeleted/package.json +1 -1
  247. package/ResponsesEmptyBox/package.json +1 -1
  248. package/ResponsesEmptyPockets/package.json +1 -1
  249. package/ResponsesImage/package.json +1 -1
  250. package/ResponsesImage403/package.json +1 -1
  251. package/ResponsesImage404/package.json +1 -1
  252. package/ResponsesImage500/package.json +1 -1
  253. package/ResponsesImage503/package.json +1 -1
  254. package/ResponsesImageConnectionError/package.json +1 -1
  255. package/ResponsesImageDeleted/package.json +1 -1
  256. package/ResponsesImageEmptyBox/package.json +1 -1
  257. package/ResponsesImageEmptyPockets/package.json +1 -1
  258. package/ResponsesImageNothingFound/package.json +1 -1
  259. package/ResponsesImageSuccess/package.json +1 -1
  260. package/ResponsesNothingFound/package.json +1 -1
  261. package/ResponsesSuccess/package.json +1 -1
  262. package/Select/package.json +1 -1
  263. package/Sidebar/package.json +1 -1
  264. package/Skeleton/package.json +1 -1
  265. package/SliderCanary/es.js +1 -0
  266. package/SliderCanary/index.d.ts +1 -0
  267. package/SliderCanary/index.js +4 -0
  268. package/SliderCanary/package.json +9 -0
  269. package/SnackBar/package.json +1 -1
  270. package/Steps/package.json +1 -1
  271. package/Switch/package.json +1 -1
  272. package/SwitchGroup/package.json +1 -1
  273. package/Table/package.json +1 -1
  274. package/Tabs/package.json +1 -1
  275. package/Tag/package.json +1 -1
  276. package/TagBase/package.json +1 -1
  277. package/Text/package.json +1 -1
  278. package/TextField/package.json +1 -1
  279. package/Theme/package.json +1 -1
  280. package/ThemeToggler/package.json +1 -1
  281. package/Timer/package.json +1 -1
  282. package/Tooltip/package.json +1 -1
  283. package/User/package.json +1 -1
  284. package/UserSelect/package.json +1 -1
  285. package/UserSelectDeprecated/package.json +1 -1
  286. package/__internal__/cjs-src/components/Combobox/helpers.d.ts +1 -1
  287. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +1 -1
  288. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.d.ts +1 -1
  289. package/__internal__/cjs-src/components/DatePickerCanary/helpers.d.ts +2 -2
  290. package/__internal__/cjs-src/components/EventInterceptor/eventInterceptorMap.d.ts +4 -9
  291. package/__internal__/cjs-src/components/EventInterceptor/eventInterceptorMap.js +7 -13
  292. package/__internal__/cjs-src/components/EventInterceptor/propsHandlers/useButtonEventHandler.js +1 -2
  293. package/__internal__/cjs-src/components/EventInterceptor/propsHandlers/useCheckboxEventsHandler.d.ts +1 -1
  294. package/__internal__/cjs-src/components/EventInterceptor/propsHandlers/useCheckboxEventsHandler.js +3 -4
  295. package/__internal__/cjs-src/components/EventInterceptor/propsHandlers/useSelectEventsHandler.d.ts +1 -1
  296. package/__internal__/cjs-src/components/EventInterceptor/propsHandlers/useSelectEventsHandler.js +3 -4
  297. package/__internal__/cjs-src/components/EventInterceptor/propsHandlers/useSnackBarEventsHandler.js +2 -3
  298. package/__internal__/cjs-src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts +2 -2
  299. package/__internal__/cjs-src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.js +3 -4
  300. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBar.css +47 -17
  301. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarCanary.js +31 -5
  302. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.css +9 -2
  303. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.js +9 -9
  304. package/__internal__/cjs-src/components/ProgressStepBarCanary/helpers.d.ts +5 -5
  305. package/__internal__/cjs-src/components/Select/helpers.d.ts +1 -1
  306. package/__internal__/cjs-src/components/SelectComponents/SelectContainer/SelectContainer.d.ts +1 -1
  307. package/__internal__/cjs-src/components/SelectComponentsDeprecated/SelectContainer/SelectContainer.d.ts +1 -1
  308. package/__internal__/cjs-src/components/SliderCanary/Slider.css +72 -0
  309. package/__internal__/cjs-src/components/SliderCanary/SliderCanary.d.ts +3 -0
  310. package/__internal__/cjs-src/components/SliderCanary/SliderCanary.js +69 -0
  311. package/__internal__/cjs-src/components/SliderCanary/SliderInput/SliderInput.d.ts +14 -0
  312. package/__internal__/cjs-src/components/SliderCanary/SliderInput/SliderInput.js +25 -0
  313. package/__internal__/cjs-src/components/SliderCanary/SliderLine/SliderLine.css +39 -0
  314. package/__internal__/cjs-src/components/SliderCanary/SliderLine/SliderLine.d.ts +4 -0
  315. package/__internal__/cjs-src/components/SliderCanary/SliderLine/SliderLine.js +26 -0
  316. package/__internal__/cjs-src/components/SliderCanary/SliderPoint/SliderPoint.css +38 -0
  317. package/__internal__/cjs-src/components/SliderCanary/SliderPoint/SliderPoint.d.ts +4 -0
  318. package/__internal__/cjs-src/components/SliderCanary/SliderPoint/SliderPoint.js +69 -0
  319. package/__internal__/cjs-src/components/SliderCanary/helper.d.ts +73 -0
  320. package/__internal__/cjs-src/components/SliderCanary/helper.js +14 -0
  321. package/__internal__/cjs-src/components/SliderCanary/useSlider/helper.d.ts +39 -0
  322. package/__internal__/cjs-src/components/SliderCanary/useSlider/helper.js +136 -0
  323. package/__internal__/cjs-src/components/SliderCanary/useSlider/useSlider.d.ts +2 -0
  324. package/__internal__/cjs-src/components/SliderCanary/useSlider/useSlider.js +231 -0
  325. package/__internal__/cjs-src/components/SliderCanary/useSliderStationing.d.ts +12 -0
  326. package/__internal__/cjs-src/components/SliderCanary/useSliderStationing.js +131 -0
  327. package/__internal__/cjs-src/components/Steps/Steps.css +30 -3
  328. package/__internal__/cjs-src/components/Steps/Steps.js +33 -4
  329. package/__internal__/cjs-src/components/Steps/StepsStep/StepsStep.css +1 -0
  330. package/__internal__/cjs-src/components/Table/Table.d.ts +5 -0
  331. package/__internal__/cjs-src/components/Table/Table.js +5 -1
  332. package/__internal__/cjs-src/components/TagBase/TagBase.d.ts +1 -1
  333. package/__internal__/cjs-src/components/UserSelect/helpers.d.ts +1 -1
  334. package/__internal__/cjs-src/hooks/useOverflow/useOverflow.d.ts +7 -0
  335. package/__internal__/cjs-src/hooks/useOverflow/useOverflow.js +53 -0
  336. package/__internal__/cjs-src/hooks/useScrollElements/useScrollElements.d.ts +7 -0
  337. package/__internal__/cjs-src/hooks/useScrollElements/useScrollElements.js +34 -0
  338. package/__internal__/src/components/Combobox/helpers.d.ts +1 -1
  339. package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +1 -1
  340. package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.d.ts +1 -1
  341. package/__internal__/src/components/DatePickerCanary/helpers.d.ts +2 -2
  342. package/__internal__/src/components/EventInterceptor/eventInterceptorMap.d.ts +4 -9
  343. package/__internal__/src/components/EventInterceptor/eventInterceptorMap.js +7 -13
  344. package/__internal__/src/components/EventInterceptor/propsHandlers/useButtonEventHandler.js +1 -2
  345. package/__internal__/src/components/EventInterceptor/propsHandlers/useCheckboxEventsHandler.d.ts +1 -1
  346. package/__internal__/src/components/EventInterceptor/propsHandlers/useCheckboxEventsHandler.js +3 -4
  347. package/__internal__/src/components/EventInterceptor/propsHandlers/useSelectEventsHandler.d.ts +1 -1
  348. package/__internal__/src/components/EventInterceptor/propsHandlers/useSelectEventsHandler.js +3 -4
  349. package/__internal__/src/components/EventInterceptor/propsHandlers/useSnackBarEventsHandler.js +2 -3
  350. package/__internal__/src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts +2 -2
  351. package/__internal__/src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.js +3 -4
  352. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBar.css +47 -17
  353. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarCanary.js +31 -5
  354. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.css +9 -2
  355. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.js +9 -9
  356. package/__internal__/src/components/ProgressStepBarCanary/helpers.d.ts +5 -5
  357. package/__internal__/src/components/Select/helpers.d.ts +1 -1
  358. package/__internal__/src/components/SelectComponents/SelectContainer/SelectContainer.d.ts +1 -1
  359. package/__internal__/src/components/SelectComponentsDeprecated/SelectContainer/SelectContainer.d.ts +1 -1
  360. package/__internal__/src/components/SliderCanary/Slider.css +72 -0
  361. package/__internal__/src/components/SliderCanary/SliderCanary.d.ts +3 -0
  362. package/__internal__/src/components/SliderCanary/SliderCanary.js +66 -0
  363. package/__internal__/src/components/SliderCanary/SliderInput/SliderInput.d.ts +14 -0
  364. package/__internal__/src/components/SliderCanary/SliderInput/SliderInput.js +22 -0
  365. package/__internal__/src/components/SliderCanary/SliderLine/SliderLine.css +39 -0
  366. package/__internal__/src/components/SliderCanary/SliderLine/SliderLine.d.ts +4 -0
  367. package/__internal__/src/components/SliderCanary/SliderLine/SliderLine.js +23 -0
  368. package/__internal__/src/components/SliderCanary/SliderPoint/SliderPoint.css +38 -0
  369. package/__internal__/src/components/SliderCanary/SliderPoint/SliderPoint.d.ts +4 -0
  370. package/__internal__/src/components/SliderCanary/SliderPoint/SliderPoint.js +66 -0
  371. package/__internal__/src/components/SliderCanary/helper.d.ts +73 -0
  372. package/__internal__/src/components/SliderCanary/helper.js +11 -0
  373. package/__internal__/src/components/SliderCanary/useSlider/helper.d.ts +39 -0
  374. package/__internal__/src/components/SliderCanary/useSlider/helper.js +133 -0
  375. package/__internal__/src/components/SliderCanary/useSlider/useSlider.d.ts +2 -0
  376. package/__internal__/src/components/SliderCanary/useSlider/useSlider.js +227 -0
  377. package/__internal__/src/components/SliderCanary/useSliderStationing.d.ts +12 -0
  378. package/__internal__/src/components/SliderCanary/useSliderStationing.js +128 -0
  379. package/__internal__/src/components/Steps/Steps.css +30 -3
  380. package/__internal__/src/components/Steps/Steps.js +34 -5
  381. package/__internal__/src/components/Steps/StepsStep/StepsStep.css +1 -0
  382. package/__internal__/src/components/Table/Table.d.ts +5 -0
  383. package/__internal__/src/components/Table/Table.js +5 -1
  384. package/__internal__/src/components/TagBase/TagBase.d.ts +1 -1
  385. package/__internal__/src/components/UserSelect/helpers.d.ts +1 -1
  386. package/__internal__/src/hooks/useOverflow/useOverflow.d.ts +7 -0
  387. package/__internal__/src/hooks/useOverflow/useOverflow.js +50 -0
  388. package/__internal__/src/hooks/useScrollElements/useScrollElements.d.ts +7 -0
  389. package/__internal__/src/hooks/useScrollElements/useScrollElements.js +30 -0
  390. package/createIcon/package.json +1 -1
  391. package/createResponsesImage/package.json +1 -1
  392. package/package.json +4 -1
  393. package/useChoiceGroup/package.json +1 -1
  394. package/useChoiceGroupIndexed/package.json +1 -1
  395. package/useClickOutside/package.json +1 -1
  396. package/useComponentSize/package.json +1 -1
  397. package/useDebounce/package.json +1 -1
  398. package/useFlag/package.json +1 -1
  399. package/useForkRef/package.json +1 -1
  400. package/useGlobalKeys/package.json +1 -1
  401. package/useKeys/package.json +1 -1
  402. package/useMutableRef/package.json +1 -1
  403. package/useOverflow/es.js +1 -0
  404. package/useOverflow/index.d.ts +1 -0
  405. package/useOverflow/index.js +4 -0
  406. package/useOverflow/package.json +9 -0
  407. package/usePrevious/package.json +1 -1
  408. package/useResizeObserved/package.json +1 -1
  409. package/useScrollElements/es.js +1 -0
  410. package/useScrollElements/index.d.ts +1 -0
  411. package/useScrollElements/index.js +4 -0
  412. package/useScrollElements/package.json +9 -0
  413. package/useScrollPosition/package.json +1 -1
  414. package/useSelect/package.json +1 -1
  415. package/useThemeVars/package.json +1 -1
  416. package/useTimer/package.json +1 -1
  417. package/withTooltip/package.json +1 -1
@@ -0,0 +1,73 @@
1
+ import React from 'react';
2
+ import { IconProps } from '../../icons/Icon/Icon';
3
+ import { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';
4
+ import { ActiveButton } from './useSlider/helper';
5
+ export declare const propStatus: readonly ["alert", "warning", "success"];
6
+ export declare type PropStatus = typeof propStatus[number];
7
+ export declare const defaultPropStatus: "alert";
8
+ export declare type PropView = 'default' | 'division';
9
+ export declare const propSize: readonly ["s", "xs", "m", "l"];
10
+ export declare type PropSize = typeof propSize[number];
11
+ export declare const defaultPropSize: PropSize;
12
+ export declare type SliderValue<RANGE> = RANGE extends true ? [number, number] : number;
13
+ export declare type PropOnChange<RANGE> = (prop: {
14
+ e?: Event | React.TouchEvent | React.MouseEvent | React.KeyboardEvent | React.ChangeEvent;
15
+ value: SliderValue<RANGE>;
16
+ }) => void;
17
+ declare type PropToolipFormatter = (value: number | undefined) => string;
18
+ declare type Props<RANGE extends boolean = false> = {
19
+ className?: string;
20
+ step?: number | number[];
21
+ view?: PropView;
22
+ disabled?: boolean;
23
+ range?: RANGE;
24
+ withTooltip?: boolean;
25
+ value: SliderValue<RANGE>;
26
+ label?: string;
27
+ caption?: string;
28
+ status?: PropStatus;
29
+ min?: number;
30
+ size?: PropSize;
31
+ max?: number;
32
+ onChange?: PropOnChange<RANGE>;
33
+ onAfterChange?: PropOnChange<RANGE>;
34
+ leftSide?: React.FC<IconProps> | 'input';
35
+ tooltipFormatter?: PropToolipFormatter;
36
+ rightSide?: React.FC<IconProps>;
37
+ };
38
+ export declare type Line = {
39
+ width: number;
40
+ active: boolean;
41
+ size?: number[];
42
+ };
43
+ export declare type SliderLineProps = {
44
+ view?: PropView;
45
+ lines: Line[];
46
+ disabled?: boolean;
47
+ hovered?: boolean;
48
+ onHover?: (hovered: boolean) => void;
49
+ };
50
+ export declare type SliderPointProps = PropsWithHTMLAttributes<{
51
+ value?: number | string;
52
+ disabled?: boolean;
53
+ focused?: boolean;
54
+ hovered?: boolean;
55
+ withTooltip?: boolean;
56
+ buttonLabel?: ActiveButton;
57
+ buttonRef?: React.RefObject<HTMLButtonElement>;
58
+ popoverPosition?: TrackPosition;
59
+ onFocus?: (e: React.FocusEvent<HTMLButtonElement> | React.MouseEvent, button: ActiveButton) => void;
60
+ onKeyPress?: (e: React.KeyboardEvent, typeButton: ActiveButton) => void;
61
+ onHover?: (hovered: boolean) => void;
62
+ position: number;
63
+ }, HTMLButtonElement>;
64
+ export declare type SliderProps<RANGE extends boolean> = PropsWithHTMLAttributes<Props<RANGE>, HTMLDivElement>;
65
+ export declare type SliderComponent = <RANGE extends boolean>(props: SliderProps<RANGE>) => React.ReactElement | null;
66
+ export declare const isRangeParams: (params: Props<boolean>) => params is Props<true>;
67
+ export declare const isNotRangeParams: (params: Props<boolean>) => params is Props<false>;
68
+ export declare const defaultTooltipFormatter: PropToolipFormatter;
69
+ export declare type TrackPosition = {
70
+ x: number;
71
+ y: number;
72
+ } | null;
73
+ export {};
@@ -0,0 +1,11 @@
1
+ export var propStatus = ['alert', 'warning', 'success'];
2
+ export var defaultPropStatus = propStatus[0];
3
+ export var propSize = ['s', 'xs', 'm', 'l'];
4
+ export var defaultPropSize = propSize[0];
5
+ export var isRangeParams = function (params) {
6
+ return !!params.range;
7
+ };
8
+ export var isNotRangeParams = function (params) {
9
+ return !params.range;
10
+ };
11
+ export var defaultTooltipFormatter = function (value) { return (value === null || value === void 0 ? void 0 : value.toString()) || ''; };
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { PropOnChange, SliderValue, TrackPosition } from '../helper';
3
+ export declare type ActiveButton = 'left' | 'right' | null | undefined;
4
+ export declare type Stationing = {
5
+ x: number;
6
+ y: number;
7
+ width: number;
8
+ height: number;
9
+ };
10
+ export declare type UseSliderProps<RANGE extends boolean = false> = {
11
+ disabled: boolean;
12
+ range?: RANGE;
13
+ value: SliderValue<RANGE>;
14
+ min: number;
15
+ max: number;
16
+ step?: number | number[];
17
+ onChange?: PropOnChange<RANGE>;
18
+ onAfterChange?: PropOnChange<RANGE>;
19
+ sliderRef: React.RefObject<HTMLDivElement>;
20
+ buttonRefs: React.RefObject<HTMLButtonElement>[];
21
+ };
22
+ export declare type UseSliderValues = {
23
+ onKeyPress: (e: React.KeyboardEvent, typeButton: ActiveButton) => void;
24
+ onFocus: (e: React.FocusEvent<HTMLButtonElement> | React.MouseEvent, button: ActiveButton) => void;
25
+ activeButton: ActiveButton;
26
+ dragPoint: () => void;
27
+ currentValue: number | [number, number];
28
+ popoverPosition: TrackPosition[];
29
+ };
30
+ export declare const isRangeParams: (params: UseSliderProps<boolean>) => params is UseSliderProps<true>;
31
+ export declare const isNotRangeParams: (params: UseSliderProps<boolean>) => params is UseSliderProps<false>;
32
+ export declare const trackPosition: (event: Event | React.TouchEvent | React.MouseEvent) => TrackPosition;
33
+ export declare const getActiveValue: (value: number | [number, number], active: ActiveButton) => number;
34
+ export declare const detectActiveButton: (posittion: TrackPosition, buttons: React.RefObject<HTMLButtonElement>[]) => ActiveButton;
35
+ export declare const getValidValue: (value: number, min: number, max: number, step?: number | number[] | undefined) => number;
36
+ export declare const isValidValue: (value: number, min: number, max: number, step?: number | number[] | undefined) => boolean;
37
+ export declare const getValueByPosition: (position: TrackPosition, sliderRef: React.RefObject<HTMLDivElement>, min: number, max: number) => number;
38
+ export declare const getNewValue: (changedValue: number, currentValue: number | [number, number], step: number | number[], min: number, max: number, activeButton: ActiveButton) => number | [number, number];
39
+ export declare const analyzeDivisionValue: (value: number, step: number | number[], min: number, max: number) => number;
@@ -0,0 +1,133 @@
1
+ import { __read, __spread } from "tslib";
2
+ import { getSteps } from '../useSliderStationing';
3
+ export var isRangeParams = function (params) {
4
+ return !!params.range;
5
+ };
6
+ export var isNotRangeParams = function (params) {
7
+ return !params.range;
8
+ };
9
+ export var trackPosition = function (event) {
10
+ if ('clientX' in event) {
11
+ return {
12
+ x: event.clientX,
13
+ y: event.clientY
14
+ };
15
+ }
16
+ return null;
17
+ };
18
+ export var getActiveValue = function (value, active) {
19
+ if (Array.isArray(value)) {
20
+ return active === 'left' ? value[0] : value[1];
21
+ }
22
+ return value;
23
+ };
24
+ export var detectActiveButton = function (position, buttons) {
25
+ var activeButton = null;
26
+ buttons.forEach(function (buttonRef, index) {
27
+ var button = buttonRef.current;
28
+ if (button && position) {
29
+ var _a = button.getBoundingClientRect(), x = _a.x, y = _a.y, width = _a.width, height = _a.height;
30
+ if (x <= position.x &&
31
+ x + width >= position.x &&
32
+ y <= position.y &&
33
+ y + height >= position.y) {
34
+ activeButton = index === 0 ? 'left' : 'right';
35
+ button.focus();
36
+ }
37
+ }
38
+ });
39
+ return activeButton;
40
+ };
41
+ export var getValidValue = function (value, min, max, step) {
42
+ if (typeof value === 'number') {
43
+ if (value > max)
44
+ return max;
45
+ if (value < min)
46
+ return min;
47
+ if (!Array.isArray(step)) {
48
+ var division = step === null || step === void 0 ? void 0 : step.toString().split('.')[1];
49
+ var stepValue = step || 1;
50
+ return (Math.ceil(Number(value.toFixed(division ? division.length : 0)) / stepValue) * stepValue);
51
+ }
52
+ var resultValue_1 = value;
53
+ var stepsArr_1 = step;
54
+ if (step[0] !== min) {
55
+ stepsArr_1 = __spread([min], stepsArr_1);
56
+ }
57
+ else if (step[step.length - 1] !== max) {
58
+ stepsArr_1 = __spread(stepsArr_1, [max]);
59
+ }
60
+ stepsArr_1.forEach(function (stepPoint, index) {
61
+ var minValue = min;
62
+ var maxValue = max;
63
+ if (index === 0) {
64
+ maxValue = stepsArr_1[index + 1];
65
+ }
66
+ else if (index === stepsArr_1.length - 1) {
67
+ minValue = stepPoint;
68
+ maxValue = max;
69
+ }
70
+ else {
71
+ maxValue = stepsArr_1[index + 1];
72
+ minValue = stepPoint;
73
+ }
74
+ if (value <= maxValue && value >= minValue) {
75
+ if ((maxValue + minValue) / 2 > value) {
76
+ resultValue_1 = minValue;
77
+ }
78
+ else {
79
+ resultValue_1 = maxValue;
80
+ }
81
+ }
82
+ });
83
+ return resultValue_1;
84
+ }
85
+ return value;
86
+ };
87
+ export var isValidValue = function (value, min, max, step) {
88
+ return getValidValue(value, min, max, step) === value;
89
+ };
90
+ export var getValueByPosition = function (position, sliderRef, min, max) {
91
+ if (sliderRef.current && position) {
92
+ var _a = sliderRef.current.getBoundingClientRect(), x = _a.x, width = _a.width;
93
+ var absoluteSize = Math.abs(max - min);
94
+ var value = min + ((position.x - x) * absoluteSize) / width;
95
+ return getValidValue(value, min, max);
96
+ }
97
+ return 0;
98
+ };
99
+ export var getNewValue = function (changedValue, currentValue, step, min, max, activeButton) {
100
+ var maxRangeValue = max;
101
+ var minRangeValue = min;
102
+ if (Array.isArray(currentValue)) {
103
+ var _a = __read(currentValue, 2), left = _a[0], right = _a[1];
104
+ if (activeButton === 'right') {
105
+ minRangeValue = left;
106
+ }
107
+ else {
108
+ maxRangeValue = right;
109
+ }
110
+ }
111
+ var analyzedValue = getValidValue(analyzeDivisionValue(changedValue, step, min, max), minRangeValue, maxRangeValue, step);
112
+ if (Array.isArray(currentValue)) {
113
+ return activeButton === 'right'
114
+ ? [currentValue[0], analyzedValue]
115
+ : [analyzedValue, currentValue[1]];
116
+ }
117
+ return analyzedValue;
118
+ };
119
+ export var analyzeDivisionValue = function (value, step, min, max) {
120
+ var steps = getSteps(step, min, max);
121
+ var newValue = value;
122
+ steps.forEach(function (stepSize) {
123
+ if (value && stepSize.min < value && stepSize.max >= value) {
124
+ if ((stepSize.max + stepSize.min) / 2 > value) {
125
+ newValue = stepSize.min;
126
+ }
127
+ else {
128
+ newValue = stepSize.max;
129
+ }
130
+ }
131
+ });
132
+ return newValue;
133
+ };
@@ -0,0 +1,2 @@
1
+ import { UseSliderProps, UseSliderValues } from './helper';
2
+ export declare function useSlider<RANGE extends boolean>(props: UseSliderProps<RANGE>): UseSliderValues;
@@ -0,0 +1,227 @@
1
+ import { __read, __spread } from "tslib";
2
+ import { useCallback, useEffect, useRef, useState } from 'react';
3
+ import { useComponentSize } from '../../../hooks/useComponentSize/useComponentSize';
4
+ import { useFlag } from '../../../hooks/useFlag/useFlag';
5
+ import { getActiveValue, getNewValue, getValidValue, getValueByPosition, isNotRangeParams, isRangeParams, trackPosition, } from './helper';
6
+ export function useSlider(props) {
7
+ var disabled = props.disabled, range = props.range, value = props.value, min = props.min, max = props.max, _a = props.step, step = _a === void 0 ? 1 : _a, onChange = props.onChange, onAfterChange = props.onAfterChange, sliderRef = props.sliderRef, buttonRefs = props.buttonRefs;
8
+ var minValue = max > min ? min : 0;
9
+ var maxValue = max > min ? max : 100;
10
+ var _b = __read(useState(value), 2), currentValue = _b[0], setCurrentValue = _b[1];
11
+ var _c = __read(useState(null), 2), leftPopover = _c[0], setLeftPopover = _c[1];
12
+ var _d = __read(useState(null), 2), rightPopover = _d[0], setRightPopover = _d[1];
13
+ var _e = __read(useFlag(false), 2), draggable = _e[0], _f = _e[1], on = _f.on, off = _f.off;
14
+ var activeButton = useRef(null);
15
+ var sizeSlider = useComponentSize(sliderRef);
16
+ var addListeners = function () {
17
+ document.addEventListener('mouseup', handleTouchEnd);
18
+ document.addEventListener('touchend', handleTouchEnd);
19
+ document.addEventListener('mousemove', handleTouchMove);
20
+ document.addEventListener('touchmove', handleTouchMove);
21
+ };
22
+ var removeListeners = function () {
23
+ document.removeEventListener('mouseup', handleTouchEnd);
24
+ document.removeEventListener('touchend', handleTouchEnd);
25
+ document.removeEventListener('mousemove', handleTouchMove);
26
+ document.removeEventListener('touchmove', handleTouchMove);
27
+ };
28
+ useEffect(function () {
29
+ addListeners();
30
+ return function () {
31
+ removeListeners();
32
+ };
33
+ }, [
34
+ activeButton.current,
35
+ step,
36
+ currentValue,
37
+ value,
38
+ min,
39
+ max,
40
+ sliderRef.current,
41
+ buttonRefs,
42
+ disabled,
43
+ draggable,
44
+ ]);
45
+ useEffect(function () {
46
+ if (Array.isArray(currentValue)) {
47
+ setTooltipPosition(currentValue[0], 'left');
48
+ setTooltipPosition(currentValue[1], 'right');
49
+ }
50
+ else {
51
+ setTooltipPosition(currentValue, 'left');
52
+ }
53
+ }, [currentValue]);
54
+ useEffect(function () {
55
+ if (JSON.stringify(value) !== JSON.stringify(currentValue)) {
56
+ setCurrentValue(value);
57
+ setTooltipPosition(getActiveValue(value, activeButton.current), 'left');
58
+ activeButton.current = null;
59
+ }
60
+ }, [value]);
61
+ useEffect(function () {
62
+ onChange === null || onChange === void 0 ? void 0 : onChange({
63
+ value: Array.isArray(currentValue)
64
+ ? [
65
+ getNewValue(currentValue[0], currentValue[0], step, min, max, 'left'),
66
+ getNewValue(currentValue[1], currentValue[1], step, min, max, 'right'),
67
+ ]
68
+ : getNewValue(currentValue, currentValue, step, min, max, 'left')
69
+ });
70
+ }, [step]);
71
+ useEffect(function () {
72
+ if (typeof value !== 'undefined' && typeof step !== 'undefined') {
73
+ var targetValue = isRangeParams(props)
74
+ ? [
75
+ getValidValue(props.value[0], min, max, step),
76
+ getValidValue(props.value[1], min, max, step),
77
+ ]
78
+ : getValidValue(props.value, min, max, step);
79
+ setCurrentValue(targetValue);
80
+ }
81
+ }, [range, typeof value]);
82
+ useEffect(function () {
83
+ var _a;
84
+ if (isRangeParams(props)) {
85
+ if (props.value[0] > props.value[1]) {
86
+ var newValue = [props.value[1], props.value[1]];
87
+ (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, { value: newValue });
88
+ }
89
+ }
90
+ }, []);
91
+ var onKeyPress = useCallback(function (event, typeButton) {
92
+ if (!disabled && typeof typeButton === 'string' && typeof currentValue !== 'undefined') {
93
+ var stepIncrement_1 = !Array.isArray(step) ? step || 1 : 1;
94
+ var validKeyCode = false;
95
+ var changedValue_1 = getActiveValue(currentValue, typeButton);
96
+ switch (event.key) {
97
+ case 'ArrowUp':
98
+ case 'ArrowRight':
99
+ case '+':
100
+ validKeyCode = true;
101
+ break;
102
+ case 'ArrowLeft':
103
+ case 'ArrowDown':
104
+ case '-':
105
+ validKeyCode = true;
106
+ stepIncrement_1 *= -1;
107
+ break;
108
+ default:
109
+ break;
110
+ }
111
+ if (validKeyCode) {
112
+ if (Array.isArray(step)) {
113
+ var stepsArr_1 = __spread(step);
114
+ if (step[0] !== minValue) {
115
+ stepsArr_1 = __spread([minValue], stepsArr_1);
116
+ }
117
+ if (step[step.length - 1] !== maxValue) {
118
+ stepsArr_1 = __spread(stepsArr_1, [maxValue]);
119
+ }
120
+ stepsArr_1.forEach(function (stepPoint, index) {
121
+ if (typeof typeButton === 'string' && changedValue_1 === stepPoint) {
122
+ if (stepIncrement_1 >= 0) {
123
+ if (index === 0) {
124
+ stepIncrement_1 = stepsArr_1[1] - minValue;
125
+ }
126
+ else {
127
+ stepIncrement_1 =
128
+ (typeof stepsArr_1[index + 1] !== 'undefined'
129
+ ? stepsArr_1[index + 1]
130
+ : maxValue) - stepPoint;
131
+ }
132
+ }
133
+ else if (index === 0) {
134
+ stepIncrement_1 = minValue - stepsArr_1[1];
135
+ }
136
+ else {
137
+ stepIncrement_1 =
138
+ (typeof stepsArr_1[index - 1] !== 'undefined' ? stepsArr_1[index - 1] : minValue) -
139
+ stepPoint;
140
+ }
141
+ }
142
+ });
143
+ }
144
+ var newValue = getNewValue(changedValue_1 + stepIncrement_1, currentValue, step, min, max, typeButton);
145
+ setCurrentValue(newValue);
146
+ setTooltipPosition(getActiveValue(newValue, typeButton), typeButton);
147
+ onChange === null || onChange === void 0 ? void 0 : onChange({
148
+ e: event,
149
+ value: newValue
150
+ });
151
+ }
152
+ }
153
+ }, [currentValue, step, min, max]);
154
+ var setTooltipPosition = function (value, position) {
155
+ if (sliderRef.current && position) {
156
+ var button = buttonRefs[position === 'left' ? 0 : 1].current || sliderRef.current;
157
+ var _a = sliderRef.current.getBoundingClientRect(), x = _a.x, width = _a.width;
158
+ var newPosition = {
159
+ y: button.offsetTop + button.offsetHeight + 50,
160
+ x: x + Math.abs((value - minValue) / (maxValue - minValue)) * width
161
+ };
162
+ if (position === 'left') {
163
+ setLeftPopover(newPosition);
164
+ }
165
+ else {
166
+ setRightPopover(newPosition);
167
+ }
168
+ }
169
+ };
170
+ var changePosition = function (event) {
171
+ var nativeEvent = event;
172
+ if (typeof activeButton.current !== 'string') {
173
+ return value;
174
+ }
175
+ var position = trackPosition(nativeEvent);
176
+ var positionValue = getValueByPosition(position, sliderRef, minValue, maxValue);
177
+ return getNewValue(positionValue, currentValue, step, min, max, activeButton.current);
178
+ };
179
+ var onFocus = function (e, button) {
180
+ activeButton.current = button;
181
+ };
182
+ var handleTouchMove = function (event) {
183
+ if (typeof activeButton.current === 'string' && draggable) {
184
+ var position = changePosition(event);
185
+ var oldValue = getActiveValue(currentValue, activeButton.current);
186
+ var newValue = getActiveValue(position, activeButton.current);
187
+ if (oldValue !== newValue) {
188
+ setCurrentValue(position);
189
+ onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange({ e: event, value: position });
190
+ }
191
+ }
192
+ };
193
+ var handleTouchEnd = function (event) {
194
+ var position = changePosition(event);
195
+ if (typeof position !== 'undefined') {
196
+ setCurrentValue(position);
197
+ onChange === null || onChange === void 0 ? void 0 : onChange({ e: event, value: position });
198
+ }
199
+ off();
200
+ if (JSON.stringify(position) !== JSON.stringify(currentValue)) {
201
+ buttonRefs.forEach(function (button) {
202
+ var _a;
203
+ (_a = button.current) === null || _a === void 0 ? void 0 : _a.blur();
204
+ });
205
+ activeButton.current = null;
206
+ }
207
+ };
208
+ useEffect(function () {
209
+ if (isRangeParams(props)) {
210
+ props.value.forEach(function (val, index) {
211
+ setTooltipPosition(getActiveValue(val, activeButton.current), index === 0 ? 'left' : 'right');
212
+ });
213
+ }
214
+ if (isNotRangeParams(props)) {
215
+ setTooltipPosition(getActiveValue(value, activeButton.current), 'left');
216
+ }
217
+ activeButton.current = null;
218
+ }, [sizeSlider, typeof value]);
219
+ return {
220
+ onKeyPress: onKeyPress,
221
+ onFocus: onFocus,
222
+ dragPoint: on,
223
+ activeButton: activeButton.current,
224
+ popoverPosition: [leftPopover, rightPopover],
225
+ currentValue: currentValue
226
+ };
227
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { Line, PropView } from './helper';
3
+ declare type UseSliderStationing = (value: number | [number, number] | undefined, min: number, max: number, view: PropView, range: boolean | undefined, step: number | number[] | undefined, buttonRefs: [React.RefObject<HTMLButtonElement>, React.RefObject<HTMLButtonElement>], sliderLineRef: React.RefObject<HTMLDivElement>) => {
4
+ lineSizes: Line[];
5
+ buttonPositions: number[];
6
+ };
7
+ export declare const getSteps: (step: number | number[], min: number, max: number) => {
8
+ min: number;
9
+ max: number;
10
+ }[];
11
+ export declare const useSliderStationing: UseSliderStationing;
12
+ export {};
@@ -0,0 +1,128 @@
1
+ import { __read } from "tslib";
2
+ import { useCallback, useEffect, useState } from 'react';
3
+ export var getSteps = function (step, min, max) {
4
+ var stepsArray = [];
5
+ var size = min;
6
+ if (Array.isArray(step)) {
7
+ step.forEach(function (stepSize) {
8
+ stepsArray.push({
9
+ min: size,
10
+ max: stepSize
11
+ });
12
+ size += stepSize - size;
13
+ });
14
+ if (size !== max) {
15
+ stepsArray.push({
16
+ min: size,
17
+ max: max
18
+ });
19
+ }
20
+ }
21
+ else {
22
+ for (var i = min; i < max; i += step) {
23
+ stepsArray.push({
24
+ min: size,
25
+ max: size + (max - i < step ? max - i : step)
26
+ });
27
+ size += step;
28
+ }
29
+ }
30
+ return stepsArray;
31
+ };
32
+ export var useSliderStationing = function (value, min, max, view, range, step, buttonRefs, sliderLineRef) {
33
+ var _a = __read(useState([]), 2), lineSizes = _a[0], setLineSizes = _a[1];
34
+ var _b = __read(useState([]), 2), buttonPositions = _b[0], setButtonPositions = _b[1];
35
+ var calculateLines = function () {
36
+ var sizesArray = [];
37
+ var absoluteSize = Math.abs(max - min);
38
+ if (typeof value !== 'undefined') {
39
+ if (view === 'default') {
40
+ if (!Array.isArray(value) && typeof value === 'number') {
41
+ sizesArray.push({
42
+ width: (1 - (max - value) / absoluteSize) * 100,
43
+ active: true
44
+ });
45
+ sizesArray.push({
46
+ width: ((max - value) / absoluteSize) * 100,
47
+ active: false
48
+ });
49
+ }
50
+ else if (Array.isArray(value) && value) {
51
+ sizesArray.push({
52
+ width: ((value[0] - min) / absoluteSize) * 100,
53
+ active: false
54
+ });
55
+ sizesArray.push({
56
+ width: ((value[1] - value[0]) / absoluteSize) * 100,
57
+ active: true
58
+ });
59
+ sizesArray.push({
60
+ width: ((max - value[1]) / absoluteSize) * 100,
61
+ active: false
62
+ });
63
+ }
64
+ else {
65
+ sizesArray.push({
66
+ width: 100,
67
+ active: false
68
+ });
69
+ }
70
+ }
71
+ else if (typeof step !== 'undefined') {
72
+ getSteps(step, min, max).forEach(function (stepSize) {
73
+ sizesArray.push({
74
+ width: (Math.abs(stepSize.max - stepSize.min) * 100) / absoluteSize,
75
+ active: (typeof value === 'number' || Array.isArray(value)) &&
76
+ (range && Array.isArray(value)
77
+ ? stepSize.max > value[0] && stepSize.min < value[1]
78
+ : stepSize.max <= value)
79
+ });
80
+ });
81
+ }
82
+ }
83
+ else {
84
+ sizesArray.push({
85
+ width: 100,
86
+ active: false
87
+ });
88
+ }
89
+ return sizesArray;
90
+ };
91
+ var getValidValue = function (value) {
92
+ if (value < min)
93
+ return min;
94
+ if (value > max)
95
+ return max;
96
+ return value;
97
+ };
98
+ var calculateButtonPositions = useCallback(function () {
99
+ var absoluteSize = Math.abs(max - min);
100
+ var defaultPaddingValue = 0;
101
+ var positions = [];
102
+ buttonRefs.forEach(function (buttonRef, index) {
103
+ var _a, _b;
104
+ if (buttonRef.current &&
105
+ buttonRef.current.offsetWidth &&
106
+ sliderLineRef.current &&
107
+ sliderLineRef.current.offsetWidth) {
108
+ defaultPaddingValue =
109
+ (absoluteSize * ((_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth)) /
110
+ (2 * ((_b = sliderLineRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth)) || 0;
111
+ }
112
+ if (typeof value === 'number' || Array.isArray(value)) {
113
+ positions.push(typeof value === 'number'
114
+ ? (1 - (max - getValidValue(value) + defaultPaddingValue) / absoluteSize) * 100
115
+ : (1 - (max - getValidValue(value[index]) + defaultPaddingValue) / absoluteSize) * 100);
116
+ }
117
+ });
118
+ return positions;
119
+ }, [buttonRefs, sliderLineRef]);
120
+ useEffect(function () {
121
+ setLineSizes(calculateLines());
122
+ setButtonPositions(calculateButtonPositions());
123
+ }, [value, min, max, range, step, view]);
124
+ return {
125
+ lineSizes: lineSizes,
126
+ buttonPositions: buttonPositions
127
+ };
128
+ };
@@ -1,9 +1,36 @@
1
1
  .Steps {
2
- display: -webkit-box;
3
- display: -ms-flexbox;
4
- display: flex;
2
+ display: -webkit-inline-box;
3
+ display: -ms-inline-flexbox;
4
+ display: inline-flex;
5
+ -webkit-box-align: center;
6
+ -ms-flex-align: center;
7
+ align-items: center;
8
+ width: -webkit-max-content;
9
+ width: -moz-max-content;
10
+ width: max-content;
11
+ max-width: 100%;
5
12
  }
6
13
 
7
14
  .Steps-Item:not(:last-child) {
8
15
  margin-right: var(--space-xs);
9
16
  }
17
+
18
+ .Steps-List {
19
+ display: -webkit-box;
20
+ display: -ms-flexbox;
21
+ display: flex;
22
+ overflow-x: scroll;
23
+ overflow-y: visible;
24
+ }
25
+
26
+ .Steps-List::-webkit-scrollbar {
27
+ display: none;
28
+ }
29
+
30
+ .Steps-Button_side_left {
31
+ margin-right: var(--space-xs);
32
+ }
33
+
34
+ .Steps-Button_side_right {
35
+ margin-left: var(--space-xs);
36
+ }