create-bearminion 1.19.0 → 1.21.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 +34 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/template/AGENTS.md +1 -1
- package/template/README.md +5 -5
- package/template/astro.config.ts +16 -4
- package/template/bearminion.lock.json +80 -132
- package/template/content/pages/about.json +2 -2
- package/template/content/pages/index.json +23 -237
- package/template/content/site.json +2 -10
- package/template/package.json +1 -1
- package/template/src/components/organisms/EntryList.astro +83 -0
- package/template/src/components/organisms/Pagination.astro +56 -0
- package/template/src/components/sections/components.gen.ts +0 -10
- package/template/src/components/sections/definitions.gen.ts +0 -10
- package/template/src/components/sections/faq/definition.ts +2 -2
- package/template/src/components/sections/media/Media.astro +2 -2
- package/template/src/components/sections/media/MediaPlayer.astro +2 -2
- package/template/src/components/sections/shared.ts +3 -0
- package/template/src/components/sections/text-image/definition.ts +1 -1
- package/template/src/content.config.ts +4 -2
- package/template/src/dev/section-preview.astro +53 -0
- package/template/src/env.d.ts +2 -0
- package/template/src/layouts/Base.astro +19 -12
- package/template/src/lib/content.ts +57 -2
- package/template/src/lib/editing.ts +6 -0
- package/template/src/lib/sitemap.ts +14 -2
- package/template/src/pages/[...slug].astro +32 -13
- package/template/src/components/sections/contact/Contact.astro +0 -231
- package/template/src/components/sections/contact/Contact.stories.ts +0 -16
- package/template/src/components/sections/contact/definition.ts +0 -52
- package/template/src/components/sections/contact/form.ts +0 -313
- package/template/src/components/sections/contact/wireframe.ts +0 -15
- package/template/src/components/sections/logo-strip/LogoStrip.astro +0 -110
- package/template/src/components/sections/logo-strip/LogoStrip.stories.ts +0 -20
- package/template/src/components/sections/logo-strip/definition.ts +0 -30
- package/template/src/components/sections/logo-strip/wireframe.ts +0 -11
- package/template/src/components/sections/pricing/Pricing.astro +0 -210
- package/template/src/components/sections/pricing/Pricing.stories.ts +0 -16
- package/template/src/components/sections/pricing/definition.ts +0 -62
- package/template/src/components/sections/pricing/wireframe.ts +0 -18
- package/template/src/components/sections/stats/Stats.astro +0 -110
- package/template/src/components/sections/stats/Stats.stories.ts +0 -16
- package/template/src/components/sections/stats/definition.ts +0 -41
- package/template/src/components/sections/stats/wireframe.ts +0 -15
- package/template/src/components/sections/testimonials/Testimonials.astro +0 -172
- package/template/src/components/sections/testimonials/Testimonials.stories.ts +0 -19
- package/template/src/components/sections/testimonials/definition.ts +0 -42
- package/template/src/components/sections/testimonials/wireframe.ts +0 -21
- package/template/src/lib/contact-form.ts +0 -97
- package/template/src/lib/hidden-text.ts +0 -32
|
@@ -1,210 +0,0 @@
|
|
|
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>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { sectionArgTypes } from '../../../stories/options'
|
|
2
|
-
import { sectionEntry } from '../../../stories/sample'
|
|
3
|
-
import Pricing from './Pricing.astro'
|
|
4
|
-
|
|
5
|
-
const entry = sectionEntry('pricing')
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Sections/Pricing',
|
|
9
|
-
component: Pricing,
|
|
10
|
-
parameters: { layout: 'fullscreen' },
|
|
11
|
-
argTypes: sectionArgTypes('pricing'),
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const Home = {
|
|
15
|
-
args: { section: entry.section, index: entry.index, motion: false },
|
|
16
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
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
|
-
})
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
])
|
|
@@ -1,110 +0,0 @@
|
|
|
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>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { sectionArgTypes } from '../../../stories/options'
|
|
2
|
-
import { sectionEntry } from '../../../stories/sample'
|
|
3
|
-
import Stats from './Stats.astro'
|
|
4
|
-
|
|
5
|
-
const entry = sectionEntry('stats')
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Sections/Stats',
|
|
9
|
-
component: Stats,
|
|
10
|
-
parameters: { layout: 'fullscreen' },
|
|
11
|
-
argTypes: sectionArgTypes('stats'),
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const Home = {
|
|
15
|
-
args: { section: entry.section, index: entry.index, motion: false },
|
|
16
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
-
})
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
])
|
|
@@ -1,172 +0,0 @@
|
|
|
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
|
-
import MediaFrame from '../../molecules/MediaFrame.astro'
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
9
|
-
section: Extract<Section, { type: 'testimonials' }>
|
|
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 featured = props.items[0]
|
|
19
|
-
const rest = props.items.slice(1)
|
|
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 === 'grid' && (
|
|
25
|
-
<div class="section-container">
|
|
26
|
-
<SectionHeader eyebrow={props.eyebrow} heading={props.heading} marks={props.marks} field={field} />
|
|
27
|
-
<ul class="mt-12 grid grid-cols-[repeat(auto-fit,minmax(min(100%,18rem),1fr))] gap-4">
|
|
28
|
-
{props.items.map((item, itemIndex) => (
|
|
29
|
-
<li class="flex flex-col justify-between gap-8 rounded-card-lg bg-surface p-7 ring-line">
|
|
30
|
-
<Typography as="blockquote" class="text-[1.125rem] leading-[1.45] tracking-[-0.02em]" data-field={field(`items.${itemIndex}.quote`)} markdown={item.quote} />
|
|
31
|
-
<div class="flex items-center gap-3">
|
|
32
|
-
{item.image && !item.image.hidden ? (
|
|
33
|
-
<MediaFrame src={item.image.src} alt={item.image.alt} aspectClass="size-10 shrink-0" roundedClass="rounded-full" class="p-0" fit={item.image?.fit} position={item.image?.position} data-field={field(`items.${itemIndex}.image.alt`)} />
|
|
34
|
-
) : (
|
|
35
|
-
<span class="inline-flex size-10 items-center justify-center rounded-full bg-fg font-mono text-[0.75rem] text-bg">
|
|
36
|
-
{item.name.slice(0, 1)}
|
|
37
|
-
</span>
|
|
38
|
-
)}
|
|
39
|
-
<div>
|
|
40
|
-
<p class="text-[0.9375rem] font-medium" data-field={field(`items.${itemIndex}.name`)}>{item.name}</p>
|
|
41
|
-
{item.role && (
|
|
42
|
-
<p class="text-[0.8125rem] text-muted" data-field={field(`items.${itemIndex}.role`)}>{item.role}</p>
|
|
43
|
-
)}
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</li>
|
|
47
|
-
))}
|
|
48
|
-
</ul>
|
|
49
|
-
</div>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
{
|
|
53
|
-
section.variant === 'featured' && featured && (
|
|
54
|
-
<div class="section-container">
|
|
55
|
-
<figure class="mx-auto max-w-4xl text-center">
|
|
56
|
-
<Typography as="blockquote" class="font-serif text-[clamp(1.75rem,1rem+2.4cqi,3rem)] leading-[1.2] font-normal tracking-[-0.03em] italic" data-field={field('items.0.quote')} markdown={featured.quote} />
|
|
57
|
-
<figcaption class="mt-6 text-[0.9375rem]">
|
|
58
|
-
<span data-field={field('items.0.name')}>{featured.name}</span>
|
|
59
|
-
{featured.role && (
|
|
60
|
-
<span class="text-muted">
|
|
61
|
-
{' '}
|
|
62
|
-
· <span data-field={field('items.0.role')}>{featured.role}</span>
|
|
63
|
-
</span>
|
|
64
|
-
)}
|
|
65
|
-
</figcaption>
|
|
66
|
-
</figure>
|
|
67
|
-
{rest.length > 0 && (
|
|
68
|
-
<ul class="mt-14 grid grid-cols-1 border-t border-[var(--line)] @min-[700px]:grid-cols-2">
|
|
69
|
-
{rest.map((item, offset) => {
|
|
70
|
-
const itemIndex = offset + 1
|
|
71
|
-
return (
|
|
72
|
-
<li class="border-t border-[var(--line)] py-8 @min-[700px]:border-t-0 @min-[700px]:border-l @min-[700px]:px-8 @min-[700px]:first:border-l-0 @min-[700px]:first:pl-0">
|
|
73
|
-
<Typography as="blockquote" class="text-[1.0625rem] leading-[1.5]" data-field={field(`items.${itemIndex}.quote`)} markdown={item.quote} />
|
|
74
|
-
<p class="mt-4 text-[0.875rem]">
|
|
75
|
-
<span data-field={field(`items.${itemIndex}.name`)}>{item.name}</span>
|
|
76
|
-
{item.role && (
|
|
77
|
-
<span class="text-muted">
|
|
78
|
-
{' '}
|
|
79
|
-
· <span data-field={field(`items.${itemIndex}.role`)}>{item.role}</span>
|
|
80
|
-
</span>
|
|
81
|
-
)}
|
|
82
|
-
</p>
|
|
83
|
-
</li>
|
|
84
|
-
)
|
|
85
|
-
})}
|
|
86
|
-
</ul>
|
|
87
|
-
)}
|
|
88
|
-
</div>
|
|
89
|
-
)
|
|
90
|
-
}
|
|
91
|
-
{
|
|
92
|
-
section.variant === 'carousel' && (
|
|
93
|
-
<div class="section-container" data-carousel>
|
|
94
|
-
<div class="flex flex-wrap items-end justify-between gap-6">
|
|
95
|
-
<SectionHeader eyebrow={props.eyebrow} heading={props.heading} marks={props.marks} field={field} />
|
|
96
|
-
<div class="flex items-center gap-3">
|
|
97
|
-
<p class="font-mono text-[0.75rem] tracking-[0.08em] text-muted" data-carousel-counter>
|
|
98
|
-
01 / {String(props.items.length).padStart(2, '0')}
|
|
99
|
-
</p>
|
|
100
|
-
<button type="button" data-carousel-prev class="inline-flex size-11 items-center justify-center rounded-full shadow-[inset_0_0_0_1px_var(--line)]" aria-label="Previous testimonial">
|
|
101
|
-
←
|
|
102
|
-
</button>
|
|
103
|
-
<button type="button" data-carousel-next class="inline-flex size-11 items-center justify-center rounded-full shadow-[inset_0_0_0_1px_var(--line)]" aria-label="Next testimonial">
|
|
104
|
-
→
|
|
105
|
-
</button>
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
<div class="mt-10 overflow-hidden">
|
|
109
|
-
<div data-carousel-track class="flex transition-transform duration-[600ms] ease-[cubic-bezier(.2,.7,.2,1)]">
|
|
110
|
-
{props.items.map((item, itemIndex) => (
|
|
111
|
-
<article class="grid w-full shrink-0 items-center gap-8 @min-[760px]:grid-cols-[minmax(16rem,0.8fr)_minmax(0,1.2fr)]">
|
|
112
|
-
{!item.image?.hidden && (
|
|
113
|
-
<MediaFrame
|
|
114
|
-
src={item.image?.src}
|
|
115
|
-
alt={item.image?.alt ?? item.name}
|
|
116
|
-
aspectClass="aspect-square"
|
|
117
|
-
roundedClass="rounded-[clamp(1rem,2cqi,1.75rem)]"
|
|
118
|
-
fit={item.image?.fit} position={item.image?.position} data-field={field(`items.${itemIndex}.image.alt`)}
|
|
119
|
-
/>
|
|
120
|
-
)}
|
|
121
|
-
<div>
|
|
122
|
-
<Typography as="blockquote" class="font-serif text-[clamp(1.75rem,1rem+2cqi,2.75rem)] leading-[1.2] italic tracking-[-0.03em]" data-field={field(`items.${itemIndex}.quote`)} markdown={item.quote} />
|
|
123
|
-
<p class="mt-6 text-[0.9375rem]">
|
|
124
|
-
<span data-field={field(`items.${itemIndex}.name`)}>{item.name}</span>
|
|
125
|
-
{item.role && (
|
|
126
|
-
<span class="text-muted">
|
|
127
|
-
{' '}
|
|
128
|
-
· <span data-field={field(`items.${itemIndex}.role`)}>{item.role}</span>
|
|
129
|
-
</span>
|
|
130
|
-
)}
|
|
131
|
-
</p>
|
|
132
|
-
</div>
|
|
133
|
-
</article>
|
|
134
|
-
))}
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
)
|
|
139
|
-
}
|
|
140
|
-
</SectionShell>
|
|
141
|
-
|
|
142
|
-
<script>
|
|
143
|
-
function bindTestimonials() {
|
|
144
|
-
document.querySelectorAll('[data-carousel]').forEach((root) => {
|
|
145
|
-
if (!(root instanceof HTMLElement) || root.dataset.bound === 'true') return
|
|
146
|
-
root.dataset.bound = 'true'
|
|
147
|
-
const track = root.querySelector('[data-carousel-track]')
|
|
148
|
-
const counter = root.querySelector('[data-carousel-counter]')
|
|
149
|
-
const prev = root.querySelector('[data-carousel-prev]')
|
|
150
|
-
const next = root.querySelector('[data-carousel-next]')
|
|
151
|
-
if (!(track instanceof HTMLElement) || !(prev instanceof HTMLButtonElement) || !(next instanceof HTMLButtonElement)) return
|
|
152
|
-
const total = track.children.length
|
|
153
|
-
let index = 0
|
|
154
|
-
const render = () => {
|
|
155
|
-
track.style.transform = `translateX(-${index * 100}%)`
|
|
156
|
-
if (counter) {
|
|
157
|
-
counter.textContent = `${String(index + 1).padStart(2, '0')} / ${String(total).padStart(2, '0')}`
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
prev.addEventListener('click', () => {
|
|
161
|
-
index = (index - 1 + total) % total
|
|
162
|
-
render()
|
|
163
|
-
})
|
|
164
|
-
next.addEventListener('click', () => {
|
|
165
|
-
index = (index + 1) % total
|
|
166
|
-
render()
|
|
167
|
-
})
|
|
168
|
-
})
|
|
169
|
-
}
|
|
170
|
-
bindTestimonials()
|
|
171
|
-
document.addEventListener('bearminion:preview', bindTestimonials)
|
|
172
|
-
</script>
|