@salutejs/plasma-core 1.226.0-next-platform-ai.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
|
@@ -8,29 +8,8 @@ Object.defineProperty(exports, "createButton", {
|
|
|
8
8
|
return createButton;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function _array_like_to_array(arr, len) {
|
|
14
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
15
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
16
|
-
return arr2;
|
|
17
|
-
}
|
|
18
|
-
function _array_with_holes(arr) {
|
|
19
|
-
if (Array.isArray(arr)) return arr;
|
|
20
|
-
}
|
|
21
|
-
function _define_property(obj, key, value) {
|
|
22
|
-
if (key in obj) {
|
|
23
|
-
Object.defineProperty(obj, key, {
|
|
24
|
-
value: value,
|
|
25
|
-
enumerable: true,
|
|
26
|
-
configurable: true,
|
|
27
|
-
writable: true
|
|
28
|
-
});
|
|
29
|
-
} else {
|
|
30
|
-
obj[key] = value;
|
|
31
|
-
}
|
|
32
|
-
return obj;
|
|
33
|
-
}
|
|
11
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
12
|
+
const _Button = require("./Button");
|
|
34
13
|
function _getRequireWildcardCache(nodeInterop) {
|
|
35
14
|
if (typeof WeakMap !== "function") return null;
|
|
36
15
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -72,135 +51,25 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
72
51
|
}
|
|
73
52
|
return newObj;
|
|
74
53
|
}
|
|
75
|
-
function
|
|
76
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
77
|
-
}
|
|
78
|
-
function _iterable_to_array_limit(arr, i) {
|
|
79
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
80
|
-
if (_i == null) return;
|
|
81
|
-
var _arr = [];
|
|
82
|
-
var _n = true;
|
|
83
|
-
var _d = false;
|
|
84
|
-
var _s, _e;
|
|
85
|
-
try {
|
|
86
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
87
|
-
_arr.push(_s.value);
|
|
88
|
-
if (i && _arr.length === i) break;
|
|
89
|
-
}
|
|
90
|
-
} catch (err) {
|
|
91
|
-
_d = true;
|
|
92
|
-
_e = err;
|
|
93
|
-
} finally{
|
|
94
|
-
try {
|
|
95
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
96
|
-
} finally{
|
|
97
|
-
if (_d) throw _e;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return _arr;
|
|
101
|
-
}
|
|
102
|
-
function _non_iterable_rest() {
|
|
103
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
104
|
-
}
|
|
105
|
-
function _object_spread(target) {
|
|
106
|
-
for(var i = 1; i < arguments.length; i++){
|
|
107
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
108
|
-
var ownKeys = Object.keys(source);
|
|
109
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
110
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
111
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
112
|
-
}));
|
|
113
|
-
}
|
|
114
|
-
ownKeys.forEach(function(key) {
|
|
115
|
-
_define_property(target, key, source[key]);
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
return target;
|
|
119
|
-
}
|
|
120
|
-
function _object_without_properties(source, excluded) {
|
|
121
|
-
if (source == null) return {};
|
|
122
|
-
var target = {}, sourceKeys, key, i;
|
|
123
|
-
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
124
|
-
sourceKeys = Reflect.ownKeys(source);
|
|
125
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
126
|
-
key = sourceKeys[i];
|
|
127
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
128
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
129
|
-
target[key] = source[key];
|
|
130
|
-
}
|
|
131
|
-
return target;
|
|
132
|
-
}
|
|
133
|
-
target = _object_without_properties_loose(source, excluded);
|
|
134
|
-
if (Object.getOwnPropertySymbols) {
|
|
135
|
-
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
136
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
137
|
-
key = sourceKeys[i];
|
|
138
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
139
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
140
|
-
target[key] = source[key];
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return target;
|
|
144
|
-
}
|
|
145
|
-
function _object_without_properties_loose(source, excluded) {
|
|
146
|
-
if (source == null) return {};
|
|
147
|
-
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
148
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
149
|
-
key = sourceKeys[i];
|
|
150
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
151
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
152
|
-
target[key] = source[key];
|
|
153
|
-
}
|
|
154
|
-
return target;
|
|
155
|
-
}
|
|
156
|
-
function _sliced_to_array(arr, i) {
|
|
157
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
158
|
-
}
|
|
159
|
-
function _to_array(arr) {
|
|
160
|
-
return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest();
|
|
161
|
-
}
|
|
162
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
163
|
-
if (!o) return;
|
|
164
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
165
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
166
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
167
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
168
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
169
|
-
}
|
|
170
|
-
function createButton() {
|
|
171
|
-
var Root = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _Button.ButtonRoot;
|
|
54
|
+
function createButton(Root = _Button.ButtonRoot) {
|
|
172
55
|
// eslint-disable-next-line prefer-arrow-callback
|
|
173
|
-
return /*#__PURE__*/ (0, _react.forwardRef)(function Button(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}) : _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, [
|
|
182
|
-
"children",
|
|
183
|
-
"text",
|
|
184
|
-
"contentLeft",
|
|
185
|
-
"contentRight",
|
|
186
|
-
"square",
|
|
187
|
-
"deviceScale",
|
|
188
|
-
"loader",
|
|
189
|
-
"disabled",
|
|
190
|
-
"isLoading",
|
|
191
|
-
"type"
|
|
192
|
-
]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
|
|
193
|
-
var isContentLeft = Boolean(contentLeft);
|
|
194
|
-
var isContentRight = Boolean(contentRight);
|
|
195
|
-
return /*#__PURE__*/ _react.default.createElement(Root, _object_spread({
|
|
56
|
+
return /*#__PURE__*/ (0, _react.forwardRef)(function Button({ children, text, contentLeft, contentRight, square, deviceScale, loader = /*#__PURE__*/ _react.default.createElement(_Button.StyledSpinner, {
|
|
57
|
+
color: "currentColor",
|
|
58
|
+
size: 56,
|
|
59
|
+
deviceScale: deviceScale
|
|
60
|
+
}), disabled, isLoading, type = 'button', ...rest }, ref) {
|
|
61
|
+
const isContentLeft = Boolean(contentLeft);
|
|
62
|
+
const isContentRight = Boolean(contentRight);
|
|
63
|
+
return /*#__PURE__*/ _react.default.createElement(Root, {
|
|
196
64
|
ref: ref,
|
|
197
65
|
type: type,
|
|
198
66
|
$isContentLeft: isContentLeft,
|
|
199
67
|
$isContentRight: isContentRight,
|
|
200
68
|
$isLoading: isLoading,
|
|
201
69
|
disabled: isLoading || disabled,
|
|
202
|
-
square: square !== undefined ? square : !text && !children
|
|
203
|
-
|
|
70
|
+
square: square !== undefined ? square : !text && !children,
|
|
71
|
+
...rest
|
|
72
|
+
}, isLoading && /*#__PURE__*/ _react.default.createElement(_Button.ButtonLoader, null, loader), /*#__PURE__*/ _react.default.createElement(_Button.ButtonContentWrapper, {
|
|
204
73
|
$isLoading: isLoading
|
|
205
74
|
}, children, !children && contentLeft, !children && text && /*#__PURE__*/ _react.default.createElement(_Button.ButtonText, {
|
|
206
75
|
$isContentLeft: isContentLeft,
|
|
@@ -31,7 +31,7 @@ _export(exports, {
|
|
|
31
31
|
return _Buttonmixins.getButtonSizesMixin;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const _Button = require("./Button");
|
|
35
|
+
const _Buttonprops = require("./Button.props");
|
|
36
|
+
const _Buttonmixins = require("./Button.mixins");
|
|
37
|
+
const _createButton = require("./createButton");
|
package/components/Card/Card.js
CHANGED
|
@@ -16,32 +16,11 @@ _export(exports, {
|
|
|
16
16
|
return StyledCard;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function _array_like_to_array(arr, len) {
|
|
25
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
26
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
27
|
-
return arr2;
|
|
28
|
-
}
|
|
29
|
-
function _array_with_holes(arr) {
|
|
30
|
-
if (Array.isArray(arr)) return arr;
|
|
31
|
-
}
|
|
32
|
-
function _define_property(obj, key, value) {
|
|
33
|
-
if (key in obj) {
|
|
34
|
-
Object.defineProperty(obj, key, {
|
|
35
|
-
value: value,
|
|
36
|
-
enumerable: true,
|
|
37
|
-
configurable: true,
|
|
38
|
-
writable: true
|
|
39
|
-
});
|
|
40
|
-
} else {
|
|
41
|
-
obj[key] = value;
|
|
42
|
-
}
|
|
43
|
-
return obj;
|
|
44
|
-
}
|
|
19
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
20
|
+
const _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
|
|
21
|
+
const _tokens = require("../../tokens");
|
|
22
|
+
const _mixins = require("../../mixins");
|
|
23
|
+
const _Typography = require("../Typography");
|
|
45
24
|
function _interop_require_default(obj) {
|
|
46
25
|
return obj && obj.__esModule ? obj : {
|
|
47
26
|
default: obj
|
|
@@ -88,149 +67,42 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
88
67
|
}
|
|
89
68
|
return newObj;
|
|
90
69
|
}
|
|
91
|
-
function _iterable_to_array(iter) {
|
|
92
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
93
|
-
}
|
|
94
|
-
function _iterable_to_array_limit(arr, i) {
|
|
95
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
96
|
-
if (_i == null) return;
|
|
97
|
-
var _arr = [];
|
|
98
|
-
var _n = true;
|
|
99
|
-
var _d = false;
|
|
100
|
-
var _s, _e;
|
|
101
|
-
try {
|
|
102
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
103
|
-
_arr.push(_s.value);
|
|
104
|
-
if (i && _arr.length === i) break;
|
|
105
|
-
}
|
|
106
|
-
} catch (err) {
|
|
107
|
-
_d = true;
|
|
108
|
-
_e = err;
|
|
109
|
-
} finally{
|
|
110
|
-
try {
|
|
111
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
112
|
-
} finally{
|
|
113
|
-
if (_d) throw _e;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return _arr;
|
|
117
|
-
}
|
|
118
|
-
function _non_iterable_rest() {
|
|
119
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
120
|
-
}
|
|
121
|
-
function _object_spread(target) {
|
|
122
|
-
for(var i = 1; i < arguments.length; i++){
|
|
123
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
124
|
-
var ownKeys = Object.keys(source);
|
|
125
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
126
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
127
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
128
|
-
}));
|
|
129
|
-
}
|
|
130
|
-
ownKeys.forEach(function(key) {
|
|
131
|
-
_define_property(target, key, source[key]);
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
return target;
|
|
135
|
-
}
|
|
136
|
-
function _object_without_properties(source, excluded) {
|
|
137
|
-
if (source == null) return {};
|
|
138
|
-
var target = {}, sourceKeys, key, i;
|
|
139
|
-
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
140
|
-
sourceKeys = Reflect.ownKeys(source);
|
|
141
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
142
|
-
key = sourceKeys[i];
|
|
143
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
144
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
145
|
-
target[key] = source[key];
|
|
146
|
-
}
|
|
147
|
-
return target;
|
|
148
|
-
}
|
|
149
|
-
target = _object_without_properties_loose(source, excluded);
|
|
150
|
-
if (Object.getOwnPropertySymbols) {
|
|
151
|
-
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
152
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
153
|
-
key = sourceKeys[i];
|
|
154
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
155
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
156
|
-
target[key] = source[key];
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return target;
|
|
160
|
-
}
|
|
161
|
-
function _object_without_properties_loose(source, excluded) {
|
|
162
|
-
if (source == null) return {};
|
|
163
|
-
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
164
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
165
|
-
key = sourceKeys[i];
|
|
166
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
167
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
168
|
-
target[key] = source[key];
|
|
169
|
-
}
|
|
170
|
-
return target;
|
|
171
|
-
}
|
|
172
|
-
function _sliced_to_array(arr, i) {
|
|
173
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
174
|
-
}
|
|
175
|
-
function _to_array(arr) {
|
|
176
|
-
return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest();
|
|
177
|
-
}
|
|
178
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
179
|
-
if (!o) return;
|
|
180
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
181
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
182
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
183
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
184
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
185
|
-
}
|
|
186
70
|
// В этих константах задаем размеры в em, чтобы не зависеть напрямую от пикселей
|
|
187
71
|
// В то же время в числителях - значения в пикселях, взятые из макета
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
72
|
+
const fontSize = 16;
|
|
73
|
+
const shadowOffset = 8 / fontSize;
|
|
74
|
+
const shadowSize = 24 / fontSize;
|
|
75
|
+
const outlineSize = 2 / fontSize;
|
|
76
|
+
const DEFAULT_ROUNDNESS = 20;
|
|
77
|
+
const StyledCard = (0, _styledcomponents.default)(_Typography.Body1).withConfig({
|
|
194
78
|
displayName: "Card__StyledCard",
|
|
195
79
|
componentId: "sc-34a54ef8-0"
|
|
196
80
|
})([
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
], _mixins.applyDisabled, _mixins.applyRoundness, _tokens.surfaceCard, shadowOffset, shadowSize,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
var focused = param.focused, outlined = param.outlined, roundness = param.roundness, scaleOnFocus = param.scaleOnFocus, theme = param.theme;
|
|
210
|
-
return (0, _styledcomponents.css)([
|
|
211
|
-
"",
|
|
212
|
-
" ",
|
|
213
|
-
" &:focus{outline:none;}"
|
|
81
|
+
``,
|
|
82
|
+
` `,
|
|
83
|
+
`;position:relative;display:flex;box-sizing:border-box;flex-direction:column;flex-shrink:0;background:`,
|
|
84
|
+
`;box-shadow:0 `,
|
|
85
|
+
`em `,
|
|
86
|
+
`em rgba(0,0,0,0.1);transition:`,
|
|
87
|
+
`;`,
|
|
88
|
+
``
|
|
89
|
+
], _mixins.applyDisabled, _mixins.applyRoundness, _tokens.surfaceCard, shadowOffset, shadowSize, ({ theme })=>theme.lowPerformance ? 'unset' : 'transform 0.4s ease-in-out', ({ focused, outlined, roundness, scaleOnFocus, theme })=>(0, _styledcomponents.css)([
|
|
90
|
+
``,
|
|
91
|
+
` `,
|
|
92
|
+
` &:focus{outline:none;}`
|
|
214
93
|
], (0, _mixins.addFocus)({
|
|
215
94
|
lowPerformance: theme.lowPerformance,
|
|
216
|
-
focused
|
|
217
|
-
outlined
|
|
218
|
-
outlineSize:
|
|
219
|
-
outlineRadius:
|
|
95
|
+
focused,
|
|
96
|
+
outlined,
|
|
97
|
+
outlineSize: `${outlineSize}rem`,
|
|
98
|
+
outlineRadius: `${_mixins.radiuses[roundness] + outlineSize}rem`
|
|
220
99
|
}), scaleOnFocus && (0, _mixins.syntheticFocus)((0, _styledcomponents.css)([
|
|
221
|
-
|
|
222
|
-
]), focused));
|
|
223
|
-
})
|
|
224
|
-
|
|
225
|
-
var _ref = [
|
|
226
|
-
_0,
|
|
227
|
-
_1
|
|
228
|
-
], _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, [
|
|
229
|
-
"roundness",
|
|
230
|
-
"children"
|
|
231
|
-
]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
|
|
232
|
-
return /*#__PURE__*/ _react.default.createElement(StyledCard, _object_spread({
|
|
100
|
+
`&{transform:scale(1.04);}`
|
|
101
|
+
]), focused)));
|
|
102
|
+
const Card = /*#__PURE__*/ _react.default.forwardRef(function Card({ roundness = DEFAULT_ROUNDNESS, children, ...rest }, ref) {
|
|
103
|
+
return /*#__PURE__*/ _react.default.createElement(StyledCard, {
|
|
233
104
|
ref: ref,
|
|
234
|
-
roundness: roundness
|
|
235
|
-
|
|
105
|
+
roundness: roundness,
|
|
106
|
+
...rest
|
|
107
|
+
}, children);
|
|
236
108
|
});
|
|
@@ -8,16 +8,16 @@ Object.defineProperty(exports, "CardBody", {
|
|
|
8
8
|
return CardBody;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
12
|
+
const _styledcomponents = /*#__PURE__*/ _interop_require_default(require("styled-components"));
|
|
13
13
|
function _interop_require_default(obj) {
|
|
14
14
|
return obj && obj.__esModule ? obj : {
|
|
15
15
|
default: obj
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
const CardBody = _styledcomponents.default.div.withConfig({
|
|
19
19
|
displayName: "CardBody",
|
|
20
20
|
componentId: "sc-24f3a93d-0"
|
|
21
21
|
})([
|
|
22
|
-
|
|
22
|
+
`position:relative;display:flex;overflow:hidden;flex:1;flex-direction:column;box-sizing:content-box;width:100%;border-radius:inherit;`
|
|
23
23
|
]);
|
|
@@ -8,8 +8,8 @@ Object.defineProperty(exports, "CardContent", {
|
|
|
8
8
|
return CardContent;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
12
|
+
const _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
|
|
13
13
|
function _interop_require_default(obj) {
|
|
14
14
|
return obj && obj.__esModule ? obj : {
|
|
15
15
|
default: obj
|
|
@@ -56,28 +56,19 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
56
56
|
}
|
|
57
57
|
return newObj;
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
const CardContent = _styledcomponents.default.div.withConfig({
|
|
60
60
|
displayName: "CardContent",
|
|
61
61
|
componentId: "sc-4a3fa268-0"
|
|
62
62
|
})([
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
],
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return disabled && (0, _styledcomponents.css)([
|
|
73
|
-
"opacity:0.5;"
|
|
74
|
-
]);
|
|
75
|
-
}, function(param) {
|
|
76
|
-
var cover = param.cover, _param_coverGradient = param.coverGradient, coverGradient = _param_coverGradient === void 0 ? true : _param_coverGradient;
|
|
77
|
-
return cover && (0, _styledcomponents.css)([
|
|
78
|
-
"position:absolute;top:0;left:0;right:0;bottom:0;justify-content:flex-end;",
|
|
79
|
-
";"
|
|
63
|
+
`display:flex;flex-direction:column;position:relative;box-sizing:border-box;padding:`,
|
|
64
|
+
`rem 1rem;border-radius:inherit;`,
|
|
65
|
+
` `,
|
|
66
|
+
``
|
|
67
|
+
], ({ compact })=>compact ? 0.375 : 1, ({ disabled })=>disabled && (0, _styledcomponents.css)([
|
|
68
|
+
`opacity:0.5;`
|
|
69
|
+
]), ({ cover, coverGradient = true })=>cover && (0, _styledcomponents.css)([
|
|
70
|
+
`position:absolute;top:0;left:0;right:0;bottom:0;justify-content:flex-end;`,
|
|
71
|
+
`;`
|
|
80
72
|
], coverGradient && (0, _styledcomponents.css)([
|
|
81
|
-
|
|
82
|
-
]));
|
|
83
|
-
});
|
|
73
|
+
`background:linear-gradient(180deg,rgba(0,0,0,0) 0%,rgba(0,0,0,0.74) 100%);`
|
|
74
|
+
])));
|
|
@@ -8,22 +8,9 @@ Object.defineProperty(exports, "CardMedia", {
|
|
|
8
8
|
return CardMedia;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function _define_property(obj, key, value) {
|
|
15
|
-
if (key in obj) {
|
|
16
|
-
Object.defineProperty(obj, key, {
|
|
17
|
-
value: value,
|
|
18
|
-
enumerable: true,
|
|
19
|
-
configurable: true,
|
|
20
|
-
writable: true
|
|
21
|
-
});
|
|
22
|
-
} else {
|
|
23
|
-
obj[key] = value;
|
|
24
|
-
}
|
|
25
|
-
return obj;
|
|
26
|
-
}
|
|
11
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
12
|
+
const _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
|
|
13
|
+
const _Image = require("../Image");
|
|
27
14
|
function _interop_require_default(obj) {
|
|
28
15
|
return obj && obj.__esModule ? obj : {
|
|
29
16
|
default: obj
|
|
@@ -70,91 +57,33 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
70
57
|
}
|
|
71
58
|
return newObj;
|
|
72
59
|
}
|
|
73
|
-
|
|
74
|
-
for(var i = 1; i < arguments.length; i++){
|
|
75
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
76
|
-
var ownKeys = Object.keys(source);
|
|
77
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
78
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
79
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
80
|
-
}));
|
|
81
|
-
}
|
|
82
|
-
ownKeys.forEach(function(key) {
|
|
83
|
-
_define_property(target, key, source[key]);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
return target;
|
|
87
|
-
}
|
|
88
|
-
function _object_without_properties(source, excluded) {
|
|
89
|
-
if (source == null) return {};
|
|
90
|
-
var target = {}, sourceKeys, key, i;
|
|
91
|
-
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
92
|
-
sourceKeys = Reflect.ownKeys(source);
|
|
93
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
94
|
-
key = sourceKeys[i];
|
|
95
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
96
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
97
|
-
target[key] = source[key];
|
|
98
|
-
}
|
|
99
|
-
return target;
|
|
100
|
-
}
|
|
101
|
-
target = _object_without_properties_loose(source, excluded);
|
|
102
|
-
if (Object.getOwnPropertySymbols) {
|
|
103
|
-
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
104
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
105
|
-
key = sourceKeys[i];
|
|
106
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
107
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
108
|
-
target[key] = source[key];
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return target;
|
|
112
|
-
}
|
|
113
|
-
function _object_without_properties_loose(source, excluded) {
|
|
114
|
-
if (source == null) return {};
|
|
115
|
-
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
116
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
117
|
-
key = sourceKeys[i];
|
|
118
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
119
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
120
|
-
target[key] = source[key];
|
|
121
|
-
}
|
|
122
|
-
return target;
|
|
123
|
-
}
|
|
124
|
-
var StyledImage = (0, _styledcomponents.default)(_Image.Image).withConfig({
|
|
60
|
+
const StyledImage = (0, _styledcomponents.default)(_Image.Image).withConfig({
|
|
125
61
|
displayName: "CardMedia__StyledImage",
|
|
126
62
|
componentId: "sc-636df49e-0"
|
|
127
63
|
})([
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
],
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
]);
|
|
135
|
-
});
|
|
136
|
-
var StyledRoot = _styledcomponents.default.div.withConfig({
|
|
64
|
+
`background-size:cover;`,
|
|
65
|
+
``
|
|
66
|
+
], ({ $disabled })=>$disabled && (0, _styledcomponents.css)([
|
|
67
|
+
`opacity:0.5;`
|
|
68
|
+
]));
|
|
69
|
+
const StyledRoot = _styledcomponents.default.div.withConfig({
|
|
137
70
|
displayName: "CardMedia__StyledRoot",
|
|
138
71
|
componentId: "sc-636df49e-1"
|
|
139
72
|
})([
|
|
140
|
-
|
|
73
|
+
`position:relative;`
|
|
141
74
|
]);
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
"style",
|
|
147
|
-
"children",
|
|
148
|
-
"className"
|
|
149
|
-
]);
|
|
150
|
-
var imgStyle = _object_spread({}, style);
|
|
75
|
+
const CardMedia = ({ disabled, placeholder, style, children, className, ...props })=>{
|
|
76
|
+
const imgStyle = {
|
|
77
|
+
...style
|
|
78
|
+
};
|
|
151
79
|
if (placeholder && !props.src) {
|
|
152
|
-
imgStyle.backgroundImage =
|
|
80
|
+
imgStyle.backgroundImage = `url('${placeholder}')`;
|
|
153
81
|
}
|
|
154
82
|
return /*#__PURE__*/ _react.default.createElement(StyledRoot, {
|
|
155
83
|
className: className
|
|
156
|
-
}, /*#__PURE__*/ _react.default.createElement(StyledImage,
|
|
84
|
+
}, /*#__PURE__*/ _react.default.createElement(StyledImage, {
|
|
157
85
|
$disabled: disabled,
|
|
158
|
-
style: imgStyle
|
|
159
|
-
|
|
86
|
+
style: imgStyle,
|
|
87
|
+
...props
|
|
88
|
+
}), children);
|
|
160
89
|
};
|