@keystone-sites/marketing-design-system 1.0.26 → 2.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.
Files changed (204) hide show
  1. package/README.md +47 -67
  2. package/fonts/gt-america-300-italic.woff2 +0 -0
  3. package/fonts/gt-america-300.woff2 +0 -0
  4. package/fonts/gt-america-400-italic.woff2 +0 -0
  5. package/fonts/gt-america-400.woff2 +0 -0
  6. package/fonts/gt-america-500.woff2 +0 -0
  7. package/fonts/gt-america-extended-300.woff2 +0 -0
  8. package/fonts/gt-america-extended-400.woff2 +0 -0
  9. package/fonts/gt-america-extended-500.woff2 +0 -0
  10. package/fonts/gt-america-extended-700.woff2 +0 -0
  11. package/fonts/gt-america-mono-300.woff2 +0 -0
  12. package/fonts/gt-america-mono-500.woff2 +0 -0
  13. package/fonts/pp-kyoto-vf.woff2 +0 -0
  14. package/package.json +46 -203
  15. package/src/base.css +300 -0
  16. package/src/fonts.css +131 -0
  17. package/src/hue.ts +17 -0
  18. package/src/icon.tsx +56 -0
  19. package/src/mark.tsx +14 -0
  20. package/src/motion.ts +123 -0
  21. package/src/parts/chip.css +84 -0
  22. package/src/parts/chip.tsx +40 -0
  23. package/src/parts/composer.css +195 -0
  24. package/src/parts/composer.tsx +220 -0
  25. package/src/parts/cx.ts +2 -0
  26. package/src/parts/faq.css +77 -0
  27. package/src/parts/faq.tsx +25 -0
  28. package/src/parts/footer.css +51 -0
  29. package/src/parts/footer.tsx +27 -0
  30. package/src/parts/nav.css +180 -0
  31. package/src/parts/nav.tsx +101 -0
  32. package/src/parts/photo.css +15 -0
  33. package/src/parts/photo.tsx +24 -0
  34. package/src/parts/plans.css +89 -0
  35. package/src/parts/plans.tsx +56 -0
  36. package/src/parts/prose.css +86 -0
  37. package/src/parts/prose.tsx +49 -0
  38. package/src/parts/shape.css +47 -0
  39. package/src/parts/shape.tsx +68 -0
  40. package/src/parts/split.tsx +49 -0
  41. package/src/parts/stamp.css +85 -0
  42. package/src/parts/stamp.tsx +36 -0
  43. package/src/parts/work-card.css +51 -0
  44. package/src/parts/work-card.tsx +40 -0
  45. package/src/set.css +439 -0
  46. package/src/styles.css +20 -0
  47. package/src/tokens/color.css +471 -0
  48. package/src/tokens/roles.css +12 -0
  49. package/src/tokens/type.css +11 -0
  50. package/src/wordmark.tsx +34 -0
  51. package/AGENTS.md +0 -192
  52. package/assets/media/brand/ks-lockup.svg +0 -13
  53. package/assets/media/brand/ks-logomark.svg +0 -4
  54. package/assets/media/brand/ks-wordmark-inline.svg +0 -13
  55. package/assets/media/brand/ks-wordmark.svg +0 -11
  56. package/assets/media/fonts/gt-standard-standard-vf.woff2 +0 -0
  57. package/assets/media/fonts/pp-kyoto-variable-upright-vf.woff2 +0 -0
  58. package/base.css +0 -113
  59. package/css-vars.d.ts +0 -10
  60. package/grid/engine.css +0 -367
  61. package/grid/field-hash.ts +0 -31
  62. package/grid/field.tsx +0 -48
  63. package/grid/gates.cjs +0 -35
  64. package/grid/region.tsx +0 -97
  65. package/icons.tsx +0 -1282
  66. package/index.css +0 -89
  67. package/lib/autoplay-gate.ts +0 -88
  68. package/lib/focus-trap.ts +0 -42
  69. package/lib/grader.ts +0 -123
  70. package/lib/legal-data.ts +0 -1
  71. package/lib/legal.ts +0 -41
  72. package/lib/noise.tsx +0 -114
  73. package/lib/phone.ts +0 -294
  74. package/lib/render-boundary.tsx +0 -27
  75. package/lib/scroll-lock.ts +0 -25
  76. package/lib/swipe.ts +0 -124
  77. package/lib/use-active-section.ts +0 -43
  78. package/lib/use-count-up.ts +0 -26
  79. package/lib/use-grader-search.ts +0 -143
  80. package/lib/use-popover.ts +0 -30
  81. package/lib/use-video-carousel.ts +0 -271
  82. package/media.ts +0 -558
  83. package/primitives/breadcrumb.css +0 -51
  84. package/primitives/breadcrumb.tsx +0 -46
  85. package/primitives/business-picker.css +0 -135
  86. package/primitives/business-picker.tsx +0 -298
  87. package/primitives/button-inline.css +0 -52
  88. package/primitives/button-inline.tsx +0 -38
  89. package/primitives/buttons.css +0 -551
  90. package/primitives/buttons.tsx +0 -330
  91. package/primitives/case-study-button.css +0 -71
  92. package/primitives/case-study-button.tsx +0 -28
  93. package/primitives/case-study-card.css +0 -318
  94. package/primitives/case-study-card.tsx +0 -116
  95. package/primitives/chip.css +0 -127
  96. package/primitives/chip.tsx +0 -53
  97. package/primitives/closer-row.css +0 -14
  98. package/primitives/closer-row.tsx +0 -22
  99. package/primitives/cta-row.css +0 -41
  100. package/primitives/cta-row.tsx +0 -39
  101. package/primitives/disclosure.css +0 -302
  102. package/primitives/disclosure.tsx +0 -277
  103. package/primitives/faq-question.css +0 -220
  104. package/primitives/faq-question.tsx +0 -55
  105. package/primitives/field.css +0 -279
  106. package/primitives/field.tsx +0 -376
  107. package/primitives/footer-item.css +0 -72
  108. package/primitives/footer-item.tsx +0 -42
  109. package/primitives/glyph-toggle.css +0 -62
  110. package/primitives/glyph-toggle.tsx +0 -42
  111. package/primitives/grader-menu.tsx +0 -84
  112. package/primitives/grader.css +0 -369
  113. package/primitives/grader.tsx +0 -285
  114. package/primitives/keystone-score.css +0 -156
  115. package/primitives/keystone-score.tsx +0 -204
  116. package/primitives/modal.css +0 -194
  117. package/primitives/modal.tsx +0 -204
  118. package/primitives/month-range.css +0 -80
  119. package/primitives/month-range.tsx +0 -183
  120. package/primitives/notice.css +0 -39
  121. package/primitives/notice.tsx +0 -56
  122. package/primitives/persona-card.css +0 -374
  123. package/primitives/persona-card.tsx +0 -74
  124. package/primitives/picture.css +0 -11
  125. package/primitives/picture.tsx +0 -41
  126. package/primitives/plan-card.css +0 -398
  127. package/primitives/plan-card.tsx +0 -153
  128. package/primitives/prose.css +0 -164
  129. package/primitives/prose.tsx +0 -194
  130. package/primitives/ramps.css +0 -77
  131. package/primitives/report-nav.css +0 -382
  132. package/primitives/report-nav.tsx +0 -353
  133. package/primitives/report.css +0 -601
  134. package/primitives/report.tsx +0 -357
  135. package/primitives/skeleton.css +0 -82
  136. package/primitives/skeleton.tsx +0 -56
  137. package/primitives/slider.css +0 -179
  138. package/primitives/slider.tsx +0 -69
  139. package/primitives/slug.css +0 -87
  140. package/primitives/slug.tsx +0 -37
  141. package/primitives/status.css +0 -427
  142. package/primitives/status.tsx +0 -323
  143. package/primitives/strip.css +0 -40
  144. package/primitives/surface.css +0 -88
  145. package/primitives/surface.tsx +0 -100
  146. package/primitives/table.css +0 -227
  147. package/primitives/table.tsx +0 -122
  148. package/primitives/tabs.css +0 -85
  149. package/primitives/tabs.tsx +0 -122
  150. package/primitives/tag.css +0 -46
  151. package/primitives/tag.tsx +0 -33
  152. package/primitives/text.css +0 -127
  153. package/primitives/toc.css +0 -65
  154. package/primitives/toc.tsx +0 -42
  155. package/primitives/tooltip.css +0 -56
  156. package/primitives/tooltip.tsx +0 -103
  157. package/rules/design-system.md +0 -154
  158. package/rules/grid-and-layout.md +0 -166
  159. package/scripts/generate-exports.mjs +0 -61
  160. package/scripts/generate-type-css.mjs +0 -130
  161. package/sections/faq-island.tsx +0 -102
  162. package/sections/faq.css +0 -213
  163. package/sections/faq.tsx +0 -46
  164. package/sections/footer-nav.tsx +0 -95
  165. package/sections/footer-signature.css +0 -223
  166. package/sections/footer-signature.tsx +0 -127
  167. package/sections/footer.css +0 -735
  168. package/sections/footer.tsx +0 -286
  169. package/sections/gallery-overlay.css +0 -213
  170. package/sections/gallery-overlay.tsx +0 -267
  171. package/sections/landing-benefits.css +0 -59
  172. package/sections/landing-benefits.tsx +0 -81
  173. package/sections/landing-closer.css +0 -23
  174. package/sections/landing-closer.tsx +0 -26
  175. package/sections/landing-hero.css +0 -80
  176. package/sections/landing-hero.tsx +0 -69
  177. package/sections/landing-quote.css +0 -19
  178. package/sections/landing-quote.tsx +0 -30
  179. package/sections/landing-sample.ts +0 -66
  180. package/sections/landing.css +0 -45
  181. package/sections/landing.tsx +0 -69
  182. package/sections/load-orchestrator.tsx +0 -43
  183. package/sections/load.css +0 -138
  184. package/sections/nav-desktop.css +0 -530
  185. package/sections/nav-desktop.tsx +0 -155
  186. package/sections/nav-menu.css +0 -57
  187. package/sections/nav-menu.tsx +0 -112
  188. package/sections/nav-mobile.css +0 -571
  189. package/sections/nav-mobile.tsx +0 -222
  190. package/sections/nav.css +0 -127
  191. package/sections/nav.tsx +0 -394
  192. package/sections/site-chat-data.ts +0 -16
  193. package/sections/site-chat-open.tsx +0 -25
  194. package/sections/site-chat.tsx +0 -67
  195. package/site-links.ts +0 -41
  196. package/site.ts +0 -2
  197. package/themes/inverted.css +0 -139
  198. package/tokens/fonts.css +0 -38
  199. package/tokens/motion.css +0 -150
  200. package/tokens/primitives.css +0 -163
  201. package/tokens/semantic.css +0 -159
  202. package/tokens/type-styles.json +0 -145
  203. package/tokens/type.css +0 -1548
  204. package/widgets.css +0 -78
