@ovotech/element-native 3.2.1 → 3.2.2-canary-a36120c-121

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.
@@ -50,7 +50,7 @@ var StyledCheckboxInputWrapper = styled_native_1.default.View(function (_a) {
50
50
  var StyledCheckboxInput = styled_native_1.default.View(function (_a) {
51
51
  var _b = _a.theme, core = _b.core, semantic = _b.semantic, invalid = _a.invalid, checked = _a.checked;
52
52
  return "\n width: ".concat(core.space[6], ";\n height: ").concat(core.space[6], ";\n border: ").concat(core.borderWidth.small, " solid;\n margin-top: 10px;\n border-radius: ").concat(core.radius.small, ";\n border-color: ").concat(invalid
53
- ? semantic.error.border
53
+ ? semantic.message.error
54
54
  : checked
55
55
  ? core.color.blue.dark
56
56
  : semantic.border.functional, ";\n background: ").concat(checked ? core.color.blue.lightest : 'transparent', ";\n ");
@@ -37,7 +37,7 @@ var StyledErrorText = styled_native_1.default.Text(function (_a) {
37
37
  : core.fontSize.body.small;
38
38
  return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, smallAndUp
39
39
  ? core.lineHeight.body.large
40
- : core.lineHeight.body.small, fontSize, semantic.error.message);
40
+ : core.lineHeight.body.small, fontSize, semantic.message.error);
41
41
  });
42
42
  var ErrorText = (0, utils_1.styledComponentWithBreakpoints)(StyledErrorText);
43
43
  exports.ErrorText = ErrorText;
@@ -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, short = _a.short, breakpoints = _a.breakpoints;
38
- return "\n background-color: ".concat(core.color.neutral.light, ";\n margin-bottom: ").concat(core.space[2], ";\n ").concat((0, utils_1.responsiveStyle)('height', core.fontSize.body, breakpoints), "\n\n ").concat(short ? 'width: 50%' : '', ";\n ");
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, breakpoints: breakpoints }, "line-".concat(i)));
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
  };
@@ -44,7 +44,7 @@ var StyledCheckboxInputWrapper = styled.View(function (_a) {
44
44
  var StyledCheckboxInput = styled.View(function (_a) {
45
45
  var _b = _a.theme, core = _b.core, semantic = _b.semantic, invalid = _a.invalid, checked = _a.checked;
46
46
  return "\n width: ".concat(core.space[6], ";\n height: ").concat(core.space[6], ";\n border: ").concat(core.borderWidth.small, " solid;\n margin-top: 10px;\n border-radius: ").concat(core.radius.small, ";\n border-color: ").concat(invalid
47
- ? semantic.error.border
47
+ ? semantic.message.error
48
48
  : checked
49
49
  ? core.color.blue.dark
50
50
  : semantic.border.functional, ";\n background: ").concat(checked ? core.color.blue.lightest : 'transparent', ";\n ");
@@ -11,7 +11,7 @@ var StyledErrorText = styled.Text(function (_a) {
11
11
  : core.fontSize.body.small;
12
12
  return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, smallAndUp
13
13
  ? core.lineHeight.body.large
14
- : core.lineHeight.body.small, fontSize, semantic.error.message);
14
+ : core.lineHeight.body.small, fontSize, semantic.message.error);
15
15
  });
16
16
  var ErrorText = styledComponentWithBreakpoints(StyledErrorText);
17
17
  export { ErrorText };
@@ -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, short = _a.short, breakpoints = _a.breakpoints;
32
- return "\n background-color: ".concat(core.color.neutral.light, ";\n margin-bottom: ").concat(core.space[2], ";\n ").concat(responsiveStyle('height', core.fontSize.body, breakpoints), "\n\n ").concat(short ? 'width: 50%' : '', ";\n ");
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, breakpoints: breakpoints }, "line-".concat(i)));
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.1",
3
+ "version": "3.2.2-canary-a36120c-121",
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-a36120c-121",
17
17
  "deepmerge": "^4.2.2",
18
18
  "lodash.groupby": "^4.6.0"
19
19
  },