@salutejs/plasma-new-hope 0.187.0-canary.1511.11742976604.0 → 0.187.0-canary.1539.11742294440.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (370) hide show
  1. package/cjs/components/Switch/Switch.css +11 -7
  2. package/cjs/components/Switch/Switch.js +16 -7
  3. package/cjs/components/Switch/Switch.js.map +1 -1
  4. package/cjs/components/Switch/Switch.styles.js +16 -4
  5. package/cjs/components/Switch/Switch.styles.js.map +1 -1
  6. package/cjs/components/Switch/Switch.styles_bei7bh.css +6 -0
  7. package/cjs/components/Switch/Switch.tokens.js +11 -0
  8. package/cjs/components/Switch/Switch.tokens.js.map +1 -1
  9. package/cjs/components/Switch/_focused/base.js +1 -1
  10. package/cjs/components/Switch/_focused/{base_j4murk.css → base_sz3n0x.css} +1 -1
  11. package/cjs/components/Switch/_size/base.js +1 -1
  12. package/cjs/components/Switch/_size/base.js.map +1 -1
  13. package/cjs/components/Switch/_size/base_1tcl212.css +1 -0
  14. package/cjs/components/{NumberInput/variations/_background-type → Switch/_toggleSize}/base.js +2 -2
  15. package/cjs/components/Switch/_toggleSize/base.js.map +1 -0
  16. package/cjs/components/Switch/_toggleSize/base_6i0904.css +1 -0
  17. package/cjs/components/Switch/_view/base.js +1 -1
  18. package/cjs/components/Switch/_view/base.js.map +1 -1
  19. package/cjs/components/Switch/_view/base_yxkf3s.css +1 -0
  20. package/cjs/index.css +11 -30
  21. package/cjs/index.js +0 -6
  22. package/cjs/index.js.map +1 -1
  23. package/emotion/cjs/components/Switch/Switch.js +17 -8
  24. package/emotion/cjs/components/Switch/Switch.styles.js +21 -5
  25. package/emotion/cjs/components/Switch/Switch.template-doc.mdx +37 -1
  26. package/emotion/cjs/components/Switch/Switch.tokens.js +11 -0
  27. package/emotion/cjs/components/Switch/_size/base.js +1 -1
  28. package/emotion/cjs/components/Switch/_toggleSize/base.js +10 -0
  29. package/emotion/cjs/components/Switch/_view/base.js +1 -1
  30. package/emotion/cjs/examples/plasma_b2c/components/Switch/Switch.config.js +11 -4
  31. package/emotion/cjs/examples/plasma_b2c/components/Switch/Switch.stories.tsx +7 -1
  32. package/emotion/cjs/examples/plasma_web/components/Switch/Switch.config.js +11 -4
  33. package/emotion/cjs/examples/plasma_web/components/Switch/Switch.stories.tsx +14 -1
  34. package/emotion/cjs/index.js +0 -11
  35. package/emotion/es/components/Switch/Switch.js +13 -4
  36. package/emotion/es/components/Switch/Switch.styles.js +20 -4
  37. package/emotion/es/components/Switch/Switch.template-doc.mdx +37 -1
  38. package/emotion/es/components/Switch/Switch.tokens.js +11 -0
  39. package/emotion/es/components/Switch/_size/base.js +2 -2
  40. package/emotion/es/components/Switch/_toggleSize/base.js +4 -0
  41. package/emotion/es/components/Switch/_view/base.js +2 -2
  42. package/emotion/es/examples/plasma_b2c/components/Switch/Switch.config.js +11 -4
  43. package/emotion/es/examples/plasma_b2c/components/Switch/Switch.stories.tsx +7 -1
  44. package/emotion/es/examples/plasma_web/components/Switch/Switch.config.js +11 -4
  45. package/emotion/es/examples/plasma_web/components/Switch/Switch.stories.tsx +14 -1
  46. package/emotion/es/index.js +1 -2
  47. package/es/components/Switch/Switch.css +11 -7
  48. package/es/components/Switch/Switch.js +17 -8
  49. package/es/components/Switch/Switch.js.map +1 -1
  50. package/es/components/Switch/Switch.styles.js +15 -5
  51. package/es/components/Switch/Switch.styles.js.map +1 -1
  52. package/es/components/Switch/Switch.styles_bei7bh.css +6 -0
  53. package/es/components/Switch/Switch.tokens.js +11 -0
  54. package/es/components/Switch/Switch.tokens.js.map +1 -1
  55. package/es/components/Switch/_focused/base.js +1 -1
  56. package/es/components/Switch/_focused/{base_j4murk.css → base_sz3n0x.css} +1 -1
  57. package/es/components/Switch/_size/base.js +1 -1
  58. package/es/components/Switch/_size/base.js.map +1 -1
  59. package/es/components/Switch/_size/base_1tcl212.css +1 -0
  60. package/es/components/{NumberInput/variations/_shape → Switch/_toggleSize}/base.js +2 -2
  61. package/es/components/Switch/_toggleSize/base.js.map +1 -0
  62. package/es/components/Switch/_toggleSize/base_6i0904.css +1 -0
  63. package/es/components/Switch/_view/base.js +1 -1
  64. package/es/components/Switch/_view/base.js.map +1 -1
  65. package/es/components/Switch/_view/base_yxkf3s.css +1 -0
  66. package/es/index.css +11 -30
  67. package/es/index.js +0 -2
  68. package/es/index.js.map +1 -1
  69. package/package.json +2 -2
  70. package/styled-components/cjs/components/Switch/Switch.js +17 -8
  71. package/styled-components/cjs/components/Switch/Switch.styles.js +11 -5
  72. package/styled-components/cjs/components/Switch/Switch.template-doc.mdx +37 -1
  73. package/styled-components/cjs/components/Switch/Switch.tokens.js +11 -0
  74. package/styled-components/cjs/components/Switch/_size/base.js +1 -1
  75. package/styled-components/cjs/components/Switch/_toggleSize/base.js +10 -0
  76. package/styled-components/cjs/components/Switch/_view/base.js +1 -1
  77. package/styled-components/cjs/examples/plasma_b2c/components/Switch/Switch.config.js +9 -2
  78. package/styled-components/cjs/examples/plasma_b2c/components/Switch/Switch.stories.tsx +7 -1
  79. package/styled-components/cjs/examples/plasma_web/components/Switch/Switch.config.js +9 -2
  80. package/styled-components/cjs/examples/plasma_web/components/Switch/Switch.stories.tsx +14 -1
  81. package/styled-components/cjs/index.js +0 -11
  82. package/styled-components/es/components/Switch/Switch.js +13 -4
  83. package/styled-components/es/components/Switch/Switch.styles.js +10 -4
  84. package/styled-components/es/components/Switch/Switch.template-doc.mdx +37 -1
  85. package/styled-components/es/components/Switch/Switch.tokens.js +11 -0
  86. package/styled-components/es/components/Switch/_size/base.js +2 -2
  87. package/styled-components/es/components/Switch/_toggleSize/base.js +4 -0
  88. package/styled-components/es/components/Switch/_view/base.js +2 -2
  89. package/styled-components/es/examples/plasma_b2c/components/Switch/Switch.config.js +9 -2
  90. package/styled-components/es/examples/plasma_b2c/components/Switch/Switch.stories.tsx +7 -1
  91. package/styled-components/es/examples/plasma_web/components/Switch/Switch.config.js +9 -2
  92. package/styled-components/es/examples/plasma_web/components/Switch/Switch.stories.tsx +14 -1
  93. package/styled-components/es/index.js +1 -2
  94. package/types/components/Switch/Switch.d.ts +3 -0
  95. package/types/components/Switch/Switch.d.ts.map +1 -1
  96. package/types/components/Switch/Switch.styles.d.ts +2 -0
  97. package/types/components/Switch/Switch.styles.d.ts.map +1 -1
  98. package/types/components/Switch/Switch.tokens.d.ts +9 -0
  99. package/types/components/Switch/Switch.tokens.d.ts.map +1 -1
  100. package/types/components/Switch/Switch.types.d.ts +10 -2
  101. package/types/components/Switch/Switch.types.d.ts.map +1 -1
  102. package/types/components/Switch/_size/base.d.ts.map +1 -1
  103. package/types/components/Switch/_toggleSize/base.d.ts.map +1 -0
  104. package/types/components/Switch/_view/base.d.ts.map +1 -1
  105. package/types/examples/plasma_b2c/components/Switch/Switch.config.d.ts +7 -0
  106. package/types/examples/plasma_b2c/components/Switch/Switch.config.d.ts.map +1 -1
  107. package/types/examples/plasma_b2c/components/Switch/Switch.d.ts +6 -0
  108. package/types/examples/plasma_b2c/components/Switch/Switch.d.ts.map +1 -1
  109. package/types/examples/plasma_web/components/Switch/Switch.config.d.ts +7 -0
  110. package/types/examples/plasma_web/components/Switch/Switch.config.d.ts.map +1 -1
  111. package/types/examples/plasma_web/components/Switch/Switch.d.ts +6 -0
  112. package/types/examples/plasma_web/components/Switch/Switch.d.ts.map +1 -1
  113. package/types/index.d.ts +0 -1
  114. package/types/index.d.ts.map +1 -1
  115. package/cjs/components/NumberInput/NumberInput.css +0 -52
  116. package/cjs/components/NumberInput/NumberInput.js +0 -205
  117. package/cjs/components/NumberInput/NumberInput.js.map +0 -1
  118. package/cjs/components/NumberInput/NumberInput.styles.js +0 -9
  119. package/cjs/components/NumberInput/NumberInput.styles.js.map +0 -1
  120. package/cjs/components/NumberInput/NumberInput.styles_jeawjl.css +0 -1
  121. package/cjs/components/NumberInput/NumberInput.tokens.js +0 -102
  122. package/cjs/components/NumberInput/NumberInput.tokens.js.map +0 -1
  123. package/cjs/components/NumberInput/ui/ActionButton/ActionButton.js +0 -19
  124. package/cjs/components/NumberInput/ui/ActionButton/ActionButton.js.map +0 -1
  125. package/cjs/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -22
  126. package/cjs/components/NumberInput/ui/ActionButton/ActionButton.styles.js.map +0 -1
  127. package/cjs/components/NumberInput/ui/ActionButton/ActionButton.styles_x642ct.css +0 -1
  128. package/cjs/components/NumberInput/ui/Input/Input.css +0 -15
  129. package/cjs/components/NumberInput/ui/Input/Input.js +0 -205
  130. package/cjs/components/NumberInput/ui/Input/Input.js.map +0 -1
  131. package/cjs/components/NumberInput/ui/Input/Input.styles.js +0 -96
  132. package/cjs/components/NumberInput/ui/Input/Input.styles.js.map +0 -1
  133. package/cjs/components/NumberInput/ui/Input/Input.styles_fhgb95.css +0 -8
  134. package/cjs/components/NumberInput/utils/index.js +0 -12
  135. package/cjs/components/NumberInput/utils/index.js.map +0 -1
  136. package/cjs/components/NumberInput/variations/_background-type/base.js.map +0 -1
  137. package/cjs/components/NumberInput/variations/_background-type/base_dx9knv.css +0 -1
  138. package/cjs/components/NumberInput/variations/_disabled/base.js +0 -9
  139. package/cjs/components/NumberInput/variations/_disabled/base.js.map +0 -1
  140. package/cjs/components/NumberInput/variations/_disabled/base_1sl0mh8.css +0 -1
  141. package/cjs/components/NumberInput/variations/_segmentation/base.js +0 -9
  142. package/cjs/components/NumberInput/variations/_segmentation/base.js.map +0 -1
  143. package/cjs/components/NumberInput/variations/_segmentation/base_14s5rot.css +0 -1
  144. package/cjs/components/NumberInput/variations/_shape/base.js +0 -9
  145. package/cjs/components/NumberInput/variations/_shape/base.js.map +0 -1
  146. package/cjs/components/NumberInput/variations/_shape/base_k05biw.css +0 -1
  147. package/cjs/components/NumberInput/variations/_size/base.js +0 -9
  148. package/cjs/components/NumberInput/variations/_size/base.js.map +0 -1
  149. package/cjs/components/NumberInput/variations/_size/base_yqdmk4.css +0 -1
  150. package/cjs/components/NumberInput/variations/_view/base.js +0 -9
  151. package/cjs/components/NumberInput/variations/_view/base.js.map +0 -1
  152. package/cjs/components/NumberInput/variations/_view/base_tnfbb5.css +0 -1
  153. package/cjs/components/Switch/Switch.styles_1kk0qzz.css +0 -4
  154. package/cjs/components/Switch/_size/base_1rjzpi4.css +0 -1
  155. package/cjs/components/Switch/_view/base_1mtyz12.css +0 -1
  156. package/emotion/cjs/components/NumberInput/NumberInput.js +0 -214
  157. package/emotion/cjs/components/NumberInput/NumberInput.styles.js +0 -17
  158. package/emotion/cjs/components/NumberInput/NumberInput.template-doc.mdx +0 -214
  159. package/emotion/cjs/components/NumberInput/NumberInput.tokens.js +0 -99
  160. package/emotion/cjs/components/NumberInput/NumberInput.types.js +0 -5
  161. package/emotion/cjs/components/NumberInput/index.js +0 -31
  162. package/emotion/cjs/components/NumberInput/ui/ActionButton/ActionButton.js +0 -18
  163. package/emotion/cjs/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -16
  164. package/emotion/cjs/components/NumberInput/ui/ActionButton/ActionButton.types.js +0 -5
  165. package/emotion/cjs/components/NumberInput/ui/Input/Input.js +0 -213
  166. package/emotion/cjs/components/NumberInput/ui/Input/Input.styles.js +0 -81
  167. package/emotion/cjs/components/NumberInput/ui/Input/Input.types.js +0 -5
  168. package/emotion/cjs/components/NumberInput/ui/index.js +0 -19
  169. package/emotion/cjs/components/NumberInput/utils/index.js +0 -9
  170. package/emotion/cjs/components/NumberInput/variations/_background-type/base.js +0 -10
  171. package/emotion/cjs/components/NumberInput/variations/_background-type/tokens.json +0 -6
  172. package/emotion/cjs/components/NumberInput/variations/_disabled/base.js +0 -9
  173. package/emotion/cjs/components/NumberInput/variations/_disabled/tokens.json +0 -4
  174. package/emotion/cjs/components/NumberInput/variations/_segmentation/base.js +0 -12
  175. package/emotion/cjs/components/NumberInput/variations/_segmentation/tokens.json +0 -1
  176. package/emotion/cjs/components/NumberInput/variations/_shape/base.js +0 -11
  177. package/emotion/cjs/components/NumberInput/variations/_shape/tokens.json +0 -1
  178. package/emotion/cjs/components/NumberInput/variations/_size/base.js +0 -13
  179. package/emotion/cjs/components/NumberInput/variations/_size/tokens.json +0 -22
  180. package/emotion/cjs/components/NumberInput/variations/_view/base.js +0 -13
  181. package/emotion/cjs/components/NumberInput/variations/_view/tokens.json +0 -14
  182. package/emotion/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.config.js +0 -46
  183. package/emotion/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.js +0 -11
  184. package/emotion/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.stories.tsx +0 -108
  185. package/emotion/cjs/examples/plasma_web/components/NumberInput/NumberInput.config.js +0 -46
  186. package/emotion/cjs/examples/plasma_web/components/NumberInput/NumberInput.js +0 -11
  187. package/emotion/cjs/examples/plasma_web/components/NumberInput/NumberInput.stories.tsx +0 -108
  188. package/emotion/es/components/NumberInput/NumberInput.js +0 -206
  189. package/emotion/es/components/NumberInput/NumberInput.styles.js +0 -11
  190. package/emotion/es/components/NumberInput/NumberInput.template-doc.mdx +0 -214
  191. package/emotion/es/components/NumberInput/NumberInput.tokens.js +0 -93
  192. package/emotion/es/components/NumberInput/NumberInput.types.js +0 -1
  193. package/emotion/es/components/NumberInput/index.js +0 -2
  194. package/emotion/es/components/NumberInput/ui/ActionButton/ActionButton.js +0 -11
  195. package/emotion/es/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -9
  196. package/emotion/es/components/NumberInput/ui/ActionButton/ActionButton.types.js +0 -1
  197. package/emotion/es/components/NumberInput/ui/Input/Input.js +0 -204
  198. package/emotion/es/components/NumberInput/ui/Input/Input.styles.js +0 -74
  199. package/emotion/es/components/NumberInput/ui/Input/Input.types.js +0 -1
  200. package/emotion/es/components/NumberInput/ui/index.js +0 -2
  201. package/emotion/es/components/NumberInput/utils/index.js +0 -3
  202. package/emotion/es/components/NumberInput/variations/_background-type/base.js +0 -4
  203. package/emotion/es/components/NumberInput/variations/_background-type/tokens.json +0 -6
  204. package/emotion/es/components/NumberInput/variations/_disabled/base.js +0 -3
  205. package/emotion/es/components/NumberInput/variations/_disabled/tokens.json +0 -4
  206. package/emotion/es/components/NumberInput/variations/_segmentation/base.js +0 -6
  207. package/emotion/es/components/NumberInput/variations/_segmentation/tokens.json +0 -1
  208. package/emotion/es/components/NumberInput/variations/_shape/base.js +0 -5
  209. package/emotion/es/components/NumberInput/variations/_shape/tokens.json +0 -1
  210. package/emotion/es/components/NumberInput/variations/_size/base.js +0 -7
  211. package/emotion/es/components/NumberInput/variations/_size/tokens.json +0 -22
  212. package/emotion/es/components/NumberInput/variations/_view/base.js +0 -7
  213. package/emotion/es/components/NumberInput/variations/_view/tokens.json +0 -14
  214. package/emotion/es/examples/plasma_b2c/components/NumberInput/NumberInput.config.js +0 -40
  215. package/emotion/es/examples/plasma_b2c/components/NumberInput/NumberInput.js +0 -5
  216. package/emotion/es/examples/plasma_b2c/components/NumberInput/NumberInput.stories.tsx +0 -108
  217. package/emotion/es/examples/plasma_web/components/NumberInput/NumberInput.config.js +0 -40
  218. package/emotion/es/examples/plasma_web/components/NumberInput/NumberInput.js +0 -5
  219. package/emotion/es/examples/plasma_web/components/NumberInput/NumberInput.stories.tsx +0 -108
  220. package/es/components/NumberInput/NumberInput.css +0 -52
  221. package/es/components/NumberInput/NumberInput.js +0 -200
  222. package/es/components/NumberInput/NumberInput.js.map +0 -1
  223. package/es/components/NumberInput/NumberInput.styles.js +0 -5
  224. package/es/components/NumberInput/NumberInput.styles.js.map +0 -1
  225. package/es/components/NumberInput/NumberInput.styles_jeawjl.css +0 -1
  226. package/es/components/NumberInput/NumberInput.tokens.js +0 -96
  227. package/es/components/NumberInput/NumberInput.tokens.js.map +0 -1
  228. package/es/components/NumberInput/ui/ActionButton/ActionButton.js +0 -15
  229. package/es/components/NumberInput/ui/ActionButton/ActionButton.js.map +0 -1
  230. package/es/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -18
  231. package/es/components/NumberInput/ui/ActionButton/ActionButton.styles.js.map +0 -1
  232. package/es/components/NumberInput/ui/ActionButton/ActionButton.styles_x642ct.css +0 -1
  233. package/es/components/NumberInput/ui/Input/Input.css +0 -15
  234. package/es/components/NumberInput/ui/Input/Input.js +0 -201
  235. package/es/components/NumberInput/ui/Input/Input.js.map +0 -1
  236. package/es/components/NumberInput/ui/Input/Input.styles.js +0 -85
  237. package/es/components/NumberInput/ui/Input/Input.styles.js.map +0 -1
  238. package/es/components/NumberInput/ui/Input/Input.styles_fhgb95.css +0 -8
  239. package/es/components/NumberInput/utils/index.js +0 -6
  240. package/es/components/NumberInput/utils/index.js.map +0 -1
  241. package/es/components/NumberInput/variations/_background-type/base.js +0 -5
  242. package/es/components/NumberInput/variations/_background-type/base.js.map +0 -1
  243. package/es/components/NumberInput/variations/_background-type/base_dx9knv.css +0 -1
  244. package/es/components/NumberInput/variations/_disabled/base.js +0 -5
  245. package/es/components/NumberInput/variations/_disabled/base.js.map +0 -1
  246. package/es/components/NumberInput/variations/_disabled/base_1sl0mh8.css +0 -1
  247. package/es/components/NumberInput/variations/_segmentation/base.js +0 -5
  248. package/es/components/NumberInput/variations/_segmentation/base.js.map +0 -1
  249. package/es/components/NumberInput/variations/_segmentation/base_14s5rot.css +0 -1
  250. package/es/components/NumberInput/variations/_shape/base.js.map +0 -1
  251. package/es/components/NumberInput/variations/_shape/base_k05biw.css +0 -1
  252. package/es/components/NumberInput/variations/_size/base.js +0 -5
  253. package/es/components/NumberInput/variations/_size/base.js.map +0 -1
  254. package/es/components/NumberInput/variations/_size/base_yqdmk4.css +0 -1
  255. package/es/components/NumberInput/variations/_view/base.js +0 -5
  256. package/es/components/NumberInput/variations/_view/base.js.map +0 -1
  257. package/es/components/NumberInput/variations/_view/base_tnfbb5.css +0 -1
  258. package/es/components/Switch/Switch.styles_1kk0qzz.css +0 -4
  259. package/es/components/Switch/_size/base_1rjzpi4.css +0 -1
  260. package/es/components/Switch/_view/base_1mtyz12.css +0 -1
  261. package/styled-components/cjs/components/NumberInput/NumberInput.js +0 -214
  262. package/styled-components/cjs/components/NumberInput/NumberInput.styles.js +0 -8
  263. package/styled-components/cjs/components/NumberInput/NumberInput.template-doc.mdx +0 -214
  264. package/styled-components/cjs/components/NumberInput/NumberInput.tokens.js +0 -99
  265. package/styled-components/cjs/components/NumberInput/NumberInput.types.js +0 -5
  266. package/styled-components/cjs/components/NumberInput/index.js +0 -31
  267. package/styled-components/cjs/components/NumberInput/ui/ActionButton/ActionButton.js +0 -18
  268. package/styled-components/cjs/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -15
  269. package/styled-components/cjs/components/NumberInput/ui/ActionButton/ActionButton.types.js +0 -5
  270. package/styled-components/cjs/components/NumberInput/ui/Input/Input.js +0 -213
  271. package/styled-components/cjs/components/NumberInput/ui/Input/Input.styles.js +0 -48
  272. package/styled-components/cjs/components/NumberInput/ui/Input/Input.types.js +0 -5
  273. package/styled-components/cjs/components/NumberInput/ui/index.js +0 -19
  274. package/styled-components/cjs/components/NumberInput/utils/index.js +0 -9
  275. package/styled-components/cjs/components/NumberInput/variations/_background-type/base.js +0 -10
  276. package/styled-components/cjs/components/NumberInput/variations/_background-type/tokens.json +0 -6
  277. package/styled-components/cjs/components/NumberInput/variations/_disabled/base.js +0 -9
  278. package/styled-components/cjs/components/NumberInput/variations/_disabled/tokens.json +0 -4
  279. package/styled-components/cjs/components/NumberInput/variations/_segmentation/base.js +0 -12
  280. package/styled-components/cjs/components/NumberInput/variations/_segmentation/tokens.json +0 -1
  281. package/styled-components/cjs/components/NumberInput/variations/_shape/base.js +0 -11
  282. package/styled-components/cjs/components/NumberInput/variations/_shape/tokens.json +0 -1
  283. package/styled-components/cjs/components/NumberInput/variations/_size/base.js +0 -13
  284. package/styled-components/cjs/components/NumberInput/variations/_size/tokens.json +0 -22
  285. package/styled-components/cjs/components/NumberInput/variations/_view/base.js +0 -13
  286. package/styled-components/cjs/components/NumberInput/variations/_view/tokens.json +0 -14
  287. package/styled-components/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.config.js +0 -46
  288. package/styled-components/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.js +0 -11
  289. package/styled-components/cjs/examples/plasma_b2c/components/NumberInput/NumberInput.stories.tsx +0 -108
  290. package/styled-components/cjs/examples/plasma_web/components/NumberInput/NumberInput.config.js +0 -46
  291. package/styled-components/cjs/examples/plasma_web/components/NumberInput/NumberInput.js +0 -11
  292. package/styled-components/cjs/examples/plasma_web/components/NumberInput/NumberInput.stories.tsx +0 -108
  293. package/styled-components/es/components/NumberInput/NumberInput.js +0 -206
  294. package/styled-components/es/components/NumberInput/NumberInput.styles.js +0 -2
  295. package/styled-components/es/components/NumberInput/NumberInput.template-doc.mdx +0 -214
  296. package/styled-components/es/components/NumberInput/NumberInput.tokens.js +0 -93
  297. package/styled-components/es/components/NumberInput/NumberInput.types.js +0 -1
  298. package/styled-components/es/components/NumberInput/index.js +0 -2
  299. package/styled-components/es/components/NumberInput/ui/ActionButton/ActionButton.js +0 -11
  300. package/styled-components/es/components/NumberInput/ui/ActionButton/ActionButton.styles.js +0 -8
  301. package/styled-components/es/components/NumberInput/ui/ActionButton/ActionButton.types.js +0 -1
  302. package/styled-components/es/components/NumberInput/ui/Input/Input.js +0 -204
  303. package/styled-components/es/components/NumberInput/ui/Input/Input.styles.js +0 -41
  304. package/styled-components/es/components/NumberInput/ui/Input/Input.types.js +0 -1
  305. package/styled-components/es/components/NumberInput/ui/index.js +0 -2
  306. package/styled-components/es/components/NumberInput/utils/index.js +0 -3
  307. package/styled-components/es/components/NumberInput/variations/_background-type/base.js +0 -4
  308. package/styled-components/es/components/NumberInput/variations/_background-type/tokens.json +0 -6
  309. package/styled-components/es/components/NumberInput/variations/_disabled/base.js +0 -3
  310. package/styled-components/es/components/NumberInput/variations/_disabled/tokens.json +0 -4
  311. package/styled-components/es/components/NumberInput/variations/_segmentation/base.js +0 -6
  312. package/styled-components/es/components/NumberInput/variations/_segmentation/tokens.json +0 -1
  313. package/styled-components/es/components/NumberInput/variations/_shape/base.js +0 -5
  314. package/styled-components/es/components/NumberInput/variations/_shape/tokens.json +0 -1
  315. package/styled-components/es/components/NumberInput/variations/_size/base.js +0 -7
  316. package/styled-components/es/components/NumberInput/variations/_size/tokens.json +0 -22
  317. package/styled-components/es/components/NumberInput/variations/_view/base.js +0 -7
  318. package/styled-components/es/components/NumberInput/variations/_view/tokens.json +0 -14
  319. package/styled-components/es/examples/plasma_b2c/components/NumberInput/NumberInput.config.js +0 -40
  320. package/styled-components/es/examples/plasma_b2c/components/NumberInput/NumberInput.js +0 -5
  321. package/styled-components/es/examples/plasma_b2c/components/NumberInput/NumberInput.stories.tsx +0 -108
  322. package/styled-components/es/examples/plasma_web/components/NumberInput/NumberInput.config.js +0 -40
  323. package/styled-components/es/examples/plasma_web/components/NumberInput/NumberInput.js +0 -5
  324. package/styled-components/es/examples/plasma_web/components/NumberInput/NumberInput.stories.tsx +0 -108
  325. package/types/components/NumberInput/NumberInput.d.ts +0 -38
  326. package/types/components/NumberInput/NumberInput.d.ts.map +0 -1
  327. package/types/components/NumberInput/NumberInput.styles.d.ts +0 -2
  328. package/types/components/NumberInput/NumberInput.styles.d.ts.map +0 -1
  329. package/types/components/NumberInput/NumberInput.tokens.d.ts +0 -88
  330. package/types/components/NumberInput/NumberInput.tokens.d.ts.map +0 -1
  331. package/types/components/NumberInput/NumberInput.types.d.ts +0 -112
  332. package/types/components/NumberInput/NumberInput.types.d.ts.map +0 -1
  333. package/types/components/NumberInput/index.d.ts +0 -3
  334. package/types/components/NumberInput/index.d.ts.map +0 -1
  335. package/types/components/NumberInput/ui/ActionButton/ActionButton.d.ts +0 -4
  336. package/types/components/NumberInput/ui/ActionButton/ActionButton.d.ts.map +0 -1
  337. package/types/components/NumberInput/ui/ActionButton/ActionButton.styles.d.ts +0 -45
  338. package/types/components/NumberInput/ui/ActionButton/ActionButton.styles.d.ts.map +0 -1
  339. package/types/components/NumberInput/ui/ActionButton/ActionButton.types.d.ts +0 -7
  340. package/types/components/NumberInput/ui/ActionButton/ActionButton.types.d.ts.map +0 -1
  341. package/types/components/NumberInput/ui/Input/Input.d.ts +0 -19
  342. package/types/components/NumberInput/ui/Input/Input.d.ts.map +0 -1
  343. package/types/components/NumberInput/ui/Input/Input.styles.d.ts +0 -30
  344. package/types/components/NumberInput/ui/Input/Input.styles.d.ts.map +0 -1
  345. package/types/components/NumberInput/ui/Input/Input.types.d.ts +0 -19
  346. package/types/components/NumberInput/ui/Input/Input.types.d.ts.map +0 -1
  347. package/types/components/NumberInput/ui/index.d.ts +0 -3
  348. package/types/components/NumberInput/ui/index.d.ts.map +0 -1
  349. package/types/components/NumberInput/utils/index.d.ts +0 -4
  350. package/types/components/NumberInput/utils/index.d.ts.map +0 -1
  351. package/types/components/NumberInput/variations/_background-type/base.d.ts.map +0 -1
  352. package/types/components/NumberInput/variations/_disabled/base.d.ts +0 -2
  353. package/types/components/NumberInput/variations/_disabled/base.d.ts.map +0 -1
  354. package/types/components/NumberInput/variations/_segmentation/base.d.ts +0 -2
  355. package/types/components/NumberInput/variations/_segmentation/base.d.ts.map +0 -1
  356. package/types/components/NumberInput/variations/_shape/base.d.ts +0 -2
  357. package/types/components/NumberInput/variations/_shape/base.d.ts.map +0 -1
  358. package/types/components/NumberInput/variations/_size/base.d.ts +0 -2
  359. package/types/components/NumberInput/variations/_size/base.d.ts.map +0 -1
  360. package/types/components/NumberInput/variations/_view/base.d.ts +0 -2
  361. package/types/components/NumberInput/variations/_view/base.d.ts.map +0 -1
  362. package/types/examples/plasma_b2c/components/NumberInput/NumberInput.config.d.ts +0 -39
  363. package/types/examples/plasma_b2c/components/NumberInput/NumberInput.config.d.ts.map +0 -1
  364. package/types/examples/plasma_b2c/components/NumberInput/NumberInput.d.ts +0 -82
  365. package/types/examples/plasma_b2c/components/NumberInput/NumberInput.d.ts.map +0 -1
  366. package/types/examples/plasma_web/components/NumberInput/NumberInput.config.d.ts +0 -39
  367. package/types/examples/plasma_web/components/NumberInput/NumberInput.config.d.ts.map +0 -1
  368. package/types/examples/plasma_web/components/NumberInput/NumberInput.d.ts +0 -82
  369. package/types/examples/plasma_web/components/NumberInput/NumberInput.d.ts.map +0 -1
  370. /package/types/components/{NumberInput/variations/_background-type → Switch/_toggleSize}/base.d.ts +0 -0
