@lets-ship/site 1.0.0 → 2.0.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/dist/blog/article-view.d.ts.map +1 -1
- package/dist/blog/article-view.js +2 -1
- package/dist/blog/article-view.js.map +1 -1
- package/dist/blog/batches.d.ts +13 -0
- package/dist/blog/batches.d.ts.map +1 -0
- package/dist/blog/batches.js +17 -0
- package/dist/blog/batches.js.map +1 -0
- package/dist/blog/index-view.d.ts +5 -0
- package/dist/blog/index-view.d.ts.map +1 -1
- package/dist/blog/index-view.js +25 -8
- package/dist/blog/index-view.js.map +1 -1
- package/dist/blog/more-posts.d.ts +17 -0
- package/dist/blog/more-posts.d.ts.map +1 -0
- package/dist/blog/more-posts.js +65 -0
- package/dist/blog/more-posts.js.map +1 -0
- package/dist/config/site-config.d.ts +49 -2
- package/dist/config/site-config.d.ts.map +1 -1
- package/dist/config/site-config.js +46 -1
- package/dist/config/site-config.js.map +1 -1
- package/dist/i18n/tables/de.d.ts.map +1 -1
- package/dist/i18n/tables/de.js +17 -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 +17 -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 +17 -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 +17 -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 +17 -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 +17 -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 +17 -0
- package/dist/i18n/tables/tr.js.map +1 -1
- package/dist/i18n/types.d.ts +27 -0
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/layout/footer.d.ts +9 -5
- package/dist/layout/footer.d.ts.map +1 -1
- package/dist/layout/footer.js +71 -8
- package/dist/layout/footer.js.map +1 -1
- package/dist/layout/frame.d.ts +14 -0
- package/dist/layout/frame.d.ts.map +1 -0
- package/dist/layout/frame.js +15 -0
- package/dist/layout/frame.js.map +1 -0
- package/dist/layout/header-menu.d.ts +27 -0
- package/dist/layout/header-menu.d.ts.map +1 -0
- package/dist/layout/header-menu.js +89 -0
- package/dist/layout/header-menu.js.map +1 -0
- package/dist/layout/header.d.ts +12 -0
- package/dist/layout/header.d.ts.map +1 -0
- package/dist/layout/header.js +101 -0
- package/dist/layout/header.js.map +1 -0
- package/dist/layout/nav-width.d.ts +29 -0
- package/dist/layout/nav-width.d.ts.map +1 -0
- package/dist/layout/nav-width.js +32 -0
- package/dist/layout/nav-width.js.map +1 -0
- package/dist/layout/nav.d.ts +13 -0
- package/dist/layout/nav.d.ts.map +1 -0
- package/dist/layout/nav.js +5 -0
- package/dist/layout/nav.js.map +1 -0
- package/dist/layout/root.d.ts.map +1 -1
- package/dist/layout/root.js +8 -1
- package/dist/layout/root.js.map +1 -1
- package/dist/mdx/allow-list.d.ts +2 -2
- package/dist/mdx/allow-list.d.ts.map +1 -1
- package/dist/mdx/allow-list.js +6 -0
- package/dist/mdx/allow-list.js.map +1 -1
- package/dist/mdx/components.d.ts +4 -1
- package/dist/mdx/components.d.ts.map +1 -1
- package/dist/mdx/components.js +14 -4
- package/dist/mdx/components.js.map +1 -1
- package/dist/node/errors.js +1 -1
- package/dist/node/errors.js.map +1 -1
- package/dist/site/app.d.ts.map +1 -1
- package/dist/site/app.js +3 -2
- package/dist/site/app.js.map +1 -1
- package/dist/site/site-page.d.ts.map +1 -1
- package/dist/site/site-page.js +4 -4
- package/dist/site/site-page.js.map +1 -1
- package/dist/website/blocks/announcement-dismiss.d.ts +13 -0
- package/dist/website/blocks/announcement-dismiss.d.ts.map +1 -0
- package/dist/website/blocks/announcement-dismiss.js +49 -0
- package/dist/website/blocks/announcement-dismiss.js.map +1 -0
- package/dist/website/blocks/announcement-views.d.ts +24 -0
- package/dist/website/blocks/announcement-views.d.ts.map +1 -0
- package/dist/website/blocks/announcement-views.js +31 -0
- package/dist/website/blocks/announcement-views.js.map +1 -0
- package/dist/website/blocks/button.d.ts +21 -0
- package/dist/website/blocks/button.d.ts.map +1 -0
- package/dist/website/blocks/button.js +32 -0
- package/dist/website/blocks/button.js.map +1 -0
- package/dist/website/blocks/call-to-action-views.d.ts +15 -0
- package/dist/website/blocks/call-to-action-views.d.ts.map +1 -0
- package/dist/website/blocks/call-to-action-views.js +36 -0
- package/dist/website/blocks/call-to-action-views.js.map +1 -0
- package/dist/website/blocks/card-grid-views.d.ts +41 -0
- package/dist/website/blocks/card-grid-views.d.ts.map +1 -0
- package/dist/website/blocks/card-grid-views.js +94 -0
- package/dist/website/blocks/card-grid-views.js.map +1 -0
- package/dist/website/blocks/carousel-controls.d.ts +13 -0
- package/dist/website/blocks/carousel-controls.d.ts.map +1 -0
- package/dist/website/blocks/carousel-controls.js +48 -0
- package/dist/website/blocks/carousel-controls.js.map +1 -0
- package/dist/website/blocks/carousel.d.ts +16 -0
- package/dist/website/blocks/carousel.d.ts.map +1 -0
- package/dist/website/blocks/carousel.js +12 -0
- package/dist/website/blocks/carousel.js.map +1 -0
- package/dist/website/blocks/catalog.d.ts +35 -0
- package/dist/website/blocks/catalog.d.ts.map +1 -0
- package/dist/website/blocks/catalog.js +26 -0
- package/dist/website/blocks/catalog.js.map +1 -0
- package/dist/website/blocks/commerce.d.ts +9 -16
- package/dist/website/blocks/commerce.d.ts.map +1 -1
- package/dist/website/blocks/commerce.js +12 -13
- package/dist/website/blocks/commerce.js.map +1 -1
- package/dist/website/blocks/contact-views.d.ts +28 -0
- package/dist/website/blocks/contact-views.d.ts.map +1 -0
- package/dist/website/blocks/contact-views.js +55 -0
- package/dist/website/blocks/contact-views.js.map +1 -0
- package/dist/website/blocks/content.d.ts +12 -20
- package/dist/website/blocks/content.d.ts.map +1 -1
- package/dist/website/blocks/content.js +18 -9
- package/dist/website/blocks/content.js.map +1 -1
- package/dist/website/blocks/empty-state-views.d.ts +32 -0
- package/dist/website/blocks/empty-state-views.d.ts.map +1 -0
- package/dist/website/blocks/empty-state-views.js +39 -0
- package/dist/website/blocks/empty-state-views.js.map +1 -0
- package/dist/website/blocks/faq-views.d.ts +20 -0
- package/dist/website/blocks/faq-views.d.ts.map +1 -0
- package/dist/website/blocks/faq-views.js +38 -0
- package/dist/website/blocks/faq-views.js.map +1 -0
- package/dist/website/blocks/feature-views.d.ts +17 -0
- package/dist/website/blocks/feature-views.d.ts.map +1 -0
- package/dist/website/blocks/feature-views.js +40 -0
- package/dist/website/blocks/feature-views.js.map +1 -0
- package/dist/website/blocks/hero-views.d.ts +15 -0
- package/dist/website/blocks/hero-views.d.ts.map +1 -0
- package/dist/website/blocks/hero-views.js +27 -0
- package/dist/website/blocks/hero-views.js.map +1 -0
- package/dist/website/blocks/icons.d.ts +63 -0
- package/dist/website/blocks/icons.d.ts.map +1 -0
- package/dist/website/blocks/icons.js +63 -0
- package/dist/website/blocks/icons.js.map +1 -0
- package/dist/website/blocks/list.d.ts +20 -0
- package/dist/website/blocks/list.d.ts.map +1 -0
- package/dist/website/blocks/list.js +29 -0
- package/dist/website/blocks/list.js.map +1 -0
- package/dist/website/blocks/logo-stats-views.d.ts +29 -0
- package/dist/website/blocks/logo-stats-views.d.ts.map +1 -0
- package/dist/website/blocks/logo-stats-views.js +51 -0
- package/dist/website/blocks/logo-stats-views.js.map +1 -0
- package/dist/website/blocks/marketing.d.ts +11 -22
- package/dist/website/blocks/marketing.d.ts.map +1 -1
- package/dist/website/blocks/marketing.js +12 -14
- package/dist/website/blocks/marketing.js.map +1 -1
- package/dist/website/blocks/media-views.d.ts +17 -0
- package/dist/website/blocks/media-views.d.ts.map +1 -0
- package/dist/website/blocks/media-views.js +24 -0
- package/dist/website/blocks/media-views.js.map +1 -0
- package/dist/website/blocks/newsletter-views.d.ts +26 -0
- package/dist/website/blocks/newsletter-views.d.ts.map +1 -0
- package/dist/website/blocks/newsletter-views.js +43 -0
- package/dist/website/blocks/newsletter-views.js.map +1 -0
- package/dist/website/blocks/parts.d.ts +19 -1
- package/dist/website/blocks/parts.d.ts.map +1 -1
- package/dist/website/blocks/parts.js +15 -2
- package/dist/website/blocks/parts.js.map +1 -1
- package/dist/website/blocks/sections.d.ts +27 -0
- package/dist/website/blocks/sections.d.ts.map +1 -0
- package/dist/website/blocks/sections.js +27 -0
- package/dist/website/blocks/sections.js.map +1 -0
- package/dist/website/blocks/team-views.d.ts +24 -0
- package/dist/website/blocks/team-views.d.ts.map +1 -0
- package/dist/website/blocks/team-views.js +45 -0
- package/dist/website/blocks/team-views.js.map +1 -0
- package/dist/website/blocks/testimonial-views.d.ts +24 -0
- package/dist/website/blocks/testimonial-views.d.ts.map +1 -0
- package/dist/website/blocks/testimonial-views.js +68 -0
- package/dist/website/blocks/testimonial-views.js.map +1 -0
- package/dist/website/blocks/variant.d.ts +28 -0
- package/dist/website/blocks/variant.d.ts.map +1 -0
- package/dist/website/blocks/variant.js +58 -0
- package/dist/website/blocks/variant.js.map +1 -0
- package/package.json +3 -2
- package/styles.css +840 -6
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* The one part of an announcement that runs in the browser: the button that closes it. The
|
|
5
|
+
* choice stays in the visitor's browser under the announcement's own id, so a new announcement
|
|
6
|
+
* (a new id) shows again. The rest of the block renders on the server; the button hides the
|
|
7
|
+
* block it sits in.
|
|
8
|
+
*/
|
|
9
|
+
import { useEffect, useRef } from "react";
|
|
10
|
+
import { BlockIcon } from "./icons.js";
|
|
11
|
+
const storageKey = (id) => `site-announcement:${id}`;
|
|
12
|
+
function wasDismissed(id) {
|
|
13
|
+
try {
|
|
14
|
+
return window.localStorage.getItem(storageKey(id)) === "dismissed";
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
// Storage can be off (a private window, blocked site data); the announcement then shows.
|
|
18
|
+
console.error("announcement: could not read the dismissal", error);
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function remember(id) {
|
|
23
|
+
try {
|
|
24
|
+
window.localStorage.setItem(storageKey(id), "dismissed");
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
// Without storage the announcement still closes for this page view.
|
|
28
|
+
console.error("announcement: could not keep the dismissal", error);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const hideBlock = (button) => {
|
|
32
|
+
const block = button?.closest('[data-block="Announcement"]');
|
|
33
|
+
if (block)
|
|
34
|
+
block.hidden = true;
|
|
35
|
+
};
|
|
36
|
+
/** The close button of an announcement, which hides the announcement it sits in. */
|
|
37
|
+
export function DismissButton({ id, label }) {
|
|
38
|
+
const ref = useRef(null);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (wasDismissed(id))
|
|
41
|
+
hideBlock(ref.current);
|
|
42
|
+
}, [id]);
|
|
43
|
+
const close = () => {
|
|
44
|
+
remember(id);
|
|
45
|
+
hideBlock(ref.current);
|
|
46
|
+
};
|
|
47
|
+
return (_jsxs("button", { ref: ref, type: "button", className: "site-announcement-close", onClick: close, children: [_jsx("span", { className: "sr-only", children: label }), _jsx(BlockIcon, { name: "close", className: "size-4" })] }));
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=announcement-dismiss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement-dismiss.js","sourceRoot":"","sources":["../../../src/website/blocks/announcement-dismiss.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;GAKG;AACH,OAAO,EAAqB,SAAS,EAAE,MAAM,EAAE,M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AC;IACT,MAAM,KAAK,GAAG,GAAS,EAAE;QACxB,QAAQ,CAAC,EAAE,CAAC,CAAC;QACb,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC,CAAC;IACF,OAAO,CACN,kBAAQ,GAAG,EAAE,GAAG,EAAE,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,yBAAyB,EAAC,OAAO,EAAE,KAAK,aACjF,eAAM,SAAS,EAAC,SAAS,YAAE,KAAK,GAAQ,EACxC,KAAC,SAAS,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,QAAQ,GAAG,IACrC,CACT,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { SiteStrings } from "../../i18n/strings.js";
|
|
3
|
+
import type { Action } from "./parts.js";
|
|
4
|
+
export declare const ANNOUNCEMENT_VARIANTS: readonly ["bar", "floating"];
|
|
5
|
+
export type AnnouncementVariant = (typeof ANNOUNCEMENT_VARIANTS)[number];
|
|
6
|
+
export type AnnouncementProps = {
|
|
7
|
+
readonly text: string;
|
|
8
|
+
/** A link after the text, such as "Read the news". */
|
|
9
|
+
readonly link?: Action;
|
|
10
|
+
/** Adds a close button. The visitor's choice is kept under `id`, so it needs one. */
|
|
11
|
+
readonly dismissible?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* A name for this announcement, such as "spring-sale": the anchor of the block, as on every
|
|
14
|
+
* block, and the key of a visitor's close. A new id shows to everyone again.
|
|
15
|
+
*/
|
|
16
|
+
readonly id?: string;
|
|
17
|
+
readonly strings: SiteStrings;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A short notice: a bar across the page where the content puts it (bar), or a box that floats at
|
|
21
|
+
* the foot of the window (floating). Either can have a close button.
|
|
22
|
+
*/
|
|
23
|
+
export declare function announcementView(variant: AnnouncementVariant, props: AnnouncementProps): ReactElement;
|
|
24
|
+
//# sourceMappingURL=announcement-views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement-views.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/announcement-views.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGzC,eAAO,MAAM,qBAAqB,8BAA8B,CAAC;AACjE,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,MAAM,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;CAC9B,CAAC;AA6BF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAyBrG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Announcement layouts, adapted from HyperUI's announcements
|
|
4
|
+
* (https://github.com/markmead/hyperui, MIT, Copyright (c) Mark Mead): colours, type and radii
|
|
5
|
+
* come from the brand instead of fixed Tailwind colours.
|
|
6
|
+
*/
|
|
7
|
+
import Link from "next/link";
|
|
8
|
+
import { DismissButton } from "./announcement-dismiss.js";
|
|
9
|
+
import { BLOCK_VARIANTS } from "./catalog.js";
|
|
10
|
+
import { anchorOf, required } from "./variant.js";
|
|
11
|
+
export const ANNOUNCEMENT_VARIANTS = BLOCK_VARIANTS.Announcement;
|
|
12
|
+
function Message({ props }) {
|
|
13
|
+
return (_jsxs("p", { className: "flex-1 text-center font-medium", children: [props.text, " ", props.link ? (_jsx(Link, { href: props.link.href, className: "site-announcement-link inline-block", children: props.link.label })) : null] }));
|
|
14
|
+
}
|
|
15
|
+
/** The words, and the close button when the announcement has one. */
|
|
16
|
+
function Row({ props, variant }) {
|
|
17
|
+
if (!props.dismissible)
|
|
18
|
+
return _jsx(Message, { props: props });
|
|
19
|
+
const id = required("Announcement", variant, "id", props.id, 'add id="<a name for this announcement>"');
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "size-8 flex-none", "aria-hidden": "true" }), _jsx(Message, { props: props }), _jsx(DismissButton, { id: id, label: props.strings.dismiss })] }));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A short notice: a bar across the page where the content puts it (bar), or a box that floats at
|
|
24
|
+
* the foot of the window (floating). Either can have a close button.
|
|
25
|
+
*/
|
|
26
|
+
export function announcementView(variant, props) {
|
|
27
|
+
if (variant === "bar")
|
|
28
|
+
return (_jsx("div", { id: anchorOf("Announcement", props.id), className: "site-announcement site-announcement-bar", "data-block": "Announcement", children: _jsx("div", { className: "site-container flex items-center justify-between gap-3 py-2", children: _jsx(Row, { props: props, variant: variant }) }) }));
|
|
29
|
+
return (_jsx("div", { id: anchorOf("Announcement", props.id), className: "site-announcement site-announcement-floating", "data-block": "Announcement", "data-variant": variant, children: _jsx("div", { className: "site-announcement-box mx-auto flex max-w-3xl items-center justify-between gap-3 px-4 py-2", children: _jsx(Row, { props: props, variant: variant }) }) }));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=announcement-views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement-views.js","sourceRoot":"","sources":["../../../src/website/blocks/announcement-views.tsx"],"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AAwB;IACtF,IAAI,OAAO,KAAK,KAAK;QACpB,OAAO,CACN,cACC,EAAE,EAAE,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,EACtC,SAAS,EAAC,yCAAyC,gBACxC,cAAc,YAEzB,cAAK,SAAS,EAAC,6DAA6D,YAC3E,KAAC,GAAG,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAI,GAClC,GACD,CACN,CAAC;IACH,OAAO,CACN,cACC,EAAE,EAAE,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,EACtC,SAAS,EAAC,8CAA8C,gBAC7C,cAAc,kBACX,OAAO,YAErB,cAAK,SAAS,EAAC,2FAA2F,YACzG,KAAC,GAAG,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAI,GAClC,GACD,CACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
export declare const BUTTON_VARIANTS: readonly ["primary", "secondary", "ghost", "icon"];
|
|
3
|
+
export type ButtonVariant = (typeof BUTTON_VARIANTS)[number];
|
|
4
|
+
export type ButtonProps = {
|
|
5
|
+
readonly href: string;
|
|
6
|
+
readonly variant?: ButtonVariant;
|
|
7
|
+
/** The words on the button. The icon layout shows none, so it takes `label` instead. */
|
|
8
|
+
readonly children?: ReactNode;
|
|
9
|
+
/** A name from the block icon set, before the words, or alone in the icon layout. */
|
|
10
|
+
readonly icon?: string;
|
|
11
|
+
/** What an icon-only button does, for readers that cannot see the icon. */
|
|
12
|
+
readonly label?: string;
|
|
13
|
+
/** An arrow after the words, for a link that leads on to the next step. */
|
|
14
|
+
readonly arrow?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A link that looks like a button, for a call to action inside text. `not-prose` keeps the
|
|
18
|
+
* article styles of a link off it.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Button(props: ButtonProps): ReactElement;
|
|
21
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/button.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKrD,eAAO,MAAM,eAAe,oDAAyB,CAAC;AACtD,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,MAAM,WAAW,GAAG;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IACjC,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,qFAAqF;IACrF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AASF;;;GAGG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAoBvD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* A link drawn as a button, adapted from HyperUI's buttons
|
|
4
|
+
* (https://github.com/markmead/hyperui, MIT, Copyright (c) Mark Mead): colours, type and radii
|
|
5
|
+
* come from the brand instead of fixed Tailwind colours.
|
|
6
|
+
*/
|
|
7
|
+
import Link from "next/link";
|
|
8
|
+
import { INLINE_VARIANTS } from "./catalog.js";
|
|
9
|
+
import { BlockIcon } from "./icons.js";
|
|
10
|
+
import { required, variantOf } from "./variant.js";
|
|
11
|
+
export const BUTTON_VARIANTS = INLINE_VARIANTS.Button;
|
|
12
|
+
const CLASS = {
|
|
13
|
+
primary: "site-button",
|
|
14
|
+
secondary: "site-button site-button-secondary",
|
|
15
|
+
ghost: "site-button site-button-ghost",
|
|
16
|
+
icon: "site-button site-button-icon",
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A link that looks like a button, for a call to action inside text. `not-prose` keeps the
|
|
20
|
+
* article styles of a link off it.
|
|
21
|
+
*/
|
|
22
|
+
export function Button(props) {
|
|
23
|
+
const variant = variantOf("Button", props.variant, BUTTON_VARIANTS);
|
|
24
|
+
const className = `${CLASS[variant]} not-prose gap-2`;
|
|
25
|
+
if (variant === "icon") {
|
|
26
|
+
const icon = required("Button", variant, "icon", props.icon, 'add icon="<a name from the icon set>"');
|
|
27
|
+
const label = required("Button", variant, "label", props.label, 'add label="<what the button does>"');
|
|
28
|
+
return (_jsxs(Link, { href: props.href, className: className, "data-variant": variant, children: [_jsx("span", { className: "sr-only", children: label }), _jsx(BlockIcon, { name: icon, className: "size-5" })] }));
|
|
29
|
+
}
|
|
30
|
+
return (_jsxs(Link, { href: props.href, className: className, "data-variant": variant === "primary" ? undefined : variant, children: [props.icon ? _jsx(BlockIcon, { name: props.icon, className: "size-4" }) : null, _jsx("span", { children: props.children }), props.arrow ? _jsx(BlockIcon, { name: "arrow-right", className: "size-4 rtl:rotate-180" }) : null] }));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/website/blocks/button.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,C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,CAAC,IAAI,EACvE,yBAAO,KAAK,CAAC,QAAQ,GAAQ,EAC5B,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAC,SAAS,IAAC,IAAI,EAAC,aAAa,EAAC,SAAS,EAAC,uBAAuB,GAAG,CAAC,CAAC,CAAC,IAAI,IAClF,CACP,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import { type Action, type Anchor, type BlockImage } from "./parts.js";
|
|
3
|
+
export declare const CALL_TO_ACTION_VARIANTS: readonly ["card", "split", "inset", "gallery"];
|
|
4
|
+
export type CallToActionVariant = (typeof CALL_TO_ACTION_VARIANTS)[number];
|
|
5
|
+
export type CallToActionProps = Anchor & {
|
|
6
|
+
readonly title: string;
|
|
7
|
+
readonly text?: string;
|
|
8
|
+
readonly action: Action;
|
|
9
|
+
/** The picture beside the text: needed by the split and inset layouts. */
|
|
10
|
+
readonly image?: BlockImage;
|
|
11
|
+
/** Two pictures: needed by the gallery layout. */
|
|
12
|
+
readonly images?: readonly BlockImage[];
|
|
13
|
+
};
|
|
14
|
+
export declare function callToActionView(variant: CallToActionVariant, props: CallToActionProps): ReactElement;
|
|
15
|
+
//# sourceMappingURL=call-to-action-views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-to-action-views.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/call-to-action-views.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,KAAK,MAAM,EAAc,KAAK,MAAM,EAAE,KAAK,UAAU,EAAqB,MAAM,YAAY,CAAC;AAGtG,eAAO,MAAM,uBAAuB,gDAA8B,CAAC;AACnE,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,kDAAkD;IAClD,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;CACxC,CAAC;AA0EF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAIrG"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BLOCK_VARIANTS } from "./catalog.js";
|
|
3
|
+
import { keyed } from "./list.js";
|
|
4
|
+
import { ActionLink, BlockImg, Section } from "./parts.js";
|
|
5
|
+
import { BlockPropError, required } from "./variant.js";
|
|
6
|
+
export const CALL_TO_ACTION_VARIANTS = BLOCK_VARIANTS.CallToAction;
|
|
7
|
+
function Words({ props, center }) {
|
|
8
|
+
return (_jsxs("div", { className: center ? "mx-auto max-w-xl text-center" : "max-w-xl", children: [_jsx("h2", { className: "site-block-title", children: props.title }), props.text ? _jsx("p", { className: "site-block-intro", children: props.text }) : null, _jsx(ActionLink, { action: props.action })] }));
|
|
9
|
+
}
|
|
10
|
+
/** The block's own look: one card with the words and the button side by side. */
|
|
11
|
+
function CardCta(props) {
|
|
12
|
+
return (_jsx(Section, { name: "CallToAction", id: props.id, children: _jsxs("div", { className: "site-card site-cta flex flex-col items-start gap-4 md:flex-row md:items-center md:justify-between", children: [_jsxs("div", { children: [_jsx("h2", { className: "site-block-title", children: props.title }), props.text ? _jsx("p", { className: "site-block-intro", children: props.text }) : null] }), _jsx(ActionLink, { action: props.action })] }) }));
|
|
13
|
+
}
|
|
14
|
+
/** A panel in two halves: the words, and a picture that fills its half (split) or sits in a corner (inset). */
|
|
15
|
+
function ImageCta({ props, variant }) {
|
|
16
|
+
const image = required("CallToAction", variant, "image", props.image, "add image={{ src, alt }}");
|
|
17
|
+
const inset = variant === "inset";
|
|
18
|
+
return (_jsx(Section, { name: "CallToAction", id: props.id, children: _jsxs("div", { className: `site-cta-panel grid overflow-hidden md:grid-cols-2 ${inset ? "md:items-end" : "md:items-stretch"}`, "data-variant": variant, children: [_jsx("div", { className: "p-8 md:p-12 lg:p-16", children: _jsx(Words, { props: props, center: false }) }), _jsx(BlockImg, { image: image, className: inset
|
|
19
|
+
? "site-cta-inset h-56 w-full object-cover md:h-[calc(100%-3rem)] md:self-end"
|
|
20
|
+
: "h-56 w-full object-cover md:h-full" })] }) }));
|
|
21
|
+
}
|
|
22
|
+
/** The words in a panel beside two pictures. */
|
|
23
|
+
function GalleryCta(props) {
|
|
24
|
+
const images = props.images ?? [];
|
|
25
|
+
if (images.length !== 2)
|
|
26
|
+
throw new BlockPropError("CallToAction", "gallery", "images", `give exactly two images, not ${images.length}`);
|
|
27
|
+
return (_jsx(Section, { name: "CallToAction", id: props.id, children: _jsxs("div", { className: "grid gap-4 md:grid-cols-2", "data-variant": "gallery", children: [_jsx("div", { className: "site-cta-panel p-8 md:p-12 lg:p-16", children: _jsx(Words, { props: props, center: true }) }), _jsx("div", { className: "grid grid-cols-2 gap-4", children: keyed(images).map(({ key, item: image }) => (_jsx(BlockImg, { image: image, className: "site-cta-photo h-40 w-full object-cover sm:h-56 md:h-full" }, key))) })] }) }));
|
|
28
|
+
}
|
|
29
|
+
export function callToActionView(variant, props) {
|
|
30
|
+
if (variant === "card")
|
|
31
|
+
return _jsx(CardCta, { ...props });
|
|
32
|
+
if (variant === "gallery")
|
|
33
|
+
return _jsx(GalleryCta, { ...props });
|
|
34
|
+
return _jsx(ImageCta, { props: props, variant: variant });
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=call-to-action-views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-to-action-views.js","sourceRoot":"","sources":["../../../src/website/blocks/call-to-action-views.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAe,UAAU,EAAgC,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACtG,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,cAAc,CAAC,YAAY,CAAC;AAanE,SAAS,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAmE;IAChG,OAAO,CACN,eAAK,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,UAAU,aACnE,aAAI,SAAS,EAAC,kBAAkB,YAAE,KAAK,CAAC,KAAK,GAAM,EAClD,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,kBAAkB,YAAE,KAAK,CAAC,IAAI,GAAK,CAAC,CAAC,CAAC,IAAI,EACrE,KAAC,UAAU,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAI,IAC/B,CACN,CAAC;AACH,CAAC;AAED,iFAAiF;AACjF,SAAS,OAAO,CAAC,KAAwB;IACxC,OAAO,CACN,KAAC,OAAO,IAAC,IAAI,EAAC,cAAc,EAAC,EAAE,EAAE,KAAK,CAAC,EAAE,YACxC,eAAK,SAAS,EAAC,mGAAmG,aACjH,0BACC,aAAI,SAAS,EAAC,kBAAkB,YAAE,KAAK,CAAC,KAAK,GAAM,EAClD,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,kBAAkB,YAAE,KAAK,CAAC,IAAI,GAAK,CAAC,CAAC,CAAC,IAAI,IAChE,EACN,KAAC,UAAU,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAI,IAC/B,GAC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SAAS,EAAC,wBAAwB,YACrC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC5C,KAAC,QAAQ,IAAW,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,2DAA2D,IAAxF,GAAG,CAAwF,CAC1G,CAAC,GACG,IACD,GACG,CACV,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAA4B,EAAE,KAAwB;IACtF,IAAI,OAAO,KAAK,MAAM;QAAE,OAAO,KAAC,OAAO,OAAK,KAAK,GAAI,CAAC;IACtD,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,KAAC,UAAU,OAAK,KAAK,GAAI,CAAC;IAC5D,OAAO,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { SiteStrings } from "../../i18n/strings.js";
|
|
3
|
+
import { type Action, type Anchor, type BlockImage } from "./parts.js";
|
|
4
|
+
export declare const CARD_GRID_VARIANTS: readonly ["image", "plain", "overlay", "icon", "tags", "list"];
|
|
5
|
+
export type CardGridVariant = (typeof CARD_GRID_VARIANTS)[number];
|
|
6
|
+
export type CardItem = {
|
|
7
|
+
readonly title: string;
|
|
8
|
+
/** Where the card leads. The whole card is the link, and its title is the link's name. */
|
|
9
|
+
readonly href?: string;
|
|
10
|
+
readonly text?: string;
|
|
11
|
+
/** Needed by the image, plain and overlay layouts. */
|
|
12
|
+
readonly image?: BlockImage;
|
|
13
|
+
/** A date as the content writes it, such as "10 Oct 2026". */
|
|
14
|
+
readonly date?: string;
|
|
15
|
+
/** A short label over the title, such as "Guide". */
|
|
16
|
+
readonly eyebrow?: string;
|
|
17
|
+
/** Needed by the tags layout. */
|
|
18
|
+
readonly tags?: readonly string[];
|
|
19
|
+
/** Needed by the icon layout: a name from the block icon set. */
|
|
20
|
+
readonly icon?: string;
|
|
21
|
+
};
|
|
22
|
+
export type CardGridProps = Anchor & {
|
|
23
|
+
readonly title?: string;
|
|
24
|
+
readonly intro?: string;
|
|
25
|
+
readonly items: readonly CardItem[];
|
|
26
|
+
readonly strings: SiteStrings;
|
|
27
|
+
/**
|
|
28
|
+
* Show the first `limit` cards only, for a long list on a page that is not its home, such as the
|
|
29
|
+
* latest three posts on a home page. It needs `more`, the link to the page with every card.
|
|
30
|
+
*/
|
|
31
|
+
readonly limit?: number;
|
|
32
|
+
/** A link under the cards to the page with all of them, such as "See all posts". */
|
|
33
|
+
readonly more?: Action;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* A grid of cards that each lead somewhere: posts, guides, case studies, products of a service.
|
|
37
|
+
* The layouts differ in what a card shows first: a picture, an icon, its tags, or a row. With
|
|
38
|
+
* `more`, a link under the cards leads to the page with all of them.
|
|
39
|
+
*/
|
|
40
|
+
export declare function cardGridView(variant: CardGridVariant, props: CardGridProps): ReactElement;
|
|
41
|
+
//# sourceMappingURL=card-grid-views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-grid-views.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/card-grid-views.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzD,OAAO,EAAE,KAAK,MAAM,EAAc,KAAK,MAAM,EAAE,KAAK,UAAU,EAAqB,MAAM,YAAY,CAAC;AAGtG,eAAO,MAAM,kBAAkB,gEAA0B,CAAC;AAC1D,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,MAAM,QAAQ,GAAG;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,0FAA0F;IAC1F,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,sDAAsD;IACtD,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,qDAAqD;IACrD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,iCAAiC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,iEAAiE;IACjE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAuKF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,GAAG,YAAY,CAqBzF"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Card layouts, adapted from HyperUI's cards and blog cards
|
|
4
|
+
* (https://github.com/markmead/hyperui, MIT, Copyright (c) Mark Mead): colours, type and radii
|
|
5
|
+
* come from the brand instead of fixed Tailwind colours.
|
|
6
|
+
*/
|
|
7
|
+
import Link from "next/link";
|
|
8
|
+
import { BLOCK_VARIANTS } from "./catalog.js";
|
|
9
|
+
import { BlockIcon } from "./icons.js";
|
|
10
|
+
import { gridColumns, keyed } from "./list.js";
|
|
11
|
+
import { ActionLink, BlockImg, Section } from "./parts.js";
|
|
12
|
+
import { BlockPropError, filled, required } from "./variant.js";
|
|
13
|
+
export const CARD_GRID_VARIANTS = BLOCK_VARIANTS.CardGrid;
|
|
14
|
+
const imageOf = (item, variant) => required("CardGrid", variant, "image", item.image, `add an image to "${item.title}"`);
|
|
15
|
+
/** The title, as the card's link when it has one: the link covers the whole card. */
|
|
16
|
+
function Title({ item, className }) {
|
|
17
|
+
return (_jsx("h3", { className: className, children: item.href ? (_jsx(Link, { href: item.href, className: "site-card-link", children: item.title })) : (item.title) }));
|
|
18
|
+
}
|
|
19
|
+
/** The eyebrow and the date over a title, when the card has them. */
|
|
20
|
+
function Meta({ item }) {
|
|
21
|
+
if (!item.eyebrow && !item.date)
|
|
22
|
+
return null;
|
|
23
|
+
return (_jsxs("p", { className: "site-card-meta mb-1 flex flex-wrap gap-x-3", children: [item.eyebrow ? _jsx("span", { className: "site-card-eyebrow", children: item.eyebrow }) : null, item.date ? _jsx("span", { children: item.date }) : null] }));
|
|
24
|
+
}
|
|
25
|
+
/** "Read more" under a linked card. The title is the link's name, so readers skip these words. */
|
|
26
|
+
function More({ item, strings }) {
|
|
27
|
+
if (!item.href)
|
|
28
|
+
return null;
|
|
29
|
+
return (_jsxs("span", { className: "site-card-more mt-4 inline-flex items-center gap-1", "aria-hidden": "true", children: [strings.readMore, _jsx(BlockIcon, { name: "arrow-right", className: "size-4 rtl:rotate-180" })] }));
|
|
30
|
+
}
|
|
31
|
+
/** The block's own look, and the icon and tags layouts: a framed card with the words in it. */
|
|
32
|
+
function FramedCard({ item, variant, strings }) {
|
|
33
|
+
const image = variant === "image" ? imageOf(item, variant) : undefined;
|
|
34
|
+
const tags = variant === "tags" ? tagsOf(item) : [];
|
|
35
|
+
const icon = variant === "icon" ? required("CardGrid", variant, "icon", item.icon, `add an icon to "${item.title}"`) : undefined;
|
|
36
|
+
const linked = item.href ? " site-card-linked" : "";
|
|
37
|
+
return (_jsxs("article", { className: `site-card-frame relative flex flex-col overflow-hidden${linked}`, children: [image ? _jsx(BlockImg, { image: image, className: "h-56 w-full object-cover" }) : null, _jsxs("div", { className: "flex flex-1 flex-col p-4 sm:p-6", children: [icon ? (_jsx("span", { className: "site-icon-box mb-4 self-start", children: _jsx(BlockIcon, { name: icon, className: "size-6" }) })) : null, _jsx(Meta, { item: item }), _jsx(Title, { item: item, className: "site-card-title" }), item.text ? _jsx("p", { className: "site-card-text line-clamp-3", children: item.text }) : null, tags.length > 0 ? _jsx(Tags, { tags: tags }) : null, _jsx(More, { item: item, strings: strings })] })] }));
|
|
38
|
+
}
|
|
39
|
+
function tagsOf(item) {
|
|
40
|
+
if (!item.tags || item.tags.length === 0)
|
|
41
|
+
throw new BlockPropError("CardGrid", "tags", "tags", `add tags={["..."]} to "${item.title}"`);
|
|
42
|
+
return item.tags;
|
|
43
|
+
}
|
|
44
|
+
function Tags({ tags }) {
|
|
45
|
+
return (_jsx("ul", { className: "mt-4 flex flex-wrap gap-1", children: keyed(tags).map(({ key, item: tag }) => (_jsx("li", { className: "site-tag", children: tag }, key))) }));
|
|
46
|
+
}
|
|
47
|
+
/** A rounded picture and the words under it, with no frame. */
|
|
48
|
+
function PlainCard({ item, strings }) {
|
|
49
|
+
return (_jsxs("article", { className: "relative flex flex-col", children: [_jsx(BlockImg, { image: imageOf(item, "plain"), className: "site-media-image h-56 w-full object-cover" }), _jsxs("div", { className: "pt-4", children: [_jsx(Meta, { item: item }), _jsx(Title, { item: item, className: "site-card-title" }), item.text ? _jsx("p", { className: "site-card-text line-clamp-3", children: item.text }) : null, _jsx(More, { item: item, strings: strings })] })] }));
|
|
50
|
+
}
|
|
51
|
+
/** The picture fills the card, and the words sit on a band of the brand colour at its foot. */
|
|
52
|
+
function OverlayCard({ item }) {
|
|
53
|
+
return (_jsxs("article", { className: "site-card-overlay relative isolate flex min-h-80 flex-col justify-end overflow-hidden", children: [_jsx(BlockImg, { image: imageOf(item, "overlay"), className: "absolute inset-0 -z-10 h-full w-full object-cover" }), _jsx("span", { className: "site-card-overlay-fade block h-12", "aria-hidden": "true" }), _jsxs("div", { className: "site-card-overlay-words p-4 pt-0 sm:p-6 sm:pt-0", children: [_jsx(Meta, { item: item }), _jsx(Title, { item: item, className: "site-card-title" }), item.text ? _jsx("p", { className: "line-clamp-2", children: item.text }) : null] })] }));
|
|
54
|
+
}
|
|
55
|
+
/** One row: a small picture when the item has one, and the words beside it. */
|
|
56
|
+
function ListCard({ item, strings }) {
|
|
57
|
+
const linked = item.href ? " site-card-linked" : "";
|
|
58
|
+
return (_jsxs("article", { className: `site-card-frame relative flex items-start gap-4 p-4 sm:p-6${linked}`, children: [item.image ? _jsx(BlockImg, { image: item.image, className: "site-thumb size-16 flex-none object-cover" }) : null, _jsxs("div", { className: "min-w-0", children: [_jsx(Meta, { item: item }), _jsx(Title, { item: item, className: "site-card-title" }), item.text ? _jsx("p", { className: "site-card-text line-clamp-2", children: item.text }) : null, _jsx(More, { item: item, strings: strings })] })] }));
|
|
59
|
+
}
|
|
60
|
+
function Card(props) {
|
|
61
|
+
if (props.variant === "plain")
|
|
62
|
+
return _jsx(PlainCard, { ...props });
|
|
63
|
+
if (props.variant === "overlay")
|
|
64
|
+
return _jsx(OverlayCard, { ...props });
|
|
65
|
+
if (props.variant === "list")
|
|
66
|
+
return _jsx(ListCard, { ...props });
|
|
67
|
+
return _jsx(FramedCard, { ...props });
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The cards the block shows: all of them, or the first `limit`. A static page holds every item it
|
|
71
|
+
* renders, so a long list is cut here and the rest live on the page `more` links to; a limit with
|
|
72
|
+
* no link would hide cards with no way to reach them.
|
|
73
|
+
*/
|
|
74
|
+
function shown(variant, props) {
|
|
75
|
+
const items = filled("CardGrid", variant, "items", props.items);
|
|
76
|
+
if (props.limit === undefined)
|
|
77
|
+
return items;
|
|
78
|
+
if (!Number.isInteger(props.limit) || props.limit < 1)
|
|
79
|
+
throw new BlockPropError("CardGrid", variant, "limit", `give a whole number of cards, 1 or more, not ${props.limit}`);
|
|
80
|
+
if (props.more === undefined)
|
|
81
|
+
throw new BlockPropError("CardGrid", variant, "more", 'add a link to the page with every card, such as more={{ label: "See all posts", href: "/blog/" }}, because limit hides the rest');
|
|
82
|
+
return items.slice(0, props.limit);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A grid of cards that each lead somewhere: posts, guides, case studies, products of a service.
|
|
86
|
+
* The layouts differ in what a card shows first: a picture, an icon, its tags, or a row. With
|
|
87
|
+
* `more`, a link under the cards leads to the page with all of them.
|
|
88
|
+
*/
|
|
89
|
+
export function cardGridView(variant, props) {
|
|
90
|
+
const items = shown(variant, props);
|
|
91
|
+
const list = variant === "list";
|
|
92
|
+
return (_jsxs(Section, { name: "CardGrid", id: props.id, title: props.title, intro: props.intro, children: [_jsx("div", { className: list ? "flex max-w-3xl flex-col gap-4" : "site-grid", "data-cols": list ? undefined : gridColumns(items.length, 3), "data-variant": variant === "image" ? undefined : variant, children: keyed(items).map(({ key, item }) => (_jsx(Card, { item: item, variant: variant, strings: props.strings }, key))) }), props.more ? (_jsx("div", { className: list ? "mt-8 flex" : "mt-10 flex justify-center", "data-more": "", children: _jsx(ActionLink, { action: props.more, secondary: true }) })) : null] }));
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=card-grid-views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-grid-views.js","sourceRoot":"","sources":["../../../src/website/blocks/card-grid-views.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE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L,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CACb,cAAK,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,2BAA2B,eAAY,EAAE,YAC7E,KAAC,UAAU,IAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,SAAG,GACvC,CACN,CAAC,CAAC,CAAC,IAAI,IACC,CACV,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one part of a carousel that runs in the browser: the buttons that move its row back and on
|
|
3
|
+
* by one view. The row itself is a list that scrolls with CSS scroll-snap, so it works by touch,
|
|
4
|
+
* trackpad and keyboard before this part loads. A button turns off at its end of the row, and the
|
|
5
|
+
* pair hides (keeping its space, so nothing moves) while the row fits with no scrolling.
|
|
6
|
+
*/
|
|
7
|
+
import { type ReactElement } from "react";
|
|
8
|
+
/** The previous and next buttons of a carousel, with the site's words for their hidden labels. */
|
|
9
|
+
export declare function CarouselControls({ previous, next, }: {
|
|
10
|
+
readonly previous: string;
|
|
11
|
+
readonly next: string;
|
|
12
|
+
}): ReactElement;
|
|
13
|
+
//# sourceMappingURL=carousel-controls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel-controls.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/carousel-controls.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,YAAY,EAA+C,MAAM,OAAO,CAAC;AAyCvF,kGAAkG;AAClG,wBAAgB,gBAAgB,CAAC,EAChC,QAAQ,EACR,IAAI,GACJ,EAAE;IACF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB,GAAG,YAAY,CAyBf"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* The one part of a carousel that runs in the browser: the buttons that move its row back and on
|
|
5
|
+
* by one view. The row itself is a list that scrolls with CSS scroll-snap, so it works by touch,
|
|
6
|
+
* trackpad and keyboard before this part loads. A button turns off at its end of the row, and the
|
|
7
|
+
* pair hides (keeping its space, so nothing moves) while the row fits with no scrolling.
|
|
8
|
+
*/
|
|
9
|
+
import { useEffect, useRef, useState } from "react";
|
|
10
|
+
import { BlockIcon } from "./icons.js";
|
|
11
|
+
// A row that scrolled to within a pixel of an end is at that end: scroll positions are fractional.
|
|
12
|
+
const SLACK = 1;
|
|
13
|
+
const trackOf = (controls) => controls?.closest("[data-carousel]")?.querySelector(".site-carousel-track") ?? null;
|
|
14
|
+
function edgesOf(track) {
|
|
15
|
+
const end = track.scrollWidth - track.clientWidth;
|
|
16
|
+
return { fits: end <= SLACK, atStart: track.scrollLeft <= SLACK, atEnd: track.scrollLeft >= end - SLACK };
|
|
17
|
+
}
|
|
18
|
+
/** Follows the row's scroll position and size, so the buttons know which ends they are at. */
|
|
19
|
+
function useEdges(ref) {
|
|
20
|
+
const [edges, setEdges] = useState({ fits: false, atStart: true, atEnd: false });
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const track = trackOf(ref.current);
|
|
23
|
+
if (!track)
|
|
24
|
+
return;
|
|
25
|
+
const update = () => setEdges(edgesOf(track));
|
|
26
|
+
update();
|
|
27
|
+
track.addEventListener("scroll", update, { passive: true });
|
|
28
|
+
const resize = new ResizeObserver(update);
|
|
29
|
+
resize.observe(track);
|
|
30
|
+
return () => {
|
|
31
|
+
track.removeEventListener("scroll", update);
|
|
32
|
+
resize.disconnect();
|
|
33
|
+
};
|
|
34
|
+
}, [ref]);
|
|
35
|
+
return edges;
|
|
36
|
+
}
|
|
37
|
+
/** Moves the row by the width it shows; the stylesheet's scroll-behavior decides whether it glides. */
|
|
38
|
+
function move(controls, direction) {
|
|
39
|
+
const track = trackOf(controls);
|
|
40
|
+
track?.scrollBy({ left: direction * track.clientWidth });
|
|
41
|
+
}
|
|
42
|
+
/** The previous and next buttons of a carousel, with the site's words for their hidden labels. */
|
|
43
|
+
export function CarouselControls({ previous, next, }) {
|
|
44
|
+
const ref = useRef(null);
|
|
45
|
+
const edges = useEdges(ref);
|
|
46
|
+
return (_jsxs("div", { ref: ref, className: "site-carousel-controls", "data-fits": edges.fits ? "" : undefined, children: [_jsxs("button", { type: "button", className: "site-carousel-button", disabled: edges.atStart, onClick: () => move(ref.current, -1), children: [_jsx("span", { className: "sr-only", children: previous }), _jsx(BlockIcon, { name: "arrow-left", className: "size-4" })] }), _jsxs("button", { type: "button", className: "site-carousel-button", disabled: edges.atEnd, onClick: () => move(ref.current, 1), children: [_jsx("span", { className: "sr-only", children: next }), _jsx(BlockIcon, { name: "arrow-right", className: "size-4" })] })] }));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=carousel-controls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel-controls.js","sourceRoot":"","sources":["../../../src/website/blocks/carousel-controls.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;GAKG;AACH,OAAO,EAAqC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC,mGAAmG;AACnG,MAAM,KAAK,GAAG,CAAC,CAAC;AAEhB,MAAM,OAAO,GAAG,CAAC,QAA4B,EAAsB,EAAE,CACpE,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,EAAE,aAAa,CAAc,sBAAsB,CAAC,IAAI,IAAI,CAAC;AAElG,SAAS,OAAO,CAAC,KAAkB;IAClC,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;IAClD,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,UAAU,I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gBAAgB,CAAC,EAChC,QAAQ,EACR,IAAI,GAIJ;IACA,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC5B,OAAO,CACN,eAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAC,wBAAwB,eAAY,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,aACvF,kBACC,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,sBAAsB,EAChC,QAAQ,EAAE,KAAK,CAAC,OAAO,EACvB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,aAEpC,eAAM,SAAS,EAAC,SAAS,YAAE,QAAQ,GAAQ,EAC3C,KAAC,SAAS,IAAC,IAAI,EAAC,YAAY,EAAC,SAAS,EAAC,QAAQ,GAAG,IAC1C,EACT,kBACC,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,sBAAsB,EAChC,QAAQ,EAAE,KAAK,CAAC,KAAK,EACrB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,aAEnC,eAAM,SAAS,EAAC,SAAS,YAAE,IAAI,GAAQ,EACvC,KAAC,SAAS,IAAC,IAAI,EAAC,aAAa,EAAC,SAAS,EAAC,QAAQ,GAAG,IAC3C,IACJ,CACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
import type { SiteStrings } from "../../i18n/strings.js";
|
|
3
|
+
/**
|
|
4
|
+
* A row of items that scrolls sideways, one snap point per item, with the buttons that move it by
|
|
5
|
+
* one view. `kind` sets the width of an item: a card shows about three at a time on a wide
|
|
6
|
+
* screen and one with the next peeking on a phone; a logo keeps its own width.
|
|
7
|
+
*/
|
|
8
|
+
export declare function CarouselRow<T>({ kind, label, items, strings, render, }: {
|
|
9
|
+
readonly kind: "cards" | "logos";
|
|
10
|
+
/** The name of the row for assistive technology, the block's title when it has one. */
|
|
11
|
+
readonly label?: string;
|
|
12
|
+
readonly items: readonly T[];
|
|
13
|
+
readonly strings: SiteStrings;
|
|
14
|
+
readonly render: (item: T) => ReactNode;
|
|
15
|
+
}): ReactElement;
|
|
16
|
+
//# sourceMappingURL=carousel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/carousel.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,EAC9B,IAAI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,EACP,MAAM,GACN,EAAE;IACF,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IACjC,uFAAuF;IACvF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,CAAC;CACxC,GAAG,YAAY,CAcf"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CarouselControls } from "./carousel-controls.js";
|
|
3
|
+
import { keyed } from "./list.js";
|
|
4
|
+
/**
|
|
5
|
+
* A row of items that scrolls sideways, one snap point per item, with the buttons that move it by
|
|
6
|
+
* one view. `kind` sets the width of an item: a card shows about three at a time on a wide
|
|
7
|
+
* screen and one with the next peeking on a phone; a logo keeps its own width.
|
|
8
|
+
*/
|
|
9
|
+
export function CarouselRow({ kind, label, items, strings, render, }) {
|
|
10
|
+
return (_jsxs("div", { className: "site-carousel", "data-carousel": "", "data-variant": "carousel", children: [_jsx("ul", { className: "site-carousel-track", "data-kind": kind, tabIndex: 0, "aria-label": label, children: keyed(items).map(({ key, item }) => (_jsx("li", { className: "site-carousel-item", children: render(item) }, key))) }), _jsx(CarouselControls, { previous: strings.previous, next: strings.next })] }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=carousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../../src/website/blocks/carousel.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAI,EAC9B,IAAI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,EACP,MAAM,GAQN;IACA,OAAO,CACN,eAAK,SAAS,EAAC,eAAe,mBAAe,EAAE,kBAAc,UAAU,aAEtE,aAAI,SAAS,EAAC,qBAAqB,eAAY,IAAI,EAAE,QAAQ,EAAE,CAAC,gBAAc,KAAK,YACjF,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CACpC,aAAc,SAAS,EAAC,oBAAoB,YAC1C,MAAM,CAAC,IAAI,CAAC,IADL,GAAG,CAEP,CACL,CAAC,GACE,EACL,KAAC,gBAAgB,IAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,GAAI,IAC/D,CACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every website block with its variants, the first being the block's own look. A block with no
|
|
3
|
+
* `variant` prop has an empty list. The views take their lists from here, and tools that show the
|
|
4
|
+
* blocks (a gallery, docs, the visual tests) read it too, so a new variant has one place to go.
|
|
5
|
+
* Pure data: it imports no view, so plain Node can read it.
|
|
6
|
+
*/
|
|
7
|
+
import type { WEBSITE_BLOCKS } from "../../mdx/allow-list.js";
|
|
8
|
+
export type WebsiteBlockName = (typeof WEBSITE_BLOCKS)[number];
|
|
9
|
+
export declare const BLOCK_VARIANTS: {
|
|
10
|
+
readonly Hero: readonly ["split", "centered", "left"];
|
|
11
|
+
readonly FeatureGrid: readonly ["cards", "split", "centered", "inline"];
|
|
12
|
+
readonly Steps: readonly [];
|
|
13
|
+
readonly Pricing: readonly [];
|
|
14
|
+
readonly Testimonials: readonly ["cards", "quote", "grid", "reviews", "carousel"];
|
|
15
|
+
readonly LogoCloud: readonly ["row", "grid", "tiles", "carousel"];
|
|
16
|
+
readonly Stats: readonly ["cards", "outlined", "divided", "tinted"];
|
|
17
|
+
readonly Faq: readonly ["cards", "boxed", "divided", "bar"];
|
|
18
|
+
readonly CallToAction: readonly ["card", "split", "inset", "gallery"];
|
|
19
|
+
readonly Team: readonly ["cards", "photos", "avatars"];
|
|
20
|
+
readonly Contact: readonly ["links", "form", "split"];
|
|
21
|
+
readonly Announcement: readonly ["bar", "floating"];
|
|
22
|
+
readonly Newsletter: readonly ["start", "centered", "panel"];
|
|
23
|
+
readonly MediaSection: readonly ["split", "wide", "wide-reversed", "stacked"];
|
|
24
|
+
readonly CardGrid: readonly ["image", "plain", "overlay", "icon", "tags", "list"];
|
|
25
|
+
readonly EmptyState: readonly ["actions", "links", "signup"];
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The common components that sit inside text rather than in a band of their own, with their
|
|
29
|
+
* variants. The first is the component's own look, as with a block.
|
|
30
|
+
*/
|
|
31
|
+
export declare const INLINE_VARIANTS: {
|
|
32
|
+
readonly Button: readonly ["primary", "secondary", "ghost", "icon"];
|
|
33
|
+
};
|
|
34
|
+
export type InlineComponentName = keyof typeof INLINE_VARIANTS;
|
|
35
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/catalog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;CAiB+C,CAAC;AAE3E;;;GAGG;AACH,eAAO,MAAM,eAAe;;CAElB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,eAAe,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const BLOCK_VARIANTS = {
|
|
2
|
+
Hero: ["split", "centered", "left"],
|
|
3
|
+
FeatureGrid: ["cards", "split", "centered", "inline"],
|
|
4
|
+
Steps: [],
|
|
5
|
+
Pricing: [],
|
|
6
|
+
Testimonials: ["cards", "quote", "grid", "reviews", "carousel"],
|
|
7
|
+
LogoCloud: ["row", "grid", "tiles", "carousel"],
|
|
8
|
+
Stats: ["cards", "outlined", "divided", "tinted"],
|
|
9
|
+
Faq: ["cards", "boxed", "divided", "bar"],
|
|
10
|
+
CallToAction: ["card", "split", "inset", "gallery"],
|
|
11
|
+
Team: ["cards", "photos", "avatars"],
|
|
12
|
+
Contact: ["links", "form", "split"],
|
|
13
|
+
Announcement: ["bar", "floating"],
|
|
14
|
+
Newsletter: ["start", "centered", "panel"],
|
|
15
|
+
MediaSection: ["split", "wide", "wide-reversed", "stacked"],
|
|
16
|
+
CardGrid: ["image", "plain", "overlay", "icon", "tags", "list"],
|
|
17
|
+
EmptyState: ["actions", "links", "signup"],
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The common components that sit inside text rather than in a band of their own, with their
|
|
21
|
+
* variants. The first is the component's own look, as with a block.
|
|
22
|
+
*/
|
|
23
|
+
export const INLINE_VARIANTS = {
|
|
24
|
+
Button: ["primary", "secondary", "ghost", "icon"],
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../src/website/blocks/catalog.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC;IACnC,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC;IACrD,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,EAAE;IACX,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC;IAC/D,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC;IAC/C,KAAK,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,CAAC;IACjD,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC;IACzC,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC;IACnD,IAAI,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC;IACpC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;IACnC,YAAY,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC;IACjC,UAAU,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC;IAC1C,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,CAAC;IAC3D,QAAQ,EAAE,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