@salutejs/plasma-new-hope 0.176.0-canary.1511.11570259013.0 → 0.176.0-canary.1513.11570030354.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (482) hide show
  1. package/cjs/components/Slider/Slider.css +13 -15
  2. package/cjs/components/Slider/Slider.js +2 -11
  3. package/cjs/components/Slider/Slider.js.map +1 -1
  4. package/cjs/components/Slider/Slider.tokens.js +17 -23
  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 +23 -58
  8. package/cjs/components/Slider/components/Double/Double.js.map +1 -1
  9. package/cjs/components/Slider/components/Single/Single.css +14 -14
  10. package/cjs/components/Slider/components/Single/Single.js +33 -64
  11. package/cjs/components/Slider/components/Single/Single.js.map +1 -1
  12. package/cjs/components/Slider/components/Single/Single.styles.js +4 -4
  13. package/cjs/components/Slider/components/Single/Single.styles.js.map +1 -1
  14. package/cjs/components/Slider/components/Single/Single.styles_1r9f1e0.css +6 -0
  15. package/cjs/components/Slider/components/SliderBase/SliderBase.css +5 -5
  16. package/cjs/components/Slider/components/SliderBase/SliderBase.js +12 -31
  17. package/cjs/components/Slider/components/SliderBase/SliderBase.js.map +1 -1
  18. package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
  19. package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -1
  20. package/cjs/components/Slider/components/SliderBase/SliderBase.styles_9s4eb3.css +5 -0
  21. package/cjs/components/Slider/ui/Handler/Handler.css +3 -3
  22. package/cjs/components/Slider/ui/Handler/Handler.js +88 -49
  23. package/cjs/components/Slider/ui/Handler/Handler.js.map +1 -1
  24. package/cjs/components/Slider/ui/Handler/Handler.styles.js +7 -17
  25. package/cjs/components/Slider/ui/Handler/Handler.styles.js.map +1 -1
  26. package/cjs/components/Slider/ui/Handler/Handler.styles_8crx5z.css +2 -0
  27. package/cjs/components/Slider/ui/Thumb/Thumb.css +1 -1
  28. package/cjs/components/Slider/ui/Thumb/Thumb.js +2 -3
  29. package/cjs/components/Slider/ui/Thumb/Thumb.js.map +1 -1
  30. package/cjs/components/Slider/ui/Thumb/Thumb.styles.js +1 -1
  31. package/cjs/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -1
  32. package/cjs/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +1 -0
  33. package/cjs/components/Slider/utils/index.js +10 -28
  34. package/cjs/components/Slider/utils/index.js.map +1 -1
  35. package/cjs/components/Slider/variations/_view/base.js +1 -1
  36. package/cjs/components/Slider/variations/_view/base.js.map +1 -1
  37. package/cjs/index.css +13 -38
  38. package/cjs/index.js +0 -6
  39. package/cjs/index.js.map +1 -1
  40. package/cjs/utils/index.js.map +1 -1
  41. package/emotion/cjs/components/Slider/Slider.js +2 -10
  42. package/emotion/cjs/components/Slider/Slider.template-doc.mdx +0 -26
  43. package/emotion/cjs/components/Slider/Slider.tokens.js +17 -23
  44. package/emotion/cjs/components/Slider/components/Double/Double.js +19 -54
  45. package/emotion/cjs/components/Slider/components/Single/Single.js +33 -64
  46. package/emotion/cjs/components/Slider/components/Single/Single.styles.js +9 -18
  47. package/emotion/cjs/components/Slider/components/SliderBase/SliderBase.js +12 -31
  48. package/emotion/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +10 -10
  49. package/emotion/cjs/components/Slider/ui/Handler/Handler.js +88 -52
  50. package/emotion/cjs/components/Slider/ui/Handler/Handler.styles.js +15 -9
  51. package/emotion/cjs/components/Slider/ui/Thumb/Thumb.js +2 -3
  52. package/emotion/cjs/components/Slider/ui/Thumb/Thumb.styles.js +3 -3
  53. package/emotion/cjs/components/Slider/utils/index.js +10 -28
  54. package/emotion/cjs/components/Slider/variations/_view/base.js +1 -2
  55. package/emotion/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +7 -7
  56. package/emotion/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +16 -98
  57. package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
  58. package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
  59. package/emotion/cjs/examples/plasma_web/components/Slider/Slider.config.js +7 -7
  60. package/emotion/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +15 -98
  61. package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
  62. package/emotion/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
  63. package/emotion/cjs/index.js +0 -11
  64. package/emotion/es/components/Slider/Slider.js +2 -11
  65. package/emotion/es/components/Slider/Slider.template-doc.mdx +0 -26
  66. package/emotion/es/components/Slider/Slider.tokens.js +17 -23
  67. package/emotion/es/components/Slider/components/Double/Double.js +19 -54
  68. package/emotion/es/components/Slider/components/Single/Single.js +34 -65
  69. package/emotion/es/components/Slider/components/Single/Single.styles.js +8 -17
  70. package/emotion/es/components/Slider/components/SliderBase/SliderBase.js +12 -31
  71. package/emotion/es/components/Slider/components/SliderBase/SliderBase.styles.js +11 -11
  72. package/emotion/es/components/Slider/ui/Handler/Handler.js +86 -51
  73. package/emotion/es/components/Slider/ui/Handler/Handler.styles.js +16 -10
  74. package/emotion/es/components/Slider/ui/Thumb/Thumb.js +2 -3
  75. package/emotion/es/components/Slider/ui/Thumb/Thumb.styles.js +3 -3
  76. package/emotion/es/components/Slider/utils/index.js +10 -28
  77. package/emotion/es/components/Slider/variations/_view/base.js +1 -2
  78. package/emotion/es/examples/plasma_b2c/components/Slider/Slider.config.js +7 -7
  79. package/emotion/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +16 -98
  80. package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
  81. package/emotion/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
  82. package/emotion/es/examples/plasma_web/components/Slider/Slider.config.js +7 -7
  83. package/emotion/es/examples/plasma_web/components/Slider/Slider.stories.tsx +15 -98
  84. package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
  85. package/emotion/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
  86. package/emotion/es/index.js +1 -2
  87. package/es/components/Slider/Slider.css +13 -15
  88. package/es/components/Slider/Slider.js +2 -11
  89. package/es/components/Slider/Slider.js.map +1 -1
  90. package/es/components/Slider/Slider.tokens.js +17 -23
  91. package/es/components/Slider/Slider.tokens.js.map +1 -1
  92. package/es/components/Slider/components/Double/Double.css +8 -8
  93. package/es/components/Slider/components/Double/Double.js +19 -54
  94. package/es/components/Slider/components/Double/Double.js.map +1 -1
  95. package/es/components/Slider/components/Single/Single.css +14 -14
  96. package/es/components/Slider/components/Single/Single.js +34 -65
  97. package/es/components/Slider/components/Single/Single.js.map +1 -1
  98. package/es/components/Slider/components/Single/Single.styles.js +4 -4
  99. package/es/components/Slider/components/Single/Single.styles.js.map +1 -1
  100. package/es/components/Slider/components/Single/Single.styles_1r9f1e0.css +6 -0
  101. package/es/components/Slider/components/SliderBase/SliderBase.css +5 -5
  102. package/es/components/Slider/components/SliderBase/SliderBase.js +12 -31
  103. package/es/components/Slider/components/SliderBase/SliderBase.js.map +1 -1
  104. package/es/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
  105. package/es/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -1
  106. package/es/components/Slider/components/SliderBase/SliderBase.styles_9s4eb3.css +5 -0
  107. package/es/components/Slider/ui/Handler/Handler.css +3 -3
  108. package/es/components/Slider/ui/Handler/Handler.js +87 -48
  109. package/es/components/Slider/ui/Handler/Handler.js.map +1 -1
  110. package/es/components/Slider/ui/Handler/Handler.styles.js +7 -17
  111. package/es/components/Slider/ui/Handler/Handler.styles.js.map +1 -1
  112. package/es/components/Slider/ui/Handler/Handler.styles_8crx5z.css +2 -0
  113. package/es/components/Slider/ui/Thumb/Thumb.css +1 -1
  114. package/es/components/Slider/ui/Thumb/Thumb.js +2 -3
  115. package/es/components/Slider/ui/Thumb/Thumb.js.map +1 -1
  116. package/es/components/Slider/ui/Thumb/Thumb.styles.js +1 -1
  117. package/es/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -1
  118. package/es/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +1 -0
  119. package/es/components/Slider/utils/index.js +10 -28
  120. package/es/components/Slider/utils/index.js.map +1 -1
  121. package/es/components/Slider/variations/_view/base.js +1 -1
  122. package/es/components/Slider/variations/_view/base.js.map +1 -1
  123. package/es/index.css +13 -38
  124. package/es/index.js +0 -2
  125. package/es/index.js.map +1 -1
  126. package/es/utils/index.js.map +1 -1
  127. package/package.json +2 -2
  128. package/styled-components/cjs/components/Slider/Slider.js +2 -10
  129. package/styled-components/cjs/components/Slider/Slider.template-doc.mdx +0 -26
  130. package/styled-components/cjs/components/Slider/Slider.tokens.js +17 -23
  131. package/styled-components/cjs/components/Slider/components/Double/Double.js +19 -54
  132. package/styled-components/cjs/components/Slider/components/Single/Single.js +33 -64
  133. package/styled-components/cjs/components/Slider/components/Single/Single.styles.js +6 -6
  134. package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.js +12 -31
  135. package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +6 -6
  136. package/styled-components/cjs/components/Slider/ui/Handler/Handler.js +88 -52
  137. package/styled-components/cjs/components/Slider/ui/Handler/Handler.styles.js +4 -7
  138. package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.js +2 -3
  139. package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.styles.js +2 -2
  140. package/styled-components/cjs/components/Slider/utils/index.js +10 -28
  141. package/styled-components/cjs/components/Slider/variations/_view/base.js +1 -2
  142. package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +3 -3
  143. package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +16 -98
  144. package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
  145. package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
  146. package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.config.js +3 -3
  147. package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +15 -98
  148. package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
  149. package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
  150. package/styled-components/cjs/index.js +0 -11
  151. package/styled-components/es/components/Slider/Slider.js +2 -11
  152. package/styled-components/es/components/Slider/Slider.template-doc.mdx +0 -26
  153. package/styled-components/es/components/Slider/Slider.tokens.js +17 -23
  154. package/styled-components/es/components/Slider/components/Double/Double.js +19 -54
  155. package/styled-components/es/components/Slider/components/Single/Single.js +34 -65
  156. package/styled-components/es/components/Slider/components/Single/Single.styles.js +5 -5
  157. package/styled-components/es/components/Slider/components/SliderBase/SliderBase.js +12 -31
  158. package/styled-components/es/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
  159. package/styled-components/es/components/Slider/ui/Handler/Handler.js +86 -51
  160. package/styled-components/es/components/Slider/ui/Handler/Handler.styles.js +5 -8
  161. package/styled-components/es/components/Slider/ui/Thumb/Thumb.js +2 -3
  162. package/styled-components/es/components/Slider/ui/Thumb/Thumb.styles.js +2 -2
  163. package/styled-components/es/components/Slider/utils/index.js +10 -28
  164. package/styled-components/es/components/Slider/variations/_view/base.js +1 -2
  165. package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.config.js +3 -3
  166. package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +16 -98
  167. package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
  168. package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
  169. package/styled-components/es/examples/plasma_web/components/Slider/Slider.config.js +3 -3
  170. package/styled-components/es/examples/plasma_web/components/Slider/Slider.stories.tsx +15 -98
  171. package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
  172. package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
  173. package/styled-components/es/index.js +1 -2
  174. package/types/components/Slider/Slider.d.ts.map +1 -1
  175. package/types/components/Slider/Slider.tokens.d.ts +16 -22
  176. package/types/components/Slider/Slider.tokens.d.ts.map +1 -1
  177. package/types/components/Slider/components/Double/Double.d.ts.map +1 -1
  178. package/types/components/Slider/components/Double/Double.types.d.ts +0 -1
  179. package/types/components/Slider/components/Double/Double.types.d.ts.map +1 -1
  180. package/types/components/Slider/components/Single/Single.d.ts.map +1 -1
  181. package/types/components/Slider/components/Single/Single.styles.d.ts +1 -1
  182. package/types/components/Slider/components/Single/Single.styles.d.ts.map +1 -1
  183. package/types/components/Slider/components/Single/Single.types.d.ts +7 -79
  184. package/types/components/Slider/components/Single/Single.types.d.ts.map +1 -1
  185. package/types/components/Slider/components/SliderBase/SliderBase.d.ts.map +1 -1
  186. package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts +1 -1
  187. package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts.map +1 -1
  188. package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts +0 -6
  189. package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts.map +1 -1
  190. package/types/components/Slider/ui/Handler/Handler.d.ts.map +1 -1
  191. package/types/components/Slider/ui/Handler/Handler.styles.d.ts +2 -6
  192. package/types/components/Slider/ui/Handler/Handler.styles.d.ts.map +1 -1
  193. package/types/components/Slider/ui/Handler/Handler.types.d.ts +1 -5
  194. package/types/components/Slider/ui/Handler/Handler.types.d.ts.map +1 -1
  195. package/types/components/Slider/ui/Thumb/Thumb.d.ts +1 -1
  196. package/types/components/Slider/ui/Thumb/Thumb.d.ts.map +1 -1
  197. package/types/components/Slider/ui/Thumb/Thumb.styles.d.ts.map +1 -1
  198. package/types/components/Slider/ui/Thumb/Thumb.types.d.ts +0 -1
  199. package/types/components/Slider/ui/Thumb/Thumb.types.d.ts.map +1 -1
  200. package/types/components/Slider/utils/index.d.ts +8 -26
  201. package/types/components/Slider/utils/index.d.ts.map +1 -1
  202. package/types/components/Slider/variations/_view/base.d.ts.map +1 -1
  203. package/types/examples/plasma_b2c/components/Slider/Slider.config.d.ts.map +1 -1
  204. package/types/examples/plasma_b2c/components/Slider/Slider.d.ts +2 -80
  205. package/types/examples/plasma_b2c/components/Slider/Slider.d.ts.map +1 -1
  206. package/types/examples/plasma_web/components/Slider/Slider.config.d.ts.map +1 -1
  207. package/types/examples/plasma_web/components/Slider/Slider.d.ts +2 -80
  208. package/types/examples/plasma_web/components/Slider/Slider.d.ts.map +1 -1
  209. package/types/index.d.ts +0 -1
  210. package/types/index.d.ts.map +1 -1
  211. package/types/utils/index.d.ts +1 -1
  212. package/types/utils/index.d.ts.map +1 -1
  213. package/cjs/components/NumberInput/NumberInput.css +0 -52
  214. package/cjs/components/NumberInput/NumberInput.js +0 -183
  215. package/cjs/components/NumberInput/NumberInput.js.map +0 -1
  216. package/cjs/components/NumberInput/NumberInput.styles.js +0 -9
  217. package/cjs/components/NumberInput/NumberInput.styles.js.map +0 -1
  218. package/cjs/components/NumberInput/NumberInput.styles_jeawjl.css +0 -1
  219. package/cjs/components/NumberInput/NumberInput.tokens.js +0 -93
  220. package/cjs/components/NumberInput/NumberInput.tokens.js.map +0 -1
  221. package/cjs/components/NumberInput/ui/ActionButton/ActionButton.js +0 -19
  222. package/cjs/components/NumberInput/ui/ActionButton/ActionButton.js.map +0 -1
  223. package/cjs/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -22
  224. package/cjs/components/NumberInput/ui/ActionButton/ActionButton.styles.js.map +0 -1
  225. package/cjs/components/NumberInput/ui/Input/Input.css +0 -15
  226. package/cjs/components/NumberInput/ui/Input/Input.js +0 -199
  227. package/cjs/components/NumberInput/ui/Input/Input.js.map +0 -1
  228. package/cjs/components/NumberInput/ui/Input/Input.styles.js +0 -96
  229. package/cjs/components/NumberInput/ui/Input/Input.styles.js.map +0 -1
  230. package/cjs/components/NumberInput/ui/Input/Input.styles_fhgb95.css +0 -8
  231. package/cjs/components/NumberInput/utils/index.js +0 -8
  232. package/cjs/components/NumberInput/utils/index.js.map +0 -1
  233. package/cjs/components/NumberInput/variations/_background-type/base.js +0 -9
  234. package/cjs/components/NumberInput/variations/_background-type/base.js.map +0 -1
  235. package/cjs/components/NumberInput/variations/_background-type/base_dx9knv.css +0 -1
  236. package/cjs/components/NumberInput/variations/_disabled/base.js +0 -9
  237. package/cjs/components/NumberInput/variations/_disabled/base.js.map +0 -1
  238. package/cjs/components/NumberInput/variations/_disabled/base_1sl0mh8.css +0 -1
  239. package/cjs/components/NumberInput/variations/_segmentation/base.js +0 -9
  240. package/cjs/components/NumberInput/variations/_segmentation/base.js.map +0 -1
  241. package/cjs/components/NumberInput/variations/_segmentation/base_3r9a58.css +0 -1
  242. package/cjs/components/NumberInput/variations/_shape/base.js +0 -9
  243. package/cjs/components/NumberInput/variations/_shape/base.js.map +0 -1
  244. package/cjs/components/NumberInput/variations/_shape/base_k05biw.css +0 -1
  245. package/cjs/components/NumberInput/variations/_size/base.js +0 -9
  246. package/cjs/components/NumberInput/variations/_size/base.js.map +0 -1
  247. package/cjs/components/NumberInput/variations/_size/base_yqdmk4.css +0 -1
  248. package/cjs/components/NumberInput/variations/_view/base.js +0 -9
  249. package/cjs/components/NumberInput/variations/_view/base.js.map +0 -1
  250. package/cjs/components/NumberInput/variations/_view/base_3gefjm.css +0 -1
  251. package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +0 -98
  252. package/cjs/components/Slider/components/Single/Single.styles_1h7n2s2.css +0 -6
  253. package/cjs/components/Slider/components/SliderBase/SliderBase.styles_1qt1224.css +0 -5
  254. package/cjs/components/Slider/ui/Handler/Handler.styles_irtcgm.css +0 -2
  255. package/cjs/components/Slider/ui/Handler/computeKeyPressData.js +0 -122
  256. package/cjs/components/Slider/ui/Handler/computeKeyPressData.js.map +0 -1
  257. package/cjs/components/Slider/ui/Thumb/Thumb.styles_uyn20e.css +0 -1
  258. package/cjs/components/Slider/variations/_view/base_1s3f6q8.css +0 -1
  259. package/emotion/cjs/components/NumberInput/NumberInput.js +0 -193
  260. package/emotion/cjs/components/NumberInput/NumberInput.styles.js +0 -17
  261. package/emotion/cjs/components/NumberInput/NumberInput.tokens.js +0 -90
  262. package/emotion/cjs/components/NumberInput/NumberInput.types.js +0 -5
  263. package/emotion/cjs/components/NumberInput/index.js +0 -31
  264. package/emotion/cjs/components/NumberInput/ui/ActionButton/ActionButton.js +0 -18
  265. package/emotion/cjs/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -16
  266. package/emotion/cjs/components/NumberInput/ui/ActionButton/ActionButton.types.js +0 -5
  267. package/emotion/cjs/components/NumberInput/ui/Input/Input.js +0 -207
  268. package/emotion/cjs/components/NumberInput/ui/Input/Input.styles.js +0 -81
  269. package/emotion/cjs/components/NumberInput/ui/Input/Input.types.js +0 -5
  270. package/emotion/cjs/components/NumberInput/ui/index.js +0 -19
  271. package/emotion/cjs/components/NumberInput/utils/index.js +0 -7
  272. package/emotion/cjs/components/NumberInput/variations/_background-type/base.js +0 -10
  273. package/emotion/cjs/components/NumberInput/variations/_background-type/tokens.json +0 -6
  274. package/emotion/cjs/components/NumberInput/variations/_disabled/base.js +0 -9
  275. package/emotion/cjs/components/NumberInput/variations/_disabled/tokens.json +0 -4
  276. package/emotion/cjs/components/NumberInput/variations/_segmentation/base.js +0 -12
  277. package/emotion/cjs/components/NumberInput/variations/_segmentation/tokens.json +0 -1
  278. package/emotion/cjs/components/NumberInput/variations/_shape/base.js +0 -11
  279. package/emotion/cjs/components/NumberInput/variations/_shape/tokens.json +0 -1
  280. package/emotion/cjs/components/NumberInput/variations/_size/base.js +0 -13
  281. package/emotion/cjs/components/NumberInput/variations/_size/tokens.json +0 -22
  282. package/emotion/cjs/components/NumberInput/variations/_view/base.js +0 -13
  283. package/emotion/cjs/components/NumberInput/variations/_view/tokens.json +0 -14
  284. package/emotion/cjs/components/Slider/ui/Handler/computeKeyPressData.js +0 -121
  285. package/emotion/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.config.js +0 -46
  286. package/emotion/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.js +0 -11
  287. package/emotion/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.stories.tsx +0 -108
  288. package/emotion/cjs/examples/plasma_web/components/NumberInput/NumberInput.config.js +0 -46
  289. package/emotion/cjs/examples/plasma_web/components/NumberInput/NumberInput.js +0 -11
  290. package/emotion/cjs/examples/plasma_web/components/NumberInput/NumberInput.stories.tsx +0 -108
  291. package/emotion/es/components/NumberInput/NumberInput.js +0 -185
  292. package/emotion/es/components/NumberInput/NumberInput.styles.js +0 -11
  293. package/emotion/es/components/NumberInput/NumberInput.tokens.js +0 -84
  294. package/emotion/es/components/NumberInput/NumberInput.types.js +0 -1
  295. package/emotion/es/components/NumberInput/index.js +0 -2
  296. package/emotion/es/components/NumberInput/ui/ActionButton/ActionButton.js +0 -11
  297. package/emotion/es/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -9
  298. package/emotion/es/components/NumberInput/ui/ActionButton/ActionButton.types.js +0 -1
  299. package/emotion/es/components/NumberInput/ui/Input/Input.js +0 -198
  300. package/emotion/es/components/NumberInput/ui/Input/Input.styles.js +0 -74
  301. package/emotion/es/components/NumberInput/ui/Input/Input.types.js +0 -1
  302. package/emotion/es/components/NumberInput/ui/index.js +0 -2
  303. package/emotion/es/components/NumberInput/utils/index.js +0 -1
  304. package/emotion/es/components/NumberInput/variations/_background-type/base.js +0 -4
  305. package/emotion/es/components/NumberInput/variations/_background-type/tokens.json +0 -6
  306. package/emotion/es/components/NumberInput/variations/_disabled/base.js +0 -3
  307. package/emotion/es/components/NumberInput/variations/_disabled/tokens.json +0 -4
  308. package/emotion/es/components/NumberInput/variations/_segmentation/base.js +0 -6
  309. package/emotion/es/components/NumberInput/variations/_segmentation/tokens.json +0 -1
  310. package/emotion/es/components/NumberInput/variations/_shape/base.js +0 -5
  311. package/emotion/es/components/NumberInput/variations/_shape/tokens.json +0 -1
  312. package/emotion/es/components/NumberInput/variations/_size/base.js +0 -7
  313. package/emotion/es/components/NumberInput/variations/_size/tokens.json +0 -22
  314. package/emotion/es/components/NumberInput/variations/_view/base.js +0 -7
  315. package/emotion/es/components/NumberInput/variations/_view/tokens.json +0 -14
  316. package/emotion/es/components/Slider/ui/Handler/computeKeyPressData.js +0 -115
  317. package/emotion/es/examples/plasma_b2c/components/NumberInput/NumberInput.config.js +0 -40
  318. package/emotion/es/examples/plasma_b2c/components/NumberInput/NumberInput.js +0 -5
  319. package/emotion/es/examples/plasma_b2c/components/NumberInput/NumberInput.stories.tsx +0 -108
  320. package/emotion/es/examples/plasma_web/components/NumberInput/NumberInput.config.js +0 -40
  321. package/emotion/es/examples/plasma_web/components/NumberInput/NumberInput.js +0 -5
  322. package/emotion/es/examples/plasma_web/components/NumberInput/NumberInput.stories.tsx +0 -108
  323. package/es/components/NumberInput/NumberInput.css +0 -52
  324. package/es/components/NumberInput/NumberInput.js +0 -178
  325. package/es/components/NumberInput/NumberInput.js.map +0 -1
  326. package/es/components/NumberInput/NumberInput.styles.js +0 -5
  327. package/es/components/NumberInput/NumberInput.styles.js.map +0 -1
  328. package/es/components/NumberInput/NumberInput.styles_jeawjl.css +0 -1
  329. package/es/components/NumberInput/NumberInput.tokens.js +0 -87
  330. package/es/components/NumberInput/NumberInput.tokens.js.map +0 -1
  331. package/es/components/NumberInput/ui/ActionButton/ActionButton.js +0 -15
  332. package/es/components/NumberInput/ui/ActionButton/ActionButton.js.map +0 -1
  333. package/es/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -18
  334. package/es/components/NumberInput/ui/ActionButton/ActionButton.styles.js.map +0 -1
  335. package/es/components/NumberInput/ui/Input/Input.css +0 -15
  336. package/es/components/NumberInput/ui/Input/Input.js +0 -195
  337. package/es/components/NumberInput/ui/Input/Input.js.map +0 -1
  338. package/es/components/NumberInput/ui/Input/Input.styles.js +0 -85
  339. package/es/components/NumberInput/ui/Input/Input.styles.js.map +0 -1
  340. package/es/components/NumberInput/ui/Input/Input.styles_fhgb95.css +0 -8
  341. package/es/components/NumberInput/utils/index.js +0 -4
  342. package/es/components/NumberInput/utils/index.js.map +0 -1
  343. package/es/components/NumberInput/variations/_background-type/base.js +0 -5
  344. package/es/components/NumberInput/variations/_background-type/base.js.map +0 -1
  345. package/es/components/NumberInput/variations/_background-type/base_dx9knv.css +0 -1
  346. package/es/components/NumberInput/variations/_disabled/base.js +0 -5
  347. package/es/components/NumberInput/variations/_disabled/base.js.map +0 -1
  348. package/es/components/NumberInput/variations/_disabled/base_1sl0mh8.css +0 -1
  349. package/es/components/NumberInput/variations/_segmentation/base.js +0 -5
  350. package/es/components/NumberInput/variations/_segmentation/base.js.map +0 -1
  351. package/es/components/NumberInput/variations/_segmentation/base_3r9a58.css +0 -1
  352. package/es/components/NumberInput/variations/_shape/base.js +0 -5
  353. package/es/components/NumberInput/variations/_shape/base.js.map +0 -1
  354. package/es/components/NumberInput/variations/_shape/base_k05biw.css +0 -1
  355. package/es/components/NumberInput/variations/_size/base.js +0 -5
  356. package/es/components/NumberInput/variations/_size/base.js.map +0 -1
  357. package/es/components/NumberInput/variations/_size/base_yqdmk4.css +0 -1
  358. package/es/components/NumberInput/variations/_view/base.js +0 -5
  359. package/es/components/NumberInput/variations/_view/base.js.map +0 -1
  360. package/es/components/NumberInput/variations/_view/base_3gefjm.css +0 -1
  361. package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +0 -98
  362. package/es/components/Slider/components/Single/Single.styles_1h7n2s2.css +0 -6
  363. package/es/components/Slider/components/SliderBase/SliderBase.styles_1qt1224.css +0 -5
  364. package/es/components/Slider/ui/Handler/Handler.styles_irtcgm.css +0 -2
  365. package/es/components/Slider/ui/Handler/computeKeyPressData.js +0 -118
  366. package/es/components/Slider/ui/Handler/computeKeyPressData.js.map +0 -1
  367. package/es/components/Slider/ui/Thumb/Thumb.styles_uyn20e.css +0 -1
  368. package/es/components/Slider/variations/_view/base_1s3f6q8.css +0 -1
  369. package/styled-components/cjs/components/NumberInput/NumberInput.js +0 -193
  370. package/styled-components/cjs/components/NumberInput/NumberInput.styles.js +0 -8
  371. package/styled-components/cjs/components/NumberInput/NumberInput.tokens.js +0 -90
  372. package/styled-components/cjs/components/NumberInput/NumberInput.types.js +0 -5
  373. package/styled-components/cjs/components/NumberInput/index.js +0 -31
  374. package/styled-components/cjs/components/NumberInput/ui/ActionButton/ActionButton.js +0 -18
  375. package/styled-components/cjs/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -15
  376. package/styled-components/cjs/components/NumberInput/ui/ActionButton/ActionButton.types.js +0 -5
  377. package/styled-components/cjs/components/NumberInput/ui/Input/Input.js +0 -207
  378. package/styled-components/cjs/components/NumberInput/ui/Input/Input.styles.js +0 -48
  379. package/styled-components/cjs/components/NumberInput/ui/Input/Input.types.js +0 -5
  380. package/styled-components/cjs/components/NumberInput/ui/index.js +0 -19
  381. package/styled-components/cjs/components/NumberInput/utils/index.js +0 -7
  382. package/styled-components/cjs/components/NumberInput/variations/_background-type/base.js +0 -10
  383. package/styled-components/cjs/components/NumberInput/variations/_background-type/tokens.json +0 -6
  384. package/styled-components/cjs/components/NumberInput/variations/_disabled/base.js +0 -9
  385. package/styled-components/cjs/components/NumberInput/variations/_disabled/tokens.json +0 -4
  386. package/styled-components/cjs/components/NumberInput/variations/_segmentation/base.js +0 -12
  387. package/styled-components/cjs/components/NumberInput/variations/_segmentation/tokens.json +0 -1
  388. package/styled-components/cjs/components/NumberInput/variations/_shape/base.js +0 -11
  389. package/styled-components/cjs/components/NumberInput/variations/_shape/tokens.json +0 -1
  390. package/styled-components/cjs/components/NumberInput/variations/_size/base.js +0 -13
  391. package/styled-components/cjs/components/NumberInput/variations/_size/tokens.json +0 -22
  392. package/styled-components/cjs/components/NumberInput/variations/_view/base.js +0 -13
  393. package/styled-components/cjs/components/NumberInput/variations/_view/tokens.json +0 -14
  394. package/styled-components/cjs/components/Slider/ui/Handler/computeKeyPressData.js +0 -121
  395. package/styled-components/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.config.js +0 -46
  396. package/styled-components/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.js +0 -11
  397. package/styled-components/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.stories.tsx +0 -108
  398. package/styled-components/cjs/examples/plasma_web/components/NumberInput/NumberInput.config.js +0 -46
  399. package/styled-components/cjs/examples/plasma_web/components/NumberInput/NumberInput.js +0 -11
  400. package/styled-components/cjs/examples/plasma_web/components/NumberInput/NumberInput.stories.tsx +0 -108
  401. package/styled-components/es/components/NumberInput/NumberInput.js +0 -185
  402. package/styled-components/es/components/NumberInput/NumberInput.styles.js +0 -2
  403. package/styled-components/es/components/NumberInput/NumberInput.tokens.js +0 -84
  404. package/styled-components/es/components/NumberInput/NumberInput.types.js +0 -1
  405. package/styled-components/es/components/NumberInput/index.js +0 -2
  406. package/styled-components/es/components/NumberInput/ui/ActionButton/ActionButton.js +0 -11
  407. package/styled-components/es/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -8
  408. package/styled-components/es/components/NumberInput/ui/ActionButton/ActionButton.types.js +0 -1
  409. package/styled-components/es/components/NumberInput/ui/Input/Input.js +0 -198
  410. package/styled-components/es/components/NumberInput/ui/Input/Input.styles.js +0 -41
  411. package/styled-components/es/components/NumberInput/ui/Input/Input.types.js +0 -1
  412. package/styled-components/es/components/NumberInput/ui/index.js +0 -2
  413. package/styled-components/es/components/NumberInput/utils/index.js +0 -1
  414. package/styled-components/es/components/NumberInput/variations/_background-type/base.js +0 -4
  415. package/styled-components/es/components/NumberInput/variations/_background-type/tokens.json +0 -6
  416. package/styled-components/es/components/NumberInput/variations/_disabled/base.js +0 -3
  417. package/styled-components/es/components/NumberInput/variations/_disabled/tokens.json +0 -4
  418. package/styled-components/es/components/NumberInput/variations/_segmentation/base.js +0 -6
  419. package/styled-components/es/components/NumberInput/variations/_segmentation/tokens.json +0 -1
  420. package/styled-components/es/components/NumberInput/variations/_shape/base.js +0 -5
  421. package/styled-components/es/components/NumberInput/variations/_shape/tokens.json +0 -1
  422. package/styled-components/es/components/NumberInput/variations/_size/base.js +0 -7
  423. package/styled-components/es/components/NumberInput/variations/_size/tokens.json +0 -22
  424. package/styled-components/es/components/NumberInput/variations/_view/base.js +0 -7
  425. package/styled-components/es/components/NumberInput/variations/_view/tokens.json +0 -14
  426. package/styled-components/es/components/Slider/ui/Handler/computeKeyPressData.js +0 -115
  427. package/styled-components/es/examples/plasma_b2c/components/NumberInput/NumberInput.config.js +0 -40
  428. package/styled-components/es/examples/plasma_b2c/components/NumberInput/NumberInput.js +0 -5
  429. package/styled-components/es/examples/plasma_b2c/components/NumberInput/NumberInput.stories.tsx +0 -108
  430. package/styled-components/es/examples/plasma_web/components/NumberInput/NumberInput.config.js +0 -40
  431. package/styled-components/es/examples/plasma_web/components/NumberInput/NumberInput.js +0 -5
  432. package/styled-components/es/examples/plasma_web/components/NumberInput/NumberInput.stories.tsx +0 -108
  433. package/types/components/NumberInput/NumberInput.d.ts +0 -38
  434. package/types/components/NumberInput/NumberInput.d.ts.map +0 -1
  435. package/types/components/NumberInput/NumberInput.styles.d.ts +0 -2
  436. package/types/components/NumberInput/NumberInput.styles.d.ts.map +0 -1
  437. package/types/components/NumberInput/NumberInput.tokens.d.ts +0 -79
  438. package/types/components/NumberInput/NumberInput.tokens.d.ts.map +0 -1
  439. package/types/components/NumberInput/NumberInput.types.d.ts +0 -112
  440. package/types/components/NumberInput/NumberInput.types.d.ts.map +0 -1
  441. package/types/components/NumberInput/index.d.ts +0 -3
  442. package/types/components/NumberInput/index.d.ts.map +0 -1
  443. package/types/components/NumberInput/ui/ActionButton/ActionButton.d.ts +0 -4
  444. package/types/components/NumberInput/ui/ActionButton/ActionButton.d.ts.map +0 -1
  445. package/types/components/NumberInput/ui/ActionButton/ActionButton.styles.d.ts +0 -45
  446. package/types/components/NumberInput/ui/ActionButton/ActionButton.styles.d.ts.map +0 -1
  447. package/types/components/NumberInput/ui/ActionButton/ActionButton.types.d.ts +0 -7
  448. package/types/components/NumberInput/ui/ActionButton/ActionButton.types.d.ts.map +0 -1
  449. package/types/components/NumberInput/ui/Input/Input.d.ts +0 -16
  450. package/types/components/NumberInput/ui/Input/Input.d.ts.map +0 -1
  451. package/types/components/NumberInput/ui/Input/Input.styles.d.ts +0 -30
  452. package/types/components/NumberInput/ui/Input/Input.styles.d.ts.map +0 -1
  453. package/types/components/NumberInput/ui/Input/Input.types.d.ts +0 -16
  454. package/types/components/NumberInput/ui/Input/Input.types.d.ts.map +0 -1
  455. package/types/components/NumberInput/ui/index.d.ts +0 -3
  456. package/types/components/NumberInput/ui/index.d.ts.map +0 -1
  457. package/types/components/NumberInput/utils/index.d.ts +0 -2
  458. package/types/components/NumberInput/utils/index.d.ts.map +0 -1
  459. package/types/components/NumberInput/variations/_background-type/base.d.ts +0 -2
  460. package/types/components/NumberInput/variations/_background-type/base.d.ts.map +0 -1
  461. package/types/components/NumberInput/variations/_disabled/base.d.ts +0 -2
  462. package/types/components/NumberInput/variations/_disabled/base.d.ts.map +0 -1
  463. package/types/components/NumberInput/variations/_segmentation/base.d.ts +0 -2
  464. package/types/components/NumberInput/variations/_segmentation/base.d.ts.map +0 -1
  465. package/types/components/NumberInput/variations/_shape/base.d.ts +0 -2
  466. package/types/components/NumberInput/variations/_shape/base.d.ts.map +0 -1
  467. package/types/components/NumberInput/variations/_size/base.d.ts +0 -2
  468. package/types/components/NumberInput/variations/_size/base.d.ts.map +0 -1
  469. package/types/components/NumberInput/variations/_view/base.d.ts +0 -2
  470. package/types/components/NumberInput/variations/_view/base.d.ts.map +0 -1
  471. package/types/components/Slider/ui/Handler/computeKeyPressData.d.ts +0 -12
  472. package/types/components/Slider/ui/Handler/computeKeyPressData.d.ts.map +0 -1
  473. package/types/examples/plasma_b2c/components/NumberInput/NumberInput.config.d.ts +0 -39
  474. package/types/examples/plasma_b2c/components/NumberInput/NumberInput.config.d.ts.map +0 -1
  475. package/types/examples/plasma_b2c/components/NumberInput/NumberInput.d.ts +0 -82
  476. package/types/examples/plasma_b2c/components/NumberInput/NumberInput.d.ts.map +0 -1
  477. package/types/examples/plasma_web/components/NumberInput/NumberInput.config.d.ts +0 -39
  478. package/types/examples/plasma_web/components/NumberInput/NumberInput.config.d.ts.map +0 -1
  479. package/types/examples/plasma_web/components/NumberInput/NumberInput.d.ts +0 -82
  480. package/types/examples/plasma_web/components/NumberInput/NumberInput.d.ts.map +0 -1
  481. /package/cjs/components/{NumberInput/ui/ActionButton/ActionButton.styles_x642ct.css → Slider/variations/_view/base_x642ct.css} +0 -0
  482. /package/es/components/{NumberInput/ui/ActionButton/ActionButton.styles_x642ct.css → Slider/variations/_view/base_x642ct.css} +0 -0
