@salutejs/plasma-new-hope 0.324.0-dev.0 → 0.325.0-canary.1941.15208820474.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 (206) hide show
  1. package/cjs/components/CodeField/CodeField.css +14 -0
  2. package/cjs/components/CodeField/CodeField.js +290 -0
  3. package/cjs/components/CodeField/CodeField.js.map +1 -0
  4. package/cjs/components/CodeField/CodeField.styles.js +57 -0
  5. package/cjs/components/CodeField/CodeField.styles.js.map +1 -0
  6. package/cjs/components/CodeField/CodeField.styles_7zxgpc.css +6 -0
  7. package/cjs/components/CodeField/CodeField.tokens.js +59 -0
  8. package/cjs/components/CodeField/CodeField.tokens.js.map +1 -0
  9. package/cjs/components/CodeField/utils/constants.js +18 -0
  10. package/cjs/components/CodeField/utils/constants.js.map +1 -0
  11. package/cjs/components/CodeField/utils/handleCodeError.js +55 -0
  12. package/cjs/components/CodeField/utils/handleCodeError.js.map +1 -0
  13. package/cjs/components/CodeField/utils/handleItemError.js +53 -0
  14. package/cjs/components/CodeField/utils/handleItemError.js.map +1 -0
  15. package/cjs/components/CodeField/utils/initialValuesHelper.js +33 -0
  16. package/cjs/components/CodeField/utils/initialValuesHelper.js.map +1 -0
  17. package/cjs/components/CodeField/variations/_disabled/base.js +9 -0
  18. package/cjs/components/CodeField/variations/_disabled/base.js.map +1 -0
  19. package/cjs/components/CodeField/variations/_disabled/base_obsae2.css +1 -0
  20. package/cjs/components/CodeField/variations/_shape/base.js +9 -0
  21. package/cjs/components/CodeField/variations/_shape/base.js.map +1 -0
  22. package/cjs/components/CodeField/variations/_shape/base_1scsyya.css +1 -0
  23. package/cjs/components/CodeField/variations/_size/base.js +9 -0
  24. package/cjs/components/CodeField/variations/_size/base.js.map +1 -0
  25. package/cjs/components/CodeField/variations/_size/base_1wrvbr5.css +1 -0
  26. package/cjs/components/CodeField/variations/_view/base.js +9 -0
  27. package/cjs/components/CodeField/variations/_view/base.js.map +1 -0
  28. package/cjs/components/CodeField/variations/_view/base_9a5yza.css +1 -0
  29. package/cjs/components/NumberInput/ui/Input/Input.js +0 -3
  30. package/cjs/components/NumberInput/ui/Input/Input.js.map +1 -1
  31. package/cjs/index.css +15 -0
  32. package/cjs/index.js +10 -0
  33. package/cjs/index.js.map +1 -1
  34. package/emotion/cjs/components/CodeField/CodeField.js +299 -0
  35. package/emotion/cjs/components/CodeField/CodeField.styles.js +65 -0
  36. package/emotion/cjs/components/CodeField/CodeField.template-doc.mdx +150 -0
  37. package/emotion/cjs/components/CodeField/CodeField.tokens.js +57 -0
  38. package/emotion/cjs/components/CodeField/CodeField.types.js +5 -0
  39. package/emotion/cjs/components/CodeField/index.js +50 -0
  40. package/emotion/cjs/components/CodeField/utils/constants.js +12 -0
  41. package/emotion/cjs/components/CodeField/utils/handleCodeError.js +58 -0
  42. package/emotion/cjs/components/CodeField/utils/handleItemError.js +56 -0
  43. package/emotion/cjs/components/CodeField/utils/index.js +38 -0
  44. package/emotion/cjs/components/CodeField/utils/initialValuesHelper.js +30 -0
  45. package/emotion/cjs/components/CodeField/variations/_disabled/base.js +9 -0
  46. package/emotion/cjs/components/CodeField/variations/_disabled/tokens.json +4 -0
  47. package/emotion/cjs/components/CodeField/variations/_shape/base.js +10 -0
  48. package/emotion/cjs/components/CodeField/variations/_shape/tokens.json +1 -0
  49. package/emotion/cjs/components/CodeField/variations/_size/base.js +10 -0
  50. package/emotion/cjs/components/CodeField/variations/_size/tokens.json +19 -0
  51. package/emotion/cjs/components/CodeField/variations/_view/base.js +10 -0
  52. package/emotion/cjs/components/CodeField/variations/_view/tokens.json +0 -0
  53. package/emotion/cjs/components/NumberInput/ui/Input/Input.js +0 -3
  54. package/emotion/cjs/examples/plasma_b2c/components/CodeField/CodeField.config.js +31 -0
  55. package/emotion/cjs/examples/plasma_b2c/components/CodeField/CodeField.js +11 -0
  56. package/emotion/cjs/examples/plasma_b2c/components/CodeField/CodeField.stories.tsx +107 -0
  57. package/emotion/cjs/examples/plasma_web/components/CodeField/CodeField.config.js +31 -0
  58. package/emotion/cjs/examples/plasma_web/components/CodeField/CodeField.js +11 -0
  59. package/emotion/cjs/examples/plasma_web/components/CodeField/CodeField.stories.tsx +107 -0
  60. package/emotion/cjs/index.js +11 -0
  61. package/emotion/es/components/CodeField/CodeField.js +290 -0
  62. package/emotion/es/components/CodeField/CodeField.styles.js +58 -0
  63. package/emotion/es/components/CodeField/CodeField.template-doc.mdx +150 -0
  64. package/emotion/es/components/CodeField/CodeField.tokens.js +51 -0
  65. package/emotion/es/components/CodeField/CodeField.types.js +1 -0
  66. package/emotion/es/components/CodeField/index.js +3 -0
  67. package/emotion/es/components/CodeField/utils/constants.js +6 -0
  68. package/emotion/es/components/CodeField/utils/handleCodeError.js +52 -0
  69. package/emotion/es/components/CodeField/utils/handleItemError.js +50 -0
  70. package/emotion/es/components/CodeField/utils/index.js +3 -0
  71. package/emotion/es/components/CodeField/utils/initialValuesHelper.js +24 -0
  72. package/emotion/es/components/CodeField/variations/_disabled/base.js +3 -0
  73. package/emotion/es/components/CodeField/variations/_disabled/tokens.json +4 -0
  74. package/emotion/es/components/CodeField/variations/_shape/base.js +4 -0
  75. package/emotion/es/components/CodeField/variations/_shape/tokens.json +1 -0
  76. package/emotion/es/components/CodeField/variations/_size/base.js +4 -0
  77. package/emotion/es/components/CodeField/variations/_size/tokens.json +19 -0
  78. package/emotion/es/components/CodeField/variations/_view/base.js +4 -0
  79. package/emotion/es/components/CodeField/variations/_view/tokens.json +0 -0
  80. package/emotion/es/components/NumberInput/ui/Input/Input.js +0 -3
  81. package/emotion/es/examples/plasma_b2c/components/CodeField/CodeField.config.js +25 -0
  82. package/emotion/es/examples/plasma_b2c/components/CodeField/CodeField.js +5 -0
  83. package/emotion/es/examples/plasma_b2c/components/CodeField/CodeField.stories.tsx +107 -0
  84. package/emotion/es/examples/plasma_web/components/CodeField/CodeField.config.js +25 -0
  85. package/emotion/es/examples/plasma_web/components/CodeField/CodeField.js +5 -0
  86. package/emotion/es/examples/plasma_web/components/CodeField/CodeField.stories.tsx +107 -0
  87. package/emotion/es/index.js +2 -1
  88. package/es/components/CodeField/CodeField.css +14 -0
  89. package/es/components/CodeField/CodeField.js +280 -0
  90. package/es/components/CodeField/CodeField.js.map +1 -0
  91. package/es/components/CodeField/CodeField.styles.js +48 -0
  92. package/es/components/CodeField/CodeField.styles.js.map +1 -0
  93. package/es/components/CodeField/CodeField.styles_7zxgpc.css +6 -0
  94. package/es/components/CodeField/CodeField.tokens.js +54 -0
  95. package/es/components/CodeField/CodeField.tokens.js.map +1 -0
  96. package/es/components/CodeField/utils/constants.js +9 -0
  97. package/es/components/CodeField/utils/constants.js.map +1 -0
  98. package/es/components/CodeField/utils/handleCodeError.js +51 -0
  99. package/es/components/CodeField/utils/handleCodeError.js.map +1 -0
  100. package/es/components/CodeField/utils/handleItemError.js +49 -0
  101. package/es/components/CodeField/utils/handleItemError.js.map +1 -0
  102. package/es/components/CodeField/utils/initialValuesHelper.js +27 -0
  103. package/es/components/CodeField/utils/initialValuesHelper.js.map +1 -0
  104. package/es/components/CodeField/variations/_disabled/base.js +5 -0
  105. package/es/components/CodeField/variations/_disabled/base.js.map +1 -0
  106. package/es/components/CodeField/variations/_disabled/base_obsae2.css +1 -0
  107. package/es/components/CodeField/variations/_shape/base.js +5 -0
  108. package/es/components/CodeField/variations/_shape/base.js.map +1 -0
  109. package/es/components/CodeField/variations/_shape/base_1scsyya.css +1 -0
  110. package/es/components/CodeField/variations/_size/base.js +5 -0
  111. package/es/components/CodeField/variations/_size/base.js.map +1 -0
  112. package/es/components/CodeField/variations/_size/base_1wrvbr5.css +1 -0
  113. package/es/components/CodeField/variations/_view/base.js +5 -0
  114. package/es/components/CodeField/variations/_view/base.js.map +1 -0
  115. package/es/components/CodeField/variations/_view/base_9a5yza.css +1 -0
  116. package/es/components/NumberInput/ui/Input/Input.js +0 -3
  117. package/es/components/NumberInput/ui/Input/Input.js.map +1 -1
  118. package/es/index.css +15 -0
  119. package/es/index.js +3 -0
  120. package/es/index.js.map +1 -1
  121. package/package.json +2 -2
  122. package/styled-components/cjs/components/CodeField/CodeField.js +299 -0
  123. package/styled-components/cjs/components/CodeField/CodeField.styles.js +38 -0
  124. package/styled-components/cjs/components/CodeField/CodeField.template-doc.mdx +150 -0
  125. package/styled-components/cjs/components/CodeField/CodeField.tokens.js +57 -0
  126. package/styled-components/cjs/components/CodeField/CodeField.types.js +5 -0
  127. package/styled-components/cjs/components/CodeField/index.js +50 -0
  128. package/styled-components/cjs/components/CodeField/utils/constants.js +12 -0
  129. package/styled-components/cjs/components/CodeField/utils/handleCodeError.js +58 -0
  130. package/styled-components/cjs/components/CodeField/utils/handleItemError.js +56 -0
  131. package/styled-components/cjs/components/CodeField/utils/index.js +38 -0
  132. package/styled-components/cjs/components/CodeField/utils/initialValuesHelper.js +30 -0
  133. package/styled-components/cjs/components/CodeField/variations/_disabled/base.js +9 -0
  134. package/styled-components/cjs/components/CodeField/variations/_disabled/tokens.json +4 -0
  135. package/styled-components/cjs/components/CodeField/variations/_shape/base.js +10 -0
  136. package/styled-components/cjs/components/CodeField/variations/_shape/tokens.json +1 -0
  137. package/styled-components/cjs/components/CodeField/variations/_size/base.js +10 -0
  138. package/styled-components/cjs/components/CodeField/variations/_size/tokens.json +19 -0
  139. package/styled-components/cjs/components/CodeField/variations/_view/base.js +10 -0
  140. package/styled-components/cjs/components/CodeField/variations/_view/tokens.json +0 -0
  141. package/styled-components/cjs/components/NumberInput/ui/Input/Input.js +0 -3
  142. package/styled-components/cjs/examples/plasma_b2c/components/CodeField/CodeField.config.js +31 -0
  143. package/styled-components/cjs/examples/plasma_b2c/components/CodeField/CodeField.js +11 -0
  144. package/styled-components/cjs/examples/plasma_b2c/components/CodeField/CodeField.stories.tsx +107 -0
  145. package/styled-components/cjs/examples/plasma_web/components/CodeField/CodeField.config.js +31 -0
  146. package/styled-components/cjs/examples/plasma_web/components/CodeField/CodeField.js +11 -0
  147. package/styled-components/cjs/examples/plasma_web/components/CodeField/CodeField.stories.tsx +107 -0
  148. package/styled-components/cjs/index.js +11 -0
  149. package/styled-components/es/components/CodeField/CodeField.js +290 -0
  150. package/styled-components/es/components/CodeField/CodeField.styles.js +30 -0
  151. package/styled-components/es/components/CodeField/CodeField.template-doc.mdx +150 -0
  152. package/styled-components/es/components/CodeField/CodeField.tokens.js +51 -0
  153. package/styled-components/es/components/CodeField/CodeField.types.js +1 -0
  154. package/styled-components/es/components/CodeField/index.js +3 -0
  155. package/styled-components/es/components/CodeField/utils/constants.js +6 -0
  156. package/styled-components/es/components/CodeField/utils/handleCodeError.js +52 -0
  157. package/styled-components/es/components/CodeField/utils/handleItemError.js +50 -0
  158. package/styled-components/es/components/CodeField/utils/index.js +3 -0
  159. package/styled-components/es/components/CodeField/utils/initialValuesHelper.js +24 -0
  160. package/styled-components/es/components/CodeField/variations/_disabled/base.js +3 -0
  161. package/styled-components/es/components/CodeField/variations/_disabled/tokens.json +4 -0
  162. package/styled-components/es/components/CodeField/variations/_shape/base.js +4 -0
  163. package/styled-components/es/components/CodeField/variations/_shape/tokens.json +1 -0
  164. package/styled-components/es/components/CodeField/variations/_size/base.js +4 -0
  165. package/styled-components/es/components/CodeField/variations/_size/tokens.json +19 -0
  166. package/styled-components/es/components/CodeField/variations/_view/base.js +4 -0
  167. package/styled-components/es/components/CodeField/variations/_view/tokens.json +0 -0
  168. package/styled-components/es/components/NumberInput/ui/Input/Input.js +0 -3
  169. package/styled-components/es/examples/plasma_b2c/components/CodeField/CodeField.config.js +25 -0
  170. package/styled-components/es/examples/plasma_b2c/components/CodeField/CodeField.js +5 -0
  171. package/styled-components/es/examples/plasma_b2c/components/CodeField/CodeField.stories.tsx +107 -0
  172. package/styled-components/es/examples/plasma_web/components/CodeField/CodeField.config.js +25 -0
  173. package/styled-components/es/examples/plasma_web/components/CodeField/CodeField.js +5 -0
  174. package/styled-components/es/examples/plasma_web/components/CodeField/CodeField.stories.tsx +107 -0
  175. package/styled-components/es/index.js +2 -1
  176. package/types/components/CodeField/CodeField.d.ts +69 -0
  177. package/types/components/CodeField/CodeField.d.ts.map +1 -0
  178. package/types/components/CodeField/CodeField.styles.d.ts +11 -0
  179. package/types/components/CodeField/CodeField.styles.d.ts.map +1 -0
  180. package/types/components/CodeField/CodeField.tokens.d.ts +52 -0
  181. package/types/components/CodeField/CodeField.tokens.d.ts.map +1 -0
  182. package/types/components/CodeField/CodeField.types.d.ts +93 -0
  183. package/types/components/CodeField/CodeField.types.d.ts.map +1 -0
  184. package/types/components/CodeField/index.d.ts +4 -0
  185. package/types/components/CodeField/index.d.ts.map +1 -0
  186. package/types/components/CodeField/utils/constants.d.ts +7 -0
  187. package/types/components/CodeField/utils/constants.d.ts.map +1 -0
  188. package/types/components/CodeField/utils/handleCodeError.d.ts +15 -0
  189. package/types/components/CodeField/utils/handleCodeError.d.ts.map +1 -0
  190. package/types/components/CodeField/utils/handleItemError.d.ts +14 -0
  191. package/types/components/CodeField/utils/handleItemError.d.ts.map +1 -0
  192. package/types/components/CodeField/utils/index.d.ts +4 -0
  193. package/types/components/CodeField/utils/index.d.ts.map +1 -0
  194. package/types/components/CodeField/utils/initialValuesHelper.d.ts +4 -0
  195. package/types/components/CodeField/utils/initialValuesHelper.d.ts.map +1 -0
  196. package/types/components/CodeField/variations/_disabled/base.d.ts +2 -0
  197. package/types/components/CodeField/variations/_disabled/base.d.ts.map +1 -0
  198. package/types/components/CodeField/variations/_shape/base.d.ts +2 -0
  199. package/types/components/CodeField/variations/_shape/base.d.ts.map +1 -0
  200. package/types/components/CodeField/variations/_size/base.d.ts +2 -0
  201. package/types/components/CodeField/variations/_size/base.d.ts.map +1 -0
  202. package/types/components/CodeField/variations/_view/base.d.ts +2 -0
  203. package/types/components/CodeField/variations/_view/base.d.ts.map +1 -0
  204. package/types/components/NumberInput/ui/Input/Input.d.ts.map +1 -1
  205. package/types/index.d.ts +1 -0
  206. package/types/index.d.ts.map +1 -1
