oolib 2.9.0 → 2.9.1

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.
@@ -16,31 +16,30 @@ var BlockLabel = function (props) {
16
16
  /*
17
17
  missing parts of this component compared to kPlabel:
18
18
  - deployment._ShowOptionalTag configuration
19
- - localization (translation)
19
+
20
20
  */
21
21
  var label = props.label, sublabel = props.sublabel, inputOnlyLabel = props.inputOnlyLabel, invert = props.invert, isRequired = props.isRequired, readOnly = props.readOnly, className = props.className, style = props.style, error = props.error, //for storybook view purposes
22
22
  errorMsgs = props.errorMsgs;
23
- var shouldCompRender = (label ||
24
- !readOnly && (sublabel || inputOnlyLabel || isRequired === false || (errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.length) > 0));
23
+ var shouldCompRender = label ||
24
+ (!readOnly &&
25
+ (sublabel ||
26
+ inputOnlyLabel ||
27
+ isRequired === false ||
28
+ (errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.length) > 0));
25
29
  var optional = readOnly ? false : isRequired === false;
26
- var errText = errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.map(function (er) { return typeof er === 'object' ? er.text : er; }).join(', ');
30
+ var errText = errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.map(function (er) { return (typeof er === "object" ? er.text : er); }).join(", ");
27
31
  //next 2 vars is for 'test link' usecase
28
32
  var errLink = (errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.length) !== 1 ? undefined : errorMsgs[0].link;
29
- var errType = ((errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.length) !== 1) ? 'danger' : (errorMsgs[0].type || 'danger');
30
- return (shouldCompRender &&
31
- react_1.default.createElement(index_styled_1.StyledBlockLabel, { style: style, className: className },
32
- react_1.default.createElement("div", { style: { display: 'flex', gap: '1rem' } },
33
- react_1.default.createElement(Typo_1.SANS_3, { invert: invert, bold: true, capitalize: true }, label || inputOnlyLabel),
34
- optional && react_1.default.createElement(Typo_1.SANS_3, { color: invert ? greyColor40 : greyColor80 }, "(optional)"),
35
- !readOnly && (error ?
36
- react_1.default.createElement(Typo_1.SANS_3, { color: red },
37
- " ",
38
- error,
39
- " ")
40
- : (errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.length) > 0 ?
41
- react_1.default.createElement(InlineAlert_1.InlineAlert, { text: errText, type: errType, link: errLink, invert: invert })
42
- :
43
- null)),
44
- !readOnly && sublabel && (react_1.default.createElement(Typo_1.SANS_3, { color: invert ? greyColor40 : greyColor80 }, sublabel))));
33
+ var errType = (errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.length) !== 1 ? "danger" : errorMsgs[0].type || "danger";
34
+ return (shouldCompRender && (react_1.default.createElement(index_styled_1.StyledBlockLabel, { style: style, className: className },
35
+ react_1.default.createElement("div", { style: { display: "flex", gap: "1rem" } },
36
+ (label || inputOnlyLabel) && (react_1.default.createElement(Typo_1.SANS_3, { invert: invert, bold: true, capitalize: true }, label || inputOnlyLabel)),
37
+ optional && (react_1.default.createElement(Typo_1.SANS_3, { color: invert ? greyColor40 : greyColor80 }, '(optional)')),
38
+ !readOnly &&
39
+ (error ? (react_1.default.createElement(Typo_1.SANS_3, { color: red },
40
+ " ",
41
+ error,
42
+ " ")) : (errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.length) > 0 ? (react_1.default.createElement(InlineAlert_1.InlineAlert, { text: errText, type: errType, link: errLink, invert: invert })) : null)),
43
+ !readOnly && sublabel && (react_1.default.createElement(Typo_1.SANS_3, { color: invert ? greyColor40 : greyColor80 }, sublabel)))));
45
44
  };
46
45
  exports.BlockLabel = BlockLabel;
