@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.
- package/dist/arsenal/icons/Icon.d.ts +57 -0
- package/dist/arsenal/icons/Icon.d.ts.map +1 -0
- package/dist/arsenal/icons/Icon.js +117 -0
- package/dist/arsenal/icons/Icon.js.map +1 -0
- package/dist/arsenal/icons/glyphs.d.ts +5238 -0
- package/dist/arsenal/icons/glyphs.d.ts.map +1 -0
- package/dist/arsenal/icons/glyphs.js +2888 -0
- package/dist/arsenal/icons/glyphs.js.map +1 -0
- package/dist/arsenal/icons/index.d.ts +4 -0
- package/dist/arsenal/icons/index.d.ts.map +1 -0
- package/dist/arsenal/icons/index.js +4 -0
- package/dist/arsenal/icons/index.js.map +1 -0
- package/dist/docs/AGENTS.md +2 -2
- package/dist/docs/arsenal.md +4555 -0
- package/dist/docs/marketing.md +7082 -480
- package/dist/document/templates/brief.html +3 -3
- package/dist/document/templates/essay.html +3 -3
- package/dist/document/templates/post.html +3 -3
- package/dist/marketing/components/ArticleBody.css +1 -0
- package/dist/marketing/components/ArticleBody.d.ts +1013 -0
- package/dist/marketing/components/ArticleBody.d.ts.map +1 -0
- package/dist/marketing/components/ArticleBody.js +120 -0
- package/dist/marketing/components/ArticleBody.js.map +1 -0
- package/dist/marketing/components/ArticleBody.js.zyzz.json +1 -0
- package/dist/marketing/components/ArticleHero.css +1 -0
- package/dist/marketing/components/ArticleHero.d.ts +168 -0
- package/dist/marketing/components/ArticleHero.d.ts.map +1 -0
- package/dist/marketing/components/ArticleHero.js +74 -0
- package/dist/marketing/components/ArticleHero.js.map +1 -0
- package/dist/marketing/components/ArticleHero.js.zyzz.json +1 -0
- package/dist/marketing/components/ArticleIndex.css +1 -0
- package/dist/marketing/components/ArticleIndex.d.ts +164 -0
- package/dist/marketing/components/ArticleIndex.d.ts.map +1 -0
- package/dist/marketing/components/ArticleIndex.js +100 -0
- package/dist/marketing/components/ArticleIndex.js.map +1 -0
- package/dist/marketing/components/ArticleIndex.js.zyzz.json +1 -0
- package/dist/marketing/components/ArticleRail.css +1 -0
- package/dist/marketing/components/ArticleRail.d.ts +105 -0
- package/dist/marketing/components/ArticleRail.d.ts.map +1 -0
- package/dist/marketing/components/ArticleRail.js +96 -0
- package/dist/marketing/components/ArticleRail.js.map +1 -0
- package/dist/marketing/components/ArticleRail.js.zyzz.json +1 -0
- package/dist/marketing/components/AsideLayout.css +1 -0
- package/dist/marketing/components/AsideLayout.d.ts +39 -0
- package/dist/marketing/components/AsideLayout.d.ts.map +1 -0
- package/dist/marketing/components/AsideLayout.js +24 -0
- package/dist/marketing/components/AsideLayout.js.map +1 -0
- package/dist/marketing/components/AsideLayout.js.zyzz.json +1 -0
- package/dist/marketing/components/Breadcrumbs.css +1 -0
- package/dist/marketing/components/Breadcrumbs.d.ts +132 -0
- package/dist/marketing/components/Breadcrumbs.d.ts.map +1 -0
- package/dist/marketing/components/Breadcrumbs.js +75 -0
- package/dist/marketing/components/Breadcrumbs.js.map +1 -0
- package/dist/marketing/components/Breadcrumbs.js.zyzz.json +1 -0
- package/dist/marketing/components/Button.css +1 -0
- package/dist/marketing/components/Button.d.ts +421 -0
- package/dist/marketing/components/Button.d.ts.map +1 -0
- package/dist/marketing/components/Button.js +87 -0
- package/dist/marketing/components/Button.js.map +1 -0
- package/dist/marketing/components/Button.js.zyzz.json +1 -0
- package/dist/marketing/components/Card.css +1 -0
- package/dist/marketing/components/Card.d.ts +563 -0
- package/dist/marketing/components/Card.d.ts.map +1 -0
- package/dist/marketing/components/Card.js +171 -0
- package/dist/marketing/components/Card.js.map +1 -0
- package/dist/marketing/components/Card.js.zyzz.json +1 -0
- package/dist/marketing/components/Contact.css +1 -0
- package/dist/marketing/components/Contact.d.ts +51 -0
- package/dist/marketing/components/Contact.d.ts.map +1 -0
- package/dist/marketing/components/Contact.js +44 -0
- package/dist/marketing/components/Contact.js.map +1 -0
- package/dist/marketing/components/Contact.js.zyzz.json +1 -0
- package/dist/marketing/components/Cta.css +1 -0
- package/dist/marketing/components/Cta.d.ts +138 -0
- package/dist/marketing/components/Cta.d.ts.map +1 -0
- package/dist/marketing/components/Cta.js +71 -0
- package/dist/marketing/components/Cta.js.map +1 -0
- package/dist/marketing/components/Cta.js.zyzz.json +1 -0
- package/dist/marketing/components/CustomerStoryFeature.css +1 -0
- package/dist/marketing/components/CustomerStoryFeature.d.ts +48 -0
- package/dist/marketing/components/CustomerStoryFeature.d.ts.map +1 -0
- package/dist/marketing/components/CustomerStoryFeature.js +58 -0
- package/dist/marketing/components/CustomerStoryFeature.js.map +1 -0
- package/dist/marketing/components/CustomerStoryFeature.js.zyzz.json +1 -0
- package/dist/marketing/components/Faq.css +1 -0
- package/dist/marketing/components/Faq.d.ts +99 -0
- package/dist/marketing/components/Faq.d.ts.map +1 -0
- package/dist/marketing/components/Faq.js +83 -0
- package/dist/marketing/components/Faq.js.map +1 -0
- package/dist/marketing/components/Faq.js.zyzz.json +1 -0
- package/dist/marketing/components/FeatureAccordion.css +1 -0
- package/dist/marketing/components/FeatureAccordion.d.ts +230 -0
- package/dist/marketing/components/FeatureAccordion.d.ts.map +1 -0
- package/dist/marketing/components/FeatureAccordion.js +117 -0
- package/dist/marketing/components/FeatureAccordion.js.map +1 -0
- package/dist/marketing/components/FeatureAccordion.js.zyzz.json +1 -0
- package/dist/marketing/components/Footer.css +1 -0
- package/dist/marketing/components/Footer.d.ts +178 -0
- package/dist/marketing/components/Footer.d.ts.map +1 -0
- package/dist/marketing/components/Footer.js +109 -0
- package/dist/marketing/components/Footer.js.map +1 -0
- package/dist/marketing/components/Footer.js.zyzz.json +1 -0
- package/dist/marketing/components/Hero.css +1 -0
- package/dist/marketing/components/Hero.d.ts +200 -0
- package/dist/marketing/components/Hero.d.ts.map +1 -0
- package/dist/marketing/components/Hero.js +67 -0
- package/dist/marketing/components/Hero.js.map +1 -0
- package/dist/marketing/components/Hero.js.zyzz.json +1 -0
- package/dist/marketing/components/LeadCapture.css +1 -0
- package/dist/marketing/components/LeadCapture.d.ts +102 -0
- package/dist/marketing/components/LeadCapture.d.ts.map +1 -0
- package/dist/marketing/components/LeadCapture.js +78 -0
- package/dist/marketing/components/LeadCapture.js.map +1 -0
- package/dist/marketing/components/LeadCapture.js.zyzz.json +1 -0
- package/dist/marketing/components/Link.css +1 -0
- package/dist/marketing/components/Link.d.ts +342 -0
- package/dist/marketing/components/Link.d.ts.map +1 -0
- package/dist/marketing/components/Link.js +152 -0
- package/dist/marketing/components/Link.js.map +1 -0
- package/dist/marketing/components/Link.js.zyzz.json +1 -0
- package/dist/marketing/components/Logo.css +1 -0
- package/dist/marketing/components/Logo.d.ts +30 -0
- package/dist/marketing/components/Logo.d.ts.map +1 -0
- package/dist/marketing/components/Logo.js +38 -0
- package/dist/marketing/components/Logo.js.map +1 -0
- package/dist/marketing/components/Logo.js.zyzz.json +1 -0
- package/dist/marketing/components/LogoWall.css +1 -0
- package/dist/marketing/components/LogoWall.d.ts +156 -0
- package/dist/marketing/components/LogoWall.d.ts.map +1 -0
- package/dist/marketing/components/LogoWall.js +41 -0
- package/dist/marketing/components/LogoWall.js.map +1 -0
- package/dist/marketing/components/LogoWall.js.zyzz.json +1 -0
- package/dist/marketing/components/Mark.css +1 -0
- package/dist/marketing/components/Mark.d.ts +30 -0
- package/dist/marketing/components/Mark.d.ts.map +1 -0
- package/dist/marketing/components/Mark.js +38 -0
- package/dist/marketing/components/Mark.js.map +1 -0
- package/dist/marketing/components/Mark.js.zyzz.json +1 -0
- package/dist/marketing/components/Media.css +1 -0
- package/dist/marketing/components/Media.d.ts +74 -0
- package/dist/marketing/components/Media.d.ts.map +1 -0
- package/dist/marketing/components/Media.js +80 -0
- package/dist/marketing/components/Media.js.map +1 -0
- package/dist/marketing/components/Media.js.zyzz.json +1 -0
- package/dist/marketing/components/Nav.css +1 -0
- package/dist/marketing/components/Nav.d.ts +303 -0
- package/dist/marketing/components/Nav.d.ts.map +1 -0
- package/dist/marketing/components/Nav.js +166 -0
- package/dist/marketing/components/Nav.js.map +1 -0
- package/dist/marketing/components/Nav.js.zyzz.json +1 -0
- package/dist/marketing/components/PartnersIndex.css +1 -0
- package/dist/marketing/components/PartnersIndex.d.ts +267 -0
- package/dist/marketing/components/PartnersIndex.d.ts.map +1 -0
- package/dist/marketing/components/PartnersIndex.js +96 -0
- package/dist/marketing/components/PartnersIndex.js.map +1 -0
- package/dist/marketing/components/PartnersIndex.js.zyzz.json +1 -0
- package/dist/marketing/components/QuoteBand.css +1 -0
- package/dist/marketing/components/QuoteBand.d.ts +128 -0
- package/dist/marketing/components/QuoteBand.d.ts.map +1 -0
- package/dist/marketing/components/QuoteBand.js +73 -0
- package/dist/marketing/components/QuoteBand.js.map +1 -0
- package/dist/marketing/components/QuoteBand.js.zyzz.json +1 -0
- package/dist/marketing/components/Section.css +1 -0
- package/dist/marketing/components/Section.d.ts +132 -0
- package/dist/marketing/components/Section.d.ts.map +1 -0
- package/dist/marketing/components/Section.js +33 -0
- package/dist/marketing/components/Section.js.map +1 -0
- package/dist/marketing/components/Section.js.zyzz.json +1 -0
- package/dist/marketing/components/SectionHeading.css +1 -0
- package/dist/marketing/components/SectionHeading.d.ts +215 -0
- package/dist/marketing/components/SectionHeading.d.ts.map +1 -0
- package/dist/marketing/components/SectionHeading.js +48 -0
- package/dist/marketing/components/SectionHeading.js.map +1 -0
- package/dist/marketing/components/SectionHeading.js.zyzz.json +1 -0
- package/dist/marketing/components/Showcase.css +1 -0
- package/dist/marketing/components/Showcase.d.ts +269 -0
- package/dist/marketing/components/Showcase.d.ts.map +1 -0
- package/dist/marketing/components/Showcase.js +67 -0
- package/dist/marketing/components/Showcase.js.map +1 -0
- package/dist/marketing/components/Showcase.js.zyzz.json +1 -0
- package/dist/marketing/components/Stats.css +1 -0
- package/dist/marketing/components/Stats.d.ts +133 -0
- package/dist/marketing/components/Stats.d.ts.map +1 -0
- package/dist/marketing/components/Stats.js +34 -0
- package/dist/marketing/components/Stats.js.map +1 -0
- package/dist/marketing/components/Stats.js.zyzz.json +1 -0
- package/dist/marketing/components/Steps.css +1 -0
- package/dist/marketing/components/Steps.d.ts +53 -0
- package/dist/marketing/components/Steps.d.ts.map +1 -0
- package/dist/marketing/components/Steps.js +78 -0
- package/dist/marketing/components/Steps.js.map +1 -0
- package/dist/marketing/components/Steps.js.zyzz.json +1 -0
- package/dist/marketing/components/SymbolTile.css +1 -0
- package/dist/marketing/components/SymbolTile.d.ts +85 -0
- package/dist/marketing/components/SymbolTile.d.ts.map +1 -0
- package/dist/marketing/components/SymbolTile.js +35 -0
- package/dist/marketing/components/SymbolTile.js.map +1 -0
- package/dist/marketing/components/SymbolTile.js.zyzz.json +1 -0
- package/dist/marketing/components/Tab.css +1 -0
- package/dist/marketing/components/Tab.d.ts +280 -0
- package/dist/marketing/components/Tab.d.ts.map +1 -0
- package/dist/marketing/components/Tab.js +43 -0
- package/dist/marketing/components/Tab.js.map +1 -0
- package/dist/marketing/components/Tab.js.zyzz.json +1 -0
- package/dist/marketing/components/Table.css +1 -0
- package/dist/marketing/components/Table.d.ts +157 -0
- package/dist/marketing/components/Table.d.ts.map +1 -0
- package/dist/marketing/components/Table.js +80 -0
- package/dist/marketing/components/Table.js.map +1 -0
- package/dist/marketing/components/Table.js.zyzz.json +1 -0
- package/dist/marketing/components/Tag.css +1 -0
- package/dist/marketing/components/Tag.d.ts +254 -0
- package/dist/marketing/components/Tag.d.ts.map +1 -0
- package/dist/marketing/components/Tag.js +59 -0
- package/dist/marketing/components/Tag.js.map +1 -0
- package/dist/marketing/components/Tag.js.zyzz.json +1 -0
- package/dist/marketing/components/internal/Links.d.ts +9 -0
- package/dist/marketing/components/internal/Links.d.ts.map +1 -0
- package/dist/marketing/components/internal/Links.js +15 -0
- package/dist/marketing/components/internal/Links.js.map +1 -0
- package/dist/marketing/icons/ArrowUpRight.d.ts +6 -0
- package/dist/marketing/icons/ArrowUpRight.d.ts.map +1 -0
- package/dist/marketing/icons/ArrowUpRight.js +5 -0
- package/dist/marketing/icons/ArrowUpRight.js.map +1 -0
- package/dist/marketing/icons/Checkmark.d.ts +6 -0
- package/dist/marketing/icons/Checkmark.d.ts.map +1 -0
- package/dist/marketing/icons/Checkmark.js +5 -0
- package/dist/marketing/icons/Checkmark.js.map +1 -0
- package/dist/marketing/icons/ChevronRight.d.ts +6 -0
- package/dist/marketing/icons/ChevronRight.d.ts.map +1 -0
- package/dist/marketing/icons/ChevronRight.js +5 -0
- package/dist/marketing/icons/ChevronRight.js.map +1 -0
- package/dist/marketing/icons/Link.d.ts +6 -0
- package/dist/marketing/icons/Link.d.ts.map +1 -0
- package/dist/marketing/icons/Link.js +5 -0
- package/dist/marketing/icons/Link.js.map +1 -0
- package/dist/marketing/icons/Play.d.ts +6 -0
- package/dist/marketing/icons/Play.d.ts.map +1 -0
- package/dist/marketing/icons/Play.js +5 -0
- package/dist/marketing/icons/Play.js.map +1 -0
- package/dist/marketing/icons/Spinner.d.ts +6 -0
- package/dist/marketing/icons/Spinner.d.ts.map +1 -0
- package/dist/marketing/icons/Spinner.js +5 -0
- package/dist/marketing/icons/Spinner.js.map +1 -0
- package/dist/marketing/icons/Xmark.d.ts +6 -0
- package/dist/marketing/icons/Xmark.d.ts.map +1 -0
- package/dist/marketing/icons/Xmark.js +5 -0
- package/dist/marketing/icons/Xmark.js.map +1 -0
- package/dist/marketing/index.d.ts +34 -1
- package/dist/marketing/index.d.ts.map +1 -1
- package/dist/marketing/index.js +34 -1
- package/dist/marketing/index.js.map +1 -1
- package/dist/marketing/index.js.zyzz.json +1 -1
- package/package.json +8 -2
- package/src/arsenal/icons/CATALOGUE.md +471 -0
- package/src/arsenal/icons/CHANGELOG.md +181 -0
- package/src/arsenal/icons/Icon.tsx +187 -0
- package/src/arsenal/icons/README.md +53 -0
- package/src/arsenal/icons/glyphs.ts +2901 -0
- package/src/arsenal/icons/index.ts +12 -0
- package/src/marketing/README.md +13 -1
- package/src/marketing/components/ArticleBody.tsx +784 -0
- package/src/marketing/components/ArticleHero.tsx +331 -0
- package/src/marketing/components/ArticleIndex.tsx +457 -0
- package/src/marketing/components/ArticleRail.tsx +384 -0
- package/src/marketing/components/AsideLayout.tsx +52 -0
- package/src/marketing/components/Breadcrumbs.tsx +197 -0
- package/src/marketing/components/Button.tsx +469 -0
- package/src/marketing/components/Card.tsx +865 -0
- package/src/marketing/components/Contact.tsx +157 -0
- package/src/marketing/components/Cta.tsx +297 -0
- package/src/marketing/components/CustomerStoryFeature.tsx +218 -0
- package/src/marketing/components/Faq.tsx +334 -0
- package/src/marketing/components/FeatureAccordion.tsx +459 -0
- package/src/marketing/components/Footer.tsx +440 -0
- package/src/marketing/components/Hero.tsx +275 -0
- package/src/marketing/components/LeadCapture.tsx +322 -0
- package/src/marketing/components/Link.tsx +508 -0
- package/src/marketing/components/Logo.tsx +71 -0
- package/src/marketing/components/LogoWall.tsx +185 -0
- package/src/marketing/components/Mark.tsx +67 -0
- package/src/marketing/components/Media.tsx +275 -0
- package/src/marketing/components/Nav.tsx +1030 -0
- package/src/marketing/components/PartnersIndex.tsx +448 -0
- package/src/marketing/components/QuoteBand.tsx +288 -0
- package/src/marketing/components/Section.tsx +110 -0
- package/src/marketing/components/SectionHeading.tsx +227 -0
- package/src/marketing/components/Showcase.tsx +301 -0
- package/src/marketing/components/Stats.tsx +130 -0
- package/src/marketing/components/Steps.tsx +215 -0
- package/src/marketing/components/SymbolTile.tsx +89 -0
- package/src/marketing/components/Tab.tsx +306 -0
- package/src/marketing/components/Table.tsx +255 -0
- package/src/marketing/components/Tag.tsx +289 -0
- package/src/marketing/components/internal/Links.ts +19 -0
- package/src/marketing/icons/ArrowUpRight.tsx +25 -0
- package/src/marketing/icons/Checkmark.tsx +25 -0
- package/src/marketing/icons/ChevronRight.tsx +25 -0
- package/src/marketing/icons/Link.tsx +25 -0
- package/src/marketing/icons/Play.tsx +25 -0
- package/src/marketing/icons/Spinner.tsx +25 -0
- package/src/marketing/icons/Xmark.tsx +25 -0
- package/src/marketing/index.ts +34 -1
|
@@ -0,0 +1,865 @@
|
|
|
1
|
+
/** Renders a Marketing card or ruled row that links a story, article, partner or guide, and the grid that lays cards out. @module */
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render'
|
|
3
|
+
import {
|
|
4
|
+
Children,
|
|
5
|
+
type ComponentPropsWithRef,
|
|
6
|
+
type FocusEvent,
|
|
7
|
+
type MouseEvent,
|
|
8
|
+
type ReactNode,
|
|
9
|
+
} from 'react'
|
|
10
|
+
import type * as zyzz from 'zyzz'
|
|
11
|
+
import { Play } from '../icons/Play.js'
|
|
12
|
+
import { style, variants } from '../zyzz.config.js'
|
|
13
|
+
import { Link } from './Link.js'
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A card in an `<article>`. On the linked jobs the title's link stretches over the whole card, so a
|
|
17
|
+
* press anywhere on it follows the link, and the card ends in a `Link.Cue`. While the pointer is on
|
|
18
|
+
* a linked card, the cue turns black and a photo zooms. A press dims the card to 72%, and keyboard
|
|
19
|
+
* focus rings the card. The `feature` and `panel` jobs hold copy and an optional `action`, and have
|
|
20
|
+
* no states of their own.
|
|
21
|
+
*
|
|
22
|
+
* - `link`: a white card with optional 16:10 `media` at the top. Set `preview` for a customer
|
|
23
|
+
* story's muted loop, which plays while the pointer or focus is on the card.
|
|
24
|
+
* - `compact`: a directory card led by a badge in `media`, with a chevron at its end.
|
|
25
|
+
* - `row`: a ruled row in a `Card.Grid` of `rows`, whose arrow a mouse reveals.
|
|
26
|
+
* - `photo`: the title on an inverse photo, over the scrim, with an optional `icon` badge. Leave out
|
|
27
|
+
* `href` for a card that names a role and links nowhere.
|
|
28
|
+
* - `feature`: a column of copy under its 1:1 art tile, and `panel`: a block at the 24px corner in
|
|
29
|
+
* any `tone`.
|
|
30
|
+
* - Give a `link` card a `cue` of two or three words, such as Read story, or it ends bare.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* <Card.Grid columns="2">
|
|
34
|
+
* <Card cue="Read story" eyebrow="ARQ" href="/customer-stories/arq" title="ARQ launches USDs on Tempo" />
|
|
35
|
+
* </Card.Grid>
|
|
36
|
+
*
|
|
37
|
+
* @see {@link https://base-ui.com/react/utils/use-render | Base UI useRender}
|
|
38
|
+
* @see {@link https://www.w3.org/WAI/WCAG22/Understanding/link-purpose-in-context.html | WCAG 2.2 Link Purpose (In Context)}
|
|
39
|
+
* @see {@link https://www.w3.org/WAI/WCAG22/Understanding/focus-visible.html | WCAG 2.2 Focus Visible}
|
|
40
|
+
*/
|
|
41
|
+
export function Card(props: Card.Props) {
|
|
42
|
+
const {
|
|
43
|
+
action,
|
|
44
|
+
as: Title = 'h3',
|
|
45
|
+
className,
|
|
46
|
+
cue,
|
|
47
|
+
description,
|
|
48
|
+
external = false,
|
|
49
|
+
externalHint,
|
|
50
|
+
eyebrow,
|
|
51
|
+
href,
|
|
52
|
+
icon,
|
|
53
|
+
job = 'link',
|
|
54
|
+
media,
|
|
55
|
+
mediaKind,
|
|
56
|
+
newTab = false,
|
|
57
|
+
newTabHint,
|
|
58
|
+
preview,
|
|
59
|
+
ref,
|
|
60
|
+
render,
|
|
61
|
+
title,
|
|
62
|
+
tone,
|
|
63
|
+
vars,
|
|
64
|
+
...attributes
|
|
65
|
+
} = props
|
|
66
|
+
|
|
67
|
+
const linked = job === 'compact' || job === 'link' || job === 'row' || href !== undefined
|
|
68
|
+
const inverse = job === 'photo' || (job === 'panel' && tone === 'inverse')
|
|
69
|
+
const fill = tone ?? (job === 'panel' ? 'grey' : 'white')
|
|
70
|
+
|
|
71
|
+
const link = useRender({
|
|
72
|
+
defaultTagName: 'a',
|
|
73
|
+
props: {
|
|
74
|
+
'data-card-link': '',
|
|
75
|
+
...(href === undefined ? {} : { href }),
|
|
76
|
+
...(newTab ? { rel: 'noopener', target: '_blank' } : {}),
|
|
77
|
+
...styles.link({ job: job === 'row' ? 'row' : 'still' }),
|
|
78
|
+
children: (
|
|
79
|
+
<>
|
|
80
|
+
{title}
|
|
81
|
+
<Hint
|
|
82
|
+
external={external}
|
|
83
|
+
externalHint={externalHint}
|
|
84
|
+
newTab={newTab}
|
|
85
|
+
newTabHint={newTabHint}
|
|
86
|
+
/>
|
|
87
|
+
</>
|
|
88
|
+
),
|
|
89
|
+
},
|
|
90
|
+
render,
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
// A photo card ends in its title. A link card ends in a cue only when it has a label.
|
|
94
|
+
const ending = (() => {
|
|
95
|
+
if (!linked || job === 'photo' || job === 'feature' || job === 'panel') return null
|
|
96
|
+
if (job === 'link' && cue === undefined) return null
|
|
97
|
+
|
|
98
|
+
const icon = external ? 'external' : 'chevron'
|
|
99
|
+
const element =
|
|
100
|
+
cue === undefined ? (
|
|
101
|
+
<Link.Cue aria-hidden="true" icon={icon} reveal={job === 'row'} />
|
|
102
|
+
) : (
|
|
103
|
+
<Link.Cue aria-hidden="true" icon={icon}>
|
|
104
|
+
{cue}
|
|
105
|
+
</Link.Cue>
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
return <span {...styles.cue({ job })}>{element}</span>
|
|
109
|
+
})()
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<article
|
|
113
|
+
{...attributes}
|
|
114
|
+
{...styles.root({ className, job, style: props.style, tone: fill, vars })}
|
|
115
|
+
data-cue-host={linked ? '' : undefined}
|
|
116
|
+
data-inverse={inverse ? '' : undefined}
|
|
117
|
+
onBlur={preview === undefined ? attributes.onBlur : stop(attributes.onBlur)}
|
|
118
|
+
onFocus={preview === undefined ? attributes.onFocus : play(attributes.onFocus)}
|
|
119
|
+
onMouseEnter={preview === undefined ? attributes.onMouseEnter : play(attributes.onMouseEnter)}
|
|
120
|
+
onMouseLeave={preview === undefined ? attributes.onMouseLeave : stop(attributes.onMouseLeave)}
|
|
121
|
+
ref={ref}
|
|
122
|
+
>
|
|
123
|
+
{media !== undefined && (job === 'link' || job === 'photo') && (
|
|
124
|
+
<div {...styles.media({ job })}>
|
|
125
|
+
<div {...styles.zoom({ kind: mediaKind })}>
|
|
126
|
+
{media}
|
|
127
|
+
{preview !== undefined && job === 'link' && (
|
|
128
|
+
<video
|
|
129
|
+
aria-hidden="true"
|
|
130
|
+
loop
|
|
131
|
+
muted
|
|
132
|
+
playsInline
|
|
133
|
+
preload="metadata"
|
|
134
|
+
src={preview}
|
|
135
|
+
{...styles.preview()}
|
|
136
|
+
/>
|
|
137
|
+
)}
|
|
138
|
+
</div>
|
|
139
|
+
{preview !== undefined && job === 'link' && (
|
|
140
|
+
<span aria-hidden="true" {...styles.indicator()}>
|
|
141
|
+
<Play {...styles.glyph()} />
|
|
142
|
+
</span>
|
|
143
|
+
)}
|
|
144
|
+
</div>
|
|
145
|
+
)}
|
|
146
|
+
{media !== undefined && (job === 'feature' || job === 'panel') && (
|
|
147
|
+
<div {...styles.tile({ job })}>{media}</div>
|
|
148
|
+
)}
|
|
149
|
+
{media !== undefined && job === 'compact' && media}
|
|
150
|
+
{icon !== undefined && job === 'photo' && (
|
|
151
|
+
<span aria-hidden="true" {...styles.badge()}>
|
|
152
|
+
{icon}
|
|
153
|
+
</span>
|
|
154
|
+
)}
|
|
155
|
+
<div {...styles.body({ job })}>
|
|
156
|
+
{eyebrow !== undefined && <p {...styles.eyebrow()}>{eyebrow}</p>}
|
|
157
|
+
<Title {...styles.title()}>{linked ? link : title}</Title>
|
|
158
|
+
{description !== undefined && <p {...styles.description()}>{description}</p>}
|
|
159
|
+
{job === 'link' && ending}
|
|
160
|
+
{action !== undefined && <div {...styles.action()}>{action}</div>}
|
|
161
|
+
</div>
|
|
162
|
+
{(job === 'compact' || job === 'row') && ending}
|
|
163
|
+
</article>
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export namespace Card {
|
|
168
|
+
type Job = NonNullable<zyzz.Props.Variants<typeof styles.root>['job']>
|
|
169
|
+
|
|
170
|
+
type Common = Omit<ComponentPropsWithRef<'article'>, 'title'> &
|
|
171
|
+
Omit<zyzz.Props.Variants<typeof styles.root>, 'job'> & {
|
|
172
|
+
/** The heading level of the title. @default 'h3' */
|
|
173
|
+
as?: 'h2' | 'h3' | 'h4' | undefined
|
|
174
|
+
/** The copy under the title, in Body B2 at 56% black. */
|
|
175
|
+
description?: ReactNode | undefined
|
|
176
|
+
/** The label over the title, such as a category or a company. */
|
|
177
|
+
eyebrow?: ReactNode | undefined
|
|
178
|
+
/**
|
|
179
|
+
* The card's media. A link card's 16:10 media at the top, a photo card's photo under its
|
|
180
|
+
* copy, a compact card's badge, a feature's 1:1 art tile, or a panel's art.
|
|
181
|
+
*/
|
|
182
|
+
media?: ReactNode | undefined
|
|
183
|
+
/**
|
|
184
|
+
* What a link or photo card's media holds: a `photo`, or a video's poster, which zooms while
|
|
185
|
+
* the pointer is on the card, or `art`, which holds still.
|
|
186
|
+
*
|
|
187
|
+
* @default 'photo'
|
|
188
|
+
*/
|
|
189
|
+
mediaKind?: zyzz.Props.Variants<typeof styles.zoom>['kind']
|
|
190
|
+
/** The title: the card's one link on the linked jobs, or a heading. */
|
|
191
|
+
title: ReactNode
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
type Linked = Link.Hints & {
|
|
195
|
+
action?: never
|
|
196
|
+
/**
|
|
197
|
+
* The cue's label, such as Read story. Without one, a link card ends in no cue, a compact card
|
|
198
|
+
* in its resting chevron, and a row in a bare arrow that a mouse reveals.
|
|
199
|
+
*/
|
|
200
|
+
cue?: ReactNode | undefined
|
|
201
|
+
/**
|
|
202
|
+
* Marks a link that leaves the site: the cue becomes an arrow up right, and the link's name
|
|
203
|
+
* ends in a hidden hint.
|
|
204
|
+
*
|
|
205
|
+
* @default false
|
|
206
|
+
*/
|
|
207
|
+
external?: boolean | undefined
|
|
208
|
+
/** Where the title's link goes. A photo card without it links nowhere. */
|
|
209
|
+
href?: string | undefined
|
|
210
|
+
/** A photo card's badge, such as a 16px icon, at its top start. */
|
|
211
|
+
icon?: ReactNode | undefined
|
|
212
|
+
/**
|
|
213
|
+
* `link`, the default: a white card. `compact`: a directory card led by a badge. `row`: a
|
|
214
|
+
* ruled row. `photo`: the title on an inverse photo.
|
|
215
|
+
*
|
|
216
|
+
* @default 'link'
|
|
217
|
+
*/
|
|
218
|
+
job?: Exclude<Job, 'feature' | 'panel'> | undefined
|
|
219
|
+
/**
|
|
220
|
+
* Opens the link in a new tab, and ends its name in a hidden hint.
|
|
221
|
+
*
|
|
222
|
+
* @default false
|
|
223
|
+
*/
|
|
224
|
+
newTab?: boolean | undefined
|
|
225
|
+
/**
|
|
226
|
+
* The URL of a link card's muted loop, such as a customer story's preview. It fades in and
|
|
227
|
+
* plays while the pointer or keyboard focus is on the card, and never under reduced motion.
|
|
228
|
+
*/
|
|
229
|
+
preview?: string | undefined
|
|
230
|
+
/** A router link for the title, such as `<NextLink href="/customer-stories/arq" />`. */
|
|
231
|
+
render?: useRender.ComponentProps<'a'>['render'] | undefined
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
type Still = {
|
|
235
|
+
/** A `Link` or a `Button` under the copy. The card itself does not link. */
|
|
236
|
+
action?: ReactNode | undefined
|
|
237
|
+
cue?: never
|
|
238
|
+
external?: never
|
|
239
|
+
externalHint?: never
|
|
240
|
+
href?: never
|
|
241
|
+
icon?: never
|
|
242
|
+
/** `feature`: a column of copy under its art tile. `panel`: a block at the 24px corner. */
|
|
243
|
+
job: Extract<Job, 'feature' | 'panel'>
|
|
244
|
+
newTab?: never
|
|
245
|
+
newTabHint?: never
|
|
246
|
+
preview?: never
|
|
247
|
+
render?: never
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export type Props = Common & (Linked | Still)
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Cards in a `<ul>`, each in an `<li>`: one column on phones, two from 768px, and three or four
|
|
254
|
+
* from 1024px, a page gutter apart. `rows` sets ruled rows with a rule closing the list. `set`
|
|
255
|
+
* draws a row of features as one outlined panel at the 24px corner, split by full-height rules.
|
|
256
|
+
* Name the list with `aria-label` where no heading names it.
|
|
257
|
+
*/
|
|
258
|
+
export function Grid(props: Grid.Props) {
|
|
259
|
+
const { children, className, columns, set, vars, ...attributes } = props
|
|
260
|
+
|
|
261
|
+
return (
|
|
262
|
+
<ul {...attributes} {...styles.grid({ className, columns, set, style: props.style, vars })}>
|
|
263
|
+
{Children.map(Children.toArray(children), (child) => (
|
|
264
|
+
<li {...styles.item()}>{child}</li>
|
|
265
|
+
))}
|
|
266
|
+
</ul>
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export namespace Grid {
|
|
271
|
+
export type Props = ComponentPropsWithRef<'ul'> & zyzz.Props.Variants<typeof styles.grid>
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* The hidden words that end the title link's name. A link that opens a new tab says so, and one
|
|
277
|
+
* that leaves the site names an external site. An English default is marked as English.
|
|
278
|
+
*/
|
|
279
|
+
function Hint(props: Hint.Props) {
|
|
280
|
+
const { external, externalHint, newTab, newTabHint } = props
|
|
281
|
+
|
|
282
|
+
const hint = (() => {
|
|
283
|
+
if (newTab)
|
|
284
|
+
return {
|
|
285
|
+
lang: newTabHint === undefined ? 'en' : undefined,
|
|
286
|
+
text: newTabHint ?? '(opens in a new tab)',
|
|
287
|
+
}
|
|
288
|
+
if (external)
|
|
289
|
+
return {
|
|
290
|
+
lang: externalHint === undefined ? 'en' : undefined,
|
|
291
|
+
text: externalHint ?? '(external site)',
|
|
292
|
+
}
|
|
293
|
+
return undefined
|
|
294
|
+
})()
|
|
295
|
+
|
|
296
|
+
if (!hint) return null
|
|
297
|
+
|
|
298
|
+
return (
|
|
299
|
+
<span lang={hint.lang} {...styles.hint()}>
|
|
300
|
+
{' '}
|
|
301
|
+
{hint.text}
|
|
302
|
+
</span>
|
|
303
|
+
)
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
declare namespace Hint {
|
|
307
|
+
type Props = Link.Hints & { external: boolean; newTab: boolean }
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** Plays a card's preview from the start, unless the reader asks for reduced motion. */
|
|
311
|
+
function play<event extends FocusEvent<HTMLElement> | MouseEvent<HTMLElement>>(
|
|
312
|
+
handler: ((event: event) => void) | undefined,
|
|
313
|
+
) {
|
|
314
|
+
return (event: event) => {
|
|
315
|
+
handler?.(event)
|
|
316
|
+
|
|
317
|
+
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return
|
|
318
|
+
|
|
319
|
+
const video = event.currentTarget.querySelector('video')
|
|
320
|
+
if (!video) return
|
|
321
|
+
|
|
322
|
+
video.currentTime = 0
|
|
323
|
+
void video.play().catch(() => {})
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/** Stops a card's preview and rewinds it. */
|
|
328
|
+
function stop<event extends FocusEvent<HTMLElement> | MouseEvent<HTMLElement>>(
|
|
329
|
+
handler: ((event: event) => void) | undefined,
|
|
330
|
+
) {
|
|
331
|
+
return (event: event) => {
|
|
332
|
+
handler?.(event)
|
|
333
|
+
|
|
334
|
+
const video = event.currentTarget.querySelector('video')
|
|
335
|
+
if (!video) return
|
|
336
|
+
|
|
337
|
+
video.pause()
|
|
338
|
+
video.currentTime = 0
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
namespace styles {
|
|
343
|
+
// A feature's or panel's action, 24px under the copy.
|
|
344
|
+
export const action = style(
|
|
345
|
+
{ display: 'flex', marginBlockStart: 'auto !custom', paddingBlockStart: '24' },
|
|
346
|
+
{ id: 'tds/marketing/card/action' },
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
// A photo card's badge at its top start, frosted at the 8px corner, the icon in white.
|
|
350
|
+
export const badge = style(
|
|
351
|
+
{
|
|
352
|
+
alignSelf: 'start',
|
|
353
|
+
backdropFilter: 'blur(10px) !custom',
|
|
354
|
+
backgroundColor: 'rgba(204, 204, 204, 0.3) !custom',
|
|
355
|
+
borderRadius: '2xs',
|
|
356
|
+
color: 'neutral.000',
|
|
357
|
+
display: 'flex',
|
|
358
|
+
fontSize: '16px !custom',
|
|
359
|
+
gridArea: '1 / 1 !custom',
|
|
360
|
+
justifySelf: 'start',
|
|
361
|
+
margin: '24',
|
|
362
|
+
padding: '10px !custom',
|
|
363
|
+
pointerEvents: 'none',
|
|
364
|
+
zIndex: '1 !custom',
|
|
365
|
+
'@media >=1024': { margin: '32' },
|
|
366
|
+
},
|
|
367
|
+
{ id: 'tds/marketing/card/badge' },
|
|
368
|
+
)
|
|
369
|
+
|
|
370
|
+
// The copy: eyebrow, 12px to the title, the card pair's gap to the description, and the cue row
|
|
371
|
+
// pushed to the card's end, so a grid's cues line up.
|
|
372
|
+
export const body = variants(
|
|
373
|
+
{
|
|
374
|
+
base: { display: 'flex', flex: '1 !custom', flexDirection: 'column', minInlineSize: '0' },
|
|
375
|
+
defaultVariants: { job: 'link' },
|
|
376
|
+
variants: {
|
|
377
|
+
job: {
|
|
378
|
+
compact: {},
|
|
379
|
+
feature: {},
|
|
380
|
+
link: { padding: '24', '@media >=1024': { padding: '32' } },
|
|
381
|
+
panel: {},
|
|
382
|
+
// On the photo, at its end. A z-index lifts the copy over the media and scrim without
|
|
383
|
+
// making the body the link's containing block, so the link still stretches over the card.
|
|
384
|
+
photo: {
|
|
385
|
+
alignSelf: 'end',
|
|
386
|
+
gridArea: '1 / 1 !custom',
|
|
387
|
+
padding: '24',
|
|
388
|
+
zIndex: '1 !custom',
|
|
389
|
+
'@media >=1024': { padding: '32' },
|
|
390
|
+
},
|
|
391
|
+
row: {},
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
{ id: 'tds/marketing/card/body' },
|
|
396
|
+
)
|
|
397
|
+
|
|
398
|
+
// The cue row: 24px under a link card's copy, at the end of a compact card, beside a row's title.
|
|
399
|
+
export const cue = variants(
|
|
400
|
+
{
|
|
401
|
+
base: { flexShrink: '0 !custom' },
|
|
402
|
+
defaultVariants: { job: 'link' },
|
|
403
|
+
variants: {
|
|
404
|
+
job: {
|
|
405
|
+
compact: { marginInlineStart: 'auto !custom' },
|
|
406
|
+
link: { marginBlockStart: 'auto !custom', paddingBlockStart: '24' },
|
|
407
|
+
row: {},
|
|
408
|
+
},
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
{ id: 'tds/marketing/card/cue' },
|
|
412
|
+
)
|
|
413
|
+
|
|
414
|
+
// Secondary on white and grey, and inverse secondary on the photo and inverse cards.
|
|
415
|
+
export const description = style(
|
|
416
|
+
{
|
|
417
|
+
color: 'content.secondary',
|
|
418
|
+
margin: '0',
|
|
419
|
+
marginBlockStart: 'textPair.h4B1',
|
|
420
|
+
textWrap: 'pretty',
|
|
421
|
+
typography: 'body.b2',
|
|
422
|
+
selectors: { '[data-inverse] &': { color: 'inverse.content.secondary' } },
|
|
423
|
+
},
|
|
424
|
+
{ id: 'tds/marketing/card/description' },
|
|
425
|
+
)
|
|
426
|
+
|
|
427
|
+
export const eyebrow = style(
|
|
428
|
+
{
|
|
429
|
+
color: 'content.secondary',
|
|
430
|
+
margin: '0',
|
|
431
|
+
marginBlockEnd: '12',
|
|
432
|
+
textTransform: 'uppercase',
|
|
433
|
+
typography: 'utility.eyebrow',
|
|
434
|
+
selectors: { '[data-inverse] &': { color: 'inverse.content.secondary' } },
|
|
435
|
+
},
|
|
436
|
+
{ id: 'tds/marketing/card/eyebrow' },
|
|
437
|
+
)
|
|
438
|
+
|
|
439
|
+
export const glyph = style(
|
|
440
|
+
{ flexShrink: '0 !custom', fontSize: '16px !custom' },
|
|
441
|
+
{ id: 'tds/marketing/card/glyph' },
|
|
442
|
+
)
|
|
443
|
+
|
|
444
|
+
// Cards in a list, a page gutter apart, or rows, ruled by their own cards, with a rule closing the
|
|
445
|
+
// list. Column templates have no tokens.
|
|
446
|
+
export const grid = variants(
|
|
447
|
+
{
|
|
448
|
+
base: {
|
|
449
|
+
display: 'grid',
|
|
450
|
+
gridTemplateColumns: 'minmax(0, 1fr) !custom',
|
|
451
|
+
listStyle: 'none !custom',
|
|
452
|
+
margin: '0',
|
|
453
|
+
padding: '0',
|
|
454
|
+
},
|
|
455
|
+
defaultVariants: { columns: '3', set: false },
|
|
456
|
+
variants: {
|
|
457
|
+
/**
|
|
458
|
+
* The columns: `2`, `3` or `4` from 1024px (two from 768px, one below), or `rows`, ruled rows
|
|
459
|
+
* with a rule closing the list.
|
|
460
|
+
*
|
|
461
|
+
* @default '3'
|
|
462
|
+
*/
|
|
463
|
+
columns: {
|
|
464
|
+
'2': {
|
|
465
|
+
gap: 'page.gutter',
|
|
466
|
+
'@media >=768': { gridTemplateColumns: 'repeat(2, minmax(0, 1fr)) !custom' },
|
|
467
|
+
},
|
|
468
|
+
'3': {
|
|
469
|
+
gap: 'page.gutter',
|
|
470
|
+
'@media >=768': { gridTemplateColumns: 'repeat(2, minmax(0, 1fr)) !custom' },
|
|
471
|
+
'@media >=1024': { gridTemplateColumns: 'repeat(3, minmax(0, 1fr)) !custom' },
|
|
472
|
+
},
|
|
473
|
+
'4': {
|
|
474
|
+
gap: 'page.gutter',
|
|
475
|
+
'@media >=768': { gridTemplateColumns: 'repeat(2, minmax(0, 1fr)) !custom' },
|
|
476
|
+
'@media >=1024': { gridTemplateColumns: 'repeat(4, minmax(0, 1fr)) !custom' },
|
|
477
|
+
},
|
|
478
|
+
rows: {
|
|
479
|
+
borderBlockEndColor: 'line.primary',
|
|
480
|
+
borderBlockEndStyle: 'solid',
|
|
481
|
+
borderBlockEndWidth: 'regular',
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
/**
|
|
485
|
+
* Draws a row of features as one outlined panel at the 24px corner: no gap, each feature
|
|
486
|
+
* 24px inside (32px from 1024px), split by full-height rules. Every item rules its start
|
|
487
|
+
* edges and sits one rule over the panel's edge, which clips them, so the rules follow any
|
|
488
|
+
* column count.
|
|
489
|
+
*
|
|
490
|
+
* @default false
|
|
491
|
+
*/
|
|
492
|
+
set: {
|
|
493
|
+
false: {},
|
|
494
|
+
true: {
|
|
495
|
+
borderColor: 'line.secondary',
|
|
496
|
+
borderRadius: 'md',
|
|
497
|
+
borderStyle: 'solid',
|
|
498
|
+
borderWidth: 'regular',
|
|
499
|
+
gap: '0',
|
|
500
|
+
overflow: 'clip',
|
|
501
|
+
selectors: {
|
|
502
|
+
'& > li': {
|
|
503
|
+
borderBlockStartColor: 'line.secondary',
|
|
504
|
+
borderBlockStartStyle: 'solid',
|
|
505
|
+
borderBlockStartWidth: 'regular',
|
|
506
|
+
borderInlineStartColor: 'line.secondary',
|
|
507
|
+
borderInlineStartStyle: 'solid',
|
|
508
|
+
borderInlineStartWidth: 'regular',
|
|
509
|
+
marginBlockStart: '-1px !custom',
|
|
510
|
+
marginInlineStart: '-1px !custom',
|
|
511
|
+
padding: '24',
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
'@media >=1024': { selectors: { '& > li': { padding: '32' } } },
|
|
515
|
+
},
|
|
516
|
+
},
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
{ id: 'tds/marketing/card/grid' },
|
|
520
|
+
)
|
|
521
|
+
|
|
522
|
+
export const hint = style(
|
|
523
|
+
{
|
|
524
|
+
borderWidth: 'none',
|
|
525
|
+
clip: 'rect(0 0 0 0) !custom',
|
|
526
|
+
height: '1px !custom',
|
|
527
|
+
margin: '-1px !custom',
|
|
528
|
+
overflow: 'hidden',
|
|
529
|
+
padding: '0',
|
|
530
|
+
position: 'absolute',
|
|
531
|
+
whiteSpace: 'nowrap',
|
|
532
|
+
width: '1px !custom',
|
|
533
|
+
},
|
|
534
|
+
{ id: 'tds/marketing/card/hint' },
|
|
535
|
+
)
|
|
536
|
+
|
|
537
|
+
// The playback look on a decorative badge: the whole card is the link, so it cannot hold a button.
|
|
538
|
+
export const indicator = style(
|
|
539
|
+
{
|
|
540
|
+
backdropFilter: 'blur(10px) brightness(0.8) !custom',
|
|
541
|
+
backgroundColor: 'neutral.glass.032',
|
|
542
|
+
blockSize: 'hitMin',
|
|
543
|
+
borderRadius: 'full',
|
|
544
|
+
color: 'inverse.content.primary',
|
|
545
|
+
cornerShape: 'round',
|
|
546
|
+
display: 'grid',
|
|
547
|
+
gridArea: '1 / 1 !custom',
|
|
548
|
+
inlineSize: 'hitMin',
|
|
549
|
+
placeItems: 'center',
|
|
550
|
+
placeSelf: 'center',
|
|
551
|
+
pointerEvents: 'none',
|
|
552
|
+
zIndex: '1 !custom',
|
|
553
|
+
},
|
|
554
|
+
{ id: 'tds/marketing/card/indicator' },
|
|
555
|
+
)
|
|
556
|
+
|
|
557
|
+
// Each item holds one card, which fills it, so a row's cards match.
|
|
558
|
+
export const item = style(
|
|
559
|
+
{ display: 'grid', minInlineSize: '0' },
|
|
560
|
+
{ id: 'tds/marketing/card/item' },
|
|
561
|
+
)
|
|
562
|
+
|
|
563
|
+
// The one link, stretched over the card: the ring and the press belong to the card, so the link
|
|
564
|
+
// draws neither. A row's title takes the link hover, black dimming to secondary, color only, and
|
|
565
|
+
// a press keeps that color as the card dims. The other titles stay still.
|
|
566
|
+
export const link = variants(
|
|
567
|
+
{
|
|
568
|
+
base: {
|
|
569
|
+
color: 'inherit !custom',
|
|
570
|
+
outlineStyle: 'none',
|
|
571
|
+
textDecoration: 'none !custom',
|
|
572
|
+
selectors: {
|
|
573
|
+
'&::after': { content: '"" !custom', inset: '0', position: 'absolute' },
|
|
574
|
+
},
|
|
575
|
+
},
|
|
576
|
+
defaultVariants: { job: 'still' },
|
|
577
|
+
variants: {
|
|
578
|
+
job: {
|
|
579
|
+
row: {
|
|
580
|
+
// At rest is where hover out and a release land.
|
|
581
|
+
transitionDuration: 'hoverOut',
|
|
582
|
+
transitionProperty: 'color !custom',
|
|
583
|
+
transitionTimingFunction: 'standard',
|
|
584
|
+
selectors: {
|
|
585
|
+
'[data-cue-host]:has([data-card-link]:active) &': { color: 'content.secondary' },
|
|
586
|
+
},
|
|
587
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
588
|
+
selectors: {
|
|
589
|
+
'[data-cue-host]:hover:not(:has([data-card-link]:active)) &': {
|
|
590
|
+
color: 'content.secondary',
|
|
591
|
+
transitionDuration: 'hoverIn',
|
|
592
|
+
},
|
|
593
|
+
},
|
|
594
|
+
},
|
|
595
|
+
},
|
|
596
|
+
still: {},
|
|
597
|
+
},
|
|
598
|
+
},
|
|
599
|
+
},
|
|
600
|
+
{ id: 'tds/marketing/card/link' },
|
|
601
|
+
)
|
|
602
|
+
|
|
603
|
+
// The media, a grey well while it loads: 16:10 at the top of a link card, bleeding to its edges
|
|
604
|
+
// and clipped by them, or a photo card's 4:3 photo under its copy, with the scrim over it. What
|
|
605
|
+
// zooms and a preview's badge share its one cell.
|
|
606
|
+
export const media = variants(
|
|
607
|
+
{
|
|
608
|
+
base: {
|
|
609
|
+
backgroundColor: 'container.surface',
|
|
610
|
+
display: 'grid',
|
|
611
|
+
gridTemplate: 'minmax(0, 1fr) / minmax(0, 1fr) !custom',
|
|
612
|
+
overflow: 'clip',
|
|
613
|
+
},
|
|
614
|
+
defaultVariants: { job: 'link' },
|
|
615
|
+
variants: {
|
|
616
|
+
job: {
|
|
617
|
+
link: { aspectRatio: '16 / 10 !custom' },
|
|
618
|
+
photo: {
|
|
619
|
+
aspectRatio: '4 / 3 !custom',
|
|
620
|
+
gridArea: '1 / 1 !custom',
|
|
621
|
+
position: 'relative',
|
|
622
|
+
selectors: {
|
|
623
|
+
'&::after': {
|
|
624
|
+
backgroundColor: 'scrim',
|
|
625
|
+
content: '"" !custom',
|
|
626
|
+
inset: '0',
|
|
627
|
+
position: 'absolute',
|
|
628
|
+
},
|
|
629
|
+
},
|
|
630
|
+
},
|
|
631
|
+
},
|
|
632
|
+
},
|
|
633
|
+
},
|
|
634
|
+
{ id: 'tds/marketing/card/media' },
|
|
635
|
+
)
|
|
636
|
+
|
|
637
|
+
// A preview fades in at the hover-in pace and out at the hover-out pace, and never shows under
|
|
638
|
+
// reduced motion.
|
|
639
|
+
export const preview = style(
|
|
640
|
+
{
|
|
641
|
+
opacity: '0 !custom',
|
|
642
|
+
pointerEvents: 'none',
|
|
643
|
+
transitionDuration: 'hoverOut',
|
|
644
|
+
transitionProperty: 'opacity !custom',
|
|
645
|
+
transitionTimingFunction: 'standard',
|
|
646
|
+
selectors: {
|
|
647
|
+
'[data-cue-host]:has(:focus-visible) &': { opacity: 'full', transitionDuration: 'hoverIn' },
|
|
648
|
+
},
|
|
649
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
650
|
+
selectors: {
|
|
651
|
+
'[data-cue-host]:hover &': { opacity: 'full', transitionDuration: 'hoverIn' },
|
|
652
|
+
},
|
|
653
|
+
},
|
|
654
|
+
// Scoped to the card, so it outranks the media layer's display.
|
|
655
|
+
'@media (prefers-reduced-motion: reduce)': {
|
|
656
|
+
selectors: { '[data-cue-host] &': { display: 'none' } },
|
|
657
|
+
},
|
|
658
|
+
},
|
|
659
|
+
{ id: 'tds/marketing/card/preview' },
|
|
660
|
+
)
|
|
661
|
+
|
|
662
|
+
// A press dims a linked card to the surfaces' press, and keyboard focus rings the card outside its
|
|
663
|
+
// corner. Forced colors drop the fill, so an edge draws a filled card.
|
|
664
|
+
export const root = variants(
|
|
665
|
+
{
|
|
666
|
+
base: {
|
|
667
|
+
color: 'neutral.100',
|
|
668
|
+
display: 'flex',
|
|
669
|
+
flexDirection: 'column',
|
|
670
|
+
minInlineSize: '0',
|
|
671
|
+
opacity: 'full',
|
|
672
|
+
outlineColor: 'neutral.100',
|
|
673
|
+
outlineOffset: 'ring',
|
|
674
|
+
outlineStyle: 'none',
|
|
675
|
+
outlineWidth: 'ring',
|
|
676
|
+
position: 'relative',
|
|
677
|
+
// At rest is where a release lands.
|
|
678
|
+
transitionDuration: 'hoverOut',
|
|
679
|
+
transitionProperty: 'opacity !custom',
|
|
680
|
+
transitionTimingFunction: 'standard',
|
|
681
|
+
// The cue and any action take the page's body type.
|
|
682
|
+
typography: 'body.b1',
|
|
683
|
+
selectors: {
|
|
684
|
+
'&[data-cue-host]:has([data-card-link]:active)': {
|
|
685
|
+
opacity: 'pressSurface',
|
|
686
|
+
transitionDuration: 'press',
|
|
687
|
+
},
|
|
688
|
+
'&[data-cue-host]:has([data-card-link]:focus-visible)': { outlineStyle: 'solid' },
|
|
689
|
+
},
|
|
690
|
+
'@media (forced-colors: active)': {
|
|
691
|
+
selectors: {
|
|
692
|
+
'&[data-cue-host]:has([data-card-link]:focus-visible)': {
|
|
693
|
+
outlineColor: 'Highlight !custom',
|
|
694
|
+
},
|
|
695
|
+
},
|
|
696
|
+
},
|
|
697
|
+
},
|
|
698
|
+
compoundVariants: [
|
|
699
|
+
{
|
|
700
|
+
when: { job: ['compact', 'link', 'panel'], tone: 'grey' },
|
|
701
|
+
style: { backgroundColor: 'container.surface' },
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
when: { job: ['compact', 'link', 'panel'], tone: 'inverse' },
|
|
705
|
+
style: {
|
|
706
|
+
backgroundColor: 'inverse.background.primary',
|
|
707
|
+
color: 'inverse.content.primary',
|
|
708
|
+
},
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
when: { job: ['compact', 'link', 'panel'], tone: 'outline' },
|
|
712
|
+
style: { borderColor: 'line.secondary', borderStyle: 'solid', borderWidth: 'regular' },
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
when: { job: ['compact', 'link', 'panel'], tone: 'white' },
|
|
716
|
+
style: { backgroundColor: 'background.secondary' },
|
|
717
|
+
},
|
|
718
|
+
],
|
|
719
|
+
defaultVariants: { job: 'link', tone: 'white' },
|
|
720
|
+
variants: {
|
|
721
|
+
job: {
|
|
722
|
+
// A badge-led directory card at the 16px corner, 16px inside (20px from 1024px), its badge
|
|
723
|
+
// beside the copy and its chevron at the row's end.
|
|
724
|
+
compact: {
|
|
725
|
+
alignItems: 'center',
|
|
726
|
+
borderRadius: 'sm',
|
|
727
|
+
flexDirection: 'row',
|
|
728
|
+
gap: '16',
|
|
729
|
+
padding: '16',
|
|
730
|
+
'@media >=1024': { padding: '20' },
|
|
731
|
+
'@media (forced-colors: active)': {
|
|
732
|
+
borderColor: 'CanvasText !custom',
|
|
733
|
+
borderStyle: 'solid',
|
|
734
|
+
borderWidth: 'regular',
|
|
735
|
+
},
|
|
736
|
+
},
|
|
737
|
+
// A column with no fill: its art tile at the top and its copy under it.
|
|
738
|
+
feature: { gap: '24' },
|
|
739
|
+
// A card at the 16px corner, its media bleeding at the top. Media clips with
|
|
740
|
+
// `overflow: clip`, never `hidden`.
|
|
741
|
+
link: {
|
|
742
|
+
borderRadius: 'sm',
|
|
743
|
+
overflow: 'clip',
|
|
744
|
+
'@media (forced-colors: active)': {
|
|
745
|
+
borderColor: 'CanvasText !custom',
|
|
746
|
+
borderStyle: 'solid',
|
|
747
|
+
borderWidth: 'regular',
|
|
748
|
+
},
|
|
749
|
+
},
|
|
750
|
+
// A block at the 24px corner, 24px inside (48px from 1024px).
|
|
751
|
+
panel: {
|
|
752
|
+
borderRadius: 'md',
|
|
753
|
+
gap: '24',
|
|
754
|
+
overflow: 'clip',
|
|
755
|
+
padding: '24',
|
|
756
|
+
'@media >=1024': { padding: '48' },
|
|
757
|
+
'@media (forced-colors: active)': {
|
|
758
|
+
borderColor: 'CanvasText !custom',
|
|
759
|
+
borderStyle: 'solid',
|
|
760
|
+
borderWidth: 'regular',
|
|
761
|
+
},
|
|
762
|
+
},
|
|
763
|
+
// The photo fills the card and the copy sits on it, over the scrim, at the card's end.
|
|
764
|
+
photo: {
|
|
765
|
+
backgroundColor: 'inverse.background.primary',
|
|
766
|
+
borderRadius: 'sm',
|
|
767
|
+
color: 'inverse.content.primary',
|
|
768
|
+
display: 'grid',
|
|
769
|
+
gridTemplate: 'minmax(0, 1fr) / minmax(0, 1fr) !custom',
|
|
770
|
+
overflow: 'clip',
|
|
771
|
+
},
|
|
772
|
+
// No fill: a rule above each row, 16px above and below it (20px from 1024px), and the
|
|
773
|
+
// cue at the row's end.
|
|
774
|
+
row: {
|
|
775
|
+
alignItems: 'baseline',
|
|
776
|
+
borderBlockStartColor: 'line.primary',
|
|
777
|
+
borderBlockStartStyle: 'solid',
|
|
778
|
+
borderBlockStartWidth: 'regular',
|
|
779
|
+
flexDirection: 'row',
|
|
780
|
+
gap: '16',
|
|
781
|
+
justifyContent: 'space-between',
|
|
782
|
+
paddingBlock: '16',
|
|
783
|
+
'@media >=1024': { paddingBlock: '20' },
|
|
784
|
+
},
|
|
785
|
+
},
|
|
786
|
+
/**
|
|
787
|
+
* The fill of a `link`, `compact` or `panel` card: none on the `page`, `white` (the
|
|
788
|
+
* default of link and compact cards), the page's `grey` step (the default of a panel), an
|
|
789
|
+
* `outline` hairline, or black with near-white text for `inverse`. The other jobs ignore it.
|
|
790
|
+
*/
|
|
791
|
+
tone: { grey: {}, inverse: {}, outline: {}, page: {}, white: {} },
|
|
792
|
+
},
|
|
793
|
+
},
|
|
794
|
+
{ id: 'tds/marketing/card' },
|
|
795
|
+
)
|
|
796
|
+
|
|
797
|
+
// A feature's 1:1 art tile, a grey well at the 16px corner, or a panel's art at its own
|
|
798
|
+
// proportions. Neither zooms.
|
|
799
|
+
export const tile = variants(
|
|
800
|
+
{
|
|
801
|
+
base: { display: 'grid', overflow: 'clip' },
|
|
802
|
+
defaultVariants: { job: 'feature' },
|
|
803
|
+
variants: {
|
|
804
|
+
job: {
|
|
805
|
+
feature: {
|
|
806
|
+
alignItems: 'center',
|
|
807
|
+
aspectRatio: '1 / 1 !custom',
|
|
808
|
+
backgroundColor: 'container.surface',
|
|
809
|
+
borderRadius: 'sm',
|
|
810
|
+
justifyItems: 'center',
|
|
811
|
+
},
|
|
812
|
+
panel: {},
|
|
813
|
+
},
|
|
814
|
+
},
|
|
815
|
+
},
|
|
816
|
+
{ id: 'tds/marketing/card/tile' },
|
|
817
|
+
)
|
|
818
|
+
|
|
819
|
+
export const title = style(
|
|
820
|
+
{ margin: '0', textWrap: 'balance', typography: 'heading.h4' },
|
|
821
|
+
{ id: 'tds/marketing/card/title' },
|
|
822
|
+
)
|
|
823
|
+
|
|
824
|
+
// What zooms: a photo or a video poster, never a badge or an art tile. It scales over the media
|
|
825
|
+
// pace while the pointer is on its card, and rests while the card is pressed. The media scale
|
|
826
|
+
// holds at 1 under reduced motion.
|
|
827
|
+
export const zoom = variants(
|
|
828
|
+
{
|
|
829
|
+
base: {
|
|
830
|
+
display: 'grid',
|
|
831
|
+
gridArea: '1 / 1 !custom',
|
|
832
|
+
gridTemplate: 'minmax(0, 1fr) / minmax(0, 1fr) !custom',
|
|
833
|
+
selectors: {
|
|
834
|
+
'& > *': {
|
|
835
|
+
blockSize: '100% !custom',
|
|
836
|
+
display: 'block',
|
|
837
|
+
gridArea: '1 / 1 !custom',
|
|
838
|
+
inlineSize: '100% !custom',
|
|
839
|
+
objectFit: 'cover',
|
|
840
|
+
},
|
|
841
|
+
},
|
|
842
|
+
},
|
|
843
|
+
defaultVariants: { kind: 'photo' },
|
|
844
|
+
variants: {
|
|
845
|
+
kind: {
|
|
846
|
+
art: {},
|
|
847
|
+
photo: {
|
|
848
|
+
scale: '1 !custom',
|
|
849
|
+
transitionDuration: 'media',
|
|
850
|
+
transitionProperty: 'scale !custom',
|
|
851
|
+
transitionTimingFunction: 'standard',
|
|
852
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
853
|
+
selectors: {
|
|
854
|
+
'[data-cue-host]:hover:not(:has([data-card-link]:active)) &': {
|
|
855
|
+
scale: 'mediaHover',
|
|
856
|
+
},
|
|
857
|
+
},
|
|
858
|
+
},
|
|
859
|
+
},
|
|
860
|
+
},
|
|
861
|
+
},
|
|
862
|
+
},
|
|
863
|
+
{ id: 'tds/marketing/card/zoom' },
|
|
864
|
+
)
|
|
865
|
+
}
|