@snack-uikit/notification 0.7.59 → 0.7.60-preview-ba12ca94.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/dist/cjs/components/NotificationCard/NotificationCard.js +156 -0
- package/dist/cjs/components/NotificationCard/components/NotificationCardFunction.js +64 -0
- package/dist/cjs/components/NotificationCard/components/NotificationCardSkeleton.js +60 -0
- package/dist/cjs/components/NotificationCard/components/index.js +26 -0
- package/dist/cjs/components/NotificationCard/constants.js +28 -0
- package/dist/cjs/components/NotificationCard/helpers.js +32 -0
- package/dist/cjs/components/NotificationCard/index.js +25 -0
- package/dist/cjs/components/NotificationCard/types.js +5 -0
- package/dist/cjs/components/NotificationPanel/NotificationPanel.js +112 -0
- package/dist/cjs/components/NotificationPanel/components/NotificationPanelBlank/NotificationPanelBlank.js +42 -0
- package/dist/cjs/components/NotificationPanel/components/NotificationPanelBlank/index.js +25 -0
- package/dist/cjs/components/NotificationPanel/components/NotificationPanelDivider/NotificationPanelDivider.js +37 -0
- package/dist/cjs/components/NotificationPanel/components/NotificationPanelDivider/index.js +25 -0
- package/dist/cjs/components/NotificationPanel/components/NotificationPanelSettings/NotificationPanelSettings.js +29 -0
- package/dist/cjs/components/NotificationPanel/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.js +50 -0
- package/dist/cjs/components/NotificationPanel/components/NotificationPanelSettings/index.js +25 -0
- package/dist/cjs/components/NotificationPanel/components/index.js +26 -0
- package/dist/cjs/components/NotificationPanel/constants.js +18 -0
- package/dist/cjs/components/NotificationPanel/index.js +25 -0
- package/dist/cjs/components/NotificationPanelPopover/NotificationPanelPopover.js +53 -0
- package/dist/cjs/components/NotificationPanelPopover/index.js +25 -0
- package/dist/cjs/components/index.js +27 -0
- package/dist/cjs/index.js +25 -0
- package/dist/esm/components/NotificationCard/NotificationCard.d.ts +43 -0
- package/dist/esm/components/NotificationCard/components/NotificationCardFunction.d.ts +7 -0
- package/dist/esm/components/NotificationCard/components/NotificationCardSkeleton.d.ts +1 -0
- package/dist/esm/components/NotificationCard/components/index.js +2 -0
- package/dist/esm/components/NotificationCard/constants.d.ts +22 -0
- package/dist/esm/components/NotificationCard/helpers.d.ts +2 -0
- package/dist/esm/components/NotificationCard/index.js +1 -0
- package/dist/esm/components/NotificationCard/styles.module.css +135 -0
- package/dist/esm/components/NotificationCard/types.d.ts +3 -0
- package/dist/esm/components/NotificationPanel/NotificationPanel.d.ts +43 -0
- package/dist/esm/components/NotificationPanel/components/NotificationPanelBlank/NotificationPanelBlank.d.ts +4 -0
- package/dist/esm/components/NotificationPanel/components/NotificationPanelBlank/index.js +1 -0
- package/dist/esm/components/NotificationPanel/components/NotificationPanelBlank/styles.module.css +3 -0
- package/dist/esm/components/NotificationPanel/components/NotificationPanelDivider/NotificationPanelDivider.d.ts +8 -0
- package/dist/esm/components/NotificationPanel/components/NotificationPanelDivider/index.js +1 -0
- package/dist/esm/components/NotificationPanel/components/NotificationPanelDivider/styles.module.css +10 -0
- package/dist/esm/components/NotificationPanel/components/NotificationPanelSettings/NotificationPanelSettings.d.ts +9 -0
- package/dist/esm/components/NotificationPanel/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.d.ts +13 -0
- package/dist/esm/components/NotificationPanel/components/NotificationPanelSettings/index.js +1 -0
- package/dist/esm/components/NotificationPanel/components/index.js +2 -0
- package/dist/esm/components/NotificationPanel/constants.d.ts +12 -0
- package/dist/esm/components/NotificationPanel/index.js +1 -0
- package/dist/esm/components/NotificationPanel/styles.module.css +111 -0
- package/dist/esm/components/NotificationPanelPopover/NotificationPanelPopover.d.ts +11 -0
- package/dist/esm/components/NotificationPanelPopover/index.js +1 -0
- package/dist/esm/components/NotificationPanelPopover/styles.module.css +20 -0
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/index.js +1 -0
- package/package.json +22 -18
- /package/dist/{components → cjs/components}/NotificationCard/NotificationCard.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationCard/components/NotificationCardFunction.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationCard/components/NotificationCardSkeleton.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationCard/components/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationCard/constants.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationCard/helpers.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationCard/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationCard/styles.module.css +0 -0
- /package/dist/{components → cjs/components}/NotificationCard/types.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationPanel/NotificationPanel.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationPanel/components/NotificationPanelBlank/NotificationPanelBlank.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationPanel/components/NotificationPanelBlank/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationPanel/components/NotificationPanelBlank/styles.module.css +0 -0
- /package/dist/{components → cjs/components}/NotificationPanel/components/NotificationPanelDivider/NotificationPanelDivider.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationPanel/components/NotificationPanelDivider/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationPanel/components/NotificationPanelDivider/styles.module.css +0 -0
- /package/dist/{components → cjs/components}/NotificationPanel/components/NotificationPanelSettings/NotificationPanelSettings.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationPanel/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationPanel/components/NotificationPanelSettings/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationPanel/components/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationPanel/constants.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationPanel/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationPanel/styles.module.css +0 -0
- /package/dist/{components → cjs/components}/NotificationPanelPopover/NotificationPanelPopover.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationPanelPopover/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/NotificationPanelPopover/styles.module.css +0 -0
- /package/dist/{components → cjs/components}/index.d.ts +0 -0
- /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/{components → esm/components}/NotificationCard/NotificationCard.js +0 -0
- /package/dist/{components → esm/components}/NotificationCard/components/NotificationCardFunction.js +0 -0
- /package/dist/{components → esm/components}/NotificationCard/components/NotificationCardSkeleton.js +0 -0
- /package/dist/{components/NotificationCard/components/index.js → esm/components/NotificationCard/components/index.d.ts} +0 -0
- /package/dist/{components → esm/components}/NotificationCard/constants.js +0 -0
- /package/dist/{components → esm/components}/NotificationCard/helpers.js +0 -0
- /package/dist/{components/NotificationCard/index.js → esm/components/NotificationCard/index.d.ts} +0 -0
- /package/dist/{components → esm/components}/NotificationCard/types.js +0 -0
- /package/dist/{components → esm/components}/NotificationPanel/NotificationPanel.js +0 -0
- /package/dist/{components → esm/components}/NotificationPanel/components/NotificationPanelBlank/NotificationPanelBlank.js +0 -0
- /package/dist/{components/NotificationPanel/components/NotificationPanelBlank/index.js → esm/components/NotificationPanel/components/NotificationPanelBlank/index.d.ts} +0 -0
- /package/dist/{components → esm/components}/NotificationPanel/components/NotificationPanelDivider/NotificationPanelDivider.js +0 -0
- /package/dist/{components/NotificationPanel/components/NotificationPanelDivider/index.js → esm/components/NotificationPanel/components/NotificationPanelDivider/index.d.ts} +0 -0
- /package/dist/{components → esm/components}/NotificationPanel/components/NotificationPanelSettings/NotificationPanelSettings.js +0 -0
- /package/dist/{components → esm/components}/NotificationPanel/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.js +0 -0
- /package/dist/{components/NotificationPanel/components/NotificationPanelSettings/index.js → esm/components/NotificationPanel/components/NotificationPanelSettings/index.d.ts} +0 -0
- /package/dist/{components/NotificationPanel/components/index.js → esm/components/NotificationPanel/components/index.d.ts} +0 -0
- /package/dist/{components → esm/components}/NotificationPanel/constants.js +0 -0
- /package/dist/{components/NotificationPanel/index.js → esm/components/NotificationPanel/index.d.ts} +0 -0
- /package/dist/{components → esm/components}/NotificationPanelPopover/NotificationPanelPopover.js +0 -0
- /package/dist/{components/NotificationPanelPopover/index.js → esm/components/NotificationPanelPopover/index.d.ts} +0 -0
- /package/dist/{components/index.js → esm/components/index.d.ts} +0 -0
- /package/dist/{index.js → esm/index.d.ts} +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NotificationPanelSettingsDroplist = NotificationPanelSettingsDroplist;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const button_1 = require("@snack-uikit/button");
|
|
10
|
+
const list_1 = require("@snack-uikit/list");
|
|
11
|
+
const tag_1 = require("@snack-uikit/tag");
|
|
12
|
+
const constants_1 = require("../../constants");
|
|
13
|
+
function NotificationPanelSettingsDroplist(_ref) {
|
|
14
|
+
let {
|
|
15
|
+
actions,
|
|
16
|
+
button
|
|
17
|
+
} = _ref;
|
|
18
|
+
const [isDroplistOpen, setDroplistOpen] = (0, react_1.useState)(false);
|
|
19
|
+
return (0, jsx_runtime_1.jsx)(list_1.Droplist, {
|
|
20
|
+
trigger: 'clickAndFocusVisible',
|
|
21
|
+
open: isDroplistOpen,
|
|
22
|
+
onOpenChange: setDroplistOpen,
|
|
23
|
+
scroll: true,
|
|
24
|
+
placement: 'bottom-end',
|
|
25
|
+
"data-test-id": constants_1.TEST_IDS.settings.droplist,
|
|
26
|
+
items: actions.map(_ref2 => {
|
|
27
|
+
let {
|
|
28
|
+
icon,
|
|
29
|
+
content,
|
|
30
|
+
tagLabel,
|
|
31
|
+
disabled,
|
|
32
|
+
onClick
|
|
33
|
+
} = _ref2;
|
|
34
|
+
return {
|
|
35
|
+
onClick: e => {
|
|
36
|
+
setDroplistOpen(false);
|
|
37
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
38
|
+
},
|
|
39
|
+
disabled,
|
|
40
|
+
content,
|
|
41
|
+
beforeContent: icon,
|
|
42
|
+
afterContent: tagLabel ? (0, jsx_runtime_1.jsx)(tag_1.Tag, {
|
|
43
|
+
label: tagLabel
|
|
44
|
+
}) : undefined,
|
|
45
|
+
'data-test-id': constants_1.TEST_IDS.settings.droplistAction
|
|
46
|
+
};
|
|
47
|
+
}),
|
|
48
|
+
children: (0, jsx_runtime_1.jsx)(button_1.ButtonSimple, Object.assign({}, button))
|
|
49
|
+
});
|
|
50
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./NotificationPanelSettings"), exports);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./NotificationPanelSettings"), exports);
|
|
26
|
+
__exportStar(require("./NotificationPanelBlank"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TEST_IDS = void 0;
|
|
7
|
+
exports.TEST_IDS = {
|
|
8
|
+
title: 'notification-panel__title',
|
|
9
|
+
chip: 'notification-panel__chip',
|
|
10
|
+
settings: {
|
|
11
|
+
droplist: 'notification-panel__settings__droplist',
|
|
12
|
+
droplistTrigger: 'notification-panel__settings__droplist-trigger',
|
|
13
|
+
droplistAction: 'notification-panel__settings__droplist-action'
|
|
14
|
+
},
|
|
15
|
+
readAll: 'notification-panel__readAll',
|
|
16
|
+
footerButton: 'notification-panel__footerButton',
|
|
17
|
+
skeleton: 'notification-panel__skeleton'
|
|
18
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./NotificationPanel"), exports);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
4
|
+
var t = {};
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
|
12
|
+
return mod && mod.__esModule ? mod : {
|
|
13
|
+
"default": mod
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
exports.NotificationPanelPopover = NotificationPanelPopover;
|
|
20
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
21
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
22
|
+
const popover_private_1 = require("@snack-uikit/popover-private");
|
|
23
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
24
|
+
/** Компонент-обёртка для NotificationPanel для использования как выпадающий элемент */
|
|
25
|
+
function NotificationPanelPopover(_a) {
|
|
26
|
+
var {
|
|
27
|
+
content,
|
|
28
|
+
trigger = 'click',
|
|
29
|
+
placement = 'bottom-end',
|
|
30
|
+
children,
|
|
31
|
+
contentClassName
|
|
32
|
+
} = _a,
|
|
33
|
+
otherProps = __rest(_a, ["content", "trigger", "placement", "children", "contentClassName"]);
|
|
34
|
+
if (!children) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
return (0, jsx_runtime_1.jsx)(popover_private_1.PopoverPrivate, Object.assign({
|
|
38
|
+
fallbackPlacements: [],
|
|
39
|
+
placement: placement,
|
|
40
|
+
popoverContent: (0, jsx_runtime_1.jsx)("div", {
|
|
41
|
+
className: styles_module_scss_1.default.notificationPanelPopoverWrap,
|
|
42
|
+
children: (0, jsx_runtime_1.jsx)("div", {
|
|
43
|
+
className: (0, classnames_1.default)(styles_module_scss_1.default.notificationPanelPopover, contentClassName),
|
|
44
|
+
children: content
|
|
45
|
+
})
|
|
46
|
+
}),
|
|
47
|
+
trigger: trigger,
|
|
48
|
+
hasArrow: false,
|
|
49
|
+
heightStrategy: 'lte'
|
|
50
|
+
}, otherProps, {
|
|
51
|
+
children: children
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./NotificationPanelPopover"), exports);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./NotificationCard"), exports);
|
|
26
|
+
__exportStar(require("./NotificationPanel"), exports);
|
|
27
|
+
__exportStar(require("./NotificationPanelPopover"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./components"), exports);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { MouseEventHandler, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { ButtonSimpleProps, ButtonTonalProps } from '@snack-uikit/button';
|
|
3
|
+
import { LinkProps } from '@snack-uikit/link';
|
|
4
|
+
import { BaseItemProps } from '@snack-uikit/list';
|
|
5
|
+
import { WithSupportProps } from '@snack-uikit/utils';
|
|
6
|
+
import { Appearance } from './types';
|
|
7
|
+
type Action = {
|
|
8
|
+
icon?: ReactElement;
|
|
9
|
+
tagLabel?: string;
|
|
10
|
+
} & Pick<BaseItemProps, 'content' | 'onClick' | 'disabled'>;
|
|
11
|
+
export type NotificationCardProps = WithSupportProps<{
|
|
12
|
+
/** Идентификатор уведомления */
|
|
13
|
+
id: string;
|
|
14
|
+
/** Тип уведомления */
|
|
15
|
+
appearance?: Appearance;
|
|
16
|
+
/** Лейбл перед заголовком */
|
|
17
|
+
label?: string;
|
|
18
|
+
/** Управление состоянием прочитано/не прочитано */
|
|
19
|
+
unread?: boolean;
|
|
20
|
+
/** Заголовок уведомления */
|
|
21
|
+
title: string;
|
|
22
|
+
/** Контент уведомления */
|
|
23
|
+
content: ReactNode;
|
|
24
|
+
/** Ссылка */
|
|
25
|
+
link?: Omit<LinkProps, 'size' | 'appearance' | 'textMode' | 'data-test-id'>;
|
|
26
|
+
/** Дата уведомления */
|
|
27
|
+
date: string;
|
|
28
|
+
/** Колбэк клика по карточке */
|
|
29
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
30
|
+
/** Колбэк при попадании карточки в область видимости на 80% */
|
|
31
|
+
onVisible?(cardId: string): void;
|
|
32
|
+
/** Кнопка главного действия у карточки */
|
|
33
|
+
primaryButton?: Omit<ButtonTonalProps, 'size' | 'appearance' | 'data-test-id'>;
|
|
34
|
+
/** Кнопка второстепенного действия у карточки */
|
|
35
|
+
secondaryButton?: Omit<ButtonSimpleProps, 'size' | 'appearance' | 'data-test-id'>;
|
|
36
|
+
/** Дополнительные действия у карточки */
|
|
37
|
+
actions?: Action[];
|
|
38
|
+
/** CSS-класс */
|
|
39
|
+
className?: string;
|
|
40
|
+
}>;
|
|
41
|
+
/** Компонент карточки уведомления */
|
|
42
|
+
export declare function NotificationCard({ id, appearance, label, unread, title, content, link, date, onClick, primaryButton, secondaryButton, actions, onVisible, className, ...rest }: NotificationCardProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { NotificationCardProps } from '../NotificationCard';
|
|
3
|
+
export type NotificationCardFunctionProps = Required<Pick<NotificationCardProps, 'actions'>> & {
|
|
4
|
+
open: boolean;
|
|
5
|
+
setDroplistOpen: Dispatch<SetStateAction<boolean>>;
|
|
6
|
+
};
|
|
7
|
+
export declare function NotificationCardFunction({ actions, open, setDroplistOpen }: NotificationCardFunctionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function NotificationCardSkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const APPEARANCE: {
|
|
2
|
+
readonly Neutral: "neutral";
|
|
3
|
+
readonly Error: "error";
|
|
4
|
+
readonly ErrorCritical: "errorCritical";
|
|
5
|
+
readonly Warning: "warning";
|
|
6
|
+
readonly Success: "success";
|
|
7
|
+
};
|
|
8
|
+
export declare const TEST_IDS: {
|
|
9
|
+
label: string;
|
|
10
|
+
title: string;
|
|
11
|
+
content: string;
|
|
12
|
+
link: string;
|
|
13
|
+
date: string;
|
|
14
|
+
actions: {
|
|
15
|
+
wrapper: string;
|
|
16
|
+
droplist: string;
|
|
17
|
+
droplistTrigger: string;
|
|
18
|
+
droplistAction: string;
|
|
19
|
+
};
|
|
20
|
+
primaryButton: string;
|
|
21
|
+
secondaryButton: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationCard';
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
.notificationCardFunction{
|
|
2
|
+
padding-top:var(--space-notification-panel-card-function-badge-padding-top, 12px);
|
|
3
|
+
padding-right:var(--space-notification-panel-card-function-badge-padding-right, 20px);
|
|
4
|
+
pointer-events:none;
|
|
5
|
+
position:absolute;
|
|
6
|
+
top:0;
|
|
7
|
+
right:0;
|
|
8
|
+
display:flex;
|
|
9
|
+
opacity:0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.notificationCardTitleText{
|
|
13
|
+
box-sizing:border-box;
|
|
14
|
+
color:var(--sys-neutral-text-main, #41424e);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.notificationCardTitleIcon{
|
|
18
|
+
width:var(--size-notification-panel-card-icon-type, 20px);
|
|
19
|
+
height:var(--size-notification-panel-card-icon-type, 20px);
|
|
20
|
+
display:flex;
|
|
21
|
+
align-items:center;
|
|
22
|
+
justify-content:center;
|
|
23
|
+
box-sizing:border-box;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.notificationCard{
|
|
27
|
+
padding-left:var(--space-notification-panel-card-padding-horizontal, 24px);
|
|
28
|
+
padding-right:var(--space-notification-panel-card-padding-horizontal, 24px);
|
|
29
|
+
padding-top:var(--space-notification-panel-card-padding-vertical, 16px);
|
|
30
|
+
padding-bottom:var(--space-notification-panel-card-padding-vertical, 16px);
|
|
31
|
+
gap:var(--space-notification-panel-card-gap, 8px);
|
|
32
|
+
border-bottom-width:var(--border-width-notification-panel-card, 1px);
|
|
33
|
+
position:relative;
|
|
34
|
+
display:flex;
|
|
35
|
+
flex-direction:column;
|
|
36
|
+
box-sizing:border-box;
|
|
37
|
+
max-width:100%;
|
|
38
|
+
border-bottom-color:var(--sys-neutral-decor-default, #dde0ea);
|
|
39
|
+
border-bottom-style:solid;
|
|
40
|
+
}
|
|
41
|
+
.notificationCard::before{
|
|
42
|
+
pointer-events:none;
|
|
43
|
+
content:"";
|
|
44
|
+
position:absolute;
|
|
45
|
+
top:0;
|
|
46
|
+
left:0;
|
|
47
|
+
box-sizing:border-box;
|
|
48
|
+
width:100%;
|
|
49
|
+
height:calc(100% + var(--border-width-notification-panel-card, 1px));
|
|
50
|
+
opacity:var(--opacity-a004, 0.04);
|
|
51
|
+
}
|
|
52
|
+
.notificationCard:focus-visible{
|
|
53
|
+
outline-width:var(--border-state-focus-s-border-width, 2px);
|
|
54
|
+
outline-style:var(--border-state-focus-s-border-style, solid);
|
|
55
|
+
outline-color:var(--border-state-focus-s-border-color, );
|
|
56
|
+
border-bottom-color:transparent;
|
|
57
|
+
outline-color:var(--sys-available-complementary, #1c1c24);
|
|
58
|
+
}
|
|
59
|
+
.notificationCard[data-droplist-open]::before, .notificationCard:hover::before, .notificationCard:focus-visible::before, .notificationCard:focus-within:not(:focus)::before{
|
|
60
|
+
background-color:var(--sys-neutral-accent-default, #787b8a);
|
|
61
|
+
}
|
|
62
|
+
.notificationCard[data-droplist-open] .notificationCardFunction, .notificationCard:hover .notificationCardFunction, .notificationCard:focus-visible .notificationCardFunction, .notificationCard:focus-within:not(:focus) .notificationCardFunction{
|
|
63
|
+
pointer-events:auto;
|
|
64
|
+
opacity:1;
|
|
65
|
+
}
|
|
66
|
+
.notificationCard[data-clickable]{
|
|
67
|
+
cursor:pointer;
|
|
68
|
+
}
|
|
69
|
+
.notificationCard[data-unread]::before{
|
|
70
|
+
opacity:var(--opacity-a008, 0.08);
|
|
71
|
+
background-color:var(--sys-neutral-accent-default, #787b8a);
|
|
72
|
+
}
|
|
73
|
+
.notificationCard[data-unread][data-droplist-open]::before, .notificationCard[data-unread]:hover::before, .notificationCard[data-unread]:focus-visible::before, .notificationCard[data-unread]:focus-within:not(:focus)::before{
|
|
74
|
+
opacity:var(--opacity-a004, 0.04);
|
|
75
|
+
}
|
|
76
|
+
.notificationCard[data-appearance=neutral] .notificationCardTitleIcon{
|
|
77
|
+
color:var(--sys-neutral-accent-default, #787b8a);
|
|
78
|
+
}
|
|
79
|
+
.notificationCard[data-appearance=error] .notificationCardTitleIcon, .notificationCard[data-appearance=errorCritical] .notificationCardTitleIcon{
|
|
80
|
+
color:var(--sys-red-accent-default, #cb3f3e);
|
|
81
|
+
}
|
|
82
|
+
.notificationCard[data-appearance=errorCritical][data-unread]::before, .notificationCard[data-appearance=errorCritical][data-droplist-open]::before, .notificationCard[data-appearance=errorCritical]:hover::before, .notificationCard[data-appearance=errorCritical]:focus-visible::before, .notificationCard[data-appearance=errorCritical]:focus-within:not(:focus)::before{
|
|
83
|
+
background-color:var(--sys-red-accent-default, #cb3f3e);
|
|
84
|
+
}
|
|
85
|
+
.notificationCard[data-appearance=errorCritical] .notificationCardTitleText{
|
|
86
|
+
color:var(--sys-red-accent-default, #cb3f3e);
|
|
87
|
+
}
|
|
88
|
+
.notificationCard[data-appearance=warning] .notificationCardTitleIcon{
|
|
89
|
+
color:var(--sys-yellow-accent-default, #e2b134);
|
|
90
|
+
}
|
|
91
|
+
.notificationCard[data-appearance=success] .notificationCardTitleIcon{
|
|
92
|
+
color:var(--sys-green-accent-default, #57b762);
|
|
93
|
+
}
|
|
94
|
+
.notificationCard[data-skeleton]::before{
|
|
95
|
+
display:none;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.notificationCardLabel{
|
|
99
|
+
display:grid;
|
|
100
|
+
color:var(--sys-neutral-text-support, #6d707f);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.notificationCardTitle{
|
|
104
|
+
gap:var(--space-notification-panel-card-title-layout-gap, 4px);
|
|
105
|
+
display:flex;
|
|
106
|
+
}
|
|
107
|
+
.notificationCardTitle[data-center]{
|
|
108
|
+
align-items:center;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.notificationCardContent{
|
|
112
|
+
box-sizing:border-box;
|
|
113
|
+
color:var(--sys-neutral-text-support, #6d707f);
|
|
114
|
+
white-space:pre-line;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.notificationCardFooter{
|
|
118
|
+
display:flex;
|
|
119
|
+
align-items:flex-end;
|
|
120
|
+
justify-content:space-between;
|
|
121
|
+
box-sizing:border-box;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.notificationCardDate{
|
|
125
|
+
flex:1 0 auto;
|
|
126
|
+
box-sizing:border-box;
|
|
127
|
+
color:var(--sys-neutral-text-light, #8b8e9b);
|
|
128
|
+
text-align:right;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.notificationCardButtons{
|
|
132
|
+
display:flex;
|
|
133
|
+
align-items:center;
|
|
134
|
+
justify-content:flex-end;
|
|
135
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { MouseEventHandler, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { ButtonFunctionProps } from '@snack-uikit/button';
|
|
3
|
+
import { ChipToggleProps } from '@snack-uikit/chips';
|
|
4
|
+
import { WithSupportProps } from '@snack-uikit/utils';
|
|
5
|
+
import { NotificationPanelBlank, NotificationPanelBlankProps, NotificationPanelSettingsProps } from './components';
|
|
6
|
+
import { NotificationPanelDivider, NotificationPanelDividerProps } from './components/NotificationPanelDivider';
|
|
7
|
+
export type { NotificationPanelBlankProps };
|
|
8
|
+
export type NotificationPanelProps = WithSupportProps<{
|
|
9
|
+
/** Заголовок панели */
|
|
10
|
+
title: string;
|
|
11
|
+
/** Кнопка настроек и выпадающий список */
|
|
12
|
+
settings?: NotificationPanelSettingsProps;
|
|
13
|
+
/** Чипы для фильтрации */
|
|
14
|
+
chips?: Omit<ChipToggleProps, 'size' | 'data-test-id'>[];
|
|
15
|
+
/** Кнопка в "шапке" панели */
|
|
16
|
+
readAllButton?: Omit<ButtonFunctionProps, 'data-test-id'> & {
|
|
17
|
+
onClick: ButtonFunctionProps['onClick'];
|
|
18
|
+
};
|
|
19
|
+
/** Кнопка внизу панели */
|
|
20
|
+
footerButton?: {
|
|
21
|
+
label: string;
|
|
22
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
23
|
+
};
|
|
24
|
+
className?: string;
|
|
25
|
+
/** Состояние загрузки */
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
/** Контент для отрисовки (e.g NotificationCard | NotificationPanel.Blank) */
|
|
28
|
+
content?: ReactNode;
|
|
29
|
+
/** Количество скелетонов карточек для отображения при загрузке */
|
|
30
|
+
skeletonsAmount?: number;
|
|
31
|
+
/** Ссылка на элемент, обозначающий самый конец прокручиваемого списка */
|
|
32
|
+
scrollEndRef?: RefObject<HTMLDivElement>;
|
|
33
|
+
/** Ссылка на контейнер, который скроллится */
|
|
34
|
+
scrollContainerRef?: RefObject<HTMLElement>;
|
|
35
|
+
}>;
|
|
36
|
+
/** Компонент панели для уведомлений */
|
|
37
|
+
export declare function NotificationPanel({ title, settings, chips, readAllButton, footerButton, content, loading, skeletonsAmount, scrollEndRef, scrollContainerRef, className, ...rest }: NotificationPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare namespace NotificationPanel {
|
|
39
|
+
const Blank: typeof NotificationPanelBlank;
|
|
40
|
+
type BlankProps = NotificationPanelBlankProps;
|
|
41
|
+
const Divider: typeof NotificationPanelDivider;
|
|
42
|
+
type DividerProps = NotificationPanelDividerProps;
|
|
43
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InfoBlockProps } from '@snack-uikit/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 @@
|
|
|
1
|
+
export * from './NotificationPanelBlank';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WithSupportProps } from '@snack-uikit/utils';
|
|
2
|
+
export type NotificationPanelDividerProps = WithSupportProps<{
|
|
3
|
+
/** Текст разделителя */
|
|
4
|
+
text: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}>;
|
|
7
|
+
/** Разделитель для группировки или разделения карточек в списке */
|
|
8
|
+
export declare function NotificationPanelDivider({ text, className, ...rest }: NotificationPanelDividerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationPanelDivider';
|
package/dist/esm/components/NotificationPanel/components/NotificationPanelDivider/styles.module.css
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
.notificationPanelDivider{
|
|
2
|
+
height:var(--size-notification-panel-readed-divider, 32px);
|
|
3
|
+
border-bottom-width:var(--border-width-notification-panel-container, 1px);
|
|
4
|
+
display:flex;
|
|
5
|
+
align-items:center;
|
|
6
|
+
justify-content:center;
|
|
7
|
+
color:var(--sys-neutral-text-light, #8b8e9b);
|
|
8
|
+
border-bottom-color:var(--sys-neutral-decor-default, #dde0ea);
|
|
9
|
+
border-bottom-style:solid;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonSimpleProps } from '@snack-uikit/button';
|
|
2
|
+
import { Action } from './NotificationPanelSettingsDroplist';
|
|
3
|
+
export type NotificationPanelSettingsProps = {
|
|
4
|
+
/** Дополнительные действия панели */
|
|
5
|
+
actions?: Action[];
|
|
6
|
+
/** Кнопка дополнительного действия панели */
|
|
7
|
+
button: Omit<ButtonSimpleProps, 'label' | 'type' | 'size' | 'data-test-id'>;
|
|
8
|
+
};
|
|
9
|
+
export declare function NotificationPanelSettings({ actions, button }: NotificationPanelSettingsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ButtonSimpleProps } from '@snack-uikit/button';
|
|
3
|
+
import { BaseItemProps } from '@snack-uikit/list';
|
|
4
|
+
export type Action = {
|
|
5
|
+
icon?: ReactElement;
|
|
6
|
+
tagLabel?: string;
|
|
7
|
+
} & Pick<BaseItemProps, 'content' | 'disabled' | 'onClick'>;
|
|
8
|
+
type NotificationPanelSettingsDroplistProps = {
|
|
9
|
+
actions: Action[];
|
|
10
|
+
button: ButtonSimpleProps;
|
|
11
|
+
};
|
|
12
|
+
export declare function NotificationPanelSettingsDroplist({ actions, button }: NotificationPanelSettingsDroplistProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationPanelSettings';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationPanel';
|