@keystone-sites/marketing-design-system 1.0.0
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/AGENTS.md +163 -0
- package/README.md +85 -0
- package/assets/media/brand/ks-lockup.svg +13 -0
- package/assets/media/brand/ks-logomark.svg +4 -0
- package/assets/media/brand/ks-wordmark-inline.svg +13 -0
- package/assets/media/brand/ks-wordmark.svg +11 -0
- package/assets/media/fonts/gt-standard-standard-vf.woff2 +0 -0
- package/assets/media/fonts/pp-kyoto-variable-upright-vf.woff2 +0 -0
- package/base.css +111 -0
- package/css-vars.d.ts +10 -0
- package/grid/engine.css +368 -0
- package/grid/field-hash.ts +31 -0
- package/grid/field.tsx +48 -0
- package/grid/gates.cjs +34 -0
- package/grid/region.tsx +97 -0
- package/icons.tsx +1224 -0
- package/index.css +77 -0
- package/lib/autoplay-gate.ts +88 -0
- package/lib/focus-trap.ts +42 -0
- package/lib/grader.ts +131 -0
- package/lib/legal-data.ts +1 -0
- package/lib/legal.ts +41 -0
- package/lib/noise.tsx +114 -0
- package/lib/render-boundary.tsx +27 -0
- package/lib/scroll-lock.ts +25 -0
- package/lib/swipe.ts +124 -0
- package/lib/use-active-section.ts +43 -0
- package/lib/use-count-up.ts +26 -0
- package/lib/use-grader-search.ts +118 -0
- package/lib/use-video-carousel.ts +271 -0
- package/media.ts +558 -0
- package/package.json +201 -0
- package/primitives/button-inline.css +52 -0
- package/primitives/button-inline.tsx +38 -0
- package/primitives/buttons.css +449 -0
- package/primitives/buttons.tsx +263 -0
- package/primitives/case-study-button.css +71 -0
- package/primitives/case-study-button.tsx +28 -0
- package/primitives/case-study-card.css +318 -0
- package/primitives/case-study-card.tsx +116 -0
- package/primitives/closer-row.css +14 -0
- package/primitives/closer-row.tsx +22 -0
- package/primitives/cta-row.css +41 -0
- package/primitives/cta-row.tsx +39 -0
- package/primitives/disclosure.css +210 -0
- package/primitives/disclosure.tsx +144 -0
- package/primitives/faq-question.css +220 -0
- package/primitives/faq-question.tsx +55 -0
- package/primitives/field.css +225 -0
- package/primitives/field.tsx +266 -0
- package/primitives/footer-item.css +72 -0
- package/primitives/footer-item.tsx +42 -0
- package/primitives/grader-menu.tsx +84 -0
- package/primitives/grader.css +302 -0
- package/primitives/grader.tsx +284 -0
- package/primitives/modal.css +151 -0
- package/primitives/modal.tsx +90 -0
- package/primitives/notice.css +39 -0
- package/primitives/notice.tsx +56 -0
- package/primitives/persona-card.css +374 -0
- package/primitives/persona-card.tsx +74 -0
- package/primitives/picture.css +11 -0
- package/primitives/picture.tsx +41 -0
- package/primitives/plan-card.css +378 -0
- package/primitives/plan-card.tsx +91 -0
- package/primitives/prose.css +118 -0
- package/primitives/prose.tsx +170 -0
- package/primitives/ramps.css +84 -0
- package/primitives/slider.css +179 -0
- package/primitives/slider.tsx +69 -0
- package/primitives/slug.css +87 -0
- package/primitives/slug.tsx +37 -0
- package/primitives/status.css +298 -0
- package/primitives/status.tsx +222 -0
- package/primitives/strip.css +40 -0
- package/primitives/surface.css +78 -0
- package/primitives/surface.tsx +95 -0
- package/primitives/table.css +226 -0
- package/primitives/table.tsx +122 -0
- package/primitives/tabs.css +85 -0
- package/primitives/tabs.tsx +122 -0
- package/primitives/text.css +110 -0
- package/primitives/toc.css +65 -0
- package/primitives/toc.tsx +42 -0
- package/rules/design-system.md +154 -0
- package/rules/grid-and-layout.md +166 -0
- package/scripts/generate-exports.mjs +61 -0
- package/scripts/generate-type-css.mjs +130 -0
- package/sections/faq-island.tsx +102 -0
- package/sections/faq.css +213 -0
- package/sections/faq.tsx +46 -0
- package/sections/footer-nav.tsx +95 -0
- package/sections/footer-signature.css +183 -0
- package/sections/footer-signature.tsx +114 -0
- package/sections/footer.css +735 -0
- package/sections/footer.tsx +283 -0
- package/sections/gallery-overlay.css +213 -0
- package/sections/gallery-overlay.tsx +267 -0
- package/sections/landing-benefits.css +59 -0
- package/sections/landing-benefits.tsx +81 -0
- package/sections/landing-closer.css +23 -0
- package/sections/landing-closer.tsx +26 -0
- package/sections/landing-hero.css +80 -0
- package/sections/landing-hero.tsx +69 -0
- package/sections/landing-quote.css +19 -0
- package/sections/landing-quote.tsx +30 -0
- package/sections/landing-sample.ts +66 -0
- package/sections/landing.css +45 -0
- package/sections/landing.tsx +69 -0
- package/sections/load-orchestrator.tsx +43 -0
- package/sections/load.css +138 -0
- package/sections/nav-desktop.css +530 -0
- package/sections/nav-desktop.tsx +155 -0
- package/sections/nav-mobile.css +571 -0
- package/sections/nav-mobile.tsx +222 -0
- package/sections/nav.css +126 -0
- package/sections/nav.tsx +394 -0
- package/sections/site-chat-data.ts +16 -0
- package/sections/site-chat-open.tsx +25 -0
- package/sections/site-chat.tsx +67 -0
- package/site-links.ts +36 -0
- package/site.ts +2 -0
- package/themes/inverted.css +139 -0
- package/tokens/fonts.css +38 -0
- package/tokens/motion.css +125 -0
- package/tokens/primitives.css +163 -0
- package/tokens/semantic.css +153 -0
- package/tokens/type-styles.json +145 -0
- package/tokens/type.css +1548 -0
- package/widgets.css +78 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/* Disclosure: a hairline row that opens a body beneath it. Stacked
|
|
2
|
+
disclosures share dividers through .rows. The filter is a toolbar
|
|
3
|
+
trigger with a popover checklist; `.check` is the bare checkbox both
|
|
4
|
+
the checklist and dense tables use. */
|
|
5
|
+
|
|
6
|
+
.disclosure-head {
|
|
7
|
+
appearance: none;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: var(--space-xs);
|
|
11
|
+
width: 100%;
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: var(--space-lg) var(--space-none);
|
|
14
|
+
border: 0;
|
|
15
|
+
background: none;
|
|
16
|
+
color: inherit;
|
|
17
|
+
text-align: left;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
}
|
|
20
|
+
.disclosure-head:focus-visible {
|
|
21
|
+
outline: none;
|
|
22
|
+
box-shadow: inset 0 0 0 var(--ring-w) var(--color-teal-200);
|
|
23
|
+
border-radius: var(--radius-sm);
|
|
24
|
+
}
|
|
25
|
+
.disclosure-row {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: var(--space-md);
|
|
29
|
+
}
|
|
30
|
+
.disclosure-title {
|
|
31
|
+
flex: 1 1 auto;
|
|
32
|
+
min-width: 0;
|
|
33
|
+
color: var(--color-text-100);
|
|
34
|
+
}
|
|
35
|
+
.disclosure-meta {
|
|
36
|
+
flex: none;
|
|
37
|
+
color: var(--color-text-400);
|
|
38
|
+
font-variant-numeric: tabular-nums;
|
|
39
|
+
}
|
|
40
|
+
.disclosure-tick {
|
|
41
|
+
flex: none;
|
|
42
|
+
color: var(--color-text-400);
|
|
43
|
+
transition: transform var(--motion-hover-duration) var(--motion-hover-ease);
|
|
44
|
+
}
|
|
45
|
+
/* Child combinators keep a nested disclosure's tick on its own state. */
|
|
46
|
+
.disclosure[data-open] > .disclosure-head > .disclosure-row > .disclosure-tick {
|
|
47
|
+
transform: rotate(180deg);
|
|
48
|
+
}
|
|
49
|
+
.disclosure-preview {
|
|
50
|
+
display: block;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
text-overflow: ellipsis;
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
color: var(--color-text-400);
|
|
55
|
+
}
|
|
56
|
+
.disclosure-preview[data-mono] {
|
|
57
|
+
--font: 400 12px/1.5 var(--font-mono);
|
|
58
|
+
--ls: 0;
|
|
59
|
+
}
|
|
60
|
+
.disclosure-body {
|
|
61
|
+
padding-bottom: var(--space-lg);
|
|
62
|
+
}
|
|
63
|
+
.disclosure-body pre {
|
|
64
|
+
margin: 0;
|
|
65
|
+
max-height: 40vh;
|
|
66
|
+
overflow: auto;
|
|
67
|
+
padding: var(--space-lg);
|
|
68
|
+
border: 1px solid var(--color-border-050);
|
|
69
|
+
border-radius: var(--radius-lg);
|
|
70
|
+
background: var(--color-bg-000);
|
|
71
|
+
color: var(--color-text-300);
|
|
72
|
+
font-family: var(--font-mono);
|
|
73
|
+
font-size: 0.75rem;
|
|
74
|
+
line-height: 1.55;
|
|
75
|
+
white-space: pre-wrap;
|
|
76
|
+
overflow-wrap: anywhere;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Check: the bare checkbox. */
|
|
80
|
+
.check {
|
|
81
|
+
flex: none;
|
|
82
|
+
box-sizing: border-box;
|
|
83
|
+
width: 16px;
|
|
84
|
+
height: 16px;
|
|
85
|
+
margin: 0;
|
|
86
|
+
appearance: none;
|
|
87
|
+
background: var(--color-bg-000);
|
|
88
|
+
border: 1px solid var(--color-border-100);
|
|
89
|
+
border-radius: var(--radius-xs);
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
transition-property: background-color, border-color;
|
|
92
|
+
transition-duration: var(--motion-hover-duration);
|
|
93
|
+
transition-timing-function: var(--motion-hover-ease);
|
|
94
|
+
}
|
|
95
|
+
.check:checked,
|
|
96
|
+
.check:indeterminate {
|
|
97
|
+
background: var(--color-teal-500);
|
|
98
|
+
border-color: var(--color-teal-500);
|
|
99
|
+
background-repeat: no-repeat;
|
|
100
|
+
background-position: center;
|
|
101
|
+
background-size: 0.7em 0.7em;
|
|
102
|
+
}
|
|
103
|
+
.check:checked {
|
|
104
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2 4.8 8.5 9.5 3.5' stroke='%23f8f7f2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
|
105
|
+
}
|
|
106
|
+
.check:indeterminate {
|
|
107
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6h7' stroke='%23f8f7f2' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
|
|
108
|
+
}
|
|
109
|
+
.check:focus-visible {
|
|
110
|
+
outline: none;
|
|
111
|
+
box-shadow: 0 0 0 var(--ring-w) var(--color-teal-100);
|
|
112
|
+
}
|
|
113
|
+
.check:disabled {
|
|
114
|
+
opacity: 0.5;
|
|
115
|
+
cursor: default;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* Filter: a toolbar trigger with a popover checklist. */
|
|
119
|
+
.filter {
|
|
120
|
+
position: relative;
|
|
121
|
+
}
|
|
122
|
+
.filter-trigger {
|
|
123
|
+
appearance: none;
|
|
124
|
+
display: inline-flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
gap: var(--space-sm);
|
|
127
|
+
box-sizing: border-box;
|
|
128
|
+
height: var(--field-h-sm, 40px);
|
|
129
|
+
margin: 0;
|
|
130
|
+
padding-inline: var(--space-lg);
|
|
131
|
+
border: 1px solid var(--color-border-000);
|
|
132
|
+
border-radius: var(--radius-md);
|
|
133
|
+
background: var(--color-bg-000);
|
|
134
|
+
box-shadow: 0 0 0 var(--ring-w) var(--color-bg-200);
|
|
135
|
+
color: var(--color-text-200);
|
|
136
|
+
white-space: nowrap;
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
transition-property: border-color, box-shadow, color;
|
|
139
|
+
transition-duration: var(--motion-hover-duration);
|
|
140
|
+
transition-timing-function: var(--motion-hover-ease);
|
|
141
|
+
}
|
|
142
|
+
@media (hover: hover) {
|
|
143
|
+
.filter-trigger:hover {
|
|
144
|
+
border-color: var(--color-border-100);
|
|
145
|
+
box-shadow: 0 0 0 var(--ring-w) var(--color-bg-300);
|
|
146
|
+
color: var(--color-text-100);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
.filter-trigger:focus-visible,
|
|
150
|
+
.filter-trigger[aria-expanded="true"] {
|
|
151
|
+
outline: none;
|
|
152
|
+
border-color: var(--color-teal-300);
|
|
153
|
+
box-shadow: 0 0 0 var(--ring-w) var(--color-teal-100);
|
|
154
|
+
}
|
|
155
|
+
.filter-count {
|
|
156
|
+
display: inline-grid;
|
|
157
|
+
place-items: center;
|
|
158
|
+
min-width: 18px;
|
|
159
|
+
height: 18px;
|
|
160
|
+
padding-inline: var(--space-xs);
|
|
161
|
+
border-radius: var(--radius-full);
|
|
162
|
+
background: var(--color-teal-250);
|
|
163
|
+
color: var(--color-teal-700);
|
|
164
|
+
}
|
|
165
|
+
.filter-tick {
|
|
166
|
+
color: var(--color-text-400);
|
|
167
|
+
transition: transform var(--motion-hover-duration) var(--motion-hover-ease);
|
|
168
|
+
}
|
|
169
|
+
.filter-trigger[aria-expanded="true"] .filter-tick {
|
|
170
|
+
transform: rotate(180deg);
|
|
171
|
+
}
|
|
172
|
+
.filter-menu {
|
|
173
|
+
position: absolute;
|
|
174
|
+
top: calc(100% + var(--space-xs));
|
|
175
|
+
right: 0;
|
|
176
|
+
z-index: var(--z-raised);
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-direction: column;
|
|
179
|
+
min-width: 14rem;
|
|
180
|
+
padding: var(--space-sm);
|
|
181
|
+
border: 1px solid var(--color-border-050);
|
|
182
|
+
border-radius: var(--radius-lg);
|
|
183
|
+
background: var(--color-bg-200);
|
|
184
|
+
box-shadow: var(--shadow-hard-round);
|
|
185
|
+
animation: filter-pop var(--motion-hover-duration) var(--motion-hover-ease) both;
|
|
186
|
+
}
|
|
187
|
+
@keyframes filter-pop {
|
|
188
|
+
from {
|
|
189
|
+
opacity: 0;
|
|
190
|
+
transform: translateY(-4px);
|
|
191
|
+
}
|
|
192
|
+
to {
|
|
193
|
+
opacity: 1;
|
|
194
|
+
transform: none;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
.filter-option {
|
|
198
|
+
display: flex;
|
|
199
|
+
align-items: center;
|
|
200
|
+
gap: var(--space-md);
|
|
201
|
+
padding: var(--space-sm) var(--space-md);
|
|
202
|
+
border-radius: var(--radius-sm);
|
|
203
|
+
color: var(--color-text-200);
|
|
204
|
+
cursor: pointer;
|
|
205
|
+
}
|
|
206
|
+
@media (hover: hover) {
|
|
207
|
+
.filter-option:hover {
|
|
208
|
+
background: var(--color-bg-300);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
/** Disclosure: a row that opens a body beneath it, and a popover menu of
|
|
4
|
+
* checkboxes for toolbar filters. Styles live in disclosure.css. */
|
|
5
|
+
|
|
6
|
+
import { useEffect, useId, useRef, useState, type ReactNode } from "react";
|
|
7
|
+
import { IconChevronDownSmall } from "../icons";
|
|
8
|
+
|
|
9
|
+
export function Disclosure({
|
|
10
|
+
title,
|
|
11
|
+
meta,
|
|
12
|
+
preview,
|
|
13
|
+
previewMono,
|
|
14
|
+
open,
|
|
15
|
+
onToggle,
|
|
16
|
+
children,
|
|
17
|
+
}: {
|
|
18
|
+
title: ReactNode;
|
|
19
|
+
/** Right-aligned detail beside the title (a size, a date). */
|
|
20
|
+
meta?: ReactNode;
|
|
21
|
+
/** One line shown while closed (a truncated excerpt). */
|
|
22
|
+
preview?: ReactNode;
|
|
23
|
+
/** Set the preview in the mono face (raw data, transcripts). */
|
|
24
|
+
previewMono?: boolean;
|
|
25
|
+
open: boolean;
|
|
26
|
+
onToggle: () => void;
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}) {
|
|
29
|
+
const bodyId = useId();
|
|
30
|
+
return (
|
|
31
|
+
<div className="disclosure" data-open={open || undefined}>
|
|
32
|
+
<button
|
|
33
|
+
type="button"
|
|
34
|
+
className="disclosure-head"
|
|
35
|
+
aria-expanded={open}
|
|
36
|
+
aria-controls={bodyId}
|
|
37
|
+
onClick={onToggle}
|
|
38
|
+
>
|
|
39
|
+
<span className="disclosure-row">
|
|
40
|
+
<span className="type type-fixed ts-text-sm-medium disclosure-title">{title}</span>
|
|
41
|
+
{meta != null && (
|
|
42
|
+
<span className="type type-fixed ts-text-xs-light disclosure-meta">{meta}</span>
|
|
43
|
+
)}
|
|
44
|
+
<IconChevronDownSmall className="disclosure-tick" />
|
|
45
|
+
</span>
|
|
46
|
+
{!open && preview != null && (
|
|
47
|
+
<span
|
|
48
|
+
className="type type-fixed ts-text-sm-light disclosure-preview"
|
|
49
|
+
data-mono={previewMono || undefined}
|
|
50
|
+
>
|
|
51
|
+
{preview}
|
|
52
|
+
</span>
|
|
53
|
+
)}
|
|
54
|
+
</button>
|
|
55
|
+
{open && (
|
|
56
|
+
<div className="disclosure-body" id={bodyId}>
|
|
57
|
+
{children}
|
|
58
|
+
</div>
|
|
59
|
+
)}
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface FilterOption<T extends string> {
|
|
65
|
+
value: T;
|
|
66
|
+
label: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** A button that opens a checklist; the consumer owns the selection. */
|
|
70
|
+
export function FilterMenu<T extends string>({
|
|
71
|
+
label,
|
|
72
|
+
options,
|
|
73
|
+
selected,
|
|
74
|
+
onChange,
|
|
75
|
+
}: {
|
|
76
|
+
label: string;
|
|
77
|
+
options: readonly FilterOption<T>[];
|
|
78
|
+
selected: readonly T[];
|
|
79
|
+
onChange: (next: T[]) => void;
|
|
80
|
+
}) {
|
|
81
|
+
const [open, setOpen] = useState(false);
|
|
82
|
+
const rootRef = useRef<HTMLDivElement>(null);
|
|
83
|
+
const menuId = useId();
|
|
84
|
+
const partial = selected.length > 0 && selected.length < options.length;
|
|
85
|
+
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
if (!open) return;
|
|
88
|
+
const onDown = (event: PointerEvent) => {
|
|
89
|
+
if (!rootRef.current?.contains(event.target as Node)) setOpen(false);
|
|
90
|
+
};
|
|
91
|
+
const onKey = (event: KeyboardEvent) => {
|
|
92
|
+
if (event.key === "Escape") setOpen(false);
|
|
93
|
+
};
|
|
94
|
+
document.addEventListener("pointerdown", onDown);
|
|
95
|
+
document.addEventListener("keydown", onKey);
|
|
96
|
+
return () => {
|
|
97
|
+
document.removeEventListener("pointerdown", onDown);
|
|
98
|
+
document.removeEventListener("keydown", onKey);
|
|
99
|
+
};
|
|
100
|
+
}, [open]);
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<div className="filter" ref={rootRef}>
|
|
104
|
+
<button
|
|
105
|
+
type="button"
|
|
106
|
+
className="type type-fixed ts-text-sm-regular filter-trigger"
|
|
107
|
+
aria-expanded={open}
|
|
108
|
+
aria-controls={menuId}
|
|
109
|
+
aria-haspopup="true"
|
|
110
|
+
onClick={() => setOpen((v) => !v)}
|
|
111
|
+
>
|
|
112
|
+
<span>{label}</span>
|
|
113
|
+
{partial && (
|
|
114
|
+
<span className="type type-fixed ts-text-2xs-medium filter-count">{selected.length}</span>
|
|
115
|
+
)}
|
|
116
|
+
<IconChevronDownSmall className="filter-tick" />
|
|
117
|
+
</button>
|
|
118
|
+
{open && (
|
|
119
|
+
<div className="filter-menu" id={menuId} role="group" aria-label={label}>
|
|
120
|
+
{options.map((option) => {
|
|
121
|
+
const checked = selected.includes(option.value);
|
|
122
|
+
return (
|
|
123
|
+
<label key={option.value} className="type type-fixed ts-text-sm-light filter-option">
|
|
124
|
+
<input
|
|
125
|
+
type="checkbox"
|
|
126
|
+
className="check"
|
|
127
|
+
checked={checked}
|
|
128
|
+
onChange={() =>
|
|
129
|
+
onChange(
|
|
130
|
+
checked
|
|
131
|
+
? selected.filter((v) => v !== option.value)
|
|
132
|
+
: [...selected, option.value],
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
/>
|
|
136
|
+
<span>{option.label}</span>
|
|
137
|
+
</label>
|
|
138
|
+
);
|
|
139
|
+
})}
|
|
140
|
+
</div>
|
|
141
|
+
)}
|
|
142
|
+
</div>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/* FAQ disclosure geometry uses fixed closed rows and measured open rows. */
|
|
2
|
+
|
|
3
|
+
.fq {
|
|
4
|
+
position: relative;
|
|
5
|
+
list-style: none;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
border-top: 1px solid var(--color-border-000);
|
|
8
|
+
padding: var(--fq-pt) var(--fq-pr) var(--fq-pb) var(--fq-pl);
|
|
9
|
+
overflow: clip;
|
|
10
|
+
/* The resting rule owns the close transition. */
|
|
11
|
+
transition: height var(--motion-drawer-duration) var(--motion-drawer-ease);
|
|
12
|
+
}
|
|
13
|
+
.fq[data-open] {
|
|
14
|
+
/* Open rows use the entrance curve. */
|
|
15
|
+
transition: height var(--motion-drawer-duration) var(--motion-drawer-ease-open);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.fq-h {
|
|
19
|
+
margin: var(--space-none);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.fq-trigger {
|
|
23
|
+
appearance: none;
|
|
24
|
+
border: 0;
|
|
25
|
+
margin: var(--space-none);
|
|
26
|
+
padding: var(--space-none);
|
|
27
|
+
background: none;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
gap: var(--space-3xl);
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: var(--fq-qrow);
|
|
35
|
+
text-align: left;
|
|
36
|
+
color: inherit;
|
|
37
|
+
touch-action: manipulation;
|
|
38
|
+
}
|
|
39
|
+
/* The whole closed row remains the tap target. */
|
|
40
|
+
.fq:not([data-open]) .fq-trigger::before {
|
|
41
|
+
content: "";
|
|
42
|
+
position: absolute;
|
|
43
|
+
inset: 0;
|
|
44
|
+
}
|
|
45
|
+
.fq-trigger:focus-visible {
|
|
46
|
+
outline: none;
|
|
47
|
+
box-shadow: 0 0 0 var(--ring-w) var(--color-border-200);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.fq-q {
|
|
51
|
+
--font: var(--fq-q-f);
|
|
52
|
+
--fs-rm: var(--fq-q-fs-rm);
|
|
53
|
+
--fs-rs: var(--fq-q-fs-rs, var(--fs-rm));
|
|
54
|
+
--fs-rt: var(--fq-q-fs-rt, var(--fs-rs));
|
|
55
|
+
--fs-rd1: var(--fq-q-fs-rd1, var(--fs-rt));
|
|
56
|
+
--fs-rd2: var(--fq-q-fs-rd2, var(--fs-rd1));
|
|
57
|
+
--lh-rm: var(--fq-q-lh-rm);
|
|
58
|
+
--lh-rs: var(--fq-q-lh-rs, var(--lh-rm));
|
|
59
|
+
--lh-rt: var(--fq-q-lh-rt, var(--lh-rs));
|
|
60
|
+
--lh-rd1: var(--fq-q-lh-rd1, var(--lh-rt));
|
|
61
|
+
--lh-rd2: var(--fq-q-lh-rd2, var(--lh-rd1));
|
|
62
|
+
--fs-px: calc(var(--fq-u, 1px) * var(--fs-band));
|
|
63
|
+
--lh-px: calc(var(--fq-u, 1px) * var(--lh-band));
|
|
64
|
+
--ls: var(--fq-q-ls);
|
|
65
|
+
--opsz: var(--fq-q-opsz);
|
|
66
|
+
color: var(--color-text-200);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.fq-chevron {
|
|
70
|
+
flex: none;
|
|
71
|
+
color: var(--color-border-400);
|
|
72
|
+
transition: rotate var(--motion-drawer-duration) var(--motion-drawer-ease);
|
|
73
|
+
}
|
|
74
|
+
.fq[data-open] .fq-chevron {
|
|
75
|
+
rotate: 180deg;
|
|
76
|
+
/* Chevron rotation follows the open transition. */
|
|
77
|
+
transition: rotate var(--motion-drawer-duration) var(--motion-drawer-ease-open);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Keep answers measurable while clipping them from closed rows. */
|
|
81
|
+
.fq-answer {
|
|
82
|
+
margin-top: var(--fq-gap);
|
|
83
|
+
padding-right: var(--fq-a-inset);
|
|
84
|
+
visibility: hidden;
|
|
85
|
+
pointer-events: none;
|
|
86
|
+
clip-path: inset(0 0 100% 0);
|
|
87
|
+
transition:
|
|
88
|
+
visibility 0s linear var(--motion-drawer-duration),
|
|
89
|
+
clip-path var(--motion-drawer-duration) var(--motion-drawer-ease);
|
|
90
|
+
}
|
|
91
|
+
.fq[data-open] .fq-answer {
|
|
92
|
+
visibility: visible;
|
|
93
|
+
pointer-events: auto;
|
|
94
|
+
clip-path: inset(0 0 0 0);
|
|
95
|
+
transition: clip-path var(--motion-drawer-duration) var(--motion-drawer-ease-open);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* Inline links read as prose links, as in legal and blog copy. */
|
|
99
|
+
.fq-a a {
|
|
100
|
+
color: inherit;
|
|
101
|
+
text-decoration: underline;
|
|
102
|
+
text-decoration-color: var(--color-border-200);
|
|
103
|
+
text-decoration-skip-ink: auto;
|
|
104
|
+
text-underline-offset: 0.18em;
|
|
105
|
+
}
|
|
106
|
+
.fq-a a:focus-visible {
|
|
107
|
+
outline: none;
|
|
108
|
+
box-shadow: 0 0 0 var(--ring-w) var(--color-teal-200);
|
|
109
|
+
}
|
|
110
|
+
.fq-a {
|
|
111
|
+
margin: var(--space-none);
|
|
112
|
+
--font: var(--fq-a-f);
|
|
113
|
+
--fs-rm: var(--fq-a-fs-rm);
|
|
114
|
+
--fs-rs: var(--fq-a-fs-rs, var(--fs-rm));
|
|
115
|
+
--fs-rt: var(--fq-a-fs-rt, var(--fs-rs));
|
|
116
|
+
--fs-rd1: var(--fq-a-fs-rd1, var(--fs-rt));
|
|
117
|
+
--fs-rd2: var(--fq-a-fs-rd2, var(--fs-rd1));
|
|
118
|
+
--lh-rm: var(--fq-a-lh-rm);
|
|
119
|
+
--lh-rs: var(--fq-a-lh-rs, var(--lh-rm));
|
|
120
|
+
--lh-rt: var(--fq-a-lh-rt, var(--lh-rs));
|
|
121
|
+
--lh-rd1: var(--fq-a-lh-rd1, var(--lh-rt));
|
|
122
|
+
--lh-rd2: var(--fq-a-lh-rd2, var(--lh-rd1));
|
|
123
|
+
--fs-px: calc(var(--fq-u, 1px) * var(--fs-band));
|
|
124
|
+
--lh-px: calc(var(--fq-u, 1px) * var(--lh-band));
|
|
125
|
+
--ls: var(--fq-a-ls);
|
|
126
|
+
--opsz: var(--fq-a-opsz);
|
|
127
|
+
color: var(--color-text-400);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Fixed-size mounts (catalog only); the section sets --fq-u and the ramp ends. */
|
|
131
|
+
|
|
132
|
+
.fq[data-size] {
|
|
133
|
+
--fq-q-f: var(--ts-text-md-light-font);
|
|
134
|
+
--fq-q-fs-rm: 16;
|
|
135
|
+
--fq-q-lh-rm: 22;
|
|
136
|
+
--fq-q-ls: var(--ts-text-md-light-ls);
|
|
137
|
+
--fq-q-opsz: var(--ts-text-md-light-opsz);
|
|
138
|
+
--fq-a-f: var(--ts-text-md-light-font);
|
|
139
|
+
--fq-a-fs-rm: 16;
|
|
140
|
+
--fq-a-lh-rm: 22;
|
|
141
|
+
--fq-a-ls: var(--ts-text-md-light-ls);
|
|
142
|
+
--fq-a-opsz: var(--ts-text-md-light-opsz);
|
|
143
|
+
--fq-a-inset: 0px;
|
|
144
|
+
--fq-gap: 16px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.fq[data-size="xs"] {
|
|
148
|
+
--fq-pt: 20px;
|
|
149
|
+
--fq-pr: 24px;
|
|
150
|
+
--fq-pb: 20px;
|
|
151
|
+
--fq-pl: 16px;
|
|
152
|
+
--fq-qrow: 24px;
|
|
153
|
+
height: 64px;
|
|
154
|
+
}
|
|
155
|
+
.fq[data-size="xs"][data-open] {
|
|
156
|
+
height: 192px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.fq[data-size="sm"] {
|
|
160
|
+
--fq-pt: 12px;
|
|
161
|
+
--fq-pr: 48px;
|
|
162
|
+
--fq-pb: 12px;
|
|
163
|
+
--fq-pl: 48px;
|
|
164
|
+
--fq-qrow: 24px;
|
|
165
|
+
height: 48px;
|
|
166
|
+
}
|
|
167
|
+
.fq[data-size="sm"][data-open] {
|
|
168
|
+
height: 192px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.fq[data-size="md"] {
|
|
172
|
+
--fq-pt: 20px;
|
|
173
|
+
--fq-pr: 40px;
|
|
174
|
+
--fq-pb: 20px;
|
|
175
|
+
--fq-pl: 40px;
|
|
176
|
+
--fq-qrow: 24px;
|
|
177
|
+
height: 64px;
|
|
178
|
+
}
|
|
179
|
+
.fq[data-size="md"][data-open] {
|
|
180
|
+
height: 192px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.fq[data-size="lg"] {
|
|
184
|
+
--fq-pt: 20px;
|
|
185
|
+
--fq-pr: 40px;
|
|
186
|
+
--fq-pb: 20px;
|
|
187
|
+
--fq-pl: 40px;
|
|
188
|
+
--fq-qrow: 40px;
|
|
189
|
+
--fq-gap: 8px;
|
|
190
|
+
height: 80px;
|
|
191
|
+
}
|
|
192
|
+
.fq[data-size="lg"][data-open] {
|
|
193
|
+
height: 160px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.fq[data-size="xl"] {
|
|
197
|
+
--fq-pt: 40px;
|
|
198
|
+
--fq-pr: 40px;
|
|
199
|
+
--fq-pb: 40px;
|
|
200
|
+
--fq-pl: 40px;
|
|
201
|
+
--fq-qrow: 32px;
|
|
202
|
+
--fq-a-inset: 96px;
|
|
203
|
+
/* Pricing v2 (1161:26591) sets the widest question in text-lg-light. */
|
|
204
|
+
--fq-q-f: var(--ts-text-lg-light-font);
|
|
205
|
+
--fq-q-fs-rm: 18;
|
|
206
|
+
--fq-q-lh-rm: 26;
|
|
207
|
+
--fq-q-ls: var(--ts-text-lg-light-ls);
|
|
208
|
+
--fq-q-opsz: var(--ts-text-lg-light-opsz);
|
|
209
|
+
--fq-a-f: var(--ts-text-lg-light-font);
|
|
210
|
+
--fq-a-fs-rm: 18;
|
|
211
|
+
--fq-a-lh-rm: 26;
|
|
212
|
+
--fq-a-ls: var(--ts-text-lg-light-ls);
|
|
213
|
+
--fq-a-opsz: var(--ts-text-lg-light-opsz);
|
|
214
|
+
height: 112px;
|
|
215
|
+
}
|
|
216
|
+
.fq[data-size="xl"][data-open] {
|
|
217
|
+
height: 224px;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* Reduced motion snaps between disclosure states. */
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { IconChevronDownSmall } from "../icons";
|
|
3
|
+
|
|
4
|
+
/** FAQ disclosure row with content-derived open height. */
|
|
5
|
+
|
|
6
|
+
type FaqQuestionSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
7
|
+
|
|
8
|
+
export interface FaqQuestionProps {
|
|
9
|
+
/** Base for the disclosure's aria-controls wiring. */
|
|
10
|
+
id: string;
|
|
11
|
+
question: string;
|
|
12
|
+
/** Prose; an inline <a> reads as a prose link. */
|
|
13
|
+
answer: ReactNode;
|
|
14
|
+
/** Designed anchor size — catalog mounts only; section mounts are
|
|
15
|
+
* unsized and ride the band restatements in faq.css. */
|
|
16
|
+
size?: FaqQuestionSize;
|
|
17
|
+
open?: boolean;
|
|
18
|
+
onToggle?: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function FaqQuestion({
|
|
22
|
+
id,
|
|
23
|
+
question,
|
|
24
|
+
answer,
|
|
25
|
+
size,
|
|
26
|
+
open = false,
|
|
27
|
+
onToggle,
|
|
28
|
+
}: FaqQuestionProps) {
|
|
29
|
+
const answerId = `${id}-answer`;
|
|
30
|
+
return (
|
|
31
|
+
<li
|
|
32
|
+
className="fq"
|
|
33
|
+
data-size={size}
|
|
34
|
+
data-open={open || undefined}
|
|
35
|
+
data-drawer=""
|
|
36
|
+
data-landmark="item"
|
|
37
|
+
>
|
|
38
|
+
<h3 className="fq-h">
|
|
39
|
+
<button
|
|
40
|
+
type="button"
|
|
41
|
+
className="fq-trigger"
|
|
42
|
+
aria-expanded={open}
|
|
43
|
+
aria-controls={answerId}
|
|
44
|
+
onClick={onToggle}
|
|
45
|
+
>
|
|
46
|
+
<span className="type fq-q">{question}</span>
|
|
47
|
+
<IconChevronDownSmall className="fq-chevron" />
|
|
48
|
+
</button>
|
|
49
|
+
</h3>
|
|
50
|
+
<div className="fq-answer" id={answerId}>
|
|
51
|
+
<p className="type fq-a">{answer}</p>
|
|
52
|
+
</div>
|
|
53
|
+
</li>
|
|
54
|
+
);
|
|
55
|
+
}
|