@hanzo/ui 8.4.13 → 8.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/dist/backends/gui/index.cjs +11 -1
  2. package/dist/backends/gui/index.d.ts +3 -0
  3. package/dist/backends/gui/index.d.ts.map +1 -1
  4. package/dist/backends/gui/index.js +3 -0
  5. package/dist/backends/gui/index.js.map +1 -1
  6. package/dist/backends/gui/link.cjs +126 -0
  7. package/dist/backends/gui/link.d.ts +65 -0
  8. package/dist/backends/gui/link.d.ts.map +1 -0
  9. package/dist/backends/gui/link.js +88 -0
  10. package/dist/backends/gui/link.js.map +1 -0
  11. package/dist/backends/gui/prose.cjs +33 -0
  12. package/dist/backends/gui/prose.d.ts +39 -0
  13. package/dist/backends/gui/prose.d.ts.map +1 -0
  14. package/dist/backends/gui/prose.js +30 -0
  15. package/dist/backends/gui/prose.js.map +1 -0
  16. package/dist/backends/gui/video.cjs +89 -0
  17. package/dist/backends/gui/video.d.ts +33 -0
  18. package/dist/backends/gui/video.d.ts.map +1 -0
  19. package/dist/backends/gui/video.js +53 -0
  20. package/dist/backends/gui/video.js.map +1 -0
  21. package/dist/blocks/accordian.cjs +19 -0
  22. package/dist/blocks/accordian.d.ts +4 -0
  23. package/dist/blocks/accordian.d.ts.map +1 -0
  24. package/dist/blocks/accordian.js +16 -0
  25. package/dist/blocks/accordian.js.map +1 -0
  26. package/dist/blocks/bullet-cards.cjs +40 -0
  27. package/dist/blocks/bullet-cards.d.ts +10 -0
  28. package/dist/blocks/bullet-cards.d.ts.map +1 -0
  29. package/dist/blocks/bullet-cards.js +37 -0
  30. package/dist/blocks/bullet-cards.js.map +1 -0
  31. package/dist/blocks/card.cjs +58 -0
  32. package/dist/blocks/card.d.ts +14 -0
  33. package/dist/blocks/card.d.ts.map +1 -0
  34. package/dist/blocks/card.js +55 -0
  35. package/dist/blocks/card.js.map +1 -0
  36. package/dist/blocks/carte-blanche.cjs +38 -0
  37. package/dist/blocks/carte-blanche.d.ts +13 -0
  38. package/dist/blocks/carte-blanche.d.ts.map +1 -0
  39. package/dist/blocks/carte-blanche.js +35 -0
  40. package/dist/blocks/carte-blanche.js.map +1 -0
  41. package/dist/blocks/content.cjs +65 -0
  42. package/dist/blocks/content.d.ts +11 -0
  43. package/dist/blocks/content.d.ts.map +1 -0
  44. package/dist/blocks/content.js +61 -0
  45. package/dist/blocks/content.js.map +1 -0
  46. package/dist/blocks/cta.cjs +103 -0
  47. package/dist/blocks/cta.d.ts +13 -0
  48. package/dist/blocks/cta.d.ts.map +1 -0
  49. package/dist/blocks/cta.js +67 -0
  50. package/dist/blocks/cta.js.map +1 -0
  51. package/dist/blocks/def.cjs +24 -0
  52. package/dist/blocks/def.d.ts +191 -0
  53. package/dist/blocks/def.d.ts.map +1 -0
  54. package/dist/blocks/def.js +22 -0
  55. package/dist/blocks/def.js.map +1 -0
  56. package/dist/blocks/enh-heading.cjs +86 -0
  57. package/dist/blocks/enh-heading.d.ts +7 -0
  58. package/dist/blocks/enh-heading.d.ts.map +1 -0
  59. package/dist/blocks/enh-heading.js +83 -0
  60. package/dist/blocks/enh-heading.js.map +1 -0
  61. package/dist/blocks/grid.cjs +98 -0
  62. package/dist/blocks/grid.d.ts +18 -0
  63. package/dist/blocks/grid.d.ts.map +1 -0
  64. package/dist/blocks/grid.js +62 -0
  65. package/dist/blocks/grid.js.map +1 -0
  66. package/dist/blocks/group.cjs +43 -0
  67. package/dist/blocks/group.d.ts +4 -0
  68. package/dist/blocks/group.d.ts.map +1 -0
  69. package/dist/blocks/group.js +40 -0
  70. package/dist/blocks/group.js.map +1 -0
  71. package/dist/blocks/heading.cjs +22 -0
  72. package/dist/blocks/heading.d.ts +4 -0
  73. package/dist/blocks/heading.d.ts.map +1 -0
  74. package/dist/blocks/heading.js +19 -0
  75. package/dist/blocks/heading.js.map +1 -0
  76. package/dist/blocks/image.cjs +54 -0
  77. package/dist/blocks/image.d.ts +19 -0
  78. package/dist/blocks/image.d.ts.map +1 -0
  79. package/dist/blocks/image.js +51 -0
  80. package/dist/blocks/image.js.map +1 -0
  81. package/dist/blocks/index.cjs +65 -0
  82. package/dist/blocks/index.d.ts +18 -0
  83. package/dist/blocks/index.d.ts.map +1 -0
  84. package/dist/blocks/index.js +30 -0
  85. package/dist/blocks/index.js.map +1 -0
  86. package/dist/blocks/screenful.cjs +139 -0
  87. package/dist/blocks/screenful.d.ts +18 -0
  88. package/dist/blocks/screenful.d.ts.map +1 -0
  89. package/dist/blocks/screenful.js +103 -0
  90. package/dist/blocks/screenful.js.map +1 -0
  91. package/dist/blocks/space.cjs +38 -0
  92. package/dist/blocks/space.d.ts +4 -0
  93. package/dist/blocks/space.d.ts.map +1 -0
  94. package/dist/blocks/space.js +35 -0
  95. package/dist/blocks/space.js.map +1 -0
  96. package/dist/blocks/spec.cjs +58 -0
  97. package/dist/blocks/spec.d.ts +60 -0
  98. package/dist/blocks/spec.d.ts.map +1 -0
  99. package/dist/blocks/spec.js +52 -0
  100. package/dist/blocks/spec.js.map +1 -0
  101. package/dist/blocks/video.cjs +103 -0
  102. package/dist/blocks/video.d.ts +22 -0
  103. package/dist/blocks/video.d.ts.map +1 -0
  104. package/dist/blocks/video.js +67 -0
  105. package/dist/blocks/video.js.map +1 -0
  106. package/dist/gallery.html +102 -1
  107. package/dist/index.cjs +9 -2
  108. package/dist/index.d.ts +1 -1
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +1 -1
  111. package/dist/index.js.map +1 -1
  112. package/dist/index.node.js +1 -1
  113. package/dist/primitives/ApplyTypography.cjs +8 -0
  114. package/dist/primitives/ApplyTypography.d.ts +2 -0
  115. package/dist/primitives/ApplyTypography.d.ts.map +1 -0
  116. package/dist/primitives/ApplyTypography.js +5 -0
  117. package/dist/primitives/ApplyTypography.js.map +1 -0
  118. package/dist/primitives/Link.cjs +8 -0
  119. package/dist/primitives/Link.d.ts +2 -0
  120. package/dist/primitives/Link.d.ts.map +1 -0
  121. package/dist/primitives/Link.js +5 -0
  122. package/dist/primitives/Link.js.map +1 -0
  123. package/dist/primitives/LinkElement.cjs +8 -0
  124. package/dist/primitives/LinkElement.d.ts +2 -0
  125. package/dist/primitives/LinkElement.d.ts.map +1 -0
  126. package/dist/primitives/LinkElement.js +5 -0
  127. package/dist/primitives/LinkElement.js.map +1 -0
  128. package/dist/primitives/MDXLink.cjs +8 -0
  129. package/dist/primitives/MDXLink.d.ts +2 -0
  130. package/dist/primitives/MDXLink.d.ts.map +1 -0
  131. package/dist/primitives/MDXLink.js +5 -0
  132. package/dist/primitives/MDXLink.js.map +1 -0
  133. package/dist/primitives/VideoPlayer.cjs +8 -0
  134. package/dist/primitives/VideoPlayer.d.ts +2 -0
  135. package/dist/primitives/VideoPlayer.d.ts.map +1 -0
  136. package/dist/primitives/VideoPlayer.js +5 -0
  137. package/dist/primitives/VideoPlayer.js.map +1 -0
  138. package/dist/primitives/YouTubeEmbed.cjs +8 -0
  139. package/dist/primitives/YouTubeEmbed.d.ts +2 -0
  140. package/dist/primitives/YouTubeEmbed.d.ts.map +1 -0
  141. package/dist/primitives/YouTubeEmbed.js +5 -0
  142. package/dist/primitives/YouTubeEmbed.js.map +1 -0
  143. package/dist/primitives/useLink.cjs +8 -0
  144. package/dist/primitives/useLink.d.ts +2 -0
  145. package/dist/primitives/useLink.d.ts.map +1 -0
  146. package/dist/primitives/useLink.js +5 -0
  147. package/dist/primitives/useLink.js.map +1 -0
  148. package/dist/product/menu/items.d.ts +1 -1
  149. package/dist/product/menu/items.d.ts.map +1 -1
  150. package/dist/styles.css +101 -0
  151. package/dist/theme.css +101 -0
  152. package/dist/tw.cjs +62 -1
  153. package/dist/tw.d.ts.map +1 -1
  154. package/dist/tw.js +62 -1
  155. package/dist/tw.js.map +1 -1
  156. package/dist/types.cjs +32 -0
  157. package/dist/types.d.ts +136 -0
  158. package/dist/types.d.ts.map +1 -0
  159. package/dist/types.js +30 -0
  160. package/dist/types.js.map +1 -0
  161. package/package.json +13 -1
