@salutejs/plasma-new-hope 0.175.3-canary.1512.11555735717.0 → 0.176.0-canary.1452.11568379583.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (264) hide show
  1. package/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  2. package/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js.map +1 -1
  3. package/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  4. package/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js.map +1 -1
  5. package/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  6. package/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js.map +1 -1
  7. package/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  8. package/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js.map +1 -1
  9. package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +2 -4
  10. package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js.map +1 -1
  11. package/cjs/components/Popover/Popover.js +1 -2
  12. package/cjs/components/Popover/Popover.js.map +1 -1
  13. package/cjs/components/Slider/Slider.css +15 -13
  14. package/cjs/components/Slider/Slider.js +11 -2
  15. package/cjs/components/Slider/Slider.js.map +1 -1
  16. package/cjs/components/Slider/Slider.tokens.js +23 -17
  17. package/cjs/components/Slider/Slider.tokens.js.map +1 -1
  18. package/cjs/components/Slider/components/Double/Double.css +8 -8
  19. package/cjs/components/Slider/components/Double/Double.js +58 -23
  20. package/cjs/components/Slider/components/Double/Double.js.map +1 -1
  21. package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +98 -0
  22. package/cjs/components/Slider/components/Single/Single.css +14 -14
  23. package/cjs/components/Slider/components/Single/Single.js +64 -33
  24. package/cjs/components/Slider/components/Single/Single.js.map +1 -1
  25. package/cjs/components/Slider/components/Single/Single.styles.js +4 -4
  26. package/cjs/components/Slider/components/Single/Single.styles.js.map +1 -1
  27. package/cjs/components/Slider/components/Single/Single.styles_1h7n2s2.css +6 -0
  28. package/cjs/components/Slider/components/SliderBase/SliderBase.css +5 -5
  29. package/cjs/components/Slider/components/SliderBase/SliderBase.js +31 -12
  30. package/cjs/components/Slider/components/SliderBase/SliderBase.js.map +1 -1
  31. package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
  32. package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -1
  33. package/cjs/components/Slider/components/SliderBase/SliderBase.styles_1qt1224.css +5 -0
  34. package/cjs/components/Slider/ui/Handler/Handler.css +3 -3
  35. package/cjs/components/Slider/ui/Handler/Handler.js +49 -88
  36. package/cjs/components/Slider/ui/Handler/Handler.js.map +1 -1
  37. package/cjs/components/Slider/ui/Handler/Handler.styles.js +17 -7
  38. package/cjs/components/Slider/ui/Handler/Handler.styles.js.map +1 -1
  39. package/cjs/components/Slider/ui/Handler/Handler.styles_irtcgm.css +2 -0
  40. package/cjs/components/Slider/ui/Handler/computeKeyPressData.js +122 -0
  41. package/cjs/components/Slider/ui/Handler/computeKeyPressData.js.map +1 -0
  42. package/cjs/components/Slider/ui/Thumb/Thumb.css +1 -1
  43. package/cjs/components/Slider/ui/Thumb/Thumb.js +3 -2
  44. package/cjs/components/Slider/ui/Thumb/Thumb.js.map +1 -1
  45. package/cjs/components/Slider/ui/Thumb/Thumb.styles.js +1 -1
  46. package/cjs/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -1
  47. package/cjs/components/Slider/ui/Thumb/Thumb.styles_uyn20e.css +1 -0
  48. package/cjs/components/Slider/utils/index.js +28 -10
  49. package/cjs/components/Slider/utils/index.js.map +1 -1
  50. package/cjs/components/Slider/variations/_view/base.js +1 -1
  51. package/cjs/components/Slider/variations/_view/base.js.map +1 -1
  52. package/cjs/components/Slider/variations/_view/base_1s3f6q8.css +1 -0
  53. package/cjs/index.css +15 -13
  54. package/cjs/utils/index.js.map +1 -1
  55. package/emotion/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  56. package/emotion/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  57. package/emotion/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  58. package/emotion/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  59. package/emotion/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -6
  60. package/emotion/cjs/components/Popover/Popover.js +1 -2
  61. package/emotion/cjs/components/Slider/Slider.js +10 -2
  62. package/emotion/cjs/components/Slider/Slider.template-doc.mdx +26 -0
  63. package/emotion/cjs/components/Slider/Slider.tokens.js +23 -17
  64. package/emotion/cjs/components/Slider/components/Double/Double.js +54 -19
  65. package/emotion/cjs/components/Slider/components/Single/Single.js +64 -33
  66. package/emotion/cjs/components/Slider/components/Single/Single.styles.js +18 -9
  67. package/emotion/cjs/components/Slider/components/SliderBase/SliderBase.js +31 -12
  68. package/emotion/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +10 -10
  69. package/emotion/cjs/components/Slider/ui/Handler/Handler.js +52 -88
  70. package/emotion/cjs/components/Slider/ui/Handler/Handler.styles.js +9 -15
  71. package/emotion/cjs/components/Slider/ui/Handler/computeKeyPressData.js +121 -0
  72. package/emotion/cjs/components/Slider/ui/Thumb/Thumb.js +3 -2
  73. package/emotion/cjs/components/Slider/ui/Thumb/Thumb.styles.js +3 -3
  74. package/emotion/cjs/components/Slider/utils/index.js +28 -10
  75. package/emotion/cjs/components/Slider/variations/_view/base.js +2 -1
  76. package/emotion/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +7 -7
  77. package/emotion/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
  78. package/emotion/cjs/examples/plasma_web/components/Slider/Slider.config.js +7 -7
  79. package/emotion/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
  80. package/emotion/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  81. package/emotion/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  82. package/emotion/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  83. package/emotion/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  84. package/emotion/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +2 -4
  85. package/emotion/es/components/Popover/Popover.js +1 -2
  86. package/emotion/es/components/Slider/Slider.js +11 -2
  87. package/emotion/es/components/Slider/Slider.template-doc.mdx +26 -0
  88. package/emotion/es/components/Slider/Slider.tokens.js +23 -17
  89. package/emotion/es/components/Slider/components/Double/Double.js +54 -19
  90. package/emotion/es/components/Slider/components/Single/Single.js +65 -34
  91. package/emotion/es/components/Slider/components/Single/Single.styles.js +17 -8
  92. package/emotion/es/components/Slider/components/SliderBase/SliderBase.js +31 -12
  93. package/emotion/es/components/Slider/components/SliderBase/SliderBase.styles.js +11 -11
  94. package/emotion/es/components/Slider/ui/Handler/Handler.js +51 -86
  95. package/emotion/es/components/Slider/ui/Handler/Handler.styles.js +10 -16
  96. package/emotion/es/components/Slider/ui/Handler/computeKeyPressData.js +115 -0
  97. package/emotion/es/components/Slider/ui/Thumb/Thumb.js +3 -2
  98. package/emotion/es/components/Slider/ui/Thumb/Thumb.styles.js +3 -3
  99. package/emotion/es/components/Slider/utils/index.js +28 -10
  100. package/emotion/es/components/Slider/variations/_view/base.js +2 -1
  101. package/emotion/es/examples/plasma_b2c/components/Slider/Slider.config.js +7 -7
  102. package/emotion/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
  103. package/emotion/es/examples/plasma_web/components/Slider/Slider.config.js +7 -7
  104. package/emotion/es/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
  105. package/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  106. package/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js.map +1 -1
  107. package/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  108. package/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js.map +1 -1
  109. package/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  110. package/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js.map +1 -1
  111. package/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  112. package/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js.map +1 -1
  113. package/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +2 -4
  114. package/es/components/Dropdown/ui/DropdownOld/DropdownOld.js.map +1 -1
  115. package/es/components/Popover/Popover.js +1 -2
  116. package/es/components/Popover/Popover.js.map +1 -1
  117. package/es/components/Slider/Slider.css +15 -13
  118. package/es/components/Slider/Slider.js +11 -2
  119. package/es/components/Slider/Slider.js.map +1 -1
  120. package/es/components/Slider/Slider.tokens.js +23 -17
  121. package/es/components/Slider/Slider.tokens.js.map +1 -1
  122. package/es/components/Slider/components/Double/Double.css +8 -8
  123. package/es/components/Slider/components/Double/Double.js +54 -19
  124. package/es/components/Slider/components/Double/Double.js.map +1 -1
  125. package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +98 -0
  126. package/es/components/Slider/components/Single/Single.css +14 -14
  127. package/es/components/Slider/components/Single/Single.js +65 -34
  128. package/es/components/Slider/components/Single/Single.js.map +1 -1
  129. package/es/components/Slider/components/Single/Single.styles.js +4 -4
  130. package/es/components/Slider/components/Single/Single.styles.js.map +1 -1
  131. package/es/components/Slider/components/Single/Single.styles_1h7n2s2.css +6 -0
  132. package/es/components/Slider/components/SliderBase/SliderBase.css +5 -5
  133. package/es/components/Slider/components/SliderBase/SliderBase.js +31 -12
  134. package/es/components/Slider/components/SliderBase/SliderBase.js.map +1 -1
  135. package/es/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
  136. package/es/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -1
  137. package/es/components/Slider/components/SliderBase/SliderBase.styles_1qt1224.css +5 -0
  138. package/es/components/Slider/ui/Handler/Handler.css +3 -3
  139. package/es/components/Slider/ui/Handler/Handler.js +48 -87
  140. package/es/components/Slider/ui/Handler/Handler.js.map +1 -1
  141. package/es/components/Slider/ui/Handler/Handler.styles.js +17 -7
  142. package/es/components/Slider/ui/Handler/Handler.styles.js.map +1 -1
  143. package/es/components/Slider/ui/Handler/Handler.styles_irtcgm.css +2 -0
  144. package/es/components/Slider/ui/Handler/computeKeyPressData.js +118 -0
  145. package/es/components/Slider/ui/Handler/computeKeyPressData.js.map +1 -0
  146. package/es/components/Slider/ui/Thumb/Thumb.css +1 -1
  147. package/es/components/Slider/ui/Thumb/Thumb.js +3 -2
  148. package/es/components/Slider/ui/Thumb/Thumb.js.map +1 -1
  149. package/es/components/Slider/ui/Thumb/Thumb.styles.js +1 -1
  150. package/es/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -1
  151. package/es/components/Slider/ui/Thumb/Thumb.styles_uyn20e.css +1 -0
  152. package/es/components/Slider/utils/index.js +28 -10
  153. package/es/components/Slider/utils/index.js.map +1 -1
  154. package/es/components/Slider/variations/_view/base.js +1 -1
  155. package/es/components/Slider/variations/_view/base.js.map +1 -1
  156. package/es/components/Slider/variations/_view/base_1s3f6q8.css +1 -0
  157. package/es/index.css +15 -13
  158. package/es/utils/index.js.map +1 -1
  159. package/package.json +2 -2
  160. package/styled-components/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  161. package/styled-components/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  162. package/styled-components/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  163. package/styled-components/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  164. package/styled-components/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -6
  165. package/styled-components/cjs/components/Popover/Popover.js +1 -2
  166. package/styled-components/cjs/components/Slider/Slider.js +10 -2
  167. package/styled-components/cjs/components/Slider/Slider.template-doc.mdx +26 -0
  168. package/styled-components/cjs/components/Slider/Slider.tokens.js +23 -17
  169. package/styled-components/cjs/components/Slider/components/Double/Double.js +54 -19
  170. package/styled-components/cjs/components/Slider/components/Single/Single.js +64 -33
  171. package/styled-components/cjs/components/Slider/components/Single/Single.styles.js +6 -6
  172. package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.js +31 -12
  173. package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +6 -6
  174. package/styled-components/cjs/components/Slider/ui/Handler/Handler.js +52 -88
  175. package/styled-components/cjs/components/Slider/ui/Handler/Handler.styles.js +7 -4
  176. package/styled-components/cjs/components/Slider/ui/Handler/computeKeyPressData.js +121 -0
  177. package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.js +3 -2
  178. package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.styles.js +2 -2
  179. package/styled-components/cjs/components/Slider/utils/index.js +28 -10
  180. package/styled-components/cjs/components/Slider/variations/_view/base.js +2 -1
  181. package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +3 -3
  182. package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
  183. package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.config.js +3 -3
  184. package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
  185. package/styled-components/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  186. package/styled-components/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  187. package/styled-components/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  188. package/styled-components/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  189. package/styled-components/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +2 -4
  190. package/styled-components/es/components/Popover/Popover.js +1 -2
  191. package/styled-components/es/components/Slider/Slider.js +11 -2
  192. package/styled-components/es/components/Slider/Slider.template-doc.mdx +26 -0
  193. package/styled-components/es/components/Slider/Slider.tokens.js +23 -17
  194. package/styled-components/es/components/Slider/components/Double/Double.js +54 -19
  195. package/styled-components/es/components/Slider/components/Single/Single.js +65 -34
  196. package/styled-components/es/components/Slider/components/Single/Single.styles.js +5 -5
  197. package/styled-components/es/components/Slider/components/SliderBase/SliderBase.js +31 -12
  198. package/styled-components/es/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
  199. package/styled-components/es/components/Slider/ui/Handler/Handler.js +51 -86
  200. package/styled-components/es/components/Slider/ui/Handler/Handler.styles.js +8 -5
  201. package/styled-components/es/components/Slider/ui/Handler/computeKeyPressData.js +115 -0
  202. package/styled-components/es/components/Slider/ui/Thumb/Thumb.js +3 -2
  203. package/styled-components/es/components/Slider/ui/Thumb/Thumb.styles.js +2 -2
  204. package/styled-components/es/components/Slider/utils/index.js +28 -10
  205. package/styled-components/es/components/Slider/variations/_view/base.js +2 -1
  206. package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.config.js +3 -3
  207. package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
  208. package/styled-components/es/examples/plasma_web/components/Slider/Slider.config.js +3 -3
  209. package/styled-components/es/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
  210. package/types/components/Dropdown/ui/DropdownDivider/DropdownDivider.d.ts.map +1 -1
  211. package/types/components/Dropdown/ui/DropdownFooter/DropdownFooter.d.ts.map +1 -1
  212. package/types/components/Dropdown/ui/DropdownGroup/DropdownGroup.d.ts.map +1 -1
  213. package/types/components/Dropdown/ui/DropdownHeader/DropdownHeader.d.ts.map +1 -1
  214. package/types/components/Dropdown/ui/DropdownOld/DropdownOld.d.ts.map +1 -1
  215. package/types/components/Popover/Popover.d.ts.map +1 -1
  216. package/types/components/Slider/Slider.d.ts.map +1 -1
  217. package/types/components/Slider/Slider.tokens.d.ts +22 -16
  218. package/types/components/Slider/Slider.tokens.d.ts.map +1 -1
  219. package/types/components/Slider/components/Double/Double.d.ts.map +1 -1
  220. package/types/components/Slider/components/Double/Double.types.d.ts +1 -0
  221. package/types/components/Slider/components/Double/Double.types.d.ts.map +1 -1
  222. package/types/components/Slider/components/Single/Single.d.ts.map +1 -1
  223. package/types/components/Slider/components/Single/Single.styles.d.ts +1 -1
  224. package/types/components/Slider/components/Single/Single.styles.d.ts.map +1 -1
  225. package/types/components/Slider/components/Single/Single.types.d.ts +79 -7
  226. package/types/components/Slider/components/Single/Single.types.d.ts.map +1 -1
  227. package/types/components/Slider/components/SliderBase/SliderBase.d.ts.map +1 -1
  228. package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts +1 -1
  229. package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts.map +1 -1
  230. package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts +6 -0
  231. package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts.map +1 -1
  232. package/types/components/Slider/ui/Handler/Handler.d.ts.map +1 -1
  233. package/types/components/Slider/ui/Handler/Handler.styles.d.ts +6 -2
  234. package/types/components/Slider/ui/Handler/Handler.styles.d.ts.map +1 -1
  235. package/types/components/Slider/ui/Handler/Handler.types.d.ts +5 -1
  236. package/types/components/Slider/ui/Handler/Handler.types.d.ts.map +1 -1
  237. package/types/components/Slider/ui/Handler/computeKeyPressData.d.ts +12 -0
  238. package/types/components/Slider/ui/Handler/computeKeyPressData.d.ts.map +1 -0
  239. package/types/components/Slider/ui/Thumb/Thumb.d.ts +1 -1
  240. package/types/components/Slider/ui/Thumb/Thumb.d.ts.map +1 -1
  241. package/types/components/Slider/ui/Thumb/Thumb.styles.d.ts.map +1 -1
  242. package/types/components/Slider/ui/Thumb/Thumb.types.d.ts +1 -0
  243. package/types/components/Slider/ui/Thumb/Thumb.types.d.ts.map +1 -1
  244. package/types/components/Slider/utils/index.d.ts +26 -8
  245. package/types/components/Slider/utils/index.d.ts.map +1 -1
  246. package/types/components/Slider/variations/_view/base.d.ts.map +1 -1
  247. package/types/examples/plasma_b2c/components/Slider/Slider.config.d.ts.map +1 -1
  248. package/types/examples/plasma_b2c/components/Slider/Slider.d.ts +80 -2
  249. package/types/examples/plasma_b2c/components/Slider/Slider.d.ts.map +1 -1
  250. package/types/examples/plasma_web/components/Slider/Slider.config.d.ts.map +1 -1
  251. package/types/examples/plasma_web/components/Slider/Slider.d.ts +80 -2
  252. package/types/examples/plasma_web/components/Slider/Slider.d.ts.map +1 -1
  253. package/types/utils/index.d.ts +1 -1
  254. package/types/utils/index.d.ts.map +1 -1
  255. package/cjs/components/Slider/components/Single/Single.styles_1r9f1e0.css +0 -6
  256. package/cjs/components/Slider/components/SliderBase/SliderBase.styles_9s4eb3.css +0 -5
  257. package/cjs/components/Slider/ui/Handler/Handler.styles_8crx5z.css +0 -2
  258. package/cjs/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +0 -1
  259. package/cjs/components/Slider/variations/_view/base_x642ct.css +0 -1
  260. package/es/components/Slider/components/Single/Single.styles_1r9f1e0.css +0 -6
  261. package/es/components/Slider/components/SliderBase/SliderBase.styles_9s4eb3.css +0 -5
  262. package/es/components/Slider/ui/Handler/Handler.styles_8crx5z.css +0 -2
  263. package/es/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +0 -1
  264. package/es/components/Slider/variations/_view/base_x642ct.css +0 -1
