@keystone-sites/marketing-design-system 2.0.0 → 2.0.1

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.
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.0",
3
+ "version": "2.0.1",
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 static (Mono has no 400;
3
- a request for it resolves to 500). Kyoto is one variable file, wght 100 to 900.
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: 300;
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-300.woff2") format("woff2");
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: 300;
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-300-italic.woff2") format("woff2");
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: 300;
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-extended-300.woff2") format("woff2");
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: 300;
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-500.woff2") format("woff2");
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.87%;
104
- ascent-override: 97.7%;
105
- descent-override: 19.44%;
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.41%;
120
- ascent-override: 81.43%;
121
- descent-override: 16.21%;
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: 97.27%;
129
- descent-override: 19.36%;
86
+ ascent-override: 92.92%;
87
+ descent-override: 24.2%;
130
88
  line-gap-override: 0%;
131
89
  }
package/src/parts/nav.css CHANGED
@@ -29,10 +29,12 @@
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;
@@ -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
- .ks .ks-nav__menu:hover {
109
- background: var(--stone);
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, under the mark and the keys. */
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
- }
141
- .ks-nav[data-open] {
142
- flex-wrap: wrap;
143
166
  }
144
- .ks-nav[data-open] .ks-nav__links {
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);
@@ -173,8 +211,3 @@
173
211
  .ks-nav__login {
174
212
  display: none;
175
213
  }
176
- @keyframes ks-fade {
177
- from {
178
- opacity: 0;
179
- }
180
- }
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";
@@ -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
- {links.map((item) => (
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
- key={item.href}
57
- href={item.href}
58
- className="ks-nav__item"
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
- {item.label}
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">
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file