@usethrottle/storefront-react 0.0.0-stage → 0.1.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/CLAUDE.md +67 -0
- package/README.md +119 -2
- package/dist/StorefrontProvider-Br4wUHui.d.cts +559 -0
- package/dist/StorefrontProvider-DLEPEjg6.d.ts +559 -0
- package/dist/account/index.cjs +69 -0
- package/dist/account/index.cjs.map +1 -0
- package/dist/account/index.d.cts +23 -0
- package/dist/account/index.d.ts +23 -0
- package/dist/account/index.js +68 -0
- package/dist/account/index.js.map +1 -0
- package/dist/chunk-2LCPIY2P.cjs +16 -0
- package/dist/chunk-2LCPIY2P.cjs.map +1 -0
- package/dist/chunk-3A72UY6T.js +2126 -0
- package/dist/chunk-3A72UY6T.js.map +1 -0
- package/dist/chunk-3JMIVAHN.js +185 -0
- package/dist/chunk-3JMIVAHN.js.map +1 -0
- package/dist/chunk-4J6AGWNC.cjs +24 -0
- package/dist/chunk-4J6AGWNC.cjs.map +1 -0
- package/dist/chunk-4U6MYDZV.js +17 -0
- package/dist/chunk-4U6MYDZV.js.map +1 -0
- package/dist/chunk-66HDJVPS.js +22 -0
- package/dist/chunk-66HDJVPS.js.map +1 -0
- package/dist/chunk-6X2OZSNV.cjs +83 -0
- package/dist/chunk-6X2OZSNV.cjs.map +1 -0
- package/dist/chunk-6ZMMZ245.cjs +2127 -0
- package/dist/chunk-6ZMMZ245.cjs.map +1 -0
- package/dist/chunk-7R37CVAB.cjs +23 -0
- package/dist/chunk-7R37CVAB.cjs.map +1 -0
- package/dist/chunk-A3IFWQUV.js +368 -0
- package/dist/chunk-A3IFWQUV.js.map +1 -0
- package/dist/chunk-AYC2YK4E.cjs +95 -0
- package/dist/chunk-AYC2YK4E.cjs.map +1 -0
- package/dist/chunk-AZV5U7YB.cjs +18 -0
- package/dist/chunk-AZV5U7YB.cjs.map +1 -0
- package/dist/chunk-CE2SKNQP.cjs +71 -0
- package/dist/chunk-CE2SKNQP.cjs.map +1 -0
- package/dist/chunk-D76CRI4X.js +2175 -0
- package/dist/chunk-D76CRI4X.js.map +1 -0
- package/dist/chunk-DOAII637.cjs +186 -0
- package/dist/chunk-DOAII637.cjs.map +1 -0
- package/dist/chunk-DYHHAOMG.cjs +17 -0
- package/dist/chunk-DYHHAOMG.cjs.map +1 -0
- package/dist/chunk-EYSVU5SJ.js +196 -0
- package/dist/chunk-EYSVU5SJ.js.map +1 -0
- package/dist/chunk-HSUUDZWS.js +37 -0
- package/dist/chunk-HSUUDZWS.js.map +1 -0
- package/dist/chunk-HZ6VEN6Q.cjs +101 -0
- package/dist/chunk-HZ6VEN6Q.cjs.map +1 -0
- package/dist/chunk-IJOTLGPT.js +16 -0
- package/dist/chunk-IJOTLGPT.js.map +1 -0
- package/dist/chunk-ISDATHVC.js +219 -0
- package/dist/chunk-ISDATHVC.js.map +1 -0
- package/dist/chunk-LW2A6USV.js +100 -0
- package/dist/chunk-LW2A6USV.js.map +1 -0
- package/dist/chunk-M4YXSLRG.cjs +369 -0
- package/dist/chunk-M4YXSLRG.cjs.map +1 -0
- package/dist/chunk-NDUEJJLP.cjs +2176 -0
- package/dist/chunk-NDUEJJLP.cjs.map +1 -0
- package/dist/chunk-NNE4FYRT.js +820 -0
- package/dist/chunk-NNE4FYRT.js.map +1 -0
- package/dist/chunk-NW3EFHY2.js +15 -0
- package/dist/chunk-NW3EFHY2.js.map +1 -0
- package/dist/chunk-NZRUQUN5.js +167 -0
- package/dist/chunk-NZRUQUN5.js.map +1 -0
- package/dist/chunk-P6HHE57S.cjs +38 -0
- package/dist/chunk-P6HHE57S.cjs.map +1 -0
- package/dist/chunk-PHY7AY27.cjs +197 -0
- package/dist/chunk-PHY7AY27.cjs.map +1 -0
- package/dist/chunk-PNJOFFTL.cjs +128 -0
- package/dist/chunk-PNJOFFTL.cjs.map +1 -0
- package/dist/chunk-PXZQ4ONA.js +127 -0
- package/dist/chunk-PXZQ4ONA.js.map +1 -0
- package/dist/chunk-Q3VTUBPP.js +82 -0
- package/dist/chunk-Q3VTUBPP.js.map +1 -0
- package/dist/chunk-Q3XFD5UI.js +45 -0
- package/dist/chunk-Q3XFD5UI.js.map +1 -0
- package/dist/chunk-QM7KTT7F.js +94 -0
- package/dist/chunk-QM7KTT7F.js.map +1 -0
- package/dist/chunk-RLWZOLXL.js +70 -0
- package/dist/chunk-RLWZOLXL.js.map +1 -0
- package/dist/chunk-SV53BRP2.js +23 -0
- package/dist/chunk-SV53BRP2.js.map +1 -0
- package/dist/chunk-VWXJO427.cjs +821 -0
- package/dist/chunk-VWXJO427.cjs.map +1 -0
- package/dist/chunk-WIIOJDHR.cjs +220 -0
- package/dist/chunk-WIIOJDHR.cjs.map +1 -0
- package/dist/chunk-XQHGFWLG.cjs +46 -0
- package/dist/chunk-XQHGFWLG.cjs.map +1 -0
- package/dist/chunk-ZHCXI2ZZ.cjs +168 -0
- package/dist/chunk-ZHCXI2ZZ.cjs.map +1 -0
- package/dist/index-RSj2Rg62.d.cts +8 -0
- package/dist/index-RSj2Rg62.d.ts +8 -0
- package/dist/index.cjs +2829 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1718 -0
- package/dist/index.d.ts +1718 -0
- package/dist/index.js +2828 -0
- package/dist/index.js.map +1 -0
- package/dist/metadata-QhKw-tvz.d.cts +188 -0
- package/dist/metadata-QhKw-tvz.d.ts +188 -0
- package/dist/next/client.cjs +84 -0
- package/dist/next/client.cjs.map +1 -0
- package/dist/next/client.d.cts +40 -0
- package/dist/next/client.d.ts +40 -0
- package/dist/next/client.js +83 -0
- package/dist/next/client.js.map +1 -0
- package/dist/next/index.cjs +1090 -0
- package/dist/next/index.cjs.map +1 -0
- package/dist/next/index.d.cts +218 -0
- package/dist/next/index.d.ts +218 -0
- package/dist/next/index.js +1049 -0
- package/dist/next/index.js.map +1 -0
- package/dist/server/index.cjs +994 -0
- package/dist/server/index.cjs.map +1 -0
- package/dist/server/index.d.cts +229 -0
- package/dist/server/index.d.ts +229 -0
- package/dist/server/index.js +951 -0
- package/dist/server/index.js.map +1 -0
- package/dist/styles.css +2111 -0
- package/dist/use-part-DCfFk7kf.d.ts +24 -0
- package/dist/use-part-DgjPBL_O.d.cts +24 -0
- package/package.json +121 -3
|
@@ -0,0 +1,2126 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
CartDrawerContext
|
|
4
|
+
} from "./chunk-NW3EFHY2.js";
|
|
5
|
+
import {
|
|
6
|
+
DEFAULT_SETTINGS,
|
|
7
|
+
brighten,
|
|
8
|
+
isHexColor,
|
|
9
|
+
isRecord,
|
|
10
|
+
isUnsafeKey,
|
|
11
|
+
mix,
|
|
12
|
+
normalizeHex,
|
|
13
|
+
resolveSiteDesign
|
|
14
|
+
} from "./chunk-A3IFWQUV.js";
|
|
15
|
+
import {
|
|
16
|
+
SfLocalizationProvider,
|
|
17
|
+
StorefrontContext,
|
|
18
|
+
usePart
|
|
19
|
+
} from "./chunk-NNE4FYRT.js";
|
|
20
|
+
|
|
21
|
+
// src/link.tsx
|
|
22
|
+
import { jsx } from "react/jsx-runtime";
|
|
23
|
+
var DefaultLink = ({ prefetch: _prefetch, ...anchor }) => /* @__PURE__ */ jsx("a", { ...anchor });
|
|
24
|
+
|
|
25
|
+
// src/settings/normalize.ts
|
|
26
|
+
var SORT_KEYS = [
|
|
27
|
+
"relevance",
|
|
28
|
+
"featured",
|
|
29
|
+
"manual",
|
|
30
|
+
"title_asc",
|
|
31
|
+
"title_desc",
|
|
32
|
+
"price_asc",
|
|
33
|
+
"price_desc",
|
|
34
|
+
"newest",
|
|
35
|
+
"updated",
|
|
36
|
+
"best_rated"
|
|
37
|
+
];
|
|
38
|
+
var ENUMS = [
|
|
39
|
+
[["theme", "colorScheme"], ["light", "dark", "auto"]],
|
|
40
|
+
[["theme", "spacingScale"], ["compact", "comfortable", "roomy"]],
|
|
41
|
+
[["listing", "pagination"], ["numbered", "load_more", "infinite"]],
|
|
42
|
+
[["listing", "filterLayout"], ["sidebar", "topbar", "drawer"]],
|
|
43
|
+
[["listing", "defaultSort"], SORT_KEYS],
|
|
44
|
+
[["card", "style"], ["standard", "minimal", "overlay", "row"]],
|
|
45
|
+
[["product", "layout"], ["classic", "stacked", "editorial"]],
|
|
46
|
+
[["product", "sectionsStyle"], ["auto", "tabs", "accordion", "stacked"]]
|
|
47
|
+
];
|
|
48
|
+
var SECTION_KEYS = ["description", "specs", "shipping", "tags", "categories", "related", "reviews"];
|
|
49
|
+
function fill(defaults, raw) {
|
|
50
|
+
if (isRecord(defaults)) {
|
|
51
|
+
const given = isRecord(raw) ? raw : {};
|
|
52
|
+
const out = {};
|
|
53
|
+
for (const key of Object.keys(defaults)) out[key] = fill(defaults[key], given[key]);
|
|
54
|
+
for (const key of Object.keys(given)) if (!isUnsafeKey(key) && !(key in out)) out[key] = given[key];
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
if (Array.isArray(defaults)) return Array.isArray(raw) ? raw : defaults;
|
|
58
|
+
if (defaults === null) return raw === void 0 ? null : raw;
|
|
59
|
+
if (typeof defaults === "number") return typeof raw === "number" && Number.isFinite(raw) ? raw : defaults;
|
|
60
|
+
return typeof raw === typeof defaults ? raw : defaults;
|
|
61
|
+
}
|
|
62
|
+
function cleanMenu(items) {
|
|
63
|
+
if (!Array.isArray(items)) return [];
|
|
64
|
+
return items.flatMap((item) => {
|
|
65
|
+
if (!isRecord(item) || typeof item.label !== "string" || !isRecord(item.target)) return [];
|
|
66
|
+
if (item.children === void 0) return [item];
|
|
67
|
+
if (!Array.isArray(item.children)) return [];
|
|
68
|
+
return [{ ...item, children: cleanMenu(item.children) }];
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
var warned = /* @__PURE__ */ new Set();
|
|
72
|
+
function warnOnce(key, message) {
|
|
73
|
+
if (process.env.NODE_ENV === "production" || warned.has(key)) return;
|
|
74
|
+
warned.add(key);
|
|
75
|
+
console.warn(`[@usethrottle/storefront-react] ${message}`);
|
|
76
|
+
}
|
|
77
|
+
function get(obj, path) {
|
|
78
|
+
let at = obj;
|
|
79
|
+
for (const key of path) at = isRecord(at) ? at[key] : void 0;
|
|
80
|
+
return at;
|
|
81
|
+
}
|
|
82
|
+
function set(obj, path, value) {
|
|
83
|
+
let at = obj;
|
|
84
|
+
for (const key of path.slice(0, -1)) at = at[key];
|
|
85
|
+
at[path[path.length - 1]] = value;
|
|
86
|
+
}
|
|
87
|
+
function normalizeSettings(raw) {
|
|
88
|
+
const out = fill(DEFAULT_SETTINGS, raw);
|
|
89
|
+
const strings = out.strings;
|
|
90
|
+
const defaultStrings = DEFAULT_SETTINGS.strings;
|
|
91
|
+
for (const key of Object.keys(defaultStrings)) if (strings[key] === "") strings[key] = defaultStrings[key];
|
|
92
|
+
for (const [path, allowed] of ENUMS) {
|
|
93
|
+
const value = get(out, path);
|
|
94
|
+
if (typeof value === "string" && allowed.includes(value)) continue;
|
|
95
|
+
const dotted = path.join(".");
|
|
96
|
+
warnOnce(`enum:${dotted}`, `settings.${dotted} has an unknown value (${JSON.stringify(value)}); using the default.`);
|
|
97
|
+
set(out, path, get(DEFAULT_SETTINGS, path));
|
|
98
|
+
}
|
|
99
|
+
const listing = out.listing;
|
|
100
|
+
listing.sorts = listing.sorts.filter(
|
|
101
|
+
(s) => isRecord(s) && typeof s.key === "string" && SORT_KEYS.includes(s.key)
|
|
102
|
+
);
|
|
103
|
+
const product = out.product;
|
|
104
|
+
product.sections = product.sections.filter(
|
|
105
|
+
(s) => isRecord(s) && typeof s.key === "string" && SECTION_KEYS.includes(s.key)
|
|
106
|
+
);
|
|
107
|
+
const nav = out.navigation;
|
|
108
|
+
nav.header = cleanMenu(nav.header);
|
|
109
|
+
nav.footer = cleanMenu(nav.footer);
|
|
110
|
+
const badges = out.badges;
|
|
111
|
+
badges.custom = badges.custom.filter(isRecord);
|
|
112
|
+
const home = out.home;
|
|
113
|
+
home.shelves = home.shelves.filter(isRecord);
|
|
114
|
+
return out;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// src/styles/index.ts
|
|
118
|
+
import { primitiveStyles } from "@usethrottle/ui";
|
|
119
|
+
|
|
120
|
+
// src/presets/bold.css.ts
|
|
121
|
+
var BOLD_CSS = `
|
|
122
|
+
[data-throttle-preset="bold"] {
|
|
123
|
+
--throttle-sf-heading-weight: 800;
|
|
124
|
+
--throttle-sf-heading-tracking: 0.02em;
|
|
125
|
+
--throttle-sf-heading-transform: uppercase;
|
|
126
|
+
}
|
|
127
|
+
`;
|
|
128
|
+
|
|
129
|
+
// src/presets/clean.css.ts
|
|
130
|
+
var CLEAN_CSS = `
|
|
131
|
+
[data-throttle-preset="clean"] {
|
|
132
|
+
--throttle-sf-heading-weight: 600;
|
|
133
|
+
--throttle-sf-heading-tracking: -0.01em;
|
|
134
|
+
--throttle-sf-heading-transform: none;
|
|
135
|
+
}
|
|
136
|
+
`;
|
|
137
|
+
|
|
138
|
+
// src/presets/editorial.css.ts
|
|
139
|
+
var EDITORIAL_CSS = `
|
|
140
|
+
[data-throttle-preset="editorial"] {
|
|
141
|
+
--throttle-sf-heading-weight: 400;
|
|
142
|
+
--throttle-sf-heading-tracking: 0;
|
|
143
|
+
--throttle-sf-heading-transform: none;
|
|
144
|
+
}
|
|
145
|
+
`;
|
|
146
|
+
|
|
147
|
+
// src/presets/index.ts
|
|
148
|
+
var PRESET_CSS = CLEAN_CSS + EDITORIAL_CSS + BOLD_CSS;
|
|
149
|
+
|
|
150
|
+
// src/styles/base.css.ts
|
|
151
|
+
var BASE_CSS = `
|
|
152
|
+
.tsf-root {
|
|
153
|
+
--throttle-sf-accent: #2563eb;
|
|
154
|
+
--throttle-sf-accent-hover: #1d4ed8;
|
|
155
|
+
--throttle-sf-accent-subtle: #eaf0fd;
|
|
156
|
+
--throttle-sf-sale: #b91c1c;
|
|
157
|
+
--throttle-sf-success: #15803d;
|
|
158
|
+
--throttle-sf-warning: #b45309;
|
|
159
|
+
--throttle-sf-danger: #b91c1c;
|
|
160
|
+
--throttle-sf-card-radius: 8px;
|
|
161
|
+
--throttle-sf-grid-gap: 20px;
|
|
162
|
+
--throttle-sf-heading-weight: 600;
|
|
163
|
+
--throttle-sf-heading-tracking: -0.01em;
|
|
164
|
+
--throttle-sf-heading-transform: none;
|
|
165
|
+
background: var(--throttle-color-background);
|
|
166
|
+
color: var(--throttle-color-foreground);
|
|
167
|
+
text-align: start;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.tsf-slot-outlet { display: block; }
|
|
171
|
+
`;
|
|
172
|
+
|
|
173
|
+
// src/styles/frame.css.ts
|
|
174
|
+
var FRAME_CSS = `
|
|
175
|
+
.tsf-skip-link {
|
|
176
|
+
position: absolute;
|
|
177
|
+
inset-inline-start: 8px;
|
|
178
|
+
inset-block-start: -120px;
|
|
179
|
+
z-index: 1000;
|
|
180
|
+
padding: 12px 16px;
|
|
181
|
+
border-radius: 8px;
|
|
182
|
+
background: var(--throttle-color-primary);
|
|
183
|
+
color: var(--throttle-color-primary-foreground);
|
|
184
|
+
font-weight: 600;
|
|
185
|
+
text-decoration: none;
|
|
186
|
+
}
|
|
187
|
+
.tsf-skip-link:focus { inset-block-start: 8px; }
|
|
188
|
+
|
|
189
|
+
.tsf-store-frame { display: flex; flex-direction: column; min-block-size: 100vh; }
|
|
190
|
+
.tsf-store-frame-main { flex: 1 0 auto; }
|
|
191
|
+
.tsf-store-frame-main:focus { outline: none; }
|
|
192
|
+
|
|
193
|
+
.tsf-announcement-bar {
|
|
194
|
+
position: relative;
|
|
195
|
+
display: flex;
|
|
196
|
+
align-items: center;
|
|
197
|
+
justify-content: center;
|
|
198
|
+
min-block-size: 44px;
|
|
199
|
+
padding-block: 4px;
|
|
200
|
+
padding-inline: 52px;
|
|
201
|
+
background: var(--throttle-color-primary);
|
|
202
|
+
color: var(--throttle-color-primary-foreground);
|
|
203
|
+
font-size: 13px;
|
|
204
|
+
text-align: center;
|
|
205
|
+
}
|
|
206
|
+
.tsf-announcement-bar-text { display: inline-flex; align-items: center; min-block-size: 44px; margin: 0; color: inherit; text-decoration: none; }
|
|
207
|
+
.tsf-announcement-bar-text:hover { text-decoration: underline; }
|
|
208
|
+
.tsf-announcement-bar-dismiss {
|
|
209
|
+
position: absolute;
|
|
210
|
+
inset-inline-end: 4px;
|
|
211
|
+
inset-block-start: 0;
|
|
212
|
+
display: inline-flex;
|
|
213
|
+
align-items: center;
|
|
214
|
+
justify-content: center;
|
|
215
|
+
min-inline-size: 44px;
|
|
216
|
+
min-block-size: 44px;
|
|
217
|
+
border: 0;
|
|
218
|
+
background: transparent;
|
|
219
|
+
color: inherit;
|
|
220
|
+
cursor: pointer;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.tsf-header:focus { outline: none; }
|
|
224
|
+
.tsf-header { border-block-end: 1px solid var(--throttle-color-border); background: var(--throttle-color-background); color: var(--throttle-color-foreground); }
|
|
225
|
+
.tsf-header-bar {
|
|
226
|
+
display: flex;
|
|
227
|
+
flex-wrap: wrap;
|
|
228
|
+
align-items: center;
|
|
229
|
+
gap: 4px 12px;
|
|
230
|
+
max-inline-size: 1280px;
|
|
231
|
+
margin-inline: auto;
|
|
232
|
+
padding-block: 8px;
|
|
233
|
+
padding-inline: 16px;
|
|
234
|
+
}
|
|
235
|
+
.tsf-header-menu-button,
|
|
236
|
+
.tsf-header-drawer-close,
|
|
237
|
+
.tsf-category-nav-toggle,
|
|
238
|
+
.tsf-cart-button,
|
|
239
|
+
.tsf-account-button {
|
|
240
|
+
position: relative;
|
|
241
|
+
display: inline-flex;
|
|
242
|
+
align-items: center;
|
|
243
|
+
justify-content: center;
|
|
244
|
+
min-inline-size: 44px;
|
|
245
|
+
min-block-size: 44px;
|
|
246
|
+
border: 0;
|
|
247
|
+
border-radius: 8px;
|
|
248
|
+
background: transparent;
|
|
249
|
+
color: inherit;
|
|
250
|
+
cursor: pointer;
|
|
251
|
+
text-decoration: none;
|
|
252
|
+
}
|
|
253
|
+
.tsf-header-menu-button:hover,
|
|
254
|
+
.tsf-header-drawer-close:hover,
|
|
255
|
+
.tsf-cart-button:hover,
|
|
256
|
+
.tsf-account-button:hover { background: var(--throttle-color-muted); }
|
|
257
|
+
@media (min-width: 960px) { .tsf-header-menu-button { display: none; } }
|
|
258
|
+
|
|
259
|
+
.tsf-header-brand {
|
|
260
|
+
display: inline-flex;
|
|
261
|
+
align-items: center;
|
|
262
|
+
gap: 8px;
|
|
263
|
+
flex: none;
|
|
264
|
+
min-inline-size: 44px;
|
|
265
|
+
min-block-size: 44px;
|
|
266
|
+
color: inherit;
|
|
267
|
+
font-size: 20px;
|
|
268
|
+
font-weight: var(--throttle-sf-heading-weight);
|
|
269
|
+
letter-spacing: var(--throttle-sf-heading-tracking);
|
|
270
|
+
text-transform: var(--throttle-sf-heading-transform);
|
|
271
|
+
text-decoration: none;
|
|
272
|
+
}
|
|
273
|
+
.tsf-header-logo { display: block; block-size: 32px; inline-size: auto; max-inline-size: 160px; }
|
|
274
|
+
.tsf-header-store-name:where([data-has-logo]) {
|
|
275
|
+
position: absolute;
|
|
276
|
+
inline-size: 1px;
|
|
277
|
+
block-size: 1px;
|
|
278
|
+
margin: -1px;
|
|
279
|
+
padding: 0;
|
|
280
|
+
overflow: hidden;
|
|
281
|
+
clip: rect(0 0 0 0);
|
|
282
|
+
white-space: nowrap;
|
|
283
|
+
border: 0;
|
|
284
|
+
}
|
|
285
|
+
.tsf-header-search { order: 3; flex: 1 1 100%; min-inline-size: 0; }
|
|
286
|
+
@media (min-width: 640px) {
|
|
287
|
+
.tsf-header-search { order: 0; flex: 1 1 auto; max-inline-size: 520px; margin-inline: auto; }
|
|
288
|
+
}
|
|
289
|
+
.tsf-header-actions { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto; }
|
|
290
|
+
@media (min-width: 640px) { .tsf-header-actions { margin-inline-start: 0; } }
|
|
291
|
+
|
|
292
|
+
.tsf-header-nav-row {
|
|
293
|
+
display: flex;
|
|
294
|
+
align-items: center;
|
|
295
|
+
justify-content: space-between;
|
|
296
|
+
gap: 16px;
|
|
297
|
+
max-inline-size: 1280px;
|
|
298
|
+
margin-inline: auto;
|
|
299
|
+
padding-inline: 16px;
|
|
300
|
+
}
|
|
301
|
+
@media (max-width: 959px) { .tsf-header-nav-row { display: none; } }
|
|
302
|
+
.tsf-header-prefs { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-inline-start: auto; }
|
|
303
|
+
.tsf-header-prefs:where([data-in-drawer]) { margin-inline-start: 0; padding-block: 8px; padding-inline: 16px; }
|
|
304
|
+
.tsf-header-drawer-top {
|
|
305
|
+
display: flex;
|
|
306
|
+
align-items: center;
|
|
307
|
+
justify-content: space-between;
|
|
308
|
+
padding-block: 8px;
|
|
309
|
+
padding-inline: 16px;
|
|
310
|
+
border-block-end: 1px solid var(--throttle-color-border);
|
|
311
|
+
}
|
|
312
|
+
.tsf-header-drawer-title { margin: 0; font-size: 18px; font-weight: var(--throttle-sf-heading-weight); }
|
|
313
|
+
|
|
314
|
+
.tsf-category-nav-list { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; margin: 0; padding: 0; list-style: none; }
|
|
315
|
+
.tsf-category-nav-list:where([data-stacked="true"]) { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; padding-block: 8px; padding-inline: 16px; }
|
|
316
|
+
.tsf-category-nav-item { position: relative; display: flex; align-items: center; }
|
|
317
|
+
.tsf-category-nav-item:where([data-stacked="true"]) { flex-wrap: wrap; }
|
|
318
|
+
.tsf-category-nav-link {
|
|
319
|
+
display: inline-flex;
|
|
320
|
+
align-items: center;
|
|
321
|
+
min-block-size: 44px;
|
|
322
|
+
color: inherit;
|
|
323
|
+
text-decoration: none;
|
|
324
|
+
}
|
|
325
|
+
.tsf-category-nav-link:hover { color: var(--throttle-sf-accent); }
|
|
326
|
+
.tsf-category-nav-toggle { min-inline-size: 28px; }
|
|
327
|
+
.tsf-category-nav-panel {
|
|
328
|
+
position: absolute;
|
|
329
|
+
inset-block-start: 100%;
|
|
330
|
+
inset-inline-start: 0;
|
|
331
|
+
z-index: 30;
|
|
332
|
+
min-inline-size: 200px;
|
|
333
|
+
margin: 0;
|
|
334
|
+
padding: 8px;
|
|
335
|
+
list-style: none;
|
|
336
|
+
background: var(--throttle-color-background);
|
|
337
|
+
border: 1px solid var(--throttle-color-border);
|
|
338
|
+
border-radius: var(--throttle-radius, 8px);
|
|
339
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
|
340
|
+
}
|
|
341
|
+
.tsf-category-nav-panel:where([data-stacked="true"]) {
|
|
342
|
+
position: static;
|
|
343
|
+
flex-basis: 100%;
|
|
344
|
+
min-inline-size: 0;
|
|
345
|
+
padding-block: 0;
|
|
346
|
+
padding-inline: 16px 0;
|
|
347
|
+
border: 0;
|
|
348
|
+
box-shadow: none;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.tsf-search-box {
|
|
352
|
+
position: relative;
|
|
353
|
+
display: flex;
|
|
354
|
+
align-items: center;
|
|
355
|
+
gap: 8px;
|
|
356
|
+
min-block-size: 44px;
|
|
357
|
+
padding-inline: 12px;
|
|
358
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
359
|
+
border-radius: 999px;
|
|
360
|
+
background: var(--throttle-color-background);
|
|
361
|
+
color: var(--throttle-color-muted-foreground);
|
|
362
|
+
}
|
|
363
|
+
.tsf-search-box:focus-within { outline: 2px solid var(--throttle-sf-accent); outline-offset: 2px; }
|
|
364
|
+
.tsf-search-box-input {
|
|
365
|
+
flex: 1 1 auto;
|
|
366
|
+
min-inline-size: 0;
|
|
367
|
+
padding-block: 10px;
|
|
368
|
+
border: 0;
|
|
369
|
+
outline: none;
|
|
370
|
+
background: transparent;
|
|
371
|
+
color: var(--throttle-color-foreground);
|
|
372
|
+
font: inherit;
|
|
373
|
+
}
|
|
374
|
+
.tsf-search-box-panel {
|
|
375
|
+
position: absolute;
|
|
376
|
+
inset-inline: 0;
|
|
377
|
+
inset-block-start: calc(100% + 4px);
|
|
378
|
+
z-index: 40;
|
|
379
|
+
max-block-size: min(70vh, 480px);
|
|
380
|
+
overflow: auto;
|
|
381
|
+
padding: 8px;
|
|
382
|
+
border: 1px solid var(--throttle-color-border);
|
|
383
|
+
border-radius: var(--throttle-radius, 8px);
|
|
384
|
+
background: var(--throttle-color-background);
|
|
385
|
+
color: var(--throttle-color-foreground);
|
|
386
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
|
387
|
+
}
|
|
388
|
+
.tsf-search-box-group-label {
|
|
389
|
+
padding-block: 8px 4px;
|
|
390
|
+
padding-inline: 8px;
|
|
391
|
+
color: var(--throttle-color-muted-foreground);
|
|
392
|
+
font-size: 12px;
|
|
393
|
+
font-weight: 600;
|
|
394
|
+
letter-spacing: 0.04em;
|
|
395
|
+
text-transform: uppercase;
|
|
396
|
+
}
|
|
397
|
+
.tsf-search-box-option,
|
|
398
|
+
.tsf-search-box-all {
|
|
399
|
+
display: flex;
|
|
400
|
+
align-items: center;
|
|
401
|
+
gap: 10px;
|
|
402
|
+
min-block-size: 44px;
|
|
403
|
+
padding: 6px 8px;
|
|
404
|
+
border-radius: 6px;
|
|
405
|
+
color: inherit;
|
|
406
|
+
text-decoration: none;
|
|
407
|
+
}
|
|
408
|
+
.tsf-search-box-option:hover,
|
|
409
|
+
.tsf-search-box-all:hover,
|
|
410
|
+
.tsf-search-box-option:where([aria-selected="true"]),
|
|
411
|
+
.tsf-search-box-all:where([aria-selected="true"]) { background: var(--throttle-color-muted); }
|
|
412
|
+
.tsf-search-box-all { font-weight: 600; color: var(--throttle-sf-accent); }
|
|
413
|
+
.tsf-search-box-thumb { flex: none; inline-size: 40px; }
|
|
414
|
+
.tsf-search-box-option-name { flex: 1 1 auto; min-inline-size: 0; overflow-wrap: anywhere; }
|
|
415
|
+
.tsf-search-box-option-meta { flex: none; color: var(--throttle-color-muted-foreground); font-size: 13px; }
|
|
416
|
+
.tsf-search-box-none { margin: 0; padding: 8px; color: var(--throttle-color-muted-foreground); }
|
|
417
|
+
.tsf-search-box-status {
|
|
418
|
+
position: absolute;
|
|
419
|
+
inline-size: 1px;
|
|
420
|
+
block-size: 1px;
|
|
421
|
+
margin: -1px;
|
|
422
|
+
padding: 0;
|
|
423
|
+
overflow: hidden;
|
|
424
|
+
clip: rect(0 0 0 0);
|
|
425
|
+
white-space: nowrap;
|
|
426
|
+
border: 0;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.tsf-locale-switch,
|
|
430
|
+
.tsf-currency-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
|
|
431
|
+
.tsf-locale-switch-label,
|
|
432
|
+
.tsf-currency-switch-label { color: var(--throttle-color-muted-foreground); }
|
|
433
|
+
.tsf-locale-switch-select,
|
|
434
|
+
.tsf-currency-switch-select {
|
|
435
|
+
min-block-size: 44px;
|
|
436
|
+
padding-inline: 8px;
|
|
437
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
438
|
+
border-radius: 6px;
|
|
439
|
+
background: var(--throttle-color-background);
|
|
440
|
+
color: var(--throttle-color-foreground);
|
|
441
|
+
font: inherit;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.tsf-cart-button-count {
|
|
445
|
+
position: absolute;
|
|
446
|
+
inset-block-start: 4px;
|
|
447
|
+
inset-inline-end: 2px;
|
|
448
|
+
min-inline-size: 18px;
|
|
449
|
+
block-size: 18px;
|
|
450
|
+
padding-inline: 4px;
|
|
451
|
+
border-radius: 999px;
|
|
452
|
+
background: var(--throttle-sf-accent);
|
|
453
|
+
color: #ffffff;
|
|
454
|
+
font-size: 11px;
|
|
455
|
+
font-weight: 600;
|
|
456
|
+
line-height: 18px;
|
|
457
|
+
text-align: center;
|
|
458
|
+
font-variant-numeric: tabular-nums;
|
|
459
|
+
}
|
|
460
|
+
.tsf-cart-button-count:where([data-empty]) { display: none; }
|
|
461
|
+
|
|
462
|
+
.tsf-header-menu-button:focus-visible,
|
|
463
|
+
.tsf-header-drawer-close:focus-visible,
|
|
464
|
+
.tsf-header-brand:focus-visible,
|
|
465
|
+
.tsf-category-nav-link:focus-visible,
|
|
466
|
+
.tsf-category-nav-toggle:focus-visible,
|
|
467
|
+
.tsf-cart-button:focus-visible,
|
|
468
|
+
.tsf-account-button:focus-visible,
|
|
469
|
+
.tsf-announcement-bar-dismiss:focus-visible,
|
|
470
|
+
.tsf-announcement-bar-text:focus-visible,
|
|
471
|
+
.tsf-footer-link:focus-visible,
|
|
472
|
+
.tsf-search-box-option:focus-visible,
|
|
473
|
+
.tsf-search-box-all:focus-visible,
|
|
474
|
+
.tsf-locale-switch-select:focus-visible,
|
|
475
|
+
.tsf-currency-switch-select:focus-visible { outline: 2px solid var(--throttle-sf-accent); outline-offset: 2px; }
|
|
476
|
+
|
|
477
|
+
.tsf-footer {
|
|
478
|
+
margin-block-start: 48px;
|
|
479
|
+
padding-block: 32px;
|
|
480
|
+
padding-inline: 16px;
|
|
481
|
+
border-block-start: 1px solid var(--throttle-color-border);
|
|
482
|
+
background: var(--throttle-color-surface);
|
|
483
|
+
color: var(--throttle-color-foreground);
|
|
484
|
+
}
|
|
485
|
+
.tsf-footer-brand,
|
|
486
|
+
.tsf-footer-extra { max-inline-size: 1280px; margin-inline: auto; margin-block-end: 24px; }
|
|
487
|
+
.tsf-footer-extra { margin-block: 24px 0; }
|
|
488
|
+
.tsf-footer-nav { max-inline-size: 1280px; margin-inline: auto; }
|
|
489
|
+
.tsf-footer-list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 40px; margin: 0; padding: 0; list-style: none; }
|
|
490
|
+
.tsf-footer-sublist { display: grid; gap: 0; margin: 4px 0 0; padding: 0; list-style: none; }
|
|
491
|
+
.tsf-footer-link { display: inline-flex; align-items: center; min-inline-size: 44px; min-block-size: 44px; color: inherit; text-decoration: none; }
|
|
492
|
+
.tsf-footer-link:hover { color: var(--throttle-sf-accent); text-decoration: underline; }
|
|
493
|
+
.tsf-footer-copyright { max-inline-size: 1280px; margin-block: 24px 0; margin-inline: auto; color: color-mix(in srgb, var(--throttle-color-muted-foreground) 75%, var(--throttle-color-foreground)); font-size: 13px; }
|
|
494
|
+
`;
|
|
495
|
+
|
|
496
|
+
// src/styles/merch.css.ts
|
|
497
|
+
var MERCH_CSS = `
|
|
498
|
+
.tsf-merch-skeleton { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--throttle-sf-grid-gap); }
|
|
499
|
+
.tsf-merch-skeleton-item { aspect-ratio: 4 / 5; border-radius: var(--throttle-sf-card-radius); background: var(--throttle-color-muted); }
|
|
500
|
+
@media (min-width: 768px) { .tsf-merch-skeleton { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
|
|
501
|
+
|
|
502
|
+
.tsf-collection-shelf { display: block; }
|
|
503
|
+
.tsf-collection-shelf-header,
|
|
504
|
+
.tsf-product-carousel-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-block-end: 16px; }
|
|
505
|
+
.tsf-collection-shelf-title,
|
|
506
|
+
.tsf-product-carousel-title { margin: 0; font-size: 22px; font-weight: var(--throttle-sf-heading-weight); letter-spacing: var(--throttle-sf-heading-tracking); text-transform: var(--throttle-sf-heading-transform); }
|
|
507
|
+
.tsf-collection-shelf-eyebrow,
|
|
508
|
+
.tsf-product-carousel-eyebrow { flex: 1 0 100%; margin: 0; color: var(--throttle-sf-accent); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
|
|
509
|
+
.tsf-collection-shelf-link { display: inline-flex; align-items: center; min-block-size: 44px; color: var(--throttle-sf-accent); font-weight: 500; text-decoration: none; }
|
|
510
|
+
.tsf-collection-shelf-link:hover { color: var(--throttle-sf-accent-hover); text-decoration: underline; }
|
|
511
|
+
.tsf-collection-shelf-grid { display: grid; grid-template-columns: repeat(var(--tsf-columns-mobile, 2), minmax(0, 1fr)); gap: var(--throttle-sf-grid-gap); margin: 0; padding: 0; list-style: none; }
|
|
512
|
+
.tsf-collection-shelf-item { min-inline-size: 0; }
|
|
513
|
+
@media (min-width: 768px) { .tsf-collection-shelf-grid { grid-template-columns: repeat(var(--tsf-columns-desktop, 4), minmax(0, 1fr)); } }
|
|
514
|
+
|
|
515
|
+
.tsf-product-carousel { display: block; }
|
|
516
|
+
.tsf-product-carousel-controls { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
|
|
517
|
+
.tsf-product-carousel-prev,
|
|
518
|
+
.tsf-product-carousel-next { display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; padding: 0; border: 1px solid var(--throttle-color-border-control); border-radius: 999px; background: var(--throttle-color-background); color: var(--throttle-color-foreground); cursor: pointer; }
|
|
519
|
+
.tsf-product-carousel-prev:hover:not(:disabled),
|
|
520
|
+
.tsf-product-carousel-next:hover:not(:disabled) { border-color: var(--throttle-color-foreground); }
|
|
521
|
+
.tsf-product-carousel-prev:disabled,
|
|
522
|
+
.tsf-product-carousel-next:disabled { opacity: 0.4; cursor: default; }
|
|
523
|
+
.tsf-product-carousel-track { display: flex; gap: var(--throttle-sf-grid-gap); margin: 0; padding: 0; list-style: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
|
|
524
|
+
.tsf-product-carousel-item { flex: 0 0 68%; min-inline-size: 0; scroll-snap-align: start; }
|
|
525
|
+
@media (min-width: 640px) { .tsf-product-carousel-item { flex-basis: calc((100% - var(--throttle-sf-grid-gap)) / 2); } }
|
|
526
|
+
@media (min-width: 900px) { .tsf-product-carousel-item { flex-basis: calc((100% - 2 * var(--throttle-sf-grid-gap)) / 3); } }
|
|
527
|
+
@media (min-width: 1200px) { .tsf-product-carousel-item { flex-basis: calc((100% - 3 * var(--throttle-sf-grid-gap)) / 4); } }
|
|
528
|
+
@media (prefers-reduced-motion: no-preference) { .tsf-product-carousel-track { scroll-behavior: smooth; } }
|
|
529
|
+
|
|
530
|
+
.tsf-featured-product { display: grid; gap: 24px; align-items: center; }
|
|
531
|
+
.tsf-featured-product-media { min-inline-size: 0; max-inline-size: 520px; }
|
|
532
|
+
.tsf-featured-product-media-link { display: block; }
|
|
533
|
+
.tsf-featured-product-placeholder { inline-size: 100%; background: var(--throttle-color-muted); border-radius: var(--throttle-sf-card-radius); }
|
|
534
|
+
.tsf-featured-product-body { display: grid; gap: 12px; justify-items: start; min-inline-size: 0; }
|
|
535
|
+
.tsf-featured-product-title { margin: 0; font-size: 28px; font-weight: var(--throttle-sf-heading-weight); letter-spacing: var(--throttle-sf-heading-tracking); text-transform: var(--throttle-sf-heading-transform); }
|
|
536
|
+
.tsf-featured-product-price { margin: 0; font-size: 18px; }
|
|
537
|
+
.tsf-featured-product-from { font-size: 14px; color: var(--throttle-color-muted-foreground); }
|
|
538
|
+
.tsf-featured-product-description { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; color: var(--throttle-color-muted-foreground); }
|
|
539
|
+
.tsf-featured-product-link { display: inline-flex; padding: 10px 20px; border-radius: var(--throttle-radius-md, 6px); background: var(--throttle-sf-accent); color: var(--throttle-color-background); font-weight: 600; text-decoration: none; }
|
|
540
|
+
.tsf-featured-product-link:hover { background: var(--throttle-sf-accent-hover); }
|
|
541
|
+
@media (min-width: 768px) {
|
|
542
|
+
.tsf-featured-product:where([data-layout="image-left"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
|
|
543
|
+
.tsf-featured-product:where([data-layout="image-right"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
|
|
544
|
+
.tsf-featured-product-media:where([data-layout="image-right"]) { order: 2; }
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
.tsf-category-directory { display: block; }
|
|
548
|
+
.tsf-category-directory-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
549
|
+
.tsf-category-directory-list:where([data-layout="list"]) { grid-template-columns: minmax(0, 1fr); gap: 4px; }
|
|
550
|
+
@media (min-width: 768px) { .tsf-category-directory-list:where([data-layout="grid"]) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
|
|
551
|
+
.tsf-category-directory-item { min-inline-size: 0; }
|
|
552
|
+
.tsf-category-directory-link { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--throttle-color-border); border-radius: var(--throttle-sf-card-radius); color: inherit; text-decoration: none; }
|
|
553
|
+
.tsf-category-directory-link:hover { border-color: var(--throttle-color-foreground); }
|
|
554
|
+
.tsf-category-directory-image { inline-size: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--throttle-sf-card-radius); background: var(--throttle-color-muted); }
|
|
555
|
+
.tsf-category-directory-name { font-weight: 600; }
|
|
556
|
+
.tsf-category-directory-count { font-size: 13px; color: var(--throttle-color-muted-foreground); }
|
|
557
|
+
.tsf-category-directory-children { display: grid; gap: 2px; margin: 6px 0 0; padding: 0; padding-inline-start: 16px; list-style: none; font-size: 14px; }
|
|
558
|
+
|
|
559
|
+
.tsf-reviews-list { display: block; }
|
|
560
|
+
.tsf-reviews-list-items { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
|
|
561
|
+
.tsf-reviews-list-item { display: grid; gap: 6px; padding-block-end: 20px; border-block-end: 1px solid var(--throttle-color-border); }
|
|
562
|
+
.tsf-reviews-list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
|
|
563
|
+
.tsf-reviews-list-title { margin: 0; font-size: 16px; font-weight: 600; }
|
|
564
|
+
.tsf-reviews-list-body { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
|
|
565
|
+
.tsf-reviews-list-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-size: 13px; color: var(--throttle-color-muted-foreground); }
|
|
566
|
+
.tsf-reviews-list-author { font-weight: 600; color: var(--throttle-color-foreground); }
|
|
567
|
+
.tsf-reviews-list-verified { color: var(--throttle-sf-success); }
|
|
568
|
+
.tsf-reviews-list-product { color: var(--throttle-sf-accent); }
|
|
569
|
+
@media (max-width: 767px) {
|
|
570
|
+
.tsf-reviews-list-product { display: inline-flex; align-items: center; min-block-size: 44px; }
|
|
571
|
+
}
|
|
572
|
+
.tsf-reviews-list-reply { padding: 10px 14px; border-inline-start: 3px solid var(--throttle-color-border); background: var(--throttle-color-muted); font-size: 14px; }
|
|
573
|
+
`;
|
|
574
|
+
|
|
575
|
+
// src/styles/pages.css.ts
|
|
576
|
+
var PAGES_CSS = `
|
|
577
|
+
.tsf-search-results { max-inline-size: 1280px; margin-inline: auto; padding-block: 24px; padding-inline: 16px; }
|
|
578
|
+
.tsf-search-results-title {
|
|
579
|
+
margin-block: 0 16px;
|
|
580
|
+
font-size: 28px;
|
|
581
|
+
font-weight: var(--throttle-sf-heading-weight);
|
|
582
|
+
letter-spacing: var(--throttle-sf-heading-tracking);
|
|
583
|
+
text-transform: var(--throttle-sf-heading-transform);
|
|
584
|
+
}
|
|
585
|
+
.tsf-search-results-prompt { margin: 0; color: var(--throttle-color-muted-foreground); }
|
|
586
|
+
|
|
587
|
+
.tsf-not-found {
|
|
588
|
+
display: grid;
|
|
589
|
+
justify-items: center;
|
|
590
|
+
gap: 12px;
|
|
591
|
+
padding-block: 64px;
|
|
592
|
+
padding-inline: 16px;
|
|
593
|
+
text-align: center;
|
|
594
|
+
}
|
|
595
|
+
.tsf-not-found-code {
|
|
596
|
+
margin: 0;
|
|
597
|
+
color: var(--throttle-color-muted-foreground);
|
|
598
|
+
font-size: 72px;
|
|
599
|
+
font-weight: 700;
|
|
600
|
+
line-height: 1;
|
|
601
|
+
letter-spacing: -0.03em;
|
|
602
|
+
}
|
|
603
|
+
.tsf-not-found-title {
|
|
604
|
+
margin: 0;
|
|
605
|
+
font-size: 28px;
|
|
606
|
+
font-weight: var(--throttle-sf-heading-weight);
|
|
607
|
+
letter-spacing: var(--throttle-sf-heading-tracking);
|
|
608
|
+
text-transform: var(--throttle-sf-heading-transform);
|
|
609
|
+
}
|
|
610
|
+
.tsf-not-found-body { max-inline-size: 44ch; margin: 0; color: var(--throttle-color-muted-foreground); }
|
|
611
|
+
.tsf-not-found-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-block: 12px 0; margin-inline: 0; }
|
|
612
|
+
.tsf-not-found-link {
|
|
613
|
+
display: inline-flex;
|
|
614
|
+
align-items: center;
|
|
615
|
+
min-block-size: 44px;
|
|
616
|
+
padding-inline: 20px;
|
|
617
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
618
|
+
border-radius: var(--throttle-radius, 8px);
|
|
619
|
+
color: inherit;
|
|
620
|
+
font-weight: 600;
|
|
621
|
+
text-decoration: none;
|
|
622
|
+
}
|
|
623
|
+
.tsf-not-found-link:first-child { border-color: transparent; background: var(--throttle-color-primary); color: var(--throttle-color-primary-foreground); }
|
|
624
|
+
.tsf-not-found-link:focus-visible { outline: 2px solid var(--throttle-sf-accent); outline-offset: 2px; }
|
|
625
|
+
|
|
626
|
+
.tsf-account-page { max-inline-size: 960px; margin-inline: auto; padding-block: 32px; padding-inline: 16px; }
|
|
627
|
+
.tsf-account-page-title { margin-block: 0 16px; font-size: 28px; font-weight: var(--throttle-sf-heading-weight); letter-spacing: var(--throttle-sf-heading-tracking); text-transform: var(--throttle-sf-heading-transform); }
|
|
628
|
+
.tsf-account-page-setup-notice {
|
|
629
|
+
max-inline-size: 560px;
|
|
630
|
+
margin-block: 48px;
|
|
631
|
+
margin-inline: auto;
|
|
632
|
+
padding: 24px;
|
|
633
|
+
border: 1px solid var(--throttle-color-border);
|
|
634
|
+
border-radius: var(--throttle-radius, 8px);
|
|
635
|
+
background: var(--throttle-color-surface);
|
|
636
|
+
}
|
|
637
|
+
.tsf-account-page-setup-title { margin-block: 0 8px; font-size: 18px; }
|
|
638
|
+
.tsf-account-page-setup-body { margin: 0; color: color-mix(in srgb, var(--throttle-color-muted-foreground) 75%, var(--throttle-color-foreground)); }
|
|
639
|
+
`;
|
|
640
|
+
|
|
641
|
+
// src/styles/pieces.css.ts
|
|
642
|
+
var PIECES_CSS = `
|
|
643
|
+
.tsf-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
|
|
644
|
+
.tsf-link:hover { color: var(--throttle-sf-accent); }
|
|
645
|
+
|
|
646
|
+
.tsf-image { display: block; inline-size: 100%; block-size: auto; object-fit: cover; background: var(--throttle-color-muted); }
|
|
647
|
+
|
|
648
|
+
.tsf-rich-text { overflow-wrap: anywhere; line-height: 1.6; }
|
|
649
|
+
.tsf-rich-text-link { color: var(--throttle-sf-accent); }
|
|
650
|
+
|
|
651
|
+
.tsf-money { font-variant-numeric: tabular-nums; }
|
|
652
|
+
.tsf-money-compare { margin-inline-start: 6px; color: var(--throttle-color-muted-foreground); font-weight: 400; font-variant-numeric: tabular-nums; }
|
|
653
|
+
|
|
654
|
+
.tsf-price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-weight: 600; }
|
|
655
|
+
.tsf-price-label { flex-basis: 100%; font-size: 12px; font-weight: 500; color: var(--throttle-sf-accent); }
|
|
656
|
+
.tsf-price-hint { flex-basis: 100%; font-size: 12px; font-weight: 400; color: var(--throttle-color-muted-foreground); }
|
|
657
|
+
|
|
658
|
+
.tsf-star-rating { display: inline-flex; align-items: center; gap: 6px; color: var(--throttle-color-muted-foreground); font-size: 13px; }
|
|
659
|
+
.tsf-star-rating-stars { display: inline-flex; gap: 1px; color: var(--throttle-color-warning); }
|
|
660
|
+
.tsf-star-rating-count { font-variant-numeric: tabular-nums; }
|
|
661
|
+
|
|
662
|
+
.tsf-product-badge {
|
|
663
|
+
display: inline-flex;
|
|
664
|
+
align-items: center;
|
|
665
|
+
padding: 2px 8px;
|
|
666
|
+
border-radius: 999px;
|
|
667
|
+
font-size: 12px;
|
|
668
|
+
font-weight: 600;
|
|
669
|
+
line-height: 1.4;
|
|
670
|
+
background: var(--tsf-badge-bg, var(--throttle-color-foreground));
|
|
671
|
+
color: var(--tsf-badge-fg, var(--throttle-color-background));
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.tsf-swatch {
|
|
675
|
+
display: inline-block;
|
|
676
|
+
inline-size: 16px;
|
|
677
|
+
block-size: 16px;
|
|
678
|
+
border-radius: 999px;
|
|
679
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
680
|
+
background-color: var(--throttle-color-muted);
|
|
681
|
+
background-size: cover;
|
|
682
|
+
background-position: center;
|
|
683
|
+
box-sizing: border-box;
|
|
684
|
+
vertical-align: middle;
|
|
685
|
+
}
|
|
686
|
+
.tsf-swatch:where([data-selected="true"]) { outline: 2px solid var(--throttle-color-foreground); outline-offset: 2px; }
|
|
687
|
+
.tsf-swatch:where([data-disabled="true"]) { opacity: 0.4; }
|
|
688
|
+
|
|
689
|
+
/* The card: the variant sets the properties, the parts read them. */
|
|
690
|
+
.tsf-product-card {
|
|
691
|
+
--tsf-card-border: 1px solid var(--throttle-color-border);
|
|
692
|
+
--tsf-card-radius: var(--throttle-sf-card-radius);
|
|
693
|
+
--tsf-body-padding: 12px;
|
|
694
|
+
--tsf-media-radius: 0;
|
|
695
|
+
position: relative;
|
|
696
|
+
display: flex;
|
|
697
|
+
flex-direction: column;
|
|
698
|
+
min-inline-size: 0;
|
|
699
|
+
border: var(--tsf-card-border);
|
|
700
|
+
border-radius: var(--tsf-card-radius);
|
|
701
|
+
background: var(--throttle-color-background);
|
|
702
|
+
color: var(--throttle-color-foreground);
|
|
703
|
+
overflow: hidden;
|
|
704
|
+
}
|
|
705
|
+
.tsf-product-card:where([data-variant="minimal"]) {
|
|
706
|
+
--tsf-card-border: 0 solid transparent;
|
|
707
|
+
--tsf-card-radius: 0;
|
|
708
|
+
--tsf-body-padding: 10px 0 0;
|
|
709
|
+
--tsf-media-radius: var(--throttle-sf-card-radius);
|
|
710
|
+
overflow: visible;
|
|
711
|
+
background: transparent;
|
|
712
|
+
}
|
|
713
|
+
.tsf-product-card:where([data-variant="overlay"]) {
|
|
714
|
+
--tsf-card-border: 0 solid transparent;
|
|
715
|
+
--tsf-body-padding: 40px 14px 14px;
|
|
716
|
+
--tsf-body-position: absolute;
|
|
717
|
+
--tsf-body-events: none;
|
|
718
|
+
--tsf-body-color: #fff;
|
|
719
|
+
--tsf-body-background: linear-gradient(to top, rgb(0 0 0 / 0.72), rgb(0 0 0 / 0));
|
|
720
|
+
}
|
|
721
|
+
.tsf-product-card:where([data-variant="row"]) { --tsf-media-basis: 38%; }
|
|
722
|
+
.tsf-product-card:where([data-sold-out]) { --tsf-media-opacity: 0.6; }
|
|
723
|
+
|
|
724
|
+
.tsf-product-card-row { display: flex; align-items: stretch; flex: 1; min-inline-size: 0; }
|
|
725
|
+
|
|
726
|
+
.tsf-product-card-media {
|
|
727
|
+
--tsf-alt: 0;
|
|
728
|
+
position: relative;
|
|
729
|
+
flex: 0 0 var(--tsf-media-basis, auto);
|
|
730
|
+
overflow: hidden;
|
|
731
|
+
border-radius: var(--tsf-media-radius);
|
|
732
|
+
background: var(--throttle-color-muted);
|
|
733
|
+
}
|
|
734
|
+
.tsf-product-card-media:focus-within { --tsf-alt: 1; }
|
|
735
|
+
@media (hover: hover) {
|
|
736
|
+
.tsf-product-card-media:hover { --tsf-alt: 1; }
|
|
737
|
+
}
|
|
738
|
+
.tsf-product-card-media-link { display: block; color: inherit; text-decoration: none; opacity: var(--tsf-media-opacity, 1); }
|
|
739
|
+
.tsf-product-card-image { display: block; }
|
|
740
|
+
.tsf-product-card-image-alt {
|
|
741
|
+
position: absolute;
|
|
742
|
+
inset: 0;
|
|
743
|
+
opacity: var(--tsf-alt);
|
|
744
|
+
transition: opacity 0.2s ease;
|
|
745
|
+
background: var(--throttle-color-muted);
|
|
746
|
+
}
|
|
747
|
+
/* No hover on a touch screen: the two images sit side by side and the shopper swipes. */
|
|
748
|
+
@media (hover: none) {
|
|
749
|
+
.tsf-product-card-media-link { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
|
|
750
|
+
.tsf-product-card-image, .tsf-product-card-image-alt { position: static; flex: 0 0 100%; opacity: 1; scroll-snap-align: start; }
|
|
751
|
+
}
|
|
752
|
+
@media (prefers-reduced-motion: reduce) {
|
|
753
|
+
.tsf-product-card-image-alt { transition: none; }
|
|
754
|
+
}
|
|
755
|
+
.tsf-product-card-placeholder { inline-size: 100%; background: var(--throttle-color-muted); }
|
|
756
|
+
|
|
757
|
+
.tsf-product-card-badges {
|
|
758
|
+
position: absolute;
|
|
759
|
+
inset-block-start: 8px;
|
|
760
|
+
inset-inline-start: 8px;
|
|
761
|
+
display: flex;
|
|
762
|
+
flex-wrap: wrap;
|
|
763
|
+
gap: 4px;
|
|
764
|
+
max-inline-size: calc(100% - 16px);
|
|
765
|
+
pointer-events: none;
|
|
766
|
+
}
|
|
767
|
+
.tsf-product-card-actions {
|
|
768
|
+
position: absolute;
|
|
769
|
+
inset-block-end: 8px;
|
|
770
|
+
inset-inline-end: 8px;
|
|
771
|
+
display: flex;
|
|
772
|
+
flex-direction: column;
|
|
773
|
+
gap: 6px;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
.tsf-product-card-body {
|
|
777
|
+
position: var(--tsf-body-position, static);
|
|
778
|
+
inset-inline: 0;
|
|
779
|
+
inset-block-end: 0;
|
|
780
|
+
flex: 1;
|
|
781
|
+
display: flex;
|
|
782
|
+
flex-direction: column;
|
|
783
|
+
align-items: flex-start;
|
|
784
|
+
gap: 6px;
|
|
785
|
+
padding: var(--tsf-body-padding);
|
|
786
|
+
min-inline-size: 0;
|
|
787
|
+
color: var(--tsf-body-color, inherit);
|
|
788
|
+
background: var(--tsf-body-background, transparent);
|
|
789
|
+
pointer-events: var(--tsf-body-events, auto);
|
|
790
|
+
}
|
|
791
|
+
.tsf-product-card-brand { margin: 0; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.7; }
|
|
792
|
+
.tsf-product-card-title {
|
|
793
|
+
margin: 0;
|
|
794
|
+
font-size: 15px;
|
|
795
|
+
font-weight: var(--throttle-sf-heading-weight);
|
|
796
|
+
letter-spacing: var(--throttle-sf-heading-tracking);
|
|
797
|
+
text-transform: var(--throttle-sf-heading-transform);
|
|
798
|
+
line-height: 1.3;
|
|
799
|
+
overflow-wrap: anywhere;
|
|
800
|
+
}
|
|
801
|
+
.tsf-product-card-title-link { color: inherit; text-decoration: none; pointer-events: auto; }
|
|
802
|
+
.tsf-product-card-title-link:hover { text-decoration: underline; }
|
|
803
|
+
.tsf-product-card-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
|
|
804
|
+
.tsf-product-card-swatch-more { font-size: 12px; opacity: 0.7; }
|
|
805
|
+
.tsf-product-card-rating { color: inherit; }
|
|
806
|
+
.tsf-product-card-price { margin: 0; font-size: 15px; }
|
|
807
|
+
.tsf-product-card-from { font-size: 12px; font-weight: 400; opacity: 0.7; }
|
|
808
|
+
.tsf-product-card-unpriced { font-size: 13px; opacity: 0.7; }
|
|
809
|
+
`;
|
|
810
|
+
|
|
811
|
+
// src/styles/product.css.ts
|
|
812
|
+
var PRODUCT_CSS = `
|
|
813
|
+
.tsf-product-page {
|
|
814
|
+
--tsf-main-columns: minmax(0, 1.1fr) minmax(0, 1fr);
|
|
815
|
+
--tsf-main-gap: 48px;
|
|
816
|
+
--tsf-buy-position: static;
|
|
817
|
+
--tsf-gallery-max: none;
|
|
818
|
+
--tsf-buy-max: none;
|
|
819
|
+
--tsf-main-justify: stretch;
|
|
820
|
+
display: block;
|
|
821
|
+
max-inline-size: 1280px;
|
|
822
|
+
margin-inline: auto;
|
|
823
|
+
padding-block: 24px 96px;
|
|
824
|
+
padding-inline: 16px;
|
|
825
|
+
box-sizing: border-box;
|
|
826
|
+
}
|
|
827
|
+
.tsf-product-page:where([data-layout="stacked"]) {
|
|
828
|
+
--tsf-main-columns: minmax(0, 1fr);
|
|
829
|
+
--tsf-main-gap: 32px;
|
|
830
|
+
--tsf-gallery-max: 720px;
|
|
831
|
+
--tsf-buy-max: 640px;
|
|
832
|
+
--tsf-main-justify: center;
|
|
833
|
+
}
|
|
834
|
+
.tsf-product-page:where([data-layout="editorial"]) {
|
|
835
|
+
--tsf-main-columns: minmax(0, 1.7fr) minmax(0, 1fr);
|
|
836
|
+
--tsf-main-gap: 64px;
|
|
837
|
+
--tsf-buy-position: sticky;
|
|
838
|
+
}
|
|
839
|
+
@media (max-width: 767px) {
|
|
840
|
+
.tsf-product-page,
|
|
841
|
+
.tsf-product-page:where([data-layout="stacked"]),
|
|
842
|
+
.tsf-product-page:where([data-layout="editorial"]) {
|
|
843
|
+
--tsf-main-columns: minmax(0, 1fr);
|
|
844
|
+
--tsf-main-gap: 24px;
|
|
845
|
+
--tsf-buy-position: static;
|
|
846
|
+
--tsf-gallery-max: none;
|
|
847
|
+
--tsf-buy-max: none;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
.tsf-product-page-main {
|
|
852
|
+
display: grid;
|
|
853
|
+
grid-template-columns: var(--tsf-main-columns);
|
|
854
|
+
gap: var(--tsf-main-gap);
|
|
855
|
+
justify-content: var(--tsf-main-justify);
|
|
856
|
+
align-items: start;
|
|
857
|
+
margin-block-end: 48px;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
/* Breadcrumbs */
|
|
861
|
+
.tsf-product-breadcrumbs { margin-block-end: 16px; font-size: var(--throttle-font-size-sm, 14px); color: var(--throttle-color-muted-foreground); }
|
|
862
|
+
.tsf-product-breadcrumbs-list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 0; list-style: none; }
|
|
863
|
+
.tsf-product-breadcrumbs-item { display: inline-flex; align-items: center; gap: 8px; }
|
|
864
|
+
.tsf-product-breadcrumbs-item:not(:last-child)::after { content: "/"; color: var(--throttle-color-border-control); }
|
|
865
|
+
.tsf-product-breadcrumbs-link { color: inherit; text-decoration: none; }
|
|
866
|
+
.tsf-product-breadcrumbs-link:hover { color: var(--throttle-color-foreground); text-decoration: underline; }
|
|
867
|
+
.tsf-product-breadcrumbs-current { color: var(--throttle-color-foreground); }
|
|
868
|
+
@media (max-width: 767px) {
|
|
869
|
+
.tsf-product-breadcrumbs-link,
|
|
870
|
+
.tsf-buy-box-rating { display: inline-flex; align-items: center; min-block-size: 44px; }
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/* Gallery */
|
|
874
|
+
.tsf-gallery { display: grid; gap: 12px; max-inline-size: var(--tsf-gallery-max); inline-size: 100%; margin-inline: auto; min-inline-size: 0; }
|
|
875
|
+
.tsf-gallery-stage {
|
|
876
|
+
position: relative;
|
|
877
|
+
overflow: hidden;
|
|
878
|
+
border-radius: var(--throttle-sf-card-radius);
|
|
879
|
+
background: var(--throttle-color-muted);
|
|
880
|
+
touch-action: pan-y;
|
|
881
|
+
cursor: zoom-in;
|
|
882
|
+
outline-offset: 2px;
|
|
883
|
+
}
|
|
884
|
+
.tsf-gallery-stage:focus-visible { outline: 2px solid var(--throttle-color-primary); }
|
|
885
|
+
.tsf-gallery-item { display: block; transition: transform 0.2s ease; will-change: transform; }
|
|
886
|
+
.tsf-gallery-item:where([data-zoomed="true"]) { transform: scale(1.9); }
|
|
887
|
+
.tsf-gallery-item:where([data-zoomed="true"]) { cursor: zoom-in; }
|
|
888
|
+
.tsf-gallery-video { display: block; inline-size: 100%; block-size: auto; background: #000; }
|
|
889
|
+
.tsf-gallery-placeholder { aspect-ratio: 4 / 5; background: var(--throttle-color-muted); }
|
|
890
|
+
.tsf-gallery-previous, .tsf-gallery-next, .tsf-gallery-enlarge, .tsf-lightbox-previous, .tsf-lightbox-next {
|
|
891
|
+
position: absolute;
|
|
892
|
+
display: inline-flex;
|
|
893
|
+
align-items: center;
|
|
894
|
+
justify-content: center;
|
|
895
|
+
inline-size: 44px;
|
|
896
|
+
block-size: 44px;
|
|
897
|
+
padding: 0;
|
|
898
|
+
border: 1px solid var(--throttle-color-border);
|
|
899
|
+
border-radius: 999px;
|
|
900
|
+
background: color-mix(in srgb, var(--throttle-color-background) 88%, transparent);
|
|
901
|
+
color: var(--throttle-color-foreground);
|
|
902
|
+
cursor: pointer;
|
|
903
|
+
}
|
|
904
|
+
.tsf-gallery-previous { inset-inline-start: 12px; inset-block-start: calc(50% - 22px); }
|
|
905
|
+
.tsf-gallery-next { inset-inline-end: 12px; inset-block-start: calc(50% - 22px); }
|
|
906
|
+
.tsf-gallery-enlarge { inset-inline-end: 12px; inset-block-end: 12px; }
|
|
907
|
+
.tsf-gallery-previous:hover, .tsf-gallery-next:hover, .tsf-gallery-enlarge:hover { background: var(--throttle-color-background); }
|
|
908
|
+
.tsf-gallery-counter {
|
|
909
|
+
position: absolute;
|
|
910
|
+
inset-inline-start: 12px;
|
|
911
|
+
inset-block-end: 12px;
|
|
912
|
+
margin: 0;
|
|
913
|
+
padding: 2px 10px;
|
|
914
|
+
border-radius: 999px;
|
|
915
|
+
background: color-mix(in srgb, var(--throttle-color-background) 88%, transparent);
|
|
916
|
+
font-size: 12px;
|
|
917
|
+
font-variant-numeric: tabular-nums;
|
|
918
|
+
}
|
|
919
|
+
.tsf-gallery-thumbs { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; overflow-x: auto; }
|
|
920
|
+
.tsf-gallery-thumbs-item { flex: 0 0 72px; }
|
|
921
|
+
.tsf-gallery-thumb {
|
|
922
|
+
display: block;
|
|
923
|
+
inline-size: 72px;
|
|
924
|
+
padding: 0;
|
|
925
|
+
border: 2px solid transparent;
|
|
926
|
+
border-radius: calc(var(--throttle-sf-card-radius) / 1.5);
|
|
927
|
+
background: var(--throttle-color-muted);
|
|
928
|
+
overflow: hidden;
|
|
929
|
+
cursor: pointer;
|
|
930
|
+
opacity: 0.7;
|
|
931
|
+
}
|
|
932
|
+
.tsf-gallery-thumb:where([aria-current="true"]) { border-color: var(--throttle-color-foreground); opacity: 1; }
|
|
933
|
+
.tsf-gallery-thumb:hover { opacity: 1; }
|
|
934
|
+
.tsf-gallery-thumb:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: 2px; }
|
|
935
|
+
|
|
936
|
+
/* Lightbox (inside the ui modal) */
|
|
937
|
+
.tsf-lightbox { position: relative; display: grid; place-items: center; min-inline-size: min(92vw, 960px); min-block-size: 50vh; }
|
|
938
|
+
.tsf-lightbox-title { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
939
|
+
.tsf-lightbox-stage { display: grid; place-items: center; max-block-size: 82vh; }
|
|
940
|
+
.tsf-lightbox-previous { inset-inline-start: 8px; inset-block-start: calc(50% - 22px); }
|
|
941
|
+
.tsf-lightbox-next { inset-inline-end: 8px; inset-block-start: calc(50% - 22px); }
|
|
942
|
+
.tsf-lightbox-counter { margin: 8px 0 0; font-size: 13px; color: var(--throttle-color-muted-foreground); font-variant-numeric: tabular-nums; }
|
|
943
|
+
|
|
944
|
+
/* Buy box */
|
|
945
|
+
.tsf-buy-box {
|
|
946
|
+
position: var(--tsf-buy-position);
|
|
947
|
+
inset-block-start: 24px;
|
|
948
|
+
display: grid;
|
|
949
|
+
gap: 16px;
|
|
950
|
+
max-inline-size: var(--tsf-buy-max);
|
|
951
|
+
inline-size: 100%;
|
|
952
|
+
margin-inline: auto;
|
|
953
|
+
min-inline-size: 0;
|
|
954
|
+
}
|
|
955
|
+
.tsf-buy-box-kicker { margin: 0; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--throttle-color-muted-foreground); }
|
|
956
|
+
.tsf-buy-box-title {
|
|
957
|
+
margin: 0;
|
|
958
|
+
font-family: var(--throttle-font-family-heading, inherit);
|
|
959
|
+
font-size: clamp(26px, 3vw, 36px);
|
|
960
|
+
line-height: 1.15;
|
|
961
|
+
font-weight: var(--throttle-sf-heading-weight);
|
|
962
|
+
letter-spacing: var(--throttle-sf-heading-tracking);
|
|
963
|
+
text-transform: var(--throttle-sf-heading-transform);
|
|
964
|
+
overflow-wrap: anywhere;
|
|
965
|
+
}
|
|
966
|
+
.tsf-buy-box-rating { justify-self: start; color: inherit; text-decoration: none; }
|
|
967
|
+
.tsf-buy-box-summary { margin: 0; color: var(--throttle-color-muted-foreground); line-height: 1.55; }
|
|
968
|
+
.tsf-buy-box-price { margin: 0; font-size: 22px; }
|
|
969
|
+
.tsf-buy-box-sku { margin: 0; font-size: 13px; color: var(--throttle-color-muted-foreground); }
|
|
970
|
+
.tsf-buy-box-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
|
|
971
|
+
|
|
972
|
+
/* Variant picker */
|
|
973
|
+
.tsf-variant-picker { display: grid; gap: 16px; }
|
|
974
|
+
.tsf-variant-option { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
|
|
975
|
+
.tsf-variant-option-legend { display: flex; gap: 8px; align-items: baseline; padding: 0; margin-block-end: 8px; font-size: 14px; }
|
|
976
|
+
.tsf-variant-option-name { font-weight: 600; }
|
|
977
|
+
.tsf-variant-option-chosen { color: var(--throttle-color-muted-foreground); }
|
|
978
|
+
.tsf-variant-option-values { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
979
|
+
.tsf-variant-value {
|
|
980
|
+
position: relative;
|
|
981
|
+
display: inline-flex;
|
|
982
|
+
align-items: center;
|
|
983
|
+
justify-content: center;
|
|
984
|
+
min-inline-size: 44px;
|
|
985
|
+
min-block-size: 44px;
|
|
986
|
+
padding-inline: 14px;
|
|
987
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
988
|
+
border-radius: var(--throttle-radius);
|
|
989
|
+
background: var(--throttle-color-background);
|
|
990
|
+
color: var(--throttle-color-foreground);
|
|
991
|
+
font: inherit;
|
|
992
|
+
cursor: pointer;
|
|
993
|
+
overflow: hidden;
|
|
994
|
+
}
|
|
995
|
+
.tsf-variant-value:where([data-kind="swatch"]) { padding-inline: 0; border-radius: 999px; min-inline-size: 44px; }
|
|
996
|
+
.tsf-variant-value:hover { border-color: var(--throttle-color-foreground); }
|
|
997
|
+
.tsf-variant-value:where([aria-pressed="true"]) { border-color: var(--throttle-color-foreground); box-shadow: inset 0 0 0 1px var(--throttle-color-foreground); }
|
|
998
|
+
.tsf-variant-value:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: 2px; }
|
|
999
|
+
.tsf-variant-value:where([data-sold-out]), .tsf-variant-value:where([data-unavailable]) { color: var(--throttle-color-muted-foreground); }
|
|
1000
|
+
.tsf-variant-value:where([data-sold-out])::after {
|
|
1001
|
+
content: "";
|
|
1002
|
+
position: absolute;
|
|
1003
|
+
inset: 0;
|
|
1004
|
+
background: linear-gradient(to bottom right, transparent calc(50% - 1px), var(--throttle-color-muted-foreground) 50%, transparent calc(50% + 1px));
|
|
1005
|
+
pointer-events: none;
|
|
1006
|
+
}
|
|
1007
|
+
.tsf-variant-value:where([data-unavailable]) { border-style: dashed; }
|
|
1008
|
+
.tsf-variant-value-label { pointer-events: none; }
|
|
1009
|
+
|
|
1010
|
+
/* Stock, quantity, add */
|
|
1011
|
+
.tsf-stock-status { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
|
|
1012
|
+
.tsf-stock-status::before { content: ""; inline-size: 8px; block-size: 8px; border-radius: 999px; background: var(--throttle-sf-success); }
|
|
1013
|
+
.tsf-stock-status:where([data-state="low"])::before { background: var(--throttle-sf-warning); }
|
|
1014
|
+
.tsf-stock-status:where([data-state="out"])::before, .tsf-stock-status:where([data-state="no_currency"])::before { background: var(--throttle-color-muted-foreground); }
|
|
1015
|
+
.tsf-stock-status:where([data-state="backorder"])::before, .tsf-stock-status:where([data-state="preorder"])::before { background: var(--throttle-sf-accent); }
|
|
1016
|
+
|
|
1017
|
+
.tsf-quantity-input { display: inline-flex; align-items: stretch; border: 1px solid var(--throttle-color-border-control); border-radius: var(--throttle-radius); overflow: hidden; }
|
|
1018
|
+
.tsf-quantity-decrease, .tsf-quantity-increase {
|
|
1019
|
+
inline-size: 44px;
|
|
1020
|
+
min-block-size: 48px;
|
|
1021
|
+
padding: 0;
|
|
1022
|
+
border: 0;
|
|
1023
|
+
background: var(--throttle-color-background);
|
|
1024
|
+
color: var(--throttle-color-foreground);
|
|
1025
|
+
font-size: 18px;
|
|
1026
|
+
cursor: pointer;
|
|
1027
|
+
}
|
|
1028
|
+
.tsf-quantity-decrease:where([aria-disabled="true"]), .tsf-quantity-increase:where([aria-disabled="true"]) { opacity: 0.4; cursor: not-allowed; }
|
|
1029
|
+
.tsf-quantity-field {
|
|
1030
|
+
inline-size: 56px;
|
|
1031
|
+
padding: 0;
|
|
1032
|
+
border: 0;
|
|
1033
|
+
border-inline: 1px solid var(--throttle-color-border);
|
|
1034
|
+
background: var(--throttle-color-background);
|
|
1035
|
+
color: var(--throttle-color-foreground);
|
|
1036
|
+
font: inherit;
|
|
1037
|
+
text-align: center;
|
|
1038
|
+
appearance: textfield;
|
|
1039
|
+
-moz-appearance: textfield;
|
|
1040
|
+
}
|
|
1041
|
+
.tsf-quantity-field::-webkit-outer-spin-button, .tsf-quantity-field::-webkit-inner-spin-button { appearance: none; margin: 0; }
|
|
1042
|
+
|
|
1043
|
+
.tsf-add-to-cart { display: grid; gap: 8px; min-inline-size: 0; }
|
|
1044
|
+
.tsf-add-to-cart-button, .tsf-sticky-add-to-cart-button {
|
|
1045
|
+
display: inline-flex;
|
|
1046
|
+
align-items: center;
|
|
1047
|
+
justify-content: center;
|
|
1048
|
+
gap: 8px;
|
|
1049
|
+
inline-size: 100%;
|
|
1050
|
+
min-block-size: 48px;
|
|
1051
|
+
padding-inline: 20px;
|
|
1052
|
+
border: 1px solid transparent;
|
|
1053
|
+
border-radius: var(--throttle-radius);
|
|
1054
|
+
background: var(--throttle-color-primary);
|
|
1055
|
+
color: var(--throttle-color-primary-foreground);
|
|
1056
|
+
font: inherit;
|
|
1057
|
+
font-weight: 600;
|
|
1058
|
+
cursor: pointer;
|
|
1059
|
+
}
|
|
1060
|
+
.tsf-add-to-cart-button:hover:not(:disabled), .tsf-sticky-add-to-cart-button:hover:not(:disabled) { filter: brightness(0.92); }
|
|
1061
|
+
.tsf-add-to-cart-button:disabled, .tsf-sticky-add-to-cart-button:disabled { opacity: 0.55; cursor: not-allowed; }
|
|
1062
|
+
.tsf-add-to-cart-button:where([aria-disabled="true"]) { cursor: progress; }
|
|
1063
|
+
.tsf-add-to-cart-button:focus-visible, .tsf-sticky-add-to-cart-button:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: 2px; }
|
|
1064
|
+
.tsf-add-to-cart-message { margin: 0; min-block-size: 1.4em; font-size: 14px; }
|
|
1065
|
+
.tsf-add-to-cart-message:where([data-tone="ok"]) { color: var(--throttle-sf-success); }
|
|
1066
|
+
.tsf-add-to-cart-message:where([data-tone="refused"]) { color: var(--throttle-sf-danger); }
|
|
1067
|
+
|
|
1068
|
+
.tsf-sticky-add-to-cart {
|
|
1069
|
+
position: fixed;
|
|
1070
|
+
inset-inline: 0;
|
|
1071
|
+
inset-block-end: 0;
|
|
1072
|
+
z-index: var(--throttle-z-popover, 30);
|
|
1073
|
+
display: flex;
|
|
1074
|
+
align-items: center;
|
|
1075
|
+
gap: 16px;
|
|
1076
|
+
padding: 12px 16px;
|
|
1077
|
+
border-block-start: 1px solid var(--throttle-color-border);
|
|
1078
|
+
background: var(--throttle-color-background);
|
|
1079
|
+
box-shadow: var(--throttle-shadow-popover, 0 -4px 16px rgba(0, 0, 0, 0.08));
|
|
1080
|
+
}
|
|
1081
|
+
.tsf-sticky-add-to-cart-title { flex: 1 1 auto; margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-inline-size: 0; }
|
|
1082
|
+
.tsf-sticky-add-to-cart-price { margin: 0; flex: 0 0 auto; }
|
|
1083
|
+
.tsf-sticky-add-to-cart-button { inline-size: auto; flex: 0 0 auto; }
|
|
1084
|
+
|
|
1085
|
+
/* Sections */
|
|
1086
|
+
.tsf-product-sections { display: grid; gap: 32px; }
|
|
1087
|
+
.tsf-product-sections:where([data-style="accordion"]) { gap: 0; border-block-start: 1px solid var(--throttle-color-border); }
|
|
1088
|
+
.tsf-product-section { min-inline-size: 0; scroll-margin-block-start: 16px; }
|
|
1089
|
+
.tsf-product-section:where([hidden]) { display: none; }
|
|
1090
|
+
.tsf-product-section-title {
|
|
1091
|
+
margin: 0 0 12px;
|
|
1092
|
+
font-family: var(--throttle-font-family-heading, inherit);
|
|
1093
|
+
font-size: 22px;
|
|
1094
|
+
font-weight: var(--throttle-sf-heading-weight);
|
|
1095
|
+
letter-spacing: var(--throttle-sf-heading-tracking);
|
|
1096
|
+
text-transform: var(--throttle-sf-heading-transform);
|
|
1097
|
+
}
|
|
1098
|
+
.tsf-product-section-title:where([data-in-tabs]) { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
1099
|
+
.tsf-product-section-trigger {
|
|
1100
|
+
display: flex;
|
|
1101
|
+
align-items: center;
|
|
1102
|
+
justify-content: space-between;
|
|
1103
|
+
inline-size: 100%;
|
|
1104
|
+
min-block-size: 56px;
|
|
1105
|
+
padding: 0;
|
|
1106
|
+
border: 0;
|
|
1107
|
+
border-block-end: 1px solid var(--throttle-color-border);
|
|
1108
|
+
background: none;
|
|
1109
|
+
color: inherit;
|
|
1110
|
+
font: inherit;
|
|
1111
|
+
text-align: start;
|
|
1112
|
+
cursor: pointer;
|
|
1113
|
+
}
|
|
1114
|
+
.tsf-product-section-trigger:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }
|
|
1115
|
+
.tsf-product-section-body { padding-block: 16px; min-inline-size: 0; }
|
|
1116
|
+
.tsf-product-section-body:where([hidden]) { display: none; }
|
|
1117
|
+
.tsf-product-specs { display: grid; margin: 0; }
|
|
1118
|
+
.tsf-product-specs-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; gap: 16px; padding-block: 10px; border-block-end: 1px solid var(--throttle-color-border); }
|
|
1119
|
+
.tsf-product-specs-label { margin: 0; color: var(--throttle-color-muted-foreground); text-transform: capitalize; }
|
|
1120
|
+
.tsf-product-specs-value { margin: 0; overflow-wrap: anywhere; }
|
|
1121
|
+
.tsf-shipping-section { line-height: 1.6; }
|
|
1122
|
+
|
|
1123
|
+
.tsf-tag-list, .tsf-category-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
|
|
1124
|
+
.tsf-tag-list-link, .tsf-category-list-link {
|
|
1125
|
+
display: inline-flex;
|
|
1126
|
+
align-items: center;
|
|
1127
|
+
min-block-size: 36px;
|
|
1128
|
+
padding-inline: 14px;
|
|
1129
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
1130
|
+
border-radius: 999px;
|
|
1131
|
+
color: inherit;
|
|
1132
|
+
text-decoration: none;
|
|
1133
|
+
font-size: 14px;
|
|
1134
|
+
}
|
|
1135
|
+
.tsf-tag-list-link:hover, .tsf-category-list-link:hover { border-color: var(--throttle-color-foreground); }
|
|
1136
|
+
|
|
1137
|
+
.tsf-related-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--throttle-sf-grid-gap); margin: 0; padding: 0; list-style: none; }
|
|
1138
|
+
.tsf-related-products-item { min-inline-size: 0; }
|
|
1139
|
+
|
|
1140
|
+
/* Reviews */
|
|
1141
|
+
.tsf-product-reviews { display: grid; gap: 24px; }
|
|
1142
|
+
.tsf-product-reviews-summary { display: grid; gap: 12px; max-inline-size: 420px; }
|
|
1143
|
+
.tsf-product-reviews-main { display: grid; gap: 24px; min-inline-size: 0; }
|
|
1144
|
+
@media (min-width: 768px) {
|
|
1145
|
+
.tsf-product-reviews:where([data-layout="columns"]) { grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr); gap: 48px; align-items: start; }
|
|
1146
|
+
.tsf-product-reviews-summary:where([data-layout="columns"]) { max-inline-size: none; }
|
|
1147
|
+
}
|
|
1148
|
+
.tsf-product-reviews-average { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 36px; font-weight: 600; }
|
|
1149
|
+
.tsf-product-reviews-histogram { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
|
|
1150
|
+
.tsf-product-reviews-histogram-row {
|
|
1151
|
+
display: grid;
|
|
1152
|
+
grid-template-columns: 36px minmax(0, 1fr) 32px;
|
|
1153
|
+
align-items: center;
|
|
1154
|
+
gap: 10px;
|
|
1155
|
+
inline-size: 100%;
|
|
1156
|
+
min-block-size: 32px;
|
|
1157
|
+
padding: 0 6px;
|
|
1158
|
+
border: 1px solid transparent;
|
|
1159
|
+
border-radius: var(--throttle-radius-sm, 6px);
|
|
1160
|
+
background: none;
|
|
1161
|
+
color: inherit;
|
|
1162
|
+
font: inherit;
|
|
1163
|
+
font-size: 14px;
|
|
1164
|
+
cursor: pointer;
|
|
1165
|
+
}
|
|
1166
|
+
.tsf-product-reviews-histogram-row:hover { background: var(--throttle-color-muted); }
|
|
1167
|
+
.tsf-product-reviews-histogram-row:where([aria-pressed="true"]) { border-color: var(--throttle-color-foreground); background: var(--throttle-color-muted); }
|
|
1168
|
+
.tsf-product-reviews-histogram-row:focus-visible { outline: 2px solid var(--throttle-color-primary); }
|
|
1169
|
+
.tsf-product-reviews-histogram-bar { display: block; block-size: 8px; border-radius: 999px; background: var(--throttle-color-muted); overflow: hidden; }
|
|
1170
|
+
.tsf-product-reviews-histogram-fill { display: block; block-size: 100%; background: var(--throttle-color-warning); }
|
|
1171
|
+
.tsf-product-reviews-histogram-count { text-align: end; font-variant-numeric: tabular-nums; color: var(--throttle-color-muted-foreground); }
|
|
1172
|
+
.tsf-product-reviews-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
|
|
1173
|
+
.tsf-product-reviews-clear { min-block-size: 44px; padding-inline: 4px; border: 0; background: none; color: var(--throttle-sf-accent); font: inherit; text-decoration: underline; cursor: pointer; }
|
|
1174
|
+
.tsf-product-reviews-list { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
|
|
1175
|
+
.tsf-product-review { display: grid; gap: 6px; padding-block-end: 20px; border-block-end: 1px solid var(--throttle-color-border); }
|
|
1176
|
+
.tsf-product-review-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
|
1177
|
+
.tsf-product-review-date { font-size: 13px; color: var(--throttle-color-muted-foreground); }
|
|
1178
|
+
.tsf-product-review-title { margin: 0; font-size: 16px; }
|
|
1179
|
+
.tsf-product-review-body { margin: 0; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-line; }
|
|
1180
|
+
.tsf-product-review-author { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--throttle-color-muted-foreground); }
|
|
1181
|
+
.tsf-product-review-reply { padding: 12px 16px; border-inline-start: 3px solid var(--throttle-color-border-control); background: var(--throttle-color-muted); font-size: 14px; }
|
|
1182
|
+
.tsf-product-reviews-load-more {
|
|
1183
|
+
justify-self: start;
|
|
1184
|
+
min-block-size: 44px;
|
|
1185
|
+
padding-inline: 20px;
|
|
1186
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
1187
|
+
border-radius: var(--throttle-radius);
|
|
1188
|
+
background: var(--throttle-color-background);
|
|
1189
|
+
color: inherit;
|
|
1190
|
+
font: inherit;
|
|
1191
|
+
cursor: pointer;
|
|
1192
|
+
}
|
|
1193
|
+
.tsf-product-reviews-load-more:where([aria-disabled="true"]) { cursor: progress; opacity: 0.7; }
|
|
1194
|
+
.tsf-product-reviews-empty, .tsf-product-reviews-gate, .tsf-product-reviews-error { margin: 0; color: var(--throttle-color-muted-foreground); }
|
|
1195
|
+
.tsf-product-reviews-error { color: var(--throttle-sf-danger); }
|
|
1196
|
+
|
|
1197
|
+
.tsf-review-form { display: grid; gap: 14px; max-inline-size: 520px; padding: 20px; border: 1px solid var(--throttle-color-border); border-radius: var(--throttle-sf-card-radius); }
|
|
1198
|
+
.tsf-review-form-title { margin: 0; font-weight: 600; font-size: 18px; }
|
|
1199
|
+
.tsf-review-form-stars { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; border: 0; }
|
|
1200
|
+
.tsf-review-form-star { position: relative; display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; font-size: 26px; color: var(--throttle-color-border-control); cursor: pointer; }
|
|
1201
|
+
.tsf-review-form-star:where([data-on="true"]) { color: var(--throttle-color-warning); }
|
|
1202
|
+
.tsf-review-form-star-input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
|
|
1203
|
+
.tsf-review-form-star:focus-within { outline: 2px solid var(--throttle-color-primary); border-radius: 6px; }
|
|
1204
|
+
.tsf-review-form-field { display: grid; gap: 6px; font-size: 14px; }
|
|
1205
|
+
.tsf-review-form-textarea { padding: 10px 12px; border: 1px solid var(--throttle-color-border-control); border-radius: var(--throttle-radius); background: var(--throttle-color-background); color: inherit; font: inherit; resize: vertical; }
|
|
1206
|
+
.tsf-review-form-error { display: block; font-size: 13px; color: var(--throttle-sf-danger); }
|
|
1207
|
+
.tsf-review-form-submit { justify-self: start; min-block-size: 48px; padding-inline: 24px; border: 0; border-radius: var(--throttle-radius); background: var(--throttle-color-primary); color: var(--throttle-color-primary-foreground); font: inherit; font-weight: 600; cursor: pointer; }
|
|
1208
|
+
.tsf-review-form-submit:where([aria-disabled="true"]) { cursor: progress; opacity: 0.7; }
|
|
1209
|
+
.tsf-review-form-thanks { margin: 0; padding: 14px 16px; border-radius: var(--throttle-radius); background: var(--throttle-color-success-surface, var(--throttle-color-muted)); }
|
|
1210
|
+
|
|
1211
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1212
|
+
.tsf-gallery-item { transition: none; }
|
|
1213
|
+
}
|
|
1214
|
+
`;
|
|
1215
|
+
|
|
1216
|
+
// src/styles/shop.css.ts
|
|
1217
|
+
var SHOP_CSS = `
|
|
1218
|
+
.tsf-shop-all { display: flex; flex-direction: column; gap: 16px; min-inline-size: 0; padding-block: 24px; }
|
|
1219
|
+
|
|
1220
|
+
.tsf-shop-all-heading {
|
|
1221
|
+
margin: 0;
|
|
1222
|
+
font-size: 28px;
|
|
1223
|
+
line-height: 1.2;
|
|
1224
|
+
font-weight: var(--throttle-sf-heading-weight);
|
|
1225
|
+
letter-spacing: var(--throttle-sf-heading-tracking);
|
|
1226
|
+
text-transform: var(--throttle-sf-heading-transform);
|
|
1227
|
+
}
|
|
1228
|
+
.tsf-shop-all-description { margin: 0; max-inline-size: 70ch; color: var(--throttle-color-muted-foreground); line-height: 1.6; }
|
|
1229
|
+
|
|
1230
|
+
.tsf-shop-all-breadcrumb-list { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--throttle-color-muted-foreground); }
|
|
1231
|
+
.tsf-shop-all-breadcrumb:where(:not(:last-child))::after { content: "/"; margin-inline-start: 8px; opacity: 0.6; }
|
|
1232
|
+
.tsf-shop-all-breadcrumb-link { color: inherit; text-decoration: none; }
|
|
1233
|
+
.tsf-shop-all-breadcrumb-link:hover { color: var(--throttle-color-foreground); text-decoration: underline; }
|
|
1234
|
+
|
|
1235
|
+
.tsf-shop-all-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
|
|
1236
|
+
.tsf-shop-all-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
|
|
1237
|
+
.tsf-result-count { margin: 0; color: var(--throttle-color-muted-foreground); font-size: 14px; }
|
|
1238
|
+
|
|
1239
|
+
.tsf-shop-all-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
|
|
1240
|
+
.tsf-shop-all-body:where([data-layout="sidebar"]) { grid-template-columns: 240px minmax(0, 1fr); }
|
|
1241
|
+
.tsf-shop-all-main { display: flex; flex-direction: column; gap: 24px; min-inline-size: 0; }
|
|
1242
|
+
|
|
1243
|
+
.tsf-live-region {
|
|
1244
|
+
position: absolute;
|
|
1245
|
+
inline-size: 1px;
|
|
1246
|
+
block-size: 1px;
|
|
1247
|
+
margin: -1px;
|
|
1248
|
+
padding: 0;
|
|
1249
|
+
overflow: hidden;
|
|
1250
|
+
clip: rect(0 0 0 0);
|
|
1251
|
+
white-space: nowrap;
|
|
1252
|
+
border: 0;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
/* Sort */
|
|
1256
|
+
.tsf-sort-select { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
|
|
1257
|
+
.tsf-sort-select-input,
|
|
1258
|
+
.tsf-facet-select,
|
|
1259
|
+
.tsf-facet-search,
|
|
1260
|
+
.tsf-facet-range-input {
|
|
1261
|
+
min-block-size: 44px;
|
|
1262
|
+
padding-inline: 12px;
|
|
1263
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
1264
|
+
border-radius: var(--throttle-sf-card-radius);
|
|
1265
|
+
background: var(--throttle-color-background);
|
|
1266
|
+
color: var(--throttle-color-foreground);
|
|
1267
|
+
font: inherit;
|
|
1268
|
+
box-sizing: border-box;
|
|
1269
|
+
}
|
|
1270
|
+
.tsf-facet-select, .tsf-facet-search { inline-size: 100%; }
|
|
1271
|
+
|
|
1272
|
+
/* Filters: the column */
|
|
1273
|
+
.tsf-filter-sidebar { display: flex; flex-direction: column; gap: 4px; min-inline-size: 0; }
|
|
1274
|
+
.tsf-filter-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block-end: 8px; }
|
|
1275
|
+
.tsf-filter-sidebar-title { margin: 0; font-size: 16px; font-weight: var(--throttle-sf-heading-weight); }
|
|
1276
|
+
.tsf-filter-clear, .tsf-active-filters-clear, .tsf-facet-range-clear, .tsf-facet-show-all {
|
|
1277
|
+
padding: 0;
|
|
1278
|
+
min-block-size: 44px;
|
|
1279
|
+
border: 0;
|
|
1280
|
+
background: none;
|
|
1281
|
+
color: var(--throttle-sf-accent);
|
|
1282
|
+
font: inherit;
|
|
1283
|
+
font-size: 14px;
|
|
1284
|
+
text-decoration: underline;
|
|
1285
|
+
text-underline-offset: 2px;
|
|
1286
|
+
cursor: pointer;
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
/* Filters: the top bar and the drawer trigger */
|
|
1290
|
+
.tsf-filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
1291
|
+
.tsf-filter-bar-more,
|
|
1292
|
+
.tsf-filter-drawer-trigger {
|
|
1293
|
+
display: inline-flex;
|
|
1294
|
+
align-items: center;
|
|
1295
|
+
gap: 8px;
|
|
1296
|
+
min-block-size: 44px;
|
|
1297
|
+
padding-inline: 14px;
|
|
1298
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
1299
|
+
border-radius: var(--throttle-sf-card-radius);
|
|
1300
|
+
background: var(--throttle-color-background);
|
|
1301
|
+
color: var(--throttle-color-foreground);
|
|
1302
|
+
font: inherit;
|
|
1303
|
+
cursor: pointer;
|
|
1304
|
+
}
|
|
1305
|
+
.tsf-filter-drawer-count, .tsf-facet-selected {
|
|
1306
|
+
display: inline-flex;
|
|
1307
|
+
align-items: center;
|
|
1308
|
+
justify-content: center;
|
|
1309
|
+
min-inline-size: 20px;
|
|
1310
|
+
padding-inline: 6px;
|
|
1311
|
+
border-radius: 999px;
|
|
1312
|
+
background: var(--throttle-sf-accent);
|
|
1313
|
+
color: var(--throttle-color-background);
|
|
1314
|
+
font-size: 12px;
|
|
1315
|
+
line-height: 20px;
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
/* A facet */
|
|
1319
|
+
.tsf-facet { min-inline-size: 0; border-block-start: 1px solid var(--throttle-color-border); }
|
|
1320
|
+
.tsf-facet:where([data-presentation="dropdown"]) { border: 0; position: relative; }
|
|
1321
|
+
.tsf-facet-heading { margin: 0; font-size: 15px; }
|
|
1322
|
+
.tsf-facet-toggle {
|
|
1323
|
+
display: flex;
|
|
1324
|
+
align-items: center;
|
|
1325
|
+
gap: 8px;
|
|
1326
|
+
inline-size: 100%;
|
|
1327
|
+
min-block-size: 44px;
|
|
1328
|
+
padding: 0;
|
|
1329
|
+
border: 0;
|
|
1330
|
+
background: none;
|
|
1331
|
+
color: inherit;
|
|
1332
|
+
font: inherit;
|
|
1333
|
+
font-weight: 600;
|
|
1334
|
+
text-align: start;
|
|
1335
|
+
cursor: pointer;
|
|
1336
|
+
}
|
|
1337
|
+
.tsf-facet-label { flex: 1; text-align: start; }
|
|
1338
|
+
.tsf-facet-body { padding-block-end: 12px; }
|
|
1339
|
+
.tsf-facet-fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
|
|
1340
|
+
.tsf-facet-legend {
|
|
1341
|
+
position: absolute;
|
|
1342
|
+
inline-size: 1px;
|
|
1343
|
+
block-size: 1px;
|
|
1344
|
+
margin: -1px;
|
|
1345
|
+
padding: 0;
|
|
1346
|
+
overflow: hidden;
|
|
1347
|
+
clip: rect(0 0 0 0);
|
|
1348
|
+
white-space: nowrap;
|
|
1349
|
+
border: 0;
|
|
1350
|
+
}
|
|
1351
|
+
.tsf-facet-trigger {
|
|
1352
|
+
display: inline-flex;
|
|
1353
|
+
align-items: center;
|
|
1354
|
+
gap: 8px;
|
|
1355
|
+
min-block-size: 44px;
|
|
1356
|
+
padding-inline: 14px;
|
|
1357
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
1358
|
+
border-radius: var(--throttle-sf-card-radius);
|
|
1359
|
+
background: var(--throttle-color-background);
|
|
1360
|
+
color: var(--throttle-color-foreground);
|
|
1361
|
+
font: inherit;
|
|
1362
|
+
cursor: pointer;
|
|
1363
|
+
}
|
|
1364
|
+
.tsf-facet-trigger:where([aria-expanded="true"]) { border-color: var(--throttle-color-foreground); }
|
|
1365
|
+
.tsf-facet-panel {
|
|
1366
|
+
position: absolute;
|
|
1367
|
+
inset-block-start: calc(100% + 4px);
|
|
1368
|
+
inset-inline-start: 0;
|
|
1369
|
+
z-index: 20;
|
|
1370
|
+
min-inline-size: 240px;
|
|
1371
|
+
max-block-size: 360px;
|
|
1372
|
+
overflow-y: auto;
|
|
1373
|
+
padding: 8px 14px;
|
|
1374
|
+
border: 1px solid var(--throttle-color-border);
|
|
1375
|
+
border-radius: var(--throttle-sf-card-radius);
|
|
1376
|
+
background: var(--throttle-color-background);
|
|
1377
|
+
box-shadow: 0 8px 24px rgb(0 0 0 / 0.14);
|
|
1378
|
+
}
|
|
1379
|
+
.tsf-facet-options { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
|
|
1380
|
+
.tsf-facet-search { margin-block-end: 8px; }
|
|
1381
|
+
.tsf-facet-option-label { display: flex; align-items: center; gap: 10px; min-block-size: 44px; cursor: pointer; font-size: 14px; }
|
|
1382
|
+
.tsf-facet-option:where([data-empty]) { opacity: 0.5; }
|
|
1383
|
+
.tsf-facet-option-input { inline-size: 18px; block-size: 18px; margin: 0; accent-color: var(--throttle-sf-accent); }
|
|
1384
|
+
.tsf-facet-option-text { flex: 1; overflow-wrap: anywhere; }
|
|
1385
|
+
.tsf-facet-option-count { color: var(--throttle-color-muted-foreground); font-variant-numeric: tabular-nums; font-size: 13px; }
|
|
1386
|
+
.tsf-facet-empty { margin: 0; color: var(--throttle-color-muted-foreground); font-size: 14px; }
|
|
1387
|
+
.tsf-facet-boolean { display: flex; flex-direction: column; }
|
|
1388
|
+
|
|
1389
|
+
.tsf-facet-range { display: flex; flex-direction: column; gap: 8px; }
|
|
1390
|
+
.tsf-facet-range-fields { display: flex; gap: 8px; }
|
|
1391
|
+
.tsf-facet-range-field { display: flex; flex: 1; flex-direction: column; gap: 4px; min-inline-size: 0; font-size: 13px; }
|
|
1392
|
+
.tsf-facet-range-input { inline-size: 100%; }
|
|
1393
|
+
.tsf-facet-range-error { margin: 0; color: var(--throttle-sf-danger); font-size: 13px; }
|
|
1394
|
+
.tsf-facet-range-hint { margin: 0; color: var(--throttle-color-muted-foreground); font-size: 13px; }
|
|
1395
|
+
.tsf-facet-range-actions { display: flex; align-items: center; gap: 12px; }
|
|
1396
|
+
.tsf-facet-range-apply {
|
|
1397
|
+
min-block-size: 44px;
|
|
1398
|
+
padding-inline: 16px;
|
|
1399
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
1400
|
+
border-radius: var(--throttle-sf-card-radius);
|
|
1401
|
+
background: var(--throttle-color-background);
|
|
1402
|
+
color: var(--throttle-color-foreground);
|
|
1403
|
+
font: inherit;
|
|
1404
|
+
cursor: pointer;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
/* Filters: the drawer */
|
|
1408
|
+
.tsf-filter-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 20px; border-block-end: 1px solid var(--throttle-color-border); }
|
|
1409
|
+
.tsf-filter-drawer-title { margin: 0; font-size: 18px; font-weight: var(--throttle-sf-heading-weight); }
|
|
1410
|
+
.tsf-filter-drawer-close { display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; border: 0; background: none; color: inherit; cursor: pointer; }
|
|
1411
|
+
.tsf-filter-drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px; }
|
|
1412
|
+
.tsf-filter-drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-block-start: 1px solid var(--throttle-color-border); }
|
|
1413
|
+
.tsf-filter-drawer-apply {
|
|
1414
|
+
flex: 1;
|
|
1415
|
+
min-block-size: 44px;
|
|
1416
|
+
padding-inline: 16px;
|
|
1417
|
+
border: 0;
|
|
1418
|
+
border-radius: var(--throttle-sf-card-radius);
|
|
1419
|
+
background: var(--throttle-color-primary);
|
|
1420
|
+
color: var(--throttle-color-primary-foreground);
|
|
1421
|
+
font: inherit;
|
|
1422
|
+
font-weight: 600;
|
|
1423
|
+
cursor: pointer;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
/* The chips */
|
|
1427
|
+
.tsf-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
|
|
1428
|
+
.tsf-active-filter-remove {
|
|
1429
|
+
display: inline-flex;
|
|
1430
|
+
align-items: center;
|
|
1431
|
+
gap: 6px;
|
|
1432
|
+
min-block-size: 36px;
|
|
1433
|
+
padding-inline: 12px;
|
|
1434
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
1435
|
+
border-radius: 999px;
|
|
1436
|
+
background: var(--throttle-color-muted);
|
|
1437
|
+
color: inherit;
|
|
1438
|
+
font: inherit;
|
|
1439
|
+
font-size: 13px;
|
|
1440
|
+
cursor: pointer;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
/* The grid */
|
|
1444
|
+
.tsf-product-grid-pages { display: flex; flex-direction: column; gap: var(--throttle-sf-grid-gap); }
|
|
1445
|
+
.tsf-product-grid, .tsf-product-grid-skeleton {
|
|
1446
|
+
display: grid;
|
|
1447
|
+
grid-template-columns: repeat(var(--tsf-cols-mobile, 2), minmax(0, 1fr));
|
|
1448
|
+
gap: var(--throttle-sf-grid-gap);
|
|
1449
|
+
align-items: start;
|
|
1450
|
+
margin: 0;
|
|
1451
|
+
padding: 0;
|
|
1452
|
+
list-style: none;
|
|
1453
|
+
}
|
|
1454
|
+
@media (min-width: 768px) {
|
|
1455
|
+
.tsf-product-grid, .tsf-product-grid-skeleton { grid-template-columns: repeat(var(--tsf-cols-desktop, 4), minmax(0, 1fr)); }
|
|
1456
|
+
}
|
|
1457
|
+
.tsf-product-grid:where([data-previous]) { opacity: 0.55; transition: opacity 0.15s ease; }
|
|
1458
|
+
.tsf-product-grid-item { min-inline-size: 0; }
|
|
1459
|
+
.tsf-product-grid-skeleton-item { aspect-ratio: 4 / 5; border-radius: var(--throttle-sf-card-radius); background: var(--throttle-color-muted); animation: tsf-shop-pulse 1.4s ease-in-out infinite; }
|
|
1460
|
+
@keyframes tsf-shop-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
|
|
1461
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1462
|
+
.tsf-product-grid-skeleton-item { animation: none; }
|
|
1463
|
+
.tsf-product-grid:where([data-previous]) { transition: none; }
|
|
1464
|
+
}
|
|
1465
|
+
.tsf-product-grid-empty, .tsf-product-grid-error { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-block: 48px; text-align: center; color: var(--throttle-color-muted-foreground); }
|
|
1466
|
+
|
|
1467
|
+
/* Pagination */
|
|
1468
|
+
.tsf-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
|
|
1469
|
+
.tsf-pagination-list { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
|
|
1470
|
+
.tsf-pagination-link, .tsf-pagination-step, .tsf-pagination-gap {
|
|
1471
|
+
display: inline-flex;
|
|
1472
|
+
align-items: center;
|
|
1473
|
+
justify-content: center;
|
|
1474
|
+
min-inline-size: 44px;
|
|
1475
|
+
min-block-size: 44px;
|
|
1476
|
+
padding-inline: 8px;
|
|
1477
|
+
border-radius: var(--throttle-sf-card-radius);
|
|
1478
|
+
color: inherit;
|
|
1479
|
+
text-decoration: none;
|
|
1480
|
+
font-variant-numeric: tabular-nums;
|
|
1481
|
+
box-sizing: border-box;
|
|
1482
|
+
}
|
|
1483
|
+
.tsf-pagination-link:hover, .tsf-pagination-step:hover { background: var(--throttle-color-muted); }
|
|
1484
|
+
.tsf-pagination-link:where([aria-current="page"]) { border: 1px solid var(--throttle-color-foreground); font-weight: 600; }
|
|
1485
|
+
.tsf-pagination-step:where([data-disabled]) { opacity: 0.4; }
|
|
1486
|
+
.tsf-pagination-more {
|
|
1487
|
+
min-block-size: 44px;
|
|
1488
|
+
padding-inline: 24px;
|
|
1489
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
1490
|
+
border-radius: var(--throttle-sf-card-radius);
|
|
1491
|
+
background: var(--throttle-color-background);
|
|
1492
|
+
color: var(--throttle-color-foreground);
|
|
1493
|
+
font: inherit;
|
|
1494
|
+
cursor: pointer;
|
|
1495
|
+
}
|
|
1496
|
+
.tsf-pagination-more:where([aria-disabled="true"]) { opacity: 0.6; cursor: progress; }
|
|
1497
|
+
.tsf-pagination-crawl {
|
|
1498
|
+
position: absolute;
|
|
1499
|
+
inline-size: 1px;
|
|
1500
|
+
block-size: 1px;
|
|
1501
|
+
margin: -1px;
|
|
1502
|
+
overflow: hidden;
|
|
1503
|
+
clip: rect(0 0 0 0);
|
|
1504
|
+
white-space: nowrap;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
/* From 768px up the sidebar or the bar are the filters, and the drawer's button is only for phones. */
|
|
1508
|
+
@media (min-width: 768px) {
|
|
1509
|
+
.tsf-filter-drawer-trigger:where([data-phone-only]) { display: none; }
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
/* Phones: every filter layout is the drawer. */
|
|
1513
|
+
@media (max-width: 767px) {
|
|
1514
|
+
.tsf-filter-sidebar, .tsf-filter-bar { display: none; }
|
|
1515
|
+
.tsf-shop-all-body:where([data-layout="sidebar"]) { grid-template-columns: minmax(0, 1fr); }
|
|
1516
|
+
}
|
|
1517
|
+
`;
|
|
1518
|
+
|
|
1519
|
+
// src/styles/shopper.css.ts
|
|
1520
|
+
var SHOPPER_CSS = `
|
|
1521
|
+
/* Cart drawer */
|
|
1522
|
+
.tsf-cart-drawer {
|
|
1523
|
+
display: flex;
|
|
1524
|
+
flex-direction: column;
|
|
1525
|
+
block-size: 100%;
|
|
1526
|
+
min-block-size: 0;
|
|
1527
|
+
color: var(--throttle-color-foreground);
|
|
1528
|
+
}
|
|
1529
|
+
.tsf-cart-drawer:where([data-inline]) { block-size: auto; }
|
|
1530
|
+
.tsf-cart-drawer-top {
|
|
1531
|
+
display: flex;
|
|
1532
|
+
align-items: center;
|
|
1533
|
+
justify-content: space-between;
|
|
1534
|
+
gap: 12px;
|
|
1535
|
+
padding-block: 12px;
|
|
1536
|
+
padding-inline: 20px;
|
|
1537
|
+
border-block-end: 1px solid var(--throttle-color-border);
|
|
1538
|
+
}
|
|
1539
|
+
.tsf-cart-drawer-title {
|
|
1540
|
+
margin: 0;
|
|
1541
|
+
font-family: var(--throttle-font-family-heading, inherit);
|
|
1542
|
+
font-size: 20px;
|
|
1543
|
+
font-weight: var(--throttle-sf-heading-weight);
|
|
1544
|
+
letter-spacing: var(--throttle-sf-heading-tracking);
|
|
1545
|
+
text-transform: var(--throttle-sf-heading-transform);
|
|
1546
|
+
}
|
|
1547
|
+
.tsf-cart-drawer-title:where([data-inline]) { margin-block-end: 12px; }
|
|
1548
|
+
.tsf-cart-drawer-close {
|
|
1549
|
+
display: inline-flex;
|
|
1550
|
+
align-items: center;
|
|
1551
|
+
justify-content: center;
|
|
1552
|
+
min-inline-size: 44px;
|
|
1553
|
+
min-block-size: 44px;
|
|
1554
|
+
border: 0;
|
|
1555
|
+
border-radius: 8px;
|
|
1556
|
+
background: transparent;
|
|
1557
|
+
color: inherit;
|
|
1558
|
+
cursor: pointer;
|
|
1559
|
+
}
|
|
1560
|
+
.tsf-cart-drawer-close:focus-visible,
|
|
1561
|
+
.tsf-cart-line-remove:focus-visible,
|
|
1562
|
+
.tsf-cart-line-decrease:focus-visible,
|
|
1563
|
+
.tsf-cart-line-increase:focus-visible,
|
|
1564
|
+
.tsf-cart-checkout:focus-visible,
|
|
1565
|
+
.tsf-cart-continue:focus-visible,
|
|
1566
|
+
.tsf-quick-add-button:focus-visible,
|
|
1567
|
+
.tsf-compare-button:focus-visible,
|
|
1568
|
+
.tsf-compare-clear:focus-visible,
|
|
1569
|
+
.tsf-compare-product-remove:focus-visible {
|
|
1570
|
+
outline: 2px solid var(--throttle-color-primary);
|
|
1571
|
+
outline-offset: 2px;
|
|
1572
|
+
}
|
|
1573
|
+
.tsf-cart-drawer-body {
|
|
1574
|
+
display: flex;
|
|
1575
|
+
flex-direction: column;
|
|
1576
|
+
flex: 1 1 auto;
|
|
1577
|
+
min-block-size: 0;
|
|
1578
|
+
}
|
|
1579
|
+
.tsf-cart-status:empty { display: none; }
|
|
1580
|
+
.tsf-cart-status { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
1581
|
+
.tsf-cart-error {
|
|
1582
|
+
margin: 12px 20px 0;
|
|
1583
|
+
padding: 10px 12px;
|
|
1584
|
+
border-radius: var(--throttle-radius);
|
|
1585
|
+
background: var(--throttle-color-muted);
|
|
1586
|
+
color: var(--throttle-sf-danger);
|
|
1587
|
+
font-size: 14px;
|
|
1588
|
+
}
|
|
1589
|
+
.tsf-cart-loading { padding: 20px; }
|
|
1590
|
+
.tsf-cart-empty { display: grid; justify-items: center; gap: 16px; padding: 48px 20px; text-align: center; }
|
|
1591
|
+
.tsf-cart-empty-text { margin: 0; color: var(--throttle-color-muted-foreground); }
|
|
1592
|
+
.tsf-cart-lines {
|
|
1593
|
+
flex: 1 1 auto;
|
|
1594
|
+
min-block-size: 0;
|
|
1595
|
+
margin: 0;
|
|
1596
|
+
padding: 0 20px;
|
|
1597
|
+
list-style: none;
|
|
1598
|
+
overflow-y: auto;
|
|
1599
|
+
}
|
|
1600
|
+
.tsf-cart-line {
|
|
1601
|
+
display: grid;
|
|
1602
|
+
grid-template-columns: 72px minmax(0, 1fr) auto;
|
|
1603
|
+
grid-template-areas: "media body total" "media body remove";
|
|
1604
|
+
align-items: start;
|
|
1605
|
+
gap: 4px 12px;
|
|
1606
|
+
padding-block: 16px;
|
|
1607
|
+
border-block-end: 1px solid var(--throttle-color-border);
|
|
1608
|
+
}
|
|
1609
|
+
.tsf-cart-line:where([data-busy]) { opacity: 0.7; }
|
|
1610
|
+
.tsf-cart-line-media { grid-area: media; overflow: hidden; border-radius: var(--throttle-radius); background: var(--throttle-color-muted); }
|
|
1611
|
+
.tsf-cart-line-body { grid-area: body; display: grid; gap: 4px; min-inline-size: 0; }
|
|
1612
|
+
.tsf-cart-line-name { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
|
|
1613
|
+
.tsf-cart-line-price { margin: 0; color: var(--throttle-color-muted-foreground); font-size: 14px; }
|
|
1614
|
+
.tsf-cart-line-note { margin: 0; color: var(--throttle-sf-danger); font-size: 13px; }
|
|
1615
|
+
.tsf-cart-line-quantity {
|
|
1616
|
+
display: inline-flex;
|
|
1617
|
+
align-items: center;
|
|
1618
|
+
justify-self: start;
|
|
1619
|
+
margin-block-start: 4px;
|
|
1620
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
1621
|
+
border-radius: var(--throttle-radius);
|
|
1622
|
+
}
|
|
1623
|
+
.tsf-cart-line-decrease,
|
|
1624
|
+
.tsf-cart-line-increase {
|
|
1625
|
+
display: inline-flex;
|
|
1626
|
+
align-items: center;
|
|
1627
|
+
justify-content: center;
|
|
1628
|
+
min-inline-size: 44px;
|
|
1629
|
+
min-block-size: 44px;
|
|
1630
|
+
border: 0;
|
|
1631
|
+
background: transparent;
|
|
1632
|
+
color: inherit;
|
|
1633
|
+
cursor: pointer;
|
|
1634
|
+
}
|
|
1635
|
+
.tsf-cart-line-decrease:disabled,
|
|
1636
|
+
.tsf-cart-line-increase:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
1637
|
+
.tsf-cart-line-count { min-inline-size: 28px; text-align: center; font-variant-numeric: tabular-nums; }
|
|
1638
|
+
.tsf-cart-line-total { grid-area: total; margin: 0; font-weight: 600; text-align: end; }
|
|
1639
|
+
.tsf-cart-line-remove {
|
|
1640
|
+
grid-area: remove;
|
|
1641
|
+
align-self: end;
|
|
1642
|
+
justify-self: end;
|
|
1643
|
+
min-block-size: 44px;
|
|
1644
|
+
padding-inline: 4px;
|
|
1645
|
+
border: 0;
|
|
1646
|
+
background: transparent;
|
|
1647
|
+
color: var(--throttle-color-muted-foreground);
|
|
1648
|
+
font: inherit;
|
|
1649
|
+
font-size: 13px;
|
|
1650
|
+
text-decoration: underline;
|
|
1651
|
+
cursor: pointer;
|
|
1652
|
+
}
|
|
1653
|
+
.tsf-cart-line-remove:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
1654
|
+
.tsf-cart-footer {
|
|
1655
|
+
display: grid;
|
|
1656
|
+
gap: 12px;
|
|
1657
|
+
padding-block: 16px;
|
|
1658
|
+
padding-inline: 20px;
|
|
1659
|
+
border-block-start: 1px solid var(--throttle-color-border);
|
|
1660
|
+
background: var(--throttle-color-background);
|
|
1661
|
+
}
|
|
1662
|
+
.tsf-cart-subtotal { display: flex; align-items: baseline; justify-content: space-between; margin: 0; font-size: 18px; font-weight: 600; }
|
|
1663
|
+
.tsf-cart-checkout {
|
|
1664
|
+
min-block-size: 48px;
|
|
1665
|
+
padding-inline: 20px;
|
|
1666
|
+
border: 1px solid transparent;
|
|
1667
|
+
border-radius: var(--throttle-radius);
|
|
1668
|
+
background: var(--throttle-color-primary);
|
|
1669
|
+
color: var(--throttle-color-primary-foreground);
|
|
1670
|
+
font: inherit;
|
|
1671
|
+
font-weight: 600;
|
|
1672
|
+
cursor: pointer;
|
|
1673
|
+
}
|
|
1674
|
+
.tsf-cart-checkout:hover:not(:disabled) { filter: brightness(0.92); }
|
|
1675
|
+
.tsf-cart-checkout:disabled { opacity: 0.55; cursor: not-allowed; }
|
|
1676
|
+
.tsf-cart-checkout:where([aria-disabled="true"]) { cursor: progress; }
|
|
1677
|
+
.tsf-cart-continue {
|
|
1678
|
+
display: inline-flex;
|
|
1679
|
+
align-items: center;
|
|
1680
|
+
justify-content: center;
|
|
1681
|
+
min-block-size: 44px;
|
|
1682
|
+
padding-inline: 12px;
|
|
1683
|
+
border: 0;
|
|
1684
|
+
background: transparent;
|
|
1685
|
+
color: var(--throttle-sf-accent);
|
|
1686
|
+
font: inherit;
|
|
1687
|
+
text-decoration: underline;
|
|
1688
|
+
cursor: pointer;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
/* Quick add */
|
|
1692
|
+
.tsf-quick-add { position: relative; display: grid; gap: 4px; justify-items: end; }
|
|
1693
|
+
.tsf-quick-add-button,
|
|
1694
|
+
.tsf-compare-button {
|
|
1695
|
+
min-block-size: 44px;
|
|
1696
|
+
padding-inline: 14px;
|
|
1697
|
+
border: 1px solid var(--throttle-color-border-control);
|
|
1698
|
+
border-radius: var(--throttle-radius);
|
|
1699
|
+
background: var(--throttle-color-background);
|
|
1700
|
+
color: var(--throttle-color-foreground);
|
|
1701
|
+
font: inherit;
|
|
1702
|
+
font-size: 14px;
|
|
1703
|
+
font-weight: 600;
|
|
1704
|
+
cursor: pointer;
|
|
1705
|
+
}
|
|
1706
|
+
.tsf-quick-add-button:hover,
|
|
1707
|
+
.tsf-compare-button:hover:not(:disabled) { background: var(--throttle-color-muted); }
|
|
1708
|
+
.tsf-quick-add-button:where([aria-disabled="true"]) { cursor: progress; }
|
|
1709
|
+
.tsf-compare-button:where([aria-pressed="true"]) { border-color: var(--throttle-sf-accent); color: var(--throttle-sf-accent); }
|
|
1710
|
+
.tsf-compare-button:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
1711
|
+
.tsf-quick-add-message { margin: 0; max-inline-size: 220px; font-size: 13px; text-align: end; }
|
|
1712
|
+
.tsf-quick-add-message:empty { display: none; }
|
|
1713
|
+
.tsf-quick-add-message:where([data-tone="ok"]) { color: var(--throttle-sf-success); }
|
|
1714
|
+
.tsf-quick-add-message:where([data-tone="refused"]) { color: var(--throttle-sf-danger); }
|
|
1715
|
+
.tsf-quick-add-panel {
|
|
1716
|
+
position: fixed;
|
|
1717
|
+
z-index: var(--throttle-z-popover, 30);
|
|
1718
|
+
display: grid;
|
|
1719
|
+
gap: 12px;
|
|
1720
|
+
inline-size: min(280px, calc(100vw - 16px));
|
|
1721
|
+
overflow-y: auto;
|
|
1722
|
+
padding: 16px;
|
|
1723
|
+
border: 1px solid var(--throttle-color-border);
|
|
1724
|
+
border-radius: var(--throttle-radius);
|
|
1725
|
+
background: var(--throttle-color-background);
|
|
1726
|
+
color: var(--throttle-color-foreground);
|
|
1727
|
+
box-shadow: var(--throttle-shadow-popover, 0 8px 24px rgba(0, 0, 0, 0.12));
|
|
1728
|
+
text-align: start;
|
|
1729
|
+
}
|
|
1730
|
+
.tsf-quick-add-title { margin: 0; font-weight: 600; }
|
|
1731
|
+
|
|
1732
|
+
/* Quick view */
|
|
1733
|
+
.tsf-quick-view-title {
|
|
1734
|
+
position: absolute;
|
|
1735
|
+
inline-size: 1px;
|
|
1736
|
+
block-size: 1px;
|
|
1737
|
+
margin: -1px;
|
|
1738
|
+
overflow: hidden;
|
|
1739
|
+
clip-path: inset(50%);
|
|
1740
|
+
white-space: nowrap;
|
|
1741
|
+
}
|
|
1742
|
+
.tsf-quick-view { padding: 24px; }
|
|
1743
|
+
.tsf-quick-view-message { margin: 0; padding: 24px; text-align: center; color: var(--throttle-color-muted-foreground); }
|
|
1744
|
+
.tsf-quick-view-body { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
|
|
1745
|
+
@media (min-width: 640px) {
|
|
1746
|
+
.tsf-quick-view-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
|
|
1747
|
+
}
|
|
1748
|
+
.tsf-quick-view-gallery, .tsf-quick-view-details { min-inline-size: 0; }
|
|
1749
|
+
.tsf-quick-view-details { display: grid; align-content: start; gap: 16px; }
|
|
1750
|
+
.tsf-quick-view-link { color: var(--throttle-sf-accent); text-decoration: underline; }
|
|
1751
|
+
|
|
1752
|
+
/* Recently viewed */
|
|
1753
|
+
.tsf-recently-viewed { display: grid; gap: 16px; }
|
|
1754
|
+
.tsf-recently-viewed-title {
|
|
1755
|
+
margin: 0;
|
|
1756
|
+
font-family: var(--throttle-font-family-heading, inherit);
|
|
1757
|
+
font-size: 22px;
|
|
1758
|
+
font-weight: var(--throttle-sf-heading-weight);
|
|
1759
|
+
letter-spacing: var(--throttle-sf-heading-tracking);
|
|
1760
|
+
text-transform: var(--throttle-sf-heading-transform);
|
|
1761
|
+
}
|
|
1762
|
+
.tsf-recently-viewed-list {
|
|
1763
|
+
display: flex;
|
|
1764
|
+
gap: var(--throttle-sf-grid-gap, 16px);
|
|
1765
|
+
margin: 0;
|
|
1766
|
+
padding: 0;
|
|
1767
|
+
list-style: none;
|
|
1768
|
+
overflow-x: auto;
|
|
1769
|
+
scroll-snap-type: x proximity;
|
|
1770
|
+
}
|
|
1771
|
+
.tsf-recently-viewed-item { flex: 0 0 min(220px, 60vw); min-inline-size: 0; scroll-snap-align: start; }
|
|
1772
|
+
|
|
1773
|
+
/* Compare */
|
|
1774
|
+
.tsf-compare { display: grid; gap: 16px; }
|
|
1775
|
+
.tsf-compare-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
|
1776
|
+
.tsf-compare-title {
|
|
1777
|
+
margin: 0;
|
|
1778
|
+
font-family: var(--throttle-font-family-heading, inherit);
|
|
1779
|
+
font-size: 22px;
|
|
1780
|
+
font-weight: var(--throttle-sf-heading-weight);
|
|
1781
|
+
letter-spacing: var(--throttle-sf-heading-tracking);
|
|
1782
|
+
text-transform: var(--throttle-sf-heading-transform);
|
|
1783
|
+
}
|
|
1784
|
+
.tsf-compare-clear {
|
|
1785
|
+
min-block-size: 44px;
|
|
1786
|
+
padding-inline: 12px;
|
|
1787
|
+
border: 0;
|
|
1788
|
+
background: transparent;
|
|
1789
|
+
color: var(--throttle-sf-accent);
|
|
1790
|
+
font: inherit;
|
|
1791
|
+
text-decoration: underline;
|
|
1792
|
+
cursor: pointer;
|
|
1793
|
+
}
|
|
1794
|
+
.tsf-compare-empty { margin: 0; color: var(--throttle-color-muted-foreground); }
|
|
1795
|
+
.tsf-compare-scroll { overflow-x: auto; }
|
|
1796
|
+
.tsf-compare-table { inline-size: 100%; min-inline-size: 560px; border-collapse: collapse; table-layout: fixed; }
|
|
1797
|
+
.tsf-compare-caption {
|
|
1798
|
+
position: absolute;
|
|
1799
|
+
inline-size: 1px;
|
|
1800
|
+
block-size: 1px;
|
|
1801
|
+
margin: -1px;
|
|
1802
|
+
overflow: hidden;
|
|
1803
|
+
clip-path: inset(50%);
|
|
1804
|
+
white-space: nowrap;
|
|
1805
|
+
}
|
|
1806
|
+
.tsf-compare-label {
|
|
1807
|
+
inline-size: 140px;
|
|
1808
|
+
padding: 12px;
|
|
1809
|
+
border-block-end: 1px solid var(--throttle-color-border);
|
|
1810
|
+
color: var(--throttle-color-muted-foreground);
|
|
1811
|
+
font-size: 14px;
|
|
1812
|
+
font-weight: 600;
|
|
1813
|
+
text-align: start;
|
|
1814
|
+
vertical-align: top;
|
|
1815
|
+
}
|
|
1816
|
+
.tsf-compare-product {
|
|
1817
|
+
position: relative;
|
|
1818
|
+
padding: 12px;
|
|
1819
|
+
border-block-end: 1px solid var(--throttle-color-border);
|
|
1820
|
+
font-weight: 600;
|
|
1821
|
+
text-align: start;
|
|
1822
|
+
vertical-align: top;
|
|
1823
|
+
}
|
|
1824
|
+
.tsf-compare-product-media { overflow: hidden; margin-block-end: 8px; border-radius: var(--throttle-radius); background: var(--throttle-color-muted); }
|
|
1825
|
+
.tsf-compare-product-link { color: inherit; text-decoration: none; }
|
|
1826
|
+
.tsf-compare-product-link:hover { text-decoration: underline; }
|
|
1827
|
+
.tsf-compare-product-remove {
|
|
1828
|
+
position: absolute;
|
|
1829
|
+
inset-block-start: 4px;
|
|
1830
|
+
inset-inline-end: 4px;
|
|
1831
|
+
display: inline-flex;
|
|
1832
|
+
align-items: center;
|
|
1833
|
+
justify-content: center;
|
|
1834
|
+
min-inline-size: 44px;
|
|
1835
|
+
min-block-size: 44px;
|
|
1836
|
+
border: 0;
|
|
1837
|
+
border-radius: 999px;
|
|
1838
|
+
background: var(--throttle-color-background);
|
|
1839
|
+
color: var(--throttle-color-foreground);
|
|
1840
|
+
cursor: pointer;
|
|
1841
|
+
}
|
|
1842
|
+
.tsf-compare-cell { padding: 12px; border-block-end: 1px solid var(--throttle-color-border); vertical-align: top; overflow-wrap: anywhere; }
|
|
1843
|
+
`;
|
|
1844
|
+
|
|
1845
|
+
// src/styles/index.ts
|
|
1846
|
+
var STOREFRONT_STYLE_ID = "throttle-storefront-styles";
|
|
1847
|
+
var STOREFRONT_LAYER_ORDER_ID = "throttle-storefront-layer-order";
|
|
1848
|
+
var STOREFRONT_LAYER_ORDER = "@layer theme, base, throttle, components, utilities;";
|
|
1849
|
+
var STOREFRONT_STYLES = "@layer throttle{" + primitiveStyles("tsf-") + BASE_CSS + PIECES_CSS + SHOP_CSS + PRODUCT_CSS + FRAME_CSS + MERCH_CSS + SHOPPER_CSS + PAGES_CSS + PRESET_CSS + "}";
|
|
1850
|
+
|
|
1851
|
+
// src/theme/to-variables.ts
|
|
1852
|
+
import { toAuthAppearance } from "@usethrottle/catalog";
|
|
1853
|
+
var BLACK = "#000000";
|
|
1854
|
+
var GRID_GAP = {
|
|
1855
|
+
compact: "12px",
|
|
1856
|
+
comfortable: "20px",
|
|
1857
|
+
roomy: "32px"
|
|
1858
|
+
};
|
|
1859
|
+
var hex = (value) => isHexColor(value) ? normalizeHex(value) : void 0;
|
|
1860
|
+
function themeToVariables(theme, scheme) {
|
|
1861
|
+
const mapped = toAuthAppearance(
|
|
1862
|
+
{ light: theme.light, dark: theme.dark, fonts: theme.fonts, radius: theme.radius },
|
|
1863
|
+
scheme
|
|
1864
|
+
);
|
|
1865
|
+
const variables = { ...mapped.variables };
|
|
1866
|
+
const palette = theme[scheme];
|
|
1867
|
+
const sf = {
|
|
1868
|
+
"--throttle-sf-card-radius": `${Number.isFinite(theme.radius) ? theme.radius : 0}px`,
|
|
1869
|
+
"--throttle-sf-grid-gap": GRID_GAP[theme.spacingScale] ?? GRID_GAP.comfortable
|
|
1870
|
+
};
|
|
1871
|
+
const put = (name, value) => {
|
|
1872
|
+
if (value !== void 0) sf[`--throttle-sf-${name}`] = value;
|
|
1873
|
+
};
|
|
1874
|
+
put("sale", hex(palette.colorSale));
|
|
1875
|
+
put("success", hex(palette.colorSuccess));
|
|
1876
|
+
put("warning", hex(palette.colorWarning));
|
|
1877
|
+
put("danger", hex(palette.colorDanger));
|
|
1878
|
+
const accent = hex(palette.colorAccent);
|
|
1879
|
+
if (accent !== void 0) {
|
|
1880
|
+
const bright = brighten(accent, 0.165, 1.15);
|
|
1881
|
+
const surface = hex(palette.colorSurface);
|
|
1882
|
+
put("accent", accent);
|
|
1883
|
+
put("accent-hover", scheme === "light" ? mix(accent, BLACK, 0.8) : bright);
|
|
1884
|
+
put("accent-subtle", surface === void 0 ? void 0 : mix(bright, surface, 0.15));
|
|
1885
|
+
}
|
|
1886
|
+
return { variables, sf };
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
// src/provider/router.ts
|
|
1890
|
+
import { useMemo, useSyncExternalStore } from "react";
|
|
1891
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
1892
|
+
var notify = () => listeners.forEach((l) => l());
|
|
1893
|
+
function subscribe(listener) {
|
|
1894
|
+
if (listeners.size === 0) window.addEventListener("popstate", notify);
|
|
1895
|
+
listeners.add(listener);
|
|
1896
|
+
return () => {
|
|
1897
|
+
listeners.delete(listener);
|
|
1898
|
+
if (listeners.size === 0) window.removeEventListener("popstate", notify);
|
|
1899
|
+
};
|
|
1900
|
+
}
|
|
1901
|
+
var snapshot = () => window.location.pathname + window.location.search;
|
|
1902
|
+
var serverSnapshot = () => "/";
|
|
1903
|
+
function navigate(mode, href, options) {
|
|
1904
|
+
window.history[mode === "push" ? "pushState" : "replaceState"](null, "", href);
|
|
1905
|
+
notify();
|
|
1906
|
+
if (options?.scroll !== false) window.scrollTo(0, 0);
|
|
1907
|
+
}
|
|
1908
|
+
function useHistoryRouter() {
|
|
1909
|
+
const location = useSyncExternalStore(subscribe, snapshot, serverSnapshot);
|
|
1910
|
+
return useMemo(() => {
|
|
1911
|
+
const at = location.indexOf("?");
|
|
1912
|
+
return {
|
|
1913
|
+
pathname: at === -1 ? location : location.slice(0, at),
|
|
1914
|
+
searchParams: new URLSearchParams(at === -1 ? "" : location.slice(at + 1)),
|
|
1915
|
+
push: (href, options) => navigate("push", href, options),
|
|
1916
|
+
replace: (href, options) => navigate("replace", href, options)
|
|
1917
|
+
};
|
|
1918
|
+
}, [location]);
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
// src/provider/StorefrontProvider.tsx
|
|
1922
|
+
import { createCatalogClient } from "@usethrottle/catalog";
|
|
1923
|
+
import {
|
|
1924
|
+
CatalogProvider,
|
|
1925
|
+
useGenerationWatch,
|
|
1926
|
+
useStorefrontSettings
|
|
1927
|
+
} from "@usethrottle/catalog/react";
|
|
1928
|
+
import {
|
|
1929
|
+
ThrottleUIProvider,
|
|
1930
|
+
isRtlLocale,
|
|
1931
|
+
useAppearance,
|
|
1932
|
+
useInjectStyles,
|
|
1933
|
+
useSiteDesign
|
|
1934
|
+
} from "@usethrottle/ui";
|
|
1935
|
+
import { useMemo as useMemo2, useState } from "react";
|
|
1936
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
1937
|
+
var MIN_WATCH_INTERVAL_MS = 6e4;
|
|
1938
|
+
var NO_ANALYTICS = { track() {
|
|
1939
|
+
} };
|
|
1940
|
+
var declarations = (vars) => Object.entries(vars).map(([name, value]) => `${name}: ${value};`).join(" ");
|
|
1941
|
+
function scopeIdOf(text) {
|
|
1942
|
+
let hash = 5381;
|
|
1943
|
+
for (let i = 0; i < text.length; i++) hash = (hash << 5) + hash + text.charCodeAt(i) | 0;
|
|
1944
|
+
return `f${(hash >>> 0).toString(36)}`;
|
|
1945
|
+
}
|
|
1946
|
+
function StorefrontProvider(props) {
|
|
1947
|
+
const { catalogKey, client: given, currency, locale } = props;
|
|
1948
|
+
const client = useMemo2(() => {
|
|
1949
|
+
if (given) return given;
|
|
1950
|
+
if (!catalogKey) throw new Error("StorefrontProvider needs a `catalogKey` or a `client`.");
|
|
1951
|
+
return createCatalogClient({
|
|
1952
|
+
publishableKey: catalogKey,
|
|
1953
|
+
...currency ? { currency } : {},
|
|
1954
|
+
...locale ? { locale } : {}
|
|
1955
|
+
});
|
|
1956
|
+
}, [given, catalogKey, currency, locale]);
|
|
1957
|
+
return /* @__PURE__ */ jsx2(
|
|
1958
|
+
CatalogProvider,
|
|
1959
|
+
{
|
|
1960
|
+
client,
|
|
1961
|
+
customerKey: props.customerKey ?? null,
|
|
1962
|
+
cartStorage: props.cartStorage,
|
|
1963
|
+
customerCart: props.customerCart,
|
|
1964
|
+
cartUrls: props.cartUrls,
|
|
1965
|
+
throttleBaseUrl: props.throttleBaseUrl,
|
|
1966
|
+
throttleCheckoutUrl: props.throttleCheckoutUrl,
|
|
1967
|
+
children: /* @__PURE__ */ jsx2(StorefrontRoot, { ...props, client })
|
|
1968
|
+
}
|
|
1969
|
+
);
|
|
1970
|
+
}
|
|
1971
|
+
function StorefrontRoot(props) {
|
|
1972
|
+
const {
|
|
1973
|
+
client,
|
|
1974
|
+
settings: initialSettings,
|
|
1975
|
+
preset,
|
|
1976
|
+
scheme,
|
|
1977
|
+
appearance,
|
|
1978
|
+
localization,
|
|
1979
|
+
icons,
|
|
1980
|
+
analytics,
|
|
1981
|
+
router,
|
|
1982
|
+
linkComponent,
|
|
1983
|
+
injectStyles = true,
|
|
1984
|
+
reviewsOnLists = true,
|
|
1985
|
+
throttlePublishableKey,
|
|
1986
|
+
onGenerationChange,
|
|
1987
|
+
generationWatch = true,
|
|
1988
|
+
currency,
|
|
1989
|
+
children
|
|
1990
|
+
} = props;
|
|
1991
|
+
const locale = props.locale ?? "en";
|
|
1992
|
+
const dir = props.dir ?? (isRtlLocale(locale) ? "rtl" : "ltr");
|
|
1993
|
+
const seeded = useMemo2(
|
|
1994
|
+
() => initialSettings ? { settings: initialSettings, settingsVersion: 0, generation: 0 } : void 0,
|
|
1995
|
+
[initialSettings]
|
|
1996
|
+
);
|
|
1997
|
+
const query = useStorefrontSettings(seeded ? { initialData: seeded } : void 0);
|
|
1998
|
+
const settings = useMemo2(
|
|
1999
|
+
() => normalizeSettings(query.data?.settings ?? initialSettings),
|
|
2000
|
+
[query.data, initialSettings]
|
|
2001
|
+
);
|
|
2002
|
+
const status = query.data ? "ready" : query.error ? "error" : "loading";
|
|
2003
|
+
const siteDesign = useSiteDesign();
|
|
2004
|
+
const themeKey = JSON.stringify(props.theme ?? null);
|
|
2005
|
+
const site = useMemo2(
|
|
2006
|
+
() => resolveSiteDesign({
|
|
2007
|
+
site: siteDesign,
|
|
2008
|
+
settings,
|
|
2009
|
+
preset,
|
|
2010
|
+
theme: props.theme,
|
|
2011
|
+
scheme,
|
|
2012
|
+
throttlePublishableKey
|
|
2013
|
+
}),
|
|
2014
|
+
// `theme` is compared by value: an inline object must not rebuild every context below.
|
|
2015
|
+
[siteDesign, settings, preset, themeKey, scheme, throttlePublishableKey]
|
|
2016
|
+
);
|
|
2017
|
+
useInjectStyles(STOREFRONT_LAYER_ORDER_ID, STOREFRONT_LAYER_ORDER, { enabled: injectStyles, position: "prepend" });
|
|
2018
|
+
useInjectStyles(STOREFRONT_STYLE_ID, STOREFRONT_STYLES, { enabled: injectStyles });
|
|
2019
|
+
const effectiveScheme = appearance?.theme ?? site.scheme;
|
|
2020
|
+
const light = useMemo2(() => themeToVariables(site.theme, "light"), [site.theme]);
|
|
2021
|
+
const dark = useMemo2(() => themeToVariables(site.theme, "dark"), [site.theme]);
|
|
2022
|
+
const uiAppearance = useMemo2(() => {
|
|
2023
|
+
const own = appearance?.variables;
|
|
2024
|
+
const ownDark = appearance?.darkVariables;
|
|
2025
|
+
const base = { ...(effectiveScheme === "dark" ? dark : light).variables, ...own };
|
|
2026
|
+
const value2 = { theme: effectiveScheme, variables: base };
|
|
2027
|
+
if (effectiveScheme === "auto") value2.darkVariables = { ...dark.variables, ...own, ...ownDark };
|
|
2028
|
+
else if (effectiveScheme === "dark" && ownDark) value2.darkVariables = ownDark;
|
|
2029
|
+
if (appearance?.elements) value2.elements = appearance.elements;
|
|
2030
|
+
if (appearance?.parts) value2.parts = appearance.parts;
|
|
2031
|
+
if (appearance?.components) value2.components = appearance.components;
|
|
2032
|
+
return value2;
|
|
2033
|
+
}, [appearance, effectiveScheme, light, dark]);
|
|
2034
|
+
const historyRouter = useHistoryRouter();
|
|
2035
|
+
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
2036
|
+
const drawer = useMemo2(() => ({ open: drawerOpen, setOpen: setDrawerOpen }), [drawerOpen]);
|
|
2037
|
+
const value = useMemo2(
|
|
2038
|
+
() => ({
|
|
2039
|
+
settings,
|
|
2040
|
+
site,
|
|
2041
|
+
preset: site.preset,
|
|
2042
|
+
scheme: site.scheme,
|
|
2043
|
+
dir,
|
|
2044
|
+
locale,
|
|
2045
|
+
currency,
|
|
2046
|
+
client,
|
|
2047
|
+
router: router ?? historyRouter,
|
|
2048
|
+
analytics: analytics ?? NO_ANALYTICS,
|
|
2049
|
+
Link: linkComponent ?? DefaultLink,
|
|
2050
|
+
reviewsOnLists,
|
|
2051
|
+
throttlePublishableKey: site.throttlePublishableKey
|
|
2052
|
+
}),
|
|
2053
|
+
[settings, site, dir, locale, currency, client, router, historyRouter, analytics, linkComponent, reviewsOnLists]
|
|
2054
|
+
);
|
|
2055
|
+
return /* @__PURE__ */ jsx2(ThrottleUIProvider, { appearance: uiAppearance, classPrefix: "tsf-", dir, icons, children: /* @__PURE__ */ jsx2(SfLocalizationProvider, { value: localization ?? {}, children: /* @__PURE__ */ jsxs(StorefrontContext.Provider, { value, children: [
|
|
2056
|
+
generationWatch !== false ? /* @__PURE__ */ jsx2(
|
|
2057
|
+
GenerationWatcher,
|
|
2058
|
+
{
|
|
2059
|
+
intervalMs: typeof generationWatch === "object" ? generationWatch.intervalMs : void 0,
|
|
2060
|
+
onChange: onGenerationChange
|
|
2061
|
+
}
|
|
2062
|
+
) : null,
|
|
2063
|
+
/* @__PURE__ */ jsx2(CartDrawerContext.Provider, { value: drawer, children: /* @__PURE__ */ jsx2(
|
|
2064
|
+
StorefrontRootElement,
|
|
2065
|
+
{
|
|
2066
|
+
site,
|
|
2067
|
+
scheme: effectiveScheme,
|
|
2068
|
+
sf: { light: light.sf, dark: dark.sf },
|
|
2069
|
+
dir,
|
|
2070
|
+
status,
|
|
2071
|
+
children
|
|
2072
|
+
}
|
|
2073
|
+
) })
|
|
2074
|
+
] }) }) });
|
|
2075
|
+
}
|
|
2076
|
+
function GenerationWatcher({ intervalMs, onChange }) {
|
|
2077
|
+
useGenerationWatch({ intervalMs: Math.max(intervalMs ?? MIN_WATCH_INTERVAL_MS, MIN_WATCH_INTERVAL_MS), onChange });
|
|
2078
|
+
return null;
|
|
2079
|
+
}
|
|
2080
|
+
function StorefrontRootElement(props) {
|
|
2081
|
+
const { site, scheme, sf, dir, status, children } = props;
|
|
2082
|
+
const { rootProps, scopeCss } = useAppearance();
|
|
2083
|
+
const part = usePart("storefront-root");
|
|
2084
|
+
const sfScope = scheme === "auto" ? scopeIdOf(JSON.stringify(sf)) : null;
|
|
2085
|
+
const sfCss = sfScope === null ? null : `.tsf-root[data-sf-scope="${sfScope}"] { ${declarations(sf.light)} }
|
|
2086
|
+
@media (prefers-color-scheme: dark) {
|
|
2087
|
+
.tsf-root[data-sf-scope="${sfScope}"] { ${declarations(sf.dark)} }
|
|
2088
|
+
}
|
|
2089
|
+
`;
|
|
2090
|
+
const style = scheme === "auto" ? rootProps.style : { ...rootProps.style, ...scheme === "dark" ? sf.dark : sf.light };
|
|
2091
|
+
const className = [rootProps.className, part.className].filter(Boolean).join(" ");
|
|
2092
|
+
return /* @__PURE__ */ jsxs(
|
|
2093
|
+
"div",
|
|
2094
|
+
{
|
|
2095
|
+
className,
|
|
2096
|
+
style,
|
|
2097
|
+
"data-throttle-part": part["data-throttle-part"],
|
|
2098
|
+
"data-throttle-preset": site.preset,
|
|
2099
|
+
"data-throttle-theme": rootProps["data-throttle-theme"],
|
|
2100
|
+
"data-throttle-scope": rootProps["data-throttle-scope"],
|
|
2101
|
+
"data-sf-scope": sfScope ?? void 0,
|
|
2102
|
+
"data-site-source": site.source,
|
|
2103
|
+
"data-theme-accent": site.theme.light.colorAccent,
|
|
2104
|
+
"data-theme-radius": site.theme.radius,
|
|
2105
|
+
"data-settings-status": status,
|
|
2106
|
+
dir,
|
|
2107
|
+
children: [
|
|
2108
|
+
scopeCss ? /* @__PURE__ */ jsx2("style", { children: scopeCss }) : null,
|
|
2109
|
+
sfCss ? /* @__PURE__ */ jsx2("style", { children: sfCss }) : null,
|
|
2110
|
+
children
|
|
2111
|
+
]
|
|
2112
|
+
}
|
|
2113
|
+
);
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
export {
|
|
2117
|
+
DefaultLink,
|
|
2118
|
+
normalizeSettings,
|
|
2119
|
+
STOREFRONT_STYLE_ID,
|
|
2120
|
+
STOREFRONT_LAYER_ORDER_ID,
|
|
2121
|
+
STOREFRONT_STYLES,
|
|
2122
|
+
themeToVariables,
|
|
2123
|
+
useHistoryRouter,
|
|
2124
|
+
StorefrontProvider
|
|
2125
|
+
};
|
|
2126
|
+
//# sourceMappingURL=chunk-3A72UY6T.js.map
|