@tansy/theme-storefront 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/LICENSE +21 -0
- package/README.md +12 -2
- package/client.d.ts +44 -0
- package/client.js +164 -0
- package/fonts/GeistVF.woff +0 -0
- package/fonts/README.md +1 -0
- package/icons.d.ts +16 -0
- package/icons.js +18 -0
- package/index.d.ts +16 -0
- package/index.js +69 -0
- package/lib.d.ts +9 -0
- package/lib.js +15 -0
- package/messages.d.ts +113 -0
- package/messages.js +113 -0
- package/package.json +34 -4
- package/render.d.ts +4 -0
- package/render.js +175 -0
- package/schema.json +31 -0
- package/styles.css +308 -0
- package/theme.css +2045 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mohamed Salah
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- Generated by scripts/package-metadata.mjs. Change that script, not this file. -->
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# @tansy/theme-storefront
|
|
4
|
+
|
|
5
|
+
A storefront look for the shop plugin: soft rounded product cards, a product stage with a size picker and quantity stepper, and a two-column cart.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @tansy/theme-storefront
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Add it to `tansy.config.ts`. See [the storefront theme documentation](https://github.com/mhmdsalahsebai/tansy/blob/main/docs/themes/storefront.md) for what it adds and the options it takes.
|
|
12
|
+
|
|
13
|
+
A first-party theme for [tansy](https://github.com/mhmdsalahsebai/tansy), a self-hosted, runtime-schema CMS for Next.js. MIT licensed.
|
package/client.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type VariantOption } from "@tansy/shop/react";
|
|
2
|
+
import { type SiteWords } from "tansy/react";
|
|
3
|
+
/**
|
|
4
|
+
* Searches published products as the visitor types, through the records API. It reads as
|
|
5
|
+
* whoever is looking, so the products collection's list rule still decides what can be found.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ProductSearch({ words, currency }: {
|
|
8
|
+
words?: SiteWords;
|
|
9
|
+
currency: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
export interface GalleryImage {
|
|
12
|
+
src: string;
|
|
13
|
+
thumb: string; /** What the image shows, for a reader who can't see it (set beside the file). */
|
|
14
|
+
alt: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The product's pictures on a soft stage, with a ring around it and arrows to step through
|
|
18
|
+
* them. Arrow keys step too once the stage has focus, the way they point in the page's direction.
|
|
19
|
+
*/
|
|
20
|
+
export declare function ProductGallery({ images, words }: {
|
|
21
|
+
images: GalleryImage[];
|
|
22
|
+
words?: SiteWords;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* Price, options as chips, a quantity stepper, and two ways to buy: into the cart and stay,
|
|
26
|
+
* or into the cart and straight to it. The cart is the shop plugin's, so checkout prices it
|
|
27
|
+
* again on the server whatever this page showed.
|
|
28
|
+
*/
|
|
29
|
+
export declare function BuyBox({ product, price, compareAt, stock, variants, currency, cartHref, words }: {
|
|
30
|
+
product: number;
|
|
31
|
+
price: number | null;
|
|
32
|
+
compareAt: number | null;
|
|
33
|
+
stock: number | null;
|
|
34
|
+
variants?: VariantOption[];
|
|
35
|
+
currency: string;
|
|
36
|
+
cartHref?: string;
|
|
37
|
+
words?: SiteWords;
|
|
38
|
+
}): import("react").JSX.Element;
|
|
39
|
+
/** The browser's share sheet where there is one, and copying the address where there isn't. */
|
|
40
|
+
export declare function ShareButton({ title, words, className }: {
|
|
41
|
+
title: string;
|
|
42
|
+
words?: SiteWords;
|
|
43
|
+
className?: string;
|
|
44
|
+
}): import("react").JSX.Element;
|
package/client.js
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
4
|
+
import { addToCart } from "@tansy/shop/react";
|
|
5
|
+
import { apiPath, contentLocale, sitePath, siteWords } from "tansy/react";
|
|
6
|
+
import { Bag, Check, ChevronLeft, ChevronRight, Minus, Plus, Search, Send } from "./icons";
|
|
7
|
+
import { cx, money, text } from "./lib";
|
|
8
|
+
/**
|
|
9
|
+
* The theme's parts that need the browser. Each takes `pickWords(words, "storefront")` from a
|
|
10
|
+
* template, so it speaks the page's language and keeps links in it.
|
|
11
|
+
*/
|
|
12
|
+
const thumb = (fileId, size = "100x100") => apiPath(`/files/${encodeURIComponent(fileId)}?thumb=${size}`);
|
|
13
|
+
const MIN_LENGTH = 2;
|
|
14
|
+
const WAIT_MS = 250;
|
|
15
|
+
/**
|
|
16
|
+
* Searches published products as the visitor types, through the records API. It reads as
|
|
17
|
+
* whoever is looking, so the products collection's list rule still decides what can be found.
|
|
18
|
+
*/
|
|
19
|
+
export function ProductSearch({ words, currency }) {
|
|
20
|
+
const { t, formatNumber } = siteWords(words);
|
|
21
|
+
const id = useId();
|
|
22
|
+
const [query, setQuery] = useState("");
|
|
23
|
+
const [results, setResults] = useState(null);
|
|
24
|
+
const [state, setState] = useState("idle");
|
|
25
|
+
const pending = useRef(null);
|
|
26
|
+
async function run(value) {
|
|
27
|
+
pending.current?.abort();
|
|
28
|
+
const terms = value.trim();
|
|
29
|
+
if (terms.length < MIN_LENGTH) {
|
|
30
|
+
setResults(null);
|
|
31
|
+
setState("idle");
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const controller = new AbortController();
|
|
35
|
+
pending.current = controller;
|
|
36
|
+
setState("busy");
|
|
37
|
+
// Published only, so staff who may list drafts find what visitors find, and every link opens.
|
|
38
|
+
const params = new URLSearchParams({ search: terms, filter: 'status = "published"', perPage: "6", fields: "id,title,price,images", urls: "1" });
|
|
39
|
+
const locale = contentLocale(words);
|
|
40
|
+
if (locale)
|
|
41
|
+
params.set("locale", locale);
|
|
42
|
+
try {
|
|
43
|
+
const response = await fetch(apiPath(`/collections/shop-products/records?${params}`), { signal: controller.signal, headers: { accept: "application/json" } });
|
|
44
|
+
const json = await response.json().catch(() => null);
|
|
45
|
+
if (controller.signal.aborted)
|
|
46
|
+
return;
|
|
47
|
+
if (!response.ok || !Array.isArray(json?.items)) {
|
|
48
|
+
setState("failed");
|
|
49
|
+
setResults(null);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
setResults(json.items);
|
|
53
|
+
setState("idle");
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
if (!controller.signal.aborted)
|
|
57
|
+
setState("failed");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
const timer = setTimeout(() => void run(query), WAIT_MS);
|
|
62
|
+
return () => clearTimeout(timer);
|
|
63
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- searches again only when the words typed change
|
|
64
|
+
}, [query]);
|
|
65
|
+
useEffect(() => () => pending.current?.abort(), []);
|
|
66
|
+
function submit(event) {
|
|
67
|
+
event.preventDefault();
|
|
68
|
+
void run(query);
|
|
69
|
+
}
|
|
70
|
+
const open = results !== null || state === "failed";
|
|
71
|
+
const status = state === "busy"
|
|
72
|
+
? t("storefront.searching")
|
|
73
|
+
: state === "failed"
|
|
74
|
+
? t("storefront.searchFailed")
|
|
75
|
+
: results === null ? "" : results.length ? t("storefront.found", { count: results.length }) : t("storefront.noResults", { query: query.trim() });
|
|
76
|
+
return (_jsxs("div", { className: "sf:relative sf:w-full sf:max-w-xl", children: [_jsxs("form", { role: "search", onSubmit: submit, children: [_jsx("label", { className: "sf:sr-only", htmlFor: `${id}-q`, children: t("storefront.searchLabel") }), _jsxs("span", { className: "sf:flex sf:h-14 sf:items-center sf:gap-3 sf:rounded-full sf:border sf:border-line sf:bg-surface sf:ps-5 sf:pe-2 sf:transition sf:focus-within:border-accent sf:focus-within:bg-page sf:focus-within:ring-4 sf:focus-within:ring-accent/15", children: [_jsx(Search, { className: "sf:size-5 sf:shrink-0 sf:text-muted" }), _jsx("input", { id: `${id}-q`, type: "search", name: "q", autoComplete: "off", maxLength: 200, placeholder: t("storefront.searchPlaceholder"), value: query, onChange: (event) => setQuery(event.target.value), onKeyDown: (event) => { if (event.key === "Escape")
|
|
77
|
+
setQuery(""); }, "aria-controls": `${id}-results`, "aria-describedby": `${id}-status`, className: "sf:h-full sf:min-w-0 sf:flex-1 sf:bg-transparent sf:text-base sf:text-ink sf:outline-none sf:placeholder:text-muted" }), _jsx("button", { type: "submit", className: "sf:inline-flex sf:h-10 sf:shrink-0 sf:items-center sf:rounded-full sf:bg-ink sf:px-5 sf:text-sm sf:font-medium sf:text-page sf:transition sf:hover:bg-accent sf:hover:text-on-accent", children: t("storefront.searchLabel") })] })] }), _jsx("p", { id: `${id}-status`, className: "sf:sr-only", role: "status", "aria-live": "polite", children: status }), _jsx("div", { id: `${id}-results`, hidden: !open, className: "sf:absolute sf:inset-x-0 sf:top-full sf:z-20 sf:mt-2 sf:overflow-hidden sf:rounded-3xl sf:border sf:border-line sf:bg-page sf:p-2 sf:shadow-card", children: results && results.length > 0 ? (_jsx("ul", { children: results.map((product) => {
|
|
78
|
+
const path = text(product.recordPath);
|
|
79
|
+
const image = Array.isArray(product.images) ? text(product.images[0]) : "";
|
|
80
|
+
const price = typeof product.price === "number" ? product.price : null;
|
|
81
|
+
return (_jsx("li", { children: _jsxs("a", { href: path ? sitePath(words, path) : undefined, className: "sf:flex sf:items-center sf:gap-3 sf:rounded-2xl sf:p-2 sf:text-ink sf:no-underline sf:hover:bg-surface sf:focus-visible:bg-surface sf:focus-visible:outline-none", children: [image ? _jsx("img", { src: thumb(image), alt: "", width: 48, height: 48, loading: "lazy", className: "sf:size-12 sf:rounded-full sf:bg-surface sf:object-cover" }) : _jsx("span", { className: "sf:grid sf:size-12 sf:place-items-center sf:rounded-full sf:bg-surface sf:text-muted", "aria-hidden": "true", children: _jsx(Bag, {}) }), _jsx("span", { className: "sf:min-w-0 sf:flex-1 sf:truncate sf:font-medium", children: text(product.title) }), price !== null && _jsx("span", { className: "sf:text-sm sf:text-muted sf:tabular-nums", children: money(formatNumber, price, currency) })] }) }, product.id));
|
|
82
|
+
}) })) : _jsx("p", { className: "sf:p-3 sf:text-sm sf:text-muted", children: status }) })] }));
|
|
83
|
+
}
|
|
84
|
+
const RoundButton = ({ label, onClick, children }) => (_jsx("button", { type: "button", "aria-label": label, onClick: onClick, className: "sf:grid sf:size-10 sf:place-items-center sf:rounded-full sf:text-ink sf:transition sf:hover:bg-ink sf:hover:text-page sf:focus-visible:outline-2 sf:focus-visible:outline-accent", children: children }));
|
|
85
|
+
/**
|
|
86
|
+
* The product's pictures on a soft stage, with a ring around it and arrows to step through
|
|
87
|
+
* them. Arrow keys step too once the stage has focus, the way they point in the page's direction.
|
|
88
|
+
*/
|
|
89
|
+
export function ProductGallery({ images, words }) {
|
|
90
|
+
const { t } = siteWords(words);
|
|
91
|
+
const [index, setIndex] = useState(0);
|
|
92
|
+
const count = images.length;
|
|
93
|
+
const go = (step) => setIndex((current) => (current + step + count) % count);
|
|
94
|
+
function keys(event) {
|
|
95
|
+
if (count < 2 || (event.key !== "ArrowLeft" && event.key !== "ArrowRight"))
|
|
96
|
+
return;
|
|
97
|
+
event.preventDefault();
|
|
98
|
+
const rtl = getComputedStyle(event.currentTarget).direction === "rtl";
|
|
99
|
+
go((event.key === "ArrowRight") !== rtl ? 1 : -1);
|
|
100
|
+
}
|
|
101
|
+
const current = images[index];
|
|
102
|
+
return (_jsxs("section", { "aria-label": t("storefront.images"), className: "sf:flex sf:flex-col sf:gap-4", children: [_jsxs("div", { role: count > 1 ? "group" : undefined, "aria-roledescription": count > 1 ? "carousel" : undefined, tabIndex: count > 1 ? 0 : undefined, onKeyDown: keys, className: "sf:group sf:relative sf:isolate sf:grid sf:aspect-square sf:place-items-center sf:overflow-hidden sf:rounded-card sf:bg-surface sf:focus-visible:outline-2 sf:focus-visible:outline-offset-4 sf:focus-visible:outline-accent", children: [_jsx("span", { "aria-hidden": "true", className: "sf:absolute sf:top-[58%] sf:left-1/2 sf:-z-10 sf:h-[26%] sf:w-[118%] sf:-translate-x-1/2 sf:-rotate-6 sf:rounded-[50%] sf:border sf:border-ink/15" }), _jsx("span", { "aria-hidden": "true", className: "sf:absolute sf:top-1/2 sf:left-1/2 sf:-z-20 sf:size-[72%] sf:-translate-1/2 sf:rounded-full sf:bg-page/70 sf:blur-2xl" }), current ? (_jsx("img", { src: current.src, alt: current.alt, className: "sf:size-[82%] sf:object-contain sf:drop-shadow-[0_24px_30px_rgba(0,0,0,0.18)] sf:transition-transform sf:duration-500 sf:ease-out sf:group-hover:scale-[1.03] sf:motion-reduce:transition-none" }, current.src)) : _jsx(Bag, { className: "sf:size-16 sf:text-muted/50", strokeWidth: 1 }), count > 1 && (_jsxs("div", { className: "sf:absolute sf:bottom-6 sf:left-1/2 sf:flex sf:-translate-x-1/2 sf:items-center sf:gap-1 sf:rounded-full sf:border sf:border-line sf:bg-page/80 sf:p-1 sf:shadow-sm sf:backdrop-blur", children: [_jsx(RoundButton, { label: t("storefront.previousImage"), onClick: () => go(-1), children: _jsx(ChevronLeft, { className: "sf:size-5 sf:rtl:-scale-x-100" }) }), _jsxs("span", { className: "sf:min-w-12 sf:text-center sf:text-sm sf:text-muted sf:tabular-nums", "aria-live": "polite", children: [index + 1, " / ", count] }), _jsx(RoundButton, { label: t("storefront.nextImage"), onClick: () => go(1), children: _jsx(ChevronRight, { className: "sf:size-5 sf:rtl:-scale-x-100" }) })] }))] }), count > 1 && (_jsx("ul", { className: "sf:flex sf:gap-3 sf:overflow-x-auto sf:pb-1", children: images.map((image, at) => (_jsx("li", { className: "sf:shrink-0", children: _jsx("button", { type: "button", onClick: () => setIndex(at), "aria-label": t("storefront.showImage", { number: at + 1 }), "aria-current": at === index ? "true" : undefined, className: cx("sf:block sf:size-20 sf:overflow-hidden sf:rounded-full sf:border-2 sf:bg-surface sf:p-1 sf:transition sf:focus-visible:outline-2 sf:focus-visible:outline-offset-2 sf:focus-visible:outline-accent", at === index ? "sf:border-accent" : "sf:border-transparent sf:opacity-70 sf:hover:opacity-100"), children: _jsx("img", { src: image.thumb, alt: image.alt, loading: "lazy", className: "sf:size-full sf:rounded-full sf:object-cover" }) }) }, image.src))) }))] }));
|
|
103
|
+
}
|
|
104
|
+
/* ----------------------------------------------------------------- buy box */
|
|
105
|
+
function Stepper({ value, max, onChange, id, words }) {
|
|
106
|
+
const { t } = siteWords(words);
|
|
107
|
+
const set = (next) => onChange(Math.max(1, Math.min(max, next)));
|
|
108
|
+
const step = "sf:grid sf:size-11 sf:place-items-center sf:rounded-full sf:text-ink sf:transition sf:hover:bg-page sf:disabled:opacity-35 sf:disabled:hover:bg-transparent sf:focus-visible:outline-2 sf:focus-visible:outline-accent";
|
|
109
|
+
return (_jsxs("div", { className: "sf:inline-flex sf:items-center sf:gap-1 sf:rounded-full sf:bg-surface sf:p-1", children: [_jsx("button", { type: "button", className: step, "aria-label": t("storefront.decrease"), "aria-controls": id, disabled: value <= 1, onClick: () => set(value - 1), children: _jsx(Minus, {}) }), _jsx("input", { id: id, type: "number", inputMode: "numeric", min: 1, max: max, value: value, onChange: (event) => set(Number(event.target.value) || 1), className: "sf:w-10 sf:bg-transparent sf:text-center sf:text-lg sf:font-semibold sf:text-ink sf:tabular-nums sf:outline-none sf:[appearance:textfield] sf:[&::-webkit-inner-spin-button]:appearance-none sf:[&::-webkit-outer-spin-button]:appearance-none" }), _jsx("button", { type: "button", className: step, "aria-label": t("storefront.increase"), "aria-controls": id, disabled: value >= max, onClick: () => set(value + 1), children: _jsx(Plus, {}) })] }));
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Price, options as chips, a quantity stepper, and two ways to buy: into the cart and stay,
|
|
113
|
+
* or into the cart and straight to it. The cart is the shop plugin's, so checkout prices it
|
|
114
|
+
* again on the server whatever this page showed.
|
|
115
|
+
*/
|
|
116
|
+
export function BuyBox({ product, price, compareAt, stock, variants = [], currency, cartHref = "/cart", words }) {
|
|
117
|
+
const { t, formatNumber } = siteWords(words);
|
|
118
|
+
const id = useId();
|
|
119
|
+
const [variant, setVariant] = useState(variants.find((option) => option.stock !== 0)?.id ?? null);
|
|
120
|
+
const [quantity, setQuantity] = useState(1);
|
|
121
|
+
const [added, setAdded] = useState(false);
|
|
122
|
+
const chosen = variants.find((option) => option.id === variant) ?? null;
|
|
123
|
+
const left = variants.length ? chosen?.stock ?? null : stock;
|
|
124
|
+
const amount = chosen?.price ?? price;
|
|
125
|
+
const soldOut = variants.length ? !chosen || chosen.stock === 0 : stock === 0;
|
|
126
|
+
const max = Math.max(1, Math.min(99, left ?? 99));
|
|
127
|
+
function choose(option) {
|
|
128
|
+
setVariant(option.id);
|
|
129
|
+
setQuantity((current) => Math.min(current, Math.max(1, option.stock ?? 99)));
|
|
130
|
+
setAdded(false);
|
|
131
|
+
}
|
|
132
|
+
function submit(event) {
|
|
133
|
+
event.preventDefault();
|
|
134
|
+
if (soldOut)
|
|
135
|
+
return;
|
|
136
|
+
addToCart(product, chosen?.id ?? null, quantity);
|
|
137
|
+
const submitter = event.nativeEvent.submitter;
|
|
138
|
+
if (submitter?.getAttribute("value") === "buy")
|
|
139
|
+
window.location.assign(sitePath(words, cartHref));
|
|
140
|
+
else
|
|
141
|
+
setAdded(true);
|
|
142
|
+
}
|
|
143
|
+
return (_jsxs("form", { onSubmit: submit, className: "sf:flex sf:flex-col sf:gap-7", children: [_jsxs("div", { className: "sf:flex sf:flex-wrap sf:items-end sf:gap-x-4 sf:gap-y-2", children: [amount !== null && _jsx("p", { className: "sf:text-4xl sf:font-semibold sf:tracking-tight sf:text-ink sf:tabular-nums sf:sm:text-5xl", children: money(formatNumber, amount, currency) }), compareAt !== null && amount !== null && compareAt > amount && _jsx("p", { className: "sf:pb-1.5 sf:text-lg sf:text-muted sf:tabular-nums", children: _jsx("s", { children: money(formatNumber, compareAt, currency) }) }), _jsxs("p", { className: cx("sf:ms-auto sf:mb-1.5 sf:inline-flex sf:items-center sf:gap-1.5 sf:rounded-full sf:px-3 sf:py-1 sf:text-sm sf:font-medium", soldOut ? "sf:bg-surface sf:text-muted" : "sf:bg-accent/10 sf:text-accent"), children: [!soldOut && _jsx(Check, { className: "sf:size-4" }), soldOut ? t("storefront.soldOut") : left !== null && left <= 5 ? t("storefront.onlyLeft", { count: left }) : t("storefront.inStock")] })] }), variants.length > 0 && (_jsxs("fieldset", { className: "sf:flex sf:flex-col sf:gap-3", children: [_jsx("legend", { className: "sf:mb-3 sf:text-sm sf:font-medium sf:text-muted", children: t("storefront.options") }), _jsx("div", { className: "sf:flex sf:flex-wrap sf:gap-2", children: variants.map((option) => (_jsxs("label", { className: "sf:relative", children: [_jsx("input", { type: "radio", name: `${id}-variant`, value: option.id, checked: variant === option.id, disabled: option.stock === 0, onChange: () => choose(option), className: "sf:peer sf:sr-only" }), _jsx("span", { className: "sf:inline-flex sf:h-12 sf:min-w-12 sf:cursor-pointer sf:items-center sf:justify-center sf:rounded-full sf:border sf:border-line sf:bg-page sf:px-4 sf:text-sm sf:font-medium sf:text-ink sf:transition sf:select-none sf:hover:border-ink sf:peer-checked:border-accent sf:peer-checked:bg-accent sf:peer-checked:text-on-accent sf:peer-focus-visible:ring-4 sf:peer-focus-visible:ring-accent/25 sf:peer-disabled:cursor-not-allowed sf:peer-disabled:text-muted sf:peer-disabled:line-through sf:peer-disabled:opacity-60 sf:peer-disabled:hover:border-line", children: option.title })] }, option.id))) })] })), !soldOut && (_jsxs("div", { className: "sf:flex sf:items-center sf:gap-4", children: [_jsx("label", { htmlFor: `${id}-quantity`, className: "sf:text-sm sf:font-medium sf:text-muted", children: t("storefront.quantity") }), _jsx(Stepper, { id: `${id}-quantity`, value: Math.min(quantity, max), max: max, onChange: (value) => { setQuantity(value); setAdded(false); }, words: words })] })), _jsxs("div", { className: "sf:grid sf:grid-cols-2 sf:gap-3", children: [_jsx("button", { type: "submit", value: "buy", disabled: soldOut, className: "sf:inline-flex sf:h-14 sf:items-center sf:justify-center sf:rounded-full sf:bg-accent sf:px-6 sf:text-base sf:font-semibold sf:text-on-accent sf:shadow-[0_10px_24px_-10px] sf:shadow-accent sf:transition sf:hover:brightness-110 sf:active:scale-[0.98] sf:disabled:cursor-not-allowed sf:disabled:opacity-50 sf:disabled:shadow-none sf:focus-visible:outline-2 sf:focus-visible:outline-offset-2 sf:focus-visible:outline-accent", children: t("storefront.buyNow") }), _jsx("button", { type: "submit", value: "add", disabled: soldOut, className: "sf:inline-flex sf:h-14 sf:items-center sf:justify-center sf:rounded-full sf:border sf:border-line sf:bg-surface sf:px-6 sf:text-base sf:font-semibold sf:text-ink sf:transition sf:hover:border-ink sf:active:scale-[0.98] sf:disabled:cursor-not-allowed sf:disabled:opacity-50 sf:focus-visible:outline-2 sf:focus-visible:outline-offset-2 sf:focus-visible:outline-accent", children: soldOut ? t("storefront.soldOut") : t("storefront.addToCart") })] }), _jsx("p", { role: "status", className: cx("sf:-mt-3 sf:text-sm sf:text-accent", !added && "sf:sr-only"), children: added && _jsxs(_Fragment, { children: [t("storefront.added"), " ", _jsx("a", { href: sitePath(words, cartHref), className: "sf:font-semibold sf:underline sf:underline-offset-4", children: t("storefront.viewCart") })] }) })] }));
|
|
144
|
+
}
|
|
145
|
+
/* ------------------------------------------------------------------- share */
|
|
146
|
+
/** The browser's share sheet where there is one, and copying the address where there isn't. */
|
|
147
|
+
export function ShareButton({ title, words, className }) {
|
|
148
|
+
const { t } = siteWords(words);
|
|
149
|
+
const [copied, setCopied] = useState(false);
|
|
150
|
+
async function share() {
|
|
151
|
+
const url = window.location.href;
|
|
152
|
+
if (typeof navigator.share === "function") {
|
|
153
|
+
await navigator.share({ title, url }).catch(() => null);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
try {
|
|
157
|
+
await navigator.clipboard.writeText(url);
|
|
158
|
+
setCopied(true);
|
|
159
|
+
setTimeout(() => setCopied(false), 2000);
|
|
160
|
+
}
|
|
161
|
+
catch { /* clipboard blocked: nothing to say */ }
|
|
162
|
+
}
|
|
163
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: share, "aria-label": t("storefront.share"), className: className, children: copied ? _jsx(Check, {}) : _jsx(Send, {}) }), _jsx("span", { role: "status", className: "sf:sr-only", children: copied ? t("storefront.copied") : "" })] }));
|
|
164
|
+
}
|
|
Binary file
|
package/fonts/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Geist by Vercel and basement.studio, under the SIL Open Font License 1.1: https://github.com/vercel/geist-font
|
package/icons.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SVGProps } from "react";
|
|
2
|
+
type Props = SVGProps<SVGSVGElement>;
|
|
3
|
+
export declare const ArrowUpRight: (props: Props) => import("react").JSX.Element;
|
|
4
|
+
export declare const ChevronLeft: (props: Props) => import("react").JSX.Element;
|
|
5
|
+
export declare const ChevronRight: (props: Props) => import("react").JSX.Element;
|
|
6
|
+
export declare const ChevronDown: (props: Props) => import("react").JSX.Element;
|
|
7
|
+
export declare const Bag: (props: Props) => import("react").JSX.Element;
|
|
8
|
+
export declare const User: (props: Props) => import("react").JSX.Element;
|
|
9
|
+
export declare const Search: (props: Props) => import("react").JSX.Element;
|
|
10
|
+
export declare const Send: (props: Props) => import("react").JSX.Element;
|
|
11
|
+
export declare const Globe: (props: Props) => import("react").JSX.Element;
|
|
12
|
+
export declare const Bars: (props: Props) => import("react").JSX.Element;
|
|
13
|
+
export declare const Minus: (props: Props) => import("react").JSX.Element;
|
|
14
|
+
export declare const Plus: (props: Props) => import("react").JSX.Element;
|
|
15
|
+
export declare const Check: (props: Props) => import("react").JSX.Element;
|
|
16
|
+
export {};
|
package/icons.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** Line icons on a 24px grid, drawn in the current colour. Decorative: whatever holds one gives it a name. */
|
|
3
|
+
function Icon({ children, className = "sf:size-5", ...props }) {
|
|
4
|
+
return (_jsx("svg", { "aria-hidden": "true", focusable: "false", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.75, strokeLinecap: "round", strokeLinejoin: "round", className: className, ...props, children: children }));
|
|
5
|
+
}
|
|
6
|
+
export const ArrowUpRight = (props) => _jsx(Icon, { ...props, children: _jsx("path", { d: "M7 17 17 7M8 7h9v9" }) });
|
|
7
|
+
export const ChevronLeft = (props) => _jsx(Icon, { ...props, children: _jsx("path", { d: "m15 18-6-6 6-6" }) });
|
|
8
|
+
export const ChevronRight = (props) => _jsx(Icon, { ...props, children: _jsx("path", { d: "m9 18 6-6-6-6" }) });
|
|
9
|
+
export const ChevronDown = (props) => _jsx(Icon, { ...props, children: _jsx("path", { d: "m6 9 6 6 6-6" }) });
|
|
10
|
+
export const Bag = (props) => _jsxs(Icon, { ...props, children: [_jsx("path", { d: "M5 8h14l-1 12H6L5 8Z" }), _jsx("path", { d: "M9 8V6a3 3 0 0 1 6 0v2" })] });
|
|
11
|
+
export const User = (props) => _jsxs(Icon, { ...props, children: [_jsx("circle", { cx: "12", cy: "8", r: "4" }), _jsx("path", { d: "M4 21a8 8 0 0 1 16 0" })] });
|
|
12
|
+
export const Search = (props) => _jsxs(Icon, { ...props, children: [_jsx("circle", { cx: "11", cy: "11", r: "7" }), _jsx("path", { d: "m20 20-3.5-3.5" })] });
|
|
13
|
+
export const Send = (props) => _jsxs(Icon, { ...props, children: [_jsx("path", { d: "M21 3 10 14" }), _jsx("path", { d: "m21 3-7 18-4-7-7-4 18-7Z" })] });
|
|
14
|
+
export const Globe = (props) => _jsxs(Icon, { ...props, children: [_jsx("circle", { cx: "12", cy: "12", r: "9" }), _jsx("path", { d: "M3 12h18M12 3c2.5 2.7 3.8 5.7 3.8 9s-1.3 6.3-3.8 9c-2.5-2.7-3.8-5.7-3.8-9S9.5 5.7 12 3Z" })] });
|
|
15
|
+
export const Bars = (props) => _jsx(Icon, { ...props, children: _jsx("path", { d: "M4 7h16M4 12h16M4 17h10" }) });
|
|
16
|
+
export const Minus = (props) => _jsx(Icon, { ...props, children: _jsx("path", { d: "M5 12h14" }) });
|
|
17
|
+
export const Plus = (props) => _jsx(Icon, { ...props, children: _jsx("path", { d: "M12 5v14M5 12h14" }) });
|
|
18
|
+
export const Check = (props) => _jsx(Icon, { ...props, children: _jsx("path", { d: "m5 12 5 5 9-10" }) });
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface StorefrontOptions {
|
|
2
|
+
/** Replaces the words under the front page's heading. Owners can also change them per language under Languages → Site text. */
|
|
3
|
+
tagline?: string;
|
|
4
|
+
/** The product search box on the front page. It searches products through the records API, as a visitor. */
|
|
5
|
+
search: boolean;
|
|
6
|
+
/** An orders button in the header, for shops whose customers sign in to see their orders. */
|
|
7
|
+
accountLinks: boolean;
|
|
8
|
+
/** "auto" follows the visitor's light or dark setting. "light" always shows the light colours. */
|
|
9
|
+
colorScheme: "auto" | "light";
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A storefront look for the shop plugin: soft rounded product cards, a product page with an
|
|
13
|
+
* image stage, option chips and a quantity stepper, and a two-column cart. Checkout, orders
|
|
14
|
+
* and the cart itself are the plugin's parts, so they behave as on the plugin's own pages.
|
|
15
|
+
*/
|
|
16
|
+
export declare const storefront: ({ tagline, search, accountLinks, colorScheme }?: Partial<StorefrontOptions>) => import("tansy/theme").ThemeManifest<StorefrontOptions>;
|
package/index.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { defineTheme } from "tansy/theme";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import schema from "./schema.json";
|
|
4
|
+
const options = z.object({
|
|
5
|
+
tagline: z.string().max(300).optional(),
|
|
6
|
+
search: z.boolean(),
|
|
7
|
+
accountLinks: z.boolean(),
|
|
8
|
+
colorScheme: z.enum(["auto", "light"]),
|
|
9
|
+
});
|
|
10
|
+
/** What a card shows. Kept short, as every list here is read on every visit. */
|
|
11
|
+
const CARD_FIELDS = "id,title,summary,price,compareAtPrice,images,stock,categories";
|
|
12
|
+
const CARD = { collection: "shop-products", sort: "-createdAt", fields: CARD_FIELDS, urls: "1" };
|
|
13
|
+
const CATEGORIES = { collection: "shop-categories", sort: "name", perPage: 50, fields: "id,name", urls: "1" };
|
|
14
|
+
/** The Shop page, for its currency and its address. Replaces the plugin's `store`, which reads the currency alone. */
|
|
15
|
+
const STORE = { collection: "shop-store", perPage: 1, fields: "id,currency", urls: "1" };
|
|
16
|
+
const PER_PAGE = 12;
|
|
17
|
+
/** The front page, at the site's root and at the shop's own address. `products` replaces the shop plugin's list of the same name, to add summaries and categories. */
|
|
18
|
+
const FRONT = {
|
|
19
|
+
store: STORE,
|
|
20
|
+
products: { ...CARD, perPage: PER_PAGE, paged: true },
|
|
21
|
+
categories: CATEGORIES,
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A storefront look for the shop plugin: soft rounded product cards, a product page with an
|
|
25
|
+
* image stage, option chips and a quantity stepper, and a two-column cart. Checkout, orders
|
|
26
|
+
* and the cart itself are the plugin's parts, so they behave as on the plugin's own pages.
|
|
27
|
+
*/
|
|
28
|
+
export const storefront = ({ tagline, search = true, accountLinks = true, colorScheme = "auto" } = {}) => defineTheme({
|
|
29
|
+
name: "storefront",
|
|
30
|
+
version: "0.1.0",
|
|
31
|
+
apiVersion: 1,
|
|
32
|
+
render: "@tansy/theme-storefront/render",
|
|
33
|
+
requires: { plugins: ["shop"] },
|
|
34
|
+
options: { schema: options, value: { tagline, search, accountLinks, colorScheme } },
|
|
35
|
+
schema,
|
|
36
|
+
tokens: {
|
|
37
|
+
color: {
|
|
38
|
+
page: "#ffffff",
|
|
39
|
+
surface: "#f2f3f2",
|
|
40
|
+
text: "#121413",
|
|
41
|
+
muted: "#6a706d",
|
|
42
|
+
border: "#e6e8e7",
|
|
43
|
+
accent: "#3d8a6e",
|
|
44
|
+
"on-accent": "#ffffff",
|
|
45
|
+
},
|
|
46
|
+
font: { body: "var(--storefront-font), system-ui, sans-serif" },
|
|
47
|
+
size: { measure: "46rem", wide: "80rem" },
|
|
48
|
+
space: { gutter: "1.25rem", gap: "1.5rem", section: "4.5rem" },
|
|
49
|
+
radius: { card: "2rem", control: "999px" },
|
|
50
|
+
shadow: { card: "0 18px 48px rgba(18, 20, 19, 0.08)" },
|
|
51
|
+
},
|
|
52
|
+
singletons: ["site-menu"],
|
|
53
|
+
queries: {
|
|
54
|
+
home: FRONT,
|
|
55
|
+
"shop-store": FRONT,
|
|
56
|
+
"shop-categories": {
|
|
57
|
+
store: STORE,
|
|
58
|
+
products: { ...CARD, filter: "categories ?= @record.id", perPage: PER_PAGE, paged: true },
|
|
59
|
+
categories: CATEGORIES,
|
|
60
|
+
},
|
|
61
|
+
// Beside the plugin's own `variants`, which the buy box reads.
|
|
62
|
+
"shop-products": {
|
|
63
|
+
store: STORE,
|
|
64
|
+
related: { ...CARD, filter: "categories ?= @record.categories && id != @record.id", perPage: 4 },
|
|
65
|
+
latest: { ...CARD, filter: "id != @record.id", perPage: 4 },
|
|
66
|
+
categories: CATEGORIES,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
});
|
package/lib.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TemplateProps } from "tansy/theme";
|
|
2
|
+
/** Joins class names, skipping the empty ones. */
|
|
3
|
+
export declare const cx: (...names: Array<string | false | null | undefined>) => string;
|
|
4
|
+
export declare const text: (value: unknown) => string;
|
|
5
|
+
export declare const num: (value: unknown) => number | null;
|
|
6
|
+
export declare const ids: (value: unknown) => number[];
|
|
7
|
+
export declare const fileIds: (value: unknown) => string[];
|
|
8
|
+
/** A price in the shop's currency, in the page's language. A currency Intl doesn't know still shows the amount. */
|
|
9
|
+
export declare function money(formatNumber: TemplateProps["formatNumber"], amount: number, currency: string): string;
|
package/lib.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Joins class names, skipping the empty ones. */
|
|
2
|
+
export const cx = (...names) => names.filter(Boolean).join(" ");
|
|
3
|
+
export const text = (value) => (typeof value === "string" ? value : "");
|
|
4
|
+
export const num = (value) => (typeof value === "number" && Number.isFinite(value) ? value : null);
|
|
5
|
+
export const ids = (value) => (Array.isArray(value) ? value.filter((id) => typeof id === "number") : typeof value === "number" ? [value] : []);
|
|
6
|
+
export const fileIds = (value) => (Array.isArray(value) ? value.filter((id) => typeof id === "string") : []);
|
|
7
|
+
/** A price in the shop's currency, in the page's language. A currency Intl doesn't know still shows the amount. */
|
|
8
|
+
export function money(formatNumber, amount, currency) {
|
|
9
|
+
try {
|
|
10
|
+
return formatNumber(amount, { style: "currency", currency: currency.toUpperCase() });
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return `${amount.toFixed(2)} ${currency.toUpperCase()}`;
|
|
14
|
+
}
|
|
15
|
+
}
|
package/messages.d.ts
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The theme's words, under `storefront`, so a client part gets only these with `pickWords`.
|
|
3
|
+
* Owners can change any of them per language under Languages → Site text. The cart, checkout
|
|
4
|
+
* and orders speak the shop plugin's words, under `shop`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const messages: {
|
|
7
|
+
en: {
|
|
8
|
+
storefront: {
|
|
9
|
+
kicker: string;
|
|
10
|
+
heroTitle: string;
|
|
11
|
+
heroIntro: string;
|
|
12
|
+
shopNow: string;
|
|
13
|
+
searchLabel: string;
|
|
14
|
+
searchPlaceholder: string;
|
|
15
|
+
searching: string;
|
|
16
|
+
searchFailed: string;
|
|
17
|
+
found: string;
|
|
18
|
+
noResults: string;
|
|
19
|
+
categories: string;
|
|
20
|
+
all: string;
|
|
21
|
+
newArrivals: string;
|
|
22
|
+
products: string;
|
|
23
|
+
pageOf: string;
|
|
24
|
+
previousPage: string;
|
|
25
|
+
nextPage: string;
|
|
26
|
+
noProducts: string;
|
|
27
|
+
emptyCategory: string;
|
|
28
|
+
featured: string;
|
|
29
|
+
soldOut: string;
|
|
30
|
+
sale: string;
|
|
31
|
+
options: string;
|
|
32
|
+
quantity: string;
|
|
33
|
+
decrease: string;
|
|
34
|
+
increase: string;
|
|
35
|
+
onlyLeft: string;
|
|
36
|
+
inStock: string;
|
|
37
|
+
addToCart: string;
|
|
38
|
+
buyNow: string;
|
|
39
|
+
added: string;
|
|
40
|
+
viewCart: string;
|
|
41
|
+
previousImage: string;
|
|
42
|
+
nextImage: string;
|
|
43
|
+
showImage: string;
|
|
44
|
+
images: string;
|
|
45
|
+
share: string;
|
|
46
|
+
copied: string;
|
|
47
|
+
back: string;
|
|
48
|
+
details: string;
|
|
49
|
+
youMayLike: string;
|
|
50
|
+
cart: string;
|
|
51
|
+
orders: string;
|
|
52
|
+
menu: string;
|
|
53
|
+
openMenu: string;
|
|
54
|
+
footerMenu: string;
|
|
55
|
+
language: string;
|
|
56
|
+
skip: string;
|
|
57
|
+
rights: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
ar: {
|
|
61
|
+
storefront: {
|
|
62
|
+
kicker: string;
|
|
63
|
+
heroTitle: string;
|
|
64
|
+
heroIntro: string;
|
|
65
|
+
shopNow: string;
|
|
66
|
+
searchLabel: string;
|
|
67
|
+
searchPlaceholder: string;
|
|
68
|
+
searching: string;
|
|
69
|
+
searchFailed: string;
|
|
70
|
+
found: string;
|
|
71
|
+
noResults: string;
|
|
72
|
+
categories: string;
|
|
73
|
+
all: string;
|
|
74
|
+
newArrivals: string;
|
|
75
|
+
products: string;
|
|
76
|
+
pageOf: string;
|
|
77
|
+
previousPage: string;
|
|
78
|
+
nextPage: string;
|
|
79
|
+
noProducts: string;
|
|
80
|
+
emptyCategory: string;
|
|
81
|
+
featured: string;
|
|
82
|
+
soldOut: string;
|
|
83
|
+
sale: string;
|
|
84
|
+
options: string;
|
|
85
|
+
quantity: string;
|
|
86
|
+
decrease: string;
|
|
87
|
+
increase: string;
|
|
88
|
+
onlyLeft: string;
|
|
89
|
+
inStock: string;
|
|
90
|
+
addToCart: string;
|
|
91
|
+
buyNow: string;
|
|
92
|
+
added: string;
|
|
93
|
+
viewCart: string;
|
|
94
|
+
previousImage: string;
|
|
95
|
+
nextImage: string;
|
|
96
|
+
showImage: string;
|
|
97
|
+
images: string;
|
|
98
|
+
share: string;
|
|
99
|
+
copied: string;
|
|
100
|
+
back: string;
|
|
101
|
+
details: string;
|
|
102
|
+
youMayLike: string;
|
|
103
|
+
cart: string;
|
|
104
|
+
orders: string;
|
|
105
|
+
menu: string;
|
|
106
|
+
openMenu: string;
|
|
107
|
+
footerMenu: string;
|
|
108
|
+
language: string;
|
|
109
|
+
skip: string;
|
|
110
|
+
rights: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
};
|
package/messages.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The theme's words, under `storefront`, so a client part gets only these with `pickWords`.
|
|
3
|
+
* Owners can change any of them per language under Languages → Site text. The cart, checkout
|
|
4
|
+
* and orders speak the shop plugin's words, under `shop`.
|
|
5
|
+
*/
|
|
6
|
+
export const messages = {
|
|
7
|
+
en: {
|
|
8
|
+
storefront: {
|
|
9
|
+
kicker: "New season",
|
|
10
|
+
heroTitle: "Experience the difference",
|
|
11
|
+
heroIntro: "Thoughtfully made pieces for every day, picked with care and sent to your door.",
|
|
12
|
+
shopNow: "Shop now",
|
|
13
|
+
searchLabel: "Search products",
|
|
14
|
+
searchPlaceholder: "Search goods",
|
|
15
|
+
searching: "Searching…",
|
|
16
|
+
searchFailed: "Search isn't working right now. Try again in a moment.",
|
|
17
|
+
found: "{count, plural, one {# product found} other {# products found}}",
|
|
18
|
+
noResults: "No products match “{query}”.",
|
|
19
|
+
categories: "Categories",
|
|
20
|
+
all: "All",
|
|
21
|
+
newArrivals: "New arrivals",
|
|
22
|
+
products: "{count, plural, one {# product} other {# products}}",
|
|
23
|
+
pageOf: "Page {page}",
|
|
24
|
+
previousPage: "Previous page",
|
|
25
|
+
nextPage: "Next page",
|
|
26
|
+
noProducts: "No products yet.",
|
|
27
|
+
emptyCategory: "Nothing in this category yet.",
|
|
28
|
+
featured: "Featured",
|
|
29
|
+
soldOut: "Sold out",
|
|
30
|
+
sale: "Sale",
|
|
31
|
+
options: "Options",
|
|
32
|
+
quantity: "Quantity",
|
|
33
|
+
decrease: "One fewer",
|
|
34
|
+
increase: "One more",
|
|
35
|
+
onlyLeft: "Only {count} left",
|
|
36
|
+
inStock: "In stock",
|
|
37
|
+
addToCart: "Add to cart",
|
|
38
|
+
buyNow: "Buy now",
|
|
39
|
+
added: "Added to your cart.",
|
|
40
|
+
viewCart: "View cart",
|
|
41
|
+
previousImage: "Previous image",
|
|
42
|
+
nextImage: "Next image",
|
|
43
|
+
showImage: "Show image {number}",
|
|
44
|
+
images: "Product images",
|
|
45
|
+
share: "Share",
|
|
46
|
+
copied: "Link copied",
|
|
47
|
+
back: "Back to the shop",
|
|
48
|
+
details: "Details",
|
|
49
|
+
youMayLike: "You may also like",
|
|
50
|
+
cart: "Cart",
|
|
51
|
+
orders: "Your orders",
|
|
52
|
+
menu: "Main",
|
|
53
|
+
openMenu: "Menu",
|
|
54
|
+
footerMenu: "Footer",
|
|
55
|
+
language: "Language",
|
|
56
|
+
skip: "Skip to content",
|
|
57
|
+
rights: "All rights reserved.",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
ar: {
|
|
61
|
+
storefront: {
|
|
62
|
+
kicker: "موسم جديد",
|
|
63
|
+
heroTitle: "عِش الفرق",
|
|
64
|
+
heroIntro: "قطع مصنوعة بعناية لكل يوم، مختارة بحرص وتصلك إلى بابك.",
|
|
65
|
+
shopNow: "تسوّق الآن",
|
|
66
|
+
searchLabel: "ابحث في المنتجات",
|
|
67
|
+
searchPlaceholder: "ابحث عن منتج",
|
|
68
|
+
searching: "جارٍ البحث…",
|
|
69
|
+
searchFailed: "البحث لا يعمل الآن. حاول مجددًا بعد قليل.",
|
|
70
|
+
found: "{count, plural, zero {لا توجد نتائج} one {منتج واحد} two {منتجان} few {# منتجات} many {# منتجًا} other {# منتج}}",
|
|
71
|
+
noResults: "لا توجد منتجات تطابق «{query}».",
|
|
72
|
+
categories: "الفئات",
|
|
73
|
+
all: "الكل",
|
|
74
|
+
newArrivals: "وصل حديثًا",
|
|
75
|
+
products: "{count, plural, zero {لا منتجات} one {منتج واحد} two {منتجان} few {# منتجات} many {# منتجًا} other {# منتج}}",
|
|
76
|
+
pageOf: "الصفحة {page}",
|
|
77
|
+
previousPage: "الصفحة السابقة",
|
|
78
|
+
nextPage: "الصفحة التالية",
|
|
79
|
+
noProducts: "لا توجد منتجات بعد.",
|
|
80
|
+
emptyCategory: "لا يوجد شيء في هذه الفئة بعد.",
|
|
81
|
+
featured: "مميز",
|
|
82
|
+
soldOut: "نفدت الكمية",
|
|
83
|
+
sale: "تخفيض",
|
|
84
|
+
options: "الخيارات",
|
|
85
|
+
quantity: "الكمية",
|
|
86
|
+
decrease: "أنقص واحدًا",
|
|
87
|
+
increase: "زد واحدًا",
|
|
88
|
+
onlyLeft: "بقي {count} فقط",
|
|
89
|
+
inStock: "متوفر",
|
|
90
|
+
addToCart: "أضف إلى السلة",
|
|
91
|
+
buyNow: "اشترِ الآن",
|
|
92
|
+
added: "أُضيف إلى سلتك.",
|
|
93
|
+
viewCart: "اعرض السلة",
|
|
94
|
+
previousImage: "الصورة السابقة",
|
|
95
|
+
nextImage: "الصورة التالية",
|
|
96
|
+
showImage: "اعرض الصورة {number}",
|
|
97
|
+
images: "صور المنتج",
|
|
98
|
+
share: "مشاركة",
|
|
99
|
+
copied: "نُسخ الرابط",
|
|
100
|
+
back: "العودة إلى المتجر",
|
|
101
|
+
details: "التفاصيل",
|
|
102
|
+
youMayLike: "قد يعجبك أيضًا",
|
|
103
|
+
cart: "السلة",
|
|
104
|
+
orders: "طلباتك",
|
|
105
|
+
menu: "القائمة الرئيسية",
|
|
106
|
+
openMenu: "القائمة",
|
|
107
|
+
footerMenu: "روابط التذييل",
|
|
108
|
+
language: "اللغة",
|
|
109
|
+
skip: "انتقل إلى المحتوى",
|
|
110
|
+
rights: "جميع الحقوق محفوظة.",
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
};
|