@@ -18,7 +18,43 @@ import { Switch } from '@salutejs/{{ package }}';
18
18
 
19
19
  export function App() {
20
20
  return (
21
- <Switch label="Переключатель" defaultChecked />
21
+ <Switch description="Описание переключателя" label="Переключатель" defaultChecked />
22
+ );
23
+ }
24
+ ```
25
+
26
+ ## Примеры
27
+
28
+ ### Размер Switch
29
+ Размер компонента задается с помощью свойства `size`.
30
+
31
+ ```tsx live
32
+ import React from 'react';
33
+ import { Button } from '@salutejs/{{ package }}';
34
+
35
+ export function App() {
36
+ return (
37
+ <div>
38
+ <Switch size="s" description="Описание переключателя" label="Переключатель" defaultChecked />
39
+ <Switch size="m" description="Описание переключателя" label="Переключатель" defaultChecked />
40
+ <Switch size="l" description="Описание переключателя" label="Переключатель" defaultChecked />
41
+ </div>
42
+ );
43
+ }
44
+ ```
45
+
46
+ Размер переключателя задается с помощью свойства `toggleSize`.
47
+
48
+ ```tsx live
49
+ import React from 'react';
50
+ import { Button } from '@salutejs/{{ package }}';
51
+
52
+ export function App() {
53
+ return (
54
+ <div style=\{{ alignItems: "center" }}>
55
+ <Switch toggleSize="s" label="Переключатель" defaultChecked />
56
+ <Switch toggleSize="l" label="Переключатель" defaultChecked />
57
+ </div>
22
58
  );
23
59
  }
