oolib 2.203.2 → 2.204.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.
@@ -44,6 +44,6 @@ var themes_1 = require("../../../v2/themes");
44
44
  var load = (0, styled_components_1.keyframes)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n from { left: -100%; }\n to { left: 100%; }\n"], ["\n from { left: -100%; }\n to { left: 100%; }\n"])));
45
45
  exports.StyledSkeletonLoader = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n overflow: hidden;\n position: relative;\n background-color: ", ";\n\n &::before {\n content: '';\n display: block;\n position: absolute;\n left: -100%;\n top: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(to right, transparent 0%, ", " 50%, transparent 100%);\n animation: ", " 1s cubic-bezier(0.4, 0.0, 0.2, 1);\n animation-iteration-count: infinite;\n }\n"], ["\n overflow: hidden;\n position: relative;\n background-color: ", ";\n\n &::before {\n content: '';\n display: block;\n position: absolute;\n left: -100%;\n top: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(to right, transparent 0%, ", " 50%, transparent 100%);\n animation: ", " 1s cubic-bezier(0.4, 0.0, 0.2, 1);\n animation-iteration-count: infinite;\n }\n"])), function (_a) {
46
46
  var theme = _a.theme;
47
- return (0, getDynamicColors_1.getSecondaryContainer)(theme === null || theme === void 0 ? void 0 : theme.colors);
47
+ return (0, getDynamicColors_1.getSurfaceContainer)(theme === null || theme === void 0 ? void 0 : theme.colors);
48
48
  }, themes_1.colors.grey5, load);
49
49
  var templateObject_1, templateObject_2;
@@ -18,7 +18,7 @@ exports.TextLoader = void 0;
18
18
  var react_1 = __importDefault(require("react"));
19
19
  var styled_1 = require("../SkeletonLoader/styled");
20
20
  var styled_components_1 = require("styled-components");
