@salutejs/plasma-new-hope 0.327.0-canary.1973.15733948288.0 → 0.327.0-canary.2010.15678347777.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.
- package/cjs/components/CodeField/CodeField.js +16 -15
- package/cjs/components/CodeField/CodeField.js.map +1 -1
- package/cjs/components/Tour/Tour.css +4 -0
- package/cjs/components/Tour/Tour.js +224 -0
- package/cjs/components/Tour/Tour.js.map +1 -0
- package/cjs/components/Tour/Tour.styles.js +51 -0
- package/cjs/components/Tour/Tour.styles.js.map +1 -0
- package/cjs/components/Tour/Tour.styles_1ks2isn.css +4 -0
- package/cjs/components/Tour/Tour.tokens.js +21 -0
- package/cjs/components/Tour/Tour.tokens.js.map +1 -0
- package/cjs/components/Tour/utils/index.js +19 -0
- package/cjs/components/Tour/utils/index.js.map +1 -0
- package/cjs/components/{CodeInput/variations/_disabled → Tour/variatoins/_size}/base.js +2 -2
- package/cjs/components/Tour/variatoins/_size/base.js.map +1 -0
- package/cjs/components/Tour/variatoins/_size/base_x642ct.css +1 -0
- package/cjs/components/{CodeInput/variations/_size → Tour/variatoins/_view}/base.js +2 -2
- package/cjs/components/Tour/variatoins/_view/base.js.map +1 -0
- package/cjs/components/Tour/variatoins/_view/base_x642ct.css +1 -0
- package/cjs/index.css +5 -15
- package/cjs/index.js +6 -12
- package/cjs/index.js.map +1 -1
- package/cjs/utils/constants.js +0 -12
- package/cjs/utils/constants.js.map +1 -1
- package/cjs/utils/index.js.map +1 -1
- package/emotion/cjs/components/CodeField/CodeField.js +16 -14
- package/emotion/cjs/components/Tour/Tour.js +233 -0
- package/emotion/cjs/components/Tour/Tour.styles.js +48 -0
- package/emotion/cjs/components/Tour/Tour.tokens.js +19 -0
- package/emotion/cjs/components/Tour/index.js +31 -0
- package/emotion/cjs/components/Tour/utils/index.js +18 -0
- package/emotion/cjs/components/Tour/variatoins/_size/base.js +8 -0
- package/emotion/cjs/components/Tour/variatoins/_view/base.js +8 -0
- package/emotion/cjs/examples/plasma_b2c/components/CodeField/CodeField.config.js +6 -6
- package/emotion/cjs/examples/plasma_b2c/components/Tour/Tour.config.js +22 -0
- package/emotion/cjs/examples/plasma_b2c/components/Tour/Tour.js +11 -0
- package/emotion/cjs/examples/plasma_b2c/components/Tour/Tour.stories.tsx +250 -0
- package/emotion/cjs/examples/plasma_web/components/CodeField/CodeField.config.js +6 -6
- package/emotion/cjs/examples/plasma_web/components/Tour/Tour.config.js +22 -0
- package/emotion/cjs/examples/plasma_web/components/Tour/Tour.js +11 -0
- package/emotion/cjs/examples/plasma_web/components/Tour/Tour.stories.tsx +242 -0
- package/emotion/cjs/hooks/index.js +1 -8
- package/emotion/cjs/index.js +8 -8
- package/emotion/cjs/utils/constants.js +2 -8
- package/emotion/cjs/utils/index.js +0 -12
- package/emotion/es/components/CodeField/CodeField.js +17 -16
- package/emotion/es/components/Tour/Tour.js +226 -0
- package/emotion/es/components/Tour/Tour.styles.js +41 -0
- package/emotion/es/components/Tour/Tour.tokens.js +13 -0
- package/emotion/es/components/Tour/index.js +2 -0
- package/emotion/es/components/Tour/utils/index.js +12 -0
- package/emotion/es/components/Tour/variatoins/_size/base.js +2 -0
- package/emotion/es/components/Tour/variatoins/_view/base.js +2 -0
- package/emotion/es/examples/plasma_b2c/components/CodeField/CodeField.config.js +6 -6
- package/emotion/es/examples/plasma_b2c/components/Tour/Tour.config.js +16 -0
- package/emotion/es/examples/plasma_b2c/components/Tour/Tour.js +5 -0
- package/emotion/es/examples/plasma_b2c/components/Tour/Tour.stories.tsx +250 -0
- package/emotion/es/examples/plasma_web/components/CodeField/CodeField.config.js +6 -6
- package/emotion/es/examples/plasma_web/components/Tour/Tour.config.js +16 -0
- package/emotion/es/examples/plasma_web/components/Tour/Tour.js +5 -0
- package/emotion/es/examples/plasma_web/components/Tour/Tour.stories.tsx +242 -0
- package/emotion/es/hooks/index.js +1 -2
- package/emotion/es/index.js +2 -2
- package/emotion/es/utils/constants.js +1 -7
- package/emotion/es/utils/index.js +0 -1
- package/es/components/CodeField/CodeField.js +17 -16
- package/es/components/CodeField/CodeField.js.map +1 -1
- package/es/components/Tour/Tour.css +4 -0
- package/es/components/Tour/Tour.js +215 -0
- package/es/components/Tour/Tour.js.map +1 -0
- package/es/components/Tour/Tour.styles.js +44 -0
- package/es/components/Tour/Tour.styles.js.map +1 -0
- package/es/components/Tour/Tour.styles_1ks2isn.css +4 -0
- package/es/components/Tour/Tour.tokens.js +16 -0
- package/es/components/Tour/Tour.tokens.js.map +1 -0
- package/es/components/Tour/utils/index.js +15 -0
- package/es/components/Tour/utils/index.js.map +1 -0
- package/es/components/{CodeInput/variations/_view → Tour/variatoins/_size}/base.js +2 -2
- package/es/components/Tour/variatoins/_size/base.js.map +1 -0
- package/es/components/Tour/variatoins/_size/base_x642ct.css +1 -0
- package/es/components/{CodeInput/variations/_size → Tour/variatoins/_view}/base.js +2 -2
- package/es/components/Tour/variatoins/_view/base.js.map +1 -0
- package/es/components/Tour/variatoins/_view/base_x642ct.css +1 -0
- package/es/index.css +5 -15
- package/es/index.js +2 -4
- package/es/index.js.map +1 -1
- package/es/utils/constants.js +1 -7
- package/es/utils/constants.js.map +1 -1
- package/es/utils/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/CodeField/CodeField.js +16 -14
- package/styled-components/cjs/components/Tour/Tour.js +233 -0
- package/styled-components/cjs/components/Tour/Tour.styles.js +27 -0
- package/styled-components/cjs/components/Tour/Tour.tokens.js +19 -0
- package/styled-components/cjs/components/Tour/index.js +31 -0
- package/styled-components/cjs/components/Tour/utils/index.js +18 -0
- package/styled-components/cjs/components/{CodeInput/variations/_disabled → Tour/variatoins/_size}/base.js +1 -2
- package/styled-components/cjs/components/Tour/variatoins/_size/tokens.json +1 -0
- package/styled-components/cjs/components/Tour/variatoins/_view/base.js +8 -0
- package/styled-components/cjs/components/Tour/variatoins/_view/tokens.json +1 -0
- package/styled-components/cjs/examples/plasma_b2c/components/CodeField/CodeField.config.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Tour/Tour.config.js +22 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Tour/Tour.js +11 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Tour/Tour.stories.tsx +250 -0
- package/styled-components/cjs/examples/plasma_web/components/CodeField/CodeField.config.js +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Tour/Tour.config.js +22 -0
- package/styled-components/cjs/examples/plasma_web/components/Tour/Tour.js +11 -0
- package/styled-components/cjs/examples/plasma_web/components/Tour/Tour.stories.tsx +242 -0
- package/styled-components/cjs/hooks/index.js +1 -8
- package/styled-components/cjs/index.js +8 -8
- package/styled-components/cjs/utils/constants.js +2 -8
- package/styled-components/cjs/utils/index.js +0 -12
- package/styled-components/es/components/CodeField/CodeField.js +17 -16
- package/styled-components/es/components/Tour/Tour.js +226 -0
- package/styled-components/es/components/Tour/Tour.styles.js +20 -0
- package/styled-components/es/components/Tour/Tour.tokens.js +13 -0
- package/styled-components/es/components/Tour/index.js +2 -0
- package/styled-components/es/components/Tour/utils/index.js +12 -0
- package/styled-components/es/components/Tour/variatoins/_size/base.js +2 -0
- package/styled-components/es/components/Tour/variatoins/_size/tokens.json +1 -0
- package/styled-components/es/components/Tour/variatoins/_view/base.js +2 -0
- package/styled-components/es/components/Tour/variatoins/_view/tokens.json +1 -0
- package/styled-components/es/examples/plasma_b2c/components/CodeField/CodeField.config.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Tour/Tour.config.js +16 -0
- package/styled-components/es/examples/plasma_b2c/components/Tour/Tour.js +5 -0
- package/styled-components/es/examples/plasma_b2c/components/Tour/Tour.stories.tsx +250 -0
- package/styled-components/es/examples/plasma_web/components/CodeField/CodeField.config.js +1 -1
- package/styled-components/es/examples/plasma_web/components/Tour/Tour.config.js +16 -0
- package/styled-components/es/examples/plasma_web/components/Tour/Tour.js +5 -0
- package/styled-components/es/examples/plasma_web/components/Tour/Tour.stories.tsx +242 -0
- package/styled-components/es/hooks/index.js +1 -2
- package/styled-components/es/index.js +2 -2
- package/styled-components/es/utils/constants.js +1 -7
- package/styled-components/es/utils/index.js +0 -1
- package/types/components/CodeField/CodeField.d.ts.map +1 -1
- package/types/components/Tour/Tour.d.ts +23 -0
- package/types/components/Tour/Tour.d.ts.map +1 -0
- package/types/components/Tour/Tour.styles.d.ts +9 -0
- package/types/components/Tour/Tour.styles.d.ts.map +1 -0
- package/types/components/Tour/Tour.tokens.d.ts +14 -0
- package/types/components/Tour/Tour.tokens.d.ts.map +1 -0
- package/types/components/Tour/Tour.types.d.ts +78 -0
- package/types/components/Tour/Tour.types.d.ts.map +1 -0
- package/types/components/Tour/index.d.ts +4 -0
- package/types/components/Tour/index.d.ts.map +1 -0
- package/types/components/Tour/utils/index.d.ts +2 -0
- package/types/components/Tour/utils/index.d.ts.map +1 -0
- package/types/components/Tour/variatoins/_size/base.d.ts.map +1 -0
- package/types/components/Tour/variatoins/_view/base.d.ts.map +1 -0
- package/types/hooks/index.d.ts +0 -1
- package/types/hooks/index.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/utils/constants.d.ts +0 -6
- package/types/utils/constants.d.ts.map +1 -1
- package/types/utils/index.d.ts +0 -1
- package/types/utils/index.d.ts.map +1 -1
- package/cjs/components/CodeInput/CodeInput.css +0 -14
- package/cjs/components/CodeInput/CodeInput.js +0 -299
- package/cjs/components/CodeInput/CodeInput.js.map +0 -1
- package/cjs/components/CodeInput/CodeInput.styles.js +0 -78
- package/cjs/components/CodeInput/CodeInput.styles.js.map +0 -1
- package/cjs/components/CodeInput/CodeInput.styles_3w98lu.css +0 -8
- package/cjs/components/CodeInput/CodeInput.tokens.js +0 -72
- package/cjs/components/CodeInput/CodeInput.tokens.js.map +0 -1
- package/cjs/components/CodeInput/utils/handleCodeError.js +0 -55
- package/cjs/components/CodeInput/utils/handleCodeError.js.map +0 -1
- package/cjs/components/CodeInput/utils/handleItemError.js +0 -42
- package/cjs/components/CodeInput/utils/handleItemError.js.map +0 -1
- package/cjs/components/CodeInput/variations/_disabled/base.js.map +0 -1
- package/cjs/components/CodeInput/variations/_disabled/base_vkh53h.css +0 -1
- package/cjs/components/CodeInput/variations/_size/base.js.map +0 -1
- package/cjs/components/CodeInput/variations/_size/base_h42a8b.css +0 -1
- package/cjs/components/CodeInput/variations/_view/base.js +0 -9
- package/cjs/components/CodeInput/variations/_view/base.js.map +0 -1
- package/cjs/components/CodeInput/variations/_view/base_17gj0wr.css +0 -1
- package/cjs/hooks/useCodeHook.js +0 -34
- package/cjs/hooks/useCodeHook.js.map +0 -1
- package/cjs/utils/initialValuesHelper.js +0 -33
- package/cjs/utils/initialValuesHelper.js.map +0 -1
- package/emotion/cjs/components/CodeInput/CodeInput.js +0 -307
- package/emotion/cjs/components/CodeInput/CodeInput.styles.js +0 -76
- package/emotion/cjs/components/CodeInput/CodeInput.tokens.js +0 -76
- package/emotion/cjs/components/CodeInput/index.js +0 -31
- package/emotion/cjs/components/CodeInput/utils/handleCodeError.js +0 -58
- package/emotion/cjs/components/CodeInput/utils/handleItemError.js +0 -40
- package/emotion/cjs/components/CodeInput/utils/index.js +0 -38
- package/emotion/cjs/components/CodeInput/variations/_disabled/base.js +0 -9
- package/emotion/cjs/components/CodeInput/variations/_disabled/tokens.json +0 -4
- package/emotion/cjs/components/CodeInput/variations/_size/base.js +0 -25
- package/emotion/cjs/components/CodeInput/variations/_size/tokens.json +0 -19
- package/emotion/cjs/components/CodeInput/variations/_view/base.js +0 -16
- package/emotion/cjs/examples/plasma_b2c/components/CodeInput/CodeInput.config.js +0 -27
- package/emotion/cjs/examples/plasma_b2c/components/CodeInput/CodeInput.js +0 -11
- package/emotion/cjs/examples/plasma_b2c/components/CodeInput/CodeInput.stories.tsx +0 -100
- package/emotion/cjs/examples/plasma_web/components/CodeInput/CodeInput.config.js +0 -27
- package/emotion/cjs/examples/plasma_web/components/CodeInput/CodeInput.js +0 -11
- package/emotion/cjs/examples/plasma_web/components/CodeInput/CodeInput.stories.tsx +0 -100
- package/emotion/cjs/hooks/useCodeHook.js +0 -32
- package/emotion/cjs/utils/initialValuesHelper.js +0 -30
- package/emotion/es/components/CodeInput/CodeInput.js +0 -299
- package/emotion/es/components/CodeInput/CodeInput.styles.js +0 -69
- package/emotion/es/components/CodeInput/CodeInput.tokens.js +0 -70
- package/emotion/es/components/CodeInput/index.js +0 -2
- package/emotion/es/components/CodeInput/utils/handleCodeError.js +0 -52
- package/emotion/es/components/CodeInput/utils/handleItemError.js +0 -34
- package/emotion/es/components/CodeInput/utils/index.js +0 -3
- package/emotion/es/components/CodeInput/variations/_disabled/base.js +0 -3
- package/emotion/es/components/CodeInput/variations/_disabled/tokens.json +0 -4
- package/emotion/es/components/CodeInput/variations/_size/base.js +0 -19
- package/emotion/es/components/CodeInput/variations/_size/tokens.json +0 -19
- package/emotion/es/components/CodeInput/variations/_view/base.js +0 -10
- package/emotion/es/examples/plasma_b2c/components/CodeInput/CodeInput.config.js +0 -21
- package/emotion/es/examples/plasma_b2c/components/CodeInput/CodeInput.js +0 -5
- package/emotion/es/examples/plasma_b2c/components/CodeInput/CodeInput.stories.tsx +0 -100
- package/emotion/es/examples/plasma_web/components/CodeInput/CodeInput.config.js +0 -21
- package/emotion/es/examples/plasma_web/components/CodeInput/CodeInput.js +0 -5
- package/emotion/es/examples/plasma_web/components/CodeInput/CodeInput.stories.tsx +0 -100
- package/emotion/es/hooks/useCodeHook.js +0 -26
- package/emotion/es/utils/initialValuesHelper.js +0 -24
- package/es/components/CodeInput/CodeInput.css +0 -14
- package/es/components/CodeInput/CodeInput.js +0 -289
- package/es/components/CodeInput/CodeInput.js.map +0 -1
- package/es/components/CodeInput/CodeInput.styles.js +0 -67
- package/es/components/CodeInput/CodeInput.styles.js.map +0 -1
- package/es/components/CodeInput/CodeInput.styles_3w98lu.css +0 -8
- package/es/components/CodeInput/CodeInput.tokens.js +0 -67
- package/es/components/CodeInput/CodeInput.tokens.js.map +0 -1
- package/es/components/CodeInput/utils/handleCodeError.js +0 -51
- package/es/components/CodeInput/utils/handleCodeError.js.map +0 -1
- package/es/components/CodeInput/utils/handleItemError.js +0 -38
- package/es/components/CodeInput/utils/handleItemError.js.map +0 -1
- package/es/components/CodeInput/variations/_disabled/base.js +0 -5
- package/es/components/CodeInput/variations/_disabled/base.js.map +0 -1
- package/es/components/CodeInput/variations/_disabled/base_vkh53h.css +0 -1
- package/es/components/CodeInput/variations/_size/base.js.map +0 -1
- package/es/components/CodeInput/variations/_size/base_h42a8b.css +0 -1
- package/es/components/CodeInput/variations/_view/base.js.map +0 -1
- package/es/components/CodeInput/variations/_view/base_17gj0wr.css +0 -1
- package/es/hooks/useCodeHook.js +0 -30
- package/es/hooks/useCodeHook.js.map +0 -1
- package/es/utils/initialValuesHelper.js +0 -27
- package/es/utils/initialValuesHelper.js.map +0 -1
- package/styled-components/cjs/components/CodeInput/CodeInput.js +0 -307
- package/styled-components/cjs/components/CodeInput/CodeInput.styles.js +0 -47
- package/styled-components/cjs/components/CodeInput/CodeInput.tokens.js +0 -76
- package/styled-components/cjs/components/CodeInput/index.js +0 -31
- package/styled-components/cjs/components/CodeInput/utils/handleCodeError.js +0 -58
- package/styled-components/cjs/components/CodeInput/utils/handleItemError.js +0 -40
- package/styled-components/cjs/components/CodeInput/utils/index.js +0 -38
- package/styled-components/cjs/components/CodeInput/variations/_disabled/tokens.json +0 -4
- package/styled-components/cjs/components/CodeInput/variations/_size/base.js +0 -25
- package/styled-components/cjs/components/CodeInput/variations/_size/tokens.json +0 -19
- package/styled-components/cjs/components/CodeInput/variations/_view/base.js +0 -16
- package/styled-components/cjs/examples/plasma_b2c/components/CodeInput/CodeInput.config.js +0 -27
- package/styled-components/cjs/examples/plasma_b2c/components/CodeInput/CodeInput.js +0 -11
- package/styled-components/cjs/examples/plasma_b2c/components/CodeInput/CodeInput.stories.tsx +0 -100
- package/styled-components/cjs/examples/plasma_web/components/CodeInput/CodeInput.config.js +0 -27
- package/styled-components/cjs/examples/plasma_web/components/CodeInput/CodeInput.js +0 -11
- package/styled-components/cjs/examples/plasma_web/components/CodeInput/CodeInput.stories.tsx +0 -100
- package/styled-components/cjs/hooks/useCodeHook.js +0 -32
- package/styled-components/cjs/utils/initialValuesHelper.js +0 -30
- package/styled-components/es/components/CodeInput/CodeInput.js +0 -299
- package/styled-components/es/components/CodeInput/CodeInput.styles.js +0 -39
- package/styled-components/es/components/CodeInput/CodeInput.tokens.js +0 -70
- package/styled-components/es/components/CodeInput/index.js +0 -2
- package/styled-components/es/components/CodeInput/utils/handleCodeError.js +0 -52
- package/styled-components/es/components/CodeInput/utils/handleItemError.js +0 -34
- package/styled-components/es/components/CodeInput/utils/index.js +0 -3
- package/styled-components/es/components/CodeInput/variations/_disabled/base.js +0 -3
- package/styled-components/es/components/CodeInput/variations/_disabled/tokens.json +0 -4
- package/styled-components/es/components/CodeInput/variations/_size/base.js +0 -19
- package/styled-components/es/components/CodeInput/variations/_size/tokens.json +0 -19
- package/styled-components/es/components/CodeInput/variations/_view/base.js +0 -10
- package/styled-components/es/examples/plasma_b2c/components/CodeInput/CodeInput.config.js +0 -21
- package/styled-components/es/examples/plasma_b2c/components/CodeInput/CodeInput.js +0 -5
- package/styled-components/es/examples/plasma_b2c/components/CodeInput/CodeInput.stories.tsx +0 -100
- package/styled-components/es/examples/plasma_web/components/CodeInput/CodeInput.config.js +0 -21
- package/styled-components/es/examples/plasma_web/components/CodeInput/CodeInput.js +0 -5
- package/styled-components/es/examples/plasma_web/components/CodeInput/CodeInput.stories.tsx +0 -100
- package/styled-components/es/hooks/useCodeHook.js +0 -26
- package/styled-components/es/utils/initialValuesHelper.js +0 -24
- package/types/components/CodeInput/CodeInput.d.ts +0 -65
- package/types/components/CodeInput/CodeInput.d.ts.map +0 -1
- package/types/components/CodeInput/CodeInput.styles.d.ts +0 -16
- package/types/components/CodeInput/CodeInput.styles.d.ts.map +0 -1
- package/types/components/CodeInput/CodeInput.tokens.d.ts +0 -72
- package/types/components/CodeInput/CodeInput.tokens.d.ts.map +0 -1
- package/types/components/CodeInput/CodeInput.types.d.ts +0 -92
- package/types/components/CodeInput/CodeInput.types.d.ts.map +0 -1
- package/types/components/CodeInput/index.d.ts +0 -3
- package/types/components/CodeInput/index.d.ts.map +0 -1
- package/types/components/CodeInput/utils/handleCodeError.d.ts +0 -15
- package/types/components/CodeInput/utils/handleCodeError.d.ts.map +0 -1
- package/types/components/CodeInput/utils/handleItemError.d.ts +0 -14
- package/types/components/CodeInput/utils/handleItemError.d.ts.map +0 -1
- package/types/components/CodeInput/utils/index.d.ts +0 -4
- package/types/components/CodeInput/utils/index.d.ts.map +0 -1
- package/types/components/CodeInput/variations/_disabled/base.d.ts.map +0 -1
- package/types/components/CodeInput/variations/_size/base.d.ts.map +0 -1
- package/types/components/CodeInput/variations/_view/base.d.ts +0 -2
- package/types/components/CodeInput/variations/_view/base.d.ts.map +0 -1
- package/types/hooks/useCodeHook.d.ts +0 -13
- package/types/hooks/useCodeHook.d.ts.map +0 -1
- package/types/utils/initialValuesHelper.d.ts +0 -4
- package/types/utils/initialValuesHelper.d.ts.map +0 -1
- /package/emotion/cjs/components/{CodeInput/CodeInput.types.js → Tour/Tour.types.js} +0 -0
- /package/emotion/cjs/components/{CodeInput/variations/_view → Tour/variatoins/_size}/tokens.json +0 -0
- /package/emotion/{es/components/CodeInput/variations → cjs/components/Tour/variatoins}/_view/tokens.json +0 -0
- /package/emotion/es/components/{CodeInput/CodeInput.types.js → Tour/Tour.types.js} +0 -0
- /package/{styled-components/cjs/components/CodeInput/variations/_view → emotion/es/components/Tour/variatoins/_size}/tokens.json +0 -0
- /package/{styled-components/es/components/CodeInput/variations → emotion/es/components/Tour/variatoins}/_view/tokens.json +0 -0
- /package/styled-components/cjs/components/{CodeInput/CodeInput.types.js → Tour/Tour.types.js} +0 -0
- /package/styled-components/es/components/{CodeInput/CodeInput.types.js → Tour/Tour.types.js} +0 -0
- /package/types/components/{CodeInput/variations/_disabled → Tour/variatoins/_size}/base.d.ts +0 -0
- /package/types/components/{CodeInput/variations/_size → Tour/variatoins/_view}/base.d.ts +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"CodeInput.js","sources":["../../../src/components/CodeInput/CodeInput.tsx"],"sourcesContent":["import React, { forwardRef, Fragment, useCallback, 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 { BACKSPACE_KEY, FORBIDDEN_KEYS, ONLY_DIGITS_PATTERN } from '../../utils/constants';\nimport { useCodeHook } from '../../hooks';\n\nimport type { CodeInputProps } from './CodeInput.types';\nimport { getCodeValue, getFieldPattern, getPlaceholderValue, handleCodeError, handleItemError } from './utils';\nimport { classes } from './CodeInput.tokens';\nimport {\n base,\n CaptionWrapper,\n CodeGroup,\n CodeWrapper,\n ItemInput,\n Separator,\n ItemWrapper,\n ItemCircle,\n} from './CodeInput.styles';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\n\nexport const codeInputRoot = (Root: RootProps<HTMLDivElement, CodeInputProps>) =>\n forwardRef<HTMLInputElement, CodeInputProps>(\n (\n {\n className,\n value: outerValue,\n placeholder,\n autoFocus,\n codeLength = 6,\n caption,\n captionAlign = 'left',\n width,\n view,\n size,\n hidden,\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 = (\n event: KeyboardEvent<HTMLInputElement | HTMLDivElement>,\n index: number,\n type?: 'circle',\n ) => {\n if (disabled) {\n return;\n }\n\n const { key } = event;\n if (FORBIDDEN_KEYS.includes(key)) {\n event.preventDefault();\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 if (type === 'circle') {\n handleAddSymbol(key, index);\n inputRefs.current[index]?.focus();\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 handleAddSymbol(symbol, index);\n };\n\n const handleAddSymbol = (symbol: string, index: number) => {\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 inputContainerRef,\n codeSetter,\n });\n }\n };\n\n const handlePaste = (event: ClipboardEvent<HTMLInputElement>) => {\n const newCode = [...code];\n\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 pastedData.forEach((element, index) => {\n newCode[index] = element;\n });\n\n const activeIndex = Math.min(pastedData.length, codeLength - 1);\n inputRefs.current[activeIndex]?.focus();\n\n codeSetter(newCode);\n };\n\n const handleFullCodeEnter = useCallback((fullCode: string) => {\n if (onFullCodeEnter) {\n onFullCodeEnter(fullCode);\n }\n }, []);\n\n useCodeHook({\n inputRefs,\n codeLength,\n disabled,\n autoFocus,\n originalValue,\n getLastActiveIndex,\n handleFullCodeEnter,\n });\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 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 <ItemWrapper key={partIndex + i + partIndex * i}>\n {(!code[inputCorrectIndex] ||\n (!!code[inputCorrectIndex] && hidden)) && (\n <ItemCircle\n role=\"tab\"\n tabIndex={originalValue.length === inputCorrectIndex ? 0 : -1}\n onKeyDown={(e: KeyboardEvent<HTMLDivElement>) => {\n handleOnKeyDown(e, inputCorrectIndex, 'circle');\n }}\n className={cls([\n !!code[inputCorrectIndex] && hidden\n ? classes.itemCirlceFilled\n : '',\n `${classes.itemCircle}-${inputCorrectIndex}`,\n ])}\n />\n )}\n <ItemInput\n ref={(element: HTMLInputElement) => {\n inputRefs.current[inputCorrectIndex] = element;\n }}\n className={cls({\n [classes.hoverEnabled]:\n inputCorrectIndex >= originalValue.length,\n })}\n hide={hidden}\n value={code[inputCorrectIndex] || ''}\n tabIndex={originalValue.length === inputCorrectIndex ? 0 : -1}\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 {...(placeholderValue && {\n placeholder: placeholderValue[inputCorrectIndex],\n })}\n />\n </ItemWrapper>\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 codeInputConfig = {\n name: 'CodeInput',\n tag: 'div',\n layout: codeInputRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n },\n defaults: {\n size: 'm',\n view: 'default',\n },\n};\n"],"names":["codeInputRoot","Root","forwardRef","_ref","ref","className","outerValue","value","placeholder","autoFocus","_ref$codeLength","codeLength","caption","_ref$captionAlign","captionAlign","width","view","size","hidden","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","type","key","FORBIDDEN_KEYS","includes","preventDefault","BACKSPACE_KEY","_inputRefs$current","_inputRefs$current$in","handleAddSymbol","codeSetter","newCode","handleChange","rawSymbol","currentTarget","symbol","charAt","_inputRefs$current$in2","_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","forEach","element","activeIndex","Math","min","handleFullCodeEnter","useCallback","fullCode","useCodeHook","useDidMountEffect","handleCodeError","currentCode","React","createElement","_extends","onClick","cls","_defineProperty","captionAlignLeft","CodeWrapper","Array","_","partIndex","Fragment","CodeGroup","role","i","inputCorrectIndex","ItemWrapper","ItemCircle","tabIndex","onKeyDown","e","itemCirlceFilled","concat","itemCircle","ItemInput","hoverEnabled","hide","onPaste","_Separator","Separator","CaptionWrapper","codeInputConfig","name","tag","layout","base","variations","css","viewCSS","sizeC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AE;AACN3J,IAAAA,IAAI,EAAE,GAAG;AACTD,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;"}
|
@@ -1,67 +0,0 @@
|
|
1
|
-
import './CodeInput.styles_3w98lu.css';
|
2
|
-
import { styled } from '@linaria/react';
|
3
|
-
|
4
|
-
var base = "b1y2r9rw";
|
5
|
-
var CodeWrapper = /*#__PURE__*/styled('div')({
|
6
|
-
name: "CodeWrapper",
|
7
|
-
"class": "c1fux591",
|
8
|
-
propsAsIs: false
|
9
|
-
});
|
10
|
-
var CodeGroup = /*#__PURE__*/styled('div')({
|
11
|
-
name: "CodeGroup",
|
12
|
-
"class": "cuja080",
|
13
|
-
propsAsIs: false
|
14
|
-
});
|
15
|
-
var Separator = /*#__PURE__*/styled('div')({
|
16
|
-
name: "Separator",
|
17
|
-
"class": "s175xqem",
|
18
|
-
propsAsIs: false
|
19
|
-
});
|
20
|
-
var _exp3 = function _exp3() {
|
21
|
-
return function (_ref) {
|
22
|
-
var hide = _ref.hide;
|
23
|
-
return hide ? '0' : '1';
|
24
|
-
};
|
25
|
-
};
|
26
|
-
var ItemInput = /*#__PURE__*/styled('input')({
|
27
|
-
name: "ItemInput",
|
28
|
-
"class": "i16menav",
|
29
|
-
propsAsIs: false,
|
30
|
-
vars: {
|
31
|
-
"i16menav-0": [/*#__PURE__*/_exp3()]
|
32
|
-
}
|
33
|
-
});
|
34
|
-
var ItemWrapper = /*#__PURE__*/styled('div')({
|
35
|
-
name: "ItemWrapper",
|
36
|
-
"class": "iuawgdb",
|
37
|
-
propsAsIs: false
|
38
|
-
});
|
39
|
-
var ItemCircle = /*#__PURE__*/styled('div')({
|
40
|
-
name: "ItemCircle",
|
41
|
-
"class": "i1tn2nm3",
|
42
|
-
propsAsIs: false
|
43
|
-
});
|
44
|
-
var _exp9 = function _exp9() {
|
45
|
-
return function (_ref2) {
|
46
|
-
var captionAlign = _ref2.captionAlign;
|
47
|
-
return captionAlign;
|
48
|
-
};
|
49
|
-
};
|
50
|
-
var _exp10 = function _exp10() {
|
51
|
-
return function (_ref3) {
|
52
|
-
var widthValue = _ref3.widthValue;
|
53
|
-
return widthValue || 'auto';
|
54
|
-
};
|
55
|
-
};
|
56
|
-
var CaptionWrapper = /*#__PURE__*/styled('div')({
|
57
|
-
name: "CaptionWrapper",
|
58
|
-
"class": "c19x1gm7",
|
59
|
-
propsAsIs: false,
|
60
|
-
vars: {
|
61
|
-
"c19x1gm7-0": [/*#__PURE__*/_exp9()],
|
62
|
-
"c19x1gm7-1": [/*#__PURE__*/_exp10()]
|
63
|
-
}
|
64
|
-
});
|
65
|
-
|
66
|
-
export { CaptionWrapper, CodeGroup, CodeWrapper, ItemCircle, ItemInput, ItemWrapper, Separator, base };
|
67
|
-
//# sourceMappingURL=CodeInput.styles.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"CodeInput.styles.js","sources":["../../../src/components/CodeInput/CodeInput.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\nimport { styled } from '@linaria/react';\n\nimport { classes, tokens } from './CodeInput.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<{ hide?: boolean }>`\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 caret-color: transparent;\n caret: none;\n opacity: ${({ hide }) => (hide ? '0' : '1')};\n`;\n\nexport const ItemWrapper = styled.div`\n position: relative;\n`;\n\nexport const ItemCircle = styled.div<{ filled?: boolean }>`\n position: absolute;\n top: calc(50% - calc(var(${tokens.codeItemCircleSize}) / 2));\n left: calc(50% - calc(var(${tokens.codeItemCircleSize}) / 2));\n width: var(${tokens.codeItemCircleSize});\n height: var(${tokens.codeItemCircleSize});\n box-sizing: border-box;\n border-radius: 100%;\n background-color: 'transparent';\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","_exp3","_ref","hide","ItemInput","vars","ItemWrapper","ItemCircle","_exp9","_ref2","captionAlign","_exp10","_ref3","widthValue","CaptionWrapper"],"mappings":";;AAKO,IAAMA,IAAI,GAUhB,WAAA;AAEM,IAAMC,WAAW,gBAAGC,MAAM,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,MAAM,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,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,WAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAE9B,EAAA;AAAC,IAAAG,KAAA,GA5BgBA,SA4BhBA,KAAAA,GAAA;AAAA,EAAA,OAYa,UAAAC,IAAA,EAAA;AAAA,IAAA,IAAGC,IAAAA,GAAAA,IAAAA,CAAAA,IAAAA,CAAAA;AAAAA,IAAAA,OAAYA,IAAI,GAAG,GAAG,GAAG,GAAI,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,C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AAA;AAAAO,EAAAA,IAAA,EAAA;AAAA,IAAA,YAAA,EAAA,cAElBG,KAAkC,EAAA,CAAA;AAAA,IAAA,YAAA,EAAA,cACvCG,MAAwC,EAAA,CAAA;AAAA,GAAA;AAAA,CAEpD;;;;"}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
.b1y2r9rw{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;}.b1y2r9rw.codeinput-caption-align-left{-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;}
|
2
|
-
.c1fux591{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
|
-
.cuja080{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
|
-
.s175xqem{width:var(--plasma-codeinput-separator-width);}
|
5
|
-
.i16menav{box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;padding:0;outline:none;pointer-events:none;text-align:center;caret-color:transparent;caret:none;opacity:var(--i16menav-0);}
|
6
|
-
.iuawgdb{position:relative;}
|
7
|
-
.i1tn2nm3{position:absolute;top:calc(50% - calc(var(--plasma-codeinput-item-circle-size) / 2));left:calc(50% - calc(var(--plasma-codeinput-item-circle-size) / 2));width:var(--plasma-codeinput-item-circle-size);height:var(--plasma-codeinput-item-circle-size);box-sizing:border-box;border-radius:100%;background-color:'transparent';}
|
8
|
-
.c19x1gm7{text-align:var(--c19x1gm7-0);-webkit-align-self:var(--c19x1gm7-0);-ms-flex-item-align:var(--c19x1gm7-0);align-self:var(--c19x1gm7-0);width:var(--c19x1gm7-1);white-space:pre-line;}
|
@@ -1,67 +0,0 @@
|
|
1
|
-
var classes = {
|
2
|
-
itemError: 'codeinput-item-error',
|
3
|
-
itemErrorAnimation: 'codeinput-item-error-animation',
|
4
|
-
itemErrorFade: 'codeinput-item-error-fade',
|
5
|
-
itemCircle: 'codeinput-item-circle',
|
6
|
-
itemCirlceFilled: 'codeinput-item-circle-filled',
|
7
|
-
itemCircleError: 'codeinput-item-circle-error',
|
8
|
-
itemCircleErrorAnimation: 'codeinput-item-circle-error-animation',
|
9
|
-
captionError: 'codeinput-caption-error',
|
10
|
-
codeError: 'codeinput-code-error',
|
11
|
-
codeErrorAnimation: 'codeinput-code-error-animation',
|
12
|
-
codeErrorFade: 'codeinput-code-error-fade',
|
13
|
-
captionAlignLeft: 'codeinput-caption-align-left',
|
14
|
-
hoverEnabled: 'codeinput-item-hover-enabled',
|
15
|
-
segmented: 'codeinput-shape-segmented',
|
16
|
-
"default": 'codeinput-shape-default',
|
17
|
-
disabled: 'codeinput-disabled'
|
18
|
-
};
|
19
|
-
var tokens = {
|
20
|
-
captionGap: '--plasma-codeinput-caption-gap',
|
21
|
-
codeItemsGap: '--plasma-codeinput-code-item-gap',
|
22
|
-
separatorWidth: '--plasma-codeinput-separator-width',
|
23
|
-
largeCodeItemWidth: '--plasma-codeinput-item-large-width',
|
24
|
-
largeCodeItemHeight: '--plasma-codeinput-item-large-height',
|
25
|
-
mediumCodeItemWidth: '--plasma-codeinput-item-medium-width',
|
26
|
-
mediumCodeItemHeight: '--plasma-codeinput-item-medium-height',
|
27
|
-
smallCodeItemWidth: '--plasma-codeinput-item-small-width',
|
28
|
-
smallCodeItemHeight: '--plasma-codeinput-item-small-height',
|
29
|
-
codeItemCircleSize: '--plasma-codeinput-item-circle-size',
|
30
|
-
codeItemCircleBorderWidth: '--plasma-codeinput-item-circle-border-width',
|
31
|
-
fontStyle: '--plasma-codeinput-font-style',
|
32
|
-
fontFamily: '--plasma-codeinput-font-family',
|
33
|
-
fontWeight: '--plasma-codeinput-font-weight',
|
34
|
-
letterSpacing: '--plasma-codeinput-letter-spacing',
|
35
|
-
largeFontSize: '--plasma-codeinput-large-font-size',
|
36
|
-
largeLineHeight: '--plasma-codeinput-large-line-height',
|
37
|
-
mediumFontSize: '--plasma-codeinput-medium-font-size',
|
38
|
-
mediumLineHeight: '--plasma-codeinput-medium-line-height',
|
39
|
-
smallFontSize: '--plasma-codeinput-small-font-size',
|
40
|
-
smallLineHeight: '--plasma-codeinput-small-line-height',
|
41
|
-
captionFontFamily: '--plasma-codeinput-caption-font-family',
|
42
|
-
captionFontSize: '--plasma-codeinput-caption-font-style',
|
43
|
-
captionFontStyle: '--plasma-codeinput-caption-font-size',
|
44
|
-
captionFontWeight: '--plasma-codeinput-caption-font-weight',
|
45
|
-
captionLetterSpacing: '--plasma-codeinput-caption-letter-spacing',
|
46
|
-
captionLineHeight: '--plasma-codeinput-caption-line-height',
|
47
|
-
borderRadius: '--plasma-codeinput-code-item-border-radius',
|
48
|
-
borderRadiusSegmented: '--plasma-codeinput-code-item-border-radius-segmented',
|
49
|
-
segmentedSideBorderRadius: '--plasma-codeinput-code-item-segmented-side-border-radius',
|
50
|
-
captionColor: '--plasma-codeinput-caption-color',
|
51
|
-
captionColorError: '--plasma-codeinput-caption-color-error',
|
52
|
-
codeColor: '--plasma-codeinput-code-color',
|
53
|
-
codeColorError: '--plasma-codeinput-code-color-error',
|
54
|
-
backgroundColor: '--plasma-codeinput-background-color',
|
55
|
-
backgroundColorHover: '--plasma-codeinput-background-color-hover',
|
56
|
-
backgroundColorFocus: '--plasma-codeinput-background-color-focus',
|
57
|
-
backgroundErrorColor: '--plasma-codeinput-background-error-color',
|
58
|
-
borderWidth: '--plasma-codeinput-border-width',
|
59
|
-
borderColor: '--plasma-codeinput-border-color',
|
60
|
-
borderColorHover: '--plasma-codeinput-border-color-hover',
|
61
|
-
borderColorFocus: '--plasma-codeinput-border-color-focus',
|
62
|
-
borderErrorColor: '--plasma-codeinput-border-error-color',
|
63
|
-
disabledOpacity: '--plasma-codeinput-disabled-opacity'
|
64
|
-
};
|
65
|
-
|
66
|
-
export { classes, tokens };
|
67
|
-
//# sourceMappingURL=CodeInput.tokens.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"CodeInput.tokens.js","sources":["../../../src/components/CodeInput/CodeInput.tokens.ts"],"sourcesContent":["export const classes = {\n itemError: 'codeinput-item-error',\n itemErrorAnimation: 'codeinput-item-error-animation',\n itemErrorFade: 'codeinput-item-error-fade',\n itemCircle: 'codeinput-item-circle',\n itemCirlceFilled: 'codeinput-item-circle-filled',\n itemCircleError: 'codeinput-item-circle-error',\n itemCircleErrorAnimation: 'codeinput-item-circle-error-animation',\n captionError: 'codeinput-caption-error',\n codeError: 'codeinput-code-error',\n codeErrorAnimation: 'codeinput-code-error-animation',\n codeErrorFade: 'codeinput-code-error-fade',\n\n captionAlignLeft: 'codeinput-caption-align-left',\n\n hoverEnabled: 'codeinput-item-hover-enabled',\n\n segmented: 'codeinput-shape-segmented',\n default: 'codeinput-shape-default',\n\n disabled: 'codeinput-disabled',\n};\n\nexport const privateTokens = {\n itemWidth: '--private-codeinput-item-width',\n itemHeight: '--private-codeinput-item-hieght',\n fontSize: '--private-codeinput-font-size',\n lineHeight: '--private-codeinput-line-height',\n};\n\nexport const tokens = {\n captionGap: '--plasma-codeinput-caption-gap',\n codeItemsGap: '--plasma-codeinput-code-item-gap',\n\n separatorWidth: '--plasma-codeinput-separator-width',\n\n largeCodeItemWidth: '--plasma-codeinput-item-large-width',\n largeCodeItemHeight: '--plasma-codeinput-item-large-height',\n\n mediumCodeItemWidth: '--plasma-codeinput-item-medium-width',\n mediumCodeItemHeight: '--plasma-codeinput-item-medium-height',\n\n smallCodeItemWidth: '--plasma-codeinput-item-small-width',\n smallCodeItemHeight: '--plasma-codeinput-item-small-height',\n\n codeItemCircleSize: '--plasma-codeinput-item-circle-size',\n codeItemCircleBorderWidth: '--plasma-codeinput-item-circle-border-width',\n\n fontStyle: '--plasma-codeinput-font-style',\n fontFamily: '--plasma-codeinput-font-family',\n fontWeight: '--plasma-codeinput-font-weight',\n letterSpacing: '--plasma-codeinput-letter-spacing',\n\n largeFontSize: '--plasma-codeinput-large-font-size',\n largeLineHeight: '--plasma-codeinput-large-line-height',\n\n mediumFontSize: '--plasma-codeinput-medium-font-size',\n mediumLineHeight: '--plasma-codeinput-medium-line-height',\n\n smallFontSize: '--plasma-codeinput-small-font-size',\n smallLineHeight: '--plasma-codeinput-small-line-height',\n\n captionFontFamily: '--plasma-codeinput-caption-font-family',\n captionFontSize: '--plasma-codeinput-caption-font-style',\n captionFontStyle: '--plasma-codeinput-caption-font-size',\n captionFontWeight: '--plasma-codeinput-caption-font-weight',\n captionLetterSpacing: '--plasma-codeinput-caption-letter-spacing',\n captionLineHeight: '--plasma-codeinput-caption-line-height',\n\n borderRadius: '--plasma-codeinput-code-item-border-radius',\n borderRadiusSegmented: '--plasma-codeinput-code-item-border-radius-segmented',\n segmentedSideBorderRadius: '--plasma-codeinput-code-item-segmented-side-border-radius',\n\n captionColor: '--plasma-codeinput-caption-color',\n captionColorError: '--plasma-codeinput-caption-color-error',\n\n codeColor: '--plasma-codeinput-code-color',\n codeColorError: '--plasma-codeinput-code-color-error',\n\n backgroundColor: '--plasma-codeinput-background-color',\n backgroundColorHover: '--plasma-codeinput-background-color-hover',\n backgroundColorFocus: '--plasma-codeinput-background-color-focus',\n backgroundErrorColor: '--plasma-codeinput-background-error-color',\n\n borderWidth: '--plasma-codeinput-border-width',\n borderColor: '--plasma-codeinput-border-color',\n borderColorHover: '--plasma-codeinput-border-color-hover',\n borderColorFocus: '--plasma-codeinput-border-color-focus',\n borderErrorColor: '--plasma-codeinput-border-error-color',\n\n disabledOpacity: '--plasma-codeinput-disabled-opacity',\n};\n\nexport type TokensType = keyof typeof tokens;\n"],"names":["classes","itemError","itemErrorAnimation","itemErrorFade","itemCircle","itemCirlceFilled","itemCircleError","itemCircleErrorAnimation","captionError","codeError","codeErrorAnimation","codeErrorFade","captionAlignLeft","hoverEnabled","segmented","disabled","tokens","captionGap","codeItemsGap","separatorWidth","largeCodeItemWidth","largeCodeItemHeight","mediumCodeItemWidth","mediumCodeItemHeight","smallCodeItemWidth","smallCodeItemHeight","codeItemCircleSize","codeItemCircleBorderWidth","fontStyle","fontFamily","fontWeight","letterSpacing","largeFontSize","largeLineHeight","mediumFontSize","mediumLineHeight","smallFontSize","smallLineHeight","captionFontFamily","captionFontSize","captionFontStyle","captionFontWeight","captionLetterSpacing","captionLineHeight","borderRadius","borderRadiusSegmented","segmentedSideBorderRadius","captionColor","captionColorError","codeColor","codeColorError","backgroundColor","backgroundColorHover","backgroundColorFocus","backgroundErrorColor","borderWidth","borderColor","borderColorHover","borderColorFocus","borderErrorColor","disabledOpacity"],"mappings":"AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,SAAS,EAAE,sBAAsB;AACjCC,EAAAA,kBAAkB,EAAE,gCAAgC;AACpDC,EAAAA,aAAa,EAAE,2BAA2B;AAC1CC,EAAAA,UAAU,EAAE,uBAAuB;AACnCC,EAAAA,gBAAgB,EAAE,8BAA8B;AAChDC,EAAAA,eAAe,EAAE,6BAA6B;AAC9CC,EAAAA,wBAAwB,EAAE,uCAAuC;AACjEC,EAAAA,YAAY,EAAE,yBAAyB;AACvCC,EAAAA,SAAS,EAAE,sBAAsB;AACjCC,EAAAA,kBAAkB,EAAE,gCAAgC;AACpDC,EAAAA,aAAa,EAAE,2BAA2B;AAE1CC,EAAAA,gBAAgB,EAAE,8BAA8B;AAEhDC,EAAAA,YAAY,EAAE,8BAA8B;AAE5CC,EAAAA,SAAS,EAAE,2BAA2B;AACtC,EAAA,SAAA,EAAS,yBAAyB;AAElCC,EAAAA,QAAQ,EAAE,oBAAA;AACd,EAAC;AASM,IAAMC,MAAM,GAAG;AAClBC,EAAAA,UAAU,EAAE,gCAAgC;AAC5CC,EAAAA,YAAY,EAAE,kCAAkC;AAEhDC,EAAAA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CAA2C;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,eAAe,EAAE,qCAAA;AACrB;;;;"}
|
@@ -1,51 +0,0 @@
|
|
1
|
-
import { toConsumableArray as _toConsumableArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
-
import { classes } from '../CodeInput.tokens.js';
|
3
|
-
import { ANIMATION_TIMEOUT } from '../../../utils/constants.js';
|
4
|
-
import { getCodeValue } from '../../../utils/initialValuesHelper.js';
|
5
|
-
|
6
|
-
var handleCodeError = function handleCodeError(_ref) {
|
7
|
-
var _captionRef$current, _captionRef$current2;
|
8
|
-
var codeLength = _ref.codeLength,
|
9
|
-
codeErrorBehavior = _ref.codeErrorBehavior,
|
10
|
-
currentCode = _ref.currentCode,
|
11
|
-
inputRefs = _ref.inputRefs,
|
12
|
-
inputContainerRef = _ref.inputContainerRef,
|
13
|
-
captionRef = _ref.captionRef,
|
14
|
-
setCode = _ref.setCode,
|
15
|
-
codeSetter = _ref.codeSetter;
|
16
|
-
if (!inputContainerRef.current) {
|
17
|
-
return;
|
18
|
-
}
|
19
|
-
switch (codeErrorBehavior) {
|
20
|
-
case 'keep':
|
21
|
-
inputContainerRef.current.classList.add(classes.codeError, classes.codeErrorAnimation);
|
22
|
-
(_captionRef$current = captionRef.current) === null || _captionRef$current === void 0 || _captionRef$current.classList.add(classes.captionError);
|
23
|
-
setTimeout(function () {
|
24
|
-
var _inputContainerRef$cu;
|
25
|
-
var newCode = _toConsumableArray(currentCode);
|
26
|
-
newCode.pop();
|
27
|
-
codeSetter(newCode);
|
28
|
-
setCode(currentCode);
|
29
|
-
(_inputContainerRef$cu = inputContainerRef.current) === null || _inputContainerRef$cu === void 0 || _inputContainerRef$cu.classList.remove(classes.codeErrorAnimation);
|
30
|
-
setTimeout(function () {
|
31
|
-
var _inputRefs$current, _inputRefs$current2;
|
32
|
-
(_inputRefs$current = inputRefs.current[inputRefs.current.length - 1]) === null || _inputRefs$current === void 0 || _inputRefs$current.setSelectionRange(0, 1);
|
33
|
-
(_inputRefs$current2 = inputRefs.current[inputRefs.current.length - 1]) === null || _inputRefs$current2 === void 0 || _inputRefs$current2.focus();
|
34
|
-
}, 0);
|
35
|
-
}, ANIMATION_TIMEOUT);
|
36
|
-
break;
|
37
|
-
case 'remove-code':
|
38
|
-
default:
|
39
|
-
inputContainerRef.current.classList.add(classes.codeError, classes.codeErrorAnimation, classes.codeErrorFade);
|
40
|
-
(_captionRef$current2 = captionRef.current) === null || _captionRef$current2 === void 0 || _captionRef$current2.classList.add(classes.captionError);
|
41
|
-
setTimeout(function () {
|
42
|
-
var _inputRefs$current$, _inputContainerRef$cu2;
|
43
|
-
codeSetter(getCodeValue(codeLength, ''));
|
44
|
-
(_inputRefs$current$ = inputRefs.current[0]) === null || _inputRefs$current$ === void 0 || _inputRefs$current$.focus();
|
45
|
-
(_inputContainerRef$cu2 = inputContainerRef.current) === null || _inputContainerRef$cu2 === void 0 || _inputContainerRef$cu2.classList.remove(classes.codeError, classes.codeErrorAnimation, classes.codeErrorFade);
|
46
|
-
}, ANIMATION_TIMEOUT);
|
47
|
-
}
|
48
|
-
};
|
49
|
-
|
50
|
-
export { handleCodeError };
|
51
|
-
//# sourceMappingURL=handleCodeError.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"handleCodeError.js","sources":["../../../../src/components/CodeInput/utils/handleCodeError.ts"],"sourcesContent":["import { Dispatch, MutableRefObject, SetStateAction } from 'react';\n\nimport type { CodeErrorBehavior } from '../CodeInput.types';\nimport { classes } from '../CodeInput.tokens';\nimport { getCodeValue } from '../../../utils';\nimport { ANIMATION_TIMEOUT } from '../../../utils/constants';\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":";;;;;IAkBaA,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,OAAO,CAACC,SAAS,EAAED,OAAO,CAACE,kBAAkB,CAAC,CAAA;AACtF,MAAA,CAAAf,mBAAA,GAAAO,UAAU,CAACG,OAAO,cAAAV,mBAAA,KAAA,KAAA,CAAA,IAAlBA,mBAAA,CAAoBW,SAAS,CAACC,GAAG,CAACC,OAAO,CAACG,YAAY,CAAC,CAAA;AAEvDC,MAAAA,UAAU,CAAC,YAAM;AAAA,QAAA,IAAAC,qBAAA,CAAA;AACb,QAAA,IAAMC,OAAO,GAAAC,kBAAA,CAAOhB,WAAW,CAAC,CAAA;QAEhCe,OAAO,CAACE,GAAG,EAAE,CAAA;QACbZ,UAAU,CAACU,OAAO,CAAC,CAAA;QACnBX,OAAO,CAACJ,WAAW,CAAC,CAAA;AAEpB,QAAA,C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,GAAAzB,SAAS,CAACK,OAAO,CAAC,CAAC,CAAC,MAAA,IAAA,IAAAoB,mBAAA,KAApBA,KAAAA,CAAAA,IAAAA,mBAAA,CAAsBH,KAAK,EAAE,CAAA;QAC7B,CAAAI,sBAAA,GAAAzB,iBAAiB,CAACI,OAAO,cAAAqB,sBAAA,KAAA,KAAA,CAAA,IAAzBA,sBAAA,CAA2BpB,SAAS,CAACW,MAAM,CACvCT,OAAO,CAACC,SAAS,EACjBD,OAAO,CAACE,kBAAkB,EAC1BF,OAAO,CAACgB,aACZ,CAAC,CAAA;OACJ,EAAED,iBAAiB,CAAC,CAAA;AAC7B,GAAA;AACJ;;;;"}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import { classes } from '../CodeInput.tokens.js';
|
2
|
-
import { ANIMATION_TIMEOUT } from '../../../utils/constants.js';
|
3
|
-
|
4
|
-
var handleItemError = function handleItemError(_ref) {
|
5
|
-
var _inputContainerRef$cu;
|
6
|
-
var currentSymbol = _ref.currentSymbol,
|
7
|
-
itemErrorBehavior = _ref.itemErrorBehavior,
|
8
|
-
index = _ref.index,
|
9
|
-
newCode = _ref.newCode,
|
10
|
-
inputRefs = _ref.inputRefs,
|
11
|
-
inputContainerRef = _ref.inputContainerRef,
|
12
|
-
codeSetter = _ref.codeSetter;
|
13
|
-
if (!inputRefs.current[index] || currentSymbol === ' ') {
|
14
|
-
return;
|
15
|
-
}
|
16
|
-
var circleElement = (_inputContainerRef$cu = inputContainerRef.current) === null || _inputContainerRef$cu === void 0 ? void 0 : _inputContainerRef$cu.querySelector(".".concat(classes.itemCircle, "-").concat(index));
|
17
|
-
switch (itemErrorBehavior) {
|
18
|
-
case 'forbid-enter':
|
19
|
-
newCode[index] = '';
|
20
|
-
codeSetter(newCode);
|
21
|
-
break;
|
22
|
-
case 'remove-symbol':
|
23
|
-
default:
|
24
|
-
newCode[index] = '';
|
25
|
-
codeSetter(newCode);
|
26
|
-
if (circleElement) {
|
27
|
-
circleElement.classList.add(classes.itemCircleError, classes.itemCircleErrorAnimation);
|
28
|
-
}
|
29
|
-
setTimeout(function () {
|
30
|
-
if (circleElement) {
|
31
|
-
circleElement.classList.remove(classes.itemCircleError, classes.itemCircleErrorAnimation);
|
32
|
-
}
|
33
|
-
}, ANIMATION_TIMEOUT);
|
34
|
-
}
|
35
|
-
};
|
36
|
-
|
37
|
-
export { handleItemError };
|
38
|
-
//# sourceMappingURL=handleItemError.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"handleItemError.js","sources":["../../../../src/components/CodeInput/utils/handleItemError.ts"],"sourcesContent":["import { MutableRefObject } from 'react';\n\nimport type { ItemErrorBehavior } from '../CodeInput.types';\nimport { classes } from '../CodeInput.tokens';\nimport { ANIMATION_TIMEOUT } from '../../../utils/constants';\n\ntype ValidateSymbolsArgs = {\n currentSymbol: string;\n itemErrorBehavior: ItemErrorBehavior;\n index: number;\n newCode: Array<string>;\n inputRefs: MutableRefObject<Array<HTMLInputElement | null>>;\n inputContainerRef: MutableRefObject<HTMLDivElement | null>;\n codeSetter: (newCode: Array<string>) => void;\n};\n\nexport const handleItemError = ({\n currentSymbol,\n itemErrorBehavior,\n index,\n newCode,\n inputRefs,\n inputContainerRef,\n codeSetter,\n}: ValidateSymbolsArgs) => {\n if (!inputRefs.current[index] || currentSymbol === ' ') {\n return;\n }\n\n const circleElement = inputContainerRef.current?.querySelector(`.${classes.itemCircle}-${index}`);\n\n switch (itemErrorBehavior) {\n case 'forbid-enter':\n newCode[index] = '';\n codeSetter(newCode);\n\n break;\n case 'remove-symbol':\n default:\n newCode[index] = '';\n codeSetter(newCode);\n\n if (circleElement) {\n circleElement.classList.add(classes.itemCircleError, classes.itemCircleErrorAnimation);\n }\n\n setTimeout(() => {\n if (circleElement) {\n circleElement.classList.remove(classes.itemCircleError, classes.itemCircleErrorAnimation);\n }\n }, ANIMATION_TIMEOUT);\n }\n};\n"],"names":["handleItemError","_ref","_inputContainerRef$cu","currentSymbol","itemErrorBehavior","index","newCode","inputRefs","inputContainerRef","codeSetter","current","circleElement","querySelector","concat","classes","itemCircle","classList","add","itemCircleError","itemCircleErrorAnimation","setTimeout","remove","ANIMATION_TIMEOUT"],"mappings":";;;IAgBaA,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAQD;AAAA,EAAA,IAAAC,qBAAA,CAAA;AAAA,EAAA,IAPvBC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IACbC,iBAAiB,GAAAH,IAAA,CAAjBG,iBAAiB;IACjBC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IACLC,OAAO,GAAAL,IAAA,CAAPK,OAAO;IACPC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,iBAAiB,GAAAP,IAAA,CAAjBO,iBAAiB;IACjBC,UAAU,GAAAR,IAAA,CAAVQ,UAAU,CAAA;EAEV,IAAI,CAACF,SAAS,CAACG,OAAO,CAACL,KAAK,CAAC,IAAIF,aAAa,KAAK,GAAG,EAAE;AACpD,IAAA,OAAA;AACJ,GAAA;EAEA,IAAMQ,aAAa,GAAAT,CAAAA,qBAAA,GAAGM,iBAAiB,CAACE,OAAO,MAAA,IAAA,IAAAR,qBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAzBA,qBAAA,CAA2BU,aAAa,CAAAC,GAAAA,CAAAA,MAAA,CAAKC,OAAO,CAACC,UAAU,OAAAF,MAAA,CAAIR,KAAK,CAAE,CAAC,CAAA;AAEjG,EAAA,QAAQD,iBAAiB;AACrB,IAAA,KAAK,cAAc;AACfE,MAAAA,OAAO,CAACD,KAAK,CAAC,GAAG,EAAE,CAAA;MACnBI,UAAU,CAACH,OAAO,CAAC,CAAA;AAEnB,MAAA,MAAA;AACJ,IAAA,KAAK,eAAe,CAAA;AACpB,IAAA;AACIA,MAAAA,OAAO,CAACD,KAAK,CAAC,GAAG,EAAE,CAAA;MACnBI,UAAU,CAACH,OAAO,CAAC,CAAA;AAEnB,MAAA,IAAIK,aAAa,EAAE;AACfA,QAAAA,aAAa,CAACK,SAAS,CAACC,GAAG,CAACH,OAAO,CAACI,eAAe,EAAEJ,OAAO,CAACK,wBAAwB,CAAC,CAAA;AAC1F,OAAA;AAEAC,MAAAA,UAAU,CAAC,YAAM;AACb,QAAA,IAAIT,aAAa,EAAE;AACfA,UAAAA,aAAa,CAACK,SAAS,CAACK,MAAM,CAACP,OAAO,CAACI,eAAe,EAAEJ,OAAO,CAACK,wBAAwB,CAAC,CAAA;AAC7F,SAAA;OACH,EAAEG,iBAAiB,CAAC,CAAA;AAC7B,GAAA;AACJ;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/CodeInput/variations/_disabled/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../../CodeInput.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;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
.b1vzcfqx.b1vzcfqx[disabled]{opacity:var(--plasma-codeinput-disabled-opacity);cursor:not-allowed;}.b1vzcfqx.b1vzcfqx[disabled] > *{pointer-events:none;}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/CodeInput/variations/_size/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { CaptionWrapper, CodeGroup, CodeWrapper, ItemInput } from '../../CodeInput.styles';\nimport { tokens, privateTokens, TokensType } from '../../CodeInput.tokens';\nimport { screenGroupBreakpoints } from '../../../../utils/constants';\n\nconst getIconMediaQueries = () => {\n return Object.entries(screenGroupBreakpoints)\n .map(([name, minWidth]) => {\n return `\n @media (min-width: ${minWidth}) {\n ${privateTokens.fontSize}: var(${tokens[`${name}FontSize` as TokensType]});\n ${privateTokens.lineHeight}: var(${tokens[`${name}CodeItemHeight` as TokensType]});\n ${privateTokens.itemWidth}: var(${tokens[`${name}CodeItemWidth` as TokensType]});\n ${privateTokens.itemHeight}: var(${tokens[`${name}LineHeight` as TokensType]});\n }\n `;\n })\n .join('\\n');\n};\n\nexport const base = css`\n ${getIconMediaQueries()}\n gap: var(${tokens.captionGap});\n\n ${CodeWrapper}, ${CodeGroup} {\n gap: var(${tokens.codeItemsGap});\n }\n\n ${ItemInput} {\n font-size: var(${privateTokens.fontSize});\n font-family: var(${tokens.fontFamily});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.letterSpacing});\n line-height: var(${privateTokens.lineHeight});\n width: var(${privateTokens.itemWidth});\n height: var(${privateTokens.itemHeight});\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":"AAqBO,IAAMA,IAAI,GA2BhB;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
.bbkzv6b{gap:var(--plasma-codeinput-caption-gap);}@media (min-width:0){.bbkzv6b{--private-codeinput-font-size:var(--plasma-codeinput-small-font-size);--private-codeinput-line-height:var(--plasma-codeinput-item-small-height);--private-codeinput-item-width:var(--plasma-codeinput-item-small-width);--private-codeinput-item-hieght:var(--plasma-codeinput-small-line-height);}}@media (min-width:35rem){.bbkzv6b{--private-codeinput-font-size:var(--plasma-codeinput-medium-font-size);--private-codeinput-line-height:var(--plasma-codeinput-item-medium-height);--private-codeinput-item-width:var(--plasma-codeinput-item-medium-width);--private-codeinput-item-hieght:var(--plasma-codeinput-medium-line-height);}}@media (min-width:60rem){.bbkzv6b{--private-codeinput-font-size:var(--plasma-codeinput-large-font-size);--private-codeinput-line-height:var(--plasma-codeinput-item-large-height);--private-codeinput-item-width:var(--plasma-codeinput-item-large-width);--private-codeinput-item-hieght:var(--plasma-codeinput-large-line-height);}}.bbkzv6b .c1fux591,.bbkzv6b .cuja080{gap:var(--plasma-codeinput-code-item-gap);}.bbkzv6b .i16menav{font-size:var(--private-codeinput-font-size);font-family:var(--plasma-codeinput-font-family);font-style:var(--plasma-codeinput-font-style);font-weight:var(--plasma-codeinput-font-weight);-webkit-letter-spacing:var(--plasma-codeinput-letter-spacing);-moz-letter-spacing:var(--plasma-codeinput-letter-spacing);-ms-letter-spacing:var(--plasma-codeinput-letter-spacing);letter-spacing:var(--plasma-codeinput-letter-spacing);line-height:var(--private-codeinput-line-height);width:var(--private-codeinput-item-width);height:var(--private-codeinput-item-hieght);}.bbkzv6b .c19x1gm7{font-family:var(--plasma-codeinput-caption-font-family);font-size:var(--plasma-codeinput-caption-font-style);font-style:var(--plasma-codeinput-caption-font-size);font-weight:var(--plasma-codeinput-caption-font-weight);-webkit-letter-spacing:var(--plasma-codeinput-caption-letter-spacing);-moz-letter-spacing:var(--plasma-codeinput-caption-letter-spacing);-ms-letter-spacing:var(--plasma-codeinput-caption-letter-spacing);letter-spacing:var(--plasma-codeinput-caption-letter-spacing);line-height:var(--plasma-codeinput-caption-line-height);}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/CodeInput/variations/_view/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { CaptionWrapper, ItemInput, ItemCircle } from '../../CodeInput.styles';\nimport { classes, tokens } from '../../CodeInput.tokens';\nimport { addFocus } from '../../../../mixins';\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 background-color: var(${tokens.backgroundColor});\n box-shadow: inset 0 0 0 var(${tokens.borderWidth}) var(${tokens.borderColor});\n }\n\n ${ItemCircle} {\n border: var(${tokens.codeItemCircleBorderWidth}) solid var(${tokens.codeColor});\n background-color: 'transparent';\n\n &.${classes.itemCirlceFilled} {\n background-color: var(${tokens.codeColor});\n }\n\n &.${classes.itemCircleErrorAnimation} {\n animation: shakingError 0.3s forwards;\n }\n\n &.${classes.itemCircleError} {\n background-color: var(${tokens.codeColorError});\n border: var(${tokens.codeItemCircleBorderWidth}) solid var(${tokens.codeColorError});\n }\n\n &:focus-visible {\n outline: none;\n }\n\n &[data-focus-visible-added] {\n ${addFocus({\n outlineOffset: '-0.125rem',\n outlineSize: '0.125rem',\n outlineRadius: '1rem',\n outlineColor: `var(${tokens.borderColorFocus})`,\n })}\n border: none;\n position: absolute;\n }\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 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 ${ItemCircle} {\n border: var(${tokens.codeItemCircleBorderWidth}) solid var(${tokens.codeColorError});\n\n &.${classes.itemCirlceFilled} {\n background-color: var(${tokens.codeColorError});\n }\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":"AAMO,IAAMA,IAAI,GA4IhB;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
.bxs6mj3 .c19x1gm7{color:var(--plasma-codeinput-caption-color);}.bxs6mj3 .c19x1gm7.codeinput-caption-error{color:var(--plasma-codeinput-caption-color-error);}.bxs6mj3 .i16menav{color:var(--plasma-codeinput-code-color);background-color:var(--plasma-codeinput-background-color);box-shadow:inset 0 0 0 var(--plasma-codeinput-border-width) var(--plasma-codeinput-border-color);}.bxs6mj3 .i1tn2nm3{border:var(--plasma-codeinput-item-circle-border-width) solid var(--plasma-codeinput-code-color);background-color:'transparent';}.bxs6mj3 .i1tn2nm3.codeinput-item-circle-filled{background-color:var(--plasma-codeinput-code-color);}.bxs6mj3 .i1tn2nm3.codeinput-item-circle-error-animation{-webkit-animation:shakingError-bxs6mj3 0.3s forwards;animation:shakingError-bxs6mj3 0.3s forwards;}.bxs6mj3 .i1tn2nm3.codeinput-item-circle-error{background-color:var(--plasma-codeinput-code-color-error);border:var(--plasma-codeinput-item-circle-border-width) solid var(--plasma-codeinput-code-color-error);}.bxs6mj3 .i1tn2nm3:focus-visible{outline:none;}.bxs6mj3 .i1tn2nm3[data-focus-visible-added]{position:relative;border:none;position:absolute;}.bxs6mj3 .i1tn2nm3[data-focus-visible-added]::before{content:'';position:absolute;top:-0.125rem;left:-0.125rem;right:-0.125rem;bottom:-0.125rem;z-index:1;display:block;box-sizing:content-box;border:0.125rem solid transparent;border-radius:1rem;-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.bxs6mj3 .i1tn2nm3[data-focus-visible-added].focus-visible:focus::before,.bxs6mj3 .i1tn2nm3[data-focus-visible-added][data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.125rem var(--plasma-codeinput-border-color-focus);}.bxs6mj3:hover .codeinput-item-hover-enabled{background-color:var(--plasma-codeinput-background-color-hover);box-shadow:inset 0 0 0 var(--plasma-codeinput-border-width) var(--plasma-codeinput-border-color-hover);}.bxs6mj3:focus-within .i16menav:focus-within{box-shadow:inset 0 0 0 var(--plasma-codeinput-border-width) var(--plasma-codeinput-border-color-focus);}.bxs6mj3.bxs6mj3 .codeinput-code-error-animation{-webkit-animation:shakingError-bxs6mj3 0.3s forwards;animation:shakingError-bxs6mj3 0.3s forwards;}.bxs6mj3.bxs6mj3 .codeinput-code-error .i16menav{color:var(--plasma-codeinput-code-color-error);background-color:var(--plasma-codeinput-background-error-color);box-shadow:inset 0 0 0 var(--plasma-codeinput-border-width) var(--plasma-codeinput-border-error-color);}.bxs6mj3.bxs6mj3 .codeinput-code-error .i1tn2nm3{border:var(--plasma-codeinput-item-circle-border-width) solid var(--plasma-codeinput-code-color-error);}.bxs6mj3.bxs6mj3 .codeinput-code-error .i1tn2nm3.codeinput-item-circle-filled{background-color:var(--plasma-codeinput-code-color-error);}.bxs6mj3.bxs6mj3 .codeinput-code-error:focus-within .i16menav{background-color:var(--plasma-codeinput-background-error-color);box-shadow:inset 0 0 0 var(--plasma-codeinput-border-width) var(--plasma-codeinput-border-error-color);}.bxs6mj3.bxs6mj3 .codeinput-code-error.codeinput-code-error-fade .i16menav{-webkit-animation:fadeError-bxs6mj3 0.3s forwards;animation:fadeError-bxs6mj3 0.3s forwards;}.bxs6mj3.bxs6mj3 .codeinput-item-error-animation{-webkit-animation:shakingError-bxs6mj3 0.3s forwards;animation:shakingError-bxs6mj3 0.3s forwards;}.bxs6mj3.bxs6mj3 .codeinput-item-error,.bxs6mj3.bxs6mj3 .codeinput-item-error:focus-within{color:var(--plasma-codeinput-code-color-error);background-color:var(--plasma-codeinput-background-error-color);box-shadow:inset 0 0 0 var(--plasma-codeinput-border-width) var(--plasma-codeinput-border-error-color);}.bxs6mj3.bxs6mj3 .codeinput-item-error.codeinput-code-error-fade,.bxs6mj3.bxs6mj3 .codeinput-item-error:focus-within.codeinput-code-error-fade{-webkit-animation:shakingError-bxs6mj3 0.3s forwards fadeError-bxs6mj3 0.3s forwards;animation:shakingError-bxs6mj3 0.3s forwards fadeError-bxs6mj3 0.3s forwards;}@-webkit-keyframes shakingError-bxs6mj3{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-bxs6mj3{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-bxs6mj3{50%{color:var(--plasma-codeinput-code-color-error);}100%{color:transparent;}}@keyframes fadeError-bxs6mj3{50%{color:var(--plasma-codeinput-code-color-error);}100%{color:transparent;}}
|
package/es/hooks/useCodeHook.js
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
import { useEffect } from 'react';
|
2
|
-
import { useDidMountEffect } from './useDidMountEffect.js';
|
3
|
-
|
4
|
-
var useCodeHook = function useCodeHook(_ref) {
|
5
|
-
var inputRefs = _ref.inputRefs,
|
6
|
-
codeLength = _ref.codeLength,
|
7
|
-
disabled = _ref.disabled,
|
8
|
-
autoFocus = _ref.autoFocus,
|
9
|
-
originalValue = _ref.originalValue,
|
10
|
-
getLastActiveIndex = _ref.getLastActiveIndex,
|
11
|
-
handleFullCodeEnter = _ref.handleFullCodeEnter;
|
12
|
-
useEffect(function () {
|
13
|
-
inputRefs.current = inputRefs.current.slice(0, codeLength);
|
14
|
-
}, [codeLength]);
|
15
|
-
useEffect(function () {
|
16
|
-
if (autoFocus && !disabled) {
|
17
|
-
var _inputRefs$current$la;
|
18
|
-
var lastActiveIndex = getLastActiveIndex();
|
19
|
-
(_inputRefs$current$la = inputRefs.current[lastActiveIndex]) === null || _inputRefs$current$la === void 0 || _inputRefs$current$la.focus();
|
20
|
-
}
|
21
|
-
}, [autoFocus]);
|
22
|
-
useDidMountEffect(function () {
|
23
|
-
if (handleFullCodeEnter && originalValue.length === codeLength) {
|
24
|
-
handleFullCodeEnter(originalValue);
|
25
|
-
}
|
26
|
-
}, [originalValue, handleFullCodeEnter]);
|
27
|
-
};
|
28
|
-
|
29
|
-
export { useCodeHook };
|
30
|
-
//# sourceMappingURL=useCodeHook.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useCodeHook.js","sources":["../../src/hooks/useCodeHook.ts"],"sourcesContent":["import { MutableRefObject, useEffect } from 'react';\n\nimport { useDidMountEffect } from '.';\n\ntype useCodeHookTypes = {\n codeLength: number;\n inputRefs: MutableRefObject<Array<HTMLInputElement | null>>;\n autoFocus?: boolean;\n disabled?: boolean;\n originalValue: string;\n getLastActiveIndex: () => number;\n handleFullCodeEnter: (fullCode: string) => void;\n};\n\nexport const useCodeHook = ({\n inputRefs,\n codeLength,\n disabled,\n autoFocus,\n originalValue,\n getLastActiveIndex,\n handleFullCodeEnter,\n}: useCodeHookTypes) => {\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"],"names":["useCodeHook","_ref","inputRefs","codeLength","disabled","autoFocus","originalValue","getLastActiveIndex","handleFullCodeEnter","useEffect","current","slice","_inputRefs$current$la","lastActiveIndex","focus","useDidMountEffect","length"],"mappings":";;;IAcaA,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAQA;AAAA,EAAA,IAPpBC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IACVC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IACTC,aAAa,GAAAL,IAAA,CAAbK,aAAa;IACbC,kBAAkB,GAAAN,IAAA,CAAlBM,kBAAkB;IAClBC,mBAAmB,GAAAP,IAAA,CAAnBO,mBAAmB,CAAA;AAEnBC,EAAAA,SAAS,CAAC,YAAM;AACZP,IAAAA,SAAS,CAACQ,OAAO,GAAGR,SAAS,CAACQ,OAAO,CAACC,KAAK,CAAC,CAAC,EAAER,UAAU,CAAC,CAAA;AAC9D,GAAC,EAAE,CAACA,UAAU,CAAC,CAAC,CAAA;AAEhBM,EAAAA,SAAS,CAAC,YAAM;AACZ,IAAA,IAAIJ,SAAS,IAAI,CAACD,QAAQ,EAAE;AAAA,MAAA,IAAAQ,qBAAA,CAAA;AACxB,MAAA,IAAMC,eAAe,GAAGN,kBAAkB,EAAE,CAAA;AAE5C,MAAA,CAAAK,qBAAA,GAAAV,SAAS,CAACQ,OAAO,CAACG,eAAe,CAAC,MAAA,IAAA,IAAAD,qBAAA,KAAlCA,KAAAA,CAAAA,IAAAA,qBAAA,CAAoCE,KAAK,EAAE,CAAA;AAC/C,KAAA;AACJ,GAAC,EAAE,CAACT,SAAS,CAAC,CAAC,CAAA;AAEfU,EAAAA,iBAAiB,CAAC,YAAM;AACpB,IAAA,IAAIP,mBAAmB,IAAIF,aAAa,CAACU,MAAM,KAAKb,UAAU,EAAE;MAC5DK,mBAAmB,CAACF,aAAa,CAAC,CAAA;AACtC,KAAA;AACJ,GAAC,EAAE,CAACA,aAAa,EAAEE,mBAAmB,CAAC,CAAC,CAAA;AAC5C;;;;"}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
var getFieldPattern = function getFieldPattern(allowedSymbols) {
|
2
|
-
if (!allowedSymbols) {
|
3
|
-
return null;
|
4
|
-
}
|
5
|
-
if (typeof allowedSymbols === 'string') {
|
6
|
-
return new RegExp(allowedSymbols, 'g');
|
7
|
-
}
|
8
|
-
return allowedSymbols;
|
9
|
-
};
|
10
|
-
var getCodeValue = function getCodeValue(codeLength, value) {
|
11
|
-
if (!value.length) {
|
12
|
-
return new Array(codeLength).fill('');
|
13
|
-
}
|
14
|
-
return value.slice(0, codeLength).split('');
|
15
|
-
};
|
16
|
-
var getPlaceholderValue = function getPlaceholderValue(codeLength, placeholder) {
|
17
|
-
if (!placeholder || typeof placeholder !== 'string') {
|
18
|
-
return null;
|
19
|
-
}
|
20
|
-
if (placeholder.length === 1) {
|
21
|
-
return Array(codeLength).fill(placeholder);
|
22
|
-
}
|
23
|
-
return placeholder.slice(0, codeLength).split('');
|
24
|
-
};
|
25
|
-
|
26
|
-
export { getCodeValue, getFieldPattern, getPlaceholderValue };
|
27
|
-
//# sourceMappingURL=initialValuesHelper.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"initialValuesHelper.js","sources":["../../src/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;;;;"}
|