@tanqory/partner-cli 0.0.0-stage → 0.1.0-alpha.2
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/LICENSE +21 -0
- package/bin/tanqory-partner.mjs +10 -0
- package/config/mirror-allowlist.json +17 -0
- package/config/theme-licences.json +108 -0
- package/config/third-party-toolchains.json +45 -0
- package/lib/api.mjs +109 -0
- package/lib/auth.mjs +211 -0
- package/lib/check.mjs +66 -0
- package/lib/cli.mjs +217 -0
- package/lib/mcp.mjs +177 -0
- package/lib/ops.mjs +179 -0
- package/lib/theme.mjs +121 -0
- package/lib/vendor/partner-checks.cjs +2420 -0
- package/package.json +59 -4
- package/starter/LICENSE +18 -0
- package/starter/README.md +44 -0
- package/starter/config/settings.json +5 -0
- package/starter/gitignore +3 -0
- package/starter/locales/en.json +22 -0
- package/starter/locales/en.schema.json +69 -0
- package/starter/locales/th.json +22 -0
- package/starter/locales/th.schema.json +69 -0
- package/starter/package.json +29 -0
- package/starter/regions/footer.json +35 -0
- package/starter/regions/header.json +13 -0
- package/starter/scripts/build.mjs +211 -0
- package/starter/scripts/probe.ts +4 -0
- package/starter/src/bundle.ts +15 -0
- package/starter/src/components/parts.tsx +32 -0
- package/starter/src/entry.client.tsx +6 -0
- package/starter/src/entry.server.tsx +13 -0
- package/starter/src/sections/chrome.tsx +132 -0
- package/starter/src/sections/commerce.tsx +242 -0
- package/starter/src/sections/content.tsx +115 -0
- package/starter/src/sections/editorial.tsx +232 -0
- package/starter/src/settings.ts +12 -0
- package/starter/src/styles/theme.css +241 -0
- package/starter/src/templates.ts +14 -0
- package/starter/src/theme.tsx +86 -0
- package/starter/templates/404.json +14 -0
- package/starter/templates/account.json +14 -0
- package/starter/templates/article.json +14 -0
- package/starter/templates/blog.json +14 -0
- package/starter/templates/cart.json +14 -0
- package/starter/templates/collection.json +14 -0
- package/starter/templates/index.json +116 -0
- package/starter/templates/page.contact.json +22 -0
- package/starter/templates/page.json +14 -0
- package/starter/templates/product.json +18 -0
- package/starter/templates/search.json +14 -0
- package/starter/tsconfig.json +17 -0
- package/starter/vite.client.config.ts +17 -0
- package/starter/vite.probe.config.ts +16 -0
- package/starter/vite.server.config.ts +32 -0
- package/README.md +0 -3
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Home page sections: hero, product grid, features, testimonials, rich text, newsletter.
|
|
3
|
+
*
|
|
4
|
+
* Editability (packages/theme-standard/EDITABILITY.md): every word, image and link a shopper sees here is a setting or
|
|
5
|
+
* a block, with real sample words as its default, so the merchant changes all of it in the theme editor. A list (the
|
|
6
|
+
* features, the testimonials) is blocks the merchant adds, removes and reorders. Every section has a preset, so it can
|
|
7
|
+
* be added from "Add section". Interface words (View all) go through t() and the locale files.
|
|
8
|
+
*/
|
|
9
|
+
import { Image, NewsletterForm, ai, defineBlock, defineSection, field, useCollection, useTranslate, type BlockInstance } from '@tanqory/theme-kit/headless'
|
|
10
|
+
import { Grid, cx } from '../components/parts'
|
|
11
|
+
|
|
12
|
+
export const hero = defineSection({
|
|
13
|
+
type: 'hero',
|
|
14
|
+
title: 't:labels.hero',
|
|
15
|
+
description: 't:descriptions.a_heading_a_short_line_an',
|
|
16
|
+
category: 'editorial',
|
|
17
|
+
settings: {
|
|
18
|
+
kicker: field.text('New season', { label: 't:labels.kicker' }),
|
|
19
|
+
heading: field.text('Made to be used every day', { label: 't:labels.heading' }),
|
|
20
|
+
body: field.richtext('<p>Simple things, made well and made to last.</p>', { label: 't:labels.text' }),
|
|
21
|
+
image: field.resource('image', '', { label: 't:labels.image' }),
|
|
22
|
+
imageAlt: field.text('', { label: 't:labels.image_description', info: 't:descriptions.what_the_picture_shows_for_people' }),
|
|
23
|
+
buttonLabel: field.text('Shop all', { label: 't:labels.button_label' }),
|
|
24
|
+
buttonLink: field.url('/collections/all', { label: 't:labels.button_link' }),
|
|
25
|
+
},
|
|
26
|
+
presets: [{ name: 't:labels.hero', settings: { kicker: 'New season', heading: 'Made to be used every day', buttonLabel: 'Shop all', buttonLink: '/collections/all' } }],
|
|
27
|
+
ai: ai.hero({ heading: 'heading', subheading: 'kicker', image: 'image', button: 'buttonLabel', link: 'buttonLink' }),
|
|
28
|
+
component: ({ settings }) => (
|
|
29
|
+
<section className={cx('st-hero', settings.image && 'st-hero--image')}>
|
|
30
|
+
{settings.image ? <Image image={settings.image} alt={settings.imageAlt} className="st-hero__img" loading="eager" /> : null}
|
|
31
|
+
<div className="st-hero__copy">
|
|
32
|
+
{settings.kicker ? <p className="st-hero__kicker">{settings.kicker}</p> : null}
|
|
33
|
+
<h1 className="st-hero__title">{settings.heading}</h1>
|
|
34
|
+
{settings.body ? <div className="st-hero__body" dangerouslySetInnerHTML={{ __html: settings.body }} /> : null}
|
|
35
|
+
{settings.buttonLabel && settings.buttonLink ? (
|
|
36
|
+
<a className="st-btn" href={settings.buttonLink}>
|
|
37
|
+
{settings.buttonLabel}
|
|
38
|
+
</a>
|
|
39
|
+
) : null}
|
|
40
|
+
</div>
|
|
41
|
+
</section>
|
|
42
|
+
),
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
function Shelf({ settings }: { settings: { heading: string; collection: string; count: number } }): JSX.Element {
|
|
46
|
+
const c = useCollection(settings.collection)
|
|
47
|
+
const t = useTranslate()
|
|
48
|
+
const products = c.products.slice(0, settings.count)
|
|
49
|
+
return (
|
|
50
|
+
<section className="st-shelf">
|
|
51
|
+
<div className="st-shelf__head">
|
|
52
|
+
<h2 className="st-shelf__title">{settings.heading || c.collection?.title}</h2>
|
|
53
|
+
{c.collection ? (
|
|
54
|
+
<a className="st-shelf__all" href={c.collection.url}>
|
|
55
|
+
{t('starter.shelf.viewAll')}
|
|
56
|
+
</a>
|
|
57
|
+
) : null}
|
|
58
|
+
</div>
|
|
59
|
+
{products.length ? <Grid products={products} eager={4} /> : <p className="st-muted">{t('starter.shelf.empty')}</p>}
|
|
60
|
+
</section>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const featuredCollection = defineSection({
|
|
65
|
+
type: 'featured-collection',
|
|
66
|
+
title: 't:labels.product_grid',
|
|
67
|
+
description: 't:descriptions.a_row_of_products_from_one',
|
|
68
|
+
category: 'products',
|
|
69
|
+
settings: {
|
|
70
|
+
heading: field.text('Featured products', { label: 't:labels.heading' }),
|
|
71
|
+
collection: field.resource('collection', 'all', { label: 't:labels.collection' }),
|
|
72
|
+
count: field.range(8, 4, 16, 4, { label: 't:labels.products_to_show' }),
|
|
73
|
+
},
|
|
74
|
+
presets: [{ name: 't:labels.product_grid', settings: { heading: 'Featured products', collection: 'all' } }],
|
|
75
|
+
ai: ai.productGrid('collection', { heading: 'heading' }),
|
|
76
|
+
component: Shelf,
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
// ── a list: each feature is a block ─────────────────────────────────────────────────────────────────────────────────
|
|
80
|
+
const feature = defineBlock({
|
|
81
|
+
type: 'feature',
|
|
82
|
+
title: 't:labels.feature',
|
|
83
|
+
settings: {
|
|
84
|
+
image: field.resource('image', '', { label: 't:labels.image' }),
|
|
85
|
+
imageAlt: field.text('', { label: 't:labels.image_description' }),
|
|
86
|
+
heading: field.text('Free delivery', { label: 't:labels.heading' }),
|
|
87
|
+
text: field.textarea('On every order over 1,000 baht.', { label: 't:labels.text' }),
|
|
88
|
+
linkLabel: field.text('', { label: 't:labels.link_label' }),
|
|
89
|
+
link: field.url('', { label: 't:labels.link' }),
|
|
90
|
+
},
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
function Feature({ block }: { block: BlockInstance }): JSX.Element {
|
|
94
|
+
const s = block.settings as { image?: string; imageAlt?: string; heading?: string; text?: string; linkLabel?: string; link?: string }
|
|
95
|
+
return (
|
|
96
|
+
<li className="st-features__item">
|
|
97
|
+
{s.image ? <Image image={s.image} alt={s.imageAlt ?? ''} className="st-features__img" /> : null}
|
|
98
|
+
{s.heading ? <h3 className="st-features__name">{s.heading}</h3> : null}
|
|
99
|
+
{s.text ? <p className="st-features__text">{s.text}</p> : null}
|
|
100
|
+
{s.linkLabel && s.link ? (
|
|
101
|
+
<a className="st-features__link" href={s.link}>
|
|
102
|
+
{s.linkLabel}
|
|
103
|
+
</a>
|
|
104
|
+
) : null}
|
|
105
|
+
</li>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const features = defineSection({
|
|
110
|
+
type: 'features',
|
|
111
|
+
title: 't:labels.features',
|
|
112
|
+
description: 't:descriptions.a_heading_and_a_row_of',
|
|
113
|
+
category: 'editorial',
|
|
114
|
+
settings: {
|
|
115
|
+
heading: field.text('Why shop with us', { label: 't:labels.heading' }),
|
|
116
|
+
columns: field.select(['2', '3', '4'], '3', { label: 't:labels.columns', optionLabels: { '2': 't:labels.two', '3': 't:labels.three', '4': 't:labels.four' } }),
|
|
117
|
+
},
|
|
118
|
+
blocks: [feature],
|
|
119
|
+
presets: [
|
|
120
|
+
{
|
|
121
|
+
name: 't:labels.features',
|
|
122
|
+
settings: { heading: 'Why shop with us' },
|
|
123
|
+
blocks: [
|
|
124
|
+
{ type: 'feature', settings: { heading: 'Free delivery', text: 'On every order over 1,000 baht.' } },
|
|
125
|
+
{ type: 'feature', settings: { heading: 'Easy returns', text: 'Send it back within 30 days, no questions asked.' } },
|
|
126
|
+
{ type: 'feature', settings: { heading: 'Made to last', text: 'Good materials, checked by hand before they ship.' } },
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
component: ({ settings, blocks }) => (
|
|
131
|
+
<section className="st-features">
|
|
132
|
+
{settings.heading ? <h2 className="st-features__title">{settings.heading}</h2> : null}
|
|
133
|
+
<ul className={cx('st-features__list', `st-features__list--${settings.columns}`)}>
|
|
134
|
+
{blocks.map((b, i) => (
|
|
135
|
+
<Feature key={i} block={b} />
|
|
136
|
+
))}
|
|
137
|
+
</ul>
|
|
138
|
+
</section>
|
|
139
|
+
),
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
// ── testimonials: each quote is a block ─────────────────────────────────────────────────────────────────────────────
|
|
143
|
+
const quote = defineBlock({
|
|
144
|
+
type: 'testimonial',
|
|
145
|
+
title: 't:labels.testimonial',
|
|
146
|
+
settings: {
|
|
147
|
+
quote: field.textarea('The best thing I bought this year.', { label: 't:labels.quotation' }),
|
|
148
|
+
name: field.text('Somchai P.', { label: 't:labels.name' }),
|
|
149
|
+
detail: field.text('Bangkok', { label: 't:labels.detail', info: 't:descriptions.a_city_or_what_they_bought' }),
|
|
150
|
+
},
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
export const testimonials = defineSection({
|
|
154
|
+
type: 'testimonials',
|
|
155
|
+
title: 't:labels.testimonials',
|
|
156
|
+
description: 't:descriptions.what_customers_say_a_heading_and',
|
|
157
|
+
category: 'editorial',
|
|
158
|
+
settings: {
|
|
159
|
+
heading: field.text('What customers say', { label: 't:labels.heading' }),
|
|
160
|
+
},
|
|
161
|
+
blocks: [quote],
|
|
162
|
+
presets: [
|
|
163
|
+
{
|
|
164
|
+
name: 't:labels.testimonials',
|
|
165
|
+
settings: { heading: 'What customers say' },
|
|
166
|
+
blocks: [
|
|
167
|
+
{ type: 'testimonial', settings: { quote: 'The best thing I bought this year.', name: 'Somchai P.', detail: 'Bangkok' } },
|
|
168
|
+
{ type: 'testimonial', settings: { quote: 'Arrived in two days, packed with care.', name: 'Anna K.', detail: 'Chiang Mai' } },
|
|
169
|
+
{ type: 'testimonial', settings: { quote: 'I ordered a second one for my sister.', name: 'Nok S.', detail: 'Phuket' } },
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
component: ({ settings, blocks }) => (
|
|
174
|
+
<section className="st-quotes">
|
|
175
|
+
{settings.heading ? <h2 className="st-quotes__title">{settings.heading}</h2> : null}
|
|
176
|
+
<ul className="st-quotes__list">
|
|
177
|
+
{blocks.map((b, i) => {
|
|
178
|
+
const s = b.settings as { quote?: string; name?: string; detail?: string }
|
|
179
|
+
return (
|
|
180
|
+
<li key={i} className="st-quotes__item">
|
|
181
|
+
<figure className="st-quotes__figure">
|
|
182
|
+
<blockquote className="st-quotes__text">{s.quote}</blockquote>
|
|
183
|
+
<figcaption className="st-quotes__who">
|
|
184
|
+
{s.name}
|
|
185
|
+
{s.detail ? <span className="st-muted"> · {s.detail}</span> : null}
|
|
186
|
+
</figcaption>
|
|
187
|
+
</figure>
|
|
188
|
+
</li>
|
|
189
|
+
)
|
|
190
|
+
})}
|
|
191
|
+
</ul>
|
|
192
|
+
</section>
|
|
193
|
+
),
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
export const note = defineSection({
|
|
197
|
+
type: 'rich-text',
|
|
198
|
+
title: 't:labels.rich_text',
|
|
199
|
+
description: 't:descriptions.a_heading_and_a_paragraph_set',
|
|
200
|
+
category: 'editorial',
|
|
201
|
+
settings: {
|
|
202
|
+
heading: field.text('About us', { label: 't:labels.heading' }),
|
|
203
|
+
body: field.richtext('<p>Tell shoppers who you are and what you make.</p>', { label: 't:labels.text' }),
|
|
204
|
+
},
|
|
205
|
+
presets: [{ name: 't:labels.rich_text', settings: { heading: 'About us', body: '<p>Tell shoppers who you are and what you make.</p>' } }],
|
|
206
|
+
ai: ai.richText({ heading: 'heading', body: 'body' }),
|
|
207
|
+
component: ({ settings }) => (
|
|
208
|
+
<section className="st-note">
|
|
209
|
+
{settings.heading ? <h2 className="st-note__title">{settings.heading}</h2> : null}
|
|
210
|
+
{settings.body ? <div className="st-note__body" dangerouslySetInnerHTML={{ __html: settings.body }} /> : null}
|
|
211
|
+
</section>
|
|
212
|
+
),
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
export const letters = defineSection({
|
|
216
|
+
type: 'newsletter',
|
|
217
|
+
title: 't:labels.newsletter',
|
|
218
|
+
description: 't:descriptions.an_email_sign_up_for_the',
|
|
219
|
+
category: 'forms',
|
|
220
|
+
settings: {
|
|
221
|
+
heading: field.text('Stay in touch', { label: 't:labels.heading' }),
|
|
222
|
+
body: field.textarea('News and offers, now and then.', { label: 't:labels.text' }),
|
|
223
|
+
},
|
|
224
|
+
presets: [{ name: 't:labels.newsletter', settings: { heading: 'Stay in touch', body: 'News and offers, now and then.' } }],
|
|
225
|
+
component: ({ settings }) => (
|
|
226
|
+
<section className="st-letters">
|
|
227
|
+
{settings.heading ? <h2 className="st-letters__title">{settings.heading}</h2> : null}
|
|
228
|
+
{settings.body ? <p className="st-letters__body">{settings.body}</p> : null}
|
|
229
|
+
<NewsletterForm className="st-letters__form" inputClassName="st-input" buttonClassName="st-btn st-btn--solid" messageClassName="st-letters__msg" />
|
|
230
|
+
</section>
|
|
231
|
+
),
|
|
232
|
+
})
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The theme settings (the editor's Theme panel): the colours a merchant can change. Each one becomes a CSS variable on
|
|
3
|
+
* the page (theme.tsx themeVars), so a change in the editor recolours the whole theme. Replace with the
|
|
4
|
+
* theme's own, and keep every colour the design uses here, never only in theme.css.
|
|
5
|
+
*/
|
|
6
|
+
import { defineSettings } from '@tanqory/theme-kit/headless'
|
|
7
|
+
|
|
8
|
+
export const settings = defineSettings({
|
|
9
|
+
colorBackground: { type: 'color', label: 't:labels.background', group: 't:labels.colours', default: '#ffffff' },
|
|
10
|
+
colorText: { type: 'color', label: 't:labels.text', group: 't:labels.colours', default: '#1f2328' },
|
|
11
|
+
colorAccent: { type: 'color', label: 't:labels.buttons_and_links', group: 't:labels.colours', default: '#1f2328' },
|
|
12
|
+
})
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/* The partner starter: a plain light storefront that suggests no design. Every rule is the theme's;
|
|
2
|
+
the kit ships no CSS. Replace this file with the theme's own design. */
|
|
3
|
+
:root {
|
|
4
|
+
--st-ink: #1f2328;
|
|
5
|
+
--st-bg: #ffffff;
|
|
6
|
+
--st-accent: #1f2328;
|
|
7
|
+
/* derived from the merchant's three colours (src/settings.ts), so they follow every change */
|
|
8
|
+
--st-panel: color-mix(in srgb, var(--st-ink) 5%, var(--st-bg));
|
|
9
|
+
--st-muted: color-mix(in srgb, var(--st-ink) 68%, var(--st-bg));
|
|
10
|
+
--st-line: color-mix(in srgb, var(--st-ink) 18%, var(--st-bg));
|
|
11
|
+
--st-font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Thai', sans-serif;
|
|
12
|
+
--st-gutter: clamp(16px, 4vw, 32px);
|
|
13
|
+
}
|
|
14
|
+
* { box-sizing: border-box; }
|
|
15
|
+
html, body { margin: 0; background: var(--st-bg); }
|
|
16
|
+
body { color: var(--st-ink); font-family: var(--st-font); line-height: 1.6; -webkit-font-smoothing: antialiased; }
|
|
17
|
+
.st { min-height: 100vh; background: var(--st-bg); color: var(--st-ink); }
|
|
18
|
+
.tq-node { display: contents; }
|
|
19
|
+
.st a { color: var(--st-accent); }
|
|
20
|
+
.st :focus-visible { outline: 2px solid var(--st-accent); outline-offset: 3px; }
|
|
21
|
+
.st h1, .st h2, .st h3 { font-weight: 600; line-height: 1.2; margin: 0; }
|
|
22
|
+
.st-muted { color: var(--st-muted); }
|
|
23
|
+
.st-skip { position: absolute; left: -9999px; top: 8px; z-index: 50; padding: 12px 16px; background: var(--st-ink); color: var(--st-bg) !important; }
|
|
24
|
+
.st-skip:focus { left: 8px; }
|
|
25
|
+
main#main:focus { outline: none; }
|
|
26
|
+
|
|
27
|
+
/* ── buttons, inputs ─────────────────────────────────────────────────────── */
|
|
28
|
+
.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 28px; border: 1px solid var(--st-accent); background: transparent; color: var(--st-accent); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
|
|
29
|
+
.st-btn:hover { background: color-mix(in srgb, var(--st-accent) 12%, transparent); }
|
|
30
|
+
.st-btn--solid, .st a.st-btn--solid { background: var(--st-accent); color: var(--st-bg); }
|
|
31
|
+
.st-btn--solid:hover { background: color-mix(in srgb, var(--st-accent) 85%, var(--st-ink)); }
|
|
32
|
+
.st-btn[disabled], .st-btn[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; }
|
|
33
|
+
.st-link { min-height: 44px; min-width: 44px; padding: 10px 4px; background: none; border: 0; color: var(--st-muted); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
|
|
34
|
+
.st-input { min-height: 48px; padding: 10px 14px; background: transparent; border: 0; border-bottom: 1px solid var(--st-muted); color: var(--st-ink); font: inherit; }
|
|
35
|
+
.st-input--qty { width: 72px; text-align: center; border: 1px solid var(--st-line); }
|
|
36
|
+
.st-label { display: block; margin-bottom: 8px; color: var(--st-muted); font-size: 12px; }
|
|
37
|
+
.st select { min-height: 44px; padding: 8px 12px; background: var(--st-bg); color: var(--st-ink); border: 1px solid var(--st-line); font: inherit; }
|
|
38
|
+
|
|
39
|
+
/* ── masthead ────────────────────────────────────────────────────────────── */
|
|
40
|
+
.st-mast { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 32px; padding: 16px var(--st-gutter); border-bottom: 1px solid var(--st-line); }
|
|
41
|
+
.st-mast__brand { display: inline-flex; align-items: center; min-height: 44px; color: var(--st-accent); font-size: 24px; font-style: italic; text-decoration: none; }
|
|
42
|
+
.st-mast__logo { max-height: 40px; width: auto; height: auto; }
|
|
43
|
+
.st-mast__tagline { grid-column: 1 / -1; order: -1; margin: 0; color: var(--st-muted); font-size: 12px; text-align: center; }
|
|
44
|
+
.st-mast__menu { display: none; }
|
|
45
|
+
.st-mast__nav ul { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; margin: 0; padding: 0; }
|
|
46
|
+
.st .st-mast__nav a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--st-ink); font-size: 13px; text-decoration: none; }
|
|
47
|
+
.st-mast__nav a:hover, .st-mast__nav a[aria-current='page'] { color: var(--st-accent); }
|
|
48
|
+
.st-mast__tools { display: flex; align-items: center; gap: 16px; }
|
|
49
|
+
.st-mast__cart { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--st-accent); font-size: 13px; text-decoration: none; }
|
|
50
|
+
.st-find { position: relative; }
|
|
51
|
+
.st-find__input { width: 180px; min-height: 44px; padding: 8px 4px; background: transparent; border: 0; border-bottom: 1px solid var(--st-muted); color: var(--st-ink); font: inherit; }
|
|
52
|
+
.st-find__input::placeholder { color: var(--st-muted); }
|
|
53
|
+
.st-find__results:not(:empty) { position: absolute; z-index: 30; top: 100%; right: 0; width: min(340px, 90vw); margin-top: 8px; padding: 8px 0; background: var(--st-panel); border: 1px solid var(--st-line); }
|
|
54
|
+
.st-find__results ul { list-style: none; margin: 0; padding: 0; }
|
|
55
|
+
.st .st-find__results a { display: flex; justify-content: space-between; gap: 12px; min-height: 44px; align-items: center; padding: 8px 16px; color: var(--st-ink); text-decoration: none; }
|
|
56
|
+
.st-find__results a:hover { background: var(--st-bg); color: var(--st-accent); }
|
|
57
|
+
.st-find--page .st-find__input { width: min(100%, 520px); font-size: 22px; }
|
|
58
|
+
.st-locale { display: flex; gap: 8px; }
|
|
59
|
+
.st-locale__select { max-width: 240px; font-size: 13px; }
|
|
60
|
+
|
|
61
|
+
/* ── hero ────────────────────────────────────────────────────────────────── */
|
|
62
|
+
.st-hero { position: relative; display: grid; place-items: center; min-height: 460px; padding: 120px var(--st-gutter); text-align: center; background: var(--st-panel); overflow: hidden; }
|
|
63
|
+
.st-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.35; }
|
|
64
|
+
.st-hero__copy { position: relative; max-width: 880px; }
|
|
65
|
+
.st-hero__kicker { margin: 0 0 24px; color: var(--st-accent); font-size: 14px; }
|
|
66
|
+
.st-hero__title { font-size: clamp(44px, 9vw, 104px); }
|
|
67
|
+
.st-hero__body { margin: 24px auto 0; max-width: 560px; color: var(--st-muted); font-size: 18px; }
|
|
68
|
+
.st-hero .st-btn { margin-top: 40px; }
|
|
69
|
+
|
|
70
|
+
/* ── shelves & cards ─────────────────────────────────────────────────────── */
|
|
71
|
+
.st-shelf, .st-note, .st-letters, .st-results, .st-cart, .st-page, .st-journal, .st-story, .st-lost, .st-account, .st-contact { padding: 64px var(--st-gutter); }
|
|
72
|
+
.st-shelf--empty { padding: 0; }
|
|
73
|
+
.st-shelf__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
|
|
74
|
+
.st-shelf__title, .st-results__title, .st-cart__title, .st-note__title, .st-letters__title, .st-contact__title { font-size: clamp(28px, 4vw, 40px); }
|
|
75
|
+
.st-shelf__all { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; }
|
|
76
|
+
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 40px 28px; list-style: none; margin: 0; padding: 0; }
|
|
77
|
+
.st-grid[aria-busy='true'] { opacity: 0.55; transition: opacity 0.2s; }
|
|
78
|
+
.st .st-card__link { display: flex; flex-direction: column; gap: 10px; color: var(--st-ink); text-decoration: none; }
|
|
79
|
+
.st-card__frame { display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--st-panel); }
|
|
80
|
+
.st-card__img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
|
|
81
|
+
.st-card__link:hover .st-card__img { transform: scale(1.03); }
|
|
82
|
+
.st-card__title { font-size: 18px; }
|
|
83
|
+
.st-card__price { color: var(--st-muted); font-size: 15px; }
|
|
84
|
+
.st-card__flag { color: var(--st-accent); }
|
|
85
|
+
|
|
86
|
+
/* ── features, testimonials (blocks) ─────────────────────────────────────── */
|
|
87
|
+
.st-features, .st-quotes { padding: 64px var(--st-gutter); }
|
|
88
|
+
.st-features__title, .st-quotes__title { margin-bottom: 32px; font-size: clamp(28px, 4vw, 40px); }
|
|
89
|
+
.st-features__list, .st-quotes__list { display: grid; gap: 32px; list-style: none; margin: 0; padding: 0; }
|
|
90
|
+
.st-features__list--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
|
|
91
|
+
.st-features__list--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
|
|
92
|
+
.st-features__list--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
|
|
93
|
+
.st-features__item { display: flex; flex-direction: column; gap: 10px; }
|
|
94
|
+
.st-features__img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--st-panel); }
|
|
95
|
+
.st-features__name { font-size: 20px; }
|
|
96
|
+
.st-features__text { margin: 0; color: var(--st-muted); }
|
|
97
|
+
.st-features__link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
|
|
98
|
+
.st-quotes { background: var(--st-panel); }
|
|
99
|
+
.st-quotes__list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
|
|
100
|
+
.st-quotes__figure { margin: 0; display: flex; flex-direction: column; gap: 16px; }
|
|
101
|
+
.st-quotes__text { margin: 0; font-size: 20px; line-height: 1.45; }
|
|
102
|
+
.st-quotes__who { font-size: 14px; }
|
|
103
|
+
|
|
104
|
+
/* ── note, letters ───────────────────────────────────────────────────────── */
|
|
105
|
+
.st-note { max-width: 760px; margin: 0 auto; text-align: center; }
|
|
106
|
+
.st-note__body { margin-top: 20px; color: var(--st-muted); font-size: 19px; }
|
|
107
|
+
.st-letters { display: grid; justify-items: center; gap: 16px; text-align: center; border-top: 1px solid var(--st-line); }
|
|
108
|
+
.st-letters__body { margin: 0; color: var(--st-muted); }
|
|
109
|
+
.st-letters__form { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: min(100%, 520px); }
|
|
110
|
+
.st-letters__form .st-input { flex: 1 1 240px; }
|
|
111
|
+
.st-letters__msg, .st-form__msg { flex-basis: 100%; margin: 0; color: var(--st-accent); }
|
|
112
|
+
|
|
113
|
+
/* ── product page ────────────────────────────────────────────────────────── */
|
|
114
|
+
.st-pdp { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; padding: 48px var(--st-gutter); }
|
|
115
|
+
.st-pdp__img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--st-panel); }
|
|
116
|
+
.st-pdp__info { display: flex; flex-direction: column; gap: 20px; padding-top: 24px; }
|
|
117
|
+
.st-pdp__vendor { margin: 0; color: var(--st-accent); font-size: 13px; }
|
|
118
|
+
.st-pdp__title { font-size: clamp(32px, 4.5vw, 52px); }
|
|
119
|
+
.st-pdp__price { font-size: 22px; }
|
|
120
|
+
.st-pdp__was { margin-right: 10px; color: var(--st-muted); }
|
|
121
|
+
.st-pdp__options { display: grid; gap: 16px; }
|
|
122
|
+
.st-opt { margin: 0; padding: 0; border: 0; }
|
|
123
|
+
.st-opt__legend { margin-bottom: 10px; padding: 0; color: var(--st-muted); font-size: 12px; }
|
|
124
|
+
.st-chip { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: 0 8px 8px 0; padding: 8px 18px; border: 1px solid var(--st-line); cursor: pointer; }
|
|
125
|
+
.st-chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
|
|
126
|
+
.st-chip[data-selected='true'] { border-color: var(--st-accent); color: var(--st-accent); }
|
|
127
|
+
.st-chip[data-available='false'] span { text-decoration: line-through; text-decoration-color: var(--st-muted); }
|
|
128
|
+
.st-chip:has(input:focus-visible) { outline: 2px solid var(--st-accent); outline-offset: 3px; }
|
|
129
|
+
.st-pdp__stock { margin: 0; color: var(--st-muted); font-size: 15px; }
|
|
130
|
+
.st-pdp__buy { display: flex; gap: 12px; }
|
|
131
|
+
.st-pdp__add { flex: 1; }
|
|
132
|
+
.st-pdp__desc { color: var(--st-muted); border-top: 1px solid var(--st-line); padding-top: 20px; }
|
|
133
|
+
|
|
134
|
+
/* ── collection ──────────────────────────────────────────────────────────── */
|
|
135
|
+
.st-plp { padding: 56px var(--st-gutter); }
|
|
136
|
+
.st-plp__head { margin-bottom: 40px; }
|
|
137
|
+
.st-plp__kicker { margin: 0 0 12px; color: var(--st-accent); font-size: 13px; }
|
|
138
|
+
.st-plp__title { font-size: clamp(40px, 7vw, 80px); }
|
|
139
|
+
.st-plp__desc { max-width: 620px; color: var(--st-muted); font-size: 18px; }
|
|
140
|
+
.st-plp__count { color: var(--st-muted); font-size: 14px; }
|
|
141
|
+
.st-plp__body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; }
|
|
142
|
+
.st-plp__filters { display: grid; align-content: start; gap: 28px; }
|
|
143
|
+
.st-facets { display: grid; gap: 24px; }
|
|
144
|
+
.st-facet { margin: 0; padding: 0; border: 0; }
|
|
145
|
+
.st-facet legend { margin-bottom: 10px; padding: 0; }
|
|
146
|
+
.st-check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
|
|
147
|
+
.st-check input { width: 20px; height: 20px; accent-color: var(--st-accent); }
|
|
148
|
+
.st-check[data-active='true'] { color: var(--st-accent); }
|
|
149
|
+
.st-facet input[type='number'] { width: 100%; min-height: 44px; margin: 4px 0 10px; padding: 6px 10px; background: transparent; border: 1px solid var(--st-line); color: var(--st-ink); font: inherit; }
|
|
150
|
+
.st-pages { display: flex; justify-content: center; gap: 12px; margin-top: 48px; }
|
|
151
|
+
|
|
152
|
+
/* ── search, cart ────────────────────────────────────────────────────────── */
|
|
153
|
+
.st-results__count { color: var(--st-muted); }
|
|
154
|
+
.st-results .st-find { display: flex; gap: 12px; margin: 24px 0; }
|
|
155
|
+
.st-cart__empty { display: grid; justify-items: start; gap: 16px; }
|
|
156
|
+
.st-lines { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--st-line); }
|
|
157
|
+
.st-line { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto auto; align-items: center; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--st-line); }
|
|
158
|
+
.st-line[data-busy='true'] { opacity: 0.6; }
|
|
159
|
+
.st-line__img { display: block; width: 96px; height: auto; aspect-ratio: 3 / 4; object-fit: cover; background: var(--st-panel); }
|
|
160
|
+
.st-line__info p { margin: 4px 0 0; }
|
|
161
|
+
.st .st-line__title { display: inline-flex; align-items: center; min-height: 44px; color: var(--st-ink); font-size: 18px; text-decoration: none; }
|
|
162
|
+
.st-line__qty { display: flex; align-items: center; gap: 6px; }
|
|
163
|
+
.st-step { min-width: 44px; min-height: 44px; background: transparent; border: 1px solid var(--st-line); color: var(--st-ink); font: inherit; font-size: 18px; cursor: pointer; }
|
|
164
|
+
.st-line__total { margin: 0; min-width: 96px; text-align: right; }
|
|
165
|
+
.st-cart__summary { display: grid; justify-items: end; gap: 10px; margin-top: 28px; }
|
|
166
|
+
.st-cart__row { display: flex; gap: 32px; margin: 0; }
|
|
167
|
+
.st-cart__row--total { font-size: 22px; }
|
|
168
|
+
.st-cart__checkout { min-width: 280px; }
|
|
169
|
+
|
|
170
|
+
/* ── drawer ──────────────────────────────────────────────────────────────── */
|
|
171
|
+
.st-drawer__backdrop { position: fixed; inset: 0; z-index: 40; background: rgb(5 6 12 / 0.7); }
|
|
172
|
+
.st-drawer { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 16px; width: min(420px, 100vw); padding: 28px; overflow-y: auto; background: var(--st-panel); border-left: 1px solid var(--st-line); }
|
|
173
|
+
.st-drawer:focus { outline: none; }
|
|
174
|
+
.st-drawer__head { display: flex; align-items: center; justify-content: space-between; }
|
|
175
|
+
.st-drawer__title { font-size: 26px; }
|
|
176
|
+
.st-drawer__close { min-height: 44px; min-width: 44px; padding: 0 8px; background: none; border: 0; color: var(--st-accent); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
|
|
177
|
+
.st-drawer__lines { list-style: none; margin: 0; padding: 0; }
|
|
178
|
+
.st-drawer__line { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--st-line); }
|
|
179
|
+
.st-drawer__line p { margin: 0; }
|
|
180
|
+
.st-drawer__img { display: block; width: 64px; height: auto; aspect-ratio: 3 / 4; object-fit: cover; background: var(--st-bg); }
|
|
181
|
+
.st-drawer__total { display: flex; justify-content: space-between; margin: 8px 0; font-size: 18px; }
|
|
182
|
+
|
|
183
|
+
/* ── content ─────────────────────────────────────────────────────────────── */
|
|
184
|
+
.st-page, .st-story { max-width: 760px; margin: 0 auto; }
|
|
185
|
+
.st-page__title, .st-story__title, .st-journal__title, .st-lost__title, .st-account__title { font-size: clamp(36px, 6vw, 64px); margin-bottom: 28px; }
|
|
186
|
+
.st-prose { color: var(--st-muted); font-size: 18px; }
|
|
187
|
+
.st-story__back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 16px; font-size: 13px; }
|
|
188
|
+
.st-journal__list { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--st-line); }
|
|
189
|
+
.st .st-journal__link { display: grid; gap: 6px; padding: 24px 0; border-bottom: 1px solid var(--st-line); color: var(--st-ink); text-decoration: none; }
|
|
190
|
+
.st-journal__name { font-size: 26px; }
|
|
191
|
+
.st-journal__excerpt { color: var(--st-muted); }
|
|
192
|
+
.st-journal__more { color: var(--st-accent); font-size: 13px; }
|
|
193
|
+
.st-lost { display: grid; justify-items: center; gap: 12px; min-height: 50vh; align-content: center; text-align: center; }
|
|
194
|
+
.st-account__frame { display: block; width: 100%; min-height: 640px; border: 1px solid var(--st-line); }
|
|
195
|
+
.st-form { display: grid; gap: 8px; max-width: 560px; }
|
|
196
|
+
.st-form .st-input { width: 100%; margin-bottom: 12px; border: 1px solid var(--st-line); }
|
|
197
|
+
.st-form textarea.st-input { min-height: 140px; }
|
|
198
|
+
|
|
199
|
+
/* ── colophon ────────────────────────────────────────────────────────────── */
|
|
200
|
+
.st-foot { padding: 56px var(--st-gutter) 40px; border-top: 1px solid var(--st-line); color: var(--st-muted); }
|
|
201
|
+
.st-foot__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px; }
|
|
202
|
+
.st-foot__name { margin: 0 0 8px; color: var(--st-ink); font-size: 24px; font-style: italic; }
|
|
203
|
+
.st-foot__tagline { margin: 0; max-width: 320px; }
|
|
204
|
+
.st-foot__heading { margin-bottom: 12px; color: var(--st-ink); font-size: 13px; }
|
|
205
|
+
.st-foot ul { list-style: none; margin: 0; padding: 0; }
|
|
206
|
+
.st .st-foot li a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--st-muted); text-decoration: none; }
|
|
207
|
+
.st-foot li a:hover { color: var(--st-accent); }
|
|
208
|
+
.st-foot__legal { margin: 48px 0 0; font-size: 13px; }
|
|
209
|
+
|
|
210
|
+
/* ── consent ─────────────────────────────────────────────────────────────── */
|
|
211
|
+
.st-consent { position: fixed; z-index: 35; left: 16px; right: 16px; bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; max-width: 760px; margin: 0 auto; padding: 20px 24px; background: var(--st-panel); border: 1px solid var(--st-line); }
|
|
212
|
+
.st-consent p { flex: 1 1 320px; margin: 0; color: var(--st-muted); }
|
|
213
|
+
.st-consent strong { color: var(--st-ink); font-weight: 400; font-style: italic; }
|
|
214
|
+
|
|
215
|
+
/* ── small screens ───────────────────────────────────────────────────────── */
|
|
216
|
+
@media (max-width: 900px) {
|
|
217
|
+
/* brand · cart · menu on one line; the menu opens the links, search and region below it */
|
|
218
|
+
.st-mast { grid-template-columns: 1fr auto auto; gap: 8px 12px; }
|
|
219
|
+
.st-mast__brand { font-size: 21px; }
|
|
220
|
+
.st-mast__menu { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 12px; background: none; border: 1px solid var(--st-line); color: var(--st-ink); font: inherit; font-size: 13px; cursor: pointer; }
|
|
221
|
+
.st-mast__nav { display: none; grid-column: 1 / -1; order: 5; }
|
|
222
|
+
.st-mast__nav.is-open { display: block; }
|
|
223
|
+
.st-mast__nav ul { flex-direction: column; }
|
|
224
|
+
.st-mast__tools { display: contents; }
|
|
225
|
+
.st-mast__cart { grid-row: 1; grid-column: 2; }
|
|
226
|
+
.st-mast__menu { grid-row: 1; grid-column: 3; }
|
|
227
|
+
.st-find, .st-locale { display: none; grid-column: 1 / -1; order: 6; }
|
|
228
|
+
.st-mast__nav.is-open ~ .st-mast__tools .st-find, .st-mast__nav.is-open ~ .st-mast__tools .st-locale { display: flex; }
|
|
229
|
+
.st-find__input { width: 100%; }
|
|
230
|
+
.st-locale { flex-wrap: wrap; }
|
|
231
|
+
.st-pdp { grid-template-columns: 1fr; gap: 24px; }
|
|
232
|
+
.st-plp__body { grid-template-columns: 1fr; }
|
|
233
|
+
.st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
|
|
234
|
+
.st-line { grid-template-columns: 72px 1fr; }
|
|
235
|
+
.st-line__img { width: 72px; }
|
|
236
|
+
.st-line__qty, .st-line__total { grid-column: 2; }
|
|
237
|
+
.st-line__total { text-align: left; }
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/* every standalone link is at least a 44 × 44 touch target */
|
|
241
|
+
.st-mast__brand, .st-mast__cart, .st-shelf__all, .st-story__back, .st-line__title { min-width: 44px; }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Template name → the route kind it renders (templates/<name>.json holds its starter content). */
|
|
2
|
+
export const TEMPLATES = {
|
|
3
|
+
index: { route: 'home', title: 'Home' },
|
|
4
|
+
product: { route: 'product' },
|
|
5
|
+
collection: { route: 'collection' },
|
|
6
|
+
search: { route: 'search' },
|
|
7
|
+
cart: { route: 'cart' },
|
|
8
|
+
page: { route: 'page' },
|
|
9
|
+
'page.contact': { route: 'page', title: 'Contact' },
|
|
10
|
+
blog: { route: 'blog' },
|
|
11
|
+
article: { route: 'article' },
|
|
12
|
+
account: { route: 'customer' },
|
|
13
|
+
'404': { route: 'not_found' },
|
|
14
|
+
} as const
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The partner starter: a plain theme on @tanqory/theme-kit/headless. Every line of markup and CSS is the theme's own;
|
|
3
|
+
* every storefront function (cart, consent, money, translations, images) comes from the kit. Replace all of it.
|
|
4
|
+
*/
|
|
5
|
+
import type { ReactNode } from 'react'
|
|
6
|
+
import { CartDrawer, CartLine, CartLineRemove, CheckoutButton, ConsentBanner, Image, SkipLink, defineTheme, formatMoney, sx, useSettings, useTranslate } from '@tanqory/theme-kit/headless'
|
|
7
|
+
import { cx } from './components/parts'
|
|
8
|
+
import { footer, header } from './sections/chrome'
|
|
9
|
+
import { featuredCollection, features, hero, letters, note, testimonials } from './sections/editorial'
|
|
10
|
+
import { account, cart, collection, product, recommendations, search } from './sections/commerce'
|
|
11
|
+
import { article, blog, contact, notFound, page } from './sections/content'
|
|
12
|
+
|
|
13
|
+
function Drawer(): JSX.Element {
|
|
14
|
+
const t = useTranslate()
|
|
15
|
+
return (
|
|
16
|
+
<CartDrawer className="st-drawer" backdropClassName="st-drawer__backdrop">
|
|
17
|
+
{(c) => (
|
|
18
|
+
<>
|
|
19
|
+
<div className="st-drawer__head">
|
|
20
|
+
<h2 className="st-drawer__title">{t('cart.title')}</h2>
|
|
21
|
+
<button type="button" className="st-drawer__close" onClick={c.close}>
|
|
22
|
+
{t('cart.close')}
|
|
23
|
+
</button>
|
|
24
|
+
</div>
|
|
25
|
+
{c.lines.length === 0 ? (
|
|
26
|
+
<p className="st-muted">{t('cart.empty')}</p>
|
|
27
|
+
) : (
|
|
28
|
+
<>
|
|
29
|
+
<ul className="st-drawer__lines">
|
|
30
|
+
{c.lines.map((line) => (
|
|
31
|
+
<CartLine key={line.id} line={line} className="st-drawer__line">
|
|
32
|
+
<Image image={line.variant.image} alt="" className="st-drawer__img" fallback={<span className="st-drawer__img st-drawer__img--empty" />} />
|
|
33
|
+
<div>
|
|
34
|
+
<p className="st-drawer__name">{line.product.title}</p>
|
|
35
|
+
<p className="st-muted">
|
|
36
|
+
{line.variant.title !== 'Default Title' ? `${line.variant.title} · ` : ''}
|
|
37
|
+
{t('starter.drawer.qty', { count: line.quantity })}
|
|
38
|
+
</p>
|
|
39
|
+
<p>{formatMoney(line.cost.total)}</p>
|
|
40
|
+
</div>
|
|
41
|
+
<CartLineRemove className="st-link" />
|
|
42
|
+
</CartLine>
|
|
43
|
+
))}
|
|
44
|
+
</ul>
|
|
45
|
+
<p className="st-drawer__total">
|
|
46
|
+
<span>{t('cart.subtotal')}</span> <span>{formatMoney(c.subtotal)}</span>
|
|
47
|
+
</p>
|
|
48
|
+
<CheckoutButton className="st-btn st-btn--solid" />
|
|
49
|
+
<a className="st-btn" href="/cart">
|
|
50
|
+
{t('starter.cart.view')}
|
|
51
|
+
</a>
|
|
52
|
+
</>
|
|
53
|
+
)}
|
|
54
|
+
</>
|
|
55
|
+
)}
|
|
56
|
+
</CartDrawer>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The merchant's colours (the editor's Theme panel, src/settings.ts) become CSS variables on the page's root, as a class:
|
|
62
|
+
* the storefront CSP forbids style attributes, so sx() turns them into a rule. Every colour in theme.css reads them.
|
|
63
|
+
*/
|
|
64
|
+
function themeVars(settings: Readonly<Record<string, unknown>>): string | undefined {
|
|
65
|
+
const color = (key: string): string | undefined => (typeof settings[key] === 'string' && /^#[0-9a-f]{6}$/i.test(settings[key] as string) ? (settings[key] as string) : undefined)
|
|
66
|
+
const vars = { '--st-bg': color('colorBackground'), '--st-ink': color('colorText'), '--st-accent': color('colorAccent') }
|
|
67
|
+
return sx(Object.fromEntries(Object.entries(vars).filter(([, v]) => v)))
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function Layout({ children }: { children: ReactNode }): JSX.Element {
|
|
71
|
+
const settings = useSettings()
|
|
72
|
+
return (
|
|
73
|
+
<div className={cx('st', themeVars(settings))}>
|
|
74
|
+
<SkipLink className="st-skip" />
|
|
75
|
+
{children}
|
|
76
|
+
<Drawer />
|
|
77
|
+
<ConsentBanner className="st-consent" buttonClassName="st-btn" acceptClassName="st-btn--solid" />
|
|
78
|
+
</div>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export default defineTheme({
|
|
83
|
+
name: 'Partner starter',
|
|
84
|
+
sections: [header, hero, featuredCollection, features, testimonials, note, letters, product, recommendations, collection, search, cart, page, contact, blog, article, account, notFound, footer],
|
|
85
|
+
Layout,
|
|
86
|
+
})
|