@sinnstack/ui 0.0.0-stage → 0.3.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 (306) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/LICENSE +373 -0
  3. package/README.md +188 -2
  4. package/docs/blocks.md +373 -0
  5. package/docs/data.md +128 -0
  6. package/docs/finishes.md +165 -0
  7. package/docs/motion.md +166 -0
  8. package/docs/primitives.md +510 -0
  9. package/docs/seo.md +191 -0
  10. package/docs/tokens.md +122 -0
  11. package/package.json +132 -3
  12. package/scripts/check-contrast.mjs +180 -0
  13. package/src/blocks/BlockRenderer.astro +60 -0
  14. package/src/blocks/CTABanner.astro +121 -0
  15. package/src/blocks/CTAPair.astro +110 -0
  16. package/src/blocks/CardGrid.astro +167 -0
  17. package/src/blocks/ConsentEmbed.astro +125 -0
  18. package/src/blocks/ConsentManager.astro +147 -0
  19. package/src/blocks/ConsentScript.astro +47 -0
  20. package/src/blocks/ContactCard.astro +164 -0
  21. package/src/blocks/ContactForm.astro +224 -0
  22. package/src/blocks/ErrorPage.astro +242 -0
  23. package/src/blocks/FAQ.astro +135 -0
  24. package/src/blocks/FeatureGrid.astro +148 -0
  25. package/src/blocks/Hero.astro +171 -0
  26. package/src/blocks/HeroCarousel.astro +220 -0
  27. package/src/blocks/HighlightCards.astro +107 -0
  28. package/src/blocks/LocationHours.astro +311 -0
  29. package/src/blocks/LogoCloud.astro +135 -0
  30. package/src/blocks/MaintenancePage.astro +173 -0
  31. package/src/blocks/MediaText.astro +177 -0
  32. package/src/blocks/PageHeader.astro +126 -0
  33. package/src/blocks/ProseSection.astro +98 -0
  34. package/src/blocks/Reviews.astro +194 -0
  35. package/src/blocks/RichText.astro +58 -0
  36. package/src/blocks/StatsBand.astro +117 -0
  37. package/src/blocks/Steps.astro +141 -0
  38. package/src/blocks/Testimonials.astro +144 -0
  39. package/src/blocks/Topbar.astro +158 -0
  40. package/src/blocks/cms/card-grid.ts +48 -0
  41. package/src/blocks/cms/consent.ts +16 -0
  42. package/src/blocks/cms/contact-card.ts +46 -0
  43. package/src/blocks/cms/contact-form.ts +37 -0
  44. package/src/blocks/cms/cta-banner.ts +27 -0
  45. package/src/blocks/cms/cta-pair.ts +30 -0
  46. package/src/blocks/cms/data-base.ts +5 -0
  47. package/src/blocks/cms/data.ts +257 -0
  48. package/src/blocks/cms/faq.ts +38 -0
  49. package/src/blocks/cms/feature-grid.ts +47 -0
  50. package/src/blocks/cms/fixtures.ts +591 -0
  51. package/src/blocks/cms/hero-carousel.ts +36 -0
  52. package/src/blocks/cms/hero.ts +33 -0
  53. package/src/blocks/cms/highlight-cards.ts +41 -0
  54. package/src/blocks/cms/images.ts +37 -0
  55. package/src/blocks/cms/index.ts +59 -0
  56. package/src/blocks/cms/location-hours.ts +67 -0
  57. package/src/blocks/cms/logo-cloud.ts +36 -0
  58. package/src/blocks/cms/media-text.ts +26 -0
  59. package/src/blocks/cms/page-header.ts +27 -0
  60. package/src/blocks/cms/pages.ts +35 -0
  61. package/src/blocks/cms/prose-section.ts +25 -0
  62. package/src/blocks/cms/reviews.ts +50 -0
  63. package/src/blocks/cms/schema-dsl.ts +134 -0
  64. package/src/blocks/cms/schema.ts +794 -0
  65. package/src/blocks/cms/shared.ts +63 -0
  66. package/src/blocks/cms/stats-band.ts +35 -0
  67. package/src/blocks/cms/steps.ts +40 -0
  68. package/src/blocks/cms/testimonials.ts +46 -0
  69. package/src/blocks/cms/topbar.ts +27 -0
  70. package/src/blocks/cms/types.ts +27 -0
  71. package/src/blocks/consent.ts +14 -0
  72. package/src/blocks/icons.ts +47 -0
  73. package/src/blocks/index.ts +42 -0
  74. package/src/blocks/internal/Actions.astro +35 -0
  75. package/src/blocks/internal/BlockHeader.astro +45 -0
  76. package/src/blocks/internal/BlockShell.astro +58 -0
  77. package/src/blocks/internal/CarouselScript.astro +7 -0
  78. package/src/blocks/internal/ConsentEmbedScript.astro +7 -0
  79. package/src/blocks/internal/ConsentManagerScript.astro +7 -0
  80. package/src/blocks/internal/HoursScript.astro +7 -0
  81. package/src/blocks/internal/Placeholder.astro +13 -0
  82. package/src/blocks/internal/RichTextNode.astro +133 -0
  83. package/src/blocks/internal/StandaloneDocument.astro +53 -0
  84. package/src/blocks/internal/consent.ts +96 -0
  85. package/src/blocks/internal/fields.ts +18 -0
  86. package/src/blocks/internal/registry-contract.ts +67 -0
  87. package/src/blocks/internal/reviews.ts +22 -0
  88. package/src/blocks/internal/slug.ts +12 -0
  89. package/src/blocks/internal/util.ts +23 -0
  90. package/src/blocks/lib/contact.ts +92 -0
  91. package/src/blocks/lib/error-pages.ts +119 -0
  92. package/src/blocks/lib/faq.ts +37 -0
  93. package/src/blocks/lib/hours.ts +201 -0
  94. package/src/blocks/lib/maintenance.ts +129 -0
  95. package/src/blocks/lib/markdown.ts +350 -0
  96. package/src/blocks/lib/rich-text.ts +132 -0
  97. package/src/blocks/registry.ts +79 -0
  98. package/src/blocks/scripts/carousel.ts +218 -0
  99. package/src/blocks/scripts/consent-embed.ts +105 -0
  100. package/src/blocks/scripts/consent-manager.ts +112 -0
  101. package/src/blocks/scripts/consent-store.ts +86 -0
  102. package/src/blocks/scripts/error-page.ts +71 -0
  103. package/src/blocks/scripts/hours.ts +107 -0
  104. package/src/blocks/scripts/maintenance.ts +109 -0
  105. package/src/blocks/styles/blocks.css +1320 -0
  106. package/src/blocks/styles/consent.css +102 -0
  107. package/src/blocks/styles/faq.css +28 -0
  108. package/src/blocks/styles/location.css +92 -0
  109. package/src/blocks/styles/prose-section.css +13 -0
  110. package/src/blocks/styles/quotes.css +123 -0
  111. package/src/blocks/styles/rich-text.css +14 -0
  112. package/src/blocks/types.ts +293 -0
  113. package/src/data/ChartAxis.astro +19 -0
  114. package/src/data/ChartContainer.astro +152 -0
  115. package/src/data/ChartLegend.astro +25 -0
  116. package/src/data/ChartSeries.astro +14 -0
  117. package/src/data/ChartTable.astro +17 -0
  118. package/src/data/ChartTooltip.astro +20 -0
  119. package/src/data/Sparkline.astro +55 -0
  120. package/src/data/cms.ts +130 -0
  121. package/src/data/index.ts +10 -0
  122. package/src/data/internal/scale.ts +107 -0
  123. package/src/data/lib/chart.ts +459 -0
  124. package/src/data/lib/render.ts +219 -0
  125. package/src/data/lib/sparkline.ts +117 -0
  126. package/src/data/schema.ts +65 -0
  127. package/src/data/scripts/chart.ts +324 -0
  128. package/src/data/styles/chart.css +392 -0
  129. package/src/finishes/aurora.css +75 -0
  130. package/src/finishes/autumn.css +87 -0
  131. package/src/finishes/blueprint.css +69 -0
  132. package/src/finishes/brutalist.css +55 -0
  133. package/src/finishes/clay.css +48 -0
  134. package/src/finishes/day-cycle.css +46 -0
  135. package/src/finishes/fog.css +71 -0
  136. package/src/finishes/glass.css +149 -0
  137. package/src/finishes/holographic.css +91 -0
  138. package/src/finishes/night.css +77 -0
  139. package/src/finishes/paper.css +58 -0
  140. package/src/finishes/polished-glass.css +159 -0
  141. package/src/finishes/rain.css +84 -0
  142. package/src/finishes/scripts/day-cycle.ts +30 -0
  143. package/src/finishes/scripts/holographic.ts +37 -0
  144. package/src/finishes/scripts/spotlight.ts +30 -0
  145. package/src/finishes/spotlight.css +41 -0
  146. package/src/finishes/spring.css +80 -0
  147. package/src/finishes/terminal.css +49 -0
  148. package/src/motion/Marquee.astro +90 -0
  149. package/src/motion/MotionProvider.astro +50 -0
  150. package/src/motion/PageTransitions.astro +61 -0
  151. package/src/motion/Parallax.astro +44 -0
  152. package/src/motion/ParallaxLayer.astro +31 -0
  153. package/src/motion/RevealOnScroll.astro +59 -0
  154. package/src/motion/SceneRegistry.astro +38 -0
  155. package/src/motion/ScrollScene.astro +81 -0
  156. package/src/motion/index.ts +12 -0
  157. package/src/motion/integration.ts +48 -0
  158. package/src/motion/runtime/page-transitions.ts +68 -0
  159. package/src/motion/runtime/runtime.ts +180 -0
  160. package/src/motion/runtime/scenes.ts +248 -0
  161. package/src/motion/runtime/types.ts +103 -0
  162. package/src/motion/styles/motion.css +332 -0
  163. package/src/motion/transitions.ts +74 -0
  164. package/src/motion/virtual.d.ts +4 -0
  165. package/src/primitives/Accordion.astro +129 -0
  166. package/src/primitives/Breadcrumbs.astro +50 -0
  167. package/src/primitives/BulletList.astro +69 -0
  168. package/src/primitives/Button.astro +73 -0
  169. package/src/primitives/ButtonGroup.astro +54 -0
  170. package/src/primitives/Callout.astro +137 -0
  171. package/src/primitives/Caption.astro +35 -0
  172. package/src/primitives/Card.astro +72 -0
  173. package/src/primitives/CardContent.astro +24 -0
  174. package/src/primitives/CardFooter.astro +36 -0
  175. package/src/primitives/CardHeader.astro +86 -0
  176. package/src/primitives/Checkbox.astro +38 -0
  177. package/src/primitives/ChoiceGroup.astro +23 -0
  178. package/src/primitives/Cluster.astro +49 -0
  179. package/src/primitives/Container.astro +44 -0
  180. package/src/primitives/DescriptionList.astro +83 -0
  181. package/src/primitives/Dialog.astro +38 -0
  182. package/src/primitives/Disclosure.astro +67 -0
  183. package/src/primitives/Divider.astro +93 -0
  184. package/src/primitives/Drawer.astro +33 -0
  185. package/src/primitives/Fieldset.astro +80 -0
  186. package/src/primitives/Flex.astro +64 -0
  187. package/src/primitives/FocusRing.astro +63 -0
  188. package/src/primitives/FocusTrap.astro +64 -0
  189. package/src/primitives/Footer.astro +155 -0
  190. package/src/primitives/Form.astro +68 -0
  191. package/src/primitives/FormDescription.astro +26 -0
  192. package/src/primitives/FormError.astro +106 -0
  193. package/src/primitives/FormField.astro +72 -0
  194. package/src/primitives/Grid.astro +64 -0
  195. package/src/primitives/Heading.astro +45 -0
  196. package/src/primitives/IconButton.astro +48 -0
  197. package/src/primitives/Image.astro +125 -0
  198. package/src/primitives/Input.astro +86 -0
  199. package/src/primitives/Label.astro +50 -0
  200. package/src/primitives/Link.astro +81 -0
  201. package/src/primitives/LinkButton.astro +66 -0
  202. package/src/primitives/List.astro +39 -0
  203. package/src/primitives/ListItem.astro +178 -0
  204. package/src/primitives/MediaObject.astro +66 -0
  205. package/src/primitives/MetricCard.astro +278 -0
  206. package/src/primitives/NavLink.astro +81 -0
  207. package/src/primitives/NavMenu.astro +109 -0
  208. package/src/primitives/Navbar.astro +197 -0
  209. package/src/primitives/Panel.astro +153 -0
  210. package/src/primitives/Picture.astro +167 -0
  211. package/src/primitives/Popover.astro +95 -0
  212. package/src/primitives/Prose.astro +45 -0
  213. package/src/primitives/Radio.astro +21 -0
  214. package/src/primitives/Rating.astro +135 -0
  215. package/src/primitives/ReducedMotion.astro +90 -0
  216. package/src/primitives/SegmentedControl.astro +132 -0
  217. package/src/primitives/Select.astro +109 -0
  218. package/src/primitives/Sheet.astro +45 -0
  219. package/src/primitives/SkipLink.astro +31 -0
  220. package/src/primitives/Slider.astro +186 -0
  221. package/src/primitives/Spacer.astro +35 -0
  222. package/src/primitives/Stack.astro +51 -0
  223. package/src/primitives/Surface.astro +70 -0
  224. package/src/primitives/Switch.astro +22 -0
  225. package/src/primitives/Table.astro +382 -0
  226. package/src/primitives/Tabs.astro +126 -0
  227. package/src/primitives/Text.astro +56 -0
  228. package/src/primitives/Textarea.astro +75 -0
  229. package/src/primitives/Thumbnail.astro +154 -0
  230. package/src/primitives/Toggle.astro +99 -0
  231. package/src/primitives/Tooltip.astro +50 -0
  232. package/src/primitives/VisuallyHidden.astro +29 -0
  233. package/src/primitives/index.ts +103 -0
  234. package/src/primitives/internal/AccordionScript.astro +7 -0
  235. package/src/primitives/internal/ChoiceField.astro +91 -0
  236. package/src/primitives/internal/FocusTrapScript.astro +8 -0
  237. package/src/primitives/internal/FormValidationScript.astro +10 -0
  238. package/src/primitives/internal/IndeterminateScript.astro +13 -0
  239. package/src/primitives/internal/ModalPanel.astro +114 -0
  240. package/src/primitives/internal/OverlayScript.astro +7 -0
  241. package/src/primitives/internal/ReducedMotionScript.astro +7 -0
  242. package/src/primitives/internal/SliderScript.astro +7 -0
  243. package/src/primitives/internal/SparklineScript.astro +7 -0
  244. package/src/primitives/internal/TableSortScript.astro +7 -0
  245. package/src/primitives/internal/TabsScript.astro +7 -0
  246. package/src/primitives/internal/TooltipScript.astro +7 -0
  247. package/src/primitives/internal/image-plan.ts +82 -0
  248. package/src/primitives/internal/image.ts +129 -0
  249. package/src/primitives/internal/slider.ts +170 -0
  250. package/src/primitives/lib/deprecate.ts +47 -0
  251. package/src/primitives/lib/focus-trap.ts +197 -0
  252. package/src/primitives/lib/focus.ts +60 -0
  253. package/src/primitives/lib/motion.ts +68 -0
  254. package/src/primitives/scripts/accordion.ts +123 -0
  255. package/src/primitives/scripts/form-validation.ts +225 -0
  256. package/src/primitives/scripts/overlay.ts +71 -0
  257. package/src/primitives/scripts/reduced-motion.ts +59 -0
  258. package/src/primitives/scripts/slider.ts +150 -0
  259. package/src/primitives/scripts/sparkline.ts +131 -0
  260. package/src/primitives/scripts/table-sort.ts +68 -0
  261. package/src/primitives/scripts/tabs.ts +151 -0
  262. package/src/primitives/scripts/tooltip.ts +28 -0
  263. package/src/primitives/styles/a11y.css +104 -0
  264. package/src/primitives/styles/accordion.css +53 -0
  265. package/src/primitives/styles/breadcrumbs.css +59 -0
  266. package/src/primitives/styles/bullet-list.css +89 -0
  267. package/src/primitives/styles/button.css +237 -0
  268. package/src/primitives/styles/choice.css +164 -0
  269. package/src/primitives/styles/cluster.css +24 -0
  270. package/src/primitives/styles/container.css +19 -0
  271. package/src/primitives/styles/data.css +849 -0
  272. package/src/primitives/styles/disclosure.css +140 -0
  273. package/src/primitives/styles/divider.css +50 -0
  274. package/src/primitives/styles/flex.css +42 -0
  275. package/src/primitives/styles/form.css +241 -0
  276. package/src/primitives/styles/grid.css +36 -0
  277. package/src/primitives/styles/media.css +247 -0
  278. package/src/primitives/styles/nav.css +792 -0
  279. package/src/primitives/styles/overlay.css +362 -0
  280. package/src/primitives/styles/prose.css +146 -0
  281. package/src/primitives/styles/scale.css +175 -0
  282. package/src/primitives/styles/segmented.css +165 -0
  283. package/src/primitives/styles/slider.css +170 -0
  284. package/src/primitives/styles/spacer.css +17 -0
  285. package/src/primitives/styles/stack.css +25 -0
  286. package/src/primitives/styles/surface.css +403 -0
  287. package/src/primitives/styles/tabs.css +223 -0
  288. package/src/primitives/styles/typography.css +144 -0
  289. package/src/primitives/styles/utilities.css +24 -0
  290. package/src/primitives/types.ts +385 -0
  291. package/src/primitives/utils.ts +254 -0
  292. package/src/seo/JSONLD.astro +35 -0
  293. package/src/seo/SEOHead.astro +47 -0
  294. package/src/seo/cms.ts +59 -0
  295. package/src/seo/index.ts +10 -0
  296. package/src/seo/integration.ts +268 -0
  297. package/src/seo/internal/url.ts +68 -0
  298. package/src/seo/lib/jsonld.ts +342 -0
  299. package/src/seo/lib/meta.ts +205 -0
  300. package/src/seo/lib/redirects.ts +293 -0
  301. package/src/seo/lib/robots.ts +33 -0
  302. package/src/seo/lib/rss.ts +98 -0
  303. package/src/seo/lib/sitemap.ts +105 -0
  304. package/src/seo/schema.ts +43 -0
  305. package/src/tokens/base.css +71 -0
  306. package/src/tokens/tokens.css +210 -0