21
- var utilsOolib_1 = require("../../../utilsOolib");
21
+ var getDynamicColors_1 = require("../../../v2/themes/utils/getDynamicColors");
22
22
  /**
23
23
  * @component Renders a text loader component with customizable styling.
24
24
  *
@@ -29,6 +29,6 @@ var utilsOolib_1 = require("../../../utilsOolib");
29
29
  var TextLoader = function (_a) {
30
30
  var style = _a.style;
31
31
  var theme = (0, styled_components_1.useTheme)();
32
- return (react_1.default.createElement(styled_1.StyledSkeletonLoader, { style: __assign(__assign({ backgroundColor: (0, utilsOolib_1.getPrimaryColor10)(theme === null || theme === void 0 ? void 0 : theme.colors) }, (style || {})), { width: (style === null || style === void 0 ? void 0 : style.width) || "8rem", height: (style === null || style === void 0 ? void 0 : style.height) || "1.5rem" }) }));
32
+ return (react_1.default.createElement(styled_1.StyledSkeletonLoader, { style: __assign(__assign({ backgroundColor: (0, getDynamicColors_1.getSecondaryContainer)(theme === null || theme === void 0 ? void 0 : theme.colors) }, (style || {})), { width: (style === null || style === void 0 ? void 0 : style.width) || "8rem", height: (style === null || style === void 0 ? void 0 : style.height) || "1.5rem", borderRadius: '4px' }) }));
33
33
  };
34
34
  exports.TextLoader = TextLoader;
@@ -1,7 +1,7 @@
1
- import { SANS_3, SANS_4_5, SANS_2 } from "../../Typo";
1
+ import { UI_BODY_DF, UI_BODY_SM_DF, UI_TITLE } from "../../../v2/components/Typo2";
2
2
  export type LoaderSize = 'L' | 'S' | 'M';
3
3
  export interface DimensionResult {
4
- TypoComp: typeof SANS_3 | typeof SANS_4_5 | typeof SANS_2;
4
+ TypoComp: typeof UI_BODY_DF | typeof UI_BODY_SM_DF | typeof UI_TITLE;
5
5
  trackThickness: number;
6
6
  diameter: number;
7
7
  }
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getTypoAndLoaderDimensions = void 0;
4
- var Typo_1 = require("../../Typo");
4
+ var Typo2_1 = require("../../../v2/components/Typo2");
5
5
  var getTypoAndLoaderDimensions = function (size) {
6
6
  if (size === void 0) { size = 'M'; }
7
7
  switch (size) {
8
8
  case 'L':
9
- return { TypoComp: Typo_1.SANS_4_5, trackThickness: 10, diameter: 70 };
9
+ return { TypoComp: Typo2_1.UI_TITLE, trackThickness: 10, diameter: 70 };
10
10
  case 'S':
11
- return { TypoComp: Typo_1.SANS_2, trackThickness: 3.65, diameter: 21.35 };
11
+ return { TypoComp: Typo2_1.UI_BODY_SM_DF, trackThickness: 3.65, diameter: 21.35 };
12
12
  case 'M':
13
13
  default:
14
- return { TypoComp: Typo_1.SANS_3, trackThickness: 7, diameter: 43 };
14
+ return { TypoComp: Typo2_1.UI_BODY_DF, trackThickness: 7, diameter: 43 };
15
15
  }
16
16
  };
17
17
  exports.getTypoAndLoaderDimensions = getTypoAndLoaderDimensions;
@@ -1,5 +1,7 @@
1
- export function PhoneInput({ passValidationErrorToFormValidation, ...props }: {
1
+ export function PhoneInput({ passValidationErrorToFormValidation, minPhoneNoLength, maxPhoneNoLength, ...props }: {
2
2
  [x: string]: any;
3
3
  passValidationErrorToFormValidation: any;
4
+ minPhoneNoLength?: number;
5
+ maxPhoneNoLength?: number;
4
6
  }): React.JSX.Element;
5
7
  import React from "react";
@@ -29,7 +29,7 @@ exports.PhoneInput = void 0;
29
29
  var react_1 = __importDefault(require("react"));
30
30
  var __1 = require("..");
31
31
  var PhoneInput = function (_a) {
32
- var passValidationErrorToFormValidation = _a.passValidationErrorToFormValidation, props = __rest(_a, ["passValidationErrorToFormValidation"]);
32
+ var passValidationErrorToFormValidation = _a.passValidationErrorToFormValidation, _b = _a.minPhoneNoLength, minPhoneNoLength = _b === void 0 ? 9 : _b, _c = _a.maxPhoneNoLength, maxPhoneNoLength = _c === void 0 ? 11 : _c, props = __rest(_a, ["passValidationErrorToFormValidation", "minPhoneNoLength", "maxPhoneNoLength"]);
33
33
  var handleValidation = function (value) {
34
34
  var errorObj;
35
35
  if (isNaN(value)) {
@@ -38,7 +38,7 @@ var PhoneInput = function (_a) {
38
38
  passValidationErrorToFormValidation(errorObj.type);
39
39
  return errorObj;
40
40
  }
41
- if (value.length < 9) {
41
+ if (value.length < minPhoneNoLength) {
42
42
  errorObj = { type: "error", msg: "Enter a valid phone number" };
43
43
  if (passValidationErrorToFormValidation)
44
44
  passValidationErrorToFormValidation(errorObj.type);
@@ -48,6 +48,6 @@ var PhoneInput = function (_a) {
48
48
  if (passValidationErrorToFormValidation)
49
49
  passValidationErrorToFormValidation("success");
50
50
  };
51
- return (react_1.default.createElement(__1.TextInput, __assign({ type: "tel", placeholder: "Enter Phone...", handleValidation: handleValidation, maxLength: 11 }, props)));
51
+ return (react_1.default.createElement(__1.TextInput, __assign({ type: "tel", placeholder: "Enter Phone...", handleValidation: handleValidation, maxLength: maxPhoneNoLength }, props)));
52
52
  };
53
53
  exports.PhoneInput = PhoneInput;
@@ -2,42 +2,56 @@ import { Colors2Type } from "../colors";
2
2
  /**
3
3
  * Get the primary Container color.
4
4
  *
5
- * @param {ColorsType} colors - Optional colors object
5
+ * @param {Colors2Type} colors - Optional colors object
6
6
  * @return {string} The primary color text
7
7
  */
