@salutejs/plasma-new-hope 0.325.0-canary.1941.15208820474.0 → 0.325.0-canary.1954.15208821137.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/cjs/components/List/List.css +1 -0
  2. package/cjs/components/List/List.js +63 -0
  3. package/cjs/components/List/List.js.map +1 -0
  4. package/cjs/components/List/List.styles.js +9 -0
  5. package/cjs/components/List/List.styles.js.map +1 -0
  6. package/cjs/components/List/List.styles_9yg2yl.css +1 -0
  7. package/cjs/components/List/List.tokens.js +41 -0
  8. package/cjs/components/List/List.tokens.js.map +1 -0
  9. package/cjs/components/List/ui/ListItem.css +18 -0
  10. package/cjs/components/List/ui/ListItem.js +27 -0
  11. package/cjs/components/List/ui/ListItem.js.map +1 -0
  12. package/cjs/components/List/ui/ListItem.styles.js +28 -0
  13. package/cjs/components/List/ui/ListItem.styles.js.map +1 -0
  14. package/cjs/components/List/ui/ListItem.styles_1eo5k14.css +2 -0
  15. package/cjs/components/{CodeField/variations/_size → List/variations/_disabled}/base.js +2 -2
  16. package/cjs/components/List/variations/_disabled/base.js.map +1 -0
  17. package/cjs/components/List/variations/_disabled/base_x642ct.css +1 -0
  18. package/cjs/components/{CodeField/variations/_view → List/variations/_size}/base.js +2 -2
  19. package/cjs/components/List/variations/_size/base.js.map +1 -0
  20. package/cjs/components/List/variations/_size/base_x642ct.css +1 -0
  21. package/cjs/components/{CodeField/variations/_shape → List/variations/_variant}/base.js +2 -2
  22. package/cjs/components/List/variations/_variant/base.js.map +1 -0
  23. package/cjs/components/List/variations/_variant/base_x642ct.css +1 -0
  24. package/cjs/components/{CodeField/variations/_disabled → List/variations/_view}/base.js +2 -2
  25. package/cjs/components/List/variations/_view/base.js.map +1 -0
  26. package/cjs/components/List/variations/_view/base_x642ct.css +1 -0
  27. package/cjs/components/NumberInput/ui/Input/Input.js +3 -0
  28. package/cjs/components/NumberInput/ui/Input/Input.js.map +1 -1
  29. package/cjs/index.css +5 -15
  30. package/cjs/index.js +8 -10
  31. package/cjs/index.js.map +1 -1
  32. package/emotion/cjs/components/List/List.js +59 -0
  33. package/emotion/cjs/components/List/List.styles.js +9 -0
  34. package/emotion/cjs/components/List/List.tokens.js +39 -0
  35. package/emotion/cjs/components/List/index.js +38 -0
  36. package/emotion/cjs/components/List/ui/ListItem.js +24 -0
  37. package/emotion/cjs/components/List/ui/ListItem.styles.js +21 -0
  38. package/emotion/cjs/components/List/variations/_disabled/base.js +8 -0
  39. package/emotion/cjs/components/List/variations/_disabled/tokens.json +1 -0
  40. package/emotion/cjs/components/List/variations/_size/base.js +8 -0
  41. package/emotion/cjs/components/List/variations/_size/tokens.json +1 -0
  42. package/emotion/cjs/components/List/variations/_variant/base.js +8 -0
  43. package/emotion/cjs/components/List/variations/_variant/tokens.json +1 -0
  44. package/emotion/cjs/components/List/variations/_view/base.js +8 -0
  45. package/emotion/cjs/components/List/variations/_view/tokens.json +1 -0
  46. package/emotion/cjs/components/NumberInput/ui/Input/Input.js +3 -0
  47. package/emotion/cjs/examples/plasma_b2c/components/List/List.config.js +34 -0
  48. package/emotion/cjs/examples/plasma_b2c/components/List/List.js +12 -0
  49. package/emotion/cjs/examples/plasma_b2c/components/List/List.stories.tsx +60 -0
  50. package/emotion/cjs/examples/plasma_web/components/List/List.config.js +34 -0
  51. package/emotion/cjs/examples/plasma_web/components/List/List.js +12 -0
  52. package/emotion/cjs/examples/plasma_web/components/List/List.stories.tsx +60 -0
  53. package/emotion/cjs/index.js +11 -11
  54. package/emotion/es/components/List/List.js +50 -0
  55. package/emotion/es/components/List/List.styles.js +3 -0
  56. package/emotion/es/components/List/List.tokens.js +33 -0
  57. package/emotion/es/components/List/index.js +3 -0
  58. package/emotion/es/components/List/ui/ListItem.js +17 -0
  59. package/emotion/es/components/List/ui/ListItem.styles.js +14 -0
  60. package/emotion/es/components/List/variations/_disabled/base.js +2 -0
  61. package/emotion/es/components/List/variations/_disabled/tokens.json +1 -0
  62. package/emotion/es/components/List/variations/_size/base.js +2 -0
  63. package/emotion/es/components/List/variations/_size/tokens.json +1 -0
  64. package/emotion/es/components/List/variations/_variant/base.js +2 -0
  65. package/emotion/es/components/List/variations/_variant/tokens.json +1 -0
  66. package/emotion/es/components/List/variations/_view/base.js +2 -0
  67. package/emotion/es/components/List/variations/_view/tokens.json +1 -0
  68. package/emotion/es/components/NumberInput/ui/Input/Input.js +3 -0
  69. package/emotion/es/examples/plasma_b2c/components/List/List.config.js +28 -0
  70. package/emotion/es/examples/plasma_b2c/components/List/List.js +6 -0
  71. package/emotion/es/examples/plasma_b2c/components/List/List.stories.tsx +60 -0
  72. package/emotion/es/examples/plasma_web/components/List/List.config.js +28 -0
  73. package/emotion/es/examples/plasma_web/components/List/List.js +6 -0
  74. package/emotion/es/examples/plasma_web/components/List/List.stories.tsx +60 -0
  75. package/emotion/es/index.js +2 -1
  76. package/es/components/List/List.css +1 -0
  77. package/es/components/List/List.js +54 -0
  78. package/es/components/List/List.js.map +1 -0
  79. package/es/components/List/List.styles.js +5 -0
  80. package/es/components/List/List.styles.js.map +1 -0
  81. package/es/components/List/List.styles_9yg2yl.css +1 -0
  82. package/es/components/List/List.tokens.js +36 -0
  83. package/es/components/List/List.tokens.js.map +1 -0
  84. package/es/components/List/ui/ListItem.css +18 -0
  85. package/es/components/List/ui/ListItem.js +19 -0
  86. package/es/components/List/ui/ListItem.js.map +1 -0
  87. package/es/components/List/ui/ListItem.styles.js +23 -0
  88. package/es/components/List/ui/ListItem.styles.js.map +1 -0
  89. package/es/components/List/ui/ListItem.styles_1eo5k14.css +2 -0
  90. package/es/components/{CodeField/variations/_view → List/variations/_disabled}/base.js +2 -2
  91. package/es/components/List/variations/_disabled/base.js.map +1 -0
  92. package/es/components/List/variations/_disabled/base_x642ct.css +1 -0
  93. package/es/components/{CodeField → List}/variations/_size/base.js +2 -2
  94. package/es/components/List/variations/_size/base.js.map +1 -0
  95. package/es/components/List/variations/_size/base_x642ct.css +1 -0
  96. package/es/components/List/variations/_variant/base.js +5 -0
  97. package/es/components/List/variations/_variant/base.js.map +1 -0
  98. package/es/components/List/variations/_variant/base_x642ct.css +1 -0
  99. package/es/components/{CodeField/variations/_disabled → List/variations/_view}/base.js +2 -2
  100. package/es/components/List/variations/_view/base.js.map +1 -0
  101. package/es/components/List/variations/_view/base_x642ct.css +1 -0
  102. package/es/components/NumberInput/ui/Input/Input.js +3 -0
  103. package/es/components/NumberInput/ui/Input/Input.js.map +1 -1
  104. package/es/index.css +5 -15
  105. package/es/index.js +3 -3
  106. package/package.json +2 -2
  107. package/styled-components/cjs/components/List/List.js +59 -0
  108. package/styled-components/cjs/components/List/List.styles.js +9 -0
  109. package/styled-components/cjs/components/List/List.tokens.js +39 -0
  110. package/styled-components/cjs/components/List/List.types.js +5 -0
  111. package/styled-components/cjs/components/List/index.js +38 -0
  112. package/styled-components/cjs/components/List/ui/ListItem.js +24 -0
  113. package/styled-components/cjs/components/List/ui/ListItem.styles.js +19 -0
  114. package/styled-components/cjs/components/List/ui/ListItem.types.js +5 -0
  115. package/styled-components/cjs/components/{CodeField → List}/variations/_disabled/base.js +1 -2
  116. package/styled-components/cjs/components/List/variations/_disabled/tokens.json +1 -0
  117. package/styled-components/cjs/components/List/variations/_size/base.js +8 -0
  118. package/styled-components/cjs/components/List/variations/_size/tokens.json +1 -0
  119. package/styled-components/cjs/components/List/variations/_variant/base.js +8 -0
  120. package/styled-components/cjs/components/List/variations/_variant/tokens.json +1 -0
  121. package/styled-components/cjs/components/List/variations/_view/base.js +8 -0
  122. package/styled-components/cjs/components/List/variations/_view/tokens.json +1 -0
  123. package/styled-components/cjs/components/NumberInput/ui/Input/Input.js +3 -0
  124. package/styled-components/cjs/examples/plasma_b2c/components/List/List.config.js +34 -0
  125. package/styled-components/cjs/examples/plasma_b2c/components/List/List.js +12 -0
  126. package/styled-components/cjs/examples/plasma_b2c/components/List/List.stories.tsx +60 -0
  127. package/styled-components/cjs/examples/plasma_web/components/List/List.config.js +34 -0
  128. package/styled-components/cjs/examples/plasma_web/components/List/List.js +12 -0
  129. package/styled-components/cjs/examples/plasma_web/components/List/List.stories.tsx +60 -0
  130. package/styled-components/cjs/index.js +11 -11
  131. package/styled-components/es/components/List/List.js +50 -0
  132. package/styled-components/es/components/List/List.styles.js +3 -0
  133. package/styled-components/es/components/List/List.tokens.js +33 -0
  134. package/styled-components/es/components/List/List.types.js +1 -0
  135. package/styled-components/es/components/List/index.js +3 -0
  136. package/styled-components/es/components/List/ui/ListItem.js +17 -0
  137. package/styled-components/es/components/List/ui/ListItem.styles.js +12 -0
  138. package/styled-components/es/components/List/ui/ListItem.types.js +1 -0
  139. package/styled-components/es/components/List/variations/_disabled/base.js +2 -0
  140. package/styled-components/es/components/List/variations/_disabled/tokens.json +1 -0
  141. package/styled-components/es/components/List/variations/_size/base.js +2 -0
  142. package/styled-components/es/components/List/variations/_size/tokens.json +1 -0
  143. package/styled-components/es/components/List/variations/_variant/base.js +2 -0
  144. package/styled-components/es/components/List/variations/_variant/tokens.json +1 -0
  145. package/styled-components/es/components/List/variations/_view/base.js +2 -0
  146. package/styled-components/es/components/List/variations/_view/tokens.json +1 -0
  147. package/styled-components/es/components/NumberInput/ui/Input/Input.js +3 -0
  148. package/styled-components/es/examples/plasma_b2c/components/List/List.config.js +28 -0
  149. package/styled-components/es/examples/plasma_b2c/components/List/List.js +6 -0
  150. package/styled-components/es/examples/plasma_b2c/components/List/List.stories.tsx +60 -0
  151. package/styled-components/es/examples/plasma_web/components/List/List.config.js +28 -0
  152. package/styled-components/es/examples/plasma_web/components/List/List.js +6 -0
  153. package/styled-components/es/examples/plasma_web/components/List/List.stories.tsx +60 -0
  154. package/styled-components/es/index.js +2 -1
  155. package/types/components/List/List.d.ts +43 -0
  156. package/types/components/List/List.d.ts.map +1 -0
  157. package/types/components/List/List.styles.d.ts +2 -0
  158. package/types/components/List/List.styles.d.ts.map +1 -0
  159. package/types/components/List/List.tokens.d.ts +34 -0
  160. package/types/components/List/List.tokens.d.ts.map +1 -0
  161. package/types/components/List/List.types.d.ts +24 -0
  162. package/types/components/List/List.types.d.ts.map +1 -0
  163. package/types/components/List/index.d.ts +5 -0
  164. package/types/components/List/index.d.ts.map +1 -0
  165. package/types/components/List/ui/ListItem.d.ts +4 -0
  166. package/types/components/List/ui/ListItem.d.ts.map +1 -0
  167. package/types/components/List/ui/ListItem.styles.d.ts +36 -0
  168. package/types/components/List/ui/ListItem.styles.d.ts.map +1 -0
  169. package/types/components/List/ui/ListItem.types.d.ts +15 -0
  170. package/types/components/List/ui/ListItem.types.d.ts.map +1 -0
  171. package/types/components/List/variations/_disabled/base.d.ts.map +1 -0
  172. package/types/components/List/variations/_size/base.d.ts.map +1 -0
  173. package/types/components/List/variations/_variant/base.d.ts.map +1 -0
  174. package/types/components/List/variations/_view/base.d.ts.map +1 -0
  175. package/types/components/NumberInput/ui/Input/Input.d.ts.map +1 -1
  176. package/types/index.d.ts +2 -1
  177. package/types/index.d.ts.map +1 -1
  178. package/cjs/components/CodeField/CodeField.css +0 -14
  179. package/cjs/components/CodeField/CodeField.js +0 -290
  180. package/cjs/components/CodeField/CodeField.js.map +0 -1
  181. package/cjs/components/CodeField/CodeField.styles.js +0 -57
  182. package/cjs/components/CodeField/CodeField.styles.js.map +0 -1
  183. package/cjs/components/CodeField/CodeField.styles_7zxgpc.css +0 -6
  184. package/cjs/components/CodeField/CodeField.tokens.js +0 -59
  185. package/cjs/components/CodeField/CodeField.tokens.js.map +0 -1
  186. package/cjs/components/CodeField/utils/constants.js +0 -18
  187. package/cjs/components/CodeField/utils/constants.js.map +0 -1
  188. package/cjs/components/CodeField/utils/handleCodeError.js +0 -55
  189. package/cjs/components/CodeField/utils/handleCodeError.js.map +0 -1
  190. package/cjs/components/CodeField/utils/handleItemError.js +0 -53
  191. package/cjs/components/CodeField/utils/handleItemError.js.map +0 -1
  192. package/cjs/components/CodeField/utils/initialValuesHelper.js +0 -33
  193. package/cjs/components/CodeField/utils/initialValuesHelper.js.map +0 -1
  194. package/cjs/components/CodeField/variations/_disabled/base.js.map +0 -1
  195. package/cjs/components/CodeField/variations/_disabled/base_obsae2.css +0 -1
  196. package/cjs/components/CodeField/variations/_shape/base.js.map +0 -1
  197. package/cjs/components/CodeField/variations/_shape/base_1scsyya.css +0 -1
  198. package/cjs/components/CodeField/variations/_size/base.js.map +0 -1
  199. package/cjs/components/CodeField/variations/_size/base_1wrvbr5.css +0 -1
  200. package/cjs/components/CodeField/variations/_view/base.js.map +0 -1
  201. package/cjs/components/CodeField/variations/_view/base_9a5yza.css +0 -1
  202. package/emotion/cjs/components/CodeField/CodeField.js +0 -299
  203. package/emotion/cjs/components/CodeField/CodeField.styles.js +0 -65
  204. package/emotion/cjs/components/CodeField/CodeField.template-doc.mdx +0 -150
  205. package/emotion/cjs/components/CodeField/CodeField.tokens.js +0 -57
  206. package/emotion/cjs/components/CodeField/index.js +0 -50
  207. package/emotion/cjs/components/CodeField/utils/constants.js +0 -12
  208. package/emotion/cjs/components/CodeField/utils/handleCodeError.js +0 -58
  209. package/emotion/cjs/components/CodeField/utils/handleItemError.js +0 -56
  210. package/emotion/cjs/components/CodeField/utils/index.js +0 -38
  211. package/emotion/cjs/components/CodeField/utils/initialValuesHelper.js +0 -30
  212. package/emotion/cjs/components/CodeField/variations/_disabled/base.js +0 -9
  213. package/emotion/cjs/components/CodeField/variations/_disabled/tokens.json +0 -4
  214. package/emotion/cjs/components/CodeField/variations/_shape/base.js +0 -10
  215. package/emotion/cjs/components/CodeField/variations/_shape/tokens.json +0 -1
  216. package/emotion/cjs/components/CodeField/variations/_size/base.js +0 -10
  217. package/emotion/cjs/components/CodeField/variations/_size/tokens.json +0 -19
  218. package/emotion/cjs/components/CodeField/variations/_view/base.js +0 -10
  219. package/emotion/cjs/components/CodeField/variations/_view/tokens.json +0 -0
  220. package/emotion/cjs/examples/plasma_b2c/components/CodeField/CodeField.config.js +0 -31
  221. package/emotion/cjs/examples/plasma_b2c/components/CodeField/CodeField.js +0 -11
  222. package/emotion/cjs/examples/plasma_b2c/components/CodeField/CodeField.stories.tsx +0 -107
  223. package/emotion/cjs/examples/plasma_web/components/CodeField/CodeField.config.js +0 -31
  224. package/emotion/cjs/examples/plasma_web/components/CodeField/CodeField.js +0 -11
  225. package/emotion/cjs/examples/plasma_web/components/CodeField/CodeField.stories.tsx +0 -107
  226. package/emotion/es/components/CodeField/CodeField.js +0 -290
  227. package/emotion/es/components/CodeField/CodeField.styles.js +0 -58
  228. package/emotion/es/components/CodeField/CodeField.template-doc.mdx +0 -150
  229. package/emotion/es/components/CodeField/CodeField.tokens.js +0 -51
  230. package/emotion/es/components/CodeField/index.js +0 -3
  231. package/emotion/es/components/CodeField/utils/constants.js +0 -6
  232. package/emotion/es/components/CodeField/utils/handleCodeError.js +0 -52
  233. package/emotion/es/components/CodeField/utils/handleItemError.js +0 -50
  234. package/emotion/es/components/CodeField/utils/index.js +0 -3
  235. package/emotion/es/components/CodeField/utils/initialValuesHelper.js +0 -24
  236. package/emotion/es/components/CodeField/variations/_disabled/base.js +0 -3
  237. package/emotion/es/components/CodeField/variations/_disabled/tokens.json +0 -4
  238. package/emotion/es/components/CodeField/variations/_shape/base.js +0 -4
  239. package/emotion/es/components/CodeField/variations/_shape/tokens.json +0 -1
  240. package/emotion/es/components/CodeField/variations/_size/base.js +0 -4
  241. package/emotion/es/components/CodeField/variations/_size/tokens.json +0 -19
  242. package/emotion/es/components/CodeField/variations/_view/base.js +0 -4
  243. package/emotion/es/components/CodeField/variations/_view/tokens.json +0 -0
  244. package/emotion/es/examples/plasma_b2c/components/CodeField/CodeField.config.js +0 -25
  245. package/emotion/es/examples/plasma_b2c/components/CodeField/CodeField.js +0 -5
  246. package/emotion/es/examples/plasma_b2c/components/CodeField/CodeField.stories.tsx +0 -107
  247. package/emotion/es/examples/plasma_web/components/CodeField/CodeField.config.js +0 -25
  248. package/emotion/es/examples/plasma_web/components/CodeField/CodeField.js +0 -5
  249. package/emotion/es/examples/plasma_web/components/CodeField/CodeField.stories.tsx +0 -107
  250. package/es/components/CodeField/CodeField.css +0 -14
  251. package/es/components/CodeField/CodeField.js +0 -280
  252. package/es/components/CodeField/CodeField.js.map +0 -1
  253. package/es/components/CodeField/CodeField.styles.js +0 -48
  254. package/es/components/CodeField/CodeField.styles.js.map +0 -1
  255. package/es/components/CodeField/CodeField.styles_7zxgpc.css +0 -6
  256. package/es/components/CodeField/CodeField.tokens.js +0 -54
  257. package/es/components/CodeField/CodeField.tokens.js.map +0 -1
  258. package/es/components/CodeField/utils/constants.js +0 -9
  259. package/es/components/CodeField/utils/constants.js.map +0 -1
  260. package/es/components/CodeField/utils/handleCodeError.js +0 -51
  261. package/es/components/CodeField/utils/handleCodeError.js.map +0 -1
  262. package/es/components/CodeField/utils/handleItemError.js +0 -49
  263. package/es/components/CodeField/utils/handleItemError.js.map +0 -1
  264. package/es/components/CodeField/utils/initialValuesHelper.js +0 -27
  265. package/es/components/CodeField/utils/initialValuesHelper.js.map +0 -1
  266. package/es/components/CodeField/variations/_disabled/base.js.map +0 -1
  267. package/es/components/CodeField/variations/_disabled/base_obsae2.css +0 -1
  268. package/es/components/CodeField/variations/_shape/base.js +0 -5
  269. package/es/components/CodeField/variations/_shape/base.js.map +0 -1
  270. package/es/components/CodeField/variations/_shape/base_1scsyya.css +0 -1
  271. package/es/components/CodeField/variations/_size/base.js.map +0 -1
  272. package/es/components/CodeField/variations/_size/base_1wrvbr5.css +0 -1
  273. package/es/components/CodeField/variations/_view/base.js.map +0 -1
  274. package/es/components/CodeField/variations/_view/base_9a5yza.css +0 -1
  275. package/styled-components/cjs/components/CodeField/CodeField.js +0 -299
  276. package/styled-components/cjs/components/CodeField/CodeField.styles.js +0 -38
  277. package/styled-components/cjs/components/CodeField/CodeField.template-doc.mdx +0 -150
  278. package/styled-components/cjs/components/CodeField/CodeField.tokens.js +0 -57
  279. package/styled-components/cjs/components/CodeField/index.js +0 -50
  280. package/styled-components/cjs/components/CodeField/utils/constants.js +0 -12
  281. package/styled-components/cjs/components/CodeField/utils/handleCodeError.js +0 -58
  282. package/styled-components/cjs/components/CodeField/utils/handleItemError.js +0 -56
  283. package/styled-components/cjs/components/CodeField/utils/index.js +0 -38
  284. package/styled-components/cjs/components/CodeField/utils/initialValuesHelper.js +0 -30
  285. package/styled-components/cjs/components/CodeField/variations/_disabled/tokens.json +0 -4
  286. package/styled-components/cjs/components/CodeField/variations/_shape/base.js +0 -10
  287. package/styled-components/cjs/components/CodeField/variations/_shape/tokens.json +0 -1
  288. package/styled-components/cjs/components/CodeField/variations/_size/base.js +0 -10
  289. package/styled-components/cjs/components/CodeField/variations/_size/tokens.json +0 -19
  290. package/styled-components/cjs/components/CodeField/variations/_view/base.js +0 -10
  291. package/styled-components/cjs/components/CodeField/variations/_view/tokens.json +0 -0
  292. package/styled-components/cjs/examples/plasma_b2c/components/CodeField/CodeField.config.js +0 -31
  293. package/styled-components/cjs/examples/plasma_b2c/components/CodeField/CodeField.js +0 -11
  294. package/styled-components/cjs/examples/plasma_b2c/components/CodeField/CodeField.stories.tsx +0 -107
  295. package/styled-components/cjs/examples/plasma_web/components/CodeField/CodeField.config.js +0 -31
  296. package/styled-components/cjs/examples/plasma_web/components/CodeField/CodeField.js +0 -11
  297. package/styled-components/cjs/examples/plasma_web/components/CodeField/CodeField.stories.tsx +0 -107
  298. package/styled-components/es/components/CodeField/CodeField.js +0 -290
  299. package/styled-components/es/components/CodeField/CodeField.styles.js +0 -30
  300. package/styled-components/es/components/CodeField/CodeField.template-doc.mdx +0 -150
  301. package/styled-components/es/components/CodeField/CodeField.tokens.js +0 -51
  302. package/styled-components/es/components/CodeField/index.js +0 -3
  303. package/styled-components/es/components/CodeField/utils/constants.js +0 -6
  304. package/styled-components/es/components/CodeField/utils/handleCodeError.js +0 -52
  305. package/styled-components/es/components/CodeField/utils/handleItemError.js +0 -50
  306. package/styled-components/es/components/CodeField/utils/index.js +0 -3
  307. package/styled-components/es/components/CodeField/utils/initialValuesHelper.js +0 -24
  308. package/styled-components/es/components/CodeField/variations/_disabled/base.js +0 -3
  309. package/styled-components/es/components/CodeField/variations/_disabled/tokens.json +0 -4
  310. package/styled-components/es/components/CodeField/variations/_shape/base.js +0 -4
  311. package/styled-components/es/components/CodeField/variations/_shape/tokens.json +0 -1
  312. package/styled-components/es/components/CodeField/variations/_size/base.js +0 -4
  313. package/styled-components/es/components/CodeField/variations/_size/tokens.json +0 -19
  314. package/styled-components/es/components/CodeField/variations/_view/base.js +0 -4
  315. package/styled-components/es/components/CodeField/variations/_view/tokens.json +0 -0
  316. package/styled-components/es/examples/plasma_b2c/components/CodeField/CodeField.config.js +0 -25
  317. package/styled-components/es/examples/plasma_b2c/components/CodeField/CodeField.js +0 -5
  318. package/styled-components/es/examples/plasma_b2c/components/CodeField/CodeField.stories.tsx +0 -107
  319. package/styled-components/es/examples/plasma_web/components/CodeField/CodeField.config.js +0 -25
  320. package/styled-components/es/examples/plasma_web/components/CodeField/CodeField.js +0 -5
  321. package/styled-components/es/examples/plasma_web/components/CodeField/CodeField.stories.tsx +0 -107
  322. package/types/components/CodeField/CodeField.d.ts +0 -69
  323. package/types/components/CodeField/CodeField.d.ts.map +0 -1
  324. package/types/components/CodeField/CodeField.styles.d.ts +0 -11
  325. package/types/components/CodeField/CodeField.styles.d.ts.map +0 -1
  326. package/types/components/CodeField/CodeField.tokens.d.ts +0 -52
  327. package/types/components/CodeField/CodeField.tokens.d.ts.map +0 -1
  328. package/types/components/CodeField/CodeField.types.d.ts +0 -93
  329. package/types/components/CodeField/CodeField.types.d.ts.map +0 -1
  330. package/types/components/CodeField/index.d.ts +0 -4
  331. package/types/components/CodeField/index.d.ts.map +0 -1
  332. package/types/components/CodeField/utils/constants.d.ts +0 -7
  333. package/types/components/CodeField/utils/constants.d.ts.map +0 -1
  334. package/types/components/CodeField/utils/handleCodeError.d.ts +0 -15
  335. package/types/components/CodeField/utils/handleCodeError.d.ts.map +0 -1
  336. package/types/components/CodeField/utils/handleItemError.d.ts +0 -14
  337. package/types/components/CodeField/utils/handleItemError.d.ts.map +0 -1
  338. package/types/components/CodeField/utils/index.d.ts +0 -4
  339. package/types/components/CodeField/utils/index.d.ts.map +0 -1
  340. package/types/components/CodeField/utils/initialValuesHelper.d.ts +0 -4
  341. package/types/components/CodeField/utils/initialValuesHelper.d.ts.map +0 -1
  342. package/types/components/CodeField/variations/_disabled/base.d.ts.map +0 -1
  343. package/types/components/CodeField/variations/_shape/base.d.ts.map +0 -1
  344. package/types/components/CodeField/variations/_size/base.d.ts.map +0 -1
  345. package/types/components/CodeField/variations/_view/base.d.ts.map +0 -1
  346. /package/emotion/cjs/components/{CodeField/CodeField.types.js → List/List.types.js} +0 -0
  347. /package/{styled-components/cjs/components/CodeField/CodeField.types.js → emotion/cjs/components/List/ui/ListItem.types.js} +0 -0
  348. /package/emotion/es/components/{CodeField/CodeField.types.js → List/List.types.js} +0 -0
  349. /package/{styled-components/es/components/CodeField/CodeField.types.js → emotion/es/components/List/ui/ListItem.types.js} +0 -0
  350. /package/types/components/{CodeField → List}/variations/_disabled/base.d.ts +0 -0
  351. /package/types/components/{CodeField/variations/_shape → List/variations/_size}/base.d.ts +0 -0
  352. /package/types/components/{CodeField/variations/_size → List/variations/_variant}/base.d.ts +0 -0
  353. /package/types/components/{CodeField → List}/variations/_view/base.d.ts +0 -0