@@ -1,10 +1,9 @@
1
- export function TagDisplay({ display, style, invert, M, XS, theme, variant }: {
1
+ export function TagDisplay({ display, style, invert, M, XS, variant }: {
2
2
  display: any;
3
3
  style: any;
4
4
  invert: any;
5
5
  M: any;
6
6
  XS: any;
7
- theme: any;
8
7
  variant?: string;
9
8
  }): JSX.Element;
10
9
  export function TagClear({ id, display, value, M, XS, invert, onClick, variant, grey, }: {
@@ -18,23 +17,21 @@ export function TagClear({ id, display, value, M, XS, invert, onClick, variant,
18
17
  variant?: string;
19
18
  grey: any;
20
19
  }): JSX.Element;
21
- export function TagSelect({ onClick, isSelected, display, value, M, XS, theme, style, onMouseDown }: {
20
+ export function TagSelect({ onClick, isSelected, display, value, M, XS, style, onMouseDown }: {
22
21
  onClick: any;
23
22
  isSelected?: boolean;
24
23
  display: any;
25
24
  value: any;
26
25
  M: any;
27
26
  XS: any;
28
- theme: any;
29
27
  style: any;
30
28
  onMouseDown: any;
31
29
  }): JSX.Element;
32
- export function TagLink({ display, to, invert, M, XS, theme, variant }: {
30
+ export function TagLink({ display, to, invert, M, XS, variant }: {
33
31
  display: any;
34
32
  to: any;
35
33
  invert: any;
36
34
  M: any;
37
35
  XS: any;
38
- theme: any;
39
36
  variant?: string;
40
37
  }): JSX.Element;
@@ -34,10 +34,10 @@ var getTypoComp = function (size) { return size === 'XS'
34
34
  return react_1.default.createElement(Typo_1.SANS_3, null, children);
35
35
  }; };
36
36
  function TagDisplay(_a) {
37
- var display = _a.display, style = _a.style, invert = _a.invert, M = _a.M, XS = _a.XS, theme = _a.theme, _b = _a.variant, variant = _b === void 0 ? 'primary' : _b;
37
+ var display = _a.display, style = _a.style, invert = _a.invert, M = _a.M, XS = _a.XS, _b = _a.variant, variant = _b === void 0 ? 'primary' : _b;
38
38
  var size = M ? 'M' : XS ? 'XS' : 'S';
39
39
  var TYPO_COMP = getTypoComp(size);
40
- return (react_1.default.createElement(index_styled_1.StyledTagDisplay, { variant: variant, invert: invert, theme: theme, size: size, style: style },
40
+ return (react_1.default.createElement(index_styled_1.StyledTagDisplay, { variant: variant, invert: invert, size: size, style: style },
41
41
  react_1.default.createElement(TYPO_COMP, null, display)));
42
42
  }
43
43
  exports.TagDisplay = TagDisplay;
@@ -53,7 +53,7 @@ function TagClear(_a) {
53
53
  }
54
54
  exports.TagClear = TagClear;
55
55
  function TagSelect(_a) {
56
- var onClick = _a.onClick, _b = _a.isSelected, isSelected = _b === void 0 ? false : _b, display = _a.display, value = _a.value, M = _a.M, XS = _a.XS, theme = _a.theme, style = _a.style, onMouseDown = _a.onMouseDown;
56
+ var onClick = _a.onClick, _b = _a.isSelected, isSelected = _b === void 0 ? false : _b, display = _a.display, value = _a.value, M = _a.M, XS = _a.XS, style = _a.style, onMouseDown = _a.onMouseDown;
57
57
  var _c = (0, react_1.useState)(isSelected), selected = _c[0], setSelected = _c[1];
58
58
  var handleOnClick = function () {
59
59
  setSelected(!selected);
@@ -66,16 +66,16 @@ function TagSelect(_a) {
66
66
  }, [isSelected]);
67
67
  var size = M ? 'M' : XS ? 'XS' : 'S';
68
68
  var TYPO_COMP = getTypoComp(size);
69
- return (react_1.default.createElement(index_styled_1.StyledTagSelect, { theme: theme, onClick: onMouseDown ? function () { return null; } : handleOnClick, selected: selected, size: size, style: style, onMouseDown: onMouseDown },
69
+ return (react_1.default.createElement(index_styled_1.StyledTagSelect, { onClick: onMouseDown ? function () { return null; } : handleOnClick, selected: selected, size: size, style: style, onMouseDown: onMouseDown },
70
70
  react_1.default.createElement(TYPO_COMP, null, display)));
71
71
  }
72
72
  exports.TagSelect = TagSelect;
73
73
  function TagLink(_a) {
74
- var display = _a.display, to = _a.to, invert = _a.invert, M = _a.M, XS = _a.XS, theme = _a.theme, _b = _a.variant, variant = _b === void 0 ? 'primary' : _b;
74
+ var display = _a.display, to = _a.to, invert = _a.invert, M = _a.M, XS = _a.XS, _b = _a.variant, variant = _b === void 0 ? 'primary' : _b;
75
75
  var size = M ? 'M' : XS ? 'XS' : 'S';
76
76
  var TYPO_COMP = getTypoComp(size);
77
77
  return (react_1.default.createElement(index_styled_1.StyledLink, { to: to },
78
- react_1.default.createElement(index_styled_1.StyledTagLink, { theme: theme, variant: variant, invert: invert, size: size },
78
+ react_1.default.createElement(index_styled_1.StyledTagLink, { variant: variant, invert: invert, size: size },
79
79
  react_1.default.createElement(TYPO_COMP, null, display))));
80
80
  }
81
81
  exports.TagLink = TagLink;
@@ -28,7 +28,8 @@ var styled_components_1 = __importStar(require("styled-components"));
28
28
  var colors_1 = require("../../themes/colors");
29
29
  var react_router_dom_1 = require("react-router-dom");
30
30
  var mixins_1 = require("../../themes/mixins");
31
- var greyColor100 = colors_1.colors.greyColor100, greyColor80 = colors_1.colors.greyColor80, greyColor10 = colors_1.colors.greyColor10, greyColor15 = colors_1.colors.greyColor15, greyColor40 = colors_1.colors.greyColor40, white = colors_1.colors.white, primaryColor10 = colors_1.colors.primaryColor10, primaryColor40 = colors_1.colors.primaryColor40, primaryColor100 = colors_1.colors.primaryColor100, primaryColorText = colors_1.colors.primaryColorText;
31
+ var utilsOolib_1 = require("../../utilsOolib");
32
+ var greyColor100 = colors_1.colors.greyColor100, greyColor80 = colors_1.colors.greyColor80, greyColor10 = colors_1.colors.greyColor10, greyColor15 = colors_1.colors.greyColor15, greyColor40 = colors_1.colors.greyColor40, white = colors_1.colors.white;
32
33
  var SIZES = {
33
34
  XS: '2rem',
34
35
  S: "3rem",
@@ -41,10 +42,10 @@ var commonStyle = function (_a) {
41
42
  var blueHover = function (_a) {
42
43
  var invert = _a.invert, colors = _a.colors;
43
44
  return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t&:hover {\n\t\tbackground-color: ", ";\n\t\tcolor: ", ";\t\t\n\t}\n"], ["\n\t&:hover {\n\t\tbackground-color: ", ";\n\t\tcolor: ", ";\t\t\n\t}\n"])), invert
44
- ? (colors === null || colors === void 0 ? void 0 : colors.primaryColor10) || primaryColor10
45
- : (colors === null || colors === void 0 ? void 0 : colors.primaryColor40) || primaryColor40, invert
45
+ ? (0, utilsOolib_1.getPrimaryColor10)(colors)
46
+ : (0, utilsOolib_1.getPrimaryColor40)(colors), invert
46
47
  ? greyColor100
47
- : (colors === null || colors === void 0 ? void 0 : colors.primaryColorText) || primaryColorText);
48
+ : (0, utilsOolib_1.getPrimaryColorText)(colors));
48
49
  };
49
50
  var greyHover = function (_a) {
50
51
  var invert = _a.invert;
@@ -70,15 +71,15 @@ var StyledTagClear = styled_components_1.default.div(templateObject_11 || (templ
70
71
  if (variant === "primary") {
71
72
  return grey
72
73
  ? (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), !invert ? greyColor15 : greyColor80, !invert ? greyColor80 : greyColor15) : (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), !invert
73
- ? (colors === null || colors === void 0 ? void 0 : colors.primaryColor100) || primaryColor100
74
- : (colors === null || colors === void 0 ? void 0 : colors.primaryColor40) || primaryColor40, !invert ? white : greyColor100);
74
+ ? (0, utilsOolib_1.getPrimaryColor100)(colors)
75
+ : (0, utilsOolib_1.getPrimaryColor40)(colors), !invert ? white : greyColor100);
75
76
  }
76
77
  else {
77
78
  // secondry
78
79
  return grey
79
- ? (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background: none;\n border: ", " solid ", ";\n color: ", ";\n "], ["\n background: none;\n border: ", " solid ", ";\n color: ", ";\n "])), size === "XS" ? "1px" : "2px", !invert ? greyColor15 : greyColor80, !invert ? greyColor80 : greyColor15) : (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n background: none;\n border: ", " solid\n ", ";\n color: ", ";\n "], ["\n background: none;\n border: ", " solid\n ", ";\n color: ", ";\n "])), size === "XS" ? "1px" : "2px", !invert ? (colors === null || colors === void 0 ? void 0 : colors.primaryColor100) || primaryColor100 : (colors === null || colors === void 0 ? void 0 : colors.primaryColor40) || primaryColor40, !invert
80
- ? (colors === null || colors === void 0 ? void 0 : colors.primaryColorText) || primaryColorText
81
- : (colors === null || colors === void 0 ? void 0 : colors.primaryColor40) || primaryColor40);
80
+ ? (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background: none;\n border: ", " solid ", ";\n color: ", ";\n "], ["\n background: none;\n border: ", " solid ", ";\n color: ", ";\n "])), size === "XS" ? "1px" : "2px", !invert ? greyColor15 : greyColor80, !invert ? greyColor80 : greyColor15) : (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n background: none;\n border: ", " solid\n ", ";\n color: ", ";\n "], ["\n background: none;\n border: ", " solid\n ", ";\n color: ", ";\n "])), size === "XS" ? "1px" : "2px", !invert ? (0, utilsOolib_1.getPrimaryColor100)(colors) : (0, utilsOolib_1.getPrimaryColor40)(colors), !invert
81
+ ? (0, utilsOolib_1.getPrimaryColorText)(colors)
82
+ : (0, utilsOolib_1.getPrimaryColor40)(colors));
82
83
  }
83
84
  }, function (_a) {
84
85
  var variant = _a.variant;
@@ -97,7 +98,7 @@ var StyledTagSelect = styled_components_1.default.div(templateObject_15 || (temp
97
98
  return commonStyle({ size: size });
98
99
  }, (0, mixins_1.multiTransition)("background-color"), function (_a) {
99
100
  var selected = _a.selected, size = _a.size, colors = _a.theme.colors;
100
- return (0, styled_components_1.css)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n border: ", " solid ", ";\n cursor: pointer;\n background-color: ", ";\n\tcolor: ", ";\n\t\t", "\n "], ["\n border: ", " solid ", ";\n cursor: pointer;\n background-color: ", ";\n\tcolor: ", ";\n\t\t", "\n "])), size === "XS" ? "1px" : "2px", (colors === null || colors === void 0 ? void 0 : colors.primaryColor100) || primaryColor100, selected ? (colors === null || colors === void 0 ? void 0 : colors.primaryColor100) || primaryColor100 : null, !selected ? (colors === null || colors === void 0 ? void 0 : colors.primaryColorText) || primaryColorText : white, !selected && (0, styled_components_1.css)(templateObject_13 || (templateObject_13 = __makeTemplateObject(["&:hover {\n\t\tbackground-color: ", ";\n\t\tcolor: ", ";\n\t\t\t\n\t\t}"], ["&:hover {\n\t\tbackground-color: ", ";\n\t\tcolor: ", ";\n\t\t\t\n\t\t}"])), (colors === null || colors === void 0 ? void 0 : colors.primaryColor40) || primaryColor40, (colors === null || colors === void 0 ? void 0 : colors.primaryColorText) || primaryColorText));
101
+ return (0, styled_components_1.css)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n border: ", " solid ", ";\n cursor: pointer;\n background-color: ", ";\n\tcolor: ", ";\n\t\t", "\n "], ["\n border: ", " solid ", ";\n cursor: pointer;\n background-color: ", ";\n\tcolor: ", ";\n\t\t", "\n "])), size === "XS" ? "1px" : "2px", (0, utilsOolib_1.getPrimaryColor100)(colors), selected ? (0, utilsOolib_1.getPrimaryColor100)(colors) : null, !selected ? (0, utilsOolib_1.getPrimaryColorText)(colors) : white, !selected && (0, styled_components_1.css)(templateObject_13 || (templateObject_13 = __makeTemplateObject(["&:hover {\n\t\tbackground-color: ", ";\n\t\tcolor: ", ";\n\t\t\t\n\t\t}"], ["&:hover {\n\t\tbackground-color: ", ";\n\t\tcolor: ", ";\n\t\t\t\n\t\t}"])), (0, utilsOolib_1.getPrimaryColor40)(colors), (0, utilsOolib_1.getPrimaryColorText)(colors)));
101
102
  });
102
103
  exports.StyledTagSelect = StyledTagSelect;
103
104
  var StyledTagLink = styled_components_1.default.div(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n \t", "\n\t", ";\n ", "\n"], ["\n \t", "\n\t", ";\n ", "\n"])), function (_a) {
@@ -107,9 +108,9 @@ var StyledTagLink = styled_components_1.default.div(templateObject_18 || (templa
107
108
  var variant = _a.variant, invert = _a.invert, size = _a.size, colors = _a.theme.colors;
108
109
  return variant === "primary"
109
110
  ? (0, styled_components_1.css)(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n \t\tbackground-color: ", ";\n \t\tcolor: ", ";\n\t\t\t\t", ";\n \t"], ["\n \t\tbackground-color: ", ";\n \t\tcolor: ", ";\n\t\t\t\t", ";\n \t"])), !invert
110
- ? (colors === null || colors === void 0 ? void 0 : colors.primaryColor100) || primaryColor100
111
- : (colors === null || colors === void 0 ? void 0 : colors.primaryColor40) || primaryColor40, !invert ? white : greyColor100, blueHover({ invert: invert, colors: colors })) : // secondary
112
- (0, styled_components_1.css)(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n \t\tbackground: none;\n \t\tborder: ", " solid ", ";\n \t\tcolor: ", ";\n\t\t\t\t", "\n \t"], ["\n \t\tbackground: none;\n \t\tborder: ", " solid ", ";\n \t\tcolor: ", ";\n\t\t\t\t", "\n \t"])), size === "XS" ? "1px" : "2px", !invert ? (colors === null || colors === void 0 ? void 0 : colors.primaryColor100) || primaryColor100 : (colors === null || colors === void 0 ? void 0 : colors.primaryColor40) || primaryColor40, !invert ? (colors === null || colors === void 0 ? void 0 : colors.primaryColorText) || primaryColorText : (colors === null || colors === void 0 ? void 0 : colors.primaryColor40) || primaryColor40, blueHover({ invert: invert, colors: colors }));
111
+ ? (0, utilsOolib_1.getPrimaryColor100)(colors)
112
+ : (0, utilsOolib_1.getPrimaryColor40)(colors), !invert ? white : greyColor100, blueHover({ invert: invert, colors: colors })) : // secondary
113
+ (0, styled_components_1.css)(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n \t\tbackground: none;\n \t\tborder: ", " solid ", ";\n \t\tcolor: ", ";\n\t\t\t\t", "\n \t"], ["\n \t\tbackground: none;\n \t\tborder: ", " solid ", ";\n \t\tcolor: ", ";\n\t\t\t\t", "\n \t"])), size === "XS" ? "1px" : "2px", !invert ? (0, utilsOolib_1.getPrimaryColor100)(colors) : (0, utilsOolib_1.getPrimaryColor40)(colors), !invert ? (0, utilsOolib_1.getPrimaryColorText)(colors) : (0, utilsOolib_1.getPrimaryColor40)(colors), blueHover({ invert: invert, colors: colors }));
113
114
  });
114
115
  exports.StyledTagLink = StyledTagLink;
115
116
  var StyledLink = (0, styled_components_1.default)(react_router_dom_1.NavLink)(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n text-decoration: none;\n"], ["\n text-decoration: none;\n"])));
@@ -74,7 +74,7 @@ var Loader_1 = require("../Loader");
74
74
  var BlockLabel_1 = require("../BlockLabel");
75
75
  var Typo_1 = require("../Typo");
76
76
  var Buttons_1 = require("../Buttons");
77
- var utils_1 = require("../utils");
77
+ var utils_1 = require("../../utils");
78
78
  var DisplayIcon = function (_a) {
79
79
  var icon = _a.icon, onClick = _a.onClick, size = _a.size;
80
80
  var IconComp = icons_1.icons[icon];
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.TypoClassesProvider = exports.BLOCKQUOTE = exports.SERIF_9_10 = exports.SERIF_7_8 = exports.SERIF_5_6 = exports.SERIF_4_5 = exports.SERIF_3_4 = exports.SERIF_3 = exports.SANS_7_8 = exports.SANS_5_6 = exports.SANS_4_5 = exports.SANS_4 = exports.SANS_3 = exports.SANS_2 = exports.SANS_0 = exports.LABEL = void 0;
18
18
  var react_1 = __importDefault(require("react"));
19
19
  var index_styled_1 = require("./index.styled");
20
- var styled_components_1 = require("styled-components");
20
+ var utilsOolib_1 = require("../../utilsOolib");
21
21
  var genFontStylingProps = function (props) {
22
22
  var _a;
23
23
  var fontSetting = {
@@ -47,10 +47,10 @@ var genFontStylingProps = function (props) {
47
47
  };
48
48
  var GenComp = function (_a) {
49
49
  var props = _a.props, Comp = _a.Comp;
50
- var currentTheme = (0, styled_components_1.useTheme)();
50
+ var localize = (0, utilsOolib_1.useLocale)();
51
51
  var invert = props.invert, value = props.value, suffix = props.suffix, color = props.color, children = props.children, theme = props.theme, style = props.style, className = props.className;
52
52
  var displayText = children || value;
53
- var localText = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.localize) ? currentTheme.localize(displayText) : displayText;
53
+ var localText = localize(displayText);
54
54
  return (react_1.default.createElement(Comp, __assign({}, genFontStylingProps(props), { color: color, theme: theme, className: className, style: style, invert: invert }),
55
55
  localText,
56
56
  suffix || ''));
@@ -1,4 +1,4 @@
1
- export function mediaQuery(point: any): any;
1
+ export function mediaQuery(point: any): string;
2
2
  export function getBreakPoint(point: any): 0 | 600 | 800 | 1000 | 1300 | 1600 | "pass a valid breakpoint";
3
3
  import { transition } from "./transitions";
4
4
  import { transitionWithDuration } from "./transitions";
@@ -1,11 +1,6 @@
1
1
  "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
2
  Object.defineProperty(exports, "__esModule", { value: true });
7
3
  exports.isElementInViewport = exports.multiTransition = exports.transitionWithDelay = exports.transitionWithDuration = exports.transition = exports.getBreakPoint = exports.mediaQuery = void 0;
8
- var styled_components_1 = require("styled-components");
9
4
  var transitions_1 = require("./transitions");
10
5
  Object.defineProperty(exports, "transition", { enumerable: true, get: function () { return transitions_1.transition; } });
11
6
  Object.defineProperty(exports, "transitionWithDuration", { enumerable: true, get: function () { return transitions_1.transitionWithDuration; } });
@@ -31,7 +26,7 @@ var getBreakPoint = function (point) {
31
26
  };
32
27
  exports.getBreakPoint = getBreakPoint;
33
28
  var mediaQuery = function (point) {
34
- return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["@media only screen and (min-width: ", "px)"], ["@media only screen and (min-width: ", "px)"])), getBreakPoint(point));
29
+ return "@media only screen and (min-width: ".concat(getBreakPoint(point), "px)");
35
30
  };
36
31
  exports.mediaQuery = mediaQuery;
37
32
  var isElementInViewport = function (el) {
@@ -44,4 +39,3 @@ var isElementInViewport = function (el) {
44
39
  rect.right <= (window.innerWidth || document.documentElement.clientWidth));
45
40
  };
46
41
  exports.isElementInViewport = isElementInViewport;
47
- var templateObject_1;
File without changes
File without changes
@@ -0,0 +1,5 @@
1
+ export function useLocale(): (text: any) => any;
2
+ export function getPrimaryColor10(colors: any): any;
3
+ export function getPrimaryColor40(colors: any): any;
4
+ export function getPrimaryColor100(colors: any): any;
5
+ export function getPrimaryColorText(colors: any): any;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ /**
3
+ * @note : THESE ARE NOT MEANT TO BE EXPORTED
4
+ *
5
+ * These are utility functions that make certain tasks
6
+ * within oolib easier
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.getPrimaryColorText = exports.getPrimaryColor100 = exports.getPrimaryColor40 = exports.getPrimaryColor10 = exports.useLocale = void 0;
10
+ var styled_components_1 = require("styled-components");
11
+ var colors_1 = require("../themes/colors");
12
+ var primaryColor10 = colors_1.colors.primaryColor10, primaryColor40 = colors_1.colors.primaryColor40, primaryColor100 = colors_1.colors.primaryColor100, primaryColorText = colors_1.colors.primaryColorText;
13
+ var useLocale = function () {
14
+ var currentTheme = (0, styled_components_1.useTheme)();
15
+ var localize = function (text) {
16
+ return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.localize)
17
+ ? currentTheme.localize(text)
18
+ : text;
19
+ };
20
+ return localize;
21
+ };
22
+ exports.useLocale = useLocale;
23
+ var getPrimaryColor10 = function (colors) {
24
+ return (colors === null || colors === void 0 ? void 0 : colors.primaryColor10) || primaryColor10;
25
+ };
26
+ exports.getPrimaryColor10 = getPrimaryColor10;
27
+ var getPrimaryColor40 = function (colors) {
28
+ return (colors === null || colors === void 0 ? void 0 : colors.primaryColor40) || primaryColor40;
29
+ };
30
+ exports.getPrimaryColor40 = getPrimaryColor40;
31
+ var getPrimaryColor100 = function (colors) {
32
+ return (colors === null || colors === void 0 ? void 0 : colors.primaryColor100) || primaryColor100;
33
+ };
34
+ exports.getPrimaryColor100 = getPrimaryColor100;
35
+ var getPrimaryColorText = function (colors) {
36
+ return (colors === null || colors === void 0 ? void 0 : colors.primaryColorText) || primaryColorText;
37
+ };
38
+ exports.getPrimaryColorText = getPrimaryColorText;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",