alicia-design-system 1.48.0 → 1.48.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.
- package/dist/cjs/alicia/common/Card/Card.d.ts +59 -38
- package/dist/cjs/alicia/common/Card/Card.js +14 -20
- package/dist/cjs/alicia/common/Card/Card.js.map +1 -1
- package/dist/cjs/alicia/common/Card/Card.spec.js +22 -9
- package/dist/cjs/alicia/common/Card/Card.spec.js.map +1 -1
- package/dist/cjs/alicia/common/Card/Card.stories.d.ts +434 -336
- package/dist/cjs/alicia/common/Card/Card.stories.js +236 -140
- package/dist/cjs/alicia/common/Card/Card.stories.js.map +1 -1
- package/dist/esm/alicia/common/Card/Card.d.ts +59 -38
- package/dist/esm/alicia/common/Card/Card.js +14 -20
- package/dist/esm/alicia/common/Card/Card.js.map +1 -1
- package/dist/esm/alicia/common/Card/Card.spec.js +22 -9
- package/dist/esm/alicia/common/Card/Card.spec.js.map +1 -1
- package/dist/esm/alicia/common/Card/Card.stories.d.ts +434 -336
- package/dist/esm/alicia/common/Card/Card.stories.js +237 -141
- package/dist/esm/alicia/common/Card/Card.stories.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,57 +1,78 @@
|
|
|
1
1
|
import { ComponentWithAs, IconProps, ButtonProps } from '@chakra-ui/react';
|
|
2
2
|
import { FC, ReactElement } from "react";
|
|
3
3
|
export declare const Card: FC<CardProps>;
|
|
4
|
+
type HeaderProps = {
|
|
5
|
+
isVisible?: boolean;
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
isPartnerLogoVisible?: boolean;
|
|
9
|
+
partnerLogoSrc?: string;
|
|
10
|
+
isPriceVisible?: boolean;
|
|
11
|
+
offeredByText?: string;
|
|
12
|
+
};
|
|
13
|
+
type HeaderIconProps = {
|
|
14
|
+
isVisible?: boolean;
|
|
15
|
+
icon?: ComponentWithAs<"svg", IconProps>;
|
|
16
|
+
};
|
|
17
|
+
type TagProps = {
|
|
18
|
+
isVisible?: boolean;
|
|
19
|
+
text?: string;
|
|
20
|
+
backgroundColor?: string;
|
|
21
|
+
color?: string;
|
|
22
|
+
icon?: ComponentWithAs<"svg", IconProps>;
|
|
23
|
+
};
|
|
24
|
+
type PriceProps = {
|
|
25
|
+
label?: string;
|
|
26
|
+
perMonthText?: string;
|
|
27
|
+
fromText?: string;
|
|
28
|
+
customPriceTag?: ReactElement;
|
|
29
|
+
};
|
|
4
30
|
type CheckListProps = {
|
|
5
31
|
id: number;
|
|
6
32
|
label: string;
|
|
7
|
-
icon
|
|
33
|
+
icon: ComponentWithAs<"svg", IconProps>;
|
|
34
|
+
};
|
|
35
|
+
type ChecklistProps = {
|
|
36
|
+
isVisible?: boolean;
|
|
37
|
+
data?: CheckListProps[];
|
|
8
38
|
};
|
|
9
39
|
type AddonsListProps = {
|
|
10
40
|
id: number;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
icon
|
|
41
|
+
text: string;
|
|
42
|
+
price: string;
|
|
43
|
+
icon: ComponentWithAs<"svg", IconProps>;
|
|
44
|
+
};
|
|
45
|
+
type AddonProps = {
|
|
46
|
+
isVisible?: boolean;
|
|
47
|
+
data?: AddonsListProps[];
|
|
48
|
+
};
|
|
49
|
+
type ReadMoreProps = {
|
|
50
|
+
isVisible?: boolean;
|
|
51
|
+
isPriceVisible?: boolean;
|
|
52
|
+
text?: string;
|
|
53
|
+
action?: () => void;
|
|
14
54
|
};
|
|
15
55
|
type CustomButtonProps = ButtonProps & {
|
|
56
|
+
isVisible?: boolean;
|
|
16
57
|
text?: string;
|
|
17
58
|
iconPosition?: 'left' | 'right';
|
|
18
59
|
icon?: ComponentWithAs<"svg", IconProps>;
|
|
19
60
|
};
|
|
61
|
+
type CTAProps = {
|
|
62
|
+
isVisible?: boolean;
|
|
63
|
+
primary?: CustomButtonProps;
|
|
64
|
+
secondary?: CustomButtonProps;
|
|
65
|
+
isPriceVisible?: boolean;
|
|
66
|
+
};
|
|
20
67
|
type CardProps = {
|
|
21
|
-
fontFamily?: string;
|
|
22
|
-
showIcon?: boolean;
|
|
23
|
-
icon?: ReactElement;
|
|
24
|
-
tag?: boolean;
|
|
25
|
-
tagText?: string;
|
|
26
|
-
tagBackgroundColor?: string;
|
|
27
|
-
tagColor?: string;
|
|
28
|
-
title?: string;
|
|
29
|
-
showPartnerLogoWithTitle?: boolean;
|
|
30
|
-
partnerLogoSrc?: string;
|
|
31
|
-
showPriceWithTitle?: boolean;
|
|
32
|
-
showPriceWithReadMore?: boolean;
|
|
33
|
-
price?: string;
|
|
34
|
-
perMonthText?: string;
|
|
35
|
-
customPriceTag?: ReactElement;
|
|
36
|
-
description?: string;
|
|
37
|
-
showCheckList?: boolean;
|
|
38
|
-
checkList?: CheckListProps[];
|
|
39
|
-
showAddonsList?: boolean;
|
|
40
|
-
addonsList?: AddonsListProps[];
|
|
41
|
-
fromText?: string;
|
|
42
|
-
offeredByText?: string;
|
|
43
|
-
showReadMore?: boolean;
|
|
44
|
-
readMoreText?: string;
|
|
45
|
-
readMoreAction?: () => void;
|
|
46
68
|
hyperlinkColor?: string;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
showPriceWithCTA?: boolean;
|
|
69
|
+
header?: HeaderProps;
|
|
70
|
+
headerIcon?: HeaderIconProps;
|
|
71
|
+
tag?: TagProps;
|
|
72
|
+
price?: PriceProps;
|
|
73
|
+
checklist?: ChecklistProps;
|
|
74
|
+
addons?: AddonProps;
|
|
75
|
+
readMore?: ReadMoreProps;
|
|
76
|
+
CTA?: CTAProps;
|
|
56
77
|
};
|
|
57
78
|
export {};
|
|
@@ -4,32 +4,26 @@ exports.Card = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("@chakra-ui/react");
|
|
6
6
|
const polished_1 = require("polished");
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const Card = ({ header = undefined, headerIcon = undefined, tag = undefined, price = undefined, checklist = undefined, addons = undefined, readMore = undefined, CTA = undefined, hyperlinkColor = "#006A70", }) => {
|
|
8
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
|
|
9
9
|
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, Object.assign({ direction: "column", sx: {
|
|
10
10
|
border: `${(0, polished_1.rem)(1)} solid rgba(0, 0, 0, 0.2)`,
|
|
11
11
|
padding: (0, polished_1.rem)(24),
|
|
12
12
|
'a': {
|
|
13
13
|
color: hyperlinkColor
|
|
14
14
|
}
|
|
15
|
-
}
|
|
16
|
-
(0, jsx_runtime_1.jsxs)(react_1.Flex, Object.assign({ direction: "row" }, { children: [(0, jsx_runtime_1.jsx)(react_1.Text, Object.assign({ fontSize: (0, polished_1.rem)(14), lineHeight: (0, polished_1.rem)(24), fontWeight: 400, display: "inline", mr: (0, polished_1.rem)(4) }, { children: offeredByText })), (0, jsx_runtime_1.jsx)(react_1.Image, { src: partnerLogoSrc, w: (0, polished_1.rem)(55), h: (0, polished_1.rem)(18), alt: "partner-logo", objectFit: "contain" })] }))] }))), description && (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: (0, polished_1.rem)(16), lineHeight: (0, polished_1.rem)(24), mb: (0, polished_1.rem)(
|
|
17
|
-
__html: description
|
|
18
|
-
} }),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} }), (0, jsx_runtime_1.jsx)(react_1.Text, { dangerouslySetInnerHTML: {
|
|
28
|
-
__html: list.addonPrice
|
|
29
|
-
} })] }))] }), list.id));
|
|
30
|
-
}) })), (showReadMore || showPriceWithReadMore) && ((0, jsx_runtime_1.jsxs)(react_1.Flex, Object.assign({ justifyContent: "space-between", w: !showReadMore && showPriceWithReadMore ? "100%" : undefined, mt: (0, polished_1.rem)(14) }, { children: [showReadMore && (0, jsx_runtime_1.jsx)(react_1.Link, Object.assign({ fontSize: (0, polished_1.rem)(16), lineHeight: (0, polished_1.rem)(24), fontWeight: 500, "data-testid": "read-more", onClick: readMoreAction }, { children: readMoreText })), showPriceWithReadMore && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: customPriceTag !== null && customPriceTag !== void 0 ? customPriceTag : (price && perMonthText && (0, jsx_runtime_1.jsxs)(react_1.Text, Object.assign({ fontSize: (0, polished_1.rem)(14), lineHeight: (0, polished_1.rem)(24), fontWeight: 400, textAlign: "right", width: "inherit" }, { children: [fromText, " ", (0, jsx_runtime_1.jsx)("b", Object.assign({ style: { fontSize: (0, polished_1.rem)(16), fontWeight: 500 } }, { children: price })), " ", perMonthText] }))) })] }))), (showCTA) && ((0, jsx_runtime_1.jsxs)(react_1.Flex, Object.assign({ mt: (0, polished_1.rem)(22), direction: "row", gap: 2, alignItems: "center", w: showPriceWithCTA ? "100%" : undefined }, { children: [showPrimaryCTA &&
|
|
31
|
-
(0, jsx_runtime_1.jsx)(react_1.Flex, { children: (0, jsx_runtime_1.jsx)(react_1.Button, Object.assign({ "data-testid": "primary-action", onClick: primaryCTA === null || primaryCTA === void 0 ? void 0 : primaryCTA.onClick, isDisabled: primaryCTA === null || primaryCTA === void 0 ? void 0 : primaryCTA.isDisabled, isLoading: primaryCTA === null || primaryCTA === void 0 ? void 0 : primaryCTA.isLoading, rightIcon: ((primaryCTA === null || primaryCTA === void 0 ? void 0 : primaryCTA.iconPosition) === "right" && (primaryCTA === null || primaryCTA === void 0 ? void 0 : primaryCTA.icon)) ? (0, jsx_runtime_1.jsx)(react_1.Icon, { as: primaryCTA === null || primaryCTA === void 0 ? void 0 : primaryCTA.icon }) : undefined, leftIcon: ((primaryCTA === null || primaryCTA === void 0 ? void 0 : primaryCTA.iconPosition) === "left" && (primaryCTA === null || primaryCTA === void 0 ? void 0 : primaryCTA.icon)) ? (0, jsx_runtime_1.jsx)(react_1.Icon, { as: primaryCTA === null || primaryCTA === void 0 ? void 0 : primaryCTA.icon }) : undefined, variant: primaryCTA === null || primaryCTA === void 0 ? void 0 : primaryCTA.variant, borderRadius: (0, polished_1.rem)(56), fontFamily: fontFamily, fontSize: (0, polished_1.rem)(14), fontWeight: 500, lineHeight: (0, polished_1.rem)(20) }, { children: primaryCTA === null || primaryCTA === void 0 ? void 0 : primaryCTA.text })) }), showSecondaryCTA &&
|
|
32
|
-
(0, jsx_runtime_1.jsx)(react_1.Flex, { children: (0, jsx_runtime_1.jsx)(react_1.Button, Object.assign({ "data-testid": "secondary-action", onClick: secondaryCTA === null || secondaryCTA === void 0 ? void 0 : secondaryCTA.onClick, isDisabled: secondaryCTA === null || secondaryCTA === void 0 ? void 0 : secondaryCTA.isDisabled, isLoading: secondaryCTA === null || secondaryCTA === void 0 ? void 0 : secondaryCTA.isLoading, rightIcon: ((secondaryCTA === null || secondaryCTA === void 0 ? void 0 : secondaryCTA.iconPosition) === "right" && (secondaryCTA === null || secondaryCTA === void 0 ? void 0 : secondaryCTA.icon)) ? (0, jsx_runtime_1.jsx)(react_1.Icon, { as: secondaryCTA === null || secondaryCTA === void 0 ? void 0 : secondaryCTA.icon }) : undefined, leftIcon: ((secondaryCTA === null || secondaryCTA === void 0 ? void 0 : secondaryCTA.iconPosition) === "left" && (secondaryCTA === null || secondaryCTA === void 0 ? void 0 : secondaryCTA.icon)) ? (0, jsx_runtime_1.jsx)(react_1.Icon, { as: secondaryCTA === null || secondaryCTA === void 0 ? void 0 : secondaryCTA.icon }) : undefined, variant: secondaryCTA === null || secondaryCTA === void 0 ? void 0 : secondaryCTA.variant, borderRadius: (0, polished_1.rem)(56), fontFamily: fontFamily, fontSize: (0, polished_1.rem)(14), fontWeight: 500, lineHeight: (0, polished_1.rem)(20) }, { children: secondaryCTA === null || secondaryCTA === void 0 ? void 0 : secondaryCTA.text })) }), showPriceWithCTA && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: customPriceTag !== null && customPriceTag !== void 0 ? customPriceTag : (price && perMonthText && (0, jsx_runtime_1.jsxs)(react_1.Text, Object.assign({ fontSize: (0, polished_1.rem)(14), lineHeight: (0, polished_1.rem)(24), fontWeight: 400, textAlign: "right", width: "inherit" }, { children: [fromText, " ", (0, jsx_runtime_1.jsx)("b", Object.assign({ style: { fontSize: (0, polished_1.rem)(16), fontWeight: 500 } }, { children: price })), " ", perMonthText] }))) })] })))] })));
|
|
15
|
+
} }, { children: [(headerIcon === null || headerIcon === void 0 ? void 0 : headerIcon.isVisible) && headerIcon.icon && (0, jsx_runtime_1.jsx)(react_1.Box, Object.assign({ mb: (0, polished_1.rem)(16) }, { children: (0, jsx_runtime_1.jsx)(react_1.Icon, { as: headerIcon.icon, w: (0, polished_1.rem)(28), height: (0, polished_1.rem)(34) }) })), (tag === null || tag === void 0 ? void 0 : tag.isVisible) && ((tag === null || tag === void 0 ? void 0 : tag.text) !== "") && (0, jsx_runtime_1.jsx)(react_1.Box, Object.assign({ mb: (0, polished_1.rem)(16) }, { children: (0, jsx_runtime_1.jsxs)(react_1.Tag, Object.assign({ size: "sm", variant: 'subtle', bg: tag === null || tag === void 0 ? void 0 : tag.backgroundColor }, { children: [(0, jsx_runtime_1.jsx)(react_1.TagLeftIcon, { boxSize: '12px', as: tag === null || tag === void 0 ? void 0 : tag.icon, color: tag.color }), (0, jsx_runtime_1.jsx)(react_1.TagLabel, Object.assign({ color: tag === null || tag === void 0 ? void 0 : tag.color, fontSize: 10, fontWeight: 500 }, { children: tag === null || tag === void 0 ? void 0 : tag.text }))] })) })), ((_a = header === null || header === void 0 ? void 0 : header.isVisible) !== null && _a !== void 0 ? _a : header === null || header === void 0 ? void 0 : header.isPriceVisible) && ((0, jsx_runtime_1.jsxs)(react_1.Flex, Object.assign({ justifyContent: "space-between", mb: (0, polished_1.rem)(8) }, { children: [(header === null || header === void 0 ? void 0 : header.isVisible) && (0, jsx_runtime_1.jsx)(react_1.Text, Object.assign({ fontSize: (0, polished_1.rem)(20), lineHeight: (0, polished_1.rem)(24), fontWeight: 500 }, { children: header === null || header === void 0 ? void 0 : header.title })), (header === null || header === void 0 ? void 0 : header.isPriceVisible) && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (_b = price === null || price === void 0 ? void 0 : price.customPriceTag) !== null && _b !== void 0 ? _b : ((price === null || price === void 0 ? void 0 : price.label) && (price === null || price === void 0 ? void 0 : price.perMonthText) && (0, jsx_runtime_1.jsxs)(react_1.Text, Object.assign({ fontSize: (0, polished_1.rem)(14), lineHeight: (0, polished_1.rem)(24), fontWeight: 400 }, { children: [price.fromText, " ", (0, jsx_runtime_1.jsx)("b", Object.assign({ style: { fontSize: (0, polished_1.rem)(16), fontWeight: 500 } }, { children: price === null || price === void 0 ? void 0 : price.label })), " ", price === null || price === void 0 ? void 0 : price.perMonthText] }))) }), (header === null || header === void 0 ? void 0 : header.isPartnerLogoVisible) &&
|
|
16
|
+
(0, jsx_runtime_1.jsxs)(react_1.Flex, Object.assign({ direction: "row" }, { children: [(0, jsx_runtime_1.jsx)(react_1.Text, Object.assign({ fontSize: (0, polished_1.rem)(14), lineHeight: (0, polished_1.rem)(24), fontWeight: 400, display: "inline", mr: (0, polished_1.rem)(4) }, { children: header === null || header === void 0 ? void 0 : header.offeredByText })), (0, jsx_runtime_1.jsx)(react_1.Image, { src: header === null || header === void 0 ? void 0 : header.partnerLogoSrc, w: (0, polished_1.rem)(55), h: (0, polished_1.rem)(18), alt: "partner-logo", objectFit: "contain" })] }))] }))), (header === null || header === void 0 ? void 0 : header.description) && (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: (0, polished_1.rem)(16), lineHeight: (0, polished_1.rem)(24), mb: (0, polished_1.rem)((checklist === null || checklist === void 0 ? void 0 : checklist.isVisible) ? 8 : 0), dangerouslySetInnerHTML: {
|
|
17
|
+
__html: header === null || header === void 0 ? void 0 : header.description
|
|
18
|
+
} }), (checklist === null || checklist === void 0 ? void 0 : checklist.isVisible) && Boolean((_c = checklist === null || checklist === void 0 ? void 0 : checklist.data) === null || _c === void 0 ? void 0 : _c.length) && (0, jsx_runtime_1.jsx)(react_1.Flex, Object.assign({ direction: "column" }, { children: (_d = checklist === null || checklist === void 0 ? void 0 : checklist.data) === null || _d === void 0 ? void 0 : _d.map((list, index) => ((0, jsx_runtime_1.jsxs)(react_1.Flex, Object.assign({ mt: (0, polished_1.rem)((index === 0) ? 18 : 12), direction: "row", fontSize: (0, polished_1.rem)(14), fontWeight: 400, lineHeight: (0, polished_1.rem)(20) }, { children: [(0, jsx_runtime_1.jsx)(react_1.Box, Object.assign({ mr: (0, polished_1.rem)(8) }, { children: (0, jsx_runtime_1.jsx)(react_1.Icon, { as: list.icon, w: (0, polished_1.rem)(14), height: (0, polished_1.rem)(10) }) })), (0, jsx_runtime_1.jsx)(react_1.Text, { dangerouslySetInnerHTML: {
|
|
19
|
+
__html: list.label
|
|
20
|
+
} })] }), list.id))) })), ((checklist === null || checklist === void 0 ? void 0 : checklist.isVisible) && (addons === null || addons === void 0 ? void 0 : addons.isVisible)) && ((0, jsx_runtime_1.jsx)(react_1.Divider, { mt: (0, polished_1.rem)(18), mb: (0, polished_1.rem)(16) })), (addons === null || addons === void 0 ? void 0 : addons.isVisible) && Boolean((_e = addons === null || addons === void 0 ? void 0 : addons.data) === null || _e === void 0 ? void 0 : _e.length) && (0, jsx_runtime_1.jsx)(react_1.Flex, Object.assign({ direction: "column" }, { children: (_f = addons === null || addons === void 0 ? void 0 : addons.data) === null || _f === void 0 ? void 0 : _f.map((list, index) => ((0, jsx_runtime_1.jsxs)(react_1.Flex, Object.assign({ mt: (0, polished_1.rem)(((checklist === null || checklist === void 0 ? void 0 : checklist.isVisible) && (addons === null || addons === void 0 ? void 0 : addons.isVisible) && index === 0) ? 0 : (index === 0) ? 18 : 12), direction: "row", width: "100%", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(react_1.Box, Object.assign({ mr: (0, polished_1.rem)(8) }, { children: (0, jsx_runtime_1.jsx)(react_1.Icon, { as: list.icon, w: (0, polished_1.rem)(14), height: (0, polished_1.rem)(10) }) })), (0, jsx_runtime_1.jsxs)(react_1.Flex, Object.assign({ justifyContent: "space-between", direction: "row", width: "inherit", fontSize: (0, polished_1.rem)(14), fontWeight: 400, lineHeight: (0, polished_1.rem)(20) }, { children: [(0, jsx_runtime_1.jsx)(react_1.Text, { dangerouslySetInnerHTML: {
|
|
21
|
+
__html: list.text
|
|
22
|
+
} }), (0, jsx_runtime_1.jsx)(react_1.Text, { dangerouslySetInnerHTML: {
|
|
23
|
+
__html: list.price
|
|
24
|
+
} })] }))] }), list.id))) })), ((_g = readMore === null || readMore === void 0 ? void 0 : readMore.isVisible) !== null && _g !== void 0 ? _g : readMore === null || readMore === void 0 ? void 0 : readMore.isPriceVisible) && ((0, jsx_runtime_1.jsxs)(react_1.Flex, Object.assign({ justifyContent: "space-between", w: !(readMore === null || readMore === void 0 ? void 0 : readMore.isVisible) && (readMore === null || readMore === void 0 ? void 0 : readMore.isPriceVisible) ? "100%" : undefined, mt: (0, polished_1.rem)(14) }, { children: [(readMore === null || readMore === void 0 ? void 0 : readMore.isVisible) && (0, jsx_runtime_1.jsx)(react_1.Link, Object.assign({ fontSize: (0, polished_1.rem)(16), lineHeight: (0, polished_1.rem)(24), fontWeight: 500, "data-testid": "read-more", onClick: readMore === null || readMore === void 0 ? void 0 : readMore.action }, { children: readMore === null || readMore === void 0 ? void 0 : readMore.text })), (readMore === null || readMore === void 0 ? void 0 : readMore.isPriceVisible) && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (_h = price === null || price === void 0 ? void 0 : price.customPriceTag) !== null && _h !== void 0 ? _h : ((price === null || price === void 0 ? void 0 : price.label) && (price === null || price === void 0 ? void 0 : price.perMonthText) && (0, jsx_runtime_1.jsxs)(react_1.Text, Object.assign({ fontSize: (0, polished_1.rem)(14), lineHeight: (0, polished_1.rem)(24), fontWeight: 400, textAlign: "right", width: "inherit" }, { children: [price === null || price === void 0 ? void 0 : price.fromText, " ", (0, jsx_runtime_1.jsx)("b", Object.assign({ style: { fontSize: (0, polished_1.rem)(16), fontWeight: 500 } }, { children: price.label })), " ", price === null || price === void 0 ? void 0 : price.perMonthText] }))) })] }))), (CTA === null || CTA === void 0 ? void 0 : CTA.isVisible) && ((0, jsx_runtime_1.jsxs)(react_1.Flex, Object.assign({ mt: (0, polished_1.rem)(22), direction: "row", gap: 2, alignItems: "center", w: CTA.isPriceVisible ? "100%" : undefined }, { children: [((_j = CTA.primary) === null || _j === void 0 ? void 0 : _j.isVisible) &&
|
|
25
|
+
(0, jsx_runtime_1.jsx)(react_1.Flex, { children: (0, jsx_runtime_1.jsx)(react_1.Button, Object.assign({ "data-testid": "primary-action", onClick: (_k = CTA.primary) === null || _k === void 0 ? void 0 : _k.onClick, isDisabled: (_l = CTA.primary) === null || _l === void 0 ? void 0 : _l.isDisabled, isLoading: (_m = CTA.primary) === null || _m === void 0 ? void 0 : _m.isLoading, rightIcon: (((_o = CTA.primary) === null || _o === void 0 ? void 0 : _o.iconPosition) === "right" && ((_p = CTA.primary) === null || _p === void 0 ? void 0 : _p.icon)) ? (0, jsx_runtime_1.jsx)(react_1.Icon, { as: (_q = CTA.primary) === null || _q === void 0 ? void 0 : _q.icon }) : undefined, leftIcon: (((_r = CTA.primary) === null || _r === void 0 ? void 0 : _r.iconPosition) === "left" && ((_s = CTA.primary) === null || _s === void 0 ? void 0 : _s.icon)) ? (0, jsx_runtime_1.jsx)(react_1.Icon, { as: (_t = CTA.primary) === null || _t === void 0 ? void 0 : _t.icon }) : undefined, variant: (_u = CTA.primary) === null || _u === void 0 ? void 0 : _u.variant, borderRadius: (0, polished_1.rem)(56), fontSize: (0, polished_1.rem)(14), fontWeight: 500, lineHeight: (0, polished_1.rem)(20) }, { children: (_v = CTA.primary) === null || _v === void 0 ? void 0 : _v.text })) }), ((_w = CTA === null || CTA === void 0 ? void 0 : CTA.secondary) === null || _w === void 0 ? void 0 : _w.isVisible) &&
|
|
26
|
+
(0, jsx_runtime_1.jsx)(react_1.Flex, { children: (0, jsx_runtime_1.jsx)(react_1.Button, Object.assign({ "data-testid": "secondary-action", onClick: (_x = CTA === null || CTA === void 0 ? void 0 : CTA.secondary) === null || _x === void 0 ? void 0 : _x.onClick, isDisabled: (_y = CTA === null || CTA === void 0 ? void 0 : CTA.secondary) === null || _y === void 0 ? void 0 : _y.isDisabled, isLoading: (_z = CTA === null || CTA === void 0 ? void 0 : CTA.secondary) === null || _z === void 0 ? void 0 : _z.isLoading, rightIcon: (((_0 = CTA === null || CTA === void 0 ? void 0 : CTA.secondary) === null || _0 === void 0 ? void 0 : _0.iconPosition) === "right" && ((_1 = CTA === null || CTA === void 0 ? void 0 : CTA.secondary) === null || _1 === void 0 ? void 0 : _1.icon)) ? (0, jsx_runtime_1.jsx)(react_1.Icon, { as: (_2 = CTA === null || CTA === void 0 ? void 0 : CTA.secondary) === null || _2 === void 0 ? void 0 : _2.icon }) : undefined, leftIcon: (((_3 = CTA === null || CTA === void 0 ? void 0 : CTA.secondary) === null || _3 === void 0 ? void 0 : _3.iconPosition) === "left" && ((_4 = CTA === null || CTA === void 0 ? void 0 : CTA.secondary) === null || _4 === void 0 ? void 0 : _4.icon)) ? (0, jsx_runtime_1.jsx)(react_1.Icon, { as: (_5 = CTA === null || CTA === void 0 ? void 0 : CTA.secondary) === null || _5 === void 0 ? void 0 : _5.icon }) : undefined, variant: (_6 = CTA === null || CTA === void 0 ? void 0 : CTA.secondary) === null || _6 === void 0 ? void 0 : _6.variant, borderRadius: (0, polished_1.rem)(56), fontSize: (0, polished_1.rem)(14), fontWeight: 500, lineHeight: (0, polished_1.rem)(20) }, { children: (_7 = CTA === null || CTA === void 0 ? void 0 : CTA.secondary) === null || _7 === void 0 ? void 0 : _7.text })) }), (CTA === null || CTA === void 0 ? void 0 : CTA.isVisible) && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (_8 = price === null || price === void 0 ? void 0 : price.customPriceTag) !== null && _8 !== void 0 ? _8 : ((price === null || price === void 0 ? void 0 : price.label) && (price === null || price === void 0 ? void 0 : price.perMonthText) && (0, jsx_runtime_1.jsxs)(react_1.Text, Object.assign({ fontSize: (0, polished_1.rem)(14), lineHeight: (0, polished_1.rem)(24), fontWeight: 400, textAlign: "right", width: "inherit" }, { children: [price === null || price === void 0 ? void 0 : price.fromText, " ", (0, jsx_runtime_1.jsx)("b", Object.assign({ style: { fontSize: (0, polished_1.rem)(16), fontWeight: 500 } }, { children: price.label })), " ", price === null || price === void 0 ? void 0 : price.perMonthText] }))) })] })))] })));
|
|
33
27
|
};
|
|
34
28
|
exports.Card = Card;
|
|
35
29
|
//# sourceMappingURL=Card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../../../src/alicia/common/Card/Card.tsx"],"names":[],"mappings":";;;;AAAA,4CAA4J;AAC5J,uCAA+B;
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../../../src/alicia/common/Card/Card.tsx"],"names":[],"mappings":";;;;AAAA,4CAA4J;AAC5J,uCAA+B;AAGxB,MAAM,IAAI,GAAkB,CAAC,EAChC,MAAM,GAAG,SAAS,EAClB,UAAU,GAAG,SAAS,EACtB,GAAG,GAAG,SAAS,EACf,KAAK,GAAG,SAAS,EACjB,SAAS,GAAG,SAAS,EACrB,MAAM,GAAG,SAAS,EAClB,QAAQ,GAAG,SAAS,EACpB,GAAG,GAAG,SAAS,EACf,cAAc,GAAG,SAAS,GAC7B,EAAE,EAAE;;IAED,OAAO,CACH,wBAAC,YAAI,kBACD,SAAS,EAAC,QAAQ,EAClB,EAAE,EAAE;YACA,MAAM,EAAE,GAAG,IAAA,cAAG,EAAC,CAAC,CAAC,2BAA2B;YAC5C,OAAO,EAAE,IAAA,cAAG,EAAC,EAAE,CAAC;YAChB,GAAG,EAA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C,gBAClB,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,SAAS,0CAAE,IAAI,IAChB,GACN,EAEV,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,SAAS,KAAI,2DACd,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,cAAc,mCAAI,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,MAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,YAAY,CAAA,IAAI,wBAAC,YAAI,kBACnE,QAAQ,EAAE,IAAA,cAAG,EAAC,EAAE,CAAC,EACjB,UAAU,EAAE,IAAA,cAAG,EAAC,EAAE,CAAC,EACnB,UAAU,EAAE,GAAG,EACf,SAAS,EAAC,OAAO,EACjB,KAAK,EAAC,SAAS,iBACjB,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,OAAE,4CAAG,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAA,cAAG,EAAC,EAAE,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,gBAAG,KAAK,CAAC,KAAK,IAAK,OAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,YAAY,KAAQ,CAAC,GACrH,KACA,CACV,KACE,CACV,CAAA;AACL,CAAC,CAAA;AAnKY,QAAA,IAAI,QAmKhB"}
|
|
@@ -16,26 +16,39 @@ describe("Rating testing with testing-library", () => {
|
|
|
16
16
|
expect(component).toBeTruthy();
|
|
17
17
|
});
|
|
18
18
|
it("renders title", () => {
|
|
19
|
-
const { getByText } = (0, react_1.render)((0, jsx_runtime_1.jsx)(index_1.Card, { title: "Rental Car" }));
|
|
19
|
+
const { getByText } = (0, react_1.render)((0, jsx_runtime_1.jsx)(index_1.Card, { header: { isVisible: true, title: "Rental Car" } }));
|
|
20
20
|
expect(getByText('Rental Car')).toBeInTheDocument();
|
|
21
21
|
});
|
|
22
22
|
it("renders description", () => {
|
|
23
|
-
const { getByText } = (0, react_1.render)((0, jsx_runtime_1.jsx)(index_1.Card, { title: "Rental Car", description: "This coverage insures you for the deductible you must pay in connection with loss of or damage to a rental car." }));
|
|
23
|
+
const { getByText } = (0, react_1.render)((0, jsx_runtime_1.jsx)(index_1.Card, { header: { isVisible: true, title: "Rental Car", description: "This coverage insures you for the deductible you must pay in connection with loss of or damage to a rental car." } }));
|
|
24
24
|
expect(getByText('This coverage insures you for the deductible you must pay in connection with loss of or damage to a rental car.')).toBeInTheDocument();
|
|
25
25
|
});
|
|
26
26
|
it("renders read more", () => {
|
|
27
|
-
const { getByText, getByTestId } = (0, react_1.render)((0, jsx_runtime_1.jsx)(index_1.Card, { title: "Rental Car", description: "This coverage insures you for the deductible you must pay in connection with loss of or damage to a rental car."
|
|
27
|
+
const { getByText, getByTestId } = (0, react_1.render)((0, jsx_runtime_1.jsx)(index_1.Card, { header: { isVisible: true, title: "Rental Car", description: "This coverage insures you for the deductible you must pay in connection with loss of or damage to a rental car." }, price: {
|
|
28
|
+
label: "€9.99",
|
|
29
|
+
perMonthText: "p.m.",
|
|
30
|
+
fromText: "From",
|
|
31
|
+
}, readMore: {
|
|
32
|
+
isVisible: true,
|
|
33
|
+
isPriceVisible: true,
|
|
34
|
+
text: "Read More",
|
|
35
|
+
action: onMockReadMore
|
|
36
|
+
} }));
|
|
28
37
|
expect(getByText('€9.99')).toBeInTheDocument();
|
|
29
38
|
user_event_1.default.click(getByTestId('read-more'));
|
|
30
39
|
expect(onMockReadMore).toBeCalledTimes(1);
|
|
31
40
|
});
|
|
32
41
|
it("renders read more", () => {
|
|
33
|
-
const { getByTestId, getByText } = (0, react_1.render)((0, jsx_runtime_1.jsx)(index_1.Card, { title: "Rental Car", description: "This coverage insures you for the deductible you must pay in connection with loss of or damage to a rental car."
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
const { getByTestId, getByText } = (0, react_1.render)((0, jsx_runtime_1.jsx)(index_1.Card, { header: { isVisible: true, title: "Rental Car", description: "This coverage insures you for the deductible you must pay in connection with loss of or damage to a rental car." }, CTA: {
|
|
43
|
+
isVisible: true,
|
|
44
|
+
primary: {
|
|
45
|
+
isVisible: true,
|
|
46
|
+
variant: "primary",
|
|
47
|
+
isLoading: false,
|
|
48
|
+
isDisabled: false,
|
|
49
|
+
text: "File a Claim",
|
|
50
|
+
onClick: onMockPrimaryCTA
|
|
51
|
+
}
|
|
39
52
|
} }));
|
|
40
53
|
expect(getByText('File a Claim')).toBeInTheDocument();
|
|
41
54
|
user_event_1.default.click(getByTestId('primary-action'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.spec.js","sourceRoot":"","sources":["../../../../../src/alicia/common/Card/Card.spec.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAgD;AAChD,qCAAmC;AACnC,mCAA+B;AAC/B,6EAAoD;AAEpD,MAAM,cAAc,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACjC,MAAM,gBAAgB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAEnC,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;IACjD,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAChC,MAAM,SAAS,GAAG,IAAA,cAAM,EAAC,uBAAC,YAAI,KAAG,CAAC,CAAC;QACnC,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;QACrB,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,cAAM,EAAC,uBAAC,YAAI,IAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"Card.spec.js","sourceRoot":"","sources":["../../../../../src/alicia/common/Card/Card.spec.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAgD;AAChD,qCAAmC;AACnC,mCAA+B;AAC/B,6EAAoD;AAEpD,MAAM,cAAc,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACj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