@salutejs/plasma-core 1.214.0-canary.2452.21584026956.0 → 1.214.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/.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
|
@@ -46,10 +46,10 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
46
46
|
}
|
|
47
47
|
var uppercaseCheck = /([A-Z])/;
|
|
48
48
|
var uppercasePattern = /([A-Z])/g;
|
|
49
|
-
var prefixAndLowerCase = function(char) {
|
|
49
|
+
var prefixAndLowerCase = function prefixAndLowerCase(char) {
|
|
50
50
|
return "-".concat(char.toLowerCase());
|
|
51
51
|
};
|
|
52
|
-
var hyphenate = function(str) {
|
|
52
|
+
var hyphenate = function hyphenate(str) {
|
|
53
53
|
return uppercaseCheck.test(str) ? str.replace(uppercasePattern, prefixAndLowerCase) : str;
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
@@ -57,7 +57,7 @@ var hyphenate = function(str) {
|
|
|
57
57
|
* оставляя значения как есть (например, не добавляя "px" к числам),
|
|
58
58
|
* а ключи переводя в kebab-case.
|
|
59
59
|
* Подходит для подготовки типографической темы.
|
|
60
|
-
*/ export var transformStyles = function(styles) {
|
|
60
|
+
*/ export var transformStyles = function transformStyles(styles) {
|
|
61
61
|
return Object.entries(styles).map(function(param) {
|
|
62
62
|
var _param = _sliced_to_array(param, 2), key = _param[0], value = _param[1];
|
|
63
63
|
return "".concat(hyphenate(key), ": ").concat(value);
|
package/hocs/withAutoFocus.js
CHANGED
|
@@ -80,12 +80,22 @@ function _object_spread(target) {
|
|
|
80
80
|
}
|
|
81
81
|
function _object_without_properties(source, excluded) {
|
|
82
82
|
if (source == null) return {};
|
|
83
|
-
var target =
|
|
84
|
-
|
|
83
|
+
var target = {}, sourceKeys, key, i;
|
|
84
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
85
|
+
sourceKeys = Reflect.ownKeys(source);
|
|
86
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
87
|
+
key = sourceKeys[i];
|
|
88
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
89
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
90
|
+
target[key] = source[key];
|
|
91
|
+
}
|
|
92
|
+
return target;
|
|
93
|
+
}
|
|
94
|
+
target = _object_without_properties_loose(source, excluded);
|
|
85
95
|
if (Object.getOwnPropertySymbols) {
|
|
86
|
-
|
|
87
|
-
for(i = 0; i <
|
|
88
|
-
key =
|
|
96
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
97
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
98
|
+
key = sourceKeys[i];
|
|
89
99
|
if (excluded.indexOf(key) >= 0) continue;
|
|
90
100
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
91
101
|
target[key] = source[key];
|
|
@@ -95,19 +105,18 @@ function _object_without_properties(source, excluded) {
|
|
|
95
105
|
}
|
|
96
106
|
function _object_without_properties_loose(source, excluded) {
|
|
97
107
|
if (source == null) return {};
|
|
98
|
-
var target = {};
|
|
99
|
-
var sourceKeys = Object.keys(source);
|
|
100
|
-
var key, i;
|
|
108
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
101
109
|
for(i = 0; i < sourceKeys.length; i++){
|
|
102
110
|
key = sourceKeys[i];
|
|
103
111
|
if (excluded.indexOf(key) >= 0) continue;
|
|
112
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
104
113
|
target[key] = source[key];
|
|
105
114
|
}
|
|
106
115
|
return target;
|
|
107
116
|
}
|
|
108
|
-
var withAutoFocus = function(Component) {
|
|
109
|
-
return function(
|
|
110
|
-
var autoFocus =
|
|
117
|
+
var withAutoFocus = function withAutoFocus(Component) {
|
|
118
|
+
return function(_0) {
|
|
119
|
+
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, [
|
|
111
120
|
"autoFocus",
|
|
112
121
|
"tabIndex",
|
|
113
122
|
"preventScroll"
|
package/hocs/withSkeleton.js
CHANGED
|
@@ -16,7 +16,7 @@ function _interop_require_default(obj) {
|
|
|
16
16
|
default: obj
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
var withSkeleton = function(Component) {
|
|
19
|
+
var withSkeleton = function withSkeleton(Component) {
|
|
20
20
|
return (0, _styledcomponents.default)(Component).withConfig({
|
|
21
21
|
displayName: "withSkeleton",
|
|
22
22
|
componentId: "sc-764f817c-0"
|
package/hooks/useFocusTrap.js
CHANGED
|
@@ -13,7 +13,7 @@ var _focusManager = require("../utils/focusManager");
|
|
|
13
13
|
var _tabbable = require("../utils/tabbable");
|
|
14
14
|
var _scopeTab = require("../utils/scopeTab");
|
|
15
15
|
// Находим элемент для фокуса
|
|
16
|
-
var getFocusElement = function(node, firstFocusSelector) {
|
|
16
|
+
var getFocusElement = function getFocusElement(node, firstFocusSelector) {
|
|
17
17
|
var focusElement = null;
|
|
18
18
|
if (firstFocusSelector) {
|
|
19
19
|
if (typeof firstFocusSelector === 'string') {
|
|
@@ -34,7 +34,7 @@ var getFocusElement = function(node, firstFocusSelector) {
|
|
|
34
34
|
}
|
|
35
35
|
return focusElement;
|
|
36
36
|
};
|
|
37
|
-
var processNode = function(node, firstFocusSelector, ref) {
|
|
37
|
+
var processNode = function processNode1(node, firstFocusSelector, ref) {
|
|
38
38
|
if (ref === null || ref === void 0 ? void 0 : ref.current) {
|
|
39
39
|
ref.current.removeEventListener('animationend', function() {
|
|
40
40
|
processNode(node, firstFocusSelector, ref);
|
|
@@ -46,7 +46,7 @@ var processNode = function(node, firstFocusSelector, ref) {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
var focusManager = new _focusManager.FocusManager();
|
|
49
|
-
var useFocusTrap = function() {
|
|
49
|
+
var useFocusTrap = function useFocusTrap() {
|
|
50
50
|
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;
|
|
51
51
|
var ref = (0, _react.useRef)();
|
|
52
52
|
var setRef = (0, _react.useCallback)(function(node) {
|
|
@@ -79,7 +79,7 @@ var useFocusTrap = function() {
|
|
|
79
79
|
if (!active) {
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
-
var handleKeyDown = function(event) {
|
|
82
|
+
var handleKeyDown = function handleKeyDown(event) {
|
|
83
83
|
if (event.key === 'Tab' && ref.current) {
|
|
84
84
|
(0, _scopeTab.scopeTab)(ref.current, event);
|
|
85
85
|
}
|
package/hooks/useForkRef.js
CHANGED
|
@@ -15,7 +15,7 @@ function _interop_require_default(obj) {
|
|
|
15
15
|
default: obj
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
var useForkRef = function(refOne, refTwo) {
|
|
18
|
+
var useForkRef = function useForkRef(refOne, refTwo) {
|
|
19
19
|
return _react.default.useMemo(function() {
|
|
20
20
|
if (refOne == null && refTwo === null) {
|
|
21
21
|
return null;
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "useResizeObserver", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _react = require("react");
|
|
12
|
-
var useResizeObserver = function(ref, callback) {
|
|
12
|
+
var useResizeObserver = function useResizeObserver(ref, callback) {
|
|
13
13
|
(0, _react.useEffect)(function() {
|
|
14
14
|
/* istanbul ignore if: убираем проверку на рефы из покрытия */ if (!(ref === null || ref === void 0 ? void 0 : ref.current)) {
|
|
15
15
|
return;
|
package/mixins/addFocus.js
CHANGED
|
@@ -19,14 +19,14 @@ _export(exports, {
|
|
|
19
19
|
var _styledcomponents = require("styled-components");
|
|
20
20
|
var _tokens = require("../tokens");
|
|
21
21
|
require("focus-visible");
|
|
22
|
-
var syntheticFocus = function(ruleset, focused) {
|
|
22
|
+
var syntheticFocus = function syntheticFocus(ruleset, focused) {
|
|
23
23
|
return (0, _styledcomponents.css)([
|
|
24
24
|
"&.focus-visible:focus,&[data-focus-visible-added]{outline:none;",
|
|
25
25
|
"}",
|
|
26
26
|
";"
|
|
27
27
|
], ruleset, focused && ruleset);
|
|
28
28
|
};
|
|
29
|
-
var addFocus = function(param) {
|
|
29
|
+
var addFocus = function addFocus(param) {
|
|
30
30
|
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 ? _tokens.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;
|
|
31
31
|
return outlined && (0, _styledcomponents.css)([
|
|
32
32
|
"position:relative;&::before{content:'';position:absolute;top:-",
|
package/mixins/applyDisabled.js
CHANGED
|
@@ -12,7 +12,7 @@ var _styledcomponents = require("styled-components");
|
|
|
12
12
|
var disabledCss = (0, _styledcomponents.css)([
|
|
13
13
|
"opacity:0.4;cursor:not-allowed;&:hover,&:active{transform:none;}"
|
|
14
14
|
]);
|
|
15
|
-
var applyDisabled = function(param) {
|
|
15
|
+
var applyDisabled = function applyDisabled(param) {
|
|
16
16
|
var disabled = param.disabled, $disabled = param.$disabled;
|
|
17
17
|
return (0, _styledcomponents.css)([
|
|
18
18
|
"&:disabled{",
|
package/mixins/applyEllipsis.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "applyEllipsis", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _styledcomponents = require("styled-components");
|
|
12
|
-
var applyEllipsis = function() {
|
|
12
|
+
var applyEllipsis = function applyEllipsis() {
|
|
13
13
|
return (0, _styledcomponents.css)([
|
|
14
14
|
"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"
|
|
15
15
|
]);
|
package/mixins/applyMaxLines.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "applyMaxLines", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _styledcomponents = require("styled-components");
|
|
12
|
-
var applyMaxLines = function(param) {
|
|
12
|
+
var applyMaxLines = function applyMaxLines(param) {
|
|
13
13
|
var maxLines = param.maxLines;
|
|
14
14
|
return maxLines && (0, _styledcomponents.css)([
|
|
15
15
|
"display:-webkit-box;overflow:hidden;box-sizing:border-box;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:",
|
package/mixins/applyNoSelect.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "applyNoSelect", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _styledcomponents = require("styled-components");
|
|
12
|
-
var applyNoSelect = function() {
|
|
12
|
+
var applyNoSelect = function applyNoSelect() {
|
|
13
13
|
return (0, _styledcomponents.css)([
|
|
14
14
|
"user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);"
|
|
15
15
|
]);
|
package/mixins/applyOutline.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "applyOutline", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _styledcomponents = require("styled-components");
|
|
12
|
-
var applyOutline = function() {
|
|
12
|
+
var applyOutline = function applyOutline() {
|
|
13
13
|
return (0, _styledcomponents.css)([
|
|
14
14
|
"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);}"
|
|
15
15
|
]);
|
package/mixins/applyRoundness.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "applyScrollSnap", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _styledcomponents = require("styled-components");
|
|
12
|
-
var applyScrollSnap = function(param) {
|
|
12
|
+
var applyScrollSnap = function applyScrollSnap(param) {
|
|
13
13
|
var scrollSnapAlign = param.scrollSnapAlign, scrollSnapStop = param.scrollSnapStop;
|
|
14
14
|
return scrollSnapAlign && (0, _styledcomponents.css)([
|
|
15
15
|
"scroll-snap-align:",
|
|
@@ -13,7 +13,7 @@ var _tokens = require("../tokens");
|
|
|
13
13
|
var loading = (0, _styledcomponents.keyframes)([
|
|
14
14
|
"from{transform:translateX(0);}to{transform:translateX(100vw);}"
|
|
15
15
|
]);
|
|
16
|
-
var applySkeletonGradient = function(param) {
|
|
16
|
+
var applySkeletonGradient = function applySkeletonGradient(param) {
|
|
17
17
|
var lighter = param.lighter;
|
|
18
18
|
return (0, _styledcomponents.css)([
|
|
19
19
|
"position:relative;overflow:hidden;z-index:1;&::before{content:'';position:absolute;animation:",
|
package/mixins/applyView.js
CHANGED
package/mixins/blur.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salutejs/plasma-core",
|
|
3
|
-
"version": "1.214.0-
|
|
3
|
+
"version": "1.214.0-dev.0",
|
|
4
4
|
"description": "Core library for Plasma: Salute Design System.",
|
|
5
5
|
"author": "Salute Frontend Team <salute.developers@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@babel/preset-react": "7.24.1",
|
|
25
25
|
"@babel/preset-typescript": "7.24.1",
|
|
26
26
|
"@microsoft/api-extractor": "7.38.3",
|
|
27
|
-
"@salutejs/plasma-cy-utils": "0.144.0-
|
|
27
|
+
"@salutejs/plasma-cy-utils": "0.144.0-dev.0",
|
|
28
28
|
"@types/jest": "27.0.1",
|
|
29
29
|
"@types/lodash.throttle": "4.1.6",
|
|
30
30
|
"@types/node": "15.14.9",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"Зубаиров Фаниль Асхатович"
|
|
81
81
|
],
|
|
82
82
|
"sideEffects": false,
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "8aa9623399b7ecac16e7657b3d8f006777a7294f"
|
|
84
84
|
}
|
|
@@ -19,27 +19,27 @@ _export(exports, {
|
|
|
19
19
|
var DEFAULT_DURATION = 300;
|
|
20
20
|
// https://css-tricks.com/emulating-css-timing-functions-javascript/
|
|
21
21
|
var tfs = {
|
|
22
|
-
linear: function(t) {
|
|
22
|
+
linear: function linear(t) {
|
|
23
23
|
return t;
|
|
24
24
|
},
|
|
25
25
|
// eslint-disable-next-line
|
|
26
|
-
easeIn: function(t) {
|
|
26
|
+
easeIn: function easeIn(t) {
|
|
27
27
|
return Math.pow(t, 1.675);
|
|
28
28
|
},
|
|
29
29
|
// eslint-disable-next-line
|
|
30
|
-
easeOut: function(t) {
|
|
30
|
+
easeOut: function easeOut(t) {
|
|
31
31
|
return 1 - Math.pow(1 - t, 1.675);
|
|
32
32
|
},
|
|
33
|
-
easeInOut: function(t) {
|
|
33
|
+
easeInOut: function easeInOut(t) {
|
|
34
34
|
return 0.5 * (Math.sin((t - 0.5) * Math.PI) + 1);
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
var animatedScrollToX = function(elem, pos) {
|
|
37
|
+
var animatedScrollToX = function animatedScrollToX(elem, pos) {
|
|
38
38
|
var duration = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : DEFAULT_DURATION, timingFunction = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 'easeInOut';
|
|
39
39
|
var startTime;
|
|
40
40
|
var startX = elem.scrollLeft;
|
|
41
41
|
var endX = Math.max(0, Math.min(elem.scrollWidth - elem.clientWidth, pos));
|
|
42
|
-
var handleNewAnimationFrame = function() {
|
|
42
|
+
var handleNewAnimationFrame = function handleNewAnimationFrame1() {
|
|
43
43
|
startTime = startTime || Date.now();
|
|
44
44
|
var timePos = Math.min(1, Math.max(1, Date.now() - startTime) / duration);
|
|
45
45
|
var scrollPos = tfs[timingFunction](timePos);
|
|
@@ -51,12 +51,12 @@ var animatedScrollToX = function(elem, pos) {
|
|
|
51
51
|
};
|
|
52
52
|
window.requestAnimationFrame(handleNewAnimationFrame);
|
|
53
53
|
};
|
|
54
|
-
var animatedScrollToY = function(elem, pos) {
|
|
54
|
+
var animatedScrollToY = function animatedScrollToY(elem, pos) {
|
|
55
55
|
var duration = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : DEFAULT_DURATION, timingFunction = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 'easeInOut';
|
|
56
56
|
var startTime;
|
|
57
57
|
var startY = elem.scrollTop;
|
|
58
58
|
var endY = Math.max(0, Math.min(elem.scrollHeight - elem.clientHeight, pos));
|
|
59
|
-
var handleNewAnimationFrame = function() {
|
|
59
|
+
var handleNewAnimationFrame = function handleNewAnimationFrame1() {
|
|
60
60
|
startTime = startTime || Date.now();
|
|
61
61
|
var timePos = Math.min(1, Math.max(1, Date.now() - startTime) / duration);
|
|
62
62
|
var scrollPos = tfs[timingFunction](timePos);
|
package/utils/extractTextFrom.js
CHANGED
|
@@ -13,7 +13,7 @@ function _type_of(obj) {
|
|
|
13
13
|
"@swc/helpers - typeof";
|
|
14
14
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
15
15
|
}
|
|
16
|
-
var extractTextFrom = function(textSource) {
|
|
16
|
+
var extractTextFrom = function extractTextFrom1(textSource) {
|
|
17
17
|
switch(typeof textSource === "undefined" ? "undefined" : _type_of(textSource)){
|
|
18
18
|
case 'string':
|
|
19
19
|
return textSource;
|
package/utils/formatCurrency.js
CHANGED
|
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "formatCurrency", {
|
|
|
14
14
|
return formatCurrency;
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
var formatCurrency = function(value, currency, minimumFractionDigits) {
|
|
17
|
+
var formatCurrency = function formatCurrency(value, currency, minimumFractionDigits) {
|
|
18
18
|
var formatter = new Intl.NumberFormat('ru', {
|
|
19
19
|
style: 'currency',
|
|
20
20
|
currency: currency,
|
package/utils/formatters.js
CHANGED
|
@@ -25,22 +25,22 @@ _export(exports, {
|
|
|
25
25
|
return padZeroNumber;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
var last = function(array) {
|
|
28
|
+
var last = function last(array) {
|
|
29
29
|
return array[array.length - 1];
|
|
30
30
|
};
|
|
31
|
-
var padZeroNumber = function(value) {
|
|
31
|
+
var padZeroNumber = function padZeroNumber(value) {
|
|
32
32
|
return "".concat(value).padStart(2, '0');
|
|
33
33
|
};
|
|
34
|
-
var monthName = function(val, monthFormat) {
|
|
34
|
+
var monthName = function monthName(val, monthFormat) {
|
|
35
35
|
var targetMonth = new Date(2000, val, 1);
|
|
36
36
|
return last(new Intl.DateTimeFormat('ru-RU', {
|
|
37
37
|
day: 'numeric',
|
|
38
38
|
month: monthFormat
|
|
39
39
|
}).formatToParts(targetMonth)).value;
|
|
40
40
|
};
|
|
41
|
-
var monthLongName = function(val) {
|
|
41
|
+
var monthLongName = function monthLongName(val) {
|
|
42
42
|
return monthName(val, 'long');
|
|
43
43
|
};
|
|
44
|
-
var monthShortName = function(val) {
|
|
44
|
+
var monthShortName = function monthShortName(val) {
|
|
45
45
|
return monthName(val, 'short').replace('.', '');
|
|
46
46
|
};
|
package/utils/roundness.js
CHANGED
|
@@ -30,7 +30,7 @@ var pins = {
|
|
|
30
30
|
'circle-clear': 'h 0 0 h',
|
|
31
31
|
'circle-circle': 'h'
|
|
32
32
|
};
|
|
33
|
-
var convertRoundnessMatrix = function(matrixKey, r, h) {
|
|
33
|
+
var convertRoundnessMatrix = function convertRoundnessMatrix(matrixKey, r, h) {
|
|
34
34
|
return matrixKey && pins[matrixKey].split(' ').map(function(char) {
|
|
35
35
|
switch(char){
|
|
36
36
|
case 'r':
|
package/utils/scopeTab.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "scopeTab", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _tabbable = require("./tabbable");
|
|
12
|
-
var scopeTab = function(node, event) {
|
|
12
|
+
var scopeTab = function scopeTab(node, event) {
|
|
13
13
|
var tabbable = (0, _tabbable.findTabbableDescendants)(node);
|
|
14
14
|
if (!tabbable.length) {
|
|
15
15
|
event.preventDefault();
|
package/utils/setRef.js
CHANGED
package/utils/tabbable.js
CHANGED
|
@@ -45,10 +45,10 @@ var focusSelector = [
|
|
|
45
45
|
'video[controls]',
|
|
46
46
|
'[contenteditable]:not([contenteditable="false"])'
|
|
47
47
|
].join(',');
|
|
48
|
-
var isHidden = function(el) {
|
|
48
|
+
var isHidden = function isHidden(el) {
|
|
49
49
|
return el.offsetWidth <= 0 && el.offsetHeight <= 0 || el.style.display === 'none' || el.style.visibility === 'hidden' || el.style.opacity === '0';
|
|
50
50
|
};
|
|
51
|
-
var isVisible = function(element, parentContainer) {
|
|
51
|
+
var isVisible = function isVisible(element, parentContainer) {
|
|
52
52
|
var parentElement = element;
|
|
53
53
|
while(parentElement){
|
|
54
54
|
if (parentElement === parentContainer || parentElement === document.body) {
|
|
@@ -61,22 +61,22 @@ var isVisible = function(element, parentContainer) {
|
|
|
61
61
|
}
|
|
62
62
|
return true;
|
|
63
63
|
};
|
|
64
|
-
var getElementTabIndex = function(element) {
|
|
64
|
+
var getElementTabIndex = function getElementTabIndex(element) {
|
|
65
65
|
var tabIndex = element.getAttribute('tabindex');
|
|
66
66
|
return tabIndex === null ? NaN : parseInt(tabIndex, 10);
|
|
67
67
|
};
|
|
68
|
-
var isFocusable = function(element, parentContainer) {
|
|
68
|
+
var isFocusable = function isFocusable(element, parentContainer) {
|
|
69
69
|
var nodeName = element.nodeName.toLowerCase();
|
|
70
70
|
var isTabIndexNotNaN = !Number.isNaN(getElementTabIndex(element));
|
|
71
71
|
var res = tabbableNode.test(nodeName) && !element.disabled || (_instanceof(element, HTMLAnchorElement) ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);
|
|
72
72
|
return Boolean(res) && isVisible(element, parentContainer);
|
|
73
73
|
};
|
|
74
|
-
var isTabble = function(element, parentContainer) {
|
|
74
|
+
var isTabble = function isTabble(element, parentContainer) {
|
|
75
75
|
var tabIndex = getElementTabIndex(element);
|
|
76
76
|
var isTabIndexNaN = Number.isNaN(tabIndex);
|
|
77
77
|
return (isTabIndexNaN || tabIndex >= 0) && isFocusable(element, parentContainer);
|
|
78
78
|
};
|
|
79
|
-
var findTabbableDescendants = function(element) {
|
|
79
|
+
var findTabbableDescendants = function findTabbableDescendants(element) {
|
|
80
80
|
return Array.from(element.querySelectorAll(focusSelector)).filter(function(el) {
|
|
81
81
|
return isTabble(el, element);
|
|
82
82
|
});
|
package/utils/toCssSize.js
CHANGED
package/utils/transformStyles.js
CHANGED
|
@@ -56,13 +56,13 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
56
56
|
}
|
|
57
57
|
var uppercaseCheck = /([A-Z])/;
|
|
58
58
|
var uppercasePattern = /([A-Z])/g;
|
|
59
|
-
var prefixAndLowerCase = function(char) {
|
|
59
|
+
var prefixAndLowerCase = function prefixAndLowerCase(char) {
|
|
60
60
|
return "-".concat(char.toLowerCase());
|
|
61
61
|
};
|
|
62
|
-
var hyphenate = function(str) {
|
|
62
|
+
var hyphenate = function hyphenate(str) {
|
|
63
63
|
return uppercaseCheck.test(str) ? str.replace(uppercasePattern, prefixAndLowerCase) : str;
|
|
64
64
|
};
|
|
65
|
-
var transformStyles = function(styles) {
|
|
65
|
+
var transformStyles = function transformStyles(styles) {
|
|
66
66
|
return Object.entries(styles).map(function(param) {
|
|
67
67
|
var _param = _sliced_to_array(param, 2), key = _param[0], value = _param[1];
|
|
68
68
|
return "".concat(hyphenate(key), ": ").concat(value);
|