@salutejs/plasma-new-hope 0.176.0-canary.1514.11570064677.0 → 0.176.1-canary.1510.11572230988.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (397) hide show
  1. package/cjs/components/Counter/Counter.css +1 -1
  2. package/cjs/components/Counter/Counter.js +3 -12
  3. package/cjs/components/Counter/Counter.js.map +1 -1
  4. package/cjs/components/Counter/Counter.tokens.js +0 -4
  5. package/cjs/components/Counter/Counter.tokens.js.map +1 -1
  6. package/cjs/components/Counter/variations/_size/base.js +1 -1
  7. package/cjs/components/Counter/variations/_size/base.js.map +1 -1
  8. package/cjs/components/Counter/variations/_size/{base_4mz17d.css → base_1z0ohiy.css} +1 -1
  9. package/cjs/components/Notification/Notification.css +11 -11
  10. package/cjs/components/Notification/Notification.js +2 -2
  11. package/cjs/components/Notification/Notification.js.map +1 -1
  12. package/cjs/components/Notification/Notification.styles.js +11 -2
  13. package/cjs/components/Notification/Notification.styles.js.map +1 -1
  14. package/{es/components/Notification/Notification.styles_7h8hp0.css → cjs/components/Notification/Notification.styles_e6274r.css} +2 -2
  15. package/cjs/components/Notification/Notification.tokens.js +2 -1
  16. package/cjs/components/Notification/Notification.tokens.js.map +1 -1
  17. package/cjs/components/Notification/Notification.types.js.map +1 -1
  18. package/cjs/components/Notification/NotificationsPortal.js +8 -4
  19. package/cjs/components/Notification/NotificationsPortal.js.map +1 -1
  20. package/cjs/components/Notification/NotificationsProvider.css +11 -11
  21. package/cjs/components/Notification/NotificationsProvider.js +3 -1
  22. package/cjs/components/Notification/NotificationsProvider.js.map +1 -1
  23. package/cjs/components/Pagination/Pagination.css +12 -12
  24. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +12 -12
  25. package/cjs/components/Select/Select.css +12 -12
  26. package/cjs/components/Select/Select.tokens.js +2 -1
  27. package/cjs/components/Select/Select.tokens.js.map +1 -1
  28. package/cjs/components/Select/ui/Inner/Inner.css +12 -12
  29. package/cjs/components/Select/ui/Inner/ui/Item/Item.css +12 -12
  30. package/cjs/components/Select/ui/Target/Target.css +12 -12
  31. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.css +12 -12
  32. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  33. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
  34. package/{es/components/Select/ui/Target/ui/Textfield/Textfield.styles_11yj58s.css → cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles_jzeap2.css} +1 -1
  35. package/cjs/components/Slider/Slider.css +15 -13
  36. package/cjs/components/Slider/Slider.js +11 -2
  37. package/cjs/components/Slider/Slider.js.map +1 -1
  38. package/cjs/components/Slider/Slider.tokens.js +23 -17
  39. package/cjs/components/Slider/Slider.tokens.js.map +1 -1
  40. package/cjs/components/Slider/components/Double/Double.css +8 -8
  41. package/cjs/components/Slider/components/Double/Double.js +58 -23
  42. package/cjs/components/Slider/components/Double/Double.js.map +1 -1
  43. package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +98 -0
  44. package/cjs/components/Slider/components/Single/Single.css +14 -14
  45. package/cjs/components/Slider/components/Single/Single.js +64 -33
  46. package/cjs/components/Slider/components/Single/Single.js.map +1 -1
  47. package/cjs/components/Slider/components/Single/Single.styles.js +4 -4
  48. package/cjs/components/Slider/components/Single/Single.styles.js.map +1 -1
  49. package/cjs/components/Slider/components/Single/Single.styles_1h7n2s2.css +6 -0
  50. package/cjs/components/Slider/components/SliderBase/SliderBase.css +5 -5
  51. package/cjs/components/Slider/components/SliderBase/SliderBase.js +31 -12
  52. package/cjs/components/Slider/components/SliderBase/SliderBase.js.map +1 -1
  53. package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
  54. package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -1
  55. package/cjs/components/Slider/components/SliderBase/SliderBase.styles_1qt1224.css +5 -0
  56. package/cjs/components/Slider/ui/Handler/Handler.css +3 -3
  57. package/cjs/components/Slider/ui/Handler/Handler.js +49 -88
  58. package/cjs/components/Slider/ui/Handler/Handler.js.map +1 -1
  59. package/cjs/components/Slider/ui/Handler/Handler.styles.js +17 -7
  60. package/cjs/components/Slider/ui/Handler/Handler.styles.js.map +1 -1
  61. package/cjs/components/Slider/ui/Handler/Handler.styles_irtcgm.css +2 -0
  62. package/cjs/components/Slider/ui/Handler/computeKeyPressData.js +122 -0
  63. package/cjs/components/Slider/ui/Handler/computeKeyPressData.js.map +1 -0
  64. package/cjs/components/Slider/ui/Thumb/Thumb.css +1 -1
  65. package/cjs/components/Slider/ui/Thumb/Thumb.js +3 -2
  66. package/cjs/components/Slider/ui/Thumb/Thumb.js.map +1 -1
  67. package/cjs/components/Slider/ui/Thumb/Thumb.styles.js +1 -1
  68. package/cjs/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -1
  69. package/cjs/components/Slider/ui/Thumb/Thumb.styles_uyn20e.css +1 -0
  70. package/cjs/components/Slider/utils/index.js +28 -10
  71. package/cjs/components/Slider/utils/index.js.map +1 -1
  72. package/cjs/components/Slider/variations/_view/base.js +1 -1
  73. package/cjs/components/Slider/variations/_view/base.js.map +1 -1
  74. package/cjs/components/Slider/variations/_view/base_1s3f6q8.css +1 -0
  75. package/cjs/index.css +38 -36
  76. package/cjs/index.js +1 -1
  77. package/cjs/utils/index.js.map +1 -1
  78. package/emotion/cjs/components/Counter/Counter.js +3 -12
  79. package/emotion/cjs/components/Counter/Counter.template-doc.mdx +2 -2
  80. package/emotion/cjs/components/Counter/Counter.tokens.js +1 -4
  81. package/emotion/cjs/components/Counter/variations/_size/base.js +1 -1
  82. package/emotion/cjs/components/Notification/Notification.js +2 -2
  83. package/emotion/cjs/components/Notification/Notification.styles.js +14 -19
  84. package/emotion/cjs/components/Notification/Notification.template-doc.mdx +17 -8
  85. package/emotion/cjs/components/Notification/Notification.tokens.js +2 -1
  86. package/emotion/cjs/components/Notification/NotificationsPortal.js +9 -5
  87. package/emotion/cjs/components/Notification/NotificationsProvider.js +3 -1
  88. package/emotion/cjs/components/Notification/index.js +4 -4
  89. package/emotion/cjs/components/Select/Select.tokens.js +2 -1
  90. package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +12 -21
  91. package/emotion/cjs/components/Slider/Slider.js +10 -2
  92. package/emotion/cjs/components/Slider/Slider.template-doc.mdx +26 -0
  93. package/emotion/cjs/components/Slider/Slider.tokens.js +23 -17
  94. package/emotion/cjs/components/Slider/components/Double/Double.js +54 -19
  95. package/emotion/cjs/components/Slider/components/Single/Single.js +64 -33
  96. package/emotion/cjs/components/Slider/components/Single/Single.styles.js +18 -9
  97. package/emotion/cjs/components/Slider/components/SliderBase/SliderBase.js +31 -12
  98. package/emotion/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +10 -10
  99. package/emotion/cjs/components/Slider/ui/Handler/Handler.js +52 -88
  100. package/emotion/cjs/components/Slider/ui/Handler/Handler.styles.js +9 -15
  101. package/emotion/cjs/components/Slider/ui/Handler/computeKeyPressData.js +121 -0
  102. package/emotion/cjs/components/Slider/ui/Thumb/Thumb.js +3 -2
  103. package/emotion/cjs/components/Slider/ui/Thumb/Thumb.styles.js +3 -3
  104. package/emotion/cjs/components/Slider/utils/index.js +28 -10
  105. package/emotion/cjs/components/Slider/variations/_view/base.js +2 -1
  106. package/emotion/cjs/examples/plasma_b2c/components/Counter/Counter.config.js +9 -12
  107. package/emotion/cjs/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
  108. package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
  109. package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  110. package/emotion/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +7 -7
  111. package/emotion/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
  112. package/emotion/cjs/examples/plasma_web/components/Counter/Counter.config.js +9 -12
  113. package/emotion/cjs/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
  114. package/emotion/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
  115. package/emotion/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  116. package/emotion/cjs/examples/plasma_web/components/Slider/Slider.config.js +7 -7
  117. package/emotion/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
  118. package/emotion/es/components/Counter/Counter.js +3 -12
  119. package/emotion/es/components/Counter/Counter.template-doc.mdx +2 -2
  120. package/emotion/es/components/Counter/Counter.tokens.js +0 -3
  121. package/emotion/es/components/Counter/variations/_size/base.js +2 -2
  122. package/emotion/es/components/Notification/Notification.js +1 -1
  123. package/emotion/es/components/Notification/Notification.styles.js +14 -19
  124. package/emotion/es/components/Notification/Notification.template-doc.mdx +17 -8
  125. package/emotion/es/components/Notification/Notification.tokens.js +2 -1
  126. package/emotion/es/components/Notification/NotificationsPortal.js +9 -5
  127. package/emotion/es/components/Notification/NotificationsProvider.js +3 -1
  128. package/emotion/es/components/Notification/index.js +1 -1
  129. package/emotion/es/components/Select/Select.tokens.js +2 -1
  130. package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +12 -21
  131. package/emotion/es/components/Slider/Slider.js +11 -2
  132. package/emotion/es/components/Slider/Slider.template-doc.mdx +26 -0
  133. package/emotion/es/components/Slider/Slider.tokens.js +23 -17
  134. package/emotion/es/components/Slider/components/Double/Double.js +54 -19
  135. package/emotion/es/components/Slider/components/Single/Single.js +65 -34
  136. package/emotion/es/components/Slider/components/Single/Single.styles.js +17 -8
  137. package/emotion/es/components/Slider/components/SliderBase/SliderBase.js +31 -12
  138. package/emotion/es/components/Slider/components/SliderBase/SliderBase.styles.js +11 -11
  139. package/emotion/es/components/Slider/ui/Handler/Handler.js +51 -86
  140. package/emotion/es/components/Slider/ui/Handler/Handler.styles.js +10 -16
  141. package/emotion/es/components/Slider/ui/Handler/computeKeyPressData.js +115 -0
  142. package/emotion/es/components/Slider/ui/Thumb/Thumb.js +3 -2
  143. package/emotion/es/components/Slider/ui/Thumb/Thumb.styles.js +3 -3
  144. package/emotion/es/components/Slider/utils/index.js +28 -10
  145. package/emotion/es/components/Slider/variations/_view/base.js +2 -1
  146. package/emotion/es/examples/plasma_b2c/components/Counter/Counter.config.js +9 -12
  147. package/emotion/es/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
  148. package/emotion/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
  149. package/emotion/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  150. package/emotion/es/examples/plasma_b2c/components/Slider/Slider.config.js +7 -7
  151. package/emotion/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
  152. package/emotion/es/examples/plasma_web/components/Counter/Counter.config.js +9 -12
  153. package/emotion/es/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
  154. package/emotion/es/examples/plasma_web/components/Notification/Notification.js +6 -4
  155. package/emotion/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  156. package/emotion/es/examples/plasma_web/components/Slider/Slider.config.js +7 -7
  157. package/emotion/es/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
  158. package/es/components/Counter/Counter.css +1 -1
  159. package/es/components/Counter/Counter.js +3 -12
  160. package/es/components/Counter/Counter.js.map +1 -1
  161. package/es/components/Counter/Counter.tokens.js +1 -4
  162. package/es/components/Counter/Counter.tokens.js.map +1 -1
  163. package/es/components/Counter/variations/_size/base.js +1 -1
  164. package/es/components/Counter/variations/_size/base.js.map +1 -1
  165. package/es/components/Counter/variations/_size/{base_4mz17d.css → base_1z0ohiy.css} +1 -1
  166. package/es/components/Notification/Notification.css +11 -11
  167. package/es/components/Notification/Notification.js +2 -2
  168. package/es/components/Notification/Notification.js.map +1 -1
  169. package/es/components/Notification/Notification.styles.js +11 -2
  170. package/es/components/Notification/Notification.styles.js.map +1 -1
  171. package/{cjs/components/Notification/Notification.styles_7h8hp0.css → es/components/Notification/Notification.styles_e6274r.css} +2 -2
  172. package/es/components/Notification/Notification.tokens.js +2 -1
  173. package/es/components/Notification/Notification.tokens.js.map +1 -1
  174. package/es/components/Notification/Notification.types.js.map +1 -1
  175. package/es/components/Notification/NotificationsPortal.js +8 -4
  176. package/es/components/Notification/NotificationsPortal.js.map +1 -1
  177. package/es/components/Notification/NotificationsProvider.css +11 -11
  178. package/es/components/Notification/NotificationsProvider.js +3 -1
  179. package/es/components/Notification/NotificationsProvider.js.map +1 -1
  180. package/es/components/Pagination/Pagination.css +12 -12
  181. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +12 -12
  182. package/es/components/Select/Select.css +12 -12
  183. package/es/components/Select/Select.tokens.js +2 -1
  184. package/es/components/Select/Select.tokens.js.map +1 -1
  185. package/es/components/Select/ui/Inner/Inner.css +12 -12
  186. package/es/components/Select/ui/Inner/ui/Item/Item.css +12 -12
  187. package/es/components/Select/ui/Target/Target.css +12 -12
  188. package/es/components/Select/ui/Target/ui/Textfield/Textfield.css +12 -12
  189. package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  190. package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
  191. package/{cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles_11yj58s.css → es/components/Select/ui/Target/ui/Textfield/Textfield.styles_jzeap2.css} +1 -1
  192. package/es/components/Slider/Slider.css +15 -13
  193. package/es/components/Slider/Slider.js +11 -2
  194. package/es/components/Slider/Slider.js.map +1 -1
  195. package/es/components/Slider/Slider.tokens.js +23 -17
  196. package/es/components/Slider/Slider.tokens.js.map +1 -1
  197. package/es/components/Slider/components/Double/Double.css +8 -8
  198. package/es/components/Slider/components/Double/Double.js +54 -19
  199. package/es/components/Slider/components/Double/Double.js.map +1 -1
  200. package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +98 -0
  201. package/es/components/Slider/components/Single/Single.css +14 -14
  202. package/es/components/Slider/components/Single/Single.js +65 -34
  203. package/es/components/Slider/components/Single/Single.js.map +1 -1
  204. package/es/components/Slider/components/Single/Single.styles.js +4 -4
  205. package/es/components/Slider/components/Single/Single.styles.js.map +1 -1
  206. package/es/components/Slider/components/Single/Single.styles_1h7n2s2.css +6 -0
  207. package/es/components/Slider/components/SliderBase/SliderBase.css +5 -5
  208. package/es/components/Slider/components/SliderBase/SliderBase.js +31 -12
  209. package/es/components/Slider/components/SliderBase/SliderBase.js.map +1 -1
  210. package/es/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
  211. package/es/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -1
  212. package/es/components/Slider/components/SliderBase/SliderBase.styles_1qt1224.css +5 -0
  213. package/es/components/Slider/ui/Handler/Handler.css +3 -3
  214. package/es/components/Slider/ui/Handler/Handler.js +48 -87
  215. package/es/components/Slider/ui/Handler/Handler.js.map +1 -1
  216. package/es/components/Slider/ui/Handler/Handler.styles.js +17 -7
  217. package/es/components/Slider/ui/Handler/Handler.styles.js.map +1 -1
  218. package/es/components/Slider/ui/Handler/Handler.styles_irtcgm.css +2 -0
  219. package/es/components/Slider/ui/Handler/computeKeyPressData.js +118 -0
  220. package/es/components/Slider/ui/Handler/computeKeyPressData.js.map +1 -0
  221. package/es/components/Slider/ui/Thumb/Thumb.css +1 -1
  222. package/es/components/Slider/ui/Thumb/Thumb.js +3 -2
  223. package/es/components/Slider/ui/Thumb/Thumb.js.map +1 -1
  224. package/es/components/Slider/ui/Thumb/Thumb.styles.js +1 -1
  225. package/es/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -1
  226. package/es/components/Slider/ui/Thumb/Thumb.styles_uyn20e.css +1 -0
  227. package/es/components/Slider/utils/index.js +28 -10
  228. package/es/components/Slider/utils/index.js.map +1 -1
  229. package/es/components/Slider/variations/_view/base.js +1 -1
  230. package/es/components/Slider/variations/_view/base.js.map +1 -1
  231. package/es/components/Slider/variations/_view/base_1s3f6q8.css +1 -0
  232. package/es/index.css +38 -36
  233. package/es/index.js +1 -1
  234. package/es/utils/index.js.map +1 -1
  235. package/package.json +2 -2
  236. package/styled-components/cjs/components/Counter/Counter.js +3 -12
  237. package/styled-components/cjs/components/Counter/Counter.template-doc.mdx +2 -2
  238. package/styled-components/cjs/components/Counter/Counter.tokens.js +1 -4
  239. package/styled-components/cjs/components/Counter/variations/_size/base.js +1 -1
  240. package/styled-components/cjs/components/Notification/Notification.js +2 -2
  241. package/styled-components/cjs/components/Notification/Notification.styles.js +5 -2
  242. package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +17 -8
  243. package/styled-components/cjs/components/Notification/Notification.tokens.js +2 -1
  244. package/styled-components/cjs/components/Notification/NotificationsPortal.js +8 -4
  245. package/styled-components/cjs/components/Notification/NotificationsProvider.js +3 -1
  246. package/styled-components/cjs/components/Notification/index.js +4 -4
  247. package/styled-components/cjs/components/Select/Select.tokens.js +2 -1
  248. package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  249. package/styled-components/cjs/components/Slider/Slider.js +10 -2
  250. package/styled-components/cjs/components/Slider/Slider.template-doc.mdx +26 -0
  251. package/styled-components/cjs/components/Slider/Slider.tokens.js +23 -17
  252. package/styled-components/cjs/components/Slider/components/Double/Double.js +54 -19
  253. package/styled-components/cjs/components/Slider/components/Single/Single.js +64 -33
  254. package/styled-components/cjs/components/Slider/components/Single/Single.styles.js +6 -6
  255. package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.js +31 -12
  256. package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +6 -6
  257. package/styled-components/cjs/components/Slider/ui/Handler/Handler.js +52 -88
  258. package/styled-components/cjs/components/Slider/ui/Handler/Handler.styles.js +7 -4
  259. package/styled-components/cjs/components/Slider/ui/Handler/computeKeyPressData.js +121 -0
  260. package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.js +3 -2
  261. package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.styles.js +2 -2
  262. package/styled-components/cjs/components/Slider/utils/index.js +28 -10
  263. package/styled-components/cjs/components/Slider/variations/_view/base.js +2 -1
  264. package/styled-components/cjs/examples/plasma_b2c/components/Counter/Counter.config.js +2 -5
  265. package/styled-components/cjs/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
  266. package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
  267. package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  268. package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +3 -3
  269. package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
  270. package/styled-components/cjs/examples/plasma_web/components/Counter/Counter.config.js +2 -5
  271. package/styled-components/cjs/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
  272. package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
  273. package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  274. package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.config.js +3 -3
  275. package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
  276. package/styled-components/es/components/Counter/Counter.js +3 -12
  277. package/styled-components/es/components/Counter/Counter.template-doc.mdx +2 -2
  278. package/styled-components/es/components/Counter/Counter.tokens.js +0 -3
  279. package/styled-components/es/components/Counter/variations/_size/base.js +2 -2
  280. package/styled-components/es/components/Notification/Notification.js +1 -1
  281. package/styled-components/es/components/Notification/Notification.styles.js +5 -2
  282. package/styled-components/es/components/Notification/Notification.template-doc.mdx +17 -8
  283. package/styled-components/es/components/Notification/Notification.tokens.js +2 -1
  284. package/styled-components/es/components/Notification/NotificationsPortal.js +8 -4
  285. package/styled-components/es/components/Notification/NotificationsProvider.js +3 -1
  286. package/styled-components/es/components/Notification/index.js +1 -1
  287. package/styled-components/es/components/Select/Select.tokens.js +2 -1
  288. package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  289. package/styled-components/es/components/Slider/Slider.js +11 -2
  290. package/styled-components/es/components/Slider/Slider.template-doc.mdx +26 -0
  291. package/styled-components/es/components/Slider/Slider.tokens.js +23 -17
  292. package/styled-components/es/components/Slider/components/Double/Double.js +54 -19
  293. package/styled-components/es/components/Slider/components/Single/Single.js +65 -34
  294. package/styled-components/es/components/Slider/components/Single/Single.styles.js +5 -5
  295. package/styled-components/es/components/Slider/components/SliderBase/SliderBase.js +31 -12
  296. package/styled-components/es/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
  297. package/styled-components/es/components/Slider/ui/Handler/Handler.js +51 -86
  298. package/styled-components/es/components/Slider/ui/Handler/Handler.styles.js +8 -5
  299. package/styled-components/es/components/Slider/ui/Handler/computeKeyPressData.js +115 -0
  300. package/styled-components/es/components/Slider/ui/Thumb/Thumb.js +3 -2
  301. package/styled-components/es/components/Slider/ui/Thumb/Thumb.styles.js +2 -2
  302. package/styled-components/es/components/Slider/utils/index.js +28 -10
  303. package/styled-components/es/components/Slider/variations/_view/base.js +2 -1
  304. package/styled-components/es/examples/plasma_b2c/components/Counter/Counter.config.js +2 -5
  305. package/styled-components/es/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
  306. package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
  307. package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  308. package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.config.js +3 -3
  309. package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
  310. package/styled-components/es/examples/plasma_web/components/Counter/Counter.config.js +2 -5
  311. package/styled-components/es/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
  312. package/styled-components/es/examples/plasma_web/components/Notification/Notification.js +6 -4
  313. package/styled-components/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  314. package/styled-components/es/examples/plasma_web/components/Slider/Slider.config.js +3 -3
  315. package/styled-components/es/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
  316. package/types/components/Counter/Counter.d.ts.map +1 -1
  317. package/types/components/Counter/Counter.tokens.d.ts +0 -3
  318. package/types/components/Counter/Counter.tokens.d.ts.map +1 -1
  319. package/types/components/Counter/Counter.types.d.ts +2 -2
  320. package/types/components/Counter/variations/_size/base.d.ts.map +1 -1
  321. package/types/components/Notification/Notification.d.ts +3 -3
  322. package/types/components/Notification/Notification.d.ts.map +1 -1
  323. package/types/components/Notification/Notification.styles.d.ts +4 -2
  324. package/types/components/Notification/Notification.styles.d.ts.map +1 -1
  325. package/types/components/Notification/Notification.tokens.d.ts +1 -0
  326. package/types/components/Notification/Notification.tokens.d.ts.map +1 -1
  327. package/types/components/Notification/Notification.types.d.ts +11 -5
  328. package/types/components/Notification/Notification.types.d.ts.map +1 -1
  329. package/types/components/Notification/NotificationsPortal.d.ts.map +1 -1
  330. package/types/components/Notification/NotificationsProvider.d.ts +4 -3
  331. package/types/components/Notification/NotificationsProvider.d.ts.map +1 -1
  332. package/types/components/Notification/index.d.ts +2 -2
  333. package/types/components/Notification/index.d.ts.map +1 -1
  334. package/types/components/Select/Select.tokens.d.ts +1 -0
  335. package/types/components/Select/Select.tokens.d.ts.map +1 -1
  336. package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts.map +1 -1
  337. package/types/components/Slider/Slider.d.ts.map +1 -1
  338. package/types/components/Slider/Slider.tokens.d.ts +22 -16
  339. package/types/components/Slider/Slider.tokens.d.ts.map +1 -1
  340. package/types/components/Slider/components/Double/Double.d.ts.map +1 -1
  341. package/types/components/Slider/components/Double/Double.types.d.ts +1 -0
  342. package/types/components/Slider/components/Double/Double.types.d.ts.map +1 -1
  343. package/types/components/Slider/components/Single/Single.d.ts.map +1 -1
  344. package/types/components/Slider/components/Single/Single.styles.d.ts +1 -1
  345. package/types/components/Slider/components/Single/Single.styles.d.ts.map +1 -1
  346. package/types/components/Slider/components/Single/Single.types.d.ts +79 -7
  347. package/types/components/Slider/components/Single/Single.types.d.ts.map +1 -1
  348. package/types/components/Slider/components/SliderBase/SliderBase.d.ts.map +1 -1
  349. package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts +1 -1
  350. package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts.map +1 -1
  351. package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts +6 -0
  352. package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts.map +1 -1
  353. package/types/components/Slider/ui/Handler/Handler.d.ts.map +1 -1
  354. package/types/components/Slider/ui/Handler/Handler.styles.d.ts +6 -2
  355. package/types/components/Slider/ui/Handler/Handler.styles.d.ts.map +1 -1
  356. package/types/components/Slider/ui/Handler/Handler.types.d.ts +5 -1
  357. package/types/components/Slider/ui/Handler/Handler.types.d.ts.map +1 -1
  358. package/types/components/Slider/ui/Handler/computeKeyPressData.d.ts +12 -0
  359. package/types/components/Slider/ui/Handler/computeKeyPressData.d.ts.map +1 -0
  360. package/types/components/Slider/ui/Thumb/Thumb.d.ts +1 -1
  361. package/types/components/Slider/ui/Thumb/Thumb.d.ts.map +1 -1
  362. package/types/components/Slider/ui/Thumb/Thumb.styles.d.ts.map +1 -1
  363. package/types/components/Slider/ui/Thumb/Thumb.types.d.ts +1 -0
  364. package/types/components/Slider/ui/Thumb/Thumb.types.d.ts.map +1 -1
  365. package/types/components/Slider/utils/index.d.ts +26 -8
  366. package/types/components/Slider/utils/index.d.ts.map +1 -1
  367. package/types/components/Slider/variations/_view/base.d.ts.map +1 -1
  368. package/types/examples/plasma_b2c/components/Counter/Counter.config.d.ts +0 -3
  369. package/types/examples/plasma_b2c/components/Counter/Counter.config.d.ts.map +1 -1
  370. package/types/examples/plasma_b2c/components/Counter/Counter.d.ts +0 -3
  371. package/types/examples/plasma_b2c/components/Counter/Counter.d.ts.map +1 -1
  372. package/types/examples/plasma_b2c/components/Notification/Notification.d.ts +4 -2
  373. package/types/examples/plasma_b2c/components/Notification/Notification.d.ts.map +1 -1
  374. package/types/examples/plasma_b2c/components/Slider/Slider.config.d.ts.map +1 -1
  375. package/types/examples/plasma_b2c/components/Slider/Slider.d.ts +80 -2
  376. package/types/examples/plasma_b2c/components/Slider/Slider.d.ts.map +1 -1
  377. package/types/examples/plasma_web/components/Counter/Counter.config.d.ts +0 -3
  378. package/types/examples/plasma_web/components/Counter/Counter.config.d.ts.map +1 -1
  379. package/types/examples/plasma_web/components/Counter/Counter.d.ts +0 -3
  380. package/types/examples/plasma_web/components/Counter/Counter.d.ts.map +1 -1
  381. package/types/examples/plasma_web/components/Notification/Notification.d.ts +4 -13
  382. package/types/examples/plasma_web/components/Notification/Notification.d.ts.map +1 -1
  383. package/types/examples/plasma_web/components/Slider/Slider.config.d.ts.map +1 -1
  384. package/types/examples/plasma_web/components/Slider/Slider.d.ts +80 -2
  385. package/types/examples/plasma_web/components/Slider/Slider.d.ts.map +1 -1
  386. package/types/utils/index.d.ts +1 -1
  387. package/types/utils/index.d.ts.map +1 -1
  388. package/cjs/components/Slider/components/Single/Single.styles_1r9f1e0.css +0 -6
  389. package/cjs/components/Slider/components/SliderBase/SliderBase.styles_9s4eb3.css +0 -5
  390. package/cjs/components/Slider/ui/Handler/Handler.styles_8crx5z.css +0 -2
  391. package/cjs/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +0 -1
  392. package/cjs/components/Slider/variations/_view/base_x642ct.css +0 -1
  393. package/es/components/Slider/components/Single/Single.styles_1r9f1e0.css +0 -6
  394. package/es/components/Slider/components/SliderBase/SliderBase.styles_9s4eb3.css +0 -5
  395. package/es/components/Slider/ui/Handler/Handler.styles_8crx5z.css +0 -2
  396. package/es/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +0 -1
  397. package/es/components/Slider/variations/_view/base_x642ct.css +0 -1
