@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.
- package/README.md +47 -67
- package/fonts/gt-america-300-italic.woff2 +0 -0
- package/fonts/gt-america-300.woff2 +0 -0
- package/fonts/gt-america-400-italic.woff2 +0 -0
- package/fonts/gt-america-400.woff2 +0 -0
- package/fonts/gt-america-500.woff2 +0 -0
- package/fonts/gt-america-extended-300.woff2 +0 -0
- package/fonts/gt-america-extended-400.woff2 +0 -0
- package/fonts/gt-america-extended-500.woff2 +0 -0
- package/fonts/gt-america-extended-700.woff2 +0 -0
- package/fonts/gt-america-mono-300.woff2 +0 -0
- package/fonts/gt-america-mono-500.woff2 +0 -0
- package/fonts/pp-kyoto-vf.woff2 +0 -0
- package/package.json +46 -203
- package/src/base.css +300 -0
- package/src/fonts.css +131 -0
- package/src/hue.ts +17 -0
- package/src/icon.tsx +56 -0
- package/src/mark.tsx +14 -0
- package/src/motion.ts +123 -0
- package/src/parts/chip.css +84 -0
- package/src/parts/chip.tsx +40 -0
- package/src/parts/composer.css +195 -0
- package/src/parts/composer.tsx +220 -0
- package/src/parts/cx.ts +2 -0
- package/src/parts/faq.css +77 -0
- package/src/parts/faq.tsx +25 -0
- package/src/parts/footer.css +51 -0
- package/src/parts/footer.tsx +27 -0
- package/src/parts/nav.css +180 -0
- package/src/parts/nav.tsx +101 -0
- package/src/parts/photo.css +15 -0
- package/src/parts/photo.tsx +24 -0
- package/src/parts/plans.css +89 -0
- package/src/parts/plans.tsx +56 -0
- package/src/parts/prose.css +86 -0
- package/src/parts/prose.tsx +49 -0
- package/src/parts/shape.css +47 -0
- package/src/parts/shape.tsx +68 -0
- package/src/parts/split.tsx +49 -0
- package/src/parts/stamp.css +85 -0
- package/src/parts/stamp.tsx +36 -0
- package/src/parts/work-card.css +51 -0
- package/src/parts/work-card.tsx +40 -0
- package/src/set.css +439 -0
- package/src/styles.css +20 -0
- package/src/tokens/color.css +471 -0
- package/src/tokens/roles.css +12 -0
- package/src/tokens/type.css +11 -0
- package/src/wordmark.tsx +34 -0
- package/AGENTS.md +0 -192
- package/assets/media/brand/ks-lockup.svg +0 -13
- package/assets/media/brand/ks-logomark.svg +0 -4
- package/assets/media/brand/ks-wordmark-inline.svg +0 -13
- package/assets/media/brand/ks-wordmark.svg +0 -11
- 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 +0 -113
- package/css-vars.d.ts +0 -10
- package/grid/engine.css +0 -367
- package/grid/field-hash.ts +0 -31
- package/grid/field.tsx +0 -48
- package/grid/gates.cjs +0 -35
- package/grid/region.tsx +0 -97
- package/icons.tsx +0 -1282
- package/index.css +0 -89
- package/lib/autoplay-gate.ts +0 -88
- package/lib/focus-trap.ts +0 -42
- package/lib/grader.ts +0 -123
- package/lib/legal-data.ts +0 -1
- package/lib/legal.ts +0 -41
- package/lib/noise.tsx +0 -114
- package/lib/phone.ts +0 -294
- package/lib/render-boundary.tsx +0 -27
- package/lib/scroll-lock.ts +0 -25
- package/lib/swipe.ts +0 -124
- package/lib/use-active-section.ts +0 -43
- package/lib/use-count-up.ts +0 -26
- package/lib/use-grader-search.ts +0 -143
- package/lib/use-popover.ts +0 -30
- package/lib/use-video-carousel.ts +0 -271
- package/media.ts +0 -558
- package/primitives/breadcrumb.css +0 -51
- package/primitives/breadcrumb.tsx +0 -46
- package/primitives/business-picker.css +0 -135
- package/primitives/business-picker.tsx +0 -298
- package/primitives/button-inline.css +0 -52
- package/primitives/button-inline.tsx +0 -38
- package/primitives/buttons.css +0 -551
- package/primitives/buttons.tsx +0 -330
- package/primitives/case-study-button.css +0 -71
- package/primitives/case-study-button.tsx +0 -28
- package/primitives/case-study-card.css +0 -318
- package/primitives/case-study-card.tsx +0 -116
- package/primitives/chip.css +0 -127
- package/primitives/chip.tsx +0 -53
- package/primitives/closer-row.css +0 -14
- package/primitives/closer-row.tsx +0 -22
- package/primitives/cta-row.css +0 -41
- package/primitives/cta-row.tsx +0 -39
- package/primitives/disclosure.css +0 -302
- package/primitives/disclosure.tsx +0 -277
- package/primitives/faq-question.css +0 -220
- package/primitives/faq-question.tsx +0 -55
- package/primitives/field.css +0 -279
- package/primitives/field.tsx +0 -376
- package/primitives/footer-item.css +0 -72
- package/primitives/footer-item.tsx +0 -42
- package/primitives/glyph-toggle.css +0 -62
- package/primitives/glyph-toggle.tsx +0 -42
- package/primitives/grader-menu.tsx +0 -84
- package/primitives/grader.css +0 -369
- package/primitives/grader.tsx +0 -285
- package/primitives/keystone-score.css +0 -156
- package/primitives/keystone-score.tsx +0 -204
- package/primitives/modal.css +0 -194
- package/primitives/modal.tsx +0 -204
- package/primitives/month-range.css +0 -80
- package/primitives/month-range.tsx +0 -183
- package/primitives/notice.css +0 -39
- package/primitives/notice.tsx +0 -56
- package/primitives/persona-card.css +0 -374
- package/primitives/persona-card.tsx +0 -74
- package/primitives/picture.css +0 -11
- package/primitives/picture.tsx +0 -41
- package/primitives/plan-card.css +0 -398
- package/primitives/plan-card.tsx +0 -153
- package/primitives/prose.css +0 -164
- package/primitives/prose.tsx +0 -194
- package/primitives/ramps.css +0 -77
- package/primitives/report-nav.css +0 -382
- package/primitives/report-nav.tsx +0 -353
- package/primitives/report.css +0 -601
- package/primitives/report.tsx +0 -357
- package/primitives/skeleton.css +0 -82
- package/primitives/skeleton.tsx +0 -56
- package/primitives/slider.css +0 -179
- package/primitives/slider.tsx +0 -69
- package/primitives/slug.css +0 -87
- package/primitives/slug.tsx +0 -37
- package/primitives/status.css +0 -427
- package/primitives/status.tsx +0 -323
- package/primitives/strip.css +0 -40
- package/primitives/surface.css +0 -88
- package/primitives/surface.tsx +0 -100
- package/primitives/table.css +0 -227
- package/primitives/table.tsx +0 -122
- package/primitives/tabs.css +0 -85
- package/primitives/tabs.tsx +0 -122
- package/primitives/tag.css +0 -46
- package/primitives/tag.tsx +0 -33
- package/primitives/text.css +0 -127
- package/primitives/toc.css +0 -65
- package/primitives/toc.tsx +0 -42
- package/primitives/tooltip.css +0 -56
- package/primitives/tooltip.tsx +0 -103
- package/rules/design-system.md +0 -154
- package/rules/grid-and-layout.md +0 -166
- package/scripts/generate-exports.mjs +0 -61
- package/scripts/generate-type-css.mjs +0 -130
- package/sections/faq-island.tsx +0 -102
- package/sections/faq.css +0 -213
- package/sections/faq.tsx +0 -46
- package/sections/footer-nav.tsx +0 -95
- package/sections/footer-signature.css +0 -223
- package/sections/footer-signature.tsx +0 -127
- package/sections/footer.css +0 -735
- package/sections/footer.tsx +0 -286
- package/sections/gallery-overlay.css +0 -213
- package/sections/gallery-overlay.tsx +0 -267
- package/sections/landing-benefits.css +0 -59
- package/sections/landing-benefits.tsx +0 -81
- package/sections/landing-closer.css +0 -23
- package/sections/landing-closer.tsx +0 -26
- package/sections/landing-hero.css +0 -80
- package/sections/landing-hero.tsx +0 -69
- package/sections/landing-quote.css +0 -19
- package/sections/landing-quote.tsx +0 -30
- package/sections/landing-sample.ts +0 -66
- package/sections/landing.css +0 -45
- package/sections/landing.tsx +0 -69
- package/sections/load-orchestrator.tsx +0 -43
- package/sections/load.css +0 -138
- package/sections/nav-desktop.css +0 -530
- package/sections/nav-desktop.tsx +0 -155
- package/sections/nav-menu.css +0 -57
- package/sections/nav-menu.tsx +0 -112
- package/sections/nav-mobile.css +0 -571
- package/sections/nav-mobile.tsx +0 -222
- package/sections/nav.css +0 -127
- package/sections/nav.tsx +0 -394
- package/sections/site-chat-data.ts +0 -16
- package/sections/site-chat-open.tsx +0 -25
- package/sections/site-chat.tsx +0 -67
- package/site-links.ts +0 -41
- package/site.ts +0 -2
- package/themes/inverted.css +0 -139
- package/tokens/fonts.css +0 -38
- package/tokens/motion.css +0 -150
- package/tokens/primitives.css +0 -163
- package/tokens/semantic.css +0 -159
- package/tokens/type-styles.json +0 -145
- package/tokens/type.css +0 -1548
- package/widgets.css +0 -78
package/primitives/status.tsx
DELETED
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
/** Status primitives: spinner, pulse, step marks, hue pills, chips,
|
|
2
|
-
* meters, rings, gauges, stars. Styles live in status.css; every colour
|
|
3
|
-
* is a token and every hue arrives through `data-hue`. */
|
|
4
|
-
|
|
5
|
-
"use client";
|
|
6
|
-
|
|
7
|
-
import { useEffect, useState, type CSSProperties, type ReactNode } from "react";
|
|
8
|
-
|
|
9
|
-
export type Hue =
|
|
10
|
-
"teal" | "blue" | "yellow" | "orange" | "red" | "brown" | "green" | "pink" | "purple" | "gray";
|
|
11
|
-
export type StepStatus = "done" | "active" | "pending";
|
|
12
|
-
/** A measured grade, or neutral for a value that was not found. */
|
|
13
|
-
export type Grade = "good" | "fair" | "poor" | "neutral";
|
|
14
|
-
|
|
15
|
-
export function Spinner({ size }: { size?: "sm" | "lg" }) {
|
|
16
|
-
return <span className="spinner" data-size={size} aria-hidden="true" />;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function PulseDot() {
|
|
20
|
-
return <span className="pulse-dot" aria-hidden="true" />;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function Check() {
|
|
24
|
-
return (
|
|
25
|
-
<svg viewBox="0 0 12 12" fill="none" aria-hidden="true">
|
|
26
|
-
<path
|
|
27
|
-
d="M2.5 6.5l2.3 2.3L9.6 3.8"
|
|
28
|
-
stroke="currentColor"
|
|
29
|
-
strokeWidth="1.8"
|
|
30
|
-
strokeLinecap="round"
|
|
31
|
-
strokeLinejoin="round"
|
|
32
|
-
/>
|
|
33
|
-
</svg>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function StepMark({ status, size }: { status: StepStatus; size?: "sm" }) {
|
|
38
|
-
return (
|
|
39
|
-
<span className="step-mark" data-status={status} data-size={size} aria-hidden="true">
|
|
40
|
-
{status === "done" && <Check />}
|
|
41
|
-
{status === "active" && <Spinner size="sm" />}
|
|
42
|
-
</span>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** A pill is coloured one way: by a hue, or — the grade pill (ks-Grader
|
|
47
|
-
* grader/status-pill) — by a grade, the grade's tint and ink with a dot
|
|
48
|
-
* in its accent, set in medium. */
|
|
49
|
-
type PillColour = { hue: Hue; grade?: never } | { grade: Grade; hue?: never };
|
|
50
|
-
|
|
51
|
-
export function Pill({
|
|
52
|
-
hue,
|
|
53
|
-
grade,
|
|
54
|
-
fill,
|
|
55
|
-
size,
|
|
56
|
-
className,
|
|
57
|
-
style,
|
|
58
|
-
children,
|
|
59
|
-
}: PillColour & {
|
|
60
|
-
/** Solid hue tint instead of the dotted ground pill. */
|
|
61
|
-
fill?: boolean;
|
|
62
|
-
size?: "sm";
|
|
63
|
-
className?: string;
|
|
64
|
-
style?: CSSProperties;
|
|
65
|
-
children: ReactNode;
|
|
66
|
-
}) {
|
|
67
|
-
const step = grade
|
|
68
|
-
? size === "sm"
|
|
69
|
-
? "ts-text-xs-medium"
|
|
70
|
-
: "ts-text-sm-medium"
|
|
71
|
-
: size === "sm"
|
|
72
|
-
? "ts-text-xs-regular"
|
|
73
|
-
: "ts-text-sm-light";
|
|
74
|
-
return (
|
|
75
|
-
<span
|
|
76
|
-
className={
|
|
77
|
-
className ? `type type-fixed ${step} pill ${className}` : `type type-fixed ${step} pill`
|
|
78
|
-
}
|
|
79
|
-
data-hue={hue}
|
|
80
|
-
data-grade={grade}
|
|
81
|
-
data-fill={fill || undefined}
|
|
82
|
-
data-size={size}
|
|
83
|
-
style={style}
|
|
84
|
-
>
|
|
85
|
-
{!fill && <i className="pill-dot" aria-hidden="true" />}
|
|
86
|
-
{children}
|
|
87
|
-
</span>
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export function HueChip({
|
|
92
|
-
hue,
|
|
93
|
-
size,
|
|
94
|
-
children,
|
|
95
|
-
}: {
|
|
96
|
-
hue: Hue;
|
|
97
|
-
size?: "sm" | "lg";
|
|
98
|
-
children: ReactNode;
|
|
99
|
-
}) {
|
|
100
|
-
return (
|
|
101
|
-
<span className="hue-chip" data-hue={hue} data-size={size} aria-hidden="true">
|
|
102
|
-
{children}
|
|
103
|
-
</span>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export function Meter({
|
|
108
|
-
value,
|
|
109
|
-
hue,
|
|
110
|
-
size,
|
|
111
|
-
slow,
|
|
112
|
-
you,
|
|
113
|
-
live,
|
|
114
|
-
}: {
|
|
115
|
-
value: number;
|
|
116
|
-
hue?: Hue;
|
|
117
|
-
size?: "sm";
|
|
118
|
-
/** Long ease for a one-time reveal instead of live progress. */
|
|
119
|
-
slow?: boolean;
|
|
120
|
-
/** Marks the subject's own bar in a ranked list. */
|
|
121
|
-
you?: boolean;
|
|
122
|
-
/** Live progress of running work: the fill reads in the deep teal. */
|
|
123
|
-
live?: boolean;
|
|
124
|
-
}) {
|
|
125
|
-
const clamped = Math.min(1, Math.max(0, value));
|
|
126
|
-
const [shown, setShown] = useState(slow ? 0 : clamped);
|
|
127
|
-
useEffect(() => {
|
|
128
|
-
if (!slow) return;
|
|
129
|
-
const t = setTimeout(() => setShown(clamped), 150);
|
|
130
|
-
return () => clearTimeout(t);
|
|
131
|
-
}, [clamped, slow]);
|
|
132
|
-
return (
|
|
133
|
-
<span
|
|
134
|
-
className="meter"
|
|
135
|
-
data-hue={hue}
|
|
136
|
-
data-size={size}
|
|
137
|
-
data-slow={slow || undefined}
|
|
138
|
-
data-you={you || undefined}
|
|
139
|
-
data-live={live || undefined}
|
|
140
|
-
style={{ "--value": slow ? shown : clamped }}
|
|
141
|
-
role="progressbar"
|
|
142
|
-
aria-valuemin={0}
|
|
143
|
-
aria-valuemax={100}
|
|
144
|
-
aria-valuenow={Math.round(clamped * 100)}
|
|
145
|
-
/>
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export function Ring({
|
|
150
|
-
value,
|
|
151
|
-
size = 32,
|
|
152
|
-
stroke = 3,
|
|
153
|
-
hue,
|
|
154
|
-
slow,
|
|
155
|
-
}: {
|
|
156
|
-
value: number;
|
|
157
|
-
size?: number;
|
|
158
|
-
stroke?: number;
|
|
159
|
-
hue?: Hue;
|
|
160
|
-
/** Long ease for a one-time reveal instead of live progress. */
|
|
161
|
-
slow?: boolean;
|
|
162
|
-
}) {
|
|
163
|
-
const r = (size - stroke) / 2;
|
|
164
|
-
const c = 2 * Math.PI * r;
|
|
165
|
-
const clamped = Math.min(1, Math.max(0, value));
|
|
166
|
-
return (
|
|
167
|
-
<svg
|
|
168
|
-
className="arc"
|
|
169
|
-
data-hue={hue}
|
|
170
|
-
data-slow={slow || undefined}
|
|
171
|
-
width={size}
|
|
172
|
-
height={size}
|
|
173
|
-
viewBox={`0 0 ${size} ${size}`}
|
|
174
|
-
aria-hidden="true"
|
|
175
|
-
>
|
|
176
|
-
<circle
|
|
177
|
-
className="arc-track"
|
|
178
|
-
cx={size / 2}
|
|
179
|
-
cy={size / 2}
|
|
180
|
-
r={r}
|
|
181
|
-
fill="none"
|
|
182
|
-
strokeWidth={stroke}
|
|
183
|
-
/>
|
|
184
|
-
<circle
|
|
185
|
-
className="arc-fill"
|
|
186
|
-
cx={size / 2}
|
|
187
|
-
cy={size / 2}
|
|
188
|
-
r={r}
|
|
189
|
-
fill="none"
|
|
190
|
-
strokeWidth={stroke}
|
|
191
|
-
strokeDasharray={c}
|
|
192
|
-
strokeDashoffset={c * (1 - clamped)}
|
|
193
|
-
/>
|
|
194
|
-
</svg>
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/** The score ring's drawing box (ks-Grader grader/score-ring). The
|
|
199
|
-
* stroke and the radius are the stylesheet's, which knows the size; the
|
|
200
|
-
* radius here is the fallback for an engine that does not size a circle
|
|
201
|
-
* from CSS, keeping a 3-unit stroke's centreline inside the box. The
|
|
202
|
-
* fill's dash is measured along a path normalised to 100, as the gauge's
|
|
203
|
-
* is (keystone-score.tsx), so the offset is the score's complement
|
|
204
|
-
* whatever the circumference. */
|
|
205
|
-
const SCORE_RING_BOX = 100;
|
|
206
|
-
const SCORE_RING_INSET = 3;
|
|
207
|
-
const SCORE_RING_PATH = 100;
|
|
208
|
-
|
|
209
|
-
const SCORE_RING_TYPE = {
|
|
210
|
-
xs: "ts-display-serif-4xs-medium",
|
|
211
|
-
sm: "ts-display-serif-3xs-regular",
|
|
212
|
-
md: "ts-display-serif-xs-light",
|
|
213
|
-
lg: "ts-display-serif-xs-plus-extralight",
|
|
214
|
-
} as const;
|
|
215
|
-
|
|
216
|
-
/** Score ring: an area's 0–100 score as a thin ring in its grade's
|
|
217
|
-
* accent, the number centred. `md` is the overview card's 60 (56 on a
|
|
218
|
-
* phone); `lg` the report hero's 76 (64); `sm` the report nav card's 32
|
|
219
|
-
* and `xs` its chips' 28, each at every size. A score that was not
|
|
220
|
-
* measured passes `value={null}`: the ring stays a track and the centre
|
|
221
|
-
* shows the children (a dash, a skeleton) instead of a number. */
|
|
222
|
-
export function ScoreRing({
|
|
223
|
-
value,
|
|
224
|
-
grade,
|
|
225
|
-
size = "md",
|
|
226
|
-
label,
|
|
227
|
-
children,
|
|
228
|
-
}: {
|
|
229
|
-
value: number | null;
|
|
230
|
-
grade: Grade;
|
|
231
|
-
size?: keyof typeof SCORE_RING_TYPE;
|
|
232
|
-
/** Accessible name; the number alone says nothing about what it scores. */
|
|
233
|
-
label: string;
|
|
234
|
-
children?: ReactNode;
|
|
235
|
-
}) {
|
|
236
|
-
const r = (SCORE_RING_BOX - SCORE_RING_INSET) / 2;
|
|
237
|
-
const clamped = value == null ? 0 : Math.min(1, Math.max(0, value / 100));
|
|
238
|
-
const step = SCORE_RING_TYPE[size];
|
|
239
|
-
return (
|
|
240
|
-
<span
|
|
241
|
-
className="score-ring"
|
|
242
|
-
data-grade={grade}
|
|
243
|
-
data-size={size}
|
|
244
|
-
role="img"
|
|
245
|
-
aria-label={value == null ? label : `${label}: ${Math.round(value)} of 100`}
|
|
246
|
-
>
|
|
247
|
-
<svg
|
|
248
|
-
className="arc"
|
|
249
|
-
viewBox={`0 0 ${SCORE_RING_BOX} ${SCORE_RING_BOX}`}
|
|
250
|
-
aria-hidden="true"
|
|
251
|
-
focusable="false"
|
|
252
|
-
>
|
|
253
|
-
<circle
|
|
254
|
-
className="arc-track"
|
|
255
|
-
cx={SCORE_RING_BOX / 2}
|
|
256
|
-
cy={SCORE_RING_BOX / 2}
|
|
257
|
-
r={r}
|
|
258
|
-
fill="none"
|
|
259
|
-
/>
|
|
260
|
-
{value != null && (
|
|
261
|
-
<circle
|
|
262
|
-
className="arc-fill"
|
|
263
|
-
cx={SCORE_RING_BOX / 2}
|
|
264
|
-
cy={SCORE_RING_BOX / 2}
|
|
265
|
-
r={r}
|
|
266
|
-
fill="none"
|
|
267
|
-
pathLength={SCORE_RING_PATH}
|
|
268
|
-
strokeDasharray={SCORE_RING_PATH}
|
|
269
|
-
strokeDashoffset={SCORE_RING_PATH * (1 - clamped)}
|
|
270
|
-
/>
|
|
271
|
-
)}
|
|
272
|
-
</svg>
|
|
273
|
-
<span className={`type type-fixed ${step} score-ring-value`} aria-hidden="true">
|
|
274
|
-
{value == null ? children : Math.round(value)}
|
|
275
|
-
</span>
|
|
276
|
-
</span>
|
|
277
|
-
);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/** Gauge: a ring that fills in after mount, with content in the centre. */
|
|
281
|
-
export function Gauge({
|
|
282
|
-
value,
|
|
283
|
-
size = 168,
|
|
284
|
-
stroke = 12,
|
|
285
|
-
hue,
|
|
286
|
-
delay = 150,
|
|
287
|
-
children,
|
|
288
|
-
}: {
|
|
289
|
-
value: number;
|
|
290
|
-
size?: number;
|
|
291
|
-
stroke?: number;
|
|
292
|
-
hue?: Hue;
|
|
293
|
-
delay?: number;
|
|
294
|
-
children?: ReactNode;
|
|
295
|
-
}) {
|
|
296
|
-
const [progress, setProgress] = useState(0);
|
|
297
|
-
useEffect(() => {
|
|
298
|
-
const t = setTimeout(() => setProgress(value), delay);
|
|
299
|
-
return () => clearTimeout(t);
|
|
300
|
-
}, [value, delay]);
|
|
301
|
-
return (
|
|
302
|
-
<span className="gauge" style={{ width: size, height: size }}>
|
|
303
|
-
<Ring value={progress} size={size} stroke={stroke} hue={hue} slow />
|
|
304
|
-
<span className="gauge-center">{children}</span>
|
|
305
|
-
</span>
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
const STAR_PATH = "m12 2 2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 18.6 6.1 20.8l1.2-6.6L2.5 9l6.6-.9L12 2Z";
|
|
310
|
-
|
|
311
|
-
/** Stars: a 0–5 rating, rounded to whole stars. */
|
|
312
|
-
export function Stars({ rating, size = 13 }: { rating: number; size?: number }) {
|
|
313
|
-
const filled = Math.round(rating);
|
|
314
|
-
return (
|
|
315
|
-
<span className="stars" aria-label={`${rating} out of 5 stars`}>
|
|
316
|
-
{Array.from({ length: 5 }, (_, i) => (
|
|
317
|
-
<svg key={i} width={size} height={size} viewBox="0 0 24 24" aria-hidden="true">
|
|
318
|
-
<path d={STAR_PATH} className={i < filled ? "star-on" : "star-off"} />
|
|
319
|
-
</svg>
|
|
320
|
-
))}
|
|
321
|
-
</span>
|
|
322
|
-
);
|
|
323
|
-
}
|
package/primitives/strip.css
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/* Strips: line-inclusive cells that stack down the twelve-tick column.
|
|
2
|
-
Each is 12t + 1px wide with a hairline border and pulls up 1px so
|
|
3
|
-
neighbours share lattice pixels. Product pages compose these for
|
|
4
|
-
heads, toolbars, panels and the closing row before the footer. */
|
|
5
|
-
|
|
6
|
-
.strip {
|
|
7
|
-
position: relative;
|
|
8
|
-
box-sizing: border-box;
|
|
9
|
-
width: calc(var(--t) * 12 + 1px);
|
|
10
|
-
margin-top: -1px;
|
|
11
|
-
border: 1px solid var(--line);
|
|
12
|
-
background: var(--color-bg-100);
|
|
13
|
-
}
|
|
14
|
-
.strip[data-first] {
|
|
15
|
-
margin-top: 0;
|
|
16
|
-
}
|
|
17
|
-
.strip[data-pad="cell"] {
|
|
18
|
-
padding: var(--space-3xl) var(--t);
|
|
19
|
-
}
|
|
20
|
-
.strip[data-pad="bar"] {
|
|
21
|
-
padding: var(--space-lg) var(--t);
|
|
22
|
-
}
|
|
23
|
-
.strip[data-pad="inset"] {
|
|
24
|
-
padding: var(--space-2xl) var(--t);
|
|
25
|
-
}
|
|
26
|
-
@container (--rd1) {
|
|
27
|
-
.strip[data-pad="cell"] {
|
|
28
|
-
padding-block: var(--space-4xl);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/* Closing row: the hairline that ends a section before the footer. */
|
|
33
|
-
.strip-close {
|
|
34
|
-
box-sizing: border-box;
|
|
35
|
-
width: calc(var(--t) * 12 + 1px);
|
|
36
|
-
height: var(--t);
|
|
37
|
-
margin-top: -1px;
|
|
38
|
-
border: 1px solid var(--line);
|
|
39
|
-
border-top: 0;
|
|
40
|
-
}
|
package/primitives/surface.css
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/* Surface: a raised sheet on the ground. One hairline step above the
|
|
2
|
-
page (bg/200 on border/050), 2xl corners, optional hard shadow. Rows
|
|
3
|
-
inside divide with the same hairline; a stack steps its children by
|
|
4
|
-
the spacing scale. Text inside is the prose kit (prose.css). */
|
|
5
|
-
|
|
6
|
-
/* Designed constants for this file. */
|
|
7
|
-
:root {
|
|
8
|
-
--shadow-hard-round: 3px 4px 0 0 var(--shadow-ink);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.surface {
|
|
12
|
-
box-sizing: border-box;
|
|
13
|
-
border: 1px solid var(--color-border-050);
|
|
14
|
-
border-radius: var(--radius-2xl);
|
|
15
|
-
background: var(--color-bg-200);
|
|
16
|
-
color: var(--color-text-200);
|
|
17
|
-
}
|
|
18
|
-
.surface[data-pad="sm"] {
|
|
19
|
-
padding: var(--space-lg);
|
|
20
|
-
}
|
|
21
|
-
.surface[data-pad="md"] {
|
|
22
|
-
padding: var(--space-2xl);
|
|
23
|
-
}
|
|
24
|
-
.surface[data-pad="lg"] {
|
|
25
|
-
padding: var(--space-3xl);
|
|
26
|
-
}
|
|
27
|
-
.surface[data-pad="none"] {
|
|
28
|
-
overflow: hidden;
|
|
29
|
-
}
|
|
30
|
-
.surface[data-elev="lift"] {
|
|
31
|
-
box-shadow: var(--shadow-hard-round);
|
|
32
|
-
}
|
|
33
|
-
.surface[data-tone="well"] {
|
|
34
|
-
background: var(--color-bg-000);
|
|
35
|
-
}
|
|
36
|
-
/* The report panel (ks-Grader 153:2): 16 at the corners, 12 on a phone. */
|
|
37
|
-
.surface[data-tone="paper"] {
|
|
38
|
-
border-color: var(--color-border-000);
|
|
39
|
-
background: var(--color-bg-050);
|
|
40
|
-
}
|
|
41
|
-
@container (--below-rt) {
|
|
42
|
-
.surface[data-tone="paper"] {
|
|
43
|
-
border-radius: var(--radius-xl);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/* Rows: stacked children divided by the hairline. */
|
|
48
|
-
.rows > * + * {
|
|
49
|
-
border-top: 1px solid var(--color-border-050);
|
|
50
|
-
}
|
|
51
|
-
.row {
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
gap: var(--space-lg);
|
|
55
|
-
padding-block: var(--space-lg);
|
|
56
|
-
}
|
|
57
|
-
.row-main {
|
|
58
|
-
flex: 1 1 auto;
|
|
59
|
-
min-width: 0;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/* Stack: vertical rhythm between siblings. */
|
|
63
|
-
.stack > * + * {
|
|
64
|
-
margin-top: var(--space-lg);
|
|
65
|
-
}
|
|
66
|
-
.stack[data-gap="sm"] > * + * {
|
|
67
|
-
margin-top: var(--space-md);
|
|
68
|
-
}
|
|
69
|
-
.stack[data-gap="lg"] > * + * {
|
|
70
|
-
margin-top: var(--space-2xl);
|
|
71
|
-
}
|
|
72
|
-
.stack[data-gap="xl"] > * + * {
|
|
73
|
-
margin-top: var(--space-4xl);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/* Divider: a hairline with breathing room. */
|
|
77
|
-
.divider {
|
|
78
|
-
margin-block: var(--space-lg);
|
|
79
|
-
border: 0;
|
|
80
|
-
border-top: 1px solid var(--color-border-050);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/* Chips: a wrapping row of pills. */
|
|
84
|
-
.chips {
|
|
85
|
-
display: flex;
|
|
86
|
-
flex-wrap: wrap;
|
|
87
|
-
gap: var(--space-sm);
|
|
88
|
-
}
|
package/primitives/surface.tsx
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/** Surface: a raised sheet on the ground, and the layout kit that fills
|
|
2
|
-
* it — hairline-divided rows, a rhythm stack, a divider, a chip row.
|
|
3
|
-
* Styles live in surface.css. */
|
|
4
|
-
|
|
5
|
-
import type { CSSProperties, ElementType, ReactNode } from "react";
|
|
6
|
-
|
|
7
|
-
type DataAttrs = Record<`data-${string}`, string | undefined> & { "aria-busy"?: boolean };
|
|
8
|
-
|
|
9
|
-
export function Surface({
|
|
10
|
-
as: Tag = "div",
|
|
11
|
-
pad = "md",
|
|
12
|
-
elev,
|
|
13
|
-
tone,
|
|
14
|
-
id,
|
|
15
|
-
className,
|
|
16
|
-
style,
|
|
17
|
-
children,
|
|
18
|
-
...rest
|
|
19
|
-
}: {
|
|
20
|
-
id?: string;
|
|
21
|
-
as?: ElementType;
|
|
22
|
-
pad?: "none" | "sm" | "md" | "lg";
|
|
23
|
-
elev?: "lift";
|
|
24
|
-
/** `well` sinks to the page's white; `paper` is the Grader report's
|
|
25
|
-
* panel (ks-Grader 153:2): bg/050 on the border hairline, a step
|
|
26
|
-
* tighter at the corners on a phone. */
|
|
27
|
-
tone?: "well" | "paper";
|
|
28
|
-
className?: string;
|
|
29
|
-
style?: CSSProperties;
|
|
30
|
-
children: ReactNode;
|
|
31
|
-
/** Set while a skeleton is mounted inside (skeleton.tsx). */
|
|
32
|
-
"aria-busy"?: boolean;
|
|
33
|
-
/** Data attributes (a stagger delay, a test id) pass through. */
|
|
34
|
-
[data: `data-${string}`]: string | undefined;
|
|
35
|
-
}) {
|
|
36
|
-
return (
|
|
37
|
-
<Tag
|
|
38
|
-
id={id}
|
|
39
|
-
className={className ? `surface ${className}` : "surface"}
|
|
40
|
-
data-pad={pad}
|
|
41
|
-
data-elev={elev}
|
|
42
|
-
data-tone={tone}
|
|
43
|
-
style={style}
|
|
44
|
-
{...(rest as DataAttrs)}
|
|
45
|
-
>
|
|
46
|
-
{children}
|
|
47
|
-
</Tag>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/** Stacked children divided by the surface hairline. */
|
|
52
|
-
export function Rows({
|
|
53
|
-
as: Tag = "div",
|
|
54
|
-
className,
|
|
55
|
-
children,
|
|
56
|
-
}: {
|
|
57
|
-
as?: ElementType;
|
|
58
|
-
className?: string;
|
|
59
|
-
children: ReactNode;
|
|
60
|
-
}) {
|
|
61
|
-
return <Tag className={className ? `rows ${className}` : "rows"}>{children}</Tag>;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/** One row: a flex line with the surface's gap; `Row.main` grows. */
|
|
65
|
-
export function Row({ className, children }: { className?: string; children: ReactNode }) {
|
|
66
|
-
return <div className={className ? `row ${className}` : "row"}>{children}</div>;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function RowMain({ className, children }: { className?: string; children: ReactNode }) {
|
|
70
|
-
return <div className={className ? `row-main ${className}` : "row-main"}>{children}</div>;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/** Vertical rhythm between siblings, stepped by the spacing scale. */
|
|
74
|
-
export function Stack({
|
|
75
|
-
as: Tag = "div",
|
|
76
|
-
gap,
|
|
77
|
-
className,
|
|
78
|
-
children,
|
|
79
|
-
}: {
|
|
80
|
-
as?: ElementType;
|
|
81
|
-
gap?: "sm" | "lg" | "xl";
|
|
82
|
-
className?: string;
|
|
83
|
-
children: ReactNode;
|
|
84
|
-
}) {
|
|
85
|
-
return (
|
|
86
|
-
<Tag className={className ? `stack ${className}` : "stack"} data-gap={gap}>
|
|
87
|
-
{children}
|
|
88
|
-
</Tag>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/** A hairline with breathing room. */
|
|
93
|
-
export function Divider() {
|
|
94
|
-
return <hr className="divider" />;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/** A wrapping row of pills. */
|
|
98
|
-
export function Chips({ className, children }: { className?: string; children: ReactNode }) {
|
|
99
|
-
return <div className={className ? `chips ${className}` : "chips"}>{children}</div>;
|
|
100
|
-
}
|