24
60
  ```
@@ -11,11 +11,22 @@ var tokens = exports.tokens = {
11
11
  fontWeight: '--plasma-switch-font-weight',
12
12
  letterSpacing: '--plasma-switch-letter-spacing',
13
13
  lineHeight: '--plasma-switch-line-height',
14
+ /* Токены description */
15
+ descriptionFontFamily: '--plasma-switch-description-font-family',
16
+ descriptionFontStyle: '--plasma-switch-description-font-style',
17
+ descriptionFontSize: '--plasma-switch-description-font-size',
18
+ descriptionFontWeight: '--plasma-switch-description-font-weight',
19
+ descriptionLetterSpacing: '--plasma-switch-description-letter-spacing',
20
+ descriptionLineHeight: '--plasma-switch-description-line-height',
14
21
  /* Цвет подписи */
15
22
  labelColor: '--plasma-switch__label-color',
16
23
  labelOffset: '--plasma-switch__label-offset',
24
+ /* Цвет описания */
25
+ descriptionColor: '--plasma-switch__description-color',
26
+ descriptionOffset: '--plasma-switch__description-offset',
17
27
  /** Прозрачность для всего компонента в состоянии disabled */
18
28
  disabledOpacity: '--plasma-switch-disabled-opacity',
29
+ verticalGap: '--plasma-switch-vertical-gap',
19
30
  trackWidth: '--plasma-switch__track-width',
20
31
  trackHeight: '--plasma-switch__track-height',
21
32
  trackBorderRadius: '--plasma-switch__track-border-radius',
@@ -7,4 +7,4 @@ exports.base = void 0;
7
7
  var _styledComponents = /*#__PURE__*/require("styled-components");
8
8
  var _Switch = /*#__PURE__*/require("../Switch.tokens");
9
9
  var _Switch2 = /*#__PURE__*/require("../Switch.styles");
10
- var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["font-family:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");font-size:var(", ");", "{flex:0 0 var(", ");width:var(", ");height:var(", ");border-radius:var(", ");&::after{width:var(", ");height:var(", ");border-radius:var(", ");margin:auto var(", ");}}", "{margin:var(", ",0);}:active:not([disabled]) ", "::after{width:calc(var(", ") * var(", ",1));}"], _Switch.tokens.fontFamily, _Switch.tokens.fontStyle, _Switch.tokens.fontWeight, _Switch.tokens.letterSpacing, _Switch.tokens.lineHeight, _Switch.tokens.fontSize, _Switch2.StyledTrigger, _Switch.tokens.trackWidth, _Switch.tokens.trackWidth, _Switch.tokens.trackHeight, _Switch.tokens.trackBorderRadius, _Switch.tokens.thumbSize, _Switch.tokens.thumbSize, _Switch.tokens.thumbBorderRadius, _Switch.tokens.thumbOffset, _Switch2.StyledLabel, _Switch.tokens.labelOffsetPrivate, _Switch2.StyledTrigger, _Switch.tokens.thumbSize, _Switch.tokens.thumbPressScale);
10
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["", "{font-family:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");font-size:var(", ");}", "{font-family:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");font-size:var(", ");}", "{margin:var(", ",0);}"], _Switch2.StyledContent, _Switch.tokens.fontFamily, _Switch.tokens.fontStyle, _Switch.tokens.fontWeight, _Switch.tokens.letterSpacing, _Switch.tokens.lineHeight, _Switch.tokens.fontSize, _Switch2.StyledDescription, _Switch.tokens.descriptionFontFamily, _Switch.tokens.descriptionFontStyle, _Switch.tokens.descriptionFontWeight, _Switch.tokens.descriptionLetterSpacing, _Switch.tokens.descriptionLineHeight, _Switch.tokens.descriptionFontSize, _Switch2.StyledLabel, _Switch.tokens.labelOffsetPrivate);
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.base = void 0;
7
+ var _styledComponents = /*#__PURE__*/require("styled-components");
8
+ var _Switch = /*#__PURE__*/require("../Switch.tokens");
9
+ var _Switch2 = /*#__PURE__*/require("../Switch.styles");
10
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["", "{flex:0 0 var(", ");width:var(", ");height:var(", ");border-radius:var(", ");&::after{width:var(", ");height:var(", ");border-radius:var(", ");margin:auto var(", ");}}:active:not([disabled]) ", "::after{width:calc(var(", ") * var(", ",1));}"], _Switch2.StyledTrigger, _Switch.tokens.trackWidth, _Switch.tokens.trackWidth, _Switch.tokens.trackHeight, _Switch.tokens.trackBorderRadius, _Switch.tokens.thumbSize, _Switch.tokens.thumbSize, _Switch.tokens.thumbBorderRadius, _Switch.tokens.thumbOffset, _Switch2.StyledTrigger, _Switch.tokens.thumbSize, _Switch.tokens.thumbPressScale);
@@ -7,4 +7,4 @@ exports.base = void 0;
7
7
  var _styledComponents = /*#__PURE__*/require("styled-components");
8
8
  var _Switch = /*#__PURE__*/require("../Switch.tokens");
9
9
  var _Switch2 = /*#__PURE__*/require("../Switch.styles");
10
- var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["", "{background-color:var(", ");}", ":not([disabled]) ~ ", ":hover{background-color:var(", ",var(", "));}", ":checked ~ ", "{background-color:var(", ");}", ":checked:not([disabled]) ~ ", ":hover{background-color:var(", ",var(", "));}", "::after{background-color:var(", ");box-shadow:var(", ");}", ":checked ~ ", "::after{box-shadow:var(", ",var(", "));}"], _Switch2.StyledTrigger, _Switch.tokens.trackBackgroundColorOff, _Switch2.StyledInput, _Switch2.StyledTrigger, _Switch.tokens.trackBackgroundColorOffHover, _Switch.tokens.trackBackgroundColorOff, _Switch2.StyledInput, _Switch2.StyledTrigger, _Switch.tokens.trackBackgroundColorOn, _Switch2.StyledInput, _Switch2.StyledTrigger, _Switch.tokens.trackBackgroundColorOnHover, _Switch.tokens.trackBackgroundColorOn, _Switch2.StyledTrigger, _Switch.tokens.thumbBackgroundColor, _Switch.tokens.thumbBoxShadow, _Switch2.StyledInput, _Switch2.StyledTrigger, _Switch.tokens.thumbBoxShadowOn, _Switch.tokens.thumbBoxShadow);
10
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["", "{background-color:var(", ");}", ":not([disabled]) ~ ", ":hover{background-color:var(", ",var(", "));}", ":checked ~ ", "{background-color:var(", ");}", ":checked:not([disabled]) ~ ", ":hover{background-color:var(", ",var(", "));}", "::after{background-color:var(", ");box-shadow:var(", ");}", ":checked ~ ", "::after{box-shadow:var(", ",var(", "));}", "{color:var(", ");}", "{color:var(", ");}"], _Switch2.StyledTrigger, _Switch.tokens.trackBackgroundColorOff, _Switch2.StyledInput, _Switch2.StyledTrigger, _Switch.tokens.trackBackgroundColorOffHover, _Switch.tokens.trackBackgroundColorOff, _Switch2.StyledInput, _Switch2.StyledTrigger, _Switch.tokens.trackBackgroundColorOn, _Switch2.StyledInput, _Switch2.StyledTrigger, _Switch.tokens.trackBackgroundColorOnHover, _Switch.tokens.trackBackgroundColorOn, _Switch2.StyledTrigger, _Switch.tokens.thumbBackgroundColor, _Switch.tokens.thumbBoxShadow, _Switch2.StyledInput, _Switch2.StyledTrigger, _Switch.tokens.thumbBoxShadowOn, _Switch.tokens.thumbBoxShadow, _Switch2.StyledLabel, _Switch.tokens.labelColor, _Switch2.StyledDescription, _Switch.tokens.descriptionColor);
@@ -10,15 +10,22 @@ var config = exports.config = {
10
10
  defaults: {
11
11
  view: 'default',
12
12
  size: 'm',
13
+ toggleSize: 'l',
13
14
  labelPosition: 'before',
14
15
  focused: 'true'
15
16
  },
16
17
  variations: {
17
18
  size: {
18
- m: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-typo-body1-font-family);", ":var(--plasma-typo-body1-font-style);", ":var(--plasma-typo-body1-font-weight);", ":var(--plasma-typo-body1-font-weight);", ":var(--plasma-typo-body1-line-height);", ":var(--plasma-typo-body1-font-size);", ":var(--plasma-typo-body1-letter-spacing);", ":2.75rem;", ":1.75rem;", ":calc(var(", ") / 2);", ":1.5rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;", ":0.75rem;"], _Switch.switchTokens.fontFamily, _Switch.switchTokens.fontStyle, _Switch.switchTokens.fontWeight, _Switch.switchTokens.fontWeight, _Switch.switchTokens.lineHeight, _Switch.switchTokens.fontSize, _Switch.switchTokens.letterSpacing, _Switch.switchTokens.trackWidth, _Switch.switchTokens.trackHeight, _Switch.switchTokens.trackBorderRadius, _Switch.switchTokens.trackHeight, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbBorderRadius, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbOffset, _Switch.switchTokens.thumbPressScale, _Switch.switchTokens.labelOffset)
19
+ s: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-line-height);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], _Switch.switchTokens.fontFamily, _Switch.switchTokens.fontStyle, _Switch.switchTokens.fontWeight, _Switch.switchTokens.lineHeight, _Switch.switchTokens.fontSize, _Switch.switchTokens.letterSpacing, _Switch.switchTokens.descriptionFontFamily, _Switch.switchTokens.descriptionFontStyle, _Switch.switchTokens.descriptionFontWeight, _Switch.switchTokens.descriptionLineHeight, _Switch.switchTokens.descriptionFontSize, _Switch.switchTokens.descriptionLetterSpacing, _Switch.switchTokens.verticalGap, _Switch.switchTokens.labelOffset),
20
+ m: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-line-height);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], _Switch.switchTokens.fontFamily, _Switch.switchTokens.fontStyle, _Switch.switchTokens.fontWeight, _Switch.switchTokens.lineHeight, _Switch.switchTokens.fontSize, _Switch.switchTokens.letterSpacing, _Switch.switchTokens.descriptionFontFamily, _Switch.switchTokens.descriptionFontStyle, _Switch.switchTokens.descriptionFontWeight, _Switch.switchTokens.descriptionLineHeight, _Switch.switchTokens.descriptionFontSize, _Switch.switchTokens.descriptionLetterSpacing, _Switch.switchTokens.verticalGap, _Switch.switchTokens.labelOffset),
21
+ l: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-line-height);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-line-height);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], _Switch.switchTokens.fontFamily, _Switch.switchTokens.fontStyle, _Switch.switchTokens.fontWeight, _Switch.switchTokens.lineHeight, _Switch.switchTokens.fontSize, _Switch.switchTokens.letterSpacing, _Switch.switchTokens.descriptionFontFamily, _Switch.switchTokens.descriptionFontStyle, _Switch.switchTokens.descriptionFontWeight, _Switch.switchTokens.descriptionLineHeight, _Switch.switchTokens.descriptionFontSize, _Switch.switchTokens.descriptionLetterSpacing, _Switch.switchTokens.verticalGap, _Switch.switchTokens.labelOffset)
22
+ },
23
+ toggleSize: {
24
+ l: /*#__PURE__*/(0, _styledComponents.css)(["", ":2.75rem;", ":1.75rem;", ":calc(var(", ") / 2);", ":1.5rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;"], _Switch.switchTokens.trackWidth, _Switch.switchTokens.trackHeight, _Switch.switchTokens.trackBorderRadius, _Switch.switchTokens.trackHeight, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbBorderRadius, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbOffset, _Switch.switchTokens.thumbPressScale),
25
+ s: /*#__PURE__*/(0, _styledComponents.css)(["", ":2rem;", ":1.25rem;", ":calc(var(", ") / 2);", ":1rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;"], _Switch.switchTokens.trackWidth, _Switch.switchTokens.trackHeight, _Switch.switchTokens.trackBorderRadius, _Switch.switchTokens.trackHeight, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbBorderRadius, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbOffset, _Switch.switchTokens.thumbPressScale)
19
26
  },
20
27
  view: {
21
- "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--surface-accent);", ":var(--surface-accent-hover);", ":var(--surface-transparent-tertiary);", ":var(--surface-transparent-tertiary-hover);", ":var(--on-dark-surface-solid-default);", ":0 1px 1px rgba(0,0,0,0.11);"], _Switch.switchTokens.trackBackgroundColorOn, _Switch.switchTokens.trackBackgroundColorOnHover, _Switch.switchTokens.trackBackgroundColorOff, _Switch.switchTokens.trackBackgroundColorOffHover, _Switch.switchTokens.thumbBackgroundColor, _Switch.switchTokens.thumbBoxShadow)
28
+ "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-accent);", ":var(--surface-accent-hover);", ":var(--surface-transparent-tertiary);", ":var(--surface-transparent-tertiary-hover);", ":var(--on-dark-surface-solid-default);", ":0 1px 1px rgba(0,0,0,0.11);"], _Switch.switchTokens.labelColor, _Switch.switchTokens.descriptionColor, _Switch.switchTokens.trackBackgroundColorOn, _Switch.switchTokens.trackBackgroundColorOnHover, _Switch.switchTokens.trackBackgroundColorOff, _Switch.switchTokens.trackBackgroundColorOffHover, _Switch.switchTokens.thumbBackgroundColor, _Switch.switchTokens.thumbBoxShadow)
22
29
  },
23
30
  disabled: {
24
31
  "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _Switch.switchTokens.disabledOpacity)
@@ -18,7 +18,7 @@ const meta: Meta<SwitchProps> = {
18
18
  decorators: [WithTheme],
19
19
  component: Switch,
20
20
  argTypes: {
21
- ...argTypesFromConfig(mergeConfig(switchConfig, config), ['size', 'view', 'focused']),
21
+ ...argTypesFromConfig(mergeConfig(switchConfig, config), ['view', 'focused']),
22
22
  labelPosition: {
23
23
  options: ['before', 'after'],
24
24
  control: { type: 'select' },
@@ -26,6 +26,7 @@ const meta: Meta<SwitchProps> = {
26
26
  },
27
27
  args: {
28
28
  label: 'Label',
29
+ description: 'Description',
29
30
  labelPosition: 'before',
30
31
  },
31
32
  };
@@ -64,5 +65,10 @@ const StoryDefault = (args: SwitchProps) => {
64
65
  };
65
66
 
66
67
  export const Default: StoryObj<SwitchProps> = {
68
+ args: {
69
+ size: 'm',
70
+ toggleSize: 'l',
71
+ disabled: false,
72
+ },
67
73
  render: (args) => <StoryDefault {...args} />,
68
74
  };
@@ -10,15 +10,22 @@ var config = exports.config = {
10
10
  defaults: {
11
11
  view: 'default',
12
12
  size: 'm',
13
+ toggleSize: 'l',
13
14
  labelPosition: 'before',
14
15
  focused: 'true'
15
16
  },
16
17
  variations: {
17
18
  size: {
18
- m: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-typo-body1-font-family);", ":var(--plasma-typo-body1-font-style);", ":var(--plasma-typo-body1-font-weight);", ":var(--plasma-typo-body1-font-weight);", ":var(--plasma-typo-body1-line-height);", ":var(--plasma-typo-body1-font-size);", ":var(--plasma-typo-body1-letter-spacing);", ":2.75rem;", ":1.75rem;", ":calc(var(", ") / 2);", ":1.5rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;", ":0.75rem;"], _Switch.switchTokens.fontFamily, _Switch.switchTokens.fontStyle, _Switch.switchTokens.fontWeight, _Switch.switchTokens.fontWeight, _Switch.switchTokens.lineHeight, _Switch.switchTokens.fontSize, _Switch.switchTokens.letterSpacing, _Switch.switchTokens.trackWidth, _Switch.switchTokens.trackHeight, _Switch.switchTokens.trackBorderRadius, _Switch.switchTokens.trackHeight, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbBorderRadius, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbOffset, _Switch.switchTokens.thumbPressScale, _Switch.switchTokens.labelOffset)
19
+ s: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-line-height);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], _Switch.switchTokens.fontFamily, _Switch.switchTokens.fontStyle, _Switch.switchTokens.fontWeight, _Switch.switchTokens.lineHeight, _Switch.switchTokens.fontSize, _Switch.switchTokens.letterSpacing, _Switch.switchTokens.descriptionFontFamily, _Switch.switchTokens.descriptionFontStyle, _Switch.switchTokens.descriptionFontWeight, _Switch.switchTokens.descriptionLineHeight, _Switch.switchTokens.descriptionFontSize, _Switch.switchTokens.descriptionLetterSpacing, _Switch.switchTokens.verticalGap, _Switch.switchTokens.labelOffset),
20
+ m: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-line-height);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], _Switch.switchTokens.fontFamily, _Switch.switchTokens.fontStyle, _Switch.switchTokens.fontWeight, _Switch.switchTokens.lineHeight, _Switch.switchTokens.fontSize, _Switch.switchTokens.letterSpacing, _Switch.switchTokens.descriptionFontFamily, _Switch.switchTokens.descriptionFontStyle, _Switch.switchTokens.descriptionFontWeight, _Switch.switchTokens.descriptionLineHeight, _Switch.switchTokens.descriptionFontSize, _Switch.switchTokens.descriptionLetterSpacing, _Switch.switchTokens.verticalGap, _Switch.switchTokens.labelOffset),
21
+ l: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-line-height);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-line-height);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], _Switch.switchTokens.fontFamily, _Switch.switchTokens.fontStyle, _Switch.switchTokens.fontWeight, _Switch.switchTokens.lineHeight, _Switch.switchTokens.fontSize, _Switch.switchTokens.letterSpacing, _Switch.switchTokens.descriptionFontFamily, _Switch.switchTokens.descriptionFontStyle, _Switch.switchTokens.descriptionFontWeight, _Switch.switchTokens.descriptionLineHeight, _Switch.switchTokens.descriptionFontSize, _Switch.switchTokens.descriptionLetterSpacing, _Switch.switchTokens.verticalGap, _Switch.switchTokens.labelOffset)
22
+ },
23
+ toggleSize: {
24
+ l: /*#__PURE__*/(0, _styledComponents.css)(["", ":2.75rem;", ":1.75rem;", ":calc(var(", ") / 2);", ":1.5rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;"], _Switch.switchTokens.trackWidth, _Switch.switchTokens.trackHeight, _Switch.switchTokens.trackBorderRadius, _Switch.switchTokens.trackHeight, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbBorderRadius, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbOffset, _Switch.switchTokens.thumbPressScale),
25
+ s: /*#__PURE__*/(0, _styledComponents.css)(["", ":2rem;", ":1.25rem;", ":calc(var(", ") / 2);", ":1rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;"], _Switch.switchTokens.trackWidth, _Switch.switchTokens.trackHeight, _Switch.switchTokens.trackBorderRadius, _Switch.switchTokens.trackHeight, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbBorderRadius, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbOffset, _Switch.switchTokens.thumbPressScale)
19
26
  },
20
27
  view: {
21
- "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--surface-accent);", ":var(--surface-accent-hover);", ":var(--surface-transparent-tertiary);", ":var(--surface-transparent-tertiary-hover);", ":var(--on-dark-surface-solid-default);", ":0 1px 1px rgba(0,0,0,0.11);"], _Switch.switchTokens.trackBackgroundColorOn, _Switch.switchTokens.trackBackgroundColorOnHover, _Switch.switchTokens.trackBackgroundColorOff, _Switch.switchTokens.trackBackgroundColorOffHover, _Switch.switchTokens.thumbBackgroundColor, _Switch.switchTokens.thumbBoxShadow)
28
+ "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-accent);", ":var(--surface-accent-hover);", ":var(--surface-transparent-tertiary);", ":var(--surface-transparent-tertiary-hover);", ":var(--on-dark-surface-solid-default);", ":0 1px 1px rgba(0,0,0,0.11);"], _Switch.switchTokens.labelColor, _Switch.switchTokens.descriptionColor, _Switch.switchTokens.trackBackgroundColorOn, _Switch.switchTokens.trackBackgroundColorOnHover, _Switch.switchTokens.trackBackgroundColorOff, _Switch.switchTokens.trackBackgroundColorOffHover, _Switch.switchTokens.thumbBackgroundColor, _Switch.switchTokens.thumbBoxShadow)
22
29
  },
23
30
  disabled: {
24
31
  "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _Switch.switchTokens.disabledOpacity)
@@ -17,9 +17,17 @@ const meta: Meta<SwitchProps> = {
17
17
  title: 'plasma_web/Switch',
18
18
  decorators: [WithTheme],
19
19
  component: Switch,
20
- argTypes: argTypesFromConfig(mergeConfig(switchConfig, config), ['size', 'view', 'focused']),
20
+ argTypes: {
21
+ ...argTypesFromConfig(mergeConfig(switchConfig, config), ['view', 'focused']),
22
+ labelPosition: {
23
+ options: ['before', 'after'],
24
+ control: { type: 'select' },
25
+ },
26
+ },
21
27
  args: {
22
28
  label: 'Label',
29
+ description: 'Description',
30
+ labelPosition: 'before',
23
31
  },
24
32
  };
25
33
 
@@ -57,5 +65,10 @@ const StoryDefault = (args: SwitchProps) => {
57
65
  };
58
66
 
59
67
  export const Default: StoryObj<SwitchProps> = {
68
+ args: {
69
+ size: 'm',
70
+ toggleSize: 'l',
71
+ disabled: false,
72
+ },
60
73
  render: (args) => <StoryDefault {...args} />,
61
74
  };
@@ -684,15 +684,4 @@ Object.keys(_ViewContainer).forEach(function (key) {
684
684
  return _ViewContainer[key];
685
685
  }
686
686
  });
687
- });
688
- var _NumberInput = /*#__PURE__*/require("./components/NumberInput");
689
- Object.keys(_NumberInput).forEach(function (key) {
690
- if (key === "default" || key === "__esModule") return;
691
- if (key in exports && exports[key] === _NumberInput[key]) return;
692
- Object.defineProperty(exports, key, {
693
- enumerable: true,
694
- get: function get() {
695
- return _NumberInput[key];
696
- }
697
- });
698
687
  });
@@ -1,25 +1,28 @@
1
1
  var _StyledTrigger;
2
- var _excluded = ["size", "view", "focused", "outlined", "disabled", "labelPosition", "label", "id", "style", "className", "checked", "pressed", "defaultChecked"];
2
+ var _excluded = ["size", "toggleSize", "view", "focused", "outlined", "disabled", "labelPosition", "label", "description", "id", "style", "className", "checked", "pressed", "defaultChecked"];
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 _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; }
5
5
  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; }
6
6
  import React, { forwardRef } from 'react';
7
7
  import { base as sizeCSS } from '../Switch/_size/base';
8
+ import { base as toggleSizeCSS } from '../Switch/_toggleSize/base';
8
9
  import { base as viewCSS } from '../Switch/_view/base';
9
10
  import { base as focusedCSS } from '../Switch/_focused/base';
10
11
  import { base as disabledCSS } from '../Switch/_disabled/base';
11
12
  import { cx } from '../../utils';
12
- import { StyledInput, StyledLabel, StyledTrigger, base } from './Switch.styles';
13
+ import { StyledContent, StyledDescription, StyledInput, StyledLabel, StyledTrigger, base } from './Switch.styles';
13
14
  import { classes } from './Switch.tokens';
14
15
  export var switchRoot = function switchRoot(Root) {
15
16
  return /*#__PURE__*/forwardRef(function (props, ref) {
16
17
  var size = props.size,
18
+ toggleSize = props.toggleSize,
17
19
  view = props.view,
18
20
  focused = props.focused,
19
21
  outlined = props.outlined,
20
22
  disabled = props.disabled,
21
23
  labelPosition = props.labelPosition,
22
24
  label = props.label,
25
+ description = props.description,
23
26
  id = props.id,
24
27
  style = props.style,
25
28
  className = props.className,
@@ -31,12 +34,15 @@ export var switchRoot = function switchRoot(Root) {
31
34
  return /*#__PURE__*/React.createElement(Root, {
32
35
  view: view,
33
36
  size: size,
37
+ toggleSize: toggleSize,
34
38
  disabled: disabled,
35
39
  focused: focused !== null && focused !== void 0 ? focused : outlined,
36
40
  labelPosition: labelPosition,
37
41
  id: id,
38
42
  style: style,
39
- className: cx(className, classes["".concat(labelPosition, "SwitchLabelPosition")])
43
+ className: cx(className)
44
+ }, /*#__PURE__*/React.createElement(StyledContent, {
45
+ className: cx(classes["".concat(labelPosition, "SwitchLabelPosition")])
40
46
  }, /*#__PURE__*/React.createElement(StyledInput, _extends({}, rest, {
41
47
  ref: ref,
42
48
  role: "switch",
@@ -49,7 +55,7 @@ export var switchRoot = function switchRoot(Root) {
49
55
  tabIndex: -1
50
56
  }, label), _StyledTrigger || (_StyledTrigger = /*#__PURE__*/React.createElement(StyledTrigger, {
51
57
  "aria-hidden": true
52
- })));
58
+ }))), description && /*#__PURE__*/React.createElement(StyledDescription, null, description));
53
59
  });
54
60
  };
55
61
  export var switchConfig = {
@@ -64,6 +70,9 @@ export var switchConfig = {
64
70
  view: {
65
71
  css: viewCSS
66
72
  },
73
+ toggleSize: {
74
+ css: toggleSizeCSS
75
+ },
67
76
  disabled: {
68
77
  css: disabledCSS,
69
78
  attrs: true
@@ -2,13 +2,19 @@ import styled from 'styled-components';
2
2
  import { css } from 'styled-components';
3
3
  import { applyEllipsis } from '../../mixins';
4
4
  import { classes, tokens } from './Switch.tokens';
5
- export var base = /*#__PURE__*/css(["position:relative;display:flex;align-items:center;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);&:focus{outline:0 none;}&.", "{justify-content:space-between;", ":0 var(", ") 0 0;}&.", "{justify-content:start;flex-direction:row-reverse;", ":0 0 0 var(", ");}"], classes.beforeSwitchLabelPosition, tokens.labelOffsetPrivate, tokens.labelOffset, classes.afterSwitchLabelPosition, tokens.labelOffsetPrivate, tokens.labelOffset);
6
- export var StyledInput = /*#__PURE__*/styled.input.withConfig({
5
+ export var base = /*#__PURE__*/css(["position:relative;display:flex;flex-direction:column;gap:var(", ");cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);&:focus{outline:0 none;}"], tokens.verticalGap);
6
+ export var StyledContent = /*#__PURE__*/styled.div.withConfig({
7
7
  componentId: "plasma-new-hope__sc-i4fgom-0"
8
+ })(["width:100%;position:relative;display:flex;align-items:center;&.", "{justify-content:space-between;", ":0 var(", ") 0 0;}&.", "{justify-content:start;flex-direction:row-reverse;", ":0 0 0 var(", ");}"], classes.beforeSwitchLabelPosition, tokens.labelOffsetPrivate, tokens.labelOffset, classes.afterSwitchLabelPosition, tokens.labelOffsetPrivate, tokens.labelOffset);
9
+ export var StyledDescription = /*#__PURE__*/styled.div.withConfig({
10
+ componentId: "plasma-new-hope__sc-i4fgom-1"
11
+ })(["position:relative;"]);
12
+ export var StyledInput = /*#__PURE__*/styled.input.withConfig({
13
+ componentId: "plasma-new-hope__sc-i4fgom-2"
8
14
  })(["position:absolute;right:0;margin:0;opacity:0;&:focus{outline:0 none;}"]);
9
15
  export var StyledLabel = /*#__PURE__*/styled.span.withConfig({
10
- componentId: "plasma-new-hope__sc-i4fgom-1"
16
+ componentId: "plasma-new-hope__sc-i4fgom-3"
11
17
  })(["user-select:none;", ""], /*#__PURE__*/applyEllipsis());
12
18
  export var StyledTrigger = /*#__PURE__*/styled.div.withConfig({
13
- componentId: "plasma-new-hope__sc-i4fgom-2"
19
+ componentId: "plasma-new-hope__sc-i4fgom-4"
14
20
  })(["position:relative;display:flex;align-items:center;transition:background-color 0.15s ease-in-out 0.1s;::after{content:'';position:absolute;right:auto;left:0;transition:width 0.15s ease-in-out 0s,left 0.3s ease-in-out 0s,right 0.3s ease-in-out 0s;}", ":checked ~ &::after{right:0;left:auto;}"], StyledInput);
@@ -18,7 +18,43 @@ import { Switch } from '@salutejs/{{ package }}';
18
18
 
19
19
  export function App() {
20
20
  return (
21
- <Switch label="Переключатель" defaultChecked />
21
+ <Switch description="Описание переключателя" label="Переключатель" defaultChecked />
22
+ );
23
+ }
24
+ ```
25
+
26
+ ## Примеры
27
+
28
+ ### Размер Switch
29
+ Размер компонента задается с помощью свойства `size`.
30
+
31
+ ```tsx live
32
+ import React from 'react';
33
+ import { Button } from '@salutejs/{{ package }}';
34
+
35
+ export function App() {
36
+ return (
37
+ <div>
38
+ <Switch size="s" description="Описание переключателя" label="Переключатель" defaultChecked />
39
+ <Switch size="m" description="Описание переключателя" label="Переключатель" defaultChecked />
40
+ <Switch size="l" description="Описание переключателя" label="Переключатель" defaultChecked />
41
+ </div>
42
+ );
43
+ }
44
+ ```
45
+
46
+ Размер переключателя задается с помощью свойства `toggleSize`.
47
+
48
+ ```tsx live
49
+ import React from 'react';
50
+ import { Button } from '@salutejs/{{ package }}';
51
+
52
+ export function App() {
53
+ return (
54
+ <div style=\{{ alignItems: "center" }}>
55
+ <Switch toggleSize="s" label="Переключатель" defaultChecked />
56
+ <Switch toggleSize="l" label="Переключатель" defaultChecked />
57
+ </div>
22
58
  );
23
59
  }
24
60
  ```
