@cloud-ru/ds-uikit-product-notification 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 +728 -0
- package/dist/cjs/components/NotificationCard/NotificationCard.d.ts +43 -0
- package/dist/cjs/components/NotificationCard/NotificationCard.js +80 -0
- package/dist/cjs/components/NotificationCard/NotificationCardSkeleton.d.ts +7 -0
- package/dist/cjs/components/NotificationCard/NotificationCardSkeleton.js +16 -0
- package/dist/cjs/components/NotificationCard/helpers.d.ts +4 -0
- package/dist/cjs/components/NotificationCard/helpers.js +31 -0
- package/dist/cjs/components/NotificationCard/index.d.ts +2 -0
- package/dist/cjs/components/NotificationCard/index.js +18 -0
- package/dist/cjs/components/NotificationCard/styles.module.css +216 -0
- package/dist/cjs/components/NotificationPanel/NotificationPanel.d.ts +22 -0
- package/dist/cjs/components/NotificationPanel/NotificationPanel.js +23 -0
- package/dist/cjs/components/NotificationPanel/index.d.ts +1 -0
- package/dist/cjs/components/NotificationPanel/index.js +17 -0
- package/dist/cjs/components/NotificationPanel/styles.module.css +10 -0
- package/dist/cjs/components/NotificationPanelContent/NotificationPanelContent.d.ts +45 -0
- package/dist/cjs/components/NotificationPanelContent/NotificationPanelContent.js +43 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.d.ts +18 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.js +43 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/hooks.d.ts +17 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/hooks.js +22 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/index.d.ts +1 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/index.js +17 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/styles.module.css +69 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/utils.d.ts +4 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/utils.js +11 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.d.ts +4 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.js +15 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/index.d.ts +1 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/index.js +17 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/styles.module.css +3 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.d.ts +12 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.js +17 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/index.d.ts +1 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/index.js +17 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/styles.module.css +35 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.d.ts +12 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.js +24 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.d.ts +9 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.js +27 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/index.d.ts +1 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/index.js +17 -0
- package/dist/cjs/components/NotificationPanelContent/components/index.d.ts +4 -0
- package/dist/cjs/components/NotificationPanelContent/components/index.js +20 -0
- package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/StackTail.d.ts +6 -0
- package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/StackTail.js +11 -0
- package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/index.d.ts +1 -0
- package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/index.js +17 -0
- package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/styles.module.css +49 -0
- package/dist/cjs/components/NotificationPanelContent/helperComponents/index.d.ts +1 -0
- package/dist/cjs/components/NotificationPanelContent/helperComponents/index.js +17 -0
- package/dist/cjs/components/NotificationPanelContent/index.d.ts +2 -0
- package/dist/cjs/components/NotificationPanelContent/index.js +18 -0
- package/dist/cjs/components/NotificationPanelContent/styles.module.css +98 -0
- package/dist/cjs/components/index.d.ts +3 -0
- package/dist/cjs/components/index.js +19 -0
- package/dist/cjs/constants.d.ts +57 -0
- package/dist/cjs/constants.js +60 -0
- package/dist/cjs/helperComponents/ActionsButton/ActionsButton.d.ts +19 -0
- package/dist/cjs/helperComponents/ActionsButton/ActionsButton.js +28 -0
- package/dist/cjs/helperComponents/ActionsButton/index.d.ts +1 -0
- package/dist/cjs/helperComponents/ActionsButton/index.js +17 -0
- package/dist/cjs/helperComponents/ActionsButton/styles.module.css +3 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +22 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/style.css +483 -0
- package/dist/cjs/types.d.ts +12 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/utils.d.ts +3 -0
- package/dist/cjs/utils.js +7 -0
- package/dist/esm/components/NotificationCard/NotificationCard.d.ts +43 -0
- package/dist/esm/components/NotificationCard/NotificationCard.js +74 -0
- package/dist/esm/components/NotificationCard/NotificationCardSkeleton.d.ts +7 -0
- package/dist/esm/components/NotificationCard/NotificationCardSkeleton.js +10 -0
- package/dist/esm/components/NotificationCard/helpers.d.ts +4 -0
- package/dist/esm/components/NotificationCard/helpers.js +27 -0
- package/dist/esm/components/NotificationCard/index.d.ts +2 -0
- package/dist/esm/components/NotificationCard/index.js +2 -0
- package/dist/esm/components/NotificationCard/styles.module.css +216 -0
- package/dist/esm/components/NotificationPanel/NotificationPanel.d.ts +22 -0
- package/dist/esm/components/NotificationPanel/NotificationPanel.js +17 -0
- package/dist/esm/components/NotificationPanel/index.d.ts +1 -0
- package/dist/esm/components/NotificationPanel/index.js +1 -0
- package/dist/esm/components/NotificationPanel/styles.module.css +10 -0
- package/dist/esm/components/NotificationPanelContent/NotificationPanelContent.d.ts +45 -0
- package/dist/esm/components/NotificationPanelContent/NotificationPanelContent.js +37 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.d.ts +18 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.js +37 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/hooks.d.ts +17 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/hooks.js +19 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/index.d.ts +1 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/index.js +1 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/styles.module.css +69 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/utils.d.ts +4 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/utils.js +7 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.d.ts +4 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.js +9 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/index.d.ts +1 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/index.js +1 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/styles.module.css +3 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.d.ts +12 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.js +11 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/index.d.ts +1 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/index.js +1 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/styles.module.css +35 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.d.ts +12 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.js +21 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.d.ts +9 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.js +21 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/index.d.ts +1 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/index.js +1 -0
- package/dist/esm/components/NotificationPanelContent/components/index.d.ts +4 -0
- package/dist/esm/components/NotificationPanelContent/components/index.js +4 -0
- package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/StackTail.d.ts +6 -0
- package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/StackTail.js +5 -0
- package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/index.d.ts +1 -0
- package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/index.js +1 -0
- package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/styles.module.css +49 -0
- package/dist/esm/components/NotificationPanelContent/helperComponents/index.d.ts +1 -0
- package/dist/esm/components/NotificationPanelContent/helperComponents/index.js +1 -0
- package/dist/esm/components/NotificationPanelContent/index.d.ts +2 -0
- package/dist/esm/components/NotificationPanelContent/index.js +2 -0
- package/dist/esm/components/NotificationPanelContent/styles.module.css +98 -0
- package/dist/esm/components/index.d.ts +3 -0
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/constants.d.ts +57 -0
- package/dist/esm/constants.js +57 -0
- package/dist/esm/helperComponents/ActionsButton/ActionsButton.d.ts +19 -0
- package/dist/esm/helperComponents/ActionsButton/ActionsButton.js +22 -0
- package/dist/esm/helperComponents/ActionsButton/index.d.ts +1 -0
- package/dist/esm/helperComponents/ActionsButton/index.js +1 -0
- package/dist/esm/helperComponents/ActionsButton/styles.module.css +3 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/style.css +483 -0
- package/dist/esm/types.d.ts +12 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/utils.d.ts +3 -0
- package/dist/esm/utils.js +4 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/package.json +60 -0
- package/src/components/NotificationCard/NotificationCard.tsx +252 -0
- package/src/components/NotificationCard/NotificationCardSkeleton.tsx +40 -0
- package/src/components/NotificationCard/helpers.tsx +36 -0
- package/src/components/NotificationCard/index.ts +2 -0
- package/src/components/NotificationCard/styles.module.scss +165 -0
- package/src/components/NotificationPanel/NotificationPanel.tsx +56 -0
- package/src/components/NotificationPanel/index.ts +1 -0
- package/src/components/NotificationPanel/styles.module.scss +15 -0
- package/src/components/NotificationPanelContent/NotificationPanelContent.tsx +168 -0
- package/src/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.tsx +128 -0
- package/src/components/NotificationPanelContent/components/NotificationCardStack/hooks.ts +45 -0
- package/src/components/NotificationPanelContent/components/NotificationCardStack/index.ts +1 -0
- package/src/components/NotificationPanelContent/components/NotificationCardStack/styles.module.scss +90 -0
- package/src/components/NotificationPanelContent/components/NotificationCardStack/utils.ts +11 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.tsx +21 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelBlank/index.ts +1 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelBlank/styles.module.scss +5 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.tsx +31 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelGroup/index.ts +1 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelGroup/styles.module.scss +45 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.tsx +34 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.tsx +43 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelSettings/index.ts +1 -0
- package/src/components/NotificationPanelContent/components/index.ts +4 -0
- package/src/components/NotificationPanelContent/helperComponents/StackTail/StackTail.tsx +17 -0
- package/src/components/NotificationPanelContent/helperComponents/StackTail/index.ts +1 -0
- package/src/components/NotificationPanelContent/helperComponents/StackTail/styles.module.scss +85 -0
- package/src/components/NotificationPanelContent/helperComponents/index.ts +1 -0
- package/src/components/NotificationPanelContent/index.ts +2 -0
- package/src/components/NotificationPanelContent/styles.module.scss +116 -0
- package/src/components/index.ts +3 -0
- package/src/constants.ts +58 -0
- package/src/helperComponents/ActionsButton/ActionsButton.tsx +73 -0
- package/src/helperComponents/ActionsButton/index.ts +1 -0
- package/src/helperComponents/ActionsButton/styles.module.scss +3 -0
- package/src/index.ts +4 -0
- package/src/types.ts +15 -0
- package/src/utils.ts +6 -0
|
@@ -0,0 +1,43 @@
|
|
|
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.NotificationCardStack = NotificationCardStack;
|
|
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 react_1 = require("react");
|
|
14
|
+
const constants_1 = require("../../../../constants");
|
|
15
|
+
const ActionsButton_1 = require("../../../../helperComponents/ActionsButton");
|
|
16
|
+
const StackTail_1 = require("../../helperComponents/StackTail");
|
|
17
|
+
const hooks_1 = require("./hooks");
|
|
18
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
19
|
+
const utils_2 = require("./utils");
|
|
20
|
+
const ANIMATION_DURATION = 0.3;
|
|
21
|
+
function NotificationCardStack({ children, defaultOpen, onOpenChanged, title, actions, unread, ...rest }) {
|
|
22
|
+
const [actionsOpen, setActionsOpen] = (0, react_1.useState)(false);
|
|
23
|
+
const { open, toggleOpen, isVisible } = (0, hooks_1.useAnimatedOpening)({
|
|
24
|
+
defaultOpen,
|
|
25
|
+
onOpenChanged,
|
|
26
|
+
duration: ANIMATION_DURATION * 1000,
|
|
27
|
+
});
|
|
28
|
+
const [first, ...stack] = (0, react_1.useMemo)(() => react_1.Children.toArray(children), [children]);
|
|
29
|
+
if (!first) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
if (!stack.length) {
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)("div", { "data-test-id": constants_1.TEST_IDS.panel.cardStack.wrapper, ...(0, utils_1.extractSupportProps)(rest), children: first }));
|
|
34
|
+
}
|
|
35
|
+
const firstCardElement = open
|
|
36
|
+
? first
|
|
37
|
+
: (0, utils_2.cloneCard)(first, componentProps => ({
|
|
38
|
+
...componentProps,
|
|
39
|
+
onClick: toggleOpen,
|
|
40
|
+
unread: unread || componentProps.unread,
|
|
41
|
+
}));
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.container, style: { '--snack-notification-stack-animation-duration': `${ANIMATION_DURATION}s` }, "data-test-id": constants_1.TEST_IDS.panel.cardStack.wrapper, ...(0, utils_1.extractSupportProps)(rest), children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.header, "data-test-id": constants_1.TEST_IDS.panel.cardStack.headline, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: 'label', size: 'l', as: 'div', className: styles_module_scss_1.default.title, onClick: toggleOpen, "aria-expanded": open, children: (0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, { "data-test-id": constants_1.TEST_IDS.panel.cardStack.title, text: title }) }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.right, children: [actions && actions.length > 0 && ((0, jsx_runtime_1.jsx)(ActionsButton_1.ActionsButton, { actions: actions, open: actionsOpen, setDroplistOpen: setActionsOpen, icon: (0, jsx_runtime_1.jsx)(system_1.KebabSVG, {}), triggerAriaLabel: '\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0441\u043E \u0441\u0442\u043E\u043F\u043A\u043E\u0439', testIds: constants_1.TEST_IDS.panel.cardStack.actions })), (0, jsx_runtime_1.jsx)(button_1.Button, { view: 'function', appearance: 'neutral', size: 'm', onClick: toggleOpen, "aria-label": open ? 'Свернуть стопку' : 'Развернуть стопку', "aria-expanded": open, "data-test-id": constants_1.TEST_IDS.panel.cardStack.openButton, icon: open ? (0, jsx_runtime_1.jsx)(system_1.ChevronUpSVG, {}) : (0, jsx_runtime_1.jsx)(system_1.ChevronDownSVG, {}) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.cards, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.first, children: [(0, jsx_runtime_1.jsx)(StackTail_1.StackTail, { open: open, count: stack.length }), firstCardElement] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.stack, "data-open": open || undefined, "data-tail-size": stack.length, children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.animationContainer, children: isVisible ? stack : [] }) })] })] }));
|
|
43
|
+
}
|
package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/hooks.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type UseAnimatedOpeningProps = {
|
|
2
|
+
defaultOpen?: boolean;
|
|
3
|
+
onOpenChanged?(open: boolean): void;
|
|
4
|
+
/** Длительность анимации раскрытия/схлопывания, мс. */
|
|
5
|
+
duration: number;
|
|
6
|
+
};
|
|
7
|
+
type UseAnimatedOpeningResult = {
|
|
8
|
+
open: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Карточки стопки остаются в DOM на время анимации схлопывания, чтобы успел
|
|
11
|
+
* проиграться transition. Сбрасывается в `false` через `duration` после закрытия.
|
|
12
|
+
*/
|
|
13
|
+
isVisible: boolean;
|
|
14
|
+
toggleOpen(): void;
|
|
15
|
+
};
|
|
16
|
+
export declare function useAnimatedOpening({ defaultOpen, onOpenChanged, duration, }: UseAnimatedOpeningProps): UseAnimatedOpeningResult;
|
|
17
|
+
export {};
|
package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/hooks.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAnimatedOpening = useAnimatedOpening;
|
|
4
|
+
const utils_1 = require("@cloud-ru/ds-utils");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
function useAnimatedOpening({ defaultOpen = false, onOpenChanged, duration, }) {
|
|
7
|
+
const [open, setOpen] = (0, utils_1.useUncontrolledProp)(undefined, defaultOpen, onOpenChanged);
|
|
8
|
+
const [isVisible, setIsVisible] = (0, react_1.useState)(open);
|
|
9
|
+
const timeout = (0, react_1.useRef)();
|
|
10
|
+
const toggleOpen = (0, react_1.useCallback)(() => setOpen(!open), [open, setOpen]);
|
|
11
|
+
(0, react_1.useEffect)(() => {
|
|
12
|
+
clearTimeout(timeout.current);
|
|
13
|
+
if (open) {
|
|
14
|
+
setIsVisible(true);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
timeout.current = setTimeout(() => setIsVisible(false), duration);
|
|
18
|
+
}
|
|
19
|
+
return () => clearTimeout(timeout.current);
|
|
20
|
+
}, [open, duration]);
|
|
21
|
+
return { open, isVisible, toggleOpen };
|
|
22
|
+
}
|
package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationCardStack';
|
package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/index.js
ADDED
|
@@ -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("./NotificationCardStack"), exports);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
.container{
|
|
2
|
+
position:relative;
|
|
3
|
+
display:flex;
|
|
4
|
+
flex-direction:column;
|
|
5
|
+
gap:var(--sn-primitive-dimension-8, 8px);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.header{
|
|
9
|
+
display:flex;
|
|
10
|
+
align-items:center;
|
|
11
|
+
justify-content:space-between;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.title{
|
|
15
|
+
cursor:default;
|
|
16
|
+
flex:1 1 auto;
|
|
17
|
+
min-width:0;
|
|
18
|
+
color:var(--sn-theme-color-available-version-textMain, var(--sn-brand-color-text-version-main, #41424e));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.right{
|
|
22
|
+
display:flex;
|
|
23
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
24
|
+
align-items:center;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.cards{
|
|
28
|
+
display:flex;
|
|
29
|
+
flex-direction:column;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.first{
|
|
33
|
+
position:relative;
|
|
34
|
+
display:flex;
|
|
35
|
+
flex-direction:column-reverse;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.stack{
|
|
39
|
+
position:relative;
|
|
40
|
+
overflow:visible;
|
|
41
|
+
height:auto;
|
|
42
|
+
transition:overflow var(--snack-notification-stack-animation-duration) allow-discrete step-end;
|
|
43
|
+
}
|
|
44
|
+
.stack:not([data-open]){
|
|
45
|
+
overflow:hidden;
|
|
46
|
+
transition:height var(--snack-notification-stack-animation-duration) allow-discrete step-end;
|
|
47
|
+
}
|
|
48
|
+
.stack:not([data-open])[data-tail-size]{
|
|
49
|
+
height:var(--sn-primitive-dimension-8, 8px);
|
|
50
|
+
}
|
|
51
|
+
.stack:not([data-open])[data-tail-size="1"]{
|
|
52
|
+
height:var(--sn-primitive-dimension-4, 4px);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.animationContainer{
|
|
56
|
+
translate:0 -100%;
|
|
57
|
+
scale:0.98;
|
|
58
|
+
display:flex;
|
|
59
|
+
flex-direction:column;
|
|
60
|
+
gap:var(--sn-primitive-dimension-8, 8px);
|
|
61
|
+
margin-top:var(--sn-primitive-dimension-8, 8px);
|
|
62
|
+
opacity:0;
|
|
63
|
+
transition:translate var(--snack-notification-stack-animation-duration), scale var(--snack-notification-stack-animation-duration), opacity var(--snack-notification-stack-animation-duration);
|
|
64
|
+
}
|
|
65
|
+
[data-open] .animationContainer{
|
|
66
|
+
translate:0 0;
|
|
67
|
+
scale:1;
|
|
68
|
+
opacity:1;
|
|
69
|
+
}
|
package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/utils.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type ComponentProps = Record<string, unknown>;
|
|
3
|
+
export declare const cloneCard: (element: ReactNode, props: (componentProps: ComponentProps) => ComponentProps) => string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined;
|
|
4
|
+
export {};
|
package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/utils.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cloneCard = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const cloneCard = (element, props) => {
|
|
6
|
+
if (!(0, react_1.isValidElement)(element)) {
|
|
7
|
+
return element;
|
|
8
|
+
}
|
|
9
|
+
return (0, react_1.cloneElement)(element, props(element.props));
|
|
10
|
+
};
|
|
11
|
+
exports.cloneCard = cloneCard;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InfoBlockProps } from '@cloud-ru/ds-info-block';
|
|
2
|
+
export type NotificationPanelBlankProps = Omit<InfoBlockProps, 'footer' | 'align' | 'size'>;
|
|
3
|
+
/** Заглушка вместо карточек в панели */
|
|
4
|
+
export declare function NotificationPanelBlank({ icon, className, ...props }: NotificationPanelBlankProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
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.NotificationPanelBlank = NotificationPanelBlank;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const info_block_1 = require("@cloud-ru/ds-info-block");
|
|
9
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
10
|
+
const constants_1 = require("../../../../constants");
|
|
11
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
12
|
+
/** Заглушка вместо карточек в панели */
|
|
13
|
+
function NotificationPanelBlank({ icon, className, ...props }) {
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(info_block_1.InfoBlock, { ...props, icon: icon ? { ...icon, appearance: icon.appearance ?? 'neutral' } : undefined, size: 'l', align: 'vertical', className: (0, classnames_1.default)(styles_module_scss_1.default.notificationPanelBlank, className), "data-test-id": props['data-test-id'] ?? constants_1.TEST_IDS.panel.blank }));
|
|
15
|
+
}
|
package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationPanelBlank';
|
package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/index.js
ADDED
|
@@ -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("./NotificationPanelBlank"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { WithSupportProps } from '@cloud-ru/ds-utils';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type NotificationPanelGroupProps = WithSupportProps<{
|
|
4
|
+
/** Заголовок группы */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Содержимое группы */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/** CSS-класс */
|
|
9
|
+
className?: string;
|
|
10
|
+
}>;
|
|
11
|
+
/** Группа уведомлений с заголовком внутри панели */
|
|
12
|
+
export declare function NotificationPanelGroup({ title, children, className, ...rest }: NotificationPanelGroupProps): 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.NotificationPanelGroup = NotificationPanelGroup;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const truncate_string_1 = require("@cloud-ru/ds-truncate-string");
|
|
9
|
+
const typography_1 = require("@cloud-ru/ds-typography");
|
|
10
|
+
const utils_1 = require("@cloud-ru/ds-utils");
|
|
11
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
12
|
+
const constants_1 = require("../../../../constants");
|
|
13
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
14
|
+
/** Группа уведомлений с заголовком внутри панели */
|
|
15
|
+
function NotificationPanelGroup({ title, children, className, ...rest }) {
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.root, className), "data-test-id": constants_1.TEST_IDS.panel.group.root, ...(0, utils_1.extractSupportProps)(rest), children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.title, "data-test-id": constants_1.TEST_IDS.panel.group.title, children: (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: 'label', size: 's', weight: 'thin', as: 'span', className: styles_module_scss_1.default.text, children: (0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, { text: title }) }) }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.content, children: children })] }));
|
|
17
|
+
}
|
package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationPanelGroup';
|
package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/index.js
ADDED
|
@@ -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("./NotificationPanelGroup"), exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.root{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
gap:var(--sn-primitive-dimension-8, 8px);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.title{
|
|
8
|
+
pointer-events:none;
|
|
9
|
+
position:sticky;
|
|
10
|
+
z-index:1;
|
|
11
|
+
top:var(--sn-primitive-dimension-4, 4px);
|
|
12
|
+
display:flex;
|
|
13
|
+
justify-content:center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.text{
|
|
17
|
+
pointer-events:initial;
|
|
18
|
+
display:inline-flex;
|
|
19
|
+
align-items:center;
|
|
20
|
+
justify-content:center;
|
|
21
|
+
min-height:var(--sn-primitive-dimension-20, 20px);
|
|
22
|
+
color:var(--sn-theme-color-available-version-textDisabled, var(--sn-brand-color-text-version-disabled, rgba(65, 66, 78, 0.3490196078)));
|
|
23
|
+
background-color:var(--sn-theme-color-neutral-background1Level, var(--sn-brand-color-neutral-95, var(--sn-primitive-color-gray-95, #fdfdfd)));
|
|
24
|
+
}
|
|
25
|
+
.text[data-size][data-weight][data-variant]{
|
|
26
|
+
padding-inline:var(--sn-primitive-dimension-8, 8px);
|
|
27
|
+
border:var(--sn-primitive-strokeWeight-strokeRegular, 1px) solid var(--sn-theme-color-neutral-decorTransparent, var(--sn-brand-color-neutral-transparent-forLightMode, rgba(124, 131, 182, 0.0784313725)));
|
|
28
|
+
border-radius:var(--sn-density-radius-xl, var(--sn-primitive-dimension-28, 28px));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.content{
|
|
32
|
+
display:flex;
|
|
33
|
+
flex-direction:column;
|
|
34
|
+
gap:var(--sn-primitive-dimension-8, 8px);
|
|
35
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ButtonProps } from '@cloud-ru/ds-button';
|
|
2
|
+
import { ElementType } from 'react';
|
|
3
|
+
import { Action } from '../../../../types';
|
|
4
|
+
export type NotificationPanelSettingsProps = {
|
|
5
|
+
/** Дополнительные действия панели */
|
|
6
|
+
actions?: Action[];
|
|
7
|
+
/** Кнопка дополнительного действия панели */
|
|
8
|
+
button?: Omit<ButtonProps<ElementType>, 'label' | 'size' | 'view' | 'data-test-id'>;
|
|
9
|
+
size?: 's' | 'm';
|
|
10
|
+
};
|
|
11
|
+
/** Кнопка настроек панели уведомлений (с выпадающим списком действий, если переданы). */
|
|
12
|
+
export declare function NotificationPanelSettings({ actions, button, size }: NotificationPanelSettingsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationPanelSettings = NotificationPanelSettings;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const button_1 = require("@cloud-ru/ds-button");
|
|
6
|
+
const system_1 = require("@cloud-ru/ds-icons/interface/system");
|
|
7
|
+
const constants_1 = require("../../../../constants");
|
|
8
|
+
const NotificationPanelSettingsDroplist_1 = require("./NotificationPanelSettingsDroplist");
|
|
9
|
+
/** Кнопка настроек панели уведомлений (с выпадающим списком действий, если переданы). */
|
|
10
|
+
function NotificationPanelSettings({ actions, button, size = 'm' }) {
|
|
11
|
+
const buttonProps = {
|
|
12
|
+
...button,
|
|
13
|
+
view: 'function',
|
|
14
|
+
appearance: 'neutral',
|
|
15
|
+
size,
|
|
16
|
+
icon: button?.icon || (0, jsx_runtime_1.jsx)(system_1.SettingsSVG, {}),
|
|
17
|
+
'aria-label': button?.['aria-label'] ?? 'Настройки уведомлений',
|
|
18
|
+
'data-test-id': constants_1.TEST_IDS.panel.settings.droplistTrigger,
|
|
19
|
+
};
|
|
20
|
+
if (!actions?.length) {
|
|
21
|
+
return (0, jsx_runtime_1.jsx)(button_1.Button, { ...buttonProps });
|
|
22
|
+
}
|
|
23
|
+
return (0, jsx_runtime_1.jsx)(NotificationPanelSettingsDroplist_1.NotificationPanelSettingsDroplist, { actions: actions, button: buttonProps });
|
|
24
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonProps } from '@cloud-ru/ds-button';
|
|
2
|
+
import { ElementType } from 'react';
|
|
3
|
+
import { Action } from '../../../../types';
|
|
4
|
+
type NotificationPanelSettingsDroplistProps = {
|
|
5
|
+
actions: Action[];
|
|
6
|
+
button: ButtonProps<ElementType>;
|
|
7
|
+
};
|
|
8
|
+
export declare function NotificationPanelSettingsDroplist({ actions, button }: NotificationPanelSettingsDroplistProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
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.NotificationPanelSettingsDroplist = NotificationPanelSettingsDroplist;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const button_1 = require("@cloud-ru/ds-button");
|
|
9
|
+
const list_1 = require("@cloud-ru/ds-list");
|
|
10
|
+
const tag_1 = require("@cloud-ru/ds-tag");
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const constants_1 = require("../../../../constants");
|
|
13
|
+
const styles_module_scss_1 = __importDefault(require('../../styles.module.css'));
|
|
14
|
+
function NotificationPanelSettingsDroplist({ actions, button }) {
|
|
15
|
+
const [isDroplistOpen, setDroplistOpen] = (0, react_1.useState)(false);
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(list_1.Droplist, { trigger: 'click', open: isDroplistOpen, onOpenChange: setDroplistOpen, scroll: true, placement: 'bottom-end', size: 'm', "data-test-id": constants_1.TEST_IDS.panel.settings.droplist, triggerClassName: styles_module_scss_1.default.inlineFlex, items: actions.map(({ icon, content, tagLabel, disabled, onClick }, index) => ({
|
|
17
|
+
onClick: e => {
|
|
18
|
+
setDroplistOpen(false);
|
|
19
|
+
onClick?.(e);
|
|
20
|
+
},
|
|
21
|
+
disabled,
|
|
22
|
+
content,
|
|
23
|
+
beforeContent: icon,
|
|
24
|
+
afterContent: tagLabel ? (0, jsx_runtime_1.jsx)(tag_1.Tag, { label: tagLabel }) : undefined,
|
|
25
|
+
'data-test-id': `${constants_1.TEST_IDS.panel.settings.droplistAction}-${index}`,
|
|
26
|
+
})), children: (0, jsx_runtime_1.jsx)(button_1.Button, { ...button }) }));
|
|
27
|
+
}
|
package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationPanelSettings';
|
package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/index.js
ADDED
|
@@ -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("./NotificationPanelSettings"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./NotificationPanelBlank"), exports);
|
|
18
|
+
__exportStar(require("./NotificationPanelGroup"), exports);
|
|
19
|
+
__exportStar(require("./NotificationPanelSettings"), exports);
|
|
20
|
+
__exportStar(require("./NotificationCardStack"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
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.StackTail = StackTail;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
9
|
+
function StackTail({ open, count }) {
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.container, "data-open": open || undefined, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.animationContainer, children: [count > 1 && (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.card, "data-level": '3' }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.card, "data-level": '2' })] }) }));
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StackTail';
|
|
@@ -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("./StackTail"), exports);
|
package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/styles.module.css
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.container{
|
|
2
|
+
position:relative;
|
|
3
|
+
height:0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.animationContainer{
|
|
7
|
+
position:absolute;
|
|
8
|
+
top:0;
|
|
9
|
+
bottom:calc(-1 * var(--sn-primitive-dimension-8, 8px));
|
|
10
|
+
overflow:hidden;
|
|
11
|
+
width:100%;
|
|
12
|
+
transition:bottom calc(var(--snack-notification-stack-animation-duration) / 2) calc(calc(var(--snack-notification-stack-animation-duration) / 2) / 1.7) ease-out;
|
|
13
|
+
}
|
|
14
|
+
[data-open] .animationContainer{
|
|
15
|
+
bottom:calc(-1 * 416px);
|
|
16
|
+
transition:bottom calc(var(--snack-notification-stack-animation-duration) / 2) ease-out;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.card{
|
|
20
|
+
position:absolute;
|
|
21
|
+
overflow:hidden;
|
|
22
|
+
height:200px;
|
|
23
|
+
border:var(--sn-primitive-strokeWeight-strokeRegular, 1px) solid var(--sn-theme-color-available-borderColor, var(--sn-brand-color-state-neutralBorder-forLightMode-default-borderColor, rgba(159, 166, 198, 0.3019607843)));
|
|
24
|
+
border-radius:var(--sn-density-radius-2xs, var(--sn-primitive-dimension-4, 4px));
|
|
25
|
+
background-color:var(--sn-theme-color-neutral-background1Level, var(--sn-brand-color-neutral-95, var(--sn-primitive-color-gray-95, #fdfdfd)));
|
|
26
|
+
transition:right calc(var(--snack-notification-stack-animation-duration) / 2) calc(var(--snack-notification-stack-animation-duration) / 2) ease, left calc(var(--snack-notification-stack-animation-duration) / 2) calc(var(--snack-notification-stack-animation-duration) / 2) ease, opacity calc(var(--snack-notification-stack-animation-duration) / 2) calc(var(--snack-notification-stack-animation-duration) / 2) ease;
|
|
27
|
+
}
|
|
28
|
+
.card::after{
|
|
29
|
+
content:"";
|
|
30
|
+
position:absolute;
|
|
31
|
+
inset:0;
|
|
32
|
+
background-color:var(--sn-theme-color-neutral-decorTransparent, var(--sn-brand-color-neutral-transparent-forLightMode, rgba(124, 131, 182, 0.0784313725)));
|
|
33
|
+
}
|
|
34
|
+
.card[data-level="2"]{
|
|
35
|
+
right:var(--sn-primitive-dimension-4, 4px);
|
|
36
|
+
bottom:50%;
|
|
37
|
+
left:var(--sn-primitive-dimension-4, 4px);
|
|
38
|
+
}
|
|
39
|
+
.card[data-level="3"]{
|
|
40
|
+
right:var(--sn-primitive-dimension-8, 8px);
|
|
41
|
+
bottom:0;
|
|
42
|
+
left:var(--sn-primitive-dimension-8, 8px);
|
|
43
|
+
}
|
|
44
|
+
[data-open] .card{
|
|
45
|
+
right:0;
|
|
46
|
+
left:0;
|
|
47
|
+
opacity:0;
|
|
48
|
+
transition:right calc(var(--snack-notification-stack-animation-duration) / 2) ease, left calc(var(--snack-notification-stack-animation-duration) / 2) ease, opacity calc(var(--snack-notification-stack-animation-duration) / 2) ease;
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StackTail';
|
|
@@ -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("./StackTail"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./NotificationPanelContent"), exports);
|
|
18
|
+
__exportStar(require("./components"), exports);
|