@tempoxyz/ds 0.3.19 → 0.3.20

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 (303) hide show
  1. package/dist/arsenal/icons/Icon.d.ts +57 -0
  2. package/dist/arsenal/icons/Icon.d.ts.map +1 -0
  3. package/dist/arsenal/icons/Icon.js +117 -0
  4. package/dist/arsenal/icons/Icon.js.map +1 -0
  5. package/dist/arsenal/icons/glyphs.d.ts +5238 -0
  6. package/dist/arsenal/icons/glyphs.d.ts.map +1 -0
  7. package/dist/arsenal/icons/glyphs.js +2888 -0
  8. package/dist/arsenal/icons/glyphs.js.map +1 -0
  9. package/dist/arsenal/icons/index.d.ts +4 -0
  10. package/dist/arsenal/icons/index.d.ts.map +1 -0
  11. package/dist/arsenal/icons/index.js +4 -0
  12. package/dist/arsenal/icons/index.js.map +1 -0
  13. package/dist/docs/AGENTS.md +2 -2
  14. package/dist/docs/arsenal.md +4555 -0
  15. package/dist/docs/marketing.md +7082 -480
  16. package/dist/document/templates/brief.html +3 -3
  17. package/dist/document/templates/essay.html +3 -3
  18. package/dist/document/templates/post.html +3 -3
  19. package/dist/marketing/components/ArticleBody.css +1 -0
  20. package/dist/marketing/components/ArticleBody.d.ts +1013 -0
  21. package/dist/marketing/components/ArticleBody.d.ts.map +1 -0
  22. package/dist/marketing/components/ArticleBody.js +120 -0
  23. package/dist/marketing/components/ArticleBody.js.map +1 -0
  24. package/dist/marketing/components/ArticleBody.js.zyzz.json +1 -0
  25. package/dist/marketing/components/ArticleHero.css +1 -0
  26. package/dist/marketing/components/ArticleHero.d.ts +168 -0
  27. package/dist/marketing/components/ArticleHero.d.ts.map +1 -0
  28. package/dist/marketing/components/ArticleHero.js +74 -0
  29. package/dist/marketing/components/ArticleHero.js.map +1 -0
  30. package/dist/marketing/components/ArticleHero.js.zyzz.json +1 -0
  31. package/dist/marketing/components/ArticleIndex.css +1 -0
  32. package/dist/marketing/components/ArticleIndex.d.ts +164 -0
  33. package/dist/marketing/components/ArticleIndex.d.ts.map +1 -0
  34. package/dist/marketing/components/ArticleIndex.js +100 -0
  35. package/dist/marketing/components/ArticleIndex.js.map +1 -0
  36. package/dist/marketing/components/ArticleIndex.js.zyzz.json +1 -0
  37. package/dist/marketing/components/ArticleRail.css +1 -0
  38. package/dist/marketing/components/ArticleRail.d.ts +105 -0
  39. package/dist/marketing/components/ArticleRail.d.ts.map +1 -0
  40. package/dist/marketing/components/ArticleRail.js +96 -0
  41. package/dist/marketing/components/ArticleRail.js.map +1 -0
  42. package/dist/marketing/components/ArticleRail.js.zyzz.json +1 -0
  43. package/dist/marketing/components/AsideLayout.css +1 -0
  44. package/dist/marketing/components/AsideLayout.d.ts +39 -0
  45. package/dist/marketing/components/AsideLayout.d.ts.map +1 -0
  46. package/dist/marketing/components/AsideLayout.js +24 -0
  47. package/dist/marketing/components/AsideLayout.js.map +1 -0
  48. package/dist/marketing/components/AsideLayout.js.zyzz.json +1 -0
  49. package/dist/marketing/components/Breadcrumbs.css +1 -0
  50. package/dist/marketing/components/Breadcrumbs.d.ts +132 -0
  51. package/dist/marketing/components/Breadcrumbs.d.ts.map +1 -0
  52. package/dist/marketing/components/Breadcrumbs.js +75 -0
  53. package/dist/marketing/components/Breadcrumbs.js.map +1 -0
  54. package/dist/marketing/components/Breadcrumbs.js.zyzz.json +1 -0
  55. package/dist/marketing/components/Button.css +1 -0
  56. package/dist/marketing/components/Button.d.ts +421 -0
  57. package/dist/marketing/components/Button.d.ts.map +1 -0
  58. package/dist/marketing/components/Button.js +87 -0
  59. package/dist/marketing/components/Button.js.map +1 -0
  60. package/dist/marketing/components/Button.js.zyzz.json +1 -0
  61. package/dist/marketing/components/Card.css +1 -0
  62. package/dist/marketing/components/Card.d.ts +563 -0
  63. package/dist/marketing/components/Card.d.ts.map +1 -0
  64. package/dist/marketing/components/Card.js +171 -0
  65. package/dist/marketing/components/Card.js.map +1 -0
  66. package/dist/marketing/components/Card.js.zyzz.json +1 -0
  67. package/dist/marketing/components/Contact.css +1 -0
  68. package/dist/marketing/components/Contact.d.ts +51 -0
  69. package/dist/marketing/components/Contact.d.ts.map +1 -0
  70. package/dist/marketing/components/Contact.js +44 -0
  71. package/dist/marketing/components/Contact.js.map +1 -0
  72. package/dist/marketing/components/Contact.js.zyzz.json +1 -0
  73. package/dist/marketing/components/Cta.css +1 -0
  74. package/dist/marketing/components/Cta.d.ts +138 -0
  75. package/dist/marketing/components/Cta.d.ts.map +1 -0
  76. package/dist/marketing/components/Cta.js +71 -0
  77. package/dist/marketing/components/Cta.js.map +1 -0
  78. package/dist/marketing/components/Cta.js.zyzz.json +1 -0
  79. package/dist/marketing/components/CustomerStoryFeature.css +1 -0
  80. package/dist/marketing/components/CustomerStoryFeature.d.ts +48 -0
  81. package/dist/marketing/components/CustomerStoryFeature.d.ts.map +1 -0
  82. package/dist/marketing/components/CustomerStoryFeature.js +58 -0
  83. package/dist/marketing/components/CustomerStoryFeature.js.map +1 -0
  84. package/dist/marketing/components/CustomerStoryFeature.js.zyzz.json +1 -0
  85. package/dist/marketing/components/Faq.css +1 -0
  86. package/dist/marketing/components/Faq.d.ts +99 -0
  87. package/dist/marketing/components/Faq.d.ts.map +1 -0
  88. package/dist/marketing/components/Faq.js +83 -0
  89. package/dist/marketing/components/Faq.js.map +1 -0
  90. package/dist/marketing/components/Faq.js.zyzz.json +1 -0
  91. package/dist/marketing/components/FeatureAccordion.css +1 -0
  92. package/dist/marketing/components/FeatureAccordion.d.ts +230 -0
  93. package/dist/marketing/components/FeatureAccordion.d.ts.map +1 -0
  94. package/dist/marketing/components/FeatureAccordion.js +117 -0
  95. package/dist/marketing/components/FeatureAccordion.js.map +1 -0
  96. package/dist/marketing/components/FeatureAccordion.js.zyzz.json +1 -0
  97. package/dist/marketing/components/Footer.css +1 -0
  98. package/dist/marketing/components/Footer.d.ts +178 -0
  99. package/dist/marketing/components/Footer.d.ts.map +1 -0
  100. package/dist/marketing/components/Footer.js +109 -0
  101. package/dist/marketing/components/Footer.js.map +1 -0
  102. package/dist/marketing/components/Footer.js.zyzz.json +1 -0
  103. package/dist/marketing/components/Hero.css +1 -0
  104. package/dist/marketing/components/Hero.d.ts +200 -0
  105. package/dist/marketing/components/Hero.d.ts.map +1 -0
  106. package/dist/marketing/components/Hero.js +67 -0
  107. package/dist/marketing/components/Hero.js.map +1 -0
  108. package/dist/marketing/components/Hero.js.zyzz.json +1 -0
  109. package/dist/marketing/components/LeadCapture.css +1 -0
  110. package/dist/marketing/components/LeadCapture.d.ts +102 -0
  111. package/dist/marketing/components/LeadCapture.d.ts.map +1 -0
  112. package/dist/marketing/components/LeadCapture.js +78 -0
  113. package/dist/marketing/components/LeadCapture.js.map +1 -0
  114. package/dist/marketing/components/LeadCapture.js.zyzz.json +1 -0
  115. package/dist/marketing/components/Link.css +1 -0
  116. package/dist/marketing/components/Link.d.ts +342 -0
  117. package/dist/marketing/components/Link.d.ts.map +1 -0
  118. package/dist/marketing/components/Link.js +152 -0
  119. package/dist/marketing/components/Link.js.map +1 -0
  120. package/dist/marketing/components/Link.js.zyzz.json +1 -0
  121. package/dist/marketing/components/Logo.css +1 -0
  122. package/dist/marketing/components/Logo.d.ts +30 -0
  123. package/dist/marketing/components/Logo.d.ts.map +1 -0
  124. package/dist/marketing/components/Logo.js +38 -0
  125. package/dist/marketing/components/Logo.js.map +1 -0
  126. package/dist/marketing/components/Logo.js.zyzz.json +1 -0
  127. package/dist/marketing/components/LogoWall.css +1 -0
  128. package/dist/marketing/components/LogoWall.d.ts +156 -0
  129. package/dist/marketing/components/LogoWall.d.ts.map +1 -0
  130. package/dist/marketing/components/LogoWall.js +41 -0
  131. package/dist/marketing/components/LogoWall.js.map +1 -0
  132. package/dist/marketing/components/LogoWall.js.zyzz.json +1 -0
  133. package/dist/marketing/components/Mark.css +1 -0
  134. package/dist/marketing/components/Mark.d.ts +30 -0
  135. package/dist/marketing/components/Mark.d.ts.map +1 -0
  136. package/dist/marketing/components/Mark.js +38 -0
  137. package/dist/marketing/components/Mark.js.map +1 -0
  138. package/dist/marketing/components/Mark.js.zyzz.json +1 -0
  139. package/dist/marketing/components/Media.css +1 -0
  140. package/dist/marketing/components/Media.d.ts +74 -0
  141. package/dist/marketing/components/Media.d.ts.map +1 -0
  142. package/dist/marketing/components/Media.js +80 -0
  143. package/dist/marketing/components/Media.js.map +1 -0
  144. package/dist/marketing/components/Media.js.zyzz.json +1 -0
  145. package/dist/marketing/components/Nav.css +1 -0
  146. package/dist/marketing/components/Nav.d.ts +303 -0
  147. package/dist/marketing/components/Nav.d.ts.map +1 -0
  148. package/dist/marketing/components/Nav.js +166 -0
  149. package/dist/marketing/components/Nav.js.map +1 -0
  150. package/dist/marketing/components/Nav.js.zyzz.json +1 -0
  151. package/dist/marketing/components/PartnersIndex.css +1 -0
  152. package/dist/marketing/components/PartnersIndex.d.ts +267 -0
  153. package/dist/marketing/components/PartnersIndex.d.ts.map +1 -0
  154. package/dist/marketing/components/PartnersIndex.js +96 -0
  155. package/dist/marketing/components/PartnersIndex.js.map +1 -0
  156. package/dist/marketing/components/PartnersIndex.js.zyzz.json +1 -0
  157. package/dist/marketing/components/QuoteBand.css +1 -0
  158. package/dist/marketing/components/QuoteBand.d.ts +128 -0
  159. package/dist/marketing/components/QuoteBand.d.ts.map +1 -0
  160. package/dist/marketing/components/QuoteBand.js +73 -0
  161. package/dist/marketing/components/QuoteBand.js.map +1 -0
  162. package/dist/marketing/components/QuoteBand.js.zyzz.json +1 -0
  163. package/dist/marketing/components/Section.css +1 -0
  164. package/dist/marketing/components/Section.d.ts +132 -0
  165. package/dist/marketing/components/Section.d.ts.map +1 -0
  166. package/dist/marketing/components/Section.js +33 -0
  167. package/dist/marketing/components/Section.js.map +1 -0
  168. package/dist/marketing/components/Section.js.zyzz.json +1 -0
  169. package/dist/marketing/components/SectionHeading.css +1 -0
  170. package/dist/marketing/components/SectionHeading.d.ts +215 -0
  171. package/dist/marketing/components/SectionHeading.d.ts.map +1 -0
  172. package/dist/marketing/components/SectionHeading.js +48 -0
  173. package/dist/marketing/components/SectionHeading.js.map +1 -0
  174. package/dist/marketing/components/SectionHeading.js.zyzz.json +1 -0
  175. package/dist/marketing/components/Showcase.css +1 -0
  176. package/dist/marketing/components/Showcase.d.ts +269 -0
  177. package/dist/marketing/components/Showcase.d.ts.map +1 -0
  178. package/dist/marketing/components/Showcase.js +67 -0
  179. package/dist/marketing/components/Showcase.js.map +1 -0
  180. package/dist/marketing/components/Showcase.js.zyzz.json +1 -0
  181. package/dist/marketing/components/Stats.css +1 -0
  182. package/dist/marketing/components/Stats.d.ts +133 -0
  183. package/dist/marketing/components/Stats.d.ts.map +1 -0
  184. package/dist/marketing/components/Stats.js +34 -0
  185. package/dist/marketing/components/Stats.js.map +1 -0
  186. package/dist/marketing/components/Stats.js.zyzz.json +1 -0
  187. package/dist/marketing/components/Steps.css +1 -0
  188. package/dist/marketing/components/Steps.d.ts +53 -0
  189. package/dist/marketing/components/Steps.d.ts.map +1 -0
  190. package/dist/marketing/components/Steps.js +78 -0
  191. package/dist/marketing/components/Steps.js.map +1 -0
  192. package/dist/marketing/components/Steps.js.zyzz.json +1 -0
  193. package/dist/marketing/components/SymbolTile.css +1 -0
  194. package/dist/marketing/components/SymbolTile.d.ts +85 -0
  195. package/dist/marketing/components/SymbolTile.d.ts.map +1 -0
  196. package/dist/marketing/components/SymbolTile.js +35 -0
  197. package/dist/marketing/components/SymbolTile.js.map +1 -0
  198. package/dist/marketing/components/SymbolTile.js.zyzz.json +1 -0
  199. package/dist/marketing/components/Tab.css +1 -0
  200. package/dist/marketing/components/Tab.d.ts +280 -0
  201. package/dist/marketing/components/Tab.d.ts.map +1 -0
  202. package/dist/marketing/components/Tab.js +43 -0
  203. package/dist/marketing/components/Tab.js.map +1 -0
  204. package/dist/marketing/components/Tab.js.zyzz.json +1 -0
  205. package/dist/marketing/components/Table.css +1 -0
  206. package/dist/marketing/components/Table.d.ts +157 -0
  207. package/dist/marketing/components/Table.d.ts.map +1 -0
  208. package/dist/marketing/components/Table.js +80 -0
  209. package/dist/marketing/components/Table.js.map +1 -0
  210. package/dist/marketing/components/Table.js.zyzz.json +1 -0
  211. package/dist/marketing/components/Tag.css +1 -0
  212. package/dist/marketing/components/Tag.d.ts +254 -0
  213. package/dist/marketing/components/Tag.d.ts.map +1 -0
  214. package/dist/marketing/components/Tag.js +59 -0
  215. package/dist/marketing/components/Tag.js.map +1 -0
  216. package/dist/marketing/components/Tag.js.zyzz.json +1 -0
  217. package/dist/marketing/components/internal/Links.d.ts +9 -0
  218. package/dist/marketing/components/internal/Links.d.ts.map +1 -0
  219. package/dist/marketing/components/internal/Links.js +15 -0
  220. package/dist/marketing/components/internal/Links.js.map +1 -0
  221. package/dist/marketing/icons/ArrowUpRight.d.ts +6 -0
  222. package/dist/marketing/icons/ArrowUpRight.d.ts.map +1 -0
  223. package/dist/marketing/icons/ArrowUpRight.js +5 -0
  224. package/dist/marketing/icons/ArrowUpRight.js.map +1 -0
  225. package/dist/marketing/icons/Checkmark.d.ts +6 -0
  226. package/dist/marketing/icons/Checkmark.d.ts.map +1 -0
  227. package/dist/marketing/icons/Checkmark.js +5 -0
  228. package/dist/marketing/icons/Checkmark.js.map +1 -0
  229. package/dist/marketing/icons/ChevronRight.d.ts +6 -0
  230. package/dist/marketing/icons/ChevronRight.d.ts.map +1 -0
  231. package/dist/marketing/icons/ChevronRight.js +5 -0
  232. package/dist/marketing/icons/ChevronRight.js.map +1 -0
  233. package/dist/marketing/icons/Link.d.ts +6 -0
  234. package/dist/marketing/icons/Link.d.ts.map +1 -0
  235. package/dist/marketing/icons/Link.js +5 -0
  236. package/dist/marketing/icons/Link.js.map +1 -0
  237. package/dist/marketing/icons/Play.d.ts +6 -0
  238. package/dist/marketing/icons/Play.d.ts.map +1 -0
  239. package/dist/marketing/icons/Play.js +5 -0
  240. package/dist/marketing/icons/Play.js.map +1 -0
  241. package/dist/marketing/icons/Spinner.d.ts +6 -0
  242. package/dist/marketing/icons/Spinner.d.ts.map +1 -0
  243. package/dist/marketing/icons/Spinner.js +5 -0
  244. package/dist/marketing/icons/Spinner.js.map +1 -0
  245. package/dist/marketing/icons/Xmark.d.ts +6 -0
  246. package/dist/marketing/icons/Xmark.d.ts.map +1 -0
  247. package/dist/marketing/icons/Xmark.js +5 -0
  248. package/dist/marketing/icons/Xmark.js.map +1 -0
  249. package/dist/marketing/index.d.ts +34 -1
  250. package/dist/marketing/index.d.ts.map +1 -1
  251. package/dist/marketing/index.js +34 -1
  252. package/dist/marketing/index.js.map +1 -1
  253. package/dist/marketing/index.js.zyzz.json +1 -1
  254. package/package.json +8 -2
  255. package/src/arsenal/icons/CATALOGUE.md +471 -0
  256. package/src/arsenal/icons/CHANGELOG.md +181 -0
  257. package/src/arsenal/icons/Icon.tsx +187 -0
  258. package/src/arsenal/icons/README.md +53 -0
  259. package/src/arsenal/icons/glyphs.ts +2901 -0
  260. package/src/arsenal/icons/index.ts +12 -0
  261. package/src/marketing/README.md +13 -1
  262. package/src/marketing/components/ArticleBody.tsx +784 -0
  263. package/src/marketing/components/ArticleHero.tsx +331 -0
  264. package/src/marketing/components/ArticleIndex.tsx +457 -0
  265. package/src/marketing/components/ArticleRail.tsx +384 -0
  266. package/src/marketing/components/AsideLayout.tsx +52 -0
  267. package/src/marketing/components/Breadcrumbs.tsx +197 -0
  268. package/src/marketing/components/Button.tsx +469 -0
  269. package/src/marketing/components/Card.tsx +865 -0
  270. package/src/marketing/components/Contact.tsx +157 -0
  271. package/src/marketing/components/Cta.tsx +297 -0
  272. package/src/marketing/components/CustomerStoryFeature.tsx +218 -0
  273. package/src/marketing/components/Faq.tsx +334 -0
  274. package/src/marketing/components/FeatureAccordion.tsx +459 -0
  275. package/src/marketing/components/Footer.tsx +440 -0
  276. package/src/marketing/components/Hero.tsx +275 -0
  277. package/src/marketing/components/LeadCapture.tsx +322 -0
  278. package/src/marketing/components/Link.tsx +508 -0
  279. package/src/marketing/components/Logo.tsx +71 -0
  280. package/src/marketing/components/LogoWall.tsx +185 -0
  281. package/src/marketing/components/Mark.tsx +67 -0
  282. package/src/marketing/components/Media.tsx +275 -0
  283. package/src/marketing/components/Nav.tsx +1030 -0
  284. package/src/marketing/components/PartnersIndex.tsx +448 -0
  285. package/src/marketing/components/QuoteBand.tsx +288 -0
  286. package/src/marketing/components/Section.tsx +110 -0
  287. package/src/marketing/components/SectionHeading.tsx +227 -0
  288. package/src/marketing/components/Showcase.tsx +301 -0
  289. package/src/marketing/components/Stats.tsx +130 -0
  290. package/src/marketing/components/Steps.tsx +215 -0
  291. package/src/marketing/components/SymbolTile.tsx +89 -0
  292. package/src/marketing/components/Tab.tsx +306 -0
  293. package/src/marketing/components/Table.tsx +255 -0
  294. package/src/marketing/components/Tag.tsx +289 -0
  295. package/src/marketing/components/internal/Links.ts +19 -0
  296. package/src/marketing/icons/ArrowUpRight.tsx +25 -0
  297. package/src/marketing/icons/Checkmark.tsx +25 -0
  298. package/src/marketing/icons/ChevronRight.tsx +25 -0
  299. package/src/marketing/icons/Link.tsx +25 -0
  300. package/src/marketing/icons/Play.tsx +25 -0
  301. package/src/marketing/icons/Spinner.tsx +25 -0
  302. package/src/marketing/icons/Xmark.tsx +25 -0
  303. package/src/marketing/index.ts +34 -1
