@salutejs/plasma-new-hope 0.324.0-canary.1967.15065564602.0 → 0.324.0-canary.1970.15068833000.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/cjs/components/Notification/Notification.css +12 -12
- package/cjs/components/Notification/Notification.js +1 -3
- package/cjs/components/Notification/Notification.js.map +1 -1
- package/cjs/components/Notification/Notification.styles.js +47 -55
- package/cjs/components/Notification/Notification.styles.js.map +1 -1
- package/cjs/components/Notification/{Notification.styles_1ogp4a2.css → Notification.styles_1yt699o.css} +1 -1
- package/cjs/components/Notification/Notification.types.js.map +1 -1
- package/cjs/components/Notification/NotificationsProvider.css +11 -11
- package/cjs/components/Notification/variations/_layout/base.js +1 -1
- package/cjs/components/Notification/variations/_layout/base.js.map +1 -1
- package/cjs/components/Notification/variations/_layout/base_qkc3i4.css +1 -0
- package/cjs/components/PaginationDots/PaginationDot.js +58 -0
- package/cjs/components/PaginationDots/PaginationDot.js.map +1 -0
- package/cjs/components/PaginationDots/PaginationDot_baul9c.css +2 -0
- package/cjs/components/PaginationDots/PaginationDots.js +33 -0
- package/cjs/components/PaginationDots/PaginationDots.js.map +1 -0
- package/cjs/components/PaginationDots/PaginationDots_fm2ha5.css +2 -0
- package/cjs/components/PaginationDots/SmartPaginationDots.css +5 -0
- package/cjs/components/PaginationDots/SmartPaginationDots.js +46 -0
- package/cjs/components/PaginationDots/SmartPaginationDots.js.map +1 -0
- package/cjs/components/PaginationDots/usePaginationDots.js +40 -0
- package/cjs/components/PaginationDots/usePaginationDots.js.map +1 -0
- package/cjs/index.css +18 -12
- package/cjs/index.js +6 -0
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/Notification/Notification.js +1 -3
- package/emotion/cjs/components/Notification/Notification.styles.js +36 -40
- package/emotion/cjs/components/Notification/variations/_layout/base.js +1 -1
- package/emotion/cjs/components/PaginationDots/PaginationDot.js +34 -0
- package/emotion/cjs/components/PaginationDots/PaginationDots.js +34 -0
- package/emotion/cjs/components/PaginationDots/SmartPaginationDots.js +42 -0
- package/emotion/cjs/components/PaginationDots/index.js +26 -0
- package/emotion/cjs/components/PaginationDots/usePaginationDots.js +38 -0
- package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +1 -3
- package/emotion/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +1 -3
- package/emotion/cjs/index.js +11 -0
- package/emotion/es/components/Notification/Notification.js +1 -3
- package/emotion/es/components/Notification/Notification.styles.js +36 -40
- package/emotion/es/components/Notification/variations/_layout/base.js +1 -1
- package/emotion/es/components/PaginationDots/PaginationDot.js +27 -0
- package/emotion/es/components/PaginationDots/PaginationDots.js +27 -0
- package/emotion/es/components/PaginationDots/SmartPaginationDots.js +35 -0
- package/emotion/es/components/PaginationDots/index.js +3 -0
- package/emotion/es/components/PaginationDots/usePaginationDots.js +32 -0
- package/emotion/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +1 -3
- package/emotion/es/examples/plasma_web/components/Notification/Notification.stories.tsx +1 -3
- package/emotion/es/index.js +2 -1
- package/es/components/Notification/Notification.css +12 -12
- package/es/components/Notification/Notification.js +1 -3
- package/es/components/Notification/Notification.js.map +1 -1
- package/es/components/Notification/Notification.styles.js +47 -55
- package/es/components/Notification/Notification.styles.js.map +1 -1
- package/es/components/Notification/{Notification.styles_1ogp4a2.css → Notification.styles_1yt699o.css} +1 -1
- package/es/components/Notification/Notification.types.js.map +1 -1
- package/es/components/Notification/NotificationsProvider.css +11 -11
- package/es/components/Notification/variations/_layout/base.js +1 -1
- package/es/components/Notification/variations/_layout/base.js.map +1 -1
- package/es/components/Notification/variations/_layout/base_qkc3i4.css +1 -0
- package/es/components/PaginationDots/PaginationDot.js +53 -0
- package/es/components/PaginationDots/PaginationDot.js.map +1 -0
- package/es/components/PaginationDots/PaginationDot_baul9c.css +2 -0
- package/es/components/PaginationDots/PaginationDots.js +28 -0
- package/es/components/PaginationDots/PaginationDots.js.map +1 -0
- package/es/components/PaginationDots/PaginationDots_fm2ha5.css +2 -0
- package/es/components/PaginationDots/SmartPaginationDots.css +5 -0
- package/es/components/PaginationDots/SmartPaginationDots.js +38 -0
- package/es/components/PaginationDots/SmartPaginationDots.js.map +1 -0
- package/es/components/PaginationDots/usePaginationDots.js +36 -0
- package/es/components/PaginationDots/usePaginationDots.js.map +1 -0
- package/es/index.css +18 -12
- package/es/index.js +3 -0
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Notification/Notification.js +1 -3
- package/styled-components/cjs/components/Notification/Notification.styles.js +25 -29
- package/styled-components/cjs/components/Notification/variations/_layout/base.js +1 -1
- package/styled-components/cjs/components/PaginationDots/PaginationDot.js +32 -0
- package/styled-components/cjs/components/PaginationDots/PaginationDots.js +23 -0
- package/styled-components/cjs/components/PaginationDots/SmartPaginationDots.js +42 -0
- package/styled-components/cjs/components/PaginationDots/index.js +26 -0
- package/styled-components/cjs/components/PaginationDots/usePaginationDots.js +38 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +1 -3
- package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +1 -3
- package/styled-components/cjs/index.js +11 -0
- package/styled-components/es/components/Notification/Notification.js +1 -3
- package/styled-components/es/components/Notification/Notification.styles.js +25 -29
- package/styled-components/es/components/Notification/variations/_layout/base.js +1 -1
- package/styled-components/es/components/PaginationDots/PaginationDot.js +25 -0
- package/styled-components/es/components/PaginationDots/PaginationDots.js +17 -0
- package/styled-components/es/components/PaginationDots/SmartPaginationDots.js +35 -0
- package/styled-components/es/components/PaginationDots/index.js +3 -0
- package/styled-components/es/components/PaginationDots/usePaginationDots.js +32 -0
- package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +1 -3
- package/styled-components/es/examples/plasma_web/components/Notification/Notification.stories.tsx +1 -3
- package/styled-components/es/index.js +2 -1
- package/types/components/Notification/Notification.d.ts.map +1 -1
- package/types/components/Notification/Notification.styles.d.ts +1 -2
- package/types/components/Notification/Notification.styles.d.ts.map +1 -1
- package/types/components/Notification/Notification.types.d.ts +0 -5
- package/types/components/Notification/Notification.types.d.ts.map +1 -1
- package/types/components/PaginationDots/PaginationDot.d.ts +20 -0
- package/types/components/PaginationDots/PaginationDot.d.ts.map +1 -0
- package/types/components/PaginationDots/PaginationDots.d.ts +14 -0
- package/types/components/PaginationDots/PaginationDots.d.ts.map +1 -0
- package/types/components/PaginationDots/SmartPaginationDots.d.ts +14 -0
- package/types/components/PaginationDots/SmartPaginationDots.d.ts.map +1 -0
- package/types/components/PaginationDots/index.d.ts +6 -0
- package/types/components/PaginationDots/index.d.ts.map +1 -0
- package/types/components/PaginationDots/usePaginationDots.d.ts +14 -0
- package/types/components/PaginationDots/usePaginationDots.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/cjs/components/Notification/variations/_layout/base_1g9g70c.css +0 -1
- package/es/components/Notification/variations/_layout/base_1g9g70c.css +0 -1
@@ -23,61 +23,57 @@ var CloseIconWrapper = exports.CloseIconWrapper = /*#__PURE__*/(0, _styledCompon
|
|
23
23
|
})(["position:absolute;width:var(", ");height:var(", ");align-self:var(", ");color:var(", ");:hover{color:var(", ");}&.", "{position:relative;}"], _Notification.tokens.closeIconButtonSize, _Notification.tokens.closeIconButtonSize, _Notification.tokens.horisontalIconCloseAlignSelf, _Notification.tokens.closeIconColor, _Notification.tokens.closeIconColorOnHover, _Notification.classes.horizontal);
|
24
24
|
var Wrapper = exports.Wrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
25
25
|
componentId: "plasma-new-hope__sc-1iufy9r-1"
|
26
|
-
})(["position:relative;
|
27
|
-
var
|
28
|
-
width = _ref$width === void 0 ? "var(".concat(_Notification.tokens.width, ")") : _ref$width;
|
29
|
-
return width;
|
30
|
-
}, _Notification.tokens.borderRadius, _Notification.tokens.borderWidth, _Notification.tokens.borderColor, function (_ref2) {
|
31
|
-
var backgroundColor = _ref2.backgroundColor;
|
26
|
+
})(["position:relative;box-sizing:border-box;background:", ";border-radius:var(", ");border:var(", ") solid var(", ");&.", "{display:flex;align-items:center;gap:var(", ");}"], function (_ref) {
|
27
|
+
var backgroundColor = _ref.backgroundColor;
|
32
28
|
return backgroundColor || "var(".concat(_Notification.tokens.background, ")");
|
33
|
-
}, _Notification.classes.horizontal, _Notification.tokens.horizontalLayoutGap);
|
29
|
+
}, _Notification.tokens.borderRadius, _Notification.tokens.borderWidth, _Notification.tokens.borderColor, _Notification.classes.horizontal, _Notification.tokens.horizontalLayoutGap);
|
34
30
|
var ButtonsWrapper = exports.ButtonsWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
35
31
|
componentId: "plasma-new-hope__sc-1iufy9r-2"
|
36
|
-
})(["margin-top:var(", ");margin-left:", ";align-self:var(", ");&.", "{margin-top:unset;margin-left:unset;}"], _Notification.tokens.buttonsMarginTop, function (
|
37
|
-
var iconPlacement =
|
32
|
+
})(["margin-top:var(", ");margin-left:", ";align-self:var(", ");&.", "{margin-top:unset;margin-left:unset;}"], _Notification.tokens.buttonsMarginTop, function (_ref2) {
|
33
|
+
var iconPlacement = _ref2.iconPlacement;
|
38
34
|
return iconPlacement === _Notification2.placements.left ? "var(".concat(_Notification.tokens.buttonsMarginLeft, ")") : 'unset';
|
39
35
|
}, _Notification.tokens.horisontalActionsAlignSelf, _Notification.classes.horizontal);
|
40
36
|
var IconWrapper = exports.IconWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
41
37
|
componentId: "plasma-new-hope__sc-1iufy9r-3"
|
42
|
-
})(["width:var(", ");height:var(", ");align-self:var(", ");color:", ";margin-right:", ";margin-bottom:", ";&.", "{margin-right:var(", ");margin-bottom:unset;}"], _Notification.tokens.contentLeftIconSize, _Notification.tokens.contentLeftIconSize, _Notification.tokens.horisontalIconLeftAlignSelf, function (
|
43
|
-
var iconColor =
|
38
|
+
})(["width:var(", ");height:var(", ");align-self:var(", ");color:", ";margin-right:", ";margin-bottom:", ";&.", "{margin-right:var(", ");margin-bottom:unset;}"], _Notification.tokens.contentLeftIconSize, _Notification.tokens.contentLeftIconSize, _Notification.tokens.horisontalIconLeftAlignSelf, function (_ref3) {
|
39
|
+
var iconColor = _ref3.iconColor;
|
44
40
|
return iconColor || "var(".concat(_Notification.tokens.contentLeftIconColor, ")");
|
41
|
+
}, function (_ref4) {
|
42
|
+
var iconPlacement = _ref4.iconPlacement;
|
43
|
+
return iconPlacement === _Notification2.placements.left ? "var(".concat(_Notification.tokens.contentLeftIconMargin, ")") : 'unset';
|
45
44
|
}, function (_ref5) {
|
46
45
|
var iconPlacement = _ref5.iconPlacement;
|
47
|
-
return iconPlacement === _Notification2.placements.left ? "var(".concat(_Notification.tokens.contentLeftIconMargin, ")") : 'unset';
|
48
|
-
}, function (_ref6) {
|
49
|
-
var iconPlacement = _ref6.iconPlacement;
|
50
46
|
return iconPlacement === _Notification2.placements.top ? "var(".concat(_Notification.tokens.contentTopIconMargin, ")") : 'unset';
|
51
47
|
}, _Notification.classes.horizontal, _Notification.tokens.horizontalLayoutLeftIconMargin);
|
52
48
|
var ContentBox = exports.ContentBox = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
53
49
|
componentId: "plasma-new-hope__sc-1iufy9r-4"
|
54
|
-
})(["display:", ";padding-top:", ";&.", "{padding:unset;display:flex;align-items:center;flex-grow:1;}"], function (
|
55
|
-
var iconPlacement =
|
50
|
+
})(["display:", ";padding-top:", ";&.", "{padding:unset;display:flex;align-items:center;flex-grow:1;}"], function (_ref6) {
|
51
|
+
var iconPlacement = _ref6.iconPlacement;
|
56
52
|
return iconPlacement === _Notification2.placements.left ? 'flex' : 'block';
|
57
|
-
}, function (
|
58
|
-
var iconPlacement =
|
53
|
+
}, function (_ref7) {
|
54
|
+
var iconPlacement = _ref7.iconPlacement;
|
59
55
|
return iconPlacement ? "var(".concat(_Notification.tokens.contentPaddingTop, ")") : "var(".concat(_Notification.tokens.contentPaddingTopWithoutIcon, ")");
|
60
56
|
}, _Notification.classes.horizontal);
|
61
57
|
var TextBox = exports.TextBox = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
62
58
|
componentId: "plasma-new-hope__sc-1iufy9r-5"
|
63
|
-
})(["padding:var(", ") var(", ") var(", ") var(", ");padding-top:", ";padding-right:", ";display:flex;flex-direction:column;row-gap:var(", ");word-break:break-word;&.", "{padding:unset;}"], _Notification.tokens.textboxPaddingTop, _Notification.tokens.textboxPaddingRight, _Notification.tokens.textboxPaddingBottom, _Notification.tokens.textboxPaddingLeft, function (
|
64
|
-
var iconPlacement =
|
59
|
+
})(["padding:var(", ") var(", ") var(", ") var(", ");padding-top:", ";padding-right:", ";display:flex;flex-direction:column;row-gap:var(", ");word-break:break-word;&.", "{padding:unset;}"], _Notification.tokens.textboxPaddingTop, _Notification.tokens.textboxPaddingRight, _Notification.tokens.textboxPaddingBottom, _Notification.tokens.textboxPaddingLeft, function (_ref8) {
|
60
|
+
var iconPlacement = _ref8.iconPlacement;
|
65
61
|
return !iconPlacement || iconPlacement === _Notification2.placements.top ? "var(".concat(_Notification.tokens.textboxPaddingTopWithTopIcon, ")") : "var(".concat(_Notification.tokens.textboxPaddingTop, ")");
|
66
|
-
}, function (
|
67
|
-
var showCloseIcon =
|
68
|
-
iconPlacement =
|
62
|
+
}, function (_ref9) {
|
63
|
+
var showCloseIcon = _ref9.showCloseIcon,
|
64
|
+
iconPlacement = _ref9.iconPlacement;
|
69
65
|
return showCloseIcon && iconPlacement !== _Notification2.placements.top ? "var(".concat(_Notification.tokens.textboxPaddingRightWithCloseIcon, ")") : "var(".concat(_Notification.tokens.textboxPaddingRight, ")");
|
70
66
|
}, _Notification.tokens.textboxGap, _Notification.classes.horizontal);
|
71
67
|
var StyledTitle = exports.StyledTitle = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
72
68
|
componentId: "plasma-new-hope__sc-1iufy9r-6"
|
73
|
-
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:", ";"], _Notification.tokens.titleFontFamily, _Notification.tokens.titleFontSize, _Notification.tokens.titleFontStyle, _Notification.tokens.titleFontWeight, _Notification.tokens.titleFontLetterSpacing, _Notification.tokens.titleFontLineHeight, /*#__PURE__*/String(_mixins.applyHyphens), function (
|
74
|
-
var textColor =
|
69
|
+
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:", ";"], _Notification.tokens.titleFontFamily, _Notification.tokens.titleFontSize, _Notification.tokens.titleFontStyle, _Notification.tokens.titleFontWeight, _Notification.tokens.titleFontLetterSpacing, _Notification.tokens.titleFontLineHeight, /*#__PURE__*/String(_mixins.applyHyphens), function (_ref10) {
|
70
|
+
var textColor = _ref10.textColor;
|
75
71
|
return textColor || "var(".concat(_Notification.tokens.titleColor, ")");
|
76
72
|
});
|
77
73
|
var StyledContent = exports.StyledContent = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
78
74
|
componentId: "plasma-new-hope__sc-1iufy9r-7"
|
79
|
-
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:", ";"], _Notification.tokens.contentFontFamily, _Notification.tokens.contentFontSize, _Notification.tokens.contentFontStyle, _Notification.tokens.contentFontWeight, _Notification.tokens.contentFontLetterSpacing, _Notification.tokens.contentFontLineHeight, /*#__PURE__*/String(_mixins.applyHyphens), function (
|
80
|
-
var textColor =
|
75
|
+
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:", ";"], _Notification.tokens.contentFontFamily, _Notification.tokens.contentFontSize, _Notification.tokens.contentFontStyle, _Notification.tokens.contentFontWeight, _Notification.tokens.contentFontLetterSpacing, _Notification.tokens.contentFontLineHeight, /*#__PURE__*/String(_mixins.applyHyphens), function (_ref11) {
|
76
|
+
var textColor = _ref11.textColor;
|
81
77
|
return textColor || "var(".concat(_Notification.tokens.contentColor, ")");
|
82
78
|
});
|
83
79
|
var StyledItemWrapper = exports.StyledItemWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
@@ -85,7 +81,7 @@ var StyledItemWrapper = exports.StyledItemWrapper = /*#__PURE__*/_styledComponen
|
|
85
81
|
})(["margin-top:1rem;opacity:1;&&.", "{animation:0.4s showAnimation ease-out;&.", "{animation:0.4s showLeftToRightAnimation ease-out;}&.", "{animation:0.4s showTopToCenterAnimation ease-out;}&.", "{animation:0.4s showBottomToCenterAnimation ease-out;}}&&.", "{animation:0.4s hideAnimation ease-out;&.", "{animation:0.4s hideLeftToRightAnimation ease-out;}}@keyframes showTopToCenterAnimation{0%{transform:translateY(-100%);opacity:0;}100%{transform:translateY(0);opacity:1;}}@keyframes showBottomToCenterAnimation{0%{transform:translateY(100%);opacity:0;}100%{transform:translateY(0);opacity:1;}}@keyframes showLeftToRightAnimation{0%{transform:translateX(-100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes hideLeftToRightAnimation{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(-100%);opacity:0;}}@keyframes showAnimation{0%{transform:translateX(100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes hideAnimation{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(100%);opacity:0;}}"], _Notification.classes.notificationItemOpened, _Notification.classes.notificationLeftToRightAnimation, _Notification.classes.notificationTopToCenterAnimation, _Notification.classes.notificationBottomToCenterAnimation, _Notification.classes.notificationItemHidden, _Notification.classes.notificationLeftToRightAnimation);
|
86
82
|
var StyledRoot = exports.StyledRoot = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
87
83
|
componentId: "plasma-new-hope__sc-1iufy9r-9"
|
88
|
-
})(["display:flex;flex-direction:column-reverse;box-sizing:border-box;padding:0 1.5rem 1.5rem;max-height:100%;align-items:", ";"], function (
|
89
|
-
var placement =
|
84
|
+
})(["display:flex;flex-direction:column-reverse;box-sizing:border-box;padding:0 1.5rem 1.5rem;max-height:100%;align-items:", ";"], function (_ref12) {
|
85
|
+
var placement = _ref12.placement;
|
90
86
|
return placement === 'bottom-left' ? 'flex-start' : 'flex-end';
|
91
87
|
});
|
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.base = void 0;
|
7
7
|
var _styledComponents = /*#__PURE__*/require("styled-components");
|
8
8
|
var _Notification = /*#__PURE__*/require("../../Notification.tokens");
|
9
|
-
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)([".", "{padding:var(", ");}.", ".", "{padding:var(", ");&.", "{padding-right:var(", ");}}.", ".", ".", "{padding:var(", ");}"], _Notification.classes.wrapper, _Notification.tokens.padding, _Notification.classes.wrapper, _Notification.classes.horizontal, _Notification.tokens.horizontalLayoutPadding, _Notification.classes.withoutCloseIcon, _Notification.tokens.horizontalLayoutRightPaddingWithoutCloseIcon, _Notification.classes.wrapper, _Notification.classes.horizontal, _Notification.classes.oneLine, _Notification.tokens.paddingOneLineTextbox);
|
9
|
+
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)([".", "{width:var(", ");padding:var(", ");}.", ".", "{padding:var(", ");&.", "{padding-right:var(", ");}}.", ".", ".", "{padding:var(", ");}"], _Notification.classes.wrapper, _Notification.tokens.width, _Notification.tokens.padding, _Notification.classes.wrapper, _Notification.classes.horizontal, _Notification.tokens.horizontalLayoutPadding, _Notification.classes.withoutCloseIcon, _Notification.tokens.horizontalLayoutRightPaddingWithoutCloseIcon, _Notification.classes.wrapper, _Notification.classes.horizontal, _Notification.classes.oneLine, _Notification.tokens.paddingOneLineTextbox);
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.PaginationDot = exports.DotBase = void 0;
|
7
|
+
var _styledComponents = /*#__PURE__*/_interopRequireDefault(/*#__PURE__*/require("styled-components"));
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
9
|
+
/**
|
10
|
+
* Элемент пагинации точками.
|
11
|
+
* Стилизованный компонент, обладающий всеми свойствами ``div``.
|
12
|
+
*/
|
13
|
+
var DotBase = exports.DotBase = /*#__PURE__*/_styledComponents["default"].li.withConfig({
|
14
|
+
componentId: "plasma-new-hope__sc-1lu8gfj-0"
|
15
|
+
})(["width:", ";height:0.375rem;border-radius:1rem;background:", ";transition:width 0.1s ease-in-out,background 0.3s ease-in-out;font-size:0.5rem;& + &{margin-left:0.375rem;}&:focus{outline:0 none;}"], function (_ref) {
|
16
|
+
var isActive = _ref.isActive;
|
17
|
+
return isActive ? '1.75rem' : '0.375rem';
|
18
|
+
}, function (_ref2) {
|
19
|
+
var isActive = _ref2.isActive;
|
20
|
+
return isActive ? 'var(--text-primary)' : 'var(--surfaceTransparentTertiary)';
|
21
|
+
});
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Элемент пагинации точками.
|
25
|
+
* Стилизованный компонент, обладающий всеми свойствами ``div``.
|
26
|
+
*/
|
27
|
+
var PaginationDot = exports.PaginationDot = /*#__PURE__*/(0, _styledComponents["default"])(DotBase).withConfig({
|
28
|
+
componentId: "plasma-new-hope__sc-1lu8gfj-1"
|
29
|
+
})(["cursor:pointer;background:", ";&:hover{background:var(--text-accent);}"], function (_ref3) {
|
30
|
+
var isActive = _ref3.isActive;
|
31
|
+
return isActive ? 'var(--text-accent)' : 'var(--surfaceTransparentTertiary)';
|
32
|
+
});
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.PaginationDots = exports.DotsBase = void 0;
|
7
|
+
var _styledComponents = /*#__PURE__*/_interopRequireDefault(/*#__PURE__*/require("styled-components"));
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
9
|
+
/**
|
10
|
+
* Оборачивающий компонент для пагинации точками.
|
11
|
+
* Стилизованный компонент, обладающий всеми свойствами ``div``.
|
12
|
+
*/
|
13
|
+
var DotsBase = exports.DotsBase = /*#__PURE__*/_styledComponents["default"].ul.withConfig({
|
14
|
+
componentId: "plasma-new-hope__sc-1ritf0l-0"
|
15
|
+
})(["display:flex;flex-wrap:wrap;align-self:center;align-items:center;margin:0;padding:0;list-style:none;"]);
|
16
|
+
|
17
|
+
/**
|
18
|
+
* Оборачивающий компонент для пагинации точками.
|
19
|
+
* Стилизованный компонент, обладающий всеми свойствами ``div``.
|
20
|
+
*/
|
21
|
+
var PaginationDots = exports.PaginationDots = /*#__PURE__*/(0, _styledComponents["default"])(DotsBase).withConfig({
|
22
|
+
componentId: "plasma-new-hope__sc-1ritf0l-1"
|
23
|
+
})([""]);
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.SmartPaginationDots = void 0;
|
7
|
+
var _react = /*#__PURE__*/_interopRequireDefault(/*#__PURE__*/require("react"));
|
8
|
+
var _usePaginationDots2 = /*#__PURE__*/require("./usePaginationDots");
|
9
|
+
var _PaginationDots = /*#__PURE__*/require("./PaginationDots");
|
10
|
+
var _PaginationDot = /*#__PURE__*/require("./PaginationDot");
|
11
|
+
var _excluded = ["items", "index", "visibleItems", "onIndexChange"];
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
13
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
14
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
15
|
+
/**
|
16
|
+
* Компонент для отображения точек пагинации
|
17
|
+
* с возможностью ограничения количества видимых элементов.
|
18
|
+
*/
|
19
|
+
var SmartPaginationDots = exports.SmartPaginationDots = function SmartPaginationDots(_ref) {
|
20
|
+
var items = _ref.items,
|
21
|
+
index = _ref.index,
|
22
|
+
visibleItems = _ref.visibleItems,
|
23
|
+
onIndexChange = _ref.onIndexChange,
|
24
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
25
|
+
var _usePaginationDots = (0, _usePaginationDots2.usePaginationDots)({
|
26
|
+
items: items,
|
27
|
+
index: index,
|
28
|
+
visibleItems: visibleItems
|
29
|
+
}),
|
30
|
+
sliced = _usePaginationDots.sliced,
|
31
|
+
activeId = _usePaginationDots.activeId;
|
32
|
+
return /*#__PURE__*/_react["default"].createElement(_PaginationDots.PaginationDots, rest, sliced.map(function (_ref2, i) {
|
33
|
+
var id = _ref2.id;
|
34
|
+
return /*#__PURE__*/_react["default"].createElement(_PaginationDot.PaginationDot, {
|
35
|
+
key: "item:".concat(i),
|
36
|
+
isActive: id === activeId,
|
37
|
+
onClick: function onClick() {
|
38
|
+
return onIndexChange === null || onIndexChange === void 0 ? void 0 : onIndexChange(i);
|
39
|
+
}
|
40
|
+
});
|
41
|
+
}));
|
42
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "PaginationDot", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _PaginationDot.PaginationDot;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
Object.defineProperty(exports, "PaginationDots", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function get() {
|
15
|
+
return _PaginationDots.PaginationDots;
|
16
|
+
}
|
17
|
+
});
|
18
|
+
Object.defineProperty(exports, "SmartPaginationDots", {
|
19
|
+
enumerable: true,
|
20
|
+
get: function get() {
|
21
|
+
return _SmartPaginationDots.SmartPaginationDots;
|
22
|
+
}
|
23
|
+
});
|
24
|
+
var _SmartPaginationDots = /*#__PURE__*/require("./SmartPaginationDots");
|
25
|
+
var _PaginationDots = /*#__PURE__*/require("./PaginationDots");
|
26
|
+
var _PaginationDot = /*#__PURE__*/require("./PaginationDot");
|
@@ -0,0 +1,38 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.usePaginationDots = void 0;
|
7
|
+
var _react = /*#__PURE__*/require("react");
|
8
|
+
var usePaginationDots = exports.usePaginationDots = function usePaginationDots(_ref) {
|
9
|
+
var items = _ref.items,
|
10
|
+
index = _ref.index,
|
11
|
+
_ref$visibleItems = _ref.visibleItems,
|
12
|
+
visibleItems = _ref$visibleItems === void 0 ? 7 : _ref$visibleItems;
|
13
|
+
var activeId = items[index].id;
|
14
|
+
var prevIndex = (0, _react.useRef)(null);
|
15
|
+
var direction = 0;
|
16
|
+
if (prevIndex.current !== null) {
|
17
|
+
direction = index > prevIndex.current ? 1 : -1;
|
18
|
+
}
|
19
|
+
var start;
|
20
|
+
var end;
|
21
|
+
if (direction === 1) {
|
22
|
+
end = Math.min(Math.max(index + 2, visibleItems), items.length);
|
23
|
+
start = Math.max(end - visibleItems, 0);
|
24
|
+
} else if (direction === -1) {
|
25
|
+
start = Math.min(Math.max(index - 1, 0), items.length - visibleItems);
|
26
|
+
end = start + visibleItems;
|
27
|
+
} else {
|
28
|
+
start = Math.max(index - Math.floor(visibleItems / 2), 0);
|
29
|
+
end = Math.min(start + visibleItems, items.length);
|
30
|
+
start = end - visibleItems;
|
31
|
+
}
|
32
|
+
var sliced = items.slice(start, end);
|
33
|
+
prevIndex.current = index;
|
34
|
+
return {
|
35
|
+
sliced: sliced,
|
36
|
+
activeId: activeId
|
37
|
+
};
|
38
|
+
};
|
package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx
CHANGED
@@ -167,13 +167,12 @@ type StoryLiveDemoProps = ComponentProps<typeof Notification> & {
|
|
167
167
|
placement?: NotificationPlacement;
|
168
168
|
};
|
169
169
|
|
170
|
-
const StoryLiveDemo = ({ timeout, placement,
|
170
|
+
const StoryLiveDemo = ({ timeout, placement, ...rest }: StoryLiveDemoProps) => {
|
171
171
|
const count = useRef(0);
|
172
172
|
const handleClick = useCallback(() => {
|
173
173
|
addNotification(
|
174
174
|
{
|
175
175
|
icon: <IconDisclosureRight color="inherit" />,
|
176
|
-
width,
|
177
176
|
...rest,
|
178
177
|
...getNotificationProps(count.current),
|
179
178
|
},
|
@@ -211,7 +210,6 @@ export const LiveDemo: StoryObj<StoryLiveDemoProps> = {
|
|
211
210
|
role: 'alert',
|
212
211
|
layout: 'vertical',
|
213
212
|
placement: 'bottom-right',
|
214
|
-
width: '',
|
215
213
|
},
|
216
214
|
render: (args) => <StoryLiveDemo {...args} />,
|
217
215
|
};
|
package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx
CHANGED
@@ -170,13 +170,12 @@ type StoryLiveDemoProps = ComponentProps<typeof Notification> & {
|
|
170
170
|
placement?: NotificationPlacement;
|
171
171
|
};
|
172
172
|
|
173
|
-
const StoryLiveDemo = ({ timeout, placement,
|
173
|
+
const StoryLiveDemo = ({ timeout, placement, ...rest }: StoryLiveDemoProps) => {
|
174
174
|
const count = useRef(0);
|
175
175
|
const handleClick = useCallback(() => {
|
176
176
|
addNotification(
|
177
177
|
{
|
178
178
|
icon: <IconDisclosureRight color="inherit" />,
|
179
|
-
width,
|
180
179
|
...rest,
|
181
180
|
...getNotificationProps(count.current),
|
182
181
|
},
|
@@ -214,7 +213,6 @@ export const LiveDemo: StoryObj<StoryLiveDemoProps> = {
|
|
214
213
|
role: 'alert',
|
215
214
|
layout: 'vertical',
|
216
215
|
placement: 'bottom-right',
|
217
|
-
width: '',
|
218
216
|
},
|
219
217
|
render: (args) => <StoryLiveDemo {...args} />,
|
220
218
|
};
|
@@ -827,4 +827,15 @@ Object.keys(_Carousel).forEach(function (key) {
|
|
827
827
|
return _Carousel[key];
|
828
828
|
}
|
829
829
|
});
|
830
|
+
});
|
831
|
+
var _PaginationDots = /*#__PURE__*/require("./components/PaginationDots");
|
832
|
+
Object.keys(_PaginationDots).forEach(function (key) {
|
833
|
+
if (key === "default" || key === "__esModule") return;
|
834
|
+
if (key in exports && exports[key] === _PaginationDots[key]) return;
|
835
|
+
Object.defineProperty(exports, key, {
|
836
|
+
enumerable: true,
|
837
|
+
get: function get() {
|
838
|
+
return _PaginationDots[key];
|
839
|
+
}
|
840
|
+
});
|
830
841
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["role", "title", "children", "actions", "view", "size", "iconPlacement", "showCloseIcon", "layout", "icon", "closeIconType", "textColor", "titleColor", "backgroundColor", "
|
1
|
+
var _excluded = ["role", "title", "children", "actions", "view", "size", "iconPlacement", "showCloseIcon", "layout", "icon", "closeIconType", "textColor", "titleColor", "backgroundColor", "onCloseButtonClick"];
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
3
3
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
@@ -37,7 +37,6 @@ export var notificationRoot = function notificationRoot(Root) {
|
|
37
37
|
textColor = props.textColor,
|
38
38
|
titleColor = props.titleColor,
|
39
39
|
backgroundColor = props.backgroundColor,
|
40
|
-
width = props.width,
|
41
40
|
onCloseButtonClick = props.onCloseButtonClick,
|
42
41
|
rest = _objectWithoutProperties(props, _excluded);
|
43
42
|
var ariaLive = 'polite';
|
@@ -65,7 +64,6 @@ export var notificationRoot = function notificationRoot(Root) {
|
|
65
64
|
"aria-atomic": ariaAtomic
|
66
65
|
}, rest), /*#__PURE__*/React.createElement(Wrapper, {
|
67
66
|
backgroundColor: backgroundColor,
|
68
|
-
width: width,
|
69
67
|
className: cx(classes.wrapper, getLayoutClass(layout), oneLineClass, withoutCloseIconClass)
|
70
68
|
}, /*#__PURE__*/React.createElement(ContentBox, {
|
71
69
|
iconPlacement: IconPlacementInternal,
|
@@ -15,61 +15,57 @@ export var CloseIconWrapper = /*#__PURE__*/styled(Button).withConfig({
|
|
15
15
|
})(["position:absolute;width:var(", ");height:var(", ");align-self:var(", ");color:var(", ");:hover{color:var(", ");}&.", "{position:relative;}"], tokens.closeIconButtonSize, tokens.closeIconButtonSize, tokens.horisontalIconCloseAlignSelf, tokens.closeIconColor, tokens.closeIconColorOnHover, classes.horizontal);
|
16
16
|
export var Wrapper = /*#__PURE__*/styled.div.withConfig({
|
17
17
|
componentId: "plasma-new-hope__sc-1iufy9r-1"
|
18
|
-
})(["position:relative;
|
19
|
-
var
|
20
|
-
width = _ref$width === void 0 ? "var(".concat(tokens.width, ")") : _ref$width;
|
21
|
-
return width;
|
22
|
-
}, tokens.borderRadius, tokens.borderWidth, tokens.borderColor, function (_ref2) {
|
23
|
-
var backgroundColor = _ref2.backgroundColor;
|
18
|
+
})(["position:relative;box-sizing:border-box;background:", ";border-radius:var(", ");border:var(", ") solid var(", ");&.", "{display:flex;align-items:center;gap:var(", ");}"], function (_ref) {
|
19
|
+
var backgroundColor = _ref.backgroundColor;
|
24
20
|
return backgroundColor || "var(".concat(tokens.background, ")");
|
25
|
-
}, classes.horizontal, tokens.horizontalLayoutGap);
|
21
|
+
}, tokens.borderRadius, tokens.borderWidth, tokens.borderColor, classes.horizontal, tokens.horizontalLayoutGap);
|
26
22
|
export var ButtonsWrapper = /*#__PURE__*/styled.div.withConfig({
|
27
23
|
componentId: "plasma-new-hope__sc-1iufy9r-2"
|
28
|
-
})(["margin-top:var(", ");margin-left:", ";align-self:var(", ");&.", "{margin-top:unset;margin-left:unset;}"], tokens.buttonsMarginTop, function (
|
29
|
-
var iconPlacement =
|
24
|
+
})(["margin-top:var(", ");margin-left:", ";align-self:var(", ");&.", "{margin-top:unset;margin-left:unset;}"], tokens.buttonsMarginTop, function (_ref2) {
|
25
|
+
var iconPlacement = _ref2.iconPlacement;
|
30
26
|
return iconPlacement === placements.left ? "var(".concat(tokens.buttonsMarginLeft, ")") : 'unset';
|
31
27
|
}, tokens.horisontalActionsAlignSelf, classes.horizontal);
|
32
28
|
export var IconWrapper = /*#__PURE__*/styled.div.withConfig({
|
33
29
|
componentId: "plasma-new-hope__sc-1iufy9r-3"
|
34
|
-
})(["width:var(", ");height:var(", ");align-self:var(", ");color:", ";margin-right:", ";margin-bottom:", ";&.", "{margin-right:var(", ");margin-bottom:unset;}"], tokens.contentLeftIconSize, tokens.contentLeftIconSize, tokens.horisontalIconLeftAlignSelf, function (
|
35
|
-
var iconColor =
|
30
|
+
})(["width:var(", ");height:var(", ");align-self:var(", ");color:", ";margin-right:", ";margin-bottom:", ";&.", "{margin-right:var(", ");margin-bottom:unset;}"], tokens.contentLeftIconSize, tokens.contentLeftIconSize, tokens.horisontalIconLeftAlignSelf, function (_ref3) {
|
31
|
+
var iconColor = _ref3.iconColor;
|
36
32
|
return iconColor || "var(".concat(tokens.contentLeftIconColor, ")");
|
33
|
+
}, function (_ref4) {
|
34
|
+
var iconPlacement = _ref4.iconPlacement;
|
35
|
+
return iconPlacement === placements.left ? "var(".concat(tokens.contentLeftIconMargin, ")") : 'unset';
|
37
36
|
}, function (_ref5) {
|
38
37
|
var iconPlacement = _ref5.iconPlacement;
|
39
|
-
return iconPlacement === placements.left ? "var(".concat(tokens.contentLeftIconMargin, ")") : 'unset';
|
40
|
-
}, function (_ref6) {
|
41
|
-
var iconPlacement = _ref6.iconPlacement;
|
42
38
|
return iconPlacement === placements.top ? "var(".concat(tokens.contentTopIconMargin, ")") : 'unset';
|
43
39
|
}, classes.horizontal, tokens.horizontalLayoutLeftIconMargin);
|
44
40
|
export var ContentBox = /*#__PURE__*/styled.div.withConfig({
|
45
41
|
componentId: "plasma-new-hope__sc-1iufy9r-4"
|
46
|
-
})(["display:", ";padding-top:", ";&.", "{padding:unset;display:flex;align-items:center;flex-grow:1;}"], function (
|
47
|
-
var iconPlacement =
|
42
|
+
})(["display:", ";padding-top:", ";&.", "{padding:unset;display:flex;align-items:center;flex-grow:1;}"], function (_ref6) {
|
43
|
+
var iconPlacement = _ref6.iconPlacement;
|
48
44
|
return iconPlacement === placements.left ? 'flex' : 'block';
|
49
|
-
}, function (
|
50
|
-
var iconPlacement =
|
45
|
+
}, function (_ref7) {
|
46
|
+
var iconPlacement = _ref7.iconPlacement;
|
51
47
|
return iconPlacement ? "var(".concat(tokens.contentPaddingTop, ")") : "var(".concat(tokens.contentPaddingTopWithoutIcon, ")");
|
52
48
|
}, classes.horizontal);
|
53
49
|
export var TextBox = /*#__PURE__*/styled.div.withConfig({
|
54
50
|
componentId: "plasma-new-hope__sc-1iufy9r-5"
|
55
|
-
})(["padding:var(", ") var(", ") var(", ") var(", ");padding-top:", ";padding-right:", ";display:flex;flex-direction:column;row-gap:var(", ");word-break:break-word;&.", "{padding:unset;}"], tokens.textboxPaddingTop, tokens.textboxPaddingRight, tokens.textboxPaddingBottom, tokens.textboxPaddingLeft, function (
|
56
|
-
var iconPlacement =
|
51
|
+
})(["padding:var(", ") var(", ") var(", ") var(", ");padding-top:", ";padding-right:", ";display:flex;flex-direction:column;row-gap:var(", ");word-break:break-word;&.", "{padding:unset;}"], tokens.textboxPaddingTop, tokens.textboxPaddingRight, tokens.textboxPaddingBottom, tokens.textboxPaddingLeft, function (_ref8) {
|
52
|
+
var iconPlacement = _ref8.iconPlacement;
|
57
53
|
return !iconPlacement || iconPlacement === placements.top ? "var(".concat(tokens.textboxPaddingTopWithTopIcon, ")") : "var(".concat(tokens.textboxPaddingTop, ")");
|
58
|
-
}, function (
|
59
|
-
var showCloseIcon =
|
60
|
-
iconPlacement =
|
54
|
+
}, function (_ref9) {
|
55
|
+
var showCloseIcon = _ref9.showCloseIcon,
|
56
|
+
iconPlacement = _ref9.iconPlacement;
|
61
57
|
return showCloseIcon && iconPlacement !== placements.top ? "var(".concat(tokens.textboxPaddingRightWithCloseIcon, ")") : "var(".concat(tokens.textboxPaddingRight, ")");
|
62
58
|
}, tokens.textboxGap, classes.horizontal);
|
63
59
|
export var StyledTitle = /*#__PURE__*/styled.div.withConfig({
|
64
60
|
componentId: "plasma-new-hope__sc-1iufy9r-6"
|
65
|
-
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:", ";"], tokens.titleFontFamily, tokens.titleFontSize, tokens.titleFontStyle, tokens.titleFontWeight, tokens.titleFontLetterSpacing, tokens.titleFontLineHeight, /*#__PURE__*/String(applyHyphens), function (
|
66
|
-
var textColor =
|
61
|
+
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:", ";"], tokens.titleFontFamily, tokens.titleFontSize, tokens.titleFontStyle, tokens.titleFontWeight, tokens.titleFontLetterSpacing, tokens.titleFontLineHeight, /*#__PURE__*/String(applyHyphens), function (_ref10) {
|
62
|
+
var textColor = _ref10.textColor;
|
67
63
|
return textColor || "var(".concat(tokens.titleColor, ")");
|
68
64
|
});
|
69
65
|
export var StyledContent = /*#__PURE__*/styled.div.withConfig({
|
70
66
|
componentId: "plasma-new-hope__sc-1iufy9r-7"
|
71
|
-
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:", ";"], tokens.contentFontFamily, tokens.contentFontSize, tokens.contentFontStyle, tokens.contentFontWeight, tokens.contentFontLetterSpacing, tokens.contentFontLineHeight, /*#__PURE__*/String(applyHyphens), function (
|
72
|
-
var textColor =
|
67
|
+
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:", ";"], tokens.contentFontFamily, tokens.contentFontSize, tokens.contentFontStyle, tokens.contentFontWeight, tokens.contentFontLetterSpacing, tokens.contentFontLineHeight, /*#__PURE__*/String(applyHyphens), function (_ref11) {
|
68
|
+
var textColor = _ref11.textColor;
|
73
69
|
return textColor || "var(".concat(tokens.contentColor, ")");
|
74
70
|
});
|
75
71
|
export var StyledItemWrapper = /*#__PURE__*/styled.div.withConfig({
|
@@ -77,7 +73,7 @@ export var StyledItemWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
77
73
|
})(["margin-top:1rem;opacity:1;&&.", "{animation:0.4s showAnimation ease-out;&.", "{animation:0.4s showLeftToRightAnimation ease-out;}&.", "{animation:0.4s showTopToCenterAnimation ease-out;}&.", "{animation:0.4s showBottomToCenterAnimation ease-out;}}&&.", "{animation:0.4s hideAnimation ease-out;&.", "{animation:0.4s hideLeftToRightAnimation ease-out;}}@keyframes showTopToCenterAnimation{0%{transform:translateY(-100%);opacity:0;}100%{transform:translateY(0);opacity:1;}}@keyframes showBottomToCenterAnimation{0%{transform:translateY(100%);opacity:0;}100%{transform:translateY(0);opacity:1;}}@keyframes showLeftToRightAnimation{0%{transform:translateX(-100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes hideLeftToRightAnimation{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(-100%);opacity:0;}}@keyframes showAnimation{0%{transform:translateX(100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes hideAnimation{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(100%);opacity:0;}}"], classes.notificationItemOpened, classes.notificationLeftToRightAnimation, classes.notificationTopToCenterAnimation, classes.notificationBottomToCenterAnimation, classes.notificationItemHidden, classes.notificationLeftToRightAnimation);
|
78
74
|
export var StyledRoot = /*#__PURE__*/styled.div.withConfig({
|
79
75
|
componentId: "plasma-new-hope__sc-1iufy9r-9"
|
80
|
-
})(["display:flex;flex-direction:column-reverse;box-sizing:border-box;padding:0 1.5rem 1.5rem;max-height:100%;align-items:", ";"], function (
|
81
|
-
var placement =
|
76
|
+
})(["display:flex;flex-direction:column-reverse;box-sizing:border-box;padding:0 1.5rem 1.5rem;max-height:100%;align-items:", ";"], function (_ref12) {
|
77
|
+
var placement = _ref12.placement;
|
82
78
|
return placement === 'bottom-left' ? 'flex-start' : 'flex-end';
|
83
79
|
});
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { css } from 'styled-components';
|
2
2
|
import { classes, tokens } from "../../Notification.tokens";
|
3
|
-
export var base = /*#__PURE__*/css([".", "{padding:var(", ");}.", ".", "{padding:var(", ");&.", "{padding-right:var(", ");}}.", ".", ".", "{padding:var(", ");}"], classes.wrapper, tokens.padding, classes.wrapper, classes.horizontal, tokens.horizontalLayoutPadding, classes.withoutCloseIcon, tokens.horizontalLayoutRightPaddingWithoutCloseIcon, classes.wrapper, classes.horizontal, classes.oneLine, tokens.paddingOneLineTextbox);
|
3
|
+
export var base = /*#__PURE__*/css([".", "{width:var(", ");padding:var(", ");}.", ".", "{padding:var(", ");&.", "{padding-right:var(", ");}}.", ".", ".", "{padding:var(", ");}"], classes.wrapper, tokens.width, tokens.padding, classes.wrapper, classes.horizontal, tokens.horizontalLayoutPadding, classes.withoutCloseIcon, tokens.horizontalLayoutRightPaddingWithoutCloseIcon, classes.wrapper, classes.horizontal, classes.oneLine, tokens.paddingOneLineTextbox);
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
/**
|
3
|
+
* Элемент пагинации точками.
|
4
|
+
* Стилизованный компонент, обладающий всеми свойствами ``div``.
|
5
|
+
*/
|
6
|
+
export var DotBase = /*#__PURE__*/styled.li.withConfig({
|
7
|
+
componentId: "plasma-new-hope__sc-1lu8gfj-0"
|
8
|
+
})(["width:", ";height:0.375rem;border-radius:1rem;background:", ";transition:width 0.1s ease-in-out,background 0.3s ease-in-out;font-size:0.5rem;& + &{margin-left:0.375rem;}&:focus{outline:0 none;}"], function (_ref) {
|
9
|
+
var isActive = _ref.isActive;
|
10
|
+
return isActive ? '1.75rem' : '0.375rem';
|
11
|
+
}, function (_ref2) {
|
12
|
+
var isActive = _ref2.isActive;
|
13
|
+
return isActive ? 'var(--text-primary)' : 'var(--surfaceTransparentTertiary)';
|
14
|
+
});
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Элемент пагинации точками.
|
18
|
+
* Стилизованный компонент, обладающий всеми свойствами ``div``.
|
19
|
+
*/
|
20
|
+
export var PaginationDot = /*#__PURE__*/styled(DotBase).withConfig({
|
21
|
+
componentId: "plasma-new-hope__sc-1lu8gfj-1"
|
22
|
+
})(["cursor:pointer;background:", ";&:hover{background:var(--text-accent);}"], function (_ref3) {
|
23
|
+
var isActive = _ref3.isActive;
|
24
|
+
return isActive ? 'var(--text-accent)' : 'var(--surfaceTransparentTertiary)';
|
25
|
+
});
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Оборачивающий компонент для пагинации точками.
|
5
|
+
* Стилизованный компонент, обладающий всеми свойствами ``div``.
|
6
|
+
*/
|
7
|
+
export var DotsBase = /*#__PURE__*/styled.ul.withConfig({
|
8
|
+
componentId: "plasma-new-hope__sc-1ritf0l-0"
|
9
|
+
})(["display:flex;flex-wrap:wrap;align-self:center;align-items:center;margin:0;padding:0;list-style:none;"]);
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Оборачивающий компонент для пагинации точками.
|
13
|
+
* Стилизованный компонент, обладающий всеми свойствами ``div``.
|
14
|
+
*/
|
15
|
+
export var PaginationDots = /*#__PURE__*/styled(DotsBase).withConfig({
|
16
|
+
componentId: "plasma-new-hope__sc-1ritf0l-1"
|
17
|
+
})([""]);
|
@@ -0,0 +1,35 @@
|
|
1
|
+
var _excluded = ["items", "index", "visibleItems", "onIndexChange"];
|
2
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
4
|
+
import React from 'react';
|
5
|
+
import { usePaginationDots } from "./usePaginationDots";
|
6
|
+
import { PaginationDots } from "./PaginationDots";
|
7
|
+
import { PaginationDot } from "./PaginationDot";
|
8
|
+
/**
|
9
|
+
* Компонент для отображения точек пагинации
|
10
|
+
* с возможностью ограничения количества видимых элементов.
|
11
|
+
*/
|
12
|
+
export var SmartPaginationDots = function SmartPaginationDots(_ref) {
|
13
|
+
var items = _ref.items,
|
14
|
+
index = _ref.index,
|
15
|
+
visibleItems = _ref.visibleItems,
|
16
|
+
onIndexChange = _ref.onIndexChange,
|
17
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
18
|
+
var _usePaginationDots = usePaginationDots({
|
19
|
+
items: items,
|
20
|
+
index: index,
|
21
|
+
visibleItems: visibleItems
|
22
|
+
}),
|
23
|
+
sliced = _usePaginationDots.sliced,
|
24
|
+
activeId = _usePaginationDots.activeId;
|
25
|
+
return /*#__PURE__*/React.createElement(PaginationDots, rest, sliced.map(function (_ref2, i) {
|
26
|
+
var id = _ref2.id;
|
27
|
+
return /*#__PURE__*/React.createElement(PaginationDot, {
|
28
|
+
key: "item:".concat(i),
|
29
|
+
isActive: id === activeId,
|
30
|
+
onClick: function onClick() {
|
31
|
+
return onIndexChange === null || onIndexChange === void 0 ? void 0 : onIndexChange(i);
|
32
|
+
}
|
33
|
+
});
|
34
|
+
}));
|
35
|
+
};
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { useRef } from 'react';
|
2
|
+
export var usePaginationDots = function usePaginationDots(_ref) {
|
3
|
+
var items = _ref.items,
|
4
|
+
index = _ref.index,
|
5
|
+
_ref$visibleItems = _ref.visibleItems,
|
6
|
+
visibleItems = _ref$visibleItems === void 0 ? 7 : _ref$visibleItems;
|
7
|
+
var activeId = items[index].id;
|
8
|
+
var prevIndex = useRef(null);
|
9
|
+
var direction = 0;
|
10
|
+
if (prevIndex.current !== null) {
|
11
|
+
direction = index > prevIndex.current ? 1 : -1;
|
12
|
+
}
|
13
|
+
var start;
|
14
|
+
var end;
|
15
|
+
if (direction === 1) {
|
16
|
+
end = Math.min(Math.max(index + 2, visibleItems), items.length);
|
17
|
+
start = Math.max(end - visibleItems, 0);
|
18
|
+
} else if (direction === -1) {
|
19
|
+
start = Math.min(Math.max(index - 1, 0), items.length - visibleItems);
|
20
|
+
end = start + visibleItems;
|
21
|
+
} else {
|
22
|
+
start = Math.max(index - Math.floor(visibleItems / 2), 0);
|
23
|
+
end = Math.min(start + visibleItems, items.length);
|
24
|
+
start = end - visibleItems;
|
25
|
+
}
|
26
|
+
var sliced = items.slice(start, end);
|
27
|
+
prevIndex.current = index;
|
28
|
+
return {
|
29
|
+
sliced: sliced,
|
30
|
+
activeId: activeId
|
31
|
+
};
|
32
|
+
};
|
package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx
CHANGED
@@ -167,13 +167,12 @@ type StoryLiveDemoProps = ComponentProps<typeof Notification> & {
|
|
167
167
|
placement?: NotificationPlacement;
|
168
168
|
};
|
169
169
|
|
170
|
-
const StoryLiveDemo = ({ timeout, placement,
|
170
|
+
const StoryLiveDemo = ({ timeout, placement, ...rest }: StoryLiveDemoProps) => {
|
171
171
|
const count = useRef(0);
|
172
172
|
const handleClick = useCallback(() => {
|
173
173
|
addNotification(
|
174
174
|
{
|
175
175
|
icon: <IconDisclosureRight color="inherit" />,
|
176
|
-
width,
|
177
176
|
...rest,
|
178
177
|
...getNotificationProps(count.current),
|
179
178
|
},
|
@@ -211,7 +210,6 @@ export const LiveDemo: StoryObj<StoryLiveDemoProps> = {
|
|
211
210
|
role: 'alert',
|
212
211
|
layout: 'vertical',
|
213
212
|
placement: 'bottom-right',
|
214
|
-
width: '',
|
215
213
|
},
|
216
214
|
render: (args) => <StoryLiveDemo {...args} />,
|
217
215
|
};
|