@@ -1,353 +0,0 @@
1
- "use client";
2
-
3
- /** The report's page switcher (ks-Grader grader-nav, 64:8505), standing
4
- * in the nav bar once a report is read. From the first desktop anchor
5
- * the pages are chips in the bar (`ReportNavChips`), the current one on
6
- * white; from the second each area's carries its score as a small ring
7
- * after its name, the whole report's page staying name alone. Below it
8
- * the bar holds the menu button alone (`ReportNavMenu`, 214:27280,
9
- * 214:27670); it opens a card under the bar with the pages as rows, each
10
- * with its score as a small ring — an unscored page an empty ring with a
11
- * dash, never a number — the current one muted, ending in whatever foot
12
- * the host gives it.
13
- *
14
- * This draws; the host decides. A page is a link (`href`) or a button
15
- * (`onSelect`) — what a page the reader may not open yet does is the
16
- * host's call. A page marked `lock` draws a lock where its ring would be
17
- * (205:21968, 245:12939) and the stylesheet holds the chips for the
18
- * second desktop anchor; nothing here knows why it is locked. The foot
19
- * is the host's: `ReportNavWho`, `ReportNavControl` and `ReportNavAsk`
20
- * are the parts it is drawn from.
21
- *
22
- * The card hangs from the bar it is mounted in: the host is the
23
- * positioned ancestor, and sets `--rnav-card-inset` to its gutter so the
24
- * card spans the phone inside the margins. Picking anything in the card,
25
- * the close button, a tap outside, Escape or focus leaving put the card
26
- * away; focus goes into the card on open and back to the opener on
27
- * close. Styles in report-nav.css (`rnav-`). */
28
-
29
- import {
30
- useEffect,
31
- useId,
32
- useRef,
33
- type FocusEvent,
34
- type KeyboardEvent,
35
- type MouseEvent,
36
- type ReactNode,
37
- } from "react";
38
- import { IconLock, IconNavMenu } from "../icons";
39
- import { usePopover } from "../lib/use-popover";
40
- import { ScoreRing, type Grade } from "./status";
41
-
42
- export interface ReportNavPage<Id extends string> {
43
- id: Id;
44
- label: string;
45
- /** The page as a link; without one the control is a button calling
46
- * `onSelect`. */
47
- href?: string;
48
- onSelect?: () => void;
49
- /** The page's score on 100; null where it could not be scored. */
50
- score: number | null;
51
- grade: Grade;
52
- /** The whole report's page: its chip carries its name alone where an
53
- * area's carries a ring (64:8505); the card's row rings it like the
54
- * rest. */
55
- overview?: boolean;
56
- /** Set, a lock stands where the ring would, and the control is named
57
- * after the label with this: "Website, Locked". */
58
- lock?: string;
59
- /** Attributes the host adds to the control (tracking, a hand-off). */
60
- attrs?: Record<string, string>;
61
- }
62
-
63
- export interface ReportNavCopy {
64
- /** Accessible name of the list of pages. */
65
- pages: string;
66
- /** The menu button's name while the card is shut, and while open. */
67
- menu: string;
68
- close: string;
69
- /** The ring's name beside a page's label: scored, and not. */
70
- score: string;
71
- unscored: string;
72
- }
73
-
74
- /** The lock's size where a ring stood (205:21968 the chip's 16, 256:15675
75
- * the card row's 20 inside the ring's 32). */
76
- const LOCK_CHIP = 16;
77
- const LOCK_ROW = 20;
78
-
79
- /** Marks a control in the card that puts the card away when picked. */
80
- const DISMISS = "data-rnav-dismiss";
81
- const dismiss = { [DISMISS]: "" };
82
-
83
- function LockMark({ size }: { size: number }) {
84
- return (
85
- <span className="rnav-lock" aria-hidden="true">
86
- <IconLock size={size} />
87
- </span>
88
- );
89
- }
90
-
91
- /** One page as its control: a link or a button, named after its lock
92
- * when it has one, carrying the host's attributes. */
93
- function PageControl<Id extends string>({
94
- page,
95
- current,
96
- className,
97
- children,
98
- }: {
99
- page: ReportNavPage<Id>;
100
- current: Id;
101
- className: string;
102
- children: ReactNode;
103
- }) {
104
- const name = page.lock ? `${page.label}, ${page.lock}` : undefined;
105
- if (page.href) {
106
- return (
107
- <a
108
- className={className}
109
- href={page.href}
110
- aria-label={name}
111
- aria-current={page.id === current ? "page" : undefined}
112
- {...dismiss}
113
- {...page.attrs}
114
- >
115
- {children}
116
- </a>
117
- );
118
- }
119
- return (
120
- <button
121
- type="button"
122
- className={className}
123
- aria-label={name}
124
- onClick={page.onSelect}
125
- {...dismiss}
126
- {...page.attrs}
127
- >
128
- {children}
129
- </button>
130
- );
131
- }
132
-
133
- /** After a page's name: its ring, or its lock. */
134
- function PageMark<Id extends string>({
135
- page,
136
- size,
137
- lock,
138
- copy,
139
- }: {
140
- page: ReportNavPage<Id>;
141
- size: "xs" | "sm";
142
- lock: number;
143
- copy: Pick<ReportNavCopy, "score" | "unscored">;
144
- }) {
145
- if (page.lock) return <LockMark size={lock} />;
146
- return (
147
- <ScoreRing
148
- value={page.score}
149
- grade={page.grade}
150
- size={size}
151
- label={page.score == null ? copy.unscored : copy.score}
152
- >
153
- —
154
- </ScoreRing>
155
- );
156
- }
157
-
158
- /** The pages as chips in the bar, from the first desktop anchor: an
159
- * area's name with its score ring (a dash where it could not be
160
- * scored; the stylesheet shows it from the second anchor) or its lock,
161
- * the overview's name alone. With any page locked the list is marked
162
- * and the stylesheet holds it for the second desktop anchor. */
163
- export function ReportNavChips<Id extends string>({
164
- pages,
165
- current,
166
- copy,
167
- }: {
168
- pages: readonly ReportNavPage<Id>[];
169
- current: Id;
170
- copy: Pick<ReportNavCopy, "pages" | "score" | "unscored">;
171
- }) {
172
- const locked = pages.some((p) => p.lock);
173
- return (
174
- <ul className="rnav-chips" aria-label={copy.pages} data-locked={locked ? "" : undefined}>
175
- {pages.map((page) => (
176
- <li key={page.id} className="rnav-chips-item">
177
- <PageControl
178
- page={page}
179
- current={current}
180
- className="type type-fixed ts-text-md-medium rnav-chip"
181
- >
182
- <span aria-hidden={page.lock ? true : undefined}>{page.label}</span>
183
- {(!page.overview || page.lock) && (
184
- <PageMark page={page} size="xs" lock={LOCK_CHIP} copy={copy} />
185
- )}
186
- </PageControl>
187
- </li>
188
- ))}
189
- </ul>
190
- );
191
- }
192
-
193
- /** The menu button below the first desktop anchor, and the card it
194
- * opens (214:27280, 214:27670): a row per page, each with its ring or
195
- * lock, and the host's `foot` under them when there is one. With any
196
- * page locked the menu is marked and the stylesheet keeps it through
197
- * the first desktop anchor, where the chips would otherwise take over. */
198
- export function ReportNavMenu<Id extends string>({
199
- pages,
200
- current,
201
- copy,
202
- foot,
203
- }: {
204
- pages: readonly ReportNavPage<Id>[];
205
- current: Id;
206
- copy: ReportNavCopy;
207
- foot?: ReactNode;
208
- }) {
209
- const { open, setOpen, rootRef } = usePopover<HTMLDivElement>();
210
- const cardRef = useRef<HTMLDivElement>(null);
211
- /* The control that opened the card takes focus back when it closes. */
212
- const openerRef = useRef<HTMLButtonElement | null>(null);
213
- const cardId = useId();
214
- const locked = pages.some((p) => p.lock);
215
-
216
- useEffect(() => {
217
- if (open) cardRef.current?.focus({ preventScroll: true });
218
- }, [open]);
219
-
220
- const close = () => {
221
- setOpen(false);
222
- openerRef.current?.focus({ preventScroll: true });
223
- };
224
- const toggle = (event: MouseEvent<HTMLButtonElement>) => {
225
- if (open) {
226
- close();
227
- } else {
228
- openerRef.current = event.currentTarget;
229
- setOpen(true);
230
- }
231
- };
232
- const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
233
- if (event.key === "Escape" && open) close();
234
- };
235
- const onBlur = (event: FocusEvent<HTMLDivElement>) => {
236
- const next = event.relatedTarget;
237
- if (open && (!(next instanceof Node) || !event.currentTarget.contains(next))) setOpen(false);
238
- };
239
- /* A page picked, or the foot's ask made, puts the card away: a link
240
- navigates and the card does not wait for it; a hand-off opens
241
- elsewhere. A control that waits (`ReportNavControl`) keeps the card. */
242
- const onCardClick = (event: MouseEvent<HTMLDivElement>) => {
243
- if (event.target instanceof Element && event.target.closest(`[${DISMISS}]`)) setOpen(false);
244
- };
245
-
246
- return (
247
- <div
248
- ref={rootRef}
249
- className="rnav-menu"
250
- data-open={open || undefined}
251
- data-locked={locked ? "" : undefined}
252
- onKeyDown={onKeyDown}
253
- onBlur={onBlur}
254
- >
255
- <button
256
- type="button"
257
- className="rnav-toggle"
258
- aria-expanded={open}
259
- aria-controls={cardId}
260
- aria-label={open ? copy.close : copy.menu}
261
- onClick={toggle}
262
- >
263
- <span className="rnav-glyphs" aria-hidden="true">
264
- <IconNavMenu className="rnav-glyph-menu" />
265
- <IconNavMenu className="rnav-glyph-x" open />
266
- </span>
267
- </button>
268
- <div
269
- id={cardId}
270
- ref={cardRef}
271
- className="rnav-card"
272
- tabIndex={-1}
273
- inert={!open || undefined}
274
- onClick={onCardClick}
275
- >
276
- <ul className="rnav-pages" aria-label={copy.pages}>
277
- {pages.map((p) => (
278
- <li key={p.id} className="rnav-row">
279
- <PageControl
280
- page={p}
281
- current={current}
282
- className="type type-fixed ts-text-md-medium rnav-page"
283
- >
284
- <span className="rnav-page-label" aria-hidden={p.lock ? true : undefined}>
285
- {p.label}
286
- </span>
287
- <PageMark page={p} size="sm" lock={LOCK_ROW} copy={copy} />
288
- </PageControl>
289
- </li>
290
- ))}
291
- </ul>
292
- {foot && <div className="rnav-foot">{foot}</div>}
293
- </div>
294
- </div>
295
- );
296
- }
297
-
298
- /** The foot's two lines: a label over a name ("Signed in as" / who). */
299
- export function ReportNavWho({ label, who }: { label: string; who: string }) {
300
- return (
301
- <span className="rnav-who">
302
- <span className="type type-fixed ts-text-xs-regular rnav-who-label">{label}</span>
303
- <span className="type type-fixed ts-text-sm-regular rnav-who-name">{who}</span>
304
- </span>
305
- );
306
- }
307
-
308
- /** The foot's muted control, beside the lines (214:27848). `busy` holds
309
- * it while the host's action runs. */
310
- export function ReportNavControl({
311
- busy = false,
312
- onClick,
313
- children,
314
- }: {
315
- busy?: boolean;
316
- onClick: () => void;
317
- children: ReactNode;
318
- }) {
319
- return (
320
- <button
321
- type="button"
322
- className="type type-fixed ts-text-sm-medium rnav-signout"
323
- disabled={busy}
324
- onClick={onClick}
325
- >
326
- {children}
327
- </button>
328
- );
329
- }
330
-
331
- /** The foot's dark control across its width (256:15675). */
332
- export function ReportNavAsk({
333
- onClick,
334
- attrs,
335
- children,
336
- }: {
337
- onClick: () => void;
338
- /** The host's hand-off, when the control opens one directly. */
339
- attrs?: Record<string, string>;
340
- children: ReactNode;
341
- }) {
342
- return (
343
- <button
344
- type="button"
345
- className="type type-fixed ts-text-sm-medium rnav-ask"
346
- onClick={onClick}
347
- {...dismiss}
348
- {...attrs}
349
- >
350
- {children}
351
- </button>
352
- );
353
- }