@@ -4,10 +4,13 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
6
6
  import React, { forwardRef } from 'react';
7
+ import { cx } from '../../utils';
7
8
  import { base as viewCSS } from './variations/_view/base';
8
9
  import { base as sizeCSS } from './variations/_size/base';
9
10
  import { base as disabledCSS } from './variations/_disabled/base';
10
11
  import { SingleSlider, DoubleUncontrolled } from './components';
12
+ import { classes } from './Slider.tokens';
13
+
11
14
  // TODO: проверить, можно ли обойтись без каста типов
12
15
 
13
16
  var isSingleValueProps = function isSingleValueProps(props, type) {
@@ -21,9 +24,15 @@ export var sliderRoot = function sliderRoot(Root) {
21
24
  var _ref$type = _ref.type,
22
25
  type = _ref$type === void 0 ? 'single' : _ref$type,
23
26
  props = _objectWithoutProperties(_ref, _excluded);
24
- return /*#__PURE__*/React.createElement(Root, _extends({}, props, {
27
+ if (isSingleValueProps(props, type)) {
28
+ return /*#__PURE__*/React.createElement(Root, _extends({}, props, {
29
+ className: cx(props.orientation === 'vertical' && classes.verticalOrientation, props.className),
30
+ ref: ref
31
+ }), /*#__PURE__*/React.createElement(SingleSlider, props));
32
+ }
33
+ return /*#__PURE__*/React.createElement(Root, _extends({
25
34
  ref: ref
26
- }), isSingleValueProps(props, type) && /*#__PURE__*/React.createElement(SingleSlider, props), isDoubleValueProps(props, type) && /*#__PURE__*/React.createElement(DoubleUncontrolled, props));
35
+ }, props), isDoubleValueProps(props, type) && /*#__PURE__*/React.createElement(DoubleUncontrolled, props));
27
36
  });
