@alfalab/core-components-pattern-lock 2.5.11 → 2.5.12-snapshot-1393ffa
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/Component.responsive.js +4 -3
- package/Component.responsive.js.map +1 -0
- package/components/base-pattern-lock/Component.js +9 -10
- package/components/base-pattern-lock/Component.js.map +1 -0
- package/components/base-pattern-lock/index.css +10 -31
- package/components/base-pattern-lock/index.js +3 -2
- package/components/base-pattern-lock/index.js.map +1 -0
- package/components/base-pattern-lock/index.module.css.js +8 -0
- package/components/base-pattern-lock/index.module.css.js.map +1 -0
- package/consts.js +1 -0
- package/consts.js.map +1 -0
- package/cssm/Component.responsive.js +6 -5
- package/cssm/Component.responsive.js.map +1 -0
- package/cssm/components/base-pattern-lock/Component.js +3 -2
- package/cssm/components/base-pattern-lock/Component.js.map +1 -0
- package/cssm/components/base-pattern-lock/index.js +3 -2
- package/cssm/components/base-pattern-lock/index.js.map +1 -0
- package/cssm/components/base-pattern-lock/index.module.css +3 -23
- package/cssm/consts.js +1 -0
- package/cssm/consts.js.map +1 -0
- package/cssm/desktop/Component.desktop.js +3 -2
- package/cssm/desktop/Component.desktop.js.map +1 -0
- package/cssm/desktop/desktop.module.css +2 -23
- package/cssm/desktop/index.js +3 -2
- package/cssm/desktop/index.js.map +1 -0
- package/cssm/hooks/use-pattern-lock-cleanup.js +1 -0
- package/cssm/hooks/use-pattern-lock-cleanup.js.map +1 -0
- package/cssm/index.js +1 -0
- package/cssm/index.js.map +1 -0
- package/cssm/mobile/Component.mobile.js +3 -2
- package/cssm/mobile/Component.mobile.js.map +1 -0
- package/cssm/mobile/index.js +3 -2
- package/cssm/mobile/index.js.map +1 -0
- package/cssm/mobile/mobile.module.css +2 -23
- package/cssm/shared/index.js +3 -2
- package/cssm/shared/index.js.map +1 -0
- package/cssm/src/Component.responsive.d.ts +4 -0
- package/cssm/src/components/base-pattern-lock/Component.d.ts +4 -0
- package/cssm/src/components/base-pattern-lock/index.d.ts +1 -0
- package/cssm/src/consts.d.ts +10 -0
- package/cssm/src/desktop/Component.desktop.d.ts +4 -0
- package/cssm/src/desktop/index.d.ts +2 -0
- package/cssm/src/hooks/use-pattern-lock-cleanup.d.ts +4 -0
- package/cssm/src/index.d.ts +3 -0
- package/cssm/src/mobile/Component.mobile.d.ts +4 -0
- package/cssm/src/mobile/index.d.ts +2 -0
- package/cssm/src/shared/index.d.ts +2 -0
- package/cssm/{typings.d.ts → src/typings.d.ts} +6 -6
- package/cssm/src/utils.d.ts +13 -0
- package/cssm/typings.js +1 -0
- package/cssm/typings.js.map +1 -0
- package/cssm/utils.js +3 -2
- package/cssm/utils.js.map +1 -0
- package/desktop/Component.desktop.js +4 -5
- package/desktop/Component.desktop.js.map +1 -0
- package/desktop/desktop.css +5 -27
- package/desktop/desktop.module.css.js +8 -0
- package/desktop/desktop.module.css.js.map +1 -0
- package/desktop/index.js +3 -2
- package/desktop/index.js.map +1 -0
- package/esm/Component.responsive.js +1 -0
- package/esm/Component.responsive.js.map +1 -0
- package/esm/components/base-pattern-lock/Component.js +3 -4
- package/esm/components/base-pattern-lock/Component.js.map +1 -0
- package/esm/components/base-pattern-lock/index.css +10 -31
- package/esm/components/base-pattern-lock/index.js +1 -0
- package/esm/components/base-pattern-lock/index.js.map +1 -0
- package/esm/components/base-pattern-lock/index.module.css.js +6 -0
- package/esm/components/base-pattern-lock/index.module.css.js.map +1 -0
- package/esm/consts.js +1 -0
- package/esm/consts.js.map +1 -0
- package/esm/desktop/Component.desktop.js +2 -3
- package/esm/desktop/Component.desktop.js.map +1 -0
- package/esm/desktop/desktop.css +5 -27
- package/esm/desktop/desktop.module.css.js +6 -0
- package/esm/desktop/desktop.module.css.js.map +1 -0
- package/esm/desktop/index.js +1 -0
- package/esm/desktop/index.js.map +1 -0
- package/esm/hooks/use-pattern-lock-cleanup.js +1 -0
- package/esm/hooks/use-pattern-lock-cleanup.js.map +1 -0
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -0
- package/esm/mobile/Component.mobile.js +2 -3
- package/esm/mobile/Component.mobile.js.map +1 -0
- package/esm/mobile/index.js +1 -0
- package/esm/mobile/index.js.map +1 -0
- package/esm/mobile/mobile.css +4 -26
- package/esm/mobile/mobile.module.css.js +6 -0
- package/esm/mobile/mobile.module.css.js.map +1 -0
- package/esm/shared/index.js +1 -0
- package/esm/shared/index.js.map +1 -0
- package/esm/src/Component.responsive.d.ts +4 -0
- package/esm/src/components/base-pattern-lock/Component.d.ts +4 -0
- package/esm/src/components/base-pattern-lock/index.d.ts +1 -0
- package/esm/src/consts.d.ts +10 -0
- package/esm/src/desktop/Component.desktop.d.ts +4 -0
- package/esm/src/desktop/index.d.ts +2 -0
- package/esm/src/hooks/use-pattern-lock-cleanup.d.ts +4 -0
- package/esm/src/index.d.ts +3 -0
- package/esm/src/mobile/Component.mobile.d.ts +4 -0
- package/esm/src/mobile/index.d.ts +2 -0
- package/esm/src/shared/index.d.ts +2 -0
- package/esm/{typings.d.ts → src/typings.d.ts} +6 -6
- package/esm/src/utils.d.ts +13 -0
- package/esm/typings.js +1 -0
- package/esm/typings.js.map +1 -0
- package/esm/utils.js +2 -1
- package/esm/utils.js.map +1 -0
- package/hooks/use-pattern-lock-cleanup.js +1 -0
- package/hooks/use-pattern-lock-cleanup.js.map +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -0
- package/mobile/Component.mobile.js +4 -5
- package/mobile/Component.mobile.js.map +1 -0
- package/mobile/index.js +3 -2
- package/mobile/index.js.map +1 -0
- package/mobile/mobile.css +4 -26
- package/mobile/mobile.module.css.js +8 -0
- package/mobile/mobile.module.css.js.map +1 -0
- package/modern/Component.responsive.js +1 -0
- package/modern/Component.responsive.js.map +1 -0
- package/modern/components/base-pattern-lock/Component.js +4 -5
- package/modern/components/base-pattern-lock/Component.js.map +1 -0
- package/modern/components/base-pattern-lock/index.css +10 -31
- package/modern/components/base-pattern-lock/index.js +1 -0
- package/modern/components/base-pattern-lock/index.js.map +1 -0
- package/modern/components/base-pattern-lock/index.module.css.js +6 -0
- package/modern/components/base-pattern-lock/index.module.css.js.map +1 -0
- package/modern/consts.js +1 -0
- package/modern/consts.js.map +1 -0
- package/modern/desktop/Component.desktop.js +2 -3
- package/modern/desktop/Component.desktop.js.map +1 -0
- package/modern/desktop/desktop.css +5 -27
- package/modern/desktop/desktop.module.css.js +6 -0
- package/modern/desktop/desktop.module.css.js.map +1 -0
- package/modern/desktop/index.js +1 -0
- package/modern/desktop/index.js.map +1 -0
- package/modern/hooks/use-pattern-lock-cleanup.js +1 -0
- package/modern/hooks/use-pattern-lock-cleanup.js.map +1 -0
- package/modern/index.js +1 -0
- package/modern/index.js.map +1 -0
- package/modern/mobile/Component.mobile.js +2 -3
- package/modern/mobile/Component.mobile.js.map +1 -0
- package/modern/mobile/index.js +1 -0
- package/modern/mobile/index.js.map +1 -0
- package/modern/mobile/mobile.css +4 -26
- package/modern/mobile/mobile.module.css.js +6 -0
- package/modern/mobile/mobile.module.css.js.map +1 -0
- package/modern/shared/index.js +1 -0
- package/modern/shared/index.js.map +1 -0
- package/modern/src/Component.responsive.d.ts +4 -0
- package/modern/src/components/base-pattern-lock/Component.d.ts +4 -0
- package/modern/src/components/base-pattern-lock/index.d.ts +1 -0
- package/modern/src/consts.d.ts +10 -0
- package/modern/src/desktop/Component.desktop.d.ts +4 -0
- package/modern/src/desktop/index.d.ts +2 -0
- package/modern/src/hooks/use-pattern-lock-cleanup.d.ts +4 -0
- package/modern/src/index.d.ts +3 -0
- package/modern/src/mobile/Component.mobile.d.ts +4 -0
- package/modern/src/mobile/index.d.ts +2 -0
- package/modern/src/shared/index.d.ts +2 -0
- package/modern/{typings.d.ts → src/typings.d.ts} +6 -6
- package/modern/src/utils.d.ts +13 -0
- package/modern/typings.js +1 -0
- package/modern/typings.js.map +1 -0
- package/modern/utils.js +2 -1
- package/modern/utils.js.map +1 -0
- package/moderncssm/Component.responsive.js +1 -0
- package/moderncssm/Component.responsive.js.map +1 -0
- package/moderncssm/components/base-pattern-lock/Component.js +3 -2
- package/moderncssm/components/base-pattern-lock/Component.js.map +1 -0
- package/moderncssm/components/base-pattern-lock/index.js +1 -0
- package/moderncssm/components/base-pattern-lock/index.js.map +1 -0
- package/moderncssm/components/base-pattern-lock/index.module.css +0 -1
- package/moderncssm/consts.js +1 -0
- package/moderncssm/consts.js.map +1 -0
- package/moderncssm/desktop/Component.desktop.js +1 -0
- package/moderncssm/desktop/Component.desktop.js.map +1 -0
- package/moderncssm/desktop/desktop.module.css +0 -1
- package/moderncssm/desktop/index.js +1 -0
- package/moderncssm/desktop/index.js.map +1 -0
- package/moderncssm/hooks/use-pattern-lock-cleanup.js +1 -0
- package/moderncssm/hooks/use-pattern-lock-cleanup.js.map +1 -0
- package/moderncssm/index.js +1 -0
- package/moderncssm/index.js.map +1 -0
- package/moderncssm/mobile/Component.mobile.js +1 -0
- package/moderncssm/mobile/Component.mobile.js.map +1 -0
- package/moderncssm/mobile/index.js +1 -0
- package/moderncssm/mobile/index.js.map +1 -0
- package/moderncssm/mobile/mobile.module.css +0 -1
- package/moderncssm/shared/index.js +1 -0
- package/moderncssm/shared/index.js.map +1 -0
- package/moderncssm/src/Component.responsive.d.ts +4 -0
- package/moderncssm/src/components/base-pattern-lock/Component.d.ts +4 -0
- package/moderncssm/src/components/base-pattern-lock/index.d.ts +1 -0
- package/moderncssm/src/consts.d.ts +10 -0
- package/moderncssm/src/desktop/Component.desktop.d.ts +4 -0
- package/moderncssm/src/desktop/index.d.ts +2 -0
- package/moderncssm/src/hooks/use-pattern-lock-cleanup.d.ts +4 -0
- package/moderncssm/src/index.d.ts +3 -0
- package/moderncssm/src/mobile/Component.mobile.d.ts +4 -0
- package/moderncssm/src/mobile/index.d.ts +2 -0
- package/moderncssm/src/shared/index.d.ts +2 -0
- package/moderncssm/{typings.d.ts → src/typings.d.ts} +6 -6
- package/moderncssm/src/utils.d.ts +13 -0
- package/moderncssm/typings.js +1 -0
- package/moderncssm/typings.js.map +1 -0
- package/moderncssm/utils.js +2 -1
- package/moderncssm/utils.js.map +1 -0
- package/package.json +6 -6
- package/shared/index.js +3 -2
- package/shared/index.js.map +1 -0
- package/src/Component.responsive.d.ts +4 -0
- package/src/components/base-pattern-lock/Component.d.ts +4 -0
- package/src/components/base-pattern-lock/index.d.ts +1 -0
- package/src/consts.d.ts +10 -0
- package/src/desktop/Component.desktop.d.ts +4 -0
- package/src/desktop/index.d.ts +2 -0
- package/src/hooks/use-pattern-lock-cleanup.d.ts +4 -0
- package/src/index.d.ts +3 -0
- package/src/mobile/Component.mobile.d.ts +4 -0
- package/src/mobile/index.d.ts +2 -0
- package/src/shared/index.d.ts +2 -0
- package/src/typings.d.ts +96 -0
- package/src/utils.d.ts +13 -0
- package/typings.js +1 -0
- package/typings.js.map +1 -0
- package/utils.js +1 -0
- package/utils.js.map +1 -0
- package/Component.responsive.d.ts +0 -6
- package/components/base-pattern-lock/Component.d.ts +0 -6
- package/components/base-pattern-lock/index.d.ts +0 -1
- package/consts.d.ts +0 -11
- package/cssm/Component.responsive.d.ts +0 -6
- package/cssm/components/base-pattern-lock/Component.d.ts +0 -6
- package/cssm/components/base-pattern-lock/index.d.ts +0 -1
- package/cssm/consts.d.ts +0 -11
- package/cssm/desktop/Component.desktop.d.ts +0 -6
- package/cssm/desktop/index.d.ts +0 -2
- package/cssm/hooks/use-pattern-lock-cleanup.d.ts +0 -6
- package/cssm/index.d.ts +0 -3
- package/cssm/mobile/Component.mobile.d.ts +0 -6
- package/cssm/mobile/index.d.ts +0 -2
- package/cssm/shared/index.d.ts +0 -2
- package/cssm/utils.d.ts +0 -14
- package/cssm/vars.css +0 -0
- package/desktop/Component.desktop.d.ts +0 -6
- package/desktop/index.d.ts +0 -2
- package/esm/Component.responsive.d.ts +0 -6
- package/esm/components/base-pattern-lock/Component.d.ts +0 -6
- package/esm/components/base-pattern-lock/index.d.ts +0 -1
- package/esm/consts.d.ts +0 -11
- package/esm/desktop/Component.desktop.d.ts +0 -6
- package/esm/desktop/index.d.ts +0 -2
- package/esm/hooks/use-pattern-lock-cleanup.d.ts +0 -6
- package/esm/index.d.ts +0 -3
- package/esm/mobile/Component.mobile.d.ts +0 -6
- package/esm/mobile/index.d.ts +0 -2
- package/esm/shared/index.d.ts +0 -2
- package/esm/utils.d.ts +0 -14
- package/hooks/use-pattern-lock-cleanup.d.ts +0 -6
- package/index.d.ts +0 -3
- package/mobile/Component.mobile.d.ts +0 -6
- package/mobile/index.d.ts +0 -2
- package/modern/Component.responsive.d.ts +0 -6
- package/modern/components/base-pattern-lock/Component.d.ts +0 -6
- package/modern/components/base-pattern-lock/index.d.ts +0 -1
- package/modern/consts.d.ts +0 -11
- package/modern/desktop/Component.desktop.d.ts +0 -6
- package/modern/desktop/index.d.ts +0 -2
- package/modern/hooks/use-pattern-lock-cleanup.d.ts +0 -6
- package/modern/index.d.ts +0 -3
- package/modern/mobile/Component.mobile.d.ts +0 -6
- package/modern/mobile/index.d.ts +0 -2
- package/modern/shared/index.d.ts +0 -2
- package/modern/utils.d.ts +0 -14
- package/moderncssm/Component.responsive.d.ts +0 -6
- package/moderncssm/components/base-pattern-lock/Component.d.ts +0 -6
- package/moderncssm/components/base-pattern-lock/index.d.ts +0 -1
- package/moderncssm/consts.d.ts +0 -11
- package/moderncssm/desktop/Component.desktop.d.ts +0 -6
- package/moderncssm/desktop/index.d.ts +0 -2
- package/moderncssm/hooks/use-pattern-lock-cleanup.d.ts +0 -6
- package/moderncssm/index.d.ts +0 -3
- package/moderncssm/mobile/Component.mobile.d.ts +0 -6
- package/moderncssm/mobile/index.d.ts +0 -2
- package/moderncssm/shared/index.d.ts +0 -2
- package/moderncssm/utils.d.ts +0 -14
- package/moderncssm/vars.css +0 -0
- package/shared/index.d.ts +0 -2
- package/typings.d.ts +0 -96
- package/utils.d.ts +0 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile.module.css.js","sources":["../src/mobile/mobile.module.css"],"sourcesContent":["@import '../../../vars/src/index.css';\n@import '../vars.css';\n\n.component {\n margin: var(--gap-0) auto;\n min-width: var(--pattern-lock-min-width);\n}\n\n.forgotBtn {\n margin: var(--gap-8) auto var(--gap-0);\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,+BAA+B,CAAC,WAAW,CAAC,+BAA+B,CAAC;;;;"}
|
package/modern/shared/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
3
|
+
import { PatternLockProps } from './typings';
|
|
4
|
+
export declare const PatternLock: React.ForwardRefExoticComponent<PatternLockProps & React.RefAttributes<TPatternLockInstance>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
3
|
+
import type { CommonPatternLockProps, PrivatePatternLockProps } from '../../typings';
|
|
4
|
+
export declare const BasePatternLock: React.ForwardRefExoticComponent<(CommonPatternLockProps & PrivatePatternLockProps) & React.RefAttributes<TPatternLockInstance>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Component';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactPatternLockProps } from '@alfalab/react-canvas-pattern-lock';
|
|
2
|
+
import type { ObservableTokens } from './typings';
|
|
3
|
+
export declare const OBSERVE_OPTIONS: MutationObserverInit;
|
|
4
|
+
export declare const DEFAULT_EXTRA_BOUNDS: ReactPatternLockProps['extraBounds'];
|
|
5
|
+
export declare const OBSERVABLE_TOKENS: ObservableTokens;
|
|
6
|
+
export declare const THEME_STATE: {
|
|
7
|
+
INITIAL: string;
|
|
8
|
+
SUCCESS: string;
|
|
9
|
+
FAILURE: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
3
|
+
import { CommonPatternLockProps } from '../typings';
|
|
4
|
+
export declare const PatternLockDesktop: React.ForwardRefExoticComponent<CommonPatternLockProps & React.RefAttributes<TPatternLockInstance>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
3
|
+
import { CommonPatternLockProps } from '../typings';
|
|
4
|
+
export declare const PatternLockMobile: React.ForwardRefExoticComponent<CommonPatternLockProps & React.RefAttributes<TPatternLockInstance>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MouseEvent } from 'react';
|
|
2
2
|
import { ReactPatternLockProps } from '@alfalab/react-canvas-pattern-lock';
|
|
3
|
-
type ConditionalProps = {
|
|
3
|
+
declare type ConditionalProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Показать кнопку "забыли код"
|
|
6
6
|
* @default "Забыли код?"
|
|
@@ -20,7 +20,7 @@ type ConditionalProps = {
|
|
|
20
20
|
onForgotBtnClick?: never;
|
|
21
21
|
forgotCodeBtnText?: never;
|
|
22
22
|
};
|
|
23
|
-
type CommonPatternLockProps = {
|
|
23
|
+
export declare type CommonPatternLockProps = {
|
|
24
24
|
/**
|
|
25
25
|
* Дополнительный класс
|
|
26
26
|
*/
|
|
@@ -53,7 +53,7 @@ type CommonPatternLockProps = {
|
|
|
53
53
|
*/
|
|
54
54
|
disabled?: boolean;
|
|
55
55
|
} & Omit<ReactPatternLockProps, 'theme' | 'width' | 'height' | 'rows' | 'cols' | 'hover' | 'justifyNodes'> & ConditionalProps;
|
|
56
|
-
type PrivatePatternLockProps = {
|
|
56
|
+
export declare type PrivatePatternLockProps = {
|
|
57
57
|
/**
|
|
58
58
|
* Включает ховер-эффект
|
|
59
59
|
*/
|
|
@@ -65,7 +65,7 @@ type PrivatePatternLockProps = {
|
|
|
65
65
|
[key: string]: string;
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
-
type PatternLockProps = CommonPatternLockProps & {
|
|
68
|
+
export declare type PatternLockProps = CommonPatternLockProps & {
|
|
69
69
|
/**
|
|
70
70
|
* Контрольная точка, с нее начинается desktop версия
|
|
71
71
|
* @default 1024
|
|
@@ -81,7 +81,7 @@ type PatternLockProps = CommonPatternLockProps & {
|
|
|
81
81
|
*/
|
|
82
82
|
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
83
83
|
};
|
|
84
|
-
type ObservableTokens = {
|
|
84
|
+
export declare type ObservableTokens = {
|
|
85
85
|
ACCENT_INITIAL: string;
|
|
86
86
|
ACCENT_SUCCESS: string;
|
|
87
87
|
ACCENT_FAILURE: string;
|
|
@@ -93,4 +93,4 @@ type ObservableTokens = {
|
|
|
93
93
|
HOVER_INNER: string;
|
|
94
94
|
HOVER_OUTER: string;
|
|
95
95
|
};
|
|
96
|
-
export {
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Theme, ThemeParams } from '@alfalab/react-canvas-pattern-lock';
|
|
2
|
+
export declare function getDefaultObserveTarget(): HTMLHeadElement;
|
|
3
|
+
export declare function getColorByToken(token: string): string;
|
|
4
|
+
export declare const getSizes: () => {
|
|
5
|
+
elementSizes: ThemeParams['dimens'];
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function getTheme(dimens: ThemeParams['dimens']): Theme;
|
|
10
|
+
export declare function getPatternLockTestIds(dataTestId: string): {
|
|
11
|
+
patternLock: string;
|
|
12
|
+
forgotCodeBtn: string;
|
|
13
|
+
};
|
package/modern/typings.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typings.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/modern/utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDataTestId } from '@alfalab/core-components-shared/modern';
|
|
2
|
-
import {
|
|
2
|
+
import { THEME_STATE, OBSERVABLE_TOKENS } from './consts.js';
|
|
3
3
|
|
|
4
4
|
function getDefaultObserveTarget() {
|
|
5
5
|
return document.head;
|
|
@@ -71,3 +71,4 @@ function getPatternLockTestIds(dataTestId) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
export { getColorByToken, getDefaultObserveTarget, getPatternLockTestIds, getSizes, getTheme };
|
|
74
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import { getDataTestId } from '@alfalab/core-components-shared';\nimport { Theme, ThemeParams } from '@alfalab/react-canvas-pattern-lock';\n\nimport { OBSERVABLE_TOKENS, THEME_STATE } from './consts';\n\nexport function getDefaultObserveTarget() {\n return document.head;\n}\n\nexport function getColorByToken(token: string) {\n return getComputedStyle(document.documentElement).getPropertyValue(token);\n}\n\nexport const getSizes = (() => {\n const COMMON_SIZES = {\n lineWidth: 6,\n nodeRing: 0,\n nodeCore: 12,\n };\n\n let cachedSize: { elementSizes: ThemeParams['dimens']; width: number; height: number };\n\n return () => {\n if (cachedSize) {\n return cachedSize;\n }\n\n cachedSize = {\n elementSizes: { ...COMMON_SIZES, nodeRadius: 32 },\n width: 240,\n height: 240,\n };\n\n return cachedSize;\n };\n})();\n\nexport function getTheme(dimens: ThemeParams['dimens']): Theme {\n const baseColors = {\n primary: getColorByToken(OBSERVABLE_TOKENS.PRIMARY),\n bg: 'transparent',\n ringBg: getColorByToken(OBSERVABLE_TOKENS.RING_BG_INITIAL),\n hover: {\n inner: getColorByToken(OBSERVABLE_TOKENS.HOVER_INNER),\n outer: getColorByToken(OBSERVABLE_TOKENS.HOVER_OUTER),\n },\n };\n\n return {\n [THEME_STATE.INITIAL]: {\n colors: {\n ...baseColors,\n accent: getColorByToken(OBSERVABLE_TOKENS.ACCENT_INITIAL),\n selectedRingBg: getColorByToken(OBSERVABLE_TOKENS.SELECTED_RING_BG_INITIAL),\n },\n dimens,\n },\n [THEME_STATE.SUCCESS]: {\n colors: {\n ...baseColors,\n accent: getColorByToken(OBSERVABLE_TOKENS.ACCENT_SUCCESS),\n selectedRingBg: getColorByToken(OBSERVABLE_TOKENS.SELECTED_RING_BG_SUCCESS),\n },\n dimens,\n },\n [THEME_STATE.FAILURE]: {\n colors: {\n ...baseColors,\n accent: getColorByToken(OBSERVABLE_TOKENS.ACCENT_FAILURE),\n selectedRingBg: getColorByToken(OBSERVABLE_TOKENS.SELECTED_RING_BG_FAILURE),\n },\n dimens,\n },\n };\n}\n\nexport function getPatternLockTestIds(dataTestId: string) {\n return {\n patternLock: dataTestId,\n forgotCodeBtn: getDataTestId(dataTestId, 'forgot-code-btn'),\n };\n}\n"],"names":[],"mappings":";;;SAKgB,uBAAuB,GAAA;IACnC,OAAO,QAAQ,CAAC,IAAI;AACxB;AAEM,SAAU,eAAe,CAAC,KAAa,EAAA;IACzC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC;AAC7E;AAEa,MAAA,QAAQ,GAAG,CAAC,MAAK;AAC1B,IAAA,MAAM,YAAY,GAAG;AACjB,QAAA,SAAS,EAAE,CAAC;AACZ,QAAA,QAAQ,EAAE,CAAC;AACX,QAAA,QAAQ,EAAE,EAAE;KACf;AAED,IAAA,IAAI,UAAkF;AAEtF,IAAA,OAAO,MAAK;AACR,QAAA,IAAI,UAAU,EAAE;AACZ,YAAA,OAAO,UAAU;AACpB;AAED,QAAA,UAAU,GAAG;YACT,YAAY,EAAE,EAAE,GAAG,YAAY,EAAE,UAAU,EAAE,EAAE,EAAE;AACjD,YAAA,KAAK,EAAE,GAAG;AACV,YAAA,MAAM,EAAE,GAAG;SACd;AAED,QAAA,OAAO,UAAU;AACrB,KAAC;AACL,CAAC;AAEK,SAAU,QAAQ,CAAC,MAA6B,EAAA;AA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AAE,aAAa,CAAC,UAAU,EAAE,iBAAiB,CAAC;KAC9D;AACL;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.responsive.js","sources":["../../src/Component.responsive.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { useIsDesktop } from '@alfalab/core-components-mq';\nimport type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';\n\nimport { PatternLockDesktop } from './desktop';\nimport { PatternLockMobile } from './mobile';\nimport { PatternLockProps } from './typings';\n\nexport const PatternLock = forwardRef<TPatternLockInstance, PatternLockProps>(\n (\n {\n breakpoint,\n client,\n defaultMatchMediaValue = client === undefined ? undefined : client === 'desktop',\n ...restProps\n },\n ref,\n ) => {\n const isDesktop = useIsDesktop(breakpoint, defaultMatchMediaValue);\n\n const Component = isDesktop ? PatternLockDesktop : PatternLockMobile;\n\n return <Component ref={ref} {...restProps} />;\n },\n);\n\nPatternLock.displayName = 'PatternLock';\n"],"names":[],"mappings":";;;;;AASO,MAAM,WAAW,GAAG,UAAU,CACjC,CACI,EACI,UAAU,EACV,MAAM,EACN,sBAAsB,GAAG,MAAM,KAAK,SAAS,GAAG,SAAS,GAAG,MAAM,KAAK,SAAS,EAChF,GAAG,SAAS,EACf,EACD,GAAG,KACH;IACA,MAAM,SAAS,GAAG,YAAY,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAElE,MAAM,SAAS,GAAG,SAAS,GAAG,kBAAkB,GAAG,iBAAiB;IAEpE,OAAO,KAAA,CAAA,aAAA,CAAC,SAAS,EAAC,EAAA,GAAG,EAAE,GAAG,EAAA,GAAM,SAAS,EAAA,CAAI;AACjD,CAAC;AAGL,WAAW,CAAC,WAAW,GAAG,aAAa;;;;"}
|
|
@@ -3,8 +3,8 @@ import cn from 'classnames';
|
|
|
3
3
|
import { ButtonMobile } from '@alfalab/core-components-button/moderncssm/mobile';
|
|
4
4
|
import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
5
5
|
import { ReactCanvasPatternLock } from '@alfalab/react-canvas-pattern-lock';
|
|
6
|
-
import { THEME_STATE, DEFAULT_EXTRA_BOUNDS,
|
|
7
|
-
import {
|
|
6
|
+
import { OBSERVE_OPTIONS, THEME_STATE, DEFAULT_EXTRA_BOUNDS, OBSERVABLE_TOKENS } from '../../consts.js';
|
|
7
|
+
import { getSizes, getTheme, getDefaultObserveTarget, getColorByToken } from '../../utils.js';
|
|
8
8
|
import commonStyles from './index.module.css';
|
|
9
9
|
|
|
10
10
|
const BasePatternLock = forwardRef(({ observeTokens = false, observerParams = {}, className, dataTestId, forgotCodeBtnText = 'Забыли код?', showForgotCodeBtn = false, onForgotBtnClick, extraBounds = DEFAULT_EXTRA_BOUNDS, messageClassName, hover, styles = {}, disabled = false, ...restProps }, ref) => {
|
|
@@ -51,3 +51,4 @@ BasePatternLock.displayName = 'BasePatternLock';
|
|
|
51
51
|
ReactCanvasPatternLock.displayName = 'ReactCanvasPatternLock';
|
|
52
52
|
|
|
53
53
|
export { BasePatternLock };
|
|
54
|
+
//# sourceMappingURL=Component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../../src/components/base-pattern-lock/Component.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useState } from 'react';\nimport cn from 'classnames';\n\nimport { ButtonMobile } from '@alfalab/core-components-button/mobile';\nimport { getDataTestId } from '@alfalab/core-components-shared';\nimport type { Theme, TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';\nimport { ReactCanvasPatternLock } from '@alfalab/react-canvas-pattern-lock';\n\nimport {\n DEFAULT_EXTRA_BOUNDS,\n OBSERVABLE_TOKENS,\n OBSERVE_OPTIONS,\n THEME_STATE,\n} from '../../consts';\nimport type { CommonPatternLockProps, PrivatePatternLockProps } from '../../typings';\nimport { getColorByToken, getDefaultObserveTarget, getSizes, getTheme } from '../../utils';\n\nimport commonStyles from './index.module.css';\n\nexport const BasePatternLock = forwardRef<\n TPatternLockInstance,\n CommonPatternLockProps & PrivatePatternLockProps\n>(\n (\n {\n observeTokens = false,\n observerParams = {},\n className,\n dataTestId,\n forgotCodeBtnText = 'Забыли код?',\n showForgotCodeBtn = false,\n onForgotBtnClick,\n extraBounds = DEFAULT_EXTRA_BOUNDS,\n messageClassName,\n hover,\n styles = {},\n disabled = false,\n ...restProps\n },\n ref,\n ) => {\n const [params, setParams] = useState<\n { theme: Theme; width: number; height: number } | undefined\n >();\n\n useEffect(() => {\n const { elementSizes, width, height } = getSizes();\n\n setParams({\n theme: getTheme(elementSizes),\n width,\n height,\n });\n }, []);\n\n useEffect(() => {\n let styleObserver: MutationObserver | null = null;\n\n if (observeTokens) {\n const { options = OBSERVE_OPTIONS, getTarget = getDefaultObserveTarget } =\n observerParams;\n\n styleObserver = new MutationObserver(() =>\n setParams((prevState) => {\n const { width, height, elementSizes } = getSizes();\n\n if (!prevState) {\n return { theme: getTheme(elementSizes), width, height };\n }\n\n const prevBgColor = prevState.theme[THEME_STATE.INITIAL].colors.primary;\n const themeChanged =\n prevBgColor !== getColorByToken(OBSERVABLE_TOKENS.PRIMARY);\n\n if (themeChanged) return { ...prevState, theme: getTheme(elementSizes) };\n\n return prevState;\n }),\n );\n\n styleObserver.observe(getTarget(), options);\n }\n\n return () => styleObserver?.disconnect();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [observeTokens]);\n\n return (\n <div\n className={cn(commonStyles.component, styles.component, className, {\n [commonStyles.hidden]: !params,\n [commonStyles.withForgotBtn]: showForgotCodeBtn,\n [commonStyles.disabled]: disabled,\n })}\n data-test-id={dataTestId}\n >\n <div className={commonStyles.canvasContainer}>\n <div className={commonStyles.canvasInner}>\n <ReactCanvasPatternLock\n {...restProps}\n {...params}\n ref={ref}\n rows={3}\n cols={3}\n justifyNodes='space-between'\n extraBounds={extraBounds}\n hover={hover}\n />\n </div>\n </div>\n {showForgotCodeBtn && (\n <ButtonMobile\n view='transparent'\n className={cn(commonStyles.forgotBtn, styles.forgotBtn)}\n onClick={onForgotBtnClick}\n dataTestId={getDataTestId(dataTestId, 'forgot-code-btn')}\n >\n {forgotCodeBtnText}\n </ButtonMobile>\n )}\n </div>\n );\n },\n);\n\nBasePatternLock.displayName = 'BasePatternLock';\nReactCanvasPatternLock.displayName = 'ReactCanvasPatternLock';\n"],"names":[],"mappings":";;;;;;;;;AAmBa,MAAA,eAAe,GAAG,UAAU,CAIrC,CACI,EACI,aAAa,GAAG,KAAK,EACrB,cAAc,GAAG,EAAE,EACnB,SAAS,EACT,UAAU,EACV,iBAAiB,GAAG,aAAa,EACjC,iBAAiB,GAAG,KAAK,EACzB,gBAAgB,EAChB,WAAW,GAAG,oBAAoB,EAClC,gBAAgB,EAChB,KAAK,EACL,MAAM,GAAG,EAAE,EACX,QAAQ,GAAG,KAAK,EAChB,GAAG,SAAS,EACf,EACD,GAAG,KACH;IACA,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,EAEjC;IAEH,SAAS,CAAC,MAAK;QACX,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE;AAElD,QAAA,SAAS,CAAC;AACN,YAAA,KAAK,EAAE,QAAQ,CAAC,YAAY,CAAC;YAC7B,KAAK;YACL,MAAM;AACT,SAAA,CAAC;KACL,EAAE,EAAE,CAAC;IAEN,SAAS,CAAC,MAAK;QACX,IAAI,aAAa,GAA4B,IAAI;AAEjD,QAAA,IAAI,aAAa,EAAE;YACf,MAAM,EAAE,OAAO,GAAG,eAAe,EAAE,SAAS,GAAG,uBAAuB,EAAE,GACpE,cAAc;AAElB,YAAA,aAAa,GAAG,IAAI,gBAAgB,CAAC,MACjC,SAAS,CAAC,CAAC,SAAS,KAAI;gBACpB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,QAAQ,EAAE;gBAElD,IAAI,CAAC,SAAS,EAAE;AACZ,oBAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,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5B,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EAAA,CACd,CACA,CACJ;AACL,QAAA,iBAAiB,KACd,KAAA,CAAA,aAAA,CAAC,YAAY,EACT,EAAA,IAAI,EAAC,aAAa,EAClB,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,EACvD,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE,aAAa,CAAC,UAAU,EAAE,iBAAiB,CAAC,EAEvD,EAAA,iBAAiB,CACP,CAClB,CACC;AAEd,CAAC;AAGL,eAAe,CAAC,WAAW,GAAG,iBAAiB;AAC/C,sBAAsB,CAAC,WAAW,GAAG,wBAAwB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/moderncssm/consts.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sources":["../../src/consts.ts"],"sourcesContent":["import type { ReactPatternLockProps } from '@alfalab/react-canvas-pattern-lock';\n\nimport type { ObservableTokens } from './typings';\n\nexport const OBSERVE_OPTIONS: MutationObserverInit = {\n childList: true,\n attributes: false,\n characterData: false,\n subtree: true,\n};\n\nexport const DEFAULT_EXTRA_BOUNDS: ReactPatternLockProps['extraBounds'] = [75, 50, 75, 50];\n\nexport const OBSERVABLE_TOKENS: ObservableTokens = {\n ACCENT_INITIAL: '--color-light-neutral-0-inverted',\n ACCENT_SUCCESS: '--color-light-status-positive',\n ACCENT_FAILURE: '--color-light-status-negative',\n PRIMARY: '--color-light-neutral-500',\n RING_BG_INITIAL: '--color-light-neutral-translucent-200',\n SELECTED_RING_BG_INITIAL: '--color-light-neutral-translucent-200-hover',\n SELECTED_RING_BG_SUCCESS: '--color-light-status-muted-positive',\n SELECTED_RING_BG_FAILURE: '--color-light-status-muted-negative',\n HOVER_INNER: '--color-light-neutral-500-hover',\n HOVER_OUTER: '--color-light-neutral-translucent-200-hover',\n};\n\nexport const THEME_STATE = {\n INITIAL: 'initial',\n SUCCESS: 'success',\n FAILURE: 'failure',\n};\n"],"names":[],"mappings":"AAIa,MAAA,eAAe,GAAyB;AACjD,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,OAAO,EAAE,IAAI;;AAGV,MAAM,oBAAoB,GAAyC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;AAE5E,MAAA,iBAAiB,GAAqB;AAC/C,IAAA,cAAc,EAAE,kCAAkC;AAClD,IAAA,cAAc,EAAE,+BAA+B;AAC/C,IAAA,cAAc,EAAE,+BAA+B;AAC/C,IAAA,OAAO,EAAE,2BAA2B;AACpC,IAAA,eAAe,EAAE,uCAAuC;AACxD,IAAA,wBAAwB,EAAE,6CAA6C;AACvE,IAAA,wBAAwB,EAAE,qCAAqC;AAC/D,IAAA,wBAAwB,EAAE,qCAAqC;AAC/D,IAAA,WAAW,EAAE,iCAAiC;AAC9C,IAAA,WAAW,EAAE,6CAA6C;;AAGjD,MAAA,WAAW,GAAG;AACvB,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,OAAO,EAAE,SAAS;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.desktop.js","sources":["../../../src/desktop/Component.desktop.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';\n\nimport { BasePatternLock } from '../components/base-pattern-lock';\nimport { CommonPatternLockProps } from '../typings';\n\nimport styles from './desktop.module.css';\n\nexport const PatternLockDesktop = forwardRef<TPatternLockInstance, CommonPatternLockProps>(\n (restProps, ref) => <BasePatternLock {...restProps} hover={true} ref={ref} styles={styles} />,\n);\n\nPatternLockDesktop.displayName = 'PatternLockDesktop';\n"],"names":[],"mappings":";;;;AASO,MAAM,kBAAkB,GAAG,UAAU,CACxC,CAAC,SAAS,EAAE,GAAG,KAAK,KAAC,CAAA,aAAA,CAAA,eAAe,EAAK,EAAA,GAAA,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAA,CAAI;AAGjG,kBAAkB,CAAC,WAAW,GAAG,oBAAoB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-pattern-lock-cleanup.js","sources":["../../../src/hooks/use-pattern-lock-cleanup.tsx"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';\n\nexport const usePatternLockCleanup = (\n patternLockRef: React.MutableRefObject<TPatternLockInstance | null>,\n) => {\n const clear = useMemo(() => {\n if (patternLockRef.current) {\n patternLockRef.current.setInitialState();\n }\n }, [patternLockRef]);\n\n return {\n clear,\n };\n};\n"],"names":[],"mappings":";;AAIa,MAAA,qBAAqB,GAAG,CACjC,cAAmE,KACnE;AACA,IAAA,MAAM,KAAK,GAAG,OAAO,CAAC,MAAK;QACvB,IAAI,cAAc,CAAC,OAAO,EAAE;AACxB,YAAA,cAAc,CAAC,OAAO,CAAC,eAAe,EAAE;AAC3C;AACL,KAAC,EAAE,CAAC,cAAc,CAAC,CAAC;IAEpB,OAAO;QACH,KAAK;KACR;AACL;;;;"}
|
package/moderncssm/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.mobile.js","sources":["../../../src/mobile/Component.mobile.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';\n\nimport { BasePatternLock } from '../components/base-pattern-lock';\nimport { CommonPatternLockProps } from '../typings';\n\nimport styles from './mobile.module.css';\n\nexport const PatternLockMobile = forwardRef<TPatternLockInstance, CommonPatternLockProps>(\n (restProps, ref) => <BasePatternLock {...restProps} ref={ref} styles={styles} />,\n);\n\nPatternLockMobile.displayName = 'PatternLockMobile';\n"],"names":[],"mappings":";;;;AASa,MAAA,iBAAiB,GAAG,UAAU,CACvC,CAAC,SAAS,EAAE,GAAG,KAAK,KAAC,CAAA,aAAA,CAAA,eAAe,EAAK,EAAA,GAAA,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAI,CAAA;AAGpF,iBAAiB,CAAC,WAAW,GAAG,mBAAmB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
3
|
+
import { PatternLockProps } from './typings';
|
|
4
|
+
export declare const PatternLock: React.ForwardRefExoticComponent<PatternLockProps & React.RefAttributes<TPatternLockInstance>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
3
|
+
import type { CommonPatternLockProps, PrivatePatternLockProps } from '../../typings';
|
|
4
|
+
export declare const BasePatternLock: React.ForwardRefExoticComponent<(CommonPatternLockProps & PrivatePatternLockProps) & React.RefAttributes<TPatternLockInstance>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Component';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactPatternLockProps } from '@alfalab/react-canvas-pattern-lock';
|
|
2
|
+
import type { ObservableTokens } from './typings';
|
|
3
|
+
export declare const OBSERVE_OPTIONS: MutationObserverInit;
|
|
4
|
+
export declare const DEFAULT_EXTRA_BOUNDS: ReactPatternLockProps['extraBounds'];
|
|
5
|
+
export declare const OBSERVABLE_TOKENS: ObservableTokens;
|
|
6
|
+
export declare const THEME_STATE: {
|
|
7
|
+
INITIAL: string;
|
|
8
|
+
SUCCESS: string;
|
|
9
|
+
FAILURE: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
3
|
+
import { CommonPatternLockProps } from '../typings';
|
|
4
|
+
export declare const PatternLockDesktop: React.ForwardRefExoticComponent<CommonPatternLockProps & React.RefAttributes<TPatternLockInstance>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
3
|
+
import { CommonPatternLockProps } from '../typings';
|
|
4
|
+
export declare const PatternLockMobile: React.ForwardRefExoticComponent<CommonPatternLockProps & React.RefAttributes<TPatternLockInstance>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MouseEvent } from 'react';
|
|
2
2
|
import { ReactPatternLockProps } from '@alfalab/react-canvas-pattern-lock';
|
|
3
|
-
type ConditionalProps = {
|
|
3
|
+
declare type ConditionalProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Показать кнопку "забыли код"
|
|
6
6
|
* @default "Забыли код?"
|
|
@@ -20,7 +20,7 @@ type ConditionalProps = {
|
|
|
20
20
|
onForgotBtnClick?: never;
|
|
21
21
|
forgotCodeBtnText?: never;
|
|
22
22
|
};
|
|
23
|
-
type CommonPatternLockProps = {
|
|
23
|
+
export declare type CommonPatternLockProps = {
|
|
24
24
|
/**
|
|
25
25
|
* Дополнительный класс
|
|
26
26
|
*/
|
|
@@ -53,7 +53,7 @@ type CommonPatternLockProps = {
|
|
|
53
53
|
*/
|
|
54
54
|
disabled?: boolean;
|
|
55
55
|
} & Omit<ReactPatternLockProps, 'theme' | 'width' | 'height' | 'rows' | 'cols' | 'hover' | 'justifyNodes'> & ConditionalProps;
|
|
56
|
-
type PrivatePatternLockProps = {
|
|
56
|
+
export declare type PrivatePatternLockProps = {
|
|
57
57
|
/**
|
|
58
58
|
* Включает ховер-эффект
|
|
59
59
|
*/
|
|
@@ -65,7 +65,7 @@ type PrivatePatternLockProps = {
|
|
|
65
65
|
[key: string]: string;
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
-
type PatternLockProps = CommonPatternLockProps & {
|
|
68
|
+
export declare type PatternLockProps = CommonPatternLockProps & {
|
|
69
69
|
/**
|
|
70
70
|
* Контрольная точка, с нее начинается desktop версия
|
|
71
71
|
* @default 1024
|
|
@@ -81,7 +81,7 @@ type PatternLockProps = CommonPatternLockProps & {
|
|
|
81
81
|
*/
|
|
82
82
|
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
83
83
|
};
|
|
84
|
-
type ObservableTokens = {
|
|
84
|
+
export declare type ObservableTokens = {
|
|
85
85
|
ACCENT_INITIAL: string;
|
|
86
86
|
ACCENT_SUCCESS: string;
|
|
87
87
|
ACCENT_FAILURE: string;
|
|
@@ -93,4 +93,4 @@ type ObservableTokens = {
|
|
|
93
93
|
HOVER_INNER: string;
|
|
94
94
|
HOVER_OUTER: string;
|
|
95
95
|
};
|
|
96
|
-
export {
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Theme, ThemeParams } from '@alfalab/react-canvas-pattern-lock';
|
|
2
|
+
export declare function getDefaultObserveTarget(): HTMLHeadElement;
|
|
3
|
+
export declare function getColorByToken(token: string): string;
|
|
4
|
+
export declare const getSizes: () => {
|
|
5
|
+
elementSizes: ThemeParams['dimens'];
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function getTheme(dimens: ThemeParams['dimens']): Theme;
|
|
10
|
+
export declare function getPatternLockTestIds(dataTestId: string): {
|
|
11
|
+
patternLock: string;
|
|
12
|
+
forgotCodeBtn: string;
|
|
13
|
+
};
|
package/moderncssm/typings.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typings.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/moderncssm/utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
2
|
-
import {
|
|
2
|
+
import { THEME_STATE, OBSERVABLE_TOKENS } from './consts.js';
|
|
3
3
|
|
|
4
4
|
function getDefaultObserveTarget() {
|
|
5
5
|
return document.head;
|
|
@@ -71,3 +71,4 @@ function getPatternLockTestIds(dataTestId) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
export { getColorByToken, getDefaultObserveTarget, getPatternLockTestIds, getSizes, getTheme };
|
|
74
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import { getDataTestId } from '@alfalab/core-components-shared';\nimport { Theme, ThemeParams } from '@alfalab/react-canvas-pattern-lock';\n\nimport { OBSERVABLE_TOKENS, THEME_STATE } from './consts';\n\nexport function getDefaultObserveTarget() {\n return document.head;\n}\n\nexport function getColorByToken(token: string) {\n return getComputedStyle(document.documentElement).getPropertyValue(token);\n}\n\nexport const getSizes = (() => {\n const COMMON_SIZES = {\n lineWidth: 6,\n nodeRing: 0,\n nodeCore: 12,\n };\n\n let cachedSize: { elementSizes: ThemeParams['dimens']; width: number; height: number };\n\n return () => {\n if (cachedSize) {\n return cachedSize;\n }\n\n cachedSize = {\n elementSizes: { ...COMMON_SIZES, nodeRadius: 32 },\n width: 240,\n height: 240,\n };\n\n return cachedSize;\n };\n})();\n\nexport function getTheme(dimens: ThemeParams['dimens']): Theme {\n const baseColors = {\n primary: getColorByToken(OBSERVABLE_TOKENS.PRIMARY),\n bg: 'transparent',\n ringBg: getColorByToken(OBSERVABLE_TOKENS.RING_BG_INITIAL),\n hover: {\n inner: getColorByToken(OBSERVABLE_TOKENS.HOVER_INNER),\n outer: getColorByToken(OBSERVABLE_TOKENS.HOVER_OUTER),\n },\n };\n\n return {\n [THEME_STATE.INITIAL]: {\n colors: {\n ...baseColors,\n accent: getColorByToken(OBSERVABLE_TOKENS.ACCENT_INITIAL),\n selectedRingBg: getColorByToken(OBSERVABLE_TOKENS.SELECTED_RING_BG_INITIAL),\n },\n dimens,\n },\n [THEME_STATE.SUCCESS]: {\n colors: {\n ...baseColors,\n accent: getColorByToken(OBSERVABLE_TOKENS.ACCENT_SUCCESS),\n selectedRingBg: getColorByToken(OBSERVABLE_TOKENS.SELECTED_RING_BG_SUCCESS),\n },\n dimens,\n },\n [THEME_STATE.FAILURE]: {\n colors: {\n ...baseColors,\n accent: getColorByToken(OBSERVABLE_TOKENS.ACCENT_FAILURE),\n selectedRingBg: getColorByToken(OBSERVABLE_TOKENS.SELECTED_RING_BG_FAILURE),\n },\n dimens,\n },\n };\n}\n\nexport function getPatternLockTestIds(dataTestId: string) {\n return {\n patternLock: dataTestId,\n forgotCodeBtn: getDataTestId(dataTestId, 'forgot-code-btn'),\n };\n}\n"],"names":[],"mappings":";;;SAKgB,uBAAuB,GAAA;IACnC,OAAO,QAAQ,CAAC,IAAI;AACxB;AAEM,SAAU,eAAe,CAAC,KAAa,EAAA;IACzC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC;AAC7E;AAEa,MAAA,QAAQ,GAAG,CAAC,MAAK;AAC1B,IAAA,MAAM,YAAY,GAAG;AACjB,QAAA,SAAS,EAAE,CAAC;AACZ,QAAA,QAAQ,EAAE,CAAC;AACX,QAAA,QAAQ,EAAE,EAA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CAAC,WAAW,CAAC,OAAO,GAAG;AACnB,YAAA,MAAM,EAAE;AACJ,gBAAA,GAAG,UAAU;AACb,gBAAA,MAAM,EAAE,eAAe,CAAC,iBAAiB,CAAC,cAAc,CAAC;AACzD,gBAAA,cAAc,EAAE,eAAe,CAAC,iBAAiB,CAAC,wBAAwB,CAAC;AAC9E,aAAA;YACD,MAAM;AACT,SAAA;KACJ;AACL;AAEM,SAAU,qBAAqB,CAAC,UAAkB,EAAA;IACpD,OAAO;AACH,QAAA,WAAW,EAAE,UAAU;AACvB,QAAA,aAAa,EAAE,aAAa,CAAC,UAAU,EAAE,iBAAiB,CAAC;KAC9D;AACL;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-pattern-lock",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.12-snapshot-1393ffa",
|
|
4
4
|
"description": "Pattern lock",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@alfalab/core-components-button": "
|
|
20
|
-
"@alfalab/core-components-shared": "
|
|
21
|
-
"@alfalab/core-components-mq": "
|
|
19
|
+
"@alfalab/core-components-button": "11.11.8-snapshot-1393ffa",
|
|
20
|
+
"@alfalab/core-components-shared": "0.16.1-snapshot-1393ffa",
|
|
21
|
+
"@alfalab/core-components-mq": "5.0.0-snapshot-1393ffa",
|
|
22
22
|
"@alfalab/react-canvas-pattern-lock": "^2.0.7",
|
|
23
23
|
"classnames": "^2.5.1",
|
|
24
24
|
"tslib": "^2.4.0"
|
|
25
25
|
},
|
|
26
|
-
"themesVersion": "
|
|
27
|
-
"varsVersion": "9.
|
|
26
|
+
"themesVersion": "14.0.0-snapshot-1393ffa",
|
|
27
|
+
"varsVersion": "9.20.1-snapshot-1393ffa"
|
|
28
28
|
}
|
package/shared/index.js
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var utils = require('../utils.js');
|
|
6
|
-
var
|
|
6
|
+
var usePatternLockCleanup = require('../hooks/use-pattern-lock-cleanup.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
exports.getPatternLockTestIds = utils.getPatternLockTestIds;
|
|
11
|
-
exports.usePatternLockCleanup =
|
|
11
|
+
exports.usePatternLockCleanup = usePatternLockCleanup.usePatternLockCleanup;
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
3
|
+
import { PatternLockProps } from './typings';
|
|
4
|
+
export declare const PatternLock: React.ForwardRefExoticComponent<PatternLockProps & React.RefAttributes<TPatternLockInstance>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
3
|
+
import type { CommonPatternLockProps, PrivatePatternLockProps } from '../../typings';
|
|
4
|
+
export declare const BasePatternLock: React.ForwardRefExoticComponent<(CommonPatternLockProps & PrivatePatternLockProps) & React.RefAttributes<TPatternLockInstance>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Component';
|
package/src/consts.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactPatternLockProps } from '@alfalab/react-canvas-pattern-lock';
|
|
2
|
+
import type { ObservableTokens } from './typings';
|
|
3
|
+
export declare const OBSERVE_OPTIONS: MutationObserverInit;
|
|
4
|
+
export declare const DEFAULT_EXTRA_BOUNDS: ReactPatternLockProps['extraBounds'];
|
|
5
|
+
export declare const OBSERVABLE_TOKENS: ObservableTokens;
|
|
6
|
+
export declare const THEME_STATE: {
|
|
7
|
+
INITIAL: string;
|
|
8
|
+
SUCCESS: string;
|
|
9
|
+
FAILURE: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
3
|
+
import { CommonPatternLockProps } from '../typings';
|
|
4
|
+
export declare const PatternLockDesktop: React.ForwardRefExoticComponent<CommonPatternLockProps & React.RefAttributes<TPatternLockInstance>>;
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
3
|
+
import { CommonPatternLockProps } from '../typings';
|
|
4
|
+
export declare const PatternLockMobile: React.ForwardRefExoticComponent<CommonPatternLockProps & React.RefAttributes<TPatternLockInstance>>;
|