@@ -5,11 +5,22 @@ export var tokens = {
5
5
  fontWeight: '--plasma-switch-font-weight',
6
6
  letterSpacing: '--plasma-switch-letter-spacing',
7
7
  lineHeight: '--plasma-switch-line-height',
8
+ /* Токены description */
9
+ descriptionFontFamily: '--plasma-switch-description-font-family',
10
+ descriptionFontStyle: '--plasma-switch-description-font-style',
11
+ descriptionFontSize: '--plasma-switch-description-font-size',
12
+ descriptionFontWeight: '--plasma-switch-description-font-weight',
13
+ descriptionLetterSpacing: '--plasma-switch-description-letter-spacing',
14
+ descriptionLineHeight: '--plasma-switch-description-line-height',
8
15
  /* Цвет подписи */
9
16
  labelColor: '--plasma-switch__label-color',
10
17
  labelOffset: '--plasma-switch__label-offset',
18
+ /* Цвет описания */
19
+ descriptionColor: '--plasma-switch__description-color',
20
+ descriptionOffset: '--plasma-switch__description-offset',
11
21
  /** Прозрачность для всего компонента в состоянии disabled */
12
22
  disabledOpacity: '--plasma-switch-disabled-opacity',
23
+ verticalGap: '--plasma-switch-vertical-gap',
13
24
  trackWidth: '--plasma-switch__track-width',
14
25
  trackHeight: '--plasma-switch__track-height',
15
26
  trackBorderRadius: '--plasma-switch__track-border-radius',
@@ -1,4 +1,4 @@
1
1
  import { css } from 'styled-components';
2
2
  import { tokens } from '../Switch.tokens';
3
- import { StyledLabel, StyledTrigger } from '../Switch.styles';
4
- export var base = /*#__PURE__*/css(["font-family:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");font-size:var(", ");", "{flex:0 0 var(", ");width:var(", ");height:var(", ");border-radius:var(", ");&::after{width:var(", ");height:var(", ");border-radius:var(", ");margin:auto var(", ");}}", "{margin:var(", ",0);}:active:not([disabled]) ", "::after{width:calc(var(", ") * var(", ",1));}"], tokens.fontFamily, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.fontSize, StyledTrigger, tokens.trackWidth, tokens.trackWidth, tokens.trackHeight, tokens.trackBorderRadius, tokens.thumbSize, tokens.thumbSize, tokens.thumbBorderRadius, tokens.thumbOffset, StyledLabel, tokens.labelOffsetPrivate, StyledTrigger, tokens.thumbSize, tokens.thumbPressScale);
3
+ import { StyledContent, StyledDescription, StyledLabel } from '../Switch.styles';
4
+ export var base = /*#__PURE__*/css(["", "{font-family:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");font-size:var(", ");}", "{font-family:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");font-size:var(", ");}", "{margin:var(", ",0);}"], StyledContent, tokens.fontFamily, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.fontSize, StyledDescription, tokens.descriptionFontFamily, tokens.descriptionFontStyle, tokens.descriptionFontWeight, tokens.descriptionLetterSpacing, tokens.descriptionLineHeight, tokens.descriptionFontSize, StyledLabel, tokens.labelOffsetPrivate);
@@ -0,0 +1,4 @@
1
+ import { css } from 'styled-components';
2
+ import { tokens } from '../Switch.tokens';
3
+ import { StyledTrigger } from '../Switch.styles';
4
+ export var base = /*#__PURE__*/css(["", "{flex:0 0 var(", ");width:var(", ");height:var(", ");border-radius:var(", ");&::after{width:var(", ");height:var(", ");border-radius:var(", ");margin:auto var(", ");}}:active:not([disabled]) ", "::after{width:calc(var(", ") * var(", ",1));}"], StyledTrigger, tokens.trackWidth, tokens.trackWidth, tokens.trackHeight, tokens.trackBorderRadius, tokens.thumbSize, tokens.thumbSize, tokens.thumbBorderRadius, tokens.thumbOffset, StyledTrigger, tokens.thumbSize, tokens.thumbPressScale);
@@ -1,4 +1,4 @@
1
1
  import { css } from 'styled-components';
2
2
  import { tokens } from '../Switch.tokens';
3
- import { StyledTrigger, StyledInput } from '../Switch.styles';
4
- export var base = /*#__PURE__*/css(["", "{background-color:var(", ");}", ":not([disabled]) ~ ", ":hover{background-color:var(", ",var(", "));}", ":checked ~ ", "{background-color:var(", ");}", ":checked:not([disabled]) ~ ", ":hover{background-color:var(", ",var(", "));}", "::after{background-color:var(", ");box-shadow:var(", ");}", ":checked ~ ", "::after{box-shadow:var(", ",var(", "));}"], StyledTrigger, tokens.trackBackgroundColorOff, StyledInput, StyledTrigger, tokens.trackBackgroundColorOffHover, tokens.trackBackgroundColorOff, StyledInput, StyledTrigger, tokens.trackBackgroundColorOn, StyledInput, StyledTrigger, tokens.trackBackgroundColorOnHover, tokens.trackBackgroundColorOn, StyledTrigger, tokens.thumbBackgroundColor, tokens.thumbBoxShadow, StyledInput, StyledTrigger, tokens.thumbBoxShadowOn, tokens.thumbBoxShadow);
3
+ import { StyledTrigger, StyledInput, StyledLabel, StyledDescription } from '../Switch.styles';
4
+ export var base = /*#__PURE__*/css(["", "{background-color:var(", ");}", ":not([disabled]) ~ ", ":hover{background-color:var(", ",var(", "));}", ":checked ~ ", "{background-color:var(", ");}", ":checked:not([disabled]) ~ ", ":hover{background-color:var(", ",var(", "));}", "::after{background-color:var(", ");box-shadow:var(", ");}", ":checked ~ ", "::after{box-shadow:var(", ",var(", "));}", "{color:var(", ");}", "{color:var(", ");}"], StyledTrigger, tokens.trackBackgroundColorOff, StyledInput, StyledTrigger, tokens.trackBackgroundColorOffHover, tokens.trackBackgroundColorOff, StyledInput, StyledTrigger, tokens.trackBackgroundColorOn, StyledInput, StyledTrigger, tokens.trackBackgroundColorOnHover, tokens.trackBackgroundColorOn, StyledTrigger, tokens.thumbBackgroundColor, tokens.thumbBoxShadow, StyledInput, StyledTrigger, tokens.thumbBoxShadowOn, tokens.thumbBoxShadow, StyledLabel, tokens.labelColor, StyledDescription, tokens.descriptionColor);
@@ -4,15 +4,22 @@ export var config = {
4
4
  defaults: {
5
5
  view: 'default',
6
6
  size: 'm',
7
+ toggleSize: 'l',
7
8
  labelPosition: 'before',
8
9
  focused: 'true'
9
10
  },
10
11
  variations: {
11
12
  size: {
12
- m: /*#__PURE__*/css(["", ":var(--plasma-typo-body1-font-family);", ":var(--plasma-typo-body1-font-style);", ":var(--plasma-typo-body1-font-weight);", ":var(--plasma-typo-body1-font-weight);", ":var(--plasma-typo-body1-line-height);", ":var(--plasma-typo-body1-font-size);", ":var(--plasma-typo-body1-letter-spacing);", ":2.75rem;", ":1.75rem;", ":calc(var(", ") / 2);", ":1.5rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;", ":0.75rem;"], switchTokens.fontFamily, switchTokens.fontStyle, switchTokens.fontWeight, switchTokens.fontWeight, switchTokens.lineHeight, switchTokens.fontSize, switchTokens.letterSpacing, switchTokens.trackWidth, switchTokens.trackHeight, switchTokens.trackBorderRadius, switchTokens.trackHeight, switchTokens.thumbSize, switchTokens.thumbBorderRadius, switchTokens.thumbSize, switchTokens.thumbOffset, switchTokens.thumbPressScale, switchTokens.labelOffset)
13
+ s: /*#__PURE__*/css(["", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-line-height);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], switchTokens.fontFamily, switchTokens.fontStyle, switchTokens.fontWeight, switchTokens.lineHeight, switchTokens.fontSize, switchTokens.letterSpacing, switchTokens.descriptionFontFamily, switchTokens.descriptionFontStyle, switchTokens.descriptionFontWeight, switchTokens.descriptionLineHeight, switchTokens.descriptionFontSize, switchTokens.descriptionLetterSpacing, switchTokens.verticalGap, switchTokens.labelOffset),
14
+ m: /*#__PURE__*/css(["", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-line-height);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], switchTokens.fontFamily, switchTokens.fontStyle, switchTokens.fontWeight, switchTokens.lineHeight, switchTokens.fontSize, switchTokens.letterSpacing, switchTokens.descriptionFontFamily, switchTokens.descriptionFontStyle, switchTokens.descriptionFontWeight, switchTokens.descriptionLineHeight, switchTokens.descriptionFontSize, switchTokens.descriptionLetterSpacing, switchTokens.verticalGap, switchTokens.labelOffset),
15
+ l: /*#__PURE__*/css(["", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-line-height);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-line-height);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], switchTokens.fontFamily, switchTokens.fontStyle, switchTokens.fontWeight, switchTokens.lineHeight, switchTokens.fontSize, switchTokens.letterSpacing, switchTokens.descriptionFontFamily, switchTokens.descriptionFontStyle, switchTokens.descriptionFontWeight, switchTokens.descriptionLineHeight, switchTokens.descriptionFontSize, switchTokens.descriptionLetterSpacing, switchTokens.verticalGap, switchTokens.labelOffset)
16
+ },
17
+ toggleSize: {
18
+ l: /*#__PURE__*/css(["", ":2.75rem;", ":1.75rem;", ":calc(var(", ") / 2);", ":1.5rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;"], switchTokens.trackWidth, switchTokens.trackHeight, switchTokens.trackBorderRadius, switchTokens.trackHeight, switchTokens.thumbSize, switchTokens.thumbBorderRadius, switchTokens.thumbSize, switchTokens.thumbOffset, switchTokens.thumbPressScale),
19
+ s: /*#__PURE__*/css(["", ":2rem;", ":1.25rem;", ":calc(var(", ") / 2);", ":1rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;"], switchTokens.trackWidth, switchTokens.trackHeight, switchTokens.trackBorderRadius, switchTokens.trackHeight, switchTokens.thumbSize, switchTokens.thumbBorderRadius, switchTokens.thumbSize, switchTokens.thumbOffset, switchTokens.thumbPressScale)
13
20
  },
