@salutejs/plasma-new-hope 0.327.0-canary.1973.15679545656.0 → 0.327.0-canary.1973.15733948288.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 (119) hide show
  1. package/cjs/components/CodeField/CodeField.js +10 -15
  2. package/cjs/components/CodeField/CodeField.js.map +1 -1
  3. package/cjs/components/CodeInput/CodeInput.js +12 -17
  4. package/cjs/components/CodeInput/CodeInput.js.map +1 -1
  5. package/cjs/components/CodeInput/CodeInput.tokens.js.map +1 -1
  6. package/cjs/components/CodeInput/utils/handleCodeError.js +2 -2
  7. package/cjs/components/CodeInput/utils/handleCodeError.js.map +1 -1
  8. package/cjs/components/CodeInput/utils/handleItemError.js +1 -1
  9. package/cjs/components/CodeInput/utils/handleItemError.js.map +1 -1
  10. package/cjs/components/CodeInput/variations/_size/base.js.map +1 -1
  11. package/cjs/hooks/useCodeHook.js +34 -0
  12. package/cjs/hooks/useCodeHook.js.map +1 -0
  13. package/cjs/index.js +6 -0
  14. package/cjs/index.js.map +1 -1
  15. package/cjs/utils/constants.js +12 -0
  16. package/cjs/utils/constants.js.map +1 -1
  17. package/cjs/utils/index.js.map +1 -1
  18. package/cjs/utils/initialValuesHelper.js.map +1 -0
  19. package/emotion/cjs/components/CodeField/CodeField.js +9 -15
  20. package/emotion/cjs/components/CodeInput/CodeInput.js +10 -16
  21. package/emotion/cjs/components/CodeInput/utils/handleCodeError.js +3 -3
  22. package/emotion/cjs/components/CodeInput/utils/handleItemError.js +1 -1
  23. package/emotion/cjs/components/CodeInput/utils/index.js +4 -4
  24. package/emotion/cjs/components/CodeInput/variations/_size/base.js +1 -1
  25. package/emotion/cjs/hooks/index.js +8 -1
  26. package/emotion/cjs/hooks/useCodeHook.js +32 -0
  27. package/emotion/cjs/utils/constants.js +8 -2
  28. package/emotion/cjs/utils/index.js +12 -0
  29. package/emotion/es/components/CodeField/CodeField.js +11 -16
  30. package/emotion/es/components/CodeInput/CodeInput.js +12 -17
  31. package/emotion/es/components/CodeInput/utils/handleCodeError.js +2 -2
  32. package/emotion/es/components/CodeInput/utils/handleItemError.js +1 -1
  33. package/emotion/es/components/CodeInput/utils/index.js +1 -1
  34. package/emotion/es/components/CodeInput/variations/_size/base.js +1 -1
  35. package/emotion/es/hooks/index.js +2 -1
  36. package/emotion/es/hooks/useCodeHook.js +26 -0
  37. package/emotion/es/utils/constants.js +7 -1
  38. package/emotion/es/utils/index.js +1 -0
  39. package/es/components/CodeField/CodeField.js +11 -16
  40. package/es/components/CodeField/CodeField.js.map +1 -1
  41. package/es/components/CodeInput/CodeInput.js +13 -18
  42. package/es/components/CodeInput/CodeInput.js.map +1 -1
  43. package/es/components/CodeInput/CodeInput.tokens.js.map +1 -1
  44. package/es/components/CodeInput/utils/handleCodeError.js +2 -2
  45. package/es/components/CodeInput/utils/handleCodeError.js.map +1 -1
  46. package/es/components/CodeInput/utils/handleItemError.js +1 -1
  47. package/es/components/CodeInput/utils/handleItemError.js.map +1 -1
  48. package/es/components/CodeInput/variations/_size/base.js.map +1 -1
  49. package/es/hooks/useCodeHook.js +30 -0
  50. package/es/hooks/useCodeHook.js.map +1 -0
  51. package/es/index.js +2 -0
  52. package/es/index.js.map +1 -1
  53. package/es/utils/constants.js +7 -1
  54. package/es/utils/constants.js.map +1 -1
  55. package/es/utils/index.js.map +1 -1
  56. package/es/utils/initialValuesHelper.js.map +1 -0
  57. package/package.json +2 -2
  58. package/styled-components/cjs/components/CodeField/CodeField.js +9 -15
  59. package/styled-components/cjs/components/CodeInput/CodeInput.js +10 -16
  60. package/styled-components/cjs/components/CodeInput/utils/handleCodeError.js +3 -3
  61. package/styled-components/cjs/components/CodeInput/utils/handleItemError.js +1 -1
  62. package/styled-components/cjs/components/CodeInput/utils/index.js +4 -4
  63. package/styled-components/cjs/hooks/index.js +8 -1
  64. package/styled-components/cjs/hooks/useCodeHook.js +32 -0
  65. package/styled-components/cjs/utils/constants.js +8 -2
  66. package/styled-components/cjs/utils/index.js +12 -0
  67. package/styled-components/es/components/CodeField/CodeField.js +11 -16
  68. package/styled-components/es/components/CodeInput/CodeInput.js +12 -17
  69. package/styled-components/es/components/CodeInput/utils/handleCodeError.js +2 -2
  70. package/styled-components/es/components/CodeInput/utils/handleItemError.js +1 -1
  71. package/styled-components/es/components/CodeInput/utils/index.js +1 -1
  72. package/styled-components/es/hooks/index.js +2 -1
  73. package/styled-components/es/hooks/useCodeHook.js +26 -0
  74. package/styled-components/es/utils/constants.js +7 -1
  75. package/styled-components/es/utils/index.js +1 -0
  76. package/types/components/CodeField/CodeField.d.ts.map +1 -1
  77. package/types/components/CodeInput/CodeInput.d.ts.map +1 -1
  78. package/types/components/CodeInput/CodeInput.tokens.d.ts +1 -0
  79. package/types/components/CodeInput/CodeInput.tokens.d.ts.map +1 -1
  80. package/types/components/CodeInput/utils/handleCodeError.d.ts.map +1 -1
  81. package/types/components/CodeInput/utils/handleItemError.d.ts.map +1 -1
  82. package/types/components/CodeInput/utils/index.d.ts +1 -1
  83. package/types/components/CodeInput/utils/index.d.ts.map +1 -1
  84. package/types/components/CodeInput/variations/_size/base.d.ts.map +1 -1
  85. package/types/hooks/index.d.ts +1 -0
  86. package/types/hooks/index.d.ts.map +1 -1
  87. package/types/hooks/useCodeHook.d.ts +13 -0
  88. package/types/hooks/useCodeHook.d.ts.map +1 -0
  89. package/types/utils/constants.d.ts +6 -0
  90. package/types/utils/constants.d.ts.map +1 -1
  91. package/types/utils/index.d.ts +1 -0
  92. package/types/utils/index.d.ts.map +1 -1
  93. package/types/utils/initialValuesHelper.d.ts.map +1 -0
  94. package/cjs/components/CodeInput/utils/constants.js +0 -14
  95. package/cjs/components/CodeInput/utils/constants.js.map +0 -1
  96. package/cjs/components/CodeInput/utils/initialValuesHelper.js.map +0 -1
  97. package/emotion/cjs/components/CodeInput/utils/constants.js +0 -12
  98. package/emotion/cjs/components/CodeInput/utils/types.js +0 -5
  99. package/emotion/es/components/CodeInput/utils/constants.js +0 -6
  100. package/emotion/es/components/CodeInput/utils/types.js +0 -1
  101. package/es/components/CodeInput/utils/constants.js +0 -7
  102. package/es/components/CodeInput/utils/constants.js.map +0 -1
  103. package/es/components/CodeInput/utils/initialValuesHelper.js.map +0 -1
  104. package/styled-components/cjs/components/CodeInput/utils/constants.js +0 -12
  105. package/styled-components/cjs/components/CodeInput/utils/types.js +0 -5
  106. package/styled-components/es/components/CodeInput/utils/constants.js +0 -6
  107. package/styled-components/es/components/CodeInput/utils/types.js +0 -1
  108. package/types/components/CodeInput/utils/constants.d.ts +0 -7
  109. package/types/components/CodeInput/utils/constants.d.ts.map +0 -1
  110. package/types/components/CodeInput/utils/initialValuesHelper.d.ts.map +0 -1
  111. package/types/components/CodeInput/utils/types.d.ts +0 -11
  112. package/types/components/CodeInput/utils/types.d.ts.map +0 -1
  113. /package/cjs/{components/CodeInput/utils → utils}/initialValuesHelper.js +0 -0
  114. /package/emotion/cjs/{components/CodeInput/utils → utils}/initialValuesHelper.js +0 -0
  115. /package/emotion/es/{components/CodeInput/utils → utils}/initialValuesHelper.js +0 -0
  116. /package/es/{components/CodeInput/utils → utils}/initialValuesHelper.js +0 -0
  117. /package/styled-components/cjs/{components/CodeInput/utils → utils}/initialValuesHelper.js +0 -0
  118. /package/styled-components/es/{components/CodeInput/utils → utils}/initialValuesHelper.js +0 -0
  119. /package/types/{components/CodeInput/utils → utils}/initialValuesHelper.d.ts +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"initialValuesHelper.js","sources":["../../../../src/components/CodeInput/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;;;;"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ONLY_DIGITS_PATTERN = exports.ONLY_DIGITS_AND_CHARS_PATTERN = exports.ONLY_CHARS_PATTERN = exports.FORBIDDEN_KEYS = exports.BACKSPACE_KEY = exports.ANIMATION_TIMEOUT = void 0;
7
- var ONLY_DIGITS_PATTERN = exports.ONLY_DIGITS_PATTERN = '^\\d+$';
8
- var ONLY_CHARS_PATTERN = exports.ONLY_CHARS_PATTERN = '^[a-zA-Z]+$';
9
- var ONLY_DIGITS_AND_CHARS_PATTERN = exports.ONLY_DIGITS_AND_CHARS_PATTERN = '^[a-zA-Z0-9]+$';
10
- var FORBIDDEN_KEYS = exports.FORBIDDEN_KEYS = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Delete', 'Tab'];
11
- var BACKSPACE_KEY = exports.BACKSPACE_KEY = 'Backspace';
12
- var ANIMATION_TIMEOUT = exports.ANIMATION_TIMEOUT = 300;
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,6 +0,0 @@
1
- export var ONLY_DIGITS_PATTERN = '^\\d+$';
2
- export var ONLY_CHARS_PATTERN = '^[a-zA-Z]+$';
3
- export var ONLY_DIGITS_AND_CHARS_PATTERN = '^[a-zA-Z0-9]+$';
4
- export var FORBIDDEN_KEYS = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Delete', 'Tab'];
5
- export var BACKSPACE_KEY = 'Backspace';
6
- export var ANIMATION_TIMEOUT = 300;
@@ -1,7 +0,0 @@
1
- export declare const ONLY_DIGITS_PATTERN = "^\\d+$";
2
- export declare const ONLY_CHARS_PATTERN = "^[a-zA-Z]+$";
3
- export declare const ONLY_DIGITS_AND_CHARS_PATTERN = "^[a-zA-Z0-9]+$";
4
- export declare const FORBIDDEN_KEYS: string[];
5
- export declare const BACKSPACE_KEY = "Backspace";
6
- export declare const ANIMATION_TIMEOUT = 300;
7
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/components/CodeInput/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAC5C,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAChD,eAAO,MAAM,6BAA6B,mBAAmB,CAAC;AAE9D,eAAO,MAAM,cAAc,UAAuE,CAAC;AACnG,eAAO,MAAM,aAAa,cAAc,CAAC;AAEzC,eAAO,MAAM,iBAAiB,MAAM,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"initialValuesHelper.d.ts","sourceRoot":"","sources":["../../../../src/components/CodeInput/utils/initialValuesHelper.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,mBAAoB,MAAM,GAAG,MAAM,kBAU9D,CAAC;AAEF,eAAO,MAAM,YAAY,eAAgB,MAAM,SAAS,MAAM,KAAG,KAAK,CAAC,MAAM,CAM5E,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAAgB,MAAM,gBAAgB,MAAM,KAAG,IAAI,GAAG,MAAM,EAU3F,CAAC"}
@@ -1,11 +0,0 @@
1
- import { tokens } from '../CodeInput.tokens';
2
- type SmallScreen = 'smallXXS' | 'smallXS' | 'smallS' | 'smallM' | 'smallL' | 'smallXL' | 'smallXXL';
3
- type MediumScreen = 'mediumXXS' | 'mediumXS' | 'mediumS' | 'mediumM' | 'mediumL' | 'mediumXL' | 'mediumXXL';
4
- type LargeScreen = 'largeXXS' | 'largeXS' | 'largeS' | 'largeM' | 'largeL' | 'largeXL' | 'largeXXL';
5
- export type ScreenVariant = SmallScreen | MediumScreen | LargeScreen;
6
- export type BreakpointTokens = {
7
- [x: string]: string | number;
8
- };
9
- export type TokensType = keyof typeof tokens;
10
- export {};
11
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/CodeInput/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,KAAK,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AACpG,KAAK,YAAY,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;AAC5G,KAAK,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AACpG,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,CAAC;AAErE,MAAM,MAAM,gBAAgB,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,MAAM,CAAC"}