@@ -0,0 +1,53 @@
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
+
9
+ var handleItemError = function handleItemError(_ref) {
10
+ var _inputRefs$current$in, _inputRefs$current$in4;
11
+ var currentSymbol = _ref.currentSymbol,
12
+ itemErrorBehavior = _ref.itemErrorBehavior,
13
+ index = _ref.index,
14
+ newCode = _ref.newCode,
15
+ inputRefs = _ref.inputRefs,
16
+ setCode = _ref.setCode,
17
+ codeSetter = _ref.codeSetter;
18
+ if (!inputRefs.current[index] || currentSymbol === ' ') {
19
+ return;
20
+ }
21
+ switch (itemErrorBehavior) {
22
+ case 'keep':
23
+ setCode(newCode);
24
+ (_inputRefs$current$in = inputRefs.current[index]) === null || _inputRefs$current$in === void 0 || _inputRefs$current$in.classList.add(CodeField_tokens.classes.itemError, CodeField_tokens.classes.itemErrorAnimation);
25
+ setTimeout(function () {
26
+ var _inputRefs$current$in2;
27
+ (_inputRefs$current$in2 = inputRefs.current[index]) === null || _inputRefs$current$in2 === void 0 || _inputRefs$current$in2.classList.remove(CodeField_tokens.classes.itemErrorAnimation);
28
+ setTimeout(function () {
29
+ var _inputRefs$current$in3;
30
+ return (_inputRefs$current$in3 = inputRefs.current[index]) === null || _inputRefs$current$in3 === void 0 ? void 0 : _inputRefs$current$in3.setSelectionRange(0, 1);
31
+ }, 0);
32
+ }, constants.ANIMATION_TIMEOUT);
33
+ break;
34
+ case 'forbid-enter':
35
+ newCode[index] = '';
36
+ codeSetter(newCode);
37
+ break;
38
+ case 'remove-symbol':
39
+ default:
40
+ setCode(newCode);
41
+ (_inputRefs$current$in4 = inputRefs.current[index]) === null || _inputRefs$current$in4 === void 0 || _inputRefs$current$in4.classList.add(CodeField_tokens.classes.itemError, CodeField_tokens.classes.itemErrorFade, CodeField_tokens.classes.itemErrorAnimation);
42
+ setTimeout(function () {
43
+ var _inputRefs$current$in5;
44
+ var updatedCode = _rollupPluginBabelHelpers.toConsumableArray(newCode);
45
+ updatedCode[index] = '';
46
+ codeSetter(updatedCode);
47
+ (_inputRefs$current$in5 = inputRefs.current[index]) === null || _inputRefs$current$in5 === void 0 || _inputRefs$current$in5.classList.remove(CodeField_tokens.classes.itemError, CodeField_tokens.classes.itemErrorFade, CodeField_tokens.classes.itemErrorAnimation);
48
+ }, constants.ANIMATION_TIMEOUT);
49
+ }
50
+ };
51
+
52
+ exports.handleItemError = handleItemError;
53
+ //# sourceMappingURL=handleItemError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleItemError.js","sources":["../../../../src/components/CodeField/utils/handleItemError.ts"],"sourcesContent":["import { Dispatch, MutableRefObject, SetStateAction } from 'react';\n\nimport type { ItemErrorBehavior } from '../CodeField.types';\nimport { classes } from '../CodeField.tokens';\n\nimport { ANIMATION_TIMEOUT } from './constants';\n\ntype ValidateSymbolsArgs = {\n currentSymbol: string;\n itemErrorBehavior: ItemErrorBehavior;\n index: number;\n newCode: Array<string>;\n inputRefs: MutableRefObject<Array<HTMLInputElement | null>>;\n setCode: Dispatch<SetStateAction<Array<string>>>;\n codeSetter: (newCode: Array<string>) => void;\n};\n\nexport const handleItemError = ({\n currentSymbol,\n itemErrorBehavior,\n index,\n newCode,\n inputRefs,\n setCode,\n codeSetter,\n}: ValidateSymbolsArgs) => {\n if (!inputRefs.current[index] || currentSymbol === ' ') {\n return;\n }\n\n switch (itemErrorBehavior) {\n case 'keep':\n setCode(newCode);\n inputRefs.current[index]?.classList.add(classes.itemError, classes.itemErrorAnimation);\n\n setTimeout(() => {\n inputRefs.current[index]?.classList.remove(classes.itemErrorAnimation);\n\n setTimeout(() => inputRefs.current[index]?.setSelectionRange(0, 1), 0);\n }, ANIMATION_TIMEOUT);\n\n break;\n case 'forbid-enter':\n newCode[index] = '';\n codeSetter(newCode);\n\n break;\n case 'remove-symbol':\n default:\n setCode(newCode);\n inputRefs.current[index]?.classList.add(\n classes.itemError,\n classes.itemErrorFade,\n classes.itemErrorAnimation,\n );\n\n setTimeout(() => {\n const updatedCode = [...newCode];\n updatedCode[index] = '';\n\n codeSetter(updatedCode);\n\n inputRefs.current[index]?.classList.remove(\n classes.itemError,\n classes.itemErrorFade,\n classes.itemErrorAnimation,\n );\n }, ANIMATION_TIMEOUT);\n }\n};\n"],"names":["handleItemError","_ref","_inputRefs$current$in","_inputRefs$current$in4","currentSymbol","itemErrorBehavior","index","newCode","inputRefs","setCode","codeSetter","current","classList","add","classes","itemError","itemErrorAnimation","setTimeout","_inputRefs$current$in2","remove","_inputRefs$current$in3","setSelectionRange","ANIMATION_TIMEOUT","itemErrorFade","_inputRefs$current$in5","updatedCode","_toConsumableArray"],"mappings":";;;;;;;;IAiBaA,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAQD;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,CAAA;AAAA,EAAA,IAPvBC,aAAa,GAAAH,IAAA,CAAbG,aAAa;IACbC,iBAAiB,GAAAJ,IAAA,CAAjBI,iBAAiB;IACjBC,KAAK,GAAAL,IAAA,CAALK,KAAK;IACLC,OAAO,GAAAN,IAAA,CAAPM,OAAO;IACPC,SAAS,GAAAP,IAAA,CAATO,SAAS;IACTC,OAAO,GAAAR,IAAA,CAAPQ,OAAO;IACPC,UAAU,GAAAT,IAAA,CAAVS,UAAU,CAAA;EAEV,IAAI,CAACF,SAAS,CAACG,OAAO,CAACL,KAAK,CAAC,IAAIF,aAAa,KAAK,GAAG,EAAE;AACpD,IAAA,OAAA;AACJ,GAAA;AAEA,EAAA,QAAQC,iBAAiB;AACrB,IAAA,KAAK,MAAM;MACPI,OAAO,CAACF,OAAO,CAAC,CAAA;MAChB,CAAAL,qBAAA,GAAAM,SAAS,CAACG,OAAO,CAACL,KAAK,CAAC,MAAAJ,IAAAA,IAAAA,qBAAA,KAAxBA,KAAAA,CAAAA,IAAAA,qBAAA,CAA0BU,SAAS,CAACC,GAAG,CAACC,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,CAAOnB,OAAO,CAAC,CAAA;AAChCkB,QAAAA,WAAW,CAACnB,KAAK,CAAC,GAAG,EAAE,CAAA;QAEvBI,UAAU,CAACe,WAAW,CAAC,CAAA;AAEvB,QAAA,CAAAD,sBAAA,GAAAhB,SAAS,CAACG,OAAO,CAACL,KAAK,CAAC,MAAAkB,IAAAA,IAAAA,sBAAA,KAAxBA,KAAAA,CAAAA,IAAAA,sBAAA,CAA0BZ,SAAS,CAACO,MAAM,CACtCL,wBAAO,CAACC,SAAS,EACjBD,wBAAO,CAACS,aAAa,EACrBT,wBAAO,CAACE,kBACZ,CAAC,CAAA;OACJ,EAAEM,2BAAiB,CAAC,CAAA;AAC7B,GAAA;AACJ;;;;"}
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var getFieldPattern = function getFieldPattern(allowedSymbols) {
6
+ if (!allowedSymbols) {
7
+ return null;
8
+ }
9
+ if (typeof allowedSymbols === 'string') {
10
+ return new RegExp(allowedSymbols, 'g');
11
+ }
12
+ return allowedSymbols;
13
+ };
14
+ var getCodeValue = function getCodeValue(codeLength, value) {
15
+ if (!value.length) {
16
+ return new Array(codeLength).fill('');
17
+ }
18
+ return value.slice(0, codeLength).split('');
19
+ };
20
+ var getPlaceholderValue = function getPlaceholderValue(codeLength, placeholder) {
21
+ if (!placeholder || typeof placeholder !== 'string') {
22
+ return null;
23
+ }
24
+ if (placeholder.length === 1) {
25
+ return Array(codeLength).fill(placeholder);
26
+ }
27
+ return placeholder.slice(0, codeLength).split('');
28
+ };
29
+
30
+ exports.getCodeValue = getCodeValue;
31
+ exports.getFieldPattern = getFieldPattern;
32
+ exports.getPlaceholderValue = getPlaceholderValue;
33
+ //# sourceMappingURL=initialValuesHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initialValuesHelper.js","sources":["../../../../src/components/CodeField/utils/initialValuesHelper.ts"],"sourcesContent":["export const getFieldPattern = (allowedSymbols: RegExp | string) => {\n if (!allowedSymbols) {\n return null;\n }\n\n if (typeof allowedSymbols === 'string') {\n return new RegExp(allowedSymbols, 'g');\n }\n\n return allowedSymbols;\n};\n\nexport const getCodeValue = (codeLength: number, value: string): Array<string> => {\n if (!value.length) {\n return new Array(codeLength).fill('');\n }\n\n return value.slice(0, codeLength).split('');\n};\n\nexport const getPlaceholderValue = (codeLength: number, placeholder?: string): null | string[] => {\n if (!placeholder || typeof placeholder !== 'string') {\n return null;\n }\n\n if (placeholder.length === 1) {\n return Array(codeLength).fill(placeholder);\n }\n\n return placeholder.slice(0, codeLength).split('');\n};\n"],"names":["getFieldPattern","allowedSymbols","RegExp","getCodeValue","codeLength","value","length","Array","fill","slice","split","getPlaceholderValue","placeholder"],"mappings":";;;;IAAaA,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,cAA+B,EAAK;EAChE,IAAI,CAACA,cAAc,EAAE;AACjB,IAAA,OAAO,IAAI,CAAA;AACf,GAAA;AAEA,EAAA,IAAI,OAAOA,cAAc,KAAK,QAAQ,EAAE;AACpC,IAAA,OAAO,IAAIC,MAAM,CAACD,cAAc,EAAE,GAAG,CAAC,CAAA;AAC1C,GAAA;AAEA,EAAA,OAAOA,cAAc,CAAA;AACzB,EAAC;AAEM,IAAME,YAAY,GAAG,SAAfA,YAAYA,CAAIC,UAAkB,EAAEC,KAAa,EAAoB;AAC9E,EAAA,IAAI,CAACA,KAAK,CAACC,MAAM,EAAE;IACf,OAAO,IAAIC,KAAK,CAACH,UAAU,CAAC,CAACI,IAAI,CAAC,EAAE,CAAC,CAAA;AACzC,GAAA;AAEA,EAAA,OAAOH,KAAK,CAACI,KAAK,CAAC,CAAC,EAAEL,UAAU,CAAC,CAACM,KAAK,CAAC,EAAE,CAAC,CAAA;AAC/C,EAAC;AAEM,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIP,UAAkB,EAAEQ,WAAoB,EAAsB;AAC9F,EAAA,IAAI,CAACA,WAAW,IAAI,OAAOA,WAAW,KAAK,QAAQ,EAAE;AACjD,IAAA,OAAO,IAAI,CAAA;AACf,GAAA;AAEA,EAAA,IAAIA,WAAW,CAACN,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAOC,KAAK,CAACH,UAAU,CAAC,CAACI,IAAI,CAACI,WAAW,CAAC,CAAA;AAC9C,GAAA;AAEA,EAAA,OAAOA,WAAW,CAACH,KAAK,CAAC,CAAC,EAAEL,UAAU,CAAC,CAACM,KAAK,CAAC,EAAE,CAAC,CAAA;AACrD;;;;;;"}
@@ -0,0 +1,9 @@
1
+ require('./base_obsae2.css');
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var base = "b3zd5bu";
7
+
8
+ exports.base = base;
9
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sources":["../../../../../src/components/CodeField/variations/_disabled/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../../CodeField.tokens';\n\nexport const base = css`\n &&[disabled] {\n opacity: var(${tokens.disabledOpacity});\n cursor: not-allowed;\n\n & > * {\n pointer-events: none;\n }\n }\n`;\n"],"names":["base"],"mappings":";;;;AAIO,IAAMA,IAAI,GAShB;;;;"}
@@ -0,0 +1 @@
1
+ .b3zd5bu.b3zd5bu[disabled]{opacity:var(--plasma-codefield-disabled-opacity);cursor:not-allowed;}.b3zd5bu.b3zd5bu[disabled] > *{pointer-events:none;}
@@ -0,0 +1,9 @@
1
+ require('./base_1scsyya.css');
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var base = "b103qcna";
7
+
8
+ exports.base = base;
9
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sources":["../../../../../src/components/CodeField/variations/_shape/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens, classes } from '../../CodeField.tokens';\nimport { ItemInput } from '../../CodeField.styles';\n\nexport const base = css`\n ${ItemInput} {\n border-radius: var(${tokens.borderRadius});\n\n &.${classes.segmented} {\n border-radius: var(${tokens.borderRadiusSegmented});\n\n &:first-child {\n border-top-left-radius: var(${tokens.segmentedSideBorderRadius});\n border-bottom-left-radius: var(${tokens.segmentedSideBorderRadius});\n }\n\n &:last-child {\n border-top-right-radius: var(${tokens.segmentedSideBorderRadius});\n border-bottom-right-radius: var(${tokens.segmentedSideBorderRadius});\n }\n }\n }\n`;\n"],"names":["base"],"mappings":";;;;AAKO,IAAMA,IAAI,GAkBhB;;;;"}
@@ -0,0 +1 @@
1
+ .b103qcna .ig5h1kg{border-radius:var(--plasma-codefield-code-item-border-radius);}.b103qcna .ig5h1kg.codefield-shape-segmented{border-radius:var(--plasma-codefield-code-item-border-radius-segmented);}.b103qcna .ig5h1kg.codefield-shape-segmented:first-child{border-top-left-radius:var(--plasma-codefield-code-item-segmented-side-border-radius);border-bottom-left-radius:var(--plasma-codefield-code-item-segmented-side-border-radius);}.b103qcna .ig5h1kg.codefield-shape-segmented:last-child{border-top-right-radius:var(--plasma-codefield-code-item-segmented-side-border-radius);border-bottom-right-radius:var(--plasma-codefield-code-item-segmented-side-border-radius);}
@@ -0,0 +1,9 @@
1
+ require('./base_1wrvbr5.css');
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var base = "bkkdah0";
7
+
8
+ exports.base = base;
9
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sources":["../../../../../src/components/CodeField/variations/_size/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { CaptionWrapper, CodeGroup, CodeWrapper, ItemInput } from '../../CodeField.styles';\nimport { tokens } from '../../CodeField.tokens';\n\nexport const base = css`\n gap: var(${tokens.captionGap});\n\n ${CodeWrapper}, ${CodeGroup} {\n gap: var(${tokens.codeItemsGap});\n }\n\n ${ItemInput} {\n width: var(${tokens.codeItemWidth});\n height: var(${tokens.codeItemHeight});\n\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.letterSpacing});\n line-height: var(${tokens.lineHeight});\n }\n\n ${CaptionWrapper} {\n font-family: var(${tokens.captionFontFamily});\n font-size: var(${tokens.captionFontSize});\n font-style: var(${tokens.captionFontStyle});\n font-weight: var(${tokens.captionFontWeight});\n letter-spacing: var(${tokens.captionLetterSpacing});\n line-height: var(${tokens.captionLineHeight});\n }\n`;\n"],"names":["base"],"mappings":";;;;AAKO,IAAMA,IAAI,GA2BhB;;;;"}
@@ -0,0 +1 @@
1
+ .bkkdah0{gap:var(--plasma-codefield-caption-gap);}.bkkdah0 .c1wzspax,.bkkdah0 .c7swj1z{gap:var(--plasma-codefield-code-item-gap);}.bkkdah0 .ig5h1kg{width:var(--plasma-codefield-item-width);height:var(--plasma-codefield-item-height);font-family:var(--plasma-codefield-font-family);font-size:var(--plasma-codefield-font-size);font-style:var(--plasma-codefield-font-style);font-weight:var(--plasma-codefield-font-weight);-webkit-letter-spacing:var(--plasma-codefield-letter-spacing);-moz-letter-spacing:var(--plasma-codefield-letter-spacing);-ms-letter-spacing:var(--plasma-codefield-letter-spacing);letter-spacing:var(--plasma-codefield-letter-spacing);line-height:var(--plasma-codefield-line-height);}.bkkdah0 .c1jpzjak{font-family:var(--plasma-codefield-caption-font-family);font-size:var(--plasma-codefield-caption-font-style);font-style:var(--plasma-codefield-caption-font-size);font-weight:var(--plasma-codefield-caption-font-weight);-webkit-letter-spacing:var(--plasma-codefield-caption-letter-spacing);-moz-letter-spacing:var(--plasma-codefield-caption-letter-spacing);-ms-letter-spacing:var(--plasma-codefield-caption-letter-spacing);letter-spacing:var(--plasma-codefield-caption-letter-spacing);line-height:var(--plasma-codefield-caption-line-height);}
@@ -0,0 +1,9 @@
1
+ require('./base_9a5yza.css');
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var base = "b1g41h91";
7
+
8
+ exports.base = base;
9
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sources":["../../../../../src/components/CodeField/variations/_view/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { CaptionWrapper, ItemInput } from '../../CodeField.styles';\nimport { classes, tokens } from '../../CodeField.tokens';\n\nexport const base = css`\n ${CaptionWrapper} {\n color: var(${tokens.captionColor});\n\n &.${classes.captionError} {\n color: var(${tokens.captionColorError});\n }\n }\n\n ${ItemInput} {\n color: var(${tokens.codeColor});\n caret-color: var(${tokens.caretColor});\n background-color: var(${tokens.backgroundColor});\n box-shadow: inset 0 0 0 var(${tokens.borderWidth}) var(${tokens.borderColor});\n }\n\n &:hover {\n .${classes.hoverEnabled} {\n background-color: var(${tokens.backgroundColorHover});\n box-shadow: inset 0 0 0 var(${tokens.borderWidth}) var(${tokens.borderColorHover});\n }\n }\n\n &:focus-within {\n ${ItemInput}:focus-within {\n background-color: var(${tokens.backgroundColorFocus});\n box-shadow: inset 0 0 0 var(${tokens.borderWidth}) var(${tokens.borderColorFocus});\n }\n }\n\n && .${classes.codeErrorAnimation} {\n animation: shakingError 0.3s forwards;\n }\n\n && .${classes.codeError} {\n ${ItemInput} {\n color: var(${tokens.codeColorError});\n background-color: var(${tokens.backgroundErrorColor});\n box-shadow: inset 0 0 0 var(${tokens.borderWidth}) var(${tokens.borderErrorColor});\n }\n\n &:focus-within {\n ${ItemInput} {\n background-color: var(${tokens.backgroundErrorColor});\n box-shadow: inset 0 0 0 var(${tokens.borderWidth}) var(${tokens.borderErrorColor});\n }\n }\n\n &.${classes.codeErrorFade} {\n ${ItemInput} {\n animation: fadeError 0.3s forwards;\n }\n }\n }\n\n && .${classes.itemErrorAnimation} {\n animation: shakingError 0.3s forwards;\n }\n\n && .${classes.itemError}, && .${classes.itemError}:focus-within {\n color: var(${tokens.codeColorError});\n background-color: var(${tokens.backgroundErrorColor});\n box-shadow: inset 0 0 0 var(${tokens.borderWidth}) var(${tokens.borderErrorColor});\n\n &.${classes.codeErrorFade} {\n animation: shakingError 0.3s forwards fadeError 0.3s forwards;\n }\n }\n\n @keyframes shakingError {\n 14% {\n transform: translateX(-0.125rem);\n }\n 28% {\n transform: translateX(0.125rem);\n }\n 42% {\n transform: translateX(-0.125rem);\n }\n 57% {\n transform: translateX(0.125rem);\n }\n 71% {\n transform: translateX(-0.125rem);\n }\n 85% {\n transform: translateX(0.125rem);\n }\n 100% {\n transform: translateX(-0.125rem);\n }\n }\n\n @keyframes fadeError {\n 50% {\n color: var(${tokens.codeColorError});\n }\n 100% {\n color: transparent;\n }\n }\n`;\n"],"names":["base"],"mappings":";;;;AAKO,IAAMA,IAAI,GAqGhB;;;;"}
@@ -0,0 +1 @@
1
+ .b1g41h91 .c1jpzjak{color:var(--plasma-codefield-caption-color);}.b1g41h91 .c1jpzjak.codefield-caption-error{color:var(--plasma-codefield-caption-color-error);}.b1g41h91 .ig5h1kg{color:var(--plasma-codefield-code-color);caret-color:var(--plasma-codefield-caret-color);background-color:var(--plasma-codefield-background-color);box-shadow:inset 0 0 0 var(--plasma-codefield-border-width) var(--plasma-codefield-border-color);}.b1g41h91:hover .codefield-item-hover-enabled{background-color:var(--plasma-codefield-background-color-hover);box-shadow:inset 0 0 0 var(--plasma-codefield-border-width) var(--plasma-codefield-border-color-hover);}.b1g41h91:focus-within .ig5h1kg:focus-within{background-color:var(--plasma-codefield-background-color-focus);box-shadow:inset 0 0 0 var(--plasma-codefield-border-width) var(--plasma-codefield-border-color-focus);}.b1g41h91.b1g41h91 .codefield-code-error-animation{-webkit-animation:shakingError-b1g41h91 0.3s forwards;animation:shakingError-b1g41h91 0.3s forwards;}.b1g41h91.b1g41h91 .codefield-code-error .ig5h1kg{color:var(--plasma-codefield-code-color-error);background-color:var(--plasma-codefield-background-error-color);box-shadow:inset 0 0 0 var(--plasma-codefield-border-width) var(--plasma-codefield-border-error-color);}.b1g41h91.b1g41h91 .codefield-code-error:focus-within .ig5h1kg{background-color:var(--plasma-codefield-background-error-color);box-shadow:inset 0 0 0 var(--plasma-codefield-border-width) var(--plasma-codefield-border-error-color);}.b1g41h91.b1g41h91 .codefield-code-error.codefield-code-error-fade .ig5h1kg{-webkit-animation:fadeError-b1g41h91 0.3s forwards;animation:fadeError-b1g41h91 0.3s forwards;}.b1g41h91.b1g41h91 .codefield-item-error-animation{-webkit-animation:shakingError-b1g41h91 0.3s forwards;animation:shakingError-b1g41h91 0.3s forwards;}.b1g41h91.b1g41h91 .codefield-item-error,.b1g41h91.b1g41h91 .codefield-item-error:focus-within{color:var(--plasma-codefield-code-color-error);background-color:var(--plasma-codefield-background-error-color);box-shadow:inset 0 0 0 var(--plasma-codefield-border-width) var(--plasma-codefield-border-error-color);}.b1g41h91.b1g41h91 .codefield-item-error.codefield-code-error-fade,.b1g41h91.b1g41h91 .codefield-item-error:focus-within.codefield-code-error-fade{-webkit-animation:shakingError-b1g41h91 0.3s forwards fadeError-b1g41h91 0.3s forwards;animation:shakingError-b1g41h91 0.3s forwards fadeError-b1g41h91 0.3s forwards;}@-webkit-keyframes shakingError-b1g41h91{14%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}28%{-webkit-transform:translateX(0.125rem);-ms-transform:translateX(0.125rem);transform:translateX(0.125rem);}42%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}57%{-webkit-transform:translateX(0.125rem);-ms-transform:translateX(0.125rem);transform:translateX(0.125rem);}71%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}85%{-webkit-transform:translateX(0.125rem);-ms-transform:translateX(0.125rem);transform:translateX(0.125rem);}100%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}}@keyframes shakingError-b1g41h91{14%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}28%{-webkit-transform:translateX(0.125rem);-ms-transform:translateX(0.125rem);transform:translateX(0.125rem);}42%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}57%{-webkit-transform:translateX(0.125rem);-ms-transform:translateX(0.125rem);transform:translateX(0.125rem);}71%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}85%{-webkit-transform:translateX(0.125rem);-ms-transform:translateX(0.125rem);transform:translateX(0.125rem);}100%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}}@-webkit-keyframes fadeError-b1g41h91{50%{color:var(--plasma-codefield-code-color-error);}100%{color:transparent;}}@keyframes fadeError-b1g41h91{50%{color:var(--plasma-codefield-code-color-error);}100%{color:transparent;}}
@@ -133,14 +133,11 @@ var NumberInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
133
133
  }
