@tempoxyz/ds 0.3.18 → 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/docs/product/documents.md +17 -1
- package/dist/document/Document.d.ts +1 -1
- package/dist/document/Document.d.ts.map +1 -1
- package/dist/document/Document.js +1 -0
- package/dist/document/Document.js.map +1 -1
- package/dist/document/document.css +12 -1
- 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/document/Document.ts +1 -0
- package/src/document/document.css +12 -1
- 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,469 @@
|
|
|
1
|
+
/** Renders Marketing call-to-action buttons and the links drawn as them. @module */
|
|
2
|
+
import * as BaseUi from '@base-ui/react/button'
|
|
3
|
+
import { useRender } from '@base-ui/react/use-render'
|
|
4
|
+
import type { ComponentPropsWithRef, MouseEvent } from 'react'
|
|
5
|
+
import type * as zyzz from 'zyzz'
|
|
6
|
+
import { keyframes } from 'zyzz/web'
|
|
7
|
+
import { Spinner } from '../icons/Spinner.js'
|
|
8
|
+
import { variants, vars } from '../zyzz.config.js'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A native `<button>` for a page's calls to action, built on Base UI Button. On a fine pointer,
|
|
12
|
+
* hover eases its fill in and out. A press dims a `primary` or `tertiary` button, deepens a
|
|
13
|
+
* `secondary` button's tint, and never changes its size.
|
|
14
|
+
*
|
|
15
|
+
* - Use `Button` for actions and `Button.Link` for navigation, such as Talk with our team.
|
|
16
|
+
* - Lead with one `primary` action and follow it with one `secondary` action at most.
|
|
17
|
+
* - Set `size` by place: `large` in a hero or closing band, `medium` in a section or card, and
|
|
18
|
+
* `small` in a dense row.
|
|
19
|
+
* - Set `appearance="inverse"` in a dark section and `appearance="overlay"` over a photo or video.
|
|
20
|
+
* - Give the icon-only `carousel` and `playback` layouts an `aria-label`, such as Next customer.
|
|
21
|
+
* - Set `busy` while an action runs, or `aria-disabled` when it cannot run. Both keep the button
|
|
22
|
+
* focusable and named, and a press does nothing.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <Button.Link href="/contact" size="large">
|
|
26
|
+
* Talk with our team
|
|
27
|
+
* </Button.Link>
|
|
28
|
+
*
|
|
29
|
+
* @see {@link https://base-ui.com/react/components/button | Base UI Button}
|
|
30
|
+
* @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/button/ | WAI-ARIA APG Button pattern}
|
|
31
|
+
* @see {@link https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html | WCAG 2.2 Target Size (Minimum)}
|
|
32
|
+
*/
|
|
33
|
+
export function Button(props: Button.Props) {
|
|
34
|
+
const {
|
|
35
|
+
appearance,
|
|
36
|
+
busy,
|
|
37
|
+
children,
|
|
38
|
+
className,
|
|
39
|
+
layout,
|
|
40
|
+
onClick,
|
|
41
|
+
size,
|
|
42
|
+
type = 'button',
|
|
43
|
+
variant,
|
|
44
|
+
vars,
|
|
45
|
+
...attributes
|
|
46
|
+
} = props
|
|
47
|
+
|
|
48
|
+
const inert =
|
|
49
|
+
busy || attributes['aria-disabled'] === true || attributes['aria-disabled'] === 'true'
|
|
50
|
+
|
|
51
|
+
// An inert button drops its `onClick`, and cancels a click that would send or reset its form.
|
|
52
|
+
const click = (() => {
|
|
53
|
+
if (!inert) return onClick
|
|
54
|
+
if (type === 'submit' || type === 'reset') return cancel
|
|
55
|
+
return undefined
|
|
56
|
+
})()
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<BaseUi.Button
|
|
60
|
+
{...attributes}
|
|
61
|
+
{...styles.button({ appearance, className, layout, size, style: props.style, variant, vars })}
|
|
62
|
+
aria-busy={busy || attributes['aria-busy']}
|
|
63
|
+
onClick={click}
|
|
64
|
+
type={type}
|
|
65
|
+
>
|
|
66
|
+
{/* Mounted whenever `busy` is passed, so the spinner fades out as well as in. */}
|
|
67
|
+
{busy !== undefined && <Spinner {...styles.spinner({ size })} />}
|
|
68
|
+
{children}
|
|
69
|
+
</BaseUi.Button>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export namespace Button {
|
|
74
|
+
export type Props = ComponentPropsWithRef<'button'> &
|
|
75
|
+
zyzz.Props.Variants<typeof styles.button> &
|
|
76
|
+
Pick<BaseUi.Button.Props, 'focusableWhenDisabled'> & {
|
|
77
|
+
/**
|
|
78
|
+
* Marks an action in progress: sets `aria-busy`, fades a spinner into the start padding after
|
|
79
|
+
* 200ms, and ignores presses. The label stays, so the width does not change.
|
|
80
|
+
*/
|
|
81
|
+
busy?: boolean | undefined
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* A link drawn as a `Button`. It keeps the link's role. Pass `render` for a router link, such as
|
|
86
|
+
* `<NextLink href="/contact" />`. An `aria-disabled` link cancels its click, so it never
|
|
87
|
+
* navigates.
|
|
88
|
+
*/
|
|
89
|
+
export function Link(props: Link.Props) {
|
|
90
|
+
const {
|
|
91
|
+
appearance,
|
|
92
|
+
className,
|
|
93
|
+
layout,
|
|
94
|
+
onClick,
|
|
95
|
+
ref,
|
|
96
|
+
render,
|
|
97
|
+
size,
|
|
98
|
+
variant,
|
|
99
|
+
vars,
|
|
100
|
+
...attributes
|
|
101
|
+
} = props
|
|
102
|
+
|
|
103
|
+
const inert = attributes['aria-disabled'] === true || attributes['aria-disabled'] === 'true'
|
|
104
|
+
|
|
105
|
+
return useRender({
|
|
106
|
+
defaultTagName: 'a',
|
|
107
|
+
props: {
|
|
108
|
+
...attributes,
|
|
109
|
+
...styles.button({
|
|
110
|
+
appearance,
|
|
111
|
+
className,
|
|
112
|
+
layout,
|
|
113
|
+
size,
|
|
114
|
+
style: props.style,
|
|
115
|
+
variant,
|
|
116
|
+
vars,
|
|
117
|
+
}),
|
|
118
|
+
onClick: inert ? cancel : onClick,
|
|
119
|
+
},
|
|
120
|
+
ref,
|
|
121
|
+
render,
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export namespace Link {
|
|
126
|
+
export type Props = useRender.ComponentProps<'a'> & zyzz.Props.Variants<typeof styles.button>
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function cancel(event: MouseEvent) {
|
|
131
|
+
event.preventDefault()
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const turn = keyframes({ to: { rotate: '360deg' } }, { id: 'tds/marketing/button/turn' })
|
|
135
|
+
|
|
136
|
+
namespace styles {
|
|
137
|
+
export const button = variants(
|
|
138
|
+
{
|
|
139
|
+
base: {
|
|
140
|
+
// The build compiles a compound variant's tokens only as whole values, so the mixed values
|
|
141
|
+
// the inverse and overlay compounds need are set here.
|
|
142
|
+
'--tds-button-blur': `blur(${vars.blur.control})`,
|
|
143
|
+
'--tds-button-dim-glass': `color-mix(in srgb, ${vars.color.neutral.glass['032']} 40%, transparent)`,
|
|
144
|
+
'--tds-button-dim-light': `color-mix(in srgb, ${vars.color.neutral['004']} 40%, transparent)`,
|
|
145
|
+
'--tds-button-dim-tint': `color-mix(in srgb, ${vars.color.neutral.tint['012']} 40%, transparent)`,
|
|
146
|
+
'--tds-button-hover-light': `color-mix(in srgb, ${vars.color.neutral['100']} 12%, ${vars.color.neutral['004']})`,
|
|
147
|
+
alignItems: 'center',
|
|
148
|
+
borderRadius: 'xs',
|
|
149
|
+
borderWidth: 'none',
|
|
150
|
+
boxSizing: 'border-box',
|
|
151
|
+
columnGap: '4',
|
|
152
|
+
cursor: 'pointer',
|
|
153
|
+
display: 'inline-flex',
|
|
154
|
+
flexShrink: '0 !custom',
|
|
155
|
+
justifyContent: 'center',
|
|
156
|
+
minWidth: '80px !custom',
|
|
157
|
+
opacity: 'full',
|
|
158
|
+
outlineColor: 'neutral.100',
|
|
159
|
+
outlineOffset: 'ring',
|
|
160
|
+
outlineStyle: 'none',
|
|
161
|
+
outlineWidth: 'ring',
|
|
162
|
+
paddingBlock: '4',
|
|
163
|
+
position: 'relative',
|
|
164
|
+
textAlign: 'center',
|
|
165
|
+
textDecoration: 'none !custom',
|
|
166
|
+
// At rest is where hover out and a release land, and where an `aria-disabled` button's dim
|
|
167
|
+
// fades in.
|
|
168
|
+
transitionDuration: 'hoverOut',
|
|
169
|
+
transitionProperty: 'background-color, color, opacity !custom',
|
|
170
|
+
transitionTimingFunction: 'standard',
|
|
171
|
+
typography: 'body.b2',
|
|
172
|
+
whiteSpace: 'nowrap',
|
|
173
|
+
selectors: {
|
|
174
|
+
// A hit area that leaves the visible size alone. Centered, it grows toward 44px, but
|
|
175
|
+
// reaches at most 4px past a side, half the 8px between buttons in a row, and 6px above
|
|
176
|
+
// and below, which a small button needs to reach 44px.
|
|
177
|
+
'&::after': {
|
|
178
|
+
content: '"" !custom',
|
|
179
|
+
insetBlock: `max(-6px, min(0px, (100% - ${vars.spacing.hitMin}) / 2)) !custom`,
|
|
180
|
+
insetInline: `max(-4px, min(0px, (100% - ${vars.spacing.hitMin}) / 2)) !custom`,
|
|
181
|
+
position: 'absolute',
|
|
182
|
+
},
|
|
183
|
+
'&:disabled': { cursor: 'not-allowed', opacity: 'disabled' },
|
|
184
|
+
'&[aria-disabled="true"]': { cursor: 'not-allowed' },
|
|
185
|
+
'&[aria-busy="true"]': { cursor: 'progress' },
|
|
186
|
+
'&:active:not(:disabled, [aria-disabled="true"], [aria-busy="true"])': {
|
|
187
|
+
opacity: 'press',
|
|
188
|
+
transitionDuration: 'press',
|
|
189
|
+
},
|
|
190
|
+
'&:focus-visible': { outlineStyle: 'solid' },
|
|
191
|
+
},
|
|
192
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
193
|
+
selectors: {
|
|
194
|
+
// The fill arrives at the hover-in pace.
|
|
195
|
+
'&:hover:not(:disabled, [aria-disabled="true"], [aria-busy="true"]):not(:active)': {
|
|
196
|
+
transitionDuration: 'hoverIn',
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
// Forced colors drop fills, so an edge draws the button.
|
|
201
|
+
'@media (forced-colors: active)': {
|
|
202
|
+
borderColor: 'ButtonText !custom',
|
|
203
|
+
borderStyle: 'solid',
|
|
204
|
+
borderWidth: 'regular',
|
|
205
|
+
selectors: {
|
|
206
|
+
'&:disabled, &[aria-disabled="true"]': {
|
|
207
|
+
borderColor: 'GrayText !custom',
|
|
208
|
+
color: 'GrayText !custom',
|
|
209
|
+
},
|
|
210
|
+
'&:focus-visible': { outlineColor: 'Highlight !custom' },
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
compoundVariants: [
|
|
215
|
+
{
|
|
216
|
+
when: { appearance: ['inverse', 'overlay'], variant: 'primary' },
|
|
217
|
+
style: {
|
|
218
|
+
backgroundColor: 'neutral.004',
|
|
219
|
+
color: 'neutral.100',
|
|
220
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
221
|
+
selectors: {
|
|
222
|
+
'&:hover:not(:disabled, [aria-disabled="true"], [aria-busy="true"]):not(:active)': {
|
|
223
|
+
backgroundColor: 'var(--tds-button-hover-light) !custom',
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
'@media (forced-colors: none)': {
|
|
228
|
+
selectors: {
|
|
229
|
+
'&[aria-disabled="true"]': {
|
|
230
|
+
backgroundColor: 'var(--tds-button-dim-light) !custom',
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
when: { appearance: ['inverse', 'overlay'], variant: 'secondary' },
|
|
238
|
+
style: {
|
|
239
|
+
backgroundColor: 'neutral.tint.012',
|
|
240
|
+
color: 'neutral.004',
|
|
241
|
+
selectors: {
|
|
242
|
+
'&:active:not(:disabled, [aria-disabled="true"], [aria-busy="true"])': {
|
|
243
|
+
backgroundColor: 'neutral.tint.028',
|
|
244
|
+
opacity: 'full',
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
248
|
+
selectors: {
|
|
249
|
+
'&:hover:not(:disabled, [aria-disabled="true"], [aria-busy="true"]):not(:active)': {
|
|
250
|
+
backgroundColor: 'neutral.tint.020',
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
'@media (forced-colors: none)': {
|
|
255
|
+
selectors: {
|
|
256
|
+
'&[aria-disabled="true"]': {
|
|
257
|
+
backgroundColor: 'var(--tds-button-dim-tint) !custom',
|
|
258
|
+
color: 'var(--tds-button-dim-light) !custom',
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
when: { appearance: ['inverse', 'overlay'], variant: 'tertiary' },
|
|
266
|
+
style: {
|
|
267
|
+
color: 'neutral.004',
|
|
268
|
+
'@media (forced-colors: none)': {
|
|
269
|
+
selectors: {
|
|
270
|
+
'&[aria-disabled="true"]': {
|
|
271
|
+
color: 'var(--tds-button-dim-light) !custom',
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
// Over media a primary label is not the ground's color, so it dims with the fill.
|
|
278
|
+
{
|
|
279
|
+
when: { appearance: 'overlay', variant: 'primary' },
|
|
280
|
+
style: {
|
|
281
|
+
'@media (forced-colors: none)': {
|
|
282
|
+
selectors: { '&[aria-disabled="true"]': { color: 'neutral.shade.040' } },
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
when: { appearance: 'overlay', variant: 'secondary' },
|
|
288
|
+
style: {
|
|
289
|
+
backdropFilter: 'var(--tds-button-blur) !custom',
|
|
290
|
+
backgroundColor: 'neutral.glass.032',
|
|
291
|
+
'@media (forced-colors: none)': {
|
|
292
|
+
selectors: {
|
|
293
|
+
'&[aria-disabled="true"]': {
|
|
294
|
+
backgroundColor: 'var(--tds-button-dim-glass) !custom',
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
],
|
|
301
|
+
defaultVariants: {
|
|
302
|
+
appearance: 'base',
|
|
303
|
+
layout: 'default',
|
|
304
|
+
size: 'medium',
|
|
305
|
+
variant: 'primary',
|
|
306
|
+
},
|
|
307
|
+
variants: {
|
|
308
|
+
/**
|
|
309
|
+
* The ground under the button: the page for `base`, a dark section for `inverse`, and a
|
|
310
|
+
* photo or video for `overlay`. On both of the last two, `primary` fills with the page's
|
|
311
|
+
* near-white and the other variants take near-white labels.
|
|
312
|
+
*
|
|
313
|
+
* @default 'base'
|
|
314
|
+
*/
|
|
315
|
+
appearance: {
|
|
316
|
+
base: {},
|
|
317
|
+
inverse: { outlineColor: 'neutral.004' },
|
|
318
|
+
overlay: { outlineColor: 'neutral.004' },
|
|
319
|
+
},
|
|
320
|
+
size: {
|
|
321
|
+
large: { minHeight: '48', paddingInline: '32' },
|
|
322
|
+
medium: { minHeight: '40', paddingInline: '24' },
|
|
323
|
+
small: {
|
|
324
|
+
borderRadius: '2xs',
|
|
325
|
+
minHeight: '32',
|
|
326
|
+
paddingInline: '16',
|
|
327
|
+
typography: 'body.b3',
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
variant: {
|
|
331
|
+
primary: {
|
|
332
|
+
backgroundColor: 'neutral.100',
|
|
333
|
+
color: 'neutral.004',
|
|
334
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
335
|
+
// Hover lifts the black 16% toward white, so the change reads.
|
|
336
|
+
selectors: {
|
|
337
|
+
'&:hover:not(:disabled, [aria-disabled="true"], [aria-busy="true"]):not(:active)': {
|
|
338
|
+
backgroundColor: 'neutral.084',
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
'@media (forced-colors: none)': {
|
|
343
|
+
selectors: { '&[aria-disabled="true"]': { backgroundColor: 'neutral.shade.040' } },
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
// Its hover adds a tint, so a press deepens the tint a step instead of dimming it.
|
|
347
|
+
secondary: {
|
|
348
|
+
backgroundColor: 'neutral.shade.004',
|
|
349
|
+
color: 'neutral.100',
|
|
350
|
+
selectors: {
|
|
351
|
+
'&:active:not(:disabled, [aria-disabled="true"], [aria-busy="true"])': {
|
|
352
|
+
backgroundColor: 'neutral.shade.020',
|
|
353
|
+
opacity: 'full',
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
357
|
+
selectors: {
|
|
358
|
+
'&:hover:not(:disabled, [aria-disabled="true"], [aria-busy="true"]):not(:active)': {
|
|
359
|
+
backgroundColor: 'neutral.shade.012',
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
'@media (forced-colors: none)': {
|
|
364
|
+
selectors: {
|
|
365
|
+
'&[aria-disabled="true"]': {
|
|
366
|
+
backgroundColor: `color-mix(in srgb, ${vars.color.neutral.shade['004']} 40%, transparent) !custom`,
|
|
367
|
+
color: 'neutral.shade.040',
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
tertiary: {
|
|
373
|
+
backgroundColor: 'transparent !custom',
|
|
374
|
+
color: 'neutral.100',
|
|
375
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
376
|
+
// Its hover is the opacity, so the opacity arrives at the hover-in pace too.
|
|
377
|
+
selectors: {
|
|
378
|
+
'&:hover:not(:disabled, [aria-disabled="true"], [aria-busy="true"]):not(:active)': {
|
|
379
|
+
opacity: '0.5 !custom',
|
|
380
|
+
transitionDuration: 'hoverIn',
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
'@media (forced-colors: none)': {
|
|
385
|
+
selectors: { '&[aria-disabled="true"]': { color: 'neutral.shade.040' } },
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
// Out of alphabetical order: a layout follows the size and variant axes, so its height,
|
|
390
|
+
// padding and fill win over theirs.
|
|
391
|
+
/**
|
|
392
|
+
* Where the button sits: `navigation` in the site header, `card` in a card, where its label
|
|
393
|
+
* may wrap, and the icon-only `carousel` and `playback` circles for paging and video.
|
|
394
|
+
*
|
|
395
|
+
* @default 'default'
|
|
396
|
+
*/
|
|
397
|
+
layout: {
|
|
398
|
+
card: { maxWidth: '100% !custom', minHeight: 'hitMin', whiteSpace: 'normal' },
|
|
399
|
+
carousel: {
|
|
400
|
+
borderRadius: 'full',
|
|
401
|
+
cornerShape: 'round',
|
|
402
|
+
height: '36px !custom',
|
|
403
|
+
minHeight: '36px !custom',
|
|
404
|
+
minWidth: '36px !custom',
|
|
405
|
+
paddingBlock: '0',
|
|
406
|
+
paddingInline: '0',
|
|
407
|
+
width: '36px !custom',
|
|
408
|
+
'@media >=1512': {
|
|
409
|
+
height: '40',
|
|
410
|
+
minHeight: '40',
|
|
411
|
+
minWidth: '40',
|
|
412
|
+
width: '40',
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
default: {},
|
|
416
|
+
navigation: { minHeight: 'hitMin', paddingInline: '24' },
|
|
417
|
+
playback: {
|
|
418
|
+
backdropFilter: `blur(${vars.blur.control}) brightness(0.8) !custom`,
|
|
419
|
+
backgroundColor: 'neutral.glass.032',
|
|
420
|
+
borderRadius: 'full',
|
|
421
|
+
cornerShape: 'round',
|
|
422
|
+
minHeight: 'hitMin',
|
|
423
|
+
minWidth: 'hitMin',
|
|
424
|
+
paddingBlock: '0',
|
|
425
|
+
paddingInline: '0',
|
|
426
|
+
width: 'hitMin',
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
},
|
|
430
|
+
},
|
|
431
|
+
{ id: 'tds/marketing/button' },
|
|
432
|
+
)
|
|
433
|
+
|
|
434
|
+
// The spinner sits in the start padding, out of layout, so going busy moves neither the width nor
|
|
435
|
+
// the label. It fades in once busy has lasted a beat, so a quick action never shows it, and once
|
|
436
|
+
// shown it waits before it fades out, so it never flashes.
|
|
437
|
+
export const spinner = variants(
|
|
438
|
+
{
|
|
439
|
+
base: {
|
|
440
|
+
animation: `${turn} 800ms linear infinite !custom`,
|
|
441
|
+
fontSize: '16px !custom',
|
|
442
|
+
insetBlock: '0',
|
|
443
|
+
marginBlock: 'auto !custom',
|
|
444
|
+
opacity: '0 !custom',
|
|
445
|
+
position: 'absolute',
|
|
446
|
+
transitionDelay: 'busyOut',
|
|
447
|
+
transitionDuration: 'busyFade',
|
|
448
|
+
transitionProperty: 'opacity !custom',
|
|
449
|
+
transitionTimingFunction: 'standard',
|
|
450
|
+
selectors: {
|
|
451
|
+
'[aria-busy="true"] > &': { opacity: 'full', transitionDelay: 'busyIn' },
|
|
452
|
+
},
|
|
453
|
+
// A button that mounts busy still waits the beat.
|
|
454
|
+
'@starting-style': { opacity: '0 !custom' },
|
|
455
|
+
'@media (prefers-reduced-motion: reduce)': { animation: 'none !custom' },
|
|
456
|
+
},
|
|
457
|
+
defaultVariants: { size: 'medium' },
|
|
458
|
+
// Centered in the start padding: 12px in 16px at `small`, 16px in 24px and 32px.
|
|
459
|
+
variants: {
|
|
460
|
+
size: {
|
|
461
|
+
large: { insetInlineStart: '8' },
|
|
462
|
+
medium: { insetInlineStart: '4' },
|
|
463
|
+
small: { fontSize: '12px !custom', insetInlineStart: '2' },
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
{ id: 'tds/marketing/button/spinner' },
|
|
468
|
+
)
|
|
469
|
+
}
|