@codecademy/brand 1.33.0-alpha.e9f120b22e.0 → 1.33.0-alpha.f8bf216385.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.
|
@@ -25,29 +25,44 @@ const rowRenderEach = (items, itemRenderer) => {
|
|
|
25
25
|
}, item.title))
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
|
-
const gridRenderEach = (maxCols, items, itemRenderer) => {
|
|
28
|
+
const gridRenderEach = (maxCols, items, itemRenderer, sectionBackgroundColor) => {
|
|
29
29
|
const size = {
|
|
30
30
|
_: 12,
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
sm: 6,
|
|
32
|
+
md: 14 / maxCols,
|
|
33
|
+
lg: 14 / maxCols,
|
|
34
|
+
xl: 12 / maxCols
|
|
33
35
|
};
|
|
34
36
|
return /*#__PURE__*/_jsx(LayoutGrid, {
|
|
35
|
-
|
|
37
|
+
columnGap: {
|
|
38
|
+
_: 8,
|
|
39
|
+
sm: 24
|
|
40
|
+
},
|
|
41
|
+
rowGap: {
|
|
42
|
+
_: 8,
|
|
43
|
+
sm: 32,
|
|
44
|
+
md: 32,
|
|
45
|
+
lg: 8
|
|
46
|
+
},
|
|
36
47
|
as: "ul",
|
|
37
48
|
pl: 0,
|
|
38
49
|
children: items.map(item => /*#__PURE__*/_jsx(Column, {
|
|
39
50
|
size: size,
|
|
40
51
|
as: "li",
|
|
41
|
-
children:
|
|
52
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
53
|
+
bg: sectionBackgroundColor,
|
|
54
|
+
borderRadius: "lg",
|
|
55
|
+
children: itemRenderer(item)
|
|
56
|
+
}, item.title)
|
|
42
57
|
}, item.title))
|
|
43
58
|
});
|
|
44
59
|
};
|
|
45
|
-
const renderEach = (maxCols, items, itemRenderer) => {
|
|
60
|
+
const renderEach = (maxCols, items, itemRenderer, sectionBackgroundColor) => {
|
|
46
61
|
if (maxCols === undefined) {
|
|
47
62
|
return rowRenderEach(items, itemRenderer);
|
|
48
63
|
}
|
|
49
64
|
if (maxCols > 0 && maxCols <= 4) {
|
|
50
|
-
return gridRenderEach(maxCols, items, itemRenderer);
|
|
65
|
+
return gridRenderEach(maxCols, items, itemRenderer, sectionBackgroundColor);
|
|
51
66
|
}
|
|
52
67
|
return null;
|
|
53
68
|
};
|
|
@@ -60,50 +75,53 @@ export const PageFeaturesEnhanced = ({
|
|
|
60
75
|
features,
|
|
61
76
|
featuresMedia,
|
|
62
77
|
testId,
|
|
63
|
-
onAnchorClick
|
|
78
|
+
onAnchorClick,
|
|
79
|
+
sectionBackgroundColor
|
|
64
80
|
}) => {
|
|
65
81
|
return /*#__PURE__*/_jsxs("div", {
|
|
66
82
|
"data-testid": testId,
|
|
67
|
-
children: [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
84
|
+
children: [title && /*#__PURE__*/_jsx(FlexBox, {
|
|
85
|
+
justifyContent: "center",
|
|
86
|
+
textAlign: "center",
|
|
87
|
+
children: eyebrow ? /*#__PURE__*/_jsx(TitleWithEyebrow, {
|
|
88
|
+
title: title,
|
|
89
|
+
eyebrow: eyebrow,
|
|
90
|
+
isPageHeading: false,
|
|
91
|
+
titleStyle: {
|
|
92
|
+
fontWeight: 700,
|
|
93
|
+
fontSize: {
|
|
94
|
+
_: 44,
|
|
95
|
+
sm: 44
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
eyebrowStyle: {
|
|
99
|
+
fontWeight: 'lighter',
|
|
100
|
+
fontSize: {
|
|
101
|
+
_: 16,
|
|
102
|
+
sm: 16
|
|
103
|
+
}
|
|
86
104
|
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
})
|
|
105
|
+
}) : /*#__PURE__*/_jsx(Title, {
|
|
106
|
+
isPageHeading: false,
|
|
107
|
+
children: title
|
|
108
|
+
})
|
|
109
|
+
}), desc && /*#__PURE__*/_jsx(FlexBox, {
|
|
110
|
+
justifyContent: "center",
|
|
111
|
+
textAlign: "center",
|
|
112
|
+
children: /*#__PURE__*/_jsx(Description, {
|
|
113
|
+
text: desc,
|
|
114
|
+
onAnchorClick: onAnchorClick
|
|
115
|
+
})
|
|
116
|
+
}), cta && /*#__PURE__*/_jsx(Box, {
|
|
117
|
+
mt: 32,
|
|
118
|
+
children: /*#__PURE__*/_jsx(CTA, {
|
|
119
|
+
href: cta.href,
|
|
120
|
+
onClick: cta.onClick,
|
|
121
|
+
buttonType: cta.buttonType,
|
|
122
|
+
children: cta.text
|
|
123
|
+
})
|
|
124
|
+
})]
|
|
107
125
|
}), /*#__PURE__*/_jsx(ColorMode, {
|
|
108
126
|
mode: "dark",
|
|
109
127
|
children: /*#__PURE__*/_jsx(Box, {
|
|
@@ -117,6 +135,7 @@ export const PageFeaturesEnhanced = ({
|
|
|
117
135
|
desc
|
|
118
136
|
}) => /*#__PURE__*/_jsxs(Background, {
|
|
119
137
|
bg: "white-300",
|
|
138
|
+
height: "100%",
|
|
120
139
|
borderRadius: "lg",
|
|
121
140
|
py: 24,
|
|
122
141
|
px: 16,
|
|
@@ -149,7 +168,7 @@ export const PageFeaturesEnhanced = ({
|
|
|
149
168
|
desc: desc,
|
|
150
169
|
onAnchorClick: onAnchorClick
|
|
151
170
|
})]
|
|
152
|
-
}))
|
|
171
|
+
}), sectionBackgroundColor)
|
|
153
172
|
})
|
|
154
173
|
})]
|
|
155
174
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/brand",
|
|
3
3
|
"description": "Brand component library for Codecademy",
|
|
4
|
-
"version": "1.33.0-alpha.
|
|
4
|
+
"version": "1.33.0-alpha.f8bf216385.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@emotion/is-prop-valid": "^1.2.1",
|