bearminion 1.8.0 → 1.9.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/CHANGELOG.md +12 -0
- package/dist/astro.js +5 -5
- package/dist/cli.js +761 -25
- package/dist/content.js +2 -2
- package/dist/hash-BeBymBO1.js +59 -0
- package/dist/index.js +4 -4
- package/dist/marks-DPBilumg.js +174 -0
- package/dist/marks.js +1 -174
- package/dist/{page-NOFVEqn1.js → page-X-WnOu7-.js} +1 -1
- package/dist/{preview--S1QUrMM.js → preview-B_88I5Jm.js} +1 -1
- package/dist/{reload-BPkPoQ-P.js → reload-Dkp3xC0l.js} +1 -1
- package/dist/rich-text-70hddxMC.js +403 -0
- package/dist/rich-text.js +1 -403
- package/dist/{sections-manifest-CU-xBjMi.js → sections-manifest-CO9QfJPG.js} +1 -1
- package/dist/{theme-DFjHjgFO.js → theme-Dv7_7B56.js} +2 -2
- package/dist/ui/mount.js +20 -7
- package/package.json +4 -1
- package/registry/default/files/src/components/atoms/Button.astro +64 -0
- package/registry/default/files/src/components/atoms/Emphasis.astro +24 -0
- package/registry/default/files/src/components/atoms/Image.astro +78 -0
- package/registry/default/files/src/components/atoms/Typography.astro +53 -0
- package/registry/default/files/src/components/atoms/button.ts +31 -0
- package/registry/default/files/src/components/atoms/image.ts +34 -0
- package/registry/default/files/src/components/atoms/options.ts +39 -0
- package/registry/default/files/src/components/atoms/typography.ts +64 -0
- package/registry/default/files/src/components/molecules/CommandLine.astro +109 -0
- package/registry/default/files/src/components/molecules/MediaFrame.astro +71 -0
- package/registry/default/files/src/components/molecules/Pill.astro +24 -0
- package/registry/default/files/src/components/molecules/SectionHeader.astro +63 -0
- package/registry/default/files/src/components/molecules/SectionShell.astro +33 -0
- package/registry/default/files/src/components/sections/contact/Contact.astro +231 -0
- package/registry/default/files/src/components/sections/contact/definition.ts +52 -0
- package/registry/default/files/src/components/sections/contact/form.ts +313 -0
- package/registry/default/files/src/components/sections/contact/wireframe.ts +15 -0
- package/registry/default/files/src/components/sections/cta/Cta.astro +206 -0
- package/registry/default/files/src/components/sections/cta/definition.ts +49 -0
- package/registry/default/files/src/components/sections/cta/wireframe.ts +9 -0
- package/registry/default/files/src/components/sections/faq/Faq.astro +136 -0
- package/registry/default/files/src/components/sections/faq/definition.ts +54 -0
- package/registry/default/files/src/components/sections/faq/wireframe.ts +19 -0
- package/registry/default/files/src/components/sections/features/Features.astro +146 -0
- package/registry/default/files/src/components/sections/features/definition.ts +54 -0
- package/registry/default/files/src/components/sections/features/wireframe.ts +19 -0
- package/registry/default/files/src/components/sections/gallery/Gallery.astro +128 -0
- package/registry/default/files/src/components/sections/gallery/definition.ts +59 -0
- package/registry/default/files/src/components/sections/gallery/lightbox.ts +159 -0
- package/registry/default/files/src/components/sections/gallery/wireframe.ts +12 -0
- package/registry/default/files/src/components/sections/hero/Hero.astro +185 -0
- package/registry/default/files/src/components/sections/hero/HeroBadge.astro +26 -0
- package/registry/default/files/src/components/sections/hero/definition.ts +74 -0
- package/registry/default/files/src/components/sections/hero/wireframe.ts +12 -0
- package/registry/default/files/src/components/sections/logo-strip/LogoStrip.astro +107 -0
- package/registry/default/files/src/components/sections/logo-strip/definition.ts +30 -0
- package/registry/default/files/src/components/sections/logo-strip/wireframe.ts +11 -0
- package/registry/default/files/src/components/sections/media/Media.astro +118 -0
- package/registry/default/files/src/components/sections/media/MediaPlayer.astro +176 -0
- package/registry/default/files/src/components/sections/media/definition.ts +77 -0
- package/registry/default/files/src/components/sections/media/source.ts +3 -0
- package/registry/default/files/src/components/sections/media/wireframe.ts +9 -0
- package/registry/default/files/src/components/sections/pricing/Pricing.astro +210 -0
- package/registry/default/files/src/components/sections/pricing/definition.ts +62 -0
- package/registry/default/files/src/components/sections/pricing/wireframe.ts +18 -0
- package/registry/default/files/src/components/sections/shared.ts +13 -0
- package/registry/default/files/src/components/sections/stats/Stats.astro +110 -0
- package/registry/default/files/src/components/sections/stats/definition.ts +41 -0
- package/registry/default/files/src/components/sections/stats/wireframe.ts +15 -0
- package/registry/default/files/src/components/sections/steps/Steps.astro +139 -0
- package/registry/default/files/src/components/sections/steps/definition.ts +62 -0
- package/registry/default/files/src/components/sections/steps/icons.ts +27 -0
- package/registry/default/files/src/components/sections/steps/wireframe.ts +16 -0
- package/registry/default/files/src/components/sections/testimonials/Testimonials.astro +172 -0
- package/registry/default/files/src/components/sections/testimonials/definition.ts +42 -0
- package/registry/default/files/src/components/sections/testimonials/wireframe.ts +21 -0
- package/registry/default/files/src/components/sections/text/Text.astro +43 -0
- package/registry/default/files/src/components/sections/text/definition.ts +36 -0
- package/registry/default/files/src/components/sections/text/wireframe.ts +12 -0
- package/registry/default/files/src/components/sections/text-image/TextImage.astro +107 -0
- package/registry/default/files/src/components/sections/text-image/definition.ts +39 -0
- package/registry/default/files/src/components/sections/text-image/wireframe.ts +12 -0
- package/registry/default/files/src/lib/assets.ts +13 -0
- package/registry/default/files/src/lib/cn.ts +6 -0
- package/registry/default/files/src/lib/contact-form.ts +97 -0
- package/registry/default/files/src/lib/hidden-text.ts +32 -0
- package/registry/default/files/src/lib/image-url.ts +38 -0
- package/registry/default/files/src/lib/link-attrs.ts +74 -0
- package/registry/default/registry.json +670 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { Section } from '../definitions'
|
|
3
|
+
import Button from '../../atoms/Button.astro'
|
|
4
|
+
import { buttonLinkProps, buttonVariant } from '../../../lib/link-attrs'
|
|
5
|
+
import SectionHeader from '../../molecules/SectionHeader.astro'
|
|
6
|
+
import SectionShell from '../../molecules/SectionShell.astro'
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
section: Extract<Section, { type: 'pricing' }>
|
|
10
|
+
index: number
|
|
11
|
+
motion?: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { section, index, motion = true } = Astro.props
|
|
15
|
+
const props = section.props
|
|
16
|
+
const field = (path: string) => `sections.${index}.props.${path}`
|
|
17
|
+
const reveal = section.motion ?? motion
|
|
18
|
+
const discount = props.yearlyDiscount
|
|
19
|
+
const featured = props.plans.find((plan) => plan.featured) ?? props.plans[0]
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
<SectionShell id={section.id} anchor={section.anchor} type={section.type} variant={section.variant} tone={section.tone} motion={reveal}>
|
|
23
|
+
{
|
|
24
|
+
section.variant === 'tiers' && (
|
|
25
|
+
<div class="section-container" data-pricing data-discount={discount}>
|
|
26
|
+
<SectionHeader eyebrow={props.eyebrow} heading={props.heading} marks={props.marks} intro={props.intro} align="center" field={field} class="mx-auto max-w-3xl" />
|
|
27
|
+
<div class="mt-8 flex justify-center">
|
|
28
|
+
<div class="inline-flex rounded-full p-1 ring-line" role="group" aria-label="Billing period">
|
|
29
|
+
<button type="button" data-billing="monthly" aria-pressed="true" class="h-10 rounded-full px-4 text-[0.875rem] font-medium">
|
|
30
|
+
Monthly
|
|
31
|
+
</button>
|
|
32
|
+
<button type="button" data-billing="yearly" aria-pressed="false" class="h-10 rounded-full px-4 text-[0.875rem] font-medium">
|
|
33
|
+
Yearly
|
|
34
|
+
</button>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<ul class="mt-10 grid grid-cols-1 gap-4 @min-[52rem]:grid-cols-3">
|
|
38
|
+
{props.plans.map((plan, planIndex) => (
|
|
39
|
+
<li
|
|
40
|
+
class:list={[
|
|
41
|
+
'flex flex-col rounded-card-lg p-7 ring-line',
|
|
42
|
+
plan.featured ? 'bg-fg text-bg' : 'bg-surface',
|
|
43
|
+
]}
|
|
44
|
+
data-monthly={plan.monthly}
|
|
45
|
+
>
|
|
46
|
+
<div class="flex items-center justify-between gap-3">
|
|
47
|
+
<h3 class="text-[1.25rem] font-semibold tracking-[-0.02em]" data-field={field(`plans.${planIndex}.name`)}>
|
|
48
|
+
{plan.name}
|
|
49
|
+
</h3>
|
|
50
|
+
{plan.featured && <span class="rounded-full bg-accent px-2.5 py-1 font-mono text-[0.6875rem] tracking-[0.06em] text-on uppercase">Popular</span>}
|
|
51
|
+
</div>
|
|
52
|
+
{plan.blurb && (
|
|
53
|
+
<p class:list={['mt-2 text-[0.9375rem] leading-[1.5]', plan.featured ? 'text-bg/70' : 'text-muted']} data-field={field(`plans.${planIndex}.blurb`)}>
|
|
54
|
+
{plan.blurb}
|
|
55
|
+
</p>
|
|
56
|
+
)}
|
|
57
|
+
<p class="mt-6">
|
|
58
|
+
<span class="text-[clamp(2.5rem,2rem+1cqi,3.25rem)] leading-none font-semibold tracking-[-0.04em]" data-amount>
|
|
59
|
+
{plan.monthly === 0 ? '$0' : `$${plan.monthly}`}
|
|
60
|
+
</span>
|
|
61
|
+
</p>
|
|
62
|
+
<p class:list={['mt-1 text-[0.8125rem]', plan.featured ? 'text-bg/70' : 'text-muted']} data-period>
|
|
63
|
+
{plan.monthly === 0 ? 'forever' : 'per month'}
|
|
64
|
+
</p>
|
|
65
|
+
{plan.cta && (
|
|
66
|
+
<Button {...buttonLinkProps(plan.cta)} variant={buttonVariant(plan.cta, plan.featured ? 'primary' : 'secondary')} class="mt-6" data-field={field(`plans.${planIndex}.cta.label`)}>
|
|
67
|
+
{plan.cta.label}
|
|
68
|
+
</Button>
|
|
69
|
+
)}
|
|
70
|
+
{plan.features.length > 0 && (
|
|
71
|
+
<ul class="mt-6 flex flex-col gap-2.5 border-t border-current/15 pt-6">
|
|
72
|
+
{plan.features.map((feature, featureIndex) => (
|
|
73
|
+
<li class="text-[0.9375rem]" data-field={field(`plans.${planIndex}.features.${featureIndex}`)}>
|
|
74
|
+
{feature}
|
|
75
|
+
</li>
|
|
76
|
+
))}
|
|
77
|
+
</ul>
|
|
78
|
+
)}
|
|
79
|
+
</li>
|
|
80
|
+
))}
|
|
81
|
+
</ul>
|
|
82
|
+
</div>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
{
|
|
86
|
+
section.variant === 'table' && (
|
|
87
|
+
<div class="section-container">
|
|
88
|
+
<SectionHeader eyebrow={props.eyebrow} heading={props.heading} marks={props.marks} intro={props.intro} field={field} />
|
|
89
|
+
<div class="mt-10 overflow-x-auto">
|
|
90
|
+
<table class="w-full min-w-[40rem] border-collapse text-left">
|
|
91
|
+
<thead>
|
|
92
|
+
<tr>
|
|
93
|
+
<th class="p-4"></th>
|
|
94
|
+
{props.plans.map((plan, planIndex) => (
|
|
95
|
+
<th class:list={['p-4 text-[0.9375rem] font-semibold', plan.featured && 'bg-accent/16']} data-field={field(`plans.${planIndex}.name`)}>
|
|
96
|
+
{plan.name}
|
|
97
|
+
</th>
|
|
98
|
+
))}
|
|
99
|
+
</tr>
|
|
100
|
+
</thead>
|
|
101
|
+
<tbody>
|
|
102
|
+
{(props.rows ?? []).map((row, rowIndex) => (
|
|
103
|
+
<tr class="border-t border-[var(--line)]">
|
|
104
|
+
{row.map((cell, cellIndex) => (
|
|
105
|
+
<td class:list={['p-4 text-[0.9375rem]', cellIndex > 0 && props.plans[cellIndex - 1]?.featured && 'bg-accent/16']} data-field={field(`rows.${rowIndex}.${cellIndex}`)}>
|
|
106
|
+
{cell === true ? '✓' : cell === false ? '—' : cell}
|
|
107
|
+
</td>
|
|
108
|
+
))}
|
|
109
|
+
</tr>
|
|
110
|
+
))}
|
|
111
|
+
</tbody>
|
|
112
|
+
</table>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
{
|
|
118
|
+
section.variant === 'single' && featured && (
|
|
119
|
+
<div class="section-container" data-pricing data-discount={discount}>
|
|
120
|
+
<SectionHeader eyebrow={props.eyebrow} heading={props.heading} marks={props.marks} intro={props.intro} field={field} />
|
|
121
|
+
<div class="mt-10 grid items-stretch gap-4 @min-[880px]:grid-cols-[minmax(22rem,1fr)_minmax(0,1fr)]">
|
|
122
|
+
<div class="flex flex-col justify-between rounded-panel bg-fg p-8 text-bg" data-monthly={featured.monthly}>
|
|
123
|
+
<div>
|
|
124
|
+
<p class="font-mono text-[0.75rem] tracking-[0.08em] uppercase text-bg/70" data-field={field('singleHeading')}>
|
|
125
|
+
{props.singleHeading ?? featured.name}
|
|
126
|
+
</p>
|
|
127
|
+
<p class="mt-6 text-[clamp(3rem,2rem+3cqi,4.5rem)] leading-none font-semibold tracking-[-0.05em]" data-amount>
|
|
128
|
+
{featured.monthly === 0 ? '$0' : `$${featured.monthly}`}
|
|
129
|
+
</p>
|
|
130
|
+
<p class="mt-2 text-[0.875rem] text-bg/70" data-period>
|
|
131
|
+
{featured.monthly === 0 ? 'forever' : 'per month'}
|
|
132
|
+
</p>
|
|
133
|
+
</div>
|
|
134
|
+
<div class="mt-8 flex flex-wrap gap-2.5">
|
|
135
|
+
{featured.cta && (
|
|
136
|
+
<Button {...buttonLinkProps(featured.cta)} variant={buttonVariant(featured.cta, 'primary')} data-field={field(`plans.${props.plans.indexOf(featured)}.cta.label`)}>
|
|
137
|
+
{featured.cta.label}
|
|
138
|
+
</Button>
|
|
139
|
+
)}
|
|
140
|
+
<div class="inline-flex rounded-full p-1 shadow-[inset_0_0_0_1px_color-mix(in_oklch,var(--bg)_30%,transparent)]" role="group" aria-label="Billing period" data-billing-inverse>
|
|
141
|
+
<button type="button" data-billing="monthly" aria-pressed="true" class="h-10 rounded-full px-4 text-[0.875rem]">
|
|
142
|
+
Monthly
|
|
143
|
+
</button>
|
|
144
|
+
<button type="button" data-billing="yearly" aria-pressed="false" class="h-10 rounded-full px-4 text-[0.875rem]">
|
|
145
|
+
Yearly
|
|
146
|
+
</button>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="rounded-panel bg-surface p-8 ring-line">
|
|
151
|
+
<h3 class="text-[1.25rem] font-semibold tracking-[-0.02em]" data-field={field(`plans.${props.plans.indexOf(featured)}.name`)}>
|
|
152
|
+
{featured.name}
|
|
153
|
+
</h3>
|
|
154
|
+
{featured.blurb && (
|
|
155
|
+
<p class="mt-2 text-muted" data-field={field(`plans.${props.plans.indexOf(featured)}.blurb`)}>
|
|
156
|
+
{featured.blurb}
|
|
157
|
+
</p>
|
|
158
|
+
)}
|
|
159
|
+
{featured.features.length > 0 && (
|
|
160
|
+
<ul class="mt-6 flex flex-col gap-3">
|
|
161
|
+
{featured.features.map((feature, featureIndex) => (
|
|
162
|
+
<li class="text-[0.9375rem]" data-field={field(`plans.${props.plans.indexOf(featured)}.features.${featureIndex}`)}>
|
|
163
|
+
✓ {feature}
|
|
164
|
+
</li>
|
|
165
|
+
))}
|
|
166
|
+
</ul>
|
|
167
|
+
)}
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
</SectionShell>
|
|
174
|
+
|
|
175
|
+
<script>
|
|
176
|
+
function bindPricing() {
|
|
177
|
+
document.querySelectorAll('[data-pricing]').forEach((root) => {
|
|
178
|
+
if (!(root instanceof HTMLElement) || root.dataset.bound === 'true') return
|
|
179
|
+
root.dataset.bound = 'true'
|
|
180
|
+
const discount = Number(root.dataset.discount ?? '0.2')
|
|
181
|
+
const cards = [...root.querySelectorAll('[data-monthly]')]
|
|
182
|
+
const buttons = [...root.querySelectorAll('[data-billing]')]
|
|
183
|
+
|
|
184
|
+
const apply = (billing: string) => {
|
|
185
|
+
buttons.forEach((button) => {
|
|
186
|
+
if (button instanceof HTMLButtonElement) button.setAttribute('aria-pressed', String(button.dataset.billing === billing))
|
|
187
|
+
})
|
|
188
|
+
cards.forEach((card) => {
|
|
189
|
+
if (!(card instanceof HTMLElement)) return
|
|
190
|
+
const monthly = Number(card.dataset.monthly ?? '0')
|
|
191
|
+
const amount = billing === 'yearly' ? Math.round(monthly * (1 - discount)) : monthly
|
|
192
|
+
const value = card.querySelector('[data-amount]')
|
|
193
|
+
const period = card.querySelector('[data-period]')
|
|
194
|
+
if (value) value.textContent = amount === 0 ? '$0' : `$${amount}`
|
|
195
|
+
if (period) {
|
|
196
|
+
period.textContent = amount === 0 ? 'forever' : billing === 'yearly' ? 'per month, billed yearly' : 'per month'
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
buttons.forEach((button) => {
|
|
202
|
+
button.addEventListener('click', () => {
|
|
203
|
+
if (button instanceof HTMLButtonElement && button.dataset.billing) apply(button.dataset.billing)
|
|
204
|
+
})
|
|
205
|
+
})
|
|
206
|
+
})
|
|
207
|
+
}
|
|
208
|
+
bindPricing()
|
|
209
|
+
document.addEventListener('bearminion:preview', bindPricing)
|
|
210
|
+
</script>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { defineSection, linkSchema, richTextSchema, textSchema, withEmphasis } from 'bearminion'
|
|
3
|
+
import { DEFAULT_CONTACT_ANCHOR, accent, eyebrow, heading } from '../shared'
|
|
4
|
+
import { pricingWireframe } from './wireframe'
|
|
5
|
+
|
|
6
|
+
export const pricingVariants = ['tiers', 'table', 'single'] as const
|
|
7
|
+
|
|
8
|
+
export const pricingPlanSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
name: textSchema,
|
|
11
|
+
blurb: textSchema.optional(),
|
|
12
|
+
monthly: z.number().nonnegative(),
|
|
13
|
+
featured: z.boolean().optional(),
|
|
14
|
+
cta: linkSchema.optional(),
|
|
15
|
+
features: z.array(textSchema),
|
|
16
|
+
})
|
|
17
|
+
.strict()
|
|
18
|
+
|
|
19
|
+
export const pricingRowSchema = z.array(z.union([z.string(), z.boolean()])).min(2)
|
|
20
|
+
|
|
21
|
+
export const pricingSchema = withEmphasis({
|
|
22
|
+
eyebrow,
|
|
23
|
+
heading,
|
|
24
|
+
intro: richTextSchema.optional(),
|
|
25
|
+
singleHeading: textSchema.optional(),
|
|
26
|
+
yearlyDiscount: z.number().min(0).max(1).default(0.2),
|
|
27
|
+
plans: z.array(pricingPlanSchema).min(1),
|
|
28
|
+
rows: z.array(pricingRowSchema).optional(),
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
export type PricingPlan = z.infer<typeof pricingPlanSchema>
|
|
32
|
+
export type PricingRow = z.infer<typeof pricingRowSchema>
|
|
33
|
+
export type PricingProps = z.infer<typeof pricingSchema>
|
|
34
|
+
|
|
35
|
+
export const pricing = defineSection({
|
|
36
|
+
type: 'pricing',
|
|
37
|
+
label: 'Pricing',
|
|
38
|
+
description: 'Plans side by side, one highlighted.',
|
|
39
|
+
schema: pricingSchema,
|
|
40
|
+
defaults: {
|
|
41
|
+
eyebrow: 'Pricing',
|
|
42
|
+
heading: 'Simple plans, no surprises.',
|
|
43
|
+
marks: accent('Simple plans, no surprises.', 'no surprises.'),
|
|
44
|
+
intro: 'Say what every plan includes, then let the table cover the differences.',
|
|
45
|
+
yearlyDiscount: 0.2,
|
|
46
|
+
plans: [
|
|
47
|
+
{
|
|
48
|
+
name: 'Starter',
|
|
49
|
+
blurb: 'For trying things out.',
|
|
50
|
+
monthly: 0,
|
|
51
|
+
cta: { label: 'Start free', href: `#${DEFAULT_CONTACT_ANCHOR}` },
|
|
52
|
+
features: ['Core features'],
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
variants: pricingVariants,
|
|
57
|
+
defaultVariant: 'tiers',
|
|
58
|
+
options: [{ name: 'yearlyDiscount', label: 'Yearly discount', type: 'number', default: 0.2, min: 0, max: 1 }],
|
|
59
|
+
optional: { props: ['eyebrow', 'heading', 'intro', 'singleHeading'], items: { plans: ['blurb', 'cta'] } },
|
|
60
|
+
counts: { plans: { recommended: 3 } },
|
|
61
|
+
wireframe: pricingWireframe,
|
|
62
|
+
})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineWireframe } from 'bearminion'
|
|
2
|
+
|
|
3
|
+
/** Add section picker thumbnail: [left %, top %, width %, height %, kind]. */
|
|
4
|
+
export const pricingWireframe = defineWireframe([
|
|
5
|
+
[30, 8, 40, 8, 'title'],
|
|
6
|
+
[8, 26, 26, 66, 'card'],
|
|
7
|
+
[37, 22, 26, 72, 'highlight'],
|
|
8
|
+
[66, 26, 26, 66, 'card'],
|
|
9
|
+
[11, 34, 10, 4, 'text'],
|
|
10
|
+
[40, 30, 10, 4, 'text'],
|
|
11
|
+
[69, 34, 10, 4, 'text'],
|
|
12
|
+
[11, 44, 14, 9, 'title'],
|
|
13
|
+
[40, 40, 14, 9, 'title'],
|
|
14
|
+
[69, 44, 14, 9, 'title'],
|
|
15
|
+
[11, 78, 20, 8, 'outline'],
|
|
16
|
+
[40, 78, 20, 9, 'button'],
|
|
17
|
+
[69, 78, 20, 8, 'outline'],
|
|
18
|
+
])
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { marksFromEmphasis, textSchema } from 'bearminion'
|
|
2
|
+
|
|
3
|
+
/** Optional text every section can drop. */
|
|
4
|
+
export const eyebrow = textSchema.optional()
|
|
5
|
+
export const heading = textSchema.optional()
|
|
6
|
+
|
|
7
|
+
/** Marks that style `em` inside `heading`, for the default copy. */
|
|
8
|
+
export function accent(heading: string, em: string) {
|
|
9
|
+
return marksFromEmphasis(heading, em)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Default in-page target for contact CTAs. Sample pages set this anchor on the contact section. */
|
|
13
|
+
export const DEFAULT_CONTACT_ANCHOR = 'contact'
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { Section } from '../definitions'
|
|
3
|
+
import Typography from '../../atoms/Typography.astro'
|
|
4
|
+
import SectionHeader from '../../molecules/SectionHeader.astro'
|
|
5
|
+
import SectionShell from '../../molecules/SectionShell.astro'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
section: Extract<Section, { type: 'stats' }>
|
|
9
|
+
index: number
|
|
10
|
+
motion?: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { section, index, motion = true } = Astro.props
|
|
14
|
+
const props = section.props
|
|
15
|
+
const field = (path: string) => `sections.${index}.props.${path}`
|
|
16
|
+
const reveal = section.motion ?? motion
|
|
17
|
+
const value =
|
|
18
|
+
'font-sans font-semibold leading-[0.9] tracking-[-0.05em] text-fg'
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
<SectionShell id={section.id} anchor={section.anchor} type={section.type} variant={section.variant} tone={section.tone} motion={reveal}>
|
|
22
|
+
{
|
|
23
|
+
section.variant === 'row' && (
|
|
24
|
+
<div class="section-container">
|
|
25
|
+
<SectionHeader eyebrow={props.eyebrow} heading={props.heading} marks={props.marks} field={field} headingClass="max-w-[18ch]" />
|
|
26
|
+
<dl class="mt-[clamp(2.5rem,5cqi,4.5rem)] grid grid-cols-1 gap-x-[clamp(1.5rem,3cqi,2.5rem)] gap-y-8 @min-[36rem]:grid-cols-2 @min-[68rem]:grid-cols-4">
|
|
27
|
+
{props.items.map((item, itemIndex) => (
|
|
28
|
+
<div class="flex flex-col gap-3 border-t border-line pt-5">
|
|
29
|
+
{item.label && (
|
|
30
|
+
<dt class="order-2 max-w-64 text-[0.9375rem] leading-[1.5] text-muted" data-field={field(`items.${itemIndex}.label`)}>
|
|
31
|
+
{item.label}
|
|
32
|
+
</dt>
|
|
33
|
+
)}
|
|
34
|
+
<dd class:list={[value, 'order-1 text-[clamp(3rem,2rem+4cqi,5.5rem)]']} data-field={field(`items.${itemIndex}.value`)}>
|
|
35
|
+
{item.value}
|
|
36
|
+
</dd>
|
|
37
|
+
</div>
|
|
38
|
+
))}
|
|
39
|
+
</dl>
|
|
40
|
+
</div>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
{
|
|
44
|
+
section.variant === 'cards' && (
|
|
45
|
+
<div class="section-container">
|
|
46
|
+
<SectionHeader
|
|
47
|
+
eyebrow={props.eyebrow}
|
|
48
|
+
heading={props.heading}
|
|
49
|
+
marks={props.marks}
|
|
50
|
+
align="center"
|
|
51
|
+
field={field}
|
|
52
|
+
headingClass="max-w-[18ch]"
|
|
53
|
+
class="mx-auto max-w-3xl"
|
|
54
|
+
/>
|
|
55
|
+
<dl class="mt-[clamp(2.5rem,4cqi,4rem)] grid grid-cols-1 gap-4 @min-[36rem]:grid-cols-2 @min-[68rem]:grid-cols-4">
|
|
56
|
+
{props.items.map((item, itemIndex) => (
|
|
57
|
+
<div
|
|
58
|
+
class:list={[
|
|
59
|
+
'flex min-h-52 flex-col justify-between gap-10 rounded-card-lg bg-surface p-6 ring-line',
|
|
60
|
+
reveal && 'transition-transform duration-300 ease-out-soft hover:-translate-y-1',
|
|
61
|
+
]}
|
|
62
|
+
>
|
|
63
|
+
<dd class:list={[value, 'text-[clamp(2.75rem,2rem+2.5cqi,4rem)]']} data-field={field(`items.${itemIndex}.value`)}>
|
|
64
|
+
{item.value}
|
|
65
|
+
</dd>
|
|
66
|
+
{item.label && (
|
|
67
|
+
<dt class="text-[0.9375rem] leading-[1.5] text-muted" data-field={field(`items.${itemIndex}.label`)}>
|
|
68
|
+
{item.label}
|
|
69
|
+
</dt>
|
|
70
|
+
)}
|
|
71
|
+
</div>
|
|
72
|
+
))}
|
|
73
|
+
</dl>
|
|
74
|
+
</div>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
{
|
|
78
|
+
section.variant === 'split' && (
|
|
79
|
+
<div class="section-container grid items-center gap-[clamp(2.5rem,6cqi,6rem)] @min-[44rem]:grid-cols-2">
|
|
80
|
+
<div class="flex flex-col gap-5">
|
|
81
|
+
<SectionHeader eyebrow={props.eyebrow} heading={props.heading} marks={props.marks} field={field} />
|
|
82
|
+
{props.body && (
|
|
83
|
+
<Typography
|
|
84
|
+
as="p"
|
|
85
|
+
size="body"
|
|
86
|
+
color="muted"
|
|
87
|
+
class="max-w-[30rem] text-[clamp(1rem,0.95rem+0.3cqi,1.125rem)] leading-[1.6]"
|
|
88
|
+
data-field={field('body')}
|
|
89
|
+
markdown={props.body}
|
|
90
|
+
/>
|
|
91
|
+
)}
|
|
92
|
+
</div>
|
|
93
|
+
<dl class="grid grid-cols-2 gap-px overflow-hidden rounded-card-lg bg-line shadow-[0_0_0_1px_var(--line)]">
|
|
94
|
+
{props.items.map((item, itemIndex) => (
|
|
95
|
+
<div class="flex flex-col gap-3 bg-bg p-[clamp(1.25rem,3cqi,2rem)]">
|
|
96
|
+
<dd class:list={[value, 'text-[clamp(2.25rem,1.5rem+2.5cqi,3.75rem)]']} data-field={field(`items.${itemIndex}.value`)}>
|
|
97
|
+
{item.value}
|
|
98
|
+
</dd>
|
|
99
|
+
{item.label && (
|
|
100
|
+
<dt class="text-[0.875rem] leading-[1.5] text-muted" data-field={field(`items.${itemIndex}.label`)}>
|
|
101
|
+
{item.label}
|
|
102
|
+
</dt>
|
|
103
|
+
)}
|
|
104
|
+
</div>
|
|
105
|
+
))}
|
|
106
|
+
</dl>
|
|
107
|
+
</div>
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
</SectionShell>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { defineSection, richTextSchema, textSchema, withEmphasis } from 'bearminion'
|
|
3
|
+
import { accent, eyebrow, heading } from '../shared'
|
|
4
|
+
import { statsWireframe } from './wireframe'
|
|
5
|
+
|
|
6
|
+
export const statsVariants = ['row', 'cards', 'split'] as const
|
|
7
|
+
|
|
8
|
+
export const statItemSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
value: textSchema,
|
|
11
|
+
label: textSchema.optional(),
|
|
12
|
+
})
|
|
13
|
+
.strict()
|
|
14
|
+
|
|
15
|
+
export const statsSchema = withEmphasis({
|
|
16
|
+
eyebrow,
|
|
17
|
+
heading,
|
|
18
|
+
body: richTextSchema.optional(),
|
|
19
|
+
items: z.array(statItemSchema).min(1),
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
export type StatItem = z.infer<typeof statItemSchema>
|
|
23
|
+
export type StatsProps = z.infer<typeof statsSchema>
|
|
24
|
+
|
|
25
|
+
export const stats = defineSection({
|
|
26
|
+
type: 'stats',
|
|
27
|
+
label: 'Stats',
|
|
28
|
+
description: 'Big numbers with short labels.',
|
|
29
|
+
schema: statsSchema,
|
|
30
|
+
defaults: {
|
|
31
|
+
eyebrow: 'By the numbers',
|
|
32
|
+
heading: 'Figures that build trust.',
|
|
33
|
+
marks: accent('Figures that build trust.', 'build trust.'),
|
|
34
|
+
items: [{ value: '120+', label: 'customers since launch' }],
|
|
35
|
+
},
|
|
36
|
+
variants: statsVariants,
|
|
37
|
+
defaultVariant: 'row',
|
|
38
|
+
optional: { props: ['eyebrow', 'heading', 'body'], items: { items: ['label'] } },
|
|
39
|
+
counts: { items: { recommended: 4 } },
|
|
40
|
+
wireframe: statsWireframe,
|
|
41
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineWireframe } from 'bearminion'
|
|
2
|
+
|
|
3
|
+
/** Add section picker thumbnail: [left %, top %, width %, height %, kind]. */
|
|
4
|
+
export const statsWireframe = defineWireframe([
|
|
5
|
+
[0, 0, 100, 100, 'dark'],
|
|
6
|
+
[8, 16, 30, 7, 'light'],
|
|
7
|
+
[8, 50, 16, 14, 'figure'],
|
|
8
|
+
[31, 50, 16, 14, 'figure'],
|
|
9
|
+
[54, 50, 16, 14, 'figure'],
|
|
10
|
+
[77, 50, 16, 14, 'figure'],
|
|
11
|
+
[8, 70, 18, 4, 'text'],
|
|
12
|
+
[31, 70, 18, 4, 'text'],
|
|
13
|
+
[54, 70, 18, 4, 'text'],
|
|
14
|
+
[77, 70, 18, 4, 'text'],
|
|
15
|
+
])
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { Section } from '../definitions'
|
|
3
|
+
import Button from '../../atoms/Button.astro'
|
|
4
|
+
import Typography from '../../atoms/Typography.astro'
|
|
5
|
+
import SectionHeader from '../../molecules/SectionHeader.astro'
|
|
6
|
+
import SectionShell from '../../molecules/SectionShell.astro'
|
|
7
|
+
import { anchorAttrs, buttonLinkProps, buttonVariant } from '../../../lib/link-attrs'
|
|
8
|
+
import { stepColumns, stepIconPaths } from './icons'
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
section: Extract<Section, { type: 'steps' }>
|
|
12
|
+
index: number
|
|
13
|
+
motion?: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const { section, index, motion = true } = Astro.props
|
|
17
|
+
const props = section.props
|
|
18
|
+
const field = (path: string) => `sections.${index}.props.${path}`
|
|
19
|
+
const reveal = section.motion ?? motion
|
|
20
|
+
const columns = stepColumns[props.steps.length] ?? ''
|
|
21
|
+
const number = (itemIndex: number) => String(itemIndex + 1).padStart(2, '0')
|
|
22
|
+
const textLink = 'inline-flex items-center gap-1.5 text-[0.9375rem] font-medium text-link underline-offset-4 hover:underline'
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
<SectionShell id={section.id} anchor={section.anchor} type={section.type} variant={section.variant} tone={section.tone} motion={reveal}>
|
|
26
|
+
{
|
|
27
|
+
section.variant === 'columns' && (
|
|
28
|
+
<div class="section-container flex flex-col gap-[clamp(2.5rem,5cqi,4rem)]">
|
|
29
|
+
<div class="flex flex-wrap items-end justify-between gap-x-16 gap-y-5">
|
|
30
|
+
<SectionHeader eyebrow={props.eyebrow} heading={props.heading} marks={props.marks} size="h2-md" field={field} headingClass="max-w-[16ch]" class="flex-[1_1_26rem] gap-5" />
|
|
31
|
+
{(props.body || props.link) && (
|
|
32
|
+
<div class="flex flex-[0_1_26rem] flex-col items-start gap-4">
|
|
33
|
+
{props.body && <Typography as="p" size="lead" color="muted" data-field={field('body')} markdown={props.body} />}
|
|
34
|
+
{props.link && (
|
|
35
|
+
<a {...anchorAttrs(props.link)} class={textLink}>
|
|
36
|
+
<span data-field={field('link.label')}>{props.link.label}</span>
|
|
37
|
+
<span aria-hidden="true">→</span>
|
|
38
|
+
</a>
|
|
39
|
+
)}
|
|
40
|
+
</div>
|
|
41
|
+
)}
|
|
42
|
+
</div>
|
|
43
|
+
<ol class:list={['grid grid-cols-1 gap-4', columns]}>
|
|
44
|
+
{props.steps.map((step, itemIndex) => (
|
|
45
|
+
<li class="flex flex-col gap-4 rounded-card bg-surface p-[clamp(1.5rem,2.5cqi,2rem)] ring-line [&_code]:bg-bg">
|
|
46
|
+
<div class="flex items-center justify-between">
|
|
47
|
+
<span class="grid size-12 place-items-center rounded-[0.875rem] bg-accent text-on" aria-hidden="true">
|
|
48
|
+
<svg viewBox="0 0 24 24" class="size-[22px]" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
49
|
+
<path d={stepIconPaths[step.icon]} />
|
|
50
|
+
</svg>
|
|
51
|
+
</span>
|
|
52
|
+
{props.numbered && <span class="font-mono text-[0.75rem] tracking-[0.06em] text-muted">{number(itemIndex)}</span>}
|
|
53
|
+
</div>
|
|
54
|
+
<Typography as="h3" size="h3" class="mt-2 text-[1.375rem] leading-[1.15] tracking-[-0.025em]" data-field={field(`steps.${itemIndex}.title`)}>
|
|
55
|
+
{step.title}
|
|
56
|
+
</Typography>
|
|
57
|
+
{step.description && <Typography as="p" size="body" color="muted" data-field={field(`steps.${itemIndex}.description`)} markdown={step.description} />}
|
|
58
|
+
</li>
|
|
59
|
+
))}
|
|
60
|
+
</ol>
|
|
61
|
+
</div>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
{
|
|
65
|
+
section.variant === 'rail' && (
|
|
66
|
+
<div class="section-container flex flex-col items-center gap-[clamp(3rem,6cqi,5rem)]">
|
|
67
|
+
<SectionHeader
|
|
68
|
+
eyebrow={props.eyebrow}
|
|
69
|
+
heading={props.heading}
|
|
70
|
+
marks={props.marks}
|
|
71
|
+
intro={props.body}
|
|
72
|
+
introField="body"
|
|
73
|
+
align="center"
|
|
74
|
+
size="h2-md"
|
|
75
|
+
field={field}
|
|
76
|
+
headingClass="max-w-[18ch]"
|
|
77
|
+
class="gap-5 [&>[data-field-kind=rich]]:max-w-[34rem]"
|
|
78
|
+
/>
|
|
79
|
+
<ol class:list={['grid w-full grid-cols-1 gap-x-8 gap-y-14', columns]}>
|
|
80
|
+
{props.steps.map((step, itemIndex) => (
|
|
81
|
+
<li class="relative flex flex-col gap-3.5 border-t border-line pt-9">
|
|
82
|
+
<span class="absolute -top-6 left-0 grid size-12 place-items-center rounded-full bg-bg text-fg ring-line" aria-hidden="true">
|
|
83
|
+
<svg viewBox="0 0 24 24" class="size-5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
84
|
+
<path d={stepIconPaths[step.icon]} />
|
|
85
|
+
</svg>
|
|
86
|
+
</span>
|
|
87
|
+
{props.numbered && <span class="font-mono text-[0.75rem] tracking-[0.06em] text-link">Step {number(itemIndex)}</span>}
|
|
88
|
+
<Typography as="h3" size="h3" class="text-[1.375rem] leading-[1.15] tracking-[-0.025em]" data-field={field(`steps.${itemIndex}.title`)}>
|
|
89
|
+
{step.title}
|
|
90
|
+
</Typography>
|
|
91
|
+
{step.description && <Typography as="p" size="body" color="muted" data-field={field(`steps.${itemIndex}.description`)} markdown={step.description} />}
|
|
92
|
+
</li>
|
|
93
|
+
))}
|
|
94
|
+
</ol>
|
|
95
|
+
{props.link && (
|
|
96
|
+
<Button {...buttonLinkProps(props.link)} variant={buttonVariant(props.link, 'secondary')} arrow data-field={field('link.label')}>
|
|
97
|
+
{props.link.label}
|
|
98
|
+
</Button>
|
|
99
|
+
)}
|
|
100
|
+
</div>
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
{
|
|
104
|
+
section.variant === 'list' && (
|
|
105
|
+
<div class="section-container grid grid-cols-[repeat(auto-fit,minmax(min(100%,22rem),1fr))] items-start gap-[clamp(2.5rem,6cqi,6rem)]">
|
|
106
|
+
<div class="sticky top-24 flex flex-col items-start gap-5">
|
|
107
|
+
<SectionHeader eyebrow={props.eyebrow} heading={props.heading} marks={props.marks} size="h2-md" field={field} class="gap-5" />
|
|
108
|
+
{props.body && <Typography as="p" size="lead" color="muted" data-field={field('body')} class="max-w-[30rem]" markdown={props.body} />}
|
|
109
|
+
{props.link && (
|
|
110
|
+
<a {...anchorAttrs(props.link)} class={textLink}>
|
|
111
|
+
<span data-field={field('link.label')}>{props.link.label}</span>
|
|
112
|
+
<span aria-hidden="true">→</span>
|
|
113
|
+
</a>
|
|
114
|
+
)}
|
|
115
|
+
</div>
|
|
116
|
+
<ol class="flex flex-col">
|
|
117
|
+
{props.steps.map((step, itemIndex) => (
|
|
118
|
+
<li class="grid grid-cols-[3rem_minmax(0,1fr)] gap-5 border-t border-line py-7">
|
|
119
|
+
<span class="grid size-12 place-items-center rounded-[0.875rem] bg-accent text-on" aria-hidden="true">
|
|
120
|
+
<svg viewBox="0 0 24 24" class="size-5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
121
|
+
<path d={stepIconPaths[step.icon]} />
|
|
122
|
+
</svg>
|
|
123
|
+
</span>
|
|
124
|
+
<div class="flex flex-col gap-2">
|
|
125
|
+
<div class="flex items-baseline gap-3">
|
|
126
|
+
{props.numbered && <span class="font-mono text-[0.75rem] text-muted">{number(itemIndex)}</span>}
|
|
127
|
+
<Typography as="h3" size="h3" class="text-[1.25rem] leading-[1.2]" data-field={field(`steps.${itemIndex}.title`)}>
|
|
128
|
+
{step.title}
|
|
129
|
+
</Typography>
|
|
130
|
+
</div>
|
|
131
|
+
{step.description && <Typography as="p" size="body" color="muted" data-field={field(`steps.${itemIndex}.description`)} markdown={step.description} />}
|
|
132
|
+
</div>
|
|
133
|
+
</li>
|
|
134
|
+
))}
|
|
135
|
+
</ol>
|
|
136
|
+
</div>
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
</SectionShell>
|