@lets-ship/site 1.0.1 → 3.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.
Files changed (211) hide show
  1. package/dist/blog/article-view.d.ts.map +1 -1
  2. package/dist/blog/article-view.js +2 -1
  3. package/dist/blog/article-view.js.map +1 -1
  4. package/dist/blog/batches.d.ts +13 -0
  5. package/dist/blog/batches.d.ts.map +1 -0
  6. package/dist/blog/batches.js +17 -0
  7. package/dist/blog/batches.js.map +1 -0
  8. package/dist/blog/index-view.d.ts +5 -0
  9. package/dist/blog/index-view.d.ts.map +1 -1
  10. package/dist/blog/index-view.js +25 -8
  11. package/dist/blog/index-view.js.map +1 -1
  12. package/dist/blog/more-posts.d.ts +17 -0
  13. package/dist/blog/more-posts.d.ts.map +1 -0
  14. package/dist/blog/more-posts.js +65 -0
  15. package/dist/blog/more-posts.js.map +1 -0
  16. package/dist/config/site-config.d.ts +49 -2
  17. package/dist/config/site-config.d.ts.map +1 -1
  18. package/dist/config/site-config.js +46 -1
  19. package/dist/config/site-config.js.map +1 -1
  20. package/dist/i18n/tables/de.d.ts.map +1 -1
  21. package/dist/i18n/tables/de.js +17 -0
  22. package/dist/i18n/tables/de.js.map +1 -1
  23. package/dist/i18n/tables/en.d.ts.map +1 -1
  24. package/dist/i18n/tables/en.js +17 -0
  25. package/dist/i18n/tables/en.js.map +1 -1
  26. package/dist/i18n/tables/es.d.ts.map +1 -1
  27. package/dist/i18n/tables/es.js +17 -0
  28. package/dist/i18n/tables/es.js.map +1 -1
  29. package/dist/i18n/tables/fr.d.ts.map +1 -1
  30. package/dist/i18n/tables/fr.js +17 -0
  31. package/dist/i18n/tables/fr.js.map +1 -1
  32. package/dist/i18n/tables/nl.d.ts.map +1 -1
  33. package/dist/i18n/tables/nl.js +17 -0
  34. package/dist/i18n/tables/nl.js.map +1 -1
  35. package/dist/i18n/tables/pt.d.ts.map +1 -1
  36. package/dist/i18n/tables/pt.js +17 -0
  37. package/dist/i18n/tables/pt.js.map +1 -1
  38. package/dist/i18n/tables/tr.d.ts.map +1 -1
  39. package/dist/i18n/tables/tr.js +17 -0
  40. package/dist/i18n/tables/tr.js.map +1 -1
  41. package/dist/i18n/types.d.ts +27 -0
  42. package/dist/i18n/types.d.ts.map +1 -1
  43. package/dist/layout/footer.d.ts +9 -5
  44. package/dist/layout/footer.d.ts.map +1 -1
  45. package/dist/layout/footer.js +71 -8
  46. package/dist/layout/footer.js.map +1 -1
  47. package/dist/layout/frame.d.ts +14 -0
  48. package/dist/layout/frame.d.ts.map +1 -0
  49. package/dist/layout/frame.js +15 -0
  50. package/dist/layout/frame.js.map +1 -0
  51. package/dist/layout/header-menu.d.ts +27 -0
  52. package/dist/layout/header-menu.d.ts.map +1 -0
  53. package/dist/layout/header-menu.js +89 -0
  54. package/dist/layout/header-menu.js.map +1 -0
  55. package/dist/layout/header.d.ts +12 -0
  56. package/dist/layout/header.d.ts.map +1 -0
  57. package/dist/layout/header.js +101 -0
  58. package/dist/layout/header.js.map +1 -0
  59. package/dist/layout/nav-width.d.ts +29 -0
  60. package/dist/layout/nav-width.d.ts.map +1 -0
  61. package/dist/layout/nav-width.js +32 -0
  62. package/dist/layout/nav-width.js.map +1 -0
  63. package/dist/layout/nav.d.ts +13 -0
  64. package/dist/layout/nav.d.ts.map +1 -0
  65. package/dist/layout/nav.js +5 -0
  66. package/dist/layout/nav.js.map +1 -0
  67. package/dist/layout/root.d.ts.map +1 -1
  68. package/dist/layout/root.js +8 -1
  69. package/dist/layout/root.js.map +1 -1
  70. package/dist/mdx/allow-list.d.ts +10 -2
  71. package/dist/mdx/allow-list.d.ts.map +1 -1
  72. package/dist/mdx/allow-list.js +12 -2
  73. package/dist/mdx/allow-list.js.map +1 -1
  74. package/dist/mdx/components.d.ts +4 -1
  75. package/dist/mdx/components.d.ts.map +1 -1
  76. package/dist/mdx/components.js +18 -4
  77. package/dist/mdx/components.js.map +1 -1
  78. package/dist/mdx/tones.d.ts +11 -0
  79. package/dist/mdx/tones.d.ts.map +1 -0
  80. package/dist/mdx/tones.js +43 -0
  81. package/dist/mdx/tones.js.map +1 -0
  82. package/dist/node/build.js +1 -1
  83. package/dist/node/build.js.map +1 -1
  84. package/dist/node/content.d.ts +7 -2
  85. package/dist/node/content.d.ts.map +1 -1
  86. package/dist/node/content.js +17 -7
  87. package/dist/node/content.js.map +1 -1
  88. package/dist/node/errors.d.ts +1 -0
  89. package/dist/node/errors.d.ts.map +1 -1
  90. package/dist/node/errors.js +2 -1
  91. package/dist/node/errors.js.map +1 -1
  92. package/dist/site/app.d.ts.map +1 -1
  93. package/dist/site/app.js +3 -2
  94. package/dist/site/app.js.map +1 -1
  95. package/dist/site/site-page.d.ts.map +1 -1
  96. package/dist/site/site-page.js +4 -4
  97. package/dist/site/site-page.js.map +1 -1
  98. package/dist/website/blocks/announcement-dismiss.d.ts +13 -0
  99. package/dist/website/blocks/announcement-dismiss.d.ts.map +1 -0
  100. package/dist/website/blocks/announcement-dismiss.js +49 -0
  101. package/dist/website/blocks/announcement-dismiss.js.map +1 -0
  102. package/dist/website/blocks/announcement-views.d.ts +24 -0
  103. package/dist/website/blocks/announcement-views.d.ts.map +1 -0
  104. package/dist/website/blocks/announcement-views.js +31 -0
  105. package/dist/website/blocks/announcement-views.js.map +1 -0
  106. package/dist/website/blocks/button.d.ts +21 -0
  107. package/dist/website/blocks/button.d.ts.map +1 -0
  108. package/dist/website/blocks/button.js +32 -0
  109. package/dist/website/blocks/button.js.map +1 -0
  110. package/dist/website/blocks/call-to-action-views.d.ts +15 -0
  111. package/dist/website/blocks/call-to-action-views.d.ts.map +1 -0
  112. package/dist/website/blocks/call-to-action-views.js +36 -0
  113. package/dist/website/blocks/call-to-action-views.js.map +1 -0
  114. package/dist/website/blocks/card-grid-views.d.ts +41 -0
  115. package/dist/website/blocks/card-grid-views.d.ts.map +1 -0
  116. package/dist/website/blocks/card-grid-views.js +94 -0
  117. package/dist/website/blocks/card-grid-views.js.map +1 -0
  118. package/dist/website/blocks/carousel-controls.d.ts +13 -0
  119. package/dist/website/blocks/carousel-controls.d.ts.map +1 -0
  120. package/dist/website/blocks/carousel-controls.js +48 -0
  121. package/dist/website/blocks/carousel-controls.js.map +1 -0
  122. package/dist/website/blocks/carousel.d.ts +16 -0
  123. package/dist/website/blocks/carousel.d.ts.map +1 -0
  124. package/dist/website/blocks/carousel.js +12 -0
  125. package/dist/website/blocks/carousel.js.map +1 -0
  126. package/dist/website/blocks/catalog.d.ts +45 -0
  127. package/dist/website/blocks/catalog.d.ts.map +1 -0
  128. package/dist/website/blocks/catalog.js +35 -0
  129. package/dist/website/blocks/catalog.js.map +1 -0
  130. package/dist/website/blocks/commerce.d.ts +10 -16
  131. package/dist/website/blocks/commerce.d.ts.map +1 -1
  132. package/dist/website/blocks/commerce.js +12 -13
  133. package/dist/website/blocks/commerce.js.map +1 -1
  134. package/dist/website/blocks/contact-views.d.ts +28 -0
  135. package/dist/website/blocks/contact-views.d.ts.map +1 -0
  136. package/dist/website/blocks/contact-views.js +55 -0
  137. package/dist/website/blocks/contact-views.js.map +1 -0
  138. package/dist/website/blocks/content.d.ts +15 -20
  139. package/dist/website/blocks/content.d.ts.map +1 -1
  140. package/dist/website/blocks/content.js +20 -9
  141. package/dist/website/blocks/content.js.map +1 -1
  142. package/dist/website/blocks/empty-state-views.d.ts +32 -0
  143. package/dist/website/blocks/empty-state-views.d.ts.map +1 -0
  144. package/dist/website/blocks/empty-state-views.js +39 -0
  145. package/dist/website/blocks/empty-state-views.js.map +1 -0
  146. package/dist/website/blocks/faq-views.d.ts +20 -0
  147. package/dist/website/blocks/faq-views.d.ts.map +1 -0
  148. package/dist/website/blocks/faq-views.js +38 -0
  149. package/dist/website/blocks/faq-views.js.map +1 -0
  150. package/dist/website/blocks/feature-views.d.ts +17 -0
  151. package/dist/website/blocks/feature-views.d.ts.map +1 -0
  152. package/dist/website/blocks/feature-views.js +40 -0
  153. package/dist/website/blocks/feature-views.js.map +1 -0
  154. package/dist/website/blocks/hero-views.d.ts +18 -0
  155. package/dist/website/blocks/hero-views.d.ts.map +1 -0
  156. package/dist/website/blocks/hero-views.js +27 -0
  157. package/dist/website/blocks/hero-views.js.map +1 -0
  158. package/dist/website/blocks/icons.d.ts +63 -0
  159. package/dist/website/blocks/icons.d.ts.map +1 -0
  160. package/dist/website/blocks/icons.js +63 -0
  161. package/dist/website/blocks/icons.js.map +1 -0
  162. package/dist/website/blocks/list.d.ts +20 -0
  163. package/dist/website/blocks/list.d.ts.map +1 -0
  164. package/dist/website/blocks/list.js +29 -0
  165. package/dist/website/blocks/list.js.map +1 -0
  166. package/dist/website/blocks/local-views.d.ts +60 -0
  167. package/dist/website/blocks/local-views.d.ts.map +1 -0
  168. package/dist/website/blocks/local-views.js +38 -0
  169. package/dist/website/blocks/local-views.js.map +1 -0
  170. package/dist/website/blocks/local.d.ts +15 -0
  171. package/dist/website/blocks/local.d.ts.map +1 -0
  172. package/dist/website/blocks/local.js +15 -0
  173. package/dist/website/blocks/local.js.map +1 -0
  174. package/dist/website/blocks/logo-stats-views.d.ts +29 -0
  175. package/dist/website/blocks/logo-stats-views.d.ts.map +1 -0
  176. package/dist/website/blocks/logo-stats-views.js +51 -0
  177. package/dist/website/blocks/logo-stats-views.js.map +1 -0
  178. package/dist/website/blocks/marketing.d.ts +11 -22
  179. package/dist/website/blocks/marketing.d.ts.map +1 -1
  180. package/dist/website/blocks/marketing.js +12 -14
  181. package/dist/website/blocks/marketing.js.map +1 -1
  182. package/dist/website/blocks/media-views.d.ts +17 -0
  183. package/dist/website/blocks/media-views.d.ts.map +1 -0
  184. package/dist/website/blocks/media-views.js +24 -0
  185. package/dist/website/blocks/media-views.js.map +1 -0
  186. package/dist/website/blocks/newsletter-views.d.ts +26 -0
  187. package/dist/website/blocks/newsletter-views.d.ts.map +1 -0
  188. package/dist/website/blocks/newsletter-views.js +44 -0
  189. package/dist/website/blocks/newsletter-views.js.map +1 -0
  190. package/dist/website/blocks/parts.d.ts +45 -2
  191. package/dist/website/blocks/parts.d.ts.map +1 -1
  192. package/dist/website/blocks/parts.js +31 -4
  193. package/dist/website/blocks/parts.js.map +1 -1
  194. package/dist/website/blocks/sections.d.ts +27 -0
  195. package/dist/website/blocks/sections.d.ts.map +1 -0
  196. package/dist/website/blocks/sections.js +27 -0
  197. package/dist/website/blocks/sections.js.map +1 -0
  198. package/dist/website/blocks/team-views.d.ts +24 -0
  199. package/dist/website/blocks/team-views.d.ts.map +1 -0
  200. package/dist/website/blocks/team-views.js +45 -0
  201. package/dist/website/blocks/team-views.js.map +1 -0
  202. package/dist/website/blocks/testimonial-views.d.ts +24 -0
  203. package/dist/website/blocks/testimonial-views.d.ts.map +1 -0
  204. package/dist/website/blocks/testimonial-views.js +68 -0
  205. package/dist/website/blocks/testimonial-views.js.map +1 -0
  206. package/dist/website/blocks/variant.d.ts +35 -0
  207. package/dist/website/blocks/variant.d.ts.map +1 -0
  208. package/dist/website/blocks/variant.js +74 -0
  209. package/dist/website/blocks/variant.js.map +1 -0
  210. package/package.json +3 -2
  211. package/styles.css +1291 -42
