@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
|
@@ -4,83 +4,68 @@ import { secondary, tertiary, body1, caption } from '../../tokens';
|
|
|
4
4
|
import { fieldStatuses } from './Field.statuses';
|
|
5
5
|
/**
|
|
6
6
|
* Common dynamic placeholder.
|
|
7
|
-
*/ export
|
|
7
|
+
*/ export const FieldPlaceholder = styled.label.withConfig({
|
|
8
8
|
displayName: "Field__FieldPlaceholder",
|
|
9
9
|
componentId: "sc-cb2977c5-0"
|
|
10
10
|
})([
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
], tertiary,
|
|
16
|
-
var theme = param.theme;
|
|
17
|
-
return theme.lowPerformance ? 'unset' : 'all 0.1s ease-in';
|
|
18
|
-
}, applyEllipsis);
|
|
11
|
+
`position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;color:`,
|
|
12
|
+
`;pointer-events:none;transition:`,
|
|
13
|
+
`;transform-origin:top left;`,
|
|
14
|
+
``
|
|
15
|
+
], tertiary, ({ theme })=>theme.lowPerformance ? 'unset' : 'all 0.1s ease-in', applyEllipsis);
|
|
19
16
|
/**
|
|
20
17
|
* Content wrapper for left and right slots of the field.
|
|
21
|
-
*/ export
|
|
18
|
+
*/ export const FieldContent = styled.div.withConfig({
|
|
22
19
|
displayName: "Field__FieldContent",
|
|
23
20
|
componentId: "sc-cb2977c5-1"
|
|
24
21
|
})([
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
],
|
|
28
|
-
var pos = param.pos;
|
|
29
|
-
return pos === 'left' ? 'left: 1rem' : 'right: 1rem';
|
|
30
|
-
});
|
|
22
|
+
`position:absolute;top:0;`,
|
|
23
|
+
`;bottom:0;display:flex;align-items:center;height:3rem;`
|
|
24
|
+
], ({ pos })=>pos === 'left' ? 'left: 1rem' : 'right: 1rem');
|
|
31
25
|
/**
|
|
32
26
|
* An inline block to place a helper text under the form item.
|
|
33
|
-
*/ export
|
|
27
|
+
*/ export const FieldHelper = styled.span.withConfig({
|
|
34
28
|
displayName: "Field__FieldHelper",
|
|
35
29
|
componentId: "sc-cb2977c5-2"
|
|
36
30
|
})([
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
``,
|
|
32
|
+
`;display:block;margin-top:0.25rem;`,
|
|
33
|
+
``
|
|
40
34
|
], caption, applyEllipsis);
|
|
41
35
|
/**
|
|
42
36
|
* Common container for singular form item.
|
|
43
|
-
*/ export
|
|
37
|
+
*/ export const FieldRoot = styled.div.withConfig({
|
|
44
38
|
displayName: "Field__FieldRoot",
|
|
45
39
|
componentId: "sc-cb2977c5-3"
|
|
46
40
|
})([
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
], body1, secondary, applyDisabled,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"{transform:scale(0.75);top:0.375rem;}",
|
|
60
|
-
"{height:3.5rem;}"
|
|
41
|
+
``,
|
|
42
|
+
`;position:relative;display:block;box-sizing:border-box;color:`,
|
|
43
|
+
`;`,
|
|
44
|
+
` `,
|
|
45
|
+
` `,
|
|
46
|
+
` `,
|
|
47
|
+
``
|
|
48
|
+
], body1, secondary, applyDisabled, ({ $size = 'm' })=>$size === 'l' ? css([
|
|
49
|
+
``,
|
|
50
|
+
`{top:1.125rem;left:1rem;right:1rem;}input:not(:placeholder-shown) ~ `,
|
|
51
|
+
`{transform:scale(0.75);top:0.375rem;}`,
|
|
52
|
+
`{height:3.5rem;}`
|
|
61
53
|
], FieldPlaceholder, FieldPlaceholder, FieldContent) : css([
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
], FieldContent)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}, function(param) {
|
|
76
|
-
var $isHelper = param.$isHelper, status = param.status;
|
|
77
|
-
return status && ($isHelper ? css([
|
|
78
|
-
"",
|
|
79
|
-
"{color:",
|
|
80
|
-
";}"
|
|
54
|
+
``,
|
|
55
|
+
`{height:3rem;}`
|
|
56
|
+
], FieldContent), ({ $isContentLeft, $isContentRight })=>css([
|
|
57
|
+
`input,textarea{`,
|
|
58
|
+
` `,
|
|
59
|
+
`}`,
|
|
60
|
+
`{`,
|
|
61
|
+
` `,
|
|
62
|
+
`}`
|
|
63
|
+
], $isContentLeft && 'padding-left: 3.125rem;', $isContentRight && 'padding-right: 3.125rem;', FieldPlaceholder, $isContentLeft && 'left: 3.125rem;', $isContentRight && 'right: 3.125rem;'), ({ $isHelper, status })=>status && ($isHelper ? css([
|
|
64
|
+
``,
|
|
65
|
+
`{color:`,
|
|
66
|
+
`;}`
|
|
81
67
|
], FieldHelper, fieldStatuses[status]) : css([
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
], FieldPlaceholder, fieldStatuses[status]));
|
|
86
|
-
});
|
|
68
|
+
``,
|
|
69
|
+
`{color:`,
|
|
70
|
+
`;}`
|
|
71
|
+
], FieldPlaceholder, fieldStatuses[status])));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { success, warning, critical, buttonSuccess, buttonWarning, buttonCritical } from '../../tokens';
|
|
2
|
-
export
|
|
3
|
-
success
|
|
4
|
-
warning
|
|
2
|
+
export const fieldStatuses = {
|
|
3
|
+
success,
|
|
4
|
+
warning,
|
|
5
5
|
error: critical
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export const fieldBackgroundStatuses = {
|
|
8
8
|
success: buttonSuccess,
|
|
9
9
|
warning: buttonWarning,
|
|
10
10
|
error: buttonCritical
|
|
@@ -1,71 +1,7 @@
|
|
|
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 { toCssSize } from '../../utils';
|
|
68
|
-
|
|
4
|
+
const ratios = {
|
|
69
5
|
'1 / 1': '100',
|
|
70
6
|
'1/1': '100',
|
|
71
7
|
'3 / 4': '133.3333',
|
|
@@ -81,65 +17,48 @@ var ratios = {
|
|
|
81
17
|
'2 / 1': '50',
|
|
82
18
|
'2/1': '50'
|
|
83
19
|
};
|
|
84
|
-
|
|
20
|
+
const StyledRoot = styled.div.withConfig({
|
|
85
21
|
displayName: "Image__StyledRoot",
|
|
86
22
|
componentId: "sc-c0cf331c-0"
|
|
87
23
|
})([
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
],
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"",
|
|
101
|
-
" ",
|
|
102
|
-
""
|
|
103
|
-
], $width && "width: ".concat(toCssSize($width), ";"), $height && "height: ".concat(toCssSize($height), ";"));
|
|
104
|
-
});
|
|
105
|
-
var StyledImg = styled.img.withConfig({
|
|
24
|
+
`position:relative;display:block;box-sizing:border-box;overflow:hidden;width:100%;height:inherit;border-radius:inherit;`,
|
|
25
|
+
` `,
|
|
26
|
+
``
|
|
27
|
+
], ({ $ratio, $customRatio })=>($ratio || $customRatio) && css([
|
|
28
|
+
`height:0;padding-bottom:`,
|
|
29
|
+
`%;`
|
|
30
|
+
], $ratio ? ratios[$ratio] : $customRatio), ({ $width, $height })=>css([
|
|
31
|
+
``,
|
|
32
|
+
` `,
|
|
33
|
+
``
|
|
34
|
+
], $width && `width: ${toCssSize($width)};`, $height && `height: ${toCssSize($height)};`));
|
|
35
|
+
const StyledImg = styled.img.withConfig({
|
|
106
36
|
displayName: "Image__StyledImg",
|
|
107
37
|
componentId: "sc-c0cf331c-1"
|
|
108
38
|
})([
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
],
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
]);
|
|
116
|
-
});
|
|
117
|
-
var StyledDivImg = styled.div.withConfig({
|
|
39
|
+
`width:100%;`,
|
|
40
|
+
`;`
|
|
41
|
+
], ({ src, ratio })=>src && ratio && css([
|
|
42
|
+
`height:100%;object-fit:cover;position:absolute;`
|
|
43
|
+
]));
|
|
44
|
+
const StyledDivImg = styled.div.withConfig({
|
|
118
45
|
displayName: "Image__StyledDivImg",
|
|
119
46
|
componentId: "sc-c0cf331c-2"
|
|
120
47
|
})([
|
|
121
|
-
|
|
48
|
+
`width:100%;height:100%;position:absolute;background-position:center;background-size:cover;`
|
|
122
49
|
]);
|
|
123
50
|
/**
|
|
124
51
|
* Компонент для отображения картинок.
|
|
125
|
-
*/
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
"sizes",
|
|
130
|
-
"base",
|
|
131
|
-
"alt",
|
|
132
|
-
"width",
|
|
133
|
-
"height"
|
|
134
|
-
]);
|
|
135
|
-
var ratio = 'ratio' in props ? props.ratio : undefined;
|
|
136
|
-
var customRatio = 'customRatio' in props ? props.customRatio : undefined;
|
|
137
|
-
return /*#__PURE__*/ React.createElement(StyledRoot, _object_spread({
|
|
52
|
+
*/ const ImageBase = ({ src, srcSet, sizes, base = 'img', alt, width, height, ...props })=>{
|
|
53
|
+
const ratio = 'ratio' in props ? props.ratio : undefined;
|
|
54
|
+
const customRatio = 'customRatio' in props ? props.customRatio : undefined;
|
|
55
|
+
return /*#__PURE__*/ React.createElement(StyledRoot, {
|
|
138
56
|
$ratio: ratio,
|
|
139
57
|
$customRatio: customRatio,
|
|
140
58
|
$width: width,
|
|
141
|
-
$height: height
|
|
142
|
-
|
|
59
|
+
$height: height,
|
|
60
|
+
...props
|
|
61
|
+
}, base === 'img' && /*#__PURE__*/ React.createElement(StyledImg, {
|
|
143
62
|
src: src,
|
|
144
63
|
srcSet: srcSet,
|
|
145
64
|
sizes: sizes,
|
|
@@ -147,7 +66,7 @@ var StyledDivImg = styled.div.withConfig({
|
|
|
147
66
|
ratio: ratio
|
|
148
67
|
}), base === 'div' && /*#__PURE__*/ React.createElement(StyledDivImg, {
|
|
149
68
|
style: {
|
|
150
|
-
backgroundImage:
|
|
69
|
+
backgroundImage: `url(${src})`
|
|
151
70
|
},
|
|
152
71
|
role: "img",
|
|
153
72
|
"aria-label": alt
|
|
@@ -155,9 +74,9 @@ var StyledDivImg = styled.div.withConfig({
|
|
|
155
74
|
};
|
|
156
75
|
/**
|
|
157
76
|
* Компонент для отображения картинок.
|
|
158
|
-
*/ export
|
|
77
|
+
*/ export const Image = styled(ImageBase).withConfig({
|
|
159
78
|
displayName: "Image",
|
|
160
79
|
componentId: "sc-c0cf331c-3"
|
|
161
80
|
})([
|
|
162
|
-
|
|
81
|
+
``
|
|
163
82
|
]);
|
|
@@ -3,11 +3,11 @@ import { applyEllipsis } from '../../mixins';
|
|
|
3
3
|
import { applyInputStyles } from './Input.mixins';
|
|
4
4
|
/**
|
|
5
5
|
* Base input.
|
|
6
|
-
*/ export
|
|
6
|
+
*/ export const Input = styled.input.withConfig({
|
|
7
7
|
displayName: "Input",
|
|
8
8
|
componentId: "sc-869dfd24-0"
|
|
9
9
|
})([
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
``,
|
|
11
|
+
` `,
|
|
12
|
+
``
|
|
13
13
|
], applyInputStyles, applyEllipsis);
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { css } from 'styled-components';
|
|
2
2
|
import { accent } from '../../tokens';
|
|
3
3
|
import { fieldStatuses } from '../Field';
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
";font:inherit;line-height:inherit;letter-spacing:inherit;&:focus{outline:none;}&:disabled{cursor:inherit;}&[readonly]{cursor:default;}",
|
|
9
|
-
""
|
|
4
|
+
export const applyInputStyles = ({ status, $size = 'm' })=>css([
|
|
5
|
+
`box-sizing:border-box;width:100%;border:0 none;caret-color:`,
|
|
6
|
+
`;font:inherit;line-height:inherit;letter-spacing:inherit;&:focus{outline:none;}&:disabled{cursor:inherit;}&[readonly]{cursor:default;}`,
|
|
7
|
+
``
|
|
10
8
|
], status ? fieldStatuses[status] : accent, $size === 'l' ? css([
|
|
11
|
-
|
|
9
|
+
`height:3.5rem;padding:1.125rem 1rem;&:not(:placeholder-shown){padding-top:1.5rem;padding-bottom:0.375rem;}&::placeholder{color:transparent;}`
|
|
12
10
|
]) : css([
|
|
13
|
-
|
|
11
|
+
`height:3rem;padding:0.875rem 1rem;`
|
|
14
12
|
]));
|
|
15
|
-
};
|
|
@@ -1,106 +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 { createGlobalStyle } from 'styled-components';
|
|
67
3
|
import { PopupBase } from '../PopupBase/PopupBase';
|
|
68
4
|
import { useFocusTrap, useUniqId } from '../../hooks';
|
|
69
5
|
import { ModalOverlay } from './ModalOverlay';
|
|
70
6
|
import { useModal } from './hooks';
|
|
71
|
-
|
|
72
|
-
|
|
7
|
+
const NoScroll = createGlobalStyle([
|
|
8
|
+
`body{overflow-y:hidden;}`
|
|
73
9
|
]);
|
|
74
10
|
/**
|
|
75
11
|
* ModalBase.
|
|
76
12
|
* Управляет показом/скрытием, подложкой и анимацией визуальной части модального окна.
|
|
77
|
-
*/ export
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"onOverlayClick",
|
|
83
|
-
"onEscKeyDown",
|
|
84
|
-
"closeOnEsc",
|
|
85
|
-
"closeOnOverlayClick",
|
|
86
|
-
"withBlur",
|
|
87
|
-
"initialFocusRef",
|
|
88
|
-
"focusAfterRef",
|
|
89
|
-
"zIndex",
|
|
90
|
-
"popupInfo",
|
|
91
|
-
"children"
|
|
92
|
-
]);
|
|
93
|
-
var trapRef = useFocusTrap(true, initialFocusRef, focusAfterRef);
|
|
94
|
-
var uniqId = useUniqId();
|
|
95
|
-
var innerId = id || uniqId;
|
|
96
|
-
var modalInfo = useModal({
|
|
13
|
+
*/ export const ModalBase = ({ id, withAnimation, onClose, onOverlayClick, onEscKeyDown, closeOnEsc = true, closeOnOverlayClick = true, withBlur, initialFocusRef, focusAfterRef, zIndex, popupInfo, children, ...rest })=>{
|
|
14
|
+
const trapRef = useFocusTrap(true, initialFocusRef, focusAfterRef);
|
|
15
|
+
const uniqId = useUniqId();
|
|
16
|
+
const innerId = id || uniqId;
|
|
17
|
+
const { modalInfo } = useModal({
|
|
97
18
|
id: innerId,
|
|
98
|
-
closeOnEsc
|
|
99
|
-
onEscKeyDown
|
|
100
|
-
onClose
|
|
101
|
-
popupInfo
|
|
102
|
-
})
|
|
103
|
-
return /*#__PURE__*/ React.createElement(PopupBase,
|
|
19
|
+
closeOnEsc,
|
|
20
|
+
onEscKeyDown,
|
|
21
|
+
onClose,
|
|
22
|
+
popupInfo
|
|
23
|
+
});
|
|
24
|
+
return /*#__PURE__*/ React.createElement(PopupBase, {
|
|
104
25
|
id: id,
|
|
105
26
|
ref: trapRef,
|
|
106
27
|
popupInfo: modalInfo,
|
|
@@ -113,6 +34,7 @@ var NoScroll = createGlobalStyle([
|
|
|
113
34
|
onClose: onClose,
|
|
114
35
|
zIndex: zIndex,
|
|
115
36
|
closeOnOverlayClick: closeOnOverlayClick
|
|
116
|
-
})
|
|
117
|
-
|
|
37
|
+
}),
|
|
38
|
+
...rest
|
|
39
|
+
}, /*#__PURE__*/ React.createElement(NoScroll, null), children);
|
|
118
40
|
};
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Взаимодействие с модальными оконами.
|
|
3
|
-
*/
|
|
4
|
-
return items.filter(
|
|
5
|
-
var _item_info;
|
|
6
|
-
return item === null || item === void 0 ? void 0 : (_item_info = item.info) === null || _item_info === void 0 ? void 0 : _item_info.isModal;
|
|
7
|
-
});
|
|
3
|
+
*/ const getModals = (items)=>{
|
|
4
|
+
return items.filter((item)=>item?.info?.isModal);
|
|
8
5
|
};
|
|
9
|
-
export
|
|
10
|
-
|
|
6
|
+
export const getIdLastModal = (items)=>{
|
|
7
|
+
const modals = getModals(items);
|
|
11
8
|
if (!modals.length) {
|
|
12
9
|
return;
|
|
13
10
|
}
|
|
14
11
|
return modals[modals.length - 1].id;
|
|
15
12
|
};
|
|
16
|
-
export
|
|
17
|
-
|
|
13
|
+
export const getIdFirstModal = (items)=>{
|
|
14
|
+
const modals = getModals(items);
|
|
18
15
|
if (!modals.length) {
|
|
19
16
|
return;
|
|
20
17
|
}
|