@contentrain/astro-kit 0.30.0 → 0.32.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.
- package/README.md +25 -2
- package/catalog.json +3305 -83
- package/components/_shared/Section.astro +18 -3
- package/components/_shared/measured.ts +152 -0
- package/components/_shared/types.ts +40 -0
- package/components/band/Band.astro +132 -0
- package/components/band/fixtures.json +8 -0
- package/components/band/meta.json +323 -0
- package/components/card-grid/CardGrid.astro +7 -3
- package/components/card-grid/fixtures.json +2 -1
- package/components/card-grid/meta.json +111 -0
- package/components/contact-details/ContactDetails.astro +7 -2
- package/components/contact-details/meta.json +113 -1
- package/components/contact-form/ContactForm.astro +48 -12
- package/components/contact-form/fixtures.json +169 -9
- package/components/contact-form/meta.json +283 -15
- package/components/cta/Cta.astro +52 -12
- package/components/cta/fixtures.json +5 -1
- package/components/cta/meta.json +11 -2
- package/components/faq/Faq.astro +60 -17
- package/components/faq/fixtures.json +75 -0
- package/components/faq/meta.json +8 -2
- package/components/feature-list/FeatureList.astro +34 -6
- package/components/feature-list/fixtures.json +2 -1
- package/components/feature-list/meta.json +125 -1
- package/components/gallery/Gallery.astro +47 -13
- package/components/gallery/fixtures.json +275 -0
- package/components/gallery/meta.json +266 -14
- package/components/hero/Hero.astro +14 -8
- package/components/hero/fixtures.json +2 -1
- package/components/hero/meta.json +111 -0
- package/components/logo-cloud/LogoCloud.astro +85 -21
- package/components/logo-cloud/fixtures.json +239 -0
- package/components/logo-cloud/meta.json +145 -5
- package/components/newsletter/Newsletter.astro +5 -1
- package/components/newsletter/meta.json +113 -1
- package/components/post-card/PostCard.astro +4 -2
- package/components/post-card/meta.json +2 -1
- package/components/post-list/PostList.astro +114 -0
- package/components/post-list/fixtures.json +387 -0
- package/components/post-list/meta.json +308 -0
- package/components/pricing/Pricing.astro +128 -24
- package/components/pricing/fixtures.json +288 -4
- package/components/pricing/meta.json +188 -1
- package/components/split/Split.astro +76 -14
- package/components/split/fixtures.json +8 -1
- package/components/split/meta.json +226 -4
- package/components/stats/Stats.astro +42 -10
- package/components/stats/fixtures.json +173 -0
- package/components/stats/meta.json +153 -5
- package/components/steps/Steps.astro +36 -8
- package/components/steps/fixtures.json +217 -5
- package/components/steps/meta.json +157 -3
- package/components/tabs/Tabs.astro +5 -2
- package/components/tabs/meta.json +2 -1
- package/components/team/Team.astro +52 -8
- package/components/team/fixtures.json +217 -4
- package/components/team/meta.json +168 -3
- package/components/team/team.ts +9 -0
- package/components/testimonial/Testimonial.astro +71 -21
- package/components/testimonial/fixtures.json +73 -0
- package/components/testimonial/meta.json +167 -3
- package/mapping/classic.json +7 -1
- package/mapping/divi.json +21 -4
- package/mapping/elementor.json +33 -8
- package/mapping/gutenberg.json +20 -4
- package/package.json +2 -2
|
@@ -1,6 +1,290 @@
|
|
|
1
1
|
[
|
|
2
|
-
{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
{
|
|
3
|
+
"name": "three-featured",
|
|
4
|
+
"props": {
|
|
5
|
+
"id": "pricing",
|
|
6
|
+
"heading": "Pricing",
|
|
7
|
+
"intro": "Start free, upgrade when the team grows.",
|
|
8
|
+
"plans": [
|
|
9
|
+
{
|
|
10
|
+
"name": "Free",
|
|
11
|
+
"price": "$0",
|
|
12
|
+
"period": "/month",
|
|
13
|
+
"description": "For one person and one site.",
|
|
14
|
+
"features": "- 1 project\n- Git-backed content\n- Community support",
|
|
15
|
+
"ctaLabel": "Start free",
|
|
16
|
+
"ctaHref": "/signup/"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "Pro",
|
|
20
|
+
"price": "$12",
|
|
21
|
+
"period": "/month",
|
|
22
|
+
"description": "For freelancers.",
|
|
23
|
+
"features": "- 5 projects\n- Media library\n- Email support",
|
|
24
|
+
"ctaLabel": "Choose Pro",
|
|
25
|
+
"ctaHref": "/signup/?plan=pro",
|
|
26
|
+
"featured": true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "Team",
|
|
30
|
+
"price": "$29",
|
|
31
|
+
"period": "/month",
|
|
32
|
+
"description": "For studios and teams.",
|
|
33
|
+
"features": "- Unlimited projects\n- Reviews and roles\n- Priority support",
|
|
34
|
+
"ctaLabel": "Choose Team",
|
|
35
|
+
"ctaHref": "/signup/?plan=team"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "two-muted",
|
|
42
|
+
"props": {
|
|
43
|
+
"columns": "2",
|
|
44
|
+
"tone": "muted",
|
|
45
|
+
"featuredLabel": "Best value",
|
|
46
|
+
"plans": [
|
|
47
|
+
{
|
|
48
|
+
"name": "Monthly",
|
|
49
|
+
"price": "€15",
|
|
50
|
+
"period": "per month",
|
|
51
|
+
"features": "- Cancel anytime",
|
|
52
|
+
"ctaLabel": "Subscribe",
|
|
53
|
+
"ctaHref": "/buy/monthly/"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "Yearly",
|
|
57
|
+
"price": "€150",
|
|
58
|
+
"period": "per year",
|
|
59
|
+
"features": "- Two months free\n- **Priority** support",
|
|
60
|
+
"ctaLabel": "Subscribe",
|
|
61
|
+
"ctaHref": "/buy/yearly/",
|
|
62
|
+
"featured": true
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "four-inverse",
|
|
69
|
+
"props": {
|
|
70
|
+
"columns": "4",
|
|
71
|
+
"tone": "inverse",
|
|
72
|
+
"heading": "Plans",
|
|
73
|
+
"plans": [
|
|
74
|
+
{
|
|
75
|
+
"name": "Solo",
|
|
76
|
+
"price": "$0",
|
|
77
|
+
"features": "- 1 site"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "Pro",
|
|
81
|
+
"price": "$12",
|
|
82
|
+
"period": "/mo",
|
|
83
|
+
"features": "- 5 sites",
|
|
84
|
+
"featured": true,
|
|
85
|
+
"ctaLabel": "Buy",
|
|
86
|
+
"ctaHref": "/buy/"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "Team",
|
|
90
|
+
"price": "$29",
|
|
91
|
+
"period": "/mo",
|
|
92
|
+
"features": "- 20 sites"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "Enterprise",
|
|
96
|
+
"price": "On request",
|
|
97
|
+
"description": "Custom terms.",
|
|
98
|
+
"ctaLabel": "Contact us",
|
|
99
|
+
"ctaHref": "/contact/"
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "accent",
|
|
106
|
+
"props": {
|
|
107
|
+
"tone": "accent",
|
|
108
|
+
"heading": "One price",
|
|
109
|
+
"plans": [
|
|
110
|
+
{
|
|
111
|
+
"name": "Studio",
|
|
112
|
+
"price": "$49",
|
|
113
|
+
"period": "once",
|
|
114
|
+
"features": "- Everything",
|
|
115
|
+
"ctaLabel": "Buy now",
|
|
116
|
+
"ctaHref": "/buy/",
|
|
117
|
+
"featured": true
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "Support",
|
|
121
|
+
"price": "$9",
|
|
122
|
+
"period": "/month",
|
|
123
|
+
"features": "- Updates and help",
|
|
124
|
+
"ctaLabel": "Add support",
|
|
125
|
+
"ctaHref": "/buy/support/"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "table",
|
|
132
|
+
"props": {
|
|
133
|
+
"id": "compare",
|
|
134
|
+
"heading": "Compare plans",
|
|
135
|
+
"layout": "table",
|
|
136
|
+
"plans": [
|
|
137
|
+
{
|
|
138
|
+
"name": "Free",
|
|
139
|
+
"price": "$0",
|
|
140
|
+
"features": "- 1 project\n- Community support",
|
|
141
|
+
"ctaLabel": "Start",
|
|
142
|
+
"ctaHref": "/signup/"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "Pro",
|
|
146
|
+
"price": "$12",
|
|
147
|
+
"period": "/month",
|
|
148
|
+
"features": "- 1 project\n- 5 projects\n- Media library\n- Email support",
|
|
149
|
+
"ctaLabel": "Choose",
|
|
150
|
+
"ctaHref": "/signup/?plan=pro",
|
|
151
|
+
"featured": true
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "Team",
|
|
155
|
+
"price": "$29",
|
|
156
|
+
"period": "/month",
|
|
157
|
+
"features": "- 1 project\n- 5 projects\n- Media library\n- Email support\n- Roles and reviews\n- Priority support\n- Audit log\n- SSO",
|
|
158
|
+
"ctaLabel": "Choose",
|
|
159
|
+
"ctaHref": "/signup/?plan=team"
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "check-compact",
|
|
166
|
+
"props": {
|
|
167
|
+
"featureStyle": "check",
|
|
168
|
+
"compact": true,
|
|
169
|
+
"plans": [
|
|
170
|
+
{
|
|
171
|
+
"name": "Free",
|
|
172
|
+
"price": "$0",
|
|
173
|
+
"period": "/month",
|
|
174
|
+
"description": "For one person and one site.",
|
|
175
|
+
"features": "- 1 project\n- Git-backed content\n- Community support",
|
|
176
|
+
"ctaLabel": "Start free",
|
|
177
|
+
"ctaHref": "/signup/"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "Pro",
|
|
181
|
+
"price": "$12",
|
|
182
|
+
"period": "/month",
|
|
183
|
+
"description": "For freelancers.",
|
|
184
|
+
"features": "- 5 projects\n- Media library\n- Email support",
|
|
185
|
+
"ctaLabel": "Choose Pro",
|
|
186
|
+
"ctaHref": "/signup/?plan=pro",
|
|
187
|
+
"featured": true
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "Team",
|
|
191
|
+
"price": "$29",
|
|
192
|
+
"period": "/month",
|
|
193
|
+
"description": "For studios and teams.",
|
|
194
|
+
"features": "- Unlimited projects\n- Reviews and roles\n- Priority support",
|
|
195
|
+
"ctaLabel": "Choose Team",
|
|
196
|
+
"ctaHref": "/signup/?plan=team"
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"name": "dot-features",
|
|
203
|
+
"props": {
|
|
204
|
+
"featureStyle": "dot",
|
|
205
|
+
"plans": [
|
|
206
|
+
{
|
|
207
|
+
"name": "Free",
|
|
208
|
+
"price": "$0",
|
|
209
|
+
"period": "/month",
|
|
210
|
+
"description": "For one person and one site.",
|
|
211
|
+
"features": "- 1 project\n- Git-backed content\n- Community support",
|
|
212
|
+
"ctaLabel": "Start free",
|
|
213
|
+
"ctaHref": "/signup/"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"name": "Pro",
|
|
217
|
+
"price": "$12",
|
|
218
|
+
"period": "/month",
|
|
219
|
+
"description": "For freelancers.",
|
|
220
|
+
"features": "- 5 projects\n- Media library\n- Email support",
|
|
221
|
+
"ctaLabel": "Choose Pro",
|
|
222
|
+
"ctaHref": "/signup/?plan=pro",
|
|
223
|
+
"featured": true
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"name": "Team",
|
|
227
|
+
"price": "$29",
|
|
228
|
+
"period": "/month",
|
|
229
|
+
"description": "For studios and teams.",
|
|
230
|
+
"features": "- Unlimited projects\n- Reviews and roles\n- Priority support",
|
|
231
|
+
"ctaLabel": "Choose Team",
|
|
232
|
+
"ctaHref": "/signup/?plan=team"
|
|
233
|
+
}
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"name": "billing-toggle",
|
|
239
|
+
"props": {
|
|
240
|
+
"id": "billing",
|
|
241
|
+
"heading": "Billing",
|
|
242
|
+
"billingToggle": "radio",
|
|
243
|
+
"columns": "2",
|
|
244
|
+
"plans": [
|
|
245
|
+
{
|
|
246
|
+
"name": "Basic",
|
|
247
|
+
"price": "€15",
|
|
248
|
+
"period": "/month",
|
|
249
|
+
"priceAlt": "€150",
|
|
250
|
+
"periodAlt": "/year",
|
|
251
|
+
"features": "- 1 site",
|
|
252
|
+
"ctaLabel": "Subscribe",
|
|
253
|
+
"ctaHref": "/buy/basic/"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"name": "Plus",
|
|
257
|
+
"price": "€29",
|
|
258
|
+
"period": "/month",
|
|
259
|
+
"priceAlt": "€290",
|
|
260
|
+
"periodAlt": "/year",
|
|
261
|
+
"features": "- 5 sites\n- Priority support",
|
|
262
|
+
"ctaLabel": "Subscribe",
|
|
263
|
+
"ctaHref": "/buy/plus/",
|
|
264
|
+
"badge": "Best value"
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
"billingMainLabel": "Monthly",
|
|
268
|
+
"billingAltLabel": "Yearly",
|
|
269
|
+
"billingLegend": "Billing period"
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"name": "missing-period-description",
|
|
274
|
+
"props": {
|
|
275
|
+
"plans": [
|
|
276
|
+
{
|
|
277
|
+
"name": "Custom",
|
|
278
|
+
"price": "On request",
|
|
279
|
+
"ctaLabel": "Talk to us",
|
|
280
|
+
"ctaHref": "/contact/"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"name": "Open",
|
|
284
|
+
"price": "Free",
|
|
285
|
+
"features": "- Everything"
|
|
286
|
+
}
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
}
|
|
6
290
|
]
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"shared": [
|
|
8
8
|
"Button.astro",
|
|
9
9
|
"Section.astro",
|
|
10
|
+
"measured.ts",
|
|
10
11
|
"types.ts"
|
|
11
12
|
],
|
|
12
13
|
"variants": {
|
|
@@ -28,6 +29,31 @@
|
|
|
28
29
|
],
|
|
29
30
|
"default": "default",
|
|
30
31
|
"description": "Section background."
|
|
32
|
+
},
|
|
33
|
+
"layout": {
|
|
34
|
+
"options": [
|
|
35
|
+
"cards",
|
|
36
|
+
"table"
|
|
37
|
+
],
|
|
38
|
+
"default": "cards",
|
|
39
|
+
"description": "cards: plans side by side. table: one comparison table, plans as columns and features as rows (for more than four plans)."
|
|
40
|
+
},
|
|
41
|
+
"featureStyle": {
|
|
42
|
+
"options": [
|
|
43
|
+
"check",
|
|
44
|
+
"dot",
|
|
45
|
+
"plain"
|
|
46
|
+
],
|
|
47
|
+
"default": "plain",
|
|
48
|
+
"description": "The mark before each feature in the cards: a check, a dot, or the list's own bullets."
|
|
49
|
+
},
|
|
50
|
+
"billingToggle": {
|
|
51
|
+
"options": [
|
|
52
|
+
"none",
|
|
53
|
+
"radio"
|
|
54
|
+
],
|
|
55
|
+
"default": "none",
|
|
56
|
+
"description": "radio: two labelled radios swap each plan's price for its priceAlt (monthly / yearly), with no script. The radio group is named from the section id, or a hash of the plans without one, so two toggles on a page stay independent."
|
|
31
57
|
}
|
|
32
58
|
},
|
|
33
59
|
"props": {
|
|
@@ -89,6 +115,21 @@
|
|
|
89
115
|
"type": "boolean",
|
|
90
116
|
"label": "Featured",
|
|
91
117
|
"description": "Raises the plan and gives it the badge."
|
|
118
|
+
},
|
|
119
|
+
"badge": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"label": "Badge",
|
|
122
|
+
"description": "A badge text on the plan (\"Best value\"); a featured plan without one reads the section's featuredLabel."
|
|
123
|
+
},
|
|
124
|
+
"priceAlt": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"label": "Price, other period",
|
|
127
|
+
"description": "The price for the other billing period (\"€150\"), shown when the toggle is on its second option."
|
|
128
|
+
},
|
|
129
|
+
"periodAlt": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"label": "Period, other period",
|
|
132
|
+
"description": "What the other price is per (\"/year\")."
|
|
92
133
|
}
|
|
93
134
|
}
|
|
94
135
|
},
|
|
@@ -104,6 +145,152 @@
|
|
|
104
145
|
"type": "string",
|
|
105
146
|
"content": false,
|
|
106
147
|
"description": "Anchor id of the section; the heading gets `<id>-title`."
|
|
148
|
+
},
|
|
149
|
+
"compact": {
|
|
150
|
+
"type": "boolean",
|
|
151
|
+
"default": false,
|
|
152
|
+
"content": false,
|
|
153
|
+
"description": "A denser card: smaller padding, gap and price."
|
|
154
|
+
},
|
|
155
|
+
"includedLabel": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"default": "Included",
|
|
158
|
+
"content": false,
|
|
159
|
+
"description": "Table cell text for readers where a plan has the feature."
|
|
160
|
+
},
|
|
161
|
+
"notIncludedLabel": {
|
|
162
|
+
"type": "string",
|
|
163
|
+
"default": "Not included",
|
|
164
|
+
"content": false,
|
|
165
|
+
"description": "Table cell text for readers where a plan lacks the feature."
|
|
166
|
+
},
|
|
167
|
+
"measured": {
|
|
168
|
+
"type": "object",
|
|
169
|
+
"content": false,
|
|
170
|
+
"description": "The source section's measured style (MeasuredStyle): frame width, padding, fill, image, columns per width, gap, text tone, radius, minimum height — all in pixels. Absent, the site's tokens; present, it wins over tone and columns. Values that are not a number, a colour or a known keyword are dropped.",
|
|
171
|
+
"fields": {
|
|
172
|
+
"containerPx": {
|
|
173
|
+
"type": "integer",
|
|
174
|
+
"min": 0,
|
|
175
|
+
"max": 2560,
|
|
176
|
+
"description": "The frame's content width."
|
|
177
|
+
},
|
|
178
|
+
"padY": {
|
|
179
|
+
"type": "integer",
|
|
180
|
+
"min": 0,
|
|
181
|
+
"max": 400,
|
|
182
|
+
"description": "Top and bottom padding."
|
|
183
|
+
},
|
|
184
|
+
"padX": {
|
|
185
|
+
"type": "integer",
|
|
186
|
+
"min": 0,
|
|
187
|
+
"max": 200,
|
|
188
|
+
"description": "The frame's side padding (gutter)."
|
|
189
|
+
},
|
|
190
|
+
"bg": {
|
|
191
|
+
"type": "object",
|
|
192
|
+
"description": "The section's background.",
|
|
193
|
+
"fields": {
|
|
194
|
+
"color": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"description": "Fill colour: hex, rgb(a) or hsl(a)."
|
|
197
|
+
},
|
|
198
|
+
"image": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"description": "Background image address (http(s) or root-relative), drawn behind the content."
|
|
201
|
+
},
|
|
202
|
+
"overlay": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"description": "Colour or linear/radial gradient laid over the image or the fill."
|
|
205
|
+
},
|
|
206
|
+
"size": {
|
|
207
|
+
"type": "string",
|
|
208
|
+
"description": "cover, contain or auto; anything else draws as cover."
|
|
209
|
+
},
|
|
210
|
+
"position": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"description": "One or two of center/top/bottom/left/right or percentages."
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"columns": {
|
|
217
|
+
"type": "object",
|
|
218
|
+
"description": "Item columns at 390 (base), 768 (md) and 1280 (lg) px; a missing width follows the narrower one.",
|
|
219
|
+
"fields": {
|
|
220
|
+
"390": {
|
|
221
|
+
"type": "integer",
|
|
222
|
+
"min": 1,
|
|
223
|
+
"max": 6,
|
|
224
|
+
"description": "Phone."
|
|
225
|
+
},
|
|
226
|
+
"768": {
|
|
227
|
+
"type": "integer",
|
|
228
|
+
"min": 1,
|
|
229
|
+
"max": 6,
|
|
230
|
+
"description": "Tablet."
|
|
231
|
+
},
|
|
232
|
+
"1280": {
|
|
233
|
+
"type": "integer",
|
|
234
|
+
"min": 1,
|
|
235
|
+
"max": 6,
|
|
236
|
+
"description": "Desktop."
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"gap": {
|
|
241
|
+
"type": "integer",
|
|
242
|
+
"min": 0,
|
|
243
|
+
"max": 200,
|
|
244
|
+
"description": "Gap between items."
|
|
245
|
+
},
|
|
246
|
+
"tone": {
|
|
247
|
+
"type": "select",
|
|
248
|
+
"options": [
|
|
249
|
+
"light",
|
|
250
|
+
"dark"
|
|
251
|
+
],
|
|
252
|
+
"description": "What the text is set for: dark = light text on a dark band. Without it, a fill's own lightness decides."
|
|
253
|
+
},
|
|
254
|
+
"align": {
|
|
255
|
+
"type": "select",
|
|
256
|
+
"options": [
|
|
257
|
+
"start",
|
|
258
|
+
"center",
|
|
259
|
+
"end"
|
|
260
|
+
],
|
|
261
|
+
"description": "Where the heading and lead sit; read by a component whose own align is not set."
|
|
262
|
+
},
|
|
263
|
+
"radius": {
|
|
264
|
+
"type": "integer",
|
|
265
|
+
"min": 0,
|
|
266
|
+
"max": 200,
|
|
267
|
+
"description": "Card and item corner radius."
|
|
268
|
+
},
|
|
269
|
+
"minHeight": {
|
|
270
|
+
"type": "integer",
|
|
271
|
+
"min": 0,
|
|
272
|
+
"max": 2000,
|
|
273
|
+
"description": "The section's minimum height."
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"billingMainLabel": {
|
|
278
|
+
"type": "string",
|
|
279
|
+
"default": "Monthly",
|
|
280
|
+
"content": false,
|
|
281
|
+
"description": "First option of the billing toggle."
|
|
282
|
+
},
|
|
283
|
+
"billingAltLabel": {
|
|
284
|
+
"type": "string",
|
|
285
|
+
"default": "Yearly",
|
|
286
|
+
"content": false,
|
|
287
|
+
"description": "Second option of the billing toggle (the plans' priceAlt)."
|
|
288
|
+
},
|
|
289
|
+
"billingLegend": {
|
|
290
|
+
"type": "string",
|
|
291
|
+
"default": "Billing period",
|
|
292
|
+
"content": false,
|
|
293
|
+
"description": "Legend of the toggle, read to screen readers."
|
|
107
294
|
}
|
|
108
295
|
},
|
|
109
296
|
"slots": {},
|
|
@@ -120,7 +307,7 @@
|
|
|
120
307
|
"divi/et_pb_pricing_tables"
|
|
121
308
|
]
|
|
122
309
|
},
|
|
123
|
-
"a11y": "Plans are a <ul>; each name is an <h3> under the section's <h2>, or an <h2> when the section has no heading. A featured plan is marked by a text badge and a ring, not colour alone. Buttons are links with their own label.",
|
|
310
|
+
"a11y": "Plans are a <ul>; each name is an <h3> under the section's <h2>, or an <h2> when the section has no heading. A featured plan is marked by a text badge and a ring, not colour alone. Buttons are links with their own label. The table layout is a real <table> with a caption, column and row headers, and Included / Not included text in every cell; the billing toggle is a fieldset with a legend and labelled radios.",
|
|
124
311
|
"pattern": {
|
|
125
312
|
"summary": "repeated plan units: name + price + feature list + button",
|
|
126
313
|
"signals": [
|
|
@@ -5,59 +5,121 @@
|
|
|
5
5
|
import { tv } from 'tailwind-variants'
|
|
6
6
|
import { renderMarkdown } from '../../../lib/markdown'
|
|
7
7
|
import Button from '../_shared/Button.astro'
|
|
8
|
+
import Embed from '../embed/Embed.astro'
|
|
9
|
+
import FeatureList from '../feature-list/FeatureList.astro'
|
|
8
10
|
import KitImage from '../_shared/KitImage.astro'
|
|
9
11
|
import Section from '../_shared/Section.astro'
|
|
10
|
-
import type { ActionInput, ImageInput } from '../_shared/types'
|
|
12
|
+
import type { ActionInput, ImageInput, MeasuredStyle } from '../_shared/types'
|
|
11
13
|
|
|
12
14
|
const split = tv({
|
|
13
15
|
slots: {
|
|
14
|
-
grid: 'grid items-center gap-10 md:
|
|
16
|
+
grid: 'grid items-center gap-10 md:gap-16',
|
|
15
17
|
copy: 'flex flex-col gap-5',
|
|
16
18
|
eyebrow: 'text-sm font-semibold tracking-wide uppercase opacity-80',
|
|
17
19
|
heading: 'text-3xl [font-weight:var(--font-weight-heading,700)] tracking-tight text-balance md:text-4xl',
|
|
18
20
|
body: 'prose prose-site max-w-none text-pretty',
|
|
19
21
|
actions: 'flex flex-wrap gap-3 pt-2',
|
|
20
|
-
media: 'overflow-hidden
|
|
22
|
+
media: 'overflow-hidden',
|
|
23
|
+
image: 'h-auto w-full object-cover',
|
|
21
24
|
},
|
|
22
25
|
variants: {
|
|
23
26
|
// Source order is text first; `start` moves the image before it on wide screens only.
|
|
24
27
|
imageSide: { start: { media: 'md:order-first' }, end: {} },
|
|
28
|
+
// The text column's share against the image's (the columns follow the sides, see `columns` below).
|
|
29
|
+
ratio: { '1:1': {}, '5:7': {}, '7:5': {} },
|
|
30
|
+
// contain: the image at its own proportions. cover: it fills the column's height.
|
|
31
|
+
imageFit: { contain: {}, cover: { grid: 'items-stretch', media: 'min-h-72 md:h-full', image: 'h-full min-h-72' } },
|
|
32
|
+
imageShape: {
|
|
33
|
+
none: { media: 'rounded-none' },
|
|
34
|
+
rounded: { media: 'rounded-[var(--radius-image,var(--radius-card))]' },
|
|
35
|
+
circle: { media: 'mx-auto aspect-square w-full max-w-lg rounded-full', image: 'h-full' },
|
|
36
|
+
},
|
|
37
|
+
// edge: the image runs on to the viewport's edge on its side (wide screens).
|
|
38
|
+
imageBleed: { none: {}, edge: { media: 'rounded-none' } },
|
|
39
|
+
// Phones show the text first, as the source does, or the picture first when it is the content itself.
|
|
40
|
+
stackOrder: { 'text-first': {}, 'media-first': { media: 'max-md:order-first' } },
|
|
41
|
+
// The media column follows the reader down a long text (wide screens).
|
|
42
|
+
sticky: { true: { media: 'md:sticky md:top-8 md:self-start' }, false: {} },
|
|
25
43
|
align: { start: {}, center: { copy: 'items-center text-center', actions: 'justify-center' } },
|
|
26
44
|
// accent/accent-ink is only ~5:1 — dimming text on it drops body copy under 4.5:1 (WCAG 1.4.3), so accent keeps it at full strength.
|
|
27
|
-
tone: { default: {}, muted: {}, inverse: {}, accent: { eyebrow: 'opacity-100' } },
|
|
45
|
+
tone: { default: {}, muted: {}, inverse: {}, accent: { eyebrow: 'opacity-100' }, brand: { eyebrow: 'opacity-100' }, none: {} },
|
|
28
46
|
},
|
|
29
|
-
defaultVariants: { imageSide: 'end', align: 'start', tone: 'default' },
|
|
47
|
+
defaultVariants: { imageSide: 'end', ratio: '1:1', imageFit: 'contain', imageShape: 'rounded', imageBleed: 'none', stackOrder: 'text-first', sticky: false, align: 'start', tone: 'default' },
|
|
30
48
|
})
|
|
31
49
|
|
|
50
|
+
// Literal class names, so the stylesheet builder sees them: the text column's share first, the image's second; a
|
|
51
|
+
// picture before the text on wide screens swaps the two columns.
|
|
52
|
+
const COLUMNS = {
|
|
53
|
+
text: { '1:1': 'md:grid-cols-2', '5:7': 'md:grid-cols-[5fr_7fr]', '7:5': 'md:grid-cols-[7fr_5fr]' },
|
|
54
|
+
image: { '1:1': 'md:grid-cols-2', '5:7': 'md:grid-cols-[7fr_5fr]', '7:5': 'md:grid-cols-[5fr_7fr]' },
|
|
55
|
+
} as const
|
|
56
|
+
// The viewport's edge, from the content's edge: what is left of the page's width, halved.
|
|
57
|
+
const BLEED = {
|
|
58
|
+
end: 'md:-me-[calc((100vw-min(var(--container-page),100vw-2*var(--spacing-gutter,2rem)))/2)]',
|
|
59
|
+
start: 'md:-ms-[calc((100vw-min(var(--container-page),100vw-2*var(--spacing-gutter,2rem)))/2)]',
|
|
60
|
+
} as const
|
|
61
|
+
|
|
62
|
+
interface Feature {
|
|
63
|
+
title: string
|
|
64
|
+
text?: string | undefined
|
|
65
|
+
/** A kit icon name (check, star, bolt, shield, heart, globe, clock, chat). */
|
|
66
|
+
icon?: string | undefined
|
|
67
|
+
}
|
|
68
|
+
|
|
32
69
|
interface Props {
|
|
33
70
|
heading: string
|
|
71
|
+
/** The heading's level: 2 under the page title; 3 or 4 when the section sits inside another. */
|
|
72
|
+
headingLevel?: 2 | 3 | 4 | undefined
|
|
34
73
|
eyebrow?: string | undefined
|
|
35
74
|
/** Markdown, rendered at build time. */
|
|
36
75
|
body?: string | undefined
|
|
37
76
|
actions?: ActionInput[] | undefined
|
|
38
77
|
image?: ImageInput | undefined
|
|
78
|
+
/** Short points under the text, each with a title and a line. */
|
|
79
|
+
features?: Feature[] | undefined
|
|
80
|
+
/** A video page (YouTube, Vimeo); the image is its poster and nothing loads from the provider until it is played. */
|
|
81
|
+
videoUrl?: string | undefined
|
|
82
|
+
/** The video's text for the play button. */
|
|
83
|
+
playLabel?: string | undefined
|
|
39
84
|
imageSide?: 'start' | 'end' | undefined
|
|
85
|
+
ratio?: '1:1' | '5:7' | '7:5' | undefined
|
|
86
|
+
imageFit?: 'contain' | 'cover' | undefined
|
|
87
|
+
imageShape?: 'none' | 'rounded' | 'circle' | undefined
|
|
88
|
+
imageBleed?: 'none' | 'edge' | undefined
|
|
89
|
+
mediaKind?: 'image' | 'video' | undefined
|
|
90
|
+
featureStyle?: 'check' | 'icon' | undefined
|
|
91
|
+
stackOrder?: 'text-first' | 'media-first' | undefined
|
|
92
|
+
sticky?: boolean | undefined
|
|
40
93
|
align?: 'start' | 'center' | undefined
|
|
41
|
-
tone?: 'default' | 'muted' | 'inverse' | 'accent' | undefined
|
|
94
|
+
tone?: 'default' | 'muted' | 'inverse' | 'accent' | 'brand' | 'none' | undefined
|
|
95
|
+
/** The source section's measured style (`MeasuredStyle`): frame, padding, fill, background image, columns per width, gap. Absent, the site's tokens; present, it wins over tone and columns. */
|
|
96
|
+
measured?: MeasuredStyle | undefined
|
|
42
97
|
id?: string | undefined
|
|
43
98
|
}
|
|
44
99
|
|
|
45
|
-
const { heading, eyebrow, body, actions = [], image, imageSide, align, tone, id } = Astro.props
|
|
46
|
-
const s = split({ imageSide, align, tone })
|
|
100
|
+
const { heading, headingLevel = 2, eyebrow, body, actions = [], image, features = [], videoUrl, playLabel, imageSide, ratio = '1:1', imageFit, imageShape, imageBleed, mediaKind, featureStyle = 'check', stackOrder, sticky = false, align, tone, measured, id } = Astro.props
|
|
101
|
+
const s = split({ imageSide, ratio, imageFit, imageShape, imageBleed, stackOrder, sticky, align, tone })
|
|
102
|
+
const Heading = `h${headingLevel}` as 'h2'
|
|
103
|
+
const columns = COLUMNS[imageSide === 'start' ? 'image' : 'text'][ratio]
|
|
104
|
+
const bleed = imageBleed === 'edge' ? BLEED[imageSide === 'start' ? 'start' : 'end'] : undefined
|
|
105
|
+
const video = mediaKind === 'video' && videoUrl
|
|
47
106
|
const headingId = id ? `${id}-title` : undefined
|
|
48
107
|
const html = await renderMarkdown(body)
|
|
49
108
|
---
|
|
50
|
-
<Section tone={tone} id={id} aria-labelledby={headingId}>
|
|
51
|
-
<div class={s.grid()}>
|
|
109
|
+
<Section measured={measured} tone={tone} id={id} aria-labelledby={headingId} class={bleed ? 'overflow-x-clip' : undefined}>
|
|
110
|
+
<div class:list={[s.grid(), columns]}>
|
|
52
111
|
<div class={s.copy()}>
|
|
53
112
|
{eyebrow && <p class={s.eyebrow()}>{eyebrow}</p>}
|
|
54
|
-
<
|
|
113
|
+
<Heading id={headingId} class={s.heading()}>{heading}</Heading>
|
|
55
114
|
{html && <div class={s.body()} data-kit-text set:html={html} />}
|
|
115
|
+
{features.length > 0 && <FeatureList items={features} columns="2" style={featureStyle} tone={tone === 'brand' || tone === 'none' ? undefined : tone} bare titleLevel={Math.min(5, headingLevel + 1) as 3 | 4 | 5} />}
|
|
56
116
|
{actions.length > 0 && <div class={s.actions()}>{actions.map(action => <Button action={action} size="lg" />)}</div>}
|
|
57
117
|
</div>
|
|
58
|
-
{image && (
|
|
59
|
-
<div class={s.media()}>
|
|
60
|
-
|
|
118
|
+
{(video || image) && (
|
|
119
|
+
<div class:list={[s.media(), bleed]}>
|
|
120
|
+
{video
|
|
121
|
+
? <div class="[&>figure]:my-0 [&>figure]:max-w-none"><Embed url={videoUrl} title={heading} poster={image} playLabel={playLabel} aspect="video" width="page" /></div>
|
|
122
|
+
: image && <KitImage image={image} sizes="(min-width: 768px) 50vw, 100vw" class={s.image()} />}
|
|
61
123
|
</div>
|
|
62
124
|
)}
|
|
63
125
|
</div>
|