@redocly/theme 0.42.2 → 0.42.3
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.
|
@@ -17,10 +17,10 @@ function Card({ title, image, icon, iconRawContent, imagePosition = 'start', lay
|
|
|
17
17
|
const alignItems = align === 'center' ? 'center' : align === 'end' ? 'flex-end' : 'flex-start';
|
|
18
18
|
const textAlign = align === 'center' ? 'center' : align === 'end' ? 'right' : 'left';
|
|
19
19
|
iconVariant = iconVariant !== null && iconVariant !== void 0 ? iconVariant : (variant === 'ghost' ? 'filled' : 'ghost');
|
|
20
|
-
return (react_1.default.createElement(CardWrapper, { as: to ? Link_1.Link : 'div', to: to, "aria-labelledby": cardTitleId, variant: variant, layout: layout, isCardLink: !!to },
|
|
20
|
+
return (react_1.default.createElement(CardWrapper, { as: to ? Link_1.Link : 'div', to: to, "aria-labelledby": cardTitleId, "$variant": variant, "$layout": layout, "$isCardLink": !!to },
|
|
21
21
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
22
22
|
image ? react_1.default.createElement(CardImage_1.CardImage, { src: image, alt: title, position: imagePosition }) : null,
|
|
23
|
-
react_1.default.createElement(CardContentWrapper, { layout: layout, alignItems: alignItems, textAlign: textAlign, hasImage: image !== undefined },
|
|
23
|
+
react_1.default.createElement(CardContentWrapper, { "$layout": layout, "$alignItems": alignItems, "$textAlign": textAlign, "$hasImage": image !== undefined },
|
|
24
24
|
icon && react_1.default.createElement(CardIcon_1.CardIcon, { variant: iconVariant, src: icon, rawContent: iconRawContent }),
|
|
25
25
|
react_1.default.createElement(ContentWrapper, null,
|
|
26
26
|
react_1.default.createElement(Title, { id: cardTitleId, "$isCardLink": !!to, "$justifyContent": justifyContent },
|
|
@@ -31,13 +31,13 @@ function Card({ title, image, icon, iconRawContent, imagePosition = 'start', lay
|
|
|
31
31
|
exports.Card = Card;
|
|
32
32
|
const CardContentWrapper = styled_components_1.default.div `
|
|
33
33
|
display: flex;
|
|
34
|
-
flex-direction: ${({ layout }) => (layout === 'horizontal' ? 'row' : 'column')};
|
|
34
|
+
flex-direction: ${({ $layout }) => ($layout === 'horizontal' ? 'row' : 'column')};
|
|
35
35
|
gap: var(--card-icon-gap);
|
|
36
|
-
align-items: ${({ alignItems }) => alignItems};
|
|
37
|
-
text-align: ${({ textAlign }) => textAlign};
|
|
36
|
+
align-items: ${({ $alignItems }) => $alignItems};
|
|
37
|
+
text-align: ${({ $textAlign }) => $textAlign};
|
|
38
38
|
flex-grow: 1;
|
|
39
39
|
padding: var(--card-padding);
|
|
40
|
-
height: ${({ hasImage }) => (hasImage ? 'auto' : '100%')};
|
|
40
|
+
height: ${({ $hasImage }) => ($hasImage ? 'auto' : '100%')};
|
|
41
41
|
`;
|
|
42
42
|
const ContentWrapper = styled_components_1.default.div `
|
|
43
43
|
display: flex;
|
package/package.json
CHANGED
|
@@ -47,17 +47,17 @@ export function Card({
|
|
|
47
47
|
as={to ? Link : 'div'}
|
|
48
48
|
to={to}
|
|
49
49
|
aria-labelledby={cardTitleId}
|
|
50
|
-
variant={variant}
|
|
51
|
-
layout={layout}
|
|
52
|
-
isCardLink={!!to}
|
|
50
|
+
$variant={variant}
|
|
51
|
+
$layout={layout}
|
|
52
|
+
$isCardLink={!!to}
|
|
53
53
|
>
|
|
54
54
|
<>
|
|
55
55
|
{image ? <CardImage src={image} alt={title} position={imagePosition} /> : null}
|
|
56
56
|
<CardContentWrapper
|
|
57
|
-
layout={layout}
|
|
58
|
-
alignItems={alignItems}
|
|
59
|
-
textAlign={textAlign}
|
|
60
|
-
hasImage={image !== undefined}
|
|
57
|
+
$layout={layout}
|
|
58
|
+
$alignItems={alignItems}
|
|
59
|
+
$textAlign={textAlign}
|
|
60
|
+
$hasImage={image !== undefined}
|
|
61
61
|
>
|
|
62
62
|
{icon && <CardIcon variant={iconVariant} src={icon} rawContent={iconRawContent} />}
|
|
63
63
|
<ContentWrapper>
|
|
@@ -74,19 +74,19 @@ export function Card({
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
const CardContentWrapper = styled.div<{
|
|
77
|
-
layout?: string;
|
|
78
|
-
alignItems: string;
|
|
79
|
-
textAlign: string;
|
|
80
|
-
hasImage: boolean;
|
|
77
|
+
$layout?: string;
|
|
78
|
+
$alignItems: string;
|
|
79
|
+
$textAlign: string;
|
|
80
|
+
$hasImage: boolean;
|
|
81
81
|
}>`
|
|
82
82
|
display: flex;
|
|
83
|
-
flex-direction: ${({ layout }) => (layout === 'horizontal' ? 'row' : 'column')};
|
|
83
|
+
flex-direction: ${({ $layout }) => ($layout === 'horizontal' ? 'row' : 'column')};
|
|
84
84
|
gap: var(--card-icon-gap);
|
|
85
|
-
align-items: ${({ alignItems }) => alignItems};
|
|
86
|
-
text-align: ${({ textAlign }) => textAlign};
|
|
85
|
+
align-items: ${({ $alignItems }) => $alignItems};
|
|
86
|
+
text-align: ${({ $textAlign }) => $textAlign};
|
|
87
87
|
flex-grow: 1;
|
|
88
88
|
padding: var(--card-padding);
|
|
89
|
-
height: ${({ hasImage }) => (hasImage ? 'auto' : '100%')};
|
|
89
|
+
height: ${({ $hasImage }) => ($hasImage ? 'auto' : '100%')};
|
|
90
90
|
`;
|
|
91
91
|
|
|
92
92
|
const ContentWrapper = styled.div`
|