14
21
  view: {
15
- "default": /*#__PURE__*/css(["", ":var(--surface-accent);", ":var(--surface-accent-hover);", ":var(--surface-transparent-tertiary);", ":var(--surface-transparent-tertiary-hover);", ":var(--on-dark-surface-solid-default);", ":0 1px 1px rgba(0,0,0,0.11);"], switchTokens.trackBackgroundColorOn, switchTokens.trackBackgroundColorOnHover, switchTokens.trackBackgroundColorOff, switchTokens.trackBackgroundColorOffHover, switchTokens.thumbBackgroundColor, switchTokens.thumbBoxShadow)
22
+ "default": /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-accent);", ":var(--surface-accent-hover);", ":var(--surface-transparent-tertiary);", ":var(--surface-transparent-tertiary-hover);", ":var(--on-dark-surface-solid-default);", ":0 1px 1px rgba(0,0,0,0.11);"], switchTokens.labelColor, switchTokens.descriptionColor, switchTokens.trackBackgroundColorOn, switchTokens.trackBackgroundColorOnHover, switchTokens.trackBackgroundColorOff, switchTokens.trackBackgroundColorOffHover, switchTokens.thumbBackgroundColor, switchTokens.thumbBoxShadow)
16
23
  },
17
24
  disabled: {
18
25
  "true": /*#__PURE__*/css(["", ":0.4;"], switchTokens.disabledOpacity)
@@ -18,7 +18,7 @@ const meta: Meta<SwitchProps> = {
18
18
  decorators: [WithTheme],
19
19
  component: Switch,
20
20
  argTypes: {
21
- ...argTypesFromConfig(mergeConfig(switchConfig, config), ['size', 'view', 'focused']),
21
+ ...argTypesFromConfig(mergeConfig(switchConfig, config), ['view', 'focused']),
22
22
  labelPosition: {
23
23
  options: ['before', 'after'],
24
24
  control: { type: 'select' },
@@ -26,6 +26,7 @@ const meta: Meta<SwitchProps> = {
26
26
  },
27
27
  args: {
28
28
  label: 'Label',
29
+ description: 'Description',
29
30
  labelPosition: 'before',
30
31
  },
31
32
  };
@@ -64,5 +65,10 @@ const StoryDefault = (args: SwitchProps) => {
64
65
  };
65
66
 
66
67
  export const Default: StoryObj<SwitchProps> = {
68
+ args: {
69
+ size: 'm',
70
+ toggleSize: 'l',
71
+ disabled: false,
72
+ },
67
73
  render: (args) => <StoryDefault {...args} />,
68
74
  };
@@ -4,15 +4,22 @@ export var config = {
4
4
  defaults: {
5
5
  view: 'default',
6
6
  size: 'm',
7
+ toggleSize: 'l',
7
8
  labelPosition: 'before',
8
9
  focused: 'true'
9
10
  },
10
11
  variations: {
11
12
  size: {
12
- m: /*#__PURE__*/css(["", ":var(--plasma-typo-body1-font-family);", ":var(--plasma-typo-body1-font-style);", ":var(--plasma-typo-body1-font-weight);", ":var(--plasma-typo-body1-font-weight);", ":var(--plasma-typo-body1-line-height);", ":var(--plasma-typo-body1-font-size);", ":var(--plasma-typo-body1-letter-spacing);", ":2.75rem;", ":1.75rem;", ":calc(var(", ") / 2);", ":1.5rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;", ":0.75rem;"], switchTokens.fontFamily, switchTokens.fontStyle, switchTokens.fontWeight, switchTokens.fontWeight, switchTokens.lineHeight, switchTokens.fontSize, switchTokens.letterSpacing, switchTokens.trackWidth, switchTokens.trackHeight, switchTokens.trackBorderRadius, switchTokens.trackHeight, switchTokens.thumbSize, switchTokens.thumbBorderRadius, switchTokens.thumbSize, switchTokens.thumbOffset, switchTokens.thumbPressScale, switchTokens.labelOffset)
13
+ s: /*#__PURE__*/css(["", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-line-height);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], switchTokens.fontFamily, switchTokens.fontStyle, switchTokens.fontWeight, switchTokens.lineHeight, switchTokens.fontSize, switchTokens.letterSpacing, switchTokens.descriptionFontFamily, switchTokens.descriptionFontStyle, switchTokens.descriptionFontWeight, switchTokens.descriptionLineHeight, switchTokens.descriptionFontSize, switchTokens.descriptionLetterSpacing, switchTokens.verticalGap, switchTokens.labelOffset),
14
+ m: /*#__PURE__*/css(["", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-line-height);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], switchTokens.fontFamily, switchTokens.fontStyle, switchTokens.fontWeight, switchTokens.lineHeight, switchTokens.fontSize, switchTokens.letterSpacing, switchTokens.descriptionFontFamily, switchTokens.descriptionFontStyle, switchTokens.descriptionFontWeight, switchTokens.descriptionLineHeight, switchTokens.descriptionFontSize, switchTokens.descriptionLetterSpacing, switchTokens.verticalGap, switchTokens.labelOffset),
15
+ l: /*#__PURE__*/css(["", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-line-height);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-line-height);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], switchTokens.fontFamily, switchTokens.fontStyle, switchTokens.fontWeight, switchTokens.lineHeight, switchTokens.fontSize, switchTokens.letterSpacing, switchTokens.descriptionFontFamily, switchTokens.descriptionFontStyle, switchTokens.descriptionFontWeight, switchTokens.descriptionLineHeight, switchTokens.descriptionFontSize, switchTokens.descriptionLetterSpacing, switchTokens.verticalGap, switchTokens.labelOffset)
16
+ },
17
+ toggleSize: {
18
+ l: /*#__PURE__*/css(["", ":2.75rem;", ":1.75rem;", ":calc(var(", ") / 2);", ":1.5rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;"], switchTokens.trackWidth, switchTokens.trackHeight, switchTokens.trackBorderRadius, switchTokens.trackHeight, switchTokens.thumbSize, switchTokens.thumbBorderRadius, switchTokens.thumbSize, switchTokens.thumbOffset, switchTokens.thumbPressScale),
19
+ s: /*#__PURE__*/css(["", ":2rem;", ":1.25rem;", ":calc(var(", ") / 2);", ":1rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;"], switchTokens.trackWidth, switchTokens.trackHeight, switchTokens.trackBorderRadius, switchTokens.trackHeight, switchTokens.thumbSize, switchTokens.thumbBorderRadius, switchTokens.thumbSize, switchTokens.thumbOffset, switchTokens.thumbPressScale)
13
20
  },
14
21
  view: {
15
- "default": /*#__PURE__*/css(["", ":var(--surface-accent);", ":var(--surface-accent-hover);", ":var(--surface-transparent-tertiary);", ":var(--surface-transparent-tertiary-hover);", ":var(--on-dark-surface-solid-default);", ":0 1px 1px rgba(0,0,0,0.11);"], switchTokens.trackBackgroundColorOn, switchTokens.trackBackgroundColorOnHover, switchTokens.trackBackgroundColorOff, switchTokens.trackBackgroundColorOffHover, switchTokens.thumbBackgroundColor, switchTokens.thumbBoxShadow)
22
+ "default": /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-accent);", ":var(--surface-accent-hover);", ":var(--surface-transparent-tertiary);", ":var(--surface-transparent-tertiary-hover);", ":var(--on-dark-surface-solid-default);", ":0 1px 1px rgba(0,0,0,0.11);"], switchTokens.labelColor, switchTokens.descriptionColor, switchTokens.trackBackgroundColorOn, switchTokens.trackBackgroundColorOnHover, switchTokens.trackBackgroundColorOff, switchTokens.trackBackgroundColorOffHover, switchTokens.thumbBackgroundColor, switchTokens.thumbBoxShadow)
16
23
  },