134
134
  return;
135
135
  }
136
- console.log('here');
137
136
  var isValid = index.numberSchema.test(cleanValue);
138
137
  if (!isValid) {
139
- console.log('not valid', cleanValue);
140
138
  setValues(event, lastValidValue);
141
139
  return;
142
140
  }
143
- console.log('valid!', cleanValue);
144
141
  if (textWrapperRef !== null && textWrapperRef !== void 0 && textWrapperRef.current && wrapperRef !== null && wrapperRef !== void 0 && wrapperRef.current && (textWrapperRef === null || textWrapperRef === void 0 || (_textWrapperRef$curre = textWrapperRef.current) === null || _textWrapperRef$curre === void 0 ? void 0 : _textWrapperRef$curre.clientWidth) > (wrapperRef === null || wrapperRef === void 0 || (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.clientWidth)) {
145
142
  wrapperRef.current.scrollLeft = textWrapperRef.current.offsetWidth - textWrapperRef.current.offsetLeft || 0;
146
143
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sources":["../../../../../src/components/NumberInput/ui/Input/Input.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport type { KeyboardEvent, ChangeEvent, FocusEvent } from 'react';\nimport { useForkRef } from '@salutejs/plasma-core';\n\nimport { classes } from '../../NumberInput.tokens';\nimport { cx, isNumber } from '../../../../utils';\nimport { useDidMountEffect } from '../../../../hooks';\nimport { defaultCharacterWidth, excludingNumberSchema, getPreciseValue, numberSchema } from '../../utils';\nimport { keyCodes } from '../../../../utils/constants';\n\nimport type { InputProps } from './Input.types';\nimport {\n AdditionalText,\n Input,\n InputWrapper,\n DynamicInput,\n InputWidthHelper,\n TextWrapper,\n StyledSpinner,\n Loader,\n} from './Input.styles';\n\nexport const NumberInput = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n value,\n precision,\n min,\n max,\n isLoading,\n loader,\n disabled,\n segmentation,\n textBefore,\n textAfter,\n isManualInput,\n isInputFocused,\n setIsInputFocused,\n setIsAnimationRun,\n setInnerValue,\n onChange,\n onBlur,\n onKeyDown,\n ...rest\n },\n ref,\n ) => {\n const [dynamicWidth, setDynamicWidth] = useState(value ? `${String(value).length}ch` : defaultCharacterWidth);\n const [lastValidValue, setLastValidValue] = useState<number | string>(Number(value));\n const [errorClass, setErrorClass] = useState<string | undefined>(undefined);\n const [errorValue, setErrorValue] = useState<number>();\n\n const inputHelperRef = useRef<HTMLSpanElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const textWrapperRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const inputForkRef = useForkRef(inputRef, ref);\n\n const solidViewClass = segmentation === 'solid' ? classes.solidView : undefined;\n const manualInputClass = isManualInput ? classes.manualInput : undefined;\n\n const getInputWidth = (firstRender = true) => {\n if (!firstRender && inputHelperRef.current?.clientWidth) {\n return `${inputHelperRef.current?.clientWidth}px`;\n }\n\n if (value) {\n return `${String(value).length}ch`;\n }\n\n return defaultCharacterWidth;\n };\n\n const setValues = (event: ChangeEvent<HTMLInputElement> | null, newValue: number | string) => {\n setLastValidValue(newValue);\n setInnerValue(newValue);\n\n if (onChange) {\n onChange(event, newValue);\n }\n };\n\n const validateValue = (newValue: number | string) => {\n if (!newValue || !isNumber(newValue)) {\n setValues(null, lastValidValue);\n setIsAnimationRun(false);\n return;\n }\n\n const resValue = Number(newValue);\n if (max !== undefined && resValue > max) {\n setErrorClass(classes.errorAnimation);\n setErrorValue(max);\n setIsAnimationRun(true);\n return;\n }\n\n if (min !== undefined && resValue < min) {\n setErrorClass(classes.errorAnimation);\n setErrorValue(min);\n setIsAnimationRun(true);\n return;\n }\n\n if (String(newValue).endsWith('.')) {\n setValues(null, Number(newValue));\n setIsAnimationRun(false);\n return;\n }\n\n if (precision !== undefined) {\n const preciseNewValue = Number(getPreciseValue(newValue, precision));\n setValues(null, preciseNewValue);\n }\n\n setIsAnimationRun(false);\n };\n\n const handleManualInputChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (!isManualInput || disabled) {\n return;\n }\n\n setIsAnimationRun(true);\n\n const { value: newValue } = event.target;\n\n if (!newValue) {\n setInnerValue('');\n\n if (onChange) {\n onChange(event, '');\n }\n return;\n }\n\n const cleanValue = newValue.replace(excludingNumberSchema, '');\n if (cleanValue.endsWith('.') || cleanValue === '-') {\n setInnerValue(cleanValue);\n\n if (onChange) {\n onChange(event, cleanValue);\n }\n return;\n }\n\n console.log('here');\n const isValid = numberSchema.test(cleanValue);\n\n if (!isValid) {\n console.log('not valid', cleanValue);\n setValues(event, lastValidValue);\n return;\n }\n console.log('valid!', cleanValue);\n\n if (\n textWrapperRef?.current &&\n wrapperRef?.current &&\n textWrapperRef?.current?.clientWidth > wrapperRef?.current?.clientWidth\n ) {\n wrapperRef.current.scrollLeft =\n textWrapperRef.current.offsetWidth - textWrapperRef.current.offsetLeft || 0;\n }\n\n setValues(event, cleanValue);\n };\n\n const handleClickInputWrapper = () => {\n if (!isManualInput || !inputRef.current) {\n return;\n }\n\n if (!isInputFocused) {\n inputRef.current.select();\n }\n\n setIsInputFocused(true);\n };\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n validateValue(value);\n setIsInputFocused(false);\n\n if (onBlur) {\n onBlur(event);\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (!isManualInput || disabled) {\n return;\n }\n\n if (event.keyCode === keyCodes.Enter) {\n event.preventDefault();\n\n validateValue(value);\n\n if (onKeyDown) {\n onKeyDown(event);\n }\n }\n };\n\n const handleEndErrorAnimation = (correctValue: number) => {\n setIsAnimationRun(false);\n setIsInputFocused(false);\n\n setErrorClass(undefined);\n setValues(null, correctValue);\n };\n\n useEffect(() => {\n setDynamicWidth(getInputWidth());\n }, []);\n\n useDidMountEffect(() => {\n setDynamicWidth(getInputWidth(false));\n }, [value]);\n\n return (\n <InputWrapper\n ref={wrapperRef}\n className={cx(solidViewClass, errorClass, manualInputClass)}\n isManualInput={Boolean(isManualInput)}\n onClick={handleClickInputWrapper}\n >\n <TextWrapper ref={textWrapperRef}>\n {!isLoading && textBefore && (\n <AdditionalText className={classes.textBefore}>{textBefore}</AdditionalText>\n )}\n {isLoading ? (\n <Loader>{loader || <StyledSpinner />}</Loader>\n ) : (\n <DynamicInput>\n <Input\n ref={inputForkRef}\n dynamicWidth={dynamicWidth}\n value={value}\n isManualInput={Boolean(isManualInput)}\n tabIndex={disabled || !isManualInput ? -1 : 0}\n onChange={handleManualInputChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onAnimationEnd={() => handleEndErrorAnimation(Number(errorValue))}\n {...rest}\n />\n <InputWidthHelper ref={inputHelperRef}>{value}</InputWidthHelper>\n </DynamicInput>\n )}\n {!isLoading && textAfter && (\n <AdditionalText className={classes.textAfter}>{textAfter}</AdditionalText>\n )}\n </TextWrapper>\n </InputWrapper>\n );\n },\n);\n"],"names":["NumberInput","forwardRef","_ref","ref","value","precision","min","max","isLoading","loader","disabled","segmentation","textBefore","textAfter","isManualInput","isInputFocused","setIsInputFocused","setIsAnimationRun","setInnerValue","onChange","onBlur","onKeyDown","rest","_objectWithoutProperties","_excluded","_useState","useState","concat","String","length","defaultCharacterWidth","_useState2","_slicedToArray","dynamicWidth","setDynamicWidth","_useState3","Number","_useState4","lastValidValue","setLastValidValue","_useState5","undefined","_useState6","errorClass","setErrorClass","_useState7","_useState8","errorValue","setErrorValue","inputHelperRef","useRef","wrapperRef","textWrapperRef","inputRef","inputForkRef","useForkRef","solidViewClass","classes","solidView","manualInputClass","manualInput","getInputWidth","_inputHelperRef$curre","firstRender","arguments","current","clientWidth","_inputHelperRef$curre2","setValues","event","newValue","validateValue","isNumber","resValue","errorAnimation","endsWith","preciseNewValue","getPreciseValue","handleManualInputChange","_textWrapperRef$curre","_wrapperRef$current","target","cleanValue","replace","excludingNumberSchema","console","log","isValid","numberSchema","test","scrollLeft","offsetWidth","offsetLeft","handleClickInputWrapper","select","handleBlur","handleKeyDown","keyCode","keyCodes","Enter","preventDefault","handleEndErrorAnimation","correctValue","useEffect","useDidMountEffect","React","createElement","InputWrapper","className","cx","Boolean","onClick","TextWrapper","AdditionalText","Loader","_StyledSpinner","StyledSpinner","DynamicInput","Input","_extends","tabIndex","onAnimationEnd","InputWidthHelper"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBO,IAAMA,WAAW,gBAAGC,gBAAU,CACjC,UAAAC,IAAA,EAsBIC,GAAG,EACF;AAAA,EAAA,IArBGC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,GAAG,GAAAJ,IAAA,CAAHI,GAAG;IACHC,GAAG,GAAAL,IAAA,CAAHK,GAAG;IACHC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,MAAM,GAAAP,IAAA,CAANO,MAAM;IACNC,QAAQ,GAAAR,IAAA,CAARQ,QAAQ;IACRC,YAAY,GAAAT,IAAA,CAAZS,YAAY;IACZC,UAAU,GAAAV,IAAA,CAAVU,UAAU;IACVC,SAAS,GAAAX,IAAA,CAATW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aAAA,CAACU,0BAAa,EAAE,IAAA,CAAC,CAAS,CAAC,gBAE9CX,sBAAA,CAAAC,aAAA,CAACW,yBAAY,qBACTZ,sBAAA,CAAAC,aAAA,CAACY,kBAAK,EAAAC,iCAAA,CAAA;AACFpH,IAAAA,GAAG,EAAEmD,YAAa;AAClBrB,IAAAA,YAAY,EAAEA,YAAa;AAC3B7B,IAAAA,KAAK,EAAEA,KAAM;AACbU,IAAAA,aAAa,EAAEgG,OAAO,CAAChG,aAAa,CAAE;IACtC0G,QAAQ,EAAE9G,QAAQ,IAAI,CAACI,aAAa,GAAG,CAAC,CAAC,GAAG,CAAE;AAC9CK,IAAAA,QAAQ,EAAE2D,uBAAwB;AAClC1D,IAAAA,MAAM,EAAE2E,UAAW;AACnB1E,IAAAA,SAAS,EAAE2E,aAAc;IACzByB,cAAc,EAAE,SAAAA,cAAA,GAAA;AAAA,MAAA,OAAMpB,uBAAuB,CAACjE,MAAM,CAACW,UAAU,CAAC,CAAC,CAAA;AAAA,KAAA;GAC7DzB,EAAAA,IAAI,CACX,CAAC,eACFmF,sBAAA,CAAAC,aAAA,CAACgB,6BAAgB,EAAA;AAACvH,IAAAA,GAAG,EAAE8C,cAAAA;AAAe,GAAA,EAAE7C,KAAwB,CACtD,CACjB,EACA,CAACI,SAAS,IAAIK,SAAS,iBACpB4F,sBAAA,CAAAC,aAAA,CAACO,2BAAc,EAAA;IAACL,SAAS,EAAEnD,0BAAO,CAAC5C,SAAAA;GAAYA,EAAAA,SAA0B,CAEpE,CACH,CAAC,CAAA;AAEvB,CACJ;;;;"}
1
+ {"version":3,"file":"Input.js","sources":["../../../../../src/components/NumberInput/ui/Input/Input.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport type { KeyboardEvent, ChangeEvent, FocusEvent } from 'react';\nimport { useForkRef } from '@salutejs/plasma-core';\n\nimport { classes } from '../../NumberInput.tokens';\nimport { cx, isNumber } from '../../../../utils';\nimport { useDidMountEffect } from '../../../../hooks';\nimport { defaultCharacterWidth, excludingNumberSchema, getPreciseValue, numberSchema } from '../../utils';\nimport { keyCodes } from '../../../../utils/constants';\n\nimport type { InputProps } from './Input.types';\nimport {\n AdditionalText,\n Input,\n InputWrapper,\n DynamicInput,\n InputWidthHelper,\n TextWrapper,\n StyledSpinner,\n Loader,\n} from './Input.styles';\n\nexport const NumberInput = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n value,\n precision,\n min,\n max,\n isLoading,\n loader,\n disabled,\n segmentation,\n textBefore,\n textAfter,\n isManualInput,\n isInputFocused,\n setIsInputFocused,\n setIsAnimationRun,\n setInnerValue,\n onChange,\n onBlur,\n onKeyDown,\n ...rest\n },\n ref,\n ) => {\n const [dynamicWidth, setDynamicWidth] = useState(value ? `${String(value).length}ch` : defaultCharacterWidth);\n const [lastValidValue, setLastValidValue] = useState<number | string>(Number(value));\n const [errorClass, setErrorClass] = useState<string | undefined>(undefined);\n const [errorValue, setErrorValue] = useState<number>();\n\n const inputHelperRef = useRef<HTMLSpanElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const textWrapperRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const inputForkRef = useForkRef(inputRef, ref);\n\n const solidViewClass = segmentation === 'solid' ? classes.solidView : undefined;\n const manualInputClass = isManualInput ? classes.manualInput : undefined;\n\n const getInputWidth = (firstRender = true) => {\n if (!firstRender && inputHelperRef.current?.clientWidth) {\n return `${inputHelperRef.current?.clientWidth}px`;\n }\n\n if (value) {\n return `${String(value).length}ch`;\n }\n\n return defaultCharacterWidth;\n };\n\n const setValues = (event: ChangeEvent<HTMLInputElement> | null, newValue: number | string) => {\n setLastValidValue(newValue);\n setInnerValue(newValue);\n\n if (onChange) {\n onChange(event, newValue);\n }\n };\n\n const validateValue = (newValue: number | string) => {\n if (!newValue || !isNumber(newValue)) {\n setValues(null, lastValidValue);\n setIsAnimationRun(false);\n return;\n }\n\n const resValue = Number(newValue);\n if (max !== undefined && resValue > max) {\n setErrorClass(classes.errorAnimation);\n setErrorValue(max);\n setIsAnimationRun(true);\n return;\n }\n\n if (min !== undefined && resValue < min) {\n setErrorClass(classes.errorAnimation);\n setErrorValue(min);\n setIsAnimationRun(true);\n return;\n }\n\n if (String(newValue).endsWith('.')) {\n setValues(null, Number(newValue));\n setIsAnimationRun(false);\n return;\n }\n\n if (precision !== undefined) {\n const preciseNewValue = Number(getPreciseValue(newValue, precision));\n setValues(null, preciseNewValue);\n }\n\n setIsAnimationRun(false);\n };\n\n const handleManualInputChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (!isManualInput || disabled) {\n return;\n }\n\n setIsAnimationRun(true);\n\n const { value: newValue } = event.target;\n\n if (!newValue) {\n setInnerValue('');\n\n if (onChange) {\n onChange(event, '');\n }\n return;\n }\n\n const cleanValue = newValue.replace(excludingNumberSchema, '');\n if (cleanValue.endsWith('.') || cleanValue === '-') {\n setInnerValue(cleanValue);\n\n if (onChange) {\n onChange(event, cleanValue);\n }\n return;\n }\n\n const isValid = numberSchema.test(cleanValue);\n\n if (!isValid) {\n setValues(event, lastValidValue);\n return;\n }\n\n if (\n textWrapperRef?.current &&\n wrapperRef?.current &&\n textWrapperRef?.current?.clientWidth > wrapperRef?.current?.clientWidth\n ) {\n wrapperRef.current.scrollLeft =\n textWrapperRef.current.offsetWidth - textWrapperRef.current.offsetLeft || 0;\n }\n\n setValues(event, cleanValue);\n };\n\n const handleClickInputWrapper = () => {\n if (!isManualInput || !inputRef.current) {\n return;\n }\n\n if (!isInputFocused) {\n inputRef.current.select();\n }\n\n setIsInputFocused(true);\n };\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n validateValue(value);\n setIsInputFocused(false);\n\n if (onBlur) {\n onBlur(event);\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (!isManualInput || disabled) {\n return;\n }\n\n if (event.keyCode === keyCodes.Enter) {\n event.preventDefault();\n\n validateValue(value);\n\n if (onKeyDown) {\n onKeyDown(event);\n }\n }\n };\n\n const handleEndErrorAnimation = (correctValue: number) => {\n setIsAnimationRun(false);\n setIsInputFocused(false);\n\n setErrorClass(undefined);\n setValues(null, correctValue);\n };\n\n useEffect(() => {\n setDynamicWidth(getInputWidth());\n }, []);\n\n useDidMountEffect(() => {\n setDynamicWidth(getInputWidth(false));\n }, [value]);\n\n return (\n <InputWrapper\n ref={wrapperRef}\n className={cx(solidViewClass, errorClass, manualInputClass)}\n isManualInput={Boolean(isManualInput)}\n onClick={handleClickInputWrapper}\n >\n <TextWrapper ref={textWrapperRef}>\n {!isLoading && textBefore && (\n <AdditionalText className={classes.textBefore}>{textBefore}</AdditionalText>\n )}\n {isLoading ? (\n <Loader>{loader || <StyledSpinner />}</Loader>\n ) : (\n <DynamicInput>\n <Input\n ref={inputForkRef}\n dynamicWidth={dynamicWidth}\n value={value}\n isManualInput={Boolean(isManualInput)}\n tabIndex={disabled || !isManualInput ? -1 : 0}\n onChange={handleManualInputChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onAnimationEnd={() => handleEndErrorAnimation(Number(errorValue))}\n {...rest}\n />\n <InputWidthHelper ref={inputHelperRef}>{value}</InputWidthHelper>\n </DynamicInput>\n )}\n {!isLoading && textAfter && (\n <AdditionalText className={classes.textAfter}>{textAfter}</AdditionalText>\n )}\n </TextWrapper>\n </InputWrapper>\n );\n },\n);\n"],"names":["NumberInput","forwardRef","_ref","ref","value","precision","min","max","isLoading","loader","disabled","segmentation","textBefore","textAfter","isManualInput","isInputFocused","setIsInputFocused","setIsAnimationRun","setInnerValue","onChange","onBlur","onKeyDown","rest","_objectWithoutProperties","_excluded","_useState","useState","concat","String","length","defaultCharacterWidth","_useState2","_slicedToArray","dynamicWidth","setDynamicWidth","_useState3","Number","_useState4","lastValidValue","setLastValidValue","_useState5","undefined","_useState6","errorClass","setErrorClass","_useState7","_useState8","errorValue","setErrorValue","inputHelperRef","useRef","wrapperRef","textWrapperRef","inputRef","inputForkRef","useForkRef","solidViewClass","classes","solidView","manualInputClass","manualInput","getInputWidth","_inputHelperRef$curre","firstRender","arguments","current","clientWidth","_inputHelperRef$curre2","setValues","event","newValue","validateValue","isNumber","resValue","errorAnimation","endsWith","preciseNewValue","getPreciseValue","handleManualInputChange","_textWrapperRef$curre","_wrapperRef$current","target","cleanValue","replace","excludingNumberSchema","isValid","numberSchema","test","scrollLeft","offsetWidth","offsetLeft","handleClickInputWrapper","select","handleBlur","handleKeyDown","keyCode","keyCodes","Enter","preventDefault","handleEndErrorAnimation","correctValue","useEffect","useDidMountEffect","React","createElement","InputWrapper","className","cx","Boolean","onClick","TextWrapper","AdditionalText","Loader","_StyledSpinner","StyledSpinner","DynamicInput","Input","_extends","tabIndex","onAnimationEnd","InputWidthHelper"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBO,IAAMA,WAAW,gBAAGC,gBAAU,CACjC,UAAAC,IAAA,EAsBIC,GAAG,EACF;AAAA,EAAA,IArBGC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,GAAG,GAAAJ,IAAA,CAAHI,GAAG;IACHC,GAAG,GAAAL,IAAA,CAAHK,GAAG;IACHC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,MAAM,GAAAP,IAAA,CAANO,MAAM;IACNC,QAAQ,GAAAR,IAAA,CAARQ,QAAQ;IACRC,YAAY,GAAAT,IAAA,CAAZS,YAAY;IACZC,UAAU,GAAAV,IAAA,CAAVU,UAAU;IACVC,SAAS,GAAAX,IAAA,CAATW,SAAS;IACTC,aAAa,GAAAZ,IAAA,CAAbY,aAAa;IACbC,cAAc,GAAAb,IAAA,CAAda,cAAc;IACdC,iBAAiB,GAAAd,IAAA,CAAjBc,iBAAiB;IACjBC,iBAAiB,GAAAf,IAAA,CAAjBe,iBAAiB;IACjBC,aAAa,GAAAhB,IAAA,CAAbgB,aAAa;IACbC,QAAQ,GAAAjB,IAAA,CAARiB,QAAQ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yE,UAAW;AACnBxE,IAAAA,SAAS,EAAEyE,aAAc;IACzByB,cAAc,EAAE,SAAAA,cAAA,GAAA;AAAA,MAAA,OAAMpB,uBAAuB,CAAC/D,MAAM,CAACW,UAAU,CAAC,CAAC,CAAA;AAAA,KAAA;GAC7DzB,EAAAA,IAAI,CACX,CAAC,eACFiF,sBAAA,CAAAC,aAAA,CAACgB,6BAAgB,EAAA;AAACrH,IAAAA,GAAG,EAAE8C,cAAAA;AAAe,GAAA,EAAE7C,KAAwB,CACtD,CACjB,EACA,CAACI,SAAS,IAAIK,SAAS,iBACpB0F,sBAAA,CAAAC,aAAA,CAACO,2BAAc,EAAA;IAACL,SAAS,EAAEjD,0BAAO,CAAC5C,SAAAA;GAAYA,EAAAA,SAA0B,CAEpE,CACH,CAAC,CAAA;AAEvB,CACJ;;;;"}
package/cjs/index.css CHANGED
@@ -969,3 +969,18 @@
969
969
  .Carousel_styles_zmchjj_c1c6iuz8__ccd8212a{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;padding-left:var(--c1c6iuz8-0);padding-right:var(--c1c6iuz8-1);}.Carousel_styles_zmchjj_cmeqer1__ccd8212a .Carousel_styles_zmchjj_c1c6iuz8__ccd8212a{padding-right:var(--c1c6iuz8-2);}
970
970
 
971
971
  .CarouselItem_cqjszm_s13at6mi__7ff91d05{-webkit-scroll-snap-align:var(--s13at6mi-0);-moz-scroll-snap-align:var(--s13at6mi-0);-ms-scroll-snap-align:var(--s13at6mi-0);scroll-snap-align:var(--s13at6mi-0);-webkit-scroll-snap-stop:var(--s13at6mi-1);-moz-scroll-snap-stop:var(--s13at6mi-1);-ms-scroll-snap-stop:var(--s13at6mi-1);scroll-snap-stop:var(--s13at6mi-1);}
972
+
973
+ .CodeField_styles_7zxgpc_b1xx9skx__84a479ac{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;}.CodeField_styles_7zxgpc_b1xx9skx__84a479ac.CodeField_styles_7zxgpc_codefieldCaptionAlignLeft__84a479ac{-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;}
974
+ .CodeField_styles_7zxgpc_c1wzspax__84a479ac{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;}
975
+ .CodeField_styles_7zxgpc_c7swj1z__84a479ac{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;}
976
+ .CodeField_styles_7zxgpc_s13uxcg8__84a479ac{width:var(--plasma-codefield-separator-width);}
977
+ .CodeField_styles_7zxgpc_ig5h1kg__84a479ac{box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;padding:0;outline:none;pointer-events:none;text-align:center;}
978
+ .CodeField_styles_7zxgpc_c1jpzjak__84a479ac{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;}
979
+
980
+ .base_9a5yza_b1g41h91__e66aaab8 .base_9a5yza_c1jpzjak__e66aaab8{color:var(--plasma-codefield-caption-color);}.base_9a5yza_b1g41h91__e66aaab8 .base_9a5yza_c1jpzjak__e66aaab8.base_9a5yza_codefieldCaptionError__e66aaab8{color:var(--plasma-codefield-caption-color-error);}.base_9a5yza_b1g41h91__e66aaab8 .base_9a5yza_ig5h1kg__e66aaab8{color:var(--plasma-codefield-code-color);caret-color:var(--plasma-codefield-caret-color);background-color:var(--plasma-codefield-background-color);box-shadow:inset 0 0 0 var(--plasma-codefield-border-width) var(--plasma-codefield-border-color);}.base_9a5yza_b1g41h91__e66aaab8:hover .base_9a5yza_codefieldItemHoverEnabled__e66aaab8{background-color:var(--plasma-codefield-background-color-hover);box-shadow:inset 0 0 0 var(--plasma-codefield-border-width) var(--plasma-codefield-border-color-hover);}.base_9a5yza_b1g41h91__e66aaab8:focus-within .base_9a5yza_ig5h1kg__e66aaab8:focus-within{background-color:var(--plasma-codefield-background-color-focus);box-shadow:inset 0 0 0 var(--plasma-codefield-border-width) var(--plasma-codefield-border-color-focus);}.base_9a5yza_b1g41h91__e66aaab8.base_9a5yza_b1g41h91__e66aaab8 .base_9a5yza_codefieldCodeErrorAnimation__e66aaab8{-webkit-animation:base_9a5yza_shakingErrorB1g41h91__e66aaab8 0.3s forwards;animation:base_9a5yza_shakingErrorB1g41h91__e66aaab8 0.3s forwards;}.base_9a5yza_b1g41h91__e66aaab8.base_9a5yza_b1g41h91__e66aaab8 .base_9a5yza_codefieldCodeError__e66aaab8 .base_9a5yza_ig5h1kg__e66aaab8{color:var(--plasma-codefield-code-color-error);background-color:var(--plasma-codefield-background-error-color);box-shadow:inset 0 0 0 var(--plasma-codefield-border-width) var(--plasma-codefield-border-error-color);}.base_9a5yza_b1g41h91__e66aaab8.base_9a5yza_b1g41h91__e66aaab8 .base_9a5yza_codefieldCodeError__e66aaab8:focus-within .base_9a5yza_ig5h1kg__e66aaab8{background-color:var(--plasma-codefield-background-error-color);box-shadow:inset 0 0 0 var(--plasma-codefield-border-width) var(--plasma-codefield-border-error-color);}.base_9a5yza_b1g41h91__e66aaab8.base_9a5yza_b1g41h91__e66aaab8 .base_9a5yza_codefieldCodeError__e66aaab8.base_9a5yza_codefieldCodeErrorFade__e66aaab8 .base_9a5yza_ig5h1kg__e66aaab8{-webkit-animation:base_9a5yza_fadeErrorB1g41h91__e66aaab8 0.3s forwards;animation:base_9a5yza_fadeErrorB1g41h91__e66aaab8 0.3s forwards;}.base_9a5yza_b1g41h91__e66aaab8.base_9a5yza_b1g41h91__e66aaab8 .base_9a5yza_codefieldItemErrorAnimation__e66aaab8{-webkit-animation:base_9a5yza_shakingErrorB1g41h91__e66aaab8 0.3s forwards;animation:base_9a5yza_shakingErrorB1g41h91__e66aaab8 0.3s forwards;}.base_9a5yza_b1g41h91__e66aaab8.base_9a5yza_b1g41h91__e66aaab8 .base_9a5yza_codefieldItemError__e66aaab8,.base_9a5yza_b1g41h91__e66aaab8.base_9a5yza_b1g41h91__e66aaab8 .base_9a5yza_codefieldItemError__e66aaab8:focus-within{color:var(--plasma-codefield-code-color-error);background-color:var(--plasma-codefield-background-error-color);box-shadow:inset 0 0 0 var(--plasma-codefield-border-width) var(--plasma-codefield-border-error-color);}.base_9a5yza_b1g41h91__e66aaab8.base_9a5yza_b1g41h91__e66aaab8 .base_9a5yza_codefieldItemError__e66aaab8.base_9a5yza_codefieldCodeErrorFade__e66aaab8,.base_9a5yza_b1g41h91__e66aaab8.base_9a5yza_b1g41h91__e66aaab8 .base_9a5yza_codefieldItemError__e66aaab8:focus-within.base_9a5yza_codefieldCodeErrorFade__e66aaab8{-webkit-animation:base_9a5yza_shakingErrorB1g41h91__e66aaab8 0.3s forwards :local(fadeError-b1g41h91) 0.3s :local(forwards);animation:base_9a5yza_shakingErrorB1g41h91__e66aaab8 0.3s forwards :local(fadeError-b1g41h91) 0.3s :local(forwards);}@-webkit-keyframes base_9a5yza_shakingErrorB1g41h91__e66aaab8{14%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}28%{-webkit-transform:translateX(0.125rem);-ms-transform:translateX(0.125rem);transform:translateX(0.125rem);}42%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}57%{-webkit-transform:translateX(0.125rem);-ms-transform:translateX(0.125rem);transform:translateX(0.125rem);}71%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}85%{-webkit-transform:translateX(0.125rem);-ms-transform:translateX(0.125rem);transform:translateX(0.125rem);}100%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}}@keyframes base_9a5yza_shakingErrorB1g41h91__e66aaab8{14%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}28%{-webkit-transform:translateX(0.125rem);-ms-transform:translateX(0.125rem);transform:translateX(0.125rem);}42%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}57%{-webkit-transform:translateX(0.125rem);-ms-transform:translateX(0.125rem);transform:translateX(0.125rem);}71%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}85%{-webkit-transform:translateX(0.125rem);-ms-transform:translateX(0.125rem);transform:translateX(0.125rem);}100%{-webkit-transform:translateX(-0.125rem);-ms-transform:translateX(-0.125rem);transform:translateX(-0.125rem);}}@-webkit-keyframes base_9a5yza_fadeErrorB1g41h91__e66aaab8{50%{color:var(--plasma-codefield-code-color-error);}100%{color:transparent;}}@keyframes base_9a5yza_fadeErrorB1g41h91__e66aaab8{50%{color:var(--plasma-codefield-code-color-error);}100%{color:transparent;}}
981
+
982
+ .base_1wrvbr5_bkkdah0__9ac780d6{gap:var(--plasma-codefield-caption-gap);}.base_1wrvbr5_bkkdah0__9ac780d6 .base_1wrvbr5_c1wzspax__9ac780d6,.base_1wrvbr5_bkkdah0__9ac780d6 .base_1wrvbr5_c7swj1z__9ac780d6{gap:var(--plasma-codefield-code-item-gap);}.base_1wrvbr5_bkkdah0__9ac780d6 .base_1wrvbr5_ig5h1kg__9ac780d6{width:var(--plasma-codefield-item-width);height:var(--plasma-codefield-item-height);font-family:var(--plasma-codefield-font-family);font-size:var(--plasma-codefield-font-size);font-style:var(--plasma-codefield-font-style);font-weight:var(--plasma-codefield-font-weight);-webkit-letter-spacing:var(--plasma-codefield-letter-spacing);-moz-letter-spacing:var(--plasma-codefield-letter-spacing);-ms-letter-spacing:var(--plasma-codefield-letter-spacing);letter-spacing:var(--plasma-codefield-letter-spacing);line-height:var(--plasma-codefield-line-height);}.base_1wrvbr5_bkkdah0__9ac780d6 .base_1wrvbr5_c1jpzjak__9ac780d6{font-family:var(--plasma-codefield-caption-font-family);font-size:var(--plasma-codefield-caption-font-style);font-style:var(--plasma-codefield-caption-font-size);font-weight:var(--plasma-codefield-caption-font-weight);-webkit-letter-spacing:var(--plasma-codefield-caption-letter-spacing);-moz-letter-spacing:var(--plasma-codefield-caption-letter-spacing);-ms-letter-spacing:var(--plasma-codefield-caption-letter-spacing);letter-spacing:var(--plasma-codefield-caption-letter-spacing);line-height:var(--plasma-codefield-caption-line-height);}
983
+
984
+ .base_1scsyya_b103qcna__a3446bcc .base_1scsyya_ig5h1kg__a3446bcc{border-radius:var(--plasma-codefield-code-item-border-radius);}.base_1scsyya_b103qcna__a3446bcc .base_1scsyya_ig5h1kg__a3446bcc.base_1scsyya_codefieldShapeSegmented__a3446bcc{border-radius:var(--plasma-codefield-code-item-border-radius-segmented);}.base_1scsyya_b103qcna__a3446bcc .base_1scsyya_ig5h1kg__a3446bcc.base_1scsyya_codefieldShapeSegmented__a3446bcc:first-child{border-top-left-radius:var(--plasma-codefield-code-item-segmented-side-border-radius);border-bottom-left-radius:var(--plasma-codefield-code-item-segmented-side-border-radius);}.base_1scsyya_b103qcna__a3446bcc .base_1scsyya_ig5h1kg__a3446bcc.base_1scsyya_codefieldShapeSegmented__a3446bcc:last-child{border-top-right-radius:var(--plasma-codefield-code-item-segmented-side-border-radius);border-bottom-right-radius:var(--plasma-codefield-code-item-segmented-side-border-radius);}
985
+
986
+ .base_obsae2_b3zd5bu__e66a8428.base_obsae2_b3zd5bu__e66a8428[disabled]{opacity:var(--plasma-codefield-disabled-opacity);cursor:not-allowed;}.base_obsae2_b3zd5bu__e66a8428.base_obsae2_b3zd5bu__e66a8428[disabled] > *{pointer-events:none;}
package/cjs/index.js CHANGED
@@ -236,6 +236,9 @@ var ToastNew_tokens = require('./components/Toast/ToastNew/ToastNew.tokens.js');
236
236
  var Carousel = require('./components/Carousel/Carousel.js');