@@ -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", "labelContent", "sliderAlign", "showScale", "showRangeValues", "showCurrentValue", "hideMinValueDiff", "hideMaxValueDiff", "labelPlacement", "rangeValuesPlacement", "scaleAlign", "multipleStepSize", "defaultValue", "size", "name", "pointerSize", "orientation", "reversed", "labelReversed"];
2
+ var _excluded = ["min", "max", "value", "disabled", "onChangeCommitted", "onChange", "ariaLabel", "label", "labelContentLeft", "showRangeValues", "showCurrentValue", "hideMinValueDiff", "hideMaxValueDiff", "labelPlacement", "rangeValuesPlacement", "multipleStepSize", "defaultValue", "size", "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; }
@@ -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, LabelContent, LabelWrapper, SingleWrapper, SliderBaseWrapper, StyledRangeValue } from './Single.styles';
24
+ import { Label, LabelContentLeft, 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,35 +33,23 @@ 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,
40
36
  showRangeValues = _ref.showRangeValues,
41
37
  showCurrentValue = _ref.showCurrentValue,
42
38
  hideMinValueDiff = _ref.hideMinValueDiff,
43
39
  hideMaxValueDiff = _ref.hideMaxValueDiff,
44
40
  _ref$labelPlacement = _ref.labelPlacement,
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,
41
+ labelPlacement = _ref$labelPlacement === void 0 ? 'outer' : _ref$labelPlacement,
42
+ _ref$rangeValuesPlace = _ref.rangeValuesPlacement,
43
+ rangeValuesPlacement = _ref$rangeValuesPlace === void 0 ? 'outer' : _ref$rangeValuesPlace,
49
44
  _ref$multipleStepSize = _ref.multipleStepSize,
50
45
  multipleStepSize = _ref$multipleStepSize === void 0 ? 10 : _ref$multipleStepSize,
51
46
  defaultValue = _ref.defaultValue,
52
47
  _ref$size = _ref.size,
53
48
  size = _ref$size === void 0 ? 'm' : _ref$size,
54
49
  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,
61
50
  rest = _objectWithoutProperties(_ref, _excluded);
62
- var isVertical = orientation === 'vertical';
63
51
  var _useState = useState({
64
- handlePosition: 0,
52
+ xHandle: 0,
65
53
  stepSize: 0,
66
54
  railFillWidth: 0
67
55
  }),
@@ -77,28 +65,23 @@ export var SingleSlider = function SingleSlider(_ref) {
77
65
  _useState6 = _slicedToArray(_useState5, 2),
78
66
  endOffset = _useState6[0],
79
67
  setEndOffset = _useState6[1];
80
- var innerValue = (_ref2 = value !== null && value !== void 0 ? value : defaultValue) !== null && _ref2 !== void 0 ? _ref2 : min;
81
- var _useState7 = useState(innerValue),
68
+ var _useState7 = useState((_ref2 = value !== null && value !== void 0 ? value : defaultValue) !== null && _ref2 !== void 0 ? _ref2 : min),
82
69
  _useState8 = _slicedToArray(_useState7, 2),
83
70
  dragValue = _useState8[0],
84
71
  setDragValue = _useState8[1];
85
72
  var stepSize = state.stepSize;
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;
73
+ var hasLabelContent = label || labelContentLeft;
74
+ var labelPlacementClass = labelPlacement === 'outer' ? classes.labelPlacementOuter : classes.labelPlacementInner;
75
+ var rangeValuesPlacementClass = rangeValuesPlacement === 'outer' ? classes.rangeValuesPlacementOuter : classes.rangeValuesPlacementInner;
91
76
  var hideMinValueDiffClass = hideMinValueDiff && dragValue - min <= hideMinValueDiff ? classes.hideMinValue : '';
92
77
  var hideMaxValueDiffClass = hideMaxValueDiff && max - dragValue <= hideMaxValueDiff ? classes.hideMaxValue : '';
93
- var verticalOrientationClass = orientation === 'vertical' ? classes.verticalOrientation : '';
94
78
  var startLabelRef = useRef(null);
95
79
  var endLabelRef = useRef(null);
96
80
  var activeFirstValue = dragValue === min ? classes.activeRangeValue : undefined;
97
81
  var activeSecondValue = dragValue === max ? classes.activeRangeValue : undefined;
98
82
  useEffect(function () {
99
- var visibleValue = reversed ? max - dragValue + min : dragValue;
100
- var localValue = Math.min(Math.max(visibleValue, min), max) - min;
101
- if (!isVertical && rangeValuesPlacement === 'outer') {
83
+ var localValue = Math.min(Math.max(dragValue, min), max) - min;
84
+ if (rangeValuesPlacement === 'outer') {
102
85
  var _startLabelRef$curren, _endLabelRef$current;
103
86
  var startWidth = (_startLabelRef$curren = startLabelRef.current) === null || _startLabelRef$curren === void 0 ? void 0 : _startLabelRef$curren.offsetWidth;
104
87
  if (isNumber(startWidth)) {
@@ -108,35 +91,30 @@ export var SingleSlider = function SingleSlider(_ref) {
108
91
  if (isNumber(endWidth)) {
109
92
  setEndOffset(Number(endWidth));
110
93
  }
111
- } else if (isVertical && innerShowScale && sliderAlign !== 'center') {
112
- setStartOffset(12);
113
- setEndOffset(12);
114
94
  } else {
115
95
  setStartOffset(1);
116
96
  setEndOffset(1);
117
97
  }
118
98
  setState(function (prevState) {
119
99
  return _objectSpread(_objectSpread({}, prevState), {}, {
120
- handlePosition: stepSize * localValue,
100
+ xHandle: stepSize * localValue,
121
101
  railFillWidth: stepSize * localValue
122
102
  });
123
103
  });
124
- }, [dragValue, innerShowScale, labelPlacement, stepSize, rangeValuesPlacement, min, max, isVertical, reversed,
125
- // для перерасчета размеров
126
- sliderAlign, size]);
104
+ }, [dragValue, labelPlacement, stepSize, rangeValuesPlacement, min, max, setStartOffset, setEndOffset]);
127
105
  var setStepSize = useCallback(function (newStepSize) {
128
106
  setState(function (prevState) {
129
107
  return _objectSpread(_objectSpread({}, prevState), {}, {
130
108
  stepSize: newStepSize
131
109
  });
132
110
  });
133
- }, []);
111
+ }, [setState]);
134
112
  var onHandleChange = function onHandleChange(handleValue, data) {
135
- var newValue = Math.round(reversed ? max - handleValue + min : handleValue);
136
- var newHandlePosition = isVertical ? data.y : data.x;
113
+ var newHandleXPosition = data.x;
114
+ var newValue = Math.round(handleValue);
137
115
  setState(function (prevState) {
138
116
  return _objectSpread(_objectSpread({}, prevState), {}, {
139
- railFillWidth: newHandlePosition
117
+ railFillWidth: newHandleXPosition
140
118
  });
141
119
  });
142
120
  if (onChange) {
@@ -154,49 +132,41 @@ export var SingleSlider = function SingleSlider(_ref) {
154
132
  }
155
133
  setDragValue(newValue);
156
134
  };
157
- var onHandleChangeCommitted = useCallback(function (handleValue, data) {
158
- var newValue = Math.round(reversed ? max - handleValue + min : handleValue);
135
+ var onHandleChangeCommitted = function onHandleChangeCommitted(handleValue, data) {
136
+ var newValue = Math.round(handleValue);
159
137
  if (onChangeCommitted) {
160
138
  onChangeCommitted(newValue);
161
139
  }
162
140
  setState(function (prevState) {
163
141
  return _objectSpread(_objectSpread({}, prevState), {}, {
164
- handlePosition: isVertical ? data.lastY : data.lastX,
165
- railFillWidth: isVertical ? data.lastY : data.lastX
142
+ xHandle: data.lastX,
143
+ railFillWidth: data.lastX
166
144
  });
167
145
  });
168
146
  setDragValue(newValue);
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'];
147
+ };
173
148
  return /*#__PURE__*/React.createElement(SingleWrapper, {
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, {
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, {
178
153
  ref: startLabelRef,
179
154
  className: cx(hideMinValueDiffClass, activeFirstValue)
180
- }, reversed ? max : min), /*#__PURE__*/React.createElement(SliderBase, _extends({
155
+ }, min), /*#__PURE__*/React.createElement(SliderBase, _extends({
181
156
  min: min,
182
157
  max: max,
183
158
  disabled: disabled,
184
- size: size,
185
- sliderAlign: sliderAlign,
186
159
  setStepSize: setStepSize,
187
160
  onChange: onHandleChangeCommitted,
188
161
  railFillWidth: state.railFillWidth,
189
- settings: settings,
162
+ settings: sizeData[size],
190
163
  labelPlacement: labelPlacement,
191
- rangeValuesPlacement: rangeValuesPlacement,
192
- orientation: orientation
164
+ rangeValuesPlacement: rangeValuesPlacement
193
165
  }, rest), /*#__PURE__*/React.createElement(Handler, {
194
- size: pointerSize,
195
- orientation: orientation,
196
166
  stepSize: state.stepSize,
197
167
  onChangeCommitted: onHandleChangeCommitted,
198
168
  onChange: onHandleChange,
199
- position: state.handlePosition,
169
+ xPosition: state.xHandle,
200
170
  min: min,
201
171
  max: max,
202
172
  startOffset: startOffset,
@@ -205,12 +175,11 @@ export var SingleSlider = function SingleSlider(_ref) {
205
175
  disabled: disabled,
206
176
  ariaLabel: ariaLabel,
207
177
  multipleStepSize: multipleStepSize,
208
- showCurrentValue: showCurrentValue,
209
- valuePlacement: valuePlacement
210
- })), innerShowScale && /*#__PURE__*/React.createElement(StyledRangeValue, {
178
+ showCurrentValue: showCurrentValue
179
+ })), showRangeValues && /*#__PURE__*/React.createElement(StyledRangeValue, {
211
180
  ref: endLabelRef,
212
181
  className: cx(classes.maxRangeValue, hideMaxValueDiffClass, activeSecondValue)
213
- }, reversed ? min : max)), /*#__PURE__*/React.createElement(InputHidden, _extends({
182
+ }, max)), /*#__PURE__*/React.createElement(InputHidden, _extends({
214
183
  name: name,
215
184
  type: "number",
216
185
  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 LabelContent = /*#__PURE__*/styled.div.withConfig({
6
+ export var LabelContentLeft = /*#__PURE__*/styled.div.withConfig({
7
7
  componentId: "plasma-new-hope__sc-1qm4elt-1"
8
- })(["display:inline-flex;"]);
8
+ })([""]);
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.valueFontFamily, tokens.valueFontSize, tokens.valueFontStyle, tokens.valueFontWeight, tokens.valueLetterSpacing, tokens.valueLineHeight, 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.rangeValueFontFamily, tokens.rangeValueFontSize, tokens.rangeValueFontStyle, tokens.rangeValueFontWeight, tokens.rangeValueLetterSpacing, tokens.rangeValueLineHeight, 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: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);
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);
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(", ");}}&.", "{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);
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);
@@ -1,7 +1,5 @@
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';
5
3
  import { Fill, Rail, RailWrap, Slider } from './SliderBase.styles';
6
4
  export var SliderBase = function SliderBase(_ref) {
7
5
  var max = _ref.max,
@@ -15,9 +13,6 @@ export var SliderBase = function SliderBase(_ref) {
15
13
  labelPlacement = _ref.labelPlacement,
16
14
  rangeValuesPlacement = _ref.rangeValuesPlacement,
17
15
  onChange = _ref.onChange,
18
- orientation = _ref.orientation,
19
- size = _ref.size,
20
- sliderAlign = _ref.sliderAlign,
21
16
  _ref$settings = _ref.settings,
22
17
  settings = _ref$settings === void 0 ? {} : _ref$settings;
23
18
  var _settings$indent = settings.indent,
@@ -26,43 +21,34 @@ export var SliderBase = function SliderBase(_ref) {
26
21
  fontSizeMultiplier = _settings$fontSizeMul === void 0 ? 16 : _settings$fontSizeMul;
27
22
  var ref = useRef(null);
28
23
  var gap = indent * fontSizeMultiplier * 2;
29
- var isVertical = orientation === 'vertical';
30
24
  useEffect(function () {
31
25
  var resizeHandler = function resizeHandler() {
32
26
  if (ref.current) {
33
- var railSize = isVertical ? ref.current.offsetHeight - gap : ref.current.offsetWidth - gap;
27
+ var railSize = ref.current.offsetWidth - gap;
34
28
  var totalSteps = max - min;
35
29
  setStepSize(railSize / totalSteps);
36
30
  }
37
31
  };
38
32
  resizeHandler();
39
- }, [labelPlacement, rangeValuesPlacement, gap, isVertical,
40
- // для перерасчета размеров
41
- size, sliderAlign]);
33
+ }, [labelPlacement, rangeValuesPlacement]);
42
34
  var onHandleChange = function onHandleChange(e) {
43
35
  if (!onChange || disabled) {
44
36
  return;
45
37
  }
46
38
  var _e$currentTarget$getB = e.currentTarget.getBoundingClientRect(),
47
39
  x = _e$currentTarget$getB.x,
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);
40
+ width = _e$currentTarget$getB.width;
41
+ var lastX = e.clientX - x;
42
+ var position = min + lastX / (width - gap) * (max - min);
54
43
  var result = Math.max(min, Math.min(max, position));
55
- var data = isVertical ? {
56
- lastY: lastPos
57
- } : {
58
- lastX: lastPos
59
- };
60
- onChange(result, data);
44
+ onChange(result, {
45
+ lastX: lastX
46
+ });
61
47
  };
62
48
  useIsomorphicLayoutEffect(function () {
63
49
  var resizeHandler = function resizeHandler() {
64
50
  if (ref.current) {
65
- var railSize = isVertical ? ref.current.offsetHeight - gap : ref.current.offsetWidth - gap;
51
+ var railSize = ref.current.offsetWidth - gap;
66
52
  var totalSteps = max - min;
67
53
  setStepSize(railSize / totalSteps);
68
54
  }
@@ -72,18 +58,13 @@ export var SliderBase = function SliderBase(_ref) {
72
58
  return function () {
73
59
  return window.removeEventListener('resize', resizeHandler);
74
60
  };
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
- } : {
61
+ }, [min, max, setStepSize, gap, labelPlacement, rangeValuesPlacement]);
62
+ var fillStyle = {
81
63
  left: "".concat(railFillXPosition, "px"),
82
64
  width: "".concat(railFillWidth, "px")
83
65
  };
84
66
  return /*#__PURE__*/React.createElement(Slider, {
85
- ref: ref,
86
- className: cx(orientation === 'vertical' && classes.verticalOrientation)
67
+ ref: ref
87
68
  }, /*#__PURE__*/React.createElement(RailWrap, {
88
69
  "aria-hidden": "true",
89
70
  onMouseDown: onHandleChange
@@ -1,15 +1,15 @@
1
1
  import styled from 'styled-components';
2
2
  import { applyHidden } from '../../../../mixins';
3
- import { classes, tokens } from '../../Slider.tokens';
4
- export var Rail = /*#__PURE__*/styled.div.withConfig({
5
- componentId: "plasma-new-hope__sc-ik0bjb-0"
6
- })(["position:relative;top:50%;height:var(", ");border-radius:var(", ");background-color:var(", ");overflow:hidden;transform:translateY(-50%);"], tokens.railThickness, tokens.railBorderRadius, tokens.railBackgroundColor);
3
+ import { tokens } from '../../Slider.tokens';
7
4
  export var Slider = /*#__PURE__*/styled.div.withConfig({
8
- componentId: "plasma-new-hope__sc-ik0bjb-1"
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);
5
+ componentId: "plasma-new-hope__sc-ik0bjb-0"
6
+ })(["flex:1;position:relative;user-select:none;height:var(", ");"], tokens.height);
10
7
  export var RailWrap = /*#__PURE__*/styled.div.withConfig({
11
- componentId: "plasma-new-hope__sc-ik0bjb-2"
8
+ componentId: "plasma-new-hope__sc-ik0bjb-1"
12
9
  })(["height:100%;"]);
10
+ export var Rail = /*#__PURE__*/styled.div.withConfig({
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);
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);
@@ -1,9 +1,5 @@
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 = ["size", "orientation", "stepSize", "onChangeCommitted", "onChange", "position", "min", "max", "bounds", "zIndex", "disabled", "side", "showCurrentValue", "startOffset", "endOffset", "value", "valuePlacement"];
1
+ var _excluded = ["stepSize", "onChangeCommitted", "onChange", "xPosition", "min", "max", "bounds", "zIndex", "disabled", "side", "showCurrentValue", "startOffset", "endOffset", "value"];
3
2
  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
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
3
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
4
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
5
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -14,23 +10,28 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
14
10
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
15
11
  import React, { useRef, forwardRef } from 'react';
16
12
  import Draggable from 'react-draggable';
17
- import { cx } from '../../../../utils';
18
13
  import { getSliderThumbValue, getOffsets } from '../../utils';
19
14
  import { Thumb } from '../Thumb/Thumb';
20
- import { classes } from '../../Slider.tokens';
21
15
  import { HandlerStyled, StyledValue } from './Handler.styles';
22
- import { computeKeyPressData } from './computeKeyPressData';
23
16
 
24
17
  // TODO: PLASMA-1707
25
18
 
19
+ var KeyboardSupport = {
20
+ PageUp: 33,
21
+ PageDown: 34,
22
+ End: 35,
23
+ Home: 36,
24
+ ArrowLeft: 37,
25
+ ArrowUp: 38,
26
+ ArrowRight: 39,
27
+ ArrowDown: 40
28
+ };
26
29
  export var Handler = /*#__PURE__*/forwardRef(function (_ref, ref) {
27
- var size = _ref.size,
28
- orientation = _ref.orientation,
29
- stepSize = _ref.stepSize,
30
+ var stepSize = _ref.stepSize,
30
31
  onChangeCommitted = _ref.onChangeCommitted,
31
32
  onChange = _ref.onChange,
32
- _ref$position = _ref.position,
33
- position = _ref$position === void 0 ? 0 : _ref$position,
33
+ _ref$xPosition = _ref.xPosition,
34
+ xPosition = _ref$xPosition === void 0 ? 0 : _ref$xPosition,
34
35
  min = _ref.min,
35
36
  max = _ref.max,
36
37
  _ref$bounds = _ref.bounds,
@@ -45,88 +46,122 @@ export var Handler = /*#__PURE__*/forwardRef(function (_ref, ref) {
45
46
  _ref$endOffset = _ref.endOffset,
46
47
  endOffset = _ref$endOffset === void 0 ? 0 : _ref$endOffset,
47
48
  value = _ref.value,
48
- valuePlacement = _ref.valuePlacement,
49
49
  rest = _objectWithoutProperties(_ref, _excluded);
50
- var isVertical = orientation === 'vertical';
51
50
  var lastOnChangeValue = useRef();
52
- var _getOffsets = getOffsets(ref, side, isVertical),
51
+ var _getOffsets = getOffsets(ref, side),
53
52
  _getOffsets2 = _slicedToArray(_getOffsets, 2),
54
- startClientOffset = _getOffsets2[0],
55
- endClientOffset = _getOffsets2[1];
53
+ offsetLeft = _getOffsets2[0],
54
+ offsetRight = _getOffsets2[1];
56
55
  var _bounds = _slicedToArray(bounds, 2),
57
- startValueBound = _bounds[0],
58
- endValueBound = _bounds[1];
59
- var startPositionBound = startValueBound ? (startValueBound - min) * stepSize : null;
60
- var endPositionBound = endValueBound ? (endValueBound - min) * stepSize : null;
61
- var dragPosition = typeof position === 'number' ? {
62
- x: isVertical ? 0 : position,
63
- y: isVertical ? position : 0
56
+ leftValueBound = _bounds[0],
57
+ rightValueBound = _bounds[1];
58
+ var leftPositionBound = leftValueBound ? (leftValueBound - min) * stepSize : null;
59
+ var rightPositionBound = rightValueBound ? (rightValueBound - min) * stepSize : null;
60
+ var position = typeof xPosition === 'number' ? {
61
+ x: xPosition,
62
+ y: 0
64
63
  } : undefined;
65
64
  var tabIndex = disabled ? -1 : 0;
66
- var computedBounds = _defineProperty(_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));
67
- var showCurrentValueCondition = showCurrentValue && (position >= startOffset && position <= max * stepSize - endOffset || position === 0 && value !== 0);
65
+ var computedBounds = {
66
+ left: (leftPositionBound !== null && leftPositionBound !== void 0 ? leftPositionBound : 0) - (offsetLeft ? stepSize : 0),
67
+ right: (rightPositionBound !== null && rightPositionBound !== void 0 ? rightPositionBound : stepSize * (max - min)) - (offsetRight ? stepSize : 0)
68
+ };
69
+ var showCurrentValueCondition = showCurrentValue && (xPosition >= startOffset && xPosition <= max * stepSize - endOffset || xPosition === 0 && value !== 0);
68
70
  var onDrag = function onDrag(_, data) {
69
- var newValue = getSliderThumbValue(isVertical ? data.y : data.x, stepSize, min, max);
71
+ var newValue = getSliderThumbValue(data.x, stepSize, min, max);
70
72
  if (lastOnChangeValue.current !== newValue) {
71
73
  onChange === null || onChange === void 0 || onChange(newValue, data);
72
74
  lastOnChangeValue.current = newValue;
73
75
  }
74
76
  };
75
77
  var onStop = function onStop(_, data) {
76
- var newValue = getSliderThumbValue(isVertical ? data.y : data.x, stepSize, min, max);
78
+ var newValue = getSliderThumbValue(data.x, stepSize, min, max);
77
79
  onChangeCommitted && onChangeCommitted(newValue, data);
78
80
  };
79
81
  var onKeyPress = function onKeyPress(event) {
80
82
  event.persist();
81
- var computedMultipleSteps = stepSize * (rest.multipleStepSize / 100 * max);
82
- var data = computeKeyPressData(event, {
83
- isVertical: isVertical,
84
- stepSize: stepSize,
85
- position: position,
86
- max: max,
87
- computedMultipleSteps: computedMultipleSteps
88
- });
89
- if (!data) {
83
+ var keyCode = event.keyCode,
84
+ target = event.target;
85
+ if (!Object.values(KeyboardSupport).includes(keyCode)) {
90
86
  return;
91
87
  }
88
+ var ArrowUp = KeyboardSupport.ArrowUp,
89
+ ArrowRight = KeyboardSupport.ArrowRight,
90
+ ArrowDown = KeyboardSupport.ArrowDown,
91
+ ArrowLeft = KeyboardSupport.ArrowLeft,
92
+ Home = KeyboardSupport.Home,
93
+ End = KeyboardSupport.End,
94
+ PageDown = KeyboardSupport.PageDown,
95
+ PageUp = KeyboardSupport.PageUp;
96
+ var computedMultipleSteps = stepSize * (rest.multipleStepSize / 100 * max);
97
+ var data = {
98
+ x: 0,
99
+ deltaX: stepSize,
100
+ lastX: xPosition,
101
+ y: 0,
102
+ deltaY: 0,
103
+ lastY: 0,
104
+ node: target
105
+ };
106
+ switch (keyCode) {
107
+ case ArrowUp:
108
+ case ArrowRight:
109
+ data.x = xPosition + stepSize;
110
+ break;
111
+ case ArrowDown:
112
+ case ArrowLeft:
113
+ data.x = xPosition - stepSize;
114
+ data.deltaX = -stepSize;
115
+ break;
116
+ case PageUp:
117
+ data.x = xPosition + computedMultipleSteps;
118
+ data.deltaX = computedMultipleSteps;
119
+ break;
120
+ case PageDown:
121
+ data.x = xPosition - computedMultipleSteps;
122
+ data.deltaX = -computedMultipleSteps;
123
+ break;
124
+ case End:
125
+ data.x = max * stepSize;
126
+ break;
127
+ case Home:
128
+ data.x = 0;
129
+ break;
130
+ default:
131
+ data.x = 0;
132
+ }
92
133
  var left = computedBounds.left,
93
- right = computedBounds.right,
94
- top = computedBounds.top,
95
- bottom = computedBounds.bottom;
134
+ right = computedBounds.right;
96
135
 
97
136
  /*
98
137
  * INFO: Находим значение в диапазоне между указанными левой и правой границами.
99
- * Или между верхней и нижней
100
138
  * Необходимо для правильного расчета положения SliderThumb.
101
139
  * см. функция clamp
102
140
  */
103
- var boundedValue = isVertical ? Math.max(Math.min(bottom, data.y), top) : Math.max(Math.min(right, data.x), left);
141
+ var boundedValue = Math.max(Math.min(right, data.x), left);
104
142
  var computedValue = getSliderThumbValue(boundedValue, stepSize, min, max);
105
143
  lastOnChangeValue.current = computedValue;
106
144
  onChangeCommitted && onChangeCommitted(computedValue, data);
107
145
  };
108
146
  return /*#__PURE__*/React.createElement(Draggable, {
109
- axis: isVertical ? 'y' : 'x',
147
+ axis: "x",
110
148
  bounds: computedBounds,
111
- grid: isVertical ? [1, stepSize] : [stepSize, 1],
149
+ grid: [stepSize, 1],
112
150
  onStop: onStop,
113
151
  onDrag: onDrag,
114
- position: dragPosition,
152
+ position: position,
115
153
  disabled: disabled
116
154
  }, /*#__PURE__*/React.createElement(HandlerStyled, {
117
155
  ref: ref,
118
156
  style: {
119
157
  zIndex: zIndex
120
158
  },
121
- className: cx(isVertical && classes.verticalOrientation, valuePlacement === 'left' && classes.valuePlacementLeft),
122
- isLarge: size === 'large',
123
159
  onKeyDown: onKeyPress
124
- }, size !== 'none' && /*#__PURE__*/React.createElement(Thumb, _extends({
160
+ }, /*#__PURE__*/React.createElement(Thumb, _extends({
125
161
  tabIndex: tabIndex,
126
162
  min: min,
127
163
  max: max,
128
164
  value: value,
129
- disabled: disabled,
130
- orientation: orientation
165
+ disabled: disabled
131
166
  }, rest)), showCurrentValueCondition && /*#__PURE__*/React.createElement(StyledValue, null, value)));
132
167
  });
@@ -1,11 +1,8 @@
1
1
  import styled from 'styled-components';
2
- import { classes, tokens } from '../../Slider.tokens';
3
- export var StyledValue = /*#__PURE__*/styled.span.withConfig({
4
- componentId: "plasma-new-hope__sc-a1py3c-0"
5
- })(["position:absolute;z-index:1;top:var(", ");text-align:center;width:100%;margin-left:-0.125rem;display:flex;justify-content:center;font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");"], tokens.currentValueTopOffset, tokens.valueFontFamily, tokens.valueFontSize, tokens.valueFontStyle, tokens.valueFontWeight, tokens.valueLetterSpacing, tokens.valueLineHeight);
2
+ import { tokens } from '../../Slider.tokens';
6
3
  export var HandlerStyled = /*#__PURE__*/styled.div.withConfig({
4
+ componentId: "plasma-new-hope__sc-a1py3c-0"
5
+ })(["cursor:pointer;position:absolute;z-index:1;top:0;left:0;"]);
6
+ export var StyledValue = /*#__PURE__*/styled.span.withConfig({
7
7
  componentId: "plasma-new-hope__sc-a1py3c-1"
8
- })(["cursor:pointer;position:absolute;z-index:1;top:0;left:0;bottom:0;display:flex;align-items:center;justify-content:center;--thumb-size:", ";&.", "{right:0;bottom:auto;align-items:flex-start;justify-content:center;", "{margin:0;top:0;bottom:0;right:0;left:calc(var(", ") - (var(", ") - var(--thumb-size)) / 2 + 0.25rem);align-items:center;justify-content:flex-start;}}&.", "{", "{left:auto;right:calc(var(", ") - (var(", ") - var(--thumb-size)) / 2 + 0.3125rem);justify-content:flex-end;}}"], function (_ref) {
9
- var isLarge = _ref.isLarge;
10
- return isLarge ? "var(".concat(tokens.thumbSizeLarge, ")") : "var(".concat(tokens.thumbSize, ")");
11
- }, classes.verticalOrientation, StyledValue, tokens.size, tokens.size, classes.valuePlacementLeft, StyledValue, tokens.size, tokens.size);
8
+ })(["position:absolute;z-index:1;top:var(", ");text-align:center;width:100%;margin-left:-0.125rem;display:flex;justify-content:center;font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");"], tokens.currentValueTopOffset, tokens.currentValueFontFamily, tokens.currentValueFontSize, tokens.currentValueFontStyle, tokens.currentValueFontWeight, tokens.currentValueLetterSpacing, tokens.currentValueLineHeight);
@@ -1,4 +1,4 @@
1
- var _excluded = ["min", "max", "value", "ariaValueMin", "ariaLabel", "disabled", "orientation"];
1
+ var _excluded = ["min", "max", "value", "ariaValueMin", "ariaLabel", "disabled"];
2
2
  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); }
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -12,7 +12,6 @@ export var Thumb = function Thumb(_ref) {
12
12
  ariaValueMin = _ref$ariaValueMin === void 0 ? min : _ref$ariaValueMin,
13
13
  ariaLabel = _ref.ariaLabel,
14
14
  disabled = _ref.disabled,
15
- orientation = _ref.orientation,
16
15
  rest = _objectWithoutProperties(_ref, _excluded);
17
16
  return /*#__PURE__*/React.createElement(ThumbBase, _extends({
18
17
  role: "slider",
@@ -21,6 +20,6 @@ export var Thumb = function Thumb(_ref) {
21
20
  "aria-valuemax": max,
22
21
  "aria-valuenow": value,
23
22
  disabled: disabled,
24
- "aria-orientation": orientation
23
+ "aria-orientation": "horizontal"
25
24
  }, rest));
26
25
  };
@@ -3,8 +3,8 @@ import { addFocus } from '../../../../mixins';
3
3
  import { tokens } from '../../Slider.tokens';
4
4
  export var ThumbBase = /*#__PURE__*/styled.div.withConfig({
5
5
  componentId: "plasma-new-hope__sc-13botku-0"
6
- })(["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(", ");margin:0.0625rem;transition:border-color 0.1s ease-in-out;&:after{background:var(", ");margin:-0.0625rem;content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;}&:not([disabled]):hover:after,&:not([disabled]):active:after{background:var(", ");}&[disabled]{cursor:not-allowed;}&:focus{outline:none;}", ""], tokens.thumbBackgroundColor, tokens.thumbBorderColor, tokens.thumbFocusBorderColor, /*#__PURE__*/addFocus({
7
- outlineOffset: '0.0625rem',
6
+ })(["width:var(", ");height:var(", ");position:relative;left:-0.125rem;top:-0.125rem;border-radius:50%;box-sizing:border-box;background:var(", ");margin:0.125rem;transition:border-color 0.1s ease-in-out;&:after{background:var(", ");margin:-0.125rem;content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;}&:not([disabled]):hover:after,&:not([disabled]):active:after{background:var(", ");}&[disabled]{cursor:not-allowed;}&:focus{outline:none;}", ""], tokens.thumbSize, tokens.thumbSize, tokens.thumbBackgroundColor, tokens.thumbBorderColor, tokens.thumbFocusBorderColor, /*#__PURE__*/addFocus({
7
+ outlineOffset: '0.125rem',
8
8
  outlineSize: '0.125rem',
9
9
  outlineRadius: '50%',
10
10
  outlineColor: /*#__PURE__*/"var(".concat(tokens.thumbFocusBorderColor, ")")