@salutejs/plasma-new-hope 0.175.2-canary.1505.11553165432.0 → 0.175.3-canary.1502.11570570852.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (338) hide show
  1. package/cjs/components/Slider/Slider.css +15 -13
  2. package/cjs/components/Slider/Slider.js +11 -2
  3. package/cjs/components/Slider/Slider.js.map +1 -1
  4. package/cjs/components/Slider/Slider.tokens.js +23 -17
  5. package/cjs/components/Slider/Slider.tokens.js.map +1 -1
  6. package/cjs/components/Slider/components/Double/Double.css +8 -8
  7. package/cjs/components/Slider/components/Double/Double.js +58 -23
  8. package/cjs/components/Slider/components/Double/Double.js.map +1 -1
  9. package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +98 -0
  10. package/cjs/components/Slider/components/Single/Single.css +14 -14
  11. package/cjs/components/Slider/components/Single/Single.js +64 -33
  12. package/cjs/components/Slider/components/Single/Single.js.map +1 -1
  13. package/cjs/components/Slider/components/Single/Single.styles.js +4 -4
  14. package/cjs/components/Slider/components/Single/Single.styles.js.map +1 -1
  15. package/cjs/components/Slider/components/Single/Single.styles_1h7n2s2.css +6 -0
  16. package/cjs/components/Slider/components/SliderBase/SliderBase.css +5 -5
  17. package/cjs/components/Slider/components/SliderBase/SliderBase.js +31 -12
  18. package/cjs/components/Slider/components/SliderBase/SliderBase.js.map +1 -1
  19. package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
  20. package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -1
  21. package/cjs/components/Slider/components/SliderBase/SliderBase.styles_1qt1224.css +5 -0
  22. package/cjs/components/Slider/ui/Handler/Handler.css +3 -3
  23. package/cjs/components/Slider/ui/Handler/Handler.js +49 -88
  24. package/cjs/components/Slider/ui/Handler/Handler.js.map +1 -1
  25. package/cjs/components/Slider/ui/Handler/Handler.styles.js +17 -7
  26. package/cjs/components/Slider/ui/Handler/Handler.styles.js.map +1 -1
  27. package/cjs/components/Slider/ui/Handler/Handler.styles_irtcgm.css +2 -0
  28. package/cjs/components/Slider/ui/Handler/computeKeyPressData.js +122 -0
  29. package/cjs/components/Slider/ui/Handler/computeKeyPressData.js.map +1 -0
  30. package/cjs/components/Slider/ui/Thumb/Thumb.css +1 -1
  31. package/cjs/components/Slider/ui/Thumb/Thumb.js +3 -2
  32. package/cjs/components/Slider/ui/Thumb/Thumb.js.map +1 -1
  33. package/cjs/components/Slider/ui/Thumb/Thumb.styles.js +1 -1
  34. package/cjs/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -1
  35. package/cjs/components/Slider/ui/Thumb/Thumb.styles_uyn20e.css +1 -0
  36. package/cjs/components/Slider/utils/index.js +28 -10
  37. package/cjs/components/Slider/utils/index.js.map +1 -1
  38. package/cjs/components/Slider/variations/_view/base.js +1 -1
  39. package/cjs/components/Slider/variations/_view/base.js.map +1 -1
  40. package/cjs/components/Slider/variations/_view/base_1s3f6q8.css +1 -0
  41. package/cjs/components/Tabs/createTabsController.js.map +1 -1
  42. package/cjs/components/Tabs/tokens.js +2 -0
  43. package/cjs/components/Tabs/tokens.js.map +1 -1
  44. package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +3 -1
  45. package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js.map +1 -1
  46. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.css +5 -5
  47. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +20 -8
  48. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js.map +1 -1
  49. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +1 -1
  50. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js.map +1 -1
  51. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/{HorizontalTabs.styles_16kuvxt.css → HorizontalTabs.styles_p9rk79.css} +1 -1
  52. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
  53. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js.map +1 -1
  54. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/{base_9miwn.css → base_4ob3q5.css} +1 -1
  55. package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.css +4 -4
  56. package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +7 -6
  57. package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js.map +1 -1
  58. package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +1 -1
  59. package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js.map +1 -1
  60. package/cjs/components/Tabs/ui/vertical/VerticalTabs/{VerticalTabs.styles_1fr5ovg.css → VerticalTabs.styles_1r1hidh.css} +1 -1
  61. package/cjs/index.css +24 -22
  62. package/cjs/utils/index.js.map +1 -1
  63. package/emotion/cjs/components/Slider/Slider.js +10 -2
  64. package/emotion/cjs/components/Slider/Slider.template-doc.mdx +26 -0
  65. package/emotion/cjs/components/Slider/Slider.tokens.js +23 -17
  66. package/emotion/cjs/components/Slider/components/Double/Double.js +54 -19
  67. package/emotion/cjs/components/Slider/components/Single/Single.js +64 -33
  68. package/emotion/cjs/components/Slider/components/Single/Single.styles.js +18 -9
  69. package/emotion/cjs/components/Slider/components/SliderBase/SliderBase.js +31 -12
  70. package/emotion/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +10 -10
  71. package/emotion/cjs/components/Slider/ui/Handler/Handler.js +52 -88
  72. package/emotion/cjs/components/Slider/ui/Handler/Handler.styles.js +9 -15
  73. package/emotion/cjs/components/Slider/ui/Handler/computeKeyPressData.js +121 -0
  74. package/emotion/cjs/components/Slider/ui/Thumb/Thumb.js +3 -2
  75. package/emotion/cjs/components/Slider/ui/Thumb/Thumb.styles.js +3 -3
  76. package/emotion/cjs/components/Slider/utils/index.js +28 -10
  77. package/emotion/cjs/components/Slider/variations/_view/base.js +2 -1
  78. package/emotion/cjs/components/Tabs/tokens.js +2 -0
  79. package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +3 -1
  80. package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +20 -8
  81. package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +4 -4
  82. package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
  83. package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +7 -6
  84. package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +4 -4
  85. package/emotion/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +7 -7
  86. package/emotion/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
  87. package/emotion/cjs/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +72 -33
  88. package/emotion/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -15
  89. package/emotion/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.js +15 -15
  90. package/emotion/cjs/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.js +6 -6
  91. package/emotion/cjs/examples/plasma_web/components/Slider/Slider.config.js +7 -7
  92. package/emotion/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
  93. package/emotion/cjs/examples/plasma_web/components/Tabs/Tabs.stories.tsx +72 -33
  94. package/emotion/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -15
  95. package/emotion/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.js +15 -15
  96. package/emotion/cjs/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.js +6 -6
  97. package/emotion/es/components/Slider/Slider.js +11 -2
  98. package/emotion/es/components/Slider/Slider.template-doc.mdx +26 -0
  99. package/emotion/es/components/Slider/Slider.tokens.js +23 -17
  100. package/emotion/es/components/Slider/components/Double/Double.js +54 -19
  101. package/emotion/es/components/Slider/components/Single/Single.js +65 -34
  102. package/emotion/es/components/Slider/components/Single/Single.styles.js +17 -8
  103. package/emotion/es/components/Slider/components/SliderBase/SliderBase.js +31 -12
  104. package/emotion/es/components/Slider/components/SliderBase/SliderBase.styles.js +11 -11
  105. package/emotion/es/components/Slider/ui/Handler/Handler.js +51 -86
  106. package/emotion/es/components/Slider/ui/Handler/Handler.styles.js +10 -16
  107. package/emotion/es/components/Slider/ui/Handler/computeKeyPressData.js +115 -0
  108. package/emotion/es/components/Slider/ui/Thumb/Thumb.js +3 -2
  109. package/emotion/es/components/Slider/ui/Thumb/Thumb.styles.js +3 -3
  110. package/emotion/es/components/Slider/utils/index.js +28 -10
  111. package/emotion/es/components/Slider/variations/_view/base.js +2 -1
  112. package/emotion/es/components/Tabs/tokens.js +2 -0
  113. package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +3 -1
  114. package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +21 -9
  115. package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +4 -4
  116. package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
  117. package/emotion/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +8 -7
  118. package/emotion/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +4 -4
  119. package/emotion/es/examples/plasma_b2c/components/Slider/Slider.config.js +7 -7
  120. package/emotion/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
  121. package/emotion/es/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +72 -33
  122. package/emotion/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -15
  123. package/emotion/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.js +15 -15
  124. package/emotion/es/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.js +6 -6
  125. package/emotion/es/examples/plasma_web/components/Slider/Slider.config.js +7 -7
  126. package/emotion/es/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
  127. package/emotion/es/examples/plasma_web/components/Tabs/Tabs.stories.tsx +72 -33
  128. package/emotion/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -15
  129. package/emotion/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.js +15 -15
  130. package/emotion/es/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.js +6 -6
  131. package/es/components/Slider/Slider.css +15 -13
  132. package/es/components/Slider/Slider.js +11 -2
  133. package/es/components/Slider/Slider.js.map +1 -1
  134. package/es/components/Slider/Slider.tokens.js +23 -17
  135. package/es/components/Slider/Slider.tokens.js.map +1 -1
  136. package/es/components/Slider/components/Double/Double.css +8 -8
  137. package/es/components/Slider/components/Double/Double.js +54 -19
  138. package/es/components/Slider/components/Double/Double.js.map +1 -1
  139. package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +98 -0
  140. package/es/components/Slider/components/Single/Single.css +14 -14
  141. package/es/components/Slider/components/Single/Single.js +65 -34
  142. package/es/components/Slider/components/Single/Single.js.map +1 -1
  143. package/es/components/Slider/components/Single/Single.styles.js +4 -4
  144. package/es/components/Slider/components/Single/Single.styles.js.map +1 -1
  145. package/es/components/Slider/components/Single/Single.styles_1h7n2s2.css +6 -0
  146. package/es/components/Slider/components/SliderBase/SliderBase.css +5 -5
  147. package/es/components/Slider/components/SliderBase/SliderBase.js +31 -12
  148. package/es/components/Slider/components/SliderBase/SliderBase.js.map +1 -1
  149. package/es/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
  150. package/es/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -1
  151. package/es/components/Slider/components/SliderBase/SliderBase.styles_1qt1224.css +5 -0
  152. package/es/components/Slider/ui/Handler/Handler.css +3 -3
  153. package/es/components/Slider/ui/Handler/Handler.js +48 -87
  154. package/es/components/Slider/ui/Handler/Handler.js.map +1 -1
  155. package/es/components/Slider/ui/Handler/Handler.styles.js +17 -7
  156. package/es/components/Slider/ui/Handler/Handler.styles.js.map +1 -1
  157. package/es/components/Slider/ui/Handler/Handler.styles_irtcgm.css +2 -0
  158. package/es/components/Slider/ui/Handler/computeKeyPressData.js +118 -0
  159. package/es/components/Slider/ui/Handler/computeKeyPressData.js.map +1 -0
  160. package/es/components/Slider/ui/Thumb/Thumb.css +1 -1
  161. package/es/components/Slider/ui/Thumb/Thumb.js +3 -2
  162. package/es/components/Slider/ui/Thumb/Thumb.js.map +1 -1
  163. package/es/components/Slider/ui/Thumb/Thumb.styles.js +1 -1
  164. package/es/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -1
  165. package/es/components/Slider/ui/Thumb/Thumb.styles_uyn20e.css +1 -0
  166. package/es/components/Slider/utils/index.js +28 -10
  167. package/es/components/Slider/utils/index.js.map +1 -1
  168. package/es/components/Slider/variations/_view/base.js +1 -1
  169. package/es/components/Slider/variations/_view/base.js.map +1 -1
  170. package/es/components/Slider/variations/_view/base_1s3f6q8.css +1 -0
  171. package/es/components/Tabs/createTabsController.js.map +1 -1
  172. package/es/components/Tabs/tokens.js +2 -0
  173. package/es/components/Tabs/tokens.js.map +1 -1
  174. package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +3 -1
  175. package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js.map +1 -1
  176. package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.css +5 -5
  177. package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +21 -9
  178. package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js.map +1 -1
  179. package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +1 -1
  180. package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js.map +1 -1
  181. package/es/components/Tabs/ui/horizontal/HorizontalTabs/{HorizontalTabs.styles_16kuvxt.css → HorizontalTabs.styles_p9rk79.css} +1 -1
  182. package/es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
  183. package/es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js.map +1 -1
  184. package/es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/{base_9miwn.css → base_4ob3q5.css} +1 -1
  185. package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.css +4 -4
  186. package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +8 -7
  187. package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js.map +1 -1
  188. package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +1 -1
  189. package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js.map +1 -1
  190. package/es/components/Tabs/ui/vertical/VerticalTabs/{VerticalTabs.styles_1fr5ovg.css → VerticalTabs.styles_1r1hidh.css} +1 -1
  191. package/es/index.css +24 -22
  192. package/es/utils/index.js.map +1 -1
  193. package/package.json +2 -2
  194. package/styled-components/cjs/components/Slider/Slider.js +10 -2
  195. package/styled-components/cjs/components/Slider/Slider.template-doc.mdx +26 -0
  196. package/styled-components/cjs/components/Slider/Slider.tokens.js +23 -17
  197. package/styled-components/cjs/components/Slider/components/Double/Double.js +54 -19
  198. package/styled-components/cjs/components/Slider/components/Single/Single.js +64 -33
  199. package/styled-components/cjs/components/Slider/components/Single/Single.styles.js +6 -6
  200. package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.js +31 -12
  201. package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +6 -6
  202. package/styled-components/cjs/components/Slider/ui/Handler/Handler.js +52 -88
  203. package/styled-components/cjs/components/Slider/ui/Handler/Handler.styles.js +7 -4
  204. package/styled-components/cjs/components/Slider/ui/Handler/computeKeyPressData.js +121 -0
  205. package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.js +3 -2
  206. package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.styles.js +2 -2
  207. package/styled-components/cjs/components/Slider/utils/index.js +28 -10
  208. package/styled-components/cjs/components/Slider/variations/_view/base.js +2 -1
  209. package/styled-components/cjs/components/Tabs/tokens.js +2 -0
  210. package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +3 -1
  211. package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +20 -8
  212. package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +2 -2
  213. package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
  214. package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +7 -6
  215. package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +2 -2
  216. package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +3 -3
  217. package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
  218. package/styled-components/cjs/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +72 -33
  219. package/styled-components/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +2 -2
  220. package/styled-components/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.js +3 -3
  221. package/styled-components/cjs/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.js +1 -1
  222. package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.config.js +3 -3
  223. package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
  224. package/styled-components/cjs/examples/plasma_web/components/Tabs/Tabs.stories.tsx +72 -33
  225. package/styled-components/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +2 -2
  226. package/styled-components/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.js +3 -3
  227. package/styled-components/cjs/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.js +1 -1
  228. package/styled-components/es/components/Slider/Slider.js +11 -2
  229. package/styled-components/es/components/Slider/Slider.template-doc.mdx +26 -0
  230. package/styled-components/es/components/Slider/Slider.tokens.js +23 -17
  231. package/styled-components/es/components/Slider/components/Double/Double.js +54 -19
  232. package/styled-components/es/components/Slider/components/Single/Single.js +65 -34
  233. package/styled-components/es/components/Slider/components/Single/Single.styles.js +5 -5
  234. package/styled-components/es/components/Slider/components/SliderBase/SliderBase.js +31 -12
  235. package/styled-components/es/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
  236. package/styled-components/es/components/Slider/ui/Handler/Handler.js +51 -86
  237. package/styled-components/es/components/Slider/ui/Handler/Handler.styles.js +8 -5
  238. package/styled-components/es/components/Slider/ui/Handler/computeKeyPressData.js +115 -0
  239. package/styled-components/es/components/Slider/ui/Thumb/Thumb.js +3 -2
  240. package/styled-components/es/components/Slider/ui/Thumb/Thumb.styles.js +2 -2
  241. package/styled-components/es/components/Slider/utils/index.js +28 -10
  242. package/styled-components/es/components/Slider/variations/_view/base.js +2 -1
  243. package/styled-components/es/components/Tabs/tokens.js +2 -0
  244. package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +3 -1
  245. package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +21 -9
  246. package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +2 -2
  247. package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
  248. package/styled-components/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +8 -7
  249. package/styled-components/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +2 -2
  250. package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.config.js +3 -3
  251. package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
  252. package/styled-components/es/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +72 -33
  253. package/styled-components/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +2 -2
  254. package/styled-components/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.js +3 -3
  255. package/styled-components/es/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.js +1 -1
  256. package/styled-components/es/examples/plasma_web/components/Slider/Slider.config.js +3 -3
  257. package/styled-components/es/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
  258. package/styled-components/es/examples/plasma_web/components/Tabs/Tabs.stories.tsx +72 -33
  259. package/styled-components/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +2 -2
  260. package/styled-components/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.js +3 -3
  261. package/styled-components/es/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.js +1 -1
  262. package/types/components/Slider/Slider.d.ts.map +1 -1
  263. package/types/components/Slider/Slider.tokens.d.ts +22 -16
  264. package/types/components/Slider/Slider.tokens.d.ts.map +1 -1
  265. package/types/components/Slider/components/Double/Double.d.ts.map +1 -1
  266. package/types/components/Slider/components/Double/Double.types.d.ts +1 -0
  267. package/types/components/Slider/components/Double/Double.types.d.ts.map +1 -1
  268. package/types/components/Slider/components/Single/Single.d.ts.map +1 -1
  269. package/types/components/Slider/components/Single/Single.styles.d.ts +1 -1
  270. package/types/components/Slider/components/Single/Single.styles.d.ts.map +1 -1
  271. package/types/components/Slider/components/Single/Single.types.d.ts +79 -7
  272. package/types/components/Slider/components/Single/Single.types.d.ts.map +1 -1
  273. package/types/components/Slider/components/SliderBase/SliderBase.d.ts.map +1 -1
  274. package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts +1 -1
  275. package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts.map +1 -1
  276. package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts +6 -0
  277. package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts.map +1 -1
  278. package/types/components/Slider/ui/Handler/Handler.d.ts.map +1 -1
  279. package/types/components/Slider/ui/Handler/Handler.styles.d.ts +6 -2
  280. package/types/components/Slider/ui/Handler/Handler.styles.d.ts.map +1 -1
  281. package/types/components/Slider/ui/Handler/Handler.types.d.ts +5 -1
  282. package/types/components/Slider/ui/Handler/Handler.types.d.ts.map +1 -1
  283. package/types/components/Slider/ui/Handler/computeKeyPressData.d.ts +12 -0
  284. package/types/components/Slider/ui/Handler/computeKeyPressData.d.ts.map +1 -0
  285. package/types/components/Slider/ui/Thumb/Thumb.d.ts +1 -1
  286. package/types/components/Slider/ui/Thumb/Thumb.d.ts.map +1 -1
  287. package/types/components/Slider/ui/Thumb/Thumb.styles.d.ts.map +1 -1
  288. package/types/components/Slider/ui/Thumb/Thumb.types.d.ts +1 -0
  289. package/types/components/Slider/ui/Thumb/Thumb.types.d.ts.map +1 -1
  290. package/types/components/Slider/utils/index.d.ts +26 -8
  291. package/types/components/Slider/utils/index.d.ts.map +1 -1
  292. package/types/components/Slider/variations/_view/base.d.ts.map +1 -1
  293. package/types/components/Tabs/TabItem.types.d.ts +50 -8
  294. package/types/components/Tabs/TabItem.types.d.ts.map +1 -1
  295. package/types/components/Tabs/Tabs.types.d.ts +44 -2
  296. package/types/components/Tabs/Tabs.types.d.ts.map +1 -1
  297. package/types/components/Tabs/createTabsController.d.ts +2 -2
  298. package/types/components/Tabs/createTabsController.d.ts.map +1 -1
  299. package/types/components/Tabs/index.d.ts +2 -2
  300. package/types/components/Tabs/index.d.ts.map +1 -1
  301. package/types/components/Tabs/tokens.d.ts +2 -0
  302. package/types/components/Tabs/tokens.d.ts.map +1 -1
  303. package/types/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.d.ts.map +1 -1
  304. package/types/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.d.ts +2 -2
  305. package/types/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.d.ts.map +1 -1
  306. package/types/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.d.ts.map +1 -1
  307. package/types/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.d.ts.map +1 -1
  308. package/types/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.d.ts.map +1 -1
  309. package/types/examples/plasma_b2c/components/Slider/Slider.config.d.ts.map +1 -1
  310. package/types/examples/plasma_b2c/components/Slider/Slider.d.ts +80 -2
  311. package/types/examples/plasma_b2c/components/Slider/Slider.d.ts.map +1 -1
  312. package/types/examples/plasma_b2c/components/Tabs/TabItem.d.ts +21 -6
  313. package/types/examples/plasma_b2c/components/Tabs/TabItem.d.ts.map +1 -1
  314. package/types/examples/plasma_b2c/components/Tabs/Tabs.d.ts +2 -2
  315. package/types/examples/plasma_b2c/components/Tabs/Tabs.d.ts.map +1 -1
  316. package/types/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.d.ts.map +1 -1
  317. package/types/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.d.ts.map +1 -1
  318. package/types/examples/plasma_web/components/Slider/Slider.config.d.ts.map +1 -1
  319. package/types/examples/plasma_web/components/Slider/Slider.d.ts +80 -2
  320. package/types/examples/plasma_web/components/Slider/Slider.d.ts.map +1 -1
  321. package/types/examples/plasma_web/components/Tabs/TabItem.d.ts +21 -6
  322. package/types/examples/plasma_web/components/Tabs/TabItem.d.ts.map +1 -1
  323. package/types/examples/plasma_web/components/Tabs/Tabs.d.ts +2 -2
  324. package/types/examples/plasma_web/components/Tabs/Tabs.d.ts.map +1 -1
  325. package/types/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.d.ts.map +1 -1
  326. package/types/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.d.ts.map +1 -1
  327. package/types/utils/index.d.ts +1 -1
  328. package/types/utils/index.d.ts.map +1 -1
  329. package/cjs/components/Slider/components/Single/Single.styles_1r9f1e0.css +0 -6
  330. package/cjs/components/Slider/components/SliderBase/SliderBase.styles_9s4eb3.css +0 -5
  331. package/cjs/components/Slider/ui/Handler/Handler.styles_8crx5z.css +0 -2
  332. package/cjs/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +0 -1
  333. package/cjs/components/Slider/variations/_view/base_x642ct.css +0 -1
  334. package/es/components/Slider/components/Single/Single.styles_1r9f1e0.css +0 -6
  335. package/es/components/Slider/components/SliderBase/SliderBase.styles_9s4eb3.css +0 -5
  336. package/es/components/Slider/ui/Handler/Handler.styles_8crx5z.css +0 -2
  337. package/es/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +0 -1
  338. package/es/components/Slider/variations/_view/base_x642ct.css +0 -1
