@salutejs/plasma-new-hope 0.336.0-canary.2238.17818313113.0 → 0.336.0-canary.2239.17794430722.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/cjs/components/Attach/Attach.css +7 -9
- package/cjs/components/Attach/Attach.js +59 -13
- package/cjs/components/Attach/Attach.js.map +1 -1
- package/cjs/components/Attach/Attach.styles.js +9 -21
- package/cjs/components/Attach/Attach.styles.js.map +1 -1
- package/cjs/components/Attach/Attach.styles_1w3ga58.css +5 -0
- package/cjs/components/Attach/Attach.tokens.js +0 -1
- package/cjs/components/Attach/Attach.tokens.js.map +1 -1
- package/cjs/components/Attach/utils/addSeparator.js +18 -0
- package/cjs/components/Attach/utils/addSeparator.js.map +1 -0
- package/cjs/components/Attach/utils/getFileicon.js +2 -2
- package/cjs/components/Attach/utils/getFileicon.js.map +1 -1
- package/cjs/components/Attach/utils/index.js +8 -0
- package/cjs/components/Attach/utils/index.js.map +1 -0
- package/cjs/components/Attach/variations/_helperTextView/base.js +1 -1
- package/cjs/components/Attach/variations/_helperTextView/base_1vgke1p.css +1 -0
- package/cjs/components/Attach/variations/_size/base.js +1 -1
- package/cjs/components/Attach/variations/_size/base.js.map +1 -1
- package/{es/components/Attach/variations/_size/base_kpo9at.css → cjs/components/Attach/variations/_size/base_a4eelx.css} +1 -1
- package/cjs/components/Drawer/Drawer.css +2 -2
- package/cjs/components/Drawer/Drawer.js +7 -10
- package/cjs/components/Drawer/Drawer.js.map +1 -1
- package/cjs/components/Drawer/Drawer.styles.js +2 -17
- package/cjs/components/Drawer/Drawer.styles.js.map +1 -1
- package/{es/components/Drawer/Drawer.styles_1gcp61n.css → cjs/components/Drawer/Drawer.styles_h5od79.css} +1 -1
- package/cjs/components/Drawer/Drawer.tokens.js +0 -10
- package/cjs/components/Drawer/Drawer.tokens.js.map +1 -1
- package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.css +1 -1
- package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js +4 -10
- package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js.map +1 -1
- package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +1 -2
- package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.styles.js.map +1 -1
- package/cjs/components/Skeleton/LineSkeleton/variations/_size/base.js +1 -1
- package/cjs/components/Skeleton/LineSkeleton/variations/_size/base.js.map +1 -1
- package/cjs/components/Skeleton/LineSkeleton/variations/_size/base_1wf7n5i.css +1 -0
- package/cjs/components/Skeleton/TextSkeleton/TextSkeleton.js +1 -4
- package/cjs/components/Skeleton/TextSkeleton/TextSkeleton.js.map +1 -1
- package/cjs/components/Skeleton/tokens.js +1 -2
- package/cjs/components/Skeleton/tokens.js.map +1 -1
- package/cjs/index.css +10 -12
- package/emotion/cjs/components/Attach/Attach.js +51 -12
- package/emotion/cjs/components/Attach/Attach.styles.js +13 -28
- package/emotion/cjs/components/Attach/Attach.tokens.js +0 -1
- package/emotion/cjs/components/Attach/utils/addSeparator.js +20 -0
- package/emotion/cjs/components/Attach/utils/getFileicon.js +3 -3
- package/emotion/cjs/components/Attach/utils/index.js +10 -2
- package/emotion/cjs/components/Attach/variations/_size/base.js +1 -1
- package/emotion/cjs/components/Drawer/Drawer.js +4 -13
- package/emotion/cjs/components/Drawer/Drawer.styles.js +4 -10
- package/emotion/cjs/components/Drawer/Drawer.tokens.js +0 -12
- package/emotion/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js +5 -11
- package/emotion/cjs/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +4 -5
- package/emotion/cjs/components/Skeleton/LineSkeleton/variations/_size/base.js +3 -1
- package/emotion/cjs/components/Skeleton/TextSkeleton/TextSkeleton.js +2 -4
- package/emotion/cjs/components/Skeleton/tokens.js +1 -2
- package/emotion/cjs/examples/components/Attach/Attach.config.js +18 -18
- package/emotion/cjs/examples/components/Combobox/Combobox.js +0 -15
- package/emotion/cjs/examples/components/Skeleton/LineSkeleton.config.js +18 -23
- package/emotion/es/components/Attach/Attach.js +55 -16
- package/emotion/es/components/Attach/Attach.styles.js +11 -20
- package/emotion/es/components/Attach/Attach.tokens.js +0 -1
- package/emotion/es/components/Attach/utils/addSeparator.js +10 -0
- package/emotion/es/components/Attach/utils/getFileicon.js +1 -1
- package/emotion/es/components/Attach/utils/index.js +3 -1
- package/emotion/es/components/Attach/variations/_size/base.js +2 -2
- package/emotion/es/components/Drawer/Drawer.js +5 -9
- package/emotion/es/components/Drawer/Drawer.styles.js +5 -11
- package/emotion/es/components/Drawer/Drawer.tokens.js +0 -9
- package/emotion/es/components/Skeleton/LineSkeleton/LineSkeleton.js +5 -11
- package/emotion/es/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +4 -5
- package/emotion/es/components/Skeleton/LineSkeleton/variations/_size/base.js +3 -1
- package/emotion/es/components/Skeleton/TextSkeleton/TextSkeleton.js +2 -4
- package/emotion/es/components/Skeleton/tokens.js +1 -2
- package/emotion/es/examples/components/Attach/Attach.config.js +18 -18
- package/emotion/es/examples/components/Skeleton/LineSkeleton.config.js +18 -23
- package/es/components/Attach/Attach.css +7 -9
- package/es/components/Attach/Attach.js +63 -17
- package/es/components/Attach/Attach.js.map +1 -1
- package/es/components/Attach/Attach.styles.js +9 -19
- package/es/components/Attach/Attach.styles.js.map +1 -1
- package/es/components/Attach/Attach.styles_1w3ga58.css +5 -0
- package/es/components/Attach/Attach.tokens.js +0 -1
- package/es/components/Attach/Attach.tokens.js.map +1 -1
- package/es/components/Attach/utils/addSeparator.js +14 -0
- package/es/components/Attach/utils/addSeparator.js.map +1 -0
- package/es/components/Attach/utils/getFileicon.js +2 -2
- package/es/components/Attach/utils/getFileicon.js.map +1 -1
- package/es/components/Attach/utils/index.js +4 -0
- package/es/components/Attach/utils/index.js.map +1 -0
- package/es/components/Attach/variations/_helperTextView/base.js +1 -1
- package/es/components/Attach/variations/_helperTextView/base_1vgke1p.css +1 -0
- package/es/components/Attach/variations/_size/base.js +1 -1
- package/es/components/Attach/variations/_size/base.js.map +1 -1
- package/{cjs/components/Attach/variations/_size/base_kpo9at.css → es/components/Attach/variations/_size/base_a4eelx.css} +1 -1
- package/es/components/Drawer/Drawer.css +2 -2
- package/es/components/Drawer/Drawer.js +6 -8
- package/es/components/Drawer/Drawer.js.map +1 -1
- package/es/components/Drawer/Drawer.styles.js +2 -17
- package/es/components/Drawer/Drawer.styles.js.map +1 -1
- package/{cjs/components/Drawer/Drawer.styles_1gcp61n.css → es/components/Drawer/Drawer.styles_h5od79.css} +1 -1
- package/es/components/Drawer/Drawer.tokens.js +1 -10
- package/es/components/Drawer/Drawer.tokens.js.map +1 -1
- package/es/components/Skeleton/LineSkeleton/LineSkeleton.css +1 -1
- package/es/components/Skeleton/LineSkeleton/LineSkeleton.js +4 -10
- package/es/components/Skeleton/LineSkeleton/LineSkeleton.js.map +1 -1
- package/es/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +1 -2
- package/es/components/Skeleton/LineSkeleton/LineSkeleton.styles.js.map +1 -1
- package/es/components/Skeleton/LineSkeleton/variations/_size/base.js +1 -1
- package/es/components/Skeleton/LineSkeleton/variations/_size/base.js.map +1 -1
- package/es/components/Skeleton/LineSkeleton/variations/_size/base_1wf7n5i.css +1 -0
- package/es/components/Skeleton/TextSkeleton/TextSkeleton.js +1 -4
- package/es/components/Skeleton/TextSkeleton/TextSkeleton.js.map +1 -1
- package/es/components/Skeleton/tokens.js +1 -2
- package/es/components/Skeleton/tokens.js.map +1 -1
- package/es/index.css +10 -12
- package/package.json +5 -5
- package/styled-components/cjs/components/Attach/Attach.js +51 -12
- package/styled-components/cjs/components/Attach/Attach.styles.js +11 -31
- package/styled-components/cjs/components/Attach/Attach.tokens.js +0 -1
- package/styled-components/cjs/components/Attach/utils/addSeparator.js +20 -0
- package/styled-components/cjs/components/Attach/utils/getFileicon.js +3 -3
- package/styled-components/cjs/components/Attach/utils/index.js +10 -2
- package/styled-components/cjs/components/Attach/variations/_size/base.js +1 -2
- package/styled-components/cjs/components/Drawer/Drawer.js +4 -13
- package/styled-components/cjs/components/Drawer/Drawer.styles.js +4 -17
- package/styled-components/cjs/components/Drawer/Drawer.tokens.js +0 -12
- package/styled-components/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js +5 -11
- package/styled-components/cjs/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +2 -3
- package/styled-components/cjs/components/Skeleton/LineSkeleton/variations/_size/base.js +7 -2
- package/styled-components/cjs/components/Skeleton/TextSkeleton/TextSkeleton.js +2 -4
- package/styled-components/cjs/components/Skeleton/tokens.js +1 -2
- package/styled-components/cjs/examples/components/Attach/Attach.config.js +4 -8
- package/styled-components/cjs/examples/components/Skeleton/LineSkeleton.config.js +1 -12
- package/styled-components/es/components/Attach/Attach.js +55 -16
- package/styled-components/es/components/Attach/Attach.styles.js +9 -23
- package/styled-components/es/components/Attach/Attach.tokens.js +0 -1
- package/styled-components/es/components/Attach/utils/addSeparator.js +10 -0
- package/styled-components/es/components/Attach/utils/getFileicon.js +1 -1
- package/styled-components/es/components/Attach/utils/index.js +3 -1
- package/styled-components/es/components/Attach/variations/_size/base.js +2 -3
- package/styled-components/es/components/Drawer/Drawer.js +5 -9
- package/styled-components/es/components/Drawer/Drawer.styles.js +5 -18
- package/styled-components/es/components/Drawer/Drawer.tokens.js +0 -9
- package/styled-components/es/components/Skeleton/LineSkeleton/LineSkeleton.js +5 -11
- package/styled-components/es/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +2 -3
- package/styled-components/es/components/Skeleton/LineSkeleton/variations/_size/base.js +7 -2
- package/styled-components/es/components/Skeleton/TextSkeleton/TextSkeleton.js +2 -4
- package/styled-components/es/components/Skeleton/tokens.js +1 -2
- package/styled-components/es/examples/components/Attach/Attach.config.js +4 -8
- package/styled-components/es/examples/components/Combobox/Combobox.js +0 -7
- package/styled-components/es/examples/components/Skeleton/LineSkeleton.config.js +1 -12
- package/types/components/Attach/Attach.d.ts.map +1 -1
- package/types/components/Attach/Attach.styles.d.ts +1 -3
- package/types/components/Attach/Attach.styles.d.ts.map +1 -1
- package/types/components/Attach/Attach.tokens.d.ts +0 -1
- package/types/components/Attach/Attach.tokens.d.ts.map +1 -1
- package/types/components/Attach/Attach.types.d.ts +0 -7
- package/types/components/Attach/Attach.types.d.ts.map +1 -1
- package/types/components/Attach/utils/addSeparator.d.ts +2 -0
- package/types/components/Attach/utils/addSeparator.d.ts.map +1 -0
- package/types/components/Attach/utils/getFileicon.d.ts +1 -1
- package/types/components/Attach/utils/index.d.ts +3 -1
- package/types/components/Attach/utils/index.d.ts.map +1 -1
- package/types/components/Attach/variations/_size/base.d.ts.map +1 -1
- package/types/components/Drawer/Drawer.d.ts +0 -2
- package/types/components/Drawer/Drawer.d.ts.map +1 -1
- package/types/components/Drawer/Drawer.styles.d.ts +1 -2
- package/types/components/Drawer/Drawer.styles.d.ts.map +1 -1
- package/types/components/Drawer/Drawer.tokens.d.ts +0 -9
- package/types/components/Drawer/Drawer.tokens.d.ts.map +1 -1
- package/types/components/Drawer/Drawer.types.d.ts +0 -16
- package/types/components/Drawer/Drawer.types.d.ts.map +1 -1
- package/types/components/Skeleton/LineSkeleton/LineSkeleton.d.ts +0 -3
- package/types/components/Skeleton/LineSkeleton/LineSkeleton.d.ts.map +1 -1
- package/types/components/Skeleton/LineSkeleton/LineSkeleton.styles.d.ts.map +1 -1
- package/types/components/Skeleton/LineSkeleton/LineSkeleton.types.d.ts +1 -1
- package/types/components/Skeleton/LineSkeleton/LineSkeleton.types.d.ts.map +1 -1
- package/types/components/Skeleton/LineSkeleton/variations/_size/base.d.ts.map +1 -1
- package/types/components/Skeleton/Skeleton.types.d.ts +0 -1
- package/types/components/Skeleton/Skeleton.types.d.ts.map +1 -1
- package/types/components/Skeleton/TextSkeleton/TextSkeleton.d.ts.map +1 -1
- package/types/components/Skeleton/tokens.d.ts +0 -1
- package/types/components/Skeleton/tokens.d.ts.map +1 -1
- package/types/examples/components/Attach/Attach.config.d.ts.map +1 -1
- package/types/examples/components/Attach/Attach.d.ts.map +1 -1
- package/types/examples/components/Drawer/Drawer.d.ts +0 -1
- package/types/examples/components/Drawer/Drawer.d.ts.map +1 -1
- package/types/examples/components/Skeleton/LineSkeleton.config.d.ts +0 -5
- package/types/examples/components/Skeleton/LineSkeleton.config.d.ts.map +1 -1
- package/types/examples/components/Skeleton/Skeleton.d.ts +0 -8
- package/types/examples/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/cjs/components/Attach/Attach.styles_pso18d.css +0 -7
- package/cjs/components/Attach/variations/_helperTextView/base_1tgnvl9.css +0 -1
- package/cjs/components/Skeleton/LineSkeleton/variations/_size/base_x642ct.css +0 -1
- package/cjs/components/Skeleton/LineSkeleton/variations/_view/base.js +0 -9
- package/cjs/components/Skeleton/LineSkeleton/variations/_view/base.js.map +0 -1
- package/cjs/components/Skeleton/LineSkeleton/variations/_view/base_1it9pjr.css +0 -1
- package/emotion/cjs/components/Skeleton/LineSkeleton/variations/_view/base.js +0 -14
- package/emotion/es/components/Skeleton/LineSkeleton/variations/_view/base.js +0 -4
- package/es/components/Attach/Attach.styles_pso18d.css +0 -7
- package/es/components/Attach/variations/_helperTextView/base_1tgnvl9.css +0 -1
- package/es/components/Skeleton/LineSkeleton/variations/_size/base_x642ct.css +0 -1
- package/es/components/Skeleton/LineSkeleton/variations/_view/base.js +0 -5
- package/es/components/Skeleton/LineSkeleton/variations/_view/base.js.map +0 -1
- package/es/components/Skeleton/LineSkeleton/variations/_view/base_1it9pjr.css +0 -1
- package/styled-components/cjs/components/Skeleton/LineSkeleton/variations/_view/base.js +0 -19
- package/styled-components/es/components/Skeleton/LineSkeleton/variations/_view/base.js +0 -9
- package/types/components/Skeleton/LineSkeleton/variations/_view/base.d.ts +0 -2
- package/types/components/Skeleton/LineSkeleton/variations/_view/base.d.ts.map +0 -1
|
@@ -19,7 +19,6 @@ _export(exports, {
|
|
|
19
19
|
var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
20
20
|
var _mixins = require("../../../mixins");
|
|
21
21
|
var _base = require("./variations/_size/base");
|
|
22
|
-
var _base1 = require("./variations/_view/base");
|
|
23
22
|
var _LineSkeletonstyles = require("./LineSkeleton.styles");
|
|
24
23
|
function _define_property(obj, key, value) {
|
|
25
24
|
if (key in obj) {
|
|
@@ -119,24 +118,22 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
119
118
|
}
|
|
120
119
|
var lineSkeletonRoot = function(Root) {
|
|
121
120
|
return /*#__PURE__*/ (0, _react.forwardRef)(function(_param, outerRootRef) {
|
|
122
|
-
var size = _param.size, lighter = _param.lighter, customGradientColor = _param.customGradientColor, _param_roundness = _param.roundness, roundness = _param_roundness === void 0 ? '16' : _param_roundness,
|
|
121
|
+
var size = _param.size, lighter = _param.lighter, customGradientColor = _param.customGradientColor, _param_roundness = _param.roundness, roundness = _param_roundness === void 0 ? '16' : _param_roundness, rest = _object_without_properties(_param, [
|
|
123
122
|
"size",
|
|
124
123
|
"lighter",
|
|
125
124
|
"customGradientColor",
|
|
126
|
-
"roundness"
|
|
127
|
-
"view"
|
|
125
|
+
"roundness"
|
|
128
126
|
]);
|
|
129
127
|
var roundnessValue = (0, _mixins.getRoundness)({
|
|
130
128
|
roundness: roundness
|
|
131
129
|
});
|
|
132
|
-
var skeletonGradientColor =
|
|
130
|
+
var skeletonGradientColor = (0, _mixins.getSkeletonColor)({
|
|
133
131
|
lighter: lighter,
|
|
134
132
|
customGradientColor: customGradientColor
|
|
135
|
-
})
|
|
133
|
+
});
|
|
136
134
|
return /*#__PURE__*/ _react.default.createElement(Root, _object_spread({
|
|
137
135
|
ref: outerRootRef,
|
|
138
|
-
size: size
|
|
139
|
-
view: view
|
|
136
|
+
size: size
|
|
140
137
|
}, rest), /*#__PURE__*/ _react.default.createElement(_LineSkeletonstyles.StyledVisibleLine, {
|
|
141
138
|
roundness: roundnessValue,
|
|
142
139
|
gradientColor: skeletonGradientColor
|
|
@@ -151,9 +148,6 @@ var lineSkeletonConfig = {
|
|
|
151
148
|
variations: {
|
|
152
149
|
size: {
|
|
153
150
|
css: _base.base
|
|
154
|
-
},
|
|
155
|
-
view: {
|
|
156
|
-
css: _base1.base
|
|
157
151
|
}
|
|
158
152
|
},
|
|
159
153
|
defaults: {}
|
|
@@ -18,7 +18,6 @@ _export(exports, {
|
|
|
18
18
|
});
|
|
19
19
|
var _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
|
|
20
20
|
var _mixins = require("../../../mixins");
|
|
21
|
-
var _tokens = require("../tokens");
|
|
22
21
|
function _getRequireWildcardCache(nodeInterop) {
|
|
23
22
|
if (typeof WeakMap !== "function") return null;
|
|
24
23
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -65,7 +64,7 @@ var base = (0, _styledcomponents.css)([
|
|
|
65
64
|
]);
|
|
66
65
|
var StyledVisibleLine = _styledcomponents.default.div.withConfig({
|
|
67
66
|
displayName: "LineSkeleton.styles__StyledVisibleLine",
|
|
68
|
-
componentId: "sc-
|
|
67
|
+
componentId: "sc-7d32d69d-0"
|
|
69
68
|
})([
|
|
70
69
|
"position:relative;overflow:hidden;width:100%;--plasma_private-line-skeleton-roundness:",
|
|
71
70
|
";",
|
|
@@ -77,5 +76,5 @@ var StyledVisibleLine = _styledcomponents.default.div.withConfig({
|
|
|
77
76
|
return roundness;
|
|
78
77
|
}, (0, _mixins.applyRoundness)('var(--plasma_private-line-skeleton-roundness)'), function(param) {
|
|
79
78
|
var gradientColor = param.gradientColor;
|
|
80
|
-
return gradientColor
|
|
79
|
+
return gradientColor;
|
|
81
80
|
}, (0, _mixins.applySkeletonGradient)('var(--plasma_private-line-skeleton-gradient)'));
|
|
@@ -9,6 +9,11 @@ Object.defineProperty(exports, "base", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _styledcomponents = require("styled-components");
|
|
12
|
+
var _LineSkeletonstyles = require("../../LineSkeleton.styles");
|
|
13
|
+
var _tokens = require("../../../tokens");
|
|
12
14
|
var base = (0, _styledcomponents.css)([
|
|
13
|
-
""
|
|
14
|
-
|
|
15
|
+
"height:var(",
|
|
16
|
+
");& ",
|
|
17
|
+
"{height:var(",
|
|
18
|
+
");}"
|
|
19
|
+
], _tokens.tokens.lineHeight, _LineSkeletonstyles.StyledVisibleLine, _tokens.tokens.visibleLineHeight);
|
|
@@ -195,14 +195,13 @@ var variousWidth = [
|
|
|
195
195
|
];
|
|
196
196
|
var textSkeleton = function(Component) {
|
|
197
197
|
return function(_param) {
|
|
198
|
-
var lines = _param.lines, width = _param.width, roundness = _param.roundness, customGradientColor = _param.customGradientColor, lighter = _param.lighter, _param_size = _param.size, size = _param_size === void 0 ? 'bodyM' : _param_size,
|
|
198
|
+
var lines = _param.lines, width = _param.width, roundness = _param.roundness, customGradientColor = _param.customGradientColor, lighter = _param.lighter, _param_size = _param.size, size = _param_size === void 0 ? 'bodyM' : _param_size, props = _object_without_properties(_param, [
|
|
199
199
|
"lines",
|
|
200
200
|
"width",
|
|
201
201
|
"roundness",
|
|
202
202
|
"customGradientColor",
|
|
203
203
|
"lighter",
|
|
204
|
-
"size"
|
|
205
|
-
"view"
|
|
204
|
+
"size"
|
|
206
205
|
]);
|
|
207
206
|
var _useState = _sliced_to_array((0, _react.useState)(null), 2), fixedWidth = _useState[0], setFixedWidth = _useState[1];
|
|
208
207
|
var _useState1 = _sliced_to_array((0, _react.useState)([]), 2), linesWidth = _useState1[0], setLinesWidth = _useState1[1];
|
|
@@ -240,7 +239,6 @@ var textSkeleton = function(Component) {
|
|
|
240
239
|
return /*#__PURE__*/ _react.default.createElement(ComponentSkeleton, {
|
|
241
240
|
key: "line:".concat(i),
|
|
242
241
|
size: size,
|
|
243
|
-
view: view,
|
|
244
242
|
roundness: roundness,
|
|
245
243
|
customGradientColor: customGradientColor,
|
|
246
244
|
lighter: lighter,
|
|
@@ -10,6 +10,5 @@ Object.defineProperty(exports, "tokens", {
|
|
|
10
10
|
});
|
|
11
11
|
var tokens = {
|
|
12
12
|
lineHeight: '--plasma-skeleton-line-height',
|
|
13
|
-
visibleLineHeight: '--plasma-skeleton-visible-line-height'
|
|
14
|
-
gradientColor: '--plasma-skeleton-gradient-color'
|
|
13
|
+
visibleLineHeight: '--plasma-skeleton-visible-line-height'
|
|
15
14
|
};
|
|
@@ -463,7 +463,6 @@ var config = {
|
|
|
463
463
|
":0.5rem;",
|
|
464
464
|
":1.625rem;",
|
|
465
465
|
":3.5rem;",
|
|
466
|
-
":3.5rem;",
|
|
467
466
|
":12.5rem;",
|
|
468
467
|
":1.5rem;",
|
|
469
468
|
":0.875rem;",
|
|
@@ -527,14 +526,13 @@ var config = {
|
|
|
527
526
|
":var(--plasma-typo-body-xs-line-height);",
|
|
528
527
|
":1rem;",
|
|
529
528
|
":inherit;"
|
|
530
|
-
], _Attach.attachTokens.horizontalGap, _Attach.attachTokens.verticalGap, _Attach.attachTokens.verticalGapWithHelperText, _Attach.attachTokens.
|
|
529
|
+
], _Attach.attachTokens.horizontalGap, _Attach.attachTokens.verticalGap, _Attach.attachTokens.verticalGapWithHelperText, _Attach.attachTokens.buttonHeight, _Attach.attachTokens.buttonWidth, _Attach.attachTokens.buttonPadding, _Attach.attachTokens.buttonRadius, _Attach.attachTokens.buttonFontFamily, _Attach.attachTokens.buttonFontSize, _Attach.attachTokens.buttonFontStyle, _Attach.attachTokens.buttonFontWeight, _Attach.attachTokens.buttonLetterSpacing, _Attach.attachTokens.buttonLineHeight, _Attach.attachTokens.buttonSpinnerSize, _Attach.attachTokens.buttonSpinnerColor, _Attach.attachTokens.buttonLeftContentMargin, _Attach.attachTokens.buttonRightContentMargin, _Attach.attachTokens.buttonValueMargin, _Attach.attachTokens.cellWidth, _Attach.attachTokens.cellPadding, _Attach.attachTokens.cellPaddingLeftContent, _Attach.attachTokens.cellPaddingContent, _Attach.attachTokens.cellPaddingRightContent, _Attach.attachTokens.cellTextboxGap, _Attach.attachTokens.cellGap, _Attach.attachTokens.cellLabelFontFamily, _Attach.attachTokens.cellLabelFontSize, _Attach.attachTokens.cellLabelFontStyle, _Attach.attachTokens.cellLabelFontWeight, _Attach.attachTokens.cellLabelLetterSpacing, _Attach.attachTokens.cellLabelLineHeight, _Attach.attachTokens.cellTitleFontFamily, _Attach.attachTokens.cellTitleFontSize, _Attach.attachTokens.cellTitleFontStyle, _Attach.attachTokens.cellTitleFontWeight, _Attach.attachTokens.cellTitleLetterSpacing, _Attach.attachTokens.cellTitleLineHeight, _Attach.attachTokens.cellSubtitleFontFamily, _Attach.attachTokens.cellSubtitleFontSize, _Attach.attachTokens.cellSubtitleFontStyle, _Attach.attachTokens.cellSubtitleFontWeight, _Attach.attachTokens.cellSubtitleLetterSpacing, _Attach.attachTokens.cellSubtitleLineHeight, _Attach.attachTokens.iconButtonHeight, _Attach.attachTokens.iconButtonWidth, _Attach.attachTokens.iconButtonPadding, _Attach.attachTokens.iconButtonRadius, _Attach.attachTokens.iconButtonFontFamily, _Attach.attachTokens.iconButtonFontSize, _Attach.attachTokens.iconButtonFontStyle, _Attach.attachTokens.iconButtonFontWeight, _Attach.attachTokens.iconButtonLetterSpacing, _Attach.attachTokens.iconButtonLineHeight, _Attach.attachTokens.iconButtonSpinnerSize, _Attach.attachTokens.iconButtonSpinnerColor, _Attach.attachTokens.iconButtonCancelHeight, _Attach.attachTokens.iconButtonCancelWidth, _Attach.attachTokens.iconButtonCancelPadding, _Attach.attachTokens.iconButtonCancelRadius, _Attach.attachTokens.iconButtonCancelFontFamily, _Attach.attachTokens.iconButtonCancelFontSize, _Attach.attachTokens.iconButtonCancelFontStyle, _Attach.attachTokens.iconButtonCancelFontWeight, _Attach.attachTokens.iconButtonCancelLetterSpacing, _Attach.attachTokens.iconButtonCancelLineHeight, _Attach.attachTokens.iconButtonCancelSpinnerSize, _Attach.attachTokens.iconButtonCancelSpinnerColor),
|
|
531
530
|
m: (0, _styledcomponents.css)([
|
|
532
531
|
"",
|
|
533
532
|
":1.25rem;",
|
|
534
533
|
":0.5rem;",
|
|
535
534
|
":1.625rem;",
|
|
536
535
|
":3rem;",
|
|
537
|
-
":3rem;",
|
|
538
536
|
":11.25rem;",
|
|
539
537
|
":1.25rem;",
|
|
540
538
|
":0.75rem;",
|
|
@@ -598,14 +596,13 @@ var config = {
|
|
|
598
596
|
":var(--plasma-typo-body-xs-line-height);",
|
|
599
597
|
":1rem;",
|
|
600
598
|
":inherit;"
|
|
601
|
-
], _Attach.attachTokens.horizontalGap, _Attach.attachTokens.verticalGap, _Attach.attachTokens.verticalGapWithHelperText, _Attach.attachTokens.
|
|
599
|
+
], _Attach.attachTokens.horizontalGap, _Attach.attachTokens.verticalGap, _Attach.attachTokens.verticalGapWithHelperText, _Attach.attachTokens.buttonHeight, _Attach.attachTokens.buttonWidth, _Attach.attachTokens.buttonPadding, _Attach.attachTokens.buttonRadius, _Attach.attachTokens.buttonFontFamily, _Attach.attachTokens.buttonFontSize, _Attach.attachTokens.buttonFontStyle, _Attach.attachTokens.buttonFontWeight, _Attach.attachTokens.buttonLetterSpacing, _Attach.attachTokens.buttonLineHeight, _Attach.attachTokens.buttonSpinnerSize, _Attach.attachTokens.buttonSpinnerColor, _Attach.attachTokens.buttonLeftContentMargin, _Attach.attachTokens.buttonRightContentMargin, _Attach.attachTokens.buttonValueMargin, _Attach.attachTokens.cellWidth, _Attach.attachTokens.cellPadding, _Attach.attachTokens.cellPaddingLeftContent, _Attach.attachTokens.cellPaddingContent, _Attach.attachTokens.cellPaddingRightContent, _Attach.attachTokens.cellTextboxGap, _Attach.attachTokens.cellGap, _Attach.attachTokens.cellLabelFontFamily, _Attach.attachTokens.cellLabelFontSize, _Attach.attachTokens.cellLabelFontStyle, _Attach.attachTokens.cellLabelFontWeight, _Attach.attachTokens.cellLabelLetterSpacing, _Attach.attachTokens.cellLabelLineHeight, _Attach.attachTokens.cellTitleFontFamily, _Attach.attachTokens.cellTitleFontSize, _Attach.attachTokens.cellTitleFontStyle, _Attach.attachTokens.cellTitleFontWeight, _Attach.attachTokens.cellTitleLetterSpacing, _Attach.attachTokens.cellTitleLineHeight, _Attach.attachTokens.cellSubtitleFontFamily, _Attach.attachTokens.cellSubtitleFontSize, _Attach.attachTokens.cellSubtitleFontStyle, _Attach.attachTokens.cellSubtitleFontWeight, _Attach.attachTokens.cellSubtitleLetterSpacing, _Attach.attachTokens.cellSubtitleLineHeight, _Attach.attachTokens.iconButtonHeight, _Attach.attachTokens.iconButtonWidth, _Attach.attachTokens.iconButtonPadding, _Attach.attachTokens.iconButtonRadius, _Attach.attachTokens.iconButtonFontFamily, _Attach.attachTokens.iconButtonFontSize, _Attach.attachTokens.iconButtonFontStyle, _Attach.attachTokens.iconButtonFontWeight, _Attach.attachTokens.iconButtonLetterSpacing, _Attach.attachTokens.iconButtonLineHeight, _Attach.attachTokens.iconButtonSpinnerSize, _Attach.attachTokens.iconButtonSpinnerColor, _Attach.attachTokens.iconButtonCancelHeight, _Attach.attachTokens.iconButtonCancelWidth, _Attach.attachTokens.iconButtonCancelPadding, _Attach.attachTokens.iconButtonCancelRadius, _Attach.attachTokens.iconButtonCancelFontFamily, _Attach.attachTokens.iconButtonCancelFontSize, _Attach.attachTokens.iconButtonCancelFontStyle, _Attach.attachTokens.iconButtonCancelFontWeight, _Attach.attachTokens.iconButtonCancelLetterSpacing, _Attach.attachTokens.iconButtonCancelLineHeight, _Attach.attachTokens.iconButtonCancelSpinnerSize, _Attach.attachTokens.iconButtonCancelSpinnerColor),
|
|
602
600
|
s: (0, _styledcomponents.css)([
|
|
603
601
|
"",
|
|
604
602
|
":1rem;",
|
|
605
603
|
":0.375rem;",
|
|
606
604
|
":1.5rem;",
|
|
607
605
|
":2.5rem;",
|
|
608
|
-
":2.5rem;",
|
|
609
606
|
":11.25rem;",
|
|
610
607
|
":1rem;",
|
|
611
608
|
":0.625rem;",
|
|
@@ -669,14 +666,13 @@ var config = {
|
|
|
669
666
|
":var(--plasma-typo-body-xs-line-height);",
|
|
670
667
|
":1rem;",
|
|
671
668
|
":inherit;"
|
|
672
|
-
], _Attach.attachTokens.horizontalGap, _Attach.attachTokens.verticalGap, _Attach.attachTokens.verticalGapWithHelperText, _Attach.attachTokens.
|
|
669
|
+
], _Attach.attachTokens.horizontalGap, _Attach.attachTokens.verticalGap, _Attach.attachTokens.verticalGapWithHelperText, _Attach.attachTokens.buttonHeight, _Attach.attachTokens.buttonWidth, _Attach.attachTokens.buttonPadding, _Attach.attachTokens.buttonRadius, _Attach.attachTokens.buttonFontFamily, _Attach.attachTokens.buttonFontSize, _Attach.attachTokens.buttonFontStyle, _Attach.attachTokens.buttonFontWeight, _Attach.attachTokens.buttonLetterSpacing, _Attach.attachTokens.buttonLineHeight, _Attach.attachTokens.buttonSpinnerSize, _Attach.attachTokens.buttonSpinnerColor, _Attach.attachTokens.buttonLeftContentMargin, _Attach.attachTokens.buttonRightContentMargin, _Attach.attachTokens.buttonValueMargin, _Attach.attachTokens.cellWidth, _Attach.attachTokens.cellPadding, _Attach.attachTokens.cellPaddingLeftContent, _Attach.attachTokens.cellPaddingContent, _Attach.attachTokens.cellPaddingRightContent, _Attach.attachTokens.cellTextboxGap, _Attach.attachTokens.cellGap, _Attach.attachTokens.cellLabelFontFamily, _Attach.attachTokens.cellLabelFontSize, _Attach.attachTokens.cellLabelFontStyle, _Attach.attachTokens.cellLabelFontWeight, _Attach.attachTokens.cellLabelLetterSpacing, _Attach.attachTokens.cellLabelLineHeight, _Attach.attachTokens.cellTitleFontFamily, _Attach.attachTokens.cellTitleFontSize, _Attach.attachTokens.cellTitleFontStyle, _Attach.attachTokens.cellTitleFontWeight, _Attach.attachTokens.cellTitleLetterSpacing, _Attach.attachTokens.cellTitleLineHeight, _Attach.attachTokens.cellSubtitleFontFamily, _Attach.attachTokens.cellSubtitleFontSize, _Attach.attachTokens.cellSubtitleFontStyle, _Attach.attachTokens.cellSubtitleFontWeight, _Attach.attachTokens.cellSubtitleLetterSpacing, _Attach.attachTokens.cellSubtitleLineHeight, _Attach.attachTokens.iconButtonHeight, _Attach.attachTokens.iconButtonWidth, _Attach.attachTokens.iconButtonPadding, _Attach.attachTokens.iconButtonRadius, _Attach.attachTokens.iconButtonFontFamily, _Attach.attachTokens.iconButtonFontSize, _Attach.attachTokens.iconButtonFontStyle, _Attach.attachTokens.iconButtonFontWeight, _Attach.attachTokens.iconButtonLetterSpacing, _Attach.attachTokens.iconButtonLineHeight, _Attach.attachTokens.iconButtonSpinnerSize, _Attach.attachTokens.iconButtonSpinnerColor, _Attach.attachTokens.iconButtonCancelHeight, _Attach.attachTokens.iconButtonCancelWidth, _Attach.attachTokens.iconButtonCancelPadding, _Attach.attachTokens.iconButtonCancelRadius, _Attach.attachTokens.iconButtonCancelFontFamily, _Attach.attachTokens.iconButtonCancelFontSize, _Attach.attachTokens.iconButtonCancelFontStyle, _Attach.attachTokens.iconButtonCancelFontWeight, _Attach.attachTokens.iconButtonCancelLetterSpacing, _Attach.attachTokens.iconButtonCancelLineHeight, _Attach.attachTokens.iconButtonCancelSpinnerSize, _Attach.attachTokens.iconButtonCancelSpinnerColor),
|
|
673
670
|
xs: (0, _styledcomponents.css)([
|
|
674
671
|
"",
|
|
675
672
|
":0.75rem;",
|
|
676
673
|
":0.25rem;",
|
|
677
674
|
":1.375rem;",
|
|
678
675
|
":2rem;",
|
|
679
|
-
":2rem;",
|
|
680
676
|
":10rem;",
|
|
681
677
|
":0.75rem;",
|
|
682
678
|
":0.5rem;",
|
|
@@ -740,7 +736,7 @@ var config = {
|
|
|
740
736
|
":var(--plasma-typo-body-xs-line-height);",
|
|
741
737
|
":1rem;",
|
|
742
738
|
":inherit;"
|
|
743
|
-
], _Attach.attachTokens.horizontalGap, _Attach.attachTokens.verticalGap, _Attach.attachTokens.verticalGapWithHelperText, _Attach.attachTokens.
|
|
739
|
+
], _Attach.attachTokens.horizontalGap, _Attach.attachTokens.verticalGap, _Attach.attachTokens.verticalGapWithHelperText, _Attach.attachTokens.buttonHeight, _Attach.attachTokens.buttonWidth, _Attach.attachTokens.buttonPadding, _Attach.attachTokens.buttonRadius, _Attach.attachTokens.buttonFontFamily, _Attach.attachTokens.buttonFontSize, _Attach.attachTokens.buttonFontStyle, _Attach.attachTokens.buttonFontWeight, _Attach.attachTokens.buttonLetterSpacing, _Attach.attachTokens.buttonLineHeight, _Attach.attachTokens.buttonSpinnerSize, _Attach.attachTokens.buttonSpinnerColor, _Attach.attachTokens.buttonLeftContentMargin, _Attach.attachTokens.buttonRightContentMargin, _Attach.attachTokens.buttonValueMargin, _Attach.attachTokens.cellWidth, _Attach.attachTokens.cellPadding, _Attach.attachTokens.cellPaddingLeftContent, _Attach.attachTokens.cellPaddingContent, _Attach.attachTokens.cellPaddingRightContent, _Attach.attachTokens.cellTextboxGap, _Attach.attachTokens.cellGap, _Attach.attachTokens.cellLabelFontFamily, _Attach.attachTokens.cellLabelFontSize, _Attach.attachTokens.cellLabelFontStyle, _Attach.attachTokens.cellLabelFontWeight, _Attach.attachTokens.cellLabelLetterSpacing, _Attach.attachTokens.cellLabelLineHeight, _Attach.attachTokens.cellTitleFontFamily, _Attach.attachTokens.cellTitleFontSize, _Attach.attachTokens.cellTitleFontStyle, _Attach.attachTokens.cellTitleFontWeight, _Attach.attachTokens.cellTitleLetterSpacing, _Attach.attachTokens.cellTitleLineHeight, _Attach.attachTokens.cellSubtitleFontFamily, _Attach.attachTokens.cellSubtitleFontSize, _Attach.attachTokens.cellSubtitleFontStyle, _Attach.attachTokens.cellSubtitleFontWeight, _Attach.attachTokens.cellSubtitleLetterSpacing, _Attach.attachTokens.cellSubtitleLineHeight, _Attach.attachTokens.iconButtonHeight, _Attach.attachTokens.iconButtonWidth, _Attach.attachTokens.iconButtonPadding, _Attach.attachTokens.iconButtonRadius, _Attach.attachTokens.iconButtonFontFamily, _Attach.attachTokens.iconButtonFontSize, _Attach.attachTokens.iconButtonFontStyle, _Attach.attachTokens.iconButtonFontWeight, _Attach.attachTokens.iconButtonLetterSpacing, _Attach.attachTokens.iconButtonLineHeight, _Attach.attachTokens.iconButtonSpinnerSize, _Attach.attachTokens.iconButtonSpinnerColor, _Attach.attachTokens.iconButtonCancelHeight, _Attach.attachTokens.iconButtonCancelWidth, _Attach.attachTokens.iconButtonCancelPadding, _Attach.attachTokens.iconButtonCancelRadius, _Attach.attachTokens.iconButtonCancelFontFamily, _Attach.attachTokens.iconButtonCancelFontSize, _Attach.attachTokens.iconButtonCancelFontStyle, _Attach.attachTokens.iconButtonCancelFontWeight, _Attach.attachTokens.iconButtonCancelLetterSpacing, _Attach.attachTokens.iconButtonCancelLineHeight, _Attach.attachTokens.iconButtonCancelSpinnerSize, _Attach.attachTokens.iconButtonCancelSpinnerColor)
|
|
744
740
|
}
|
|
745
741
|
}
|
|
746
742
|
};
|
|
@@ -12,20 +12,9 @@ var _styledcomponents = require("styled-components");
|
|
|
12
12
|
var _Skeleton = require("../../../components/Skeleton");
|
|
13
13
|
var config = {
|
|
14
14
|
defaults: {
|
|
15
|
-
size: 'bodyM'
|
|
16
|
-
view: 'default'
|
|
15
|
+
size: 'bodyM'
|
|
17
16
|
},
|
|
18
17
|
variations: {
|
|
19
|
-
view: {
|
|
20
|
-
default: (0, _styledcomponents.css)([
|
|
21
|
-
"",
|
|
22
|
-
":var(--plasma-colors-skeleton-gradient,var(--surface-skeleton-gradient));"
|
|
23
|
-
], _Skeleton.skeletonTokens.gradientColor),
|
|
24
|
-
lighter: (0, _styledcomponents.css)([
|
|
25
|
-
"",
|
|
26
|
-
":var(--plasma-colors-skeleton-gradient-lighter,var(--surface-skeleton-deep-gradient));"
|
|
27
|
-
], _Skeleton.skeletonTokens.gradientColor)
|
|
28
|
-
},
|
|
29
18
|
size: {
|
|
30
19
|
bodyL: (0, _styledcomponents.css)([
|
|
31
20
|
"",
|
|
@@ -99,25 +99,24 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
99
99
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
100
100
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
101
101
|
}
|
|
102
|
-
import React, { forwardRef, useRef, useState } from "react";
|
|
103
|
-
import { useForkRef } from "@salutejs/plasma-core";
|
|
102
|
+
import React, { forwardRef, useEffect, useRef, useState } from "react";
|
|
103
|
+
import { useForkRef, useIsomorphicLayoutEffect } from "@salutejs/plasma-core";
|
|
104
104
|
import { cx } from "../../utils";
|
|
105
105
|
import { IconCloseCircleOutline } from "../_Icon";
|
|
106
106
|
import { base as sizeCSS } from "./variations/_size/base";
|
|
107
107
|
import { base as viewCSS } from "./variations/_view/base";
|
|
108
108
|
import { base as helperTextViewCSS } from "./variations/_helperTextView/base";
|
|
109
|
-
import { base, StyledHelperText, StyledHiddenInput,
|
|
109
|
+
import { base, StyledHelperText, StyledHiddenInput, StyledHiddenInputHelper, StyledAttachButtonWrapper } from "./Attach.styles";
|
|
110
110
|
import { StyledCell } from "./ui/Cell/Cell";
|
|
111
|
-
import { extractExtension,
|
|
111
|
+
import { extractExtension, getFileicon, addSeparator, separator } from "./utils";
|
|
112
112
|
import { classes } from "./Attach.tokens";
|
|
113
113
|
import { AttachButton } from "./components/AttachButton";
|
|
114
114
|
import { StyledIconButtonCancel } from "./ui/IconButton/IconButton.styles";
|
|
115
115
|
export var attachRoot = function(Root) {
|
|
116
116
|
return /*#__PURE__*/ forwardRef(function(props, outerRef) {
|
|
117
|
-
var _props_flow = props.flow, flow = _props_flow === void 0 ? 'auto' : _props_flow, _props_buttonType = props.buttonType, buttonType = _props_buttonType === void 0 ? 'button' : _props_buttonType,
|
|
117
|
+
var _props_flow = props.flow, flow = _props_flow === void 0 ? 'auto' : _props_flow, _props_buttonType = props.buttonType, buttonType = _props_buttonType === void 0 ? 'button' : _props_buttonType, _props_hasAttachment = props.hasAttachment, hasAttachment = _props_hasAttachment === void 0 ? true : _props_hasAttachment, acceptedFileFormats = props.acceptedFileFormats, helperText = props.helperText, size = props.size, view = props.view, helperTextView = props.helperTextView, className = props.className, style = props.style, isLoading = props.isLoading, disabled = props.disabled, id = props.id, name = props.name, customIcon = props.customIcon, onChange = props.onChange, onClear = props.onClear, rest = _object_without_properties(props, [
|
|
118
118
|
"flow",
|
|
119
119
|
"buttonType",
|
|
120
|
-
"hideButtonOnAttach",
|
|
121
120
|
"hasAttachment",
|
|
122
121
|
"acceptedFileFormats",
|
|
123
122
|
"helperText",
|
|
@@ -131,30 +130,65 @@ export var attachRoot = function(Root) {
|
|
|
131
130
|
"id",
|
|
132
131
|
"name",
|
|
133
132
|
"customIcon",
|
|
134
|
-
"onClick",
|
|
135
133
|
"onChange",
|
|
136
134
|
"onClear"
|
|
137
135
|
]);
|
|
138
136
|
var innerRef = useRef(null);
|
|
139
137
|
var ref = useForkRef(outerRef, innerRef);
|
|
140
138
|
var inputRef = useRef(null);
|
|
139
|
+
var inputHelperRef = useRef(null);
|
|
141
140
|
var cellRef = useRef(null);
|
|
142
141
|
var buttonRef = useRef(null);
|
|
142
|
+
var emptyTextCellWidth = useRef(null);
|
|
143
143
|
var _useState = _sliced_to_array(useState(''), 2), filename = _useState[0], setFilename = _useState[1];
|
|
144
|
+
var _useState1 = _sliced_to_array(useState(''), 2), truncatedFilename = _useState1[0], setTruncatedFilename = _useState1[1];
|
|
144
145
|
var horizontalClass = flow === 'horizontal' ? classes.horizontal : undefined;
|
|
145
146
|
var verticalClass = flow === 'vertical' ? classes.vertical : undefined;
|
|
146
147
|
var withHelperTextClass = helperText ? classes.withHelperText : undefined;
|
|
147
148
|
var autoClass = flow === 'auto' ? classes.auto : undefined;
|
|
149
|
+
var cellHiddenClass = truncatedFilename.length === 0 ? classes.cellHidden : undefined;
|
|
148
150
|
var accept = acceptedFileFormats === null || acceptedFileFormats === void 0 ? void 0 : acceptedFileFormats.join(',');
|
|
149
151
|
var extension = extractExtension(filename);
|
|
150
|
-
var
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
var cellContentLeft = customIcon || getFileicon(extension, size);
|
|
153
|
+
useEffect(function() {
|
|
154
|
+
var _cellRef_current;
|
|
155
|
+
emptyTextCellWidth.current = ((_cellRef_current = cellRef.current) === null || _cellRef_current === void 0 ? void 0 : _cellRef_current.offsetWidth) || 0;
|
|
156
|
+
}, []);
|
|
157
|
+
useIsomorphicLayoutEffect(function() {
|
|
158
|
+
if (!cellRef.current || !cellRef.current.parentElement || !inputHelperRef.current || !inputHelperRef.current.textContent || !emptyTextCellWidth.current || !buttonRef.current) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
var _inputHelperRef_current = inputHelperRef.current, textWidth = _inputHelperRef_current.offsetWidth;
|
|
162
|
+
var _buttonRef_current = buttonRef.current, buttonWidth = _buttonRef_current.offsetWidth;
|
|
163
|
+
var _cellRef_current_parentElement_getBoundingClientRect = cellRef.current.parentElement.getBoundingClientRect(), parentWidth = _cellRef_current_parentElement_getBoundingClientRect.width, parentLeft = _cellRef_current_parentElement_getBoundingClientRect.left;
|
|
164
|
+
var _cellRef_current_getBoundingClientRect = cellRef.current.getBoundingClientRect(), cellLeft = _cellRef_current_getBoundingClientRect.left;
|
|
165
|
+
var leftDiff = cellLeft - parentLeft;
|
|
166
|
+
var currentTextWidth = textWidth;
|
|
167
|
+
if (currentTextWidth + emptyTextCellWidth.current + leftDiff <= parentWidth || currentTextWidth + emptyTextCellWidth.current < buttonWidth) {
|
|
168
|
+
setTruncatedFilename(filename);
|
|
154
169
|
return;
|
|
155
170
|
}
|
|
156
|
-
|
|
157
|
-
|
|
171
|
+
var currFilename = addSeparator(filename, separator);
|
|
172
|
+
for(var i = currFilename.indexOf(separator) - 1; i > 0; i -= 1){
|
|
173
|
+
if (currentTextWidth + emptyTextCellWidth.current + leftDiff <= parentWidth) {
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
var left = currFilename.slice(0, i);
|
|
177
|
+
var right = currFilename.slice(i + 1);
|
|
178
|
+
var newFilename = "".concat(left).concat(right);
|
|
179
|
+
inputHelperRef.current.textContent = newFilename;
|
|
180
|
+
currentTextWidth = inputHelperRef.current.offsetWidth;
|
|
181
|
+
if (currentTextWidth + emptyTextCellWidth.current < buttonWidth) {
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
currFilename = newFilename;
|
|
185
|
+
}
|
|
186
|
+
inputHelperRef.current.textContent = filename;
|
|
187
|
+
setTruncatedFilename(currFilename);
|
|
188
|
+
});
|
|
189
|
+
var handleClick = function() {
|
|
190
|
+
if (!inputRef.current) {
|
|
191
|
+
return;
|
|
158
192
|
}
|
|
159
193
|
inputRef.current.click();
|
|
160
194
|
};
|
|
@@ -176,6 +210,7 @@ export var attachRoot = function(Root) {
|
|
|
176
210
|
}
|
|
177
211
|
inputRef.current.value = '';
|
|
178
212
|
setFilename('');
|
|
213
|
+
setTruncatedFilename('');
|
|
179
214
|
};
|
|
180
215
|
return /*#__PURE__*/ React.createElement(Root, {
|
|
181
216
|
className: cx(horizontalClass, verticalClass, autoClass, withHelperTextClass, className),
|
|
@@ -191,16 +226,20 @@ export var attachRoot = function(Root) {
|
|
|
191
226
|
id: id,
|
|
192
227
|
name: name,
|
|
193
228
|
onChange: handleChange
|
|
194
|
-
}),
|
|
229
|
+
}), /*#__PURE__*/ React.createElement(StyledHiddenInputHelper, {
|
|
230
|
+
ref: inputHelperRef
|
|
231
|
+
}, filename), /*#__PURE__*/ React.createElement(StyledAttachButtonWrapper, null, /*#__PURE__*/ React.createElement(AttachButton, _object_spread({
|
|
195
232
|
ref: buttonRef,
|
|
196
233
|
buttonType: buttonType,
|
|
197
234
|
isLoading: isLoading,
|
|
198
235
|
disabled: disabled,
|
|
199
236
|
onClick: handleClick
|
|
200
|
-
}, rest)), helperText && /*#__PURE__*/ React.createElement(StyledHelperText, null, helperText)),
|
|
237
|
+
}, rest)), helperText && /*#__PURE__*/ React.createElement(StyledHelperText, null, helperText)), hasAttachment && /*#__PURE__*/ React.createElement(StyledCell, {
|
|
201
238
|
stretching: "fixed",
|
|
239
|
+
className: cellHiddenClass,
|
|
202
240
|
ref: cellRef,
|
|
203
241
|
size: size,
|
|
242
|
+
title: truncatedFilename,
|
|
204
243
|
contentLeft: cellContentLeft,
|
|
205
244
|
contentRight: /*#__PURE__*/ React.createElement(StyledIconButtonCancel, {
|
|
206
245
|
onClick: handleClear
|
|
@@ -208,7 +247,7 @@ export var attachRoot = function(Root) {
|
|
|
208
247
|
size: "xs",
|
|
209
248
|
color: "inherit"
|
|
210
249
|
}))
|
|
211
|
-
}
|
|
250
|
+
}));
|
|
212
251
|
});
|
|
213
252
|
};
|
|
214
253
|
export var attachConfig = {
|
|
@@ -1,43 +1,29 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
import { css } from "styled-components";
|
|
3
|
-
import { applyEllipsis } from "../../mixins";
|
|
4
3
|
export var base = css([
|
|
5
4
|
"position:relative;display:flex;"
|
|
6
5
|
]);
|
|
7
6
|
export var StyledHiddenInput = styled.input.withConfig({
|
|
8
7
|
displayName: "Attach.styles__StyledHiddenInput",
|
|
9
|
-
componentId: "sc-
|
|
8
|
+
componentId: "sc-7ce14282-0"
|
|
10
9
|
})([
|
|
11
10
|
"display:none;"
|
|
12
11
|
]);
|
|
12
|
+
export var StyledHiddenInputHelper = styled.div.withConfig({
|
|
13
|
+
displayName: "Attach.styles__StyledHiddenInputHelper",
|
|
14
|
+
componentId: "sc-7ce14282-1"
|
|
15
|
+
})([
|
|
16
|
+
"position:absolute;visibility:hidden;white-space:nowrap;"
|
|
17
|
+
]);
|
|
13
18
|
export var StyledAttachButtonWrapper = styled.div.withConfig({
|
|
14
19
|
displayName: "Attach.styles__StyledAttachButtonWrapper",
|
|
15
|
-
componentId: "sc-
|
|
20
|
+
componentId: "sc-7ce14282-2"
|
|
16
21
|
})([
|
|
17
22
|
"position:relative;"
|
|
18
23
|
]);
|
|
19
24
|
export var StyledHelperText = styled.div.withConfig({
|
|
20
25
|
displayName: "Attach.styles__StyledHelperText",
|
|
21
|
-
componentId: "sc-
|
|
26
|
+
componentId: "sc-7ce14282-3"
|
|
22
27
|
})([
|
|
23
28
|
"position:absolute;margin-top:0.25rem;"
|
|
24
29
|
]);
|
|
25
|
-
export var FilenameWrapper = styled.div.withConfig({
|
|
26
|
-
displayName: "Attach.styles__FilenameWrapper",
|
|
27
|
-
componentId: "sc-ebfa8a10-3"
|
|
28
|
-
})([
|
|
29
|
-
"display:inline-grid;align-items:center;grid-template-columns:auto 1fr;min-width:8ch;"
|
|
30
|
-
]);
|
|
31
|
-
export var TruncatedFilenamePart = styled.span.withConfig({
|
|
32
|
-
displayName: "Attach.styles__TruncatedFilenamePart",
|
|
33
|
-
componentId: "sc-ebfa8a10-4"
|
|
34
|
-
})([
|
|
35
|
-
"",
|
|
36
|
-
""
|
|
37
|
-
], applyEllipsis());
|
|
38
|
-
export var FilenameExtensionPart = styled.span.withConfig({
|
|
39
|
-
displayName: "Attach.styles__FilenameExtensionPart",
|
|
40
|
-
componentId: "sc-ebfa8a10-5"
|
|
41
|
-
})([
|
|
42
|
-
""
|
|
43
|
-
]);
|
|
@@ -9,7 +9,6 @@ export var tokens = {
|
|
|
9
9
|
horizontalGap: '--plasma-attach-horizontal-gap',
|
|
10
10
|
verticalGap: '--plasma-attach-vertical-gap',
|
|
11
11
|
verticalGapWithHelperText: '--plasma-attach-vertical-gap-with-helper-text',
|
|
12
|
-
filenameWrapperHeight: '--plasma-attach-filename-wrapper-height',
|
|
13
12
|
helperTextColor: '--plasma-attach-helper-text-color',
|
|
14
13
|
// Токены для Button
|
|
15
14
|
buttonColor: '--plasma-attach-button-color',
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { extractExtension } from "./extractExtension";
|
|
2
|
+
export var addSeparator = function(filename, separator) {
|
|
3
|
+
var extension = extractExtension(filename);
|
|
4
|
+
var strings = filename.split('.');
|
|
5
|
+
var name = strings.length > 1 ? strings.slice(0, -1).join('.') : strings[0];
|
|
6
|
+
var lastChar = name[name.length - 1];
|
|
7
|
+
var dotChar = '.';
|
|
8
|
+
var nameWithSeparator = "".concat(name.slice(0, -1)).concat(separator).concat(lastChar);
|
|
9
|
+
return extension === name ? "".concat(nameWithSeparator) : "".concat(nameWithSeparator).concat(dotChar).concat(extension);
|
|
10
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { IconBlankCsvOutline, IconBlankDocOutline, IconBlankOutline, IconBlankPdfOutline, IconBlankTxtOutline, IconBlankXlsOutline } from "../../_Icon";
|
|
3
|
-
export var
|
|
3
|
+
export var getFileicon = function(extension, size) {
|
|
4
4
|
var iconSize = size === 'xs' ? 'xs' : 's';
|
|
5
5
|
switch(extension){
|
|
6
6
|
case 'pdf':
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css } from "styled-components";
|
|
2
2
|
import { tokens, classes } from "../../Attach.tokens";
|
|
3
|
-
import {
|
|
3
|
+
import { StyledHelperText, StyledHiddenInputHelper } from "../../Attach.styles";
|
|
4
4
|
export var base = css([
|
|
5
5
|
"&.",
|
|
6
6
|
"{column-gap:var(",
|
|
@@ -18,7 +18,6 @@ export var base = css([
|
|
|
18
18
|
");font-weight:var(",
|
|
19
19
|
");letter-spacing:var(",
|
|
20
20
|
");line-height:var(",
|
|
21
|
-
");height:var(",
|
|
22
21
|
");}",
|
|
23
22
|
"{font-family:var(--plasma-typo-body-xs-font-family);font-size:var(--plasma-typo-body-xs-font-size);font-style:var(--plasma-typo-body-xs-font-style);font-weight:var(--plasma-typo-body-xs-font-weight);letter-spacing:var(--plasma-typo-body-xs-letter-spacing);line-height:var(--plasma-typo-body-xs-line-height);}}"
|
|
24
|
-
], classes.horizontal, tokens.horizontalGap, classes.vertical, tokens.verticalGap, classes.auto, tokens.verticalGap, tokens.horizontalGap, classes.withHelperText, tokens.verticalGapWithHelperText,
|
|
23
|
+
], classes.horizontal, tokens.horizontalGap, classes.vertical, tokens.verticalGap, classes.auto, tokens.verticalGap, tokens.horizontalGap, classes.withHelperText, tokens.verticalGapWithHelperText, StyledHiddenInputHelper, tokens.cellTitleFontFamily, tokens.cellTitleFontSize, tokens.cellTitleFontStyle, tokens.cellTitleFontWeight, tokens.cellTitleLetterSpacing, tokens.cellTitleLineHeight, StyledHelperText);
|
|
@@ -54,9 +54,8 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
54
54
|
return target;
|
|
55
55
|
}
|
|
56
56
|
import React, { forwardRef, useMemo } from "react";
|
|
57
|
-
import cls from "classnames";
|
|
58
57
|
import { useForkRef } from "@salutejs/plasma-core";
|
|
59
|
-
import { getSizeValueFromProp, safeUseId } from "../../utils";
|
|
58
|
+
import { cx, getSizeValueFromProp, safeUseId } from "../../utils";
|
|
60
59
|
import { usePopupContext } from "../Popup";
|
|
61
60
|
import { Overlay } from "../Overlay";
|
|
62
61
|
import { DEFAULT_Z_INDEX } from "../Popup/utils";
|
|
@@ -71,7 +70,7 @@ import { useDrawer } from "./hooks";
|
|
|
71
70
|
// issue #823
|
|
72
71
|
export var drawerRoot = function(Root) {
|
|
73
72
|
return /*#__PURE__*/ forwardRef(function(_param, outerRef) {
|
|
74
|
-
var id = _param.id, zIndex = _param.zIndex, popupInfo = _param.popupInfo, withBlur = _param.withBlur, children = _param.children, view = _param.view, size = _param.size, width = _param.width, height = _param.height, isOpen = _param.isOpen, opened = _param.opened, initialFocusRef = _param.initialFocusRef, focusAfterRef = _param.focusAfterRef,
|
|
73
|
+
var id = _param.id, zIndex = _param.zIndex, popupInfo = _param.popupInfo, withBlur = _param.withBlur, children = _param.children, view = _param.view, size = _param.size, width = _param.width, height = _param.height, isOpen = _param.isOpen, opened = _param.opened, initialFocusRef = _param.initialFocusRef, focusAfterRef = _param.focusAfterRef, className = _param.className, customBackgroundColor = _param.customBackgroundColor, customContentBackgroundColor = _param.customContentBackgroundColor, onClose = _param.onClose, onOverlayClick = _param.onOverlayClick, onEscKeyDown = _param.onEscKeyDown, offset = _param.offset, frame = _param.frame, _param_borderRadius = _param.borderRadius, borderRadius = _param_borderRadius === void 0 ? 'none' : _param_borderRadius, _param_placement = _param.placement, placement = _param_placement === void 0 ? 'right' : _param_placement, _param_closeOnEsc = _param.closeOnEsc, closeOnEsc = _param_closeOnEsc === void 0 ? true : _param_closeOnEsc, _param_closeOnOverlayClick = _param.closeOnOverlayClick, closeOnOverlayClick = _param_closeOnOverlayClick === void 0 ? true : _param_closeOnOverlayClick, _param_asModal = _param.asModal, asModal = _param_asModal === void 0 ? true : _param_asModal, draggable = _param.draggable, rest = _object_without_properties(_param, [
|
|
75
74
|
"id",
|
|
76
75
|
"zIndex",
|
|
77
76
|
"popupInfo",
|
|
@@ -85,7 +84,6 @@ export var drawerRoot = function(Root) {
|
|
|
85
84
|
"opened",
|
|
86
85
|
"initialFocusRef",
|
|
87
86
|
"focusAfterRef",
|
|
88
|
-
"animationInfo",
|
|
89
87
|
"className",
|
|
90
88
|
"customBackgroundColor",
|
|
91
89
|
"customContentBackgroundColor",
|
|
@@ -135,11 +133,10 @@ export var drawerRoot = function(Root) {
|
|
|
135
133
|
onClose();
|
|
136
134
|
}
|
|
137
135
|
};
|
|
138
|
-
var _obj;
|
|
139
136
|
return /*#__PURE__*/ React.createElement(StyledPopup, _object_spread({
|
|
140
137
|
id: innerId,
|
|
141
138
|
ref: asModal ? innerRef : outerRef,
|
|
142
|
-
className:
|
|
139
|
+
className: cx(placementClass),
|
|
143
140
|
opened: innerIsOpen,
|
|
144
141
|
zIndex: zIndex,
|
|
145
142
|
placement: placement,
|
|
@@ -149,7 +146,6 @@ export var drawerRoot = function(Root) {
|
|
|
149
146
|
height: innerHeight,
|
|
150
147
|
offset: offset,
|
|
151
148
|
withAnimation: true,
|
|
152
|
-
drawerAnimationInfo: animationInfo,
|
|
153
149
|
overlay: asModal && /*#__PURE__*/ React.createElement(Root, {
|
|
154
150
|
view: view
|
|
155
151
|
}, /*#__PURE__*/ React.createElement(Overlay, {
|
|
@@ -162,7 +158,6 @@ export var drawerRoot = function(Root) {
|
|
|
162
158
|
onOverlayClick: onDrawerOverlayKeyDown
|
|
163
159
|
}))
|
|
164
160
|
}, rest), /*#__PURE__*/ React.createElement(Root, {
|
|
165
|
-
className: classes.panel,
|
|
166
161
|
view: view,
|
|
167
162
|
size: size,
|
|
168
163
|
style: {
|
|
@@ -174,7 +169,8 @@ export var drawerRoot = function(Root) {
|
|
|
174
169
|
width: innerWidth,
|
|
175
170
|
height: innerHeight,
|
|
176
171
|
customBackgroundColor: customBackgroundColor,
|
|
177
|
-
customContentBackgroundColor: customContentBackgroundColor
|
|
172
|
+
customContentBackgroundColor: customContentBackgroundColor,
|
|
173
|
+
className: className
|
|
178
174
|
}, children)));
|
|
179
175
|
});
|
|
180
176
|
};
|
|
@@ -2,7 +2,7 @@ import styled from "styled-components";
|
|
|
2
2
|
import { component, mergeConfig } from "../../engines";
|
|
3
3
|
import { popupClasses, popupConfig } from "../Popup";
|
|
4
4
|
import { panelTokens, panelConfig } from "../Panel";
|
|
5
|
-
import { classes,
|
|
5
|
+
import { classes, tokens } from "./Drawer.tokens";
|
|
6
6
|
var mergedPanelConfig = mergeConfig(panelConfig);
|
|
7
7
|
var Panel = component(mergedPanelConfig);
|
|
8
8
|
var Popup = component(popupConfig);
|
|
@@ -59,7 +59,7 @@ var getAnimationStyles = function() {
|
|
|
59
59
|
};
|
|
60
60
|
export var StyledPanel = styled(Panel).withConfig({
|
|
61
61
|
displayName: "Drawer.styles__StyledPanel",
|
|
62
|
-
componentId: "sc-
|
|
62
|
+
componentId: "sc-7ba5c890-0"
|
|
63
63
|
})([
|
|
64
64
|
"",
|
|
65
65
|
":var(",
|
|
@@ -67,7 +67,7 @@ export var StyledPanel = styled(Panel).withConfig({
|
|
|
67
67
|
], panelTokens.closeColor, tokens.closeIconColor);
|
|
68
68
|
export var StyledPopup = styled(Popup).withConfig({
|
|
69
69
|
displayName: "Drawer.styles__StyledPopup",
|
|
70
|
-
componentId: "sc-
|
|
70
|
+
componentId: "sc-7ba5c890-1"
|
|
71
71
|
})([
|
|
72
72
|
"&&.",
|
|
73
73
|
"{animation:fadeIn 0.2s forwards;scrollbar-gutter:stable;}&&.",
|
|
@@ -77,24 +77,11 @@ export var StyledPopup = styled(Popup).withConfig({
|
|
|
77
77
|
" > div{width:",
|
|
78
78
|
";height:",
|
|
79
79
|
";}",
|
|
80
|
-
"
|
|
81
|
-
"{&& .",
|
|
82
|
-
"{animation:",
|
|
83
|
-
";}}&.",
|
|
84
|
-
"{&&.",
|
|
85
|
-
" .",
|
|
86
|
-
"{animation:",
|
|
87
|
-
";}}"
|
|
80
|
+
""
|
|
88
81
|
], classes.overlay, popupClasses.endAnimation, classes.overlay, popupClasses.root, popupClasses.root, function(param) {
|
|
89
82
|
var width = param.width;
|
|
90
83
|
return width || 'auto';
|
|
91
84
|
}, function(param) {
|
|
92
85
|
var height = param.height;
|
|
93
86
|
return height || 'auto';
|
|
94
|
-
}, getAnimationStyles()
|
|
95
|
-
var drawerAnimationInfo = param.drawerAnimationInfo;
|
|
96
|
-
return (drawerAnimationInfo === null || drawerAnimationInfo === void 0 ? void 0 : drawerAnimationInfo.enter) || "var(".concat(privateTokens.enterAnimation, ")");
|
|
97
|
-
}, classes.exitCustomAnimation, popupClasses.endAnimation, popupClasses.root, function(param) {
|
|
98
|
-
var drawerAnimationInfo = param.drawerAnimationInfo;
|
|
99
|
-
return (drawerAnimationInfo === null || drawerAnimationInfo === void 0 ? void 0 : drawerAnimationInfo.exit) || "var(".concat(privateTokens.exitAnimation, ")");
|
|
100
|
-
});
|
|
87
|
+
}, getAnimationStyles());
|