@tempoxyz/ds 4.3.20261201063729 → 4.4.20261201070331

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 (73) hide show
  1. package/dist/docs/AGENTS.md +1 -1
  2. package/dist/docs/arsenal.md +144 -271
  3. package/dist/docs/marketing.md +428 -329
  4. package/dist/document/templates/brief.html +3 -3
  5. package/dist/document/templates/essay.html +3 -3
  6. package/dist/document/templates/post.html +3 -3
  7. package/dist/marketing/components/Bleed.d.ts +1 -1
  8. package/dist/marketing/components/Bleed.d.ts.map +1 -1
  9. package/dist/marketing/components/Bleed.js.map +1 -1
  10. package/dist/marketing/components/Bleed.js.zyzz.json +1 -1
  11. package/dist/marketing/components/Carousel.d.ts +3 -4
  12. package/dist/marketing/components/Carousel.d.ts.map +1 -1
  13. package/dist/marketing/components/Carousel.js +3 -4
  14. package/dist/marketing/components/Carousel.js.map +1 -1
  15. package/dist/marketing/components/Cta.d.ts.map +1 -1
  16. package/dist/marketing/components/Cta.js +2 -2
  17. package/dist/marketing/components/Cta.js.map +1 -1
  18. package/dist/marketing/components/Cta.js.zyzz.json +1 -1
  19. package/dist/marketing/components/Faq.d.ts +1 -1
  20. package/dist/marketing/components/Faq.js +1 -1
  21. package/dist/marketing/components/FeatureAccordion.d.ts +1 -1
  22. package/dist/marketing/components/FeatureAccordion.js +1 -1
  23. package/dist/marketing/components/LogoWall.d.ts +9 -8
  24. package/dist/marketing/components/LogoWall.d.ts.map +1 -1
  25. package/dist/marketing/components/LogoWall.js +10 -9
  26. package/dist/marketing/components/LogoWall.js.map +1 -1
  27. package/dist/marketing/components/LogoWall.js.zyzz.json +1 -1
  28. package/dist/marketing/components/Section.d.ts +64 -16
  29. package/dist/marketing/components/Section.d.ts.map +1 -1
  30. package/dist/marketing/components/Section.js +25 -13
  31. package/dist/marketing/components/Section.js.map +1 -1
  32. package/dist/marketing/components/Section.js.zyzz.json +1 -1
  33. package/dist/marketing/components/SectionHeading.css +1 -1
  34. package/dist/marketing/components/SectionHeading.d.ts +132 -61
  35. package/dist/marketing/components/SectionHeading.d.ts.map +1 -1
  36. package/dist/marketing/components/SectionHeading.js +27 -25
  37. package/dist/marketing/components/SectionHeading.js.map +1 -1
  38. package/dist/marketing/components/SectionHeading.js.zyzz.json +1 -1
  39. package/dist/marketing/components/Showcase.d.ts +1 -1
  40. package/dist/marketing/components/Showcase.d.ts.map +1 -1
  41. package/dist/marketing/components/Showcase.js +2 -2
  42. package/dist/marketing/components/Showcase.js.map +1 -1
  43. package/dist/marketing/components/Showcase.js.zyzz.json +1 -1
  44. package/dist/marketing/components/Statement.d.ts +1 -1
  45. package/dist/marketing/components/Statement.d.ts.map +1 -1
  46. package/dist/marketing/components/Statement.js.map +1 -1
  47. package/dist/marketing/components/Statement.js.zyzz.json +1 -1
  48. package/dist/marketing/components/Steps.d.ts +1 -1
  49. package/dist/marketing/components/Steps.js +1 -1
  50. package/dist/marketing/components/Story.d.ts +2 -2
  51. package/dist/marketing/components/Story.d.ts.map +1 -1
  52. package/dist/marketing/components/Story.js.zyzz.json +1 -1
  53. package/dist/marketing/components/Table.d.ts +2 -2
  54. package/dist/marketing/components/Table.d.ts.map +1 -1
  55. package/dist/marketing/components/Table.js +1 -5
  56. package/dist/marketing/components/Table.js.map +1 -1
  57. package/dist/marketing/components/Table.js.zyzz.json +1 -1
  58. package/dist/marketing/index.js.zyzz.json +1 -1
  59. package/package.json +2 -2
  60. package/src/marketing/README.md +1 -1
  61. package/src/marketing/components/Bleed.tsx +4 -1
  62. package/src/marketing/components/Carousel.tsx +3 -4
  63. package/src/marketing/components/Cta.tsx +2 -7
  64. package/src/marketing/components/Faq.tsx +1 -1
  65. package/src/marketing/components/FeatureAccordion.tsx +1 -1
  66. package/src/marketing/components/LogoWall.tsx +13 -12
  67. package/src/marketing/components/Section.tsx +109 -18
  68. package/src/marketing/components/SectionHeading.tsx +167 -66
  69. package/src/marketing/components/Showcase.tsx +5 -4
  70. package/src/marketing/components/Statement.tsx +4 -1
  71. package/src/marketing/components/Steps.tsx +1 -1
  72. package/src/marketing/components/Story.tsx +2 -2
  73. package/src/marketing/components/Table.tsx +10 -16
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tempoxyz/ds",
3
3
  "type": "module",
