oolib 2.111.0 → 2.111.2

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.
@@ -91,7 +91,7 @@ function DropdownSingle(_a) {
91
91
  (0, handlers_1.handleSelect_SINGLE)({
92
92
  id: id,
93
93
  newVal: newVal,
94
- prevVal: value,
94
+ // prevVal: value,
95
95
  // hideShowOtherTextInputOnSelect_SINGLE,
96
96
  handleHideOptions: handleHideOptions,
97
97
  saveValueAsString: saveValueAsString,
@@ -5,11 +5,10 @@ export function handleSelect_MULTI({ parentOnChange, id, prevVal, newVal, saveVa
5
5
  newVal: any;
6
6
  saveValueAsString: any;
7
7
  }): void;
8
- export function handleSelect_SINGLE({ parentOnChange, handleHideOptions, id, newVal, prevVal, saveValueAsString }: {
8
+ export function handleSelect_SINGLE({ parentOnChange, handleHideOptions, id, newVal, saveValueAsString }: {
9
9
  parentOnChange: any;
10
10
  handleHideOptions: any;
11
11
  id: any;
12
12
  newVal: any;
13
- prevVal: any;
14
13
  saveValueAsString: any;
15
14
  }): void;
@@ -30,7 +30,9 @@ exports.handleSelect_MULTI = handleSelect_MULTI;
30
30
  var handleSelect_SINGLE = function (_a) {
31
31
  var parentOnChange = _a.parentOnChange,
32
32
  // hideShowOtherTextInputOnSelect_SINGLE,
33
- handleHideOptions = _a.handleHideOptions, id = _a.id, newVal = _a.newVal, prevVal = _a.prevVal, saveValueAsString = _a.saveValueAsString;
33
+ handleHideOptions = _a.handleHideOptions, id = _a.id, newVal = _a.newVal,
34
+ // prevVal,
35
+ saveValueAsString = _a.saveValueAsString;
34
36
  /**
35
37
  * this enables removing the selected option, if clicked on again
36
38
  * but disabled for now, cuz deselecting was causing all sorts of sideeffects on the platform
@@ -1,4 +1,15 @@
1
1
  import React from 'react';
2
+ export interface TypoProps {
3
+ invert?: boolean;
4
+ value?: string;
5
+ suffix?: string;
6
+ color?: string;
7
+ children?: React.ReactNode;
8
+ theme?: any;
9
+ style?: React.CSSProperties;
10
+ className?: string;
11
+ [key: string]: any;
12
+ }
2
13
  export declare const LABEL: React.FunctionComponent<TypoCompProps>;
3
14
  export interface TypoCompProps {
4
15
  [key: string]: any;
@@ -61,7 +61,7 @@ var GenComp = function (_a) {
61
61
  var localize = (0, utilsOolib_1.useLocale)();
62
62
  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, restProps = __rest(props, ["invert", "value", "suffix", "color", "children", "theme", "style", "className"]);
63
63
  var displayText = children || value;
64
- var localText = localize(displayText === null || displayText === void 0 ? void 0 : displayText.toString());
64
+ var localText = localize(displayText);
65
65
  return (react_1.default.createElement(Comp, __assign({}, genFontStylingProps(restProps), { color: color, className: className, style: style, invert: invert }),
66
66
  localText,
67
67
  " ",
@@ -73,7 +73,9 @@ var SANS_0 = function (props) { return react_1.default.createElement(GenComp, {
73
73
  exports.SANS_0 = SANS_0;
74
74
  var SANS_2 = function (props) { return react_1.default.createElement(GenComp, { props: props, Comp: index_styled_1.SANS_2_STYLED }); };
75
75
  exports.SANS_2 = SANS_2;
76
- var SANS_3 = function (props) { return react_1.default.createElement(GenComp, { props: props, Comp: index_styled_1.SANS_3_STYLED }); };
76
+ var SANS_3 = function (props) {
77
+ return (react_1.default.createElement(GenComp, { props: props, Comp: index_styled_1.SANS_3_STYLED }));
78
+ };
77
79
  exports.SANS_3 = SANS_3;
78
80
  var SANS_3_4 = function (props) { return react_1.default.createElement(GenComp, { props: props, Comp: index_styled_1.SANS_3_4_STYLED }); };
79
81
  exports.SANS_3_4 = SANS_3_4;
@@ -1,2 +1,8 @@
1
- export function WrapperCardGrid(props: any): React.JSX.Element;
1
+ export function WrapperCardGrid({ style, className, children, id, minWidth }: {
2
+ style: any;
3
+ className: any;
4
+ children: any;
5
+ id: any;
6
+ minWidth?: string;
7
+ }): React.JSX.Element;
2
8
  import React from "react";
@@ -10,10 +10,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.WrapperCardGrid = void 0;
11
11
  var react_1 = __importDefault(require("react"));
12
12
  var styled_components_1 = __importDefault(require("styled-components"));
13
- var StyledWrapperCardGrid = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n position: relative;\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(30rem, 1fr));\n grid-template-rows: auto;\n grid-row-gap: 2rem;\n grid-column-gap: 2rem;\n"], ["\n width: 100%;\n position: relative;\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(30rem, 1fr));\n grid-template-rows: auto;\n grid-row-gap: 2rem;\n grid-column-gap: 2rem;\n"])));
14
- var WrapperCardGrid = function (props) {
15
- var style = props.style, className = props.className, children = props.children, id = props.id;
16
- return (react_1.default.createElement(StyledWrapperCardGrid, { id: id, style: style, className: className }, children));
13
+ var StyledWrapperCardGrid = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n position: relative;\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(", ", 1fr));\n grid-template-rows: auto;\n grid-row-gap: 2rem;\n grid-column-gap: 2rem;\n"], ["\n width: 100%;\n position: relative;\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(", ", 1fr));\n grid-template-rows: auto;\n grid-row-gap: 2rem;\n grid-column-gap: 2rem;\n"])), function (_a) {
14
+ var minWidth = _a.minWidth;
15
+ return minWidth;
16
+ });
17
+ var WrapperCardGrid = function (_a) {
18
+ var style = _a.style, className = _a.className, children = _a.children, id = _a.id, _b = _a.minWidth, minWidth = _b === void 0 ? '30rem' : _b;
19
+ return (react_1.default.createElement(StyledWrapperCardGrid, { id: id, style: style, className: className, minWidth: minWidth }, children));
17
20
  };
18
21
  exports.WrapperCardGrid = WrapperCardGrid;
19
22
  var templateObject_1;
@@ -4,8 +4,9 @@
4
4
  * These are utility functions that make certain tasks
5
5
  * within oolib easier
6
6
  */
7
+ import { ReactNode } from 'react';
7
8
  import { ColorsType } from '../themes/colors';
8
- export declare const useLocale: () => (text: string) => string;
9
+ export declare const useLocale: () => (value: ReactNode) => ReactNode;
9
10
  export declare const getPrimaryColor10: (colors?: ColorsType) => string;
10
11
  export declare const getPrimaryColor40: (colors?: ColorsType) => string;
11
12
  export declare const getPrimaryColor100: (colors?: ColorsType) => string;
@@ -5,29 +5,33 @@
5
5
  * These are utility functions that make certain tasks
6
6
  * within oolib easier
7
7
  */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
8
11
  Object.defineProperty(exports, "__esModule", { value: true });
9
12
  exports.getPrimaryColorText = exports.getPrimaryColor100 = exports.getPrimaryColor40 = exports.getPrimaryColor10 = exports.useLocale = void 0;
13
+ var react_1 = __importDefault(require("react"));
10
14
  var styled_components_1 = require("styled-components");
11
15
  var colors_1 = require("../themes/colors");
12
16
  var primaryColor10 = colors_1.colors.primaryColor10, primaryColor40 = colors_1.colors.primaryColor40, primaryColor100 = colors_1.colors.primaryColor100, primaryColorText = colors_1.colors.primaryColorText;
13
17
  var useLocale = function () {
14
18
  var currentTheme = (0, styled_components_1.useTheme)();
15
- var localize = function (text) {
16
- return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.localize) ? currentTheme.localize(text) : text;
19
+ ;
20
+ var localize = function (value) {
21
+ // Check if the value is a React component or a JavaScript object
22
+ if (react_1.default.isValidElement(value) || typeof value === 'object') {
23
+ return value;
24
+ }
25
+ // If the value is a string, attempt to localize it
26
+ if (typeof value === 'string') {
27
+ return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.localize) ? currentTheme.localize(value) : value;
28
+ }
29
+ // If the value is a React element or another type of value, render it as-is
30
+ return value;
17
31
  };
18
32
  return localize;
19
33
  };
20
34
  exports.useLocale = useLocale;
21
- // export const useLocale = () => {
22
- // const currentTheme = useTheme();
23
- // const localize = text => {
24
- // console.log({ text })
25
- // return currentTheme?.localize
26
- // ? currentTheme.localize(text)
27
- // : text
28
- // }
29
- // return localize
30
- // }
31
35
  var getPrimaryColor10 = function (colors) {
32
36
  return (colors === null || colors === void 0 ? void 0 : colors.primaryColor10) || primaryColor10;
33
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.111.0",
3
+ "version": "2.111.2",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",