@@ -0,0 +1,53 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * Video.
5
+ *
6
+ * `VideoPlayer` is a `<video>` that takes its sources as an array, because a
7
+ * block describes them that way and every caller was otherwise writing the same
8
+ * `<source>` map.
9
+ *
10
+ * `YouTubeEmbed` shows the poster first and mounts the iframe on click. That is
11
+ * not a nicety: an embed loads ~1MB and sets cookies on sight, so a page with
12
+ * several of them pays for all of them before anyone watches one. The
13
+ * `-nocookie` host is the same trade — YouTube's own domain for embeds that
14
+ * defers its cookie until playback starts.
15
+ */
16
+ import * as React from 'react';
17
+ export const VideoPlayer = React.forwardRef(({ sources, ...rest }, ref) => (_jsx("video", { ref: ref, ...rest, children: sources.map((src, i) => (_jsx("source", { src: src }, i))) })));
18
+ VideoPlayer.displayName = 'VideoPlayer';
19
+ /** YouTube's own play mark, drawn rather than imported so this pulls no icon set. */
20
+ const Play = ({ size }) => (_jsxs("svg", { width: size, height: size * 0.7, viewBox: "0 0 68 48", role: "img", "aria-hidden": true, style: { transition: 'transform .15s ease' }, children: [_jsx("path", { d: "M66.5 7.7a8.6 8.6 0 0 0-6-6C55.2 0 34 0 34 0S12.8 0 7.5 1.6a8.6 8.6 0 0 0-6 6A89.7 89.7 0 0 0 0 24a89.7 89.7 0 0 0 1.5 16.3 8.6 8.6 0 0 0 6 6C12.8 48 34 48 34 48s21.2 0 26.5-1.6a8.6 8.6 0 0 0 6-6A89.7 89.7 0 0 0 68 24a89.7 89.7 0 0 0-1.5-16.3z", fill: "#f00" }), _jsx("path", { d: "M27 34V14l18 10-18 10z", fill: "#fff" })] }));
21
+ export const YouTubeEmbed = ({ youtubeID, width, height, buttonSize = 100, timeAt, title, caption, className, }) => {
22
+ const [playing, setPlaying] = React.useState(false);
23
+ if (playing) {
24
+ // autoplay is honoured because the iframe mounts inside a click.
25
+ const q = `${timeAt ? `?t=${timeAt}&` : '?'}rel=0&autoplay=1`;
26
+ return (_jsx("div", { className: className, children: _jsx("iframe", { width: width, height: height, src: `https://www.youtube-nocookie.com/embed/${youtubeID}${q}`, allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, title: title || 'YouTube video', style: { aspectRatio: '16 / 9', width: '100%', height: '100%', border: 0, padding: 0 } }) }));
27
+ }
28
+ return (_jsx("div", { className: className, children: _jsxs("button", { type: "button", onClick: () => setPlaying(true), "aria-label": title ? `Play ${title}` : 'Play video', style: {
29
+ position: 'relative',
30
+ aspectRatio: '16 / 9',
31
+ width: '100%',
32
+ padding: 0,
33
+ border: 0,
34
+ background: 'transparent',
35
+ cursor: 'pointer',
36
+ }, children: [_jsx("img", { src: `https://img.youtube.com/vi/${youtubeID}/maxresdefault.jpg`, alt: "", width: width, height: height, loading: "lazy", style: { width: '100%', height: '100%', objectFit: 'cover' } }), _jsx("span", { style: {
37
+ position: 'absolute',
38
+ left: '50%',
39
+ top: '50%',
40
+ transform: 'translate(-50%, -50%)',
41
+ display: 'grid',
42
+ placeItems: 'center',
43
+ opacity: 0.9,
44
+ }, children: _jsx(Play, { size: buttonSize }) }), caption && (_jsx("p", { className: "hz-prose", style: {
45
+ position: 'absolute',
46
+ left: '50%',
47
+ top: 20,
48
+ transform: 'translateX(-50%)',
49
+ whiteSpace: 'nowrap',
50
+ margin: 0,
51
+ }, children: caption }))] }) }));
52
+ };
53
+ //# sourceMappingURL=video.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video.js","sourceRoot":"","sources":["../../../src/backends/gui/video.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CACzC,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC7B,gBAAO,GAAG,EAAE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EAAE,kBAAkB;wBAC7B,UAAU,EAAE,QAAQ;wBACpB,MAAM,EAAE,CAAC;qBACV,YAEA,OAAO,GACN,CACL,IACM,GACL,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,19 @@
1
+ 'use client';"use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccordianBlockComponent = void 0;
4
+ const react_1 = require("react");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const accordion_1 = require("../backends/gui/accordion.cjs");
7
+ const prose_1 = require("../backends/gui/prose.cjs");
8
+ const box_1 = require("../box.cjs");
9
+ const spec_1 = require("./spec.cjs");
10
+ const AccordianBlockComponent = ({ block, className }) => {
11
+ if (block.blockType !== 'accordian')
12
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "accordian block required" });
13
+ const b = block;
14
+ return ((0, jsx_runtime_1.jsx)(accordion_1.Accordion, { type: "single", collapsible: true, ...(0, spec_1.sx)('w-full border rounded-xl overflow-hidden', className), children: b.items.map((item, i) => ((0, react_1.createElement)(accordion_1.AccordionItem, { ...(0, spec_1.sx)('border-b overflow-hidden'), value: `value-${i}`, key: i },
15
+ (0, jsx_runtime_1.jsx)(accordion_1.AccordionTrigger, { ...(0, spec_1.sx)('px-3 md:px-4 lg:px-6'), children: (0, jsx_runtime_1.jsx)(prose_1.ApplyTypography, { children: (0, jsx_runtime_1.jsx)(box_1.Box, { tag: "h6", className: "text-[1.05rem] font-semibold", children: item.trigger }) }) }),
16
+ (0, jsx_runtime_1.jsx)(accordion_1.AccordionContent, { ...(0, spec_1.sx)('p-4 border-t'), children: (0, jsx_runtime_1.jsx)(prose_1.ApplyTypography, { className: "items-start", children: typeof item.content === 'string' ? (0, jsx_runtime_1.jsx)(box_1.Box, { tag: "p", children: item.content }) : item.content }) })))) }));
17
+ };
18
+ exports.AccordianBlockComponent = AccordianBlockComponent;
19
+ exports.default = exports.AccordianBlockComponent;
@@ -0,0 +1,4 @@
1
+ import { type BlockComponentProps } from './spec.js';
2
+ export declare const AccordianBlockComponent: ({ block, className }: BlockComponentProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default AccordianBlockComponent;
4
+ //# sourceMappingURL=accordian.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordian.d.ts","sourceRoot":"","sources":["../../src/blocks/accordian.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,mBAAmB,EAAM,MAAM,QAAQ,CAAA;AAErD,eAAO,MAAM,uBAAuB,yBAA0B,mBAAmB,4CAgChF,CAAA;eAEc,uBAAuB"}
@@ -0,0 +1,16 @@
1
+ 'use client';import { createElement as _createElement } from "react";
2
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
3
+ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from '../backends/gui/accordion.js';
4
+ import { ApplyTypography } from '../backends/gui/prose.js';
5
+ import { Box } from '../box.js';
6
+ import { sx } from './spec.js';
7
+ export const AccordianBlockComponent = ({ block, className }) => {
8
+ if (block.blockType !== 'accordian')
9
+ return _jsx(_Fragment, { children: "accordian block required" });
10
+ const b = block;
11
+ return (_jsx(Accordion, { type: "single", collapsible: true, ...sx('w-full border rounded-xl overflow-hidden', className), children: b.items.map((item, i) => (_createElement(AccordionItem, { ...sx('border-b overflow-hidden'), value: `value-${i}`, key: i },
12
+ _jsx(AccordionTrigger, { ...sx('px-3 md:px-4 lg:px-6'), children: _jsx(ApplyTypography, { children: _jsx(Box, { tag: "h6", className: "text-[1.05rem] font-semibold", children: item.trigger }) }) }),
13
+ _jsx(AccordionContent, { ...sx('p-4 border-t'), children: _jsx(ApplyTypography, { className: "items-start", children: typeof item.content === 'string' ? _jsx(Box, { tag: "p", children: item.content }) : item.content }) })))) }));
14
+ };
15
+ export default AccordianBlockComponent;
16
+ //# sourceMappingURL=accordian.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordian.js","sourceRoot":"","sources":["../../src/blocks/accordian.tsx"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ACH,CAAC,CAAA;AAED,eAAe,uBAAuB,CAAA"}
@@ -0,0 +1,40 @@
1
+ 'use client';"use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulletCardsBlockComponent = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const box_1 = require("../box.cjs");
6
+ const cn_1 = require("../core/cn.cjs");
7
+ const grid_1 = require("./grid.cjs");
8
+ const spec_1 = require("./spec.cjs");
9
+ /** An icon given as a url is drawn at `size`; given as a node it renders as-is. */
10
+ const Mark = ({ icon, size, phone, className, }) => {
11
+ if (!icon)
12
+ return null;
13
+ if (typeof icon === 'string') {
14
+ const s = phone ? size * 0.75 : size;
15
+ return (0, jsx_runtime_1.jsx)(box_1.Box, { tag: "img", src: icon, width: s, height: s, alt: "", className: className });
16
+ }
17
+ return (0, jsx_runtime_1.jsx)(box_1.Box, { className: className, children: icon });
18
+ };
19
+ /**
20
+ * A grid of one-line cards, each an icon beside its text.
21
+ *
22
+ * Borders arrive at `md` and not before: on a phone the grid is one column, so
23
+ * a border per card would draw a stack of boxes where the eye reads a list.
24
+ */
25
+ const BulletCardsBlockComponent = ({ block, className, agent, }) => {
26
+ if (block.blockType !== 'bullet-cards')
27
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "bullet-cards block required" });
28
+ const b = block;
29
+ const spec = (s) => (0, spec_1.has)(b.specifiers, s);
30
+ const border = spec('no-card-border')
31
+ ? 'border-0'
32
+ : (0, cn_1.cn)('md:border', spec('border-muted-3')
33
+ ? 'md:border-muted-3'
34
+ : spec('border-muted-1')
35
+ ? 'md:border-muted-1'
36
+ : 'md:border-muted-2');
37
+ return ((0, jsx_runtime_1.jsx)(grid_1.GridBlockComponent, { block: { blockType: 'grid', grid: b.grid }, className: className, agent: agent, children: b.cards.map((card, i) => ((0, jsx_runtime_1.jsxs)(box_1.Box, { className: (0, cn_1.cn)('px-0 sm:px-4 py-1 md:py-4 rounded-lg', 'flex flex-row justify-start items-center text-foreground', border), children: [(0, jsx_runtime_1.jsx)(Mark, { icon: card.icon, size: b.iconSize ?? 28, phone: agent === 'phone', className: "shrink-0 mr-2 md:mr-4" }), (0, jsx_runtime_1.jsx)(box_1.Box, { tag: "p", className: (0, cn_1.cn)('m-0 sm:text-base', spec('mobile-small-text') ? 'text-xs' : 'text-sm'), children: card.text })] }, i))) }));
38
+ };
39
+ exports.BulletCardsBlockComponent = BulletCardsBlockComponent;
40
+ exports.default = exports.BulletCardsBlockComponent;
@@ -0,0 +1,10 @@
1
+ import { type BlockComponentProps } from './spec.js';
2
+ /**
3
+ * A grid of one-line cards, each an icon beside its text.
4
+ *
5
+ * Borders arrive at `md` and not before: on a phone the grid is one column, so
6
+ * a border per card would draw a stack of boxes where the eye reads a list.
7
+ */
8
+ export declare const BulletCardsBlockComponent: ({ block, className, agent, }: BlockComponentProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default BulletCardsBlockComponent;
10
+ //# sourceMappingURL=bullet-cards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bullet-cards.d.ts","sourceRoot":"","sources":["../../src/blocks/bullet-cards.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,mBAAmB,EAAO,MAAM,QAAQ,CAAA;AAsBtD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,iCAInC,mBAAmB,4CA4CrB,CAAA;eAEc,yBAAyB"}
@@ -0,0 +1,37 @@
1
+ 'use client';import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box } from '../box.js';
3
+ import { cn } from '../core/cn.js';
4
+ import { GridBlockComponent } from './grid.js';
5
+ import { has } from './spec.js';
6
+ /** An icon given as a url is drawn at `size`; given as a node it renders as-is. */
7
+ const Mark = ({ icon, size, phone, className, }) => {
8
+ if (!icon)
9
+ return null;
10
+ if (typeof icon === 'string') {
11
+ const s = phone ? size * 0.75 : size;
12
+ return _jsx(Box, { tag: "img", src: icon, width: s, height: s, alt: "", className: className });
13
+ }
14
+ return _jsx(Box, { className: className, children: icon });
15
+ };
16
+ /**
17
+ * A grid of one-line cards, each an icon beside its text.
18
+ *
19
+ * Borders arrive at `md` and not before: on a phone the grid is one column, so
20
+ * a border per card would draw a stack of boxes where the eye reads a list.
21
+ */
22
+ export const BulletCardsBlockComponent = ({ block, className, agent, }) => {
23
+ if (block.blockType !== 'bullet-cards')
24
+ return _jsx(_Fragment, { children: "bullet-cards block required" });
25
+ const b = block;
26
+ const spec = (s) => has(b.specifiers, s);
27
+ const border = spec('no-card-border')
28
+ ? 'border-0'
29
+ : cn('md:border', spec('border-muted-3')
30
+ ? 'md:border-muted-3'
31
+ : spec('border-muted-1')
32
+ ? 'md:border-muted-1'
33
+ : 'md:border-muted-2');
34
+ return (_jsx(GridBlockComponent, { block: { blockType: 'grid', grid: b.grid }, className: className, agent: agent, children: b.cards.map((card, i) => (_jsxs(Box, { className: cn('px-0 sm:px-4 py-1 md:py-4 rounded-lg', 'flex flex-row justify-start items-center text-foreground', border), children: [_jsx(Mark, { icon: card.icon, size: b.iconSize ?? 28, phone: agent === 'phone', className: "shrink-0 mr-2 md:mr-4" }), _jsx(Box, { tag: "p", className: cn('m-0 sm:text-base', spec('mobile-small-text') ? 'text-xs' : 'text-sm'), children: card.text })] }, i))) }));
35
+ };
36
+ export default BulletCardsBlockComponent;
37
+ //# sourceMappingURL=bullet-cards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bullet-cards.js","sourceRoot":"","sources":["../../src/blocks/bullet-cards.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAA;AAC3C,OAAO,EAA4B,GAAG,EAAE,MAAM,QAAQ,CAAA;AAEtD,mFAAmF;AACnF,MAAM,IAAI,GAAG,CAAC,EACZ,IAA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C,CAAC,IAAI,EAAE,EAC1C,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,YAEX,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACxB,MAAC,GAAG,IAEF,SAAS,EAAE,EAAE,CACX,sCAAsC,EACtC,0DAA0D,EAC1D,MAAM,CACP,aAED,KAAC,IAAI,IACH,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,CAAC,CAAC,QAAQ,IAAI,EAAE,EACtB,KAAK,EAAE,KAAK,KAAK,OAAO,EACxB,SAAS,EAAC,uBAAuB,GACjC,EACF,KAAC,GAAG,IAAC,GAAG,EAAC,GAAG,EAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,YAC9F,IAAI,CAAC,IAAI,GACN,KAfD,CAAC,CAgBF,CACP,CAAC,GACiB,CACtB,CAAA;AACH,CAAC,CAAA;AAED,eAAe,yBAAyB,CAAA"}
@@ -0,0 +1,58 @@
1
+ 'use client';"use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CardBlockComponent = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const card_1 = require("../backends/gui/card.cjs");
6
+ const card_2 = require("../backends/gui/card.cjs");
7
+ const link_1 = require("../backends/gui/link.cjs");
8
+ const prose_1 = require("../backends/gui/prose.cjs");
9
+ const box_1 = require("../box.cjs");
10
+ const cn_1 = require("../core/cn.cjs");
11
+ const cta_1 = require("./cta.cjs");
12
+ const image_1 = require("./image.cjs");
13
+ const video_1 = require("./video.cjs");
14
+ const spec_1 = require("./spec.cjs");
15
+ const SIZES = ['responsive', 'sm', 'base', 'lg', 'xl'];
16
+ /** `typography-lg` in the specifier bag picks the prose rung. */
17
+ const rung = (specifiers) => {
18
+ const hint = specifiers?.split(/\s+/).find((t) => t.startsWith('typography-'));
19
+ const last = hint?.split('-').pop();
20
+ return last && SIZES.includes(last) ? last : 'responsive';
21
+ };
22
+ /** A link that reads as a row: label left, an arrow out on the right. */
23
+ const LinkOut = ({ def }) => ((0, jsx_runtime_1.jsx)(link_1.LinkElement, { def: def, style: { justifyContent: 'space-between' }, variant: "link", iconAfter: true, icon: (0, jsx_runtime_1.jsx)("svg", { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", "aria-hidden": true, children: (0, jsx_runtime_1.jsx)("path", { d: "M7 17 17 7M7 7h10v10", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }) }) }));
24
+ /**
25
+ * A card: a heading, some media, some content, and a call to action — any of
26
+ * which may be absent.
27
+ *
28
+ * `ghost` is the variant with everything taken away: no border, no padding, a
29
+ * larger left-aligned title. It reads as content on the page rather than as a
30
+ * card, which is what a card in a grid of prose usually wants to be.
31
+ */
32
+ const CardBlockComponent = ({ block, className, contentClassName, agent, }) => {
33
+ if (block.blockType !== 'card')
34
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "card block required" });
35
+ const card = block;
36
+ const spec = (s) => (0, spec_1.has)(card.specifiers, s);
37
+ const ghost = spec('ghost');
38
+ const dim = spec('appear-disabled');
39
+ const hover = spec('reveal-content-on-hover');
40
+ const inline = spec('icon-inline');
41
+ const pad = ghost ? 'px-0 py-0' : 'px-6 py-3';
42
+ const border = dim ? 'border-muted-4' : 'border-muted-3';
43
+ const bg = spec('bg-card') ? 'bg-level-1' : '';
44
+ const place = (0, cn_1.cn)(spec('content-left') ? 'items-start' : 'items-center', spec('content-top') && 'justify-start', contentClassName);
45
+ const Header = ({ inContent = false, className: cls }) => card.title || card.byline || card.icon ? ((0, jsx_runtime_1.jsxs)(card_2.CardHeader, { ...(0, spec_1.sx)((0, cn_1.cn)('text-accent', dim && 'text-muted-2', pad, ghost && 'border-0', cls)), children: [(0, jsx_runtime_1.jsxs)(box_1.Box, { className: inline || inContent ? 'flex flex-row justify-start items-end my-3' : '', children: [card.icon && !card.iconAfter && ((0, jsx_runtime_1.jsx)(box_1.Box, { className: inline ? 'mr-1' : 'mb-2', children: card.icon })), card.title && ((0, jsx_runtime_1.jsx)(card_2.CardTitle, { ...(0, spec_1.sx)((0, cn_1.cn)('text-center text-lg font-medium', spec('heading-style-title') && 'font-heading text-base leading-tight', ghost && 'text-left md:text-xl', inline && 'md:text-xl')), children: card.title })), card.icon && card.iconAfter && ((0, jsx_runtime_1.jsx)(box_1.Box, { className: inline ? 'ml-1' : 'my-1', children: card.icon }))] }), card.byline && (0, jsx_runtime_1.jsx)(card_2.CardDescription, { children: card.byline })] })) : null;
46
+ const prose = (content) => typeof content === 'string' ? (0, jsx_runtime_1.jsx)(box_1.Box, { tag: "p", children: content }) : content;
47
+ const Body = ({ className: cls }) => spec('media-left') ? ((0, jsx_runtime_1.jsxs)(card_2.CardContent, { ...(0, spec_1.sx)((0, cn_1.cn)('flex flex-row justify-start items-stretch p-0 grow', border, bg, place, cls)), children: [card.media && ((0, jsx_runtime_1.jsx)(box_1.Box, { className: (0, cn_1.cn)('box-content grow-0', pad),
48
+ // This layout assumes the media is a video with an `sm` size — it
49
+ // is the width that decides the split, so it has to be known here.
50
+ style: { width: card.media.dim?.sm?.w }, children: (0, jsx_runtime_1.jsx)(video_1.VideoBlockComponent, { block: card.media, usePoster: spec('video-use-poster'), size: "sm", agent: agent, className: dim ? 'opacity-60' : '' }) })), card.content && ((0, jsx_runtime_1.jsx)(prose_1.ApplyTypography, { className: (0, cn_1.cn)('grow border-l flex flex-col justify-center', pad, border, place), size: rung(card.specifiers), children: prose(card.content) }))] })) : ((0, jsx_runtime_1.jsxs)(card_2.CardContent, { ...(0, spec_1.sx)((0, cn_1.cn)('grow flex flex-col justify-center', bg, pad, place, spec('full-width') && 'p-0', cls)), children: [hover && (0, jsx_runtime_1.jsx)(Header, { inContent: true }), card.content && spec('content-before') && prose(card.content), card.media &&
51
+ (card.media.blockType === 'image' ? ((0, jsx_runtime_1.jsx)(image_1.ImageBlockComponent, { block: card.media, agent: agent })) : ((0, jsx_runtime_1.jsx)(video_1.VideoBlockComponent, { block: card.media, agent: agent }))), card.content && !spec('content-before') && prose(card.content)] }));
52
+ const Foot = () => !card.cta ? null : spec('links-w-arrow') ? ((0, jsx_runtime_1.jsx)(card_2.CardFooter, { ...(0, spec_1.sx)((0, cn_1.cn)('flex flex-col justify-start items-stretch', pad)), children: (0, jsx_runtime_1.jsx)(cta_1.CTABlockComponent, { block: card.cta, agent: agent, renderLink: (def, key) => (0, jsx_runtime_1.jsx)(LinkOut, { def: def }, key) }) })) : ((0, jsx_runtime_1.jsx)(card_2.CardFooter, { ...(0, spec_1.sx)((0, cn_1.cn)('grid grid-cols-1 gap-2 md:flex md:flex-row md:justify-center', pad)), children: (0, jsx_runtime_1.jsx)(cta_1.CTABlockComponent, { block: card.cta, agent: agent }) }));
53
+ return ((0, jsx_runtime_1.jsxs)(card_1.Card, { ...(0, spec_1.sx)((0, cn_1.cn)('flex flex-col self-stretch', hover && 'group relative', border, (spec('no-outer-border') || ghost) && 'border-0', bg, ghost && 'gap-2', className)), children: [(0, jsx_runtime_1.jsx)(Header, { className: hover ? 'absolute top-0 left-0 w-full hidden' : '' }), (0, jsx_runtime_1.jsx)(Body, { className: hover
54
+ ? 'items-start justify-start rounded-lg p-4 transition-opacity duration-500 ease-out opacity-100'
55
+ : '' }), (0, jsx_runtime_1.jsx)(Foot, {})] }));
56
+ };
57
+ exports.CardBlockComponent = CardBlockComponent;
58
+ exports.default = exports.CardBlockComponent;
@@ -0,0 +1,14 @@
1
+ import { type BlockComponentProps } from './spec.js';
2
+ /**
3
+ * A card: a heading, some media, some content, and a call to action — any of
4
+ * which may be absent.
5
+ *
6
+ * `ghost` is the variant with everything taken away: no border, no padding, a
7
+ * larger left-aligned title. It reads as content on the page rather than as a
8
+ * card, which is what a card in a grid of prose usually wants to be.
9
+ */
10
+ export declare const CardBlockComponent: ({ block, className, contentClassName, agent, }: BlockComponentProps & {
11
+ contentClassName?: string;
12
+ }) => import("react/jsx-runtime").JSX.Element;
13
+ export default CardBlockComponent;
14
+ //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/blocks/card.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,mBAAmB,EAAW,MAAM,QAAQ,CAAA;AAgC1D;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,mDAK5B,mBAAmB,GAAG;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,4CA4IrD,CAAA;eAEc,kBAAkB"}
@@ -0,0 +1,55 @@
1
+ 'use client';import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Card } from '../backends/gui/card.js';
3
+ import { CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from '../backends/gui/card.js';
4
+ import { LinkElement } from '../backends/gui/link.js';
5
+ import { ApplyTypography } from '../backends/gui/prose.js';
6
+ import { Box } from '../box.js';
7
+ import { cn } from '../core/cn.js';
8
+ import { CTABlockComponent } from './cta.js';
9
+ import { ImageBlockComponent } from './image.js';
10
+ import { VideoBlockComponent } from './video.js';
11
+ import { has, sx } from './spec.js';
12
+ const SIZES = ['responsive', 'sm', 'base', 'lg', 'xl'];
13
+ /** `typography-lg` in the specifier bag picks the prose rung. */
14
+ const rung = (specifiers) => {
15
+ const hint = specifiers?.split(/\s+/).find((t) => t.startsWith('typography-'));
16
+ const last = hint?.split('-').pop();
17
+ return last && SIZES.includes(last) ? last : 'responsive';
18
+ };
19
+ /** A link that reads as a row: label left, an arrow out on the right. */
20
+ const LinkOut = ({ def }) => (_jsx(LinkElement, { def: def, style: { justifyContent: 'space-between' }, variant: "link", iconAfter: true, icon: _jsx("svg", { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", "aria-hidden": true, children: _jsx("path", { d: "M7 17 17 7M7 7h10v10", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }) }) }));
21
+ /**
22
+ * A card: a heading, some media, some content, and a call to action — any of
23
+ * which may be absent.
24
+ *
25
+ * `ghost` is the variant with everything taken away: no border, no padding, a
26
+ * larger left-aligned title. It reads as content on the page rather than as a
27
+ * card, which is what a card in a grid of prose usually wants to be.
28
+ */
29
+ export const CardBlockComponent = ({ block, className, contentClassName, agent, }) => {
30
+ if (block.blockType !== 'card')
31
+ return _jsx(_Fragment, { children: "card block required" });
32
+ const card = block;
33
+ const spec = (s) => has(card.specifiers, s);
34
+ const ghost = spec('ghost');
35
+ const dim = spec('appear-disabled');
36
+ const hover = spec('reveal-content-on-hover');
37
+ const inline = spec('icon-inline');
38
+ const pad = ghost ? 'px-0 py-0' : 'px-6 py-3';
39
+ const border = dim ? 'border-muted-4' : 'border-muted-3';
40
+ const bg = spec('bg-card') ? 'bg-level-1' : '';
41
+ const place = cn(spec('content-left') ? 'items-start' : 'items-center', spec('content-top') && 'justify-start', contentClassName);
42
+ const Header = ({ inContent = false, className: cls }) => card.title || card.byline || card.icon ? (_jsxs(CardHeader, { ...sx(cn('text-accent', dim && 'text-muted-2', pad, ghost && 'border-0', cls)), children: [_jsxs(Box, { className: inline || inContent ? 'flex flex-row justify-start items-end my-3' : '', children: [card.icon && !card.iconAfter && (_jsx(Box, { className: inline ? 'mr-1' : 'mb-2', children: card.icon })), card.title && (_jsx(CardTitle, { ...sx(cn('text-center text-lg font-medium', spec('heading-style-title') && 'font-heading text-base leading-tight', ghost && 'text-left md:text-xl', inline && 'md:text-xl')), children: card.title })), card.icon && card.iconAfter && (_jsx(Box, { className: inline ? 'ml-1' : 'my-1', children: card.icon }))] }), card.byline && _jsx(CardDescription, { children: card.byline })] })) : null;
43
+ const prose = (content) => typeof content === 'string' ? _jsx(Box, { tag: "p", children: content }) : content;
44
+ const Body = ({ className: cls }) => spec('media-left') ? (_jsxs(CardContent, { ...sx(cn('flex flex-row justify-start items-stretch p-0 grow', border, bg, place, cls)), children: [card.media && (_jsx(Box, { className: cn('box-content grow-0', pad),
45
+ // This layout assumes the media is a video with an `sm` size — it
46
+ // is the width that decides the split, so it has to be known here.
47
+ style: { width: card.media.dim?.sm?.w }, children: _jsx(VideoBlockComponent, { block: card.media, usePoster: spec('video-use-poster'), size: "sm", agent: agent, className: dim ? 'opacity-60' : '' }) })), card.content && (_jsx(ApplyTypography, { className: cn('grow border-l flex flex-col justify-center', pad, border, place), size: rung(card.specifiers), children: prose(card.content) }))] })) : (_jsxs(CardContent, { ...sx(cn('grow flex flex-col justify-center', bg, pad, place, spec('full-width') && 'p-0', cls)), children: [hover && _jsx(Header, { inContent: true }), card.content && spec('content-before') && prose(card.content), card.media &&
48
+ (card.media.blockType === 'image' ? (_jsx(ImageBlockComponent, { block: card.media, agent: agent })) : (_jsx(VideoBlockComponent, { block: card.media, agent: agent }))), card.content && !spec('content-before') && prose(card.content)] }));
49
+ const Foot = () => !card.cta ? null : spec('links-w-arrow') ? (_jsx(CardFooter, { ...sx(cn('flex flex-col justify-start items-stretch', pad)), children: _jsx(CTABlockComponent, { block: card.cta, agent: agent, renderLink: (def, key) => _jsx(LinkOut, { def: def }, key) }) })) : (_jsx(CardFooter, { ...sx(cn('grid grid-cols-1 gap-2 md:flex md:flex-row md:justify-center', pad)), children: _jsx(CTABlockComponent, { block: card.cta, agent: agent }) }));
50
+ return (_jsxs(Card, { ...sx(cn('flex flex-col self-stretch', hover && 'group relative', border, (spec('no-outer-border') || ghost) && 'border-0', bg, ghost && 'gap-2', className)), children: [_jsx(Header, { className: hover ? 'absolute top-0 left-0 w-full hidden' : '' }), _jsx(Body, { className: hover
51
+ ? 'items-start justify-start rounded-lg p-4 transition-opacity duration-500 ease-out opacity-100'
52
+ : '' }), _jsx(Foot, {})] }));
53
+ };
54
+ export default CardBlockComponent;
55
+ //# sourceMappingURL=card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.js","sourceRoot":"","s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E,CAAC,8DAA8D,EAAE,GAAG,CAAC,CAAC,YACzF,KAAC,iBAAiB,IAAC,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,GAAI,GACzC,CACd,CAAA;IAEH,OAAO,CACL,MAAC,IAAI,OACC,EAAE,CAAC,EAAE,CACP,4BAA4B,EAC5B,KAAK,IAAI,gBAAgB,EACzB,MAAM,EACN,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,IAAI,UAAU,EAChD,EAAE,EACF,KAAK,IAAI,OAAO,EAChB,SAAS,CACV,CAAC,aAEF,KAAC,MAAM,IAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,qCAAqC,CAAC,CAAC,CAAC,EAAE,GAAI,EACzE,KAAC,IAAI,IACH,SAAS,EACP,KAAK;oBACH,CAAC,CAAC,+FAA+F;oBACjG,CAAC,CAAC,EAAE,GAER,EACF,KAAC,IAAI,KAAG,IACH,CACR,CAAA;AACH,CAAC,CAAA;AAED,eAAe,kBAAkB,CAAA"}
@@ -0,0 +1,38 @@
1
+ 'use client';"use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CarteBlancheBlockComponent = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const card_1 = require("../backends/gui/card.cjs");
6
+ const box_1 = require("../box.cjs");
7
+ const cn_1 = require("../core/cn.cjs");
8
+ const content_1 = require("./content.cjs");
9
+ const cta_1 = require("./cta.cjs");
10
+ const enh_heading_1 = require("./enh-heading.cjs");
11
+ const spec_1 = require("./spec.cjs");
12
+ /** The roomy padding `big-padding` asks for. Default is the card's own. */
13
+ const ROOMY = 'md:p-8 lg:p-12 xl:p-16';
14
+ /**
15
+ * A panel with a free hand: anything above the heading, anything below it, and
16
+ * a call to action at the foot.
17
+ *
18
+ * `variant-content-left` turns the stack on its side — the top content moves
19
+ * beside the heading and body rather than above them — and
20
+ * `variant-mobile-content-left` asks for that on a phone only, which is why the
21
+ * choice is made here rather than in css.
22
+ */
23
+ const CarteBlancheBlockComponent = ({ block, className, agent, }) => {
24
+ if (block.blockType !== 'carte-blanche')
25
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "carte-blanche block required" });
26
+ const b = block;
27
+ const spec = (s) => (0, spec_1.has)(b.specifiers, s);
28
+ const head = (0, cn_1.cn)(spec('big-padding') && ROOMY, spec('no-inner-borders') && 'border-none');
29
+ const body = (0, cn_1.cn)(spec('big-padding-content') && ROOMY);
30
+ const foot = (0, cn_1.cn)(spec('no-inner-borders') && 'border-t-0');
31
+ const Heading = () => b.heading ? ((0, jsx_runtime_1.jsx)(card_1.CardHeader, { ...(0, spec_1.sx)(head), children: (0, jsx_runtime_1.jsx)(enh_heading_1.EnhHeadingBlockComponent, { block: b.heading, className: "text-accent", agent: agent }) })) : null;
32
+ const Body = () => b.content ? ((0, jsx_runtime_1.jsx)(card_1.CardContent, { ...(0, spec_1.sx)((0, cn_1.cn)('flex flex-col justify-center', body, className)), children: (0, jsx_runtime_1.jsx)(content_1.Content, { blocks: b.content, agent: agent }) })) : null;
33
+ const Foot = ({ className: cls }) => b.cta ? ((0, jsx_runtime_1.jsx)(card_1.CardFooter, { ...(0, spec_1.sx)((0, cn_1.cn)('grid grid-cols-1 gap-2 md:flex md:flex-row md:justify-center', foot, cls)), children: (0, jsx_runtime_1.jsx)(cta_1.CTABlockComponent, { block: b.cta, agent: agent }) })) : null;
34
+ const sideways = spec('variant-content-left') || (spec('variant-mobile-content-left') && agent === 'phone');
35
+ return ((0, jsx_runtime_1.jsx)(card_1.Card, { ...(0, spec_1.sx)((0, cn_1.cn)('flex flex-col', className, spec('no-outer-borders') && 'border-none')), children: sideways ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(box_1.Box, { className: "flex gap-2", children: [b.topContent && ((0, jsx_runtime_1.jsx)(content_1.Content, { blocks: b.topContent, agent: agent, className: "self-center ml-6 mt-6" })), (0, jsx_runtime_1.jsxs)(box_1.Box, { className: "flex flex-col", children: [(0, jsx_runtime_1.jsx)(Heading, {}), b.content && ((0, jsx_runtime_1.jsx)(card_1.CardContent, { ...(0, spec_1.sx)((0, cn_1.cn)('flex flex-col justify-start', body, className)), children: (0, jsx_runtime_1.jsx)(content_1.Content, { blocks: b.content, agent: agent }) }))] })] }), (0, jsx_runtime_1.jsx)(Foot, { className: "mx-auto" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(b.heading || b.topContent) && ((0, jsx_runtime_1.jsxs)(card_1.CardHeader, { ...(0, spec_1.sx)(head), children: [b.topContent && (0, jsx_runtime_1.jsx)(content_1.Content, { blocks: b.topContent, agent: agent }), b.heading && ((0, jsx_runtime_1.jsx)(enh_heading_1.EnhHeadingBlockComponent, { block: b.heading, className: "text-accent", agent: agent }))] })), (0, jsx_runtime_1.jsx)(Body, {}), (0, jsx_runtime_1.jsx)(Foot, {})] })) }));
36
+ };
37
+ exports.CarteBlancheBlockComponent = CarteBlancheBlockComponent;
38
+ exports.default = exports.CarteBlancheBlockComponent;
@@ -0,0 +1,13 @@
1
+ import { type BlockComponentProps } from './spec.js';
2
+ /**
3
+ * A panel with a free hand: anything above the heading, anything below it, and
4
+ * a call to action at the foot.
5
+ *
6
+ * `variant-content-left` turns the stack on its side — the top content moves
7
+ * beside the heading and body rather than above them — and
8
+ * `variant-mobile-content-left` asks for that on a phone only, which is why the
9
+ * choice is made here rather than in css.
10
+ */
11
+ export declare const CarteBlancheBlockComponent: ({ block, className, agent, }: BlockComponentProps) => import("react/jsx-runtime").JSX.Element;
12
+ export default CarteBlancheBlockComponent;
13
+ //# sourceMappingURL=carte-blanche.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carte-blanche.d.ts","sourceRoot":"","sources":["../../src/blocks/carte-blanche.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,mBAAmB,EAAW,MAAM,QAAQ,CAAA;AAK1D;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,iCAIpC,mBAAmB,4CAqErB,CAAA;eAEc,0BAA0B"}
@@ -0,0 +1,35 @@
1
+ 'use client';import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Card, CardContent, CardFooter, CardHeader } from '../backends/gui/card.js';
3
+ import { Box } from '../box.js';
4
+ import { cn } from '../core/cn.js';
5
+ import { Content } from './content.js';
6
+ import { CTABlockComponent } from './cta.js';
7
+ import { EnhHeadingBlockComponent } from './enh-heading.js';
8
+ import { has, sx } from './spec.js';
9
+ /** The roomy padding `big-padding` asks for. Default is the card's own. */
10
+ const ROOMY = 'md:p-8 lg:p-12 xl:p-16';
11
+ /**
12
+ * A panel with a free hand: anything above the heading, anything below it, and
13
+ * a call to action at the foot.
14
+ *
15
+ * `variant-content-left` turns the stack on its side — the top content moves
16
+ * beside the heading and body rather than above them — and
17
+ * `variant-mobile-content-left` asks for that on a phone only, which is why the
18
+ * choice is made here rather than in css.
19
+ */
20
+ export const CarteBlancheBlockComponent = ({ block, className, agent, }) => {
21
+ if (block.blockType !== 'carte-blanche')
22
+ return _jsx(_Fragment, { children: "carte-blanche block required" });
23
+ const b = block;
24
+ const spec = (s) => has(b.specifiers, s);
25
+ const head = cn(spec('big-padding') && ROOMY, spec('no-inner-borders') && 'border-none');
26
+ const body = cn(spec('big-padding-content') && ROOMY);
27
+ const foot = cn(spec('no-inner-borders') && 'border-t-0');
28
+ const Heading = () => b.heading ? (_jsx(CardHeader, { ...sx(head), children: _jsx(EnhHeadingBlockComponent, { block: b.heading, className: "text-accent", agent: agent }) })) : null;
29
+ const Body = () => b.content ? (_jsx(CardContent, { ...sx(cn('flex flex-col justify-center', body, className)), children: _jsx(Content, { blocks: b.content, agent: agent }) })) : null;
30
+ const Foot = ({ className: cls }) => b.cta ? (_jsx(CardFooter, { ...sx(cn('grid grid-cols-1 gap-2 md:flex md:flex-row md:justify-center', foot, cls)), children: _jsx(CTABlockComponent, { block: b.cta, agent: agent }) })) : null;
31
+ const sideways = spec('variant-content-left') || (spec('variant-mobile-content-left') && agent === 'phone');
32
+ return (_jsx(Card, { ...sx(cn('flex flex-col', className, spec('no-outer-borders') && 'border-none')), children: sideways ? (_jsxs(_Fragment, { children: [_jsxs(Box, { className: "flex gap-2", children: [b.topContent && (_jsx(Content, { blocks: b.topContent, agent: agent, className: "self-center ml-6 mt-6" })), _jsxs(Box, { className: "flex flex-col", children: [_jsx(Heading, {}), b.content && (_jsx(CardContent, { ...sx(cn('flex flex-col justify-start', body, className)), children: _jsx(Content, { blocks: b.content, agent: agent }) }))] })] }), _jsx(Foot, { className: "mx-auto" })] })) : (_jsxs(_Fragment, { children: [(b.heading || b.topContent) && (_jsxs(CardHeader, { ...sx(head), children: [b.topContent && _jsx(Content, { blocks: b.topContent, agent: agent }), b.heading && (_jsx(EnhHeadingBlockComponent, { block: b.heading, className: "text-accent", agent: agent }))] })), _jsx(Body, {}), _jsx(Foot, {})] })) }));
33
+ };
34
+ export default CarteBlancheBlockComponent;
35
+ //# sourceMappingURL=carte-blanche.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carte-blanche.js","sourceRoot":"","sources":["../../src/blocks/carte-blanche.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAChF,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAE/B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAA4B,GAAG,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE1D,2EAA2E;AAC3E,MAAM,KAAK,GAAG,wBA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,CAAC,IAAI,CAC9B,MAAC,UAAU,OAAK,EAAE,CAAC,IAAI,CAAC,aACrB,CAAC,CAAC,UAAU,IAAI,KAAC,OAAO,IAAC,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,GAAI,EAC/D,CAAC,CAAC,OAAO,IAAI,CACZ,KAAC,wBAAwB,IAAC,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,EAAC,aAAa,EAAC,KAAK,EAAE,KAAK,GAAI,CACrF,IACU,CACd,EACD,KAAC,IAAI,KAAG,EACR,KAAC,IAAI,KAAG,IACP,CACJ,GACI,CACR,CAAA;AACH,CAAC,CAAA;AAED,eAAe,0BAA0B,CAAA"}
@@ -0,0 +1,65 @@
1
+ 'use client';"use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Content = exports.registerBlockType = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const accordian_1 = require("./accordian.cjs");
6
+ const bullet_cards_1 = require("./bullet-cards.cjs");
7
+ const card_1 = require("./card.cjs");
8
+ const carte_blanche_1 = require("./carte-blanche.cjs");
9
+ const cta_1 = require("./cta.cjs");
10
+ const enh_heading_1 = require("./enh-heading.cjs");
11
+ const grid_1 = require("./grid.cjs");
12
+ const group_1 = require("./group.cjs");
13
+ const heading_1 = require("./heading.cjs");
14
+ const image_1 = require("./image.cjs");
15
+ const space_1 = require("./space.cjs");
16
+ const video_1 = require("./video.cjs");
17
+ /**
18
+ * `blockType` → renderer.
19
+ *
20
+ * A Map rather than a switch because it is also the extension point: a host
21
+ * calls `registerBlockType` to add a type of its own, or to replace one of
22
+ * these — which is how a Next app substitutes its optimizing image, and how
23
+ * anything the library does not ship reaches the page.
24
+ */
25
+ const map = new Map([
26
+ ['accordian', accordian_1.AccordianBlockComponent],
27
+ ['bullet-cards', bullet_cards_1.BulletCardsBlockComponent],
28
+ ['card', card_1.CardBlockComponent],
29
+ ['carte-blanche', carte_blanche_1.CarteBlancheBlockComponent],
30
+ ['cta', cta_1.CTABlockComponent],
31
+ ['enh-heading', enh_heading_1.EnhHeadingBlockComponent],
32
+ ['grid', grid_1.GridBlockComponent],
33
+ ['group', group_1.GroupBlockComponent],
34
+ ['heading', heading_1.HeadingBlockComponent],
35
+ ['image', image_1.ImageBlockComponent],
36
+ ['space', space_1.SpaceBlockComponent],
37
+ ['video', video_1.VideoBlockComponent],
38
+ ]);
39
+ const registerBlockType = (key, type) => {
40
+ map.set(key, type);
41
+ };
42
+ exports.registerBlockType = registerBlockType;
43
+ /**
44
+ * `element` is the one type with no renderer, by design: it carries a node the
45
+ * author already built, so rendering it means handing it back. That is what
46
+ * makes a page of blocks able to hold anything at all.
47
+ */
48
+ const one = (block, className, agent, key) => {
49
+ if (block.blockType === 'element')
50
+ return block.element;
51
+ const Comp = map.get(block.blockType);
52
+ if (!Comp)
53
+ return null;
54
+ return (0, jsx_runtime_1.jsx)(Comp, { block: block, className: className, agent: agent }, key);
55
+ };
56
+ const Content = ({ blocks, className, agent, }) => {
57
+ if (!blocks)
58
+ return null;
59
+ if (Array.isArray(blocks)) {
60
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: blocks.map((b, i) => one(b, className, agent, `${b.blockType}-${i}`)) }));
61
+ }
62
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: one(blocks, className, agent) });
63
+ };
64
+ exports.Content = Content;
65
+ exports.default = exports.Content;
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import type { Block } from './def.js';
3
+ import type { BlockComponentProps } from './spec.js';
4
+ export declare const registerBlockType: (key: string, type: React.ComponentType<BlockComponentProps>) => void;
5
+ export declare const Content: ({ blocks, className, agent, }: {
6
+ blocks: Block | Block[] | undefined;
7
+ className?: string;
8
+ agent?: string;
9
+ }) => import("react/jsx-runtime").JSX.Element | null;
10
+ export default Content;
11
+ //# sourceMappingURL=content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/blocks/content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,KAAK,EAAgB,MAAM,OAAO,CAAA;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAsCjD,eAAO,MAAM,iBAAiB,QACvB,MAAM,QACL,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,KAC7C,IAEF,CAAA;AAcD,eAAO,MAAM,OAAO,kCAIjB;IACD,MAAM,EAAE,KAAK,GAAG,KAAK,EAAE,GAAG,SAAS,CAAA;IACnC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,mDAUA,CAAA;eAEc,OAAO"}