28
37
  };
29
38
  export var sliderConfig = {
@@ -76,3 +76,29 @@ export function App() {
76
76
  );
77
77
  }
78
78
  ```
79
+
80
+ # Вертикальное отображение
81
+
82
+ ```tsx live
83
+ import React from 'react';
84
+ import { Slider } from '@salutejs/{{ package }}';
85
+ import { IconMic } from '@salutejs/plasma-icons';
86
+
87
+ export function App() {
88
+ return (
89
+ <section style={{ height: '300px' }}>
90
+ <Slider
91
+ onChangeCommitted={() => {}}
92
+ min={0}
93
+ max={100}
94
+ value={30}
95
+ label="Громкость"
96
+ labelContent={<IconMic size="s" />}
97
+ orientation="vertical"
98
+ sliderAlign="center"
99
+ size="m"
100
+ />
101
+ </section>
102
+ );
103
+ }
104
+ ```
@@ -1,6 +1,12 @@
1
1
  export var classes = {
2
2
  labelPlacementOuter: 'slider-label-placement-outer',
3
3
  labelPlacementInner: 'slider-label-placement-inner',
4
+ labelPlacementBottom: 'slider-label-placement-bottom',
5
+ labelAlignLeft: 'slider-label-align-left',
6
+ labelAlignCenter: 'slider-label-align-center',
7
+ labelAlignRight: 'slider-label-align-right',
8
+ labelAlignNone: 'slider-label-align-none',
9
+ labelContentReversed: 'slider-label-content-reversed',
4
10
  rangeValuesPlacementOuter: 'slider-range-values-placement-outer',
5
11
  rangeValuesPlacementInner: 'slider-range-values-placement-inner',
6
12
  maxRangeValue: 'slider-max-range-value',
@@ -9,13 +15,17 @@ export var classes = {
9
15
  textFieldActive: 'slider-text-field-active',
10
16
  firstTextField: 'slider-first-text-field',
11
17
  secondTextField: 'slider-second-text-field',
12
- activeRangeValue: 'slider-active-range-value'
18
+ activeRangeValue: 'slider-active-range-value',
19
+ verticalOrientation: 'slider-vertical-orientation',
20
+ valuePlacementLeft: 'slider-value-placement-left',
21
+ reversed: 'slider-reversed'
13
22
  };
14
23
  export var tokens = {
15
- height: '--plasma-slider-height',
24
+ size: '--plasma-slider-size',
16
25
  labelWrapperGap: '--plasma-slider-label-wrapper-gap',
17
26
  labelWrapperMarginBottom: '--plasma-slider-label-wrapper-margin-bottom',
18
27
  labelWrapperMarginRight: '--plasma-slider-label-wrapper-margin-right',
28
+ labelWrapperVerticalMargin: '--plasma-slider-label-wrapper-vertical-margin',
19
29
  labelColor: '--plasma-slider-label-color',
20
30
  labelFontFamily: '--plasma-slider-label-font-family',
21
31
  labelFontSize: '--plasma-slider-label-font-size',
@@ -23,31 +33,27 @@ export var tokens = {
23
33
  labelFontWeight: '--plasma-slider-label-font-weight',
24
34
  labelLetterSpacing: '--plasma-slider-label-letter-spacing',
25
35
  labelLineHeight: '--plasma-slider-label-line-height',
26
- rangeMinValueMargin: '--plasma-slider-range-min-value-margin',
27
- rangeMaxValueMargin: '--plasma-slider-range-max-value-margin',
28
36
  rangeValueBottomOffset: '--plasma-slider-range-value-bottom-offset',
37
+ rangeValueHorizontalMargin: '--plasma-slider-range-value-horizontal-margin',
38
+ rangeValueHorizontalOffset: '--plasma-slider-range-value-horizontal-offset',
39
+ rangeValueVerticalMargin: '--plasma-slider-range-value-vertical-margin',
29
40
  rangeValueColor: '--plasma-slider-range-value-color',
30
- rangeValueFontFamily: '--plasma-slider-range-value-font-family',
31
- rangeValueFontSize: '--plasma-slider-range-value-font-size',
32
- rangeValueFontStyle: '--plasma-slider-range-value-font-style',
33
- rangeValueFontWeight: '--plasma-slider-range-value-font-weight',
34
- rangeValueLetterSpacing: '--plasma-slider-range-value-letter-spacing',
35
- rangeValueLineHeight: '--plasma-slider-range-value-line-height',
41
+ valueFontFamily: '--plasma-slider-value-font-family',
42
+ valueFontSize: '--plasma-slider-value-font-size',
43
+ valueFontStyle: '--plasma-slider-value-font-style',
44
+ valueFontWeight: '--plasma-slider-value-font-weight',
45
+ valueLetterSpacing: '--plasma-slider-value-letter-spacing',
46
+ valueLineHeight: '--plasma-slider-value-line-height',
36
47
  doubleWrapperGap: '--plasma-slider-double-wrapper-gap',
37
48
  thumbSize: '--plasma-slider-thumb-size',
49
+ thumbSizeLarge: '--plasma-slider-thumb-size-large',
38
50
  thumbBorder: '--plasma-slider-thumb-border',
39
51
  thumbBorderColor: '--plasma-slider-thumb-border-color',
40
52
  thumbBackgroundColor: '--plasma-slider-thumb-background-color',
41
53
  thumbFocusBorderColor: '--plasma-slider-thumb-focus-border-color',
42
54
  currentValueTopOffset: '--plasma-slider-current-value-top-offset',
43
- currentValueFontFamily: '--plasma-slider-current-value-font-family',
44
- currentValueFontSize: '--plasma-slider-current-value-font-size',
45
- currentValueFontStyle: '--plasma-slider-current-value-font-style',
46
- currentValueFontWeight: '--plasma-slider-current-value-font-weight',
47
- currentValueLetterSpacing: '--plasma-slider-current-value-letter-spacing',
48
- currentValueLineHeight: '--plasma-slider-current-value-line-height',
49
55
  railBackgroundColor: '--plasma-slider-rail-background-color',
50
- railHeight: '--plasma-slider-rail-height',
56
+ railThickness: '--plasma-slider-rail-thickness',
51
57
  railBorderRadius: '--plasma-slider-rail-border-radius',
52
58
  railIndent: '--plasma-slider-rail-indent',
53
59
  fillColor: '--plasma-slider-fill-color',
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["min", "max", "value", "disabled", "label", "labelContentLeft", "size", "onChangeCommitted", "onChangeTextField", "onBlurTextField", "onKeyDownTextField", "onChange", "ariaLabel", "multipleStepSize", "name"];
2
+ var _excluded = ["min", "max", "value", "disabled", "label", "labelContentLeft", "size", "pointerSize", "onChangeCommitted", "onChangeTextField", "onBlurTextField", "onKeyDownTextField", "onChange", "ariaLabel", "multipleStepSize", "name"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -38,6 +38,8 @@ export var DoubleSlider = function DoubleSlider(_ref) {
38
38
  labelContentLeft = _ref.labelContentLeft,
39
39
  _ref$size = _ref.size,
40
40
  size = _ref$size === void 0 ? 'm' : _ref$size,
41
+ _ref$pointerSize = _ref.pointerSize,
42
+ pointerSize = _ref$pointerSize === void 0 ? 'small' : _ref$pointerSize,
41
43
  onChangeCommitted = _ref.onChangeCommitted,
42
44
  onChangeTextField = _ref.onChangeTextField,
43
45
  onBlurTextField = _ref.onBlurTextField,
@@ -64,20 +66,30 @@ export var DoubleSlider = function DoubleSlider(_ref) {
64
66
  setState = _useState2[1];
65
67
  var _useState3 = useState(false),
66
68
  _useState4 = _slicedToArray(_useState3, 2),
67
- firstInputActive = _useState4[0],
68
- setFirstInputActive = _useState4[1];
69
+ firstInputHovered = _useState4[0],
70
+ setFirstInputHovered = _useState4[1];
69
71
  var _useState5 = useState(false),
70
72
  _useState6 = _slicedToArray(_useState5, 2),
71
- secondInputActive = _useState6[0],
72
- setSecondInputActive = _useState6[1];
73
- var _useState7 = useState(value[0]),
73
+ firstInputFocused = _useState6[0],
74
+ setFirstInputFocused = _useState6[1];
75
+ var _useState7 = useState(false),
74
76
  _useState8 = _slicedToArray(_useState7, 2),
75
- firstValue = _useState8[0],
76
- setFirstValue = _useState8[1];
77
- var _useState9 = useState(value[1]),
77
+ secondInputHovered = _useState8[0],
78
+ setSecondInputHovered = _useState8[1];
79
+ var _useState9 = useState(false),
78
80
  _useState10 = _slicedToArray(_useState9, 2),
79
- secondValue = _useState10[0],
80
- setSecondValue = _useState10[1];
81
+ secondInputFocused = _useState10[0],
82
+ setSecondInputFocused = _useState10[1];
83
+ var firstInputActive = firstInputHovered || firstInputFocused;
84
+ var secondInputActive = secondInputHovered || secondInputFocused;
85
+ var _useState11 = useState(value[0]),
86
+ _useState12 = _slicedToArray(_useState11, 2),
87
+ firstValue = _useState12[0],
88
+ setFirstValue = _useState12[1];
89
+ var _useState13 = useState(value[1]),
90
+ _useState14 = _slicedToArray(_useState13, 2),
91
+ secondValue = _useState14[0],
92
+ setSecondValue = _useState14[1];
81
93
  var firstHandleRef = useRef(null);
82
94
  var secondHandleRef = useRef(null);
83
95
  var firstHandleValue = useRef(value[0]);
@@ -102,6 +114,16 @@ export var DoubleSlider = function DoubleSlider(_ref) {
102
114
  });
103
115
  });
104
116
  }, [value, stepSize, min, max, setFirstValue, setSecondValue]);
117
+ useEffect(function () {
118
+ var onMouseUp = function onMouseUp() {
119
+ setFirstInputFocused(false);
120
+ setSecondInputFocused(false);
121
+ };
122
+ window.addEventListener('mouseup', onMouseUp);
123
+ return function () {
124
+ window.removeEventListener('mouseup', onMouseUp);
125
+ };
126
+ }, []);
105
127
  var setStepSize = useCallback(function (newStepSize) {
106
128
  setState(function (prevState) {
107
129
  return _objectSpread(_objectSpread({}, prevState), {}, {
@@ -243,16 +265,20 @@ export var DoubleSlider = function DoubleSlider(_ref) {
243
265
  ariaLabelLeft = _ref3[0],
244
266
  ariaLabelRight = _ref3[1];
245
267
  var currentFirstSliderValue = Math.max(state.firstValue, min);
268
+ var settings = sizeData[size][pointerSize === 'large' ? 'large' : 'small'];
246
269
  return /*#__PURE__*/React.createElement(DoubleWrapper, null, hasLabelContent && /*#__PURE__*/React.createElement(LabelWrapper, null, labelContentLeft && /*#__PURE__*/React.createElement(LabelContentLeft, null, labelContentLeft), label && /*#__PURE__*/React.createElement(Label, null, label)), /*#__PURE__*/React.createElement(SliderWrapper, null, /*#__PURE__*/React.createElement(SliderBase, _extends({
247
270
  min: min,
248
271
  max: max,
272
+ size: size,
249
273
  disabled: disabled,
250
274
  setStepSize: setStepSize,
251
275
  railFillWidth: state.railFillWidth,
252
- settings: sizeData[size],
253
- railFillXPosition: state.railFillXPosition
276
+ settings: settings,
277
+ railFillXPosition: state.railFillXPosition,
278
+ orientation: "horizontal"
254
279
  }, rest), /*#__PURE__*/React.createElement(Handler, {
255
280
  ref: firstHandleRef,
281
+ size: pointerSize,
256
282
  stepSize: state.stepSize,
257
283
  multipleStepSize: multipleStepSize,
258
284
  onChangeCommitted: onFirstHandleChangeCommitted,
@@ -262,18 +288,23 @@ export var DoubleSlider = function DoubleSlider(_ref) {
262
288
  disabled: disabled,
263
289
  bounds: [min, state.secondValue],
264
290
  side: "left",
265
- xPosition: state.xFirstHandle,
291
+ orientation: "horizontal",
292
+ position: state.xFirstHandle,
266
293
  zIndex: state.firstHandleZIndex,
267
294
  value: currentFirstSliderValue,
268
295
  ariaLabel: ariaLabelLeft,
296
+ onMouseDown: function onMouseDown() {
297
+ return setFirstInputFocused(true);
298
+ },
269
299
  onMouseEnter: function onMouseEnter() {
270
- return setFirstInputActive(true);
300
+ return setFirstInputHovered(true);
271
301
  },
272
302
  onMouseLeave: function onMouseLeave() {
273
- return setFirstInputActive(false);
303
+ return setFirstInputHovered(false);
274
304
  }
275
305
  }), /*#__PURE__*/React.createElement(Handler, {
276
306
  ref: secondHandleRef,
307
+ size: pointerSize,
277
308
  stepSize: state.stepSize,
278
309
  multipleStepSize: multipleStepSize,
279
310
  onChangeCommitted: onSecondHandleChangeCommitted,
@@ -284,15 +315,19 @@ export var DoubleSlider = function DoubleSlider(_ref) {
284
315
  disabled: disabled,
285
316
  bounds: [state.firstValue, max],
286
317
  side: "right",
287
- xPosition: state.xSecondHandle,
318
+ orientation: "horizontal",
319
+ position: state.xSecondHandle,
288
320
  zIndex: state.secondHandleZIndex,
289
321
  value: Math.max(state.secondValue, min),
290
322
  ariaLabel: ariaLabelRight,
323
+ onMouseDown: function onMouseDown() {
324
+ return setSecondInputFocused(true);
325
+ },
291
326
  onMouseEnter: function onMouseEnter() {
292
- return setSecondInputActive(true);
327
+ return setSecondInputHovered(true);
293
328
  },
294
329
  onMouseLeave: function onMouseLeave() {
295
- return setSecondInputActive(false);
330
+ return setSecondInputHovered(false);
296
331
  }
297
332
  })), /*#__PURE__*/React.createElement(InputsWrapper, null, /*#__PURE__*/React.createElement(StyledInput, {
298
333
  className: cx(classes.firstTextField, firstInputActiveClass),
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["min", "max", "value", "disabled", "onChangeCommitted", "onChange", "ariaLabel", "label", "labelContentLeft", "showRangeValues", "showCurrentValue", "hideMinValueDiff", "hideMaxValueDiff", "labelPlacement", "rangeValuesPlacement", "multipleStepSize", "defaultValue", "size", "name"];
2
+ var _excluded = ["min", "max", "value", "disabled", "onChangeCommitted", "onChange", "ariaLabel", "label", "labelContentLeft", "labelContent", "sliderAlign", "showScale", "showRangeValues", "showCurrentValue", "hideMinValueDiff", "hideMaxValueDiff", "labelPlacement", "rangeValuesPlacement", "scaleAlign", "multipleStepSize", "defaultValue", "size", "name", "pointerSize", "orientation", "reversed", "labelReversed"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -21,7 +21,7 @@ import { sizeData } from '../../utils';
21
21
  import { cx, isNumber, noop } from '../../../../utils';
22
22
  import { classes } from '../../Slider.tokens';
23
23
  import { InputHidden } from '../SliderBase/SliderBase.styles';
24
- import { Label, LabelContentLeft, LabelWrapper, SingleWrapper, SliderBaseWrapper, StyledRangeValue } from './Single.styles';
24
+ import { Label, LabelContent, LabelWrapper, SingleWrapper, SliderBaseWrapper, StyledRangeValue } from './Single.styles';
25
25
  export var SingleSlider = function SingleSlider(_ref) {
26
26
  var _ref2;
27
27
  var min = _ref.min,
@@ -33,23 +33,35 @@ export var SingleSlider = function SingleSlider(_ref) {
33
33
  ariaLabel = _ref.ariaLabel,
34
34
  label = _ref.label,
35
35
  labelContentLeft = _ref.labelContentLeft,
36
+ labelContent = _ref.labelContent,
37
+ _ref$sliderAlign = _ref.sliderAlign,
38
+ sliderAlign = _ref$sliderAlign === void 0 ? 'left' : _ref$sliderAlign,
39
+ showScale = _ref.showScale,
36
40
  showRangeValues = _ref.showRangeValues,
37
41
  showCurrentValue = _ref.showCurrentValue,
38
42
  hideMinValueDiff = _ref.hideMinValueDiff,
39
43
  hideMaxValueDiff = _ref.hideMaxValueDiff,
40
44
  _ref$labelPlacement = _ref.labelPlacement,
41
- labelPlacement = _ref$labelPlacement === void 0 ? 'outer' : _ref$labelPlacement,
42
- _ref$rangeValuesPlace = _ref.rangeValuesPlacement,
43
- rangeValuesPlacement = _ref$rangeValuesPlace === void 0 ? 'outer' : _ref$rangeValuesPlace,
45
+ labelPlacement = _ref$labelPlacement === void 0 ? 'top' : _ref$labelPlacement,
46
+ rangeValuesPlacementOld = _ref.rangeValuesPlacement,
47
+ _ref$scaleAlign = _ref.scaleAlign,
48
+ scaleAlign = _ref$scaleAlign === void 0 ? 'bottom' : _ref$scaleAlign,
44
49
  _ref$multipleStepSize = _ref.multipleStepSize,
45
50
  multipleStepSize = _ref$multipleStepSize === void 0 ? 10 : _ref$multipleStepSize,
46
51
  defaultValue = _ref.defaultValue,
47
52
  _ref$size = _ref.size,
48
53
  size = _ref$size === void 0 ? 'm' : _ref$size,
49
54
  name = _ref.name,
55
+ _ref$pointerSize = _ref.pointerSize,
56
+ pointerSize = _ref$pointerSize === void 0 ? 'small' : _ref$pointerSize,
57
+ _ref$orientation = _ref.orientation,
58
+ orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation,
59
+ reversed = _ref.reversed,
60
+ labelReversed = _ref.labelReversed,
50
61
  rest = _objectWithoutProperties(_ref, _excluded);
62
+ var isVertical = orientation === 'vertical';
51
63
  var _useState = useState({
52
- xHandle: 0,
64
+ handlePosition: 0,
53
65
  stepSize: 0,
54
66
  railFillWidth: 0
55
67
  }),
@@ -65,23 +77,28 @@ export var SingleSlider = function SingleSlider(_ref) {
65
77
  _useState6 = _slicedToArray(_useState5, 2),
66
78
  endOffset = _useState6[0],
67
79
  setEndOffset = _useState6[1];
68
- var _useState7 = useState((_ref2 = value !== null && value !== void 0 ? value : defaultValue) !== null && _ref2 !== void 0 ? _ref2 : min),
80
+ var innerValue = (_ref2 = value !== null && value !== void 0 ? value : defaultValue) !== null && _ref2 !== void 0 ? _ref2 : min;
81
+ var _useState7 = useState(innerValue),
69
82
  _useState8 = _slicedToArray(_useState7, 2),
70
83
  dragValue = _useState8[0],
71
84
  setDragValue = _useState8[1];
72
85
  var stepSize = state.stepSize;
73
- var hasLabelContent = label || labelContentLeft;
74
- var labelPlacementClass = labelPlacement === 'outer' ? classes.labelPlacementOuter : classes.labelPlacementInner;
75
- var rangeValuesPlacementClass = rangeValuesPlacement === 'outer' ? classes.rangeValuesPlacementOuter : classes.rangeValuesPlacementInner;
86
+ var innerShowScale = showRangeValues || showScale;
87
+ var hasLabelContent = Boolean(label || labelContentLeft || labelContent) && (!isVertical || isVertical && sliderAlign !== 'none');
88
+ var labelPlacementClass = !isVertical && (labelPlacement === 'outer' || labelPlacement === 'top') ? classes.labelPlacementOuter : classes.labelPlacementInner;
89
+ var rangeValuesPlacement = rangeValuesPlacementOld === 'outer' || scaleAlign === 'bottom' ? 'outer' : 'inner';
90
+ var scaleAlignClass = rangeValuesPlacement === 'outer' ? classes.rangeValuesPlacementOuter : classes.rangeValuesPlacementInner;
76
91
  var hideMinValueDiffClass = hideMinValueDiff && dragValue - min <= hideMinValueDiff ? classes.hideMinValue : '';
77
92
  var hideMaxValueDiffClass = hideMaxValueDiff && max - dragValue <= hideMaxValueDiff ? classes.hideMaxValue : '';
93
+ var verticalOrientationClass = orientation === 'vertical' ? classes.verticalOrientation : '';
78
94
  var startLabelRef = useRef(null);
79
95
  var endLabelRef = useRef(null);
80
96
  var activeFirstValue = dragValue === min ? classes.activeRangeValue : undefined;
81
97
  var activeSecondValue = dragValue === max ? classes.activeRangeValue : undefined;
82
98
  useEffect(function () {
83
- var localValue = Math.min(Math.max(dragValue, min), max) - min;
84
- if (rangeValuesPlacement === 'outer') {
99
+ var visibleValue = reversed ? max - dragValue + min : dragValue;
100
+ var localValue = Math.min(Math.max(visibleValue, min), max) - min;
101
+ if (!isVertical && rangeValuesPlacement === 'outer') {
85
102
  var _startLabelRef$curren, _endLabelRef$current;
86
103
  var startWidth = (_startLabelRef$curren = startLabelRef.current) === null || _startLabelRef$curren === void 0 ? void 0 : _startLabelRef$curren.offsetWidth;
87
104
  if (isNumber(startWidth)) {
@@ -91,30 +108,35 @@ export var SingleSlider = function SingleSlider(_ref) {
91
108
  if (isNumber(endWidth)) {
92
109
  setEndOffset(Number(endWidth));
93
110
  }
111
+ } else if (isVertical && innerShowScale && sliderAlign !== 'center') {
112
+ setStartOffset(12);
113
+ setEndOffset(12);
94
114
  } else {
95
115
  setStartOffset(1);
96
116
  setEndOffset(1);
97
117
  }
98
118
  setState(function (prevState) {
99
119
  return _objectSpread(_objectSpread({}, prevState), {}, {
100
- xHandle: stepSize * localValue,
120
+ handlePosition: stepSize * localValue,
101
121
  railFillWidth: stepSize * localValue
102
122
  });
103
123
  });
104
- }, [dragValue, labelPlacement, stepSize, rangeValuesPlacement, min, max, setStartOffset, setEndOffset]);
124
+ }, [dragValue, innerShowScale, labelPlacement, stepSize, rangeValuesPlacement, min, max, isVertical, reversed,
125
+ // для перерасчета размеров
126
+ sliderAlign, size]);
105
127
  var setStepSize = useCallback(function (newStepSize) {
106
128
  setState(function (prevState) {
107
129
  return _objectSpread(_objectSpread({}, prevState), {}, {
108
130
  stepSize: newStepSize
109
131
  });
110
132
  });
111
- }, [setState]);
133
+ }, []);
112
134
  var onHandleChange = function onHandleChange(handleValue, data) {
113
- var newHandleXPosition = data.x;
114
- var newValue = Math.round(handleValue);
135
+ var newValue = Math.round(reversed ? max - handleValue + min : handleValue);
136
+ var newHandlePosition = isVertical ? data.y : data.x;
115
137
  setState(function (prevState) {
116
138
  return _objectSpread(_objectSpread({}, prevState), {}, {
117
- railFillWidth: newHandleXPosition
139
+ railFillWidth: newHandlePosition
118
140
  });
119
141
  });
120
142
  if (onChange) {
@@ -132,41 +154,49 @@ export var SingleSlider = function SingleSlider(_ref) {
132
154
  }
133
155
  setDragValue(newValue);
134
156
  };
135
- var onHandleChangeCommitted = function onHandleChangeCommitted(handleValue, data) {
136
- var newValue = Math.round(handleValue);
157
+ var onHandleChangeCommitted = useCallback(function (handleValue, data) {
158
+ var newValue = Math.round(reversed ? max - handleValue + min : handleValue);
137
159
  if (onChangeCommitted) {
138
160
  onChangeCommitted(newValue);
139
161
  }
140
162
  setState(function (prevState) {
141
163
  return _objectSpread(_objectSpread({}, prevState), {}, {
142
- xHandle: data.lastX,
143
- railFillWidth: data.lastX
164
+ handlePosition: isVertical ? data.lastY : data.lastX,
165
+ railFillWidth: isVertical ? data.lastY : data.lastX
144
166
  });
145
167
  });
146
168
  setDragValue(newValue);
147
- };
169
+ }, [isVertical, min, max, reversed]);
170
+ var labelVerticalPlacement = reversed ? 'bottom' : 'top';
171
+ var valuePlacement = sliderAlign === 'right' ? 'left' : 'right';
172
+ var settings = sizeData[size][pointerSize === 'large' ? 'large' : 'small'];
148
173
  return /*#__PURE__*/React.createElement(SingleWrapper, {
149
- className: labelPlacementClass
150
- }, hasLabelContent && /*#__PURE__*/React.createElement(LabelWrapper, null, labelContentLeft && /*#__PURE__*/React.createElement(LabelContentLeft, null, labelContentLeft), label && /*#__PURE__*/React.createElement(Label, null, label)), /*#__PURE__*/React.createElement(SliderBaseWrapper, {
151
- className: rangeValuesPlacementClass
152
- }, showRangeValues && /*#__PURE__*/React.createElement(StyledRangeValue, {
174
+ className: cx(labelPlacementClass, scaleAlignClass, verticalOrientationClass, sliderAlign === 'right' && classes.labelAlignLeft, (sliderAlign === 'center' || sliderAlign === 'none') && classes.labelAlignCenter, sliderAlign === 'left' && classes.labelAlignRight, labelVerticalPlacement === 'bottom' && classes.labelPlacementBottom, labelReversed && classes.labelContentReversed)
175
+ }, hasLabelContent && /*#__PURE__*/React.createElement(LabelWrapper, null, (labelContentLeft || labelContent) && /*#__PURE__*/React.createElement(LabelContent, null, labelContent), label && /*#__PURE__*/React.createElement(Label, null, label)), /*#__PURE__*/React.createElement(SliderBaseWrapper, {
176
+ className: cx(!isVertical && rangeValuesPlacement === 'outer' && classes.rangeValuesPlacementOuter, !isVertical && rangeValuesPlacement !== 'outer' && classes.rangeValuesPlacementInner, verticalOrientationClass)
177
+ }, innerShowScale && /*#__PURE__*/React.createElement(StyledRangeValue, {
153
178
  ref: startLabelRef,
154
179
  className: cx(hideMinValueDiffClass, activeFirstValue)
155
- }, min), /*#__PURE__*/React.createElement(SliderBase, _extends({
180
+ }, reversed ? max : min), /*#__PURE__*/React.createElement(SliderBase, _extends({
156
181
  min: min,
157
182
  max: max,
158
183
  disabled: disabled,
184
+ size: size,
185
+ sliderAlign: sliderAlign,
159
186
  setStepSize: setStepSize,
160
187
  onChange: onHandleChangeCommitted,
161
188
  railFillWidth: state.railFillWidth,
162
- settings: sizeData[size],
189
+ settings: settings,
163
190
  labelPlacement: labelPlacement,
164
- rangeValuesPlacement: rangeValuesPlacement
191
+ rangeValuesPlacement: rangeValuesPlacement,
192
+ orientation: orientation
165
193
  }, rest), /*#__PURE__*/React.createElement(Handler, {
194
+ size: pointerSize,
195
+ orientation: orientation,
166
196
  stepSize: state.stepSize,
167
197
  onChangeCommitted: onHandleChangeCommitted,
168
198
  onChange: onHandleChange,
169
- xPosition: state.xHandle,
199
+ position: state.handlePosition,
170
200
  min: min,
171
201
  max: max,
172
202
  startOffset: startOffset,
@@ -175,11 +205,12 @@ export var SingleSlider = function SingleSlider(_ref) {
175
205
  disabled: disabled,
176
206
  ariaLabel: ariaLabel,
177
207
  multipleStepSize: multipleStepSize,
178
- showCurrentValue: showCurrentValue
179
- })), showRangeValues && /*#__PURE__*/React.createElement(StyledRangeValue, {
208
+ showCurrentValue: showCurrentValue,
209
+ valuePlacement: valuePlacement
210
+ })), innerShowScale && /*#__PURE__*/React.createElement(StyledRangeValue, {
180
211
  ref: endLabelRef,
181
212
  className: cx(classes.maxRangeValue, hideMaxValueDiffClass, activeSecondValue)
182
- }, max)), /*#__PURE__*/React.createElement(InputHidden, _extends({
213
+ }, reversed ? min : max)), /*#__PURE__*/React.createElement(InputHidden, _extends({
183
214
  name: name,
184
215
  type: "number",
185
216
  datatype: "slider-single",