@ovotech/element-native 3.2.2 → 3.2.3-canary-a51d195-122
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.
|
@@ -29,20 +29,19 @@ exports.SkeletonText = void 0;
|
|
|
29
29
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
30
|
var hooks_1 = require("../../hooks");
|
|
31
31
|
var styled_native_1 = __importDefault(require("../../styled.native"));
|
|
32
|
-
var utils_1 = require("../../utils");
|
|
33
32
|
var Text_1 = require("../Text");
|
|
34
33
|
var Skeleton_1 = require("./Skeleton");
|
|
35
34
|
var SkeletonAnimation_1 = require("./SkeletonAnimation");
|
|
36
35
|
var StyledSkeletonText = (0, styled_native_1.default)(Skeleton_1.Skeleton)(function (_a) {
|
|
37
|
-
var core = _a.theme.core,
|
|
38
|
-
return "\n background-color: ".concat(core.color.neutral.light, ";\n margin-bottom: ").concat(core.space[2], ";\n ").concat(
|
|
36
|
+
var core = _a.theme.core, aboveSmallBreakpoint = _a.aboveSmallBreakpoint, short = _a.short;
|
|
37
|
+
return "\n background-color: ".concat(core.color.neutral.light, ";\n margin-bottom: ").concat(core.space[2], ";\n height: ").concat(aboveSmallBreakpoint ? core.fontSize.body.large : core.fontSize.body.small, ";\n\n ").concat(short ? 'width: 50%' : '', ";\n ");
|
|
39
38
|
});
|
|
40
39
|
var SkeletonText = function (_a) {
|
|
41
40
|
var _b = _a.lines, lines = _b === void 0 ? 1 : _b, rest = __rest(_a, ["lines"]);
|
|
42
|
-
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
43
41
|
var generatedLines = [];
|
|
42
|
+
var smallAndUp = (0, hooks_1.useBreakpoint)().smallAndUp;
|
|
44
43
|
for (var i = 1; i <= lines; i++) {
|
|
45
|
-
generatedLines.push((0, jsx_runtime_1.jsx)(StyledSkeletonText, { short: i === lines,
|
|
44
|
+
generatedLines.push((0, jsx_runtime_1.jsx)(StyledSkeletonText, { short: i === lines, aboveSmallBreakpoint: smallAndUp }, "line-".concat(i)));
|
|
46
45
|
}
|
|
47
46
|
return ((0, jsx_runtime_1.jsx)(Text_1.P, __assign({ as: SkeletonAnimation_1.SkeletonAnimation }, rest, { children: generatedLines })));
|
|
48
47
|
};
|
|
@@ -23,20 +23,19 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
24
|
import { useBreakpoint } from '../../hooks';
|
|
25
25
|
import styled from '../../styled.native';
|
|
26
|
-
import { responsiveStyle } from '../../utils';
|
|
27
26
|
import { P } from '../Text';
|
|
28
27
|
import { Skeleton } from './Skeleton';
|
|
29
28
|
import { SkeletonAnimation } from './SkeletonAnimation';
|
|
30
29
|
var StyledSkeletonText = styled(Skeleton)(function (_a) {
|
|
31
|
-
var core = _a.theme.core,
|
|
32
|
-
return "\n background-color: ".concat(core.color.neutral.light, ";\n margin-bottom: ").concat(core.space[2], ";\n ").concat(
|
|
30
|
+
var core = _a.theme.core, aboveSmallBreakpoint = _a.aboveSmallBreakpoint, short = _a.short;
|
|
31
|
+
return "\n background-color: ".concat(core.color.neutral.light, ";\n margin-bottom: ").concat(core.space[2], ";\n height: ").concat(aboveSmallBreakpoint ? core.fontSize.body.large : core.fontSize.body.small, ";\n\n ").concat(short ? 'width: 50%' : '', ";\n ");
|
|
33
32
|
});
|
|
34
33
|
export var SkeletonText = function (_a) {
|
|
35
34
|
var _b = _a.lines, lines = _b === void 0 ? 1 : _b, rest = __rest(_a, ["lines"]);
|
|
36
|
-
var breakpoints = useBreakpoint();
|
|
37
35
|
var generatedLines = [];
|
|
36
|
+
var smallAndUp = useBreakpoint().smallAndUp;
|
|
38
37
|
for (var i = 1; i <= lines; i++) {
|
|
39
|
-
generatedLines.push(_jsx(StyledSkeletonText, { short: i === lines,
|
|
38
|
+
generatedLines.push(_jsx(StyledSkeletonText, { short: i === lines, aboveSmallBreakpoint: smallAndUp }, "line-".concat(i)));
|
|
40
39
|
}
|
|
41
40
|
return (_jsx(P, __assign({ as: SkeletonAnimation }, rest, { children: generatedLines })));
|
|
42
41
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ovotech/element-native",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3-canary-a51d195-122",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"url": "@ovotech/element"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ovotech/element-core": "^2.0.1",
|
|
16
|
+
"@ovotech/element-core": "^2.0.1-canary-a51d195-122",
|
|
17
17
|
"deepmerge": "^4.2.2",
|
|
18
18
|
"lodash.groupby": "^4.6.0"
|
|
19
19
|
},
|