@alfalab/core-components-modal 11.0.4 → 11.0.5-alfasans
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.d.ts +4 -4
- package/Component.js.map +1 -1
- package/Component.responsive.d.ts +14 -14
- package/Context.d.ts +0 -1
- package/components/content/desktop.css +6 -6
- package/components/content/desktop.module.css.js +1 -1
- package/components/content/index.css +3 -3
- package/components/content/index.module.css.js +1 -1
- package/components/content/mobile.css +2 -2
- package/components/content/mobile.module.css.js +1 -1
- package/components/controls/index.css +1 -1
- package/components/controls/index.module.css.js +1 -1
- package/components/footer/Component.d.ts +1 -1
- package/components/footer/desktop.css +8 -8
- package/components/footer/desktop.module.css.js +1 -1
- package/components/footer/index.css +3 -3
- package/components/footer/index.module.css.js +1 -1
- package/components/footer/layout.css +16 -16
- package/components/footer/layout.module.css.js +1 -1
- package/components/footer/mobile.css +3 -3
- package/components/footer/mobile.module.css.js +1 -1
- package/components/header/Component.d.ts +1 -1
- package/components/header/Component.js.map +1 -1
- package/components/header/desktop.css +21 -18
- package/components/header/desktop.module.css.js +1 -1
- package/components/header/index.css +3 -3
- package/components/header/index.module.css.js +1 -1
- package/components/header/mobile.css +10 -8
- package/components/header/mobile.module.css.js +1 -1
- package/cssm/Component.d.ts +4 -4
- package/cssm/Component.js.map +1 -1
- package/cssm/Component.responsive.d.ts +14 -14
- package/cssm/Context.d.ts +0 -1
- package/cssm/components/footer/Component.d.ts +1 -1
- package/cssm/components/header/Component.d.ts +1 -1
- package/cssm/components/header/Component.js.map +1 -1
- package/cssm/components/header/desktop.module.css +7 -4
- package/cssm/components/header/mobile.module.css +6 -4
- package/cssm/desktop/Component.desktop.d.ts +9 -9
- package/cssm/typings.d.ts +6 -6
- package/cssm/utils.d.ts +1 -1
- package/cssm/utils.js.map +1 -1
- package/desktop/Component.desktop.d.ts +9 -9
- package/desktop/desktop.css +8 -8
- package/desktop/desktop.module.css.js +1 -1
- package/esm/Component.d.ts +4 -4
- package/esm/Component.js.map +1 -1
- package/esm/Component.responsive.d.ts +14 -14
- package/esm/Context.d.ts +0 -1
- package/esm/components/content/desktop.css +6 -6
- package/esm/components/content/desktop.module.css.js +1 -1
- package/esm/components/content/index.css +3 -3
- package/esm/components/content/index.module.css.js +1 -1
- package/esm/components/content/mobile.css +2 -2
- package/esm/components/content/mobile.module.css.js +1 -1
- package/esm/components/controls/index.css +1 -1
- package/esm/components/controls/index.module.css.js +1 -1
- package/esm/components/footer/Component.d.ts +1 -1
- package/esm/components/footer/desktop.css +8 -8
- package/esm/components/footer/desktop.module.css.js +1 -1
- package/esm/components/footer/index.css +3 -3
- package/esm/components/footer/index.module.css.js +1 -1
- package/esm/components/footer/layout.css +16 -16
- package/esm/components/footer/layout.module.css.js +1 -1
- package/esm/components/footer/mobile.css +3 -3
- package/esm/components/footer/mobile.module.css.js +1 -1
- package/esm/components/header/Component.d.ts +1 -1
- package/esm/components/header/Component.js.map +1 -1
- package/esm/components/header/desktop.css +21 -18
- package/esm/components/header/desktop.module.css.js +1 -1
- package/esm/components/header/index.css +3 -3
- package/esm/components/header/index.module.css.js +1 -1
- package/esm/components/header/mobile.css +10 -8
- package/esm/components/header/mobile.module.css.js +1 -1
- package/esm/desktop/Component.desktop.d.ts +9 -9
- package/esm/desktop/desktop.css +8 -8
- package/esm/desktop/desktop.module.css.js +1 -1
- package/esm/mobile/mobile.css +2 -2
- package/esm/mobile/mobile.module.css.js +1 -1
- package/esm/transitions.css +7 -7
- package/esm/transitions.module.css.js +1 -1
- package/esm/typings.d.ts +6 -6
- package/esm/utils.d.ts +1 -1
- package/esm/utils.js.map +1 -1
- package/mobile/mobile.css +2 -2
- package/mobile/mobile.module.css.js +1 -1
- package/modern/Component.d.ts +4 -4
- package/modern/Component.js.map +1 -1
- package/modern/Component.responsive.d.ts +14 -14
- package/modern/Context.d.ts +0 -1
- package/modern/components/content/desktop.css +6 -6
- package/modern/components/content/desktop.module.css.js +1 -1
- package/modern/components/content/index.css +3 -3
- package/modern/components/content/index.module.css.js +1 -1
- package/modern/components/content/mobile.css +2 -2
- package/modern/components/content/mobile.module.css.js +1 -1
- package/modern/components/controls/index.css +1 -1
- package/modern/components/controls/index.module.css.js +1 -1
- package/modern/components/footer/Component.d.ts +1 -1
- package/modern/components/footer/desktop.css +8 -8
- package/modern/components/footer/desktop.module.css.js +1 -1
- package/modern/components/footer/index.css +3 -3
- package/modern/components/footer/index.module.css.js +1 -1
- package/modern/components/footer/layout.css +16 -16
- package/modern/components/footer/layout.module.css.js +1 -1
- package/modern/components/footer/mobile.css +3 -3
- package/modern/components/footer/mobile.module.css.js +1 -1
- package/modern/components/header/Component.d.ts +1 -1
- package/modern/components/header/Component.js.map +1 -1
- package/modern/components/header/desktop.css +21 -18
- package/modern/components/header/desktop.module.css.js +1 -1
- package/modern/components/header/index.css +3 -3
- package/modern/components/header/index.module.css.js +1 -1
- package/modern/components/header/mobile.css +10 -8
- package/modern/components/header/mobile.module.css.js +1 -1
- package/modern/desktop/Component.desktop.d.ts +9 -9
- package/modern/desktop/desktop.css +8 -8
- package/modern/desktop/desktop.module.css.js +1 -1
- package/modern/mobile/mobile.css +2 -2
- package/modern/mobile/mobile.module.css.js +1 -1
- package/modern/transitions.css +7 -7
- package/modern/transitions.module.css.js +1 -1
- package/modern/typings.d.ts +6 -6
- package/modern/utils.d.ts +1 -1
- package/modern/utils.js.map +1 -1
- package/moderncssm/Component.d.ts +4 -4
- package/moderncssm/Component.js.map +1 -1
- package/moderncssm/Component.responsive.d.ts +14 -14
- package/moderncssm/Context.d.ts +0 -1
- package/moderncssm/components/footer/Component.d.ts +1 -1
- package/moderncssm/components/header/Component.d.ts +1 -1
- package/moderncssm/components/header/Component.js.map +1 -1
- package/moderncssm/components/header/desktop.module.css +4 -2
- package/moderncssm/components/header/mobile.module.css +3 -2
- package/moderncssm/desktop/Component.desktop.d.ts +9 -9
- package/moderncssm/typings.d.ts +6 -6
- package/moderncssm/utils.d.ts +1 -1
- package/moderncssm/utils.js.map +1 -1
- package/package.json +7 -7
- package/src/vars.css +1 -1
- package/transitions.css +7 -7
- package/transitions.module.css.js +1 -1
- package/typings.d.ts +6 -6
- package/utils.d.ts +1 -1
- package/utils.js.map +1 -1
package/modern/typings.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type BaseModalProps } from '@alfalab/core-components-base-modal/modern';
|
|
3
|
-
export
|
|
3
|
+
export type ModalDesktopProps = BaseModalProps & {
|
|
4
4
|
/**
|
|
5
5
|
* Ширина модального окна
|
|
6
6
|
* @default 600
|
|
@@ -21,8 +21,8 @@ export declare type ModalDesktopProps = BaseModalProps & {
|
|
|
21
21
|
*/
|
|
22
22
|
iOSLock?: boolean;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
25
|
-
export
|
|
24
|
+
export type ModalMobileProps = Omit<ModalDesktopProps, 'size' | 'fixedPosition'>;
|
|
25
|
+
export type ModalResponsiveProps = ModalDesktopProps & {
|
|
26
26
|
/**
|
|
27
27
|
* Контрольная точка, с нее начинается desktop версия
|
|
28
28
|
* @default 1024
|
|
@@ -38,13 +38,13 @@ export declare type ModalResponsiveProps = ModalDesktopProps & {
|
|
|
38
38
|
*/
|
|
39
39
|
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
40
40
|
};
|
|
41
|
-
export
|
|
42
|
-
export
|
|
41
|
+
export type View = 'desktop' | 'mobile';
|
|
42
|
+
export type TResponsiveModalContext = {
|
|
43
43
|
view: View;
|
|
44
44
|
size: NonNullable<ModalDesktopProps['size']>;
|
|
45
45
|
dataTestId?: string;
|
|
46
46
|
};
|
|
47
|
-
export
|
|
47
|
+
export type ContentProps = {
|
|
48
48
|
/**
|
|
49
49
|
* Контент
|
|
50
50
|
*/
|
package/modern/utils.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ export declare function getModalTestIds(dataTestId: string): {
|
|
|
9
9
|
closer: string;
|
|
10
10
|
backButton: string;
|
|
11
11
|
};
|
|
12
|
-
export declare const getSizeStyle: (size: ModalResponsiveProps[
|
|
12
|
+
export declare const getSizeStyle: (size: ModalResponsiveProps["size"]) => string;
|
package/modern/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { type ModalResponsiveProps } from './typings';\n\nexport function getModalTestIds(dataTestId: string) {\n return {\n modal: dataTestId,\n content: getDataTestId(dataTestId, 'content'),\n footer: getDataTestId(dataTestId, 'footer'),\n controls: getDataTestId(dataTestId, 'controls'),\n header: getDataTestId(dataTestId, 'header'),\n title: getDataTestId(dataTestId, 'header-title'),\n closer: getDataTestId(dataTestId, 'header-closer'),\n backButton: getDataTestId(dataTestId, 'header-back-button'),\n };\n}\n\nexport const getSizeStyle = (size: ModalResponsiveProps['size']) => {\n if (size === 'fullscreen') {\n return size;\n }\n\n return `size-${size}`;\n};\n"],"names":[],"mappings":";;AAIM,SAAU,eAAe,CAAC,UAAkB,EAAA;IAC9C,OAAO;AACH,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,OAAO,EAAE,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC;AAC7C,QAAA,MAAM,EAAE,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;AAC3C,QAAA,QAAQ,EAAE,aAAa,CAAC,UAAU,EAAE,UAAU,CAAC;AAC/C,QAAA,MAAM,EAAE,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;AAC3C,QAAA,KAAK,EAAE,aAAa,CAAC,UAAU,EAAE,cAAc,CAAC;AAChD,QAAA,MAAM,EAAE,aAAa,CAAC,UAAU,EAAE,eAAe,CAAC;AAClD,QAAA,UAAU,EAAE,aAAa,CAAC,UAAU,EAAE,oBAAoB,CAAC;KAC9D;AACL;AAEa,MAAA,YAAY,GAAG,CAAC,IAAkC,KAAI;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { type ModalResponsiveProps } from './typings';\n\nexport function getModalTestIds(dataTestId: string) {\n return {\n modal: dataTestId,\n content: getDataTestId(dataTestId, 'content'),\n footer: getDataTestId(dataTestId, 'footer'),\n controls: getDataTestId(dataTestId, 'controls'),\n header: getDataTestId(dataTestId, 'header'),\n title: getDataTestId(dataTestId, 'header-title'),\n closer: getDataTestId(dataTestId, 'header-closer'),\n backButton: getDataTestId(dataTestId, 'header-back-button'),\n };\n}\n\nexport const getSizeStyle = (size: ModalResponsiveProps['size']) => {\n if (size === 'fullscreen') {\n return size;\n }\n\n return `size-${size}`;\n};\n"],"names":[],"mappings":";;AAIM,SAAU,eAAe,CAAC,UAAkB,EAAA;IAC9C,OAAO;AACH,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,OAAO,EAAE,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC;AAC7C,QAAA,MAAM,EAAE,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;AAC3C,QAAA,QAAQ,EAAE,aAAa,CAAC,UAAU,EAAE,UAAU,CAAC;AAC/C,QAAA,MAAM,EAAE,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;AAC3C,QAAA,KAAK,EAAE,aAAa,CAAC,UAAU,EAAE,cAAc,CAAC;AAChD,QAAA,MAAM,EAAE,aAAa,CAAC,UAAU,EAAE,eAAe,CAAC;AAClD,QAAA,UAAU,EAAE,aAAa,CAAC,UAAU,EAAE,oBAAoB,CAAC;KAC9D;AACL;AAEa,MAAA,YAAY,GAAG,CAAC,IAAkC,KAAI;AAC/D,IAAA,IAAI,IAAI,KAAK,YAAY,EAAE;AACvB,QAAA,OAAO,IAAI;;IAGf,OAAO,CAAA,KAAA,EAAQ,IAAI,CAAA,CAAE;AACzB;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type View } from './typings';
|
|
3
3
|
export declare const Modal: React.ForwardRefExoticComponent<import("@alfalab/core-components-base-modal").BaseModalProps & {
|
|
4
|
-
size?: "fullscreen" | 500 | 600 | 800 | 1140
|
|
5
|
-
fixedPosition?: boolean
|
|
6
|
-
hasCloser?: boolean
|
|
7
|
-
iOSLock?: boolean
|
|
4
|
+
size?: "fullscreen" | 500 | 600 | 800 | 1140;
|
|
5
|
+
fixedPosition?: boolean;
|
|
6
|
+
hasCloser?: boolean;
|
|
7
|
+
iOSLock?: boolean;
|
|
8
8
|
} & {
|
|
9
9
|
view: View;
|
|
10
10
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["import React, { forwardRef, useMemo, useRef } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { BaseModal } from '@alfalab/core-components-base-modal';\n\nimport { ResponsiveContext } from './ResponsiveContext';\nimport { type ModalDesktopProps, type View } from './typings';\nimport { getSizeStyle } from './utils';\n\nimport desktopStyles from './desktop/desktop.module.css';\nimport mobileStyles from './mobile/mobile.module.css';\nimport transitions from './transitions.module.css';\n\nexport const Modal = forwardRef<HTMLDivElement, ModalDesktopProps & { view: View }>(\n (\n {\n size = 500,\n fixedPosition,\n children,\n className,\n wrapperClassName,\n transitionProps = {},\n view,\n dataTestId,\n ...restProps\n },\n ref,\n ) => {\n const modalRef = useRef<HTMLElement>(null);\n\n const handleEntered = (node: HTMLElement, isAppearing: boolean) => {\n if (fixedPosition && modalRef.current) {\n const content = modalRef.current.querySelector<HTMLElement>(\n `.${desktopStyles.component}`,\n );\n\n if (content) {\n const { marginTop } = window.getComputedStyle(content);\n\n content.style.marginTop = marginTop;\n }\n }\n\n if (transitionProps.onEntered) {\n transitionProps.onEntered(node, isAppearing);\n }\n };\n\n const baseModalProps =\n view === 'desktop'\n ? {\n ref: mergeRefs([ref, modalRef]),\n wrapperClassName: cn(desktopStyles.wrapper, wrapperClassName, {\n [desktopStyles.fullscreen]: size === 'fullscreen',\n }),\n className: cn(\n desktopStyles.component,\n className,\n desktopStyles[getSizeStyle(size)],\n ),\n backdropProps: {\n invisible: size === 'fullscreen',\n ...restProps.backdropProps,\n },\n transitionProps: {\n classNames: transitions,\n ...transitionProps,\n onEntered: handleEntered,\n },\n }\n : {\n wrapperClassName,\n ref,\n transitionProps: {\n classNames: transitions,\n ...transitionProps,\n },\n className: cn(className, mobileStyles.component),\n contentProps: {\n ...restProps.contentProps,\n className: cn(mobileStyles.content, restProps.contentProps?.className),\n },\n };\n\n const contextValue = useMemo(() => ({ size, view, dataTestId }), [size, view, dataTestId]);\n\n return (\n <ResponsiveContext.Provider value={contextValue}>\n <BaseModal {...restProps} {...baseModalProps} dataTestId={dataTestId}>\n {children}\n </BaseModal>\n </ResponsiveContext.Provider>\n );\n },\n);\n\nModal.displayName = 'Modal';\n"],"names":[],"mappings":";;;;;;;;;;AAcO,MAAM,KAAK,GAAG,UAAU,CAC3B,CACI,EACI,IAAI,GAAG,GAAG,EACV,aAAa,EACb,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,eAAe,GAAG,EAAE,EACpB,IAAI,EACJ,UAAU,EACV,GAAG,SAAS,EACf,EACD,GAAG,KACH;AACA,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAc,IAAI,CAAC;AAE1C,IAAA,MAAM,aAAa,GAAG,CAAC,IAAiB,EAAE,WAAoB,KAAI;AAC9D,QAAA,IAAI,aAAa,IAAI,QAAQ,CAAC,OAAO,EAAE;AACnC,YAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,aAAa,CAC1C,CAAA,CAAA,EAAI,aAAa,CAAC,SAAS,CAAA,CAAE,CAChC;
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["import React, { forwardRef, useMemo, useRef } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { BaseModal } from '@alfalab/core-components-base-modal';\n\nimport { ResponsiveContext } from './ResponsiveContext';\nimport { type ModalDesktopProps, type View } from './typings';\nimport { getSizeStyle } from './utils';\n\nimport desktopStyles from './desktop/desktop.module.css';\nimport mobileStyles from './mobile/mobile.module.css';\nimport transitions from './transitions.module.css';\n\nexport const Modal = forwardRef<HTMLDivElement, ModalDesktopProps & { view: View }>(\n (\n {\n size = 500,\n fixedPosition,\n children,\n className,\n wrapperClassName,\n transitionProps = {},\n view,\n dataTestId,\n ...restProps\n },\n ref,\n ) => {\n const modalRef = useRef<HTMLElement>(null);\n\n const handleEntered = (node: HTMLElement, isAppearing: boolean) => {\n if (fixedPosition && modalRef.current) {\n const content = modalRef.current.querySelector<HTMLElement>(\n `.${desktopStyles.component}`,\n );\n\n if (content) {\n const { marginTop } = window.getComputedStyle(content);\n\n content.style.marginTop = marginTop;\n }\n }\n\n if (transitionProps.onEntered) {\n transitionProps.onEntered(node, isAppearing);\n }\n };\n\n const baseModalProps =\n view === 'desktop'\n ? {\n ref: mergeRefs([ref, modalRef]),\n wrapperClassName: cn(desktopStyles.wrapper, wrapperClassName, {\n [desktopStyles.fullscreen]: size === 'fullscreen',\n }),\n className: cn(\n desktopStyles.component,\n className,\n desktopStyles[getSizeStyle(size)],\n ),\n backdropProps: {\n invisible: size === 'fullscreen',\n ...restProps.backdropProps,\n },\n transitionProps: {\n classNames: transitions,\n ...transitionProps,\n onEntered: handleEntered,\n },\n }\n : {\n wrapperClassName,\n ref,\n transitionProps: {\n classNames: transitions,\n ...transitionProps,\n },\n className: cn(className, mobileStyles.component),\n contentProps: {\n ...restProps.contentProps,\n className: cn(mobileStyles.content, restProps.contentProps?.className),\n },\n };\n\n const contextValue = useMemo(() => ({ size, view, dataTestId }), [size, view, dataTestId]);\n\n return (\n <ResponsiveContext.Provider value={contextValue}>\n <BaseModal {...restProps} {...baseModalProps} dataTestId={dataTestId}>\n {children}\n </BaseModal>\n </ResponsiveContext.Provider>\n );\n },\n);\n\nModal.displayName = 'Modal';\n"],"names":[],"mappings":";;;;;;;;;;AAcO,MAAM,KAAK,GAAG,UAAU,CAC3B,CACI,EACI,IAAI,GAAG,GAAG,EACV,aAAa,EACb,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,eAAe,GAAG,EAAE,EACpB,IAAI,EACJ,UAAU,EACV,GAAG,SAAS,EACf,EACD,GAAG,KACH;AACA,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAc,IAAI,CAAC;AAE1C,IAAA,MAAM,aAAa,GAAG,CAAC,IAAiB,EAAE,WAAoB,KAAI;AAC9D,QAAA,IAAI,aAAa,IAAI,QAAQ,CAAC,OAAO,EAAE;AACnC,YAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,aAAa,CAC1C,CAAA,CAAA,EAAI,aAAa,CAAC,SAAS,CAAA,CAAE,CAChC;YAED,IAAI,OAAO,EAAE;gBACT,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC;AAEtD,gBAAA,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,SAAS;;;AAI3C,QAAA,IAAI,eAAe,CAAC,SAAS,EAAE;AAC3B,YAAA,eAAe,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC;;AAEpD,KAAC;AAED,IAAA,MAAM,cAAc,GAChB,IAAI,KAAK;AACL,UAAE;YACI,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YAC/B,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,gBAAgB,EAAE;AAC1D,gBAAA,CAAC,aAAa,CAAC,UAAU,GAAG,IAAI,KAAK,YAAY;aACpD,CAAC;AACF,YAAA,SAAS,EAAE,EAAE,CACT,aAAa,CAAC,SAAS,EACvB,SAAS,EACT,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CACpC;AACD,YAAA,aAAa,EAAE;gBACX,SAAS,EAAE,IAAI,KAAK,YAAY;gBAChC,GAAG,SAAS,CAAC,aAAa;AAC7B,aAAA;AACD,YAAA,eAAe,EAAE;AACb,gBAAA,UAAU,EAAE,WAAW;AACvB,gBAAA,GAAG,eAAe;AAClB,gBAAA,SAAS,EAAE,aAAa;AAC3B,aAAA;AACJ;AACH,UAAE;YACI,gBAAgB;YAChB,GAAG;AACH,YAAA,eAAe,EAAE;AACb,gBAAA,UAAU,EAAE,WAAW;AACvB,gBAAA,GAAG,eAAe;AACrB,aAAA;YACD,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC;AAChD,YAAA,YAAY,EAAE;gBACV,GAAG,SAAS,CAAC,YAAY;AACzB,gBAAA,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC;AACzE,aAAA;SACJ;IAEX,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IAE1F,QACI,oBAAC,iBAAiB,CAAC,QAAQ,EAAC,EAAA,KAAK,EAAE,YAAY,EAAA;AAC3C,QAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAA,GAAK,SAAS,EAAA,GAAM,cAAc,EAAE,UAAU,EAAE,UAAU,EAC/D,EAAA,QAAQ,CACD,CACa;AAErC,CAAC;AAGL,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
|
|
@@ -4,24 +4,24 @@ import { Controls } from './components/controls';
|
|
|
4
4
|
import { Footer } from './components/footer/Component';
|
|
5
5
|
import { Header } from './components/header/Component';
|
|
6
6
|
declare const ModalResponsiveComponent: React.ForwardRefExoticComponent<import("@alfalab/core-components-base-modal").BaseModalProps & {
|
|
7
|
-
size?: "fullscreen" | 500 | 600 | 800 | 1140
|
|
8
|
-
fixedPosition?: boolean
|
|
9
|
-
hasCloser?: boolean
|
|
10
|
-
iOSLock?: boolean
|
|
7
|
+
size?: "fullscreen" | 500 | 600 | 800 | 1140;
|
|
8
|
+
fixedPosition?: boolean;
|
|
9
|
+
hasCloser?: boolean;
|
|
10
|
+
iOSLock?: boolean;
|
|
11
11
|
} & {
|
|
12
|
-
breakpoint?: number
|
|
13
|
-
client?: "desktop" | "mobile"
|
|
14
|
-
defaultMatchMediaValue?: boolean | (() => boolean)
|
|
12
|
+
breakpoint?: number;
|
|
13
|
+
client?: "desktop" | "mobile";
|
|
14
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
15
15
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
16
16
|
export declare const ModalResponsive: React.ForwardRefExoticComponent<import("@alfalab/core-components-base-modal").BaseModalProps & {
|
|
17
|
-
size?: "fullscreen" | 500 | 600 | 800 | 1140
|
|
18
|
-
fixedPosition?: boolean
|
|
19
|
-
hasCloser?: boolean
|
|
20
|
-
iOSLock?: boolean
|
|
17
|
+
size?: "fullscreen" | 500 | 600 | 800 | 1140;
|
|
18
|
+
fixedPosition?: boolean;
|
|
19
|
+
hasCloser?: boolean;
|
|
20
|
+
iOSLock?: boolean;
|
|
21
21
|
} & {
|
|
22
|
-
breakpoint?: number
|
|
23
|
-
client?: "desktop" | "mobile"
|
|
24
|
-
defaultMatchMediaValue?: boolean | (() => boolean)
|
|
22
|
+
breakpoint?: number;
|
|
23
|
+
client?: "desktop" | "mobile";
|
|
24
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
25
25
|
} & React.RefAttributes<HTMLDivElement>> & {
|
|
26
26
|
Header: React.FC<import("./components/header/Component").HeaderProps>;
|
|
27
27
|
Content: React.FC<import("./typings").ContentProps>;
|
package/moderncssm/Context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
2
|
import { type NavigationBarPrivateProps } from '@alfalab/core-components-navigation-bar-private/moderncssm';
|
|
3
|
-
export
|
|
3
|
+
export type HeaderProps = Omit<NavigationBarPrivateProps, 'size' | 'view' | 'parentRef'>;
|
|
4
4
|
export declare const Header: FC<HeaderProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/header/Component.tsx"],"sourcesContent":["import React, { type FC, useCallback, useContext, useEffect } from 'react';\nimport cn from 'classnames';\n\nimport {\n NavigationBarPrivate,\n type NavigationBarPrivateProps,\n} from '@alfalab/core-components-navigation-bar-private';\nimport { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { ModalContext } from '../../Context';\nimport { ResponsiveContext } from '../../ResponsiveContext';\nimport { getSizeStyle } from '../../utils';\n\nimport desktopStyles from './desktop.module.css';\nimport styles from './index.module.css';\nimport mobileStyles from './mobile.module.css';\n\nexport type HeaderProps = Omit<NavigationBarPrivateProps, 'size' | 'view' | 'parentRef'>;\n\nexport const Header: FC<HeaderProps> = ({\n className,\n sticky,\n title,\n children,\n contentClassName,\n hasCloser = true,\n onClose: onHeaderClose,\n ...restProps\n}) => {\n const { setHasHeader, headerHighlighted, parentRef, onClose } = useContext(ModalContext);\n const { view, size, dataTestId } = useContext(ResponsiveContext);\n\n const handleClose = useCallback<NonNullable<NavigationBarPrivateProps['onClose']>>(\n (...params) => {\n if (onHeaderClose) {\n onHeaderClose(...params);\n }\n if (onClose) {\n onClose(...params);\n }\n },\n [onHeaderClose, onClose],\n );\n\n useEffect(() => {\n setHasHeader(true);\n }, [setHasHeader]);\n\n const hasContent = Boolean(title || children);\n\n return (\n <NavigationBarPrivate\n dataTestId={getDataTestId(dataTestId, 'header')}\n {...restProps}\n scrollableParentRef={parentRef}\n hasCloser={hasCloser}\n sticky={sticky}\n view={view}\n title={title}\n onClose={handleClose}\n className={cn(className, {\n [styles.highlighted]: hasContent && sticky && headerHighlighted,\n [styles.sticky]: sticky,\n [styles.hasContent]: hasContent,\n [desktopStyles.header]: view === 'desktop',\n [desktopStyles.sticky]: view === 'desktop' && sticky,\n [desktopStyles[getSizeStyle(size)]]: view === 'desktop',\n [mobileStyles.header]: view === 'mobile',\n [mobileStyles.sticky]: view === 'mobile' && sticky,\n })}\n contentClassName={cn(contentClassName, {\n [desktopStyles.content]: view === 'desktop',\n [mobileStyles.content]: view === 'mobile',\n })}\n >\n {children}\n </NavigationBarPrivate>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAmBO,MAAM,MAAM,GAAoB,CAAC,EACpC,SAAS,EACT,MAAM,EACN,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,SAAS,GAAG,IAAI,EAChB,OAAO,EAAE,aAAa,EACtB,GAAG,SAAS,EACf,KAAI;AACD,IAAA,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,YAAY,CAAC;AACxF,IAAA,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAEhE,MAAM,WAAW,GAAG,WAAW,CAC3B,CAAC,GAAG,MAAM,KAAI;
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/header/Component.tsx"],"sourcesContent":["import React, { type FC, useCallback, useContext, useEffect } from 'react';\nimport cn from 'classnames';\n\nimport {\n NavigationBarPrivate,\n type NavigationBarPrivateProps,\n} from '@alfalab/core-components-navigation-bar-private';\nimport { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { ModalContext } from '../../Context';\nimport { ResponsiveContext } from '../../ResponsiveContext';\nimport { getSizeStyle } from '../../utils';\n\nimport desktopStyles from './desktop.module.css';\nimport styles from './index.module.css';\nimport mobileStyles from './mobile.module.css';\n\nexport type HeaderProps = Omit<NavigationBarPrivateProps, 'size' | 'view' | 'parentRef'>;\n\nexport const Header: FC<HeaderProps> = ({\n className,\n sticky,\n title,\n children,\n contentClassName,\n hasCloser = true,\n onClose: onHeaderClose,\n ...restProps\n}) => {\n const { setHasHeader, headerHighlighted, parentRef, onClose } = useContext(ModalContext);\n const { view, size, dataTestId } = useContext(ResponsiveContext);\n\n const handleClose = useCallback<NonNullable<NavigationBarPrivateProps['onClose']>>(\n (...params) => {\n if (onHeaderClose) {\n onHeaderClose(...params);\n }\n if (onClose) {\n onClose(...params);\n }\n },\n [onHeaderClose, onClose],\n );\n\n useEffect(() => {\n setHasHeader(true);\n }, [setHasHeader]);\n\n const hasContent = Boolean(title || children);\n\n return (\n <NavigationBarPrivate\n dataTestId={getDataTestId(dataTestId, 'header')}\n {...restProps}\n scrollableParentRef={parentRef}\n hasCloser={hasCloser}\n sticky={sticky}\n view={view}\n title={title}\n onClose={handleClose}\n className={cn(className, {\n [styles.highlighted]: hasContent && sticky && headerHighlighted,\n [styles.sticky]: sticky,\n [styles.hasContent]: hasContent,\n [desktopStyles.header]: view === 'desktop',\n [desktopStyles.sticky]: view === 'desktop' && sticky,\n [desktopStyles[getSizeStyle(size)]]: view === 'desktop',\n [mobileStyles.header]: view === 'mobile',\n [mobileStyles.sticky]: view === 'mobile' && sticky,\n })}\n contentClassName={cn(contentClassName, {\n [desktopStyles.content]: view === 'desktop',\n [mobileStyles.content]: view === 'mobile',\n })}\n >\n {children}\n </NavigationBarPrivate>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAmBO,MAAM,MAAM,GAAoB,CAAC,EACpC,SAAS,EACT,MAAM,EACN,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,SAAS,GAAG,IAAI,EAChB,OAAO,EAAE,aAAa,EACtB,GAAG,SAAS,EACf,KAAI;AACD,IAAA,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,YAAY,CAAC;AACxF,IAAA,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAEhE,MAAM,WAAW,GAAG,WAAW,CAC3B,CAAC,GAAG,MAAM,KAAI;QACV,IAAI,aAAa,EAAE;AACf,YAAA,aAAa,CAAC,GAAG,MAAM,CAAC;;QAE5B,IAAI,OAAO,EAAE;AACT,YAAA,OAAO,CAAC,GAAG,MAAM,CAAC;;AAE1B,KAAC,EACD,CAAC,aAAa,EAAE,OAAO,CAAC,CAC3B;IAED,SAAS,CAAC,MAAK;QACX,YAAY,CAAC,IAAI,CAAC;AACtB,KAAC,EAAE,CAAC,YAAY,CAAC,CAAC;IAElB,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,IAAI,QAAQ,CAAC;IAE7C,QACI,oBAAC,oBAAoB,EAAA,EACjB,UAAU,EAAE,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAA,GAC3C,SAAS,EACb,mBAAmB,EAAE,SAAS,EAC9B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE;YACrB,CAAC,MAAM,CAAC,WAAW,GAAG,UAAU,IAAI,MAAM,IAAI,iBAAiB;AAC/D,YAAA,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM;AACvB,YAAA,CAAC,MAAM,CAAC,UAAU,GAAG,UAAU;AAC/B,YAAA,CAAC,aAAa,CAAC,MAAM,GAAG,IAAI,KAAK,SAAS;YAC1C,CAAC,aAAa,CAAC,MAAM,GAAG,IAAI,KAAK,SAAS,IAAI,MAAM;YACpD,CAAC,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,KAAK,SAAS;AACvD,YAAA,CAAC,YAAY,CAAC,MAAM,GAAG,IAAI,KAAK,QAAQ;YACxC,CAAC,YAAY,CAAC,MAAM,GAAG,IAAI,KAAK,QAAQ,IAAI,MAAM;AACrD,SAAA,CAAC,EACF,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,EAAE;AACnC,YAAA,CAAC,aAAa,CAAC,OAAO,GAAG,IAAI,KAAK,SAAS;AAC3C,YAAA,CAAC,YAAY,CAAC,OAAO,GAAG,IAAI,KAAK,QAAQ;AAC5C,SAAA,CAAC,EAED,EAAA,QAAQ,CACU;AAE/B;;;;"}
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
font-size: 22px;
|
|
20
20
|
line-height: 26px;
|
|
21
21
|
font-weight: 700;
|
|
22
|
-
|
|
22
|
+
letter-spacing: 0.2px;
|
|
23
|
+
font-family: var(--font-family-alfasans);
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
.size-800 .content,
|
|
@@ -29,7 +30,8 @@
|
|
|
29
30
|
font-size: 30px;
|
|
30
31
|
line-height: 36px;
|
|
31
32
|
font-weight: 700;
|
|
32
|
-
|
|
33
|
+
letter-spacing: 0.1px;
|
|
34
|
+
font-family: var(--font-family-alfasans);
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
.size-500,
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
padding: var(--modal-header-mobile-content-paddings);
|
|
23
23
|
font-size: 20px;
|
|
24
24
|
line-height: 28px;
|
|
25
|
-
font-weight:
|
|
26
|
-
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
letter-spacing: -0.15px;
|
|
27
|
+
font-family: var(--font-family-alfasans);
|
|
27
28
|
}
|
|
@@ -4,18 +4,18 @@ import { type ControlsProps } from '../components/controls';
|
|
|
4
4
|
import { Footer } from '../components/footer/Component';
|
|
5
5
|
import { type HeaderProps } from '../components/header/Component';
|
|
6
6
|
declare const ModalDesktopComponent: React.ForwardRefExoticComponent<import("@alfalab/core-components-base-modal").BaseModalProps & {
|
|
7
|
-
size?: "fullscreen" | 500 | 600 | 800 | 1140
|
|
8
|
-
fixedPosition?: boolean
|
|
9
|
-
hasCloser?: boolean
|
|
10
|
-
iOSLock?: boolean
|
|
7
|
+
size?: "fullscreen" | 500 | 600 | 800 | 1140;
|
|
8
|
+
fixedPosition?: boolean;
|
|
9
|
+
hasCloser?: boolean;
|
|
10
|
+
iOSLock?: boolean;
|
|
11
11
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
declare const HeaderDesktop: React.FC<Omit<HeaderProps, "
|
|
12
|
+
declare const HeaderDesktop: React.FC<Omit<HeaderProps, "titleSize" | "subtitle">>;
|
|
13
13
|
declare const ControlsDesktop: React.FC<Omit<ControlsProps, "mobileLayout">>;
|
|
14
14
|
export declare const ModalDesktop: React.ForwardRefExoticComponent<import("@alfalab/core-components-base-modal").BaseModalProps & {
|
|
15
|
-
size?: "fullscreen" | 500 | 600 | 800 | 1140
|
|
16
|
-
fixedPosition?: boolean
|
|
17
|
-
hasCloser?: boolean
|
|
18
|
-
iOSLock?: boolean
|
|
15
|
+
size?: "fullscreen" | 500 | 600 | 800 | 1140;
|
|
16
|
+
fixedPosition?: boolean;
|
|
17
|
+
hasCloser?: boolean;
|
|
18
|
+
iOSLock?: boolean;
|
|
19
19
|
} & React.RefAttributes<HTMLDivElement>> & {
|
|
20
20
|
Content: React.FC<import("../typings").ContentProps>;
|
|
21
21
|
Header: React.FC<Omit<HeaderProps, "subtitle" | "titleSize">>;
|
package/moderncssm/typings.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type BaseModalProps } from '@alfalab/core-components-base-modal/moderncssm';
|
|
3
|
-
export
|
|
3
|
+
export type ModalDesktopProps = BaseModalProps & {
|
|
4
4
|
/**
|
|
5
5
|
* Ширина модального окна
|
|
6
6
|
* @default 600
|
|
@@ -21,8 +21,8 @@ export declare type ModalDesktopProps = BaseModalProps & {
|
|
|
21
21
|
*/
|
|
22
22
|
iOSLock?: boolean;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
25
|
-
export
|
|
24
|
+
export type ModalMobileProps = Omit<ModalDesktopProps, 'size' | 'fixedPosition'>;
|
|
25
|
+
export type ModalResponsiveProps = ModalDesktopProps & {
|
|
26
26
|
/**
|
|
27
27
|
* Контрольная точка, с нее начинается desktop версия
|
|
28
28
|
* @default 1024
|
|
@@ -38,13 +38,13 @@ export declare type ModalResponsiveProps = ModalDesktopProps & {
|
|
|
38
38
|
*/
|
|
39
39
|
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
40
40
|
};
|
|
41
|
-
export
|
|
42
|
-
export
|
|
41
|
+
export type View = 'desktop' | 'mobile';
|
|
42
|
+
export type TResponsiveModalContext = {
|
|
43
43
|
view: View;
|
|
44
44
|
size: NonNullable<ModalDesktopProps['size']>;
|
|
45
45
|
dataTestId?: string;
|
|
46
46
|
};
|
|
47
|
-
export
|
|
47
|
+
export type ContentProps = {
|
|
48
48
|
/**
|
|
49
49
|
* Контент
|
|
50
50
|
*/
|
package/moderncssm/utils.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ export declare function getModalTestIds(dataTestId: string): {
|
|
|
9
9
|
closer: string;
|
|
10
10
|
backButton: string;
|
|
11
11
|
};
|
|
12
|
-
export declare const getSizeStyle: (size: ModalResponsiveProps[
|
|
12
|
+
export declare const getSizeStyle: (size: ModalResponsiveProps["size"]) => string;
|
package/moderncssm/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { type ModalResponsiveProps } from './typings';\n\nexport function getModalTestIds(dataTestId: string) {\n return {\n modal: dataTestId,\n content: getDataTestId(dataTestId, 'content'),\n footer: getDataTestId(dataTestId, 'footer'),\n controls: getDataTestId(dataTestId, 'controls'),\n header: getDataTestId(dataTestId, 'header'),\n title: getDataTestId(dataTestId, 'header-title'),\n closer: getDataTestId(dataTestId, 'header-closer'),\n backButton: getDataTestId(dataTestId, 'header-back-button'),\n };\n}\n\nexport const getSizeStyle = (size: ModalResponsiveProps['size']) => {\n if (size === 'fullscreen') {\n return size;\n }\n\n return `size-${size}`;\n};\n"],"names":[],"mappings":";;AAIM,SAAU,eAAe,CAAC,UAAkB,EAAA;IAC9C,OAAO;AACH,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,OAAO,EAAE,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC;AAC7C,QAAA,MAAM,EAAE,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;AAC3C,QAAA,QAAQ,EAAE,aAAa,CAAC,UAAU,EAAE,UAAU,CAAC;AAC/C,QAAA,MAAM,EAAE,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;AAC3C,QAAA,KAAK,EAAE,aAAa,CAAC,UAAU,EAAE,cAAc,CAAC;AAChD,QAAA,MAAM,EAAE,aAAa,CAAC,UAAU,EAAE,eAAe,CAAC;AAClD,QAAA,UAAU,EAAE,aAAa,CAAC,UAAU,EAAE,oBAAoB,CAAC;KAC9D;AACL;AAEa,MAAA,YAAY,GAAG,CAAC,IAAkC,KAAI;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { type ModalResponsiveProps } from './typings';\n\nexport function getModalTestIds(dataTestId: string) {\n return {\n modal: dataTestId,\n content: getDataTestId(dataTestId, 'content'),\n footer: getDataTestId(dataTestId, 'footer'),\n controls: getDataTestId(dataTestId, 'controls'),\n header: getDataTestId(dataTestId, 'header'),\n title: getDataTestId(dataTestId, 'header-title'),\n closer: getDataTestId(dataTestId, 'header-closer'),\n backButton: getDataTestId(dataTestId, 'header-back-button'),\n };\n}\n\nexport const getSizeStyle = (size: ModalResponsiveProps['size']) => {\n if (size === 'fullscreen') {\n return size;\n }\n\n return `size-${size}`;\n};\n"],"names":[],"mappings":";;AAIM,SAAU,eAAe,CAAC,UAAkB,EAAA;IAC9C,OAAO;AACH,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,OAAO,EAAE,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC;AAC7C,QAAA,MAAM,EAAE,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;AAC3C,QAAA,QAAQ,EAAE,aAAa,CAAC,UAAU,EAAE,UAAU,CAAC;AAC/C,QAAA,MAAM,EAAE,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;AAC3C,QAAA,KAAK,EAAE,aAAa,CAAC,UAAU,EAAE,cAAc,CAAC;AAChD,QAAA,MAAM,EAAE,aAAa,CAAC,UAAU,EAAE,eAAe,CAAC;AAClD,QAAA,UAAU,EAAE,aAAa,CAAC,UAAU,EAAE,oBAAoB,CAAC;KAC9D;AACL;AAEa,MAAA,YAAY,GAAG,CAAC,IAAkC,KAAI;AAC/D,IAAA,IAAI,IAAI,KAAK,YAAY,EAAE;AACvB,QAAA,OAAO,IAAI;;IAGf,OAAO,CAAA,KAAA,EAAQ,IAAI,CAAA,CAAE;AACzB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-modal",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.5-alfasans",
|
|
4
4
|
"description": "Modal component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"main": "index.js",
|
|
11
11
|
"module": "./esm/index.js",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@alfalab/core-components-base-modal": "
|
|
14
|
-
"@alfalab/core-components-mq": "
|
|
15
|
-
"@alfalab/core-components-navigation-bar-private": "
|
|
16
|
-
"@alfalab/core-components-shared": "
|
|
13
|
+
"@alfalab/core-components-base-modal": "7.1.2-alfasans",
|
|
14
|
+
"@alfalab/core-components-mq": "6.0.3-alfasans",
|
|
15
|
+
"@alfalab/core-components-navigation-bar-private": "2.0.5-alfasans",
|
|
16
|
+
"@alfalab/core-components-shared": "2.1.1-alfasans",
|
|
17
17
|
"classnames": "^2.5.1",
|
|
18
18
|
"react-merge-refs": "^1.1.0",
|
|
19
19
|
"tslib": "^2.4.0"
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
"access": "public",
|
|
27
27
|
"directory": "dist"
|
|
28
28
|
},
|
|
29
|
-
"themesVersion": "15.0.2",
|
|
30
|
-
"varsVersion": "11.0.
|
|
29
|
+
"themesVersion": "15.0.2-alfasans",
|
|
30
|
+
"varsVersion": "11.0.2-alfasans"
|
|
31
31
|
}
|
package/src/vars.css
CHANGED
package/transitions.css
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
.
|
|
2
|
-
.
|
|
1
|
+
.modal__appear_urcoc,
|
|
2
|
+
.modal__enter_urcoc {
|
|
3
3
|
opacity: 0;
|
|
4
4
|
transform: translateY(15px);
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.
|
|
8
|
-
.
|
|
7
|
+
.modal__appearActive_urcoc,
|
|
8
|
+
.modal__enterActive_urcoc {
|
|
9
9
|
opacity: 1;
|
|
10
10
|
transform: translateY(0);
|
|
11
11
|
transition:
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
transform 200ms ease-in;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.
|
|
16
|
+
.modal__exit_urcoc {
|
|
17
17
|
opacity: 1;
|
|
18
18
|
transform: translateY(0);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.
|
|
22
|
-
.
|
|
21
|
+
.modal__exitActive_urcoc,
|
|
22
|
+
.modal__exitDone_urcoc {
|
|
23
23
|
opacity: 0;
|
|
24
24
|
transform: translateY(15px);
|
|
25
25
|
transition:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./transitions.css');
|
|
4
4
|
|
|
5
|
-
var transitions = {"appear":"
|
|
5
|
+
var transitions = {"appear":"modal__appear_urcoc","enter":"modal__enter_urcoc","appearActive":"modal__appearActive_urcoc","enterActive":"modal__enterActive_urcoc","exit":"modal__exit_urcoc","exitActive":"modal__exitActive_urcoc","exitDone":"modal__exitDone_urcoc"};
|
|
6
6
|
|
|
7
7
|
module.exports = transitions;
|
|
8
8
|
//# sourceMappingURL=transitions.module.css.js.map
|
package/typings.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type BaseModalProps } from '@alfalab/core-components-base-modal';
|
|
3
|
-
export
|
|
3
|
+
export type ModalDesktopProps = BaseModalProps & {
|
|
4
4
|
/**
|
|
5
5
|
* Ширина модального окна
|
|
6
6
|
* @default 600
|
|
@@ -21,8 +21,8 @@ export declare type ModalDesktopProps = BaseModalProps & {
|
|
|
21
21
|
*/
|
|
22
22
|
iOSLock?: boolean;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
25
|
-
export
|
|
24
|
+
export type ModalMobileProps = Omit<ModalDesktopProps, 'size' | 'fixedPosition'>;
|
|
25
|
+
export type ModalResponsiveProps = ModalDesktopProps & {
|
|
26
26
|
/**
|
|
27
27
|
* Контрольная точка, с нее начинается desktop версия
|
|
28
28
|
* @default 1024
|
|
@@ -38,13 +38,13 @@ export declare type ModalResponsiveProps = ModalDesktopProps & {
|
|
|
38
38
|
*/
|
|
39
39
|
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
40
40
|
};
|
|
41
|
-
export
|
|
42
|
-
export
|
|
41
|
+
export type View = 'desktop' | 'mobile';
|
|
42
|
+
export type TResponsiveModalContext = {
|
|
43
43
|
view: View;
|
|
44
44
|
size: NonNullable<ModalDesktopProps['size']>;
|
|
45
45
|
dataTestId?: string;
|
|
46
46
|
};
|
|
47
|
-
export
|
|
47
|
+
export type ContentProps = {
|
|
48
48
|
/**
|
|
49
49
|
* Контент
|
|
50
50
|
*/
|
package/utils.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ export declare function getModalTestIds(dataTestId: string): {
|
|
|
9
9
|
closer: string;
|
|
10
10
|
backButton: string;
|
|
11
11
|
};
|
|
12
|
-
export declare const getSizeStyle: (size: ModalResponsiveProps[
|
|
12
|
+
export declare const getSizeStyle: (size: ModalResponsiveProps["size"]) => string;
|
package/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["src/utils.ts"],"sourcesContent":["import { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { type ModalResponsiveProps } from './typings';\n\nexport function getModalTestIds(dataTestId: string) {\n return {\n modal: dataTestId,\n content: getDataTestId(dataTestId, 'content'),\n footer: getDataTestId(dataTestId, 'footer'),\n controls: getDataTestId(dataTestId, 'controls'),\n header: getDataTestId(dataTestId, 'header'),\n title: getDataTestId(dataTestId, 'header-title'),\n closer: getDataTestId(dataTestId, 'header-closer'),\n backButton: getDataTestId(dataTestId, 'header-back-button'),\n };\n}\n\nexport const getSizeStyle = (size: ModalResponsiveProps['size']) => {\n if (size === 'fullscreen') {\n return size;\n }\n\n return `size-${size}`;\n};\n"],"names":["getDataTestId"],"mappings":";;;;;;AAIM,SAAU,eAAe,CAAC,UAAkB,EAAA;IAC9C,OAAO;AACH,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,OAAO,EAAEA,kCAAa,CAAC,UAAU,EAAE,SAAS,CAAC;AAC7C,QAAA,MAAM,EAAEA,kCAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;AAC3C,QAAA,QAAQ,EAAEA,kCAAa,CAAC,UAAU,EAAE,UAAU,CAAC;AAC/C,QAAA,MAAM,EAAEA,kCAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;AAC3C,QAAA,KAAK,EAAEA,kCAAa,CAAC,UAAU,EAAE,cAAc,CAAC;AAChD,QAAA,MAAM,EAAEA,kCAAa,CAAC,UAAU,EAAE,eAAe,CAAC;AAClD,QAAA,UAAU,EAAEA,kCAAa,CAAC,UAAU,EAAE,oBAAoB,CAAC;KAC9D;AACL;AAEO,IAAM,YAAY,GAAG,UAAC,IAAkC,EAAA;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["src/utils.ts"],"sourcesContent":["import { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { type ModalResponsiveProps } from './typings';\n\nexport function getModalTestIds(dataTestId: string) {\n return {\n modal: dataTestId,\n content: getDataTestId(dataTestId, 'content'),\n footer: getDataTestId(dataTestId, 'footer'),\n controls: getDataTestId(dataTestId, 'controls'),\n header: getDataTestId(dataTestId, 'header'),\n title: getDataTestId(dataTestId, 'header-title'),\n closer: getDataTestId(dataTestId, 'header-closer'),\n backButton: getDataTestId(dataTestId, 'header-back-button'),\n };\n}\n\nexport const getSizeStyle = (size: ModalResponsiveProps['size']) => {\n if (size === 'fullscreen') {\n return size;\n }\n\n return `size-${size}`;\n};\n"],"names":["getDataTestId"],"mappings":";;;;;;AAIM,SAAU,eAAe,CAAC,UAAkB,EAAA;IAC9C,OAAO;AACH,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,OAAO,EAAEA,kCAAa,CAAC,UAAU,EAAE,SAAS,CAAC;AAC7C,QAAA,MAAM,EAAEA,kCAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;AAC3C,QAAA,QAAQ,EAAEA,kCAAa,CAAC,UAAU,EAAE,UAAU,CAAC;AAC/C,QAAA,MAAM,EAAEA,kCAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;AAC3C,QAAA,KAAK,EAAEA,kCAAa,CAAC,UAAU,EAAE,cAAc,CAAC;AAChD,QAAA,MAAM,EAAEA,kCAAa,CAAC,UAAU,EAAE,eAAe,CAAC;AAClD,QAAA,UAAU,EAAEA,kCAAa,CAAC,UAAU,EAAE,oBAAoB,CAAC;KAC9D;AACL;AAEO,IAAM,YAAY,GAAG,UAAC,IAAkC,EAAA;AAC3D,IAAA,IAAI,IAAI,KAAK,YAAY,EAAE;AACvB,QAAA,OAAO,IAAI;;IAGf,OAAO,OAAA,CAAA,MAAA,CAAQ,IAAI,CAAE;AACzB;;;;;"}
|