@@ -1,4 +1,4 @@
1
- import './Single.styles_1r9f1e0.css';
1
+ import './Single.styles_1h7n2s2.css';
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -10,8 +10,8 @@ var LabelWrapper = /*#__PURE__*/react.styled('div')({
10
10
  "class": "l1p4kc08",
11
11
  propsAsIs: false
12
12
  });
13
- var LabelContentLeft = /*#__PURE__*/react.styled('div')({
14
- name: "LabelContentLeft",
13
+ var LabelContent = /*#__PURE__*/react.styled('div')({
14
+ name: "LabelContent",
15
15
  "class": "ly2gexi",
16
16
  propsAsIs: false
17
17
  });
@@ -37,7 +37,7 @@ var SingleWrapper = /*#__PURE__*/react.styled('div')({
37
37
  });
38
38
 
39
39
  exports.Label = Label;
40
- exports.LabelContentLeft = LabelContentLeft;
40
+ exports.LabelContent = LabelContent;
41
41
  exports.LabelWrapper = LabelWrapper;
42
42
  exports.SingleWrapper = SingleWrapper;
43
43
  exports.SliderBaseWrapper = SliderBaseWrapper;
@@ -1 +1 @@
1
- {"version":3,"file":"Single.styles.js","sources":["../../../../../src/components/Slider/components/Single/Single.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { classes, tokens } from '../../Slider.tokens';\n\nexport const LabelWrapper = styled.div`\n color: var(${tokens.labelColor});\n\n display: flex;\n gap: var(${tokens.labelWrapperGap});\n`;\n\nexport const LabelContentLeft = styled.div``;\n\nexport const Label = styled.label`\n font-family: var(${tokens.labelFontFamily});\n font-size: var(${tokens.labelFontSize});\n font-style: var(${tokens.labelFontStyle});\n font-weight: var(${tokens.labelFontWeight});\n letter-spacing: var(${tokens.labelLetterSpacing});\n line-height: var(${tokens.labelLineHeight});\n`;\n\nexport const StyledRangeValue = styled.span`\n color: var(${tokens.rangeValueColor});\n font-family: var(${tokens.rangeValueFontFamily});\n font-size: var(${tokens.rangeValueFontSize});\n font-style: var(${tokens.rangeValueFontStyle});\n font-weight: var(${tokens.rangeValueFontWeight});\n letter-spacing: var(${tokens.rangeValueLetterSpacing});\n line-height: var(${tokens.rangeValueLineHeight});\n\n transition: opacity 0.1s ease-in-out;\n\n &.${classes.hideMinValue}, &.${classes.hideMaxValue} {\n opacity: 0;\n }\n\n &.${classes.activeRangeValue} {\n color: var(${tokens.labelColor});\n }\n`;\n\nexport const SliderBaseWrapper = styled.div`\n position: relative;\n display: flex;\n flex: 1;\n\n &.${classes.rangeValuesPlacementOuter} {\n ${StyledRangeValue} {\n position: absolute;\n bottom: var(${tokens.rangeValueBottomOffset});\n left: 0;\n\n &.${classes.maxRangeValue} {\n left: unset;\n right: 0;\n }\n }\n }\n\n &.${classes.rangeValuesPlacementInner} {\n align-items: center;\n\n ${StyledRangeValue} {\n margin-right: var(${tokens.rangeMinValueMargin});\n\n &.${classes.maxRangeValue} {\n margin-right: 0;\n margin-left: var(${tokens.rangeMaxValueMargin});\n }\n }\n }\n`;\n\nexport const SingleWrapper = styled.div`\n display: flex;\n opacity: var(${tokens.disabledOpacity});\n\n &.${classes.labelPlacementOuter} {\n flex-direction: column;\n\n ${LabelWrapper} {\n margin-bottom: var(${tokens.labelWrapperMarginBottom});\n }\n }\n\n &.${classes.labelPlacementInner} {\n ${LabelWrapper} {\n margin-right: var(${tokens.labelWrapperMarginRight});\n }\n }\n`;\n"],"names":["LabelWrapper","styled","name","class","propsAsIs","LabelContentLeft","Label","StyledRangeValue","SliderBaseWrapper","SingleWrapper"],"mappings":";;;;;;AAIO,IAAMA,YAAY,gBAAGC,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,cAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAKjC,EAAA;AAEM,IAAMC,gBAAgB,gBAAGJ,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,kBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAAM,EAAA;AAErC,IAAME,KAAK,gBAAGL,YAAM,CAAA,OAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,OAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAO1B,EAAA;AAEM,IAAMG,gBAAgB,gBAAGN,YAAM,CAAA,MAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,kBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAkBrC,EAAA;AAEM,IAAMI,iBAAiB,gBAAGP,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,mBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CA8BtC,EAAA;AAEM,IAAMK,aAAa,gBAAGR,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,eAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAiBlC;;;;;;;;;"}
1
+ {"version":3,"file":"Single.styles.js","sources":["../../../../../src/components/Slider/components/Single/Single.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { classes, tokens } from '../../Slider.tokens';\n\nexport const LabelWrapper = styled.div`\n color: var(${tokens.labelColor});\n\n display: flex;\n gap: var(${tokens.labelWrapperGap});\n`;\n\nexport const LabelContent = styled.div`\n display: inline-flex;\n`;\n\nexport const Label = styled.label`\n font-family: var(${tokens.labelFontFamily});\n font-size: var(${tokens.labelFontSize});\n font-style: var(${tokens.labelFontStyle});\n font-weight: var(${tokens.labelFontWeight});\n letter-spacing: var(${tokens.labelLetterSpacing});\n line-height: var(${tokens.labelLineHeight});\n`;\n\nexport const StyledRangeValue = styled.span`\n color: var(${tokens.rangeValueColor});\n font-family: var(${tokens.valueFontFamily});\n font-size: var(${tokens.valueFontSize});\n font-style: var(${tokens.valueFontStyle});\n font-weight: var(${tokens.valueFontWeight});\n letter-spacing: var(${tokens.valueLetterSpacing});\n line-height: var(${tokens.valueLineHeight});\n\n transition: opacity 0.1s ease-in-out;\n\n &.${classes.hideMinValue}, &.${classes.hideMaxValue} {\n opacity: 0;\n }\n\n &.${classes.activeRangeValue} {\n color: var(${tokens.labelColor});\n }\n`;\n\nexport const SliderBaseWrapper = styled.div`\n position: relative;\n display: flex;\n flex: 1;\n\n &.${classes.rangeValuesPlacementOuter} {\n ${StyledRangeValue} {\n position: absolute;\n bottom: calc(var(${tokens.railThickness}) * -1.5 - var(${tokens.rangeValueBottomOffset}));\n left: 0;\n\n &.${classes.maxRangeValue} {\n left: unset;\n right: 0;\n }\n }\n }\n\n &.${classes.rangeValuesPlacementInner} {\n align-items: center;\n\n ${StyledRangeValue} {\n margin-right: var(${tokens.rangeValueHorizontalMargin});\n\n &.${classes.maxRangeValue} {\n margin-right: 0;\n margin-left: var(${tokens.rangeValueHorizontalMargin});\n }\n }\n }\n`;\n\nexport const SingleWrapper = styled.div`\n display: flex;\n opacity: var(${tokens.disabledOpacity});\n\n &.${classes.labelPlacementOuter} {\n flex-direction: column;\n\n ${LabelWrapper} {\n margin-bottom: var(${tokens.labelWrapperMarginBottom});\n }\n }\n\n &.${classes.labelPlacementInner} {\n ${LabelWrapper} {\n margin-right: var(${tokens.labelWrapperMarginRight});\n }\n }\n\n &.${classes.verticalOrientation} {\n flex-direction: column;\n align-items: center;\n\n &.${classes.labelAlignCenter} {\n ${LabelWrapper} {\n flex-direction: column-reverse;\n }\n\n &.${classes.labelPlacementBottom} {\n ${LabelWrapper} {\n flex-direction: column;\n }\n\n &.${classes.labelContentReversed} {\n ${LabelWrapper} {\n flex-direction: column-reverse;\n }\n }\n }\n\n &.${classes.labelContentReversed} {\n ${LabelWrapper} {\n flex-direction: column;\n }\n }\n }\n\n ${LabelWrapper} {\n align-items: center;\n }\n\n ${SliderBaseWrapper} {\n width: var(${tokens.size});\n }\n\n &.${classes.labelPlacementInner} {\n ${LabelWrapper} {\n margin-right: 0;\n margin-bottom: var(${tokens.labelWrapperVerticalMargin});\n }\n }\n\n &.${classes.labelAlignLeft} {\n align-items: flex-end;\n\n ${LabelWrapper} {\n flex-direction: row-reverse;\n }\n }\n\n &.${classes.labelAlignRight} {\n align-items: flex-start;\n }\n\n &.${classes.labelPlacementBottom} {\n flex-direction: column-reverse;\n\n ${LabelWrapper} {\n margin-top: var(${tokens.labelWrapperVerticalMargin});\n margin-right: 0;\n margin-bottom: 0;\n }\n }\n }\n\n &.${classes.verticalOrientation} {\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n ${SliderBaseWrapper} {\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n\n &.${classes.labelAlignCenter} {\n ${StyledRangeValue} {\n position: static;\n bottom: 0;\n left: 0;\n margin-bottom: var(${tokens.rangeValueVerticalMargin});\n\n &.${classes.maxRangeValue} {\n left: 0;\n right: 0;\n bottom: 0;\n margin-top: var(${tokens.rangeValueVerticalMargin});\n margin-bottom: 0;\n }\n }\n }\n\n &.${classes.labelAlignLeft}, &.${classes.labelAlignRight} {\n ${StyledRangeValue} {\n margin-right: 0;\n margin-bottom: 0;\n position: absolute;\n top: 0;\n\n right: calc(\n var(${tokens.railThickness}) / 2 + var(${tokens.size}) / 2 +\n var(${tokens.rangeValueHorizontalOffset})\n );\n\n &.${classes.maxRangeValue} {\n margin-right: 0;\n margin-left: 0;\n top: auto;\n bottom: 0;\n }\n }\n }\n\n &.${classes.labelAlignRight} {\n ${StyledRangeValue} {\n left: calc(var(${tokens.size}) + var(${tokens.railThickness}));\n }\n }\n }\n`;\n"],"names":["LabelWrapper","styled","name","class","propsAsIs","LabelContent","Label","StyledRangeValue","SliderBaseWrapper","SingleWrapper"],"mappings":";;;;;;AAIO,IAAMA,YAAY,gBAAGC,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,cAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAKjC,EAAA;AAEM,IAAMC,YAAY,gBAAGJ,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,cAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAEjC,EAAA;AAEM,IAAME,KAAK,gBAAGL,YAAM,CAAA,OAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,OAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAO1B,EAAA;AAEM,IAAMG,gBAAgB,gBAAGN,YAAM,CAAA,MAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,kBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAkBrC,EAAA;AAEM,IAAMI,iBAAiB,gBAAGP,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,mBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CA8BtC,EAAA;AAEM,IAAMK,aAAa,gBAAGR,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,eAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CA2IlC;;;;;;;;;"}
@@ -0,0 +1,6 @@
1
+ .l1p4kc08{color:var(--plasma-slider-label-color);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--plasma-slider-label-wrapper-gap);}
2
+ .ly2gexi{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}
3
+ .lozb535{font-family:var(--plasma-slider-label-font-family);font-size:var(--plasma-slider-label-font-size);font-style:var(--plasma-slider-label-font-style);font-weight:var(--plasma-slider-label-font-weight);-webkit-letter-spacing:var(--plasma-slider-label-letter-spacing);-moz-letter-spacing:var(--plasma-slider-label-letter-spacing);-ms-letter-spacing:var(--plasma-slider-label-letter-spacing);letter-spacing:var(--plasma-slider-label-letter-spacing);line-height:var(--plasma-slider-label-line-height);}
4
+ .s1w9icbd{color:var(--plasma-slider-range-value-color);font-family:var(--plasma-slider-value-font-family);font-size:var(--plasma-slider-value-font-size);font-style:var(--plasma-slider-value-font-style);font-weight:var(--plasma-slider-value-font-weight);-webkit-letter-spacing:var(--plasma-slider-value-letter-spacing);-moz-letter-spacing:var(--plasma-slider-value-letter-spacing);-ms-letter-spacing:var(--plasma-slider-value-letter-spacing);letter-spacing:var(--plasma-slider-value-letter-spacing);line-height:var(--plasma-slider-value-line-height);-webkit-transition:opacity 0.1s ease-in-out;transition:opacity 0.1s ease-in-out;}.s1w9icbd.slider-hide-min-value,.s1w9icbd.slider-hide-max-value{opacity:0;}.s1w9icbd.slider-active-range-value{color:var(--plasma-slider-label-color);}
5
+ .s1d2sfgl{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1;-ms-flex:1;flex:1;}.s1d2sfgl.slider-range-values-placement-outer .s1w9icbd{position:absolute;bottom:calc(var(--plasma-slider-rail-thickness) * -1.5 - var(--plasma-slider-range-value-bottom-offset));left:0;}.s1d2sfgl.slider-range-values-placement-outer .s1w9icbd.slider-max-range-value{left:unset;right:0;}.s1d2sfgl.slider-range-values-placement-inner{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.s1d2sfgl.slider-range-values-placement-inner .s1w9icbd{margin-right:var(--plasma-slider-range-value-horizontal-margin);}.s1d2sfgl.slider-range-values-placement-inner .s1w9icbd.slider-max-range-value{margin-right:0;margin-left:var(--plasma-slider-range-value-horizontal-margin);}
6
+ .ss3ujqx{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;opacity:var(--plasma-slider-disabled-opacity);}.ss3ujqx.slider-label-placement-outer{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.ss3ujqx.slider-label-placement-outer .l1p4kc08{margin-bottom:var(--plasma-slider-label-wrapper-margin-bottom);}.ss3ujqx.slider-label-placement-inner .l1p4kc08{margin-right:var(--plasma-slider-label-wrapper-margin-right);}.ss3ujqx.slider-vertical-orientation{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.ss3ujqx.slider-vertical-orientation.slider-label-align-center .l1p4kc08{-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse;}.ss3ujqx.slider-vertical-orientation.slider-label-align-center.slider-label-placement-bottom .l1p4kc08{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.ss3ujqx.slider-vertical-orientation.slider-label-align-center.slider-label-placement-bottom.slider-label-content-reversed .l1p4kc08{-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse;}.ss3ujqx.slider-vertical-orientation.slider-label-align-center.slider-label-content-reversed .l1p4kc08{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.ss3ujqx.slider-vertical-orientation .l1p4kc08{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.ss3ujqx.slider-vertical-orientation .s1d2sfgl{width:var(--plasma-slider-size);}.ss3ujqx.slider-vertical-orientation.slider-label-placement-inner .l1p4kc08{margin-right:0;margin-bottom:var(--plasma-slider-label-wrapper-vertical-margin);}.ss3ujqx.slider-vertical-orientation.slider-label-align-left{-webkit-align-items:flex-end;-webkit-box-align:flex-end;-ms-flex-align:flex-end;align-items:flex-end;}.ss3ujqx.slider-vertical-orientation.slider-label-align-left .l1p4kc08{-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse;}.ss3ujqx.slider-vertical-orientation.slider-label-align-right{-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;}.ss3ujqx.slider-vertical-orientation.slider-label-placement-bottom{-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse;}.ss3ujqx.slider-vertical-orientation.slider-label-placement-bottom .l1p4kc08{margin-top:var(--plasma-slider-label-wrapper-vertical-margin);margin-right:0;margin-bottom:0;}.ss3ujqx.slider-vertical-orientation{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}.ss3ujqx.slider-vertical-orientation .s1d2sfgl{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}.ss3ujqx.slider-vertical-orientation.slider-label-align-center .s1w9icbd{position:static;bottom:0;left:0;margin-bottom:var(--plasma-slider-range-value-vertical-margin);}.ss3ujqx.slider-vertical-orientation.slider-label-align-center .s1w9icbd.slider-max-range-value{left:0;right:0;bottom:0;margin-top:var(--plasma-slider-range-value-vertical-margin);margin-bottom:0;}.ss3ujqx.slider-vertical-orientation.slider-label-align-left .s1w9icbd,.ss3ujqx.slider-vertical-orientation.slider-label-align-right .s1w9icbd{margin-right:0;margin-bottom:0;position:absolute;top:0;right:calc( var(--plasma-slider-rail-thickness) / 2 + var(--plasma-slider-size) / 2 + var(--plasma-slider-range-value-horizontal-offset) );}.ss3ujqx.slider-vertical-orientation.slider-label-align-left .s1w9icbd.slider-max-range-value,.ss3ujqx.slider-vertical-orientation.slider-label-align-right .s1w9icbd.slider-max-range-value{margin-right:0;margin-left:0;top:auto;bottom:0;}.ss3ujqx.slider-vertical-orientation.slider-label-align-right .s1w9icbd{left:calc(var(--plasma-slider-size) + var(--plasma-slider-rail-thickness));}
@@ -1,5 +1,5 @@
1
- .SliderBase_styles_9s4eb3_s33crq1__d6fac54b{-webkit-flex:1;-ms-flex:1;flex:1;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:var(--plasma-slider-height);}
2
- .SliderBase_styles_9s4eb3_rnaoqfb__d6fac54b{height:100%;}
3
- .SliderBase_styles_9s4eb3_r1bro5xo__d6fac54b{position:relative;top:50%;height:var(--plasma-slider-rail-height);border-radius:var(--plasma-slider-rail-border-radius);background-color:var(--plasma-slider-rail-background-color);overflow:hidden;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);}
4
- .SliderBase_styles_9s4eb3_fdg7yhg__d6fac54b{position:absolute;height:100%;top:0;left:0;background:var(--plasma-slider-fill-color);width:0;}
5
- .SliderBase_styles_9s4eb3_i17ya4q3__d6fac54b{visibility:hidden;width:0;height:0;opacity:0;margin:0;padding:0;border:none;}
1
+ .SliderBase_styles_1qt1224_r33crq1__8fd7c64a{position:relative;top:50%;height:var(--plasma-slider-rail-thickness);border-radius:var(--plasma-slider-rail-border-radius);background-color:var(--plasma-slider-rail-background-color);overflow:hidden;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);}
2
+ .SliderBase_styles_1qt1224_snaoqfb__8fd7c64a{-webkit-flex:1;-ms-flex:1;flex:1;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:var(--plasma-slider-size);}.SliderBase_styles_1qt1224_snaoqfb__8fd7c64a.SliderBase_styles_1qt1224_sliderVerticalOrientation__8fd7c64a{width:var(--plasma-slider-size);height:auto;}.SliderBase_styles_1qt1224_snaoqfb__8fd7c64a.SliderBase_styles_1qt1224_sliderVerticalOrientation__8fd7c64a .SliderBase_styles_1qt1224_r33crq1__8fd7c64a{top:0;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);width:var(--plasma-slider-rail-thickness);height:100%;}
3
+ .SliderBase_styles_1qt1224_r1bro5xo__8fd7c64a{height:100%;}
4
+ .SliderBase_styles_1qt1224_fdg7yhg__8fd7c64a{position:absolute;height:100%;top:0;left:0;background:var(--plasma-slider-fill-color);width:0;}
5
+ .SliderBase_styles_1qt1224_i17ya4q3__8fd7c64a{visibility:hidden;width:0;height:0;opacity:0;margin:0;padding:0;border:none;}
@@ -3,6 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
+ var Slider_tokens = require('../../Slider.tokens.js');
7
+ var index = require('../../../../utils/index.js');
6
8
  var SliderBase_styles = require('./SliderBase.styles.js');
7
9
  var useIsomorphicLayoutEffect = require('../../../../hooks/useIsomorphicLayoutEffect.js');
8
10
 
@@ -18,6 +20,9 @@ var SliderBase = function SliderBase(_ref) {
18
20
  labelPlacement = _ref.labelPlacement,
19
21
  rangeValuesPlacement = _ref.rangeValuesPlacement,
20
22
  onChange = _ref.onChange,
23
+ orientation = _ref.orientation,
24
+ size = _ref.size,
25
+ sliderAlign = _ref.sliderAlign,
21
26
  _ref$settings = _ref.settings,
22
27
  settings = _ref$settings === void 0 ? {} : _ref$settings;
23
28
  var _settings$indent = settings.indent,
@@ -26,34 +31,43 @@ var SliderBase = function SliderBase(_ref) {
26
31
  fontSizeMultiplier = _settings$fontSizeMul === void 0 ? 16 : _settings$fontSizeMul;
27
32
  var ref = React.useRef(null);
28
33
  var gap = indent * fontSizeMultiplier * 2;
34
+ var isVertical = orientation === 'vertical';
29
35
  React.useEffect(function () {
30
36
  var resizeHandler = function resizeHandler() {
31
37
  if (ref.current) {
32
- var railSize = ref.current.offsetWidth - gap;
38
+ var railSize = isVertical ? ref.current.offsetHeight - gap : ref.current.offsetWidth - gap;
33
39
  var totalSteps = max - min;
34
40
  setStepSize(railSize / totalSteps);
35
41
  }
36
42
  };
37
43
  resizeHandler();
38
- }, [labelPlacement, rangeValuesPlacement]);
44
+ }, [labelPlacement, rangeValuesPlacement, gap, isVertical,
45
+ // для перерасчета размеров
46
+ size, sliderAlign]);
39
47
  var onHandleChange = function onHandleChange(e) {
40
48
  if (!onChange || disabled) {
41
49
  return;
42
50
  }
43
51
  var _e$currentTarget$getB = e.currentTarget.getBoundingClientRect(),
44
52
  x = _e$currentTarget$getB.x,
45
- width = _e$currentTarget$getB.width;
46
- var lastX = e.clientX - x;
47
- var position = min + lastX / (width - gap) * (max - min);
53
+ width = _e$currentTarget$getB.width,
54
+ y = _e$currentTarget$getB.y,
55
+ height = _e$currentTarget$getB.height;
56
+ var lastPos = isVertical ? e.clientY - y : e.clientX - x;
57
+ var sliderWidth = isVertical ? height : width;
58
+ var position = min + lastPos / (sliderWidth - gap) * (max - min);
48
59
  var result = Math.max(min, Math.min(max, position));
49
- onChange(result, {
50
- lastX: lastX
51
- });
60
+ var data = isVertical ? {
61
+ lastY: lastPos
62
+ } : {
63
+ lastX: lastPos
64
+ };
65
+ onChange(result, data);
52
66
  };
53
67
  useIsomorphicLayoutEffect.useIsomorphicLayoutEffect(function () {
54
68
  var resizeHandler = function resizeHandler() {
55
69
  if (ref.current) {
56
- var railSize = ref.current.offsetWidth - gap;
70
+ var railSize = isVertical ? ref.current.offsetHeight - gap : ref.current.offsetWidth - gap;
57
71
  var totalSteps = max - min;
58
72
  setStepSize(railSize / totalSteps);
59
73
  }
@@ -63,13 +77,18 @@ var SliderBase = function SliderBase(_ref) {
63
77
  return function () {
64
78
  return window.removeEventListener('resize', resizeHandler);
65
79
  };
66
- }, [min, max, setStepSize, gap, labelPlacement, rangeValuesPlacement]);
67
- var fillStyle = {
80
+ }, [min, max, setStepSize, gap, labelPlacement, rangeValuesPlacement, isVertical]);
81
+ var fillStyle = isVertical ? {
82
+ top: "".concat(railFillXPosition, "px"),
83
+ height: "".concat(railFillWidth, "px"),
84
+ width: '100%'
85
+ } : {
68
86
  left: "".concat(railFillXPosition, "px"),
69
87
  width: "".concat(railFillWidth, "px")
70
88
  };
71
89
  return /*#__PURE__*/React.createElement(SliderBase_styles.Slider, {
72
- ref: ref
90
+ ref: ref,
91
+ className: index.cx(orientation === 'vertical' && Slider_tokens.classes.verticalOrientation)
73
92
  }, /*#__PURE__*/React.createElement(SliderBase_styles.RailWrap, {
74
93
  "aria-hidden": "true",
75
94
  onMouseDown: onHandleChange
@@ -1 +1 @@
1
- {"version":3,"file":"SliderBase.js","sources":["../../../../../src/components/Slider/components/SliderBase/SliderBase.tsx"],"sourcesContent":["import React, { PropsWithChildren, useRef, MouseEventHandler, useEffect } from 'react';\nimport { DraggableData } from 'react-draggable';\n\nimport { useIsomorphicLayoutEffect } from '../../../../hooks';\n\nimport type { SliderViewProps } from './SliderBase.types';\nimport { Fill, Rail, RailWrap, Slider } from './SliderBase.styles';\n\nexport const SliderBase: React.FC<PropsWithChildren<SliderViewProps>> = ({\n max,\n min,\n setStepSize,\n railFillWidth,\n children,\n railFillXPosition = 0,\n disabled,\n labelPlacement,\n rangeValuesPlacement,\n onChange,\n settings = {},\n}) => {\n const { indent = 0.75, fontSizeMultiplier = 16 } = settings;\n\n const ref = useRef<HTMLDivElement | null>(null);\n const gap = indent * fontSizeMultiplier * 2;\n\n useEffect(() => {\n const resizeHandler = () => {\n if (ref.current) {\n const railSize = ref.current.offsetWidth - gap;\n const totalSteps = max - min;\n\n setStepSize(railSize / totalSteps);\n }\n };\n\n resizeHandler();\n }, [labelPlacement, rangeValuesPlacement]);\n\n const onHandleChange: MouseEventHandler<HTMLDivElement> = (e) => {\n if (!onChange || disabled) {\n return;\n }\n\n const { x, width } = e.currentTarget.getBoundingClientRect();\n\n const lastX = e.clientX - x;\n\n const position = min + (lastX / (width - gap)) * (max - min);\n const result = Math.max(min, Math.min(max, position));\n\n onChange(result, { lastX } as DraggableData);\n };\n\n useIsomorphicLayoutEffect(() => {\n const resizeHandler = () => {\n if (ref.current) {\n const railSize = ref.current.offsetWidth - gap;\n const totalSteps = max - min;\n\n setStepSize(railSize / totalSteps);\n }\n };\n\n resizeHandler();\n window.addEventListener('resize', resizeHandler);\n\n return () => window.removeEventListener('resize', resizeHandler);\n }, [min, max, setStepSize, gap, labelPlacement, rangeValuesPlacement]);\n\n const fillStyle = { left: `${railFillXPosition}px`, width: `${railFillWidth}px` };\n\n return (\n <Slider ref={ref}>\n <RailWrap aria-hidden=\"true\" onMouseDown={onHandleChange}>\n <Rail>\n <Fill style={fillStyle} />\n </Rail>\n </RailWrap>\n\n {children}\n </Slider>\n );\n};\n"],"names":["SliderBase","_ref","max","min","setStepSize","railFillWidth","children","_ref$railFillXPositio","railFillXPosition","disabled","labelPlacement","rangeValuesPlacement","onChange","_ref$settings","settings","_settings$indent","indent","_settings$fontSizeMul","fontSizeMultiplier","ref","useRef","gap","useEffect","resizeHandler","current","railSize","offsetWidth","totalSteps","onHandleChange","e","_e$currentTarget$getB","currentTarget","getBoundingClientRect","x","width","lastX","clientX","position","result","Math","useIsomorphicLayoutEffect","window","addEventListener","removeEventListener","fillStyle","left","concat","React","createElement","Slider","RailWrap","onMouseDown","Rail","Fill","style"],"mappings":";;;;;;;;IAQaA,UAAwD,GAAG,SAA3DA,UAAwDA,CAAAC,IAAA,EAY/D;AAAA,EAAA,IAXFC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IAAAC,qBAAA,GAAAN,IAAA,CACRO,iBAAiB;AAAjBA,IAAAA,iBAAiB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,CAAC,GAAAA,qBAAA;IACrBE,QAAQ,GAAAR,IAAA,CAARQ,QAAQ;IACRC,cAAc,GAAAT,IAAA,CAAdS,cAAc;IACdC,oBAAoB,GAAAV,IAAA,CAApBU,oBAAoB;IACpBC,QAAQ,GAAAX,IAAA,CAARW,QAAQ;IAAAC,aAAA,GAAAZ,IAAA,CACRa,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAA,KAAA,CAAA,GAAG,EAAE,GAAAA,aAAA,CAAA;AAEb,EAAA,IAAAE,gBAAA,GAAmDD,QAAQ,CAAnDE,MAAM;AAANA,IAAAA,MAAM,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,gBAAA;IAAAE,qBAAA,GAA8BH,QAAQ,CAApCI,kBAAkB;AAAlBA,IAAAA,kBAAkB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,qBAAA,CAAA;AAE9C,EAAA,IAAME,GAAG,GAAGC,YAAM,CAAwB,IAAI,CAAC,CAAA;AAC/C,EAAA,IAAMC,GAAG,GAAGL,MAAM,GAAGE,kBAAkB,GAAG,CAAC,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CACA,CAAC,EAEVtC,QACG,CAAC,CAAA;AAEjB;;;;"}
1
+ {"version":3,"file":"SliderBase.js","sources":["../../../../../src/components/Slider/components/SliderBase/SliderBase.tsx"],"sourcesContent":["import React, { PropsWithChildren, useRef, MouseEventHandler, useEffect } from 'react';\nimport { DraggableData } from 'react-draggable';\n\nimport { useIsomorphicLayoutEffect } from '../../../../hooks';\nimport { classes } from '../../Slider.tokens';\nimport { cx } from '../../../../utils';\n\nimport type { SliderViewProps } from './SliderBase.types';\nimport { Fill, Rail, RailWrap, Slider } from './SliderBase.styles';\n\nexport const SliderBase: React.FC<PropsWithChildren<SliderViewProps>> = ({\n max,\n min,\n setStepSize,\n railFillWidth,\n children,\n railFillXPosition = 0,\n disabled,\n labelPlacement,\n rangeValuesPlacement,\n onChange,\n orientation,\n size,\n sliderAlign,\n settings = {},\n}) => {\n const { indent = 0.75, fontSizeMultiplier = 16 } = settings;\n\n const ref = useRef<HTMLDivElement | null>(null);\n const gap = indent * fontSizeMultiplier * 2;\n const isVertical = orientation === 'vertical';\n\n useEffect(() => {\n const resizeHandler = () => {\n if (ref.current) {\n const railSize = isVertical ? ref.current.offsetHeight - gap : ref.current.offsetWidth - gap;\n const totalSteps = max - min;\n\n setStepSize(railSize / totalSteps);\n }\n };\n\n resizeHandler();\n }, [\n labelPlacement,\n rangeValuesPlacement,\n gap,\n isVertical,\n // для перерасчета размеров\n size,\n sliderAlign,\n ]);\n\n const onHandleChange: MouseEventHandler<HTMLDivElement> = (e) => {\n if (!onChange || disabled) {\n return;\n }\n\n const { x, width, y, height } = e.currentTarget.getBoundingClientRect();\n\n const lastPos = isVertical ? e.clientY - y : e.clientX - x;\n const sliderWidth = isVertical ? height : width;\n\n const position = min + (lastPos / (sliderWidth - gap)) * (max - min);\n const result = Math.max(min, Math.min(max, position));\n\n const data = isVertical ? { lastY: lastPos } : { lastX: lastPos };\n onChange(result, (data as unknown) as DraggableData);\n };\n\n useIsomorphicLayoutEffect(() => {\n const resizeHandler = () => {\n if (ref.current) {\n const railSize = isVertical ? ref.current.offsetHeight - gap : ref.current.offsetWidth - gap;\n const totalSteps = max - min;\n\n setStepSize(railSize / totalSteps);\n }\n };\n\n resizeHandler();\n window.addEventListener('resize', resizeHandler);\n\n return () => window.removeEventListener('resize', resizeHandler);\n }, [min, max, setStepSize, gap, labelPlacement, rangeValuesPlacement, isVertical]);\n\n const fillStyle = isVertical\n ? { top: `${railFillXPosition}px`, height: `${railFillWidth}px`, width: '100%' }\n : { left: `${railFillXPosition}px`, width: `${railFillWidth}px` };\n\n return (\n <Slider ref={ref} className={cx(orientation === 'vertical' && classes.verticalOrientation)}>\n <RailWrap aria-hidden=\"true\" onMouseDown={onHandleChange}>\n <Rail>\n <Fill style={fillStyle} />\n </Rail>\n </RailWrap>\n\n {children}\n </Slider>\n );\n};\n"],"names":["SliderBase","_ref","max","min","setStepSize","railFillWidth","children","_ref$railFillXPositio","railFillXPosition","disabled","labelPlacement","rangeValuesPlacement","onChange","orientation","size","sliderAlign","_ref$settings","settings","_settings$indent","indent","_settings$fontSizeMul","fontSizeMultiplier","ref","useRef","gap","isVertical","useEffect","resizeHandler","current","railSize","offsetHeight","offsetWidth","totalSteps","onHandleChange","e","_e$currentTarget$getB","currentTarget","getBoundingClientRect","x","width","y","height","lastPos","clientY","clientX","sliderWidth","position","result","Math","data","lastY","lastX","useIsomorphicLayoutEffect","window","addEventListener","removeEventListener","fillStyle","top","concat","left","React","createElement","Slider","className","cx","classes","verticalOrientation","RailWrap","onMouseDown","Rail","Fill","style"],"mappings":";;;;;;;;;;IAUaA,UAAwD,GAAG,SAA3DA,UAAwDA,CAAAC,IAAA,EAe/D;AAAA,EAAA,IAdFC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,QAAQ,GAAAL,IAAA,CAARK,QAAQ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AAAA,CAAAA,MAAA,CAAKlD,iBAAiB,EAAI,IAAA,CAAA;IAAE+B,KAAK,EAAA,EAAA,CAAAmB,MAAA,CAAKrD,aAAa,EAAA,IAAA,CAAA;GAAM,CAAA;AAErE,EAAA,oBACIuD,KAAA,CAAAC,aAAA,CAACC,wBAAM,EAAA;AAACxC,IAAAA,GAAG,EAAEA,GAAI;IAACyC,SAAS,EAAEC,QAAE,CAACnD,WAAW,KAAK,UAAU,IAAIoD,qBAAO,CAACC,mBAAmB,CAAA;AAAE,GAAA,eACvFN,KAAA,CAAAC,aAAA,CAACM,0BAAQ,EAAA;AAAC,IAAA,aAAA,EAAY,MAAM;AAACC,IAAAA,WAAW,EAAEnC,cAAAA;GACtC2B,eAAAA,KAAA,CAAAC,aAAA,CAACQ,sBAAI,qBACDT,KAAA,CAAAC,aAAA,CAACS,sBAAI,EAAA;AAACC,IAAAA,KAAK,EAAEf,SAAAA;AAAU,GAAE,CACvB,CACA,CAAC,EAEVlD,QACG,CAAC,CAAA;AAEjB;;;;"}
@@ -1,22 +1,22 @@
1
- import './SliderBase.styles_9s4eb3.css';
1
+ import './SliderBase.styles_1qt1224.css';
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var react = require('@linaria/react');
7
7
 
8
+ var Rail = /*#__PURE__*/react.styled('div')({
9
+ name: "Rail",
10
+ "class": "r33crq1",
11
+ propsAsIs: false
12
+ });
8
13
  var Slider = /*#__PURE__*/react.styled('div')({
9
14
  name: "Slider",
10
- "class": "s33crq1",
15
+ "class": "snaoqfb",
11
16
  propsAsIs: false
12
17
  });
13
18
  var RailWrap = /*#__PURE__*/react.styled('div')({
14
19
  name: "RailWrap",
15
- "class": "rnaoqfb",
16
- propsAsIs: false
17
- });
18
- var Rail = /*#__PURE__*/react.styled('div')({
19
- name: "Rail",
20
20
  "class": "r1bro5xo",
21
21
  propsAsIs: false
22
22
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SliderBase.styles.js","sources":["../../../../../src/components/Slider/components/SliderBase/SliderBase.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { applyHidden } from '../../../../mixins';\nimport { tokens } from '../../Slider.tokens';\n\nexport const Slider = styled.div`\n flex: 1;\n position: relative;\n user-select: none;\n height: var(${tokens.height});\n`;\n\nexport const RailWrap = styled.div`\n height: 100%;\n`;\n\nexport const Rail = styled.div`\n position: relative;\n top: 50%;\n\n height: var(${tokens.railHeight});\n\n border-radius: var(${tokens.railBorderRadius});\n background-color: var(${tokens.railBackgroundColor});\n\n overflow: hidden;\n transform: translateY(-50%);\n`;\n\nexport const Fill = styled.div`\n position: absolute;\n height: 100%;\n top: 0;\n left: 0;\n background: var(${tokens.fillColor});\n width: 0;\n`;\n\nexport const InputHidden = styled.input`\n ${applyHidden()};\n`;\n"],"names":["Slider","styled","name","class","propsAsIs","RailWrap","Rail","Fill","InputHidden"],"mappings":";;;;;;AAKO,IAAMA,MAAM,gBAAGC,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,QAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAK3B,EAAA;AAEM,IAAMC,QAAQ,gBAAGJ,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,UAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAE7B,EAAA;AAEM,IAAME,IAAI,gBAAGL,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,MAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAWzB,EAAA;AAEM,IAAMG,IAAI,gBAAGN,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,MAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAOzB,EAAA;AAEM,IAAMI,WAAW,gBAAGP,YAAM,CAAA,OAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,aAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAEhC;;;;;;;;"}
1
+ {"version":3,"file":"SliderBase.styles.js","sources":["../../../../../src/components/Slider/components/SliderBase/SliderBase.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { applyHidden } from '../../../../mixins';\nimport { classes, tokens } from '../../Slider.tokens';\n\nexport const Rail = styled.div`\n position: relative;\n top: 50%;\n\n height: var(${tokens.railThickness});\n\n border-radius: var(${tokens.railBorderRadius});\n background-color: var(${tokens.railBackgroundColor});\n\n overflow: hidden;\n transform: translateY(-50%);\n`;\n\nexport const Slider = styled.div`\n flex: 1;\n position: relative;\n user-select: none;\n height: var(${tokens.size});\n\n &.${classes.verticalOrientation} {\n width: var(${tokens.size});\n height: auto;\n\n ${Rail} {\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n width: var(${tokens.railThickness});\n height: 100%;\n }\n }\n`;\n\nexport const RailWrap = styled.div`\n height: 100%;\n`;\n\nexport const Fill = styled.div`\n position: absolute;\n height: 100%;\n top: 0;\n left: 0;\n background: var(${tokens.fillColor});\n width: 0;\n`;\n\nexport const InputHidden = styled.input`\n ${applyHidden()};\n`;\n"],"names":["Rail","styled","name","class","propsAsIs","Slider","RailWrap","Fill","InputHidden"],"mappings":";;;;;;AAKO,IAAMA,IAAI,gBAAGC,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,MAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAWzB,EAAA;AAEM,IAAMC,MAAM,gBAAGJ,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,QAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAkB3B,EAAA;AAEM,IAAME,QAAQ,gBAAGL,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,UAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAE7B,EAAA;AAEM,IAAMG,IAAI,gBAAGN,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,MAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAOzB,EAAA;AAEM,IAAMI,WAAW,gBAAGP,YAAM,CAAA,OAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,aAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAEhC;;;;;;;;"}
@@ -0,0 +1,5 @@
1
+ .r33crq1{position:relative;top:50%;height:var(--plasma-slider-rail-thickness);border-radius:var(--plasma-slider-rail-border-radius);background-color:var(--plasma-slider-rail-background-color);overflow:hidden;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);}
2
+ .snaoqfb{-webkit-flex:1;-ms-flex:1;flex:1;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:var(--plasma-slider-size);}.snaoqfb.slider-vertical-orientation{width:var(--plasma-slider-size);height:auto;}.snaoqfb.slider-vertical-orientation .r33crq1{top:0;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);width:var(--plasma-slider-rail-thickness);height:100%;}
3
+ .r1bro5xo{height:100%;}
4
+ .fdg7yhg{position:absolute;height:100%;top:0;left:0;background:var(--plasma-slider-fill-color);width:0;}
5
+ .i17ya4q3{visibility:hidden;width:0;height:0;opacity:0;margin:0;padding:0;border:none;}
@@ -1,4 +1,4 @@
1
- .Thumb_styles_4w4gzn_tqbdf8b__14129a5b{width:var(--plasma-slider-thumb-size);height:var(--plasma-slider-thumb-size);position:relative;left:-0.125rem;top:-0.125rem;border-radius:50%;box-sizing:border-box;background:var(--plasma-slider-thumb-background-color);margin:0.125rem;-webkit-transition:border-color 0.1s ease-in-out;transition:border-color 0.1s ease-in-out;position:relative;}.Thumb_styles_4w4gzn_tqbdf8b__14129a5b:after{background:var(--plasma-slider-thumb-border-color);margin:-0.125rem;content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;}.Thumb_styles_4w4gzn_tqbdf8b__14129a5b:not([disabled]):hover:after,.Thumb_styles_4w4gzn_tqbdf8b__14129a5b:not([disabled]):active:after{background:var(--plasma-slider-thumb-focus-border-color);}.Thumb_styles_4w4gzn_tqbdf8b__14129a5b[disabled]{cursor:not-allowed;}.Thumb_styles_4w4gzn_tqbdf8b__14129a5b:focus{outline:none;}.Thumb_styles_4w4gzn_tqbdf8b__14129a5b::before{content:'';position:absolute;top:0.125rem;left:0.125rem;right:0.125rem;bottom:0.125rem;z-index:1;display:block;box-sizing:content-box;border:0.125rem solid transparent;border-radius:50%;-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.Thumb_styles_4w4gzn_tqbdf8b__14129a5b.Thumb_styles_4w4gzn_focusVisible__14129a5b:focus::before,.Thumb_styles_4w4gzn_tqbdf8b__14129a5b[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.125rem var(--plasma-slider-thumb-focus-border-color);}
1
+ .Thumb_styles_uyn20e_tqbdf8b__de0962c7{width:var(--thumb-size);height:var(--thumb-size);min-width:var(--thumb-size);min-height:var(--thumb-size);position:relative;border-radius:50%;box-sizing:border-box;background:var(--plasma-slider-thumb-background-color);margin:0.0625rem;-webkit-transition:border-color 0.1s ease-in-out;transition:border-color 0.1s ease-in-out;position:relative;}.Thumb_styles_uyn20e_tqbdf8b__de0962c7:after{background:var(--plasma-slider-thumb-border-color);margin:-0.0625rem;content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;}.Thumb_styles_uyn20e_tqbdf8b__de0962c7:not([disabled]):hover:after,.Thumb_styles_uyn20e_tqbdf8b__de0962c7:not([disabled]):active:after{background:var(--plasma-slider-thumb-focus-border-color);}.Thumb_styles_uyn20e_tqbdf8b__de0962c7[disabled]{cursor:not-allowed;}.Thumb_styles_uyn20e_tqbdf8b__de0962c7:focus{outline:none;}.Thumb_styles_uyn20e_tqbdf8b__de0962c7::before{content:'';position:absolute;top:0.0625rem;left:0.0625rem;right:0.0625rem;bottom:0.0625rem;z-index:1;display:block;box-sizing:content-box;border:0.125rem solid transparent;border-radius:50%;-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.Thumb_styles_uyn20e_tqbdf8b__de0962c7.Thumb_styles_uyn20e_focusVisible__de0962c7:focus::before,.Thumb_styles_uyn20e_tqbdf8b__de0962c7[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.125rem var(--plasma-slider-thumb-focus-border-color);}
2
2
 
3
- .Handler_styles_8crx5z_h1tnrnip__2d4342c7{cursor:pointer;position:absolute;z-index:1;top:0;left:0;}
4
- .Handler_styles_8crx5z_s12uu2lj__2d4342c7{position:absolute;z-index:1;top:var(--plasma-slider-current-value-top-offset);text-align:center;width:100%;margin-left:-0.125rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;font-family:var(--plasma-slider-current-value-font-family);font-size:var(--plasma-slider-current-value-font-size);font-style:var(--plasma-slider-current-value-font-style);font-weight:var(--plasma-slider-current-value-font-weight);-webkit-letter-spacing:var(--plasma-slider-current-value-letter-spacing);-moz-letter-spacing:var(--plasma-slider-current-value-letter-spacing);-ms-letter-spacing:var(--plasma-slider-current-value-letter-spacing);letter-spacing:var(--plasma-slider-current-value-letter-spacing);line-height:var(--plasma-slider-current-value-line-height);}
3
+ .Handler_styles_irtcgm_s1tnrnip__e8f853c5{position:absolute;z-index:1;top:var(--plasma-slider-current-value-top-offset);text-align:center;width:100%;margin-left:-0.125rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;font-family:var(--plasma-slider-value-font-family);font-size:var(--plasma-slider-value-font-size);font-style:var(--plasma-slider-value-font-style);font-weight:var(--plasma-slider-value-font-weight);-webkit-letter-spacing:var(--plasma-slider-value-letter-spacing);-moz-letter-spacing:var(--plasma-slider-value-letter-spacing);-ms-letter-spacing:var(--plasma-slider-value-letter-spacing);letter-spacing:var(--plasma-slider-value-letter-spacing);line-height:var(--plasma-slider-value-line-height);}
4
+ .Handler_styles_irtcgm_h12uu2lj__e8f853c5{cursor:pointer;position:absolute;z-index:1;top:0;left:0;bottom:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;--thumb-size:var(--h12uu2lj-0);}.Handler_styles_irtcgm_h12uu2lj__e8f853c5.Handler_styles_irtcgm_sliderVerticalOrientation__e8f853c5{right:0;bottom:auto;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}.Handler_styles_irtcgm_h12uu2lj__e8f853c5.Handler_styles_irtcgm_sliderVerticalOrientation__e8f853c5 .Handler_styles_irtcgm_s1tnrnip__e8f853c5{margin:0;top:0;bottom:0;right:0;left:calc(var(--plasma-slider-size) - (var(--plasma-slider-size) - var(--thumb-size)) / 2 + 0.25rem);-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;}.Handler_styles_irtcgm_h12uu2lj__e8f853c5.Handler_styles_irtcgm_sliderValuePlacementLeft__e8f853c5 .Handler_styles_irtcgm_s1tnrnip__e8f853c5{left:auto;right:calc(var(--plasma-slider-size) - (var(--plasma-slider-size) - var(--thumb-size)) / 2 + 0.3125rem);-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;}
@@ -5,30 +5,25 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
6
6
  var React = require('react');
7
7
  var Draggable = require('react-draggable');
8
- var index = require('../../utils/index.js');
8
+ var index = require('../../../../utils/index.js');
9
+ var index$1 = require('../../utils/index.js');
9
10
  var Thumb = require('../Thumb/Thumb.js');
11
+ var Slider_tokens = require('../../Slider.tokens.js');
10
12
  var Handler_styles = require('./Handler.styles.js');
13
+ var computeKeyPressData = require('./computeKeyPressData.js');
11
14
 
12
- var _excluded = ["stepSize", "onChangeCommitted", "onChange", "xPosition", "min", "max", "bounds", "zIndex", "disabled", "side", "showCurrentValue", "startOffset", "endOffset", "value"];
15
+ var _excluded = ["size", "orientation", "stepSize", "onChangeCommitted", "onChange", "position", "min", "max", "bounds", "zIndex", "disabled", "side", "showCurrentValue", "startOffset", "endOffset", "value", "valuePlacement"];
13
16
 
14
17
  // TODO: PLASMA-1707
15
18
 
16
- var KeyboardSupport = {
17
- PageUp: 33,
18
- PageDown: 34,
19
- End: 35,
20
- Home: 36,
21
- ArrowLeft: 37,
22
- ArrowUp: 38,
23
- ArrowRight: 39,
24
- ArrowDown: 40
25
- };
26
19
  var Handler = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
27
- var stepSize = _ref.stepSize,
20
+ var size = _ref.size,
21
+ orientation = _ref.orientation,
22
+ stepSize = _ref.stepSize,
28
23
  onChangeCommitted = _ref.onChangeCommitted,
29
24
  onChange = _ref.onChange,
30
- _ref$xPosition = _ref.xPosition,
31
- xPosition = _ref$xPosition === void 0 ? 0 : _ref$xPosition,
25
+ _ref$position = _ref.position,
26
+ position = _ref$position === void 0 ? 0 : _ref$position,
32
27
  min = _ref.min,
33
28
  max = _ref.max,
34
29
  _ref$bounds = _ref.bounds,
@@ -43,123 +38,89 @@ var Handler = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
43
38
  _ref$endOffset = _ref.endOffset,
44
39
  endOffset = _ref$endOffset === void 0 ? 0 : _ref$endOffset,
45
40
  value = _ref.value,
41
+ valuePlacement = _ref.valuePlacement,
46
42
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
43
+ var isVertical = orientation === 'vertical';
47
44
  var lastOnChangeValue = React.useRef();
48
- var _getOffsets = index.getOffsets(ref, side),
45
+ var _getOffsets = index$1.getOffsets(ref, side, isVertical),
49
46
  _getOffsets2 = _rollupPluginBabelHelpers.slicedToArray(_getOffsets, 2),
50
- offsetLeft = _getOffsets2[0],
51
- offsetRight = _getOffsets2[1];
47
+ startClientOffset = _getOffsets2[0],
48
+ endClientOffset = _getOffsets2[1];
52
49
  var _bounds = _rollupPluginBabelHelpers.slicedToArray(bounds, 2),
53
- leftValueBound = _bounds[0],
54
- rightValueBound = _bounds[1];
55
- var leftPositionBound = leftValueBound ? (leftValueBound - min) * stepSize : null;
56
- var rightPositionBound = rightValueBound ? (rightValueBound - min) * stepSize : null;
57
- var position = typeof xPosition === 'number' ? {
58
- x: xPosition,
59
- y: 0
50
+ startValueBound = _bounds[0],
51
+ endValueBound = _bounds[1];
52
+ var startPositionBound = startValueBound ? (startValueBound - min) * stepSize : null;
53
+ var endPositionBound = endValueBound ? (endValueBound - min) * stepSize : null;
54
+ var dragPosition = typeof position === 'number' ? {
55
+ x: isVertical ? 0 : position,
56
+ y: isVertical ? position : 0
60
57
  } : undefined;
61
58
  var tabIndex = disabled ? -1 : 0;
62
- var computedBounds = {
63
- left: (leftPositionBound !== null && leftPositionBound !== void 0 ? leftPositionBound : 0) - (offsetLeft ? stepSize : 0),
64
- right: (rightPositionBound !== null && rightPositionBound !== void 0 ? rightPositionBound : stepSize * (max - min)) - (offsetRight ? stepSize : 0)
65
- };
66
- var showCurrentValueCondition = showCurrentValue && (xPosition >= startOffset && xPosition <= max * stepSize - endOffset || xPosition === 0 && value !== 0);
59
+ var computedBounds = _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, isVertical ? 'top' : 'left', (startPositionBound !== null && startPositionBound !== void 0 ? startPositionBound : 0) - (startClientOffset ? stepSize : 0)), isVertical ? 'bottom' : 'right', (endPositionBound !== null && endPositionBound !== void 0 ? endPositionBound : stepSize * (max - min)) - (endClientOffset ? stepSize : 0));
60
+ var showCurrentValueCondition = showCurrentValue && (position >= startOffset && position <= max * stepSize - endOffset || position === 0 && value !== 0);
67
61
  var onDrag = function onDrag(_, data) {
68
- var newValue = index.getSliderThumbValue(data.x, stepSize, min, max);
62
+ var newValue = index$1.getSliderThumbValue(isVertical ? data.y : data.x, stepSize, min, max);
69
63
  if (lastOnChangeValue.current !== newValue) {
70
64
  onChange === null || onChange === void 0 || onChange(newValue, data);
71
65
  lastOnChangeValue.current = newValue;
72
66
  }
73
67
  };
74
68
  var onStop = function onStop(_, data) {
75
- var newValue = index.getSliderThumbValue(data.x, stepSize, min, max);
69
+ var newValue = index$1.getSliderThumbValue(isVertical ? data.y : data.x, stepSize, min, max);
76
70
  onChangeCommitted && onChangeCommitted(newValue, data);
77
71
  };
78
72
  var onKeyPress = function onKeyPress(event) {
79
73
  event.persist();
80
- var keyCode = event.keyCode,
81
- target = event.target;
82
- if (!Object.values(KeyboardSupport).includes(keyCode)) {
83
- return;
84
- }
85
- var ArrowUp = KeyboardSupport.ArrowUp,
86
- ArrowRight = KeyboardSupport.ArrowRight,
87
- ArrowDown = KeyboardSupport.ArrowDown,
88
- ArrowLeft = KeyboardSupport.ArrowLeft,
89
- Home = KeyboardSupport.Home,
90
- End = KeyboardSupport.End,
91
- PageDown = KeyboardSupport.PageDown,
92
- PageUp = KeyboardSupport.PageUp;
93
74
  var computedMultipleSteps = stepSize * (rest.multipleStepSize / 100 * max);
94
- var data = {
95
- x: 0,
96
- deltaX: stepSize,
97
- lastX: xPosition,
98
- y: 0,
99
- deltaY: 0,
100
- lastY: 0,
101
- node: target
102
- };
103
- switch (keyCode) {
104
- case ArrowUp:
105
- case ArrowRight:
106
- data.x = xPosition + stepSize;
107
- break;
108
- case ArrowDown:
109
- case ArrowLeft:
110
- data.x = xPosition - stepSize;
111
- data.deltaX = -stepSize;
112
- break;
113
- case PageUp:
114
- data.x = xPosition + computedMultipleSteps;
115
- data.deltaX = computedMultipleSteps;
116
- break;
117
- case PageDown:
118
- data.x = xPosition - computedMultipleSteps;
119
- data.deltaX = -computedMultipleSteps;
120
- break;
121
- case End:
122
- data.x = max * stepSize;
123
- break;
124
- case Home:
125
- data.x = 0;
126
- break;
127
- default:
128
- data.x = 0;
75
+ var data = computeKeyPressData.computeKeyPressData(event, {
76
+ isVertical: isVertical,
77
+ stepSize: stepSize,
78
+ position: position,
79
+ max: max,
80
+ computedMultipleSteps: computedMultipleSteps
81
+ });
82
+ if (!data) {
83
+ return;
129
84
  }
130
85
  var left = computedBounds.left,
131
- right = computedBounds.right;
86
+ right = computedBounds.right,
87
+ top = computedBounds.top,
88
+ bottom = computedBounds.bottom;
132
89
 
133
90
  /*
134
91
  * INFO: Находим значение в диапазоне между указанными левой и правой границами.
92
+ * Или между верхней и нижней
135
93
  * Необходимо для правильного расчета положения SliderThumb.
136
94
  * см. функция clamp
137
95
  */
138
- var boundedValue = Math.max(Math.min(right, data.x), left);
139
- var computedValue = index.getSliderThumbValue(boundedValue, stepSize, min, max);
96
+ var boundedValue = isVertical ? Math.max(Math.min(bottom, data.y), top) : Math.max(Math.min(right, data.x), left);
97
+ var computedValue = index$1.getSliderThumbValue(boundedValue, stepSize, min, max);
140
98
  lastOnChangeValue.current = computedValue;
141
99
  onChangeCommitted && onChangeCommitted(computedValue, data);
142
100
  };
143
101
  return /*#__PURE__*/React.createElement(Draggable, {
144
- axis: "x",
102
+ axis: isVertical ? 'y' : 'x',
145
103
  bounds: computedBounds,
146
- grid: [stepSize, 1],
104
+ grid: isVertical ? [1, stepSize] : [stepSize, 1],
147
105
  onStop: onStop,
148
106
  onDrag: onDrag,
149
- position: position,
107
+ position: dragPosition,
150
108
  disabled: disabled
151
109
  }, /*#__PURE__*/React.createElement(Handler_styles.HandlerStyled, {
152
110
  ref: ref,
153
111
  style: {
154
112
  zIndex: zIndex
155
113
  },
114
+ className: index.cx(isVertical && Slider_tokens.classes.verticalOrientation, valuePlacement === 'left' && Slider_tokens.classes.valuePlacementLeft),
115
+ isLarge: size === 'large',
156
116
  onKeyDown: onKeyPress
157
- }, /*#__PURE__*/React.createElement(Thumb.Thumb, _rollupPluginBabelHelpers.extends({
117
+ }, size !== 'none' && /*#__PURE__*/React.createElement(Thumb.Thumb, _rollupPluginBabelHelpers.extends({
158
118
  tabIndex: tabIndex,
159
119
  min: min,
160
120
  max: max,
161
121
  value: value,
162
- disabled: disabled
122
+ disabled: disabled,
123
+ orientation: orientation
163
124
  }, rest)), showCurrentValueCondition && /*#__PURE__*/React.createElement(Handler_styles.StyledValue, null, value)));
164
125
  });
165
126
 
@@ -1 +1 @@
1
- {"version":3,"file":"Handler.js","sources":["../../../../../src/components/Slider/ui/Handler/Handler.tsx"],"sourcesContent":["import React, { useRef, forwardRef, KeyboardEvent } from 'react';\nimport Draggable, { DraggableEventHandler } from 'react-draggable';\nimport type { DraggableData } from 'react-draggable';\n\nimport { getSliderThumbValue, getOffsets } from '../../utils';\nimport { Thumb } from '../Thumb/Thumb';\n\nimport type { HandlerProps } from './Handler.types';\nimport { HandlerStyled, StyledValue } from './Handler.styles';\n\n// TODO: PLASMA-1707\ndeclare module 'react-draggable' {\n export interface DraggableProps {\n children: React.ReactNode;\n }\n}\n\nconst KeyboardSupport = {\n PageUp: 33,\n PageDown: 34,\n End: 35,\n Home: 36,\n ArrowLeft: 37,\n ArrowUp: 38,\n ArrowRight: 39,\n ArrowDown: 40,\n};\n\nexport const Handler = forwardRef<HTMLDivElement, HandlerProps>(\n (\n {\n stepSize,\n onChangeCommitted,\n onChange,\n xPosition = 0,\n min,\n max,\n bounds = [],\n zIndex,\n disabled,\n side,\n showCurrentValue = false,\n startOffset = 0,\n endOffset = 0,\n value,\n ...rest\n },\n ref,\n ) => {\n const lastOnChangeValue = useRef<number>();\n\n const [offsetLeft, offsetRight] = getOffsets(ref, side);\n\n const [leftValueBound, rightValueBound] = bounds;\n const leftPositionBound = leftValueBound ? (leftValueBound - min) * stepSize : null;\n const rightPositionBound = rightValueBound ? (rightValueBound - min) * stepSize : null;\n\n const position = typeof xPosition === 'number' ? { x: xPosition, y: 0 } : undefined;\n const tabIndex = disabled ? -1 : 0;\n\n const computedBounds = {\n left: (leftPositionBound ?? 0) - (offsetLeft ? stepSize : 0),\n right: (rightPositionBound ?? stepSize * (max - min)) - (offsetRight ? stepSize : 0),\n };\n\n const showCurrentValueCondition =\n showCurrentValue &&\n ((xPosition >= startOffset && xPosition <= max * stepSize - endOffset) || (xPosition === 0 && value !== 0));\n\n const onDrag: DraggableEventHandler = (_, data) => {\n const newValue = getSliderThumbValue(data.x, stepSize, min, max);\n if (lastOnChangeValue.current !== newValue) {\n onChange?.(newValue, data);\n lastOnChangeValue.current = newValue;\n }\n };\n\n const onStop: DraggableEventHandler = (_, data) => {\n const newValue = getSliderThumbValue(data.x, stepSize, min, max);\n onChangeCommitted && onChangeCommitted(newValue, data);\n };\n\n const onKeyPress = (event: KeyboardEvent<HTMLDivElement>) => {\n event.persist();\n\n const { keyCode, target } = event;\n\n if (!Object.values(KeyboardSupport).includes(keyCode)) {\n return;\n }\n\n const { ArrowUp, ArrowRight, ArrowDown, ArrowLeft, Home, End, PageDown, PageUp } = KeyboardSupport;\n\n const computedMultipleSteps = stepSize * ((rest.multipleStepSize / 100) * max);\n\n const data: DraggableData = {\n x: 0,\n deltaX: stepSize,\n lastX: xPosition,\n y: 0,\n deltaY: 0,\n lastY: 0,\n node: target as HTMLDivElement,\n };\n\n switch (keyCode) {\n case ArrowUp:\n case ArrowRight:\n data.x = xPosition + stepSize;\n break;\n case ArrowDown:\n case ArrowLeft:\n data.x = xPosition - stepSize;\n data.deltaX = -stepSize;\n break;\n case PageUp:\n data.x = xPosition + computedMultipleSteps;\n data.deltaX = computedMultipleSteps;\n break;\n case PageDown:\n data.x = xPosition - computedMultipleSteps;\n data.deltaX = -computedMultipleSteps;\n break;\n case End:\n data.x = max * stepSize;\n break;\n case Home:\n data.x = 0;\n break;\n default:\n data.x = 0;\n }\n\n const { left, right } = computedBounds;\n\n /*\n * INFO: Находим значение в диапазоне между указанными левой и правой границами.\n * Необходимо для правильного расчета положения SliderThumb.\n * см. функция clamp\n */\n const boundedValue = Math.max(Math.min(right, data.x), left);\n\n const computedValue = getSliderThumbValue(boundedValue, stepSize, min, max);\n lastOnChangeValue.current = computedValue;\n\n onChangeCommitted && onChangeCommitted(computedValue, data);\n };\n\n return (\n <Draggable\n axis=\"x\"\n bounds={computedBounds}\n grid={[stepSize, 1]}\n onStop={onStop}\n onDrag={onDrag}\n position={position}\n disabled={disabled}\n >\n <HandlerStyled ref={ref} style={{ zIndex }} onKeyDown={onKeyPress}>\n <Thumb tabIndex={tabIndex} min={min} max={max} value={value} disabled={disabled} {...rest} />\n {showCurrentValueCondition && <StyledValue>{value}</StyledValue>}\n </HandlerStyled>\n </Draggable>\n );\n },\n);\n"],"names":["KeyboardSupport","PageUp","PageDown","End","Home","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Handler","forwardRef","_ref","ref","stepSize","onChangeCommitted","onChange","_ref$xPosition","xPosition","min","max","_ref$bounds","bounds","zIndex","disabled","side","_ref$showCurrentValue","showCurrentValue","_ref$startOffset","startOffset","_ref$endOffset","endOffset","value","rest","_objectWithoutProperties","_excluded","lastOnChangeValue","useRef","_getOffsets","getOffsets","_getOffsets2","_slicedToArray","offsetLeft","offsetRight","_bounds","leftValueBound","rightValueBound","leftPositionBound","rightPositionBound","position","x","y","undefined","tabIndex","computedBounds","left","right","showCurrentValueCondition","onDrag","_","data","newValue","getSliderThumbValue","current","onStop","onKeyPress","event","persist","keyCode","target","Object","values","includes","computedMultipleSteps","multipleStepSize","deltaX","lastX","deltaY","lastY","node","boundedValue","Math","computedValue","React","createElement","Draggable","axis","grid","HandlerStyled","style","onKeyDown","Thumb","_extends","StyledValue"],"mappings":";;;;;;;;;;;;;AAUA;;AAOA,IAAMA,eAAe,GAAG;AACpBC,EAAAA,MAAM,EAAE,EAAE;AACVC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,GAAG,EAAE,EAAE;AACPC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,SAAS,EAAE,EAAE;AACbC,EAAAA,OAAO,EAAE,EAAE;AACXC,EAAAA,UAAU,EAAE,EAAE;AACdC,EAAAA,SAAS,EAAE,EAAA;AACf,CAAC,CAAA;AAEM,IAAMC,OAAO,gBAAGC,gBAAU,CAC7B,UAAAC,IAAA,EAkBIC,GAAG,EACF;AAAA,EAAA,IAjBGC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,iBAAiB,GAAAH,IAAA,CAAjBG,iBAAiB;IACjBC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IAAAC,cAAA,GAAAL,IAAA,CACRM,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,CAAC,GAAAA,cAAA;IACbE,GAAG,GAAAP,IAAA,CAAHO,GAAG;IACHC,GAAG,GAAAR,IAAA,CAAHQ,GAAG;IAAAC,WAAA,GAAAT,IAAA,CACHU,MAAM;AAANA,IAAAA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,WAAA;IACXE,MAAM,GAAAX,IAAA,CAANW,MAAM;IACNC,QAAQ,GAAAZ,IAAA,CAARY,QAAQ;IACRC,IAAI,GAAAb,I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BAAI0B,KAAA,CAAAC,aAAA,CAACS,0BAAW,EAAA,IAAA,EAAE7D,KAAmB,CACpD,CACR,CAAC,CAAA;AAEpB,CACJ;;;;"}
1
+ {"version":3,"file":"Handler.js","sources":["../../../../../src/components/Slider/ui/Handler/Handler.tsx"],"sourcesContent":["import React, { useRef, forwardRef, KeyboardEvent } from 'react';\nimport Draggable, { DraggableEventHandler } from 'react-draggable';\n\nimport { cx } from '../../../../utils';\nimport { getSliderThumbValue, getOffsets } from '../../utils';\nimport { Thumb } from '../Thumb/Thumb';\nimport { classes } from '../../Slider.tokens';\n\nimport type { HandlerProps } from './Handler.types';\nimport { HandlerStyled, StyledValue } from './Handler.styles';\nimport { computeKeyPressData } from './computeKeyPressData';\n\n// TODO: PLASMA-1707\ndeclare module 'react-draggable' {\n export interface DraggableProps {\n children: React.ReactNode;\n }\n}\n\nexport const Handler = forwardRef<HTMLDivElement, HandlerProps>(\n (\n {\n size,\n orientation,\n stepSize,\n onChangeCommitted,\n onChange,\n position = 0,\n min,\n max,\n bounds = [],\n zIndex,\n disabled,\n side,\n showCurrentValue = false,\n startOffset = 0,\n endOffset = 0,\n value,\n valuePlacement,\n ...rest\n },\n ref,\n ) => {\n const isVertical = orientation === 'vertical';\n\n const lastOnChangeValue = useRef<number>();\n const [startClientOffset, endClientOffset] = getOffsets(ref, side, isVertical);\n\n const [startValueBound, endValueBound] = bounds;\n const startPositionBound = startValueBound ? (startValueBound - min) * stepSize : null;\n const endPositionBound = endValueBound ? (endValueBound - min) * stepSize : null;\n\n const dragPosition =\n typeof position === 'number' ? { x: isVertical ? 0 : position, y: isVertical ? position : 0 } : undefined;\n const tabIndex = disabled ? -1 : 0;\n\n const computedBounds = {\n [isVertical ? 'top' : 'left']: (startPositionBound ?? 0) - (startClientOffset ? stepSize : 0),\n [isVertical ? 'bottom' : 'right']:\n (endPositionBound ?? stepSize * (max - min)) - (endClientOffset ? stepSize : 0),\n };\n\n const showCurrentValueCondition =\n showCurrentValue &&\n ((position >= startOffset && position <= max * stepSize - endOffset) || (position === 0 && value !== 0));\n\n const onDrag: DraggableEventHandler = (_, data) => {\n const newValue = getSliderThumbValue(isVertical ? data.y : data.x, stepSize, min, max);\n if (lastOnChangeValue.current !== newValue) {\n onChange?.(newValue, data);\n lastOnChangeValue.current = newValue;\n }\n };\n\n const onStop: DraggableEventHandler = (_, data) => {\n const newValue = getSliderThumbValue(isVertical ? data.y : data.x, stepSize, min, max);\n onChangeCommitted && onChangeCommitted(newValue, data);\n };\n\n const onKeyPress = (event: KeyboardEvent<HTMLDivElement>) => {\n event.persist();\n\n const computedMultipleSteps = stepSize * ((rest.multipleStepSize / 100) * max);\n\n const data = computeKeyPressData(event, {\n isVertical,\n stepSize,\n position,\n max,\n computedMultipleSteps,\n });\n\n if (!data) {\n return;\n }\n\n const { left, right, top, bottom } = computedBounds;\n\n /*\n * INFO: Находим значение в диапазоне между указанными левой и правой границами.\n * Или между верхней и нижней\n * Необходимо для правильного расчета положения SliderThumb.\n * см. функция clamp\n */\n const boundedValue = isVertical\n ? Math.max(Math.min(bottom, data.y), top)\n : Math.max(Math.min(right, data.x), left);\n\n const computedValue = getSliderThumbValue(boundedValue, stepSize, min, max);\n lastOnChangeValue.current = computedValue;\n\n onChangeCommitted && onChangeCommitted(computedValue, data);\n };\n\n return (\n <Draggable\n axis={isVertical ? 'y' : 'x'}\n bounds={computedBounds}\n grid={isVertical ? [1, stepSize] : [stepSize, 1]}\n onStop={onStop}\n onDrag={onDrag}\n position={dragPosition}\n disabled={disabled}\n >\n <HandlerStyled\n ref={ref}\n style={{ zIndex }}\n className={cx(\n isVertical && classes.verticalOrientation,\n valuePlacement === 'left' && classes.valuePlacementLeft,\n )}\n isLarge={size === 'large'}\n onKeyDown={onKeyPress}\n >\n {size !== 'none' && (\n <Thumb\n tabIndex={tabIndex}\n min={min}\n max={max}\n value={value}\n disabled={disabled}\n orientation={orientation}\n {...rest}\n />\n )}\n {showCurrentValueCondition && <StyledValue>{value}</StyledValue>}\n </HandlerStyled>\n </Draggable>\n );\n },\n);\n"],"names":["Handler","forwardRef","_ref","ref","size","orientation","stepSize","onChangeCommitted","onChange","_ref$position","position","min","max","_ref$bounds","bounds","zIndex","disabled","side","_ref$showCurrentValue","showCurrentValue","_ref$startOffset","startOffset","_ref$endOffset","endOffset","value","valuePlacement","rest","_objectWithoutProperties","_excluded","isVertical","lastOnChangeValue","useRef","_getOffsets","getOffsets","_getOffsets2","_slicedToArray","startClientOffset","endClientOffset","_bounds","startValueBound","endValueBound","startPositionBound","endPositionBound","dragPosition","x","y","undefined","tabIndex","computedBounds","_defineProperty","showCurrentValueCondition","onDrag","_","data","newValue","getSliderThumbValue","current","onStop","onKeyPress","event","persist","computedMultipleSteps","multipleStepSize","computeKeyPressData","left","right","top","bottom","boundedValue","Math","computedValue","React","createElement","Draggable","axis","grid","HandlerStyled","style","className","cx","classes","verticalOrientation","valuePlacementLeft","isLarge","onKeyDown","Thumb","_extends","StyledValue"],"mappings":";;;;;;;;;;;;;;;;AAYA;;AAOO,IAAMA,OAAO,gBAAGC,gBAAU,CAC7B,UAAAC,IAAA,EAqBIC,GAAG,EACF;AAAA,EAAA,IApBGC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IACRC,iBAAiB,GAAAL,IAAA,CAAjBK,iBAAiB;IACjBC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;IAAAC,aAAA,GAAAP,IAAA,CACRQ,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,CAAC,GAAAA,aAAA;IACZE,GAAG,GAAAT,IAAA,CAAHS,GAAG;IACHC,GAAG,GAAAV,IAAA,CAAHU,GAAG;IAAAC,WAAA,GAAAX,IAAA,CACHY,MAAM;AAANA,IAAAA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,WAAA;I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;AACVzE,IAAAA,GAAG,EAAEA,GAAI;AACT0E,IAAAA,KAAK,EAAE;AAAE9D,MAAAA,MAAM,EAANA,MAAAA;KAAS;AAClB+D,IAAAA,SAAS,EAAEC,QAAE,CACTlD,UAAU,IAAImD,qBAAO,CAACC,mBAAmB,EACzCxD,cAAc,KAAK,MAAM,IAAIuD,qBAAO,CAACE,kBACzC,CAAE;IACFC,OAAO,EAAE/E,IAAI,KAAK,OAAQ;AAC1BgF,IAAAA,SAAS,EAAE1B,UAAAA;GAEVtD,EAAAA,IAAI,KAAK,MAAM,iBACZmE,KAAA,CAAAC,aAAA,CAACa,WAAK,EAAAC,iCAAA,CAAA;AACFvC,IAAAA,QAAQ,EAAEA,QAAS;AACnBpC,IAAAA,GAAG,EAAEA,GAAI;AACTC,IAAAA,GAAG,EAAEA,GAAI;AACTY,IAAAA,KAAK,EAAEA,KAAM;AACbR,IAAAA,QAAQ,EAAEA,QAAS;AACnBX,IAAAA,WAAW,EAAEA,WAAAA;AAAY,GAAA,EACrBqB,IAAI,CACX,CACJ,EACAwB,yBAAyB,iBAAIqB,KAAA,CAAAC,aAAA,CAACe,0BAAW,EAAA,IAAA,EAAE/D,KAAmB,CACpD,CACR,CAAC,CAAA;AAEpB,CACJ;;;;"}
@@ -1,20 +1,30 @@
1
- import './Handler.styles_8crx5z.css';
1
+ import './Handler.styles_irtcgm.css';
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var react = require('@linaria/react');
7
+ var Slider_tokens = require('../../Slider.tokens.js');
7
8
 
8
- var HandlerStyled = /*#__PURE__*/react.styled('div')({
9
- name: "HandlerStyled",
10
- "class": "h1tnrnip",
11
- propsAsIs: false
12
- });
13
9
  var StyledValue = /*#__PURE__*/react.styled('span')({
14
10
  name: "StyledValue",
15
- "class": "s12uu2lj",
11
+ "class": "s1tnrnip",
16
12
  propsAsIs: false
17
13
  });
14
+ var _exp8 = function _exp8() {
15
+ return function (_ref) {
16
+ var isLarge = _ref.isLarge;
17
+ return isLarge ? "var(".concat(Slider_tokens.tokens.thumbSizeLarge, ")") : "var(".concat(Slider_tokens.tokens.thumbSize, ")");
18
+ };
19
+ };
20
+ var HandlerStyled = /*#__PURE__*/react.styled('div')({
21
+ name: "HandlerStyled",
22
+ "class": "h12uu2lj",
23
+ propsAsIs: false,
24
+ vars: {
25
+ "h12uu2lj-0": [/*#__PURE__*/_exp8()]
26
+ }
27
+ });
18
28
 
19
29
  exports.HandlerStyled = HandlerStyled;
20
30
  exports.StyledValue = StyledValue;