@@ -1,13 +1,40 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Link from "next/link";
3
+ import { anchorOf, toneOf } from "./variant.js";
4
+ /** The attributes of a block's own `<section>`, in the order of every band: anchor, class, name, tone. */
5
+ export function bandAttrs(name, anchor, className = "site-block") {
6
+ return { id: anchorOf(name, anchor.id), className, "data-block": name, "data-tone": toneOf(name, anchor.tone) };
7
+ }
3
8
  /**
4
9
  * The frame of every block: a full-width band with the content in the site container, a heading
5
10
  * when the block has a title, and a `data-block` name that tests and the site's own CSS can find.
6
11
  */
7
- export function Section({ name, title, intro, children, }) {
8
- return (_jsx("section", { className: "site-block", "data-block": name, children: _jsxs("div", { className: "site-container", children: [title ? _jsx("h2", { className: "site-block-title", children: title }) : null, intro ? _jsx("p", { className: "site-block-intro", children: intro }) : null, children] }) }));
12
+ export function Section({ name, id, tone, title, intro, align, children, }) {
13
+ const head = align === "center" ? "site-block-head-center" : undefined;
14
+ return (_jsx("section", { ...bandAttrs(name, { id, tone }), children: _jsxs("div", { className: "site-container", children: [title ? _jsx("h2", { className: head ? `site-block-title ${head}` : "site-block-title", children: title }) : null, intro ? _jsx("p", { className: head ? `site-block-intro ${head}` : "site-block-intro", children: intro }) : null, children] }) }));
15
+ }
16
+ /** The buttons of a block, primary first; nothing when it has none. */
17
+ export function Actions({ primary, secondary, center = false, size = "md", }) {
18
+ if (!primary && !secondary)
19
+ return null;
20
+ return (_jsxs("div", { className: center ? "mt-8 flex flex-wrap justify-center gap-3" : "mt-8 flex flex-wrap gap-3", children: [primary ? _jsx(ActionLink, { action: primary, size: size }) : null, secondary ? _jsx(ActionLink, { action: secondary, secondary: true, size: size }) : null] }));
21
+ }
22
+ /** An image a block shows as it is: the static export ships images unprocessed. */
23
+ export function BlockImg({ image, className, }) {
24
+ // biome-ignore lint/performance/noImgElement: static export, images ship as they are
25
+ return _jsx("img", { src: image.src, alt: image.alt, className: className });
26
+ }
27
+ /**
28
+ * A picture as the brand shows media: in a frame or on its own with the media radius, cut to the
29
+ * brand's first aspect ratio, in its two-colour treatment when it has one, and, with `bleed`,
30
+ * running to the page edge on a wide screen when the brand's media container is `bleed`.
31
+ */
32
+ export function Media({ image, bleed = false, className, }) {
33
+ const classes = ["site-media", bleed ? "site-media-bleed" : "", className ?? ""].filter(Boolean).join(" ");
34
+ return (_jsx("figure", { className: classes, children: _jsx("div", { className: "site-media-picture", children: _jsx(BlockImg, { image: image, className: "site-media-img" }) }) }));
9
35
  }
10
- export function ActionLink({ action, secondary = false, }) {
11
- return (_jsx(Link, { href: action.href, className: secondary ? "site-button site-button-secondary" : "site-button", children: action.label }));
36
+ export function ActionLink({ action, secondary = false, size = "md", }) {
37
+ const classes = ["site-button", secondary ? "site-button-secondary" : "", size === "lg" ? "site-button-lg" : ""];
38
+ return (_jsx(Link, { href: action.href, className: classes.filter(Boolean).join(" "), children: action.label }));
12
39
  }
13
40
  //# sourceMappingURL=parts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parts.js","sourceRoot":"","sources":["../../../src/website/blocks/parts.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAS7B;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,EACvB,IAAI,EACJ,KAAK,EACL,KAAK,EACL,QAAQ,GAMR;IACA,OAAO,CACN,kBAAS,SAAS,EAAC,YAAY,gBAAa,IAAI,YAC/C,eAAK,SAAS,EAAC,gBAAgB,aAC7B,KAAK,CAAC,CAAC,CAAC,aAAI,SAAS,EAAC,kBAAkB,YAAE,KAAK,GAAM,CAAC,CAAC,CAAC,IAAI,EAC5D,KAAK,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,kBAAkB,YAAE,KAAK,GAAK,CAAC,CAAC,CAAC,IAAI,EAC1D,QAAQ,IACJ,GACG,CACV,CAAC;AACH,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EAC1B,MAAM,EACN,SAAS,GAAG,KAAK,GAIjB;IACA,OAAO,CACN,KAAC,IAAI,IAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,aAAa,YACjG,MAAM,CAAC,KAAK,GACP,CACP,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"parts.js","sourceRoot":"","sources":["../../../src/website/blocks/parts.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAchD,0GAA0G;AAC1G,MAAM,UAAU,SAAS,CACxB,IAAY,EACZ,MAAc,EACd,SAAS,GAAG,YAAY;IAOxB,OAAO,EAAE,EAAE,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EA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CAAC,YACnE,MAAM,CAAC,KAAK,GACP,CACP,CAAC;AACH,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { ReactElement } from "react";
2
+ import { type AnnouncementProps, type AnnouncementVariant } from "./announcement-views.js";
3
+ import { type CardGridProps, type CardGridVariant } from "./card-grid-views.js";
4
+ import { type EmptyStateProps, type EmptyStateVariant } from "./empty-state-views.js";
5
+ import { type MediaSectionProps, type MediaSectionVariant } from "./media-views.js";
6
+ import { type NewsletterProps, type NewsletterVariant } from "./newsletter-views.js";
7
+ /** A short notice across the page or floating at its foot, with an optional link and close button. */
8
+ export declare function Announcement({ variant, ...props }: AnnouncementProps & {
9
+ readonly variant?: AnnouncementVariant;
10
+ }): ReactElement;
11
+ /** A signup for the site's mailing list. */
12
+ export declare function Newsletter({ variant, ...props }: NewsletterProps & {
13
+ readonly variant?: NewsletterVariant;
14
+ }): ReactElement;
15
+ /** A heading and a paragraph with a picture. */
16
+ export declare function MediaSection({ variant, ...props }: MediaSectionProps & {
17
+ readonly variant?: MediaSectionVariant;
18
+ }): ReactElement;
19
+ /** A grid of cards that each lead somewhere. */
20
+ export declare function CardGrid({ variant, ...props }: CardGridProps & {
21
+ readonly variant?: CardGridVariant;
22
+ }): ReactElement;
23
+ /** A page or section with nothing in it yet, and the way on. */
24
+ export declare function EmptyState({ variant, ...props }: EmptyStateProps & {
25
+ readonly variant?: EmptyStateVariant;
26
+ }): ReactElement;
27
+ //# sourceMappingURL=sections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/sections.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAEN,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAExB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAsB,KAAK,aAAa,EAAE,KAAK,eAAe,EAAgB,MAAM,sBAAsB,CAAC;AAClH,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAEtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEN,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAExB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAEtB,MAAM,uBAAuB,CAAC;AAG/B,sGAAsG;AACtG,wBAAgB,YAAY,CAAC,EAC5B,OAAO,EACP,GAAG,KAAK,EACR,EAAE,iBAAiB,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAA;CAAE,GAAG,YAAY,CAE/E;AAED,4CAA4C;AAC5C,wBAAgB,UAAU,CAAC,EAC1B,OAAO,EACP,GAAG,KAAK,EACR,EAAE,eAAe,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAA;CAAE,GAAG,YAAY,CAE3E;AAED,gDAAgD;AAChD,wBAAgB,YAAY,CAAC,EAC5B,OAAO,EACP,GAAG,KAAK,EACR,EAAE,iBAAiB,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAA;CAAE,GAAG,YAAY,CAE/E;AAED,gDAAgD;AAChD,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAA;CAAE,GAAG,YAAY,CAEpH;AAED,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,EAC1B,OAAO,EACP,GAAG,KAAK,EACR,EAAE,eAAe,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAA;CAAE,GAAG,YAAY,CAE3E"}
@@ -0,0 +1,27 @@
1
+ import { ANNOUNCEMENT_VARIANTS, announcementView, } from "./announcement-views.js";
2
+ import { CARD_GRID_VARIANTS, cardGridView } from "./card-grid-views.js";
3
+ import { EMPTY_STATE_VARIANTS, emptyStateView, } from "./empty-state-views.js";
4
+ import { MEDIA_SECTION_VARIANTS, mediaSectionView, } from "./media-views.js";
5
+ import { NEWSLETTER_VARIANTS, newsletterView, } from "./newsletter-views.js";
6
+ import { variantOf } from "./variant.js";
7
+ /** A short notice across the page or floating at its foot, with an optional link and close button. */
8
+ export function Announcement({ variant, ...props }) {
9
+ return announcementView(variantOf("Announcement", variant, ANNOUNCEMENT_VARIANTS), props);
10
+ }
11
+ /** A signup for the site's mailing list. */
12
+ export function Newsletter({ variant, ...props }) {
13
+ return newsletterView(variantOf("Newsletter", variant, NEWSLETTER_VARIANTS), props);
14
+ }
15
+ /** A heading and a paragraph with a picture. */
16
+ export function MediaSection({ variant, ...props }) {
17
+ return mediaSectionView(variantOf("MediaSection", variant, MEDIA_SECTION_VARIANTS), props);
18
+ }
19
+ /** A grid of cards that each lead somewhere. */
20
+ export function CardGrid({ variant, ...props }) {
21
+ return cardGridView(variantOf("CardGrid", variant, CARD_GRID_VARIANTS), props);
22
+ }
23
+ /** A page or section with nothing in it yet, and the way on. */
24
+ export function EmptyState({ variant, ...props }) {
25
+ return emptyStateView(variantOf("EmptyState", variant, EMPTY_STATE_VARIANTS), props);
26
+ }
27
+ //# sourceMappingURL=sections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sections.js","sourceRoot":"","sources":["../../../src/website/blocks/sections.tsx"],"names":[],"mappings":"AACA,OAAO,EACN,qBAAqB,EAGrB,gBAAgB,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAA4C,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAClH,OAAO,EACN,oBAAoB,EAGpB,cAAc,GACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,sBAAsB,EAGtB,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,mBAAmB,EAGnB,cAAc,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,sGAAsG;AACtG,MAAM,UAAU,YAAY,CAAC,EAC5B,OAAO,EACP,GAAG,KAAK,EACwD;IAChE,OAAO,gBAAgB,CAAC,SAAS,CAAC,cAAc,EAAE,OAAO,EAAE,qBAAqB,CAAC,EAAE,KAAK,CAAC,CAAC;AAC3F,CAAC;AAED,4CAA4C;AAC5C,MAAM,UAAU,UAAU,CAAC,EAC1B,OAAO,EACP,GAAG,KAAK,EACoD;IAC5D,OAAO,cAAc,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,EAAE,mBAAmB,CAAC,EAAE,KAAK,CAAC,CAAC;AACrF,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,YAAY,CAAC,EAC5B,OAAO,EACP,GAAG,KAAK,EACwD;IAChE,OAAO,gBAAgB,CAAC,SAAS,CAAC,cAAc,EAAE,OAAO,EAAE,sBAAsB,CAAC,EAAE,KAAK,CAAC,CAAC;AAC5F,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAA0D;IACrG,OAAO,YAAY,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,EAAE,kBAAkB,CAAC,EAAE,KAAK,CAAC,CAAC;AAChF,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,UAAU,CAAC,EAC1B,OAAO,EACP,GAAG,KAAK,EACoD;IAC5D,OAAO,cAAc,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,EAAE,oBAAoB,CAAC,EAAE,KAAK,CAAC,CAAC;AACtF,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { ReactElement } from "react";
2
+ import { type Anchor, type BlockImage } from "./parts.js";
3
+ export declare const TEAM_VARIANTS: readonly ["cards", "photos", "avatars"];
4
+ export type TeamVariant = (typeof TEAM_VARIANTS)[number];
5
+ /** A profile link of a member; `icon` is a block icon name such as "linkedin", and `label` its accessible name. */
6
+ export type MemberLink = {
7
+ readonly label: string;
8
+ readonly href: string;
9
+ readonly icon: string;
10
+ };
11
+ export type Member = {
12
+ readonly name: string;
13
+ readonly role: string;
14
+ readonly image?: BlockImage;
15
+ readonly bio?: string;
16
+ readonly links?: readonly MemberLink[];
17
+ };
18
+ export type TeamProps = Anchor & {
19
+ readonly title?: string;
20
+ readonly intro?: string;
21
+ readonly members: readonly Member[];
22
+ };
23
+ export declare function teamView(variant: TeamVariant, props: TeamProps): ReactElement;
24
+ //# sourceMappingURL=team-views.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-views.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/team-views.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,UAAU,EAAqB,MAAM,YAAY,CAAC;AAG7E,eAAO,MAAM,aAAa,yCAAsB,CAAC;AACjD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,mHAAmH;AACnH,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAElG,MAAM,MAAM,MAAM,GAAG;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;CACvC,CAAC;AACF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC,CAAC;AAuGF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,GAAG,YAAY,CAG7E"}
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { BLOCK_VARIANTS } from "./catalog.js";
3
+ import { BlockIcon } from "./icons.js";
4
+ import { keyed } from "./list.js";
5
+ import { BlockImg, Section } from "./parts.js";
6
+ import { BlockPropError, filled } from "./variant.js";
7
+ export const TEAM_VARIANTS = BLOCK_VARIANTS.Team;
8
+ function MemberLinks({ links }) {
9
+ if (!links || links.length === 0)
10
+ return null;
11
+ return (_jsx("ul", { className: "flex gap-3", children: keyed(links).map(({ key, item: link }) => (_jsx("li", { children: _jsx("a", { href: link.href, className: "site-icon-link", "aria-label": link.label, children: _jsx(BlockIcon, { name: link.icon, className: "size-6" }) }) }, key))) }));
12
+ }
13
+ /*
14
+ * A photo or a card keeps the size of a full row's cell whatever the number of members, so two
15
+ * people do not each take half the page: the grid always has the layout's own columns, and a
16
+ * short row sits in the middle.
17
+ */
18
+ /** The photo a layout cannot draw without. */
19
+ function photoOf(variant, member) {
20
+ if (!member.image)
21
+ throw new BlockPropError("Team", variant, `image for ${member.name}`, "add image={{ src, alt }} to every member");
22
+ return member.image;
23
+ }
24
+ /** The block's own look: a card per member, the photo optional. */
25
+ function CardTeam(props) {
26
+ return (_jsx(Section, { name: "Team", id: props.id, tone: props.tone, title: props.title, intro: props.intro, children: _jsx("ul", { className: "site-grid", "data-cols": "4", "data-phone": "2", children: keyed(props.members).map(({ key, item: member }) => (_jsxs("li", { className: "site-card", children: [member.image ? _jsx(BlockImg, { image: member.image, className: "site-avatar" }) : null, _jsx("h3", { className: "site-card-title", children: member.name }), _jsx("p", { className: "site-card-text", children: member.role }), member.bio ? _jsx("p", { className: "site-card-text mt-2", children: member.bio }) : null, member.links?.length ? (_jsx("div", { className: "mt-3", children: _jsx(MemberLinks, { links: member.links }) })) : null] }, key))) }) }));
27
+ }
28
+ /** Wide photos in three columns, the name, role and links under each. */
29
+ function PhotoTeam(props) {
30
+ return (_jsx(Section, { name: "Team", id: props.id, tone: props.tone, title: props.title, intro: props.intro, children: _jsx("ul", { className: "site-grid site-grid-roomy", "data-cols": "3", "data-variant": "photos", children: keyed(props.members).map(({ key, item: member }) => (_jsxs("li", { children: [_jsx(BlockImg, { image: photoOf("photos", member), className: "site-team-photo aspect-video w-full object-cover" }), _jsxs("div", { className: "mt-4 flex items-center justify-between gap-4", children: [_jsxs("div", { children: [_jsx("h3", { className: "site-card-title", children: member.name }), _jsx("p", { className: "site-card-text", children: member.role })] }), _jsx(MemberLinks, { links: member.links })] }), member.bio ? _jsx("p", { className: "site-card-text mt-2", children: member.bio }) : null] }, key))) }) }));
31
+ }
32
+ /** Round photos in up to six columns, each name centred under its photo. */
33
+ function AvatarTeam(props) {
34
+ return (_jsx(Section, { name: "Team", id: props.id, tone: props.tone, title: props.title, intro: props.intro, align: "center", children: _jsx("ul", { className: "site-grid site-grid-roomy", "data-cols": "6", "data-phone": "2", "data-variant": "avatars", children: keyed(props.members).map(({ key, item: member }) => (_jsxs("li", { className: "flex flex-col items-center text-center", children: [_jsx(BlockImg, { image: photoOf("avatars", member), className: "site-avatar-round aspect-square w-full object-cover" }), _jsx("h3", { className: "site-card-title mt-4", children: member.name }), _jsx("p", { className: "site-card-text", children: member.role }), _jsx(MemberLinks, { links: member.links })] }, key))) }) }));
35
+ }
36
+ const VIEWS = {
37
+ cards: CardTeam,
38
+ photos: PhotoTeam,
39
+ avatars: AvatarTeam,
40
+ };
41
+ export function teamView(variant, props) {
42
+ const View = VIEWS[variant];
43
+ return _jsx(View, { ...props, members: filled("Team", variant, "members", props.members) });
44
+ }
45
+ //# sourceMappingURL=team-views.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-views.js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E,EAAE,CAAC,CACpD,cAAc,SAAS,EAAC,wCAAwC,aAC/D,KAAC,QAAQ,IACR,KAAK,EAAE,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,SAAS,EAAC,qDAAqD,GAC9D,EACF,aAAI,SAAS,EAAC,sBAAsB,YAAE,MAAM,CAAC,IAAI,GAAM,EACvD,YAAG,SAAS,EAAC,gBAAgB,YAAE,MAAM,CAAC,IAAI,GAAK,EAC/C,KAAC,WAAW,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,GAAI,KAP5B,GAAG,CAQP,CACL,CAAC,GACE,GACI,CACV,CAAC;AACH,CAAC;AAED,MAAM,KAAK,GAAsE;IAChF,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,UAAU;CACnB,CAAC;AAEF,MAAM,UAAU,QAAQ,CAAC,OAAoB,EAAE,KAAgB;IAC9D,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5B,OAAO,KAAC,IAAI,OAAK,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,GAAI,CAAC;AACxF,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { ReactElement } from "react";
2
+ import { type SiteStrings } from "../../i18n/strings.js";
3
+ import { type Anchor, type BlockImage } from "./parts.js";
4
+ export declare const TESTIMONIALS_VARIANTS: readonly ["cards", "quote", "grid", "reviews", "carousel"];
5
+ export type TestimonialsVariant = (typeof TESTIMONIALS_VARIANTS)[number];
6
+ export type Testimonial = {
7
+ readonly quote: string;
8
+ readonly name: string;
9
+ readonly role?: string;
10
+ /** The person's photo, shown beside the name. */
11
+ readonly image?: BlockImage;
12
+ /** A short heading over the quote, in the review layout. */
13
+ readonly title?: string;
14
+ /** Stars from 1 to 5, in the review layout. */
15
+ readonly rating?: number;
16
+ };
17
+ export type TestimonialsProps = Anchor & {
18
+ readonly title?: string;
19
+ readonly intro?: string;
20
+ readonly items: readonly Testimonial[];
21
+ readonly strings: SiteStrings;
22
+ };
23
+ export declare function testimonialsView(variant: TestimonialsVariant, props: TestimonialsProps): ReactElement;
24
+ //# sourceMappingURL=testimonial-views.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testimonial-views.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/testimonial-views.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAQ,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAI/D,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,UAAU,EAAqB,MAAM,YAAY,CAAC;AAG7E,eAAO,MAAM,qBAAqB,4DAA8B,CAAC;AACjE,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,MAAM,MAAM,WAAW,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG;IACxC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;CAC9B,CAAC;AA8JF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAGrG"}
@@ -0,0 +1,68 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /*
3
+ * Testimonial layouts. The quote, grid and review layouts are adapted from HyperUI's
4
+ * testimonials (https://github.com/markmead/hyperui, MIT, Copyright (c) Mark Mead): colours,
5
+ * type and radii come from the brand instead of fixed Tailwind colours. The carousel is the shared
6
+ * row in `carousel.tsx`.
7
+ */
8
+ import { Quotes, Star } from "@phosphor-icons/react/dist/ssr";
9
+ import { fill } from "../../i18n/strings.js";
10
+ import { CarouselRow } from "./carousel.js";
11
+ import { BLOCK_VARIANTS } from "./catalog.js";
12
+ import { gridColumns, keyed } from "./list.js";
13
+ import { BlockImg, Section } from "./parts.js";
14
+ import { BlockPropError, filled } from "./variant.js";
15
+ export const TESTIMONIALS_VARIANTS = BLOCK_VARIANTS.Testimonials;
16
+ const STARS = [1, 2, 3, 4, 5];
17
+ function Rating({ value, strings }) {
18
+ if (!Number.isInteger(value) || value < 1 || value > 5)
19
+ throw new BlockPropError("Testimonials", "reviews", "rating", `give a whole number from 1 to 5, not ${value}`);
20
+ return (_jsxs("p", { className: "site-rating flex items-center gap-0.5", children: [_jsx("span", { className: "sr-only", children: fill(strings.ratedOutOf, String(value)) }), keyed(STARS).map(({ key, item: star }) => (_jsx(Star, { "aria-hidden": "true", weight: "fill", className: star <= value ? "size-4" : "site-star-off size-4" }, key)))] }));
21
+ }
22
+ /** The name, the role and the photo when there is one; `center` for a caption under a centred quote. */
23
+ function Person({ item, center = false }) {
24
+ return (_jsxs("div", { className: center ? "flex flex-col items-center gap-3" : "flex items-center gap-3", children: [item.image ? _jsx(BlockImg, { image: item.image, className: "site-avatar-round size-10 object-cover" }) : null, _jsxs("div", { className: center ? "text-center" : "text-start", children: [_jsx("p", { className: "site-person-name", children: item.name }), item.role ? _jsx("p", { className: "site-card-text", children: item.role }) : null] })] }));
25
+ }
26
+ /** A quote card: the words, then who said them under a rule, at the foot whatever the quote's length. */
27
+ function QuoteCard({ item, children }) {
28
+ return (_jsxs("figure", { className: "site-card flex h-full flex-col", children: [children, _jsx("blockquote", { className: "site-quote flex-1", children: item.quote }), _jsx("figcaption", { className: "site-testimonial-foot mt-6 pt-4", children: _jsx(Person, { item: item }) })] }));
29
+ }
30
+ /** A quote card under a quotation mark in the brand colour, as the cards and the carousel show it. */
31
+ function MarkedQuoteCard({ item }) {
32
+ return (_jsx(QuoteCard, { item: item, children: _jsx(Quotes, { "aria-hidden": "true", weight: "fill", className: "site-quote-mark mb-4 size-6" }) }));
33
+ }
34
+ /** The block's own look: a card per quote in two columns, each under a quotation mark. */
35
+ function CardTestimonials(props) {
36
+ return (_jsx(Section, { name: "Testimonials", id: props.id, tone: props.tone, title: props.title, intro: props.intro, children: _jsx("ul", { className: "site-grid", "data-cols": gridColumns(props.items.length, 2), children: keyed(props.items).map(({ key, item }) => (_jsx("li", { children: _jsx(MarkedQuoteCard, { item: item }) }, key))) }) }));
37
+ }
38
+ /** The quote cards in one row the reader scrolls, for more quotes than a page wants to stack. */
39
+ function CarouselTestimonials(props) {
40
+ return (_jsx(Section, { name: "Testimonials", id: props.id, tone: props.tone, title: props.title, intro: props.intro, children: _jsx(CarouselRow, { kind: "cards", label: props.title, items: props.items, strings: props.strings, render: (item) => _jsx(MarkedQuoteCard, { item: item }) }) }));
41
+ }
42
+ /** One quote, large and centred, under a quotation mark in the brand colour. */
43
+ function QuoteTestimonials(props) {
44
+ const [item, ...rest] = props.items;
45
+ if (item === undefined || rest.length > 0)
46
+ throw new BlockPropError("Testimonials", "quote", `exactly one item in items, not ${props.items.length}`, "it shows one quote large; use cards, grid, reviews or carousel for more");
47
+ return (_jsx(Section, { name: "Testimonials", id: props.id, tone: props.tone, title: props.title, intro: props.intro, align: "center", children: _jsxs("figure", { className: "mx-auto flex max-w-2xl flex-col items-center text-center", "data-variant": "quote", children: [_jsx(Quotes, { "aria-hidden": "true", weight: "fill", className: "site-quote-mark size-8" }), _jsx("blockquote", { className: "site-quote-large mt-4", children: item.quote }), _jsx("figcaption", { className: "mt-6", children: _jsx(Person, { item: item, center: true }) })] }) }));
48
+ }
49
+ /** Three columns of cards, each led by the person, then the words. */
50
+ function GridTestimonials(props) {
51
+ return (_jsx(Section, { name: "Testimonials", id: props.id, tone: props.tone, title: props.title, intro: props.intro, children: _jsx("ul", { className: "site-grid", "data-cols": gridColumns(props.items.length, 3), "data-variant": "grid", children: keyed(props.items).map(({ key, item }) => (_jsx("li", { children: _jsxs("figure", { className: "site-card flex h-full flex-col", children: [_jsx("figcaption", { className: "mb-4", children: _jsx(Person, { item: item }) }), _jsx("blockquote", { className: "site-quote", children: item.quote })] }) }, key))) }) }));
52
+ }
53
+ /** Review cards in three columns: the stars, a heading, the words, and who wrote them at the foot. */
54
+ function ReviewTestimonials(props) {
55
+ return (_jsx(Section, { name: "Testimonials", id: props.id, tone: props.tone, title: props.title, intro: props.intro, children: _jsx("ul", { className: "site-grid", "data-cols": gridColumns(props.items.length, 3), "data-variant": "reviews", children: keyed(props.items).map(({ key, item }) => (_jsx("li", { children: _jsx(QuoteCard, { item: item, children: _jsxs("div", { className: "mb-3 flex flex-col gap-3", children: [item.rating === undefined ? null : _jsx(Rating, { value: item.rating, strings: props.strings }), item.title ? _jsx("h3", { className: "site-card-title", children: item.title }) : null] }) }) }, key))) }) }));
56
+ }
57
+ const VIEWS = {
58
+ cards: CardTestimonials,
59
+ quote: QuoteTestimonials,
60
+ grid: GridTestimonials,
61
+ reviews: ReviewTestimonials,
62
+ carousel: CarouselTestimonials,
63
+ };
64
+ export function testimonialsView(variant, props) {
65
+ const View = VIEWS[variant];
66
+ return _jsx(View, { ...props, items: filled("Testimonials", variant, "items", props.items) });
67
+ }
68
+ //# sourceMappingURL=testimonial-views.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testimonial-views.js","sourceRoot":"","sources":["../../../src/website/blocks/testimonial-views.tsx"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BAAgB;IACtB,OAAO,EAAE,kBAAkB;IAC3B,QAAQ,EAAE,oBAAoB;CAC9B,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAAC,OAA4B,EAAE,KAAwB;IACtF,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5B,OAAO,KAAC,IAAI,OAAK,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,GAAI,CAAC;AAC1F,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Block variants: one block per kind of section, with a `variant` prop for its layouts. The
3
+ * first variant of each list is the block's own look, the one a page gets without the prop.
4
+ */
5
+ import { type SectionTone } from "./catalog.js";
6
+ /** A `variant` a block does not have. Content names it, so the error names the choices. */
7
+ export declare class BlockVariantError extends Error {
8
+ constructor(block: string, variant: string, allowed: readonly string[]);
9
+ }
10
+ /**
11
+ * A prop that one variant needs and the content left out. A block with no variants passes
12
+ * `undefined`, and the message names the block alone.
13
+ */
14
+ export declare class BlockPropError extends Error {
15
+ constructor(block: string, variant: string | undefined, prop: string, remedy: string);
16
+ }
17
+ /** A `tone` that is not one of the section tones. */
18
+ export declare class BlockToneError extends Error {
19
+ constructor(block: string, tone: string);
20
+ }
21
+ /** The `data-tone` of a block: absent for the page's own tone, the tone's name for the others. */
22
+ export declare function toneOf(block: string, tone: string | undefined): Exclude<SectionTone, "base"> | undefined;
23
+ /** An `id` that a link cannot point at: it must be an anchor name, such as "pricing". */
24
+ export declare class BlockIdError extends Error {
25
+ constructor(block: string, id: string);
26
+ }
27
+ /** The variant to render: the one the content names, or the block's own look when it names none. */
28
+ export declare function variantOf<V extends string>(block: string, variant: string | undefined, allowed: readonly V[]): V;
29
+ /** The list a block shows, or a BlockPropError when the content gave it no item. */
30
+ export declare function filled<T>(block: string, variant: string | undefined, prop: string, items: readonly T[]): readonly T[];
31
+ /** The anchor of a block, so a link such as "#pricing" scrolls to it: absent, or a valid name. */
32
+ export declare function anchorOf(block: string, id: string | undefined): string | undefined;
33
+ /** The value of a prop the variant needs, or a BlockPropError that says what to add. */
34
+ export declare function required<T>(block: string, variant: string, prop: string, value: T | undefined, remedy: string): T;
35
+ //# sourceMappingURL=variant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variant.d.ts","sourceRoot":"","sources":["../../../src/website/blocks/variant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAE/D,2FAA2F;AAC3F,qBAAa,iBAAkB,SAAQ,KAAK;gBAC/B,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE;CAItE;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,KAAK;gBAC5B,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAIpF;AAED,qDAAqD;AACrD,qBAAa,cAAe,SAAQ,KAAK;gBAC5B,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAIvC;AAED,kGAAkG;AAClG,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,SAAS,CAIxG;AAED,yFAAyF;AACzF,qBAAa,YAAa,SAAQ,KAAK;gBAC1B,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM;CAMrC;AAED,oGAAoG;AACpG,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,CAMhH;AAED,oFAAoF;AACpF,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,CAIrH;AAED,kGAAkG;AAClG,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGlF;AAED,wFAAwF;AACxF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,CAGjH"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Block variants: one block per kind of section, with a `variant` prop for its layouts. The
3
+ * first variant of each list is the block's own look, the one a page gets without the prop.
4
+ */
5
+ import { SECTION_TONES } from "./catalog.js";
6
+ /** A `variant` a block does not have. Content names it, so the error names the choices. */
7
+ export class BlockVariantError extends Error {
8
+ constructor(block, variant, allowed) {
9
+ super(`${block}: there is no variant "${variant}". Use one of ${allowed.join(", ")}, or leave variant out.`);
10
+ this.name = "BlockVariantError";
11
+ }
12
+ }
13
+ /**
14
+ * A prop that one variant needs and the content left out. A block with no variants passes
15
+ * `undefined`, and the message names the block alone.
16
+ */
17
+ export class BlockPropError extends Error {
18
+ constructor(block, variant, prop, remedy) {
19
+ super(`${variant === undefined ? block : `${block} variant "${variant}"`} needs ${prop}: ${remedy}`);
20
+ this.name = "BlockPropError";
21
+ }
22
+ }
23
+ /** A `tone` that is not one of the section tones. */
24
+ export class BlockToneError extends Error {
25
+ constructor(block, tone) {
26
+ super(`${block}: there is no tone "${tone}". Use one of ${SECTION_TONES.join(", ")}, or leave tone out.`);
27
+ this.name = "BlockToneError";
28
+ }
29
+ }
30
+ /** The `data-tone` of a block: absent for the page's own tone, the tone's name for the others. */
31
+ export function toneOf(block, tone) {
32
+ if (tone === undefined || tone === "base")
33
+ return undefined;
34
+ if (!SECTION_TONES.includes(tone))
35
+ throw new BlockToneError(block, tone);
36
+ return tone;
37
+ }
38
+ /** An `id` that a link cannot point at: it must be an anchor name, such as "pricing". */
39
+ export class BlockIdError extends Error {
40
+ constructor(block, id) {
41
+ super(`${block}: id "${id}" is not an anchor name. Use a letter first, then letters, digits or hyphens, such as id="pricing".`);
42
+ this.name = "BlockIdError";
43
+ }
44
+ }
45
+ /** The variant to render: the one the content names, or the block's own look when it names none. */
46
+ export function variantOf(block, variant, allowed) {
47
+ const own = allowed[0];
48
+ if (own === undefined)
49
+ throw new Error(`${block}: a block needs at least one variant`);
50
+ if (variant === undefined)
51
+ return own;
52
+ if (!allowed.includes(variant))
53
+ throw new BlockVariantError(block, variant, allowed);
54
+ return variant;
55
+ }
56
+ /** The list a block shows, or a BlockPropError when the content gave it no item. */
57
+ export function filled(block, variant, prop, items) {
58
+ if (items.length === 0)
59
+ throw new BlockPropError(block, variant, `at least one item in ${prop}`, `add one, or remove the block`);
60
+ return items;
61
+ }
62
+ /** The anchor of a block, so a link such as "#pricing" scrolls to it: absent, or a valid name. */
63
+ export function anchorOf(block, id) {
64
+ if (id !== undefined && !/^[A-Za-z][\w-]*$/.test(id))
65
+ throw new BlockIdError(block, id);
66
+ return id;
67
+ }
68
+ /** The value of a prop the variant needs, or a BlockPropError that says what to add. */
69
+ export function required(block, variant, prop, value, remedy) {
70
+ if (value === undefined)
71
+ throw new BlockPropError(block, variant, prop, remedy);
72
+ return value;
73
+ }
74
+ //# sourceMappingURL=variant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variant.js","sourceRoot":"","sources":["../../../src/website/blocks/variant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAoB,MAAM,cAAc,CAAC;AAE/D,2FAA2F;AAC3F,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC3C,YAAY,KAAa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,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-ship/site",
3
- "version": "1.0.1",
3
+ "version": "3.0.0",
4
4
  "type": "module",
5
5
  "description": "The white-label site engine of SHIP Sites: a website, blog and docs on Next.js and fumadocs, themed entirely by a brand DNA.",
6
6
  "license": "MIT",
@@ -141,13 +141,14 @@
141
141
  "node": ">=20.12"
142
142
  },
143
143
  "dependencies": {
144
+ "@phosphor-icons/react": "^2.1.10",
144
145
  "jiti": "^2.7.0",
145
146
  "remark": "^15.0.1",
146
147
  "remark-mdx": "^3.1.1",
147
148
  "unist-util-visit": "^5.1.0",
148
149
  "zbsearch": "^4.0.1",
149
150
  "zod": "^4.4.3",
150
- "@lets-ship/brand-dna": "^1.1.0"
151
+ "@lets-ship/brand-dna": "^3.0.0"
151
152
  },
152
153
  "peerDependencies": {
153
154
  "fumadocs-core": "16.17.5",