@@ -0,0 +1,350 @@
1
+ /**
2
+ * Markdown ⇄ rich-text tree, for CMS rich text stored as Markdown strings.
3
+ *
4
+ * `markdownToRichText` parses the Markdown editors write into the node tree RichText renders, so
5
+ * the renderer's allowlist still decides what reaches the page: raw HTML stays literal text (Astro
6
+ * escapes it) and link/image URLs still pass safeLinkUrl / safeMediaUrl.
7
+ *
8
+ * Supported: paragraphs (a single newline is a line break), `#` headings, `-`/`*`/`+` and `1.`
9
+ * lists (nested by indenting), `>` quotes, fenced code, `---` rules, pipe tables, an image on a
10
+ * line of its own (`![alt](/src/assets/a.jpg "Caption")`), and inline **bold**, *italic*,
11
+ * ~~strikethrough~~, `code`, [links](/path "title") and <https://autolinks>. Backslash escapes
12
+ * any of these characters.
13
+ *
14
+ * `richTextToMarkdown` goes the other way, for moving rich-text trees (e.g. from TinaCMS) into
15
+ * Markdown content.
16
+ */
17
+ import type { RichTextNode, RichTextRoot } from './rich-text';
18
+
19
+ type Marks = Pick<RichTextNode, 'bold' | 'italic' | 'strikethrough' | 'code'>;
20
+
21
+ // --- Inline --------------------------------------------------------------------------------------
22
+
23
+ const PUNCT = /[\\`*_{}[\]()#+\-.!|~<>"']/;
24
+ const isWord = (c: string | undefined) => Boolean(c && /[\p{L}\p{N}]/u.test(c));
25
+
26
+ /** Index of the closing delimiter `d` for an opener at `from`, or -1. Skips code spans and escapes. */
27
+ function closing(s: string, from: number, d: string): number {
28
+ for (let i = from; i < s.length; i++) {
29
+ const c = s[i];
30
+ if (c === '\\') { i++; continue; }
31
+ if (c === '`') {
32
+ const run = /^`+/.exec(s.slice(i))![0];
33
+ const end = s.indexOf(run, i + run.length);
34
+ if (end > 0) { i = end + run.length - 1; continue; }
35
+ }
36
+ if (s.startsWith(d, i) && i > from && !/\s/.test(s[i - 1])) {
37
+ // A single * or _ must not be the start of a double one.
38
+ if (d.length === 1 && s[i + 1] === d) { i++; continue; }
39
+ if (d === '_' && isWord(s[i + 1])) continue;
40
+ // `***` after `**bold *both`: the inner `*` closes first, so take the last two.
41
+ if (d.length === 2 && d[0] !== '~') {
42
+ let end = i + 2;
43
+ while (s[end] === d[0]) end++;
44
+ return end - 2;
45
+ }
46
+ return i;
47
+ }
48
+ }
49
+ return -1;
50
+ }
51
+
52
+ /** Index of the `]` that matches the `[` at `open`, or -1. */
53
+ function bracketEnd(s: string, open: number): number {
54
+ let depth = 0;
55
+ for (let i = open; i < s.length; i++) {
56
+ if (s[i] === '\\') { i++; continue; }
57
+ if (s[i] === '[') depth++;
58
+ if (s[i] === ']' && --depth === 0) return i;
59
+ }
60
+ return -1;
61
+ }
62
+
63
+ /** `(url "title")` at `at`: the url, optional title and the index after `)`. */
64
+ function destination(s: string, at: number): { url: string; title?: string; end: number } | undefined {
65
+ if (s[at] !== '(') return undefined;
66
+ const m = /^\(\s*(<[^>\n]*>|[^\s()]*(?:\([^\s()]*\)[^\s()]*)*)(?:\s+"((?:[^"\\]|\\.)*)")?\s*\)/.exec(s.slice(at));
67
+ if (!m) return undefined;
68
+ const url = m[1].startsWith('<') ? m[1].slice(1, -1) : m[1];
69
+ return { url, title: m[2]?.replace(/\\(.)/g, '$1'), end: at + m[0].length };
70
+ }
71
+
72
+ export function parseInline(s: string, marks: Marks = {}): RichTextNode[] {
73
+ const out: RichTextNode[] = [];
74
+ let buf = '';
75
+ const flush = () => {
76
+ if (buf) out.push({ type: 'text', text: buf, ...marks });
77
+ buf = '';
78
+ };
79
+ const wrap = (inner: RichTextNode[]) => { flush(); out.push(...inner); };
80
+
81
+ for (let i = 0; i < s.length; i++) {
82
+ const c = s[i];
83
+ if (c === '\\' && i + 1 < s.length && PUNCT.test(s[i + 1])) { buf += s[++i]; continue; }
84
+ if (c === '\n') {
85
+ buf = buf.replace(/[ \t]+$/, '');
86
+ flush();
87
+ out.push({ type: 'break' });
88
+ while (s[i + 1] === ' ' || s[i + 1] === '\t') i++;
89
+ continue;
90
+ }
91
+ if (c === '`') {
92
+ const run = /^`+/.exec(s.slice(i))![0];
93
+ const end = s.indexOf(run, i + run.length);
94
+ if (end > 0) {
95
+ flush();
96
+ let code = s.slice(i + run.length, end).replace(/\n/g, ' ');
97
+ if (/^ .*[^ ].* $/.test(code)) code = code.slice(1, -1);
98
+ out.push({ type: 'text', text: code, ...marks, code: true });
99
+ i = end + run.length - 1;
100
+ continue;
101
+ }
102
+ buf += run;
103
+ i += run.length - 1;
104
+ continue;
105
+ }
106
+ if (c === '<') {
107
+ const m = /^<((?:https?:\/\/|mailto:)[^\s<>]+)>/i.exec(s.slice(i));
108
+ if (m) {
109
+ flush();
110
+ const label = m[1].replace(/^mailto:/i, '');
111
+ out.push({ type: 'a', url: m[1], children: [{ type: 'text', text: label, ...marks }] });
112
+ i += m[0].length - 1;
113
+ continue;
114
+ }
115
+ }
116
+ if (c === '!' && s[i + 1] === '[') {
117
+ // Images only render on a line of their own (a block); inline, keep the alt text.
118
+ const close = bracketEnd(s, i + 1);
119
+ const dest = close > 0 ? destination(s, close + 1) : undefined;
120
+ if (dest) { buf += s.slice(i + 2, close); i = dest.end - 1; continue; }
121
+ }
122
+ if (c === '[') {
123
+ const close = bracketEnd(s, i);
124
+ const dest = close > 0 ? destination(s, close + 1) : undefined;
125
+ if (dest) {
126
+ flush();
127
+ out.push({ type: 'a', url: dest.url, ...(dest.title ? { title: dest.title } : {}), children: parseInline(s.slice(i + 1, close), marks) });
128
+ i = dest.end - 1;
129
+ continue;
130
+ }
131
+ }
132
+ const delim = s.startsWith('**', i) ? '**' : s.startsWith('__', i) ? '__' : s.startsWith('~~', i) ? '~~' : c === '*' || c === '_' ? c : undefined;
133
+ if (delim && !/\s/.test(s[i + delim.length] ?? ' ') && !(delim[0] === '_' && isWord(s[i - 1]))) {
134
+ const end = closing(s, i + delim.length, delim);
135
+ if (end > 0) {
136
+ const mark: Marks = delim === '~~' ? { strikethrough: true } : delim.length === 2 ? { bold: true } : { italic: true };
137
+ wrap(parseInline(s.slice(i + delim.length, end), { ...marks, ...mark }));
138
+ i = end + delim.length - 1;
139
+ continue;
140
+ }
141
+ }
142
+ buf += c;
143
+ }
144
+ flush();
145
+ return out;
146
+ }
147
+
148
+ // --- Blocks --------------------------------------------------------------------------------------
149
+
150
+ const FENCE = /^ {0,3}(`{3,}|~{3,})\s*([\w+#.-]*)[^\n]*$/;
151
+ const HEADING = /^ {0,3}(#{1,6})(?:[ \t]+(.*?))?(?:[ \t]+#+)?[ \t]*$/;
152
+ const HR = /^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/;
153
+ const QUOTE = /^ {0,3}> ?(.*)$/;
154
+ const ITEM = /^( *)([-*+]|\d{1,9}[.)])([ \t]+(.*))?$/;
155
+ const TABLE_RULE = /^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/;
156
+ const IMAGE = /^\s*!\[((?:[^\]\\]|\\.)*)\]\(\s*(<[^>\n]*>|\S+?)(?:\s+"((?:[^"\\]|\\.)*)")?\s*\)\s*$/;
157
+
158
+ const startsBlock = (line: string) => FENCE.test(line) || HEADING.test(line) || HR.test(line) || QUOTE.test(line) || /^ {0,3}([-*+]|1[.)])[ \t]+\S/.test(line);
159
+
160
+ function cells(row: string): string[] {
161
+ const t = row.trim().replace(/^\|/, '').replace(/(?<!\\)\|$/, '');
162
+ return t.split(/(?<!\\)\|/).map((c) => c.trim().replace(/\\\|/g, '|'));
163
+ }
164
+
165
+ function parseBlocks(lines: string[]): RichTextNode[] {
166
+ const out: RichTextNode[] = [];
167
+ let i = 0;
168
+ while (i < lines.length) {
169
+ const line = lines[i];
170
+ if (!line.trim()) { i++; continue; }
171
+
172
+ const fence = FENCE.exec(line);
173
+ if (fence) {
174
+ const body: string[] = [];
175
+ i++;
176
+ while (i < lines.length && !new RegExp(`^ {0,3}${fence[1][0]}{${fence[1].length},}\\s*$`).test(lines[i])) body.push(lines[i++]);
177
+ i++;
178
+ out.push({ type: 'code_block', value: body.join('\n'), ...(fence[2] ? { lang: fence[2] } : {}) });
179
+ continue;
180
+ }
181
+ const h = HEADING.exec(line);
182
+ if (h) {
183
+ out.push({ type: `h${h[1].length}`, children: parseInline(h[2] ?? '') });
184
+ i++;
185
+ continue;
186
+ }
187
+ if (HR.test(line)) { out.push({ type: 'hr' }); i++; continue; }
188
+
189
+ if (QUOTE.test(line)) {
190
+ const inner: string[] = [];
191
+ while (i < lines.length && lines[i].trim() && (QUOTE.test(lines[i]) || !startsBlock(lines[i]))) {
192
+ const q = QUOTE.exec(lines[i]);
193
+ inner.push(q ? q[1] : lines[i]);
194
+ i++;
195
+ }
196
+ out.push({ type: 'blockquote', children: parseBlocks(inner) });
197
+ continue;
198
+ }
199
+
200
+ const item = ITEM.exec(line);
201
+ if (item && (item[3] || lines[i + 1]?.startsWith(' '))) {
202
+ const indent = item[1].length;
203
+ const ordered = /\d/.test(item[2]);
204
+ const items: RichTextNode[] = [];
205
+ while (i < lines.length) {
206
+ const m = ITEM.exec(lines[i]);
207
+ if (!m || m[1].length !== indent || /\d/.test(m[2]) !== ordered) break;
208
+ const contentIndent = indent + m[2].length + (m[3] ? m[3].length - (m[4] ?? '').length : 1);
209
+ const body = [m[4] ?? ''];
210
+ i++;
211
+ while (i < lines.length) {
212
+ const next = lines[i];
213
+ if (!next.trim()) {
214
+ // A blank line continues the item only if indented content follows.
215
+ const after = lines.slice(i + 1).find((l) => l.trim());
216
+ if (after !== undefined && after.length - after.trimStart().length >= contentIndent) { body.push(''); i++; continue; }
217
+ break;
218
+ }
219
+ const lead = next.length - next.trimStart().length;
220
+ if (lead >= contentIndent) { body.push(next.slice(contentIndent)); i++; continue; }
221
+ if (ITEM.test(next) && lead <= indent) break;
222
+ if (lead > indent && ITEM.test(next)) { body.push(next.slice(Math.min(lead, contentIndent))); i++; continue; }
223
+ if (startsBlock(next)) break;
224
+ body.push(next.trim()); // lazy continuation of the item's paragraph
225
+ i++;
226
+ }
227
+ const kids = parseBlocks(body).map((k, n) => (n === 0 && k.type === 'p' ? { ...k, type: 'lic' } : k));
228
+ items.push({ type: 'li', children: kids.length ? kids : [{ type: 'lic', children: [] }] });
229
+ while (i < lines.length && !lines[i].trim()) {
230
+ const after = lines.slice(i).find((l) => l.trim());
231
+ const m2 = after ? ITEM.exec(after) : null;
232
+ if (m2 && m2[1].length === indent && /\d/.test(m2[2]) === ordered) i++;
233
+ else break;
234
+ }
235
+ }
236
+ out.push({ type: ordered ? 'ol' : 'ul', children: items });
237
+ continue;
238
+ }
239
+
240
+ if (line.includes('|') && TABLE_RULE.test(lines[i + 1] ?? '') && (lines[i + 1] ?? '').includes('-')) {
241
+ const head = cells(line);
242
+ const rows: RichTextNode[] = [{ type: 'tr', children: head.map((c) => ({ type: 'th', children: parseInline(c) })) }];
243
+ i += 2;
244
+ while (i < lines.length && lines[i].trim() && lines[i].includes('|')) {
245
+ const row = cells(lines[i++]);
246
+ rows.push({ type: 'tr', children: head.map((_, n) => ({ type: 'td', children: parseInline(row[n] ?? '') })) });
247
+ }
248
+ out.push({ type: 'table', children: rows });
249
+ continue;
250
+ }
251
+
252
+ const para: string[] = [line.trim()];
253
+ i++;
254
+ while (i < lines.length && lines[i].trim() && !startsBlock(lines[i]) && !(lines[i].includes('|') && TABLE_RULE.test(lines[i + 1] ?? ''))) para.push(lines[i++].trim());
255
+ const img = para.length === 1 ? IMAGE.exec(para[0]) : null;
256
+ if (img) {
257
+ const url = img[2].startsWith('<') ? img[2].slice(1, -1) : img[2];
258
+ out.push({ type: 'img', url, alt: img[1].replace(/\\(.)/g, '$1'), ...(img[3] ? { caption: img[3].replace(/\\(.)/g, '$1') } : {}) });
259
+ } else out.push({ type: 'p', children: parseInline(para.join('\n')) });
260
+ }
261
+ return out;
262
+ }
263
+
264
+ /** Parse Markdown into the rich-text tree RichText renders. */
265
+ export function markdownToRichText(markdown: string): RichTextRoot {
266
+ const lines = markdown.replace(/\r\n?/g, '\n').replace(/\t/g, ' ').split('\n');
267
+ return { type: 'root', children: parseBlocks(lines) };
268
+ }
269
+
270
+ // --- Tree → Markdown -----------------------------------------------------------------------------
271
+
272
+ const escapeText = (t: string) => t.replace(/([\\`*_[\]~<])/g, '\\$1');
273
+ const escapeLineStart = (line: string) => line.replace(/^(\s*)(#{1,6}\s|>|[-+*]\s|\d+[.)]\s)/, (_, sp: string, m: string) => `${sp}\\${m}`);
274
+
275
+ function inlineMd(nodes: RichTextNode[] = []): string {
276
+ return nodes
277
+ .map((n) => {
278
+ if (!n || typeof n !== 'object') return '';
279
+ if (n.type === 'break') return '\n';
280
+ if (n.type === 'a') {
281
+ const title = n.title ? ` "${String(n.title).replace(/"/g, '\\"')}"` : '';
282
+ return `[${inlineMd(n.children)}](${String(n.url ?? '').replace(/[()\s]/g, encodeURIComponent)}${title})`;
283
+ }
284
+ if (n.type === 'text') {
285
+ const t = n.text ?? '';
286
+ if (!t) return '';
287
+ if (n.code) return t.includes('`') ? `\`\` ${t} \`\`` : `\`${t}\``;
288
+ // Marks wrap the trimmed text so `** bold**` never happens.
289
+ const [, lead, core, trail] = /^(\s*)([\s\S]*?)(\s*)$/.exec(t)!;
290
+ if (!core) return t;
291
+ let s = escapeText(core);
292
+ if (n.strikethrough) s = `~~${s}~~`;
293
+ if (n.italic) s = `*${s}*`;
294
+ if (n.bold) s = `**${s}**`;
295
+ return lead + s + trail;
296
+ }
297
+ return inlineMd(n.children); // unknown inline wrappers: keep their text
298
+ })
299
+ .join('');
300
+ }
301
+
302
+ function blockMd(n: RichTextNode, depth = 0): string {
303
+ const kids = n.children ?? [];
304
+ const h = /^h([1-6])$/.exec(n.type);
305
+ if (h) return `${'#'.repeat(Number(h[1]))} ${inlineMd(kids).replace(/\n/g, ' ')}`;
306
+ switch (n.type) {
307
+ case 'p':
308
+ case 'lic':
309
+ return inlineMd(kids).split('\n').map(escapeLineStart).join('\n');
310
+ case 'ul':
311
+ case 'ol':
312
+ return kids
313
+ .map((li, i) => {
314
+ const marker = n.type === 'ol' ? `${i + 1}. ` : '- ';
315
+ const pad = ' '.repeat(marker.length);
316
+ const parts = (li.type === 'li' ? li.children ?? [] : [li]).map((c) => blockMd(c, depth + 1)).filter((s) => s.trim());
317
+ const body = parts.join('\n').split('\n').map((l, j) => (j === 0 ? l : l ? pad + l : l)).join('\n');
318
+ return marker + body;
319
+ })
320
+ .join('\n');
321
+ case 'blockquote':
322
+ return kids.map((k) => blockMd(k)).join('\n\n').split('\n').map((l) => (l ? `> ${l}` : '>')).join('\n');
323
+ case 'code_block': {
324
+ const value = String(n.value ?? '');
325
+ const fence = value.includes('```') ? '~~~' : '```';
326
+ return `${fence}${n.lang ?? ''}\n${value}\n${fence}`;
327
+ }
328
+ case 'hr':
329
+ return '---';
330
+ case 'img':
331
+ return `![${escapeText(String(n.alt ?? ''))}](${String(n.url ?? '').replace(/[()\s]/g, encodeURIComponent)}${n.caption ? ` "${String(n.caption).replace(/"/g, '\\"')}"` : ''})`;
332
+ case 'table': {
333
+ const rows = kids.flatMap((k) => (k.type === 'thead' || k.type === 'tbody' ? k.children ?? [] : [k]));
334
+ if (!rows.length) return '';
335
+ const line = (r: RichTextNode) => `| ${(r.children ?? []).map((c) => inlineMd(c.children).replace(/\n/g, ' ').replace(/\|/g, '\\|')).join(' | ')} |`;
336
+ const width = (rows[0].children ?? []).length;
337
+ return [line(rows[0]), `|${' --- |'.repeat(width)}`, ...rows.slice(1).map(line)].join('\n');
338
+ }
339
+ default:
340
+ return kids.length ? inlineMd(kids) : '';
341
+ }
342
+ }
343
+
344
+ /** A rich-text tree (or plain text) as Markdown. Unknown node types keep their text. */
345
+ export function richTextToMarkdown(value: RichTextRoot | RichTextNode[] | string | null | undefined): string {
346
+ if (value == null) return '';
347
+ if (typeof value === 'string') return value;
348
+ const nodes = Array.isArray(value) ? value : value.type === 'root' ? value.children ?? [] : [value];
349
+ return nodes.map((n) => blockMd(n)).filter((s) => s.trim()).join('\n\n');
350
+ }
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Rich text from the CMS: Markdown or a Slate-style rich-text tree, normalized for RichText.
3
+ *
4
+ * Safety by construction: RichText renders only the node types listed in BLOCK_TYPES and
5
+ * INLINE_TYPES, as Astro elements (text is always escaped). Raw HTML nodes, MDX templates and
6
+ * unknown types are dropped. Links and images keep only safe URLs (http(s), mailto, tel,
7
+ * relative); anything else (javascript:, data:, vbscript:…) is removed.
8
+ */
9
+ import { safeHref } from './contact';
10
+ import { markdownToRichText } from './markdown';
11
+
12
+ export interface RichTextNode {
13
+ type: string;
14
+ children?: RichTextNode[];
15
+ /** Text leaves. */
16
+ text?: string;
17
+ bold?: boolean;
18
+ italic?: boolean;
19
+ code?: boolean;
20
+ strikethrough?: boolean;
21
+ underline?: boolean;
22
+ /** Links and images. */
23
+ url?: string;
24
+ title?: string;
25
+ alt?: string;
26
+ caption?: string;
27
+ /** Code blocks. */
28
+ value?: string;
29
+ lang?: string;
30
+ [key: string]: unknown;
31
+ }
32
+ export interface RichTextRoot extends RichTextNode {
33
+ type: 'root';
34
+ children: RichTextNode[];
35
+ }
36
+ /** What a block accepts: Markdown (what SinnStackCMS stores), a rich-text tree, or nothing. */
37
+ export type RichTextValue = RichTextRoot | RichTextNode[] | string | null | undefined;
38
+
39
+ export const BLOCK_TYPES = new Set(['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'li', 'lic', 'blockquote', 'code_block', 'img', 'hr', 'table', 'thead', 'tbody', 'tr', 'th', 'td']);
40
+ export const INLINE_TYPES = new Set(['text', 'a', 'break']);
41
+
42
+ /** Normalize any accepted value to a root node (strings are parsed as Markdown). */
43
+ export function toRichTextRoot(value: RichTextValue): RichTextRoot {
44
+ if (value == null) return { type: 'root', children: [] };
45
+ if (typeof value === 'string') return markdownToRichText(value);
46
+ if (Array.isArray(value)) return { type: 'root', children: value };
47
+ if (value.type === 'root' && Array.isArray(value.children)) return value as RichTextRoot;
48
+ return { type: 'root', children: [value] };
49
+ }
50
+
51
+ /** True when the value would render no visible text or media. */
52
+ export function isRichTextEmpty(value: RichTextValue): boolean {
53
+ const root = toRichTextRoot(value);
54
+ const visible = (n: RichTextNode): boolean => {
55
+ if (!n || typeof n !== 'object') return false;
56
+ if (n.type === 'text') return Boolean(n.text?.trim());
57
+ if (n.type === 'img') return Boolean(safeMediaUrl(n.url));
58
+ if (n.type === 'code_block') return Boolean(n.value?.trim());
59
+ if (n.type === 'hr') return false;
60
+ if (!BLOCK_TYPES.has(n.type) && !INLINE_TYPES.has(n.type)) return false;
61
+ return (n.children ?? []).some(visible);
62
+ };
63
+ return !root.children.some(visible);
64
+ }
65
+
66
+ /**
67
+ * Plain text, for structured data (FAQ answers), meta descriptions and accessible names.
68
+ * Paragraph-level nodes are separated by a blank line and list items by a newline.
69
+ */
70
+ export function richTextPlain(value: RichTextValue): string {
71
+ const root = toRichTextRoot(value);
72
+ const BLOCKS = new Set(['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'code_block', 'table', 'ul', 'ol']);
73
+ const walk = (n: RichTextNode): string => {
74
+ if (!n || typeof n !== 'object') return '';
75
+ if (n.type === 'text') return n.text ?? '';
76
+ if (n.type === 'break') return '\n';
77
+ if (n.type === 'code_block') return n.value ?? '';
78
+ if (n.type === 'img') return '';
79
+ if (!BLOCK_TYPES.has(n.type) && !INLINE_TYPES.has(n.type) && n.type !== 'root') return '';
80
+ const kids = n.children ?? [];
81
+ if (n.type === 'ul' || n.type === 'ol') return kids.map(walk).filter((s) => s.trim()).join('\n');
82
+ if (n.type === 'tr') return kids.map(walk).join('\t');
83
+ if (n.type === 'table' || n.type === 'thead' || n.type === 'tbody') return kids.map(walk).join('\n');
84
+ if (n.type === 'root') {
85
+ return kids
86
+ .map((k) => walk(k).trim())
87
+ .filter(Boolean)
88
+ .join('\n\n');
89
+ }
90
+ const inner = kids.map(walk).join('');
91
+ return BLOCKS.has(n.type) ? inner.trim() : inner;
92
+ };
93
+ return walk(root).replace(/[ \t]+\n/g, '\n').trim();
94
+ }
95
+
96
+ /** Smallest heading level used in the content (h1 → 1), or undefined when there are none. */
97
+ export function topHeadingLevel(value: RichTextValue): number | undefined {
98
+ let min: number | undefined;
99
+ const walk = (n: RichTextNode) => {
100
+ const m = /^h([1-6])$/.exec(n?.type ?? '');
101
+ if (m) min = Math.min(min ?? 6, Number(m[1]));
102
+ (n?.children ?? []).forEach(walk);
103
+ };
104
+ toRichTextRoot(value).children.forEach(walk);
105
+ return min;
106
+ }
107
+
108
+ /**
109
+ * The level a content heading renders at, so the content's top heading lands on `topLevel`
110
+ * (the editor's h1/h2 never competes with the page title) and relative levels are kept.
111
+ */
112
+ export function shiftedHeading(level: number, contentTop: number | undefined, topLevel: number): 2 | 3 | 4 | 5 | 6 {
113
+ const shift = topLevel - (contentTop ?? level);
114
+ return Math.min(6, Math.max(2, Math.max(topLevel, level + shift))) as 2 | 3 | 4 | 5 | 6;
115
+ }
116
+
117
+ /** Link targets: http(s), mailto, tel, sms, relative paths and fragments. */
118
+ export function safeLinkUrl(url: unknown): string | undefined {
119
+ return typeof url === 'string' ? safeHref(url) : undefined;
120
+ }
121
+
122
+ /** Image sources: http(s) or site paths only (no data:, blob:, javascript:). */
123
+ export function safeMediaUrl(url: unknown): string | undefined {
124
+ if (typeof url !== 'string') return undefined;
125
+ const v = url.trim();
126
+ if (!v) return undefined;
127
+ // Protocol-relative (another host), and the characters browsers strip or read as `/` (see safeHref).
128
+ if (v.startsWith('//') || /[\x00-\x1f\x7f\\]/.test(v)) return undefined;
129
+ if (/^https?:\/\//i.test(v) || v.startsWith('/') || v.startsWith('./') || v.startsWith('../')) return v;
130
+ if (/^[a-z][a-z0-9+.-]*:/i.test(v)) return undefined;
131
+ return v;
132
+ }
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Registry: template name → component + CMS mapper (checklist §5). BlockRenderer uses it;
3
+ * sites extend it with their own blocks (an .astro component or a Lit tag wrapper):
4
+ *
5
+ * import { blockRegistry } from '@sinnstack/ui/blocks/registry';
6
+ * const registry = { ...blockRegistry, pricing: { component: Pricing, toProps: (d) => d } };
7
+ */
8
+ import Hero from './Hero.astro';
9
+ import CTABanner from './CTABanner.astro';
10
+ import FeatureGrid from './FeatureGrid.astro';
11
+ import CardGrid from './CardGrid.astro';
12
+ import LogoCloud from './LogoCloud.astro';
13
+ import HeroCarousel from './HeroCarousel.astro';
14
+ import PageHeader from './PageHeader.astro';
15
+ import ContactCard from './ContactCard.astro';
16
+ import Steps from './Steps.astro';
17
+ import MediaText from './MediaText.astro';
18
+ import CTAPair from './CTAPair.astro';
19
+ import StatsBand from './StatsBand.astro';
20
+ import HighlightCards from './HighlightCards.astro';
21
+ import ContactForm from './ContactForm.astro';
22
+ import ProseSection from './ProseSection.astro';
23
+ import FAQ from './FAQ.astro';
24
+ import Testimonials from './Testimonials.astro';
25
+ import Reviews from './Reviews.astro';
26
+ import LocationHours from './LocationHours.astro';
27
+ import { heroToProps } from './cms/hero';
28
+ import { ctaBannerToProps } from './cms/cta-banner';
29
+ import { featureGridToProps } from './cms/feature-grid';
30
+ import { cardGridToProps } from './cms/card-grid';
31
+ import { logoCloudToProps } from './cms/logo-cloud';
32
+ import { heroCarouselToProps } from './cms/hero-carousel';
33
+ import { pageHeaderToProps } from './cms/page-header';
34
+ import { contactCardToProps } from './cms/contact-card';
35
+ import { stepsToProps } from './cms/steps';
36
+ import { mediaTextToProps } from './cms/media-text';
37
+ import { ctaPairToProps } from './cms/cta-pair';
38
+ import { statsBandToProps } from './cms/stats-band';
39
+ import { highlightCardsToProps } from './cms/highlight-cards';
40
+ import { contactFormToProps } from './cms/contact-form';
41
+ import { proseSectionToProps } from './cms/prose-section';
42
+ import { faqToProps } from './cms/faq';
43
+ import { testimonialsToProps } from './cms/testimonials';
44
+ import { reviewsToProps } from './cms/reviews';
45
+ import { locationHoursToProps } from './cms/location-hours';
46
+ import type { MapContext } from './cms/types';
47
+
48
+ export interface RegistryEntry {
49
+ /** An Astro component (a Lit block is wrapped in a small .astro file that renders its tag). */
50
+ component: (props: any) => unknown;
51
+ toProps: (data: any, ctx: MapContext) => Record<string, unknown>;
52
+ /** Label for editor-facing messages. */
53
+ label?: string;
54
+ /** The block can hold the page's h1: BlockRenderer gives level 1 to the first such block. */
55
+ h1?: boolean;
56
+ }
57
+ export type BlockRegistry = Record<string, RegistryEntry>;
58
+
59
+ export const blockRegistry: BlockRegistry = {
60
+ hero: { component: Hero, toProps: heroToProps, label: 'Hero', h1: true },
61
+ ctaBanner: { component: CTABanner, toProps: ctaBannerToProps, label: 'Call to action' },
62
+ featureGrid: { component: FeatureGrid, toProps: featureGridToProps, label: 'Feature grid' },
63
+ cardGrid: { component: CardGrid, toProps: cardGridToProps, label: 'Card grid' },
64
+ logoCloud: { component: LogoCloud, toProps: logoCloudToProps, label: 'Logo cloud' },
65
+ heroCarousel: { component: HeroCarousel, toProps: heroCarouselToProps, label: 'Hero carousel' },
66
+ pageHeader: { component: PageHeader, toProps: pageHeaderToProps, label: 'Page header', h1: true },
67
+ contactCard: { component: ContactCard, toProps: contactCardToProps, label: 'Contact card' },
68
+ steps: { component: Steps, toProps: stepsToProps, label: 'Steps' },
69
+ mediaText: { component: MediaText, toProps: mediaTextToProps, label: 'Image and text' },
70
+ ctaPair: { component: CTAPair, toProps: ctaPairToProps, label: 'Two calls to action' },
71
+ statsBand: { component: StatsBand, toProps: statsBandToProps, label: 'Stats band' },
72
+ highlightCards: { component: HighlightCards, toProps: highlightCardsToProps, label: 'Highlight cards' },
73
+ contactForm: { component: ContactForm, toProps: contactFormToProps, label: 'Contact form' },
74
+ proseSection: { component: ProseSection, toProps: proseSectionToProps, label: 'Text' },
75
+ faq: { component: FAQ, toProps: faqToProps, label: 'FAQ' },
76
+ testimonials: { component: Testimonials, toProps: testimonialsToProps, label: 'Testimonials' },
77
+ reviews: { component: Reviews, toProps: reviewsToProps, label: 'Reviews' },
78
+ locationHours: { component: LocationHours, toProps: locationHoursToProps, label: 'Location and hours' },
79
+ };