@@ -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",
@@ -3,18 +3,18 @@ import { classes, tokens } from '../../Slider.tokens';
3
3
  export var LabelWrapper = /*#__PURE__*/styled.div.withConfig({
4
4
  componentId: "plasma-new-hope__sc-1qm4elt-0"
5
5
  })(["color:var(", ");display:flex;gap:var(", ");"], tokens.labelColor, tokens.labelWrapperGap);
6
- export var LabelContentLeft = /*#__PURE__*/styled.div.withConfig({
6
+ export var LabelContent = /*#__PURE__*/styled.div.withConfig({
7
7
  componentId: "plasma-new-hope__sc-1qm4elt-1"
8
- })([""]);
8
+ })(["display:inline-flex;"]);
9
9
  export var Label = /*#__PURE__*/styled.label.withConfig({
10
10
  componentId: "plasma-new-hope__sc-1qm4elt-2"
11
11
  })(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");"], tokens.labelFontFamily, tokens.labelFontSize, tokens.labelFontStyle, tokens.labelFontWeight, tokens.labelLetterSpacing, tokens.labelLineHeight);
12
12
  export var StyledRangeValue = /*#__PURE__*/styled.span.withConfig({
13
13
  componentId: "plasma-new-hope__sc-1qm4elt-3"
14
- })(["color:var(", ");font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");transition:opacity 0.1s ease-in-out;&.", ",&.", "{opacity:0;}&.", "{color:var(", ");}"], tokens.rangeValueColor, tokens.rangeValueFontFamily, tokens.rangeValueFontSize, tokens.rangeValueFontStyle, tokens.rangeValueFontWeight, tokens.rangeValueLetterSpacing, tokens.rangeValueLineHeight, classes.hideMinValue, classes.hideMaxValue, classes.activeRangeValue, tokens.labelColor);
14
+ })(["color:var(", ");font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");transition:opacity 0.1s ease-in-out;&.", ",&.", "{opacity:0;}&.", "{color:var(", ");}"], tokens.rangeValueColor, tokens.valueFontFamily, tokens.valueFontSize, tokens.valueFontStyle, tokens.valueFontWeight, tokens.valueLetterSpacing, tokens.valueLineHeight, classes.hideMinValue, classes.hideMaxValue, classes.activeRangeValue, tokens.labelColor);
15
15
  export var SliderBaseWrapper = /*#__PURE__*/styled.div.withConfig({
16
16
  componentId: "plasma-new-hope__sc-1qm4elt-4"
17
- })(["position:relative;display:flex;flex:1;&.", "{", "{position:absolute;bottom:var(", ");left:0;&.", "{left:unset;right:0;}}}&.", "{align-items:center;", "{margin-right:var(", ");&.", "{margin-right:0;margin-left:var(", ");}}}"], classes.rangeValuesPlacementOuter, StyledRangeValue, tokens.rangeValueBottomOffset, classes.maxRangeValue, classes.rangeValuesPlacementInner, StyledRangeValue, tokens.rangeMinValueMargin, classes.maxRangeValue, tokens.rangeMaxValueMargin);
17
+ })(["position:relative;display:flex;flex:1;&.", "{", "{position:absolute;bottom:calc(var(", ") * -1.5 - var(", "));left:0;&.", "{left:unset;right:0;}}}&.", "{align-items:center;", "{margin-right:var(", ");&.", "{margin-right:0;margin-left:var(", ");}}}"], classes.rangeValuesPlacementOuter, StyledRangeValue, tokens.railThickness, tokens.rangeValueBottomOffset, classes.maxRangeValue, classes.rangeValuesPlacementInner, StyledRangeValue, tokens.rangeValueHorizontalMargin, classes.maxRangeValue, tokens.rangeValueHorizontalMargin);
18
18
  export var SingleWrapper = /*#__PURE__*/styled.div.withConfig({
19
19
  componentId: "plasma-new-hope__sc-1qm4elt-5"
20
- })(["display:flex;opacity:var(", ");&.", "{flex-direction:column;", "{margin-bottom:var(", ");}}&.", "{", "{margin-right:var(", ");}}"], tokens.disabledOpacity, classes.labelPlacementOuter, LabelWrapper, tokens.labelWrapperMarginBottom, classes.labelPlacementInner, LabelWrapper, tokens.labelWrapperMarginRight);
20
+ })(["display:flex;opacity:var(", ");&.", "{flex-direction:column;", "{margin-bottom:var(", ");}}&.", "{", "{margin-right:var(", ");}}&.", "{flex-direction:column;align-items:center;&.", "{", "{flex-direction:column-reverse;}&.", "{", "{flex-direction:column;}&.", "{", "{flex-direction:column-reverse;}}}&.", "{", "{flex-direction:column;}}}", "{align-items:center;}", "{width:var(", ");}&.", "{", "{margin-right:0;margin-bottom:var(", ");}}&.", "{align-items:flex-end;", "{flex-direction:row-reverse;}}&.", "{align-items:flex-start;}&.", "{flex-direction:column-reverse;", "{margin-top:var(", ");margin-right:0;margin-bottom:0;}}}&.", "{flex-direction:column;align-items:center;justify-content:center;", "{flex-direction:column;align-items:center;justify-content:center;}&.", "{", "{position:static;bottom:0;left:0;margin-bottom:var(", ");&.", "{left:0;right:0;bottom:0;margin-top:var(", ");margin-bottom:0;}}}&.", ",&.", "{", "{margin-right:0;margin-bottom:0;position:absolute;top:0;right:calc( var(", ") / 2 + var(", ") / 2 + var(", ") );&.", "{margin-right:0;margin-left:0;top:auto;bottom:0;}}}&.", "{", "{left:calc(var(", ") + var(", "));}}}"], tokens.disabledOpacity, classes.labelPlacementOuter, LabelWrapper, tokens.labelWrapperMarginBottom, classes.labelPlacementInner, LabelWrapper, tokens.labelWrapperMarginRight, classes.verticalOrientation, classes.labelAlignCenter, LabelWrapper, classes.labelPlacementBottom, LabelWrapper, classes.labelContentReversed, LabelWrapper, classes.labelContentReversed, LabelWrapper, LabelWrapper, SliderBaseWrapper, tokens.size, classes.labelPlacementInner, LabelWrapper, tokens.labelWrapperVerticalMargin, classes.labelAlignLeft, LabelWrapper, classes.labelAlignRight, classes.labelPlacementBottom, LabelWrapper, tokens.labelWrapperVerticalMargin, classes.verticalOrientation, SliderBaseWrapper, classes.labelAlignCenter, StyledRangeValue, tokens.rangeValueVerticalMargin, classes.maxRangeValue, tokens.rangeValueVerticalMargin, classes.labelAlignLeft, classes.labelAlignRight, StyledRangeValue, tokens.railThickness, tokens.size, tokens.rangeValueHorizontalOffset, classes.maxRangeValue, classes.labelAlignRight, StyledRangeValue, tokens.size, tokens.railThickness);
@@ -1,5 +1,7 @@
1
1
  import React, { useRef, useEffect } from 'react';
