@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,449 @@
|
|
|
1
|
+
/* Fill, ghost, and arrow buttons use fixed geometry per size.
|
|
2
|
+
Interactive states have data-state equivalents for static rendering. */
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
.btn-fill,
|
|
6
|
+
.btn-ghost,
|
|
7
|
+
.btn-arrow {
|
|
8
|
+
--btn-arrow-thru-dur: 500ms;
|
|
9
|
+
--btn-arrow-thru-exit-ease: cubic-bezier(0.64, 0, 0.78, 0);
|
|
10
|
+
--btn-arrow-thru-enter-ease: var(--motion-drawer-ease);
|
|
11
|
+
appearance: none;
|
|
12
|
+
border: 0;
|
|
13
|
+
margin: 0;
|
|
14
|
+
background: none;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
text-decoration: none;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
}
|
|
19
|
+
/* ---------------- size ----------------
|
|
20
|
+
|
|
21
|
+
A control's size is the `--btn-size` keyword its `.btn-body` sees on the
|
|
22
|
+
control. `data-size` on the control sets it; without `data-size` the
|
|
23
|
+
control inherits it, so a section can declare `--btn-size` per band on
|
|
24
|
+
any ancestor (`<ButtonFill size="inherit">`) and one control serves every
|
|
25
|
+
band instead of one hidden copy per band. */
|
|
26
|
+
|
|
27
|
+
.btn-fill[data-size="xl"],
|
|
28
|
+
.btn-ghost[data-size="xl"] { --btn-size: xl; }
|
|
29
|
+
.btn-fill[data-size="lg"],
|
|
30
|
+
.btn-ghost[data-size="lg"],
|
|
31
|
+
.btn-arrow[data-size="lg"] { --btn-size: lg; }
|
|
32
|
+
.btn-fill[data-size="md"],
|
|
33
|
+
.btn-ghost[data-size="md"],
|
|
34
|
+
.btn-arrow[data-size="md"] { --btn-size: md; }
|
|
35
|
+
.btn-fill[data-size="sm"],
|
|
36
|
+
.btn-ghost[data-size="sm"],
|
|
37
|
+
.btn-arrow[data-size="sm"] { --btn-size: sm; }
|
|
38
|
+
.btn-ghost[data-size="xs"] { --btn-size: xs; }
|
|
39
|
+
|
|
40
|
+
.btn-fill,
|
|
41
|
+
.btn-ghost {
|
|
42
|
+
display: inline-flex;
|
|
43
|
+
border-radius: var(--radius-full);
|
|
44
|
+
}
|
|
45
|
+
.btn-fill[data-shape="box"] {
|
|
46
|
+
border-radius: var(--radius-none);
|
|
47
|
+
}
|
|
48
|
+
.btn-body {
|
|
49
|
+
position: relative;
|
|
50
|
+
display: inline-flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
border-radius: inherit;
|
|
55
|
+
height: var(--_h);
|
|
56
|
+
transition-property: background-color;
|
|
57
|
+
transition-duration: var(--motion-hover-duration);
|
|
58
|
+
transition-timing-function: var(--motion-hover-ease);
|
|
59
|
+
}
|
|
60
|
+
/* Touch target: the drawn heights are Figma's (md 40, sm 36, xs 32);
|
|
61
|
+
sizes under 44px extend their hit area invisibly, the .btn-inline
|
|
62
|
+
idiom, so geometry and the visual gate are untouched. */
|
|
63
|
+
.btn-body::after {
|
|
64
|
+
content: "";
|
|
65
|
+
position: absolute;
|
|
66
|
+
inset: min(0px, calc((var(--_h) - 44px) / 2)) 0;
|
|
67
|
+
}
|
|
68
|
+
/* Full-bleed control (`<ButtonFill stretch>`): the control fills its
|
|
69
|
+
container's inline size and the pill follows, label still centred. Forms
|
|
70
|
+
and product sheets use it; marketing controls stay intrinsic. */
|
|
71
|
+
.btn-fill[data-stretch],
|
|
72
|
+
.btn-ghost[data-stretch] {
|
|
73
|
+
display: flex;
|
|
74
|
+
width: 100%;
|
|
75
|
+
}
|
|
76
|
+
.btn-fill[data-stretch] .btn-body,
|
|
77
|
+
.btn-ghost[data-stretch] .btn-body {
|
|
78
|
+
flex: 1 1 auto;
|
|
79
|
+
}
|
|
80
|
+
.btn-fill .btn-body {
|
|
81
|
+
padding: var(--_py) var(--_pr) var(--_py) var(--_pl);
|
|
82
|
+
gap: var(--space-xs);
|
|
83
|
+
background: var(--_bg);
|
|
84
|
+
color: var(--_ink);
|
|
85
|
+
}
|
|
86
|
+
.btn-fill[data-shape="box"] .btn-body {
|
|
87
|
+
padding-inline: var(--_pl-box) var(--_pr-box);
|
|
88
|
+
}
|
|
89
|
+
.btn-ghost .btn-body {
|
|
90
|
+
padding-inline: var(--_px);
|
|
91
|
+
gap: var(--_gap, var(--space-md));
|
|
92
|
+
color: var(--_ink);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@container style(--btn-size: xl) {
|
|
96
|
+
.btn-body {
|
|
97
|
+
--_h: 48px;
|
|
98
|
+
--_py: calc(var(--space-md) + var(--space-2xs));
|
|
99
|
+
--_pl: var(--space-3xl);
|
|
100
|
+
--_pr: var(--space-2xl);
|
|
101
|
+
--_pl-box: var(--space-2xl);
|
|
102
|
+
--_pr-box: var(--space-xl);
|
|
103
|
+
--_px: var(--space-2xl);
|
|
104
|
+
--_icon: 20px;
|
|
105
|
+
--font: var(--ts-text-xl-light-font);
|
|
106
|
+
--ls: var(--ts-text-xl-light-ls);
|
|
107
|
+
--opsz: var(--ts-text-xl-light-opsz);
|
|
108
|
+
}
|
|
109
|
+
.btn-arrow-body {
|
|
110
|
+
--_d: 40px;
|
|
111
|
+
--_g: 24px;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
@container style(--btn-size: lg) {
|
|
115
|
+
.btn-body {
|
|
116
|
+
--_h: 48px;
|
|
117
|
+
--_py: calc(var(--space-md) + var(--space-2xs));
|
|
118
|
+
--_pl: var(--space-2xl);
|
|
119
|
+
--_pr: var(--space-xl);
|
|
120
|
+
--_pl-box: var(--space-xl);
|
|
121
|
+
--_pr-box: var(--space-lg);
|
|
122
|
+
--_px: var(--space-xl);
|
|
123
|
+
--_icon: 20px;
|
|
124
|
+
--font: var(--ts-text-lg-light-font);
|
|
125
|
+
--ls: var(--ts-text-lg-light-ls);
|
|
126
|
+
--opsz: var(--ts-text-lg-light-opsz);
|
|
127
|
+
}
|
|
128
|
+
.btn-arrow-body {
|
|
129
|
+
--_d: 40px;
|
|
130
|
+
--_g: 24px;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
@container style(--btn-size: md) {
|
|
134
|
+
.btn-body {
|
|
135
|
+
--_h: 40px;
|
|
136
|
+
--_py: var(--space-md);
|
|
137
|
+
--_pl: var(--space-xl);
|
|
138
|
+
--_pr: var(--space-lg);
|
|
139
|
+
--_pl-box: var(--space-lg);
|
|
140
|
+
--_pr-box: var(--space-md);
|
|
141
|
+
--_px: var(--space-lg);
|
|
142
|
+
--_icon: 18px;
|
|
143
|
+
--font: var(--ts-text-md-light-font);
|
|
144
|
+
--ls: var(--ts-text-md-light-ls);
|
|
145
|
+
--opsz: var(--ts-text-md-light-opsz);
|
|
146
|
+
}
|
|
147
|
+
.btn-arrow-body {
|
|
148
|
+
--_d: 32px;
|
|
149
|
+
--_g: 18px;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
@container style(--btn-size: sm) {
|
|
153
|
+
.btn-body {
|
|
154
|
+
--_h: 36px;
|
|
155
|
+
--_py: var(--space-sm);
|
|
156
|
+
/* Small pills use an optical left inset. */
|
|
157
|
+
--_pl: calc(var(--space-lg) + var(--space-2xs));
|
|
158
|
+
--_pr: calc(var(--space-md) + var(--space-2xs));
|
|
159
|
+
--_pl-box: var(--space-lg);
|
|
160
|
+
--_pr-box: var(--space-md);
|
|
161
|
+
--_px: var(--space-lg);
|
|
162
|
+
--_icon: 16px;
|
|
163
|
+
--font: var(--ts-text-sm-light-font);
|
|
164
|
+
--ls: var(--ts-text-sm-light-ls);
|
|
165
|
+
--opsz: var(--ts-text-sm-light-opsz);
|
|
166
|
+
}
|
|
167
|
+
.btn-arrow-body {
|
|
168
|
+
--_d: 28px;
|
|
169
|
+
--_g: 16px;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
@container style(--btn-size: xs) {
|
|
173
|
+
.btn-body {
|
|
174
|
+
--_h: 32px;
|
|
175
|
+
--_px: var(--space-lg);
|
|
176
|
+
--_gap: var(--space-sm);
|
|
177
|
+
--_icon: 14px;
|
|
178
|
+
--font: var(--ts-text-xs-light-font);
|
|
179
|
+
--ls: var(--ts-text-xs-light-ls);
|
|
180
|
+
--opsz: var(--ts-text-xs-light-opsz);
|
|
181
|
+
}
|
|
182
|
+
.btn-arrow-body {
|
|
183
|
+
--_d: 28px;
|
|
184
|
+
--_g: 16px;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* ---------------- button-fill ---------------- */
|
|
189
|
+
|
|
190
|
+
.btn-fill[data-chrome="teal"] {
|
|
191
|
+
--_bg: var(--color-teal-300);
|
|
192
|
+
--_bg-hover: var(--color-teal-400);
|
|
193
|
+
--_ring: var(--color-teal-500);
|
|
194
|
+
--_ink: var(--color-teal-800);
|
|
195
|
+
--_glyph: var(--color-teal-600);
|
|
196
|
+
}
|
|
197
|
+
.btn-fill[data-chrome="gray"] {
|
|
198
|
+
--_bg: var(--color-bg-300);
|
|
199
|
+
--_bg-hover: var(--color-bg-400);
|
|
200
|
+
--_ring: var(--color-border-200);
|
|
201
|
+
--_ink: var(--color-text-200);
|
|
202
|
+
--_glyph: var(--color-text-500);
|
|
203
|
+
}
|
|
204
|
+
/* The Scale plan's button (1129:17842): blue/250 on blue/800. Hover and
|
|
205
|
+
ring step one swatch like the teal chrome; the design draws rest only. */
|
|
206
|
+
.btn-fill[data-chrome="blue"] {
|
|
207
|
+
--_bg: var(--color-blue-250);
|
|
208
|
+
--_bg-hover: var(--color-blue-300);
|
|
209
|
+
--_ring: var(--color-blue-400);
|
|
210
|
+
--_ink: var(--color-blue-800);
|
|
211
|
+
--_glyph: var(--color-blue-600);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@media (hover: hover) {
|
|
215
|
+
.btn-fill:hover .btn-body {
|
|
216
|
+
background: var(--_bg-hover);
|
|
217
|
+
}
|
|
218
|
+
.btn-fill:hover .btn-glyph {
|
|
219
|
+
left: var(--btn-glyph-slide);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
.btn-fill[data-state="hover"] .btn-body {
|
|
223
|
+
background: var(--_bg-hover);
|
|
224
|
+
}
|
|
225
|
+
.btn-fill[data-state="hover"] .btn-glyph {
|
|
226
|
+
left: var(--btn-glyph-slide);
|
|
227
|
+
}
|
|
228
|
+
.btn-fill:focus-visible,
|
|
229
|
+
.btn-fill[data-state="focus"] {
|
|
230
|
+
outline: none;
|
|
231
|
+
box-shadow: 0 0 0 var(--ring-w) var(--_ring);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.btn-fill:disabled {
|
|
235
|
+
cursor: not-allowed;
|
|
236
|
+
box-shadow: none;
|
|
237
|
+
}
|
|
238
|
+
.btn-fill:disabled .btn-body {
|
|
239
|
+
background: var(--color-bg-300);
|
|
240
|
+
color: var(--color-text-500);
|
|
241
|
+
}
|
|
242
|
+
.btn-fill:disabled .btn-glyph {
|
|
243
|
+
color: var(--color-text-600);
|
|
244
|
+
left: 0;
|
|
245
|
+
}
|
|
246
|
+
@media (hover: hover) {
|
|
247
|
+
.btn-fill:disabled:hover .btn-body {
|
|
248
|
+
background: var(--color-bg-300);
|
|
249
|
+
}
|
|
250
|
+
.btn-fill:disabled:hover .btn-glyph {
|
|
251
|
+
left: 0;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* The trailing glyph is an arrow that slides on hover. */
|
|
256
|
+
.btn-fill .btn-glyph {
|
|
257
|
+
display: inline-flex;
|
|
258
|
+
flex: none;
|
|
259
|
+
color: var(--_glyph);
|
|
260
|
+
/* Animate left to avoid compositor re-rasterization during fill changes. */
|
|
261
|
+
position: relative;
|
|
262
|
+
left: 0;
|
|
263
|
+
transition: left var(--btn-glyph-slide-dur) var(--motion-hover-ease);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/* ---------------- button-ghost ---------------- */
|
|
267
|
+
|
|
268
|
+
.btn-ghost {
|
|
269
|
+
--_ink: var(--color-brown-600);
|
|
270
|
+
--_hover-bg: var(--color-brown-200);
|
|
271
|
+
--_ring: var(--color-brown-200);
|
|
272
|
+
}
|
|
273
|
+
.btn-ghost[data-color="teal"] {
|
|
274
|
+
--_ink: var(--color-teal-600);
|
|
275
|
+
--_hover-bg: var(--color-teal-200);
|
|
276
|
+
--_ring: var(--color-teal-200);
|
|
277
|
+
}
|
|
278
|
+
.btn-ghost[data-color="gray"] {
|
|
279
|
+
--_ink: var(--color-text-200);
|
|
280
|
+
--_hover-bg: var(--color-bg-300);
|
|
281
|
+
--_ring: var(--color-bg-200);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
@media (hover: hover) {
|
|
285
|
+
.btn-ghost:not(:disabled):hover .btn-body {
|
|
286
|
+
background: var(--_hover-bg);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
.btn-ghost[data-state="hover"] .btn-body {
|
|
290
|
+
background: var(--_hover-bg);
|
|
291
|
+
}
|
|
292
|
+
/* Focus uses the chrome's light ring. */
|
|
293
|
+
.btn-ghost:focus-visible,
|
|
294
|
+
.btn-ghost[data-state="focus"] {
|
|
295
|
+
outline: none;
|
|
296
|
+
box-shadow: 0 0 0 var(--ring-w) var(--_ring);
|
|
297
|
+
}
|
|
298
|
+
.btn-ghost:disabled {
|
|
299
|
+
--_ink: var(--color-text-500);
|
|
300
|
+
cursor: default;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/* leading icon slot — icons keep their intrinsic two-tone palettes */
|
|
304
|
+
.btn-ghost .btn-icon {
|
|
305
|
+
display: inline-flex;
|
|
306
|
+
}
|
|
307
|
+
.btn-ghost .btn-icon svg {
|
|
308
|
+
width: var(--_icon);
|
|
309
|
+
height: var(--_icon);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/* ---------------- button-arrow ---------------- */
|
|
313
|
+
|
|
314
|
+
.btn-arrow {
|
|
315
|
+
position: relative;
|
|
316
|
+
display: inline-grid;
|
|
317
|
+
box-sizing: border-box;
|
|
318
|
+
border-radius: var(--radius-full);
|
|
319
|
+
padding: var(--space-none);
|
|
320
|
+
background: var(--_bg);
|
|
321
|
+
color: var(--_glyph);
|
|
322
|
+
flex: none;
|
|
323
|
+
/* The clipped circle hides the arrow's pass-through travel. */
|
|
324
|
+
overflow: clip;
|
|
325
|
+
}
|
|
326
|
+
/* The body carries the size the control's --btn-size selects. */
|
|
327
|
+
.btn-arrow-body {
|
|
328
|
+
display: grid;
|
|
329
|
+
place-items: center;
|
|
330
|
+
width: var(--_d);
|
|
331
|
+
height: var(--_d);
|
|
332
|
+
--_thru: calc((var(--_d) + var(--_g)) / 2);
|
|
333
|
+
}
|
|
334
|
+
/* Hover fill lives on a child so this clip box never paint-transitions. */
|
|
335
|
+
.btn-arrow::before {
|
|
336
|
+
content: "";
|
|
337
|
+
position: absolute;
|
|
338
|
+
inset: 0;
|
|
339
|
+
border-radius: inherit;
|
|
340
|
+
background: var(--_bg-hover);
|
|
341
|
+
opacity: 0;
|
|
342
|
+
pointer-events: none;
|
|
343
|
+
transition: opacity var(--motion-hover-duration) var(--motion-drawer-ease);
|
|
344
|
+
}
|
|
345
|
+
.btn-arrow svg {
|
|
346
|
+
grid-area: 1 / 1;
|
|
347
|
+
width: var(--_g);
|
|
348
|
+
height: var(--_g);
|
|
349
|
+
/* relative left, not transform — same no-compositor rule as
|
|
350
|
+
.btn-glyph; also keeps clear of the loading spin's transform */
|
|
351
|
+
position: relative;
|
|
352
|
+
z-index: 1;
|
|
353
|
+
left: 0;
|
|
354
|
+
}
|
|
355
|
+
/* Stacked glyphs sequence two half-duration legs and blend interruptions. */
|
|
356
|
+
.btn-arrow .btn-arrow-main {
|
|
357
|
+
transition: left calc(var(--btn-arrow-thru-dur) / 2)
|
|
358
|
+
var(--btn-arrow-thru-enter-ease) calc(var(--btn-arrow-thru-dur) / 2);
|
|
359
|
+
}
|
|
360
|
+
.btn-arrow .btn-arrow-ghost {
|
|
361
|
+
left: calc(-1 * var(--_thru));
|
|
362
|
+
transition: left calc(var(--btn-arrow-thru-dur) / 2)
|
|
363
|
+
var(--btn-arrow-thru-exit-ease);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.btn-arrow[data-chrome="teal"] {
|
|
367
|
+
--_bg: var(--color-teal-400);
|
|
368
|
+
--_bg-hover: var(--color-teal-500);
|
|
369
|
+
--_bg-disabled: var(--color-teal-250);
|
|
370
|
+
--_bg-loading: var(--color-teal-300);
|
|
371
|
+
--_glyph: var(--color-teal-800);
|
|
372
|
+
--_glyph-disabled: var(--color-teal-500);
|
|
373
|
+
--_glyph-loading: var(--color-teal-800);
|
|
374
|
+
}
|
|
375
|
+
.btn-arrow[data-chrome="gray"] {
|
|
376
|
+
--_bg: var(--color-bg-300);
|
|
377
|
+
--_bg-hover: var(--color-bg-500);
|
|
378
|
+
--_bg-disabled: var(--color-bg-200);
|
|
379
|
+
--_bg-loading: var(--color-bg-300);
|
|
380
|
+
--_glyph: var(--color-text-200);
|
|
381
|
+
--_glyph-disabled: var(--color-text-600);
|
|
382
|
+
--_glyph-loading: var(--color-text-100);
|
|
383
|
+
}
|
|
384
|
+
/* Brown chrome gives its spinner an explicit track color. */
|
|
385
|
+
.btn-arrow[data-chrome="brown"] {
|
|
386
|
+
--_bg: var(--color-brown-200);
|
|
387
|
+
--_bg-hover: var(--color-brown-300);
|
|
388
|
+
--_bg-disabled: var(--color-brown-100);
|
|
389
|
+
--_bg-loading: var(--color-brown-200);
|
|
390
|
+
--_glyph: var(--color-brown-600);
|
|
391
|
+
--_glyph-disabled: var(--color-brown-300);
|
|
392
|
+
--_glyph-loading: var(--color-brown-700);
|
|
393
|
+
--loading-track: var(--color-brown-300);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
@media (hover: hover) {
|
|
397
|
+
.btn-arrow:not(:disabled):not([data-state="disabled"]):not([data-loading]):hover::before {
|
|
398
|
+
opacity: 1;
|
|
399
|
+
}
|
|
400
|
+
.btn-arrow:not(:disabled):not([data-state="disabled"]):not([data-loading]):hover
|
|
401
|
+
.btn-arrow-main {
|
|
402
|
+
left: var(--_thru);
|
|
403
|
+
transition: left calc(var(--btn-arrow-thru-dur) / 2)
|
|
404
|
+
var(--btn-arrow-thru-exit-ease);
|
|
405
|
+
}
|
|
406
|
+
.btn-arrow:not(:disabled):not([data-state="disabled"]):not([data-loading]):hover
|
|
407
|
+
.btn-arrow-ghost {
|
|
408
|
+
left: 0;
|
|
409
|
+
transition: left calc(var(--btn-arrow-thru-dur) / 2)
|
|
410
|
+
var(--btn-arrow-thru-enter-ease) calc(var(--btn-arrow-thru-dur) / 2);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
.btn-arrow[data-state="hover"]::before {
|
|
414
|
+
opacity: 1;
|
|
415
|
+
}
|
|
416
|
+
.btn-arrow[data-state="hover"] .btn-arrow-main {
|
|
417
|
+
left: var(--_thru);
|
|
418
|
+
transition: left calc(var(--btn-arrow-thru-dur) / 2)
|
|
419
|
+
var(--btn-arrow-thru-exit-ease);
|
|
420
|
+
}
|
|
421
|
+
.btn-arrow[data-state="hover"] .btn-arrow-ghost {
|
|
422
|
+
left: 0;
|
|
423
|
+
transition: left calc(var(--btn-arrow-thru-dur) / 2)
|
|
424
|
+
var(--btn-arrow-thru-enter-ease) calc(var(--btn-arrow-thru-dur) / 2);
|
|
425
|
+
}
|
|
426
|
+
.btn-arrow:focus-visible {
|
|
427
|
+
outline: none;
|
|
428
|
+
box-shadow: 0 0 0 var(--ring-w) var(--_bg-disabled);
|
|
429
|
+
}
|
|
430
|
+
.btn-arrow:disabled,
|
|
431
|
+
.btn-arrow[data-state="disabled"] {
|
|
432
|
+
background: var(--_bg-disabled);
|
|
433
|
+
color: var(--_glyph-disabled);
|
|
434
|
+
cursor: default;
|
|
435
|
+
}
|
|
436
|
+
.btn-arrow[data-loading] {
|
|
437
|
+
background: var(--_bg-loading);
|
|
438
|
+
color: var(--_glyph-loading);
|
|
439
|
+
pointer-events: none;
|
|
440
|
+
}
|
|
441
|
+
.btn-arrow[data-loading] svg {
|
|
442
|
+
animation: btn-arrow-spin 1s linear infinite;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
@keyframes btn-arrow-spin {
|
|
446
|
+
to {
|
|
447
|
+
transform: rotate(360deg);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/** Fill, ghost, and icon button primitives. */
|
|
2
|
+
|
|
3
|
+
import type { MouseEventHandler, ReactNode } from "react";
|
|
4
|
+
import { IconArrowRight, IconCaseStudies, IconLoadingCircle, IconNavTrigger } from "../icons";
|
|
5
|
+
import { EXTERNAL_LINK } from "../site-links";
|
|
6
|
+
|
|
7
|
+
type ForceableState = "hover" | "focus";
|
|
8
|
+
|
|
9
|
+
/** Pass-through data and ARIA attributes for an island's own hooks (a
|
|
10
|
+
* toggle's `aria-expanded`, `aria-controls`, a test id). Marketing pages
|
|
11
|
+
* wire behaviour through `action` instead. */
|
|
12
|
+
type PassAttrs = Record<`data-${string}` | `aria-${string}`, string | undefined>;
|
|
13
|
+
|
|
14
|
+
/** `inherit` takes `--btn-size` from an ancestor, which a section sets per
|
|
15
|
+
* band so one control serves every band. */
|
|
16
|
+
type FillSize = "xl" | "lg" | "md" | "sm" | "inherit";
|
|
17
|
+
type GhostSize = FillSize | "xs";
|
|
18
|
+
|
|
19
|
+
interface ButtonFillProps {
|
|
20
|
+
size?: FillSize;
|
|
21
|
+
chrome?: "teal" | "gray" | "blue";
|
|
22
|
+
shape?: "pill" | "box";
|
|
23
|
+
type?: "button" | "submit";
|
|
24
|
+
/** Renders link chrome when provided. */
|
|
25
|
+
href?: string;
|
|
26
|
+
/** Open in a new tab (external destinations). */
|
|
27
|
+
external?: boolean;
|
|
28
|
+
/** Behavior hook rendered as data-action. */
|
|
29
|
+
action?: string;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** Fill the container's inline size (form submits, product sheets). */
|
|
32
|
+
stretch?: boolean;
|
|
33
|
+
forceState?: ForceableState;
|
|
34
|
+
/** An island's own handler; pages prefer `action`. */
|
|
35
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
36
|
+
attrs?: PassAttrs;
|
|
37
|
+
children: ReactNode;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function sizeAttr(size: GhostSize): string | undefined {
|
|
41
|
+
return size === "inherit" ? undefined : size;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function ButtonFill({
|
|
45
|
+
size = "lg",
|
|
46
|
+
chrome = "teal",
|
|
47
|
+
shape = "pill",
|
|
48
|
+
type = "button",
|
|
49
|
+
href,
|
|
50
|
+
external = false,
|
|
51
|
+
action,
|
|
52
|
+
disabled = false,
|
|
53
|
+
stretch = false,
|
|
54
|
+
forceState,
|
|
55
|
+
onClick,
|
|
56
|
+
attrs,
|
|
57
|
+
children,
|
|
58
|
+
}: ButtonFillProps) {
|
|
59
|
+
const label = (
|
|
60
|
+
<span className="type type-fixed btn-body">
|
|
61
|
+
{children}
|
|
62
|
+
<span className="btn-glyph">
|
|
63
|
+
<IconNavTrigger variant="arrow" />
|
|
64
|
+
</span>
|
|
65
|
+
</span>
|
|
66
|
+
);
|
|
67
|
+
if (href !== undefined) {
|
|
68
|
+
return (
|
|
69
|
+
<a
|
|
70
|
+
href={href}
|
|
71
|
+
className="btn-fill"
|
|
72
|
+
data-size={sizeAttr(size)}
|
|
73
|
+
data-chrome={chrome}
|
|
74
|
+
data-shape={shape}
|
|
75
|
+
data-stretch={stretch ? "" : undefined}
|
|
76
|
+
data-state={forceState}
|
|
77
|
+
data-action={action}
|
|
78
|
+
onClick={onClick}
|
|
79
|
+
{...(external ? EXTERNAL_LINK : {})}
|
|
80
|
+
{...attrs}
|
|
81
|
+
>
|
|
82
|
+
{label}
|
|
83
|
+
</a>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
return (
|
|
87
|
+
<button
|
|
88
|
+
type={type}
|
|
89
|
+
className="btn-fill"
|
|
90
|
+
data-size={sizeAttr(size)}
|
|
91
|
+
data-chrome={chrome}
|
|
92
|
+
data-shape={shape}
|
|
93
|
+
data-stretch={stretch ? "" : undefined}
|
|
94
|
+
data-state={forceState}
|
|
95
|
+
data-action={action}
|
|
96
|
+
disabled={disabled}
|
|
97
|
+
onClick={onClick}
|
|
98
|
+
{...attrs}
|
|
99
|
+
>
|
|
100
|
+
{label}
|
|
101
|
+
</button>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
interface ButtonGhostProps {
|
|
106
|
+
size?: GhostSize;
|
|
107
|
+
color?: "brown" | "teal" | "gray";
|
|
108
|
+
/** Leading icon; icons keep their intrinsic two-tone palettes. Pass
|
|
109
|
+
* null for a text-only button. */
|
|
110
|
+
icon?: ReactNode;
|
|
111
|
+
/** Renders link chrome when provided. */
|
|
112
|
+
href?: string;
|
|
113
|
+
/** Open in a new tab (external destinations). */
|
|
114
|
+
external?: boolean;
|
|
115
|
+
/** Behavior hook rendered as data-action — "open-chat" opens the site
|
|
116
|
+
* chat (sections/site-chat-open.tsx); "open-gallery" the work gallery. */
|
|
117
|
+
action?: string;
|
|
118
|
+
disabled?: boolean;
|
|
119
|
+
forceState?: ForceableState;
|
|
120
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
121
|
+
attrs?: PassAttrs;
|
|
122
|
+
children: ReactNode;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function ButtonGhost({
|
|
126
|
+
size = "lg",
|
|
127
|
+
color = "brown",
|
|
128
|
+
icon = <IconCaseStudies />,
|
|
129
|
+
href,
|
|
130
|
+
external = false,
|
|
131
|
+
action,
|
|
132
|
+
disabled = false,
|
|
133
|
+
forceState,
|
|
134
|
+
onClick,
|
|
135
|
+
attrs,
|
|
136
|
+
children,
|
|
137
|
+
}: ButtonGhostProps) {
|
|
138
|
+
const content = (
|
|
139
|
+
<span className="type type-fixed btn-body">
|
|
140
|
+
{icon !== null && <span className="btn-icon">{icon}</span>}
|
|
141
|
+
{children}
|
|
142
|
+
</span>
|
|
143
|
+
);
|
|
144
|
+
if (href !== undefined) {
|
|
145
|
+
return (
|
|
146
|
+
<a
|
|
147
|
+
href={href}
|
|
148
|
+
className="btn-ghost"
|
|
149
|
+
data-size={sizeAttr(size)}
|
|
150
|
+
data-color={color}
|
|
151
|
+
data-state={forceState}
|
|
152
|
+
data-action={action}
|
|
153
|
+
onClick={onClick}
|
|
154
|
+
{...(external ? EXTERNAL_LINK : {})}
|
|
155
|
+
{...attrs}
|
|
156
|
+
>
|
|
157
|
+
{content}
|
|
158
|
+
</a>
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
return (
|
|
162
|
+
<button
|
|
163
|
+
type="button"
|
|
164
|
+
className="btn-ghost"
|
|
165
|
+
data-size={sizeAttr(size)}
|
|
166
|
+
data-color={color}
|
|
167
|
+
data-state={forceState}
|
|
168
|
+
data-action={action}
|
|
169
|
+
disabled={disabled}
|
|
170
|
+
onClick={onClick}
|
|
171
|
+
{...attrs}
|
|
172
|
+
>
|
|
173
|
+
{content}
|
|
174
|
+
</button>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
interface ButtonArrowProps {
|
|
179
|
+
size?: "lg" | "md" | "sm" | "inherit";
|
|
180
|
+
chrome?: "teal" | "gray" | "brown";
|
|
181
|
+
/** A URL renders link chrome; null renders disabled non-link chrome. */
|
|
182
|
+
href?: string | null;
|
|
183
|
+
disabled?: boolean;
|
|
184
|
+
loading?: boolean;
|
|
185
|
+
forceState?: ForceableState | "disabled";
|
|
186
|
+
/** The control is icon-only; the name is mandatory. */
|
|
187
|
+
label: string;
|
|
188
|
+
type?: "button" | "submit";
|
|
189
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
190
|
+
attrs?: PassAttrs;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export function ButtonArrow({
|
|
194
|
+
size = "lg",
|
|
195
|
+
chrome = "teal",
|
|
196
|
+
href,
|
|
197
|
+
disabled = false,
|
|
198
|
+
loading = false,
|
|
199
|
+
forceState,
|
|
200
|
+
label,
|
|
201
|
+
type = "button",
|
|
202
|
+
onClick,
|
|
203
|
+
attrs,
|
|
204
|
+
}: ButtonArrowProps) {
|
|
205
|
+
const glyph = (
|
|
206
|
+
<span className="btn-arrow-body">
|
|
207
|
+
{loading ? (
|
|
208
|
+
<IconLoadingCircle />
|
|
209
|
+
) : (
|
|
210
|
+
<>
|
|
211
|
+
{/* Stacked glyphs create the hover pass-through. */}
|
|
212
|
+
<IconArrowRight className="btn-arrow-main" />
|
|
213
|
+
<IconArrowRight className="btn-arrow-ghost" />
|
|
214
|
+
</>
|
|
215
|
+
)}
|
|
216
|
+
</span>
|
|
217
|
+
);
|
|
218
|
+
if (typeof href === "string") {
|
|
219
|
+
return (
|
|
220
|
+
<a
|
|
221
|
+
href={href}
|
|
222
|
+
className="btn-arrow"
|
|
223
|
+
data-size={sizeAttr(size)}
|
|
224
|
+
data-chrome={chrome}
|
|
225
|
+
data-state={forceState}
|
|
226
|
+
aria-label={label}
|
|
227
|
+
>
|
|
228
|
+
{glyph}
|
|
229
|
+
</a>
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
if (href === null) {
|
|
233
|
+
return (
|
|
234
|
+
<span
|
|
235
|
+
className="btn-arrow"
|
|
236
|
+
data-size={sizeAttr(size)}
|
|
237
|
+
data-chrome={chrome}
|
|
238
|
+
data-state="disabled"
|
|
239
|
+
aria-disabled="true"
|
|
240
|
+
aria-label={label}
|
|
241
|
+
>
|
|
242
|
+
{glyph}
|
|
243
|
+
</span>
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
return (
|
|
247
|
+
<button
|
|
248
|
+
type={type}
|
|
249
|
+
className="btn-arrow"
|
|
250
|
+
data-size={sizeAttr(size)}
|
|
251
|
+
data-chrome={chrome}
|
|
252
|
+
data-state={forceState}
|
|
253
|
+
data-loading={loading || undefined}
|
|
254
|
+
disabled={disabled}
|
|
255
|
+
aria-busy={loading || undefined}
|
|
256
|
+
aria-label={label}
|
|
257
|
+
onClick={onClick}
|
|
258
|
+
{...attrs}
|
|
259
|
+
>
|
|
260
|
+
{glyph}
|
|
261
|
+
</button>
|
|
262
|
+
);
|
|
263
|
+
}
|