oolib 2.154.0 → 2.155.0

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.
@@ -0,0 +1,11 @@
1
+ export function CardContent({ id, data, config, to, onClick, openInNewTab, actions, highlight }: {
2
+ id: any;
3
+ data: any;
4
+ config: any;
5
+ to: any;
6
+ onClick: any;
7
+ openInNewTab: any;
8
+ actions: any;
9
+ highlight: any;
10
+ }): React.JSX.Element;
11
+ import React from "react";
@@ -1,144 +1,76 @@
1
- // import React from "react";
2
- // import { useTheme } from "styled-components";
3
- // import { injectHttps } from "../../../utils/injectHttps";
4
- // import { getPrimaryColorText, useLocale } from "../../../utilsOolib";
5
- // import { ActionMenu } from "../../ActionMenu";
6
- // import { LABEL } from "../../Typo";
7
- // import VideoInput from "../../VideoInput";
8
- // import MetaBlock from "../../MetaBlock";
9
- // import { LineClampWrapper } from "../comps/LineClampWrapper";
10
- // import { StyledTitle, StyledTitleSpan } from "../styled";
11
- // import { decideLinkCompAndTarget } from "../utils/decideLinkCompAndTarget";
12
- // import { dontRenderIfBothOnClickAndTo } from "../utils/dontRenderIfBothOnClickAndTo";
13
- // import { parseCardConfig } from "../utils/parseCardConfig";
14
- // import {imageDataExists, videoDataExists} from '../utils/mediaDataExists'
15
- // import {
16
- // StyledCardWrapper,
17
- // StyledContainer1,
18
- // StyledCrown,
19
- // StyledCrownWrapper,
20
- // StyledEmbedSection,
21
- // StyledUpperSection,
22
- // } from "./styled";
23
- // import {CardPlaceholder} from '../comps/CardPlaceholder'
24
- // import { ImageInput } from "../../ImageInput";
25
- // import { icons } from "../../../icons"
26
- // import { TagDisplay, TagLink } from "../../Tags";
27
- // const { CrownSimple } = icons;
28
- // export const CardContent = ({
29
- // id,
30
- // data,
31
- // config,
32
- // to,
33
- // onClick,
34
- // openInNewTab,
35
- // actions,
36
- // highlight
37
- // }) => {
38
- // const theme = useTheme();
39
- // const localize = useLocale();
40
- // const { parseSpecialSyntax } = theme || {};
41
- // const showEmbedSection = !!(config?.image || config?.video);
42
- // const { cardLabel, title, video, image, metaBlock, tagDisplay } =
43
- // parseCardConfig({
44
- // config,
45
- // data,
46
- // parseSpecialSyntax
47
- // });
48
- // let dontRenderRes = dontRenderIfBothOnClickAndTo({onClick, to});
49
- // if(dontRenderRes) return dontRenderRes
50
- // const {LinkComp, target, externalUrl } = decideLinkCompAndTarget({to, openInNewTab})
51
- // return (
52
- // <LinkComp
53
- // target={target}
54
- // href={injectHttps(to)}
55
- // to={to}
56
- // >
57
- // <StyledCardWrapper
58
- // id={id}
59
- // highlight={highlight}
60
- // onClick={onClick ? e => onClick(e,data) : undefined}
61
- // /** imp to pass data cuz its used by some on okf eg. LinkOrEmbedModal*/
62
- // >
63
- // {highlight && <StyledCrownWrapper>
64
- // <StyledCrown>
65
- // <CrownSimple size={24}/>
66
- // </StyledCrown>
67
- // </StyledCrownWrapper>}
68
- // <StyledUpperSection highlight={highlight}>
69
- // <StyledContainer1>
70
- // {cardLabel ? (
71
- // <div
72
- // title={cardLabel}
73
- // style={{
74
- // display: "flex",
75
- // gap: "2rem",
76
- // justifyContent: "space-between",
77
- // }}
78
- // >
79
- // <LABEL
80
- // style={{
81
- // textOverflow: "ellipsis",
82
- // overflow: "hidden",
83
- // whiteSpace: "nowrap",
84
- // }}
85
- // color={getPrimaryColorText(theme?.colors)}
86
- // >
87
- // {cardLabel}
88
- // </LABEL>
89
- // <div style={{ marginTop: "-1rem", marginRight: "-1rem" }}>
90
- // {actions && <ActionMenu actions={actions} />}
91
- // </div>
92
- // </div>
93
- // ) : null}
94
- // {title ? (
95
- // <div style={{ display: "flex", alignItems: "end", gap: ".5rem" }}>
96
- // {" "}
97
- // <LineClampWrapper noOfLines_M={6} title={title}>
98
- // <StyledTitle capitalize className="StyledTitle">
99
- // <StyledTitleSpan className="StyledTitleSpan">
100
- // {localize(title)}
101
- // </StyledTitleSpan>
102
- // </StyledTitle>
103
- // </LineClampWrapper>
104
- // </div>
105
- // ) : null}
106
- // </StyledContainer1>
107
- // {/* {((Array.isArray(tagDisplay?.data) && tagDisplay?.data?.length > 0) || typeof tagDisplay === "string") && <TagDisplay display={Array.isArray(tagDisplay?.data) ? tagDisplay?.data[0]?.display : tagDisplay} to={tagDisplay?.collectionId ? `/published-page/${tagDisplay?.collectionId}?id=${tagDisplay?.data[0]?._id}` : "#"} color="green"/>} */}
108
- // {tagDisplay && <TagDisplay display={tagDisplay} color="green"/>}
109
- // {metaBlock?.length > 0 ? (
110
- // <MetaBlock data={data} config={metaBlock} /> //show only two meta for cardContent
111
- // ) : null}
112
- // </StyledUpperSection>
113
- // {showEmbedSection && (
114
- // <StyledEmbedSection>
115
- // {!imageDataExists(image) && !videoDataExists(video) &&
116
- // <CardPlaceholder/>
117
- // }
118
- // {imageDataExists(image) && (
119
- // <div style={{ width: "100%" }}>
120
- // {
121
- // <ImageInput
122
- // value={image}
123
- // aspectRatio={"5/3"}
124
- // readOnly={true}
125
- // defaultImageSpread={"cover"} //meaning if a spread is not defined in image data, it will fallback to this.
126
- // enableCaptions={false}
127
- // disableImageBorder={true}
128
- // />
129
- // }
130
- // </div>
131
- // )}
132
- // {videoDataExists(video) && !imageDataExists(image) ? (
133
- // <div style={{ width: "100%", position: 'relative' }}>
134
- // <VideoInput value={video} readOnly={true} light={true} />
135
- // {/**below div ensures the video is not clickable */}
136
- // <div style={{position: 'absolute', top: 0, left: 0, width: '100%', height: '100%'}}/>
137
- // </div>
138
- // ) : null}
139
- // </StyledEmbedSection>
140
- // )}
141
- // </StyledCardWrapper>
142
- // </LinkComp>
143
- // );
144
- // };
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CardContent = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var styled_components_1 = require("styled-components");
9
+ var injectHttps_1 = require("../../../utils/injectHttps");
10
+ var utilsOolib_1 = require("../../../utilsOolib");
11
+ var ActionMenu_1 = require("../../ActionMenu");
12
+ var Typo_1 = require("../../Typo");
13
+ var VideoInput_1 = __importDefault(require("../../VideoInput"));
14
+ var MetaBlock_1 = __importDefault(require("../../MetaBlock"));
15
+ var LineClampWrapper_1 = require("../comps/LineClampWrapper");
16
+ var styled_1 = require("../styled");
17
+ var decideLinkCompAndTarget_1 = require("../utils/decideLinkCompAndTarget");
18
+ var dontRenderIfBothOnClickAndTo_1 = require("../utils/dontRenderIfBothOnClickAndTo");
19
+ var parseCardConfig_1 = require("../utils/parseCardConfig");
20
+ var mediaDataExists_1 = require("../utils/mediaDataExists");
21
+ var styled_2 = require("./styled");
22
+ var CardPlaceholder_1 = require("../comps/CardPlaceholder");
23
+ var ImageInput_1 = require("../../ImageInput");
24
+ var icons_1 = require("../../../icons");
25
+ var Tags_1 = require("../../Tags");
26
+ var CrownSimple = icons_1.icons.CrownSimple;
27
+ var CardContent = function (_a) {
28
+ var id = _a.id, data = _a.data, config = _a.config, to = _a.to, onClick = _a.onClick, openInNewTab = _a.openInNewTab, actions = _a.actions, highlight = _a.highlight;
29
+ var theme = (0, styled_components_1.useTheme)();
30
+ var localize = (0, utilsOolib_1.useLocale)();
31
+ var parseSpecialSyntax = (theme || {}).parseSpecialSyntax;
32
+ var showEmbedSection = !!((config === null || config === void 0 ? void 0 : config.image) || (config === null || config === void 0 ? void 0 : config.video));
33
+ var _b = (0, parseCardConfig_1.parseCardConfig)({
34
+ config: config,
35
+ data: data,
36
+ parseSpecialSyntax: parseSpecialSyntax
37
+ }), cardLabel = _b.cardLabel, title = _b.title, video = _b.video, image = _b.image, metaBlock = _b.metaBlock, tagDisplay = _b.tagDisplay;
38
+ var dontRenderRes = (0, dontRenderIfBothOnClickAndTo_1.dontRenderIfBothOnClickAndTo)({ onClick: onClick, to: to });
39
+ if (dontRenderRes)
40
+ return dontRenderRes;
41
+ var _c = (0, decideLinkCompAndTarget_1.decideLinkCompAndTarget)({ to: to, openInNewTab: openInNewTab }), LinkComp = _c.LinkComp, target = _c.target, externalUrl = _c.externalUrl;
42
+ return (react_1.default.createElement(LinkComp, { target: target, href: (0, injectHttps_1.injectHttps)(to), to: to },
43
+ react_1.default.createElement(styled_2.StyledCardWrapper, { id: id, highlight: highlight, onClick: onClick ? function (e) { return onClick(e, data); } : undefined },
44
+ highlight && react_1.default.createElement(styled_2.StyledCrownWrapper, null,
45
+ react_1.default.createElement(styled_2.StyledCrown, null,
46
+ react_1.default.createElement(CrownSimple, { size: 24 }))),
47
+ react_1.default.createElement(styled_2.StyledUpperSection, { highlight: highlight },
48
+ react_1.default.createElement(styled_2.StyledContainer1, null,
49
+ cardLabel ? (react_1.default.createElement("div", { title: cardLabel, style: {
50
+ display: "flex",
51
+ gap: "2rem",
52
+ justifyContent: "space-between",
53
+ } },
54
+ react_1.default.createElement(Typo_1.LABEL, { style: {
55
+ textOverflow: "ellipsis",
56
+ overflow: "hidden",
57
+ whiteSpace: "nowrap",
58
+ }, color: (0, utilsOolib_1.getPrimaryColorText)(theme === null || theme === void 0 ? void 0 : theme.colors) }, cardLabel),
59
+ react_1.default.createElement("div", { style: { marginTop: "-1rem", marginRight: "-1rem" } }, actions && react_1.default.createElement(ActionMenu_1.ActionMenu, { actions: actions })))) : null,
60
+ title ? (react_1.default.createElement("div", { style: { display: "flex", alignItems: "end", gap: ".5rem" } },
61
+ " ",
62
+ react_1.default.createElement(LineClampWrapper_1.LineClampWrapper, { noOfLines_M: 6, title: title },
63
+ react_1.default.createElement(styled_1.StyledTitle, { capitalize: true, className: "StyledTitle" },
64
+ react_1.default.createElement(styled_1.StyledTitleSpan, { className: "StyledTitleSpan" }, localize(title)))))) : null),
65
+ tagDisplay && react_1.default.createElement(Tags_1.TagDisplay, { display: tagDisplay, color: "green" }),
66
+ (metaBlock === null || metaBlock === void 0 ? void 0 : metaBlock.length) > 0 ? (react_1.default.createElement(MetaBlock_1.default, { data: data, config: metaBlock }) //show only two meta for cardContent
67
+ ) : null),
68
+ showEmbedSection && (react_1.default.createElement(styled_2.StyledEmbedSection, null,
69
+ !(0, mediaDataExists_1.imageDataExists)(image) && !(0, mediaDataExists_1.videoDataExists)(video) &&
70
+ react_1.default.createElement(CardPlaceholder_1.CardPlaceholder, null),
71
+ (0, mediaDataExists_1.imageDataExists)(image) && (react_1.default.createElement("div", { style: { width: "100%" } }, react_1.default.createElement(ImageInput_1.ImageInput, { value: image, aspectRatio: "5/3", readOnly: true, defaultImageSpread: "cover", enableCaptions: false, disableImageBorder: true }))),
72
+ (0, mediaDataExists_1.videoDataExists)(video) && !(0, mediaDataExists_1.imageDataExists)(image) ? (react_1.default.createElement("div", { style: { width: "100%", position: 'relative' } },
73
+ react_1.default.createElement(VideoInput_1.default, { value: video, readOnly: true, light: true }),
74
+ react_1.default.createElement("div", { style: { position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' } }))) : null)))));
75
+ };
76
+ exports.CardContent = CardContent;
@@ -0,0 +1,7 @@
1
+ export const StyledContainer1: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export const StyledMetaBlock: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export const StyledEmbedSection: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export const StyledCardWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export const StyledUpperSection: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export const StyledCrownWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export const StyledCrown: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,60 +1,53 @@
1
- // import styled, { css } from "styled-components";
2
- // import { colors } from "../../../themes/colors";
3
- // import { transition } from "../../../themes/mixins/transitions";
4
- // import { CSSTitleAnimationOnHover } from "../styled";
5
- // const { greyColor5, white, invertGreen } = colors;
6
- // const flexColumn = css`
7
- // display: flex;
8
- // flex-direction: column;
9
- // `;
10
- // export const StyledContainer1 = styled.div`
11
- // ${flexColumn}
12
- // gap: 1rem;
13
- // `;
14
- // export const StyledMetaBlock = styled.div`
15
- // display: flex;
16
- // gap: 0.5em;
17
- // `;
18
- // export const StyledEmbedSection = styled.div`
19
- // height: 100px;
20
- // display: flex;
21
- // align-items: center;
22
- // overflow: hidden;
23
- // width: 100%;
24
- // `;
25
- // export const StyledCardWrapper = styled.div`
26
- // height: 100%;
27
- // border: 2px solid ${greyColor5};
28
- // background-color: ${({ highlight }) => highlight ? colors.lightGreen : greyColor5 };
29
- // display: flex;
30
- // flex-direction: column;
31
- // justify-content: space-between;
32
- // ${transition("background-color")}
33
- // cursor: pointer;
34
- // &:hover {
35
- // background-color: ${white};
36
- // ${CSSTitleAnimationOnHover};
37
- // #CardPlaceholder {
38
- // opacity: 1;
39
- // }
40
- // }
41
- // `;
42
- // export const StyledUpperSection = styled.div`
43
- // /* height: 100%; */
44
- // flex-grow: 1;
45
- // justify-content: space-between;
46
- // padding: 2rem;
47
- // ${flexColumn}
48
- // gap: ${({ highlight }) => highlight ? '2rem' : '3rem'};
49
- // padding-top: ${({ highlight }) => highlight ? "1rem" : "2rem"};
50
- // `;
51
- // export const StyledCrownWrapper = styled.div`
52
- // width: 100%;
53
- // display: flex;
54
- // justify-content: flex-end
55
- // `;
56
- // export const StyledCrown = styled.div`
57
- // width: max-content;
58
- // background-color: ${invertGreen};
59
- // padding: 1rem;
60
- // `
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || function (mod) {
23
+ if (mod && mod.__esModule) return mod;
24
+ var result = {};
25
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
+ __setModuleDefault(result, mod);
27
+ return result;
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.StyledCrown = exports.StyledCrownWrapper = exports.StyledUpperSection = exports.StyledCardWrapper = exports.StyledEmbedSection = exports.StyledMetaBlock = exports.StyledContainer1 = void 0;
31
+ var styled_components_1 = __importStar(require("styled-components"));
32
+ var colors_1 = require("../../../themes/colors");
33
+ var transitions_1 = require("../../../themes/mixins/transitions");
34
+ var styled_1 = require("../styled");
35
+ var greyColor5 = colors_1.colors.greyColor5, white = colors_1.colors.white, invertGreen = colors_1.colors.invertGreen;
36
+ var flexColumn = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
37
+ exports.StyledContainer1 = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n gap: 1rem;\n"], ["\n ", "\n gap: 1rem;\n"])), flexColumn);
38
+ exports.StyledMetaBlock = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n gap: 0.5em;\n"], ["\n display: flex;\n gap: 0.5em;\n"])));
39
+ exports.StyledEmbedSection = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 100px;\n display: flex;\n align-items: center;\n overflow: hidden;\n width: 100%;\n"], ["\n height: 100px;\n display: flex;\n align-items: center;\n overflow: hidden;\n width: 100%;\n"])));
40
+ exports.StyledCardWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: 100%;\n border: 2px solid ", ";\n background-color: ", "; \n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n ", "\n\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n ", ";\n #CardPlaceholder {\n opacity: 1;\n }\n }\n"], ["\n height: 100%;\n border: 2px solid ", ";\n background-color: ", "; \n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n ", "\n\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n ", ";\n #CardPlaceholder {\n opacity: 1;\n }\n }\n"])), greyColor5, function (_a) {
41
+ var highlight = _a.highlight;
42
+ return highlight ? colors_1.colors.lightGreen : greyColor5;
43
+ }, (0, transitions_1.transition)("background-color"), white, styled_1.CSSTitleAnimationOnHover);
44
+ exports.StyledUpperSection = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n /* height: 100%; */\n flex-grow: 1;\n justify-content: space-between;\n padding: 2rem;\n ", "\n gap: ", ";\n padding-top: ", ";\n"], ["\n /* height: 100%; */\n flex-grow: 1;\n justify-content: space-between;\n padding: 2rem;\n ", "\n gap: ", ";\n padding-top: ", ";\n"])), flexColumn, function (_a) {
45
+ var highlight = _a.highlight;
46
+ return highlight ? '2rem' : '3rem';
47
+ }, function (_a) {
48
+ var highlight = _a.highlight;
49
+ return highlight ? "1rem" : "2rem";
50
+ });
51
+ exports.StyledCrownWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n width: 100%;\n display: flex; \n justify-content: flex-end\n"], ["\n width: 100%;\n display: flex; \n justify-content: flex-end\n"])));
52
+ exports.StyledCrown = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n width: max-content;\n background-color: ", ";\n padding: 1rem;\n"], ["\n width: max-content;\n background-color: ", ";\n padding: 1rem;\n"])), invertGreen);
53
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
@@ -0,0 +1,12 @@
1
+ export function ListContent({ id, data, config, to, onClick, openInNewTab, actions, statusTag, variant, }: {
2
+ id: any;
3
+ data: any;
4
+ config: any;
5
+ to: any;
6
+ onClick: any;
7
+ openInNewTab: any;
8
+ actions: any;
9
+ statusTag: any;
10
+ variant?: string;
11
+ }): React.JSX.Element;
12
+ import React from "react";
@@ -1,172 +1,87 @@
1
- // import React from "react";
2
- // import { useTheme } from "styled-components";
3
- // import { injectHttps } from "../../../utils/injectHttps";
4
- // import { getPrimaryColorText, useLocale } from "../../../utilsOolib";
5
- // import { ActionMenu } from "../../ActionMenu";
6
- // import { ImageInput } from "../../ImageInput";
7
- // import { TagDisplay } from "../../Tags";
8
- // import VideoInput from "../../VideoInput";
9
- // import MetaBlock from "../../MetaBlock";
10
- // import { CardPlaceholder } from "../comps/CardPlaceholder";
11
- // import { LineClampWrapper } from "../comps/LineClampWrapper";
12
- // import { StyledLabel, StyledTitle, StyledTitleSpan } from "../styled";
13
- // import { decideLinkCompAndTarget } from "../utils/decideLinkCompAndTarget";
14
- // import { dontRenderIfBothOnClickAndTo } from "../utils/dontRenderIfBothOnClickAndTo";
15
- // import { imageDataExists, videoDataExists } from "../utils/mediaDataExists";
16
- // import { parseCardConfig } from "../utils/parseCardConfig";
17
- // import {
18
- // StyledContentModule2,
19
- // StyledHeader,
20
- // StyledListElemContainer,
21
- // StyledListWrapper,
22
- // StyledMediaMask,
23
- // StyledStatusTagCardLabelWrapper,
24
- // StyledVideoWrapper,
25
- // } from "./styled.js";
26
- // import { ProfileImageInput } from "../../ImageInput/derivedComps/ProfileImageInput";
27
- // import { useScreenWidth } from "../../../utils/_EXPORTS";
28
- // import { getBreakPoint } from "../../../themes/mixins";
29
- // export const ListContent = ({
30
- // id,
31
- // data,
32
- // config,
33
- // to,
34
- // onClick,
35
- // openInNewTab,
36
- // actions,
37
- // statusTag,
38
- // variant = "content", //alt = profile
39
- // }) => {
40
- // const theme = useTheme();
41
- // const localize = useLocale();
42
- // const screenWidth = useScreenWidth()
43
- // const { parseSpecialSyntax } = theme || {};
44
- // const { cardLabel, title, video, image, metaBlock } = parseCardConfig({
45
- // config,
46
- // data,
47
- // parseSpecialSyntax,
48
- // });
49
- // let dontRenderRes = dontRenderIfBothOnClickAndTo({ onClick, to });
50
- // if (dontRenderRes) return dontRenderRes;
51
- // const { LinkComp, target, externalUrl } = decideLinkCompAndTarget({
52
- // to,
53
- // openInNewTab,
54
- // });
55
- // const mediaConfigExists = config.video || config.image;
56
- // return (
57
- // <LinkComp target={target} href={injectHttps(to)} to={to}>
58
- // <StyledListElemContainer
59
- // id={id}
60
- // onClick={onClick ? e => onClick(e,data) : undefined}
61
- // /** imp to pass data cuz its used by some on okf eg. LinkOrEmbedModal*/
62
- // >
63
- // <StyledListWrapper
64
- // mediaConfigExists={
65
- // mediaConfigExists /*cuz if it does space needs to be allocated for it */
66
- // }
67
- // actions={actions}
68
- // >
69
- // <StyledHeader>
70
- // {(cardLabel || statusTag) &&
71
- // <StyledStatusTagCardLabelWrapper style={{maxWidth: '100%', paddingBottom: '0.7rem'}}>
72
- // {cardLabel && (
73
- // <div title={cardLabel} style={{maxWidth: '100%'}}>
74
- // <StyledLabel color={getPrimaryColorText(theme?.colors)}>
75
- // {cardLabel}
76
- // </StyledLabel>
77
- // </div>
78
- // )}
79
- // {statusTag && (
80
- // <TagDisplay variant={"secondary"} XS display={statusTag} />
81
- // )}
82
- // </StyledStatusTagCardLabelWrapper>}
83
- // {title ? (
84
- // <div style={{flexGrow: 1}}>
85
- // <LineClampWrapper noOfLines_M={6} noOfLines_D={3} title={title}>
86
- // <StyledTitle capitalize className="StyledTitle">
87
- // <StyledTitleSpan className="StyledTitleSpan">
88
- // {localize(title)}
89
- // </StyledTitleSpan>
90
- // </StyledTitle>
91
- // </LineClampWrapper>
92
- // </div>
93
- // ) : null}
94
- // {metaBlock?.length > 0 && (
95
- // <div style={{ width: "100%", paddingTop: "1rem" }}>
96
- // <MetaBlock data={data} config={metaBlock} />
97
- // </div>
98
- // )}
99
- // </StyledHeader>
100
- // {variant === "content" ? (
101
- // (mediaConfigExists || actions) && (
102
- // <StyledContentModule2>
103
- // {mediaConfigExists && <>
104
- // {!imageDataExists(image) && !videoDataExists(video) && (
105
- // <StyledMediaMask>
106
- // <CardPlaceholder
107
- // style={{ height: "100%", width: "auto" }}
108
- // />
109
- // </StyledMediaMask>
110
- // )}
111
- // {videoDataExists(video) && !imageDataExists(image) ? (
112
- // <StyledMediaMask>
113
- // <StyledVideoWrapper>
114
- // <VideoInput
115
- // value={video}
116
- // readOnly={true}
117
- // light={true}
118
- // height={"100%"}
119
- // />
120
- // {/**below div ensures the video is not clickable */}
121
- // <div
122
- // style={{
123
- // position: "absolute",
124
- // top: 0,
125
- // left: 0,
126
- // width: "100%",
127
- // height: "100%",
128
- // }}
129
- // />
130
- // </StyledVideoWrapper>
131
- // </StyledMediaMask>
132
- // ) : null}
133
- // {imageDataExists(image) && (
134
- // <StyledMediaMask>
135
- // {
136
- // // <div
137
- // // // style={{
138
- // // // width: "14rem",
139
- // // // }}
140
- // // >
141
- // <ImageInput
142
- // stretchToFullHeight
143
- // value={image}
144
- // aspectRatio={"5/3"}
145
- // readOnly={true}
146
- // enableCaptions={false}
147
- // disableImageBorder={true}
148
- // defaultImageSpread={"cover"}
149
- // />
150
- // // </div>
151
- // }
152
- // </StyledMediaMask>
153
- // )}
154
- // </>}
155
- // {actions && <ActionMenu actions={actions} align="right" />}
156
- // </StyledContentModule2>
157
- // )
158
- // ) : (
159
- // <StyledContentModule2>
160
- // <ProfileImageInput
161
- // readOnly
162
- // value={image}
163
- // size={screenWidth >= getBreakPoint('sm') ? 60 : 70}
164
- // imageTitle={title}
165
- // />
166
- // </StyledContentModule2>
167
- // )}
168
- // </StyledListWrapper>
169
- // </StyledListElemContainer>
170
- // </LinkComp>
171
- // );
172
- // };
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ListContent = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var styled_components_1 = require("styled-components");
9
+ var injectHttps_1 = require("../../../utils/injectHttps");
10
+ var utilsOolib_1 = require("../../../utilsOolib");
11
+ var ActionMenu_1 = require("../../ActionMenu");
12
+ var ImageInput_1 = require("../../ImageInput");
13
+ var Tags_1 = require("../../Tags");
14
+ var VideoInput_1 = __importDefault(require("../../VideoInput"));
15
+ var MetaBlock_1 = __importDefault(require("../../MetaBlock"));
16
+ var CardPlaceholder_1 = require("../comps/CardPlaceholder");
17
+ var LineClampWrapper_1 = require("../comps/LineClampWrapper");
18
+ var styled_1 = require("../styled");
19
+ var decideLinkCompAndTarget_1 = require("../utils/decideLinkCompAndTarget");
20
+ var dontRenderIfBothOnClickAndTo_1 = require("../utils/dontRenderIfBothOnClickAndTo");
21
+ var mediaDataExists_1 = require("../utils/mediaDataExists");
22
+ var parseCardConfig_1 = require("../utils/parseCardConfig");
23
+ var styled_js_1 = require("./styled.js");
24
+ var ProfileImageInput_1 = require("../../ImageInput/derivedComps/ProfileImageInput");
25
+ var _EXPORTS_1 = require("../../../utils/_EXPORTS");
26
+ var mixins_1 = require("../../../themes/mixins");
27
+ var ListContent = function (_a) {
28
+ var id = _a.id, data = _a.data, config = _a.config, to = _a.to, onClick = _a.onClick, openInNewTab = _a.openInNewTab, actions = _a.actions, statusTag = _a.statusTag, _b = _a.variant, variant = _b === void 0 ? "content" : _b;
29
+ var theme = (0, styled_components_1.useTheme)();
30
+ var localize = (0, utilsOolib_1.useLocale)();
31
+ var screenWidth = (0, _EXPORTS_1.useScreenWidth)();
32
+ var parseSpecialSyntax = (theme || {}).parseSpecialSyntax;
33
+ var _c = (0, parseCardConfig_1.parseCardConfig)({
34
+ config: config,
35
+ data: data,
36
+ parseSpecialSyntax: parseSpecialSyntax,
37
+ }), cardLabel = _c.cardLabel, title = _c.title, video = _c.video, image = _c.image, metaBlock = _c.metaBlock;
38
+ var dontRenderRes = (0, dontRenderIfBothOnClickAndTo_1.dontRenderIfBothOnClickAndTo)({ onClick: onClick, to: to });
39
+ if (dontRenderRes)
40
+ return dontRenderRes;
41
+ var _d = (0, decideLinkCompAndTarget_1.decideLinkCompAndTarget)({
42
+ to: to,
43
+ openInNewTab: openInNewTab,
44
+ }), LinkComp = _d.LinkComp, target = _d.target, externalUrl = _d.externalUrl;
45
+ var mediaConfigExists = config.video || config.image;
46
+ return (react_1.default.createElement(LinkComp, { target: target, href: (0, injectHttps_1.injectHttps)(to), to: to },
47
+ react_1.default.createElement(styled_js_1.StyledListElemContainer, { id: id, onClick: onClick ? function (e) { return onClick(e, data); } : undefined },
48
+ react_1.default.createElement(styled_js_1.StyledListWrapper, { mediaConfigExists: mediaConfigExists /*cuz if it does space needs to be allocated for it */, actions: actions },
49
+ react_1.default.createElement(styled_js_1.StyledHeader, null,
50
+ (cardLabel || statusTag) &&
51
+ react_1.default.createElement(styled_js_1.StyledStatusTagCardLabelWrapper, { style: { maxWidth: '100%', paddingBottom: '0.7rem' } },
52
+ cardLabel && (react_1.default.createElement("div", { title: cardLabel, style: { maxWidth: '100%' } },
53
+ react_1.default.createElement(styled_1.StyledLabel, { color: (0, utilsOolib_1.getPrimaryColorText)(theme === null || theme === void 0 ? void 0 : theme.colors) }, cardLabel))),
54
+ statusTag && (react_1.default.createElement(Tags_1.TagDisplay, { variant: "secondary", XS: true, display: statusTag }))),
55
+ title ? (react_1.default.createElement("div", { style: { flexGrow: 1 } },
56
+ react_1.default.createElement(LineClampWrapper_1.LineClampWrapper, { noOfLines_M: 6, noOfLines_D: 3, title: title },
57
+ react_1.default.createElement(styled_1.StyledTitle, { capitalize: true, className: "StyledTitle" },
58
+ react_1.default.createElement(styled_1.StyledTitleSpan, { className: "StyledTitleSpan" }, localize(title)))))) : null,
59
+ (metaBlock === null || metaBlock === void 0 ? void 0 : metaBlock.length) > 0 && (react_1.default.createElement("div", { style: { width: "100%", paddingTop: "1rem" } },
60
+ react_1.default.createElement(MetaBlock_1.default, { data: data, config: metaBlock })))),
61
+ variant === "content" ? ((mediaConfigExists || actions) && (react_1.default.createElement(styled_js_1.StyledContentModule2, null,
62
+ mediaConfigExists && react_1.default.createElement(react_1.default.Fragment, null,
63
+ !(0, mediaDataExists_1.imageDataExists)(image) && !(0, mediaDataExists_1.videoDataExists)(video) && (react_1.default.createElement(styled_js_1.StyledMediaMask, null,
64
+ react_1.default.createElement(CardPlaceholder_1.CardPlaceholder, { style: { height: "100%", width: "auto" } }))),
65
+ (0, mediaDataExists_1.videoDataExists)(video) && !(0, mediaDataExists_1.imageDataExists)(image) ? (react_1.default.createElement(styled_js_1.StyledMediaMask, null,
66
+ react_1.default.createElement(styled_js_1.StyledVideoWrapper, null,
67
+ react_1.default.createElement(VideoInput_1.default, { value: video, readOnly: true, light: true, height: "100%" }),
68
+ react_1.default.createElement("div", { style: {
69
+ position: "absolute",
70
+ top: 0,
71
+ left: 0,
72
+ width: "100%",
73
+ height: "100%",
74
+ } })))) : null,
75
+ (0, mediaDataExists_1.imageDataExists)(image) && (react_1.default.createElement(styled_js_1.StyledMediaMask, null,
76
+ // <div
77
+ // // style={{
78
+ // // width: "14rem",
79
+ // // }}
80
+ // >
81
+ react_1.default.createElement(ImageInput_1.ImageInput, { stretchToFullHeight: true, value: image, aspectRatio: "5/3", readOnly: true, enableCaptions: false, disableImageBorder: true, defaultImageSpread: "cover" })
82
+ // </div>
83
+ ))),
84
+ actions && react_1.default.createElement(ActionMenu_1.ActionMenu, { actions: actions, align: "right" })))) : (react_1.default.createElement(styled_js_1.StyledContentModule2, null,
85
+ react_1.default.createElement(ProfileImageInput_1.ProfileImageInput, { readOnly: true, value: image, size: screenWidth >= (0, mixins_1.getBreakPoint)('sm') ? 60 : 70, imageTitle: title })))))));
86
+ };
87
+ exports.ListContent = ListContent;
@@ -0,0 +1,7 @@
1
+ export const StyledListElemContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export const StyledStatusTagCardLabelWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export const StyledHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export const StyledListWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export const StyledContentModule2: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export const StyledMediaMask: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export const StyledVideoWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,71 +1,26 @@
1
- // import styled from "styled-components";
2
- // import { colors } from "../../../themes";
3
- // import { ellipsis, mediaQuery } from "../../../themes/mixins";
4
- // import { LABEL } from "../../Typo";
5
- // import { CSSTitleAnimationOnHover } from "../styled";
6
- // export const StyledListElemContainer = styled.div`
7
- // border-bottom: 1px solid ${colors.greyColor15};
8
- // margin-bottom: 2rem;
9
- // padding-bottom: 2rem;
10
- // cursor: pointer;
11
- // &:hover {
12
- // ${CSSTitleAnimationOnHover};
13
- // #CardPlaceholder {
14
- // opacity: 1;
15
- // }
16
- // }
17
- // `;
18
- // export const StyledStatusTagCardLabelWrapper = styled.div`
19
- // display: flex;
20
- // gap: 1rem;
21
- // align-items: center;
22
- // flex-wrap: wrap;
23
- // `
24
- // export const StyledHeader = styled.div`
25
- // display: flex;
26
- // align-items: flex-start;
27
- // flex-direction: column;
28
- // flex-wrap: wrap;
29
- // min-width: 0;
30
- // flex-grow: 1;
31
- // `;
32
- // /** the absolute positioning based approach is required, else the ellipsis causes UI glitches */
33
- // const mediaContainerWidth = 70;
34
- // const mediaContainerWidth_SM = 60;
35
- // export const StyledListWrapper = styled.div`
36
- // width: auto;
37
- // display: flex;
38
- // gap:2rem;
39
- // position: relative;
40
- // `;
41
- // export const StyledContentModule2 = styled.div`
42
- // display: flex;
43
- // flex-direction: column-reverse;
44
- // justify-content: flex-end;
45
- // align-items: flex-end;
46
- // gap: 1rem;
47
- // flex-shrink: 0;
48
- // ${mediaQuery("sm")} {
49
- // flex-direction: row;
50
- // align-items: center;
51
- // }
52
- // `;
53
- // export const StyledMediaMask = styled.div`
54
- // display: flex;
55
- // flex-direction: column;
56
- // align-items: center;
57
- // overflow: hidden;
58
- // height: 84px;
59
- // width: ${mediaContainerWidth}px;
60
- // ${mediaQuery("sm")} {
61
- // width: ${mediaContainerWidth_SM}px;
62
- // height: 6rem;
63
- // }
64
- // `;
65
- // export const StyledVideoWrapper = styled.div`
66
- // width: 14rem;
67
- // height: 8.4rem;
68
- // ${mediaQuery("sm")} {
69
- // height: 6rem;
70
- // }
71
- // `
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
7
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.StyledVideoWrapper = exports.StyledMediaMask = exports.StyledContentModule2 = exports.StyledListWrapper = exports.StyledHeader = exports.StyledStatusTagCardLabelWrapper = exports.StyledListElemContainer = void 0;
11
+ var styled_components_1 = __importDefault(require("styled-components"));
12
+ var themes_1 = require("../../../themes");
13
+ var mixins_1 = require("../../../themes/mixins");
14
+ var Typo_1 = require("../../Typo");
15
+ var styled_1 = require("../styled");
16
+ exports.StyledListElemContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-bottom: 1px solid ", ";\n margin-bottom: 2rem;\n padding-bottom: 2rem;\n cursor: pointer;\n &:hover {\n ", ";\n #CardPlaceholder {\n opacity: 1;\n }\n }\n"], ["\n border-bottom: 1px solid ", ";\n margin-bottom: 2rem;\n padding-bottom: 2rem;\n cursor: pointer;\n &:hover {\n ", ";\n #CardPlaceholder {\n opacity: 1;\n }\n }\n"])), themes_1.colors.greyColor15, styled_1.CSSTitleAnimationOnHover);
17
+ exports.StyledStatusTagCardLabelWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n gap: 1rem;\n align-items: center;\n flex-wrap: wrap;\n"], ["\n display: flex;\n gap: 1rem;\n align-items: center;\n flex-wrap: wrap;\n"])));
18
+ exports.StyledHeader = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\n \n min-width: 0;\n flex-grow: 1;\n"], ["\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\n \n min-width: 0;\n flex-grow: 1;\n"])));
19
+ /** the absolute positioning based approach is required, else the ellipsis causes UI glitches */
20
+ var mediaContainerWidth = 70;
21
+ var mediaContainerWidth_SM = 60;
22
+ exports.StyledListWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: auto;\n display: flex;\n gap:2rem;\n position: relative;\n \n"], ["\n width: auto;\n display: flex;\n gap:2rem;\n position: relative;\n \n"])));
23
+ exports.StyledContentModule2 = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n flex-direction: column-reverse;\n justify-content: flex-end;\n align-items: flex-end;\n gap: 1rem;\n flex-shrink: 0;\n ", " {\n flex-direction: row;\n align-items: center;\n }\n"], ["\n display: flex;\n flex-direction: column-reverse;\n justify-content: flex-end;\n align-items: flex-end;\n gap: 1rem;\n flex-shrink: 0;\n ", " {\n flex-direction: row;\n align-items: center;\n }\n"])), (0, mixins_1.mediaQuery)("sm"));
24
+ exports.StyledMediaMask = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n height: 84px;\n width: ", "px;\n ", " {\n width: ", "px;\n height: 6rem;\n }\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n height: 84px;\n width: ", "px;\n ", " {\n width: ", "px;\n height: 6rem;\n }\n"])), mediaContainerWidth, (0, mixins_1.mediaQuery)("sm"), mediaContainerWidth_SM);
25
+ exports.StyledVideoWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n width: 14rem;\n height: 8.4rem;\n ", " {\n height: 6rem;\n }\n"], ["\n width: 14rem;\n height: 8.4rem;\n ", " {\n height: 6rem;\n }\n"])), (0, mixins_1.mediaQuery)("sm"));
26
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
@@ -1,21 +1,5 @@
1
1
  declare namespace _default {
2
2
  let title: string;
3
- namespace argTypes {
4
- namespace width {
5
- let name: string;
6
- namespace control {
7
- let type: string;
8
- let min: number;
9
- let max: number;
10
- let step: number;
11
- }
12
- }
13
- }
14
- namespace args {
15
- export let invert: boolean;
16
- let width_1: number;
17
- export { width_1 as width };
18
- }
19
3
  }
20
4
  export default _default;
21
5
  export function Playground(args: any): React.JSX.Element;
@@ -8,16 +8,16 @@ var react_1 = __importDefault(require("react"));
8
8
  var Playground_1 = require("../../../components/Playground");
9
9
  exports.default = {
10
10
  title: "Components/Playground",
11
- argTypes: {
12
- width: {
13
- name: "Width PX",
14
- control: { type: 'range', min: 300, max: 1500, step: 100 },
15
- }
16
- },
17
- args: {
18
- invert: false,
19
- width: 1300,
20
- }
11
+ // argTypes:{
12
+ // width: {
13
+ // name: "Width PX",
14
+ // control: { type: 'range', min: 300, max: 1500, step: 100 },
15
+ // }
16
+ // },
17
+ // args: {
18
+ // invert: false,
19
+ // width: 1300,
20
+ // }
21
21
  };
22
22
  var Playground = function (args) {
23
23
  return (react_1.default.createElement("div", null,
@@ -12,7 +12,9 @@ declare namespace _default {
12
12
  export let width: number;
13
13
  export let aspectRatio: string;
14
14
  export let fontWeight: number;
15
+ export let style: {};
15
16
  export let letterSizeMultiplier: string;
17
+ export let strechToFullHeight: boolean;
16
18
  }
17
19
  }
18
20
  export default _default;
@@ -25,11 +25,16 @@ exports.default = {
25
25
  width: 500,
26
26
  aspectRatio: "5/3",
27
27
  fontWeight: 900,
28
- letterSizeMultiplier: '1.8'
28
+ style: {},
29
+ letterSizeMultiplier: '1.8',
30
+ strechToFullHeight: false,
29
31
  },
30
32
  };
31
33
  var Image_Placeholder = function (args) {
32
- return (React.createElement("div", { style: { width: "".concat(args.width, "px") } },
34
+ return (React.createElement("div", { style: {
35
+ width: "".concat(args.width, "px"),
36
+ height: '700px',
37
+ } },
33
38
  React.createElement(ImagePlaceholder_1.ImagePlaceholder, __assign({}, args))));
34
39
  };
35
40
  exports.Image_Placeholder = Image_Placeholder;
@@ -1,8 +1,10 @@
1
- export function ImagePlaceholder({ title, height, fontWeight, aspectRatio, letterSizeMultiplier, }: {
1
+ export function ImagePlaceholder({ title, height, fontWeight, aspectRatio, letterSizeMultiplier, strechToFullHeight, style }: {
2
2
  title: any;
3
3
  height: any;
4
4
  fontWeight: any;
5
5
  aspectRatio?: string;
6
6
  letterSizeMultiplier?: number;
7
+ strechToFullHeight?: boolean;
8
+ style?: {};
7
9
  }): React.JSX.Element;
8
10
  import React from 'react';
@@ -31,9 +31,9 @@ var react_1 = __importStar(require("react"));
31
31
  var gradient_background_jpg_1 = __importDefault(require("../../../assets/images/gradient_background.jpg"));
32
32
  var styled_1 = require("./styled");
33
33
  var ImagePlaceholder = function (_a) {
34
- var title = _a.title, height = _a.height, fontWeight = _a.fontWeight, _b = _a.aspectRatio, aspectRatio = _b === void 0 ? "5/3" : _b, _c = _a.letterSizeMultiplier, letterSizeMultiplier = _c === void 0 ? 1.8 : _c;
34
+ var title = _a.title, height = _a.height, fontWeight = _a.fontWeight, _b = _a.aspectRatio, aspectRatio = _b === void 0 ? "5/3" : _b, _c = _a.letterSizeMultiplier, letterSizeMultiplier = _c === void 0 ? 1.8 : _c, _d = _a.strechToFullHeight, strechToFullHeight = _d === void 0 ? false : _d, _e = _a.style, style = _e === void 0 ? {} : _e;
35
35
  var containerRef = (0, react_1.useRef)(null);
36
- var _d = (0, react_1.useState)(200), letterSize = _d[0], setLetterSize = _d[1];
36
+ var _f = (0, react_1.useState)(200), letterSize = _f[0], setLetterSize = _f[1];
37
37
  (0, react_1.useEffect)(function () {
38
38
  var calculateLetterSize = function () {
39
39
  if (containerRef.current) {
@@ -62,7 +62,7 @@ var ImagePlaceholder = function (_a) {
62
62
  var randomColor = colors[Math.floor(Math.random() * colors.length)];
63
63
  randomColor += '80'; // to convert to RGBA format for 50% opacity
64
64
  var firstLetter = title.charAt(0).toUpperCase();
65
- return (react_1.default.createElement(styled_1.StyledContainer, { ref: containerRef, aspectRatio: aspectRatio, height: height },
65
+ return (react_1.default.createElement(styled_1.StyledContainer, { ref: containerRef, aspectRatio: aspectRatio, height: height, strechToFullHeight: strechToFullHeight, style: style },
66
66
  react_1.default.createElement(styled_1.StyledImageLayer, null,
67
67
  react_1.default.createElement(styled_1.StyledImage, { src: gradient_background_jpg_1.default, alt: title })),
68
68
  react_1.default.createElement(styled_1.StyledColorOverlay, { color: randomColor }),
@@ -12,8 +12,8 @@ var styled_components_1 = __importDefault(require("styled-components"));
12
12
  var themes_1 = require("../../themes");
13
13
  var white = themes_1.colors.white;
14
14
  exports.StyledContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n width: 100%;\n height: ", ";\n aspect-ratio: ", ";\n"], ["\n position: relative;\n width: 100%;\n height: ", ";\n aspect-ratio: ", ";\n"])), function (_a) {
15
- var height = _a.height;
16
- return height || "inherit";
15
+ var height = _a.height, strechToFullHeight = _a.strechToFullHeight;
16
+ return height ? height : (strechToFullHeight ? '100%' : 'auto');
17
17
  }, function (props) { return props.aspectRatio; });
18
18
  exports.StyledImageLayer = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n inset: 0;\n overflow: hidden;\n"], ["\n position: absolute;\n inset: 0;\n overflow: hidden;\n"])));
19
19
  exports.StyledImage = styled_components_1.default.img(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n"], ["\n width: 100%;\n height: 100%;\n object-fit: cover;\n"])));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.154.0",
3
+ "version": "2.155.0",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,6 +0,0 @@
1
- declare namespace _default {
2
- let title: string;
3
- }
4
- export default _default;
5
- export function CardContent(args: any): React.JSX.Element;
6
- import React from "react";
@@ -1,47 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CardContent = void 0;
7
- var react_1 = __importDefault(require("react"));
8
- // import { Container } from "../../../../components/Container";
9
- // import { PaddingTopBottom30 } from "../../../../components/Paddings";
10
- // import { WrapperCardGrid } from "../../../../components/Wrappers/WrapperCardGrid";
11
- // import { Wrapper1500 } from "../../../../components/Wrappers";
12
- // import { CardContent as CardContent_ } from "../../../../components/cards/CardContent";
13
- // import { commonCardArgs, commonCardArgTypes, cardContentArgs, cardContentArgTypes } from "./utils/cardArgTypes";
14
- // import { parseCardArgs } from "./utils/parseCardArgs";
15
- // import { makeArrayFromLength } from "../../../../utils/makeArrayFromLength";
16
- exports.default = {
17
- title: "Components/CardContent",
18
- // argTypes: {
19
- // ...commonCardArgTypes,
20
- // ...cardContentArgTypes
21
- // },
22
- // args: {
23
- // ...commonCardArgs,
24
- // ...cardContentArgs
25
- // },
26
- };
27
- var CardContent = function (args) {
28
- // const props = parseCardArgs(args);
29
- return (react_1.default.createElement(react_1.default.Fragment, null));
30
- };
31
- exports.CardContent = CardContent;
32
- // export const Playground = (args) => {
33
- // const props = parseCardArgs(args);
34
- // return (
35
- // <Container>
36
- // {/* <PaddingTopBottom30>
37
- // <Wrapper1500 left>
38
- // <WrapperCardGrid>
39
- // {makeArrayFromLength(50).map(d => (
40
- // <CardContent_ {...props} config={props.config} />
41
- // )) }
42
- // </WrapperCardGrid>
43
- // </Wrapper1500>
44
- // </PaddingTopBottom30> */}
45
- // </Container>
46
- // );
47
- // };
@@ -1,6 +0,0 @@
1
- declare namespace _default {
2
- let title: string;
3
- }
4
- export default _default;
5
- export function ListContent(args: any): React.JSX.Element;
6
- import React from "react";
@@ -1,50 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ListContent = void 0;
7
- var react_1 = __importDefault(require("react"));
8
- // import { Container } from "../../../../components/Container";
9
- // import { PaddingTopBottom30 } from "../../../../components/Paddings";
10
- // import { ListContent as ListContent_ } from "../../../../components/cards/ListContent";
11
- // import docs from "./ListContent.mdx";
12
- // import { commonCardArgs, commonCardArgTypes, listContentArgs, listContentArgTypes } from "./utils/cardArgTypes";
13
- // import { parseCardArgs } from "./utils/parseCardArgs";
14
- // import { Wrapper700 } from "../../../../components/Wrappers";
15
- // import { makeArrayFromLength } from "../../../../utils/makeArrayFromLength";
16
- exports.default = {
17
- title: "Components/ListContent",
18
- // argTypes: {
19
- // ...commonCardArgTypes,
20
- // ...listContentArgTypes
21
- // },
22
- // args: {
23
- // ...commonCardArgs,
24
- // ...listContentArgs
25
- // },
26
- // parameters: {
27
- // docs: {
28
- // page: docs,
29
- // },
30
- // },
31
- };
32
- var ListContent = function (args) {
33
- // const props = parseCardArgs(args);
34
- return (react_1.default.createElement(react_1.default.Fragment, null));
35
- };
36
- exports.ListContent = ListContent;
37
- // export const Playground = (args) => {
38
- // const props = parseCardArgs(args);
39
- // return (
40
- // <Container>
41
- // <PaddingTopBottom30>
42
- // <Wrapper700 left>
43
- // {makeArrayFromLength(50).map(d => (
44
- // <ListContent_ {...props} config={props.config} />
45
- // )) }
46
- // </Wrapper700>
47
- // </PaddingTopBottom30>
48
- // </Container>
49
- // );
50
- // };