2
2
  import { useIsomorphicLayoutEffect } from '../../../../hooks';
3
+ import { classes } from '../../Slider.tokens';
4
+ import { cx } from '../../../../utils';
3
5
  import { Fill, Rail, RailWrap, Slider } from './SliderBase.styles';
4
6
  export var SliderBase = function SliderBase(_ref) {
5
7
  var max = _ref.max,
@@ -13,6 +15,9 @@ export var SliderBase = function SliderBase(_ref) {
13
15
  labelPlacement = _ref.labelPlacement,
14
16
  rangeValuesPlacement = _ref.rangeValuesPlacement,
15
17
  onChange = _ref.onChange,
18
+ orientation = _ref.orientation,
19
+ size = _ref.size,
20
+ sliderAlign = _ref.sliderAlign,
16
21
  _ref$settings = _ref.settings,
17
22
  settings = _ref$settings === void 0 ? {} : _ref$settings;
18
23
  var _settings$indent = settings.indent,
@@ -21,34 +26,43 @@ export var SliderBase = function SliderBase(_ref) {
21
26
  fontSizeMultiplier = _settings$fontSizeMul === void 0 ? 16 : _settings$fontSizeMul;
22
27
  var ref = useRef(null);
23
28
  var gap = indent * fontSizeMultiplier * 2;
29
+ var isVertical = orientation === 'vertical';
24
30
  useEffect(function () {
25
31
  var resizeHandler = function resizeHandler() {
26
32
  if (ref.current) {
27
- var railSize = ref.current.offsetWidth - gap;
33
+ var railSize = isVertical ? ref.current.offsetHeight - gap : ref.current.offsetWidth - gap;
28
34
  var totalSteps = max - min;
29
35
  setStepSize(railSize / totalSteps);
30
36
  }
31
37
  };
32
38
  resizeHandler();
33
- }, [labelPlacement, rangeValuesPlacement]);
39
+ }, [labelPlacement, rangeValuesPlacement, gap, isVertical,
40
+ // для перерасчета размеров
41
+ size, sliderAlign]);
34
42
  var onHandleChange = function onHandleChange(e) {
35
43
  if (!onChange || disabled) {
36
44
  return;
37
45
  }
38
46
  var _e$currentTarget$getB = e.currentTarget.getBoundingClientRect(),
39
47
  x = _e$currentTarget$getB.x,
40
- width = _e$currentTarget$getB.width;
41
- var lastX = e.clientX - x;
42
- var position = min + lastX / (width - gap) * (max - min);
48
+ width = _e$currentTarget$getB.width,
49
+ y = _e$currentTarget$getB.y,
50
+ height = _e$currentTarget$getB.height;
51
+ var lastPos = isVertical ? e.clientY - y : e.clientX - x;
52
+ var sliderWidth = isVertical ? height : width;
53
+ var position = min + lastPos / (sliderWidth - gap) * (max - min);
43
54
  var result = Math.max(min, Math.min(max, position));
44
- onChange(result, {
45
- lastX: lastX
46
- });
55
+ var data = isVertical ? {
56
+ lastY: lastPos
57
+ } : {
58
+ lastX: lastPos
59
+ };
60
+ onChange(result, data);
47
61
  };
48
62
  useIsomorphicLayoutEffect(function () {
49
63
  var resizeHandler = function resizeHandler() {
50
64
  if (ref.current) {
51
- var railSize = ref.current.offsetWidth - gap;
65
+ var railSize = isVertical ? ref.current.offsetHeight - gap : ref.current.offsetWidth - gap;
52
66
  var totalSteps = max - min;
53
67
  setStepSize(railSize / totalSteps);
54
68
  }
@@ -58,13 +72,18 @@ export var SliderBase = function SliderBase(_ref) {
58
72
  return function () {
59
73
  return window.removeEventListener('resize', resizeHandler);
60
74
  };
61
- }, [min, max, setStepSize, gap, labelPlacement, rangeValuesPlacement]);
62
- var fillStyle = {
75
+ }, [min, max, setStepSize, gap, labelPlacement, rangeValuesPlacement, isVertical]);
76
+ var fillStyle = isVertical ? {
77
+ top: "".concat(railFillXPosition, "px"),
78
+ height: "".concat(railFillWidth, "px"),
79
+ width: '100%'
80
+ } : {
63
81
  left: "".concat(railFillXPosition, "px"),
64
82
  width: "".concat(railFillWidth, "px")
65
83
  };
66
84
  return /*#__PURE__*/React.createElement(Slider, {
67
- ref: ref
85
+ ref: ref,
86
+ className: cx(orientation === 'vertical' && classes.verticalOrientation)
68
87
  }, /*#__PURE__*/React.createElement(RailWrap, {
69
88
  "aria-hidden": "true",
70
89
  onMouseDown: onHandleChange
@@ -1,15 +1,15 @@
1
1
  import styled from 'styled-components';
2
2
  import { applyHidden } from '../../../../mixins';
3
- import { tokens } from '../../Slider.tokens';
4
- export var Slider = /*#__PURE__*/styled.div.withConfig({
3
+ import { classes, tokens } from '../../Slider.tokens';
4
+ export var Rail = /*#__PURE__*/styled.div.withConfig({
5
5
  componentId: "plasma-new-hope__sc-ik0bjb-0"
6
- })(["flex:1;position:relative;user-select:none;height:var(", ");"], tokens.height);
7
- export var RailWrap = /*#__PURE__*/styled.div.withConfig({
6
+ })(["position:relative;top:50%;height:var(", ");border-radius:var(", ");background-color:var(", ");overflow:hidden;transform:translateY(-50%);"], tokens.railThickness, tokens.railBorderRadius, tokens.railBackgroundColor);
7
+ export var Slider = /*#__PURE__*/styled.div.withConfig({
8
8
  componentId: "plasma-new-hope__sc-ik0bjb-1"
9
- })(["height:100%;"]);
10
- export var Rail = /*#__PURE__*/styled.div.withConfig({
9
+ })(["flex:1;position:relative;user-select:none;height:var(", ");&.", "{width:var(", ");height:auto;", "{top:0;left:50%;transform:translateX(-50%);width:var(", ");height:100%;}}"], tokens.size, classes.verticalOrientation, tokens.size, Rail, tokens.railThickness);
10
+ export var RailWrap = /*#__PURE__*/styled.div.withConfig({
11
11
  componentId: "plasma-new-hope__sc-ik0bjb-2"
12
- })(["position:relative;top:50%;height:var(", ");border-radius:var(", ");background-color:var(", ");overflow:hidden;transform:translateY(-50%);"], tokens.railHeight, tokens.railBorderRadius, tokens.railBackgroundColor);
12
+ })(["height:100%;"]);
13
13
  export var Fill = /*#__PURE__*/styled.div.withConfig({
14
14
  componentId: "plasma-new-hope__sc-ik0bjb-3"
15
15
  })(["position:absolute;height:100%;top:0;left:0;background:var(", ");width:0;"], tokens.fillColor);