4
- "version": "4.3.20261201063729",
4
+ "version": "4.4.20261201070331",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "DESIGN.md",
@@ -1534,5 +1534,5 @@
1534
1534
  "main": "./dist/web/index.js",
1535
1535
  "module": "./dist/web/index.js",
1536
1536
  "types": "./dist/web/index.d.ts",
1537
- "gitHead": "79be7897a30c3be38f24bf5a9faf05a0dab8da4f"
1537
+ "gitHead": "da0065237ac47bd8a1803f8e0d698ca4f552eb2d"
1538
1538
  }
@@ -26,7 +26,7 @@ Control fills use `control.solid.rest`, `control.solid.hover`, `control.tonal.ho
26
26
 
27
27
  The Marketing surface shares the Zyzz plugin setup of the [Web surface](../web/README.md#setup).
28
28
 
29
- Marketing also ships the components and sections of a marketing page, from `Button`, `Link` and `Tag` to `Section`, `Hero`, `Card`, `Nav` and `Footer`. Each takes its content as props and children, and its links through `render`, so a site keeps its own router, copy and data.
29
+ Marketing also ships the components and sections of a marketing page, from `Button`, `Link` and `Tag` to `Section`, `Hero`, `Card`, `Nav` and `Footer`. Each takes its content as props and children, and its links through `render`, so a site keeps its own router, copy and data. `Section` draws its own heading from `eyebrow`, `title`, `description` and `action`.
30
30
 
31
31
  ```tsx
32
32
  import { Button, Hero } from '@tempoxyz/ds/marketing'
@@ -38,7 +38,10 @@ export function Bleed(props: Bleed.Props) {
38
38
  }
39
39
 
