@salutejs/plasma-core 1.214.0-next-insol.0 → 1.215.0-canary.2456.21632138802.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/.swc/plugins/{v7_linux_x86_64_14.0.0/cce279a62b5dde357ee7b421711ef357c3f0a29cd3cb6e86336f7345fd604d8e → linux_x86_64_24.0.0/202f6e4cef5244f7c5860be71bf49ba7448c1085420582e8bfccb5598d99b9c4.wasmer-v7} +0 -0
- package/.swc/plugins/{v7_linux_x86_64_14.0.0/358fecaab1701de64a7bceee21e5f3a204d1107aa33eb372d1dab77a43118622 → linux_x86_64_24.0.0/671036687e3bc3a68b2957b14f0890c0b5825f19e8049d9af5daf3537b9160fd.wasmer-v7} +0 -0
- package/collectPackageInfo.js +1 -1
- package/components/Badge/Badge.js +19 -10
- package/components/Button/Button.mixins.js +1 -1
- package/components/Button/createButton.js +76 -12
- package/components/Card/Card.js +75 -11
- package/components/Card/CardMedia.js +19 -10
- package/components/Card/CardPrice.js +19 -10
- package/components/Card/CardTypography.js +2 -2
- package/components/Carousel/CarouselItem.js +21 -12
- package/components/Carousel/hooks.js +2 -2
- package/components/Carousel/utils.js +14 -14
- package/components/Image/Image.js +19 -10
- package/components/Input/Input.mixins.js +1 -1
- package/components/ModalBase/ModalBase.js +19 -10
- package/components/ModalBase/ModalBaseContext.js +3 -3
- package/components/ModalBase/ModalOverlay.js +19 -10
- package/components/ModalBase/hooks.js +1 -1
- package/components/PaginationDots/usePaginationDots.js +1 -1
- package/components/Popup/Popup.js +77 -13
- package/components/PopupBase/PopupBase.js +31 -13
- package/components/PopupBase/PopupBaseContext.js +4 -4
- package/components/PopupBase/PopupBaseRoot.js +75 -11
- package/components/PopupBase/hooks.js +2 -2
- package/components/PopupBase/utils.js +1 -1
- package/components/Price/Price.js +19 -10
- package/components/RadioGroup/RadioGroup.js +75 -11
- package/components/SSRProvider/SSRProvider.js +1 -1
- package/components/Skeleton/LineSkeleton.js +19 -10
- package/components/Skeleton/RectSkeleton.js +19 -10
- package/components/Skeleton/TextSkeleton.js +19 -10
- package/components/Slider/Double.js +19 -10
- package/components/Slider/Handle.js +29 -11
- package/components/Slider/Single.js +19 -10
- package/components/Slider/Slider.js +2 -2
- package/components/Slider/SliderBase.js +2 -2
- package/components/Slider/ThumbBase.js +19 -10
- package/components/Spinner/Spinner.js +19 -10
- package/components/Spinner/SpinnerSvg.js +19 -10
- package/components/Switch/Switch.js +76 -12
- package/components/Tabs/TabItem.js +75 -11
- package/components/Tabs/Tabs.js +75 -11
- package/components/Tabs/createTabsController.js +75 -11
- package/components/TextArea/TextArea.js +1 -1
- package/components/Toast/Toast.js +1 -1
- package/components/Toast/ToastContext.js +2 -2
- package/components/Toast/ToastController.js +3 -3
- package/components/Toast/ToastProvider.js +3 -3
- package/components/Toast/useToast.js +1 -1
- package/es/collectPackageInfo.js +1 -1
- package/es/components/Badge/Badge.js +19 -10
- package/es/components/Button/Button.mixins.js +1 -1
- package/es/components/Button/createButton.js +76 -12
- package/es/components/Card/Card.js +75 -11
- package/es/components/Card/CardMedia.js +19 -10
- package/es/components/Card/CardPrice.js +19 -10
- package/es/components/Card/CardTypography.js +2 -2
- package/es/components/Carousel/CarouselItem.js +21 -12
- package/es/components/Carousel/hooks.js +4 -4
- package/es/components/Carousel/utils.js +14 -14
- package/es/components/Image/Image.js +19 -10
- package/es/components/Input/Input.mixins.js +1 -1
- package/es/components/ModalBase/ModalBase.js +19 -10
- package/es/components/ModalBase/ModalBaseContext.js +3 -3
- package/es/components/ModalBase/ModalOverlay.js +19 -10
- package/es/components/ModalBase/hooks.js +1 -1
- package/es/components/PaginationDots/usePaginationDots.js +1 -1
- package/es/components/Popup/Popup.js +77 -13
- package/es/components/PopupBase/PopupBase.js +31 -13
- package/es/components/PopupBase/PopupBaseContext.js +4 -4
- package/es/components/PopupBase/PopupBaseRoot.js +75 -11
- package/es/components/PopupBase/hooks.js +2 -2
- package/es/components/PopupBase/utils.js +1 -1
- package/es/components/Price/Price.js +19 -10
- package/es/components/RadioGroup/RadioGroup.js +75 -11
- package/es/components/SSRProvider/SSRProvider.js +1 -1
- package/es/components/Skeleton/LineSkeleton.js +19 -10
- package/es/components/Skeleton/RectSkeleton.js +19 -10
- package/es/components/Skeleton/TextSkeleton.js +19 -10
- package/es/components/Slider/Double.js +19 -10
- package/es/components/Slider/Handle.js +29 -11
- package/es/components/Slider/Single.js +19 -10
- package/es/components/Slider/Slider.js +2 -2
- package/es/components/Slider/SliderBase.js +2 -2
- package/es/components/Slider/ThumbBase.js +19 -10
- package/es/components/Spinner/Spinner.js +19 -10
- package/es/components/Spinner/SpinnerSvg.js +19 -10
- package/es/components/Switch/Switch.js +76 -12
- package/es/components/Tabs/TabItem.js +75 -11
- package/es/components/Tabs/Tabs.js +75 -11
- package/es/components/Tabs/createTabsController.js +75 -11
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/Toast/Toast.js +1 -1
- package/es/components/Toast/ToastContext.js +2 -2
- package/es/components/Toast/ToastController.js +3 -3
- package/es/components/Toast/ToastProvider.js +3 -3
- package/es/components/Toast/useToast.js +1 -1
- package/es/hocs/withAutoFocus.js +20 -11
- package/es/hocs/withSkeleton.js +1 -1
- package/es/hooks/useFocusTrap.js +4 -4
- package/es/hooks/useForkRef.js +1 -1
- package/es/hooks/useResizeObserver.js +1 -1
- package/es/mixins/addFocus.js +2 -2
- package/es/mixins/applyDisabled.js +1 -1
- package/es/mixins/applyEllipsis.js +1 -1
- package/es/mixins/applyMaxLines.js +1 -1
- package/es/mixins/applyNoSelect.js +1 -1
- package/es/mixins/applyOutline.js +1 -1
- package/es/mixins/applyRoundness.js +1 -1
- package/es/mixins/applyScrollSnap.js +1 -1
- package/es/mixins/applySkeletonGradient.js +1 -1
- package/es/mixins/applyView.js +1 -1
- package/es/mixins/blur.js +1 -1
- package/es/utils/animatedScrollTo.js +8 -8
- package/es/utils/extractTextFrom.js +1 -1
- package/es/utils/formatCurrency.js +1 -1
- package/es/utils/formatters.js +5 -5
- package/es/utils/roundness.js +1 -1
- package/es/utils/scopeTab.js +1 -1
- package/es/utils/setRef.js +1 -1
- package/es/utils/tabbable.js +6 -6
- package/es/utils/toCssSize.js +1 -1
- package/es/utils/transformStyles.js +3 -3
- package/hocs/withAutoFocus.js +20 -11
- package/hocs/withSkeleton.js +1 -1
- package/hooks/useFocusTrap.js +4 -4
- package/hooks/useForkRef.js +1 -1
- package/hooks/useResizeObserver.js +1 -1
- package/mixins/addFocus.js +2 -2
- package/mixins/applyDisabled.js +1 -1
- package/mixins/applyEllipsis.js +1 -1
- package/mixins/applyMaxLines.js +1 -1
- package/mixins/applyNoSelect.js +1 -1
- package/mixins/applyOutline.js +1 -1
- package/mixins/applyRoundness.js +1 -1
- package/mixins/applyScrollSnap.js +1 -1
- package/mixins/applySkeletonGradient.js +1 -1
- package/mixins/applyView.js +1 -1
- package/mixins/blur.js +1 -1
- package/package.json +3 -3
- package/utils/animatedScrollTo.js +8 -8
- package/utils/extractTextFrom.js +1 -1
- package/utils/formatCurrency.js +1 -1
- package/utils/formatters.js +5 -5
- package/utils/roundness.js +1 -1
- package/utils/scopeTab.js +1 -1
- package/utils/setRef.js +1 -1
- package/utils/tabbable.js +6 -6
- package/utils/toCssSize.js +1 -1
- package/utils/transformStyles.js +3 -3
|
@@ -1,3 +1,11 @@
|
|
|
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
|
+
}
|
|
1
9
|
function _define_property(obj, key, value) {
|
|
2
10
|
if (key in obj) {
|
|
3
11
|
Object.defineProperty(obj, key, {
|
|
@@ -11,6 +19,36 @@ function _define_property(obj, key, value) {
|
|
|
11
19
|
}
|
|
12
20
|
return obj;
|
|
13
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
|
+
}
|
|
14
52
|
function _object_spread(target) {
|
|
15
53
|
for(var i = 1; i < arguments.length; i++){
|
|
16
54
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -28,12 +66,22 @@ function _object_spread(target) {
|
|
|
28
66
|
}
|
|
29
67
|
function _object_without_properties(source, excluded) {
|
|
30
68
|
if (source == null) return {};
|
|
31
|
-
var target =
|
|
32
|
-
|
|
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);
|
|
33
81
|
if (Object.getOwnPropertySymbols) {
|
|
34
|
-
|
|
35
|
-
for(i = 0; i <
|
|
36
|
-
key =
|
|
82
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
83
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
84
|
+
key = sourceKeys[i];
|
|
37
85
|
if (excluded.indexOf(key) >= 0) continue;
|
|
38
86
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
39
87
|
target[key] = source[key];
|
|
@@ -43,16 +91,29 @@ function _object_without_properties(source, excluded) {
|
|
|
43
91
|
}
|
|
44
92
|
function _object_without_properties_loose(source, excluded) {
|
|
45
93
|
if (source == null) return {};
|
|
46
|
-
var target = {};
|
|
47
|
-
var sourceKeys = Object.keys(source);
|
|
48
|
-
var key, i;
|
|
94
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
49
95
|
for(i = 0; i < sourceKeys.length; i++){
|
|
50
96
|
key = sourceKeys[i];
|
|
51
97
|
if (excluded.indexOf(key) >= 0) continue;
|
|
98
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
52
99
|
target[key] = source[key];
|
|
53
100
|
}
|
|
54
101
|
return target;
|
|
55
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
|
+
}
|
|
56
117
|
import React, { forwardRef, useMemo, useCallback, useRef } from 'react';
|
|
57
118
|
import { useForkRef } from '../../hooks';
|
|
58
119
|
import { TabItemRefs, TabsContext } from './TabsContext';
|
|
@@ -71,13 +132,16 @@ var Keys = /*#__PURE__*/ function(Keys) {
|
|
|
71
132
|
*/ export function createTabsController() {
|
|
72
133
|
var ListComponent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Tabs, ItemComponent = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : TabItem;
|
|
73
134
|
// eslint-disable-next-line prefer-arrow-callback
|
|
74
|
-
return /*#__PURE__*/ forwardRef(function TabsController(
|
|
75
|
-
var
|
|
135
|
+
return /*#__PURE__*/ forwardRef(function TabsController(_0, _1) {
|
|
136
|
+
var _ref = [
|
|
137
|
+
_0,
|
|
138
|
+
_1
|
|
139
|
+
], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), items = _ref2.items, index = _ref2.index, autoscroll = _ref2.autoscroll, onIndexChange = _ref2.onIndexChange, rest = _object_without_properties(_ref2, [
|
|
76
140
|
"items",
|
|
77
141
|
"index",
|
|
78
142
|
"autoscroll",
|
|
79
143
|
"onIndexChange"
|
|
80
|
-
]);
|
|
144
|
+
]), _rest1 = _sliced_to_array(_rest, 1), outerRef = _rest1[0];
|
|
81
145
|
var disabled = rest.disabled;
|
|
82
146
|
var refs = useMemo(function() {
|
|
83
147
|
return new TabItemRefs();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { applyInputStyles } from '../Input/Input.mixins';
|
|
3
|
-
export var applyTextAreaCssProperties = function(param) {
|
|
3
|
+
export var applyTextAreaCssProperties = function applyTextAreaCssProperties(param) {
|
|
4
4
|
var height = param.height, width = param.width;
|
|
5
5
|
var computedHeight = !Number.isNaN(Number(height)) ? "".concat(height, "rem") : height;
|
|
6
6
|
var computedWidth = !Number.isNaN(Number(width)) ? "".concat(width, "rem") : width;
|
|
@@ -21,7 +21,7 @@ var StyledContent = styled.div.withConfig({
|
|
|
21
21
|
/**
|
|
22
22
|
* Короткие текстовые подсказки.
|
|
23
23
|
* Вызываются только в текущем запущенном приложении как реакция на выполнение действия пользователем.
|
|
24
|
-
*/ export var Toast = function(param) {
|
|
24
|
+
*/ export var Toast = function Toast(param) {
|
|
25
25
|
var _param_role = param.role, role = _param_role === void 0 ? 'status' : _param_role, text = param.text, contentLeft = param.contentLeft;
|
|
26
26
|
var ariaLive = 'polite';
|
|
27
27
|
var ariaAtomic = false;
|
|
@@ -3,10 +3,10 @@ export var ToastContext = /*#__PURE__*/ createContext({
|
|
|
3
3
|
text: null,
|
|
4
4
|
position: null,
|
|
5
5
|
timeout: null,
|
|
6
|
-
showToast: function() {
|
|
6
|
+
showToast: function showToast() {
|
|
7
7
|
return undefined;
|
|
8
8
|
},
|
|
9
|
-
hideToast: function() {
|
|
9
|
+
hideToast: function hideToast() {
|
|
10
10
|
return undefined;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
@@ -50,13 +50,13 @@ import { Fade } from '../Fade';
|
|
|
50
50
|
import { safeFlushSync } from '../../utils';
|
|
51
51
|
import { Toast, StyledRoot as ToastStyledRoot } from './Toast';
|
|
52
52
|
import { useToast } from './useToast';
|
|
53
|
-
var showAnimation = function(position) {
|
|
53
|
+
var showAnimation = function showAnimation(position) {
|
|
54
54
|
return keyframes([
|
|
55
55
|
"0%{transform:translate(-50%,",
|
|
56
56
|
"5rem);opacity:0;}80%{transform:translate(-50%,0);opacity:0.7;}100%{opacity:1;}"
|
|
57
57
|
], position === 'top' && '-');
|
|
58
58
|
};
|
|
59
|
-
var hideAnimation = function(position) {
|
|
59
|
+
var hideAnimation = function hideAnimation(position) {
|
|
60
60
|
return keyframes([
|
|
61
61
|
"0%{opacity:1;}20%{transform:translate(-50%,0);opacity:0.7;}100%{transform:translate(-50%,",
|
|
62
62
|
"5rem);opacity:0;}"
|
|
@@ -100,7 +100,7 @@ var StyledRoot = styled.div.withConfig({
|
|
|
100
100
|
/**
|
|
101
101
|
* Создаёт <div />, который внутри себя содержит тост.
|
|
102
102
|
* Цикл: show => timeout => hide.
|
|
103
|
-
*/ export var ToastController = function(param) {
|
|
103
|
+
*/ export var ToastController = function ToastController(param) {
|
|
104
104
|
var role = param.role, text = param.text, contentLeft = param.contentLeft, position = param.position, timeout = param.timeout, fade = param.fade, offset = param.offset;
|
|
105
105
|
var hideToast = useToast().hideToast;
|
|
106
106
|
var _useState = _sliced_to_array(useState(true), 2), isVisible = _useState[0], setIsVisible = _useState[1];
|
|
@@ -106,7 +106,7 @@ import { ToastContext } from './ToastContext';
|
|
|
106
106
|
var DEFAULT_POSITION = 'bottom';
|
|
107
107
|
var DEFAULT_TIMEOUT = 3000;
|
|
108
108
|
var DEFAULT_FADE = true;
|
|
109
|
-
var getShowToastCallSignature = function(args) {
|
|
109
|
+
var getShowToastCallSignature = function getShowToastCallSignature(args) {
|
|
110
110
|
if (_type_of(args[0]) === 'object' && 'text' in args[0]) {
|
|
111
111
|
return args[0];
|
|
112
112
|
}
|
|
@@ -121,14 +121,14 @@ var getShowToastCallSignature = function(args) {
|
|
|
121
121
|
role: role
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
|
-
export var ToastProvider = function(param) {
|
|
124
|
+
export var ToastProvider = function ToastProvider(param) {
|
|
125
125
|
var children = param.children;
|
|
126
126
|
var _useState = _sliced_to_array(useState({
|
|
127
127
|
text: null,
|
|
128
128
|
position: null,
|
|
129
129
|
timeout: null
|
|
130
130
|
}), 2), value = _useState[0], setValue = _useState[1];
|
|
131
|
-
var showToastCallback = function() {
|
|
131
|
+
var showToastCallback = function showToastCallback() {
|
|
132
132
|
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
133
133
|
args[_key] = arguments[_key];
|
|
134
134
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
2
|
import { ToastContext } from './ToastContext';
|
|
3
|
-
export var useToast = function() {
|
|
3
|
+
export var useToast = function useToast() {
|
|
4
4
|
var _useContext = useContext(ToastContext), showToast = _useContext.showToast, hideToast = _useContext.hideToast;
|
|
5
5
|
return {
|
|
6
6
|
showToast: showToast,
|
package/es/hocs/withAutoFocus.js
CHANGED
|
@@ -28,12 +28,22 @@ function _object_spread(target) {
|
|
|
28
28
|
}
|
|
29
29
|
function _object_without_properties(source, excluded) {
|
|
30
30
|
if (source == null) return {};
|
|
31
|
-
var target =
|
|
32
|
-
|
|
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);
|
|
33
43
|
if (Object.getOwnPropertySymbols) {
|
|
34
|
-
|
|
35
|
-
for(i = 0; i <
|
|
36
|
-
key =
|
|
44
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
45
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
46
|
+
key = sourceKeys[i];
|
|
37
47
|
if (excluded.indexOf(key) >= 0) continue;
|
|
38
48
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
39
49
|
target[key] = source[key];
|
|
@@ -43,20 +53,19 @@ function _object_without_properties(source, excluded) {
|
|
|
43
53
|
}
|
|
44
54
|
function _object_without_properties_loose(source, excluded) {
|
|
45
55
|
if (source == null) return {};
|
|
46
|
-
var target = {};
|
|
47
|
-
var sourceKeys = Object.keys(source);
|
|
48
|
-
var key, i;
|
|
56
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
49
57
|
for(i = 0; i < sourceKeys.length; i++){
|
|
50
58
|
key = sourceKeys[i];
|
|
51
59
|
if (excluded.indexOf(key) >= 0) continue;
|
|
60
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
52
61
|
target[key] = source[key];
|
|
53
62
|
}
|
|
54
63
|
return target;
|
|
55
64
|
}
|
|
56
65
|
import React, { useEffect, useRef } from 'react';
|
|
57
|
-
export var withAutoFocus = function(Component) {
|
|
58
|
-
return function(
|
|
59
|
-
var autoFocus =
|
|
66
|
+
export var withAutoFocus = function withAutoFocus(Component) {
|
|
67
|
+
return function(_0) {
|
|
68
|
+
var autoFocus = _0.autoFocus, _0_tabIndex = _0.tabIndex, tabIndex = _0_tabIndex === void 0 ? -1 : _0_tabIndex, _0_preventScroll = _0.preventScroll, preventScroll = _0_preventScroll === void 0 ? true : _0_preventScroll, props = _object_without_properties(_0, [
|
|
60
69
|
"autoFocus",
|
|
61
70
|
"tabIndex",
|
|
62
71
|
"preventScroll"
|
package/es/hocs/withSkeleton.js
CHANGED
|
@@ -4,7 +4,7 @@ import { applySkeletonGradient } from '../mixins';
|
|
|
4
4
|
/**
|
|
5
5
|
* Делает компонент скелетоном - у него заменяется фоновый цвет,
|
|
6
6
|
* добавляется градиент и текст становится на 100% прозрачным.
|
|
7
|
-
*/ export var withSkeleton = function(Component) {
|
|
7
|
+
*/ export var withSkeleton = function withSkeleton(Component) {
|
|
8
8
|
return styled(Component).withConfig({
|
|
9
9
|
displayName: "withSkeleton",
|
|
10
10
|
componentId: "sc-764f817c-0"
|
package/es/hooks/useFocusTrap.js
CHANGED
|
@@ -3,7 +3,7 @@ import { FocusManager } from '../utils/focusManager';
|
|
|
3
3
|
import { focusSelector, isFocusable, isTabble } from '../utils/tabbable';
|
|
4
4
|
import { scopeTab } from '../utils/scopeTab';
|
|
5
5
|
// Находим элемент для фокуса
|
|
6
|
-
var getFocusElement = function(node, firstFocusSelector) {
|
|
6
|
+
var getFocusElement = function getFocusElement(node, firstFocusSelector) {
|
|
7
7
|
var focusElement = null;
|
|
8
8
|
if (firstFocusSelector) {
|
|
9
9
|
if (typeof firstFocusSelector === 'string') {
|
|
@@ -24,7 +24,7 @@ var getFocusElement = function(node, firstFocusSelector) {
|
|
|
24
24
|
}
|
|
25
25
|
return focusElement;
|
|
26
26
|
};
|
|
27
|
-
var processNode = function(node, firstFocusSelector, ref) {
|
|
27
|
+
var processNode = function processNode1(node, firstFocusSelector, ref) {
|
|
28
28
|
if (ref === null || ref === void 0 ? void 0 : ref.current) {
|
|
29
29
|
ref.current.removeEventListener('animationend', function() {
|
|
30
30
|
processNode(node, firstFocusSelector, ref);
|
|
@@ -38,7 +38,7 @@ var processNode = function(node, firstFocusSelector, ref) {
|
|
|
38
38
|
var focusManager = new FocusManager();
|
|
39
39
|
/**
|
|
40
40
|
* Захватывает фокус внутри DOM node.
|
|
41
|
-
* */ export var useFocusTrap = function() {
|
|
41
|
+
* */ export var useFocusTrap = function useFocusTrap() {
|
|
42
42
|
var active = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, firstFocusSelector = arguments.length > 1 ? arguments[1] : void 0, focusAfterNode = arguments.length > 2 ? arguments[2] : void 0, focusAfterAnimation = arguments.length > 3 ? arguments[3] : void 0;
|
|
43
43
|
var ref = useRef();
|
|
44
44
|
var setRef = useCallback(function(node) {
|
|
@@ -71,7 +71,7 @@ var focusManager = new FocusManager();
|
|
|
71
71
|
if (!active) {
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
-
var handleKeyDown = function(event) {
|
|
74
|
+
var handleKeyDown = function handleKeyDown(event) {
|
|
75
75
|
if (event.key === 'Tab' && ref.current) {
|
|
76
76
|
scopeTab(ref.current, event);
|
|
77
77
|
}
|
package/es/hooks/useForkRef.js
CHANGED
|
@@ -5,7 +5,7 @@ import { setRef } from '../utils';
|
|
|
5
5
|
* @param {React.Ref<T>} refOne
|
|
6
6
|
* @param {React.Ref<T>} refTwo
|
|
7
7
|
* @return {Function React.Ref}
|
|
8
|
-
*/ export var useForkRef = function(refOne, refTwo) {
|
|
8
|
+
*/ export var useForkRef = function useForkRef(refOne, refTwo) {
|
|
9
9
|
return React.useMemo(function() {
|
|
10
10
|
if (refOne == null && refTwo === null) {
|
|
11
11
|
return null;
|
|
@@ -4,7 +4,7 @@ import { useEffect } from 'react';
|
|
|
4
4
|
* @param {React.Ref<T>} ref - реф элемента, за которым нужно следить
|
|
5
5
|
* @callback callback - функция, которая вызывается при изменении элемента
|
|
6
6
|
* @param {Element} element - элемент, размер которого изменился
|
|
7
|
-
*/ export var useResizeObserver = function(ref, callback) {
|
|
7
|
+
*/ export var useResizeObserver = function useResizeObserver(ref, callback) {
|
|
8
8
|
useEffect(function() {
|
|
9
9
|
/* istanbul ignore if: убираем проверку на рефы из покрытия */ if (!(ref === null || ref === void 0 ? void 0 : ref.current)) {
|
|
10
10
|
return;
|
package/es/mixins/addFocus.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css } from 'styled-components';
|
|
2
2
|
import { buttonFocused } from '../tokens';
|
|
3
3
|
import 'focus-visible';
|
|
4
|
-
export var syntheticFocus = function(ruleset, focused) {
|
|
4
|
+
export var syntheticFocus = function syntheticFocus(ruleset, focused) {
|
|
5
5
|
return css([
|
|
6
6
|
"&.focus-visible:focus,&[data-focus-visible-added]{outline:none;",
|
|
7
7
|
"}",
|
|
@@ -27,7 +27,7 @@ export var syntheticFocus = function(ruleset, focused) {
|
|
|
27
27
|
* outlineRadius: '10em 1em',
|
|
28
28
|
* outlineColor: 'greenyellow',
|
|
29
29
|
* });
|
|
30
|
-
*/ export var addFocus = function(param) {
|
|
30
|
+
*/ export var addFocus = function addFocus(param) {
|
|
31
31
|
var lowPerformance = param.lowPerformance, focused = param.focused, _param_outlined = param.outlined, outlined = _param_outlined === void 0 ? true : _param_outlined, _param_outlineSize = param.outlineSize, outlineSize = _param_outlineSize === void 0 ? '0.125rem' : _param_outlineSize, _param_outlineOffset = param.outlineOffset, outlineOffset = _param_outlineOffset === void 0 ? outlineSize : _param_outlineOffset, _param_outlineColor = param.outlineColor, outlineColor = _param_outlineColor === void 0 ? buttonFocused : _param_outlineColor, _param_outlineRadius = param.outlineRadius, outlineRadius = _param_outlineRadius === void 0 ? 0 : _param_outlineRadius, _param_synthesizeFocus = param.synthesizeFocus, synthesizeFocus = _param_synthesizeFocus === void 0 ? syntheticFocus : _param_synthesizeFocus;
|
|
32
32
|
return outlined && css([
|
|
33
33
|
"position:relative;&::before{content:'';position:absolute;top:-",
|
|
@@ -4,7 +4,7 @@ var disabledCss = css([
|
|
|
4
4
|
]);
|
|
5
5
|
/**
|
|
6
6
|
* Миксин неактивной кнопки
|
|
7
|
-
*/ export var applyDisabled = function(param) {
|
|
7
|
+
*/ export var applyDisabled = function applyDisabled(param) {
|
|
8
8
|
var disabled = param.disabled, $disabled = param.$disabled;
|
|
9
9
|
return css([
|
|
10
10
|
"&:disabled{",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css } from 'styled-components';
|
|
2
|
-
export var applyMaxLines = function(param) {
|
|
2
|
+
export var applyMaxLines = function applyMaxLines(param) {
|
|
3
3
|
var maxLines = param.maxLines;
|
|
4
4
|
return maxLines && css([
|
|
5
5
|
"display:-webkit-box;overflow:hidden;box-sizing:border-box;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css } from 'styled-components';
|
|
2
|
-
export var applyOutline = function() {
|
|
2
|
+
export var applyOutline = function applyOutline() {
|
|
3
3
|
return css([
|
|
4
4
|
"position:relative;&::before{content:'';position:absolute;top:var(--plasma-outline-offset);left:var(--plasma-outline-offset);right:var(--plasma-outline-offset);bottom:var(--plasma-outline-offset);display:block;box-sizing:border-box;border:var(--plasma-outline-offset) solid transparent;border-radius:var(--plasma-outline-radius);transition:box-shadow 0.2s ease-in-out;pointer-events:none;}&:focus::before{box-shadow:0 0 0 var(--plasma-outline-size) var(--plasma-outline-radius);}"
|
|
5
5
|
]);
|
|
@@ -16,7 +16,7 @@ import { css } from 'styled-components';
|
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* Миксин скругленности.
|
|
19
|
-
*/ export var applyRoundness = function(param) {
|
|
19
|
+
*/ export var applyRoundness = function applyRoundness(param) {
|
|
20
20
|
var roundness = param.roundness;
|
|
21
21
|
return css([
|
|
22
22
|
"border-radius:",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css } from 'styled-components';
|
|
2
|
-
export var applyScrollSnap = function(param) {
|
|
2
|
+
export var applyScrollSnap = function applyScrollSnap(param) {
|
|
3
3
|
var scrollSnapAlign = param.scrollSnapAlign, scrollSnapStop = param.scrollSnapStop;
|
|
4
4
|
return scrollSnapAlign && css([
|
|
5
5
|
"scroll-snap-align:",
|
|
@@ -3,7 +3,7 @@ import { skeletonGradient, skeletonGradientLighter } from '../tokens';
|
|
|
3
3
|
var loading = keyframes([
|
|
4
4
|
"from{transform:translateX(0);}to{transform:translateX(100vw);}"
|
|
5
5
|
]);
|
|
6
|
-
export var applySkeletonGradient = function(param) {
|
|
6
|
+
export var applySkeletonGradient = function applySkeletonGradient(param) {
|
|
7
7
|
var lighter = param.lighter;
|
|
8
8
|
return css([
|
|
9
9
|
"position:relative;overflow:hidden;z-index:1;&::before{content:'';position:absolute;animation:",
|
package/es/mixins/applyView.js
CHANGED
|
@@ -43,7 +43,7 @@ import { accent, white, text, buttonAccent, buttonSecondary, buttonSuccess, butt
|
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
45
|
* Миксин для применения общих цветовых стилей.
|
|
46
|
-
*/ export var applyView = function(param) {
|
|
46
|
+
*/ export var applyView = function applyView(param) {
|
|
47
47
|
var view = param.view;
|
|
48
48
|
return views[view];
|
|
49
49
|
};
|
package/es/mixins/blur.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var DEFAULT_DURATION = 300;
|
|
2
2
|
// https://css-tricks.com/emulating-css-timing-functions-javascript/
|
|
3
3
|
var tfs = {
|
|
4
|
-
linear: function(t) {
|
|
4
|
+
linear: function linear(t) {
|
|
5
5
|
return t;
|
|
6
6
|
},
|
|
7
7
|
// eslint-disable-next-line
|
|
8
|
-
easeIn: function(t) {
|
|
8
|
+
easeIn: function easeIn(t) {
|
|
9
9
|
return Math.pow(t, 1.675);
|
|
10
10
|
},
|
|
11
11
|
// eslint-disable-next-line
|
|
12
|
-
easeOut: function(t) {
|
|
12
|
+
easeOut: function easeOut(t) {
|
|
13
13
|
return 1 - Math.pow(1 - t, 1.675);
|
|
14
14
|
},
|
|
15
|
-
easeInOut: function(t) {
|
|
15
|
+
easeInOut: function easeInOut(t) {
|
|
16
16
|
return 0.5 * (Math.sin((t - 0.5) * Math.PI) + 1);
|
|
17
17
|
}
|
|
18
18
|
};
|
|
@@ -22,12 +22,12 @@ var tfs = {
|
|
|
22
22
|
* @param {number} pos
|
|
23
23
|
* @param {number} duration
|
|
24
24
|
* @param {string} timingFunction
|
|
25
|
-
*/ export var animatedScrollToX = function(elem, pos) {
|
|
25
|
+
*/ export var animatedScrollToX = function animatedScrollToX(elem, pos) {
|
|
26
26
|
var duration = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : DEFAULT_DURATION, timingFunction = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 'easeInOut';
|
|
27
27
|
var startTime;
|
|
28
28
|
var startX = elem.scrollLeft;
|
|
29
29
|
var endX = Math.max(0, Math.min(elem.scrollWidth - elem.clientWidth, pos));
|
|
30
|
-
var handleNewAnimationFrame = function() {
|
|
30
|
+
var handleNewAnimationFrame = function handleNewAnimationFrame1() {
|
|
31
31
|
startTime = startTime || Date.now();
|
|
32
32
|
var timePos = Math.min(1, Math.max(1, Date.now() - startTime) / duration);
|
|
33
33
|
var scrollPos = tfs[timingFunction](timePos);
|
|
@@ -45,12 +45,12 @@ var tfs = {
|
|
|
45
45
|
* @param {number} pos
|
|
46
46
|
* @param {number} duration
|
|
47
47
|
* @param {string} timingFunction
|
|
48
|
-
*/ export var animatedScrollToY = function(elem, pos) {
|
|
48
|
+
*/ export var animatedScrollToY = function animatedScrollToY(elem, pos) {
|
|
49
49
|
var duration = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : DEFAULT_DURATION, timingFunction = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 'easeInOut';
|
|
50
50
|
var startTime;
|
|
51
51
|
var startY = elem.scrollTop;
|
|
52
52
|
var endY = Math.max(0, Math.min(elem.scrollHeight - elem.clientHeight, pos));
|
|
53
|
-
var handleNewAnimationFrame = function() {
|
|
53
|
+
var handleNewAnimationFrame = function handleNewAnimationFrame1() {
|
|
54
54
|
startTime = startTime || Date.now();
|
|
55
55
|
var timePos = Math.min(1, Math.max(1, Date.now() - startTime) / duration);
|
|
56
56
|
var scrollPos = tfs[timingFunction](timePos);
|
|
@@ -3,7 +3,7 @@ function _type_of(obj) {
|
|
|
3
3
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
4
4
|
}
|
|
5
5
|
import { isValidElement, Children } from 'react';
|
|
6
|
-
export var extractTextFrom = function(textSource) {
|
|
6
|
+
export var extractTextFrom = function extractTextFrom1(textSource) {
|
|
7
7
|
switch(typeof textSource === "undefined" ? "undefined" : _type_of(textSource)){
|
|
8
8
|
case 'string':
|
|
9
9
|
return textSource;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param {string} currency
|
|
5
5
|
* @param {number} minimumFractionDigits
|
|
6
6
|
* @return {string}
|
|
7
|
-
*/ export var formatCurrency = function(value, currency, minimumFractionDigits) {
|
|
7
|
+
*/ export var formatCurrency = function formatCurrency(value, currency, minimumFractionDigits) {
|
|
8
8
|
var formatter = new Intl.NumberFormat('ru', {
|
|
9
9
|
style: 'currency',
|
|
10
10
|
currency: currency,
|
package/es/utils/formatters.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export var last = function(array) {
|
|
1
|
+
export var last = function last(array) {
|
|
2
2
|
return array[array.length - 1];
|
|
3
3
|
};
|
|
4
|
-
export var padZeroNumber = function(value) {
|
|
4
|
+
export var padZeroNumber = function padZeroNumber(value) {
|
|
5
5
|
return "".concat(value).padStart(2, '0');
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
@@ -11,16 +11,16 @@ export var padZeroNumber = function(value) {
|
|
|
11
11
|
* Так же результат выполнения метода `formatToParts` является массивом,
|
|
12
12
|
* в котором находятся части даты, форматированной на основнии `options`.
|
|
13
13
|
* То есть в данном случае вернется массив [`day`, `separator`, `month`]
|
|
14
|
-
*/ export var monthName = function(val, monthFormat) {
|
|
14
|
+
*/ export var monthName = function monthName(val, monthFormat) {
|
|
15
15
|
var targetMonth = new Date(2000, val, 1);
|
|
16
16
|
return last(new Intl.DateTimeFormat('ru-RU', {
|
|
17
17
|
day: 'numeric',
|
|
18
18
|
month: monthFormat
|
|
19
19
|
}).formatToParts(targetMonth)).value;
|
|
20
20
|
};
|
|
21
|
-
export var monthLongName = function(val) {
|
|
21
|
+
export var monthLongName = function monthLongName(val) {
|
|
22
22
|
return monthName(val, 'long');
|
|
23
23
|
};
|
|
24
|
-
export var monthShortName = function(val) {
|
|
24
|
+
export var monthShortName = function monthShortName(val) {
|
|
25
25
|
return monthName(val, 'short').replace('.', '');
|
|
26
26
|
};
|
package/es/utils/roundness.js
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* @example
|
|
24
24
|
* // Выведет значение для border-radius, равное '1em 2em 2em 1em'
|
|
25
25
|
* convertPinsMatrix('r h h r', '1em', '2em');
|
|
26
|
-
*/ export var convertRoundnessMatrix = function(matrixKey, r, h) {
|
|
26
|
+
*/ export var convertRoundnessMatrix = function convertRoundnessMatrix(matrixKey, r, h) {
|
|
27
27
|
return matrixKey && pins[matrixKey].split(' ').map(function(char) {
|
|
28
28
|
switch(char){
|
|
29
29
|
case 'r':
|
package/es/utils/scopeTab.js
CHANGED
|
@@ -3,7 +3,7 @@ import { findTabbableDescendants } from './tabbable';
|
|
|
3
3
|
* Управлление фокусом лишь внутри ноды через tab
|
|
4
4
|
* @param node
|
|
5
5
|
* @param event
|
|
6
|
-
*/ export var scopeTab = function(node, event) {
|
|
6
|
+
*/ export var scopeTab = function scopeTab(node, event) {
|
|
7
7
|
var tabbable = findTabbableDescendants(node);
|
|
8
8
|
if (!tabbable.length) {
|
|
9
9
|
event.preventDefault();
|
package/es/utils/setRef.js
CHANGED
package/es/utils/tabbable.js
CHANGED
|
@@ -18,10 +18,10 @@ export var focusSelector = [
|
|
|
18
18
|
'video[controls]',
|
|
19
19
|
'[contenteditable]:not([contenteditable="false"])'
|
|
20
20
|
].join(',');
|
|
21
|
-
var isHidden = function(el) {
|
|
21
|
+
var isHidden = function isHidden(el) {
|
|
22
22
|
return el.offsetWidth <= 0 && el.offsetHeight <= 0 || el.style.display === 'none' || el.style.visibility === 'hidden' || el.style.opacity === '0';
|
|
23
23
|
};
|
|
24
|
-
export var isVisible = function(element, parentContainer) {
|
|
24
|
+
export var isVisible = function isVisible(element, parentContainer) {
|
|
25
25
|
var parentElement = element;
|
|
26
26
|
while(parentElement){
|
|
27
27
|
if (parentElement === parentContainer || parentElement === document.body) {
|
|
@@ -34,23 +34,23 @@ export var isVisible = function(element, parentContainer) {
|
|
|
34
34
|
}
|
|
35
35
|
return true;
|
|
36
36
|
};
|
|
37
|
-
var getElementTabIndex = function(element) {
|
|
37
|
+
var getElementTabIndex = function getElementTabIndex(element) {
|
|
38
38
|
var tabIndex = element.getAttribute('tabindex');
|
|
39
39
|
return tabIndex === null ? NaN : parseInt(tabIndex, 10);
|
|
40
40
|
};
|
|
41
|
-
export var isFocusable = function(element, parentContainer) {
|
|
41
|
+
export var isFocusable = function isFocusable(element, parentContainer) {
|
|
42
42
|
var nodeName = element.nodeName.toLowerCase();
|
|
43
43
|
var isTabIndexNotNaN = !Number.isNaN(getElementTabIndex(element));
|
|
44
44
|
var res = tabbableNode.test(nodeName) && !element.disabled || (_instanceof(element, HTMLAnchorElement) ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);
|
|
45
45
|
return Boolean(res) && isVisible(element, parentContainer);
|
|
46
46
|
};
|
|
47
|
-
export var isTabble = function(element, parentContainer) {
|
|
47
|
+
export var isTabble = function isTabble(element, parentContainer) {
|
|
48
48
|
var tabIndex = getElementTabIndex(element);
|
|
49
49
|
var isTabIndexNaN = Number.isNaN(tabIndex);
|
|
50
50
|
return (isTabIndexNaN || tabIndex >= 0) && isFocusable(element, parentContainer);
|
|
51
51
|
};
|
|
52
52
|
// Все элементы внутри данной ноды, до которых можно добраться табом
|
|
53
|
-
export var findTabbableDescendants = function(element) {
|
|
53
|
+
export var findTabbableDescendants = function findTabbableDescendants(element) {
|
|
54
54
|
return Array.from(element.querySelectorAll(focusSelector)).filter(function(el) {
|
|
55
55
|
return isTabble(el, element);
|
|
56
56
|
});
|
package/es/utils/toCssSize.js
CHANGED