@alfalab/core-components-side-panel 4.1.3 → 5.0.1
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 +1 -0
- package/Component.responsive.js +6 -3
- package/components/content/Component.desktop.js +3 -1
- package/components/content/Component.js +5 -2
- package/components/content/Component.mobile.js +3 -1
- package/components/content/desktop.css +3 -3
- package/components/content/index.css +4 -4
- package/components/content/mobile.css +3 -3
- package/components/controls/Component.d.ts +29 -0
- package/components/controls/Component.js +32 -0
- package/components/controls/index.css +4 -0
- package/components/controls/index.d.ts +1 -0
- package/components/controls/index.js +14 -0
- package/components/footer/Component.desktop.js +4 -1
- package/components/footer/Component.js +7 -6
- package/components/footer/Component.mobile.js +5 -2
- package/components/footer/desktop.css +3 -3
- package/components/footer/index.css +9 -9
- package/components/footer/layout.css +17 -27
- package/components/footer/mobile.css +4 -13
- package/components/header/Component.js +6 -5
- package/components/header/desktop.css +5 -5
- package/components/header/index.css +19 -19
- package/components/header/mobile.css +4 -4
- package/cssm/Component.responsive.d.ts +1 -0
- package/cssm/Component.responsive.js +7 -4
- package/cssm/components/content/Component.desktop.js +2 -0
- package/cssm/components/content/Component.js +4 -1
- package/cssm/components/content/Component.mobile.js +2 -0
- package/cssm/components/controls/Component.d.ts +29 -0
- package/cssm/components/controls/Component.js +32 -0
- package/cssm/components/controls/index.d.ts +1 -0
- package/cssm/components/controls/index.js +15 -0
- package/cssm/components/controls/index.module.css +3 -0
- package/cssm/components/footer/Component.desktop.js +2 -0
- package/cssm/components/footer/Component.js +4 -1
- package/cssm/components/footer/Component.mobile.js +3 -1
- package/cssm/components/footer/index.module.css +5 -5
- package/cssm/components/footer/layout.module.css +8 -18
- package/cssm/components/footer/mobile.module.css +1 -10
- package/cssm/components/header/Component.js +3 -2
- package/cssm/components/header/index.module.css +5 -5
- package/cssm/desktop/Component.desktop.d.ts +4 -1
- package/cssm/desktop/Component.desktop.js +8 -4
- package/cssm/desktop/index.js +5 -2
- package/cssm/index.js +5 -3
- package/cssm/mobile/Component.mobile.d.ts +2 -0
- package/cssm/mobile/Component.mobile.js +8 -4
- package/cssm/mobile/index.js +5 -2
- package/cssm/typings.d.ts +1 -0
- package/desktop/Component.desktop.d.ts +4 -1
- package/desktop/Component.desktop.js +9 -5
- package/desktop/desktop.css +3 -3
- package/desktop/index.js +4 -1
- package/desktop/transitions.desktop.css +7 -7
- package/esm/Component.responsive.d.ts +1 -0
- package/esm/Component.responsive.js +6 -3
- package/esm/components/content/Component.desktop.js +3 -1
- package/esm/components/content/Component.js +5 -2
- package/esm/components/content/Component.mobile.js +3 -1
- package/esm/components/content/desktop.css +3 -3
- package/esm/components/content/index.css +4 -4
- package/esm/components/content/mobile.css +3 -3
- package/esm/components/controls/Component.d.ts +29 -0
- package/esm/components/controls/Component.js +23 -0
- package/esm/components/controls/index.css +4 -0
- package/esm/components/controls/index.d.ts +1 -0
- package/esm/components/controls/index.js +6 -0
- package/esm/components/footer/Component.desktop.js +4 -1
- package/esm/components/footer/Component.js +6 -5
- package/esm/components/footer/Component.mobile.js +5 -2
- package/esm/components/footer/desktop.css +3 -3
- package/esm/components/footer/index.css +9 -9
- package/esm/components/footer/layout.css +17 -27
- package/esm/components/footer/mobile.css +4 -13
- package/esm/components/header/Component.js +6 -5
- package/esm/components/header/desktop.css +5 -5
- package/esm/components/header/index.css +19 -19
- package/esm/components/header/mobile.css +4 -4
- package/esm/desktop/Component.desktop.d.ts +4 -1
- package/esm/desktop/Component.desktop.js +9 -5
- package/esm/desktop/desktop.css +3 -3
- package/esm/desktop/index.js +4 -1
- package/esm/desktop/transitions.desktop.css +7 -7
- package/esm/index.js +4 -2
- package/esm/layout.module-31951bef.js +4 -0
- package/esm/mobile/Component.mobile.d.ts +2 -0
- package/esm/mobile/Component.mobile.js +10 -6
- package/esm/mobile/index.js +4 -1
- package/esm/mobile/mobile.css +4 -4
- package/esm/mobile/transitions.mobile.css +8 -8
- package/esm/typings.d.ts +1 -0
- package/index.js +4 -2
- package/layout.module-2f71de49.js +6 -0
- package/mobile/Component.mobile.d.ts +2 -0
- package/mobile/Component.mobile.js +9 -5
- package/mobile/index.js +4 -1
- package/mobile/mobile.css +4 -4
- package/mobile/transitions.mobile.css +8 -8
- package/modern/Component.responsive.d.ts +1 -0
- package/modern/Component.responsive.js +6 -3
- package/modern/components/content/Component.desktop.js +3 -1
- package/modern/components/content/Component.js +5 -2
- package/modern/components/content/Component.mobile.js +3 -1
- package/modern/components/content/desktop.css +3 -3
- package/modern/components/content/index.css +4 -4
- package/modern/components/content/mobile.css +3 -3
- package/modern/components/controls/Component.d.ts +29 -0
- package/modern/components/controls/Component.js +22 -0
- package/modern/components/controls/index.css +4 -0
- package/modern/components/controls/index.d.ts +1 -0
- package/modern/components/controls/index.js +6 -0
- package/modern/components/footer/Component.desktop.js +4 -1
- package/modern/components/footer/Component.js +6 -5
- package/modern/components/footer/Component.mobile.js +5 -2
- package/modern/components/footer/desktop.css +3 -3
- package/modern/components/footer/index.css +9 -9
- package/modern/components/footer/layout.css +17 -27
- package/modern/components/footer/mobile.css +4 -13
- package/modern/components/header/Component.js +6 -5
- package/modern/components/header/desktop.css +5 -5
- package/modern/components/header/index.css +19 -19
- package/modern/components/header/mobile.css +4 -4
- package/modern/desktop/Component.desktop.d.ts +4 -1
- package/modern/desktop/Component.desktop.js +10 -6
- package/modern/desktop/desktop.css +3 -3
- package/modern/desktop/index.js +4 -1
- package/modern/desktop/transitions.desktop.css +7 -7
- package/modern/index.js +4 -2
- package/modern/layout.module-a8ffdbd1.js +4 -0
- package/modern/mobile/Component.mobile.d.ts +2 -0
- package/modern/mobile/Component.mobile.js +10 -6
- package/modern/mobile/index.js +4 -1
- package/modern/mobile/mobile.css +4 -4
- package/modern/mobile/transitions.mobile.css +8 -8
- package/modern/typings.d.ts +1 -0
- package/package.json +5 -5
- package/src/Component.responsive.tsx +18 -3
- package/src/components/content/Component.tsx +5 -1
- package/src/components/controls/Component.tsx +76 -0
- package/src/components/controls/index.module.css +3 -0
- package/src/components/controls/index.ts +1 -0
- package/src/components/footer/Component.mobile.tsx +1 -1
- package/src/components/footer/Component.tsx +5 -1
- package/src/components/footer/layout.module.css +8 -18
- package/src/components/footer/mobile.module.css +0 -16
- package/src/components/header/Component.tsx +3 -1
- package/src/desktop/Component.desktop.tsx +8 -4
- package/src/mobile/Component.mobile.tsx +10 -4
- package/src/typings.ts +1 -0
- package/src/vars.css +6 -6
- package/typings.d.ts +1 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/* hash:
|
|
2
|
-
.side-
|
|
3
|
-
.side-
|
|
1
|
+
/* hash: ntku8 */
|
|
2
|
+
.side-panel__appear_1lrki,
|
|
3
|
+
.side-panel__enter_1lrki {
|
|
4
4
|
opacity: 0;
|
|
5
5
|
transform: translateY(15px);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
.side-
|
|
9
|
-
.side-
|
|
8
|
+
.side-panel__appearActive_1lrki,
|
|
9
|
+
.side-panel__enterActive_1lrki {
|
|
10
10
|
opacity: 1;
|
|
11
11
|
transform: translateY(0);
|
|
12
12
|
transition: opacity 200ms ease-in, transform 200ms ease-in;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.side-
|
|
15
|
+
.side-panel__exit_1lrki {
|
|
16
16
|
opacity: 1;
|
|
17
17
|
transform: translateY(0);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.side-
|
|
21
|
-
.side-
|
|
20
|
+
.side-panel__exitActive_1lrki,
|
|
21
|
+
.side-panel__exitDone_1lrki {
|
|
22
22
|
opacity: 0;
|
|
23
23
|
transform: translateY(15px);
|
|
24
24
|
transition: opacity 200ms ease-out, transform 200ms ease-out;
|
package/esm/typings.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -7,12 +7,14 @@ require('tslib');
|
|
|
7
7
|
require('react');
|
|
8
8
|
require('@alfalab/core-components-mq');
|
|
9
9
|
require('@alfalab/core-components-shared');
|
|
10
|
-
require('./components/
|
|
10
|
+
require('./components/controls/Component.js');
|
|
11
11
|
require('classnames');
|
|
12
|
+
require('./ResponsiveContext.js');
|
|
13
|
+
require('./layout.module-2f71de49.js');
|
|
14
|
+
require('./components/header/Component.js');
|
|
12
15
|
require('@alfalab/core-components-navigation-bar');
|
|
13
16
|
require('./Context.js');
|
|
14
17
|
require('@alfalab/core-components-base-modal');
|
|
15
|
-
require('./ResponsiveContext.js');
|
|
16
18
|
require('./desktop/Component.desktop.js');
|
|
17
19
|
require('react-merge-refs');
|
|
18
20
|
require('@alfalab/core-components-drawer');
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var layoutStyles = {"column":"side-panel__column_16gdu","gap-16":"side-panel__gap-16_16gdu","gap-24":"side-panel__gap-24_16gdu","gap-32":"side-panel__gap-32_16gdu","start":"side-panel__start_16gdu","center":"side-panel__center_16gdu","space-between":"side-panel__space-between_16gdu"};
|
|
4
|
+
require('./components/footer/layout.css')
|
|
5
|
+
|
|
6
|
+
exports.layoutStyles = layoutStyles;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { BaseModalProps } from "@alfalab/core-components-base-modal";
|
|
4
|
+
import { ControlsProps } from "../components/controls/index";
|
|
4
5
|
type SidePanelMobileProps = BaseModalProps & {
|
|
5
6
|
/**
|
|
6
7
|
* Управление наличием закрывающего крестика
|
|
@@ -18,5 +19,6 @@ declare const SidePanelMobile: React.ForwardRefExoticComponent<BaseModalProps &
|
|
|
18
19
|
Content: React.FC<import("../components/content/Component").ContentProps>;
|
|
19
20
|
Header: React.FC<import("../components/header/Component").HeaderProps>;
|
|
20
21
|
Footer: React.FC<import("../components/footer/Component").FooterProps>;
|
|
22
|
+
Controls: React.FC<Omit<ControlsProps, "mobileLayout">>;
|
|
21
23
|
};
|
|
22
24
|
export { SidePanelMobileProps, SidePanelMobile };
|
|
@@ -7,11 +7,14 @@ var React = require('react');
|
|
|
7
7
|
var cn = require('classnames');
|
|
8
8
|
var coreComponentsBaseModal = require('@alfalab/core-components-base-modal');
|
|
9
9
|
var components_content_Component_mobile = require('../components/content/Component.mobile.js');
|
|
10
|
+
var components_controls_Component = require('../components/controls/Component.js');
|
|
10
11
|
var components_footer_Component_mobile = require('../components/footer/Component.mobile.js');
|
|
11
12
|
var components_header_Component = require('../components/header/Component.js');
|
|
12
13
|
var ResponsiveContext = require('../ResponsiveContext.js');
|
|
13
14
|
require('../components/content/Component.js');
|
|
15
|
+
require('@alfalab/core-components-shared');
|
|
14
16
|
require('../Context.js');
|
|
17
|
+
require('../layout.module-2f71de49.js');
|
|
15
18
|
require('../components/footer/Component.js');
|
|
16
19
|
require('@alfalab/core-components-navigation-bar');
|
|
17
20
|
|
|
@@ -20,17 +23,17 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
20
23
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
21
24
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
22
25
|
|
|
23
|
-
var styles = {"component":"side-
|
|
26
|
+
var styles = {"component":"side-panel__component_1050h","mobileContent":"side-panel__mobileContent_1050h"};
|
|
24
27
|
require('./mobile.css')
|
|
25
28
|
|
|
26
|
-
var transitions = {"appear":"side-
|
|
29
|
+
var transitions = {"appear":"side-panel__appear_1lrki","enter":"side-panel__enter_1lrki","appearActive":"side-panel__appearActive_1lrki","enterActive":"side-panel__enterActive_1lrki","exit":"side-panel__exit_1lrki","exitActive":"side-panel__exitActive_1lrki","exitDone":"side-panel__exitDone_1lrki"};
|
|
27
30
|
require('./transitions.mobile.css')
|
|
28
31
|
|
|
29
|
-
var contextValue = { size: 's', view: 'mobile' };
|
|
30
32
|
var SidePanelMobileComponent = React.forwardRef(function (_a, ref) {
|
|
31
|
-
var children = _a.children, className = _a.className, transitionProps = _a.transitionProps, restProps = tslib.__rest(_a, ["children", "className", "transitionProps"]);
|
|
33
|
+
var children = _a.children, className = _a.className, transitionProps = _a.transitionProps, dataTestId = _a.dataTestId, restProps = tslib.__rest(_a, ["children", "className", "transitionProps", "dataTestId"]);
|
|
32
34
|
var responsiveContext = React.useContext(ResponsiveContext.ResponsiveContext);
|
|
33
|
-
var
|
|
35
|
+
var contextValue = React.useMemo(function () { return ({ size: 's', view: 'mobile', dataTestId: dataTestId }); }, [dataTestId]);
|
|
36
|
+
var renderContent = function () { return (React__default.default.createElement(coreComponentsBaseModal.BaseModal, tslib.__assign({}, restProps, { dataTestId: dataTestId, ref: ref, transitionProps: tslib.__assign({ classNames: transitions }, transitionProps), className: cn__default.default(className, styles.component), scrollHandler: 'content' }),
|
|
34
37
|
React__default.default.createElement("div", { className: styles.mobileContent }, children))); };
|
|
35
38
|
var renderWithContext = function () { return (React__default.default.createElement(ResponsiveContext.ResponsiveContext.Provider, { value: contextValue }, renderContent())); };
|
|
36
39
|
return responsiveContext ? renderContent() : renderWithContext();
|
|
@@ -39,6 +42,7 @@ var SidePanelMobile = Object.assign(SidePanelMobileComponent, {
|
|
|
39
42
|
Content: components_content_Component_mobile.ContentMobile,
|
|
40
43
|
Header: components_header_Component.Header,
|
|
41
44
|
Footer: components_footer_Component_mobile.FooterMobile,
|
|
45
|
+
Controls: components_controls_Component.Controls,
|
|
42
46
|
});
|
|
43
47
|
|
|
44
48
|
exports.SidePanelMobile = SidePanelMobile;
|
package/mobile/index.js
CHANGED
|
@@ -9,12 +9,15 @@ require('classnames');
|
|
|
9
9
|
require('@alfalab/core-components-base-modal');
|
|
10
10
|
require('../components/content/Component.mobile.js');
|
|
11
11
|
require('../components/content/Component.js');
|
|
12
|
+
require('@alfalab/core-components-shared');
|
|
12
13
|
require('../Context.js');
|
|
14
|
+
require('../ResponsiveContext.js');
|
|
15
|
+
require('../components/controls/Component.js');
|
|
16
|
+
require('../layout.module-2f71de49.js');
|
|
13
17
|
require('../components/footer/Component.mobile.js');
|
|
14
18
|
require('../components/footer/Component.js');
|
|
15
19
|
require('../components/header/Component.js');
|
|
16
20
|
require('@alfalab/core-components-navigation-bar');
|
|
17
|
-
require('../ResponsiveContext.js');
|
|
18
21
|
|
|
19
22
|
|
|
20
23
|
|
package/mobile/mobile.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: uxsui */
|
|
2
2
|
:root {
|
|
3
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 */
|
|
4
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 */
|
|
@@ -27,17 +27,17 @@
|
|
|
27
27
|
/* mobile */
|
|
28
28
|
|
|
29
29
|
/* paddings */
|
|
30
|
-
} .side-
|
|
30
|
+
} .side-panel__component_1050h {
|
|
31
31
|
top: 0;
|
|
32
32
|
height: 100%;
|
|
33
33
|
width: 100%;
|
|
34
34
|
overflow-x: hidden;
|
|
35
35
|
overflow-y: auto;
|
|
36
36
|
max-width: 600px;
|
|
37
|
-
} .side-
|
|
37
|
+
} .side-panel__component_1050h.side-panel__component_1050h {
|
|
38
38
|
position: fixed;
|
|
39
39
|
flex: 1;
|
|
40
|
-
} .side-
|
|
40
|
+
} .side-panel__mobileContent_1050h {
|
|
41
41
|
display: flex;
|
|
42
42
|
flex-direction: column;
|
|
43
43
|
width: 100%;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/* hash:
|
|
2
|
-
.side-
|
|
3
|
-
.side-
|
|
1
|
+
/* hash: ntku8 */
|
|
2
|
+
.side-panel__appear_1lrki,
|
|
3
|
+
.side-panel__enter_1lrki {
|
|
4
4
|
opacity: 0;
|
|
5
5
|
transform: translateY(15px);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
.side-
|
|
9
|
-
.side-
|
|
8
|
+
.side-panel__appearActive_1lrki,
|
|
9
|
+
.side-panel__enterActive_1lrki {
|
|
10
10
|
opacity: 1;
|
|
11
11
|
transform: translateY(0);
|
|
12
12
|
transition: opacity 200ms ease-in, transform 200ms ease-in;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.side-
|
|
15
|
+
.side-panel__exit_1lrki {
|
|
16
16
|
opacity: 1;
|
|
17
17
|
transform: translateY(0);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.side-
|
|
21
|
-
.side-
|
|
20
|
+
.side-panel__exitActive_1lrki,
|
|
21
|
+
.side-panel__exitDone_1lrki {
|
|
22
22
|
opacity: 0;
|
|
23
23
|
transform: translateY(15px);
|
|
24
24
|
transition: opacity 200ms ease-out, transform 200ms ease-out;
|
|
@@ -45,6 +45,7 @@ declare const SidePanelResponsive: React.ForwardRefExoticComponent<BaseModalProp
|
|
|
45
45
|
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
46
46
|
} & React.RefAttributes<HTMLDivElement>> & {
|
|
47
47
|
Header: React.FC<import("./components/header/Component").HeaderProps>;
|
|
48
|
+
Controls: React.FC<import("./components/controls/index").ControlsProps>;
|
|
48
49
|
Content: React.FC<import("./components/content/Component").ContentProps> | React.FC<import("./components/content/Component.desktop").ContentDesktopProps>;
|
|
49
50
|
Footer: React.FC<import("./components/footer/Component").FooterProps> | React.FC<import("./components/footer/Component.desktop").FooterDesktopProps>;
|
|
50
51
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { forwardRef, useMemo, useContext } from 'react';
|
|
2
2
|
import { useMatchMedia } from '@alfalab/core-components-mq/modern';
|
|
3
3
|
import { isClient } from '@alfalab/core-components-shared/modern';
|
|
4
|
+
import { Controls } from './components/controls/Component.js';
|
|
4
5
|
import { Header } from './components/header/Component.js';
|
|
5
6
|
import { SidePanelDesktop } from './desktop/Component.desktop.js';
|
|
6
7
|
import { SidePanelMobile } from './mobile/Component.mobile.js';
|
|
7
8
|
import { ResponsiveContext } from './ResponsiveContext.js';
|
|
8
9
|
import 'classnames';
|
|
10
|
+
import './layout.module-a8ffdbd1.js';
|
|
9
11
|
import '@alfalab/core-components-navigation-bar/modern';
|
|
10
12
|
import './Context.js';
|
|
11
13
|
import '@alfalab/core-components-base-modal/modern';
|
|
@@ -27,18 +29,19 @@ function createResponsive(desktop, mobile) {
|
|
|
27
29
|
}
|
|
28
30
|
return ResponsiveChild;
|
|
29
31
|
}
|
|
30
|
-
const SidePanelResponsiveComponent = forwardRef(({ children, breakpoint = 1024, size = 's', defaultMatchMediaValue, ...restProps }, ref) => {
|
|
32
|
+
const SidePanelResponsiveComponent = forwardRef(({ children, breakpoint = 1024, size = 's', defaultMatchMediaValue, dataTestId, ...restProps }, ref) => {
|
|
31
33
|
const query = `(min-width: ${breakpoint}px)`;
|
|
32
34
|
const getDefaultValue = () => (isClient() ? window.matchMedia(query).matches : false);
|
|
33
35
|
const [isDesktop] = useMatchMedia(query, defaultMatchMediaValue ?? getDefaultValue);
|
|
34
36
|
const view = isDesktop ? 'desktop' : 'mobile';
|
|
35
|
-
const contextValue = useMemo(() => ({ view, size }), [view, size]);
|
|
37
|
+
const contextValue = useMemo(() => ({ view, size, dataTestId }), [view, size, dataTestId]);
|
|
36
38
|
const Component = isDesktop ? SidePanelDesktop : SidePanelMobile;
|
|
37
39
|
return (React.createElement(ResponsiveContext.Provider, { value: contextValue },
|
|
38
|
-
React.createElement(Component, { ref: ref, size: size, ...restProps }, children)));
|
|
40
|
+
React.createElement(Component, { ref: ref, size: size, dataTestId: dataTestId, ...restProps }, children)));
|
|
39
41
|
});
|
|
40
42
|
const SidePanelResponsive = Object.assign(SidePanelResponsiveComponent, {
|
|
41
43
|
Header,
|
|
44
|
+
Controls,
|
|
42
45
|
Content: createResponsive(SidePanelDesktop.Content, SidePanelMobile.Content),
|
|
43
46
|
Footer: createResponsive(SidePanelDesktop.Footer, SidePanelMobile.Footer),
|
|
44
47
|
});
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Content } from './Component.js';
|
|
4
|
+
import '@alfalab/core-components-shared/modern';
|
|
4
5
|
import '../../Context.js';
|
|
5
6
|
import '@alfalab/core-components-base-modal/modern';
|
|
7
|
+
import '../../ResponsiveContext.js';
|
|
6
8
|
|
|
7
|
-
const styles = {"s":"side-
|
|
9
|
+
const styles = {"s":"side-panel__s_39vrx"};
|
|
8
10
|
require('./desktop.css')
|
|
9
11
|
|
|
10
12
|
const ContentDesktop = ({ size = 's', className, ...restProps }) => React.createElement(Content, { className: cn(className, size && styles[size]), ...restProps });
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
+
import { getDataTestId } from '@alfalab/core-components-shared/modern';
|
|
3
4
|
import { ModalContext } from '../../Context.js';
|
|
5
|
+
import { ResponsiveContext } from '../../ResponsiveContext.js';
|
|
4
6
|
import '@alfalab/core-components-base-modal/modern';
|
|
5
7
|
|
|
6
|
-
const styles = {"content":"side-
|
|
8
|
+
const styles = {"content":"side-panel__content_1vagu","withHeader":"side-panel__withHeader_1vagu","flex":"side-panel__flex_1vagu"};
|
|
7
9
|
require('./index.css')
|
|
8
10
|
|
|
9
11
|
const Content = ({ children, className, dataTestId }) => {
|
|
10
12
|
const { contentRef, hasHeader } = useContext(ModalContext);
|
|
13
|
+
const responsiveContext = useContext(ResponsiveContext);
|
|
11
14
|
return (React.createElement("div", { className: cn(styles.content, className, styles.flex, {
|
|
12
15
|
[styles.withHeader]: hasHeader,
|
|
13
|
-
}), ref: contentRef, "data-test-id": dataTestId }, children));
|
|
16
|
+
}), ref: contentRef, "data-test-id": dataTestId || getDataTestId(responsiveContext?.dataTestId, 'content') }, children));
|
|
14
17
|
};
|
|
15
18
|
|
|
16
19
|
export { Content };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Content } from './Component.js';
|
|
4
|
+
import '@alfalab/core-components-shared/modern';
|
|
4
5
|
import '../../Context.js';
|
|
5
6
|
import '@alfalab/core-components-base-modal/modern';
|
|
7
|
+
import '../../ResponsiveContext.js';
|
|
6
8
|
|
|
7
|
-
const styles = {"content":"side-
|
|
9
|
+
const styles = {"content":"side-panel__content_1hc2n"};
|
|
8
10
|
require('./mobile.css')
|
|
9
11
|
|
|
10
12
|
const ContentMobile = ({ className, ...restProps }) => (React.createElement(Content, { className: cn(className, styles.content), ...restProps }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1dure */
|
|
2
2
|
:root {
|
|
3
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 */
|
|
4
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 */
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
/* mobile */
|
|
31
31
|
|
|
32
32
|
/* paddings */
|
|
33
|
-
} .side-
|
|
33
|
+
} .side-panel__s_39vrx {
|
|
34
34
|
padding: var(--side-panel-s-content-paddings)
|
|
35
|
-
} .side-
|
|
35
|
+
} .side-panel__s_39vrx:last-child {
|
|
36
36
|
padding-bottom: var(--gap-2xl);
|
|
37
37
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: nio5e */
|
|
2
2
|
:root {
|
|
3
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 */
|
|
4
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 */
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
/* mobile */
|
|
28
28
|
|
|
29
29
|
/* paddings */
|
|
30
|
-
} .side-
|
|
30
|
+
} .side-panel__content_1vagu {
|
|
31
31
|
position: relative;
|
|
32
32
|
box-sizing: border-box;
|
|
33
33
|
width: 100%;
|
|
34
34
|
z-index: 0
|
|
35
|
-
} .side-
|
|
35
|
+
} .side-panel__content_1vagu.side-panel__withHeader_1vagu {
|
|
36
36
|
padding-top: 0;
|
|
37
|
-
} .side-
|
|
37
|
+
} .side-panel__flex_1vagu {
|
|
38
38
|
flex: 1 1 auto;
|
|
39
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1bbeb */
|
|
2
2
|
:root {
|
|
3
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 */
|
|
4
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 */
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
/* mobile */
|
|
29
29
|
|
|
30
30
|
/* paddings */
|
|
31
|
-
} .side-
|
|
31
|
+
} .side-panel__content_1hc2n {
|
|
32
32
|
padding: var(--gap-m) var(--gap-m) 0
|
|
33
|
-
} .side-
|
|
33
|
+
} .side-panel__content_1hc2n:last-child {
|
|
34
34
|
padding-bottom: var(--gap-m);
|
|
35
35
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
interface ControlsProps {
|
|
5
|
+
/**
|
|
6
|
+
* Основной слот
|
|
7
|
+
*/
|
|
8
|
+
primary?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Дополнительный слот
|
|
11
|
+
*/
|
|
12
|
+
secondary?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Выравнивание элементов футера
|
|
15
|
+
* @default start
|
|
16
|
+
*/
|
|
17
|
+
layout?: 'start' | 'center' | 'space-between' | 'column';
|
|
18
|
+
/**
|
|
19
|
+
* Выравнивание элементов футера (мобильный view)
|
|
20
|
+
* @default start
|
|
21
|
+
*/
|
|
22
|
+
mobileLayout?: 'start' | 'center' | 'space-between' | 'column';
|
|
23
|
+
/**
|
|
24
|
+
* Отступы между элементами футера
|
|
25
|
+
*/
|
|
26
|
+
gap?: 16 | 24 | 32;
|
|
27
|
+
}
|
|
28
|
+
declare const Controls: React.FC<ControlsProps>;
|
|
29
|
+
export { ControlsProps, Controls };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { getDataTestId } from '@alfalab/core-components-shared/modern';
|
|
4
|
+
import { ResponsiveContext } from '../../ResponsiveContext.js';
|
|
5
|
+
import { l as layoutStyles } from '../../layout.module-a8ffdbd1.js';
|
|
6
|
+
|
|
7
|
+
const styles = {"component":"side-panel__component_scwve"};
|
|
8
|
+
require('./index.css')
|
|
9
|
+
|
|
10
|
+
const Controls = ({ primary, secondary, gap = 16, layout: layoutProp = 'start', mobileLayout = layoutProp, }) => {
|
|
11
|
+
const context = useContext(ResponsiveContext);
|
|
12
|
+
const { view = 'desktop', dataTestId } = context || {};
|
|
13
|
+
const layout = view === 'mobile' ? mobileLayout : layoutProp;
|
|
14
|
+
const shouldReverse = view === 'mobile' && layout !== 'column';
|
|
15
|
+
return (React.createElement("div", { "data-test-id": getDataTestId(dataTestId, 'controls'), className: cn(styles.component, layoutStyles[layout], gap && layoutStyles[`gap-${gap}`]) }, shouldReverse ? (React.createElement(React.Fragment, null,
|
|
16
|
+
secondary,
|
|
17
|
+
primary)) : (React.createElement(React.Fragment, null,
|
|
18
|
+
primary,
|
|
19
|
+
secondary))));
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { Controls };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Footer } from './Component.js';
|
|
4
|
+
import '@alfalab/core-components-shared/modern';
|
|
4
5
|
import '../../Context.js';
|
|
5
6
|
import '@alfalab/core-components-base-modal/modern';
|
|
7
|
+
import '../../ResponsiveContext.js';
|
|
8
|
+
import '../../layout.module-a8ffdbd1.js';
|
|
6
9
|
|
|
7
|
-
const styles = {"sticky":"side-
|
|
10
|
+
const styles = {"sticky":"side-panel__sticky_62kfr","s":"side-panel__s_62kfr"};
|
|
8
11
|
require('./desktop.css')
|
|
9
12
|
|
|
10
13
|
const FooterDesktop = ({ size = 's', className, sticky, ...restProps }) => (React.createElement(Footer, { className: cn(className, size && styles[size], {
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import React, { useContext, useEffect } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
+
import { getDataTestId } from '@alfalab/core-components-shared/modern';
|
|
3
4
|
import { ModalContext } from '../../Context.js';
|
|
5
|
+
import { ResponsiveContext } from '../../ResponsiveContext.js';
|
|
6
|
+
import { l as layoutStyles } from '../../layout.module-a8ffdbd1.js';
|
|
4
7
|
import '@alfalab/core-components-base-modal/modern';
|
|
5
8
|
|
|
6
|
-
const styles = {"footer":"side-
|
|
9
|
+
const styles = {"footer":"side-panel__footer_3jdk9","sticky":"side-panel__sticky_3jdk9","highlighted":"side-panel__highlighted_3jdk9"};
|
|
7
10
|
require('./index.css')
|
|
8
11
|
|
|
9
|
-
const layoutStyles = {"column":"side-panel__column_d8m7q","gap-16":"side-panel__gap-16_d8m7q","gap-24":"side-panel__gap-24_d8m7q","gap-32":"side-panel__gap-32_d8m7q","start":"side-panel__start_d8m7q","center":"side-panel__center_d8m7q","space-between":"side-panel__space-between_d8m7q"};
|
|
10
|
-
require('./layout.css')
|
|
11
|
-
|
|
12
12
|
const Footer = ({ children, className, sticky, layout = 'start', gap, dataTestId, }) => {
|
|
13
13
|
const { footerHighlighted, setHasFooter } = useContext(ModalContext);
|
|
14
|
+
const responsiveContext = useContext(ResponsiveContext);
|
|
14
15
|
useEffect(() => {
|
|
15
16
|
setHasFooter(true);
|
|
16
17
|
}, [setHasFooter]);
|
|
17
18
|
return (React.createElement("div", { className: cn(styles.footer, className, layoutStyles[layout], gap && layoutStyles[`gap-${gap}`], {
|
|
18
19
|
[styles.highlighted]: sticky && footerHighlighted,
|
|
19
20
|
[styles.sticky]: sticky,
|
|
20
|
-
}), "data-test-id": dataTestId }, children));
|
|
21
|
+
}), "data-test-id": dataTestId || getDataTestId(responsiveContext?.dataTestId, 'footer') }, children));
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
export { Footer };
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Footer } from './Component.js';
|
|
4
|
+
import '@alfalab/core-components-shared/modern';
|
|
4
5
|
import '../../Context.js';
|
|
5
6
|
import '@alfalab/core-components-base-modal/modern';
|
|
7
|
+
import '../../ResponsiveContext.js';
|
|
8
|
+
import '../../layout.module-a8ffdbd1.js';
|
|
6
9
|
|
|
7
|
-
const styles = {"footer":"side-
|
|
10
|
+
const styles = {"footer":"side-panel__footer_1e4vh","sticky":"side-panel__sticky_1e4vh"};
|
|
8
11
|
require('./mobile.css')
|
|
9
12
|
|
|
10
|
-
const FooterMobile = ({ className, sticky, layout = 'start', ...restProps }) => (React.createElement(Footer, { className: cn(className, styles.footer,
|
|
13
|
+
const FooterMobile = ({ className, sticky, layout = 'start', ...restProps }) => (React.createElement(Footer, { className: cn(className, styles.footer, {
|
|
11
14
|
[styles.sticky]: sticky,
|
|
12
15
|
}), sticky: sticky, layout: layout, ...restProps }));
|
|
13
16
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1kjc9 */
|
|
2
2
|
:root {
|
|
3
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 */
|
|
4
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 */
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
/* mobile */
|
|
31
31
|
|
|
32
32
|
/* paddings */
|
|
33
|
-
} .side-
|
|
33
|
+
} .side-panel__sticky_62kfr {
|
|
34
34
|
bottom: 0;
|
|
35
|
-
} .side-
|
|
35
|
+
} .side-panel__s_62kfr {
|
|
36
36
|
padding: var(--side-panel-s-footer-paddings);
|
|
37
37
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: yf1yt */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
|
-
--color-light-bg-primary: #fff;
|
|
5
|
-
--color-light-
|
|
4
|
+
--color-light-modal-bg-primary: #fff;
|
|
5
|
+
--color-light-neutral-300: #e7e8eb; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* 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
6
|
} :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 */
|
|
7
7
|
} :root {
|
|
8
8
|
} :root {
|
|
@@ -17,30 +17,30 @@
|
|
|
17
17
|
} :root {
|
|
18
18
|
} :root {
|
|
19
19
|
} :root {
|
|
20
|
-
--side-panel-footer-background: var(--color-light-bg-primary);
|
|
20
|
+
--side-panel-footer-background: var(--color-light-modal-bg-primary);
|
|
21
21
|
|
|
22
22
|
/* sizes */
|
|
23
23
|
|
|
24
24
|
/* paddings */
|
|
25
25
|
|
|
26
26
|
/* scroll */
|
|
27
|
-
--side-panel-footer-highlight-background: var(--color-light-bg-primary);
|
|
28
|
-
--side-panel-footer-highlight-box-shadow: 0 -1px 0 0 var(--color-light-
|
|
27
|
+
--side-panel-footer-highlight-background: var(--color-light-modal-bg-primary);
|
|
28
|
+
--side-panel-footer-highlight-box-shadow: 0 -1px 0 0 var(--color-light-neutral-300);
|
|
29
29
|
|
|
30
30
|
/* desktop */
|
|
31
31
|
|
|
32
32
|
/* mobile */
|
|
33
33
|
|
|
34
34
|
/* paddings */
|
|
35
|
-
} .side-
|
|
35
|
+
} .side-panel__footer_3jdk9 {
|
|
36
36
|
width: 100%;
|
|
37
37
|
box-sizing: border-box;
|
|
38
38
|
transition: box-shadow 0.2s ease, background 0.2s ease;
|
|
39
|
-
} .side-
|
|
39
|
+
} .side-panel__sticky_3jdk9 {
|
|
40
40
|
background: var(--side-panel-footer-background);
|
|
41
41
|
position: sticky;
|
|
42
42
|
z-index: 1;
|
|
43
|
-
} .side-
|
|
43
|
+
} .side-panel__highlighted_3jdk9 {
|
|
44
44
|
background: var(--side-panel-footer-highlight-background);
|
|
45
45
|
box-shadow: var(--side-panel-footer-highlight-box-shadow);
|
|
46
46
|
}
|