@@ -0,0 +1,275 @@
1
+ /** Renders the Marketing hero that opens a marketing or index page. @module */
2
+ import { type ComponentPropsWithRef, type ReactNode, useId } from 'react'
3
+ import type * as zyzz from 'zyzz'
4
+ import { style, variants } from '../zyzz.config.js'
5
+
6
+ /**
7
+ * A page's opening `<section>`: an eyebrow, the page's `<h1>` in Display Hero, a subtitle and up
8
+ * to two actions under the top inset, with slots for a logo row, media, or art. The `statement`
9
+ * form centers it, as a product page opens, and the `index` form sets it at the start, over an
10
+ * index page's list. It has no states or motion, and its buttons keep theirs.
11
+ *
12
+ * - Pass up to two large `Button.Link`s as `children`, one `primary` and one `secondary` at most.
13
+ * - Name the product or collection in `eyebrow`, such as Tempo Routes, or leave it out.
14
+ * - Pass the title's authored line breaks as `lines`, which keep each line whole and size it to
15
+ * fit the width.
16
+ * - The section takes its title as its name. Pass `aria-label` for another name.
17
+ * - Set `heading="h2"` only where the hero shows inside another page, such as a docs example.
18
+ *
19
+ * @example
20
+ * <Hero
21
+ * description="Move money by connecting stablecoins, networks, and bank accounts."
22
+ * eyebrow="Tempo Routes"
23
+ * title="Build stablecoin payment flows with one API"
24
+ * >
25
+ * <Button.Link href="/contact" size="large">Get in touch</Button.Link>
26
+ * </Hero>
27
+ *
28
+ * @see {@link https://www.w3.org/WAI/ARIA/apg/practices/headings/ | WAI-ARIA APG Headings}
29
+ */
30
+ export function Hero(props: Hero.Props) {
31
+ const {
32
+ art,
33
+ artPlacement = 'below',
34
+ children,
35
+ className,
36
+ description,
37
+ eyebrow,
38
+ form,
39
+ heading: Heading = 'h1',
40
+ lines,
41
+ logos,
42
+ media,
43
+ title,
44
+ vars,
45
+ ...attributes
46
+ } = props
47
+
48
+ const titleId = useId()
49
+ const named =
50
+ attributes['aria-label'] !== undefined || attributes['aria-labelledby'] !== undefined
51
+
52
+ return (
53
+ <>
54
+ <section
55
+ aria-labelledby={named ? undefined : titleId}
56
+ {...attributes}
57
+ {...styles.root({ className, form, style: props.style, vars })}
58
+ >
59
+ {art !== undefined && artPlacement === 'behind' && (
60
+ <div aria-hidden="true" {...styles.behind()}>
61
+ {art}
62
+ </div>
63
+ )}
64
+ {eyebrow !== undefined && <p {...styles.eyebrow()}>{eyebrow}</p>}
65
+ <Heading id={titleId} {...styles.title({ form, lines: lines !== undefined })}>
66
+ {lines === undefined
67
+ ? title
68
+ : lines.map((line, index) => (
69
+ <span key={line} {...styles.line()}>
70
+ {index ? ` ${line}` : line}
71
+ </span>
72
+ ))}
73
+ </Heading>
74
+ {description !== undefined && <p {...styles.subtitle()}>{description}</p>}
75
+ {children !== undefined && <div {...styles.actions({ form })}>{children}</div>}
76
+ {logos !== undefined && <div {...styles.logos({ form })}>{logos}</div>}
77
+ {media !== undefined && <div {...styles.media()}>{media}</div>}
78
+ </section>
79
+ {art !== undefined && artPlacement === 'below' && <div {...styles.art()}>{art}</div>}
80
+ </>
81
+ )
82
+ }
83
+
84
+ export namespace Hero {
85
+ export type Props = Omit<ComponentPropsWithRef<'section'>, 'children' | 'title'> &
86
+ Pick<zyzz.Props.Variants<typeof styles.root>, 'className' | 'form' | 'style' | 'vars'> & {
87
+ /**
88
+ * Art: a full-bleed band below the hero, such as a product's line art, or a scene behind its
89
+ * copy, by `artPlacement`. Absent by default.
90
+ */
91
+ art?: ReactNode | undefined
92
+ /**
93
+ * Where `art` sits: a band `below` the hero, or `behind` its copy, filling the section, hidden
94
+ * from screen readers and clear of the pointer.
95
+ *
96
+ * @default 'below'
97
+ */
98
+ artPlacement?: 'behind' | 'below' | undefined
99
+ /** Up to two large buttons, 32px below the subtitle (40px from 1024px), or an index's filters. */
100
+ children?: ReactNode | undefined
101
+ /** The subtitle under the title, in Body B1 up to 280px wide, and 480px from 768px. */
102
+ description?: ReactNode | undefined
103
+ /** The product or collection name above the title, such as Tempo Routes. */
104
+ eyebrow?: ReactNode | undefined
105
+ /**
106
+ * The title's element: the page's `h1`, or an `h2` where the hero shows inside another page.
107
+ *
108
+ * @default 'h1'
109
+ */
110
+ heading?: 'h1' | 'h2' | undefined
111
+ /** A logo row, 48px below the actions. */
112
+ logos?: ReactNode | undefined
113
+ /** Media under the copy, as wide as the hero, such as a film. */
114
+ media?: ReactNode | undefined
115
+ } & (
116
+ | {
117
+ lines?: undefined
118
+ /** The page's title, in sentence case without a closing period. */
119
+ title: ReactNode
120
+ }
121
+ | {
122
+ /**
123
+ * The title as its authored lines, each kept whole on one line and scaled down to fit
124
+ * the width. They render in place of `title`.
125
+ */
126
+ lines: readonly string[]
127
+ title?: undefined
128
+ }
129
+ )
130
+ }
131
+
132
+ namespace styles {
133
+ // Up to two buttons, 8px apart, 32px below the subtitle (40px from 1024px): the heading gap and 8px
134
+ // more.
135
+ export const actions = variants(
136
+ {
137
+ base: { display: 'flex', flexWrap: 'wrap', gap: '8', paddingBlockStart: '8' },
138
+ defaultVariants: { form: 'statement' },
139
+ variants: {
140
+ form: { index: { justifyContent: 'flex-start' }, statement: { justifyContent: 'center' } },
141
+ },
142
+ },
143
+ { id: 'tds/marketing/hero/actions' },
144
+ )
145
+
146
+ // A full-bleed band below the hero. The section after it holds the space under it.
147
+ export const art = style({ paddingBlockStart: 'section.xs' }, { id: 'tds/marketing/hero/art' })
148
+
149
+ // A layer that fills the section under the copy. It takes no pointer, so the actions stay
150
+ // reachable through it.
151
+ export const behind = style(
152
+ { inset: '0 !custom', pointerEvents: 'none', position: 'absolute', zIndex: '-1 !custom' },
153
+ { id: 'tds/marketing/hero/behind' },
154
+ )
155
+
156
+ export const eyebrow = style(
157
+ { color: 'content.secondary', textTransform: 'uppercase', typography: 'utility.eyebrow' },
158
+ { id: 'tds/marketing/hero/eyebrow' },
159
+ )
160
+
161
+ // The tracking resolves at the line's own size, so the line sets the type again before it
162
+ // shrinks it. 9.3cqw fits the longest product line with about 3% to spare.
163
+ export const line = style(
164
+ {
165
+ display: 'block',
166
+ typography: 'display.hero',
167
+ // After the typography, which sets the size it overrides.
168
+ fontSize: 'min(1em, 9.3cqw) !custom',
169
+ whiteSpace: 'nowrap',
170
+ },
171
+ { id: 'tds/marketing/hero/line' },
172
+ )
173
+
174
+ // A logo row, 48px below the actions at every width: the heading gap and 24px or 16px more.
175
+ export const logos = variants(
176
+ {
177
+ base: {
178
+ display: 'flex',
179
+ paddingBlockStart: '24',
180
+ width: '100% !custom',
181
+ '@media >=1024': { paddingBlockStart: '16' },
182
+ },
183
+ defaultVariants: { form: 'statement' },
184
+ variants: {
185
+ form: { index: { justifyContent: 'flex-start' }, statement: { justifyContent: 'center' } },
186
+ },
187
+ },
188
+ { id: 'tds/marketing/hero/logos' },
189
+ )
190
+
191
+ // Media under the copy at the content gap, 32px (48px from 1024px): the heading gap and 8px or
192
+ // 16px more.
193
+ export const media = style(
194
+ {
195
+ paddingBlockStart: '8',
196
+ width: '100% !custom',
197
+ '@media >=1024': { paddingBlockStart: '16' },
198
+ },
199
+ { id: 'tds/marketing/hero/media' },
200
+ )
201
+
202
+ // The page margins and the 2560px cap. Positioned and isolated, so art behind the copy fills this
203
+ // box and stays under the copy without reaching past the hero. The lines drop their own margins.
204
+ export const root = variants(
205
+ {
206
+ base: {
207
+ boxSizing: 'border-box',
208
+ display: 'flex',
209
+ flexDirection: 'column',
210
+ gap: 'layoutGap.heading',
211
+ // Its own inline size, so a parent that centers its children cannot shrink it to its text.
212
+ inlineSize: '100% !custom',
213
+ isolation: 'isolate',
214
+ marginInline: 'auto !custom',
215
+ maxWidth: '2560',
216
+ paddingBlockEnd: 'section.md',
217
+ paddingBlockStart: 'section.hero',
218
+ paddingInline: 'page.margin',
219
+ position: 'relative',
220
+ selectors: { '& :is(h1, h2, p)': { margin: '0' } },
221
+ },
222
+ defaultVariants: { form: 'statement' },
223
+ variants: {
224
+ /**
225
+ * The layout: `statement` centers the lines and actions, as a product page opens, and
226
+ * `index` sets them at the start, over an index page's list.
227
+ *
228
+ * @default 'statement'
229
+ */
230
+ form: {
231
+ index: { alignItems: 'flex-start', textAlign: 'start' },
232
+ statement: { alignItems: 'center', textAlign: 'center' },
233
+ },
234
+ },
235
+ },
236
+ { id: 'tds/marketing/hero' },
237
+ )
238
+
239
+ export const subtitle = style(
240
+ {
241
+ color: 'content.secondary',
242
+ maxWidth: '280',
243
+ textWrap: 'balance',
244
+ typography: 'body.b1',
245
+ '@media >=768': { maxWidth: '480' },
246
+ },
247
+ { id: 'tds/marketing/hero/subtitle' },
248
+ )
249
+
250
+ // With authored lines, the title fills its width, which sizes the lines. The index form sets the
251
+ // wider measure of an index page, as a long title runs over the list below it.
252
+ export const title = variants(
253
+ {
254
+ base: {
255
+ color: 'content.primary',
256
+ maxWidth: '600',
257
+ textWrap: 'balance',
258
+ typography: 'display.hero',
259
+ },
260
+ defaultVariants: { form: 'statement', lines: false },
261
+ variants: {
262
+ form: {
263
+ index: {
264
+ maxWidth: '320',
265
+ '@media >=768': { maxWidth: '720' },
266
+ '@media >=1512': { maxWidth: '1000' },
267
+ },
268
+ statement: {},
269
+ },
270
+ lines: { false: {}, true: { containerType: 'inline-size', width: '100% !custom' } },
271
+ },
272
+ },
273
+ { id: 'tds/marketing/hero/title' },
274
+ )
275
+ }
@@ -0,0 +1,322 @@
1
+ /** Renders the opening of a report's page: its title, authors, summary and key figures beside a download form. @module */
2
+ import { type ComponentPropsWithRef, Fragment, type ReactNode, useId } from 'react'
3
+ import type * as zyzz from 'zyzz'
4
+ import { style, variants } from '../zyzz.config.js'
5
+
6
+ /**
7
+ * The opening of a report's own page, where a reader fills a short form to get the PDF. Renders an
8
+ * `article` on the page's container: the title in Display Hero over the authors and a summary
9
+ * section, beside the form from 1024px, then the key figures across the full width.
10
+ *
11
+ * - Pass the form as `children`. The part lays it out and never posts it.
12
+ * - Pass the key figures in `figures`, such as a Marketing `Stats`.
13
+ * - Name the summary by its heading, such as Inside the report.
14
+ * - Set `lang` on a page in another language, so the authors list joins in that language.
15
+ *
16
+ * @example
17
+ * <LeadCapture
18
+ * authors={[{ href: 'https://example.com/simon', name: 'Simon Taylor' }]}
19
+ * summary={{ heading: 'Inside the analysis', items: ['Why redemption terms matter'] }}
20
+ * title="Stablecoins as cash on the balance sheet"
21
+ * >
22
+ * <ReportForm />
23
+ * </LeadCapture>
24
+ *
25
+ * @see {@link https://www.w3.org/WAI/WCAG22/Understanding/labels-or-instructions.html | WCAG 2.2 Labels or Instructions}
26
+ * @see {@link https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html | WCAG 2.2 Info and Relationships}
27
+ */
28
+ export function LeadCapture(props: LeadCapture.Props) {
29
+ const {
30
+ authors = [],
31
+ byline = 'By',
32
+ children,
33
+ className,
34
+ eyebrow,
35
+ figures,
36
+ formId,
37
+ summary,
38
+ title,
39
+ vars,
40
+ ...attributes
41
+ } = props
42
+
43
+ const summaryId = useId()
44
+
45
+ // The names join as the page's language joins a list, such as `A, B, and C` in English. A tag
46
+ // that `Intl` rejects, such as `en_US`, falls back to English.
47
+ const locale = (() => {
48
+ try {
49
+ return Intl.getCanonicalLocales(attributes.lang || 'en')[0] ?? 'en'
50
+ } catch {
51
+ return 'en'
52
+ }
53
+ })()
54
+ const parts = new Intl.ListFormat(locale, {
55
+ style: 'long',
56
+ type: 'conjunction',
57
+ }).formatToParts(authors.map((author) => author.name))
58
+ let elements = 0
59
+
60
+ return (
61
+ <article {...attributes} {...styles.root({ className, style: props.style, vars })}>
62
+ <div {...styles.copy()}>
63
+ {eyebrow && <p {...styles.eyebrow()}>{eyebrow}</p>}
64
+ <h1 {...styles.title()}>{title}</h1>
65
+ {authors.length > 0 && (
66
+ <p {...styles.authors()}>
67
+ {byline}{' '}
68
+ {parts.map((part, index) => {
69
+ if (part.type === 'literal') return <Fragment key={index}>{part.value}</Fragment>
70
+
71
+ // Elements arrive in the order of the names.
72
+ const author = authors[elements++]
73
+ if (!author?.href) return <Fragment key={index}>{part.value}</Fragment>
74
+
75
+ return (
76
+ <a href={author.href} key={index} {...styles.author()}>
77
+ {part.value}
78
+ </a>
79
+ )
80
+ })}
81
+ </p>
82
+ )}
83
+ {summary && (
84
+ <section aria-labelledby={summaryId} {...styles.summary()}>
85
+ <h2 id={summaryId} {...styles.summaryHeading()}>
86
+ {summary.heading}
87
+ </h2>
88
+ {summary.text && <p {...styles.summaryText()}>{summary.text}</p>}
89
+ {summary.items && summary.items.length > 0 && (
90
+ <ul {...styles.items()}>
91
+ {summary.items.map((item, index) => (
92
+ <li key={index} {...styles.item()}>
93
+ {item}
94
+ </li>
95
+ ))}
96
+ </ul>
97
+ )}
98
+ </section>
99
+ )}
100
+ </div>
101
+ <div id={formId} {...styles.form()}>
102
+ {children}
103
+ </div>
104
+ {figures && <div {...styles.figures()}>{figures}</div>}
105
+ </article>
106
+ )
107
+ }
108
+
109
+ export namespace LeadCapture {
110
+ /** One author of the report. */
111
+ export type Author = {
112
+ /** The author's page, such as a profile. Without it the name renders as text. */
113
+ href?: string | undefined
114
+ /** The author's full name. */
115
+ name: string
116
+ }
117
+
118
+ export type Props = Omit<ComponentPropsWithRef<'article'>, 'children' | 'title'> &
119
+ zyzz.Props.Variants<typeof styles.root> & {
120
+ /** The report's authors, listed after `byline` in the order given. */
121
+ authors?: readonly Author[] | undefined
122
+ /**
123
+ * The word before the authors' names.
124
+ * @default 'By'
125
+ */
126
+ byline?: string | undefined
127
+ /** The form that unlocks the report, beside the copy from 1024px and under it before. */
128
+ children: ReactNode
129
+ /** A label above the title, such as Analysis. Leave it out for a report. */
130
+ eyebrow?: ReactNode | undefined
131
+ /** The report's key figures across the full width, such as a Marketing `Stats`. */
132
+ figures?: ReactNode | undefined
133
+ /** An id for the form's column, so a link such as `#download` can scroll to it. */
134
+ formId?: string | undefined
135
+ /** The summary under the authors, ruled off by a hairline and named by its heading. */
136
+ summary?: Summary | undefined
137
+ /** The report's title, set as the page's `h1`. */
138
+ title: ReactNode
139
+ }
140
+
141
+ /** What the report covers. */
142
+ export type Summary = {
143
+ /** The summary's `h2`, such as Inside the report. */
144
+ heading: ReactNode
145
+ /** The points it covers, each on a round marker. */
146
+ items?: readonly ReactNode[] | undefined
147
+ /** One paragraph on what the report explains. */
148
+ text?: ReactNode | undefined
149
+ }
150
+ }
151
+
152
+ namespace styles {
153
+ // Opens the page Section Hero below the top, and keeps Section LG above the footer. The copy and
154
+ // the form, then the figures, sit Section SM apart.
155
+ export const root = variants(
156
+ {
157
+ base: {
158
+ alignItems: 'start',
159
+ boxSizing: 'border-box',
160
+ color: 'content.primary',
161
+ columnGap: 'page.gutter',
162
+ display: 'grid',
163
+ gridTemplateColumns: 'minmax(0, 1fr) !custom',
164
+ marginInline: 'auto !custom',
165
+ maxWidth: '2560',
166
+ paddingBlockEnd: 'section.lg',
167
+ paddingBlockStart: 'section.hero',
168
+ paddingInline: 'page.margin',
169
+ rowGap: 'section.sm',
170
+ typography: 'body.b1',
171
+ width: '100% !custom',
172
+ '@media >=1024': { gridTemplateColumns: 'repeat(12, minmax(0, 1fr)) !custom' },
173
+ },
174
+ },
175
+ { id: 'tds/marketing/lead-capture' },
176
+ )
177
+
178
+ export const author = style(
179
+ {
180
+ color: 'link.rest',
181
+ outlineColor: 'content.primary',
182
+ outlineOffset: 'ringInline',
183
+ outlineStyle: 'none',
184
+ outlineWidth: 'ring',
185
+ textDecorationLine: 'underline',
186
+ textUnderlineOffset: '3px !custom',
187
+ // At rest is where hover out and a release land.
188
+ transitionDuration: 'hoverOut',
189
+ transitionProperty: 'color, opacity !custom',
190
+ transitionTimingFunction: 'standard',
191
+ selectors: {
192
+ '&:active': { opacity: 'pressSurface', transitionDuration: 'press' },
193
+ '&:focus-visible': { outlineStyle: 'solid' },
194
+ },
195
+ '@media (hover: hover) and (pointer: fine)': {
196
+ selectors: {
197
+ '&:hover:not(:active)': { color: 'link.hover', transitionDuration: 'hoverIn' },
198
+ },
199
+ },
200
+ '@media (forced-colors: active)': {
201
+ selectors: { '&:focus-visible': { outlineColor: 'Highlight !custom' } },
202
+ },
203
+ },
204
+ { id: 'tds/marketing/lead-capture/author' },
205
+ )
206
+
207
+ export const authors = style(
208
+ {
209
+ color: 'content.secondary',
210
+ margin: '0',
211
+ marginBlockStart: 'layoutGap.heading',
212
+ typography: 'body.b2',
213
+ },
214
+ { id: 'tds/marketing/lead-capture/authors' },
215
+ )
216
+
217
+ export const copy = style(
218
+ { minWidth: '0', '@media >=1024': { gridColumn: 'span 7 !custom' } },
219
+ { id: 'tds/marketing/lead-capture/copy' },
220
+ )
221
+
222
+ export const eyebrow = style(
223
+ {
224
+ color: 'content.secondary',
225
+ margin: '0',
226
+ marginBlockEnd: '16',
227
+ textTransform: 'uppercase',
228
+ typography: 'utility.eyebrow',
229
+ },
230
+ { id: 'tds/marketing/lead-capture/eyebrow' },
231
+ )
232
+
233
+ export const figures = style(
234
+ { gridColumn: '1 / -1 !custom', minWidth: '0' },
235
+ { id: 'tds/marketing/lead-capture/figures' },
236
+ )
237
+
238
+ export const form = style(
239
+ {
240
+ minWidth: '0',
241
+ scrollMarginBlockStart: 'scrollOffset',
242
+ '@media >=1024': { gridColumn: '8 / span 5 !custom' },
243
+ },
244
+ { id: 'tds/marketing/lead-capture/form' },
245
+ )
246
+
247
+ // A round marker in the text color on the first line.
248
+ export const item = style(
249
+ {
250
+ paddingInlineStart: '24',
251
+ position: 'relative',
252
+ selectors: {
253
+ '&::before': {
254
+ backgroundColor: 'content.primary',
255
+ borderRadius: 'full',
256
+ content: '"" !custom',
257
+ cornerShape: 'round',
258
+ height: '6px !custom',
259
+ insetBlockStart: '8',
260
+ insetInlineStart: '0',
261
+ position: 'absolute',
262
+ width: '6px !custom',
263
+ },
264
+ },
265
+ '@media (forced-colors: active)': {
266
+ selectors: { '&::before': { backgroundColor: 'CanvasText !custom' } },
267
+ },
268
+ },
269
+ { id: 'tds/marketing/lead-capture/item' },
270
+ )
271
+
272
+ export const items = style(
273
+ {
274
+ display: 'flex',
275
+ flexDirection: 'column',
276
+ gap: '12',
277
+ listStyle: 'none !custom',
278
+ margin: '0',
279
+ marginBlockStart: '8',
280
+ padding: '0',
281
+ },
282
+ { id: 'tds/marketing/lead-capture/items' },
283
+ )
284
+
285
+ // Ruled off the title by a hairline.
286
+ export const summary = style(
287
+ {
288
+ borderBlockStartColor: 'line.secondary',
289
+ borderBlockStartStyle: 'solid',
290
+ borderBlockStartWidth: 'regular',
291
+ display: 'flex',
292
+ flexDirection: 'column',
293
+ gap: '12',
294
+ marginBlockStart: '40',
295
+ maxWidth: '600',
296
+ paddingBlockStart: '24',
297
+ '@media >=1024': { marginBlockStart: '48' },
298
+ },
299
+ { id: 'tds/marketing/lead-capture/summary' },
300
+ )
301
+
302
+ export const summaryHeading = style(
303
+ { color: 'content.primary', margin: '0', typography: 'heading.h4' },
304
+ { id: 'tds/marketing/lead-capture/summary-heading' },
305
+ )
306
+
307
+ export const summaryText = style(
308
+ { color: 'content.secondary', margin: '0' },
309
+ { id: 'tds/marketing/lead-capture/summary-text' },
310
+ )
311
+
312
+ export const title = style(
313
+ {
314
+ color: 'content.primary',
315
+ margin: '0',
316
+ maxWidth: '720',
317
+ textWrap: 'balance',
318
+ typography: 'display.hero',
319
+ },
320
+ { id: 'tds/marketing/lead-capture/title' },
321
+ )
322
+ }