40
40
  export namespace Bleed {
41
- export type Props = Omit<Section.Props, 'bleed' | 'children' | 'space' | 'tone'> & {
41
+ export type Props = Omit<
42
+ Section.Props,
43
+ 'bleed' | 'children' | 'space' | 'tone' | keyof Section.HeadingProps
44
+ > & {
42
45
  /** The media: an `img`, a `picture` or a `video`, cropped to cover the frame. */
43
46
  children: ReactNode
44
47
  /** A few words over the media's start corner, such as the place it shows. Absent by default. */
@@ -14,7 +14,7 @@ import { Button } from './Button.js'
14
14
  *
15
15
  * - Give it an `id`, and the same id as the `track` of its `Carousel.Controls`.
16
16
  * - Name it with `aria-label` by what it holds, such as Customer stories, and pass its controls to
17
- * the `controls` of the `SectionHeading` above it.
17
+ * the `controls` of the `Section` around it.
18
18
  * - Wrap each item in `Carousel.Item`, such as a Marketing `Card`.
19
19
  * - Use it where a row holds more items than fit, four or more. Show three or fewer in a grid.
20
20
  *
@@ -22,8 +22,7 @@ import { Button } from './Button.js'
22
22
  * items in view, and Home and End to the first and last item.
23
23
  *
24
24
  * @example
25
- * <Section aria-labelledby="customers">
26
- * <SectionHeading controls={<Carousel.Controls track="customer-list" />} title="Customers" titleId="customers" />
25
+ * <Section controls={<Carousel.Controls track="customer-list" />} title="Customers">
27
26
  * <Carousel aria-label="Customer stories" id="customer-list">
28
27
  * <Carousel.Item>…</Carousel.Item>
29
28
  * </Carousel>
@@ -83,7 +82,7 @@ export namespace Carousel {
83
82
  * view: two Marketing `Button`s in the icon-only `carousel` layout, 8px apart. A button marks
84
83
  * itself `aria-disabled` at the end it points to, and stays focusable.
85
84
  *
86
- * - Pass it to the `controls` of the `SectionHeading` above the carousel.
85
+ * - Pass it to the `controls` of the `Section` around the carousel.
87
86
  * - Name the buttons by what they page, such as Previous customers and Next customers, through
88
87
  * `messages`.
89
88
  * - Set `tone="inverse"` inside an inverse `Section`.
@@ -2,7 +2,7 @@
2
2
  import { type ComponentPropsWithRef, type ReactNode, useId } from 'react'
3
3
  import type * as zyzz from 'zyzz'
4
4
  import { style, variants } from '../zyzz.config.js'
5
- import { SectionHeading } from './SectionHeading.js'
5
+ import { Heading } from './SectionHeading.js'
6
6
 
7
7
  /**
8
8
  * The `<section>` that closes a page or an article on its next step. The `single` variant is one
@@ -51,12 +51,7 @@ export function Cta(props: Cta.Props) {
51
51
  if (variant === 'cards')
52
52
  return (
53
53
  <section {...root}>
54
- <SectionHeading
55
- description={description}
56
- eyebrow={eyebrow}
57
- title={title}
58
- titleId={titleId}
59
- />
54
+ <Heading description={description} eyebrow={eyebrow} title={title} titleId={titleId} />
60
55
  <div {...styles.grid()}>{children}</div>
61
56
  </section>
62
57
  )
@@ -22,7 +22,7 @@ import { style, variants, vars } from '../zyzz.config.js'
22
22
  * - Pass each `Faq.Item` as a direct child. Its place sets its two-digit index and its default
23
23
  * `value`.
24
24
  * - Write each question as the reader asks it, and answer it in one or two short paragraphs.
25
- * - Place the rows under a heading, such as a `SectionHeading`, since each question is an `<h3>`.
25
+ * - Place the rows in a `Section` with a `title`, since each question is an `<h3>`.
26
26
  *
27
27
  * @example
28
28
  * <Faq>
@@ -28,7 +28,7 @@ import { style, variants, vars } from '../zyzz.config.js'
28
28
  * - Write each `description` as one sentence, and end a row with a Marketing `Link` in `link`.
29
29
  * - Pass decorative art in `media`. The art is hidden from assistive technology, so the name and
30
30
  * description carry the meaning.
31
- * - Place it in a `Section` under a `SectionHeading`.
31
+ * - Place it in a `Section` with a `title`.
32
32
  *
33
33
  * @example
34
34
  * <FeatureAccordion
@@ -1,25 +1,26 @@
1
- /** Renders the companies Tempo was designed with as a wall of logos under a centered heading. @module */
1
+ /** Renders a group of companies as a wall of logos under a centered heading. @module */
2
2
  import { type ReactNode, useId } from 'react'
3
3
  import { variants } from '../zyzz.config.js'
4
4
  import { Section } from './Section.js'
5
- import { SectionHeading } from './SectionHeading.js'
5
+ import { Heading } from './SectionHeading.js'
6
6
 
7
7
  /**
8
- * The companies Tempo was designed with, as on About. Renders a `Section` named by its centered
8
+ * A group of companies as logos in one ink. Renders a `Section` named by its centered
9
9
  * heading over a list of logos: two columns, three from 600px and six from 1024px. Every logo draws
10
10
  * in one ink at 28px tall and at most 140px wide, so no company outweighs another.
11
11
  *
12
12
  * - Pass each logo as a `src` or a `logo` node, with the company's `name`. The name labels the
13
13
  * logo, so a screen reader reads every company.
14
14
  * - Set `tone="inverse"` to paint the section inverse, so the logos and heading draw near-white.
15
- * - Use a `Hero` with logos for a row under a page's title, and a partners directory for partners a
16
- * visitor can search.
15
+ * - Pass 6 or 12 logos, so every row is full at two, three and six across.
16
+ * - Use a `Hero` with logos for a row under a page's title, and an index for a collection a visitor
17
+ * can filter.
17
18
  *
18
19
  * @example
19
20
  * <LogoWall
20
- * description="Tempo was shaped with input from fintechs, banks, and commerce platforms."
21
- * logos={[{ name: 'Visa', src: '/partners/visa.svg' }]}
22
- * title="Designed with global payment leaders"
21
+ * description="Banks, fintechs and platforms that shaped the network."
22
+ * logos={[{ name: 'Northwind', src: '/logos/northwind.svg' }]}
23
+ * title="Built with teams across payments"
23
24
  * />
24
25
  *
25
26
  * @see {@link https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html | WCAG 2.2 Non-text Content}
@@ -35,13 +36,13 @@ export function LogoWall(props: LogoWall.Props) {
35
36
 
36
37
  return (
37
38
  <Section aria-labelledby={id} tone={tone} {...attributes}>
38
- <SectionHeading
39
- appearance={ink}
40
- centered
39
+ <Heading
40
+ align="center"
41
41
  description={description}
42
42
  subtitle="body"
43
43
  title={title}
44
44
  titleId={id}
45
+ tone={ink === 'inverse' ? 'inverse' : 'page'}
45
46
  />
46
47
  <ul {...styles.list()}>
47
48
  {logos.map((logo) => (
@@ -81,7 +82,7 @@ export namespace LogoWall {
81
82
  name: string
82
83
  }
83
84
 
84
- export type Props = Omit<Section.Props, 'children' | 'title'> & {
85
+ export type Props = Omit<Section.Props, 'children' | keyof Section.HeadingProps> & {
85
86
  /**
86
87
  * The ink of the logos and heading, which the section's `tone` sets: near-white on an
87
88
  * `inverse` tone and black on the others.
@@ -1,42 +1,132 @@
1
- /** Renders the Marketing page section: its container, its tone and the space above its content. @module */
2
- import type { ComponentPropsWithRef } from 'react'
1
+ /** Renders the Marketing page section: its container, its tone, its heading and the space above its content. @module */
2
+ import { type ComponentPropsWithRef, type ReactNode, useId } from 'react'
3
3
  import type * as zyzz from 'zyzz'
4
4
  import { variants } from '../zyzz.config.js'
5
+ import { Heading } from './SectionHeading.js'
5
6
 
6
7
  /**
7
8
  * A native `<section>` that holds one page section below the hero: the page margins, the 2560px
8
- * cap, and the space above its content. The section below holds the space between two sections, so
9
- * the spaces never add up, and a section pads its end only to close the page.
9
+ * cap, the space above its content, and its heading: an eyebrow, an `<h2>` title, a description
10
+ * and one action. The section below holds the space between two sections, so the spaces never add
11
+ * up, and a section pads its end only to close the page.
10
12
  *
11
- * - Set `space="turn"` where the register changes, such as into or out of a dark panel, a
13
+ * - Set `title` to open the section on its heading. The section takes the title as its name,
14
+ * unless you pass `aria-label` or `aria-labelledby`.
15
+ * - Set `space="turn"` where the ground changes, such as into or out of an inverse section, a
12
16
  * full-bleed section or the page's closing section.
13
17
  * - Set `close` on the page's last section, so it keeps the XL space above the footer.
14
- * - Set `bleed` to run the section's content to the page's edges, never margins of your own.
15
- * - Set `tone` to paint the section. Parts inside an `inverse` section take their own inverse
16
- * tone, such as `tone="inverse"` on a `Button`.
17
- * - Name the section by its title: pass the `titleId` of its `SectionHeading` as
18
- * `aria-labelledby`. Leave it unnamed when it holds a part that names itself, such as `Contact`.
18
+ * - Set `bleed` to run the section's content to the page's edges, never margins of your own. The
19
+ * heading keeps the page margins.
20
+ * - Set `tone` to paint the section. The heading follows it. Parts inside an `inverse` section take
21
+ * their own inverse tone, such as `tone="inverse"` on a `Button`.
22
+ * - Name a section without a title with `aria-label`, unless it holds a part that names itself,
23
+ * such as a `Cta` with `variant="contact"`.
19
24
  *
20
25
  * @example
21
- * <Section aria-labelledby="benefits">
22
- * <SectionHeading eyebrow="Business benefits" title="Make stablecoins work for your business" titleId="benefits" />
26
+ * <Section eyebrow="Business benefits" title="Make stablecoins work for your business">
27
+ * …
23
28
  * </Section>
24
29
  *
25
30
  * @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/landmarks/examples/region.html | WAI-ARIA APG Region landmark}
26
31
  */
27
32
  export function Section(props: Section.Props) {
28
- const { bleed, className, close, space, tone, vars, ...attributes } = props
33
+ const {
34
+ action,
35
+ align,
36
+ bleed,
37
+ children,
38
+ className,
39
+ close,
40
+ controls,
41
+ description,
42
+ eyebrow,
43
+ size,
44
+ space,
45
+ title,
46
+ titleId,
47
+ tone,
48
+ vars,
49
+ ...attributes
50
+ } = props
51
+
52
+ const generated = useId()
53
+ const id = titleId ?? generated
54
+ const named =
55
+ attributes['aria-label'] !== undefined || attributes['aria-labelledby'] !== undefined
29
56
 
30
57
  return (
31
58
  <section
59
+ aria-labelledby={title === undefined || named ? undefined : id}
32
60
  {...attributes}
33
61
  {...styles.root({ bleed, className, close, space, style: props.style, tone, vars })}
34
- />
62
+ >
63
+ {title !== undefined && (
64
+ <Heading
65
+ align={align}
66
+ controls={controls}
67
+ description={description}
68
+ eyebrow={eyebrow}
69
+ inset={bleed}
70
+ size={size}
71
+ // The description continues the title in its type only in the wide heading.
72
+ subtitle={size === 'wide' ? 'heading' : 'body'}
73
+ title={title}
74
+ titleId={id}
75
+ tone={tone === 'inverse' ? 'inverse' : 'page'}
76
+ >
77
+ {action}
78
+ </Heading>
79
+ )}
80
+ {children}
81
+ </section>
35
82
  )
36
83
  }
37
84
 
38
85
  export namespace Section {
39
- export type Props = ComponentPropsWithRef<'section'> & zyzz.Props.Variants<typeof styles.root>
86
+ /**
87
+ * The heading's props. `eyebrow`, `description`, `action` and `controls` need a `title`. A part
88
+ * that wraps `Section` omits them by `keyof Section.HeadingProps`.
89
+ */
90
+ export type HeadingProps = {
91
+ /**
92
+ * The section's one action, 32px below the heading's copy (40px from 1024px), such as a
93
+ * `Button.Link` with `layout="card"`.
94
+ */
95
+ action?: ReactNode | undefined
96
+ /**
97
+ * Sets the heading's lines and action at the start, or centers them on the section.
98
+ *
99
+ * @default 'start'
100
+ */
101
+ align?: NonNullable<Heading.Props['align']> | undefined
102
+ /** A carousel's buttons, at the end of the heading and level with its last line. */
103
+ controls?: ReactNode | undefined
104
+ /**
105
+ * The line under the title, in Body B1 up to 480px. At `size="wide"` it continues the title in
106
+ * its type.
107
+ */
108
+ description?: ReactNode | undefined
109
+ /** A few uppercase words above the title that name the section, such as How it works. */
110
+ eyebrow?: ReactNode | undefined
111
+ /**
112
+ * The heading's measure: 600px at `regular`. At `wide`, the title and description run to
113
+ * 1000px from 1024px, and the content follows closer.
114
+ *
115
+ * @default 'regular'
116
+ */
117
+ size?: NonNullable<Heading.Props['size']> | undefined
118
+ /**
119
+ * The heading's `<h2>`, in sentence case without a closing period. It names the section. Absent
120
+ * by default, when the section has no heading.
121
+ */
122
+ title: ReactNode
123
+ /** The title's `id`. Absent by default, when the section generates one. */
124
+ titleId?: string | undefined
125
+ }
126
+
127
+ export type Props = Omit<ComponentPropsWithRef<'section'>, 'title'> &
128
+ zyzz.Props.Variants<typeof styles.root> &
129
+ (HeadingProps | { [key in keyof HeadingProps]?: undefined })
40
130
  }
41
131
 
42
132
  namespace styles {
@@ -69,7 +159,8 @@ namespace styles {
69
159
  defaultVariants: { bleed: false, close: false, space: 'gap', tone: 'page' },
70
160
  variants: {
71
161
  /**
72
- * Runs the content to the page's edges, inside the 2560px cap.
162
+ * Runs the content to the page's edges, inside the 2560px cap. The heading keeps the page
163
+ * margins.
73
164
  *
74
165
  * @default false
75
166
  */
@@ -82,14 +173,14 @@ namespace styles {
82
173
  close: { false: {}, true: { paddingBlockEnd: 'section.xl' } },
83
174
  /**
84
175
  * The space above the content: `gap`, the large section space, or the extra-large `turn`
85
- * where the register changes.
176
+ * where the ground changes.
86
177
  *
87
178
  * @default 'gap'
88
179
  */
89
180
  space: { gap: {}, turn: { paddingBlockStart: 'section.xl' } },
90
181
  /**
91
182
  * The section's fill: none on the `page`, `white`, the page's `grey` step, an `outline`
92
- * hairline, or black with near-white text for `inverse`.
183
+ * hairline, or black with near-white text for `inverse`. The heading follows it.
93
184
  *
94
185
  * @default 'page'
95
186
  */