@salutejs/plasma-core 1.226.1-next-sbcom.0 → 1.227.0-dev.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/__helpers/IconPlaceholder.js +6 -9
- package/__helpers/index.js +1 -1
- package/collectPackageInfo.js +4 -4
- package/components/Badge/Badge.js +30 -103
- package/components/Badge/index.js +1 -1
- package/components/Basebox/Basebox.js +33 -42
- package/components/Basebox/index.js +1 -1
- package/components/Button/Button.js +28 -67
- package/components/Button/Button.mixins.js +22 -76
- package/components/Button/Button.props.js +5 -5
- package/components/Button/createButton.js +14 -145
- package/components/Button/index.js +4 -4
- package/components/Card/Card.js +34 -162
- package/components/Card/CardBody.js +4 -4
- package/components/Card/CardContent.js +14 -23
- package/components/Card/CardMedia.js +20 -91
- package/components/Card/CardPrice.js +18 -60
- package/components/Card/CardTypography.js +43 -52
- package/components/Card/index.js +5 -5
- package/components/Carousel/Carousel.js +46 -64
- package/components/Carousel/CarouselItem.js +21 -93
- package/components/Carousel/hooks.js +62 -121
- package/components/Carousel/index.js +3 -3
- package/components/Carousel/utils.js +59 -73
- package/components/Fade/Fade.js +6 -9
- package/components/Fade/index.js +1 -1
- package/components/Field/Field.js +48 -63
- package/components/Field/Field.statuses.js +3 -3
- package/components/Field/index.js +2 -2
- package/components/Image/Image.js +34 -115
- package/components/Image/index.js +1 -1
- package/components/Input/Input.js +7 -7
- package/components/Input/Input.mixins.js +9 -12
- package/components/Input/index.js +1 -1
- package/components/ModalBase/ModalBase.js +22 -100
- package/components/ModalBase/ModalBaseContext.js +6 -9
- package/components/ModalBase/ModalOverlay.js +28 -111
- package/components/ModalBase/hooks.js +15 -43
- package/components/ModalBase/index.js +2 -2
- package/components/PaginationDots/PaginationDot.js +11 -17
- package/components/PaginationDots/PaginationDots.js +4 -7
- package/components/PaginationDots/index.js +3 -3
- package/components/PaginationDots/usePaginationDots.js +10 -11
- package/components/Popup/Popup.js +52 -205
- package/components/Popup/index.js +1 -1
- package/components/PopupBase/PopupBase.js +35 -169
- package/components/PopupBase/PopupBaseContext.js +26 -86
- package/components/PopupBase/PopupBaseRoot.js +31 -169
- package/components/PopupBase/hooks.js +23 -97
- package/components/PopupBase/index.js +3 -3
- package/components/PopupBase/utils.js +32 -78
- package/components/Price/Price.js +15 -90
- package/components/Price/index.js +1 -1
- package/components/RadioGroup/RadioGroup.js +6 -127
- package/components/RadioGroup/index.js +1 -1
- package/components/SSRProvider/SSRProvider.js +4 -5
- package/components/SSRProvider/index.js +1 -1
- package/components/Skeleton/LineSkeleton.js +23 -95
- package/components/Skeleton/RectSkeleton.js +20 -93
- package/components/Skeleton/Skeleton.js +2 -2
- package/components/Skeleton/TextSkeleton.js +11 -55
- package/components/Skeleton/index.js +3 -3
- package/components/Slider/Double.js +52 -203
- package/components/Slider/Handle.js +28 -158
- package/components/Slider/Single.js +29 -177
- package/components/Slider/Slider.js +5 -7
- package/components/Slider/SliderBase.js +39 -48
- package/components/Slider/ThumbBase.js +19 -95
- package/components/Slider/index.js +3 -3
- package/components/Slider/utils.js +2 -2
- package/components/Spinner/Spinner.js +28 -100
- package/components/Spinner/SpinnerSvg.js +9 -78
- package/components/Spinner/index.js +1 -1
- package/components/Switch/Switch.js +49 -220
- package/components/Switch/index.js +1 -1
- package/components/Tabs/TabItem.js +33 -168
- package/components/Tabs/Tabs.js +32 -170
- package/components/Tabs/TabsContext.js +12 -42
- package/components/Tabs/createTabsController.js +33 -168
- package/components/Tabs/index.js +4 -4
- package/components/TextArea/TextArea.js +20 -30
- package/components/TextArea/index.js +1 -1
- package/components/TextField/index.js +3 -3
- package/components/Toast/Toast.js +15 -16
- package/components/Toast/ToastContext.js +4 -8
- package/components/Toast/ToastController.js +44 -101
- package/components/Toast/ToastProvider.js +37 -142
- package/components/Toast/index.js +3 -3
- package/components/Toast/useToast.js +6 -6
- package/components/Typography/Body.js +18 -18
- package/components/Typography/Button.js +13 -13
- package/components/Typography/Caption.js +8 -8
- package/components/Typography/Display.js +18 -18
- package/components/Typography/Footnote.js +13 -13
- package/components/Typography/Headline.js +43 -43
- package/components/Typography/Paragraph.js +24 -24
- package/components/Typography/Underline.js +8 -8
- package/es/__helpers/IconPlaceholder.js +5 -8
- package/es/collectPackageInfo.js +3 -3
- package/es/components/Badge/Badge.js +27 -100
- package/es/components/Basebox/Basebox.js +28 -37
- package/es/components/Button/Button.js +24 -63
- package/es/components/Button/Button.mixins.js +19 -73
- package/es/components/Button/Button.props.js +3 -3
- package/es/components/Button/createButton.js +12 -143
- package/es/components/Card/Card.js +29 -157
- package/es/components/Card/CardBody.js +2 -2
- package/es/components/Card/CardContent.js +12 -21
- package/es/components/Card/CardMedia.js +17 -88
- package/es/components/Card/CardPrice.js +13 -55
- package/es/components/Card/CardTypography.js +43 -52
- package/es/components/Carousel/Carousel.js +45 -63
- package/es/components/Carousel/CarouselItem.js +18 -90
- package/es/components/Carousel/hooks.js +58 -117
- package/es/components/Carousel/utils.js +58 -72
- package/es/components/Fade/Fade.js +5 -8
- package/es/components/Field/Field.js +44 -59
- package/es/components/Field/Field.statuses.js +4 -4
- package/es/components/Image/Image.js +31 -112
- package/es/components/Input/Input.js +4 -4
- package/es/components/Input/Input.mixins.js +6 -9
- package/es/components/ModalBase/ModalBase.js +16 -94
- package/es/components/ModalBase/ModalBaseContext.js +6 -9
- package/es/components/ModalBase/ModalOverlay.js +23 -106
- package/es/components/ModalBase/hooks.js +12 -40
- package/es/components/PaginationDots/PaginationDot.js +9 -15
- package/es/components/PaginationDots/PaginationDots.js +3 -6
- package/es/components/PaginationDots/usePaginationDots.js +9 -10
- package/es/components/Popup/Popup.js +48 -201
- package/es/components/PopupBase/PopupBase.js +27 -161
- package/es/components/PopupBase/PopupBaseContext.js +25 -85
- package/es/components/PopupBase/PopupBaseRoot.js +26 -164
- package/es/components/PopupBase/hooks.js +21 -95
- package/es/components/PopupBase/utils.js +31 -77
- package/es/components/Price/Price.js +12 -87
- package/es/components/RadioGroup/RadioGroup.js +5 -126
- package/es/components/SSRProvider/SSRProvider.js +3 -4
- package/es/components/Skeleton/LineSkeleton.js +18 -90
- package/es/components/Skeleton/RectSkeleton.js +16 -89
- package/es/components/Skeleton/Skeleton.js +2 -2
- package/es/components/Skeleton/TextSkeleton.js +7 -51
- package/es/components/Slider/Double.js +49 -200
- package/es/components/Slider/Handle.js +23 -153
- package/es/components/Slider/Single.js +26 -174
- package/es/components/Slider/Slider.js +2 -4
- package/es/components/Slider/SliderBase.js +36 -45
- package/es/components/Slider/ThumbBase.js +16 -92
- package/es/components/Slider/index.js +1 -1
- package/es/components/Slider/utils.js +2 -2
- package/es/components/Spinner/Spinner.js +23 -95
- package/es/components/Spinner/SpinnerSvg.js +8 -77
- package/es/components/Switch/Switch.js +45 -216
- package/es/components/Tabs/TabItem.js +28 -163
- package/es/components/Tabs/Tabs.js +28 -166
- package/es/components/Tabs/TabsContext.js +11 -41
- package/es/components/Tabs/createTabsController.js +28 -163
- package/es/components/TextArea/TextArea.js +18 -28
- package/es/components/Toast/Toast.js +10 -11
- package/es/components/Toast/ToastContext.js +3 -7
- package/es/components/Toast/ToastController.js +38 -95
- package/es/components/Toast/ToastProvider.js +34 -139
- package/es/components/Toast/useToast.js +4 -4
- package/es/components/Typography/Body.js +15 -15
- package/es/components/Typography/Button.js +10 -10
- package/es/components/Typography/Caption.js +5 -5
- package/es/components/Typography/Display.js +15 -15
- package/es/components/Typography/Footnote.js +10 -10
- package/es/components/Typography/Headline.js +40 -40
- package/es/components/Typography/Paragraph.js +21 -21
- package/es/components/Typography/Underline.js +5 -5
- package/es/hocs/withAutoFocus.js +8 -78
- package/es/hocs/withSkeleton.js +5 -10
- package/es/hooks/useDebouncedFunction.js +4 -36
- package/es/hooks/useFocusTrap.js +18 -21
- package/es/hooks/useForkRef.js +3 -3
- package/es/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/es/hooks/useResizeObserver.js +8 -8
- package/es/hooks/useUniqId.js +6 -52
- package/es/mixins/addFocus.js +17 -22
- package/es/mixins/applyDisabled.js +6 -9
- package/es/mixins/applyEllipsis.js +2 -4
- package/es/mixins/applyMaxLines.js +3 -6
- package/es/mixins/applyNoSelect.js +2 -4
- package/es/mixins/applyOutline.js +2 -4
- package/es/mixins/applyRoundness.js +4 -7
- package/es/mixins/applyScrollSnap.js +4 -7
- package/es/mixins/applySkeletonGradient.js +6 -9
- package/es/mixins/applyView.js +2 -5
- package/es/mixins/blur.js +2 -5
- package/es/mixins/shadows.js +1 -1
- package/es/tokens/colors.js +48 -48
- package/es/tokens/typography.js +18 -18
- package/es/utils/__tests__/formatters.test.js +2 -2
- package/es/utils/animatedScrollTo.js +24 -34
- package/es/utils/canUseDOM.js +1 -1
- package/es/utils/extractTextFrom.js +3 -7
- package/es/utils/focusManager.js +40 -47
- package/es/utils/formatCurrency.js +4 -4
- package/es/utils/formatters.js +6 -14
- package/es/utils/react.js +4 -4
- package/es/utils/roundness.js +2 -4
- package/es/utils/scopeTab.js +5 -5
- package/es/utils/setRef.js +1 -1
- package/es/utils/tabbable.js +16 -25
- package/es/utils/toCssSize.js +1 -3
- package/es/utils/transformStyles.js +5 -60
- package/hocs/index.js +2 -2
- package/hocs/withAutoFocus.js +9 -79
- package/hocs/withSkeleton.js +8 -13
- package/hooks/index.js +6 -6
- package/hooks/useDebouncedFunction.js +5 -37
- package/hooks/useFocusTrap.js +22 -25
- package/hooks/useForkRef.js +5 -5
- package/hooks/useIsomorphicLayoutEffect.js +3 -3
- package/hooks/useResizeObserver.js +9 -9
- package/hooks/useUniqId.js +8 -54
- package/mixins/addFocus.js +19 -24
- package/mixins/applyDisabled.js +7 -10
- package/mixins/applyEllipsis.js +3 -5
- package/mixins/applyMaxLines.js +4 -7
- package/mixins/applyNoSelect.js +3 -5
- package/mixins/applyOutline.js +3 -5
- package/mixins/applyRoundness.js +5 -8
- package/mixins/applyScrollSnap.js +5 -8
- package/mixins/applySkeletonGradient.js +8 -11
- package/mixins/applyView.js +3 -6
- package/mixins/blur.js +2 -5
- package/mixins/index.js +11 -11
- package/mixins/shadows.js +1 -1
- package/package.json +13 -18
- package/tokens/colors.js +48 -48
- package/tokens/typography.js +18 -18
- package/utils/__tests__/formatters.test.js +3 -3
- package/utils/animatedScrollTo.js +24 -34
- package/utils/canUseDOM.js +1 -1
- package/utils/extractTextFrom.js +4 -8
- package/utils/focusManager.js +41 -48
- package/utils/formatCurrency.js +4 -4
- package/utils/formatters.js +6 -14
- package/utils/index.js +10 -10
- package/utils/react.js +7 -7
- package/utils/roundness.js +2 -4
- package/utils/scopeTab.js +6 -6
- package/utils/setRef.js +1 -1
- package/utils/tabbable.js +16 -25
- package/utils/toCssSize.js +1 -3
- package/utils/transformStyles.js +5 -60
|
@@ -2,28 +2,19 @@ import React from 'react';
|
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
/**
|
|
4
4
|
* Компонент для отображения как текстового, так и любого другого контента.
|
|
5
|
-
*/ export
|
|
5
|
+
*/ export const CardContent = styled.div.withConfig({
|
|
6
6
|
displayName: "CardContent",
|
|
7
7
|
componentId: "sc-4a3fa268-0"
|
|
8
8
|
})([
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
],
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return disabled && css([
|
|
19
|
-
"opacity:0.5;"
|
|
20
|
-
]);
|
|
21
|
-
}, function(param) {
|
|
22
|
-
var cover = param.cover, _param_coverGradient = param.coverGradient, coverGradient = _param_coverGradient === void 0 ? true : _param_coverGradient;
|
|
23
|
-
return cover && css([
|
|
24
|
-
"position:absolute;top:0;left:0;right:0;bottom:0;justify-content:flex-end;",
|
|
25
|
-
";"
|
|
9
|
+
`display:flex;flex-direction:column;position:relative;box-sizing:border-box;padding:`,
|
|
10
|
+
`rem 1rem;border-radius:inherit;`,
|
|
11
|
+
` `,
|
|
12
|
+
``
|
|
13
|
+
], ({ compact })=>compact ? 0.375 : 1, ({ disabled })=>disabled && css([
|
|
14
|
+
`opacity:0.5;`
|
|
15
|
+
]), ({ cover, coverGradient = true })=>cover && css([
|
|
16
|
+
`position:absolute;top:0;left:0;right:0;bottom:0;justify-content:flex-end;`,
|
|
17
|
+
`;`
|
|
26
18
|
], coverGradient && css([
|
|
27
|
-
|
|
28
|
-
]));
|
|
29
|
-
});
|
|
19
|
+
`background:linear-gradient(180deg,rgba(0,0,0,0) 0%,rgba(0,0,0,0.74) 100%);`
|
|
20
|
+
])));
|
|
@@ -1,106 +1,35 @@
|
|
|
1
|
-
function _define_property(obj, key, value) {
|
|
2
|
-
if (key in obj) {
|
|
3
|
-
Object.defineProperty(obj, key, {
|
|
4
|
-
value: value,
|
|
5
|
-
enumerable: true,
|
|
6
|
-
configurable: true,
|
|
7
|
-
writable: true
|
|
8
|
-
});
|
|
9
|
-
} else {
|
|
10
|
-
obj[key] = value;
|
|
11
|
-
}
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
function _object_spread(target) {
|
|
15
|
-
for(var i = 1; i < arguments.length; i++){
|
|
16
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
-
var ownKeys = Object.keys(source);
|
|
18
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
ownKeys.forEach(function(key) {
|
|
24
|
-
_define_property(target, key, source[key]);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
}
|
|
29
|
-
function _object_without_properties(source, excluded) {
|
|
30
|
-
if (source == null) return {};
|
|
31
|
-
var target = {}, sourceKeys, key, i;
|
|
32
|
-
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
33
|
-
sourceKeys = Reflect.ownKeys(source);
|
|
34
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
35
|
-
key = sourceKeys[i];
|
|
36
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
37
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
38
|
-
target[key] = source[key];
|
|
39
|
-
}
|
|
40
|
-
return target;
|
|
41
|
-
}
|
|
42
|
-
target = _object_without_properties_loose(source, excluded);
|
|
43
|
-
if (Object.getOwnPropertySymbols) {
|
|
44
|
-
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
45
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
46
|
-
key = sourceKeys[i];
|
|
47
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
48
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
49
|
-
target[key] = source[key];
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return target;
|
|
53
|
-
}
|
|
54
|
-
function _object_without_properties_loose(source, excluded) {
|
|
55
|
-
if (source == null) return {};
|
|
56
|
-
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
57
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
58
|
-
key = sourceKeys[i];
|
|
59
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
60
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
61
|
-
target[key] = source[key];
|
|
62
|
-
}
|
|
63
|
-
return target;
|
|
64
|
-
}
|
|
65
1
|
import React from 'react';
|
|
66
2
|
import styled, { css } from 'styled-components';
|
|
67
3
|
import { Image } from '../Image';
|
|
68
|
-
|
|
4
|
+
const StyledImage = styled(Image).withConfig({
|
|
69
5
|
displayName: "CardMedia__StyledImage",
|
|
70
6
|
componentId: "sc-636df49e-0"
|
|
71
7
|
})([
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
],
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
]);
|
|
79
|
-
});
|
|
80
|
-
var StyledRoot = styled.div.withConfig({
|
|
8
|
+
`background-size:cover;`,
|
|
9
|
+
``
|
|
10
|
+
], ({ $disabled })=>$disabled && css([
|
|
11
|
+
`opacity:0.5;`
|
|
12
|
+
]));
|
|
13
|
+
const StyledRoot = styled.div.withConfig({
|
|
81
14
|
displayName: "CardMedia__StyledRoot",
|
|
82
15
|
componentId: "sc-636df49e-1"
|
|
83
16
|
})([
|
|
84
|
-
|
|
17
|
+
`position:relative;`
|
|
85
18
|
]);
|
|
86
19
|
/**
|
|
87
20
|
* Компонент для отображения картинок.
|
|
88
|
-
*/ export
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"style",
|
|
93
|
-
"children",
|
|
94
|
-
"className"
|
|
95
|
-
]);
|
|
96
|
-
var imgStyle = _object_spread({}, style);
|
|
21
|
+
*/ export const CardMedia = ({ disabled, placeholder, style, children, className, ...props })=>{
|
|
22
|
+
const imgStyle = {
|
|
23
|
+
...style
|
|
24
|
+
};
|
|
97
25
|
if (placeholder && !props.src) {
|
|
98
|
-
imgStyle.backgroundImage =
|
|
26
|
+
imgStyle.backgroundImage = `url('${placeholder}')`;
|
|
99
27
|
}
|
|
100
28
|
return /*#__PURE__*/ React.createElement(StyledRoot, {
|
|
101
29
|
className: className
|
|
102
|
-
}, /*#__PURE__*/ React.createElement(StyledImage,
|
|
30
|
+
}, /*#__PURE__*/ React.createElement(StyledImage, {
|
|
103
31
|
$disabled: disabled,
|
|
104
|
-
style: imgStyle
|
|
105
|
-
|
|
32
|
+
style: imgStyle,
|
|
33
|
+
...props
|
|
34
|
+
}), children);
|
|
106
35
|
};
|
|
@@ -1,82 +1,40 @@
|
|
|
1
|
-
function _object_without_properties(source, excluded) {
|
|
2
|
-
if (source == null) return {};
|
|
3
|
-
var target = {}, sourceKeys, key, i;
|
|
4
|
-
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
5
|
-
sourceKeys = Reflect.ownKeys(source);
|
|
6
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
7
|
-
key = sourceKeys[i];
|
|
8
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
9
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
10
|
-
target[key] = source[key];
|
|
11
|
-
}
|
|
12
|
-
return target;
|
|
13
|
-
}
|
|
14
|
-
target = _object_without_properties_loose(source, excluded);
|
|
15
|
-
if (Object.getOwnPropertySymbols) {
|
|
16
|
-
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
17
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
18
|
-
key = sourceKeys[i];
|
|
19
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
20
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
21
|
-
target[key] = source[key];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return target;
|
|
25
|
-
}
|
|
26
|
-
function _object_without_properties_loose(source, excluded) {
|
|
27
|
-
if (source == null) return {};
|
|
28
|
-
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
29
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
30
|
-
key = sourceKeys[i];
|
|
31
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
32
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
33
|
-
target[key] = source[key];
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
}
|
|
37
1
|
import React from 'react'; // eslint-disable-line
|
|
38
2
|
import styled from 'styled-components';
|
|
39
3
|
import { buttonAccent, primary, tertiary } from '../../tokens';
|
|
40
4
|
import { Price } from '../Price';
|
|
41
5
|
import { Body2 } from '../Typography';
|
|
42
|
-
|
|
6
|
+
const StyledRoot = styled(Body2).withConfig({
|
|
43
7
|
displayName: "CardPrice__StyledRoot",
|
|
44
8
|
componentId: "sc-b9ac85b9-0"
|
|
45
9
|
})([
|
|
46
|
-
|
|
10
|
+
`display:flex;box-sizing:border-box;margin-top:0.75rem;`
|
|
47
11
|
]);
|
|
48
|
-
|
|
12
|
+
const StyledPrice = styled(Price).withConfig({
|
|
49
13
|
displayName: "CardPrice__StyledPrice",
|
|
50
14
|
componentId: "sc-b9ac85b9-1"
|
|
51
15
|
})([
|
|
52
|
-
|
|
53
|
-
|
|
16
|
+
`height:2.5rem;color:`,
|
|
17
|
+
`;`
|
|
54
18
|
], primary);
|
|
55
|
-
|
|
19
|
+
const StyledOldPrice = styled(Price).withConfig({
|
|
56
20
|
displayName: "CardPrice__StyledOldPrice",
|
|
57
21
|
componentId: "sc-b9ac85b9-2"
|
|
58
22
|
})([
|
|
59
|
-
|
|
60
|
-
|
|
23
|
+
`height:2.5rem;margin-left:0.5rem;color:`,
|
|
24
|
+
`;`
|
|
61
25
|
], tertiary);
|
|
62
|
-
|
|
26
|
+
const StyledCount = styled(Body2).withConfig({
|
|
63
27
|
displayName: "CardPrice__StyledCount",
|
|
64
28
|
componentId: "sc-b9ac85b9-3"
|
|
65
29
|
})([
|
|
66
|
-
|
|
67
|
-
|
|
30
|
+
`box-sizing:border-box;height:2.5rem;margin-left:0.5rem;color:`,
|
|
31
|
+
`;`
|
|
68
32
|
], buttonAccent);
|
|
69
|
-
export
|
|
70
|
-
var count = _0.count, currency = _0.currency, oldPrice = _0.oldPrice, price = _0.price, rest = _object_without_properties(_0, [
|
|
71
|
-
"count",
|
|
72
|
-
"currency",
|
|
73
|
-
"oldPrice",
|
|
74
|
-
"price"
|
|
75
|
-
]);
|
|
33
|
+
export const CardPrice = ({ count, currency, oldPrice, price, ...rest })=>{
|
|
76
34
|
return /*#__PURE__*/ React.createElement(StyledRoot, rest, /*#__PURE__*/ React.createElement(StyledPrice, {
|
|
77
35
|
currency: currency
|
|
78
36
|
}, price), oldPrice && /*#__PURE__*/ React.createElement(StyledOldPrice, {
|
|
79
37
|
currency: currency,
|
|
80
38
|
stroke: true
|
|
81
|
-
}, oldPrice), count ? /*#__PURE__*/ React.createElement(StyledCount, null, "
|
|
39
|
+
}, oldPrice), count ? /*#__PURE__*/ React.createElement(StyledCount, null, "×", count) : '');
|
|
82
40
|
};
|
|
@@ -2,93 +2,84 @@
|
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { primary, secondary, tertiary } from '../../tokens';
|
|
4
4
|
import { Body1, Body2, ParagraphText1, ParagraphText2, Headline1, Headline2, Headline3, Footnote1, Footnote2 } from '../Typography';
|
|
5
|
-
|
|
6
|
-
primary
|
|
7
|
-
secondary
|
|
8
|
-
tertiary
|
|
5
|
+
const views = {
|
|
6
|
+
primary,
|
|
7
|
+
secondary,
|
|
8
|
+
tertiary
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"display:-webkit-box;overflow:hidden;box-sizing:border-box;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:",
|
|
14
|
-
";"
|
|
10
|
+
const linesMixin = ({ lines = 2 })=>css([
|
|
11
|
+
`display:-webkit-box;overflow:hidden;box-sizing:border-box;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:`,
|
|
12
|
+
`;`
|
|
15
13
|
], lines);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
";"
|
|
23
|
-
], function(param) {
|
|
24
|
-
var theme = param.theme;
|
|
25
|
-
return theme.lowPerformance ? 'unset' : 'color 0.1s ease-in-out';
|
|
26
|
-
}, views[view]);
|
|
27
|
-
};
|
|
28
|
-
export var CardHeadline1 = styled(Headline1).withConfig({
|
|
14
|
+
const viewMixin = ({ view = 'primary' })=>css([
|
|
15
|
+
`transition:`,
|
|
16
|
+
`;color:`,
|
|
17
|
+
`;`
|
|
18
|
+
], ({ theme })=>theme.lowPerformance ? 'unset' : 'color 0.1s ease-in-out', views[view]);
|
|
19
|
+
export const CardHeadline1 = styled(Headline1).withConfig({
|
|
29
20
|
displayName: "CardTypography__CardHeadline1",
|
|
30
21
|
componentId: "sc-ebd1f68e-0"
|
|
31
22
|
})([
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
``,
|
|
24
|
+
`;`
|
|
34
25
|
], viewMixin);
|
|
35
|
-
export
|
|
26
|
+
export const CardHeadline2 = styled(Headline2).withConfig({
|
|
36
27
|
displayName: "CardTypography__CardHeadline2",
|
|
37
28
|
componentId: "sc-ebd1f68e-1"
|
|
38
29
|
})([
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
``,
|
|
31
|
+
`;`
|
|
41
32
|
], viewMixin);
|
|
42
|
-
export
|
|
33
|
+
export const CardHeadline3 = styled(Headline3).withConfig({
|
|
43
34
|
displayName: "CardTypography__CardHeadline3",
|
|
44
35
|
componentId: "sc-ebd1f68e-2"
|
|
45
36
|
})([
|
|
46
|
-
|
|
47
|
-
|
|
37
|
+
``,
|
|
38
|
+
`;`
|
|
48
39
|
], viewMixin);
|
|
49
|
-
export
|
|
40
|
+
export const CardFootnote1 = styled(Footnote1).withConfig({
|
|
50
41
|
displayName: "CardTypography__CardFootnote1",
|
|
51
42
|
componentId: "sc-ebd1f68e-3"
|
|
52
43
|
})([
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
``,
|
|
45
|
+
`;`
|
|
55
46
|
], viewMixin);
|
|
56
|
-
export
|
|
47
|
+
export const CardFootnote2 = styled(Footnote2).withConfig({
|
|
57
48
|
displayName: "CardTypography__CardFootnote2",
|
|
58
49
|
componentId: "sc-ebd1f68e-4"
|
|
59
50
|
})([
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
``,
|
|
52
|
+
`;`
|
|
62
53
|
], viewMixin);
|
|
63
|
-
export
|
|
54
|
+
export const CardBody1 = styled(Body1).withConfig({
|
|
64
55
|
displayName: "CardTypography__CardBody1",
|
|
65
56
|
componentId: "sc-ebd1f68e-5"
|
|
66
57
|
})([
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
58
|
+
``,
|
|
59
|
+
`;`,
|
|
60
|
+
`;`
|
|
70
61
|
], linesMixin, viewMixin);
|
|
71
|
-
export
|
|
62
|
+
export const CardBody2 = styled(Body2).withConfig({
|
|
72
63
|
displayName: "CardTypography__CardBody2",
|
|
73
64
|
componentId: "sc-ebd1f68e-6"
|
|
74
65
|
})([
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
66
|
+
``,
|
|
67
|
+
`;`,
|
|
68
|
+
`;`
|
|
78
69
|
], linesMixin, viewMixin);
|
|
79
|
-
export
|
|
70
|
+
export const CardParagraph1 = styled(ParagraphText1).withConfig({
|
|
80
71
|
displayName: "CardTypography__CardParagraph1",
|
|
81
72
|
componentId: "sc-ebd1f68e-7"
|
|
82
73
|
})([
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
``,
|
|
75
|
+
`;`,
|
|
76
|
+
`;`
|
|
86
77
|
], linesMixin, viewMixin);
|
|
87
|
-
export
|
|
78
|
+
export const CardParagraph2 = styled(ParagraphText2).withConfig({
|
|
88
79
|
displayName: "CardTypography__CardParagraph2",
|
|
89
80
|
componentId: "sc-ebd1f68e-8"
|
|
90
81
|
})([
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
82
|
+
``,
|
|
83
|
+
`;`,
|
|
84
|
+
`;`
|
|
94
85
|
], linesMixin, viewMixin);
|
|
@@ -3,89 +3,71 @@ import styled, { css } from 'styled-components';
|
|
|
3
3
|
* Компонент применяется, если требуется компенсировать отступы контейнера в сетке.
|
|
4
4
|
* При обертывании вокруг ``Carousel``, добавляет карусели и ее прокрутке дополнительные отступы.
|
|
5
5
|
* Стилизованный компонент, обладающий всеми свойствами ``div``.
|
|
6
|
-
*/ export
|
|
6
|
+
*/ export const CarouselGridWrapper = styled.div.withConfig({
|
|
7
7
|
displayName: "Carousel__CarouselGridWrapper",
|
|
8
8
|
componentId: "sc-2bb1b43b-0"
|
|
9
9
|
})([
|
|
10
|
-
|
|
10
|
+
`overflow:hidden;margin-left:calc(var(--plasma-grid-margin) * -1);margin-right:calc(var(--plasma-grid-margin) * -1);`
|
|
11
11
|
]);
|
|
12
12
|
/**
|
|
13
13
|
* Корневой элемент - ограничивающая обертка карусели.
|
|
14
|
-
*/ export
|
|
14
|
+
*/ export const Carousel = styled.div.withConfig({
|
|
15
15
|
displayName: "Carousel",
|
|
16
16
|
componentId: "sc-2bb1b43b-1"
|
|
17
17
|
})([
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
],
|
|
23
|
-
|
|
24
|
-
return axis === 'x' ? css([
|
|
25
|
-
"overflow-x:auto;overflow-y:hidden;"
|
|
18
|
+
`position:relative;margin:0;padding:0;list-style:none;::-webkit-scrollbar{display:none;}`,
|
|
19
|
+
` `,
|
|
20
|
+
` `,
|
|
21
|
+
` &{scroll-padding:0 var(--plasma-grid-margin);padding-left:var(--plasma-grid-margin);}`
|
|
22
|
+
], ({ axis })=>axis === 'x' ? css([
|
|
23
|
+
`overflow-x:auto;overflow-y:hidden;`
|
|
26
24
|
]) : css([
|
|
27
|
-
|
|
28
|
-
])
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
" ",
|
|
35
|
-
";"
|
|
36
|
-
], function(param) {
|
|
37
|
-
var theme = param.theme;
|
|
38
|
-
return theme.lowPerformance ? 'unset' : 'smooth';
|
|
39
|
-
}, axis, scrollSnapType);
|
|
40
|
-
}, CarouselGridWrapper);
|
|
25
|
+
`height:100%;overflow-x:hidden;overflow-y:auto;`
|
|
26
|
+
]), ({ scrollSnapType, axis })=>scrollSnapType && scrollSnapType !== 'none' && css([
|
|
27
|
+
`scroll-behavior:`,
|
|
28
|
+
`;scroll-snap-type:`,
|
|
29
|
+
` `,
|
|
30
|
+
`;`
|
|
31
|
+
], ({ theme })=>theme.lowPerformance ? 'unset' : 'smooth', axis, scrollSnapType), CarouselGridWrapper);
|
|
41
32
|
/**
|
|
42
33
|
* Списковый (трековый) элемент карусели для непосредственного вложения айтемов в него.
|
|
43
|
-
*/ export
|
|
34
|
+
*/ export const CarouselTrack = styled.div.withConfig({
|
|
44
35
|
displayName: "Carousel__CarouselTrack",
|
|
45
36
|
componentId: "sc-2bb1b43b-2"
|
|
46
37
|
})([
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
],
|
|
52
|
-
var virtualSize = param.virtualSize, axis = param.axis;
|
|
53
|
-
return(// для виртуализированной карусели (useVirtual)
|
|
38
|
+
``,
|
|
39
|
+
` `,
|
|
40
|
+
` `,
|
|
41
|
+
``
|
|
42
|
+
], ({ virtualSize, axis })=>// для виртуализированной карусели (useVirtual)
|
|
54
43
|
virtualSize && css([
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
], axis === 'x' ? 'width' : 'height', virtualSize))
|
|
59
|
-
}, function(param) {
|
|
60
|
-
var liteMode = param.liteMode;
|
|
61
|
-
return(// для поддержки CarouselLite
|
|
44
|
+
`position:absolute;`,
|
|
45
|
+
`:`,
|
|
46
|
+
`px;`
|
|
47
|
+
], axis === 'x' ? 'width' : 'height', virtualSize), ({ liteMode })=>// для поддержки CarouselLite
|
|
62
48
|
liteMode && css([
|
|
63
|
-
|
|
64
|
-
]))
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"display:inline-flex;flex-direction:row;",
|
|
69
|
-
" ",
|
|
70
|
-
""
|
|
49
|
+
`transition-property:transform;transition-duration:0.5s;transform:translate(0px,0px);`
|
|
50
|
+
]), ({ axis, paddingStart, paddingEnd })=>axis === 'x' ? css([
|
|
51
|
+
`display:inline-flex;flex-direction:row;`,
|
|
52
|
+
` `,
|
|
53
|
+
``
|
|
71
54
|
], paddingStart && css([
|
|
72
|
-
|
|
73
|
-
|
|
55
|
+
`padding-left:`,
|
|
56
|
+
`;`
|
|
74
57
|
], paddingStart), paddingEnd ? css([
|
|
75
|
-
|
|
76
|
-
|
|
58
|
+
`padding-right:`,
|
|
59
|
+
`;`
|
|
77
60
|
], paddingEnd) : css([
|
|
78
|
-
|
|
79
|
-
|
|
61
|
+
``,
|
|
62
|
+
` &{padding-right:var(--plasma-grid-margin);}`
|
|
80
63
|
], CarouselGridWrapper)) : css([
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
64
|
+
`display:flex;flex-direction:column;width:100%;`,
|
|
65
|
+
` `,
|
|
66
|
+
``
|
|
84
67
|
], paddingStart && css([
|
|
85
|
-
|
|
86
|
-
|
|
68
|
+
`padding-top:`,
|
|
69
|
+
`;`
|
|
87
70
|
], paddingStart), paddingEnd && css([
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
], paddingEnd));
|
|
91
|
-
});
|
|
71
|
+
`padding-bottom:`,
|
|
72
|
+
`;`
|
|
73
|
+
], paddingEnd)));
|
|
@@ -1,95 +1,27 @@
|
|
|
1
|
-
function _define_property(obj, key, value) {
|
|
2
|
-
if (key in obj) {
|
|
3
|
-
Object.defineProperty(obj, key, {
|
|
4
|
-
value: value,
|
|
5
|
-
enumerable: true,
|
|
6
|
-
configurable: true,
|
|
7
|
-
writable: true
|
|
8
|
-
});
|
|
9
|
-
} else {
|
|
10
|
-
obj[key] = value;
|
|
11
|
-
}
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
function _object_spread(target) {
|
|
15
|
-
for(var i = 1; i < arguments.length; i++){
|
|
16
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
-
var ownKeys = Object.keys(source);
|
|
18
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
ownKeys.forEach(function(key) {
|
|
24
|
-
_define_property(target, key, source[key]);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
}
|
|
29
|
-
function _object_without_properties(source, excluded) {
|
|
30
|
-
if (source == null) return {};
|
|
31
|
-
var target = {}, sourceKeys, key, i;
|
|
32
|
-
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
33
|
-
sourceKeys = Reflect.ownKeys(source);
|
|
34
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
35
|
-
key = sourceKeys[i];
|
|
36
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
37
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
38
|
-
target[key] = source[key];
|
|
39
|
-
}
|
|
40
|
-
return target;
|
|
41
|
-
}
|
|
42
|
-
target = _object_without_properties_loose(source, excluded);
|
|
43
|
-
if (Object.getOwnPropertySymbols) {
|
|
44
|
-
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
45
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
46
|
-
key = sourceKeys[i];
|
|
47
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
48
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
49
|
-
target[key] = source[key];
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return target;
|
|
53
|
-
}
|
|
54
|
-
function _object_without_properties_loose(source, excluded) {
|
|
55
|
-
if (source == null) return {};
|
|
56
|
-
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
57
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
58
|
-
key = sourceKeys[i];
|
|
59
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
60
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
61
|
-
target[key] = source[key];
|
|
62
|
-
}
|
|
63
|
-
return target;
|
|
64
|
-
}
|
|
65
1
|
import React from 'react';
|
|
66
2
|
import styled from 'styled-components';
|
|
67
3
|
import { applyScrollSnap } from '../../mixins';
|
|
68
|
-
|
|
4
|
+
const StyledItem = styled.div.withConfig({
|
|
69
5
|
displayName: "CarouselItem__StyledItem",
|
|
70
6
|
componentId: "sc-36578ca1-0"
|
|
71
7
|
})([
|
|
72
|
-
|
|
73
|
-
|
|
8
|
+
``,
|
|
9
|
+
``
|
|
74
10
|
], applyScrollSnap);
|
|
75
|
-
|
|
11
|
+
const StyledItemVirtual = styled.div.withConfig({
|
|
76
12
|
displayName: "CarouselItem__StyledItemVirtual",
|
|
77
13
|
componentId: "sc-36578ca1-1"
|
|
78
14
|
})([
|
|
79
|
-
|
|
15
|
+
`position:absolute;`
|
|
80
16
|
]);
|
|
81
|
-
export
|
|
82
|
-
|
|
83
|
-
"scrollSnapAlign",
|
|
84
|
-
"scrollSnapStop",
|
|
85
|
-
"children"
|
|
86
|
-
]);
|
|
87
|
-
return /*#__PURE__*/ React.createElement(StyledItem, _object_spread({
|
|
17
|
+
export const CarouselItem = ({ scrollSnapAlign = 'center', scrollSnapStop = 'always', children, ...rest })=>{
|
|
18
|
+
return /*#__PURE__*/ React.createElement(StyledItem, {
|
|
88
19
|
scrollSnapAlign: scrollSnapAlign,
|
|
89
20
|
scrollSnapStop: scrollSnapStop,
|
|
90
21
|
role: "group",
|
|
91
|
-
"aria-roledescription": "slide"
|
|
92
|
-
|
|
22
|
+
"aria-roledescription": "slide",
|
|
23
|
+
...rest
|
|
24
|
+
}, children);
|
|
93
25
|
};
|
|
94
26
|
/**
|
|
95
27
|
* Компонент для использовани внутри CarouselVirtual для элементов с фиксированным размером.
|
|
@@ -97,18 +29,14 @@ export var CarouselItem = function CarouselItem(_0) {
|
|
|
97
29
|
* ```
|
|
98
30
|
* import { useVirtual } from '@salutejs/use-virtual';
|
|
99
31
|
* ```
|
|
100
|
-
*/ export
|
|
101
|
-
|
|
102
|
-
"left",
|
|
103
|
-
"top",
|
|
104
|
-
"children",
|
|
105
|
-
"style"
|
|
106
|
-
]);
|
|
107
|
-
return /*#__PURE__*/ React.createElement(StyledItemVirtual, _object_spread({
|
|
32
|
+
*/ export const CarouselItemVirtual = ({ left, top, children, style, ...rest })=>{
|
|
33
|
+
return /*#__PURE__*/ React.createElement(StyledItemVirtual, {
|
|
108
34
|
role: "group",
|
|
109
35
|
"aria-roledescription": "slide",
|
|
110
|
-
style:
|
|
111
|
-
transform:
|
|
112
|
-
|
|
113
|
-
|
|
36
|
+
style: {
|
|
37
|
+
transform: `translate(${left ?? 0}px, ${top ?? 0}px)`,
|
|
38
|
+
...style
|
|
39
|
+
},
|
|
40
|
+
...rest
|
|
41
|
+
}, children);
|
|
114
42
|
};
|