@salutejs/plasma-new-hope 0.265.0-canary.1759.13297025461.0 → 0.265.0-dev.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/engines/linaria.js +4 -2
- package/cjs/engines/linaria.js.map +1 -1
- package/cjs/engines/utils.js +22 -0
- package/cjs/engines/utils.js.map +1 -1
- package/emotion/cjs/engines/emotion.js +9 -3
- package/emotion/cjs/engines/utils.js +26 -1
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +13 -14
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +1 -1
- package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.config.js +13 -14
- package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +1 -2
- package/emotion/es/engines/emotion.js +10 -4
- package/emotion/es/engines/utils.js +25 -0
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +13 -14
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +1 -1
- package/emotion/es/examples/plasma_web/components/TextArea/TextArea.config.js +13 -14
- package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +1 -2
- package/es/engines/linaria.js +5 -3
- package/es/engines/linaria.js.map +1 -1
- package/es/engines/utils.js +23 -2
- package/es/engines/utils.js.map +1 -1
- package/package.json +5 -5
- package/styled-components/cjs/engines/styled-components.js +9 -3
- package/styled-components/cjs/engines/utils.js +26 -1
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +1 -2
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.config.js +1 -2
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +1 -2
- package/styled-components/es/engines/styled-components.js +10 -4
- package/styled-components/es/engines/utils.js +25 -0
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +1 -2
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.config.js +1 -2
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +1 -2
- package/types/engines/emotion.d.ts.map +1 -1
- package/types/engines/linaria.d.ts.map +1 -1
- package/types/engines/styled-components.d.ts.map +1 -1
- package/types/engines/types.d.ts +4 -0
- package/types/engines/types.d.ts.map +1 -1
- package/types/engines/utils.d.ts +2 -1
- package/types/engines/utils.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts +0 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts +0 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/examples/plasma_web/components/TextArea/TextArea.config.d.ts +0 -1
- package/types/examples/plasma_web/components/TextArea/TextArea.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/TextArea/TextArea.d.ts +0 -1
- package/types/examples/plasma_web/components/TextArea/TextArea.d.ts.map +1 -1
@@ -13,8 +13,7 @@ import { config } from './TextArea.config';
|
|
13
13
|
import { TextArea } from './TextArea';
|
14
14
|
|
15
15
|
const labelPlacements = ['inner', 'outer'];
|
16
|
-
const sizes = ['xs', 's', 'm', 'l'
|
17
|
-
const views = ['default', 'positive', 'warning', 'negative'];
|
16
|
+
const sizes = ['xs', 's', 'm', 'l'];
|
18
17
|
const hintViews = ['default'];
|
19
18
|
const hintSizes = ['m', 's'];
|
20
19
|
const hintTriggers = ['hover', 'click'];
|
@@ -2,7 +2,7 @@ import _styled from "@emotion/styled/base";
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
3
|
import React, { forwardRef } from 'react';
|
4
4
|
import { css } from '@emotion/react';
|
5
|
-
import { getStaticVariants, getDynamicVariants } from './utils';
|
5
|
+
import { getStaticVariants, getDynamicVariants, getIntersectionStyles } from './utils';
|
6
6
|
export { css };
|
7
7
|
var Root = /*#__PURE__*/_styled("div", {
|
8
8
|
target: "ew8uqlo0",
|
@@ -16,12 +16,16 @@ var Root = /*#__PURE__*/_styled("div", {
|
|
16
16
|
}, ";", function (_ref3) {
|
17
17
|
var dynamicVariants = _ref3.dynamicVariants;
|
18
18
|
return dynamicVariants;
|
19
|
-
}, ";"
|
19
|
+
}, ";", function (_ref4) {
|
20
|
+
var intersectionStyles = _ref4.intersectionStyles;
|
21
|
+
return intersectionStyles;
|
22
|
+
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy1lbW90aW9uL2VuZ2luZXMvZW1vdGlvbi50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBY0UiLCJmaWxlIjoiLi4vLi4vLi4vc3JjLWVtb3Rpb24vZW5naW5lcy9lbW90aW9uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgY3NzLCBTZXJpYWxpemVkU3R5bGVzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5pbXBvcnQgeyBnZXRTdGF0aWNWYXJpYW50cywgZ2V0RHluYW1pY1ZhcmlhbnRzLCBnZXRJbnRlcnNlY3Rpb25TdHlsZXMgfSBmcm9tICcuL3V0aWxzJztcbmltcG9ydCB0eXBlIHsgQ29tcG9uZW50Q29uZmlnLCBIVE1MQW55QXR0cmlidXRlcyB9IGZyb20gJy4vdHlwZXMn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yBrZXlvZiBKU1guSW50cmluc2ljRWxlbWVudHMpO1xuXG4gICAgcmV0dXJuIGZvcndhcmRSZWY8SFRNTEVsZW1lbnQsIEhUTUxBbnlBdHRyaWJ1dGVzPigocHJvcHMsIHJlZikgPT4ge1xuICAgICAgICBjb25zdCBpbnRlcnNlY3Rpb25TdHlsZXMgPSBnZXRJbnRlcnNlY3Rpb25TdHlsZXMocHJvcHMsIGludGVyc2VjdGlvbnMpO1xuXG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICA8UlxuICAgICAgICAgICAgICAgIGJhc2U9e2Jhc2V9XG4gICAgICAgICAgICAgICAgc3RhdGljVmFyaWFudHM9e3N0YXRpY1ZhcmlhbnRzfVxuICAgICAgICAgICAgICAgIGR5bmFtaWNWYXJpYW50cz17ZHluYW1pY1ZhcmlhbnRzfVxuICAgICAgICAgICAgICAgIGludGVyc2VjdGlvblN0eWxlcz17aW50ZXJzZWN0aW9uU3R5bGVzfVxuICAgICAgICAgICAgICAgIHsuLi5wcm9wc31cbiAgICAgICAgICAgICAgICByZWY9e3JlZn1cbiAgICAgICAgICAgIC8+XG4gICAgICAgICk7XG4gICAgfSk7XG59O1xuIl19 */"));
|
20
23
|
|
21
24
|
/* eslint-disable no-underscore-dangle */
|
22
25
|
export var _component = function _component(componentConfig) {
|
23
26
|
var tag = componentConfig.tag,
|
24
|
-
base = componentConfig.base
|
27
|
+
base = componentConfig.base,
|
28
|
+
intersections = componentConfig.intersections;
|
25
29
|
var staticVariants = getStaticVariants(componentConfig);
|
26
30
|
var dynamicVariants = getDynamicVariants(componentConfig);
|
27
31
|
|
@@ -31,10 +35,12 @@ export var _component = function _component(componentConfig) {
|
|
31
35
|
label: "plasma-new-hope__R"
|
32
36
|
});
|
33
37
|
return /*#__PURE__*/forwardRef(function (props, ref) {
|
38
|
+
var intersectionStyles = getIntersectionStyles(props, intersections);
|
34
39
|
return /*#__PURE__*/React.createElement(R, _extends({
|
35
40
|
base: base,
|
36
41
|
staticVariants: staticVariants,
|
37
|
-
dynamicVariants: dynamicVariants
|
42
|
+
dynamicVariants: dynamicVariants,
|
43
|
+
intersectionStyles: intersectionStyles
|
38
44
|
}, props, {
|
39
45
|
ref: ref
|
40
46
|
}));
|
@@ -1,3 +1,7 @@
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
3
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
4
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
1
5
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
2
6
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
3
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
@@ -33,4 +37,25 @@ export var getDynamicVariants = function getDynamicVariants(config) {
|
|
33
37
|
}
|
34
38
|
return res;
|
35
39
|
};
|
40
|
+
};
|
41
|
+
export var getIntersectionStyles = function getIntersectionStyles(props, intersections) {
|
42
|
+
if (!intersections) {
|
43
|
+
return [];
|
44
|
+
}
|
45
|
+
return intersections.reduce(function (styles, item) {
|
46
|
+
var hasMatchStyle = Object.entries(item).filter(function (_ref) {
|
47
|
+
var _ref2 = _slicedToArray(_ref, 1),
|
48
|
+
key = _ref2[0];
|
49
|
+
return key !== 'style';
|
50
|
+
}).every(function (_ref3) {
|
51
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
52
|
+
key = _ref4[0],
|
53
|
+
value = _ref4[1];
|
54
|
+
return props[key] === value;
|
55
|
+
});
|
56
|
+
if (hasMatchStyle) {
|
57
|
+
styles.push(item.style);
|
58
|
+
}
|
59
|
+
return styles;
|
60
|
+
}, []);
|
36
61
|
};
|