oolib 2.17.13 → 2.17.14

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.
@@ -1 +1,4 @@
1
- export function Loader(props: any): JSX.Element;
1
+ export function Loader({ isBlock, ...props }: {
2
+ [x: string]: any;
3
+ isBlock?: boolean;
4
+ }): JSX.Element;
@@ -10,6 +10,17 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
13
24
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
25
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
26
  };
@@ -22,32 +33,34 @@ var styled_components_1 = require("styled-components");
22
33
  var greyColor100 = colors_1.colors.greyColor100;
23
34
  var styled_1 = require("./styled");
24
35
  var LoaderDiv = function (_a) {
25
- var L = _a.L, _b = _a.M, M = _b === void 0 ? true : _b, S = _a.S, children = _a.children, _text = _a.text, debug = _a.debug, invert = _a.invert, _c = _a.isBlock, isBlock = _c === void 0 ? true : _c;
36
+ var L = _a.L, M = _a.M, S = _a.S, children = _a.children, _text = _a.text, debug = _a.debug, invert = _a.invert, _b = _a.isBlock, isBlock = _b === void 0 ? true : _b;
26
37
  var theme = (0, styled_components_1.useTheme)();
27
38
  var text = _text || children;
39
+ //defaults to M if neither are specified
28
40
  var getTypoSizeAndTrackSize = function (_a) {
29
41
  var L = _a.L, M = _a.M, S = _a.S;
30
42
  switch (true) {
31
43
  case L:
32
44
  return { TypoComp: Typo_1.SANS_4_5, trackSize: 10, size: 70 };
33
- case M:
34
- return { TypoComp: Typo_1.SANS_3, trackSize: 7, size: 43 };
35
45
  case S:
36
- default:
37
46
  return { TypoComp: Typo_1.SANS_2, trackSize: 3.65, size: 21.35 };
47
+ case M:
48
+ default:
49
+ return { TypoComp: Typo_1.SANS_3, trackSize: 7, size: 43 };
38
50
  }
39
51
  };
40
- var _d = getTypoSizeAndTrackSize({ L: L, M: M, S: S }), TypoComp = _d.TypoComp, trackSize = _d.trackSize, size = _d.size;
52
+ var _c = getTypoSizeAndTrackSize({ L: L, M: M, S: S }), TypoComp = _c.TypoComp, trackSize = _c.trackSize, size = _c.size;
41
53
  return (react_1.default.createElement(styled_1.StyledLoaderWrapper, __assign({}, { isBlock: isBlock }),
42
54
  react_1.default.createElement(styled_1.StyledLoader, __assign({}, { size: size, trackSize: trackSize, invert: invert })),
43
55
  (text || ((theme === null || theme === void 0 ? void 0 : theme._Env) === "dev" && debug)) && (react_1.default.createElement(TypoComp, __assign({ invert: invert }, (L ? { bold: true } : { semibold: true })), "".concat((theme === null || theme === void 0 ? void 0 : theme._Env) === "dev" && debug ? debug : "").concat(text)))));
44
56
  };
45
- // still dont think we need to have this overlay thing,
57
+ // still dont think we need to have this overlay thing,
46
58
  // but lets consult with design and make a decision on this
47
- //also i think the gap between loader and text should also be modified dynamically based on
59
+ //also i think the gap between loader and text should also be modified dynamically based on
48
60
  //size L, M or S
49
- var Loader = function (props) {
50
- return !props.isBlock ? (react_1.default.createElement(LoaderDiv, __assign({}, props))) : (react_1.default.createElement(styled_1.StyledLoaderOverlay, __assign({}, props),
51
- react_1.default.createElement(LoaderDiv, __assign({}, props))));
52
- };
61
+ function Loader(_a) {
62
+ var _b = _a.isBlock, isBlock = _b === void 0 ? true : _b, props = __rest(_a, ["isBlock"]);
63
+ var renderLoaderDiv = function () { return react_1.default.createElement(LoaderDiv, __assign({}, __assign(__assign({}, props), { isBlock: isBlock }))); };
64
+ return !isBlock ? (renderLoaderDiv()) : (react_1.default.createElement(styled_1.StyledLoaderOverlay, __assign({}, { blockHeight: props.blockHeight }), renderLoaderDiv()));
65
+ }
53
66
  exports.Loader = Loader;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.17.13",
3
+ "version": "2.17.14",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",