@cloud-ru/ds-popup-private 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/LICENSE +201 -0
- package/README.md +163 -0
- package/dist/cjs/components/FooterActions/FooterActions.d.ts +44 -0
- package/dist/cjs/components/FooterActions/FooterActions.js +44 -0
- package/dist/cjs/components/FooterActions/index.d.ts +1 -0
- package/dist/cjs/components/FooterActions/index.js +17 -0
- package/dist/cjs/components/FooterActions/styles.module.css +20 -0
- package/dist/cjs/components/PopupBody/PopupBody.d.ts +3 -0
- package/dist/cjs/components/PopupBody/PopupBody.js +15 -0
- package/dist/cjs/components/PopupBody/index.d.ts +1 -0
- package/dist/cjs/components/PopupBody/index.js +17 -0
- package/dist/cjs/components/PopupBody/styles.module.css +16 -0
- package/dist/cjs/components/PopupCloseButton/PopupCloseButton.d.ts +11 -0
- package/dist/cjs/components/PopupCloseButton/PopupCloseButton.js +16 -0
- package/dist/cjs/components/PopupCloseButton/index.d.ts +1 -0
- package/dist/cjs/components/PopupCloseButton/index.js +17 -0
- package/dist/cjs/components/PopupCloseButton/styles.module.css +109 -0
- package/dist/cjs/components/PopupFooter/PopupFooter.d.ts +3 -0
- package/dist/cjs/components/PopupFooter/PopupFooter.js +17 -0
- package/dist/cjs/components/PopupFooter/index.d.ts +1 -0
- package/dist/cjs/components/PopupFooter/index.js +17 -0
- package/dist/cjs/components/PopupFooter/styles.module.css +32 -0
- package/dist/cjs/components/PopupHeader/PopupHeader.d.ts +3 -0
- package/dist/cjs/components/PopupHeader/PopupHeader.js +37 -0
- package/dist/cjs/components/PopupHeader/index.d.ts +1 -0
- package/dist/cjs/components/PopupHeader/index.js +17 -0
- package/dist/cjs/components/PopupHeader/styles.module.css +128 -0
- package/dist/cjs/components/PopupMedia/PopupMedia.d.ts +7 -0
- package/dist/cjs/components/PopupMedia/PopupMedia.js +14 -0
- package/dist/cjs/components/PopupMedia/index.d.ts +1 -0
- package/dist/cjs/components/PopupMedia/index.js +17 -0
- package/dist/cjs/components/PopupMedia/styles.module.css +27 -0
- package/dist/cjs/components/index.d.ts +6 -0
- package/dist/cjs/components/index.js +22 -0
- package/dist/cjs/constants.d.ts +68 -0
- package/dist/cjs/constants.js +73 -0
- package/dist/cjs/context/overlaySurface.d.ts +35 -0
- package/dist/cjs/context/overlaySurface.js +45 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +20 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/style.css +332 -0
- package/dist/cjs/types.d.ts +95 -0
- package/dist/cjs/types.js +2 -0
- package/dist/esm/components/FooterActions/FooterActions.d.ts +44 -0
- package/dist/esm/components/FooterActions/FooterActions.js +38 -0
- package/dist/esm/components/FooterActions/index.d.ts +1 -0
- package/dist/esm/components/FooterActions/index.js +1 -0
- package/dist/esm/components/FooterActions/styles.module.css +20 -0
- package/dist/esm/components/PopupBody/PopupBody.d.ts +3 -0
- package/dist/esm/components/PopupBody/PopupBody.js +9 -0
- package/dist/esm/components/PopupBody/index.d.ts +1 -0
- package/dist/esm/components/PopupBody/index.js +1 -0
- package/dist/esm/components/PopupBody/styles.module.css +16 -0
- package/dist/esm/components/PopupCloseButton/PopupCloseButton.d.ts +11 -0
- package/dist/esm/components/PopupCloseButton/PopupCloseButton.js +10 -0
- package/dist/esm/components/PopupCloseButton/index.d.ts +1 -0
- package/dist/esm/components/PopupCloseButton/index.js +1 -0
- package/dist/esm/components/PopupCloseButton/styles.module.css +109 -0
- package/dist/esm/components/PopupFooter/PopupFooter.d.ts +3 -0
- package/dist/esm/components/PopupFooter/PopupFooter.js +11 -0
- package/dist/esm/components/PopupFooter/index.d.ts +1 -0
- package/dist/esm/components/PopupFooter/index.js +1 -0
- package/dist/esm/components/PopupFooter/styles.module.css +32 -0
- package/dist/esm/components/PopupHeader/PopupHeader.d.ts +3 -0
- package/dist/esm/components/PopupHeader/PopupHeader.js +31 -0
- package/dist/esm/components/PopupHeader/index.d.ts +1 -0
- package/dist/esm/components/PopupHeader/index.js +1 -0
- package/dist/esm/components/PopupHeader/styles.module.css +128 -0
- package/dist/esm/components/PopupMedia/PopupMedia.d.ts +7 -0
- package/dist/esm/components/PopupMedia/PopupMedia.js +8 -0
- package/dist/esm/components/PopupMedia/index.d.ts +1 -0
- package/dist/esm/components/PopupMedia/index.js +1 -0
- package/dist/esm/components/PopupMedia/styles.module.css +27 -0
- package/dist/esm/components/index.d.ts +6 -0
- package/dist/esm/components/index.js +6 -0
- package/dist/esm/constants.d.ts +68 -0
- package/dist/esm/constants.js +70 -0
- package/dist/esm/context/overlaySurface.d.ts +35 -0
- package/dist/esm/context/overlaySurface.js +38 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/style.css +332 -0
- package/dist/esm/types.d.ts +95 -0
- package/dist/esm/types.js +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/package.json +46 -0
- package/src/components/FooterActions/FooterActions.tsx +111 -0
- package/src/components/FooterActions/index.ts +1 -0
- package/src/components/FooterActions/styles.module.scss +32 -0
- package/src/components/PopupBody/PopupBody.tsx +20 -0
- package/src/components/PopupBody/index.ts +1 -0
- package/src/components/PopupBody/styles.module.scss +24 -0
- package/src/components/PopupCloseButton/PopupCloseButton.tsx +37 -0
- package/src/components/PopupCloseButton/index.ts +1 -0
- package/src/components/PopupCloseButton/styles.module.scss +39 -0
- package/src/components/PopupFooter/PopupFooter.tsx +24 -0
- package/src/components/PopupFooter/index.ts +1 -0
- package/src/components/PopupFooter/styles.module.scss +49 -0
- package/src/components/PopupHeader/PopupHeader.tsx +125 -0
- package/src/components/PopupHeader/index.ts +1 -0
- package/src/components/PopupHeader/styles.module.scss +158 -0
- package/src/components/PopupMedia/PopupMedia.tsx +18 -0
- package/src/components/PopupMedia/index.ts +1 -0
- package/src/components/PopupMedia/styles.module.scss +33 -0
- package/src/components/index.ts +6 -0
- package/src/constants.ts +72 -0
- package/src/context/overlaySurface.tsx +65 -0
- package/src/index.ts +4 -0
- package/src/types.ts +110 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.stateLayer{
|
|
3
|
+
visibility:initial;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.root{
|
|
7
|
+
cursor:pointer;
|
|
8
|
+
position:relative;
|
|
9
|
+
display:flex;
|
|
10
|
+
align-items:center;
|
|
11
|
+
justify-content:center;
|
|
12
|
+
box-sizing:border-box;
|
|
13
|
+
margin:var(--sn-popupPrivate-anatomy-window-badgeButtonClosed-paddingTop, var(--sn-brand-anatomy-spacing-window-badgeButtonClosed-paddingTop, var(--sn-primitive-dimension-48, 48px))) var(--sn-popupPrivate-anatomy-window-badgeButtonClosed-paddingRight, var(--sn-brand-anatomy-spacing-window-badgeButtonClosed-paddingRight, var(--sn-primitive-dimension-48, 48px))) var(--sn-popupPrivate-anatomy-window-badgeButtonClosed-paddingBottom, var(--sn-brand-anatomy-spacing-window-badgeButtonClosed-paddingBottom, var(--sn-primitive-dimension-0, 0px))) var(--sn-popupPrivate-anatomy-window-badgeButtonClosed-paddingLeft, var(--sn-brand-anatomy-spacing-window-badgeButtonClosed-paddingLeft, var(--sn-primitive-dimension-0, 0px)));
|
|
14
|
+
padding:0;
|
|
15
|
+
border:0 solid transparent;
|
|
16
|
+
color:var(--sn-theme-color-neutral-text, var(--sn-brand-color-neutral-45, var(--sn-primitive-color-gray-45, #81869c)));
|
|
17
|
+
background:transparent;
|
|
18
|
+
outline:0;
|
|
19
|
+
min-width:var(--sn-popupPrivate-anatomy-window-badgeButtonClosed-buttonClosed-minWidth, var(--sn-primitive-dimension-32, 32px));
|
|
20
|
+
min-height:var(--sn-popupPrivate-anatomy-window-badgeButtonClosed-buttonClosed-minHeight, var(--sn-primitive-dimension-32, 32px));
|
|
21
|
+
border-radius:var(--sn-popupPrivate-anatomy-window-badgeButtonClosed-buttonClosed-borderRadius, var(--sn-brand-anatomy-radius-window-buttonClosed-m, var(--sn-primitive-dimension-full, 10000px)));
|
|
22
|
+
}
|
|
23
|
+
.root .stateLayer{
|
|
24
|
+
position:absolute;
|
|
25
|
+
inset:0;
|
|
26
|
+
border-radius:inherit;
|
|
27
|
+
}
|
|
28
|
+
.root .stateLayer[data-state=borderOnBackground]{
|
|
29
|
+
border-color:var(--sn-theme-color-material-stateLayer-neutral-border-default-borderColor, var(--sn-brand-color-state-neutralBorder-forLightMode-default-borderColor, rgba(159, 166, 198, 0.3019607843)));
|
|
30
|
+
border-style:solid;
|
|
31
|
+
border-width:var(--sn-primitive-strokeWeight-strokeRegular, 1px);
|
|
32
|
+
}
|
|
33
|
+
.root .stateLayer[data-state=emptyNeutralOnBackground]{
|
|
34
|
+
background:var(--sn-theme-color-material-stateLayer-neutral-onBackground-defaultEmpty-filled, var(--sn-brand-color-state-neutral-forLightMode-default-background, rgba(120, 123, 138, 0)));
|
|
35
|
+
}
|
|
36
|
+
.root .stateLayer[data-state=activatedOnBackground]{
|
|
37
|
+
background:var(--sn-theme-color-material-stateLayer-activated-default-filled, var(--sn-brand-color-state-activated-default-background, var(--sn-brandRole-color-brandA-backgroundActivatedDefault, rgba(56, 159, 116, 0.1490196078))));
|
|
38
|
+
}
|
|
39
|
+
.root .stateLayer[data-state=versionOnColor]{
|
|
40
|
+
background:var(--sn-theme-color-material-stateLayer-versionOnColor-default-filled, rgba(0, 0, 0, 0.0509803922));
|
|
41
|
+
}
|
|
42
|
+
.root .stateLayer[data-state=emptyVersionOnColor]{
|
|
43
|
+
background:var(--sn-theme-color-material-stateLayer-versionOnColor-defaultEmpty-filled, rgba(0, 0, 0, 0));
|
|
44
|
+
}
|
|
45
|
+
.root .stateLayer[data-state=inversionOnColor]{
|
|
46
|
+
background:var(--sn-theme-color-material-stateLayer-inversionOnColor-default-filled, rgba(255, 255, 255, 0.1019607843));
|
|
47
|
+
}
|
|
48
|
+
.root .stateLayer[data-state=emptyInversionOnColor]{
|
|
49
|
+
background:var(--sn-theme-color-material-stateLayer-inversionOnColor-defaultEmpty-filled, rgba(255, 255, 255, 0));
|
|
50
|
+
}
|
|
51
|
+
.root .stateLayer[data-state=emptyDarkOnAccent]{
|
|
52
|
+
background:var(--sn-theme-color-material-stateLayer-darkOnAccent-defaultEmpty-filled, rgba(0, 0, 0, 0));
|
|
53
|
+
}
|
|
54
|
+
@media (hover: hover){
|
|
55
|
+
.root:hover:not([data-disabled], [data-loading]) .stateLayer[data-state=borderOnBackground]{
|
|
56
|
+
border-color:var(--sn-theme-color-material-stateLayer-neutral-border-hovered-borderColor, var(--sn-brand-color-state-neutralBorder-forLightMode-hovered-borderColor, rgba(159, 166, 198, 0.6509803922)));
|
|
57
|
+
}
|
|
58
|
+
.root:hover:not([data-disabled], [data-loading]) .stateLayer[data-state=emptyNeutralOnBackground]{
|
|
59
|
+
background:var(--sn-theme-color-material-stateLayer-neutral-onBackground-hovered-filled, var(--sn-brand-color-state-neutral-forLightMode-hovered-background, rgba(188, 195, 220, 0.1490196078)));
|
|
60
|
+
}
|
|
61
|
+
.root:hover:not([data-disabled], [data-loading]) .stateLayer[data-state=activatedOnBackground]{
|
|
62
|
+
background:var(--sn-theme-color-material-stateLayer-activated-hovered-filled, var(--sn-brand-color-state-activated-hovered-background, var(--sn-brandRole-color-brandA-backgroundActivatedHovered, rgba(56, 159, 116, 0.3490196078))));
|
|
63
|
+
}
|
|
64
|
+
.root:hover:not([data-disabled], [data-loading]) .stateLayer[data-state=versionOnColor]{
|
|
65
|
+
background:var(--sn-theme-color-material-stateLayer-versionOnColor-hovered-filled, rgba(0, 0, 0, 0.1019607843));
|
|
66
|
+
}
|
|
67
|
+
.root:hover:not([data-disabled], [data-loading]) .stateLayer[data-state=emptyVersionOnColor]{
|
|
68
|
+
background:var(--sn-theme-color-material-stateLayer-versionOnColor-hovered-filled, rgba(0, 0, 0, 0.1019607843));
|
|
69
|
+
}
|
|
70
|
+
.root:hover:not([data-disabled], [data-loading]) .stateLayer[data-state=inversionOnColor]{
|
|
71
|
+
background:var(--sn-theme-color-material-stateLayer-inversionOnColor-hovered-filled, rgba(255, 255, 255, 0.1490196078));
|
|
72
|
+
}
|
|
73
|
+
.root:hover:not([data-disabled], [data-loading]) .stateLayer[data-state=emptyInversionOnColor]{
|
|
74
|
+
background:var(--sn-theme-color-material-stateLayer-inversionOnColor-hovered-filled, rgba(255, 255, 255, 0.1490196078));
|
|
75
|
+
}
|
|
76
|
+
.root:hover:not([data-disabled], [data-loading]) .stateLayer[data-state=emptyDarkOnAccent]{
|
|
77
|
+
background:var(--sn-theme-color-material-stateLayer-darkOnAccent-hovered-filled, rgba(0, 0, 0, 0.0588235294));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
.root{
|
|
81
|
+
}
|
|
82
|
+
.root[data-loading] .stateLayer[data-state=borderOnBackground], .root:active:not([data-disabled], [data-loading]) .stateLayer[data-state=borderOnBackground], .root[data-pressed=true]:not([data-disabled], [data-loading]) .stateLayer[data-state=borderOnBackground]{
|
|
83
|
+
border-color:var(--sn-theme-color-material-stateLayer-neutral-border-pressed-borderColor, var(--sn-brand-color-state-neutralBorder-forLightMode-pressed-borderColor, rgba(159, 166, 198, 0.8)));
|
|
84
|
+
}
|
|
85
|
+
.root[data-loading] .stateLayer[data-state=emptyNeutralOnBackground], .root:active:not([data-disabled], [data-loading]) .stateLayer[data-state=emptyNeutralOnBackground], .root[data-pressed=true]:not([data-disabled], [data-loading]) .stateLayer[data-state=emptyNeutralOnBackground]{
|
|
86
|
+
background:var(--sn-theme-color-material-stateLayer-neutral-onBackground-pressed-filled, var(--sn-brand-color-state-neutral-forLightMode-pressed-background, rgba(188, 195, 220, 0.3019607843)));
|
|
87
|
+
}
|
|
88
|
+
.root[data-loading] .stateLayer[data-state=activatedOnBackground], .root:active:not([data-disabled], [data-loading]) .stateLayer[data-state=activatedOnBackground], .root[data-pressed=true]:not([data-disabled], [data-loading]) .stateLayer[data-state=activatedOnBackground]{
|
|
89
|
+
background:var(--sn-theme-color-material-stateLayer-activated-pressed-filled, var(--sn-brand-color-state-activated-pressed-background, var(--sn-brandRole-color-brandA-backgroundActivatedPressed, rgba(56, 159, 116, 0.4509803922))));
|
|
90
|
+
}
|
|
91
|
+
.root[data-loading] .stateLayer[data-state=versionOnColor], .root:active:not([data-disabled], [data-loading]) .stateLayer[data-state=versionOnColor], .root[data-pressed=true]:not([data-disabled], [data-loading]) .stateLayer[data-state=versionOnColor]{
|
|
92
|
+
background:var(--sn-theme-color-material-stateLayer-versionOnColor-pressed-filled, rgba(0, 0, 0, 0.1490196078));
|
|
93
|
+
}
|
|
94
|
+
.root[data-loading] .stateLayer[data-state=emptyVersionOnColor], .root:active:not([data-disabled], [data-loading]) .stateLayer[data-state=emptyVersionOnColor], .root[data-pressed=true]:not([data-disabled], [data-loading]) .stateLayer[data-state=emptyVersionOnColor]{
|
|
95
|
+
background:var(--sn-theme-color-material-stateLayer-versionOnColor-pressed-filled, rgba(0, 0, 0, 0.1490196078));
|
|
96
|
+
}
|
|
97
|
+
.root[data-loading] .stateLayer[data-state=inversionOnColor], .root:active:not([data-disabled], [data-loading]) .stateLayer[data-state=inversionOnColor], .root[data-pressed=true]:not([data-disabled], [data-loading]) .stateLayer[data-state=inversionOnColor]{
|
|
98
|
+
background:var(--sn-theme-color-material-stateLayer-inversionOnColor-pressed-filled, rgba(255, 255, 255, 0.0509803922));
|
|
99
|
+
}
|
|
100
|
+
.root[data-loading] .stateLayer[data-state=emptyInversionOnColor], .root:active:not([data-disabled], [data-loading]) .stateLayer[data-state=emptyInversionOnColor], .root[data-pressed=true]:not([data-disabled], [data-loading]) .stateLayer[data-state=emptyInversionOnColor]{
|
|
101
|
+
background:var(--sn-theme-color-material-stateLayer-inversionOnColor-pressed-filled, rgba(255, 255, 255, 0.0509803922));
|
|
102
|
+
}
|
|
103
|
+
.root[data-loading] .stateLayer[data-state=emptyDarkOnAccent], .root:active:not([data-disabled], [data-loading]) .stateLayer[data-state=emptyDarkOnAccent], .root[data-pressed=true]:not([data-disabled], [data-loading]) .stateLayer[data-state=emptyDarkOnAccent]{
|
|
104
|
+
background:var(--sn-theme-color-material-stateLayer-darkOnAccent-pressed-filled, rgba(0, 0, 0, 0.1215686275));
|
|
105
|
+
}
|
|
106
|
+
.root:focus-visible{
|
|
107
|
+
outline:var(--sn-theme-color-available-complementary, #000000) solid var(--sn-primitive-strokeWeight-strokeSemiBold, 2px);
|
|
108
|
+
outline-offset:var(--sn-primitive-strokeWeight-strokeSemiBold, 2px);
|
|
109
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PopupFooterProps } from '../../types';
|
|
2
|
+
/** Нижняя action-зона overlay'я (рендерит `children` в `bottomBar`-секции). Раскладка по поверхности. */
|
|
3
|
+
export declare function PopupFooter({ children, className, ...rest }: PopupFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PopupFooter = PopupFooter;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const utils_1 = require("@cloud-ru/ds-utils");
|
|
9
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
10
|
+
const constants_1 = require("../../constants");
|
|
11
|
+
const overlaySurface_1 = require("../../context/overlaySurface");
|
|
12
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
13
|
+
/** Нижняя action-зона overlay'я (рендерит `children` в `bottomBar`-секции). Раскладка по поверхности. */
|
|
14
|
+
function PopupFooter({ children, className, ...rest }) {
|
|
15
|
+
const surface = (0, overlaySurface_1.useSurfaceTokenSegment)();
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.root, className), "data-surface": surface, "data-test-id": constants_1.TEST_IDS.footer, ...(0, utils_1.extractSupportProps)(rest), children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.contentWrapper, children: children }) }));
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PopupFooter';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./PopupFooter"), exports);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.root{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-shrink:0;
|
|
4
|
+
box-sizing:border-box;
|
|
5
|
+
}
|
|
6
|
+
.root[data-surface=bottomSheet]{
|
|
7
|
+
touch-action:none;
|
|
8
|
+
flex-direction:column;
|
|
9
|
+
align-items:stretch;
|
|
10
|
+
justify-content:center;
|
|
11
|
+
padding:var(--sn-popupPrivate-anatomy-bottomSheet-footer-paddingTop, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px))) var(--sn-popupPrivate-anatomy-bottomSheet-footer-paddingHorizontal, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px))) var(--sn-popupPrivate-anatomy-bottomSheet-footer-paddingBottom, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px))) var(--sn-popupPrivate-anatomy-bottomSheet-footer-paddingHorizontal, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
12
|
+
}
|
|
13
|
+
.root[data-surface=window]{
|
|
14
|
+
align-items:center;
|
|
15
|
+
align-self:stretch;
|
|
16
|
+
padding-left:var(--sn-popupPrivate-anatomy-window-footer-paddingHorizontal, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
17
|
+
padding-right:var(--sn-popupPrivate-anatomy-window-footer-paddingHorizontal, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
18
|
+
padding-bottom:var(--sn-popupPrivate-anatomy-window-footer-paddingBottom, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.contentWrapper{
|
|
22
|
+
display:flex;
|
|
23
|
+
flex-direction:column;
|
|
24
|
+
}
|
|
25
|
+
[data-surface=bottomSheet] .contentWrapper{
|
|
26
|
+
gap:var(--sn-density-spacing-interval-m, var(--sn-primitive-dimension-16, 16px));
|
|
27
|
+
}
|
|
28
|
+
[data-surface=window] .contentWrapper{
|
|
29
|
+
flex:1 0 0;
|
|
30
|
+
align-items:flex-start;
|
|
31
|
+
justify-content:center;
|
|
32
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PopupHeaderProps } from '../../types';
|
|
2
|
+
/** Header overlay'я: back-button + title + slotAfterTitle + actionButton + subtitle + slotSecondTitle. */
|
|
3
|
+
export declare function PopupHeader({ title, titleId, slotAfterTitle, subtitle, slotSecondTitle, onBackButtonClick, actionButton, truncate, testIds, className, ...rest }: PopupHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PopupHeader = PopupHeader;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const button_1 = require("@cloud-ru/ds-button");
|
|
9
|
+
const system_1 = require("@cloud-ru/ds-icons/interface/system");
|
|
10
|
+
const truncate_string_1 = require("@cloud-ru/ds-truncate-string");
|
|
11
|
+
const typography_1 = require("@cloud-ru/ds-typography");
|
|
12
|
+
const utils_1 = require("@cloud-ru/ds-utils");
|
|
13
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
14
|
+
const constants_1 = require("../../constants");
|
|
15
|
+
const overlaySurface_1 = require("../../context/overlaySurface");
|
|
16
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
17
|
+
/** Header overlay'я: back-button + title + slotAfterTitle + actionButton + subtitle + slotSecondTitle. */
|
|
18
|
+
function PopupHeader({ title, titleId, slotAfterTitle, subtitle, slotSecondTitle, onBackButtonClick, actionButton, truncate, testIds, className, ...rest }) {
|
|
19
|
+
const surface = (0, overlaySurface_1.useSurfaceTokenSegment)();
|
|
20
|
+
// `slotSecondTitle` (search/segment) есть только в мастере bottomSheet — на window/modal/drawer игнор.
|
|
21
|
+
const isSheet = (0, overlaySurface_1.useOverlaySurface)() === overlaySurface_1.OVERLAY_SURFACE.Sheet;
|
|
22
|
+
const hasHeadline = Boolean(title || onBackButtonClick || actionButton || slotAfterTitle);
|
|
23
|
+
// Мобильный sheet — крупный `title-l`; desktop window (modal/drawer) — `headline-s`.
|
|
24
|
+
const titleContent = truncate?.title !== undefined && typeof title === 'string' ? ((0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, { maxLines: truncate.title, text: title })) : (title);
|
|
25
|
+
const subtitleContent = truncate?.subtitle !== undefined && typeof subtitle === 'string' ? ((0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, { maxLines: truncate.subtitle, text: subtitle })) : (subtitle);
|
|
26
|
+
// Потребитель-обёртка может переопределить id слотов; пропущенные берём из `TEST_IDS`.
|
|
27
|
+
const ids = {
|
|
28
|
+
header: testIds?.header ?? constants_1.TEST_IDS.header,
|
|
29
|
+
title: testIds?.title ?? constants_1.TEST_IDS.title,
|
|
30
|
+
slotAfterTitle: testIds?.slotAfterTitle ?? constants_1.TEST_IDS.slotAfterTitle,
|
|
31
|
+
subtitle: testIds?.subtitle ?? constants_1.TEST_IDS.subtitle,
|
|
32
|
+
slotSecondTitle: testIds?.slotSecondTitle ?? constants_1.TEST_IDS.slotSecondTitle,
|
|
33
|
+
backButton: testIds?.backButton ?? constants_1.TEST_IDS.backButton,
|
|
34
|
+
actionButton: testIds?.actionButton ?? constants_1.TEST_IDS.actionButton,
|
|
35
|
+
};
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.root, className), "data-surface": surface, "data-with-before": Boolean(onBackButtonClick) || undefined, ...(0, utils_1.extractSupportProps)(rest), "data-test-id": ids.header, children: [hasHeadline && ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.headlineWrapper, "data-with-before": Boolean(onBackButtonClick) || undefined, "data-with-after": Boolean(actionButton) || undefined, children: [onBackButtonClick && ((0, jsx_runtime_1.jsx)(button_1.Button, { view: 'function', appearance: 'neutral', size: 'm', icon: (0, jsx_runtime_1.jsx)(system_1.ArrowLeftSVG, {}), "aria-label": '\u041D\u0430\u0437\u0430\u0434', onClick: onBackButtonClick, "data-test-id": ids.backButton })), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.headline, children: [title && ((0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: isSheet ? 'title' : 'headline', size: isSheet ? 'l' : 's', id: titleId, className: styles_module_scss_1.default.title, "data-test-id": ids.title, children: titleContent })), slotAfterTitle && ((0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.slotAfterTitle, "data-test-id": ids.slotAfterTitle, children: slotAfterTitle }))] }), actionButton && ((0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.actionButton, "data-test-id": ids.actionButton, children: actionButton }))] })), subtitle && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.subtitleWrapper, "data-test-id": ids.subtitle, children: (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: 'body', size: 'm', className: styles_module_scss_1.default.subtitle, children: subtitleContent }) })), isSheet && slotSecondTitle && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.secondWrapper, "data-test-id": ids.slotSecondTitle, children: slotSecondTitle }))] }));
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PopupHeader';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./PopupHeader"), exports);
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
.root{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
flex-shrink:0;
|
|
5
|
+
box-sizing:border-box;
|
|
6
|
+
}
|
|
7
|
+
.root[data-surface=bottomSheet]{
|
|
8
|
+
gap:var(--sn-popupPrivate-anatomy-bottomSheet-header-gap, var(--sn-density-spacing-interval-xs, var(--sn-primitive-dimension-4, 4px)));
|
|
9
|
+
padding-top:var(--sn-popupPrivate-anatomy-bottomSheet-header-paddingTop, var(--sn-density-spacing-interval-m, var(--sn-primitive-dimension-16, 16px)));
|
|
10
|
+
padding-bottom:var(--sn-popupPrivate-anatomy-bottomSheet-header-paddingBottom, var(--sn-density-spacing-interval-m, var(--sn-primitive-dimension-16, 16px)));
|
|
11
|
+
}
|
|
12
|
+
.root[data-surface=window]{
|
|
13
|
+
align-items:flex-start;
|
|
14
|
+
align-self:stretch;
|
|
15
|
+
justify-content:center;
|
|
16
|
+
gap:var(--sn-popupPrivate-anatomy-window-header-gap, var(--sn-density-spacing-interval-xs, var(--sn-primitive-dimension-4, 4px)));
|
|
17
|
+
padding-bottom:var(--sn-popupPrivate-anatomy-window-header-paddingBottom, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
18
|
+
}
|
|
19
|
+
.root[data-surface=window]:not([data-with-before]){
|
|
20
|
+
gap:0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.headlineWrapper{
|
|
24
|
+
display:flex;
|
|
25
|
+
align-items:center;
|
|
26
|
+
}
|
|
27
|
+
[data-surface=bottomSheet] .headlineWrapper{
|
|
28
|
+
touch-action:none;
|
|
29
|
+
gap:0;
|
|
30
|
+
}
|
|
31
|
+
[data-surface=bottomSheet] .headlineWrapper[data-with-before], [data-surface=bottomSheet] .headlineWrapper[data-with-after]{
|
|
32
|
+
gap:var(--sn-popupPrivate-anatomy-bottomSheet-header-headline-gap, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
33
|
+
}
|
|
34
|
+
[data-surface=bottomSheet] .headlineWrapper[data-with-before]{
|
|
35
|
+
padding-left:var(--sn-popupPrivate-anatomy-bottomSheet-header-headline-paddingLeft, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
36
|
+
}
|
|
37
|
+
[data-surface=bottomSheet] .headlineWrapper[data-with-after]{
|
|
38
|
+
padding-right:var(--sn-popupPrivate-anatomy-bottomSheet-header-headline-paddingRight, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
39
|
+
}
|
|
40
|
+
[data-surface=window] .headlineWrapper{
|
|
41
|
+
align-self:stretch;
|
|
42
|
+
gap:var(--sn-popupPrivate-anatomy-window-header-headline-gap, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
43
|
+
height:var(--sn-popupPrivate-anatomy-window-header-headline-height, var(--sn-density-size-m, var(--sn-primitive-dimension-56, 56px)));
|
|
44
|
+
padding-left:var(--sn-popupPrivate-anatomy-window-header-headline-paddingHorizontal, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
45
|
+
padding-right:var(--sn-popupPrivate-anatomy-window-header-headline-paddingHorizontal, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
46
|
+
padding-right:0;
|
|
47
|
+
}
|
|
48
|
+
[data-surface=window] .headlineWrapper:not([data-with-before]){
|
|
49
|
+
padding-left:0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.headline{
|
|
53
|
+
display:flex;
|
|
54
|
+
align-items:center;
|
|
55
|
+
box-sizing:border-box;
|
|
56
|
+
min-width:0;
|
|
57
|
+
}
|
|
58
|
+
[data-surface=bottomSheet] .headline{
|
|
59
|
+
flex:1 1 auto;
|
|
60
|
+
gap:var(--sn-popupPrivate-anatomy-bottomSheet-header-headline-headlineWrapper-gap, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
61
|
+
padding-top:var(--sn-popupPrivate-anatomy-bottomSheet-header-headline-headlineWrapper-paddingVertical, var(--sn-primitive-dimension-10, 10px));
|
|
62
|
+
padding-bottom:var(--sn-popupPrivate-anatomy-bottomSheet-header-headline-headlineWrapper-paddingVertical, var(--sn-primitive-dimension-10, 10px));
|
|
63
|
+
}
|
|
64
|
+
[data-surface=window] .headline{
|
|
65
|
+
flex:1 0 0;
|
|
66
|
+
gap:var(--sn-popupPrivate-anatomy-window-header-headline-headlineWrapper-gap, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
67
|
+
padding-left:var(--sn-popupPrivate-anatomy-window-header-headline-headlineWrapper-paddingLeft, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
68
|
+
padding-right:var(--sn-popupPrivate-anatomy-window-header-headline-headlineWrapper-paddingRight, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[data-surface=bottomSheet] .headlineWrapper:not([data-with-before]) .headline{
|
|
72
|
+
padding-left:var(--sn-popupPrivate-anatomy-bottomSheet-header-headline-headlineWrapper-paddingLeft, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
[data-surface=bottomSheet] .headlineWrapper:not([data-with-after]) .headline{
|
|
76
|
+
padding-right:var(--sn-popupPrivate-anatomy-bottomSheet-header-headline-headlineWrapper-paddingRight, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[data-surface=window] .headlineWrapper[data-with-before] .headline{
|
|
80
|
+
padding-left:0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.title{
|
|
84
|
+
flex:0 1 auto;
|
|
85
|
+
min-width:0;
|
|
86
|
+
color:var(--sn-theme-color-available-version-textMain, var(--sn-brand-color-text-version-main, #41424e));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.slotAfterTitle{
|
|
90
|
+
display:inline-flex;
|
|
91
|
+
flex:1 1 auto;
|
|
92
|
+
align-items:center;
|
|
93
|
+
min-width:0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.actionButton{
|
|
97
|
+
display:inline-flex;
|
|
98
|
+
flex-shrink:0;
|
|
99
|
+
align-items:center;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.subtitleWrapper{
|
|
103
|
+
display:flex;
|
|
104
|
+
flex-direction:column;
|
|
105
|
+
align-items:flex-start;
|
|
106
|
+
box-sizing:border-box;
|
|
107
|
+
}
|
|
108
|
+
[data-surface=bottomSheet] .subtitleWrapper{
|
|
109
|
+
padding-right:var(--sn-popupPrivate-anatomy-bottomSheet-header-subHeadlineWrapper-paddingHorizontal, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
110
|
+
padding-left:var(--sn-popupPrivate-anatomy-bottomSheet-header-subHeadlineWrapper-paddingHorizontal, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
111
|
+
}
|
|
112
|
+
[data-surface=window] .subtitleWrapper{
|
|
113
|
+
align-self:stretch;
|
|
114
|
+
padding-left:var(--sn-popupPrivate-anatomy-window-header-subHeadlineWrapper-paddingHorizontal, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
115
|
+
padding-right:var(--sn-popupPrivate-anatomy-window-header-subHeadlineWrapper-paddingHorizontal, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.subtitle{
|
|
119
|
+
color:var(--sn-theme-color-available-version-textSecondary, var(--sn-brand-color-text-version-secondary, rgba(65, 66, 78, 0.8)));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.secondWrapper{
|
|
123
|
+
box-sizing:border-box;
|
|
124
|
+
}
|
|
125
|
+
[data-surface=bottomSheet] .secondWrapper{
|
|
126
|
+
padding-left:var(--sn-popupPrivate-anatomy-bottomSheet-header-secondWrapper-paddingHorizontal, var(--sn-popupPrivate-anatomy-bottomSheet-header-headline-headlineWrapper-gap, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px))));
|
|
127
|
+
padding-right:var(--sn-popupPrivate-anatomy-bottomSheet-header-secondWrapper-paddingHorizontal, var(--sn-popupPrivate-anatomy-bottomSheet-header-headline-headlineWrapper-gap, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px))));
|
|
128
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PopupMediaProps } from '../../types';
|
|
2
|
+
type MediaProps = PopupMediaProps & {
|
|
3
|
+
className?: string;
|
|
4
|
+
};
|
|
5
|
+
/** Media-блок над headline: `kind='image'` — во всю ширину, `kind='icon'` — иконка. */
|
|
6
|
+
export declare function PopupMedia({ src, alt, kind, className }: MediaProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PopupMedia = PopupMedia;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
9
|
+
const constants_1 = require("../../constants");
|
|
10
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
11
|
+
/** Media-блок над headline: `kind='image'` — во всю ширину, `kind='icon'` — иконка. */
|
|
12
|
+
function PopupMedia({ src, alt, kind = constants_1.MEDIA_KIND.Image, className }) {
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, className), "data-media-kind": kind, "data-test-id": constants_1.TEST_IDS.media, children: (0, jsx_runtime_1.jsx)("img", { src: src, alt: alt, className: kind === constants_1.MEDIA_KIND.Image ? styles_module_scss_1.default.image : styles_module_scss_1.default.icon }) }));
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PopupMedia';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./PopupMedia"), exports);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.wrapper{
|
|
2
|
+
touch-action:none;
|
|
3
|
+
overflow:hidden;
|
|
4
|
+
display:flex;
|
|
5
|
+
flex-shrink:0;
|
|
6
|
+
align-items:center;
|
|
7
|
+
justify-content:center;
|
|
8
|
+
box-sizing:border-box;
|
|
9
|
+
width:100%;
|
|
10
|
+
}
|
|
11
|
+
.wrapper[data-media-kind=icon]{
|
|
12
|
+
padding-top:var(--sn-popupPrivate-anatomy-window-media-icon-paddingTop, var(--sn-primitive-dimension-32, 32px));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.image{
|
|
16
|
+
display:block;
|
|
17
|
+
width:100%;
|
|
18
|
+
min-height:184px;
|
|
19
|
+
-o-object-fit:cover;
|
|
20
|
+
object-fit:cover;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.icon{
|
|
24
|
+
display:block;
|
|
25
|
+
max-width:100%;
|
|
26
|
+
height:auto;
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./PopupHeader"), exports);
|
|
18
|
+
__exportStar(require("./PopupBody"), exports);
|
|
19
|
+
__exportStar(require("./PopupFooter"), exports);
|
|
20
|
+
__exportStar(require("./PopupMedia"), exports);
|
|
21
|
+
__exportStar(require("./PopupCloseButton"), exports);
|
|
22
|
+
__exportStar(require("./FooterActions"), exports);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Тип media-блока в overlay-шапке.
|
|
3
|
+
*
|
|
4
|
+
* - `Image` — изображение во всю ширину (высота 184px), прижато к шапке (убирается
|
|
5
|
+
* верхний отступ контент-блока). Горизонтальные паддинги body этим не меняются — они отдельно через `bodyPadding`.
|
|
6
|
+
* - `Icon` — иконка с `padding-top: 24px`.
|
|
7
|
+
*
|
|
8
|
+
* Соответствие Figma: `bottomSheetMediaImage` (360×184) и `bottomSheetMediaIcon` (360×104).
|
|
9
|
+
*/
|
|
10
|
+
export declare const MEDIA_KIND: {
|
|
11
|
+
readonly Image: "image";
|
|
12
|
+
readonly Icon: "icon";
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Ориентация кнопок футера, собранных из `approveButton` / `cancelButton` / `additionalButton`.
|
|
16
|
+
* Применяется только при ровно двух кнопках (см. `footerActionsOrientation`).
|
|
17
|
+
*
|
|
18
|
+
* - `Horizontal` — кнопки в ряд через space-between: secondary слева, primary справа, ширина по
|
|
19
|
+
* контенту. Дефолт — точное соответствие Figma `bottomBar.buttonGroup` (cancel/confirm).
|
|
20
|
+
* - `Vertical` — кнопки в столбик, full-width (primary сверху).
|
|
21
|
+
*/
|
|
22
|
+
export declare const FOOTER_ACTIONS_ORIENTATION: {
|
|
23
|
+
readonly Vertical: "vertical";
|
|
24
|
+
readonly Horizontal: "horizontal";
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Стабильные `data-test-id` для слотов overlay-chrome (header / body / footer / media / close).
|
|
28
|
+
*
|
|
29
|
+
* Используются для e2e-локаторов в Playwright и Storybook play-функциях. Реэкспортируется из
|
|
30
|
+
* `@cloud-ru/ds-bottom-sheet`, чтобы потребитель (приложение) ссылался на те же id, что и наши тесты.
|
|
31
|
+
*
|
|
32
|
+
* Значения намеренно сохраняют префикс `bottom-sheet__` — на фазе выноса слоя из `@cloud-ru/ds-bottom-sheet`
|
|
33
|
+
* они переносятся 1:1 без смены поведения; переименование в `popup-private__*` — отдельная фаза.
|
|
34
|
+
*
|
|
35
|
+
* Figma-typo-мост (см. `.claude/rules/figma-integration.md`):
|
|
36
|
+
* Figma `badgeHandle` → код `handle` (показывается при `swipeEnabled`)
|
|
37
|
+
* Figma `blackout` → код `backdrop` / `showBackdrop`
|
|
38
|
+
* Figma `topBar` → код `header` / `onBackButtonClick`
|
|
39
|
+
* Figma `bottomBar` → код `footer`
|
|
40
|
+
* Figma `+ slotMedia` → код `media`
|
|
41
|
+
* Figma `+ slotSubtitle` → код `subtitle` (текст под title)
|
|
42
|
+
* Figma `+ slotSecondTitle` → код `slotSecondTitle` (search/segment, только sheet)
|
|
43
|
+
* Figma `+ slotAfterHeadline` → код `slotAfterTitle`
|
|
44
|
+
* Figma `+ slotBottomBar` → код `footer` (ReactNode)
|
|
45
|
+
* Figma `buttonBefore` (48×48) → код auto-back-button по `onBackButtonClick`
|
|
46
|
+
* Figma `buttonAfter` (48×48) → код `actionButton` (ReactNode)
|
|
47
|
+
*/
|
|
48
|
+
export declare const TEST_IDS: {
|
|
49
|
+
readonly root: "bottom-sheet";
|
|
50
|
+
readonly backdrop: "bottom-sheet__backdrop";
|
|
51
|
+
readonly handle: "bottom-sheet__handle";
|
|
52
|
+
readonly header: "bottom-sheet__header";
|
|
53
|
+
readonly title: "bottom-sheet__title";
|
|
54
|
+
readonly slotAfterTitle: "bottom-sheet__slot-after-title";
|
|
55
|
+
readonly subtitle: "bottom-sheet__subtitle";
|
|
56
|
+
readonly slotSecondTitle: "bottom-sheet__slot-second-title";
|
|
57
|
+
readonly backButton: "bottom-sheet__back-button";
|
|
58
|
+
readonly actionButton: "bottom-sheet__action-button";
|
|
59
|
+
readonly media: "bottom-sheet__media";
|
|
60
|
+
readonly closeButton: "popup__close-button";
|
|
61
|
+
readonly body: "bottom-sheet__body";
|
|
62
|
+
readonly footer: "bottom-sheet__footer";
|
|
63
|
+
readonly footerApprove: "bottom-sheet__footer-approve";
|
|
64
|
+
readonly footerCancel: "bottom-sheet__footer-cancel";
|
|
65
|
+
readonly footerAdditional: "bottom-sheet__footer-additional";
|
|
66
|
+
readonly dividerTop: "bottom-sheet__divider-top";
|
|
67
|
+
readonly dividerBottom: "bottom-sheet__divider-bottom";
|
|
68
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TEST_IDS = exports.FOOTER_ACTIONS_ORIENTATION = exports.MEDIA_KIND = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Тип media-блока в overlay-шапке.
|
|
6
|
+
*
|
|
7
|
+
* - `Image` — изображение во всю ширину (высота 184px), прижато к шапке (убирается
|
|
8
|
+
* верхний отступ контент-блока). Горизонтальные паддинги body этим не меняются — они отдельно через `bodyPadding`.
|
|
9
|
+
* - `Icon` — иконка с `padding-top: 24px`.
|
|
10
|
+
*
|
|
11
|
+
* Соответствие Figma: `bottomSheetMediaImage` (360×184) и `bottomSheetMediaIcon` (360×104).
|
|
12
|
+
*/
|
|
13
|
+
exports.MEDIA_KIND = {
|
|
14
|
+
Image: 'image',
|
|
15
|
+
Icon: 'icon',
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Ориентация кнопок футера, собранных из `approveButton` / `cancelButton` / `additionalButton`.
|
|
19
|
+
* Применяется только при ровно двух кнопках (см. `footerActionsOrientation`).
|
|
20
|
+
*
|
|
21
|
+
* - `Horizontal` — кнопки в ряд через space-between: secondary слева, primary справа, ширина по
|
|
22
|
+
* контенту. Дефолт — точное соответствие Figma `bottomBar.buttonGroup` (cancel/confirm).
|
|
23
|
+
* - `Vertical` — кнопки в столбик, full-width (primary сверху).
|
|
24
|
+
*/
|
|
25
|
+
exports.FOOTER_ACTIONS_ORIENTATION = {
|
|
26
|
+
Vertical: 'vertical',
|
|
27
|
+
Horizontal: 'horizontal',
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Стабильные `data-test-id` для слотов overlay-chrome (header / body / footer / media / close).
|
|
31
|
+
*
|
|
32
|
+
* Используются для e2e-локаторов в Playwright и Storybook play-функциях. Реэкспортируется из
|
|
33
|
+
* `@cloud-ru/ds-bottom-sheet`, чтобы потребитель (приложение) ссылался на те же id, что и наши тесты.
|
|
34
|
+
*
|
|
35
|
+
* Значения намеренно сохраняют префикс `bottom-sheet__` — на фазе выноса слоя из `@cloud-ru/ds-bottom-sheet`
|
|
36
|
+
* они переносятся 1:1 без смены поведения; переименование в `popup-private__*` — отдельная фаза.
|
|
37
|
+
*
|
|
38
|
+
* Figma-typo-мост (см. `.claude/rules/figma-integration.md`):
|
|
39
|
+
* Figma `badgeHandle` → код `handle` (показывается при `swipeEnabled`)
|
|
40
|
+
* Figma `blackout` → код `backdrop` / `showBackdrop`
|
|
41
|
+
* Figma `topBar` → код `header` / `onBackButtonClick`
|
|
42
|
+
* Figma `bottomBar` → код `footer`
|
|
43
|
+
* Figma `+ slotMedia` → код `media`
|
|
44
|
+
* Figma `+ slotSubtitle` → код `subtitle` (текст под title)
|
|
45
|
+
* Figma `+ slotSecondTitle` → код `slotSecondTitle` (search/segment, только sheet)
|
|
46
|
+
* Figma `+ slotAfterHeadline` → код `slotAfterTitle`
|
|
47
|
+
* Figma `+ slotBottomBar` → код `footer` (ReactNode)
|
|
48
|
+
* Figma `buttonBefore` (48×48) → код auto-back-button по `onBackButtonClick`
|
|
49
|
+
* Figma `buttonAfter` (48×48) → код `actionButton` (ReactNode)
|
|
50
|
+
*/
|
|
51
|
+
exports.TEST_IDS = {
|
|
52
|
+
root: 'bottom-sheet',
|
|
53
|
+
backdrop: 'bottom-sheet__backdrop',
|
|
54
|
+
handle: 'bottom-sheet__handle',
|
|
55
|
+
header: 'bottom-sheet__header',
|
|
56
|
+
title: 'bottom-sheet__title',
|
|
57
|
+
slotAfterTitle: 'bottom-sheet__slot-after-title',
|
|
58
|
+
subtitle: 'bottom-sheet__subtitle',
|
|
59
|
+
slotSecondTitle: 'bottom-sheet__slot-second-title',
|
|
60
|
+
backButton: 'bottom-sheet__back-button',
|
|
61
|
+
actionButton: 'bottom-sheet__action-button',
|
|
62
|
+
media: 'bottom-sheet__media',
|
|
63
|
+
closeButton: 'popup__close-button',
|
|
64
|
+
body: 'bottom-sheet__body',
|
|
65
|
+
footer: 'bottom-sheet__footer',
|
|
66
|
+
footerApprove: 'bottom-sheet__footer-approve',
|
|
67
|
+
footerCancel: 'bottom-sheet__footer-cancel',
|
|
68
|
+
footerAdditional: 'bottom-sheet__footer-additional',
|
|
69
|
+
// Два разных разделителя (topBar↔body и body↔footer) — разные id, чтобы каждый адресовался
|
|
70
|
+
// однозначно (без strict-mode-коллизии `getByTestId`).
|
|
71
|
+
dividerTop: 'bottom-sheet__divider-top',
|
|
72
|
+
dividerBottom: 'bottom-sheet__divider-bottom',
|
|
73
|
+
};
|