8
8
  export declare const getPrimaryContainer: (colors?: Colors2Type) => string;
9
9
  /**
10
- * Get the secondary Container color.
10
+ * Get the secondary Container color.
11
11
  *
12
- * @param {ColorsType} colors - Optional colors object
13
- * @return {string} The primary color text
12
+ * @param {Colors2Type} colors - Optional colors object
13
+ * @return {string} The secondary color text
14
14
  */
15
15
  export declare const getSecondaryContainer: (colors?: Colors2Type) => string;
16
16
  /**
17
17
  * get the tertiary Container color..
18
18
  *
19
- * @param {ColorsType} colors - Optional colors object
20
- * @return {string} The primary color text
19
+ * @param {Colors2Type} colors - Optional colors object
20
+ * @return {string} The tertiary color text
21
21
  */
22
22
  export declare const getTertiaryContainer: (colors?: Colors2Type) => string;
23
23
  /**
24
24
  * Get the onPrimary color.
25
25
  *
26
- * @param {ColorsType} colors - Optional colors object
27
- * @return {string} The primary color text
26
+ * @param {Colors2Type} colors - Optional colors object
27
+ * @return {string} The onPrimary color text
28
28
  */
29
29
  export declare const getOnPrimary: (colors?: Colors2Type) => string;
30
30
  /**
31
31
  * Get the onSecondary color.
32
32
  *
33
- * @param {ColorsType} colors - Optional colors object
34
- * @return {string} The primary color text
33
+ * @param {Colors2Type} colors - Optional colors object
34
+ * @return {string} The onSecondary color text
35
35
  */
36
36
  export declare const getOnSecondary: (colors?: Colors2Type) => string;
37
37
  /**
38
38
  * Get the onTertiary color.
39
39
  *
40
- * @param {ColorsType} colors - Optional colors object
41
- * @return {string} The primary color text
40
+ * @param {Colors2Type} colors - Optional colors object
41
+ * @return {string} The onTertiary color text
42
42
  */
43
43
  export declare const getOnTertiary: (colors?: Colors2Type) => string;
44
+ /**
45
+ * Get the surface Container color.
46
+ *
47
+ * @param {Colors2Type} colors - Optional colors object
48
+ * @return {string} The surface container color text
49
+ */
50
+ export declare const getSurfaceContainer: (colors?: Colors2Type) => string;
51
+ /**
52
+ * Get the surface Container Low color.
53
+ *
54
+ * @param {Colors2Type} colors - Optional colors object
55
+ * @return {string} The surface container low color text
56
+ */
57
+ export declare const getSurfaceContainerLow: (colors?: Colors2Type) => string;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getOnTertiary = exports.getOnSecondary = exports.getOnPrimary = exports.getTertiaryContainer = exports.getSecondaryContainer = exports.getPrimaryContainer = void 0;
3
+ exports.getSurfaceContainerLow = exports.getSurfaceContainer = exports.getOnTertiary = exports.getOnSecondary = exports.getOnPrimary = exports.getTertiaryContainer = exports.getSecondaryContainer = exports.getPrimaryContainer = void 0;
4
4
  var colors_1 = require("../colors");
5
- var primaryContainer = colors_1.colors.primaryContainer, secondaryContainer = colors_1.colors.secondaryContainer, tertiaryContainer = colors_1.colors.tertiaryContainer, onPrimary = colors_1.colors.onPrimary, onSecondary = colors_1.colors.onSecondary, onTertiary = colors_1.colors.onTertiary;
5
+ var primaryContainer = colors_1.colors.primaryContainer, secondaryContainer = colors_1.colors.secondaryContainer, tertiaryContainer = colors_1.colors.tertiaryContainer, onPrimary = colors_1.colors.onPrimary, onSecondary = colors_1.colors.onSecondary, onTertiary = colors_1.colors.onTertiary, surfaceContainer = colors_1.colors.surfaceContainer, surfaceContainerLow = colors_1.colors.surfaceContainerLow;
6
6
  /**
7
7
  * Get the primary Container color.
8
8
  *
9
- * @param {ColorsType} colors - Optional colors object
9
+ * @param {Colors2Type} colors - Optional colors object
10
10
  * @return {string} The primary color text
11
11
  */
