oolib 2.64.5 → 2.64.7
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.
- package/dist/components/TextInputs/index.js +1 -1
- package/dist/components/cards/CardEmbed/index.js +2 -2
- package/dist/components/cards/CardEmbed/styled.js +4 -7
- package/dist/components/cards/comps/CardMetaBlock/index.d.ts +4 -2
- package/dist/components/cards/comps/CardMetaBlock/index.js +18 -14
- package/dist/components/cards/styled.d.ts +2 -2
- package/dist/components/cards/styled.js +3 -3
- package/dist/components/cards/utils/parseCardConfig.js +28 -15
- package/package.json +1 -1
|
@@ -226,7 +226,7 @@ var PhoneInput = function (_a) {
|
|
|
226
226
|
if (passValidationErrorToFormValidation)
|
|
227
227
|
passValidationErrorToFormValidation("success");
|
|
228
228
|
};
|
|
229
|
-
return (react_1.default.createElement(exports.TextInput, __assign({ type: "tel", placeholder: "Enter Phone...", handleValidation: handleValidation, maxLength:
|
|
229
|
+
return (react_1.default.createElement(exports.TextInput, __assign({ type: "tel", placeholder: "Enter Phone...", handleValidation: handleValidation, maxLength: 11 }, props)));
|
|
230
230
|
};
|
|
231
231
|
exports.PhoneInput = PhoneInput;
|
|
232
232
|
var URLInput = function (_a) {
|
|
@@ -63,8 +63,8 @@ var CardEmbed = function (_a) {
|
|
|
63
63
|
title && (react_1.default.createElement(LineClampWrapper_1.LineClampWrapper, { noOfLines_M: 1, noOfLines_D: 2, title: title },
|
|
64
64
|
react_1.default.createElement(styled_1.StyledTitle, { disabled: disabled, as: Typo_1.SERIF_3_4, capitalize: true, className: "StyledTitle" },
|
|
65
65
|
react_1.default.createElement(styled_1.StyledTitleSpan, { className: "StyledTitleSpan" }, title)))),
|
|
66
|
-
(metaBlockData ||
|
|
67
|
-
|
|
66
|
+
(metaBlockData === null || metaBlockData === void 0 ? void 0 : metaBlockData.length) > 0 && (react_1.default.createElement("div", { style: { paddingTop: "1.7rem" } },
|
|
67
|
+
react_1.default.createElement(CardMetaBlock_1.default, { disabled: disabled, value: metaBlockData })))),
|
|
68
68
|
mediaConfigExists && (react_1.default.createElement(styled_2.StyledContentModule2, { disabled: disabled },
|
|
69
69
|
!(0, mediaDataExists_1.imageDataExists)(image) && !(0, mediaDataExists_1.videoDataExists)(video) && (react_1.default.createElement(styled_2.StyledCardEmbedPlaceholderWrapper, null,
|
|
70
70
|
react_1.default.createElement(CardPlaceholder_1.CardPlaceholder, { style: {
|
|
@@ -35,7 +35,7 @@ var Typo_1 = require("../../Typo");
|
|
|
35
35
|
var styled_1 = require("../styled");
|
|
36
36
|
var greyColor5 = themes_1.colors.greyColor5, white = themes_1.colors.white, greyColor10 = themes_1.colors.greyColor10;
|
|
37
37
|
exports.ErrorCardEmbedWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-top: 1rem;\n padding-bottom: 1rem;\n"], ["\n padding-top: 1rem;\n padding-bottom: 1rem;\n"])));
|
|
38
|
-
exports.StyledEmbedCardWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex
|
|
38
|
+
exports.StyledEmbedCardWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n /* display: flex; */\n cursor: pointer;\n position: relative;\n background-color: ", ";\n justify-content: space-between;\n border: 2px solid\n ", ";\n background-color: ", ";\n ", ";\n /* min-height: 10rem; */\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n ", ";\n }\n }\n"], ["\n /* display: flex; */\n cursor: pointer;\n position: relative;\n background-color: ", ";\n justify-content: space-between;\n border: 2px solid\n ", ";\n background-color: ", ";\n ", ";\n /* min-height: 10rem; */\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n ", ";\n }\n }\n"])), white, function (_a) {
|
|
39
39
|
var disabled = _a.disabled;
|
|
40
40
|
return (disabled ? themes_1.colors.greyColor3 : greyColor5);
|
|
41
41
|
}, function (_a) {
|
|
@@ -45,14 +45,11 @@ exports.StyledEmbedCardWrapper = styled_components_1.default.div(templateObject_
|
|
|
45
45
|
var disabled = _a.disabled;
|
|
46
46
|
return !disabled && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", ";\n #CardPlaceholder {\n opacity: 1;\n }\n "], ["\n ", ";\n #CardPlaceholder {\n opacity: 1;\n }\n "])), styled_1.CSSTitleAnimationOnHover);
|
|
47
47
|
});
|
|
48
|
-
exports.StyledContentModule1 = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n /* align-items: center; */\n flex-direction: column;\n padding: 2rem;\n
|
|
49
|
-
|
|
50
|
-
return !error ? "2px solid ".concat(greyColor10) : "none";
|
|
51
|
-
});
|
|
52
|
-
exports.StyledContentModule2 = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n min-width: 0; // IMP: hack to get this div to not bleed out of parent flex container\n width: 10rem;\n opacity: ", ";\n"], ["\n min-width: 0; // IMP: hack to get this div to not bleed out of parent flex container\n width: 10rem;\n opacity: ", ";\n"])), function (_a) {
|
|
48
|
+
exports.StyledContentModule1 = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n /* align-items: center; */\n flex-direction: column;\n padding: 2rem;\n padding-right: 8rem;\n ", "{\n padding-right: 10rem;\n }\n"], ["\n display: flex;\n /* align-items: center; */\n flex-direction: column;\n padding: 2rem;\n padding-right: 8rem;\n ", "{\n padding-right: 10rem;\n }\n"])), (0, mixins_1.mediaQuery)('sm'));
|
|
49
|
+
exports.StyledContentModule2 = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: absolute;\n right: 0;\n top: 0;\n height: 100%;\n opacity: ", ";\n width: 8rem;\n ", "{\n width: 10rem\n }\n"], ["\n position: absolute;\n right: 0;\n top: 0;\n height: 100%;\n opacity: ", ";\n width: 8rem;\n ", "{\n width: 10rem\n }\n"])), function (_a) {
|
|
53
50
|
var disabled = _a.disabled;
|
|
54
51
|
return (disabled ? 0.4 : 1);
|
|
55
|
-
});
|
|
52
|
+
}, (0, mixins_1.mediaQuery)('sm'));
|
|
56
53
|
exports.StyledCardEmbedAction = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n"], ["\n position: absolute;\n top: 0;\n right: 0;\n"])));
|
|
57
54
|
exports.StyledCardEmbedLabel = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n padding-bottom: 0.5rem;\n"], ["\n padding-bottom: 0.5rem;\n"])));
|
|
58
55
|
exports.StyledMetaBlock = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n padding: 0;\n"], ["\n padding: 0;\n"])));
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export default CardMetaBlock;
|
|
2
|
-
declare function CardMetaBlock({ value, disabled }: {
|
|
3
|
-
value
|
|
2
|
+
declare function CardMetaBlock({ value, disabled, align, invert }: {
|
|
3
|
+
value?: any[];
|
|
4
4
|
disabled: any;
|
|
5
|
+
align?: string;
|
|
6
|
+
invert: any;
|
|
5
7
|
}): React.JSX.Element;
|
|
6
8
|
import React from "react";
|
|
@@ -26,32 +26,36 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
26
|
__setModuleDefault(result, mod);
|
|
27
27
|
return result;
|
|
28
28
|
};
|
|
29
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
-
};
|
|
32
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
30
|
var react_1 = __importStar(require("react"));
|
|
34
|
-
var styled_components_1 =
|
|
31
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
35
32
|
var themes_1 = require("../../../../themes");
|
|
36
33
|
var Typo_1 = require("../../../Typo");
|
|
37
34
|
var mixins_1 = require("../../../../themes/mixins");
|
|
35
|
+
var DisplayIcon_1 = require("../../../../utils/comps/DisplayIcon");
|
|
38
36
|
var greyColor100 = themes_1.colors.greyColor100;
|
|
39
|
-
var StyledContainer = styled_components_1.default.div(
|
|
40
|
-
var
|
|
41
|
-
|
|
37
|
+
var StyledContainer = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 1rem;\n flex-wrap: wrap;\n ", "\n"], ["\n display: flex;\n align-items: center;\n gap: 1rem;\n flex-wrap: wrap;\n ", "\n"])), function (_a) {
|
|
38
|
+
var align = _a.align;
|
|
39
|
+
return align === "center" && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n justify-content: center;\n "], ["\n justify-content: center;\n "])));
|
|
40
|
+
});
|
|
41
|
+
var StyledMetaWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 0.5rem;\n"], ["\n display: flex;\n align-items: center;\n gap: 0.5rem;\n"])));
|
|
42
|
+
var STYLED_SANS_2 = (0, styled_components_1.default)(Typo_1.SANS_2)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n color: ", ";\n"], ["\n ", "\n color: ", ";\n"])), mixins_1.ellipsis, function (_a) {
|
|
42
43
|
var disabled = _a.disabled;
|
|
43
44
|
return disabled ? themes_1.colors.greyColor40 : themes_1.colors.greyColor100;
|
|
44
45
|
});
|
|
45
|
-
var StyledSeparator = styled_components_1.default.div(
|
|
46
|
+
var StyledSeparator = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 0.3rem;\n height: 0.3rem;\n border-radius: 50%;\n background-color: ", ";\n"], ["\n width: 0.3rem;\n height: 0.3rem;\n border-radius: 50%;\n background-color: ", ";\n"])), function (_a) {
|
|
46
47
|
var disabled = _a.disabled;
|
|
47
48
|
return disabled ? themes_1.colors.greyColor40 : themes_1.colors.greyColor100;
|
|
48
49
|
});
|
|
49
50
|
var CardMetaBlock = function (_a) {
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
var _b = _a.value, value = _b === void 0 ? [] : _b, disabled = _a.disabled, _c = _a.align, align = _c === void 0 ? "left" : _c, invert = _a.invert;
|
|
52
|
+
if (value.length === 0)
|
|
53
|
+
return null;
|
|
54
|
+
return (react_1.default.createElement(StyledContainer, { align: align }, value.map(function (v, i) { return (react_1.default.createElement(react_1.Fragment, { key: i },
|
|
55
|
+
react_1.default.createElement(StyledMetaWrapper, { style: { maxWidth: (100 / value.length) + '%' } },
|
|
56
|
+
v.icon && (react_1.default.createElement(DisplayIcon_1.DisplayIcon, { icon: v.icon, size: 15, color: invert ? themes_1.colors.white : themes_1.colors.greyColor100 })),
|
|
57
|
+
react_1.default.createElement(STYLED_SANS_2, { disabled: disabled, capitalize: true }, v.display)),
|
|
58
|
+
i + 1 === value.length ? null : (react_1.default.createElement(StyledSeparator, { disabled: disabled })))); })));
|
|
55
59
|
};
|
|
56
60
|
exports.default = CardMetaBlock;
|
|
57
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
61
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** -- this bit is common for ListContent and CardEmbed */
|
|
1
|
+
/** -- this bit is common for CardContent, ListContent and CardEmbed */
|
|
2
2
|
export const StyledLabel: import("styled-components").StyledComponent<(props: any) => import("react").JSX.Element, any, {}, never>;
|
|
3
|
-
/** -- END this bit is common for ListContent and CardEmbed */
|
|
3
|
+
/** -- END this bit is common for CardContent, ListContent and CardEmbed */
|
|
4
4
|
/** --- this bit handles the entire title underline hover animation --- */
|
|
5
5
|
export const StyledTitle: import("styled-components").StyledComponent<(props: any) => import("react").JSX.Element, any, {}, never>;
|
|
6
6
|
export const StyledTitleSpan: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -33,15 +33,15 @@ var mixins_1 = require("../../themes/mixins");
|
|
|
33
33
|
var Typo_1 = require("../Typo");
|
|
34
34
|
var utilsOolib_1 = require("../../utilsOolib");
|
|
35
35
|
var themes_1 = require("../../themes");
|
|
36
|
-
/** -- this bit is common for ListContent and CardEmbed */
|
|
36
|
+
/** -- this bit is common for CardContent, ListContent and CardEmbed */
|
|
37
37
|
exports.StyledLabel = (0, styled_components_1.default)(Typo_1.LABEL)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", ";\n max-width: 23rem;\n ", "{\n max-width: 40rem;\n }\n \n ", " \n"], ["\n ", ";\n max-width: 23rem;\n ", "{\n max-width: 40rem;\n }\n \n ", " \n"
|
|
38
|
-
/** -- END this bit is common for ListContent and CardEmbed */
|
|
38
|
+
/** -- END this bit is common for CardContent, ListContent and CardEmbed */
|
|
39
39
|
/** --- this bit handles the entire title underline hover animation --- */
|
|
40
40
|
])), mixins_1.ellipsis, (0, mixins_1.mediaQuery)("sm"), function (_a) {
|
|
41
41
|
var disabled = _a.disabled;
|
|
42
42
|
return disabled && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), themes_1.colors.greyColor40);
|
|
43
43
|
});
|
|
44
|
-
/** -- END this bit is common for ListContent and CardEmbed */
|
|
44
|
+
/** -- END this bit is common for CardContent, ListContent and CardEmbed */
|
|
45
45
|
/** --- this bit handles the entire title underline hover animation --- */
|
|
46
46
|
exports.StyledTitle = (0, styled_components_1.default)(Typo_1.SERIF_4_5)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", ";\n color: ", ";\n"], ["\n ", ";\n color: ", ";\n"])), (0, mixins_1.transition)("color"), function (_a) {
|
|
47
47
|
var disabled = _a.disabled;
|
|
@@ -16,11 +16,30 @@ var parseCardConfig = function (_a) {
|
|
|
16
16
|
var video = config.video && (0, getVal_1.getVal)(data, config.video);
|
|
17
17
|
var tagDisplay = config.tagDisplay && (0, getVal_1.getVal)(data, config.tagDisplay);
|
|
18
18
|
var image = config.image && (0, getVal_1.getVal)(data, config.image);
|
|
19
|
-
//metablock
|
|
20
|
-
var metaBlockData = (_b = config.metaBlock) === null || _b === void 0 ? void 0 : _b.slice(0, 2)
|
|
19
|
+
//metablock in cards doesnt accept more than 2 configs
|
|
20
|
+
var metaBlockData = parseMetaBlockConfig({ config: (_b = config.metaBlock) === null || _b === void 0 ? void 0 : _b.slice(0, 2), localize: localize, data: data });
|
|
21
|
+
return {
|
|
22
|
+
title: title,
|
|
23
|
+
titleOptional: titleOptional,
|
|
24
|
+
desc: desc,
|
|
25
|
+
cardLabel: cardLabel,
|
|
26
|
+
video: video,
|
|
27
|
+
image: image,
|
|
28
|
+
metaBlockData: metaBlockData,
|
|
29
|
+
tagDisplay: tagDisplay,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
exports.parseCardConfig = parseCardConfig;
|
|
33
|
+
var parseMetaBlockConfig = function (_a) {
|
|
34
|
+
var config = _a.config, localize = _a.localize, data = _a.data;
|
|
35
|
+
if (!config)
|
|
36
|
+
return [];
|
|
37
|
+
//else
|
|
38
|
+
return config.map(function (d) {
|
|
21
39
|
var key = d.key;
|
|
22
40
|
var valuePath = d.valuePath;
|
|
23
41
|
var prefix = d.prefix;
|
|
42
|
+
var icon = d.icon;
|
|
24
43
|
var returnValue;
|
|
25
44
|
switch (key) {
|
|
26
45
|
case "name":
|
|
@@ -43,17 +62,11 @@ var parseCardConfig = function (_a) {
|
|
|
43
62
|
if (prefix) {
|
|
44
63
|
return "".concat(localize(prefix), " : ").concat(returnValue);
|
|
45
64
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
video: video,
|
|
54
|
-
image: image,
|
|
55
|
-
metaBlockData: metaBlockData,
|
|
56
|
-
tagDisplay: tagDisplay,
|
|
57
|
-
};
|
|
65
|
+
var toReturn = ({ display: returnValue });
|
|
66
|
+
//now to incorporate things like icons, imgs, links
|
|
67
|
+
if (icon) {
|
|
68
|
+
toReturn.icon = icon;
|
|
69
|
+
}
|
|
70
|
+
return toReturn;
|
|
71
|
+
}).filter(function (d) { return d.display !== undefined; });
|
|
58
72
|
};
|
|
59
|
-
exports.parseCardConfig = parseCardConfig;
|