@keystone-sites/marketing-design-system 2.0.0 → 2.0.2
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/fonts/gt-america-italic-vf.woff2 +0 -0
- package/fonts/gt-america-mono-vf.woff2 +0 -0
- package/fonts/gt-america-vf.woff2 +0 -0
- package/package.json +1 -1
- package/src/fonts.css +26 -68
- package/src/parts/composer.css +79 -3
- package/src/parts/composer.tsx +133 -17
- package/src/parts/nav.css +62 -27
- package/src/parts/nav.tsx +22 -15
- package/src/parts/plans.css +11 -10
- 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
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keystone-sites/marketing-design-system",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "The Set: Keystone's marketing design system. Tokens, fonts, base styles and the parts the marketing sites are built from, as plain CSS and React.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
package/src/fonts.css
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* GT America and PP Kyoto, shipped with the package in fonts/; a site's bundler emits whichever
|
|
2
|
-
files the page uses, so no site keeps copies of its own. GT America is
|
|
3
|
-
|
|
2
|
+
files the page uses, so no site keeps copies of its own. All are variable. GT America is three
|
|
3
|
+
files: upright and italic, each wght 25 to 900 and wdth 50 (Compressed) to 150 (Expanded), with
|
|
4
|
+
Standard at 100 and Extended at 125, and Mono, wght 25 to 900. Kyoto is one file, wght 100 to
|
|
5
|
+
900.
|
|
4
6
|
|
|
5
7
|
Each family has a fallback matched to its metrics against Arial, Georgia or Courier New, so text
|
|
6
8
|
set before the face arrives takes the same lines and the swap does not move the page. */
|
|
@@ -8,38 +10,19 @@
|
|
|
8
10
|
/* Standard: interface and body */
|
|
9
11
|
@font-face {
|
|
10
12
|
font-family: "GT America";
|
|
11
|
-
font-weight:
|
|
13
|
+
font-weight: 25 900;
|
|
14
|
+
font-stretch: 50% 150%;
|
|
12
15
|
font-style: normal;
|
|
13
16
|
font-display: swap;
|
|
14
|
-
src: url("../fonts/gt-america-
|
|
17
|
+
src: url("../fonts/gt-america-vf.woff2") format("woff2");
|
|
15
18
|
}
|
|
16
19
|
@font-face {
|
|
17
20
|
font-family: "GT America";
|
|
18
|
-
font-weight:
|
|
21
|
+
font-weight: 25 900;
|
|
22
|
+
font-stretch: 50% 150%;
|
|
19
23
|
font-style: italic;
|
|
20
24
|
font-display: swap;
|
|
21
|
-
src: url("../fonts/gt-america-
|
|
22
|
-
}
|
|
23
|
-
@font-face {
|
|
24
|
-
font-family: "GT America";
|
|
25
|
-
font-weight: 400;
|
|
26
|
-
font-style: normal;
|
|
27
|
-
font-display: swap;
|
|
28
|
-
src: url("../fonts/gt-america-400.woff2") format("woff2");
|
|
29
|
-
}
|
|
30
|
-
@font-face {
|
|
31
|
-
font-family: "GT America";
|
|
32
|
-
font-weight: 400;
|
|
33
|
-
font-style: italic;
|
|
34
|
-
font-display: swap;
|
|
35
|
-
src: url("../fonts/gt-america-400-italic.woff2") format("woff2");
|
|
36
|
-
}
|
|
37
|
-
@font-face {
|
|
38
|
-
font-family: "GT America";
|
|
39
|
-
font-weight: 500;
|
|
40
|
-
font-style: normal;
|
|
41
|
-
font-display: swap;
|
|
42
|
-
src: url("../fonts/gt-america-500.woff2") format("woff2");
|
|
25
|
+
src: url("../fonts/gt-america-italic-vf.woff2") format("woff2");
|
|
43
26
|
}
|
|
44
27
|
|
|
45
28
|
/* Kyoto: display. The brand's thin serif voice for headlines. */
|
|
@@ -51,58 +34,33 @@
|
|
|
51
34
|
src: url("../fonts/pp-kyoto-vf.woff2") format("woff2");
|
|
52
35
|
}
|
|
53
36
|
|
|
54
|
-
/* Extended: the sans alternate for display, where a serif reads wrong
|
|
37
|
+
/* Extended: the sans alternate for display, where a serif reads wrong. The upright file, held at
|
|
38
|
+
its widest: a face declared at one width sets the font's wdth axis to it, whatever the text
|
|
39
|
+
asks for, and a page with both families fetches the file once. */
|
|
55
40
|
@font-face {
|
|
56
41
|
font-family: "GT America Extended";
|
|
57
|
-
font-weight:
|
|
42
|
+
font-weight: 25 900;
|
|
43
|
+
font-stretch: 125%;
|
|
58
44
|
font-style: normal;
|
|
59
45
|
font-display: swap;
|
|
60
|
-
src: url("../fonts/gt-america-
|
|
61
|
-
}
|
|
62
|
-
@font-face {
|
|
63
|
-
font-family: "GT America Extended";
|
|
64
|
-
font-weight: 400;
|
|
65
|
-
font-style: normal;
|
|
66
|
-
font-display: swap;
|
|
67
|
-
src: url("../fonts/gt-america-extended-400.woff2") format("woff2");
|
|
68
|
-
}
|
|
69
|
-
@font-face {
|
|
70
|
-
font-family: "GT America Extended";
|
|
71
|
-
font-weight: 500;
|
|
72
|
-
font-style: normal;
|
|
73
|
-
font-display: swap;
|
|
74
|
-
src: url("../fonts/gt-america-extended-500.woff2") format("woff2");
|
|
75
|
-
}
|
|
76
|
-
@font-face {
|
|
77
|
-
font-family: "GT America Extended";
|
|
78
|
-
font-weight: 700;
|
|
79
|
-
font-style: normal;
|
|
80
|
-
font-display: swap;
|
|
81
|
-
src: url("../fonts/gt-america-extended-700.woff2") format("woff2");
|
|
46
|
+
src: url("../fonts/gt-america-vf.woff2") format("woff2");
|
|
82
47
|
}
|
|
83
48
|
|
|
84
49
|
/* Mono: figures and labels */
|
|
85
50
|
@font-face {
|
|
86
51
|
font-family: "GT America Mono";
|
|
87
|
-
font-weight:
|
|
88
|
-
font-style: normal;
|
|
89
|
-
font-display: swap;
|
|
90
|
-
src: url("../fonts/gt-america-mono-300.woff2") format("woff2");
|
|
91
|
-
}
|
|
92
|
-
@font-face {
|
|
93
|
-
font-family: "GT America Mono";
|
|
94
|
-
font-weight: 500;
|
|
52
|
+
font-weight: 25 900;
|
|
95
53
|
font-style: normal;
|
|
96
54
|
font-display: swap;
|
|
97
|
-
src: url("../fonts/gt-america-mono-
|
|
55
|
+
src: url("../fonts/gt-america-mono-vf.woff2") format("woff2");
|
|
98
56
|
}
|
|
99
57
|
|
|
100
58
|
@font-face {
|
|
101
59
|
font-family: "GT America Fallback";
|
|
102
60
|
src: local("Arial");
|
|
103
|
-
size-adjust: 102.
|
|
104
|
-
ascent-override:
|
|
105
|
-
descent-override:
|
|
61
|
+
size-adjust: 102.5%;
|
|
62
|
+
ascent-override: 93.66%;
|
|
63
|
+
descent-override: 24.39%;
|
|
106
64
|
line-gap-override: 0%;
|
|
107
65
|
}
|
|
108
66
|
@font-face {
|
|
@@ -116,16 +74,16 @@
|
|
|
116
74
|
@font-face {
|
|
117
75
|
font-family: "GT America Extended Fallback";
|
|
118
76
|
src: local("Arial");
|
|
119
|
-
size-adjust: 123.
|
|
120
|
-
ascent-override:
|
|
121
|
-
descent-override:
|
|
77
|
+
size-adjust: 123.08%;
|
|
78
|
+
ascent-override: 78%;
|
|
79
|
+
descent-override: 20.31%;
|
|
122
80
|
line-gap-override: 0%;
|
|
123
81
|
}
|
|
124
82
|
@font-face {
|
|
125
83
|
font-family: "GT America Mono Fallback";
|
|
126
84
|
src: local("Courier New");
|
|
127
85
|
size-adjust: 103.32%;
|
|
128
|
-
ascent-override:
|
|
129
|
-
descent-override:
|
|
86
|
+
ascent-override: 92.92%;
|
|
87
|
+
descent-override: 24.2%;
|
|
130
88
|
line-gap-override: 0%;
|
|
131
89
|
}
|
package/src/parts/composer.css
CHANGED
|
@@ -114,13 +114,76 @@
|
|
|
114
114
|
font-size: var(--key-icon);
|
|
115
115
|
transition: background-color 120ms var(--out);
|
|
116
116
|
}
|
|
117
|
-
.ks .ks-iconbtn:hover
|
|
117
|
+
.ks .ks-iconbtn:hover,
|
|
118
|
+
.ks-prompts[data-open] .ks-iconbtn {
|
|
118
119
|
background: var(--stone);
|
|
119
120
|
}
|
|
121
|
+
.ks-iconbtn > svg {
|
|
122
|
+
transition: rotate 200ms var(--out);
|
|
123
|
+
}
|
|
124
|
+
.ks-prompts[data-open] .ks-iconbtn > svg {
|
|
125
|
+
rotate: 45deg;
|
|
126
|
+
}
|
|
127
|
+
/* The +'s prompts, a menu opened down from the bar, over whatever lies under the composer: clear
|
|
128
|
+
of its edge by 6px, past its padding (8px) and border (1px), and flush with its left side. */
|
|
129
|
+
.ks-prompts {
|
|
130
|
+
position: relative;
|
|
131
|
+
}
|
|
132
|
+
.ks-prompts__menu {
|
|
133
|
+
position: absolute;
|
|
134
|
+
top: calc(100% + 15px);
|
|
135
|
+
left: -9px;
|
|
136
|
+
z-index: 10;
|
|
137
|
+
display: grid;
|
|
138
|
+
width: max-content;
|
|
139
|
+
max-width: min(340px, calc(100vw - 32px));
|
|
140
|
+
padding: 4px;
|
|
141
|
+
background: var(--white);
|
|
142
|
+
border: 1px solid var(--line);
|
|
143
|
+
border-radius: 8px;
|
|
144
|
+
box-shadow: var(--lift-lg);
|
|
145
|
+
transform-origin: top left;
|
|
146
|
+
animation: ks-prompts-in 180ms var(--out);
|
|
147
|
+
}
|
|
148
|
+
@keyframes ks-prompts-in {
|
|
149
|
+
from {
|
|
150
|
+
opacity: 0;
|
|
151
|
+
transform: translateY(-4px) scale(0.98);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
.ks-prompts__item {
|
|
155
|
+
padding: 9px 12px;
|
|
156
|
+
border-radius: 4px;
|
|
157
|
+
background: transparent;
|
|
158
|
+
color: var(--ink);
|
|
159
|
+
font-family: var(--sans);
|
|
160
|
+
font-size: var(--key-type);
|
|
161
|
+
line-height: 22px;
|
|
162
|
+
text-align: left;
|
|
163
|
+
transition: background-color 120ms var(--out);
|
|
164
|
+
}
|
|
165
|
+
.ks .ks-prompts__item:hover,
|
|
166
|
+
.ks .ks-prompts__item:focus-visible {
|
|
167
|
+
background: var(--paper);
|
|
168
|
+
outline: 0;
|
|
169
|
+
}
|
|
170
|
+
@media (prefers-reduced-motion: reduce) {
|
|
171
|
+
.ks-prompts__menu {
|
|
172
|
+
animation-name: ks-prompts-fade;
|
|
173
|
+
}
|
|
174
|
+
.ks-iconbtn > svg {
|
|
175
|
+
transition: none;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
@keyframes ks-prompts-fade {
|
|
179
|
+
from {
|
|
180
|
+
opacity: 0;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
120
183
|
.ks-send {
|
|
121
184
|
display: grid;
|
|
122
185
|
place-items: center;
|
|
123
|
-
width: var(--key);
|
|
186
|
+
width: calc(var(--key) * 2);
|
|
124
187
|
height: var(--key);
|
|
125
188
|
border-radius: 4px;
|
|
126
189
|
background: var(--pear-100);
|
|
@@ -176,7 +239,20 @@
|
|
|
176
239
|
background: #2c2b29;
|
|
177
240
|
color: var(--text-paper);
|
|
178
241
|
}
|
|
179
|
-
.ks-composer[data-tone="ink"] .ks-iconbtn:hover
|
|
242
|
+
.ks-composer[data-tone="ink"] .ks-iconbtn:hover,
|
|
243
|
+
.ks-composer[data-tone="ink"] .ks-prompts[data-open] .ks-iconbtn {
|
|
244
|
+
background: #3a3836;
|
|
245
|
+
}
|
|
246
|
+
.ks-composer[data-tone="ink"] .ks-prompts__menu {
|
|
247
|
+
background: #2c2b29;
|
|
248
|
+
border-color: #3a3836;
|
|
249
|
+
box-shadow: 0 24px 60px rgb(0 0 0 / 0.5);
|
|
250
|
+
}
|
|
251
|
+
.ks-composer[data-tone="ink"] .ks-prompts__item {
|
|
252
|
+
color: var(--text-paper);
|
|
253
|
+
}
|
|
254
|
+
.ks .ks-composer[data-tone="ink"] .ks-prompts__item:hover,
|
|
255
|
+
.ks .ks-composer[data-tone="ink"] .ks-prompts__item:focus-visible {
|
|
180
256
|
background: #3a3836;
|
|
181
257
|
}
|
|
182
258
|
.ks-composer[data-tone="ink"] .ks-send {
|
package/src/parts/composer.tsx
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
type CSSProperties,
|
|
5
|
+
type KeyboardEvent,
|
|
5
6
|
type ReactNode,
|
|
6
7
|
type RefObject,
|
|
7
8
|
useEffect,
|
|
9
|
+
useId,
|
|
8
10
|
useLayoutEffect,
|
|
9
11
|
useRef,
|
|
10
12
|
useState,
|
|
@@ -100,6 +102,9 @@ export function useComposer({
|
|
|
100
102
|
return { value, setValue, load, send, focus: bring, loaded, ref };
|
|
101
103
|
}
|
|
102
104
|
|
|
105
|
+
/** A prompt the + offers: what its line in the menu says, and what lands in the composer. */
|
|
106
|
+
export type ComposerPrompt = { label: string; prompt: string };
|
|
107
|
+
|
|
103
108
|
type Props = {
|
|
104
109
|
composer: ComposerState;
|
|
105
110
|
/** What the empty line shows. */
|
|
@@ -107,11 +112,24 @@ type Props = {
|
|
|
107
112
|
tone?: "ink";
|
|
108
113
|
className?: string;
|
|
109
114
|
style?: CSSProperties;
|
|
110
|
-
/** Extra controls on the left of the bar, after
|
|
115
|
+
/** Extra controls on the left of the bar, after the +. */
|
|
111
116
|
tools?: ReactNode;
|
|
117
|
+
/** What the + offers. Without them there is no +. */
|
|
118
|
+
prompts?: readonly ComposerPrompt[];
|
|
119
|
+
/** What choosing one does. By default its prompt is dropped in. */
|
|
120
|
+
onPrompt?: (prompt: ComposerPrompt) => void;
|
|
112
121
|
};
|
|
113
122
|
|
|
114
|
-
export function Composer({
|
|
123
|
+
export function Composer({
|
|
124
|
+
composer,
|
|
125
|
+
placeholder,
|
|
126
|
+
tone,
|
|
127
|
+
className,
|
|
128
|
+
style,
|
|
129
|
+
tools,
|
|
130
|
+
prompts,
|
|
131
|
+
onPrompt,
|
|
132
|
+
}: Props) {
|
|
115
133
|
const { value, setValue, send, loaded, ref } = composer;
|
|
116
134
|
const field = useRef<HTMLTextAreaElement>(null);
|
|
117
135
|
const ready = value.trim() !== "";
|
|
@@ -160,15 +178,18 @@ export function Composer({ composer, placeholder, tone, className, style, tools
|
|
|
160
178
|
</label>
|
|
161
179
|
<div className="ks-composer__bar">
|
|
162
180
|
<div className="ks-composer__actions">
|
|
163
|
-
|
|
164
|
-
<
|
|
165
|
-
|
|
181
|
+
{prompts && prompts.length > 0 ? (
|
|
182
|
+
<Prompts
|
|
183
|
+
prompts={prompts}
|
|
184
|
+
onPick={(prompt) => {
|
|
185
|
+
if (onPrompt) onPrompt(prompt);
|
|
186
|
+
else composer.load(prompt.prompt);
|
|
187
|
+
}}
|
|
188
|
+
/>
|
|
189
|
+
) : null}
|
|
166
190
|
{tools}
|
|
167
191
|
</div>
|
|
168
192
|
<div className="ks-composer__actions">
|
|
169
|
-
<span className="ks-iconbtn" aria-hidden>
|
|
170
|
-
<Mic />
|
|
171
|
-
</span>
|
|
172
193
|
{/* Keyed by the count of prompts dropped in, so each replays the send key's nudge. */}
|
|
173
194
|
<button
|
|
174
195
|
key={loaded}
|
|
@@ -186,7 +207,110 @@ export function Composer({ composer, placeholder, tone, className, style, tools
|
|
|
186
207
|
);
|
|
187
208
|
}
|
|
188
209
|
|
|
189
|
-
|
|
210
|
+
/** The + and the menu it opens down from the bar: a line to a prompt. Arrows move through them,
|
|
211
|
+
Escape or a click away closes it, and choosing one closes it and hands the prompt on. */
|
|
212
|
+
function Prompts({
|
|
213
|
+
prompts,
|
|
214
|
+
onPick,
|
|
215
|
+
}: {
|
|
216
|
+
prompts: readonly ComposerPrompt[];
|
|
217
|
+
onPick: (prompt: ComposerPrompt) => void;
|
|
218
|
+
}) {
|
|
219
|
+
const [open, setOpen] = useState(false);
|
|
220
|
+
const root = useRef<HTMLDivElement>(null);
|
|
221
|
+
const key = useRef<HTMLButtonElement>(null);
|
|
222
|
+
const menu = useId();
|
|
223
|
+
|
|
224
|
+
const items = () => [
|
|
225
|
+
...(root.current?.querySelectorAll<HTMLButtonElement>(".ks-prompts__item") ?? []),
|
|
226
|
+
];
|
|
227
|
+
|
|
228
|
+
useEffect(() => {
|
|
229
|
+
if (!open) return;
|
|
230
|
+
root.current?.querySelector<HTMLButtonElement>(".ks-prompts__item")?.focus();
|
|
231
|
+
const away = (event: PointerEvent) => {
|
|
232
|
+
if (!root.current?.contains(event.target as Node)) setOpen(false);
|
|
233
|
+
};
|
|
234
|
+
document.addEventListener("pointerdown", away);
|
|
235
|
+
return () => {
|
|
236
|
+
document.removeEventListener("pointerdown", away);
|
|
237
|
+
};
|
|
238
|
+
}, [open]);
|
|
239
|
+
|
|
240
|
+
const close = () => {
|
|
241
|
+
setOpen(false);
|
|
242
|
+
key.current?.focus();
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
|
|
246
|
+
const all = items();
|
|
247
|
+
const at = all.indexOf(document.activeElement as HTMLButtonElement);
|
|
248
|
+
const move = (to: number) => {
|
|
249
|
+
event.preventDefault();
|
|
250
|
+
all[(to + all.length) % all.length]?.focus();
|
|
251
|
+
};
|
|
252
|
+
if (event.key === "Escape") {
|
|
253
|
+
event.preventDefault();
|
|
254
|
+
close();
|
|
255
|
+
} else if (event.key === "Tab") setOpen(false);
|
|
256
|
+
else if (event.key === "ArrowDown") move(at + 1);
|
|
257
|
+
else if (event.key === "ArrowUp") move(at - 1);
|
|
258
|
+
else if (event.key === "Home") move(0);
|
|
259
|
+
else if (event.key === "End") move(all.length - 1);
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
return (
|
|
263
|
+
<div ref={root} className="ks-prompts" data-open={open ? "" : undefined}>
|
|
264
|
+
<button
|
|
265
|
+
ref={key}
|
|
266
|
+
type="button"
|
|
267
|
+
className="ks-iconbtn"
|
|
268
|
+
aria-label="Try a prompt"
|
|
269
|
+
aria-haspopup="menu"
|
|
270
|
+
aria-expanded={open}
|
|
271
|
+
aria-controls={open ? menu : undefined}
|
|
272
|
+
onClick={() => {
|
|
273
|
+
setOpen((was) => !was);
|
|
274
|
+
}}
|
|
275
|
+
onKeyDown={(event) => {
|
|
276
|
+
if (event.key === "ArrowDown" && !open) {
|
|
277
|
+
event.preventDefault();
|
|
278
|
+
setOpen(true);
|
|
279
|
+
}
|
|
280
|
+
}}
|
|
281
|
+
>
|
|
282
|
+
<Plus />
|
|
283
|
+
</button>
|
|
284
|
+
{open ? (
|
|
285
|
+
<div
|
|
286
|
+
id={menu}
|
|
287
|
+
className="ks-prompts__menu"
|
|
288
|
+
role="menu"
|
|
289
|
+
aria-label="Prompts to try"
|
|
290
|
+
onKeyDown={onKeyDown}
|
|
291
|
+
>
|
|
292
|
+
{prompts.map((prompt) => (
|
|
293
|
+
<button
|
|
294
|
+
key={prompt.label}
|
|
295
|
+
type="button"
|
|
296
|
+
role="menuitem"
|
|
297
|
+
tabIndex={-1}
|
|
298
|
+
className="ks-prompts__item"
|
|
299
|
+
onClick={() => {
|
|
300
|
+
setOpen(false);
|
|
301
|
+
onPick(prompt);
|
|
302
|
+
}}
|
|
303
|
+
>
|
|
304
|
+
{prompt.label}
|
|
305
|
+
</button>
|
|
306
|
+
))}
|
|
307
|
+
</div>
|
|
308
|
+
) : null}
|
|
309
|
+
</div>
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// The composer's two glyphs, drawn on the 24px grid the Figma file uses.
|
|
190
314
|
const glyph = {
|
|
191
315
|
width: "1em",
|
|
192
316
|
height: "1em",
|
|
@@ -203,14 +327,6 @@ function Plus() {
|
|
|
203
327
|
</svg>
|
|
204
328
|
);
|
|
205
329
|
}
|
|
206
|
-
function Mic() {
|
|
207
|
-
return (
|
|
208
|
-
<svg {...glyph} aria-hidden>
|
|
209
|
-
<rect x="9" y="3.5" width="6" height="11" rx="3" />
|
|
210
|
-
<path d="M5.5 11.5a6.5 6.5 0 0 0 13 0M12 18v3" strokeLinecap="square" />
|
|
211
|
-
</svg>
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
330
|
function Return() {
|
|
215
331
|
return (
|
|
216
332
|
<svg {...glyph} aria-hidden>
|
package/src/parts/nav.css
CHANGED
|
@@ -29,18 +29,20 @@
|
|
|
29
29
|
flex: none;
|
|
30
30
|
}
|
|
31
31
|
.ks-nav__links {
|
|
32
|
+
padding-inline: 24px;
|
|
33
|
+
}
|
|
34
|
+
.ks-nav__list {
|
|
32
35
|
display: flex;
|
|
33
36
|
align-items: center;
|
|
34
37
|
gap: 20px;
|
|
35
|
-
padding-inline: 24px;
|
|
36
38
|
}
|
|
37
39
|
.ks-nav__item {
|
|
38
40
|
padding: 2px 6px;
|
|
39
41
|
border-radius: 2px;
|
|
40
42
|
font-weight: 400;
|
|
41
|
-
font-size:
|
|
42
|
-
line-height:
|
|
43
|
-
letter-spacing: -0.
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
line-height: 21px;
|
|
45
|
+
letter-spacing: -0.01em;
|
|
44
46
|
color: var(--ink);
|
|
45
47
|
transition: color 120ms var(--out);
|
|
46
48
|
}
|
|
@@ -94,19 +96,25 @@
|
|
|
94
96
|
.ks .ks-nav[data-tone="ink"] .ks-nav__try:focus-visible {
|
|
95
97
|
outline-color: var(--ink);
|
|
96
98
|
}
|
|
97
|
-
/* The menu key, on a phone only: a key square, the bar's own ground
|
|
99
|
+
/* The menu key, on a phone only: a key square, the bar's own ground, square-cornered as the way
|
|
100
|
+
in beside it. Its ground shows under a pointer only: on a touch screen a hover stays behind
|
|
101
|
+
after the tap. */
|
|
98
102
|
.ks-nav__menu {
|
|
99
103
|
display: none;
|
|
100
104
|
place-items: center;
|
|
101
105
|
width: var(--key);
|
|
102
106
|
height: var(--key);
|
|
103
|
-
border-radius: 4px;
|
|
104
107
|
color: var(--ink);
|
|
105
108
|
font-size: var(--key-icon);
|
|
106
109
|
transition: background-color 120ms var(--out);
|
|
107
110
|
}
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
@media (hover: hover) {
|
|
112
|
+
.ks .ks-nav__menu:hover {
|
|
113
|
+
background: var(--stone);
|
|
114
|
+
}
|
|
115
|
+
.ks .ks-nav[data-tone="ink"] .ks-nav__menu:hover {
|
|
116
|
+
background: var(--line-ink);
|
|
117
|
+
}
|
|
110
118
|
}
|
|
111
119
|
.ks .ks-nav__menu:focus-visible {
|
|
112
120
|
outline: 2px solid var(--char);
|
|
@@ -115,9 +123,6 @@
|
|
|
115
123
|
.ks-nav[data-tone="ink"] .ks-nav__menu {
|
|
116
124
|
color: var(--text-paper);
|
|
117
125
|
}
|
|
118
|
-
.ks .ks-nav[data-tone="ink"] .ks-nav__menu:hover {
|
|
119
|
-
background: var(--line-ink);
|
|
120
|
-
}
|
|
121
126
|
.ks .ks-nav[data-tone="ink"] .ks-nav__menu:focus-visible {
|
|
122
127
|
outline-color: var(--text-paper);
|
|
123
128
|
}
|
|
@@ -128,26 +133,59 @@
|
|
|
128
133
|
.ks-nav__home {
|
|
129
134
|
margin-right: auto;
|
|
130
135
|
}
|
|
131
|
-
/* Open, the bar runs down to hold the links, one to a row
|
|
136
|
+
/* Open, the bar runs down from under the mark and the keys to hold the links, one to a row: the
|
|
137
|
+
row the links sit in grows from nothing to their height, showing them from the top, and each
|
|
138
|
+
link comes down into place after the one above it. Closing runs back up, quicker, all at
|
|
139
|
+
once. Shut, the links are hidden from the keyboard and screen readers as well as the eye. */
|
|
140
|
+
.ks-nav {
|
|
141
|
+
flex-wrap: wrap;
|
|
142
|
+
row-gap: 0;
|
|
143
|
+
}
|
|
132
144
|
.ks-nav__links {
|
|
133
|
-
display: none;
|
|
134
145
|
order: 3;
|
|
135
146
|
flex-basis: 100%;
|
|
147
|
+
display: grid;
|
|
148
|
+
grid-template-rows: 0fr;
|
|
149
|
+
padding: 0;
|
|
150
|
+
visibility: hidden;
|
|
151
|
+
transition:
|
|
152
|
+
grid-template-rows 240ms var(--out),
|
|
153
|
+
visibility 0s linear 240ms;
|
|
154
|
+
}
|
|
155
|
+
.ks-nav[data-open] .ks-nav__links {
|
|
156
|
+
grid-template-rows: 1fr;
|
|
157
|
+
visibility: visible;
|
|
158
|
+
transition: grid-template-rows 440ms var(--out);
|
|
159
|
+
}
|
|
160
|
+
.ks-nav__list {
|
|
161
|
+
min-height: 0;
|
|
162
|
+
overflow: hidden;
|
|
136
163
|
flex-direction: column;
|
|
137
164
|
align-items: stretch;
|
|
138
165
|
gap: 0;
|
|
139
|
-
padding: 8px 0 0;
|
|
140
166
|
}
|
|
141
|
-
.ks-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
display: flex;
|
|
146
|
-
animation: ks-fade 200ms var(--out) both;
|
|
167
|
+
.ks-nav__list::before {
|
|
168
|
+
content: "";
|
|
169
|
+
flex: none;
|
|
170
|
+
height: 8px;
|
|
147
171
|
}
|
|
148
172
|
.ks-nav__links .ks-nav__item {
|
|
149
173
|
padding: 12px 8px;
|
|
150
174
|
font-size: 18px;
|
|
175
|
+
opacity: 0;
|
|
176
|
+
translate: 0 -12px;
|
|
177
|
+
transition:
|
|
178
|
+
opacity 160ms var(--out),
|
|
179
|
+
translate 160ms var(--out),
|
|
180
|
+
color 120ms var(--out);
|
|
181
|
+
}
|
|
182
|
+
.ks-nav[data-open] .ks-nav__links .ks-nav__item {
|
|
183
|
+
opacity: 1;
|
|
184
|
+
translate: none;
|
|
185
|
+
transition:
|
|
186
|
+
opacity 280ms var(--out) calc(var(--i, 0) * 25ms),
|
|
187
|
+
translate 400ms var(--out) calc(var(--i, 0) * 25ms),
|
|
188
|
+
color 120ms var(--out);
|
|
151
189
|
}
|
|
152
190
|
.ks-nav__links .ks-nav__item + .ks-nav__item {
|
|
153
191
|
border-top: 1px solid var(--line);
|
|
@@ -169,12 +207,9 @@
|
|
|
169
207
|
translate: none;
|
|
170
208
|
}
|
|
171
209
|
}
|
|
172
|
-
/* The way in, in the phone's menu only. */
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
@keyframes ks-fade {
|
|
177
|
-
from {
|
|
178
|
-
opacity: 0;
|
|
210
|
+
/* The way in, last of the links: a link like the rest, with the arrow in the phone's menu only. */
|
|
211
|
+
@media (min-width: 721px) {
|
|
212
|
+
.ks-nav__login > svg {
|
|
213
|
+
display: none;
|
|
179
214
|
}
|
|
180
215
|
}
|
package/src/parts/nav.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { type MouseEvent, useEffect, useState } from "react";
|
|
3
|
+
import { type CSSProperties, type MouseEvent, useEffect, useState } from "react";
|
|
4
4
|
import { Icon } from "../icon";
|
|
5
5
|
import { Mark } from "../mark";
|
|
6
6
|
import { prefersReducedMotion } from "../motion";
|
|
@@ -12,7 +12,7 @@ type Props = {
|
|
|
12
12
|
home: NavLink;
|
|
13
13
|
/** A link to `#id` glides to that section; any other is followed. */
|
|
14
14
|
links: readonly NavLink[];
|
|
15
|
-
/** The way in for a customer,
|
|
15
|
+
/** The way in for a customer, after the links. */
|
|
16
16
|
login: NavLink;
|
|
17
17
|
/** The key at the end: a handler, or a page to go to. */
|
|
18
18
|
cta: { label: string } & ({ onClick: () => void } | { href: string });
|
|
@@ -51,22 +51,29 @@ export function Nav({ home, links, login, cta, tone }: Props) {
|
|
|
51
51
|
<Mark className="ks-nav__mark" />
|
|
52
52
|
</a>
|
|
53
53
|
<div id="ks-nav-links" className="ks-nav__links">
|
|
54
|
-
|
|
54
|
+
<div className="ks-nav__list">
|
|
55
|
+
{links.map((item, index) => (
|
|
56
|
+
<a
|
|
57
|
+
key={item.href}
|
|
58
|
+
href={item.href}
|
|
59
|
+
className="ks-nav__item"
|
|
60
|
+
style={{ "--i": index } as CSSProperties}
|
|
61
|
+
onClick={(event) => {
|
|
62
|
+
go(event, item.href);
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
{item.label}
|
|
66
|
+
</a>
|
|
67
|
+
))}
|
|
55
68
|
<a
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
onClick={(event) => {
|
|
60
|
-
go(event, item.href);
|
|
61
|
-
}}
|
|
69
|
+
href={login.href}
|
|
70
|
+
className="ks-nav__item ks-nav__login"
|
|
71
|
+
style={{ "--i": links.length } as CSSProperties}
|
|
62
72
|
>
|
|
63
|
-
{
|
|
73
|
+
{login.label}
|
|
74
|
+
<Icon name="arrow-right" />
|
|
64
75
|
</a>
|
|
65
|
-
|
|
66
|
-
<a href={login.href} className="ks-nav__item ks-nav__login">
|
|
67
|
-
{login.label}
|
|
68
|
-
<Icon name="arrow-right" />
|
|
69
|
-
</a>
|
|
76
|
+
</div>
|
|
70
77
|
</div>
|
|
71
78
|
{"href" in cta ? (
|
|
72
79
|
<a href={cta.href} className="ks-nav__try">
|
package/src/parts/plans.css
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
.ks-plan {
|
|
10
10
|
display: flex;
|
|
11
11
|
flex-direction: column;
|
|
12
|
-
gap: calc(var(--u) * 0.
|
|
13
|
-
padding: var(--u);
|
|
12
|
+
gap: calc(var(--u) * 0.5);
|
|
13
|
+
padding: calc(var(--u) * 0.7);
|
|
14
14
|
min-height: calc(var(--u) * 12);
|
|
15
15
|
}
|
|
16
16
|
.ks-plan + .ks-plan {
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
gap: 8px;
|
|
32
32
|
font-family: var(--serif);
|
|
33
33
|
font-weight: 200;
|
|
34
|
-
font-size: calc(var(--u) *
|
|
34
|
+
font-size: calc(var(--u) * 1.5);
|
|
35
35
|
line-height: 1;
|
|
36
36
|
letter-spacing: -0.03em;
|
|
37
37
|
}
|
|
38
38
|
.ks-plan__price small {
|
|
39
39
|
font-family: var(--sans);
|
|
40
|
-
font-size: var(--
|
|
40
|
+
font-size: max(14px, calc(var(--u) * 0.35));
|
|
41
41
|
letter-spacing: 0;
|
|
42
42
|
color: var(--muted);
|
|
43
43
|
}
|
|
@@ -47,13 +47,14 @@
|
|
|
47
47
|
.ks-plan__for {
|
|
48
48
|
font-family: var(--ext);
|
|
49
49
|
font-weight: 500;
|
|
50
|
-
font-size: calc(var(--u) * 0.
|
|
50
|
+
font-size: max(16px, calc(var(--u) * 0.42));
|
|
51
51
|
line-height: 1.25;
|
|
52
52
|
}
|
|
53
53
|
.ks-plan__list {
|
|
54
54
|
display: grid;
|
|
55
|
-
gap:
|
|
56
|
-
font-size: var(--
|
|
55
|
+
gap: 6px;
|
|
56
|
+
font-size: max(14px, calc(var(--u) * 0.35));
|
|
57
|
+
line-height: 1.45;
|
|
57
58
|
color: var(--soft);
|
|
58
59
|
}
|
|
59
60
|
.ks-plan[data-featured] .ks-plan__list {
|
|
@@ -61,14 +62,14 @@
|
|
|
61
62
|
}
|
|
62
63
|
.ks-plan__list li {
|
|
63
64
|
display: grid;
|
|
64
|
-
grid-template-columns:
|
|
65
|
+
grid-template-columns: 5px 1fr;
|
|
65
66
|
gap: 10px;
|
|
66
67
|
align-items: baseline;
|
|
67
68
|
}
|
|
68
69
|
.ks-plan__list li::before {
|
|
69
70
|
content: "";
|
|
70
|
-
width:
|
|
71
|
-
height:
|
|
71
|
+
width: 5px;
|
|
72
|
+
height: 5px;
|
|
72
73
|
background: currentColor;
|
|
73
74
|
translate: 0 -1px;
|
|
74
75
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|