237
237
  var Carousel_styles = require('./components/Carousel/Carousel.styles.js');
238
238
  var CarouselItem = require('./components/Carousel/CarouselItem.js');
239
+ var CodeField = require('./components/CodeField/CodeField.js');
240
+ var CodeField_tokens = require('./components/CodeField/CodeField.tokens.js');
241
+ var constants$1 = require('./components/CodeField/utils/constants.js');
239
242
 
240
243
 
241
244
 
@@ -676,4 +679,11 @@ exports.carouselConfig = Carousel.carouselConfig;
676
679
  exports.carouselRoot = Carousel.carouselRoot;
677
680
  exports.CarouselGridWrapper = Carousel_styles.CarouselGridWrapper;
678
681
  exports.CarouselItem = CarouselItem.CarouselItem;
682
+ exports.codeFieldConfig = CodeField.codeFieldConfig;
683
+ exports.codeFieldRoot = CodeField.codeFieldRoot;
684
+ exports.codeFieldClasses = CodeField_tokens.classes;
685
+ exports.codeFieldTokens = CodeField_tokens.tokens;
686
+ exports.ONLY_CHARS_PATTERN = constants$1.ONLY_CHARS_PATTERN;
687
+ exports.ONLY_DIGITS_AND_CHARS_PATTERN = constants$1.ONLY_DIGITS_AND_CHARS_PATTERN;
688
+ exports.ONLY_DIGITS_PATTERN = constants$1.ONLY_DIGITS_PATTERN;
679
689
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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