@lets-ship/site 3.4.0 → 3.5.1
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/dist/i18n/tables/de.d.ts.map +1 -1
- package/dist/i18n/tables/de.js +24 -0
- package/dist/i18n/tables/de.js.map +1 -1
- package/dist/i18n/tables/en.d.ts.map +1 -1
- package/dist/i18n/tables/en.js +24 -0
- package/dist/i18n/tables/en.js.map +1 -1
- package/dist/i18n/tables/es.d.ts.map +1 -1
- package/dist/i18n/tables/es.js +24 -0
- package/dist/i18n/tables/es.js.map +1 -1
- package/dist/i18n/tables/fr.d.ts.map +1 -1
- package/dist/i18n/tables/fr.js +24 -0
- package/dist/i18n/tables/fr.js.map +1 -1
- package/dist/i18n/tables/nl.d.ts.map +1 -1
- package/dist/i18n/tables/nl.js +24 -0
- package/dist/i18n/tables/nl.js.map +1 -1
- package/dist/i18n/tables/pt.d.ts.map +1 -1
- package/dist/i18n/tables/pt.js +24 -0
- package/dist/i18n/tables/pt.js.map +1 -1
- package/dist/i18n/tables/tr.d.ts.map +1 -1
- package/dist/i18n/tables/tr.js +24 -0
- package/dist/i18n/tables/tr.js.map +1 -1
- package/dist/i18n/types.d.ts +31 -0
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/mdx/allow-list.d.ts +1 -1
- package/dist/mdx/allow-list.d.ts.map +1 -1
- package/dist/mdx/allow-list.js +4 -0
- package/dist/mdx/allow-list.js.map +1 -1
- package/dist/mdx/components.d.ts.map +1 -1
- package/dist/mdx/components.js +8 -2
- package/dist/mdx/components.js.map +1 -1
- package/dist/website/blocks/app-views.d.ts +32 -0
- package/dist/website/blocks/app-views.d.ts.map +1 -0
- package/dist/website/blocks/app-views.js +42 -0
- package/dist/website/blocks/app-views.js.map +1 -0
- package/dist/website/blocks/app.d.ts +7 -0
- package/dist/website/blocks/app.d.ts.map +1 -0
- package/dist/website/blocks/app.js +7 -0
- package/dist/website/blocks/app.js.map +1 -0
- package/dist/website/blocks/booking-fields.d.ts +39 -0
- package/dist/website/blocks/booking-fields.d.ts.map +1 -0
- package/dist/website/blocks/booking-fields.js +44 -0
- package/dist/website/blocks/booking-fields.js.map +1 -0
- package/dist/website/blocks/booking-request.d.ts +22 -0
- package/dist/website/blocks/booking-request.d.ts.map +1 -0
- package/dist/website/blocks/booking-request.js +42 -0
- package/dist/website/blocks/booking-request.js.map +1 -0
- package/dist/website/blocks/booking-slot-picker.d.ts +23 -0
- package/dist/website/blocks/booking-slot-picker.d.ts.map +1 -0
- package/dist/website/blocks/booking-slot-picker.js +63 -0
- package/dist/website/blocks/booking-slot-picker.js.map +1 -0
- package/dist/website/blocks/booking-slots.d.ts +63 -0
- package/dist/website/blocks/booking-slots.d.ts.map +1 -0
- package/dist/website/blocks/booking-slots.js +127 -0
- package/dist/website/blocks/booking-slots.js.map +1 -0
- package/dist/website/blocks/booking-views.d.ts +42 -0
- package/dist/website/blocks/booking-views.d.ts.map +1 -0
- package/dist/website/blocks/booking-views.js +52 -0
- package/dist/website/blocks/booking-views.js.map +1 -0
- package/dist/website/blocks/call-to-action-views.d.ts.map +1 -1
- package/dist/website/blocks/call-to-action-views.js +1 -1
- package/dist/website/blocks/call-to-action-views.js.map +1 -1
- package/dist/website/blocks/card-grid-views.d.ts +5 -4
- package/dist/website/blocks/card-grid-views.d.ts.map +1 -1
- package/dist/website/blocks/card-grid-views.js +15 -3
- package/dist/website/blocks/card-grid-views.js.map +1 -1
- package/dist/website/blocks/catalog.d.ts +6 -2
- package/dist/website/blocks/catalog.d.ts.map +1 -1
- package/dist/website/blocks/catalog.js +6 -2
- package/dist/website/blocks/catalog.js.map +1 -1
- package/dist/website/blocks/commerce.d.ts.map +1 -1
- package/dist/website/blocks/commerce.js +2 -1
- package/dist/website/blocks/commerce.js.map +1 -1
- package/dist/website/blocks/contact-views.d.ts.map +1 -1
- package/dist/website/blocks/contact-views.js +7 -4
- package/dist/website/blocks/contact-views.js.map +1 -1
- package/dist/website/blocks/empty-state-views.d.ts.map +1 -1
- package/dist/website/blocks/empty-state-views.js +1 -1
- package/dist/website/blocks/empty-state-views.js.map +1 -1
- package/dist/website/blocks/event-dates.d.ts +42 -0
- package/dist/website/blocks/event-dates.d.ts.map +1 -0
- package/dist/website/blocks/event-dates.js +80 -0
- package/dist/website/blocks/event-dates.js.map +1 -0
- package/dist/website/blocks/event-list.d.ts +16 -0
- package/dist/website/blocks/event-list.d.ts.map +1 -0
- package/dist/website/blocks/event-list.js +37 -0
- package/dist/website/blocks/event-list.js.map +1 -0
- package/dist/website/blocks/event-rows.d.ts +9 -0
- package/dist/website/blocks/event-rows.d.ts.map +1 -0
- package/dist/website/blocks/event-rows.js +13 -0
- package/dist/website/blocks/event-rows.js.map +1 -0
- package/dist/website/blocks/event-visitor.d.ts +14 -0
- package/dist/website/blocks/event-visitor.d.ts.map +1 -0
- package/dist/website/blocks/event-visitor.js +16 -0
- package/dist/website/blocks/event-visitor.js.map +1 -0
- package/dist/website/blocks/faq-views.d.ts.map +1 -1
- package/dist/website/blocks/faq-views.js +7 -7
- package/dist/website/blocks/faq-views.js.map +1 -1
- package/dist/website/blocks/hero-views.js +1 -1
- package/dist/website/blocks/hero-views.js.map +1 -1
- package/dist/website/blocks/icons.d.ts +2 -0
- package/dist/website/blocks/icons.d.ts.map +1 -1
- package/dist/website/blocks/icons.js +3 -1
- package/dist/website/blocks/icons.js.map +1 -1
- package/dist/website/blocks/local-views.d.ts +27 -2
- package/dist/website/blocks/local-views.d.ts.map +1 -1
- package/dist/website/blocks/local-views.js +21 -5
- package/dist/website/blocks/local-views.js.map +1 -1
- package/dist/website/blocks/local.d.ts +10 -0
- package/dist/website/blocks/local.d.ts.map +1 -1
- package/dist/website/blocks/local.js +10 -0
- package/dist/website/blocks/local.js.map +1 -1
- package/dist/website/blocks/logo-stats-views.d.ts.map +1 -1
- package/dist/website/blocks/logo-stats-views.js +3 -1
- package/dist/website/blocks/logo-stats-views.js.map +1 -1
- package/dist/website/blocks/media-views.js +1 -1
- package/dist/website/blocks/media-views.js.map +1 -1
- package/dist/website/blocks/menu-views.d.ts +44 -0
- package/dist/website/blocks/menu-views.d.ts.map +1 -0
- package/dist/website/blocks/menu-views.js +47 -0
- package/dist/website/blocks/menu-views.js.map +1 -0
- package/dist/website/blocks/products-views.d.ts +38 -0
- package/dist/website/blocks/products-views.d.ts.map +1 -0
- package/dist/website/blocks/products-views.js +65 -0
- package/dist/website/blocks/products-views.js.map +1 -0
- package/dist/website/blocks/shop.d.ts +7 -0
- package/dist/website/blocks/shop.d.ts.map +1 -0
- package/dist/website/blocks/shop.js +7 -0
- package/dist/website/blocks/shop.js.map +1 -0
- package/dist/website/blocks/ticks.d.ts +10 -0
- package/dist/website/blocks/ticks.d.ts.map +1 -0
- package/dist/website/blocks/ticks.js +9 -0
- package/dist/website/blocks/ticks.js.map +1 -0
- package/dist/website/blocks/visitor-date.d.ts +2 -0
- package/dist/website/blocks/visitor-date.d.ts.map +1 -0
- package/dist/website/blocks/visitor-date.js +10 -0
- package/dist/website/blocks/visitor-date.js.map +1 -0
- package/package.json +1 -1
- package/styles.css +1021 -19
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The menu of a restaurant or a café: sections of dishes, each with a price, a short text, diet
|
|
3
|
+
* tags and an optional photo. Every word is a prop, so the content writes the dishes, the tags
|
|
4
|
+
* and the currency in the site's language. The rows read like a printed menu: rules between the
|
|
5
|
+
* dishes, no cards, and the prices in the brand's numerals so they line up.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactElement } from "react";
|
|
8
|
+
import { type Action, type Anchor, type BlockImage } from "./parts.js";
|
|
9
|
+
export declare const MENU_VARIANTS: readonly ["sections", "split", "photos"];
|
|
10
|
+
export type MenuVariant = (typeof MENU_VARIANTS)[number];
|
|
11
|
+
/** One dish or drink. The price is text, so the content says the currency and the size. */
|
|
12
|
+
export type MenuDish = {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly price: string;
|
|
15
|
+
readonly text?: string;
|
|
16
|
+
/** Short marks such as "Vegan" or "Spicy", in the site's language. */
|
|
17
|
+
readonly tags?: readonly string[];
|
|
18
|
+
/** A photo of the dish: small beside its row, or the card's picture in the photos layout. */
|
|
19
|
+
readonly image?: BlockImage;
|
|
20
|
+
/** A line under the price, such as "per glass" or "sample price". */
|
|
21
|
+
readonly note?: string;
|
|
22
|
+
};
|
|
23
|
+
/** A part of the menu, such as "Starters" or "Drinks", with an optional line under its name. */
|
|
24
|
+
export type MenuSection = {
|
|
25
|
+
readonly title: string;
|
|
26
|
+
readonly text?: string;
|
|
27
|
+
readonly dishes: readonly MenuDish[];
|
|
28
|
+
};
|
|
29
|
+
export type MenuProps = Anchor & {
|
|
30
|
+
readonly title?: string;
|
|
31
|
+
readonly intro?: string;
|
|
32
|
+
readonly sections: readonly MenuSection[];
|
|
33
|
+
/** A line for the whole menu, such as where to ask about allergens. */
|
|
34
|
+
readonly note?: string;
|
|
35
|
+
/** Usually the founder's own order page or a link to reserve a table. */
|
|
36
|
+
readonly primary?: Action;
|
|
37
|
+
readonly secondary?: Action;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* The sections in two columns on a wide screen (sections), the heading beside them and kept in
|
|
41
|
+
* view while the dishes scroll (split), or each dish as a photo card (photos).
|
|
42
|
+
*/
|
|
43
|
+
export declare function menuView(variant: MenuVariant, props: MenuProps): ReactElement;
|
|
44
|
+
//# sourceMappingURL=menu-views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-views.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/menu-views.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EACN,KAAK,MAAM,EAEX,KAAK,MAAM,EACX,KAAK,UAAU,EAKf,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,aAAa,0CAAsB,CAAC;AACjD,MAAM,MAAM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fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { BLOCK_VARIANTS } from "./catalog.js";
|
|
3
|
+
import { keyed } from "./list.js";
|
|
4
|
+
import { Actions, BlockImg, BlockTitle, bandAttrs, Section, } from "./parts.js";
|
|
5
|
+
import { filled, required } from "./variant.js";
|
|
6
|
+
export const MENU_VARIANTS = BLOCK_VARIANTS.Menu;
|
|
7
|
+
/**
|
|
8
|
+
* Every dish card keeps one size, whatever the length of its section: a section of two drinks
|
|
9
|
+
* would otherwise get two cards twice the size of the dishes above it.
|
|
10
|
+
*/
|
|
11
|
+
const DISH_COLUMNS = "3";
|
|
12
|
+
function Tags({ tags }) {
|
|
13
|
+
if (tags.length === 0)
|
|
14
|
+
return null;
|
|
15
|
+
return (_jsx("ul", { className: "site-menu-tags", children: keyed(tags).map(({ key, item }) => (_jsx("li", { className: "site-tag", children: item }, key))) }));
|
|
16
|
+
}
|
|
17
|
+
function Price({ dish }) {
|
|
18
|
+
return (_jsxs("p", { className: "site-price-amount", children: [dish.price, dish.note ? _jsx("span", { className: "site-price-note", children: dish.note }) : null] }));
|
|
19
|
+
}
|
|
20
|
+
function DishRow({ dish }) {
|
|
21
|
+
return (_jsxs("li", { className: "site-menu-dish", children: [dish.image ? _jsx(BlockImg, { image: dish.image, className: "site-menu-thumb" }) : null, _jsxs("div", { className: "site-menu-words", children: [_jsx("h4", { className: "site-menu-name", children: dish.name }), dish.text ? _jsx("p", { className: "site-card-text", children: dish.text }) : null, _jsx(Tags, { tags: dish.tags ?? [] })] }), _jsx(Price, { dish: dish })] }));
|
|
22
|
+
}
|
|
23
|
+
function DishCard({ dish }) {
|
|
24
|
+
const image = required("Menu", "photos", "image", dish.image, `add an image to "${dish.name}"`);
|
|
25
|
+
return (_jsxs("article", { className: "site-menu-card", children: [_jsx(BlockImg, { image: image, className: "site-menu-photo" }), _jsxs("div", { className: "site-menu-card-head", children: [_jsx("h4", { className: "site-menu-name", children: dish.name }), _jsx(Price, { dish: dish })] }), dish.text ? _jsx("p", { className: "site-card-text", children: dish.text }) : null, _jsx(Tags, { tags: dish.tags ?? [] })] }));
|
|
26
|
+
}
|
|
27
|
+
function MenuGroup({ section, variant, }) {
|
|
28
|
+
const dishes = filled("Menu", variant, "dishes", section.dishes);
|
|
29
|
+
return (_jsxs("div", { className: "site-menu-section", children: [_jsx("h3", { className: "site-menu-heading", children: section.title }), section.text ? _jsx("p", { className: "site-card-text site-menu-section-text", children: section.text }) : null, variant === "photos" ? (_jsx("div", { className: "site-grid site-menu-cards", "data-cols": DISH_COLUMNS, children: keyed(dishes).map(({ key, item }) => (_jsx(DishCard, { dish: item }, key))) })) : (_jsx("ul", { className: "site-menu-list", children: keyed(dishes).map(({ key, item }) => (_jsx(DishRow, { dish: item }, key))) }))] }));
|
|
30
|
+
}
|
|
31
|
+
/** The line for the whole menu and the buttons, under the dishes or under the heading. */
|
|
32
|
+
function Closing({ props }) {
|
|
33
|
+
return (_jsxs(_Fragment, { children: [props.note ? _jsx("p", { className: "site-menu-note", children: props.note }) : null, _jsx(Actions, { primary: props.primary, secondary: props.secondary })] }));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The sections in two columns on a wide screen (sections), the heading beside them and kept in
|
|
37
|
+
* view while the dishes scroll (split), or each dish as a photo card (photos).
|
|
38
|
+
*/
|
|
39
|
+
export function menuView(variant, props) {
|
|
40
|
+
const sections = filled("Menu", variant, "sections", props.sections);
|
|
41
|
+
const groups = keyed(sections).map(({ key, item }) => _jsx(MenuGroup, { section: item, variant: variant }, key));
|
|
42
|
+
if (variant === "split")
|
|
43
|
+
return (_jsx("section", { ...bandAttrs("Menu", props, "site-block"), "data-variant": "split", children: _jsxs("div", { className: "site-container site-split-end", children: [_jsxs("div", { className: "site-menu-side site-split-side", children: [props.title || props.intro ? (_jsxs("div", { className: "site-split-head", children: [props.title ? _jsx(BlockTitle, { block: "Menu", title: props.title, highlight: props.highlight }) : null, props.intro ? _jsx("p", { className: "site-block-intro", children: props.intro }) : null] })) : null, props.note || props.primary || props.secondary ? (_jsx("div", { className: "site-split-closing", children: _jsx(Closing, { props: props }) })) : null] }), _jsx("div", { className: "site-menu", children: groups })] }) }));
|
|
44
|
+
const cols = variant === "sections" && sections.length > 1 ? "2" : undefined;
|
|
45
|
+
return (_jsxs(Section, { name: "Menu", id: props.id, tone: props.tone, title: props.title, highlight: props.highlight, intro: props.intro, children: [_jsx("div", { className: "site-menu", "data-variant": variant === "photos" ? "photos" : undefined, "data-cols": cols, children: groups }), _jsx(Closing, { props: props })] }));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=menu-views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-views.js","sourceRoot":"","sources":["../../../src/website/blocks/menu-views.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAEN,OAAO,EAGP,QAAQ,EACR,UAAU,EACV,SAAS,EACT,OAAO,GACP,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAC,IAAI,CAAC;AAkCjD;;;GAGG;AACH,MAAM,YAAY,GAAG,GAAG,CAAC;AAEzB,SAAS,IAAI,CAAC,EAAE,IAAI,EAAwC;IAC3D,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,OAAO,CACN,aAAI,SAAS,EAAC,gBAAgB,YAC5B,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CACnC,aAAc,SAAS,EAAC,UAAU,YAChC,IAAI,IADG,GAAG,CAEP,CACL,CAAC,GACE,CACL,CAAC;AACH,CAAC;AAED,SAAS,KAAK,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,KAAK,CAAC,KAAK,GAAK,CAAC,CAAC,CAAC,IAAI,IAClE,CACN,CAAC,CAAC,CAAC,IAAI,EACP,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CACjD,cAAK,SAAS,EAAC,oBAAoB,YAClC,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,GAAI,GACpB,CACN,CAAC,CAAC,CAAC,IAAI,IACH,EACN,cAAK,SAAS,EAAC,WAAW,YAAE,MAAM,GAAO,IACpC,GACG,CACV,CAAC;IACH,MAAM,IAAI,GAAG,OAAO,KAAK,UAAU,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7E,OAAO,CACN,MAAC,OAAO,IACP,IAAI,EAAC,MAAM,EACX,EAAE,EAAE,KAAK,CAAC,EAAE,EACZ,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,aAElB,cAAK,SAAS,EAAC,WAAW,kBAAe,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,eAAa,IAAI,YACnG,MAAM,GACF,EACN,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,GAAI,IAChB,CACV,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import { type Action, type Anchor, type BlockImage } from "./parts.js";
|
|
3
|
+
export declare const PRODUCTS_VARIANTS: readonly ["grid", "detail"];
|
|
4
|
+
export type ProductsVariant = (typeof PRODUCTS_VARIANTS)[number];
|
|
5
|
+
/** A choice the buyer makes, such as a size. The label names the field and the values are its choices. */
|
|
6
|
+
export type ProductOption = {
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly values: readonly string[];
|
|
9
|
+
};
|
|
10
|
+
/** One product. The price is text, so the content says the currency. */
|
|
11
|
+
export type Product = {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly price: string;
|
|
14
|
+
/** The product's own page or its place on the shop page. The whole card is the link. */
|
|
15
|
+
readonly href?: string;
|
|
16
|
+
readonly image: BlockImage;
|
|
17
|
+
/** More photos of the product, for the detail layout. */
|
|
18
|
+
readonly images?: readonly BlockImage[];
|
|
19
|
+
readonly text?: string;
|
|
20
|
+
/** A short word on the photo, such as "New" or "Sold out", in the site's language. */
|
|
21
|
+
readonly badge?: string;
|
|
22
|
+
/** A line under the price, such as "sample price" or "incl. VAT". */
|
|
23
|
+
readonly note?: string;
|
|
24
|
+
/** The detail layout shows each as a field, and sends the choice to the shop page. */
|
|
25
|
+
readonly options?: readonly ProductOption[];
|
|
26
|
+
};
|
|
27
|
+
export type ProductsProps = Anchor & {
|
|
28
|
+
readonly title?: string;
|
|
29
|
+
readonly intro?: string;
|
|
30
|
+
readonly products: readonly Product[];
|
|
31
|
+
/** Needed by the detail layout: the button, and the founder's own shop, cart or order page. */
|
|
32
|
+
readonly buy?: Action;
|
|
33
|
+
/** The grid layout: a link under the products to the page with all of them. */
|
|
34
|
+
readonly more?: Action;
|
|
35
|
+
};
|
|
36
|
+
/** A grid of pictures with a name and a price each (grid), or one product with its options (detail). */
|
|
37
|
+
export declare function productsView(variant: ProductsVariant, props: ProductsProps): ReactElement;
|
|
38
|
+
//# sourceMappingURL=products-views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products-views.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/products-views.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,OAAO,CAAC;AAGjD,OAAO,EACN,KAAK,MAAM,EAEX,KAAK,MAAM,EACX,KAAK,UAAU,EAKf,MAAM,YAAY,CAAC;AAGpB,eAAO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OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,GAAG,YAAY,CAEzF"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The products of a small shop: a grid of pictures with a name and a price under each, and the
|
|
4
|
+
* page of one product with its photos, its options and a button. The site has no cart and no
|
|
5
|
+
* payment of its own, so the button leads to the founder's own shop or order page. Every word is
|
|
6
|
+
* a prop, so the content writes the names, the prices, the options and the buttons in the site's
|
|
7
|
+
* language.
|
|
8
|
+
*/
|
|
9
|
+
import Link from "next/link";
|
|
10
|
+
import { useId } from "react";
|
|
11
|
+
import { BLOCK_VARIANTS } from "./catalog.js";
|
|
12
|
+
import { gridColumns, keyed } from "./list.js";
|
|
13
|
+
import { ActionLink, BlockImg, BlockTitle, bandAttrs, Section, } from "./parts.js";
|
|
14
|
+
import { BlockPropError, filled, required } from "./variant.js";
|
|
15
|
+
export const PRODUCTS_VARIANTS = BLOCK_VARIANTS.Products;
|
|
16
|
+
const MOST_COLUMNS = 4;
|
|
17
|
+
function Price({ product }) {
|
|
18
|
+
return (_jsxs("p", { className: "site-price-amount", children: [product.price, product.note ? _jsx("span", { className: "site-price-note", children: product.note }) : null] }));
|
|
19
|
+
}
|
|
20
|
+
function Badge({ product }) {
|
|
21
|
+
return product.badge ? _jsx("span", { className: "site-tag site-product-badge", children: product.badge }) : null;
|
|
22
|
+
}
|
|
23
|
+
/** The product's name, and the link over the whole card when it has a page. */
|
|
24
|
+
function CardName({ product }) {
|
|
25
|
+
return (_jsx("h3", { className: "site-product-name", children: product.href ? (_jsx(Link, { href: product.href, className: "site-card-link", children: product.name })) : (product.name) }));
|
|
26
|
+
}
|
|
27
|
+
function ProductCard({ product }) {
|
|
28
|
+
return (_jsxs("article", { className: "site-product", children: [_jsxs("div", { className: "site-product-photo", children: [_jsx(BlockImg, { image: product.image, className: "site-product-img" }), _jsx(Badge, { product: product })] }), _jsxs("div", { className: "site-product-head", children: [_jsx(CardName, { product: product }), _jsx(Price, { product: product })] })] }));
|
|
29
|
+
}
|
|
30
|
+
function gridView(props) {
|
|
31
|
+
const products = filled("Products", "grid", "products", props.products);
|
|
32
|
+
return (_jsxs(Section, { name: "Products", id: props.id, tone: props.tone, title: props.title, highlight: props.highlight, intro: props.intro, children: [_jsx("ul", { className: "site-grid site-products", "data-cols": gridColumns(products.length, MOST_COLUMNS), children: keyed(products).map(({ key, item }) => (_jsx("li", { children: _jsx(ProductCard, { product: item }) }, key))) }), props.more ? (_jsx("div", { className: "site-products-more", "data-more": "", children: _jsx(ActionLink, { action: props.more, secondary: true }) })) : null] }));
|
|
33
|
+
}
|
|
34
|
+
/** The main photo, and the others as a row under it that scrolls with CSS scroll-snap. */
|
|
35
|
+
function Gallery({ product }) {
|
|
36
|
+
const more = product.images ?? [];
|
|
37
|
+
return (_jsxs("div", { className: "site-product-gallery", children: [_jsx("div", { className: "site-product-photo", children: _jsx(BlockImg, { image: product.image, className: "site-product-img" }) }), more.length > 0 ? (
|
|
38
|
+
// biome-ignore lint/a11y/noNoninteractiveTabindex: a row that scrolls must take focus, so a keyboard can scroll it
|
|
39
|
+
_jsx("ul", { className: "site-product-thumbs", tabIndex: 0, "aria-label": product.name, children: keyed(more).map(({ key, item }) => (_jsx("li", { className: "site-product-thumb", children: _jsx(BlockImg, { image: item, className: "site-product-img" }) }, key))) })) : null] }));
|
|
40
|
+
}
|
|
41
|
+
/** One choice as a select. Its name is the option's label, so the shop page gets `Size=M`. */
|
|
42
|
+
function OptionField({ option, id }) {
|
|
43
|
+
const values = filled("Products", "detail", `values in the option "${option.label}"`, option.values);
|
|
44
|
+
return (_jsxs("div", { children: [_jsx("label", { htmlFor: id, className: "site-label", children: option.label }), _jsx("select", { id: id, name: option.label, className: "site-input", children: keyed(values).map(({ key, item }) => (_jsx("option", { children: item }, key))) })] }));
|
|
45
|
+
}
|
|
46
|
+
/** A GET form, so the shop page receives the choices as query parameters and no script runs. */
|
|
47
|
+
function BuyForm({ product, buy }) {
|
|
48
|
+
const base = useId();
|
|
49
|
+
return (_jsxs("form", { method: "get", action: buy.href, className: "site-form site-product-form", children: [keyed(product.options ?? []).map(({ key, item }) => (_jsx(OptionField, { option: item, id: `${base}-${key}` }, key))), _jsx("button", { type: "submit", className: "site-button justify-center", children: buy.label })] }));
|
|
50
|
+
}
|
|
51
|
+
function detailView(props) {
|
|
52
|
+
const products = filled("Products", "detail", "products", props.products);
|
|
53
|
+
const [product] = products;
|
|
54
|
+
if (product === undefined || products.length > 1)
|
|
55
|
+
throw new BlockPropError("Products", "detail", "exactly one product", "use the grid layout for more than one product");
|
|
56
|
+
const buy = required("Products", "detail", "buy", props.buy, 'add buy={{ label: "Buy", href: "<your shop or order page>" }}');
|
|
57
|
+
// The block's own title is the page's h2, so the name is one level under it.
|
|
58
|
+
const Name = props.title ? "h3" : "h2";
|
|
59
|
+
return (_jsx("section", { ...bandAttrs("Products", props, "site-block"), "data-variant": "detail", children: _jsxs("div", { className: "site-container", children: [props.title ? _jsx(BlockTitle, { block: "Products", title: props.title, highlight: props.highlight }) : null, props.intro ? _jsx("p", { className: "site-block-intro", children: props.intro }) : null, _jsxs("div", { className: "site-product-detail", children: [_jsx(Gallery, { product: product }), _jsxs("div", { className: "site-product-info", children: [_jsx(Badge, { product: product }), _jsx(Name, { className: "site-product-title", children: product.name }), _jsx(Price, { product: product }), product.text ? _jsx("p", { className: "site-card-text", children: product.text }) : null, _jsx(BuyForm, { product: product, buy: buy })] })] })] }) }));
|
|
60
|
+
}
|
|
61
|
+
/** A grid of pictures with a name and a price each (grid), or one product with its options (detail). */
|
|
62
|
+
export function productsView(variant, props) {
|
|
63
|
+
return variant === "detail" ? detailView(props) : gridView(props);
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=products-views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products-views.js","sourceRoot":"","sources":["../../../src/website/blocks/products-views.tsx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AC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import { type ProductsProps, type ProductsVariant } from "./products-views.js";
|
|
3
|
+
/** What a small shop sells: a grid of products, or the page of one product with a button to the shop. */
|
|
4
|
+
export declare function Products({ variant, ...props }: ProductsProps & {
|
|
5
|
+
readonly variant?: ProductsVariant;
|
|
6
|
+
}): ReactElement;
|
|
7
|
+
//# sourceMappingURL=shop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shop.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/shop.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAqB,KAAK,aAAa,EAAE,KAAK,eAAe,EAAgB,MAAM,qBAAqB,CAAC;AAGhH,yGAAyG;AACzG,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAA;CAAE,GAAG,YAAY,CAEpH"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PRODUCTS_VARIANTS, productsView } from "./products-views.js";
|
|
2
|
+
import { variantOf } from "./variant.js";
|
|
3
|
+
/** What a small shop sells: a grid of products, or the page of one product with a button to the shop. */
|
|
4
|
+
export function Products({ variant, ...props }) {
|
|
5
|
+
return productsView(variantOf("Products", variant, PRODUCTS_VARIANTS), props);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=shop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shop.js","sourceRoot":"","sources":["../../../src/website/blocks/shop.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAA4C,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,yGAAyG;AACzG,MAAM,UAAU,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAA0D;IACrG,OAAO,YAAY,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,EAAE,iBAAiB,CAAC,EAAE,KAAK,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A list of short lines, each after a tick: what an app does, what a plan includes. One part for
|
|
3
|
+
* every such list, so they look the same on every block.
|
|
4
|
+
*/
|
|
5
|
+
import type { ReactElement } from "react";
|
|
6
|
+
export declare function Ticks({ items, className, }: {
|
|
7
|
+
readonly items?: readonly string[];
|
|
8
|
+
readonly className?: string;
|
|
9
|
+
}): ReactElement | null;
|
|
10
|
+
//# sourceMappingURL=ticks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticks.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/ticks.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,wBAAgB,KAAK,CAAC,EACrB,KAAK,EACL,SAAS,GACT,EAAE;IACF,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC5B,GAAG,YAAY,GAAG,IAAI,CAYtB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BlockIcon } from "./icons.js";
|
|
3
|
+
import { keyed } from "./list.js";
|
|
4
|
+
export function Ticks({ items, className, }) {
|
|
5
|
+
if (!items || items.length === 0)
|
|
6
|
+
return null;
|
|
7
|
+
return (_jsx("ul", { className: className ? `site-ticks ${className}` : "site-ticks", children: keyed(items).map(({ key, item }) => (_jsxs("li", { className: "site-tick", children: [_jsx(BlockIcon, { name: "check-circle", className: "site-tick-icon" }), _jsx("span", { children: item })] }, key))) }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=ticks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticks.js","sourceRoot":"","sources":["../../../src/website/blocks/ticks.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,MAAM,UAAU,KAAK,CAAC,EACrB,KAAK,EACL,SAAS,GAIT;IACA,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9C,OAAO,CACN,aAAI,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,cAAc,SAAS,EAAE,CAAC,CAAC,CAAC,YAAY,YACjE,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CACpC,cAAc,SAAS,EAAC,WAAW,aAClC,KAAC,SAAS,IAAC,IAAI,EAAC,cAAc,EAAC,SAAS,EAAC,gBAAgB,GAAG,EAC5D,yBAAO,IAAI,GAAQ,KAFX,GAAG,CAGP,CACL,CAAC,GACE,CACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitor-date.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/visitor-date.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY,CAAC,GAAG,GAAE,IAAiB,GAAG,MAAM,CAE3D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The visitor's own date as "YYYY-MM-DD", in the browser's time zone. A static page is built
|
|
3
|
+
* once, so only the browser knows the day it is read on; client parts call this after mount,
|
|
4
|
+
* never during a render the server also runs. The clock is a parameter so a test can pin it.
|
|
5
|
+
*/
|
|
6
|
+
const pad = (value) => String(value).padStart(2, "0");
|
|
7
|
+
export function visitorToday(now = new Date()) {
|
|
8
|
+
return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=visitor-date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitor-date.js","sourceRoot":"","sources":["../../../src/website/blocks/visitor-date.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,GAAG,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAEtE,MAAM,UAAU,YAAY,CAAC,MAAY,IAAI,IAAI,EAAE;IAClD,OAAO,GAAG,GAAG,CAAC,WAAW,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;AAChF,CAAC"}
|
package/package.json
CHANGED