@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
|
@@ -1,31 +1,3 @@
|
|
|
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
1
|
import React from 'react';
|
|
30
2
|
import styled from 'styled-components';
|
|
31
3
|
import { applyDisabled, applyBlur, applyEllipsis } from '../../mixins';
|
|
@@ -33,71 +5,60 @@ import { Spinner } from '../Spinner';
|
|
|
33
5
|
/**
|
|
34
6
|
* Корневой элемент для стилизации кнопки.
|
|
35
7
|
* Должен быть передан в функцию `createButton`.
|
|
36
|
-
*/ export
|
|
8
|
+
*/ export const ButtonRoot = styled.button.withConfig({
|
|
37
9
|
displayName: "Button__ButtonRoot",
|
|
38
10
|
componentId: "sc-b39b3537-0"
|
|
39
11
|
})([
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
],
|
|
44
|
-
var isLoading = param.$isLoading;
|
|
45
|
-
return !isLoading && applyDisabled;
|
|
46
|
-
}, applyBlur);
|
|
12
|
+
`position:relative;display:inline-flex;align-items:center;box-sizing:border-box;justify-content:center;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);a&{text-decoration:none;}&:focus{outline:none;}`,
|
|
13
|
+
` `,
|
|
14
|
+
``
|
|
15
|
+
], ({ $isLoading: isLoading })=>!isLoading && applyDisabled, applyBlur);
|
|
47
16
|
/**
|
|
48
17
|
* Элемент лоадера для кнопки.
|
|
49
|
-
*/ export
|
|
18
|
+
*/ export const ButtonLoader = styled.div.withConfig({
|
|
50
19
|
displayName: "Button__ButtonLoader",
|
|
51
20
|
componentId: "sc-b39b3537-1"
|
|
52
21
|
})([
|
|
53
|
-
|
|
22
|
+
`position:absolute;`
|
|
54
23
|
]);
|
|
55
24
|
/**
|
|
56
25
|
* Спиннер по умолчанию с фиксированной шириной.
|
|
57
|
-
*/ export
|
|
26
|
+
*/ export const StyledSpinner = styled(Spinner).withConfig({
|
|
58
27
|
displayName: "Button__StyledSpinner",
|
|
59
28
|
componentId: "sc-b39b3537-2"
|
|
60
29
|
})([
|
|
61
|
-
|
|
30
|
+
`width:1.375rem;`
|
|
62
31
|
]);
|
|
63
32
|
/**
|
|
64
33
|
* Обёртка для содержимого кнопки.
|
|
65
|
-
*/ export
|
|
34
|
+
*/ export const ButtonContentWrapper = styled.span.withConfig({
|
|
66
35
|
displayName: "Button__ButtonContentWrapper",
|
|
67
36
|
componentId: "sc-b39b3537-3"
|
|
68
37
|
})([
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
],
|
|
72
|
-
var isLoading = param.$isLoading;
|
|
73
|
-
return isLoading && 'opacity: 0;';
|
|
74
|
-
});
|
|
38
|
+
`display:flex;align-items:inherit;justify-content:inherit;width:100%;`,
|
|
39
|
+
``
|
|
40
|
+
], ({ $isLoading: isLoading })=>isLoading && 'opacity: 0;');
|
|
75
41
|
/**
|
|
76
42
|
* A text wrapping element, that used when `text` prop is passed.
|
|
77
43
|
* @private
|
|
78
|
-
*/ export
|
|
44
|
+
*/ export const ButtonText = styled.span.withConfig({
|
|
79
45
|
displayName: "Button__ButtonText",
|
|
80
46
|
componentId: "sc-b39b3537-4"
|
|
81
47
|
})([
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
], applyEllipsis,
|
|
87
|
-
var isContentLeft = param.$isContentLeft;
|
|
88
|
-
return isContentLeft && 'margin-left: 0.375rem;';
|
|
89
|
-
}, function(param) {
|
|
90
|
-
var isContentRight = param.$isContentRight;
|
|
91
|
-
return isContentRight && 'margin-right: 0.375rem;';
|
|
92
|
-
});
|
|
48
|
+
`box-sizing:border-box;`,
|
|
49
|
+
` `,
|
|
50
|
+
` `,
|
|
51
|
+
``
|
|
52
|
+
], applyEllipsis, ({ $isContentLeft: isContentLeft })=>isContentLeft && 'margin-left: 0.375rem;', ({ $isContentRight: isContentRight })=>isContentRight && 'margin-right: 0.375rem;');
|
|
93
53
|
/**
|
|
94
54
|
* Базовая кнопка.
|
|
95
55
|
* @deprecated
|
|
96
|
-
*/ export
|
|
56
|
+
*/ export const Button = /*#__PURE__*/ React.forwardRef(// eslint-disable-next-line prefer-arrow-callback
|
|
97
57
|
function Button(props, ref) {
|
|
98
|
-
return /*#__PURE__*/ React.createElement(ButtonRoot,
|
|
99
|
-
ref: ref
|
|
100
|
-
|
|
58
|
+
return /*#__PURE__*/ React.createElement(ButtonRoot, {
|
|
59
|
+
ref: ref,
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
101
62
|
});
|
|
102
63
|
Button.defaultProps = {
|
|
103
64
|
pin: 'square-square',
|
|
@@ -1,55 +1,3 @@
|
|
|
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 ownKeys(object, enumerableOnly) {
|
|
30
|
-
var keys = Object.keys(object);
|
|
31
|
-
if (Object.getOwnPropertySymbols) {
|
|
32
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
-
if (enumerableOnly) {
|
|
34
|
-
symbols = symbols.filter(function(sym) {
|
|
35
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
keys.push.apply(keys, symbols);
|
|
39
|
-
}
|
|
40
|
-
return keys;
|
|
41
|
-
}
|
|
42
|
-
function _object_spread_props(target, source) {
|
|
43
|
-
source = source != null ? source : {};
|
|
44
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
-
} else {
|
|
47
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return target;
|
|
52
|
-
}
|
|
53
1
|
import { css } from 'styled-components';
|
|
54
2
|
import { addFocus } from '../../mixins';
|
|
55
3
|
import { convertRoundnessMatrix } from '../../utils';
|
|
@@ -57,10 +5,8 @@ import { convertRoundnessMatrix } from '../../utils';
|
|
|
57
5
|
* Создание специализированного миксина со своими размерами и типографикой.
|
|
58
6
|
* @param {Record<string, object>} sizes
|
|
59
7
|
* @param {Record<string, object>} typos
|
|
60
|
-
*/ export
|
|
61
|
-
|
|
62
|
-
var size = param.size, pin = param.pin, outlined = param.outlined, focused = param.focused, isContentLeft = param.$isContentLeft, isContentRight = param.$isContentRight, shiftLeft = param.shiftLeft, shiftRight = param.shiftRight, square = param.square, stretch = param.stretch, theme = param.theme;
|
|
63
|
-
var paddingX = sizes[size].paddingX;
|
|
8
|
+
*/ export const getButtonSizesMixin = (sizes, typos)=>({ size, pin, outlined, focused, $isContentLeft: isContentLeft, $isContentRight: isContentRight, shiftLeft, shiftRight, square, stretch, theme })=>{
|
|
9
|
+
let { paddingX } = sizes[size];
|
|
64
10
|
if (square) {
|
|
65
11
|
paddingX = sizes[size].paddingY;
|
|
66
12
|
} else if (stretch) {
|
|
@@ -69,21 +15,21 @@ import { convertRoundnessMatrix } from '../../utils';
|
|
|
69
15
|
paddingX = sizes[size].paddingContentX;
|
|
70
16
|
}
|
|
71
17
|
return css([
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
], sizes[size].height, sizes[size].paddingY, paddingX, convertRoundnessMatrix(pin, sizes[size].radius, sizes[size].radiusCircle), stretch && 'width: 100%;', square &&
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
18
|
+
`height:`,
|
|
19
|
+
`;padding:`,
|
|
20
|
+
` `,
|
|
21
|
+
`;border-radius:`,
|
|
22
|
+
`;`,
|
|
23
|
+
` `,
|
|
24
|
+
` `,
|
|
25
|
+
` `,
|
|
26
|
+
` `,
|
|
27
|
+
` `,
|
|
28
|
+
``
|
|
29
|
+
], sizes[size].height, sizes[size].paddingY, paddingX, convertRoundnessMatrix(pin, sizes[size].radius, sizes[size].radiusCircle), stretch && 'width: 100%;', square && ` width: ${sizes[size].height};`, shiftLeft && `margin-left: calc(-1 * ${paddingX});`, shiftRight && `margin-right: calc(-1 * ${paddingX});`, typos[size], addFocus({
|
|
30
|
+
...theme,
|
|
31
|
+
focused,
|
|
32
|
+
outlined,
|
|
33
|
+
outlineRadius: convertRoundnessMatrix(pin, `calc(${sizes[size].radius} + var(--plasma-outline-size))`, `calc(${sizes[size].radiusCircle} + var(--plasma-outline-size))`)
|
|
34
|
+
}));
|
|
88
35
|
};
|
|
89
|
-
};
|
|
@@ -2,7 +2,7 @@ import { views } from '../../mixins';
|
|
|
2
2
|
import { button1, button2 } from '../../tokens';
|
|
3
3
|
/**
|
|
4
4
|
* Цветовые виды.
|
|
5
|
-
*/ export
|
|
5
|
+
*/ export const buttonViews = {
|
|
6
6
|
primary: views.primary,
|
|
7
7
|
secondary: views.secondary,
|
|
8
8
|
success: views.success,
|
|
@@ -14,7 +14,7 @@ import { button1, button2 } from '../../tokens';
|
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* Размеры в rem в соответствии с дизайном.
|
|
17
|
-
*/ export
|
|
17
|
+
*/ export const buttonSizes = {
|
|
18
18
|
l: {
|
|
19
19
|
height: 'var(--plasma-button-l-height)',
|
|
20
20
|
paddingY: 'var(--plasma-button-l-padding-y)',
|
|
@@ -45,7 +45,7 @@ import { button1, button2 } from '../../tokens';
|
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
47
47
|
* Размеры типографики кнопки.
|
|
48
|
-
*/ export
|
|
48
|
+
*/ export const buttonTypography = {
|
|
49
49
|
l: button1,
|
|
50
50
|
m: button1,
|
|
51
51
|
s: button2
|
|
@@ -1,159 +1,28 @@
|
|
|
1
|
-
function _array_like_to_array(arr, len) {
|
|
2
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
-
return arr2;
|
|
5
|
-
}
|
|
6
|
-
function _array_with_holes(arr) {
|
|
7
|
-
if (Array.isArray(arr)) return arr;
|
|
8
|
-
}
|
|
9
|
-
function _define_property(obj, key, value) {
|
|
10
|
-
if (key in obj) {
|
|
11
|
-
Object.defineProperty(obj, key, {
|
|
12
|
-
value: value,
|
|
13
|
-
enumerable: true,
|
|
14
|
-
configurable: true,
|
|
15
|
-
writable: true
|
|
16
|
-
});
|
|
17
|
-
} else {
|
|
18
|
-
obj[key] = value;
|
|
19
|
-
}
|
|
20
|
-
return obj;
|
|
21
|
-
}
|
|
22
|
-
function _iterable_to_array(iter) {
|
|
23
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
24
|
-
}
|
|
25
|
-
function _iterable_to_array_limit(arr, i) {
|
|
26
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
27
|
-
if (_i == null) return;
|
|
28
|
-
var _arr = [];
|
|
29
|
-
var _n = true;
|
|
30
|
-
var _d = false;
|
|
31
|
-
var _s, _e;
|
|
32
|
-
try {
|
|
33
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
34
|
-
_arr.push(_s.value);
|
|
35
|
-
if (i && _arr.length === i) break;
|
|
36
|
-
}
|
|
37
|
-
} catch (err) {
|
|
38
|
-
_d = true;
|
|
39
|
-
_e = err;
|
|
40
|
-
} finally{
|
|
41
|
-
try {
|
|
42
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
43
|
-
} finally{
|
|
44
|
-
if (_d) throw _e;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return _arr;
|
|
48
|
-
}
|
|
49
|
-
function _non_iterable_rest() {
|
|
50
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
51
|
-
}
|
|
52
|
-
function _object_spread(target) {
|
|
53
|
-
for(var i = 1; i < arguments.length; i++){
|
|
54
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
55
|
-
var ownKeys = Object.keys(source);
|
|
56
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
57
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
58
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
59
|
-
}));
|
|
60
|
-
}
|
|
61
|
-
ownKeys.forEach(function(key) {
|
|
62
|
-
_define_property(target, key, source[key]);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
return target;
|
|
66
|
-
}
|
|
67
|
-
function _object_without_properties(source, excluded) {
|
|
68
|
-
if (source == null) return {};
|
|
69
|
-
var target = {}, sourceKeys, key, i;
|
|
70
|
-
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
71
|
-
sourceKeys = Reflect.ownKeys(source);
|
|
72
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
73
|
-
key = sourceKeys[i];
|
|
74
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
75
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
76
|
-
target[key] = source[key];
|
|
77
|
-
}
|
|
78
|
-
return target;
|
|
79
|
-
}
|
|
80
|
-
target = _object_without_properties_loose(source, excluded);
|
|
81
|
-
if (Object.getOwnPropertySymbols) {
|
|
82
|
-
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
83
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
84
|
-
key = sourceKeys[i];
|
|
85
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
86
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
87
|
-
target[key] = source[key];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return target;
|
|
91
|
-
}
|
|
92
|
-
function _object_without_properties_loose(source, excluded) {
|
|
93
|
-
if (source == null) return {};
|
|
94
|
-
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
95
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
96
|
-
key = sourceKeys[i];
|
|
97
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
98
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
99
|
-
target[key] = source[key];
|
|
100
|
-
}
|
|
101
|
-
return target;
|
|
102
|
-
}
|
|
103
|
-
function _sliced_to_array(arr, i) {
|
|
104
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
105
|
-
}
|
|
106
|
-
function _to_array(arr) {
|
|
107
|
-
return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest();
|
|
108
|
-
}
|
|
109
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
110
|
-
if (!o) return;
|
|
111
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
112
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
113
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
114
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
115
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
116
|
-
}
|
|
117
1
|
import React, { forwardRef } from 'react';
|
|
118
2
|
import { ButtonContentWrapper, ButtonLoader, ButtonRoot, ButtonText, StyledSpinner } from './Button';
|
|
119
3
|
/**
|
|
120
4
|
* Функция для создания компонента Button,
|
|
121
5
|
* что дает возможность кастомизировать вид, пропсы и т.п.,
|
|
122
6
|
* при этом сохраняя в базе общий интерфейс.
|
|
123
|
-
*/ export function createButton() {
|
|
124
|
-
var Root = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ButtonRoot;
|
|
7
|
+
*/ export function createButton(Root = ButtonRoot) {
|
|
125
8
|
// eslint-disable-next-line prefer-arrow-callback
|
|
126
|
-
return /*#__PURE__*/ forwardRef(function Button(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}) : _ref_loader, disabled = _ref2.disabled, isLoading = _ref2.isLoading, _ref_type = _ref2.type, type = _ref_type === void 0 ? 'button' : _ref_type, rest = _object_without_properties(_ref2, [
|
|
135
|
-
"children",
|
|
136
|
-
"text",
|
|
137
|
-
"contentLeft",
|
|
138
|
-
"contentRight",
|
|
139
|
-
"square",
|
|
140
|
-
"deviceScale",
|
|
141
|
-
"loader",
|
|
142
|
-
"disabled",
|
|
143
|
-
"isLoading",
|
|
144
|
-
"type"
|
|
145
|
-
]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
|
|
146
|
-
var isContentLeft = Boolean(contentLeft);
|
|
147
|
-
var isContentRight = Boolean(contentRight);
|
|
148
|
-
return /*#__PURE__*/ React.createElement(Root, _object_spread({
|
|
9
|
+
return /*#__PURE__*/ forwardRef(function Button({ children, text, contentLeft, contentRight, square, deviceScale, loader = /*#__PURE__*/ React.createElement(StyledSpinner, {
|
|
10
|
+
color: "currentColor",
|
|
11
|
+
size: 56,
|
|
12
|
+
deviceScale: deviceScale
|
|
13
|
+
}), disabled, isLoading, type = 'button', ...rest }, ref) {
|
|
14
|
+
const isContentLeft = Boolean(contentLeft);
|
|
15
|
+
const isContentRight = Boolean(contentRight);
|
|
16
|
+
return /*#__PURE__*/ React.createElement(Root, {
|
|
149
17
|
ref: ref,
|
|
150
18
|
type: type,
|
|
151
19
|
$isContentLeft: isContentLeft,
|
|
152
20
|
$isContentRight: isContentRight,
|
|
153
21
|
$isLoading: isLoading,
|
|
154
22
|
disabled: isLoading || disabled,
|
|
155
|
-
square: square !== undefined ? square : !text && !children
|
|
156
|
-
|
|
23
|
+
square: square !== undefined ? square : !text && !children,
|
|
24
|
+
...rest
|
|
25
|
+
}, isLoading && /*#__PURE__*/ React.createElement(ButtonLoader, null, loader), /*#__PURE__*/ React.createElement(ButtonContentWrapper, {
|
|
157
26
|
$isLoading: isLoading
|
|
158
27
|
}, children, !children && contentLeft, !children && text && /*#__PURE__*/ React.createElement(ButtonText, {
|
|
159
28
|
$isContentLeft: isContentLeft,
|
|
@@ -1,119 +1,3 @@
|
|
|
1
|
-
function _array_like_to_array(arr, len) {
|
|
2
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
-
return arr2;
|
|
5
|
-
}
|
|
6
|
-
function _array_with_holes(arr) {
|
|
7
|
-
if (Array.isArray(arr)) return arr;
|
|
8
|
-
}
|
|
9
|
-
function _define_property(obj, key, value) {
|
|
10
|
-
if (key in obj) {
|
|
11
|
-
Object.defineProperty(obj, key, {
|
|
12
|
-
value: value,
|
|
13
|
-
enumerable: true,
|
|
14
|
-
configurable: true,
|
|
15
|
-
writable: true
|
|
16
|
-
});
|
|
17
|
-
} else {
|
|
18
|
-
obj[key] = value;
|
|
19
|
-
}
|
|
20
|
-
return obj;
|
|
21
|
-
}
|
|
22
|
-
function _iterable_to_array(iter) {
|
|
23
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
24
|
-
}
|
|
25
|
-
function _iterable_to_array_limit(arr, i) {
|
|
26
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
27
|
-
if (_i == null) return;
|
|
28
|
-
var _arr = [];
|
|
29
|
-
var _n = true;
|
|
30
|
-
var _d = false;
|
|
31
|
-
var _s, _e;
|
|
32
|
-
try {
|
|
33
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
34
|
-
_arr.push(_s.value);
|
|
35
|
-
if (i && _arr.length === i) break;
|
|
36
|
-
}
|
|
37
|
-
} catch (err) {
|
|
38
|
-
_d = true;
|
|
39
|
-
_e = err;
|
|
40
|
-
} finally{
|
|
41
|
-
try {
|
|
42
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
43
|
-
} finally{
|
|
44
|
-
if (_d) throw _e;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return _arr;
|
|
48
|
-
}
|
|
49
|
-
function _non_iterable_rest() {
|
|
50
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
51
|
-
}
|
|
52
|
-
function _object_spread(target) {
|
|
53
|
-
for(var i = 1; i < arguments.length; i++){
|
|
54
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
55
|
-
var ownKeys = Object.keys(source);
|
|
56
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
57
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
58
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
59
|
-
}));
|
|
60
|
-
}
|
|
61
|
-
ownKeys.forEach(function(key) {
|
|
62
|
-
_define_property(target, key, source[key]);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
return target;
|
|
66
|
-
}
|
|
67
|
-
function _object_without_properties(source, excluded) {
|
|
68
|
-
if (source == null) return {};
|
|
69
|
-
var target = {}, sourceKeys, key, i;
|
|
70
|
-
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
71
|
-
sourceKeys = Reflect.ownKeys(source);
|
|
72
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
73
|
-
key = sourceKeys[i];
|
|
74
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
75
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
76
|
-
target[key] = source[key];
|
|
77
|
-
}
|
|
78
|
-
return target;
|
|
79
|
-
}
|
|
80
|
-
target = _object_without_properties_loose(source, excluded);
|
|
81
|
-
if (Object.getOwnPropertySymbols) {
|
|
82
|
-
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
83
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
84
|
-
key = sourceKeys[i];
|
|
85
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
86
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
87
|
-
target[key] = source[key];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return target;
|
|
91
|
-
}
|
|
92
|
-
function _object_without_properties_loose(source, excluded) {
|
|
93
|
-
if (source == null) return {};
|
|
94
|
-
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
95
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
96
|
-
key = sourceKeys[i];
|
|
97
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
98
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
99
|
-
target[key] = source[key];
|
|
100
|
-
}
|
|
101
|
-
return target;
|
|
102
|
-
}
|
|
103
|
-
function _sliced_to_array(arr, i) {
|
|
104
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
105
|
-
}
|
|
106
|
-
function _to_array(arr) {
|
|
107
|
-
return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest();
|
|
108
|
-
}
|
|
109
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
110
|
-
if (!o) return;
|
|
111
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
112
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
113
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
114
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
115
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
116
|
-
}
|
|
117
1
|
import React from 'react';
|
|
118
2
|
import styled, { css } from 'styled-components';
|
|
119
3
|
import { surfaceCard } from '../../tokens';
|
|
@@ -121,55 +5,43 @@ import { addFocus, applyDisabled, applyRoundness, radiuses, syntheticFocus } fro
|
|
|
121
5
|
import { Body1 } from '../Typography';
|
|
122
6
|
// В этих константах задаем размеры в em, чтобы не зависеть напрямую от пикселей
|
|
123
7
|
// В то же время в числителях - значения в пикселях, взятые из макета
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
export
|
|
8
|
+
const fontSize = 16;
|
|
9
|
+
const shadowOffset = 8 / fontSize;
|
|
10
|
+
const shadowSize = 24 / fontSize;
|
|
11
|
+
const outlineSize = 2 / fontSize;
|
|
12
|
+
const DEFAULT_ROUNDNESS = 20;
|
|
13
|
+
export const StyledCard = styled(Body1).withConfig({
|
|
130
14
|
displayName: "Card__StyledCard",
|
|
131
15
|
componentId: "sc-34a54ef8-0"
|
|
132
16
|
})([
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
], applyDisabled, applyRoundness, surfaceCard, shadowOffset, shadowSize,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
var focused = param.focused, outlined = param.outlined, roundness = param.roundness, scaleOnFocus = param.scaleOnFocus, theme = param.theme;
|
|
146
|
-
return css([
|
|
147
|
-
"",
|
|
148
|
-
" ",
|
|
149
|
-
" &:focus{outline:none;}"
|
|
17
|
+
``,
|
|
18
|
+
` `,
|
|
19
|
+
`;position:relative;display:flex;box-sizing:border-box;flex-direction:column;flex-shrink:0;background:`,
|
|
20
|
+
`;box-shadow:0 `,
|
|
21
|
+
`em `,
|
|
22
|
+
`em rgba(0,0,0,0.1);transition:`,
|
|
23
|
+
`;`,
|
|
24
|
+
``
|
|
25
|
+
], applyDisabled, applyRoundness, surfaceCard, shadowOffset, shadowSize, ({ theme })=>theme.lowPerformance ? 'unset' : 'transform 0.4s ease-in-out', ({ focused, outlined, roundness, scaleOnFocus, theme })=>css([
|
|
26
|
+
``,
|
|
27
|
+
` `,
|
|
28
|
+
` &:focus{outline:none;}`
|
|
150
29
|
], addFocus({
|
|
151
30
|
lowPerformance: theme.lowPerformance,
|
|
152
|
-
focused
|
|
153
|
-
outlined
|
|
154
|
-
outlineSize:
|
|
155
|
-
outlineRadius:
|
|
31
|
+
focused,
|
|
32
|
+
outlined,
|
|
33
|
+
outlineSize: `${outlineSize}rem`,
|
|
34
|
+
outlineRadius: `${radiuses[roundness] + outlineSize}rem`
|
|
156
35
|
}), scaleOnFocus && syntheticFocus(css([
|
|
157
|
-
|
|
158
|
-
]), focused));
|
|
159
|
-
});
|
|
36
|
+
`&{transform:scale(1.04);}`
|
|
37
|
+
]), focused)));
|
|
160
38
|
/**
|
|
161
39
|
* Контейнер со скругленными углами с возможностью фокусировки на нем.
|
|
162
40
|
*/ // eslint-disable-next-line prefer-arrow-callback
|
|
163
|
-
export
|
|
164
|
-
|
|
165
|
-
_0,
|
|
166
|
-
_1
|
|
167
|
-
], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), _ref_roundness = _ref2.roundness, roundness = _ref_roundness === void 0 ? DEFAULT_ROUNDNESS : _ref_roundness, children = _ref2.children, rest = _object_without_properties(_ref2, [
|
|
168
|
-
"roundness",
|
|
169
|
-
"children"
|
|
170
|
-
]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
|
|
171
|
-
return /*#__PURE__*/ React.createElement(StyledCard, _object_spread({
|
|
41
|
+
export const Card = /*#__PURE__*/ React.forwardRef(function Card({ roundness = DEFAULT_ROUNDNESS, children, ...rest }, ref) {
|
|
42
|
+
return /*#__PURE__*/ React.createElement(StyledCard, {
|
|
172
43
|
ref: ref,
|
|
173
|
-
roundness: roundness
|
|
174
|
-
|
|
44
|
+
roundness: roundness,
|
|
45
|
+
...rest
|
|
46
|
+
}, children);
|
|
175
47
|
});
|
|
@@ -3,9 +3,9 @@ import styled from 'styled-components';
|
|
|
3
3
|
/**
|
|
4
4
|
* Помещается в ``<Card />`` и скругляет рамки содержимого внутри него.
|
|
5
5
|
* Обязательно к использованию для корректного отображения скругленных углов контента.
|
|
6
|
-
*/ export
|
|
6
|
+
*/ export const CardBody = styled.div.withConfig({
|
|
7
7
|
displayName: "CardBody",
|
|
8
8
|
componentId: "sc-24f3a93d-0"
|
|
9
9
|
})([
|
|
10
|
-
|
|
10
|
+
`position:relative;display:flex;overflow:hidden;flex:1;flex-direction:column;box-sizing:content-box;width:100%;border-radius:inherit;`
|
|
11
11
|
]);
|