12
12
  var getPrimaryContainer = function (colors) {
@@ -14,10 +14,10 @@ var getPrimaryContainer = function (colors) {
14
14
  };
15
15
  exports.getPrimaryContainer = getPrimaryContainer;
16
16
  /**
17
- * Get the secondary Container color.
17
+ * Get the secondary Container color.
18
18
  *
19
- * @param {ColorsType} colors - Optional colors object
20
- * @return {string} The primary color text
19
+ * @param {Colors2Type} colors - Optional colors object
20
+ * @return {string} The secondary color text
21
21
  */
22
22
  var getSecondaryContainer = function (colors) {
23
23
  return (colors === null || colors === void 0 ? void 0 : colors.secondaryContainer) || secondaryContainer;
@@ -26,8 +26,8 @@ exports.getSecondaryContainer = getSecondaryContainer;
26
26
  /**
27
27
  * get the tertiary Container color..
28
28
  *
29
- * @param {ColorsType} colors - Optional colors object
30
- * @return {string} The primary color text
29
+ * @param {Colors2Type} colors - Optional colors object
30
+ * @return {string} The tertiary color text
31
31
  */
32
32
  var getTertiaryContainer = function (colors) {
33
33
  return (colors === null || colors === void 0 ? void 0 : colors.tertiaryContainer) || tertiaryContainer;
@@ -36,8 +36,8 @@ exports.getTertiaryContainer = getTertiaryContainer;
36
36
  /**
37
37
  * Get the onPrimary color.
38
38
  *
39
- * @param {ColorsType} colors - Optional colors object
40
- * @return {string} The primary color text
39
+ * @param {Colors2Type} colors - Optional colors object
40
+ * @return {string} The onPrimary color text
41
41
  */
42
42
  var getOnPrimary = function (colors) {
43
43
  return (colors === null || colors === void 0 ? void 0 : colors.onPrimary) || onPrimary;
@@ -46,8 +46,8 @@ exports.getOnPrimary = getOnPrimary;
46
46
  /**
47
47
  * Get the onSecondary color.
48
48
  *
49
- * @param {ColorsType} colors - Optional colors object
50
- * @return {string} The primary color text
49
+ * @param {Colors2Type} colors - Optional colors object
50
+ * @return {string} The onSecondary color text
51
51
  */
52
52
  var getOnSecondary = function (colors) {
53
53
  return (colors === null || colors === void 0 ? void 0 : colors.onSecondary) || onSecondary;
@@ -56,10 +56,30 @@ exports.getOnSecondary = getOnSecondary;
56
56
  /**
57
57
  * Get the onTertiary color.
58
58
  *
59
- * @param {ColorsType} colors - Optional colors object
60
- * @return {string} The primary color text
59
+ * @param {Colors2Type} colors - Optional colors object
60
+ * @return {string} The onTertiary color text
61
61
  */
62
62
  var getOnTertiary = function (colors) {
63
63
  return (colors === null || colors === void 0 ? void 0 : colors.onTertiary) || onTertiary;
64
64
  };
65
65
  exports.getOnTertiary = getOnTertiary;
66
+ /**
67
+ * Get the surface Container color.
68
+ *
69
+ * @param {Colors2Type} colors - Optional colors object
70
+ * @return {string} The surface container color text
71
+ */
72
+ var getSurfaceContainer = function (colors) {
73
+ return (colors === null || colors === void 0 ? void 0 : colors.surfaceContainer) || surfaceContainer;
74
+ };
75
+ exports.getSurfaceContainer = getSurfaceContainer;
76
+ /**
77
+ * Get the surface Container Low color.
78
+ *
79
+ * @param {Colors2Type} colors - Optional colors object
80
+ * @return {string} The surface container low color text
81
+ */
82
+ var getSurfaceContainerLow = function (colors) {
83
+ return (colors === null || colors === void 0 ? void 0 : colors.surfaceContainerLow) || surfaceContainerLow;
84
+ };
85
+ exports.getSurfaceContainerLow = getSurfaceContainerLow;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.203.2",
3
+ "version": "2.204.1",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",