@@ -1,290 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
6
- var React = require('react');
7
- var cls = require('classnames');
8
- var constants = require('./utils/constants.js');
9
- var CodeField_tokens = require('./CodeField.tokens.js');
10
- var CodeField_styles = require('./CodeField.styles.js');
11
- var base = require('./variations/_view/base.js');
12
- var base$1 = require('./variations/_size/base.js');
13
- var base$2 = require('./variations/_shape/base.js');
14
- var base$3 = require('./variations/_disabled/base.js');
15
- var initialValuesHelper = require('./utils/initialValuesHelper.js');
16
- var useDidMountEffect = require('../../hooks/useDidMountEffect.js');
17
- var handleCodeError = require('./utils/handleCodeError.js');
18
- var getSizeValueFromProp = require('../../utils/getSizeValueFromProp.js');
19
- var handleItemError = require('./utils/handleItemError.js');
20
-
21
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
22
-
23
- var React__default = /*#__PURE__*/_interopDefault(React);
24
- var cls__default = /*#__PURE__*/_interopDefault(cls);
25
-
26
- var _Separator;
27
- var _excluded = ["className", "value", "placeholder", "autoFocus", "codeLength", "caption", "captionAlign", "width", "shape", "view", "size", "disabled", "isError", "allowedSymbols", "itemErrorBehavior", "codeErrorBehavior", "autoComplete", "setIsError", "onChange", "onFullCodeEnter"];
28
- var codeFieldRoot = function codeFieldRoot(Root) {
29
- return /*#__PURE__*/React.forwardRef(function (_ref, ref) {
30
- var className = _ref.className,
31
- outerValue = _ref.value,
32
- placeholder = _ref.placeholder,
33
- autoFocus = _ref.autoFocus,
34
- _ref$codeLength = _ref.codeLength,
35
- codeLength = _ref$codeLength === void 0 ? 6 : _ref$codeLength,
36
- caption = _ref.caption,
37
- _ref$captionAlign = _ref.captionAlign,
38
- captionAlign = _ref$captionAlign === void 0 ? 'left' : _ref$captionAlign,
39
- width = _ref.width,
40
- _ref$shape = _ref.shape,
41
- shape = _ref$shape === void 0 ? 'default' : _ref$shape,
42
- view = _ref.view,
43
- size = _ref.size,
44
- disabled = _ref.disabled,
45
- isError = _ref.isError,
46
- _ref$allowedSymbols = _ref.allowedSymbols,
47
- allowedSymbols = _ref$allowedSymbols === void 0 ? constants.ONLY_DIGITS_PATTERN : _ref$allowedSymbols,
48
- _ref$itemErrorBehavio = _ref.itemErrorBehavior,
49
- itemErrorBehavior = _ref$itemErrorBehavio === void 0 ? 'remove-symbol' : _ref$itemErrorBehavio,
50
- _ref$codeErrorBehavio = _ref.codeErrorBehavior,
51
- codeErrorBehavior = _ref$codeErrorBehavio === void 0 ? 'remove-code' : _ref$codeErrorBehavio,
52
- _ref$autoComplete = _ref.autoComplete,
53
- autoComplete = _ref$autoComplete === void 0 ? 'one-time-code' : _ref$autoComplete,
54
- setIsError = _ref.setIsError,
55
- onChange = _ref.onChange,
56
- onFullCodeEnter = _ref.onFullCodeEnter,
57
- rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
58
- var _useState = React.useState(initialValuesHelper.getCodeValue(codeLength, outerValue || '')),
59
- _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
60
- code = _useState2[0],
61
- setCode = _useState2[1];
62
- var _useState3 = React.useState(code.join('')),
63
- _useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
64
- originalValue = _useState4[0],
65
- setOriginalValue = _useState4[1];
66
- var inputRefs = React.useRef([]);
67
- var inputContainerRef = React.useRef(null);
68
- var captionRef = React.useRef(null);
69
- var fieldPattern = initialValuesHelper.getFieldPattern(allowedSymbols);
70
- var placeholderValue = initialValuesHelper.getPlaceholderValue(codeLength, placeholder);
71
- var parts = codeLength === 6 ? 2 : 1;
72
- var widthValue = width ? getSizeValueFromProp.getSizeValueFromProp(width, 'rem') : undefined;
73
- var getLastActiveIndex = function getLastActiveIndex() {
74
- if (code.length && code.length < codeLength) {
75
- return code.length;
76
- }
77
- var lastEmptyIndex = code.findIndex(function (digit) {
78
- return digit === '';
79
- });
80
- return lastEmptyIndex >= 0 ? lastEmptyIndex : codeLength - 1;
81
- };
82
- var handleClick = function handleClick() {
83
- if (disabled) {
84
- return;
85
- }
86
- var lastActiveIndex = getLastActiveIndex();
87
- if (inputRefs.current[lastActiveIndex]) {
88
- inputRefs.current[lastActiveIndex].focus();
89
- }
90
- };
91
- var handleOnKeyDown = function handleOnKeyDown(event, index) {
92
- if (disabled) {
93
- return;
94
- }
95
- var key = event.key;
96
- if (constants.FORBIDDEN_KEYS.includes(key)) {
97
- event.preventDefault();
98
- return;
99
- }
100
- if (key === constants.BACKSPACE_KEY) {
101
- if (index > 0 && code[index] === '') {
102
- var _inputRefs$current;
103
- (_inputRefs$current = inputRefs.current[index - 1]) === null || _inputRefs$current === void 0 || _inputRefs$current.focus();
104
- }
105
- }
106
- };
107
- var codeSetter = function codeSetter(newCode) {
108
- setCode(newCode);
109
- setOriginalValue(newCode.join(''));
110
- if (onChange) {
111
- onChange(newCode.join(''));
112
- }
113
- };
114
- var handleChange = function handleChange(event, index) {
115
- var _inputRefs$current$in;
116
- if (disabled) {
117
- return;
118
- }
119
- var rawSymbol = event.currentTarget.value;
120
- var symbol = rawSymbol.charAt(rawSymbol.length - 1);
121
- var newCode = _rollupPluginBabelHelpers.toConsumableArray(code);
122
- (_inputRefs$current$in = inputRefs.current[index]) === null || _inputRefs$current$in === void 0 || _inputRefs$current$in.classList.remove(CodeField_tokens.classes.itemError);
123
- if (isError) {
124
- var _captionRef$current;
125
- (_captionRef$current = captionRef.current) === null || _captionRef$current === void 0 || _captionRef$current.classList.remove(CodeField_tokens.classes.captionError);
126
- if (codeErrorBehavior === 'keep') {
127
- var _inputContainerRef$cu;
128
- (_inputContainerRef$cu = inputContainerRef.current) === null || _inputContainerRef$cu === void 0 || _inputContainerRef$cu.classList.remove(CodeField_tokens.classes.codeError, CodeField_tokens.classes.codeErrorAnimation);
129
- }
130
- if (setIsError) {
131
- setIsError(false);
132
- }
133
- }
134
- if (!fieldPattern) {
135
- newCode[index] = symbol;
136
- codeSetter(newCode);
137
- if (symbol && index < codeLength - 1) {
138
- var _inputRefs$current2;
139
- (_inputRefs$current2 = inputRefs.current[index + 1]) === null || _inputRefs$current2 === void 0 || _inputRefs$current2.focus();
140
- }
141
- return;
142
- }
143
- if (!symbol) {
144
- newCode[index] = '';
145
- codeSetter(newCode);
146
- return;
147
- }
148
- if (fieldPattern.test(symbol)) {
149
- newCode[index] = symbol.charAt(symbol.length - 1);
150
- codeSetter(newCode);
151
- if (index < codeLength - 1) {
152
- var _inputRefs$current3;
153
- (_inputRefs$current3 = inputRefs.current[index + 1]) === null || _inputRefs$current3 === void 0 || _inputRefs$current3.focus();
154
- }
155
- } else {
156
- newCode[index] = symbol.charAt(symbol.length - 1);
157
- handleItemError.handleItemError({
158
- currentSymbol: symbol,
159
- itemErrorBehavior: itemErrorBehavior,
160
- index: index,
161
- newCode: newCode,
162
- inputRefs: inputRefs,
163
- setCode: setCode,
164
- codeSetter: codeSetter
165
- });
166
- }
167
- };
168
- var handlePaste = function handlePaste(event) {
169
- var _inputRefs$current$ac;
170
- if (disabled) {
171
- return;
172
- }
173
- event.preventDefault();
174
- var rawData = event.clipboardData.getData('text/plain');
175
- var pastedData = (fieldPattern ? rawData.split('').map(function (symb) {
176
- var _symb$match;
177
- return ((_symb$match = symb.match(fieldPattern)) === null || _symb$match === void 0 ? void 0 : _symb$match[0]) || '';
178
- }).filter(Boolean) || [] : rawData.split('')).slice(0, codeLength);
179
- var activeIndex = Math.min(pastedData.length, codeLength - 1);
180
- (_inputRefs$current$ac = inputRefs.current[activeIndex]) === null || _inputRefs$current$ac === void 0 || _inputRefs$current$ac.focus();
181
- codeSetter(pastedData);
182
- };
183
- var handleFullCodeEnter = React.useCallback(function (fullCode) {
184
- if (onFullCodeEnter) {
185
- onFullCodeEnter(fullCode);
186
- }
187
- }, []);
188
- React.useEffect(function () {
189
- inputRefs.current = inputRefs.current.slice(0, codeLength);
190
- }, [codeLength]);
191
- React.useEffect(function () {
192
- if (autoFocus && !disabled) {
193
- var _inputRefs$current$la;
194
- var lastActiveIndex = getLastActiveIndex();
195
- (_inputRefs$current$la = inputRefs.current[lastActiveIndex]) === null || _inputRefs$current$la === void 0 || _inputRefs$current$la.focus();
196
- }
197
- }, [autoFocus]);
198
- useDidMountEffect.useDidMountEffect(function () {
199
- if (handleFullCodeEnter && originalValue.length === codeLength) {
200
- handleFullCodeEnter(originalValue);
201
- }
202
- }, [originalValue, handleFullCodeEnter]);
203
- useDidMountEffect.useDidMountEffect(function () {
204
- if (isError) {
205
- handleCodeError.handleCodeError({
206
- codeLength: codeLength,
207
- codeErrorBehavior: codeErrorBehavior,
208
- currentCode: code,
209
- inputRefs: inputRefs,
210
- inputContainerRef: inputContainerRef,
211
- captionRef: captionRef,
212
- setCode: setCode,
213
- codeSetter: codeSetter
214
- });
215
- }
216
- }, [isError]);
217
- return /*#__PURE__*/React__default.default.createElement(Root, _rollupPluginBabelHelpers.extends({
218
- ref: ref,
219
- view: view,
220
- size: size,
221
- shape: shape,
222
- disabled: disabled,
223
- onClick: handleClick,
224
- className: cls__default.default(className, _rollupPluginBabelHelpers.defineProperty({}, CodeField_tokens.classes.captionAlignLeft, captionAlign === 'left'))
225
- }, rest), /*#__PURE__*/React__default.default.createElement(CodeField_styles.CodeWrapper, {
226
- ref: inputContainerRef
227
- }, _rollupPluginBabelHelpers.toConsumableArray(Array(parts)).map(function (_, partIndex) {
228
- return /*#__PURE__*/React__default.default.createElement(React.Fragment, {
229
- key: partIndex
230
- }, /*#__PURE__*/React__default.default.createElement(CodeField_styles.CodeGroup, {
231
- role: "group"
232
- }, _rollupPluginBabelHelpers.toConsumableArray(Array(codeLength / parts)).map(function (_, i) {
233
- var inputCorrectIndex = i + codeLength / parts * partIndex;
234
- return /*#__PURE__*/React__default.default.createElement(CodeField_styles.ItemInput, _rollupPluginBabelHelpers.extends({
235
- key: partIndex + i + partIndex * i,
236
- ref: function ref(element) {
237
- inputRefs.current[inputCorrectIndex] = element;
238
- },
239
- className: cls__default.default(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, CodeField_tokens.classes.segmented, shape === 'segmented'), CodeField_tokens.classes.hoverEnabled, inputCorrectIndex >= originalValue.length)),
240
- value: code[inputCorrectIndex] || '',
241
- autoComplete: autoComplete,
242
- onChange: function onChange(e) {
243
- handleChange(e, inputCorrectIndex);
244
- },
245
- onKeyDown: function onKeyDown(e) {
246
- handleOnKeyDown(e, inputCorrectIndex);
247
- },
248
- onPaste: handlePaste,
249
- tabIndex: originalValue.length === inputCorrectIndex ? 0 : -1
250
- }, placeholderValue && {
251
- placeholder: placeholderValue[inputCorrectIndex]
252
- }));
253
- })), partIndex !== parts - 1 && (_Separator || (_Separator = /*#__PURE__*/React__default.default.createElement(CodeField_styles.Separator, null))));
254
- })), caption && /*#__PURE__*/React__default.default.createElement(CodeField_styles.CaptionWrapper, {
255
- ref: captionRef,
256
- captionAlign: captionAlign,
257
- widthValue: widthValue
258
- }, caption));
259
- });
260
- };
261
- var codeFieldConfig = {
262
- name: 'CodeField',
263
- tag: 'div',
264
- layout: codeFieldRoot,
265
- base: CodeField_styles.base,
266
- variations: {
267
- view: {
268
- css: base.base
269
- },
270
- size: {
271
- css: base$1.base
272
- },
273
- shape: {
274
- css: base$2.base
275
- },
276
- disabled: {
277
- css: base$3.base,
278
- attrs: true
279
- }
280
- },
281
- defaults: {
282
- size: 'm',
283
- view: 'default',
284
- shape: 'default'
285
- }
286
- };
287
-
288
- exports.codeFieldConfig = codeFieldConfig;
289
- exports.codeFieldRoot = codeFieldRoot;
290
- //# sourceMappingURL=CodeField.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeField.js","sources":["../../../src/components/CodeField/CodeField.tsx"],"sourcesContent":["import React, { forwardRef, Fragment, useCallback, useEffect, useRef, useState } from 'react';\nimport cls from 'classnames';\nimport type { ChangeEvent, KeyboardEvent, ClipboardEvent } from 'react';\nimport type { RootProps } from 'src/engines';\nimport { useDidMountEffect } from 'src/hooks';\nimport { getSizeValueFromProp } from 'src/utils';\n\nimport type { CodeFieldProps } from './CodeField.types';\nimport { BACKSPACE_KEY, FORBIDDEN_KEYS, ONLY_DIGITS_PATTERN } from './utils/constants';\nimport { getCodeValue, getFieldPattern, getPlaceholderValue, handleCodeError, handleItemError } from './utils';\nimport { classes } from './CodeField.tokens';\nimport { base, CaptionWrapper, CodeGroup, CodeWrapper, ItemInput, Separator } from './CodeField.styles';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as shapeCSS } from './variations/_shape/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\n\nexport const codeFieldRoot = (Root: RootProps<HTMLDivElement, CodeFieldProps>) =>\n forwardRef<HTMLInputElement, CodeFieldProps>(\n (\n {\n className,\n value: outerValue,\n placeholder,\n autoFocus,\n codeLength = 6,\n caption,\n captionAlign = 'left',\n width,\n shape = 'default',\n view,\n size,\n disabled,\n isError,\n allowedSymbols = ONLY_DIGITS_PATTERN,\n itemErrorBehavior = 'remove-symbol',\n codeErrorBehavior = 'remove-code',\n autoComplete = 'one-time-code',\n setIsError,\n onChange,\n onFullCodeEnter,\n ...rest\n },\n ref,\n ) => {\n const [code, setCode] = useState<Array<string>>(getCodeValue(codeLength, outerValue || ''));\n const [originalValue, setOriginalValue] = useState<string>(code.join(''));\n\n const inputRefs = useRef<Array<HTMLInputElement>>([]);\n const inputContainerRef = useRef<HTMLDivElement | null>(null);\n const captionRef = useRef<HTMLDivElement | null>(null);\n\n const fieldPattern = getFieldPattern(allowedSymbols);\n const placeholderValue = getPlaceholderValue(codeLength, placeholder);\n const parts = codeLength === 6 ? 2 : 1;\n\n const widthValue = width ? getSizeValueFromProp(width, 'rem') : undefined;\n\n const getLastActiveIndex = () => {\n if (code.length && code.length < codeLength) {\n return code.length;\n }\n\n const lastEmptyIndex = code.findIndex((digit) => digit === '');\n return lastEmptyIndex >= 0 ? lastEmptyIndex : codeLength - 1;\n };\n\n const handleClick = () => {\n if (disabled) {\n return;\n }\n\n const lastActiveIndex = getLastActiveIndex();\n\n if (inputRefs.current[lastActiveIndex]) {\n inputRefs.current[lastActiveIndex].focus();\n }\n };\n\n const handleOnKeyDown = (event: KeyboardEvent<HTMLInputElement>, index: number) => {\n if (disabled) {\n return;\n }\n\n const { key } = event;\n if (FORBIDDEN_KEYS.includes(key)) {\n event.preventDefault();\n\n return;\n }\n\n if (key === BACKSPACE_KEY) {\n if (index > 0 && code[index] === '') {\n inputRefs.current[index - 1]?.focus();\n }\n }\n };\n\n const codeSetter = (newCode: Array<string>) => {\n setCode(newCode);\n setOriginalValue(newCode.join(''));\n\n if (onChange) {\n onChange(newCode.join(''));\n }\n };\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>, index: number) => {\n if (disabled) {\n return;\n }\n\n const rawSymbol = event.currentTarget.value;\n const symbol = rawSymbol.charAt(rawSymbol.length - 1);\n const newCode = [...code];\n\n inputRefs.current[index]?.classList.remove(classes.itemError);\n if (isError) {\n captionRef.current?.classList.remove(classes.captionError);\n\n if (codeErrorBehavior === 'keep') {\n inputContainerRef.current?.classList.remove(classes.codeError, classes.codeErrorAnimation);\n }\n\n if (setIsError) {\n setIsError(false);\n }\n }\n\n if (!fieldPattern) {\n newCode[index] = symbol;\n codeSetter(newCode);\n\n if (symbol && index < codeLength - 1) {\n inputRefs.current[index + 1]?.focus();\n }\n\n return;\n }\n\n if (!symbol) {\n newCode[index] = '';\n codeSetter(newCode);\n\n return;\n }\n\n if (fieldPattern.test(symbol)) {\n newCode[index] = symbol.charAt(symbol.length - 1);\n codeSetter(newCode);\n\n if (index < codeLength - 1) {\n inputRefs.current[index + 1]?.focus();\n }\n } else {\n newCode[index] = symbol.charAt(symbol.length - 1);\n\n handleItemError({\n currentSymbol: symbol,\n itemErrorBehavior,\n index,\n newCode,\n inputRefs,\n setCode,\n codeSetter,\n });\n }\n };\n\n const handlePaste = (event: ClipboardEvent<HTMLInputElement>) => {\n if (disabled) {\n return;\n }\n\n event.preventDefault();\n\n const rawData = event.clipboardData.getData('text/plain');\n\n const pastedData = (fieldPattern\n ? rawData\n .split('')\n .map((symb) => symb.match(fieldPattern)?.[0] || '')\n .filter(Boolean) || []\n : rawData.split('')\n ).slice(0, codeLength);\n\n const activeIndex = Math.min(pastedData.length, codeLength - 1);\n inputRefs.current[activeIndex]?.focus();\n\n codeSetter(pastedData);\n };\n\n const handleFullCodeEnter = useCallback((fullCode: string) => {\n if (onFullCodeEnter) {\n onFullCodeEnter(fullCode);\n }\n }, []);\n\n useEffect(() => {\n inputRefs.current = inputRefs.current.slice(0, codeLength);\n }, [codeLength]);\n\n useEffect(() => {\n if (autoFocus && !disabled) {\n const lastActiveIndex = getLastActiveIndex();\n\n inputRefs.current[lastActiveIndex]?.focus();\n }\n }, [autoFocus]);\n\n useDidMountEffect(() => {\n if (handleFullCodeEnter && originalValue.length === codeLength) {\n handleFullCodeEnter(originalValue);\n }\n }, [originalValue, handleFullCodeEnter]);\n\n useDidMountEffect(() => {\n if (isError) {\n handleCodeError({\n codeLength,\n codeErrorBehavior,\n currentCode: code,\n inputRefs,\n inputContainerRef,\n captionRef,\n setCode,\n codeSetter,\n });\n }\n }, [isError]);\n\n return (\n <Root\n ref={ref}\n view={view}\n size={size}\n shape={shape}\n disabled={disabled}\n onClick={handleClick}\n className={cls(className, {\n [classes.captionAlignLeft]: captionAlign === 'left',\n })}\n {...rest}\n >\n <CodeWrapper ref={inputContainerRef}>\n {[...Array(parts)].map((_, partIndex) => (\n <Fragment key={partIndex}>\n <CodeGroup role=\"group\">\n {[...Array(codeLength / parts)].map((_, i) => {\n const inputCorrectIndex = i + (codeLength / parts) * partIndex;\n\n return (\n <ItemInput\n key={partIndex + i + partIndex * i}\n ref={(element: HTMLInputElement) => {\n inputRefs.current[inputCorrectIndex] = element;\n }}\n className={cls({\n [classes.segmented]: shape === 'segmented',\n [classes.hoverEnabled]: inputCorrectIndex >= originalValue.length,\n })}\n value={code[inputCorrectIndex] || ''}\n autoComplete={autoComplete}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n handleChange(e, inputCorrectIndex);\n }}\n onKeyDown={(e: KeyboardEvent<HTMLInputElement>) => {\n handleOnKeyDown(e, inputCorrectIndex);\n }}\n onPaste={handlePaste}\n tabIndex={originalValue.length === inputCorrectIndex ? 0 : -1}\n {...(placeholderValue && {\n placeholder: placeholderValue[inputCorrectIndex],\n })}\n />\n );\n })}\n </CodeGroup>\n {partIndex !== parts - 1 && <Separator />}\n </Fragment>\n ))}\n </CodeWrapper>\n {caption && (\n <CaptionWrapper ref={captionRef} captionAlign={captionAlign} widthValue={widthValue}>\n {caption}\n </CaptionWrapper>\n )}\n </Root>\n );\n },\n );\n\nexport const codeFieldConfig = {\n name: 'CodeField',\n tag: 'div',\n layout: codeFieldRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n shape: {\n css: shapeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n },\n defaults: {\n size: 'm',\n view: 'default',\n shape: 'default',\n },\n};\n"],"names":["codeFieldRoot","Root","forwardRef","_ref","ref","className","outerValue","value","placeholder","autoFocus","_ref$codeLength","codeLength","caption","_ref$captionAlign","captionAlign","width","_ref$shape","shape","view","size","disabled","isError","_ref$allowedSymbols","allowedSymbols","ONLY_DIGITS_PATTERN","_ref$itemErrorBehavio","itemErrorBehavior","_ref$codeErrorBehavio","codeErrorBehavior","_ref$autoComplete","autoComplete","setIsError","onChange","onFullCodeEnter","rest","_objectWithoutProperties","_excluded","_useState","useState","getCodeValue","_useState2","_slicedToArray","code","setCode","_useState3","join","_useState4","originalValue","setOriginalValue","inputRefs","useRef","inputContainerRef","captionRef","fieldPattern","getFieldPattern","placeholderValue","getPlaceholderValue","parts","widthValue","getSizeValueFromProp","undefined","getLastActiveIndex","length","lastEmptyIndex","findIndex","digit","handleClick","lastActiveIndex","current","focus","handleOnKeyDown","event","index","key","FORBIDDEN_KEYS","includes","preventDefault","BACKSPACE_KEY","_inputRefs$current","codeSetter","newCode","handleChange","_inputRefs$current$in","rawSymbol","currentTarget","symbol","charAt","_toConsumableArray","classList","remove","classes","itemError","_captionRef$current","captionError","_inputContainerRef$cu","codeError","codeErrorAnimation","_inputRefs$current2","test","_inputRefs$current3","handleItemError","currentSymbol","handlePaste","_inputRefs$current$ac","rawData","clipboardData","getData","pastedData","split","map","symb","_symb$match","match","filter","Boolean","slice","activeIndex","Math","min","handleFullCodeEnter","useCallback","fullCode","useEffect","_inputRefs$current$la","useDidMountEffect","handleCodeError","currentCode","React","createElement","_extends","onClick","cls","_defineProperty","captionAlignLeft","CodeWrapper","Array","_","partIndex","Fragment","CodeGroup","role","i","inputCorrectIndex","ItemInput","element","segmented","hoverEnabled","e","onKeyDown","onPaste","tabIndex","_Separator","Separator","CaptionWrapper","codeFieldConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","shapeCSS","disabledCSS","attrs","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;IAiBaA,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,IAA+C,EAAA;AAAA,EAAA,oBACzEC,gBAAU,CACN,UAAAC,IAAA,EAwBIC,GAAG,EACF;AAAA,IAAA,IAvBGC,SAAS,GAAAF,IAAA,CAATE,SAAS;MACFC,UAAU,GAAAH,IAAA,CAAjBI,KAAK;MACLC,WAAW,GAAAL,IAAA,CAAXK,WAAW;MACXC,SAAS,GAAAN,IAAA,CAATM,SAAS;MAAAC,eAAA,GAAAP,IAAA,CACTQ,UAAU;AAAVA,MAAAA,UAAU,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,CAAC,GAAAA,eAAA;MACdE,OAAO,GAAAT,IAAA,CAAPS,OAAO;MAAAC,iBAAA,GAAAV,IAAA,CACPW,YAAY;AAAZA,MAAAA,YAAY,GAAAD,iBAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,iBAAA;MACrBE,KAAK,GAAAZ,IAAA,CAALY,KAAK;MAAAC,UAAA,GAAAb,IAAA,CACLc,KAAK;AAALA,MAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,SAAS,GAAAA,UAAA;MACjBE,IAAI,GAAAf,IAAA,CAAJe,IAAI;MACJC,IAAI,GAAAhB,IAAA,CAAJgB,IAAI;MACJC,QAAQ,GAAAjB,IAAA,CAARiB,QAAQ;MACRC,OAAO,GAAAlB,IAAA,CAAPkB,OAAO;MAAAC,mBAAA,GAAAnB,IAAA,CACPoB,cAAc;AAAdA,MAAAA,cAAc,GAAAD,mBAAA,KAAGE,KAAAA,CAAAA,GAAAA,6BAAmB,GAAAF,mBAAA;MAAAG,qBAAA,GAAAtB,IAAA,CACpCuB,iBAAiB;AAA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BAAc,EAAA;AAACrJ,MAAAA,GAAG,EAAEgD,UAAW;AAACtC,MAAAA,YAAY,EAAEA,YAAa;AAAC4C,MAAAA,UAAU,EAAEA,UAAAA;KACpE9C,EAAAA,OACW,CAElB,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAM8I,eAAe,GAAG;AAC3BC,EAAAA,IAAI,EAAE,WAAW;AACjBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE7J,aAAa;AACrB8J,EAAAA,IAAI,EAAJA,qBAAI;AACJC,EAAAA,UAAU,EAAE;AACR7I,IAAAA,IAAI,EAAE;AACF8I,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACD9I,IAAAA,IAAI,EAAE;AACF6I,MAAAA,GAAG,EAAEE,WAAAA;KACR;AACDjJ,IAAAA,KAAK,EAAE;AACH+I,MAAAA,GAAG,EAAEG,WAAAA;KACR;AACD/I,IAAAA,QAAQ,EAAE;AACN4I,MAAAA,GAAG,EAAEI,WAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNnJ,IAAAA,IAAI,EAAE,GAAG;AACTD,IAAAA,IAAI,EAAE,SAAS;AACfD,IAAAA,KAAK,EAAE,SAAA;AACX,GAAA;AACJ;;;;;"}
@@ -1,57 +0,0 @@
1
- require('./CodeField.styles_7zxgpc.css');
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- var react = require('@linaria/react');
7
-
8
- var base = "b1xx9skx";
9
- var CodeWrapper = /*#__PURE__*/react.styled('div')({
10
- name: "CodeWrapper",
11
- "class": "c1wzspax",
12
- propsAsIs: false
13
- });
14
- var CodeGroup = /*#__PURE__*/react.styled('div')({
15
- name: "CodeGroup",
16
- "class": "c7swj1z",
17
- propsAsIs: false
18
- });
19
- var Separator = /*#__PURE__*/react.styled('div')({
20
- name: "Separator",
21
- "class": "s13uxcg8",
22
- propsAsIs: false
23
- });
24
- var ItemInput = /*#__PURE__*/react.styled('input')({
25
- name: "ItemInput",
26
- "class": "ig5h1kg",
27
- propsAsIs: false
28
- });
29
- var _exp4 = function _exp4() {
30
- return function (_ref) {
31
- var captionAlign = _ref.captionAlign;
32
- return captionAlign;
33
- };
34
- };
35
- var _exp5 = function _exp5() {
36
- return function (_ref2) {
37
- var widthValue = _ref2.widthValue;
38
- return widthValue || 'auto';
39
- };
40
- };
41
- var CaptionWrapper = /*#__PURE__*/react.styled('div')({
42
- name: "CaptionWrapper",
43
- "class": "c1jpzjak",
44
- propsAsIs: false,
45
- vars: {
46
- "c1jpzjak-0": [/*#__PURE__*/_exp4()],
47
- "c1jpzjak-1": [/*#__PURE__*/_exp5()]
48
- }
49
- });
50
-
51
- exports.CaptionWrapper = CaptionWrapper;
52
- exports.CodeGroup = CodeGroup;
53
- exports.CodeWrapper = CodeWrapper;
54
- exports.ItemInput = ItemInput;
55
- exports.Separator = Separator;
56
- exports.base = base;
57
- //# sourceMappingURL=CodeField.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeField.styles.js","sources":["../../../src/components/CodeField/CodeField.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\nimport { styled } from '@linaria/react';\n\nimport { classes, tokens } from './CodeField.tokens';\n\nexport const base = css`\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: min-content;\n align-items: center;\n\n &.${classes.captionAlignLeft} {\n align-items: start;\n }\n`;\n\nexport const CodeWrapper = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport const CodeGroup = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport const Separator = styled.div`\n width: var(${tokens.separatorWidth});\n`;\n\nexport const ItemInput = styled.input`\n box-sizing: border-box;\n appearance: none;\n border: 0;\n padding: 0;\n outline: none;\n pointer-events: none;\n text-align: center;\n`;\n\nexport const CaptionWrapper = styled.div<{ captionAlign: 'left' | 'center'; widthValue?: string }>`\n text-align: ${({ captionAlign }) => captionAlign};\n align-self: ${({ captionAlign }) => captionAlign};\n width: ${({ widthValue }) => widthValue || 'auto'};\n white-space: pre-line;\n`;\n"],"names":["base","CodeWrapper","styled","name","class","propsAsIs","CodeGroup","Separator","ItemInput","_exp4","_ref","captionAlign","_exp5","_ref2","widthValue","CaptionWrapper","vars"],"mappings":";;;;;;AAKO,IAAMA,IAAI,GAUhB,WAAA;AAEM,IAAMC,WAAW,gBAAGC,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,aAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAGhC,EAAA;AAEM,IAAMC,SAAS,gBAAGJ,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,WAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAG9B,EAAA;AAEM,IAAME,SAAS,gBAAGL,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,WAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAE9B,EAAA;AAEM,IAAMG,SAAS,gBAAGN,YAAM,CAAA,OAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,WAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAQ9B,EAAA;AAAC,IAAAI,KAAA,GAtCgBA,SAsChBA,KAAAA,GAAA;AAAA,EAAA,OAIgB,UAAAC,IAAA,EAAA;AAAA,IAAA,IAAGC,YAAAA,GAAAA,IAAAA,CAAAA,YAAAA,CAAAA;AAAAA,IAAAA,OAAmBA,YAAY,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAAA,IAAAC,KAAA,GA1ClCA,SA0CkCA,KAAAA,GAAA;AAAA,EAAA,OACvC,UAAAC,KAAA,EAAA;AAAA,IAAA,IAAGC,UAAAA,GAAAA,KAAAA,CAAAA,UAAAA,CAAAA;IAAAA,OAAiBA,UAAU,IAAI,MAAM,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAH9C,IAAMC,cAAc,gBAAGb,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,gBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAAW,EAAAA,IAAA,EAAA;AAAA,IAAA,YAAA,EAAA,cAElBP,KAAkC,EAAA,CAAA;AAAA,IAAA,YAAA,EAAA,cACvCG,KAAwC,EAAA,CAAA;AAAA,GAAA;AAAA,CAEpD;;;;;;;;;"}
@@ -1,6 +0,0 @@
1
- .b1xx9skx{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;width:-webkit-min-content;width:-moz-min-content;width:min-content;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.b1xx9skx.codefield-caption-align-left{-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;}
2
- .c1wzspax{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
3
- .c7swj1z{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
4
- .s13uxcg8{width:var(--plasma-codefield-separator-width);}
5
- .ig5h1kg{box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;padding:0;outline:none;pointer-events:none;text-align:center;}
6
- .c1jpzjak{text-align:var(--c1jpzjak-0);-webkit-align-self:var(--c1jpzjak-0);-ms-flex-item-align:var(--c1jpzjak-0);align-self:var(--c1jpzjak-0);width:var(--c1jpzjak-1);white-space:pre-line;}
@@ -1,59 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var classes = {
6
- itemError: 'codefield-item-error',
7
- itemErrorAnimation: 'codefield-item-error-animation',
8
- itemErrorFade: 'codefield-item-error-fade',
9
- captionError: 'codefield-caption-error',
10
- codeError: 'codefield-code-error',
11
- codeErrorAnimation: 'codefield-code-error-animation',
12
- codeErrorFade: 'codefield-code-error-fade',
13
- captionAlignLeft: 'codefield-caption-align-left',
14
- hoverEnabled: 'codefield-item-hover-enabled',
15
- segmented: 'codefield-shape-segmented',
16
- "default": 'codefield-shape-default',
17
- disabled: 'codefield-disabled'
18
- };
19
- var tokens = {
20
- captionGap: '--plasma-codefield-caption-gap',
21
- codeItemsGap: '--plasma-codefield-code-item-gap',
22
- separatorWidth: '--plasma-codefield-separator-width',
23
- codeItemWidth: '--plasma-codefield-item-width',
24
- codeItemHeight: '--plasma-codefield-item-height',
25
- fontFamily: '--plasma-codefield-font-family',
26
- fontStyle: '--plasma-codefield-font-style',
27
- fontSize: '--plasma-codefield-font-size',
28
- fontWeight: '--plasma-codefield-font-weight',
29
- letterSpacing: '--plasma-codefield-letter-spacing',
30
- lineHeight: '--plasma-codefield-line-height',
31
- captionFontFamily: '--plasma-codefield-caption-font-family',
32
- captionFontSize: '--plasma-codefield-caption-font-style',
33
- captionFontStyle: '--plasma-codefield-caption-font-size',
34
- captionFontWeight: '--plasma-codefield-caption-font-weight',
35
- captionLetterSpacing: '--plasma-codefield-caption-letter-spacing',
36
- captionLineHeight: '--plasma-codefield-caption-line-height',
37
- borderRadius: '--plasma-codefield-code-item-border-radius',
38
- borderRadiusSegmented: '--plasma-codefield-code-item-border-radius-segmented',
39
- segmentedSideBorderRadius: '--plasma-codefield-code-item-segmented-side-border-radius',
40
- captionColor: '--plasma-codefield-caption-color',
41
- captionColorError: '--plasma-codefield-caption-color-error',
42
- codeColor: '--plasma-codefield-code-color',
43
- codeColorError: '--plasma-codefield-code-color-error',
44
- backgroundColor: '--plasma-codefield-background-color',
45
- backgroundColorHover: '--plasma-codefield-background-color-hover',
46
- backgroundColorFocus: '--plasma-codefield-background-color-focus',
47
- backgroundErrorColor: '--plasma-codefield-background-error-color',
48
- borderWidth: '--plasma-codefield-border-width',
49
- borderColor: '--plasma-codefield-border-color',
50
- borderColorHover: '--plasma-codefield-border-color-hover',
51
- borderColorFocus: '--plasma-codefield-border-color-focus',
52
- borderErrorColor: '--plasma-codefield-border-error-color',
53
- caretColor: '--plasma-codefield-caret-color',
54
- disabledOpacity: '--plasma-codefield-disabled-opacity'
55
- };
56
-
57
- exports.classes = classes;
58
- exports.tokens = tokens;
59
- //# sourceMappingURL=CodeField.tokens.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeField.tokens.js","sources":["../../../src/components/CodeField/CodeField.tokens.ts"],"sourcesContent":["export const classes = {\n itemError: 'codefield-item-error',\n itemErrorAnimation: 'codefield-item-error-animation',\n itemErrorFade: 'codefield-item-error-fade',\n captionError: 'codefield-caption-error',\n codeError: 'codefield-code-error',\n codeErrorAnimation: 'codefield-code-error-animation',\n codeErrorFade: 'codefield-code-error-fade',\n\n captionAlignLeft: 'codefield-caption-align-left',\n\n hoverEnabled: 'codefield-item-hover-enabled',\n\n segmented: 'codefield-shape-segmented',\n default: 'codefield-shape-default',\n\n disabled: 'codefield-disabled',\n};\n\nexport const tokens = {\n captionGap: '--plasma-codefield-caption-gap',\n codeItemsGap: '--plasma-codefield-code-item-gap',\n\n separatorWidth: '--plasma-codefield-separator-width',\n\n codeItemWidth: '--plasma-codefield-item-width',\n codeItemHeight: '--plasma-codefield-item-height',\n\n fontFamily: '--plasma-codefield-font-family',\n fontStyle: '--plasma-codefield-font-style',\n fontSize: '--plasma-codefield-font-size',\n fontWeight: '--plasma-codefield-font-weight',\n letterSpacing: '--plasma-codefield-letter-spacing',\n lineHeight: '--plasma-codefield-line-height',\n\n captionFontFamily: '--plasma-codefield-caption-font-family',\n captionFontSize: '--plasma-codefield-caption-font-style',\n captionFontStyle: '--plasma-codefield-caption-font-size',\n captionFontWeight: '--plasma-codefield-caption-font-weight',\n captionLetterSpacing: '--plasma-codefield-caption-letter-spacing',\n captionLineHeight: '--plasma-codefield-caption-line-height',\n\n borderRadius: '--plasma-codefield-code-item-border-radius',\n borderRadiusSegmented: '--plasma-codefield-code-item-border-radius-segmented',\n segmentedSideBorderRadius: '--plasma-codefield-code-item-segmented-side-border-radius',\n\n captionColor: '--plasma-codefield-caption-color',\n captionColorError: '--plasma-codefield-caption-color-error',\n\n codeColor: '--plasma-codefield-code-color',\n codeColorError: '--plasma-codefield-code-color-error',\n\n backgroundColor: '--plasma-codefield-background-color',\n backgroundColorHover: '--plasma-codefield-background-color-hover',\n backgroundColorFocus: '--plasma-codefield-background-color-focus',\n backgroundErrorColor: '--plasma-codefield-background-error-color',\n\n borderWidth: '--plasma-codefield-border-width',\n borderColor: '--plasma-codefield-border-color',\n borderColorHover: '--plasma-codefield-border-color-hover',\n borderColorFocus: '--plasma-codefield-border-color-focus',\n borderErrorColor: '--plasma-codefield-border-error-color',\n\n caretColor: '--plasma-codefield-caret-color',\n\n disabledOpacity: '--plasma-codefield-disabled-opacity',\n};\n"],"names":["classes","itemError","itemErrorAnimation","itemErrorFade","captionError","codeError","codeErrorAnimation","codeErrorFade","captionAlignLeft","hoverEnabled","segmented","disabled","tokens","captionGap","codeItemsGap","separatorWidth","codeItemWidth","codeItemHeight","fontFamily","fontStyle","fontSize","fontWeight","letterSpacing","lineHeight","captionFontFamily","captionFontSize","captionFontStyle","captionFontWeight","captionLetterSpacing","captionLineHeight","borderRadius","borderRadiusSegmented","segmentedSideBorderRadius","captionColor","captionColorError","codeColor","codeColorError","backgroundColor","backgroundColorHover","backgroundColorFocus","backgroundErrorColor","borderWidth","borderColor","borderColorHover","borderColorFocus","borderErrorColor","caretColor","disabledOpacity"],"mappings":";;;;AAA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A,YAAY,EAAE,kCAAkC;AAChDC,EAAAA,iBAAiB,EAAE,wCAAwC;AAE3DC,EAAAA,SAAS,EAAE,+BAA+B;AAC1CC,EAAAA,cAAc,EAAE,qCAAqC;AAErDC,EAAAA,eAAe,EAAE,qCAAqC;AACtDC,EAAAA,oBAAoB,EAAE,2CAA2C;AACjEC,EAAAA,oBAAoB,EAAE,2CAA2C;AACjEC,EAAAA,oBAAoB,EAAE,2CAA2C;AAEjEC,EAAAA,WAAW,EAAE,iCAAiC;AAC9CC,EAAAA,WAAW,EAAE,iCAAiC;AAC9CC,EAAAA,gBAAgB,EAAE,uCAAuC;AACzDC,EAAAA,gBAAgB,EAAE,uCAAuC;AACzDC,EAAAA,gBAAgB,EAAE,uCAAuC;AAEzDC,EAAAA,UAAU,EAAE,gCAAgC;AAE5CC,EAAAA,eAAe,EAAE,qCAAA;AACrB;;;;;"}
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var ONLY_DIGITS_PATTERN = '^\\d+$';
6
- var ONLY_CHARS_PATTERN = '^[a-zA-Z]+$';
7
- var ONLY_DIGITS_AND_CHARS_PATTERN = '^[a-zA-Z0-9]+$';
8
- var FORBIDDEN_KEYS = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Delete'];
9
- var BACKSPACE_KEY = 'Backspace';
10
- var ANIMATION_TIMEOUT = 300;
11
-
12
- exports.ANIMATION_TIMEOUT = ANIMATION_TIMEOUT;
13
- exports.BACKSPACE_KEY = BACKSPACE_KEY;
14
- exports.FORBIDDEN_KEYS = FORBIDDEN_KEYS;
15
- exports.ONLY_CHARS_PATTERN = ONLY_CHARS_PATTERN;
16
- exports.ONLY_DIGITS_AND_CHARS_PATTERN = ONLY_DIGITS_AND_CHARS_PATTERN;
17
- exports.ONLY_DIGITS_PATTERN = ONLY_DIGITS_PATTERN;
18
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/components/CodeField/utils/constants.ts"],"sourcesContent":["export const ONLY_DIGITS_PATTERN = '^\\\\d+$';\nexport const ONLY_CHARS_PATTERN = '^[a-zA-Z]+$';\nexport const ONLY_DIGITS_AND_CHARS_PATTERN = '^[a-zA-Z0-9]+$';\n\nexport const FORBIDDEN_KEYS = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Delete'];\nexport const BACKSPACE_KEY = 'Backspace';\n\nexport const ANIMATION_TIMEOUT = 300;\n"],"names":["ONLY_DIGITS_PATTERN","ONLY_CHARS_PATTERN","ONLY_DIGITS_AND_CHARS_PATTERN","FORBIDDEN_KEYS","BACKSPACE_KEY","ANIMATION_TIMEOUT"],"mappings":";;;;AAAO,IAAMA,mBAAmB,GAAG,SAAQ;AACpC,IAAMC,kBAAkB,GAAG,cAAa;AACxC,IAAMC,6BAA6B,GAAG,iBAAgB;AAEhDC,IAAAA,cAAc,GAAG,CAAC,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAC;AACpF,IAAMC,aAAa,GAAG,YAAW;AAEjC,IAAMC,iBAAiB,GAAG;;;;;;;;;"}
@@ -1,55 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
6
- var CodeField_tokens = require('../CodeField.tokens.js');
7
- var constants = require('./constants.js');
8
- var initialValuesHelper = require('./initialValuesHelper.js');
9
-
10
- var handleCodeError = function handleCodeError(_ref) {
11
- var _captionRef$current, _captionRef$current2;
12
- var codeLength = _ref.codeLength,
13
- codeErrorBehavior = _ref.codeErrorBehavior,
14
- currentCode = _ref.currentCode,
15
- inputRefs = _ref.inputRefs,
16
- inputContainerRef = _ref.inputContainerRef,
17
- captionRef = _ref.captionRef,
18
- setCode = _ref.setCode,
19
- codeSetter = _ref.codeSetter;
20
- if (!inputContainerRef.current) {
21
- return;
22
- }
23
- switch (codeErrorBehavior) {
24
- case 'keep':
25
- inputContainerRef.current.classList.add(CodeField_tokens.classes.codeError, CodeField_tokens.classes.codeErrorAnimation);
26
- (_captionRef$current = captionRef.current) === null || _captionRef$current === void 0 || _captionRef$current.classList.add(CodeField_tokens.classes.captionError);
27
- setTimeout(function () {
28
- var _inputContainerRef$cu;
29
- var newCode = _rollupPluginBabelHelpers.toConsumableArray(currentCode);
30
- newCode.pop();
31
- codeSetter(newCode);
32
- setCode(currentCode);
33
- (_inputContainerRef$cu = inputContainerRef.current) === null || _inputContainerRef$cu === void 0 || _inputContainerRef$cu.classList.remove(CodeField_tokens.classes.codeErrorAnimation);
34
- setTimeout(function () {
35
- var _inputRefs$current, _inputRefs$current2;
36
- (_inputRefs$current = inputRefs.current[inputRefs.current.length - 1]) === null || _inputRefs$current === void 0 || _inputRefs$current.setSelectionRange(0, 1);
37
- (_inputRefs$current2 = inputRefs.current[inputRefs.current.length - 1]) === null || _inputRefs$current2 === void 0 || _inputRefs$current2.focus();
38
- }, 0);
39
- }, constants.ANIMATION_TIMEOUT);
40
- break;
41
- case 'remove-code':
42
- default:
43
- inputContainerRef.current.classList.add(CodeField_tokens.classes.codeError, CodeField_tokens.classes.codeErrorAnimation, CodeField_tokens.classes.codeErrorFade);
44
- (_captionRef$current2 = captionRef.current) === null || _captionRef$current2 === void 0 || _captionRef$current2.classList.add(CodeField_tokens.classes.captionError);
45
- setTimeout(function () {
46
- var _inputRefs$current$, _inputContainerRef$cu2;
47
- codeSetter(initialValuesHelper.getCodeValue(codeLength, ''));
48
- (_inputRefs$current$ = inputRefs.current[0]) === null || _inputRefs$current$ === void 0 || _inputRefs$current$.focus();
49
- (_inputContainerRef$cu2 = inputContainerRef.current) === null || _inputContainerRef$cu2 === void 0 || _inputContainerRef$cu2.classList.remove(CodeField_tokens.classes.codeError, CodeField_tokens.classes.codeErrorAnimation, CodeField_tokens.classes.codeErrorFade);
50
- }, constants.ANIMATION_TIMEOUT);
51
- }
52
- };
53
-
54
- exports.handleCodeError = handleCodeError;
55
- //# sourceMappingURL=handleCodeError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handleCodeError.js","sources":["../../../../src/components/CodeField/utils/handleCodeError.ts"],"sourcesContent":["import { Dispatch, MutableRefObject, SetStateAction } from 'react';\n\nimport type { CodeErrorBehavior } from '../CodeField.types';\nimport { classes } from '../CodeField.tokens';\n\nimport { ANIMATION_TIMEOUT } from './constants';\nimport { getCodeValue } from './initialValuesHelper';\n\ntype ValidateSymbolsArgs = {\n codeLength: number;\n codeErrorBehavior: CodeErrorBehavior;\n currentCode: Array<string>;\n inputContainerRef: MutableRefObject<HTMLDivElement | null>;\n inputRefs: MutableRefObject<Array<HTMLInputElement | null>>;\n captionRef: MutableRefObject<HTMLDivElement | null>;\n setCode: Dispatch<SetStateAction<Array<string>>>;\n codeSetter: (newCode: Array<string>) => void;\n};\n\nexport const handleCodeError = ({\n codeLength,\n codeErrorBehavior,\n currentCode,\n inputRefs,\n inputContainerRef,\n captionRef,\n setCode,\n codeSetter,\n}: ValidateSymbolsArgs) => {\n if (!inputContainerRef.current) {\n return;\n }\n\n switch (codeErrorBehavior) {\n case 'keep':\n inputContainerRef.current.classList.add(classes.codeError, classes.codeErrorAnimation);\n captionRef.current?.classList.add(classes.captionError);\n\n setTimeout(() => {\n const newCode = [...currentCode];\n\n newCode.pop();\n codeSetter(newCode);\n setCode(currentCode);\n\n inputContainerRef.current?.classList.remove(classes.codeErrorAnimation);\n\n setTimeout(() => {\n inputRefs.current[inputRefs.current.length - 1]?.setSelectionRange(0, 1);\n inputRefs.current[inputRefs.current.length - 1]?.focus();\n }, 0);\n }, ANIMATION_TIMEOUT);\n\n break;\n case 'remove-code':\n default:\n inputContainerRef.current.classList.add(\n classes.codeError,\n classes.codeErrorAnimation,\n classes.codeErrorFade,\n );\n captionRef.current?.classList.add(classes.captionError);\n\n setTimeout(() => {\n codeSetter(getCodeValue(codeLength, ''));\n\n inputRefs.current[0]?.focus();\n inputContainerRef.current?.classList.remove(\n classes.codeError,\n classes.codeErrorAnimation,\n classes.codeErrorFade,\n );\n }, ANIMATION_TIMEOUT);\n }\n};\n"],"names":["handleCodeError","_ref","_captionRef$current","_captionRef$current2","codeLength","codeErrorBehavior","currentCode","inputRefs","inputContainerRef","captionRef","setCode","codeSetter","current","classList","add","classes","codeError","codeErrorAnimation","captionError","setTimeout","_inputContainerRef$cu","newCode","_toConsumableArray","pop","remove","_inputRefs$current","_inputRefs$current2","length","setSelectionRange","focus","ANIMATION_TIMEOUT","codeErrorFade","_inputRefs$current$","_inputContainerRef$cu2","getCodeValue"],"mappings":";;;;;;;;;IAmBaA,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EASD;EAAA,IAAAC,mBAAA,EAAAC,oBAAA,CAAA;AAAA,EAAA,IARvBC,UAAU,GAAAH,IAAA,CAAVG,UAAU;IACVC,iBAAiB,GAAAJ,IAAA,CAAjBI,iBAAiB;IACjBC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IACXC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,iBAAiB,GAAAP,IAAA,CAAjBO,iBAAiB;IACjBC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,OAAO,GAAAT,IAAA,CAAPS,OAAO;IACPC,UAAU,GAAAV,IAAA,CAAVU,UAAU,CAAA;AAEV,EAAA,IAAI,CAACH,iBAAiB,CAACI,OAAO,EAAE;AAC5B,IAAA,OAAA;AACJ,GAAA;AAEA,EAAA,QAAQP,iBAAiB;AACrB,IAAA,KAAK,MAAM;AACPG,MAAAA,iBAAiB,CAACI,OAAO,CAACC,SAAS,CAACC,GAAG,CAACC,wBAAO,CAACC,SAAS,EAAED,wBAAO,CAACE,kBAAkB,CAAC,CAAA;AACtF,MAAA,CAAAf,mBAAA,GAAAO,UAAU,CAACG,OAAO,cAAAV,mBAAA,KAAA,KAAA,CAAA,IAAlBA,mBAAA,CAAoBW,SAAS,CAACC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