@alfalab/core-components-pattern-lock 2.5.13 → 3.0.0-snapshot-133b390
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.d.ts +3 -5
- package/Component.responsive.js +4 -3
- package/Component.responsive.js.map +1 -0
- package/components/base-pattern-lock/Component.d.ts +3 -5
- 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.d.ts +1 -1
- 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.d.ts +6 -7
- package/consts.js +1 -0
- package/consts.js.map +1 -0
- package/cssm/Component.responsive.d.ts +3 -5
- package/cssm/Component.responsive.js +6 -5
- package/cssm/Component.responsive.js.map +1 -0
- package/cssm/components/base-pattern-lock/Component.d.ts +3 -5
- 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.d.ts +1 -1
- 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.d.ts +6 -7
- package/cssm/consts.js +1 -0
- package/cssm/consts.js.map +1 -0
- package/cssm/desktop/Component.desktop.d.ts +3 -5
- 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.d.ts +2 -2
- package/cssm/desktop/index.js +3 -2
- package/cssm/desktop/index.js.map +1 -0
- package/cssm/hooks/use-pattern-lock-cleanup.d.ts +2 -4
- package/cssm/hooks/use-pattern-lock-cleanup.js +1 -0
- package/cssm/hooks/use-pattern-lock-cleanup.js.map +1 -0
- package/cssm/index.d.ts +3 -3
- package/cssm/index.js +1 -0
- package/cssm/index.js.map +1 -0
- package/cssm/mobile/Component.mobile.d.ts +3 -5
- package/cssm/mobile/Component.mobile.js +3 -2
- package/cssm/mobile/Component.mobile.js.map +1 -0
- package/cssm/mobile/index.d.ts +2 -2
- 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.d.ts +2 -2
- package/cssm/shared/index.js +3 -2
- package/cssm/shared/index.js.map +1 -0
- package/cssm/typings.d.ts +6 -6
- package/cssm/typings.js +1 -0
- package/cssm/typings.js.map +1 -0
- package/cssm/utils.d.ts +5 -6
- package/cssm/utils.js +3 -2
- package/cssm/utils.js.map +1 -0
- package/desktop/Component.desktop.d.ts +3 -5
- 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.d.ts +2 -2
- package/desktop/index.js +3 -2
- package/desktop/index.js.map +1 -0
- package/esm/Component.responsive.d.ts +3 -5
- package/esm/Component.responsive.js +1 -0
- package/esm/Component.responsive.js.map +1 -0
- package/esm/components/base-pattern-lock/Component.d.ts +3 -5
- 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.d.ts +1 -1
- 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.d.ts +6 -7
- package/esm/consts.js +1 -0
- package/esm/consts.js.map +1 -0
- package/esm/desktop/Component.desktop.d.ts +3 -5
- 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.d.ts +2 -2
- package/esm/desktop/index.js +1 -0
- package/esm/desktop/index.js.map +1 -0
- package/esm/hooks/use-pattern-lock-cleanup.d.ts +2 -4
- package/esm/hooks/use-pattern-lock-cleanup.js +1 -0
- package/esm/hooks/use-pattern-lock-cleanup.js.map +1 -0
- package/esm/index.d.ts +3 -3
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -0
- package/esm/mobile/Component.mobile.d.ts +3 -5
- package/esm/mobile/Component.mobile.js +2 -3
- package/esm/mobile/Component.mobile.js.map +1 -0
- package/esm/mobile/index.d.ts +2 -2
- 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.d.ts +2 -2
- package/esm/shared/index.js +1 -0
- package/esm/shared/index.js.map +1 -0
- package/esm/typings.d.ts +6 -6
- package/esm/typings.js +1 -0
- package/esm/typings.js.map +1 -0
- package/esm/utils.d.ts +5 -6
- package/esm/utils.js +2 -1
- package/esm/utils.js.map +1 -0
- package/hooks/use-pattern-lock-cleanup.d.ts +2 -4
- package/hooks/use-pattern-lock-cleanup.js +1 -0
- package/hooks/use-pattern-lock-cleanup.js.map +1 -0
- package/index.d.ts +3 -3
- package/index.js +1 -0
- package/index.js.map +1 -0
- package/mobile/Component.mobile.d.ts +3 -5
- package/mobile/Component.mobile.js +4 -5
- package/mobile/Component.mobile.js.map +1 -0
- package/mobile/index.d.ts +2 -2
- 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.d.ts +3 -5
- package/modern/Component.responsive.js +1 -0
- package/modern/Component.responsive.js.map +1 -0
- package/modern/components/base-pattern-lock/Component.d.ts +3 -5
- 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.d.ts +1 -1
- 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.d.ts +6 -7
- package/modern/consts.js +1 -0
- package/modern/consts.js.map +1 -0
- package/modern/desktop/Component.desktop.d.ts +3 -5
- 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.d.ts +2 -2
- package/modern/desktop/index.js +1 -0
- package/modern/desktop/index.js.map +1 -0
- package/modern/hooks/use-pattern-lock-cleanup.d.ts +2 -4
- package/modern/hooks/use-pattern-lock-cleanup.js +1 -0
- package/modern/hooks/use-pattern-lock-cleanup.js.map +1 -0
- package/modern/index.d.ts +3 -3
- package/modern/index.js +1 -0
- package/modern/index.js.map +1 -0
- package/modern/mobile/Component.mobile.d.ts +3 -5
- package/modern/mobile/Component.mobile.js +2 -3
- package/modern/mobile/Component.mobile.js.map +1 -0
- package/modern/mobile/index.d.ts +2 -2
- 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.d.ts +2 -2
- package/modern/shared/index.js +1 -0
- package/modern/shared/index.js.map +1 -0
- package/modern/typings.d.ts +6 -6
- package/modern/typings.js +1 -0
- package/modern/typings.js.map +1 -0
- package/modern/utils.d.ts +5 -6
- package/modern/utils.js +2 -1
- package/modern/utils.js.map +1 -0
- package/moderncssm/Component.responsive.d.ts +3 -5
- package/moderncssm/Component.responsive.js +1 -0
- package/moderncssm/Component.responsive.js.map +1 -0
- package/moderncssm/components/base-pattern-lock/Component.d.ts +3 -5
- 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.d.ts +1 -1
- 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.d.ts +6 -7
- package/moderncssm/consts.js +1 -0
- package/moderncssm/consts.js.map +1 -0
- package/moderncssm/desktop/Component.desktop.d.ts +3 -5
- 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.d.ts +2 -2
- package/moderncssm/desktop/index.js +1 -0
- package/moderncssm/desktop/index.js.map +1 -0
- package/moderncssm/hooks/use-pattern-lock-cleanup.d.ts +2 -4
- package/moderncssm/hooks/use-pattern-lock-cleanup.js +1 -0
- package/moderncssm/hooks/use-pattern-lock-cleanup.js.map +1 -0
- package/moderncssm/index.d.ts +3 -3
- package/moderncssm/index.js +1 -0
- package/moderncssm/index.js.map +1 -0
- package/moderncssm/mobile/Component.mobile.d.ts +3 -5
- package/moderncssm/mobile/Component.mobile.js +1 -0
- package/moderncssm/mobile/Component.mobile.js.map +1 -0
- package/moderncssm/mobile/index.d.ts +2 -2
- 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.d.ts +2 -2
- package/moderncssm/shared/index.js +1 -0
- package/moderncssm/shared/index.js.map +1 -0
- package/moderncssm/typings.d.ts +6 -6
- package/moderncssm/typings.js +1 -0
- package/moderncssm/typings.js.map +1 -0
- package/moderncssm/utils.d.ts +5 -6
- package/moderncssm/utils.js +2 -1
- package/moderncssm/utils.js.map +1 -0
- package/package.json +6 -6
- package/shared/index.d.ts +2 -2
- package/shared/index.js +3 -2
- package/shared/index.js.map +1 -0
- package/typings.d.ts +6 -6
- package/typings.js +1 -0
- package/typings.js.map +1 -0
- package/utils.d.ts +5 -6
- package/utils.js +1 -0
- package/utils.js.map +1 -0
- package/cssm/vars.css +0 -0
- package/desktop/package.json +0 -3
- package/mobile/package.json +0 -3
- package/moderncssm/vars.css +0 -0
- package/shared/package.json +0 -3
- package/src/desktop/package.json +0 -3
- package/src/mobile/package.json +0 -3
- package/src/shared/package.json +0 -3
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
4
|
-
import { PatternLockProps } from
|
|
5
|
-
declare const PatternLock: React.ForwardRefExoticComponent<PatternLockProps & React.RefAttributes<TPatternLockInstance>>;
|
|
6
|
-
export { PatternLock };
|
|
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>>;
|
package/Component.responsive.js
CHANGED
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var coreComponentsMq = require('@alfalab/core-components-mq');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
var Component_desktop = require('./desktop/Component.desktop.js');
|
|
9
|
+
var Component_mobile = require('./mobile/Component.mobile.js');
|
|
10
10
|
|
|
11
11
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
12
12
|
|
|
@@ -15,9 +15,10 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
15
15
|
var PatternLock = React.forwardRef(function (_a, ref) {
|
|
16
16
|
var breakpoint = _a.breakpoint, client = _a.client, _b = _a.defaultMatchMediaValue, defaultMatchMediaValue = _b === void 0 ? client === undefined ? undefined : client === 'desktop' : _b, restProps = tslib.__rest(_a, ["breakpoint", "client", "defaultMatchMediaValue"]);
|
|
17
17
|
var isDesktop = coreComponentsMq.useIsDesktop(breakpoint, defaultMatchMediaValue);
|
|
18
|
-
var Component = isDesktop ?
|
|
18
|
+
var Component = isDesktop ? Component_desktop.PatternLockDesktop : Component_mobile.PatternLockMobile;
|
|
19
19
|
return React__default.default.createElement(Component, tslib.__assign({ ref: ref }, restProps));
|
|
20
20
|
});
|
|
21
21
|
PatternLock.displayName = 'PatternLock';
|
|
22
22
|
|
|
23
23
|
exports.PatternLock = PatternLock;
|
|
24
|
+
//# sourceMappingURL=Component.responsive.js.map
|
|
@@ -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":["forwardRef","__rest","useIsDesktop","PatternLockDesktop","PatternLockMobile","React","__assign"],"mappings":";;;;;;;;;;;;;;IASa,WAAW,GAAGA,gBAAU,CACjC,UACI,EAKC,EACD,GAAG,EAAA;AALC,IAAA,IAAA,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,EAAgF,GAAA,EAAA,CAAA,sBAAA,EAAhF,sBAAsB,GAAA,EAAA,KAAA,MAAA,GAAG,MAAM,KAAK,SAAS,GAAG,SAAS,GAAG,MAAM,KAAK,SAAS,GAAA,EAAA,EAC7E,SAAS,GAJhBC,YAAA,CAAA,EAAA,EAAA,CAAA,YAAA,EAAA,QAAA,EAAA,wBAAA,CAKC,CADe;IAIhB,IAAM,SAAS,GAAGC,6BAAY,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAElE,IAAM,SAAS,GAAG,SAAS,GAAGC,oCAAkB,GAAGC,kCAAiB;IAEpE,OAAOC,sBAAA,CAAA,aAAA,CAAC,SAAS,EAACC,cAAA,CAAA,EAAA,GAAG,EAAE,GAAG,EAAA,EAAM,SAAS,CAAA,CAAI;AACjD,CAAC;AAGL,WAAW,CAAC,WAAW,GAAG,aAAa;;;;"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
4
|
-
import { CommonPatternLockProps, PrivatePatternLockProps } from
|
|
5
|
-
declare const BasePatternLock: React.ForwardRefExoticComponent<(CommonPatternLockProps & PrivatePatternLockProps) & React.RefAttributes<TPatternLockInstance>>;
|
|
6
|
-
export { BasePatternLock };
|
|
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>>;
|
|
@@ -10,15 +10,13 @@ var coreComponentsShared = require('@alfalab/core-components-shared');
|
|
|
10
10
|
var reactCanvasPatternLock = require('@alfalab/react-canvas-pattern-lock');
|
|
11
11
|
var consts = require('../../consts.js');
|
|
12
12
|
var utils = require('../../utils.js');
|
|
13
|
+
var index_module = require('./index.module.css.js');
|
|
13
14
|
|
|
14
15
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
15
16
|
|
|
16
17
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
17
18
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
18
19
|
|
|
19
|
-
var commonStyles = {"component":"pattern-lock__component_1gq1e","canvasContainer":"pattern-lock__canvasContainer_1gq1e","canvasInner":"pattern-lock__canvasInner_1gq1e","disabled":"pattern-lock__disabled_1gq1e","withForgotBtn":"pattern-lock__withForgotBtn_1gq1e","forgotBtn":"pattern-lock__forgotBtn_1gq1e"};
|
|
20
|
-
require('./index.css')
|
|
21
|
-
|
|
22
20
|
var BasePatternLock = React.forwardRef(function (_a, ref) {
|
|
23
21
|
var _b;
|
|
24
22
|
var _c = _a.observeTokens, observeTokens = _c === void 0 ? false : _c, _d = _a.observerParams, observerParams = _d === void 0 ? {} : _d, className = _a.className, dataTestId = _a.dataTestId, _e = _a.forgotCodeBtnText, forgotCodeBtnText = _e === void 0 ? 'Забыли код?' : _e, _f = _a.showForgotCodeBtn, showForgotCodeBtn = _f === void 0 ? false : _f, onForgotBtnClick = _a.onForgotBtnClick, _g = _a.extraBounds, extraBounds = _g === void 0 ? consts.DEFAULT_EXTRA_BOUNDS : _g; _a.messageClassName; var hover = _a.hover, _h = _a.styles, styles = _h === void 0 ? {} : _h, _j = _a.disabled, disabled = _j === void 0 ? false : _j, restProps = tslib.__rest(_a, ["observeTokens", "observerParams", "className", "dataTestId", "forgotCodeBtnText", "showForgotCodeBtn", "onForgotBtnClick", "extraBounds", "messageClassName", "hover", "styles", "disabled"]);
|
|
@@ -53,17 +51,18 @@ var BasePatternLock = React.forwardRef(function (_a, ref) {
|
|
|
53
51
|
return function () { return styleObserver === null || styleObserver === void 0 ? void 0 : styleObserver.disconnect(); };
|
|
54
52
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
53
|
}, [observeTokens]);
|
|
56
|
-
return (React__default.default.createElement("div", { className: cn__default.default(
|
|
57
|
-
_b[
|
|
58
|
-
_b[
|
|
59
|
-
_b[
|
|
54
|
+
return (React__default.default.createElement("div", { className: cn__default.default(index_module.component, styles.component, className, (_b = {},
|
|
55
|
+
_b[index_module.hidden] = !params,
|
|
56
|
+
_b[index_module.withForgotBtn] = showForgotCodeBtn,
|
|
57
|
+
_b[index_module.disabled] = disabled,
|
|
60
58
|
_b)), "data-test-id": dataTestId },
|
|
61
|
-
React__default.default.createElement("div", { className:
|
|
62
|
-
React__default.default.createElement("div", { className:
|
|
59
|
+
React__default.default.createElement("div", { className: index_module.canvasContainer },
|
|
60
|
+
React__default.default.createElement("div", { className: index_module.canvasInner },
|
|
63
61
|
React__default.default.createElement(reactCanvasPatternLock.ReactCanvasPatternLock, tslib.__assign({}, restProps, params, { ref: ref, rows: 3, cols: 3, justifyNodes: 'space-between', extraBounds: extraBounds, hover: hover })))),
|
|
64
|
-
showForgotCodeBtn && (React__default.default.createElement(mobile.ButtonMobile, { view: 'transparent', className: cn__default.default(
|
|
62
|
+
showForgotCodeBtn && (React__default.default.createElement(mobile.ButtonMobile, { view: 'transparent', className: cn__default.default(index_module.forgotBtn, styles.forgotBtn), onClick: onForgotBtnClick, dataTestId: coreComponentsShared.getDataTestId(dataTestId, 'forgot-code-btn') }, forgotCodeBtnText))));
|
|
65
63
|
});
|
|
66
64
|
BasePatternLock.displayName = 'BasePatternLock';
|
|
67
65
|
reactCanvasPatternLock.ReactCanvasPatternLock.displayName = 'ReactCanvasPatternLock';
|
|
68
66
|
|
|
69
67
|
exports.BasePatternLock = BasePatternLock;
|
|
68
|
+
//# 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":["forwardRef","DEFAULT_EXTRA_BOUNDS","__rest","useState","useEffect","getSizes","getTheme","OBSERVE_OPTIONS","getDefaultObserveTarget","THEME_STATE","getColorByToken","OBSERVABLE_TOKENS","__assign","React","cn","commonStyles","ReactCanvasPatternLock","ButtonMobile","getDataTestId"],"mappings":";;;;;;;;;;;;;;;;;;;IAmBa,eAAe,GAAGA,gBAAU,CAIrC,UACI,EAcC,EACD,GAAG,EAAA;;AAdC,IAAA,IAAA,EAAqB,GAAA,EAAA,CAAA,aAAA,CAAA,CAArB,aAAa,GAAA,EAAA,KAAA,MAAA,GAAG,KAAK,GAAA,EAAA,CACrB,CAAA,EAAA,GAAA,EAAA,CAAA,cAAmB,CAAnB,CAAA,cAAc,GAAG,EAAA,KAA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BAAiB,CACP,CAClB,CACC;AAEd,CAAC;AAGL,eAAe,CAAC,WAAW,GAAG,iBAAiB;AAC/CF,6CAAsB,CAAC,WAAW,GAAG,wBAAwB;;;;"}
|
|
@@ -1,57 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
:
|
|
3
|
-
} /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
5
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
6
|
-
} :root {
|
|
7
|
-
|
|
8
|
-
/* Hard */
|
|
9
|
-
|
|
10
|
-
/* Up */
|
|
11
|
-
|
|
12
|
-
/* Hard up */
|
|
13
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
14
|
-
|
|
15
|
-
/* новые значения, используйте их */
|
|
16
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
17
|
-
--gap-m: 16px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
18
|
-
|
|
19
|
-
/* новые значения, используйте их */
|
|
20
|
-
|
|
21
|
-
/* no-unit может приводить к проблемам в calc (#1559) */
|
|
22
|
-
/* stylelint-disable-next-line length-zero-no-unit */
|
|
1
|
+
:root {
|
|
2
|
+
--gap-m: 16px;
|
|
23
3
|
--gap-0: 0px;
|
|
24
4
|
--gap-16: var(--gap-m);
|
|
25
5
|
} :root {
|
|
26
|
-
} /* @deprecated */ /* @deprecated */ /* @deprecated */ /* @deprecated */ /* @deprecated */ :root {
|
|
27
6
|
--size-xs-height: 40px;
|
|
28
|
-
}
|
|
7
|
+
} :root {
|
|
29
8
|
--pattern-lock-min-width: 304px;
|
|
30
9
|
--pattern-lock-min-height: 272px;
|
|
31
10
|
--pattern-lock-with-forgot-btn-min-height: 336px;
|
|
32
|
-
} .pattern-
|
|
11
|
+
} .pattern-lock__component_10lfg {
|
|
33
12
|
display: flex;
|
|
34
13
|
flex-direction: column;
|
|
35
14
|
align-items: center;
|
|
36
15
|
box-sizing: border-box;
|
|
37
16
|
min-height: var(--pattern-lock-min-height)
|
|
38
|
-
} .pattern-
|
|
17
|
+
} .pattern-lock__component_10lfg canvas {
|
|
39
18
|
display: block;
|
|
40
19
|
margin: var(--gap-0) auto;
|
|
41
|
-
} .pattern-
|
|
20
|
+
} .pattern-lock__component_10lfg .pattern-lock__canvasContainer_10lfg {
|
|
42
21
|
box-sizing: border-box;
|
|
43
22
|
padding: var(--gap-16) var(--gap-16);
|
|
44
23
|
min-width: var(--pattern-lock-min-width);
|
|
45
24
|
min-height: var(--pattern-lock-min-height)
|
|
46
|
-
} .pattern-
|
|
25
|
+
} .pattern-lock__component_10lfg .pattern-lock__canvasContainer_10lfg .pattern-lock__canvasInner_10lfg {
|
|
47
26
|
box-sizing: border-box;
|
|
48
27
|
padding: var(--gap-0) var(--gap-16);
|
|
49
28
|
min-width: var(--pattern-lock-min-height);
|
|
50
|
-
} .pattern-
|
|
29
|
+
} .pattern-lock__component_10lfg.pattern-lock__disabled_10lfg {
|
|
51
30
|
pointer-events: none;
|
|
52
|
-
} .pattern-
|
|
31
|
+
} .pattern-lock__withForgotBtn_10lfg {
|
|
53
32
|
min-height: var(--pattern-lock-with-forgot-btn-min-height);
|
|
54
|
-
} .pattern-
|
|
33
|
+
} .pattern-lock__forgotBtn_10lfg {
|
|
55
34
|
display: block;
|
|
56
35
|
min-height: var(--size-xs-height);
|
|
57
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './Component';
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var Component = require('./Component.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.BasePatternLock =
|
|
9
|
+
exports.BasePatternLock = Component.BasePatternLock;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('./index.css');
|
|
4
|
+
|
|
5
|
+
var commonStyles = {"component":"pattern-lock__component_10lfg","canvasContainer":"pattern-lock__canvasContainer_10lfg","canvasInner":"pattern-lock__canvasInner_10lfg","disabled":"pattern-lock__disabled_10lfg","withForgotBtn":"pattern-lock__withForgotBtn_10lfg","forgotBtn":"pattern-lock__forgotBtn_10lfg"};
|
|
6
|
+
|
|
7
|
+
module.exports = commonStyles;
|
|
8
|
+
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/base-pattern-lock/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n@import '../../vars.css';\n\n.component {\n display: flex;\n flex-direction: column;\n align-items: center;\n box-sizing: border-box;\n min-height: var(--pattern-lock-min-height);\n\n & canvas {\n display: block;\n margin: var(--gap-0) auto;\n }\n\n & .canvasContainer {\n box-sizing: border-box;\n padding: var(--gap-16) var(--gap-16);\n min-width: var(--pattern-lock-min-width);\n min-height: var(--pattern-lock-min-height);\n\n & .canvasInner {\n box-sizing: border-box;\n padding: var(--gap-0) var(--gap-16);\n min-width: var(--pattern-lock-min-height);\n }\n }\n\n &.disabled {\n pointer-events: none;\n }\n}\n\n.withForgotBtn {\n min-height: var(--pattern-lock-with-forgot-btn-min-height);\n}\n\n.forgotBtn {\n display: block;\n min-height: var(--size-xs-height);\n}\n"],"names":[],"mappings":";;;;AAEgB,mBAAe,CAAC,WAAW,CAAC,+BAA+B,CAAC,iBAAiB,CAAC,qCAAqC,CAAC,aAAa,CAAC,iCAAiC,CAAC,UAAU,CAAC,8BAA8B,CAAC,eAAe,CAAC,mCAAmC,CAAC,WAAW,CAAC,+BAA+B,CAAC;;;;"}
|
package/consts.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { ReactPatternLockProps } from '@alfalab/react-canvas-pattern-lock';
|
|
2
|
-
import { ObservableTokens } from
|
|
3
|
-
declare const OBSERVE_OPTIONS: MutationObserverInit;
|
|
4
|
-
declare const DEFAULT_EXTRA_BOUNDS: ReactPatternLockProps['extraBounds'];
|
|
5
|
-
declare const OBSERVABLE_TOKENS: ObservableTokens;
|
|
6
|
-
declare const THEME_STATE: {
|
|
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
7
|
INITIAL: string;
|
|
8
8
|
SUCCESS: string;
|
|
9
9
|
FAILURE: string;
|
|
10
10
|
};
|
|
11
|
-
export { OBSERVE_OPTIONS, DEFAULT_EXTRA_BOUNDS, OBSERVABLE_TOKENS, THEME_STATE };
|
package/consts.js
CHANGED
package/consts.js.map
ADDED
|
@@ -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,IAAA,eAAe,GAAyB;AACjD,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,OAAO,EAAE,IAAI;;AAGV,IAAM,oBAAoB,GAAyC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;AAE5E,IAAA,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,IAAA,WAAW,GAAG;AACvB,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,OAAO,EAAE,SAAS;;;;;;;;"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
4
|
-
import { PatternLockProps } from
|
|
5
|
-
declare const PatternLock: React.ForwardRefExoticComponent<PatternLockProps & React.RefAttributes<TPatternLockInstance>>;
|
|
6
|
-
export { PatternLock };
|
|
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>>;
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
7
|
+
var cssm = require('@alfalab/core-components-mq/cssm');
|
|
8
|
+
var Component_desktop = require('./desktop/Component.desktop.js');
|
|
9
|
+
var Component_mobile = require('./mobile/Component.mobile.js');
|
|
10
10
|
|
|
11
11
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
12
12
|
|
|
@@ -14,10 +14,11 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
14
14
|
|
|
15
15
|
var PatternLock = React.forwardRef(function (_a, ref) {
|
|
16
16
|
var breakpoint = _a.breakpoint, client = _a.client, _b = _a.defaultMatchMediaValue, defaultMatchMediaValue = _b === void 0 ? client === undefined ? undefined : client === 'desktop' : _b, restProps = tslib.__rest(_a, ["breakpoint", "client", "defaultMatchMediaValue"]);
|
|
17
|
-
var isDesktop =
|
|
18
|
-
var Component = isDesktop ?
|
|
17
|
+
var isDesktop = cssm.useIsDesktop(breakpoint, defaultMatchMediaValue);
|
|
18
|
+
var Component = isDesktop ? Component_desktop.PatternLockDesktop : Component_mobile.PatternLockMobile;
|
|
19
19
|
return React__default.default.createElement(Component, tslib.__assign({ ref: ref }, restProps));
|
|
20
20
|
});
|
|
21
21
|
PatternLock.displayName = 'PatternLock';
|
|
22
22
|
|
|
23
23
|
exports.PatternLock = PatternLock;
|
|
24
|
+
//# sourceMappingURL=Component.responsive.js.map
|
|
@@ -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":["forwardRef","__rest","useIsDesktop","PatternLockDesktop","PatternLockMobile","React","__assign"],"mappings":";;;;;;;;;;;;;;IASa,WAAW,GAAGA,gBAAU,CACjC,UACI,EAKC,EACD,GAAG,EAAA;AALC,IAAA,IAAA,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,EAAgF,GAAA,EAAA,CAAA,sBAAA,EAAhF,sBAAsB,GAAA,EAAA,KAAA,MAAA,GAAG,MAAM,KAAK,SAAS,GAAG,SAAS,GAAG,MAAM,KAAK,SAAS,GAAA,EAAA,EAC7E,SAAS,GAJhBC,YAAA,CAAA,EAAA,EAAA,CAAA,YAAA,EAAA,QAAA,EAAA,wBAAA,CAKC,CADe;IAIhB,IAAM,SAAS,GAAGC,iBAAY,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAElE,IAAM,SAAS,GAAG,SAAS,GAAGC,oCAAkB,GAAGC,kCAAiB;IAEpE,OAAOC,sBAAA,CAAA,aAAA,CAAC,SAAS,EAACC,cAAA,CAAA,EAAA,GAAG,EAAE,GAAG,EAAA,EAAM,SAAS,CAAA,CAAI;AACjD,CAAC;AAGL,WAAW,CAAC,WAAW,GAAG,aAAa;;;;"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
4
|
-
import { CommonPatternLockProps, PrivatePatternLockProps } from
|
|
5
|
-
declare const BasePatternLock: React.ForwardRefExoticComponent<(CommonPatternLockProps & PrivatePatternLockProps) & React.RefAttributes<TPatternLockInstance>>;
|
|
6
|
-
export { BasePatternLock };
|
|
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>>;
|
|
@@ -6,7 +6,7 @@ var tslib = require('tslib');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
8
|
var mobile = require('@alfalab/core-components-button/cssm/mobile');
|
|
9
|
-
var
|
|
9
|
+
var cssm = require('@alfalab/core-components-shared/cssm');
|
|
10
10
|
var reactCanvasPatternLock = require('@alfalab/react-canvas-pattern-lock');
|
|
11
11
|
var consts = require('../../consts.js');
|
|
12
12
|
var utils = require('../../utils.js');
|
|
@@ -60,9 +60,10 @@ var BasePatternLock = React.forwardRef(function (_a, ref) {
|
|
|
60
60
|
React__default.default.createElement("div", { className: commonStyles__default.default.canvasContainer },
|
|
61
61
|
React__default.default.createElement("div", { className: commonStyles__default.default.canvasInner },
|
|
62
62
|
React__default.default.createElement(reactCanvasPatternLock.ReactCanvasPatternLock, tslib.__assign({}, restProps, params, { ref: ref, rows: 3, cols: 3, justifyNodes: 'space-between', extraBounds: extraBounds, hover: hover })))),
|
|
63
|
-
showForgotCodeBtn && (React__default.default.createElement(mobile.ButtonMobile, { view: 'transparent', className: cn__default.default(commonStyles__default.default.forgotBtn, styles.forgotBtn), onClick: onForgotBtnClick, dataTestId:
|
|
63
|
+
showForgotCodeBtn && (React__default.default.createElement(mobile.ButtonMobile, { view: 'transparent', className: cn__default.default(commonStyles__default.default.forgotBtn, styles.forgotBtn), onClick: onForgotBtnClick, dataTestId: cssm.getDataTestId(dataTestId, 'forgot-code-btn') }, forgotCodeBtnText))));
|
|
64
64
|
});
|
|
65
65
|
BasePatternLock.displayName = 'BasePatternLock';
|
|
66
66
|
reactCanvasPatternLock.ReactCanvasPatternLock.displayName = 'ReactCanvasPatternLock';
|
|
67
67
|
|
|
68
68
|
exports.BasePatternLock = BasePatternLock;
|
|
69
|
+
//# 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":["forwardRef","DEFAULT_EXTRA_BOUNDS","__rest","useState","useEffect","getSizes","getTheme","OBSERVE_OPTIONS","getDefaultObserveTarget","THEME_STATE","getColorByToken","OBSERVABLE_TOKENS","__assign","React","cn","commonStyles","ReactCanvasPatternLock","ButtonMobile","getDataTestId"],"mappings":";;;;;;;;;;;;;;;;;;;;IAmBa,eAAe,GAAGA,gBAAU,CAIrC,UACI,EAcC,EACD,GAAG,EAAA;;AAdC,IAAA,IAAA,EAAqB,GAAA,EAAA,CAAA,aAAA,CAAA,CAArB,aAAa,GAAA,EAAA,KAAA,MAAA,GAAG,KAAK,GAAA,EAAA,CACrB,CAAA,EAAA,GAAA,EAAA,CAAA,cAAmB,CAAnB,CAAA,cAAc,GAAG,EAAA,KAAA,MAAA,GAAA,EAAE,KAAA,CACnB,CAAA,SAAS,GAAA,EAAA,CAAA,SAAA,CAAA,CACT,UAAU,GAAA,EAAA,CAAA,UAAA,CACV,CAAA,EAAA,GAAA,EAAA,CAAA,iBAAiC,EAAjC,iBAAiB,GAAA,EAAA,KAAA,MAAA,GAAG,aAAa,GAAA,EAAA,CACjC,CAAA,EAAA,GAAA,EAAA,CAAA,iBAAyB,CAAzB,CAAA,iBAAiB,mBAAG,KAAK,GAAA,EAAA,CACzB,CAAA,gBAAgB,GAAA,EAAA,CAAA,gBAAA,CAAA,CAChB,EAAkC,GAAA,EAAA,CAAA,WAAA,CAAA,CAAlC,WAAW,GAAG,EAAA,KAAA,MAAA,GAAAC,2BAAoB,GAAA,EAAA,CAAA,CAClB,EAAA,CAAA,gBAAA,CAChB,KAAA,KAAK,WAAA,CACL,CA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,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEE,6BAAY,CAAC,eAAe,EAAA;AACxC,YAAAF,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEE,6BAAY,CAAC,WAAW,EAAA;AACpC,gBAAAF,sBAAA,CAAA,aAAA,CAACG,6CAAsB,EAAAJ,cAAA,CAAA,EAAA,EACf,SAAS,EACT,MAAM,EAAA,EACV,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,CAAC,EACP,YAAY,EAAC,eAAe,EAC5B,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EAAA,CAAA,CACd,CACA,CACJ;AACL,QAAA,iBAAiB,KACdC,sBAAA,CAAA,aAAA,CAACI,mBAAY,EACT,EAAA,IAAI,EAAC,aAAa,EAClB,SAAS,EAAEH,mBAAE,CAACC,6BAAY,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,EACvD,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAEG,kBAAa,CAAC,UAAU,EAAE,iBAAiB,CAAC,EAEvD,EAAA,iBAAiB,CACP,CAClB,CACC;AAEd,CAAC;AAGL,eAAe,CAAC,WAAW,GAAG,iBAAiB;AAC/CF,6CAAsB,CAAC,WAAW,GAAG,wBAAwB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './Component';
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var Component = require('./Component.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.BasePatternLock =
|
|
9
|
+
exports.BasePatternLock = Component.BasePatternLock;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,30 +1,10 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
|
|
3
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
5
|
-
} :root {
|
|
6
|
-
|
|
7
|
-
/* Hard */
|
|
8
|
-
|
|
9
|
-
/* Up */
|
|
10
|
-
|
|
11
|
-
/* Hard up */
|
|
12
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
13
|
-
|
|
14
|
-
/* новые значения, используйте их */
|
|
15
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
16
|
-
--gap-m: 16px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
17
|
-
|
|
18
|
-
/* новые значения, используйте их */
|
|
19
|
-
|
|
20
|
-
/* no-unit может приводить к проблемам в calc (#1559) */
|
|
21
|
-
/* stylelint-disable-next-line length-zero-no-unit */
|
|
1
|
+
:root {
|
|
2
|
+
--gap-m: 16px;
|
|
22
3
|
--gap-0: 0px;
|
|
23
4
|
--gap-16: var(--gap-m);
|
|
24
5
|
} :root {
|
|
25
|
-
} /* @deprecated */ /* @deprecated */ /* @deprecated */ /* @deprecated */ /* @deprecated */ :root {
|
|
26
6
|
--size-xs-height: 40px;
|
|
27
|
-
}
|
|
7
|
+
} :root {
|
|
28
8
|
--pattern-lock-min-width: 304px;
|
|
29
9
|
--pattern-lock-min-height: 272px;
|
|
30
10
|
--pattern-lock-with-forgot-btn-min-height: 336px;
|
package/cssm/consts.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { ReactPatternLockProps } from '@alfalab/react-canvas-pattern-lock';
|
|
2
|
-
import { ObservableTokens } from
|
|
3
|
-
declare const OBSERVE_OPTIONS: MutationObserverInit;
|
|
4
|
-
declare const DEFAULT_EXTRA_BOUNDS: ReactPatternLockProps['extraBounds'];
|
|
5
|
-
declare const OBSERVABLE_TOKENS: ObservableTokens;
|
|
6
|
-
declare const THEME_STATE: {
|
|
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
7
|
INITIAL: string;
|
|
8
8
|
SUCCESS: string;
|
|
9
9
|
FAILURE: string;
|
|
10
10
|
};
|
|
11
|
-
export { OBSERVE_OPTIONS, DEFAULT_EXTRA_BOUNDS, OBSERVABLE_TOKENS, THEME_STATE };
|
package/cssm/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,IAAA,eAAe,GAAyB;AACjD,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,OAAO,EAAE,IAAI;;AAGV,IAAM,oBAAoB,GAAyC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;AAE5E,IAAA,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,IAAA,WAAW,GAAG;AACvB,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,OAAO,EAAE,SAAS;;;;;;;;"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import { TPatternLockInstance } from '@alfalab/react-canvas-pattern-lock';
|
|
4
|
-
import { CommonPatternLockProps } from
|
|
5
|
-
declare const PatternLockDesktop: React.ForwardRefExoticComponent<CommonPatternLockProps & React.RefAttributes<TPatternLockInstance>>;
|
|
6
|
-
export { PatternLockDesktop };
|
|
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>>;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var
|
|
7
|
+
var Component = require('../components/base-pattern-lock/Component.js');
|
|
8
8
|
var styles = require('./desktop.module.css');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -12,7 +12,8 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
12
12
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
13
13
|
var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
14
14
|
|
|
15
|
-
var PatternLockDesktop = React.forwardRef(function (restProps, ref) { return React__default.default.createElement(
|
|
15
|
+
var PatternLockDesktop = React.forwardRef(function (restProps, ref) { return React__default.default.createElement(Component.BasePatternLock, tslib.__assign({}, restProps, { hover: true, ref: ref, styles: styles__default.default })); });
|
|
16
16
|
PatternLockDesktop.displayName = 'PatternLockDesktop';
|
|
17
17
|
|
|
18
18
|
exports.PatternLockDesktop = PatternLockDesktop;
|
|
19
|
+
//# sourceMappingURL=Component.desktop.js.map
|
|
@@ -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":["forwardRef","React","BasePatternLock","__assign","styles"],"mappings":";;;;;;;;;;;;;;AASO,IAAM,kBAAkB,GAAGA,gBAAU,CACxC,UAAC,SAAS,EAAE,GAAG,EAAA,EAAK,OAAAC,sBAAA,CAAA,aAAA,CAACC,yBAAe,EAAKC,cAAA,CAAA,EAAA,EAAA,SAAS,EAAE,EAAA,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAEC,uBAAM,EAAA,CAAA,CAAI,CAAzE,EAAyE;AAGjG,kBAAkB,CAAC,WAAW,GAAG,oBAAoB;;;;"}
|