@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,459 @@
1
+ /** Renders the Marketing feature accordion: one feature open at a time, with its art beside it. @module */
2
+ import * as BaseUi from '@base-ui/react/accordion'
3
+ import {
4
+ type ComponentPropsWithRef,
5
+ type KeyboardEvent,
6
+ type ReactNode,
7
+ useRef,
8
+ useState,
9
+ useSyncExternalStore,
10
+ } from 'react'
11
+ import type * as zyzz from 'zyzz'
12
+ import { style, variants } from '../zyzz.config.js'
13
+
14
+ /**
15
+ * Rows of features, each a name, a line and an optional link, beside the open row's art from
16
+ * 1024px. One row is open at a time, built on Base UI Accordion: each name is a `<button>` with
17
+ * `aria-expanded` inside an `<h3>`, and pressing it opens its row and closes the last one. Below
18
+ * 1024px every row stands open with its art under its text, and the names are plain headings.
19
+ *
20
+ * - Use it for Home's products, each with its art and a link to its page, or for a product's three
21
+ * capabilities with `variant="capabilities"`.
22
+ * - Write each `description` as one sentence, and end a row with a Marketing `Link` in `link`.
23
+ * - Pass decorative art in `media`. The art is hidden from assistive technology, so the name and
24
+ * description carry the meaning.
25
+ * - Place it in a `Section` under a `SectionHeading`.
26
+ *
27
+ * @example
28
+ * <FeatureAccordion
29
+ * items={[
30
+ * { description: 'Hold stablecoins and earn yield.', media: <Art />, title: 'Earn' },
31
+ * { description: 'Send payments across borders.', media: <Art />, title: 'Routes' },
32
+ * ]}
33
+ * />
34
+ *
35
+ * @see {@link https://base-ui.com/react/components/accordion | Base UI Accordion}
36
+ * @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/accordion/ | WAI-ARIA APG Accordion pattern}
37
+ */
38
+ export function FeatureAccordion(props: FeatureAccordion.Props) {
39
+ const {
40
+ className,
41
+ defaultValue,
42
+ items,
43
+ onValueChange,
44
+ value: controlled,
45
+ variant,
46
+ vars,
47
+ ...attributes
48
+ } = props
49
+
50
+ const wide = useSyncExternalStore(subscribe, matches, () => true)
51
+ const values = items.map((item, index) => item.value ?? String(index))
52
+ const [uncontrolled, setUncontrolled] = useState(defaultValue ?? values[0])
53
+ const value = controlled ?? uncontrolled
54
+ const triggers = useRef<(HTMLElement | null)[]>([])
55
+
56
+ // The row just left, so its art drifts up as the next row's art rises. Adjusted while rendering,
57
+ // so a controlled `value` sets it too.
58
+ const [shown, setShown] = useState<{ current?: string | undefined; left?: string | undefined }>({
59
+ current: value,
60
+ })
61
+ if (shown.current !== value) setShown({ current: value, left: shown.current })
62
+
63
+ function select(next: string) {
64
+ if (next === value) return
65
+ setUncontrolled(next)
66
+ onValueChange?.(next)
67
+ }
68
+
69
+ // Up and Down move to the row before or after and open it, and Home and End jump to the first
70
+ // and last. Base UI Accordion leaves arrow keys to the page, after the APG update.
71
+ function navigate(event: KeyboardEvent<HTMLButtonElement>, index: number) {
72
+ const last = items.length - 1
73
+ const next = (() => {
74
+ if (event.key === 'ArrowDown') return Math.min(last, index + 1)
75
+ if (event.key === 'ArrowUp') return Math.max(0, index - 1)
76
+ if (event.key === 'Home') return 0
77
+ if (event.key === 'End') return last
78
+ return undefined
79
+ })()
80
+ if (next === undefined) return
81
+
82
+ event.preventDefault()
83
+ triggers.current[next]?.focus()
84
+ select(values[next]!)
85
+ }
86
+
87
+ if (!wide)
88
+ return (
89
+ <div {...attributes} {...styles.root({ className, style: props.style, variant, vars })}>
90
+ <div {...styles.list()}>
91
+ {items.map((item, index) => (
92
+ <div data-open="" key={values[index]}>
93
+ <h3 {...styles.name({ variant })}>{item.title}</h3>
94
+ <div {...styles.body({ variant })}>
95
+ <p {...styles.description()}>{item.description}</p>
96
+ {item.link}
97
+ </div>
98
+ <div aria-hidden="true" {...styles.media({ variant })}>
99
+ <div {...styles.art()}>{item.media}</div>
100
+ </div>
101
+ </div>
102
+ ))}
103
+ </div>
104
+ </div>
105
+ )
106
+
107
+ return (
108
+ <BaseUi.Accordion.Root
109
+ {...attributes}
110
+ {...styles.root({ className, style: props.style, variant, vars })}
111
+ hiddenUntilFound
112
+ // A press on the open row would close it, so only a change to another row passes.
113
+ onValueChange={(next) => {
114
+ const [first] = next
115
+ if (typeof first === 'string') select(first)
116
+ }}
117
+ value={value === undefined ? [] : [value]}
118
+ >
119
+ <div {...styles.list()}>
120
+ {items.map((item, index) => (
121
+ <BaseUi.Accordion.Item
122
+ data-leaving={shown.left === values[index] && value !== values[index] ? '' : undefined}
123
+ key={values[index]}
124
+ value={values[index]}
125
+ >
126
+ <BaseUi.Accordion.Header {...styles.name({ variant })}>
127
+ <BaseUi.Accordion.Trigger
128
+ onKeyDown={(event) => navigate(event, index)}
129
+ ref={(element) => {
130
+ triggers.current[index] = element
131
+ }}
132
+ {...styles.trigger()}
133
+ >
134
+ {item.title}
135
+ </BaseUi.Accordion.Trigger>
136
+ </BaseUi.Accordion.Header>
137
+ <BaseUi.Accordion.Panel {...styles.panel()}>
138
+ <div {...styles.body({ variant })}>
139
+ <p {...styles.description()}>{item.description}</p>
140
+ {item.link}
141
+ </div>
142
+ </BaseUi.Accordion.Panel>
143
+ <div aria-hidden="true" {...styles.media({ variant })}>
144
+ <div {...styles.art()}>{item.media}</div>
145
+ </div>
146
+ </BaseUi.Accordion.Item>
147
+ ))}
148
+ </div>
149
+ </BaseUi.Accordion.Root>
150
+ )
151
+ }
152
+
153
+ export namespace FeatureAccordion {
154
+ /** One feature row. */
155
+ export type Item = {
156
+ /** The line under the name, as one sentence. */
157
+ description: ReactNode
158
+ /** A Marketing `Link` that ends the row, such as Explore Earn. Absent when the row links nowhere. */
159
+ link?: ReactNode | undefined
160
+ /**
161
+ * Decorative art for the row, hidden from assistive technology. It fills a 1:1 frame below
162
+ * 768px, 16:9 from 768px, and 3:2 from 1024px in `capabilities`. Its frame carries `data-open`
163
+ * on its row while open, so art can start its own motion with an `[data-open] &` selector.
164
+ */
165
+ media: ReactNode
166
+ /** The feature's name, such as Earn. */
167
+ title: string
168
+ /** Identifies the row in `value`. Defaults to the row's index as a string. */
169
+ value?: string | undefined
170
+ }
171
+
172
+ export type Props = Omit<ComponentPropsWithRef<'div'>, 'children' | 'defaultValue'> &
173
+ zyzz.Props.Variants<typeof styles.root> & {
174
+ /** The row open at first, when `value` is not set. Defaults to the first row. */
175
+ defaultValue?: string | undefined
176
+ /** The rows, in order. */
177
+ items: readonly Item[]
178
+ /** Called with the row that opens, by press or arrow key. */
179
+ onValueChange?: ((value: string) => void) | undefined
180
+ /** The open row, for a controlled accordion. */
181
+ value?: string | undefined
182
+ }
183
+ }
184
+
185
+ const query = '(min-width: 1024px)'
186
+
187
+ function matches() {
188
+ return matchMedia(query).matches
189
+ }
190
+
191
+ function subscribe(onChange: () => void) {
192
+ const media = matchMedia(query)
193
+ media.addEventListener('change', onChange)
194
+ return () => media.removeEventListener('change', onChange)
195
+ }
196
+
197
+ namespace styles {
198
+ // The art eases in over the row's art, waits a beat, and leaves faster than it arrives. Under
199
+ // reduced motion the showcase durations are 0ms, so the change is immediate.
200
+ export const art = style(
201
+ {
202
+ alignItems: 'center',
203
+ display: 'flex',
204
+ inset: '0',
205
+ justifyContent: 'center',
206
+ position: 'absolute',
207
+ '@media >=1024': {
208
+ transitionDuration: 'media',
209
+ transitionProperty: 'translate !custom',
210
+ transitionTimingFunction: 'standard',
211
+ translate: '0 6px !custom',
212
+ selectors: {
213
+ '[data-leaving] > * > &': { translate: '0 -4px !custom' },
214
+ '[data-open] > * > &': {
215
+ transitionDelay: 'showcaseEnter',
216
+ transitionDuration: 'showcaseEnter',
217
+ transitionTimingFunction: 'enter',
218
+ translate: 'none !custom',
219
+ },
220
+ },
221
+ },
222
+ '@media (prefers-reduced-motion: reduce)': {
223
+ selectors: {
224
+ '&, [data-leaving] > * > &, [data-open] > * > &': { translate: 'none !custom' },
225
+ },
226
+ },
227
+ },
228
+ { id: 'tds/marketing/feature-accordion/art' },
229
+ )
230
+
231
+ // The text rises 10px into its row as it opens and leaves 6px upward as it closes, on the rows'
232
+ // pace and curve.
233
+ export const body = variants(
234
+ {
235
+ base: {
236
+ display: 'grid',
237
+ gap: 'textPair.b1B1',
238
+ typography: 'body.b1',
239
+ '@media >=1024': {
240
+ transitionDuration: 'showcase',
241
+ transitionProperty: 'translate !custom',
242
+ transitionTimingFunction: 'morph',
243
+ selectors: {
244
+ '[data-starting-style] > &': { translate: '0 10px !custom' },
245
+ '[data-ending-style] > &': { translate: '0 -6px !custom' },
246
+ },
247
+ },
248
+ '@media (prefers-reduced-motion: reduce)': {
249
+ selectors: {
250
+ '[data-starting-style] > &, [data-ending-style] > &': { translate: 'none !custom' },
251
+ },
252
+ },
253
+ },
254
+ defaultVariants: { variant: 'products' },
255
+ variants: {
256
+ variant: {
257
+ capabilities: { paddingTop: 'textPair.h4B1' },
258
+ products: { paddingTop: '16' },
259
+ },
260
+ },
261
+ },
262
+ { id: 'tds/marketing/feature-accordion/body' },
263
+ )
264
+
265
+ export const description = style(
266
+ {
267
+ color: 'content.secondary',
268
+ margin: '0',
269
+ textWrap: 'pretty',
270
+ '@media >=1024': { maxWidth: '280' },
271
+ },
272
+ { id: 'tds/marketing/feature-accordion/description' },
273
+ )
274
+
275
+ export const list = style(
276
+ {
277
+ display: 'flex',
278
+ flexDirection: 'column',
279
+ gap: 'layoutGap.content',
280
+ minWidth: '0 !custom',
281
+ '@media >=1024': {
282
+ alignSelf: 'start',
283
+ gap: '32',
284
+ gridColumn: '1 / span 4 !custom',
285
+ gridRow: '1 !custom',
286
+ },
287
+ },
288
+ { id: 'tds/marketing/feature-accordion/list' },
289
+ )
290
+
291
+ // From 1024px every row's art overlays one frame over the right eight columns, so the rows stay
292
+ // put while the art changes. Each frame sits absolutely over the stage, which `::before` sizes.
293
+ export const media = variants(
294
+ {
295
+ base: {
296
+ aspectRatio: '1 !custom',
297
+ borderRadius: 'sm',
298
+ marginTop: 'layoutGap.element',
299
+ overflow: 'clip',
300
+ position: 'relative',
301
+ '@media >=768': { aspectRatio: '16 / 9 !custom' },
302
+ '@media >=1024': {
303
+ insetInlineEnd: '0',
304
+ marginTop: '0',
305
+ opacity: '0 !custom',
306
+ pointerEvents: 'none',
307
+ position: 'absolute',
308
+ top: '0',
309
+ // The art it leaves fades at the showcase exit pace.
310
+ transitionDuration: 'showcaseExit',
311
+ transitionProperty: 'opacity !custom',
312
+ transitionTimingFunction: 'standard',
313
+ // Eight of twelve columns with their seven 32px gaps.
314
+ width: 'calc((200% - 32px) / 3) !custom',
315
+ selectors: {
316
+ '[data-open] > &': {
317
+ opacity: 'full',
318
+ transitionDelay: 'showcaseEnter',
319
+ transitionDuration: 'showcaseEnter',
320
+ transitionTimingFunction: 'enter',
321
+ },
322
+ },
323
+ },
324
+ },
325
+ defaultVariants: { variant: 'products' },
326
+ variants: {
327
+ variant: {
328
+ // Capability art brings its own plate.
329
+ capabilities: { '@media >=1024': { aspectRatio: '3 / 2 !custom' } },
330
+ products: { backgroundColor: 'neutral.006' },
331
+ },
332
+ },
333
+ },
334
+ { id: 'tds/marketing/feature-accordion/media' },
335
+ )
336
+
337
+ export const name = variants(
338
+ {
339
+ base: {
340
+ borderBlockStartColor: 'line.secondary',
341
+ borderBlockStartStyle: 'solid',
342
+ borderBlockStartWidth: 'regular',
343
+ color: 'content.primary',
344
+ margin: '0',
345
+ maxWidth: '600',
346
+ paddingTop: '24',
347
+ '@media >=1024': { paddingTop: '32' },
348
+ },
349
+ defaultVariants: { variant: 'products' },
350
+ variants: {
351
+ variant: {
352
+ // Capabilities are phrases, not one-word products.
353
+ capabilities: { typography: 'heading.h4' },
354
+ products: { typography: 'heading.h3' },
355
+ },
356
+ },
357
+ },
358
+ { id: 'tds/marketing/feature-accordion/name' },
359
+ )
360
+
361
+ // The panel's height follows Base UI's measure. Its clip lets a link's focus ring show past the
362
+ // sides and foot, where `overflow: hidden` would cut it.
363
+ export const panel = style(
364
+ {
365
+ clipPath: 'inset(0 -8px -6px) !custom',
366
+ height: 'var(--accordion-panel-height) !custom',
367
+ transitionDuration: 'showcase',
368
+ transitionProperty: 'height !custom',
369
+ transitionTimingFunction: 'morph',
370
+ selectors: {
371
+ '&[data-starting-style], &[data-ending-style]': { height: '0' },
372
+ },
373
+ },
374
+ { id: 'tds/marketing/feature-accordion/panel' },
375
+ )
376
+
377
+ export const root = variants(
378
+ {
379
+ base: {
380
+ display: 'grid',
381
+ gap: 'layoutGap.element',
382
+ gridTemplateColumns: 'minmax(0, 1fr) !custom',
383
+ position: 'relative',
384
+ '@media >=1024': {
385
+ gridTemplateColumns: 'repeat(12, minmax(0, 1fr)) !custom',
386
+ selectors: {
387
+ '&::before': {
388
+ alignSelf: 'start',
389
+ content: '"" !custom',
390
+ gridColumn: '5 / span 8 !custom',
391
+ gridRow: '1 !custom',
392
+ },
393
+ },
394
+ },
395
+ },
396
+ defaultVariants: { variant: 'products' },
397
+ variants: {
398
+ /**
399
+ * The rows' register: `products` for Home's products, with `h3` names and a 16:9 frame on a
400
+ * grey ground, and `capabilities` for a product's capabilities, with `h4` names and a 3:2
401
+ * frame from 1024px that the art plates itself.
402
+ *
403
+ * @default 'products'
404
+ */
405
+ variant: {
406
+ capabilities: {
407
+ '@media >=1024': { selectors: { '&::before': { aspectRatio: '3 / 2 !custom' } } },
408
+ },
409
+ products: {
410
+ '@media >=1024': { selectors: { '&::before': { aspectRatio: '16 / 9 !custom' } } },
411
+ },
412
+ },
413
+ },
414
+ },
415
+ { id: 'tds/marketing/feature-accordion' },
416
+ )
417
+
418
+ // A resting name reads as supporting text, a hovered one at 80%, between rest and open, and the
419
+ // open one at full strength. The color changes at the media pace, on the showcase's curve.
420
+ export const trigger = style(
421
+ {
422
+ appearance: 'none !custom',
423
+ backgroundColor: 'transparent !custom',
424
+ borderRadius: '2px !custom',
425
+ borderStyle: 'none',
426
+ color: 'content.secondary',
427
+ cursor: 'pointer',
428
+ display: 'block',
429
+ fontFamily: 'inherit !custom',
430
+ fontSize: 'inherit !custom',
431
+ fontWeight: 'inherit !custom',
432
+ letterSpacing: 'inherit !custom',
433
+ lineHeight: 'inherit !custom',
434
+ opacity: 'full',
435
+ outlineColor: 'neutral.100',
436
+ outlineOffset: 'ring',
437
+ outlineStyle: 'none',
438
+ outlineWidth: 'ring',
439
+ padding: '0',
440
+ textAlign: 'start',
441
+ transitionDuration: 'media',
442
+ transitionProperty: 'color, opacity !custom',
443
+ transitionTimingFunction: 'morph',
444
+ width: '100% !custom',
445
+ selectors: {
446
+ '&[data-panel-open]': { color: 'content.primary' },
447
+ '&:active:not([data-panel-open])': { opacity: 'press', transitionDuration: 'press' },
448
+ '&:focus-visible': { outlineStyle: 'solid' },
449
+ },
450
+ '@media (hover: hover) and (pointer: fine)': {
451
+ selectors: { '&:hover:not([data-panel-open])': { color: 'content.prose' } },
452
+ },
453
+ '@media (forced-colors: active)': {
454
+ selectors: { '&:focus-visible': { outlineColor: 'Highlight !custom' } },
455
+ },
456
+ },
457
+ { id: 'tds/marketing/feature-accordion/trigger' },
458
+ )
459
+ }