@tanqory/partner-cli 0.0.0-stage → 0.1.0-alpha.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/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 +63 -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 +1617 -0
- package/package.json +59 -4
- package/starter/LICENSE +18 -0
- package/starter/README.md +38 -0
- package/starter/config/settings.json +3 -0
- package/starter/gitignore +3 -0
- package/starter/locales/en.json +22 -0
- package/starter/locales/th.json +22 -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 +195 -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 +111 -0
- package/starter/src/sections/editorial.tsx +107 -0
- package/starter/src/settings.ts +15 -0
- package/starter/src/styles/theme.css +224 -0
- package/starter/src/templates.ts +14 -0
- package/starter/src/theme.tsx +76 -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 +36 -0
- package/starter/templates/page.contact.json +18 -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,224 @@
|
|
|
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-panel: #f5f5f4;
|
|
7
|
+
--st-accent: #1f2328;
|
|
8
|
+
--st-muted: #57606a;
|
|
9
|
+
--st-line: #d0d7de;
|
|
10
|
+
--st-font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Thai', sans-serif;
|
|
11
|
+
--st-gutter: clamp(16px, 4vw, 32px);
|
|
12
|
+
}
|
|
13
|
+
* { box-sizing: border-box; }
|
|
14
|
+
html, body { margin: 0; background: var(--st-bg); }
|
|
15
|
+
body { color: var(--st-ink); font-family: var(--st-font); line-height: 1.6; -webkit-font-smoothing: antialiased; }
|
|
16
|
+
body:has(.st--dark) { background: #111315; }
|
|
17
|
+
.st { min-height: 100vh; background: var(--st-bg); color: var(--st-ink); }
|
|
18
|
+
.st--dark { --st-ink: #f2f2f2; --st-bg: #111315; --st-panel: #1b1e21; --st-accent: #f2f2f2; --st-muted: #a8b0b8; --st-line: #30363d; }
|
|
19
|
+
.tq-node { display: contents; }
|
|
20
|
+
.st a { color: var(--st-accent); }
|
|
21
|
+
.st :focus-visible { outline: 2px solid var(--st-accent); outline-offset: 3px; }
|
|
22
|
+
.st h1, .st h2, .st h3 { font-weight: 600; line-height: 1.2; margin: 0; }
|
|
23
|
+
.st-muted { color: var(--st-muted); }
|
|
24
|
+
.st-skip { position: absolute; left: -9999px; top: 8px; z-index: 50; padding: 12px 16px; background: var(--st-ink); color: var(--st-bg) !important; }
|
|
25
|
+
.st-skip:focus { left: 8px; }
|
|
26
|
+
main#main:focus { outline: none; }
|
|
27
|
+
|
|
28
|
+
/* ── buttons, inputs ─────────────────────────────────────────────────────── */
|
|
29
|
+
.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; }
|
|
30
|
+
.st-btn:hover { background: color-mix(in srgb, var(--st-accent) 12%, transparent); }
|
|
31
|
+
.st-btn--solid, .st a.st-btn--solid { background: var(--st-accent); color: var(--st-bg); }
|
|
32
|
+
.st-btn--solid:hover { background: color-mix(in srgb, var(--st-accent) 85%, var(--st-ink)); }
|
|
33
|
+
.st-btn[disabled], .st-btn[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; }
|
|
34
|
+
.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; }
|
|
35
|
+
.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; }
|
|
36
|
+
.st-input--qty { width: 72px; text-align: center; border: 1px solid var(--st-line); }
|
|
37
|
+
.st-label { display: block; margin-bottom: 8px; color: var(--st-muted); font-size: 12px; }
|
|
38
|
+
.st select { min-height: 44px; padding: 8px 12px; background: var(--st-bg); color: var(--st-ink); border: 1px solid var(--st-line); font: inherit; }
|
|
39
|
+
|
|
40
|
+
/* ── masthead ────────────────────────────────────────────────────────────── */
|
|
41
|
+
.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); }
|
|
42
|
+
.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; }
|
|
43
|
+
.st-mast__logo { max-height: 40px; width: auto; height: auto; }
|
|
44
|
+
.st-mast__tagline { display: none; }
|
|
45
|
+
.st-mast__menu { display: none; }
|
|
46
|
+
.st-mast__nav ul { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; margin: 0; padding: 0; }
|
|
47
|
+
.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; }
|
|
48
|
+
.st-mast__nav a:hover, .st-mast__nav a[aria-current='page'] { color: var(--st-accent); }
|
|
49
|
+
.st-mast__tools { display: flex; align-items: center; gap: 16px; }
|
|
50
|
+
.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; }
|
|
51
|
+
.st-find { position: relative; }
|
|
52
|
+
.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; }
|
|
53
|
+
.st-find__input::placeholder { color: var(--st-muted); }
|
|
54
|
+
.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); }
|
|
55
|
+
.st-find__results ul { list-style: none; margin: 0; padding: 0; }
|
|
56
|
+
.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; }
|
|
57
|
+
.st-find__results a:hover { background: var(--st-bg); color: var(--st-accent); }
|
|
58
|
+
.st-find--page .st-find__input { width: min(100%, 520px); font-size: 22px; }
|
|
59
|
+
.st-locale { display: flex; gap: 8px; }
|
|
60
|
+
.st-locale__select { max-width: 240px; font-size: 13px; }
|
|
61
|
+
|
|
62
|
+
/* ── hero ────────────────────────────────────────────────────────────────── */
|
|
63
|
+
.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; }
|
|
64
|
+
.st-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.35; }
|
|
65
|
+
.st-hero__copy { position: relative; max-width: 880px; }
|
|
66
|
+
.st-hero__kicker { margin: 0 0 24px; color: var(--st-accent); font-size: 14px; }
|
|
67
|
+
.st-hero__title { font-size: clamp(44px, 9vw, 104px); }
|
|
68
|
+
.st-hero__body { margin: 24px auto 0; max-width: 560px; color: var(--st-muted); font-size: 18px; }
|
|
69
|
+
.st-hero .st-btn { margin-top: 40px; }
|
|
70
|
+
|
|
71
|
+
/* ── shelves & cards ─────────────────────────────────────────────────────── */
|
|
72
|
+
.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); }
|
|
73
|
+
.st-shelf--empty { padding: 0; }
|
|
74
|
+
.st-shelf__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
|
|
75
|
+
.st-shelf__title, .st-results__title, .st-cart__title, .st-note__title, .st-letters__title, .st-contact__title { font-size: clamp(28px, 4vw, 40px); }
|
|
76
|
+
.st-shelf__all { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; }
|
|
77
|
+
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 40px 28px; list-style: none; margin: 0; padding: 0; }
|
|
78
|
+
.st-grid[aria-busy='true'] { opacity: 0.55; transition: opacity 0.2s; }
|
|
79
|
+
.st .st-card__link { display: flex; flex-direction: column; gap: 10px; color: var(--st-ink); text-decoration: none; }
|
|
80
|
+
.st-card__frame { display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--st-panel); }
|
|
81
|
+
.st-card__img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
|
|
82
|
+
.st-card__link:hover .st-card__img { transform: scale(1.03); }
|
|
83
|
+
.st-card__title { font-size: 18px; }
|
|
84
|
+
.st-card__price { color: var(--st-muted); font-size: 15px; }
|
|
85
|
+
.st-card__flag { color: var(--st-accent); }
|
|
86
|
+
|
|
87
|
+
/* ── note, letters ───────────────────────────────────────────────────────── */
|
|
88
|
+
.st-note { max-width: 760px; margin: 0 auto; text-align: center; }
|
|
89
|
+
.st-note__body { margin-top: 20px; color: var(--st-muted); font-size: 19px; }
|
|
90
|
+
.st-letters { display: grid; justify-items: center; gap: 16px; text-align: center; border-top: 1px solid var(--st-line); }
|
|
91
|
+
.st-letters__body { margin: 0; color: var(--st-muted); }
|
|
92
|
+
.st-letters__form { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: min(100%, 520px); }
|
|
93
|
+
.st-letters__form .st-input { flex: 1 1 240px; }
|
|
94
|
+
.st-letters__msg, .st-form__msg { flex-basis: 100%; margin: 0; color: var(--st-accent); }
|
|
95
|
+
|
|
96
|
+
/* ── product page ────────────────────────────────────────────────────────── */
|
|
97
|
+
.st-pdp { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; padding: 48px var(--st-gutter); }
|
|
98
|
+
.st-pdp__img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--st-panel); }
|
|
99
|
+
.st-pdp__info { display: flex; flex-direction: column; gap: 20px; padding-top: 24px; }
|
|
100
|
+
.st-pdp__vendor { margin: 0; color: var(--st-accent); font-size: 13px; }
|
|
101
|
+
.st-pdp__title { font-size: clamp(32px, 4.5vw, 52px); }
|
|
102
|
+
.st-pdp__price { font-size: 22px; }
|
|
103
|
+
.st-pdp__was { margin-right: 10px; color: var(--st-muted); }
|
|
104
|
+
.st-pdp__options { display: grid; gap: 16px; }
|
|
105
|
+
.st-opt { margin: 0; padding: 0; border: 0; }
|
|
106
|
+
.st-opt__legend { margin-bottom: 10px; padding: 0; color: var(--st-muted); font-size: 12px; }
|
|
107
|
+
.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; }
|
|
108
|
+
.st-chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
|
|
109
|
+
.st-chip[data-selected='true'] { border-color: var(--st-accent); color: var(--st-accent); }
|
|
110
|
+
.st-chip[data-available='false'] span { text-decoration: line-through; text-decoration-color: var(--st-muted); }
|
|
111
|
+
.st-chip:has(input:focus-visible) { outline: 2px solid var(--st-accent); outline-offset: 3px; }
|
|
112
|
+
.st-pdp__stock { margin: 0; color: var(--st-muted); font-size: 15px; }
|
|
113
|
+
.st-pdp__buy { display: flex; gap: 12px; }
|
|
114
|
+
.st-pdp__add { flex: 1; }
|
|
115
|
+
.st-pdp__desc { color: var(--st-muted); border-top: 1px solid var(--st-line); padding-top: 20px; }
|
|
116
|
+
|
|
117
|
+
/* ── collection ──────────────────────────────────────────────────────────── */
|
|
118
|
+
.st-plp { padding: 56px var(--st-gutter); }
|
|
119
|
+
.st-plp__head { margin-bottom: 40px; }
|
|
120
|
+
.st-plp__kicker { margin: 0 0 12px; color: var(--st-accent); font-size: 13px; }
|
|
121
|
+
.st-plp__title { font-size: clamp(40px, 7vw, 80px); }
|
|
122
|
+
.st-plp__desc { max-width: 620px; color: var(--st-muted); font-size: 18px; }
|
|
123
|
+
.st-plp__count { color: var(--st-muted); font-size: 14px; }
|
|
124
|
+
.st-plp__body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; }
|
|
125
|
+
.st-plp__filters { display: grid; align-content: start; gap: 28px; }
|
|
126
|
+
.st-facets { display: grid; gap: 24px; }
|
|
127
|
+
.st-facet { margin: 0; padding: 0; border: 0; }
|
|
128
|
+
.st-facet legend { margin-bottom: 10px; padding: 0; }
|
|
129
|
+
.st-check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
|
|
130
|
+
.st-check input { width: 20px; height: 20px; accent-color: var(--st-accent); }
|
|
131
|
+
.st-check[data-active='true'] { color: var(--st-accent); }
|
|
132
|
+
.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; }
|
|
133
|
+
.st-pages { display: flex; justify-content: center; gap: 12px; margin-top: 48px; }
|
|
134
|
+
|
|
135
|
+
/* ── search, cart ────────────────────────────────────────────────────────── */
|
|
136
|
+
.st-results__count { color: var(--st-muted); }
|
|
137
|
+
.st-results .st-find { display: flex; gap: 12px; margin: 24px 0; }
|
|
138
|
+
.st-cart__empty { display: grid; justify-items: start; gap: 16px; }
|
|
139
|
+
.st-lines { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--st-line); }
|
|
140
|
+
.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); }
|
|
141
|
+
.st-line[data-busy='true'] { opacity: 0.6; }
|
|
142
|
+
.st-line__img { display: block; width: 96px; height: auto; aspect-ratio: 3 / 4; object-fit: cover; background: var(--st-panel); }
|
|
143
|
+
.st-line__info p { margin: 4px 0 0; }
|
|
144
|
+
.st .st-line__title { display: inline-flex; align-items: center; min-height: 44px; color: var(--st-ink); font-size: 18px; text-decoration: none; }
|
|
145
|
+
.st-line__qty { display: flex; align-items: center; gap: 6px; }
|
|
146
|
+
.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; }
|
|
147
|
+
.st-line__total { margin: 0; min-width: 96px; text-align: right; }
|
|
148
|
+
.st-cart__summary { display: grid; justify-items: end; gap: 10px; margin-top: 28px; }
|
|
149
|
+
.st-cart__row { display: flex; gap: 32px; margin: 0; }
|
|
150
|
+
.st-cart__row--total { font-size: 22px; }
|
|
151
|
+
.st-cart__checkout { min-width: 280px; }
|
|
152
|
+
|
|
153
|
+
/* ── drawer ──────────────────────────────────────────────────────────────── */
|
|
154
|
+
.st-drawer__backdrop { position: fixed; inset: 0; z-index: 40; background: rgb(5 6 12 / 0.7); }
|
|
155
|
+
.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); }
|
|
156
|
+
.st-drawer:focus { outline: none; }
|
|
157
|
+
.st-drawer__head { display: flex; align-items: center; justify-content: space-between; }
|
|
158
|
+
.st-drawer__title { font-size: 26px; }
|
|
159
|
+
.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; }
|
|
160
|
+
.st-drawer__lines { list-style: none; margin: 0; padding: 0; }
|
|
161
|
+
.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); }
|
|
162
|
+
.st-drawer__line p { margin: 0; }
|
|
163
|
+
.st-drawer__img { display: block; width: 64px; height: auto; aspect-ratio: 3 / 4; object-fit: cover; background: var(--st-bg); }
|
|
164
|
+
.st-drawer__total { display: flex; justify-content: space-between; margin: 8px 0; font-size: 18px; }
|
|
165
|
+
|
|
166
|
+
/* ── content ─────────────────────────────────────────────────────────────── */
|
|
167
|
+
.st-page, .st-story { max-width: 760px; margin: 0 auto; }
|
|
168
|
+
.st-page__title, .st-story__title, .st-journal__title, .st-lost__title, .st-account__title { font-size: clamp(36px, 6vw, 64px); margin-bottom: 28px; }
|
|
169
|
+
.st-prose { color: var(--st-muted); font-size: 18px; }
|
|
170
|
+
.st-story__back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 16px; font-size: 13px; }
|
|
171
|
+
.st-journal__list { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--st-line); }
|
|
172
|
+
.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; }
|
|
173
|
+
.st-journal__name { font-size: 26px; }
|
|
174
|
+
.st-journal__excerpt { color: var(--st-muted); }
|
|
175
|
+
.st-journal__more { color: var(--st-accent); font-size: 13px; }
|
|
176
|
+
.st-lost { display: grid; justify-items: center; gap: 12px; min-height: 50vh; align-content: center; text-align: center; }
|
|
177
|
+
.st-account__frame { display: block; width: 100%; min-height: 640px; border: 1px solid var(--st-line); }
|
|
178
|
+
.st-form { display: grid; gap: 8px; max-width: 560px; }
|
|
179
|
+
.st-form .st-input { width: 100%; margin-bottom: 12px; border: 1px solid var(--st-line); }
|
|
180
|
+
.st-form textarea.st-input { min-height: 140px; }
|
|
181
|
+
|
|
182
|
+
/* ── colophon ────────────────────────────────────────────────────────────── */
|
|
183
|
+
.st-foot { padding: 56px var(--st-gutter) 40px; border-top: 1px solid var(--st-line); color: var(--st-muted); }
|
|
184
|
+
.st-foot__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px; }
|
|
185
|
+
.st-foot__name { margin: 0 0 8px; color: var(--st-ink); font-size: 24px; font-style: italic; }
|
|
186
|
+
.st-foot__tagline { margin: 0; max-width: 320px; }
|
|
187
|
+
.st-foot__heading { margin-bottom: 12px; color: var(--st-ink); font-size: 13px; }
|
|
188
|
+
.st-foot ul { list-style: none; margin: 0; padding: 0; }
|
|
189
|
+
.st .st-foot li a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--st-muted); text-decoration: none; }
|
|
190
|
+
.st-foot li a:hover { color: var(--st-accent); }
|
|
191
|
+
.st-foot__legal { margin: 48px 0 0; font-size: 13px; }
|
|
192
|
+
|
|
193
|
+
/* ── consent ─────────────────────────────────────────────────────────────── */
|
|
194
|
+
.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); }
|
|
195
|
+
.st-consent p { flex: 1 1 320px; margin: 0; color: var(--st-muted); }
|
|
196
|
+
.st-consent strong { color: var(--st-ink); font-weight: 400; font-style: italic; }
|
|
197
|
+
|
|
198
|
+
/* ── small screens ───────────────────────────────────────────────────────── */
|
|
199
|
+
@media (max-width: 900px) {
|
|
200
|
+
/* brand · cart · menu on one line; the menu opens the links, search and region below it */
|
|
201
|
+
.st-mast { grid-template-columns: 1fr auto auto; gap: 8px 12px; }
|
|
202
|
+
.st-mast__brand { font-size: 21px; }
|
|
203
|
+
.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; }
|
|
204
|
+
.st-mast__nav { display: none; grid-column: 1 / -1; order: 5; }
|
|
205
|
+
.st-mast__nav.is-open { display: block; }
|
|
206
|
+
.st-mast__nav ul { flex-direction: column; }
|
|
207
|
+
.st-mast__tools { display: contents; }
|
|
208
|
+
.st-mast__cart { grid-row: 1; grid-column: 2; }
|
|
209
|
+
.st-mast__menu { grid-row: 1; grid-column: 3; }
|
|
210
|
+
.st-find, .st-locale { display: none; grid-column: 1 / -1; order: 6; }
|
|
211
|
+
.st-mast__nav.is-open ~ .st-mast__tools .st-find, .st-mast__nav.is-open ~ .st-mast__tools .st-locale { display: flex; }
|
|
212
|
+
.st-find__input { width: 100%; }
|
|
213
|
+
.st-locale { flex-wrap: wrap; }
|
|
214
|
+
.st-pdp { grid-template-columns: 1fr; gap: 24px; }
|
|
215
|
+
.st-plp__body { grid-template-columns: 1fr; }
|
|
216
|
+
.st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
|
|
217
|
+
.st-line { grid-template-columns: 72px 1fr; }
|
|
218
|
+
.st-line__img { width: 72px; }
|
|
219
|
+
.st-line__qty, .st-line__total { grid-column: 2; }
|
|
220
|
+
.st-line__total { text-align: left; }
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* every standalone link is at least a 44 × 44 touch target */
|
|
224
|
+
.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,76 @@
|
|
|
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, useSettings, useTranslate } from '@tanqory/theme-kit/headless'
|
|
7
|
+
import { cx } from './components/parts'
|
|
8
|
+
import { footer, header } from './sections/chrome'
|
|
9
|
+
import { featuredCollection, hero, letters, note } 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
|
+
function Layout({ children }: { children: ReactNode }): JSX.Element {
|
|
61
|
+
const settings = useSettings()
|
|
62
|
+
return (
|
|
63
|
+
<div className={cx('st', settings.scheme === 'dark' && 'st--dark')}>
|
|
64
|
+
<SkipLink className="st-skip" />
|
|
65
|
+
{children}
|
|
66
|
+
<Drawer />
|
|
67
|
+
<ConsentBanner className="st-consent" buttonClassName="st-btn" acceptClassName="st-btn--solid" />
|
|
68
|
+
</div>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export default defineTheme({
|
|
73
|
+
name: 'Partner starter',
|
|
74
|
+
sections: [header, hero, featuredCollection, note, letters, product, recommendations, collection, search, cart, page, contact, blog, article, account, notFound, footer],
|
|
75
|
+
Layout,
|
|
76
|
+
})
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contentVersion": 1,
|
|
3
|
+
"template": "index",
|
|
4
|
+
"regions": {
|
|
5
|
+
"main": {
|
|
6
|
+
"sections": [
|
|
7
|
+
{
|
|
8
|
+
"id": "hero-1",
|
|
9
|
+
"type": "hero",
|
|
10
|
+
"settings": {
|
|
11
|
+
"kicker": "Welcome",
|
|
12
|
+
"heading": "Our shop",
|
|
13
|
+
"buttonLabel": "Shop all",
|
|
14
|
+
"buttonLink": "/collections/all"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "shelf-1",
|
|
19
|
+
"type": "featured-collection",
|
|
20
|
+
"settings": {
|
|
21
|
+
"heading": "Products",
|
|
22
|
+
"collection": "all"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "note-1",
|
|
27
|
+
"type": "rich-text"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "letters-1",
|
|
31
|
+
"type": "newsletter"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"jsx": "react-jsx",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"noUnusedLocals": true,
|
|
10
|
+
"noUnusedParameters": true,
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"types": ["vite/client"]
|
|
15
|
+
},
|
|
16
|
+
"include": ["src", "scripts/probe.ts"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import react from '@vitejs/plugin-react'
|
|
3
|
+
|
|
4
|
+
// The browser bundle → dist/build/client. `base: './'`: the asset origin and its /a/<digest>/client prefix
|
|
5
|
+
// are known only once the platform has built the artifact, so every URL stays relative to its file.
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
plugins: [react()],
|
|
8
|
+
base: './',
|
|
9
|
+
build: {
|
|
10
|
+
outDir: 'dist/build/client',
|
|
11
|
+
emptyOutDir: true,
|
|
12
|
+
manifest: true,
|
|
13
|
+
target: 'es2022',
|
|
14
|
+
sourcemap: false,
|
|
15
|
+
rollupOptions: { input: 'src/entry.client.tsx' },
|
|
16
|
+
},
|
|
17
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import react from '@vitejs/plugin-react'
|
|
3
|
+
|
|
4
|
+
// The theme's declarations for Node (scripts/build.mjs reads them to write the manifest). The kit is
|
|
5
|
+
// bundled in so its `import.meta.env` reads are defined; React stays external.
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
plugins: [react()],
|
|
8
|
+
ssr: { noExternal: ['@tanqory/theme-kit'] },
|
|
9
|
+
build: {
|
|
10
|
+
ssr: 'scripts/probe.ts',
|
|
11
|
+
outDir: 'dist/.probe',
|
|
12
|
+
emptyOutDir: true,
|
|
13
|
+
target: 'node20',
|
|
14
|
+
rollupOptions: { output: { entryFileNames: 'probe.mjs', format: 'es' } },
|
|
15
|
+
},
|
|
16
|
+
})
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import react from '@vitejs/plugin-react'
|
|
3
|
+
|
|
4
|
+
// The serve entry → dist/build/server/entry.mjs: ONE ES module, everything inlined, no imports, no dynamic
|
|
5
|
+
// import(), no Node built-ins (Theme ABI v2 §1, §11). Browser-only globals are compile-time `undefined` here:
|
|
6
|
+
// every use sits behind a `typeof window` guard or in an effect that never runs during the server render, so
|
|
7
|
+
// the minifier drops those branches and the entry has no free identifier outside the ABI's globals.
|
|
8
|
+
const BROWSER_ONLY = [
|
|
9
|
+
'window', 'document', 'location', 'history', 'self', 'localStorage', 'sessionStorage',
|
|
10
|
+
'requestAnimationFrame', 'cancelAnimationFrame', 'getComputedStyle', 'matchMedia', 'CSS',
|
|
11
|
+
'DOMParser', 'MutationObserver', 'ResizeObserver', 'IntersectionObserver', 'HTMLElement',
|
|
12
|
+
'MessageChannel', 'setImmediate', 'MSApp', 'reportError', '__REACT_DEVTOOLS_GLOBAL_HOOK__',
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
export default defineConfig({
|
|
16
|
+
plugins: [react()],
|
|
17
|
+
define: {
|
|
18
|
+
'process.env.NODE_ENV': '"production"',
|
|
19
|
+
...Object.fromEntries(BROWSER_ONLY.map((name) => [name, 'undefined'])),
|
|
20
|
+
},
|
|
21
|
+
ssr: { noExternal: true, target: 'webworker' },
|
|
22
|
+
resolve: { conditions: ['workerd', 'worker', 'browser', 'module', 'import', 'default'] },
|
|
23
|
+
build: {
|
|
24
|
+
ssr: 'src/entry.server.tsx',
|
|
25
|
+
outDir: 'dist/build/server',
|
|
26
|
+
emptyOutDir: true,
|
|
27
|
+
target: 'es2022',
|
|
28
|
+
minify: 'esbuild',
|
|
29
|
+
sourcemap: false,
|
|
30
|
+
rollupOptions: { output: { entryFileNames: 'entry.mjs', format: 'es', inlineDynamicImports: true } },
|
|
31
|
+
},
|
|
32
|
+
})
|
package/README.md
DELETED