17
24
  disabled: {
18
25
  "true": /*#__PURE__*/css(["", ":0.4;"], switchTokens.disabledOpacity)
@@ -17,9 +17,17 @@ const meta: Meta<SwitchProps> = {
17
17
  title: 'plasma_web/Switch',
18
18
  decorators: [WithTheme],
19
19
  component: Switch,
20
- argTypes: argTypesFromConfig(mergeConfig(switchConfig, config), ['size', 'view', 'focused']),
20
+ argTypes: {
21
+ ...argTypesFromConfig(mergeConfig(switchConfig, config), ['view', 'focused']),
22
+ labelPosition: {
23
+ options: ['before', 'after'],
24
+ control: { type: 'select' },
25
+ },
26
+ },
21
27
  args: {
22
28
  label: 'Label',
29
+ description: 'Description',
30
+ labelPosition: 'before',
23
31
  },
24
32
  };
25
33
 
@@ -57,5 +65,10 @@ const StoryDefault = (args: SwitchProps) => {
57
65
  };
58
66
 
59
67
  export const Default: StoryObj<SwitchProps> = {
68
+ args: {
69
+ size: 'm',
70
+ toggleSize: 'l',
71
+ disabled: false,
72
+ },
60
73
  render: (args) => <StoryDefault {...args} />,
61
74
  };
@@ -61,5 +61,4 @@ export * from './components/EmptyState';
61
61
  export * from './components/Editable';
62
62
  export * from './components/Mask';
63
63
  export * from './components/Attach';
64
- export * from './components/ViewContainer';
65
- export * from './components/NumberInput';
64
+ export * from './components/ViewContainer';
@@ -14,6 +14,9 @@ export declare const switchConfig: {
14
14
  view: {
15
15
  css: import("@linaria/core").LinariaClassName;
16
16
  };
17
+ toggleSize: {
18
+ css: import("@linaria/core").LinariaClassName;
19
+ };
17
20
  disabled: {
18
21
  css: import("@linaria/core").LinariaClassName;
19
22
  attrs: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAQ1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,eAAO,MAAM,UAAU,SAAU,UAAU,gBAAgB,EAAE,WAAW,CAAC,yFAoDnE,CAAC;AAEP,eAAO,MAAM,YAAY;;;;mBAtDQ,UAAU,gBAAgB,EAAE,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;CA8ExE,CAAC"}
1
+ {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAS1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,eAAO,MAAM,UAAU,SAAU,UAAU,gBAAgB,EAAE,WAAW,CAAC,yFA0DnE,CAAC;AAEP,eAAO,MAAM,YAAY;;;;mBA5DQ,UAAU,gBAAgB,EAAE,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;CAuFxE,CAAC"}