@keystone-sites/marketing-design-system 1.0.27 → 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 (219) 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 -225
  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 -216
  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 -388
  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 -1508
  66. package/index.css +0 -94
  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/markdown.ts +0 -200
  73. package/lib/noise.tsx +0 -114
  74. package/lib/phone.ts +0 -294
  75. package/lib/render-boundary.tsx +0 -27
  76. package/lib/scroll-lock.ts +0 -25
  77. package/lib/swipe.ts +0 -124
  78. package/lib/use-active-section.ts +0 -43
  79. package/lib/use-copy.ts +0 -41
  80. package/lib/use-count-up.ts +0 -26
  81. package/lib/use-grader-search.ts +0 -143
  82. package/lib/use-popover.ts +0 -30
  83. package/lib/use-video-carousel.ts +0 -271
  84. package/media.ts +0 -558
  85. package/primitives/ask-cursor.tsx +0 -74
  86. package/primitives/ask.css +0 -103
  87. package/primitives/ask.tsx +0 -28
  88. package/primitives/breadcrumb.css +0 -51
  89. package/primitives/breadcrumb.tsx +0 -46
  90. package/primitives/business-picker.css +0 -135
  91. package/primitives/business-picker.tsx +0 -298
  92. package/primitives/button-inline.css +0 -58
  93. package/primitives/button-inline.tsx +0 -48
  94. package/primitives/buttons.css +0 -551
  95. package/primitives/buttons.tsx +0 -330
  96. package/primitives/case-study-button.css +0 -71
  97. package/primitives/case-study-button.tsx +0 -28
  98. package/primitives/case-study-card.css +0 -318
  99. package/primitives/case-study-card.tsx +0 -116
  100. package/primitives/chart.css +0 -110
  101. package/primitives/chart.tsx +0 -198
  102. package/primitives/chat-copy.tsx +0 -30
  103. package/primitives/chat.css +0 -1086
  104. package/primitives/chat.tsx +0 -684
  105. package/primitives/chip.css +0 -127
  106. package/primitives/chip.tsx +0 -53
  107. package/primitives/closer-row.css +0 -14
  108. package/primitives/closer-row.tsx +0 -22
  109. package/primitives/cta-row.css +0 -41
  110. package/primitives/cta-row.tsx +0 -39
  111. package/primitives/disclosure.css +0 -302
  112. package/primitives/disclosure.tsx +0 -277
  113. package/primitives/faq-question.css +0 -220
  114. package/primitives/faq-question.tsx +0 -55
  115. package/primitives/field.css +0 -279
  116. package/primitives/field.tsx +0 -376
  117. package/primitives/footer-item.css +0 -72
  118. package/primitives/footer-item.tsx +0 -42
  119. package/primitives/glyph-toggle.css +0 -62
  120. package/primitives/glyph-toggle.tsx +0 -42
  121. package/primitives/grader-menu.tsx +0 -84
  122. package/primitives/grader.css +0 -369
  123. package/primitives/grader.tsx +0 -285
  124. package/primitives/keystone-score.css +0 -156
  125. package/primitives/keystone-score.tsx +0 -204
  126. package/primitives/markdown.css +0 -232
  127. package/primitives/markdown.tsx +0 -359
  128. package/primitives/modal.css +0 -193
  129. package/primitives/modal.tsx +0 -204
  130. package/primitives/month-range.css +0 -80
  131. package/primitives/month-range.tsx +0 -183
  132. package/primitives/notice.css +0 -39
  133. package/primitives/notice.tsx +0 -56
  134. package/primitives/persona-card.css +0 -374
  135. package/primitives/persona-card.tsx +0 -74
  136. package/primitives/picture.css +0 -11
  137. package/primitives/picture.tsx +0 -41
  138. package/primitives/plan-card.css +0 -398
  139. package/primitives/plan-card.tsx +0 -153
  140. package/primitives/prompt.css +0 -588
  141. package/primitives/prompt.tsx +0 -440
  142. package/primitives/prose.css +0 -164
  143. package/primitives/prose.tsx +0 -194
  144. package/primitives/ramps.css +0 -77
  145. package/primitives/report-nav.css +0 -382
  146. package/primitives/report-nav.tsx +0 -353
  147. package/primitives/report.css +0 -601
  148. package/primitives/report.tsx +0 -357
  149. package/primitives/skeleton.css +0 -82
  150. package/primitives/skeleton.tsx +0 -56
  151. package/primitives/slider.css +0 -179
  152. package/primitives/slider.tsx +0 -69
  153. package/primitives/slug.css +0 -87
  154. package/primitives/slug.tsx +0 -37
  155. package/primitives/status.css +0 -427
  156. package/primitives/status.tsx +0 -323
  157. package/primitives/strip.css +0 -43
  158. package/primitives/surface.css +0 -88
  159. package/primitives/surface.tsx +0 -100
  160. package/primitives/table.css +0 -227
  161. package/primitives/table.tsx +0 -122
  162. package/primitives/tabs.css +0 -85
  163. package/primitives/tabs.tsx +0 -122
  164. package/primitives/tag.css +0 -46
  165. package/primitives/tag.tsx +0 -33
  166. package/primitives/text.css +0 -127
  167. package/primitives/toc.css +0 -65
  168. package/primitives/toc.tsx +0 -42
  169. package/primitives/tooltip.css +0 -56
  170. package/primitives/tooltip.tsx +0 -103
  171. package/rules/design-system.md +0 -154
  172. package/rules/grid-and-layout.md +0 -174
  173. package/scripts/generate-exports.mjs +0 -61
  174. package/scripts/generate-type-css.mjs +0 -130
  175. package/sections/faq-island.tsx +0 -102
  176. package/sections/faq.css +0 -213
  177. package/sections/faq.tsx +0 -46
  178. package/sections/footer-nav.tsx +0 -95
  179. package/sections/footer-signature.css +0 -223
  180. package/sections/footer-signature.tsx +0 -127
  181. package/sections/footer.css +0 -735
  182. package/sections/footer.tsx +0 -286
  183. package/sections/gallery-overlay.css +0 -212
  184. package/sections/gallery-overlay.tsx +0 -267
  185. package/sections/landing-benefits.css +0 -59
  186. package/sections/landing-benefits.tsx +0 -81
  187. package/sections/landing-closer.css +0 -23
  188. package/sections/landing-closer.tsx +0 -26
  189. package/sections/landing-hero.css +0 -80
  190. package/sections/landing-hero.tsx +0 -69
  191. package/sections/landing-quote.css +0 -19
  192. package/sections/landing-quote.tsx +0 -30
  193. package/sections/landing-sample.ts +0 -66
  194. package/sections/landing.css +0 -45
  195. package/sections/landing.tsx +0 -69
  196. package/sections/load-orchestrator.tsx +0 -43
  197. package/sections/load.css +0 -138
  198. package/sections/nav-desktop.css +0 -530
  199. package/sections/nav-desktop.tsx +0 -155
  200. package/sections/nav-menu.css +0 -57
  201. package/sections/nav-menu.tsx +0 -112
  202. package/sections/nav-mobile.css +0 -571
  203. package/sections/nav-mobile.tsx +0 -222
  204. package/sections/nav-solo.tsx +0 -28
  205. package/sections/nav.css +0 -135
  206. package/sections/nav.tsx +0 -394
  207. package/sections/site-chat-data.ts +0 -16
  208. package/sections/site-chat-open.tsx +0 -25
  209. package/sections/site-chat.tsx +0 -67
  210. package/site-links.ts +0 -41
  211. package/site.ts +0 -2
  212. package/themes/inverted.css +0 -177
  213. package/tokens/fonts.css +0 -38
  214. package/tokens/motion.css +0 -158
  215. package/tokens/primitives.css +0 -163
  216. package/tokens/semantic.css +0 -174
  217. package/tokens/type-styles.json +0 -145
  218. package/tokens/type.css +0 -1548
  219. package/widgets.css +0 -78
package/src/base.css ADDED
@@ -0,0 +1,300 @@
1
+ /* The page's defaults, in the `base` layer, so any unlayered rule (a part's, a site's) outranks
2
+ them whatever its specificity.
3
+
4
+ The reset is Tailwind's preflight (MIT, Tailwind Labs, Inc.), unchanged but for its theme
5
+ lookups, which read the system's families. */
6
+ @layer base {
7
+ *,
8
+ ::after,
9
+ ::before,
10
+ ::backdrop,
11
+ ::file-selector-button {
12
+ box-sizing: border-box;
13
+ margin: 0;
14
+ padding: 0;
15
+ border: 0 solid;
16
+ }
17
+
18
+ html,
19
+ :host {
20
+ line-height: 1.5;
21
+ -webkit-text-size-adjust: 100%;
22
+ tab-size: 4;
23
+ font-family: var(--font-sans);
24
+ font-feature-settings: normal;
25
+ font-variation-settings: normal;
26
+ -webkit-tap-highlight-color: transparent;
27
+ }
28
+
29
+ hr {
30
+ height: 0;
31
+ color: inherit;
32
+ border-top-width: 1px;
33
+ }
34
+
35
+ abbr:where([title]) {
36
+ -webkit-text-decoration: underline dotted;
37
+ text-decoration: underline dotted;
38
+ }
39
+
40
+ h1,
41
+ h2,
42
+ h3,
43
+ h4,
44
+ h5,
45
+ h6 {
46
+ font-size: inherit;
47
+ font-weight: inherit;
48
+ }
49
+
50
+ a {
51
+ color: inherit;
52
+ -webkit-text-decoration: inherit;
53
+ text-decoration: inherit;
54
+ }
55
+
56
+ b,
57
+ strong {
58
+ font-weight: bolder;
59
+ }
60
+
61
+ code,
62
+ kbd,
63
+ samp,
64
+ pre {
65
+ font-family: var(--font-mono);
66
+ font-feature-settings: normal;
67
+ font-variation-settings: normal;
68
+ font-size: 1em;
69
+ }
70
+
71
+ small {
72
+ font-size: 80%;
73
+ }
74
+
75
+ sub,
76
+ sup {
77
+ font-size: 75%;
78
+ line-height: 0;
79
+ position: relative;
80
+ vertical-align: baseline;
81
+ }
82
+
83
+ sub {
84
+ bottom: -0.25em;
85
+ }
86
+
87
+ sup {
88
+ top: -0.5em;
89
+ }
90
+
91
+ table {
92
+ text-indent: 0;
93
+ border-color: inherit;
94
+ border-collapse: collapse;
95
+ }
96
+
97
+ :-moz-focusring:where(:not(iframe)) {
98
+ outline: auto;
99
+ }
100
+
101
+ progress {
102
+ vertical-align: baseline;
103
+ }
104
+
105
+ summary {
106
+ display: list-item;
107
+ }
108
+
109
+ ol,
110
+ ul,
111
+ menu {
112
+ list-style: none;
113
+ }
114
+
115
+ img,
116
+ svg,
117
+ video,
118
+ canvas,
119
+ audio,
120
+ iframe,
121
+ embed,
122
+ object {
123
+ display: block;
124
+ vertical-align: middle;
125
+ }
126
+
127
+ img,
128
+ video {
129
+ max-width: 100%;
130
+ height: auto;
131
+ }
132
+
133
+ button,
134
+ input,
135
+ select,
136
+ optgroup,
137
+ textarea,
138
+ ::file-selector-button {
139
+ font: inherit;
140
+ font-feature-settings: inherit;
141
+ font-variation-settings: inherit;
142
+ letter-spacing: inherit;
143
+ color: inherit;
144
+ border-radius: 0;
145
+ background-color: transparent;
146
+ opacity: 1;
147
+ }
148
+
149
+ :where(select:is([multiple], [size])) optgroup {
150
+ font-weight: bolder;
151
+ }
152
+
153
+ :where(select:is([multiple], [size])) optgroup option {
154
+ padding-inline-start: 20px;
155
+ }
156
+
157
+ ::file-selector-button {
158
+ margin-inline-end: 4px;
159
+ }
160
+
161
+ ::placeholder {
162
+ opacity: 1;
163
+ }
164
+
165
+ /* Safari before 17 crashes on color-mix() with currentcolor. */
166
+ @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {
167
+ ::placeholder {
168
+ color: color-mix(in oklab, currentcolor 50%, transparent);
169
+ }
170
+ }
171
+
172
+ textarea {
173
+ resize: vertical;
174
+ }
175
+
176
+ ::-webkit-search-decoration {
177
+ -webkit-appearance: none;
178
+ }
179
+
180
+ ::-webkit-date-and-time-value {
181
+ min-height: 1lh;
182
+ text-align: inherit;
183
+ }
184
+
185
+ ::-webkit-datetime-edit {
186
+ display: inline-flex;
187
+ }
188
+
189
+ ::-webkit-datetime-edit-fields-wrapper {
190
+ padding: 0;
191
+ }
192
+
193
+ ::-webkit-datetime-edit,
194
+ ::-webkit-datetime-edit-year-field,
195
+ ::-webkit-datetime-edit-month-field,
196
+ ::-webkit-datetime-edit-day-field,
197
+ ::-webkit-datetime-edit-hour-field,
198
+ ::-webkit-datetime-edit-minute-field,
199
+ ::-webkit-datetime-edit-second-field,
200
+ ::-webkit-datetime-edit-millisecond-field,
201
+ ::-webkit-datetime-edit-meridiem-field {
202
+ padding-block: 0;
203
+ }
204
+
205
+ ::-webkit-calendar-picker-indicator {
206
+ line-height: 1;
207
+ }
208
+
209
+ :-moz-ui-invalid {
210
+ box-shadow: none;
211
+ }
212
+
213
+ button,
214
+ input:where([type="button"], [type="reset"], [type="submit"]),
215
+ ::file-selector-button {
216
+ appearance: button;
217
+ }
218
+
219
+ ::-webkit-inner-spin-button,
220
+ ::-webkit-outer-spin-button {
221
+ height: auto;
222
+ }
223
+
224
+ [hidden]:where(:not([hidden="until-found"])) {
225
+ display: none !important;
226
+ }
227
+
228
+ * {
229
+ border-color: var(--border);
230
+ }
231
+
232
+ html {
233
+ font-family: var(--font-sans);
234
+ font-weight: 300;
235
+ font-size: 1rem;
236
+ line-height: 1.5rem;
237
+ letter-spacing: 0;
238
+ -webkit-font-smoothing: antialiased;
239
+ -moz-osx-font-smoothing: grayscale;
240
+ text-rendering: optimizeLegibility;
241
+ font-feature-settings: "kern", "liga", "calt";
242
+ }
243
+
244
+ body {
245
+ background-color: var(--background);
246
+ color: var(--foreground);
247
+ }
248
+
249
+ /* Headings and running copy wrap for shape; controls keep their lines. */
250
+ h1,
251
+ h2,
252
+ h3,
253
+ h4,
254
+ p,
255
+ li,
256
+ blockquote,
257
+ figcaption {
258
+ text-wrap: pretty;
259
+ }
260
+
261
+ h1,
262
+ h2,
263
+ h3 {
264
+ font-family: var(--font-display);
265
+ font-weight: 200;
266
+ }
267
+
268
+ table,
269
+ time,
270
+ [data-numeric] {
271
+ font-variant-numeric: tabular-nums;
272
+ }
273
+
274
+ button:not(:disabled),
275
+ [role="button"]:not(:disabled) {
276
+ cursor: pointer;
277
+ }
278
+
279
+ [data-slot="icon"] {
280
+ display: inline-block;
281
+ flex-shrink: 0;
282
+ }
283
+
284
+ /* Central draws at 1.5 on a 24 grid; every stroke renders at --icon-stroke on screen whatever
285
+ the icon's size. The attribute catches strokes only, so filled shapes stay filled. */
286
+ [data-slot="icon"] [stroke] {
287
+ stroke-width: var(--icon-stroke);
288
+ vector-effect: non-scaling-stroke;
289
+ }
290
+
291
+ :focus-visible {
292
+ outline: 2px solid var(--ring);
293
+ outline-offset: 2px;
294
+ }
295
+
296
+ ::selection {
297
+ background: var(--primary);
298
+ color: var(--primary-foreground);
299
+ }
300
+ }
package/src/fonts.css ADDED
@@ -0,0 +1,131 @@
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.
4
+
5
+ Each family has a fallback matched to its metrics against Arial, Georgia or Courier New, so text
6
+ set before the face arrives takes the same lines and the swap does not move the page. */
7
+
8
+ /* Standard: interface and body */
9
+ @font-face {
10
+ font-family: "GT America";
11
+ font-weight: 300;
12
+ font-style: normal;
13
+ font-display: swap;
14
+ src: url("../fonts/gt-america-300.woff2") format("woff2");
15
+ }
16
+ @font-face {
17
+ font-family: "GT America";
18
+ font-weight: 300;
19
+ font-style: italic;
20
+ 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");
43
+ }
44
+
45
+ /* Kyoto: display. The brand's thin serif voice for headlines. */
46
+ @font-face {
47
+ font-family: "PP Kyoto";
48
+ font-weight: 100 900;
49
+ font-style: normal;
50
+ font-display: swap;
51
+ src: url("../fonts/pp-kyoto-vf.woff2") format("woff2");
52
+ }
53
+
54
+ /* Extended: the sans alternate for display, where a serif reads wrong */
55
+ @font-face {
56
+ font-family: "GT America Extended";
57
+ font-weight: 300;
58
+ font-style: normal;
59
+ 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");
82
+ }
83
+
84
+ /* Mono: figures and labels */
85
+ @font-face {
86
+ 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;
95
+ font-style: normal;
96
+ font-display: swap;
97
+ src: url("../fonts/gt-america-mono-500.woff2") format("woff2");
98
+ }
99
+
100
+ @font-face {
101
+ font-family: "GT America Fallback";
102
+ src: local("Arial");
103
+ size-adjust: 102.87%;
104
+ ascent-override: 97.7%;
105
+ descent-override: 19.44%;
106
+ line-gap-override: 0%;
107
+ }
108
+ @font-face {
109
+ font-family: "PP Kyoto Fallback";
110
+ src: local("Georgia");
111
+ size-adjust: 108.2%;
112
+ ascent-override: 97.97%;
113
+ descent-override: 31.42%;
114
+ line-gap-override: 25.88%;
115
+ }
116
+ @font-face {
117
+ font-family: "GT America Extended Fallback";
118
+ src: local("Arial");
119
+ size-adjust: 123.41%;
120
+ ascent-override: 81.43%;
121
+ descent-override: 16.21%;
122
+ line-gap-override: 0%;
123
+ }
124
+ @font-face {
125
+ font-family: "GT America Mono Fallback";
126
+ src: local("Courier New");
127
+ size-adjust: 103.32%;
128
+ ascent-override: 97.27%;
129
+ descent-override: 19.36%;
130
+ line-gap-override: 0%;
131
+ }
package/src/hue.ts ADDED
@@ -0,0 +1,17 @@
1
+ /** The hues a part can take (`data-hue`), each with its light, mid, full, deep, soft and ink. */
2
+ export const HUES = [
3
+ "pear",
4
+ "tangerine",
5
+ "pink",
6
+ "purple",
7
+ "blue",
8
+ "red",
9
+ "amber",
10
+ "green",
11
+ "teal",
12
+ "sky",
13
+ "orchid",
14
+ "slate",
15
+ ] as const;
16
+
17
+ export type Hue = (typeof HUES)[number];
package/src/icon.tsx ADDED
@@ -0,0 +1,56 @@
1
+ import {
2
+ type CentralIconBaseProps,
3
+ IconArrowRight,
4
+ IconArrowUp,
5
+ IconArrowUpRight,
6
+ IconBarsThree,
7
+ IconCheckmark1Medium,
8
+ IconCrossMedium,
9
+ IconFacebook,
10
+ IconInfinity,
11
+ IconInstagram,
12
+ IconLinkedin,
13
+ IconPhone,
14
+ IconYoutube,
15
+ } from "@central-icons-react/square-outlined-radius-0-stroke-1.5";
16
+
17
+ // The glyphs the Set draws with: Central (iconists.co), square caps and joins, outlined, radius 0,
18
+ // drawn at 1.5 and rendered at a screen pixel at every size (base.css). A part asks for a glyph
19
+ // by name, so swapping one is an edit to this map alone.
20
+ export const icons = {
21
+ "arrow-right": IconArrowRight,
22
+ "arrow-up": IconArrowUp,
23
+ "arrow-up-right": IconArrowUpRight,
24
+ check: IconCheckmark1Medium,
25
+ close: IconCrossMedium,
26
+ facebook: IconFacebook,
27
+ instagram: IconInstagram,
28
+ linkedin: IconLinkedin,
29
+ menu: IconBarsThree,
30
+ meta: IconInfinity,
31
+ phone: IconPhone,
32
+ youtube: IconYoutube,
33
+ } as const;
34
+
35
+ export type IconName = keyof typeof icons;
36
+
37
+ type Props = Omit<CentralIconBaseProps, "name"> & {
38
+ name: IconName;
39
+ /** A label makes the icon meaningful to assistive tech; without one it is decorative. */
40
+ label?: string;
41
+ };
42
+
43
+ /** A glyph, 1em square, so it scales with the text beside it. */
44
+ export function Icon({ name, label, ...props }: Props) {
45
+ const Glyph = icons[name];
46
+ return (
47
+ <Glyph
48
+ data-slot="icon"
49
+ size="1em"
50
+ aria-hidden={label ? undefined : true}
51
+ aria-label={label}
52
+ role={label ? "img" : undefined}
53
+ {...props}
54
+ />
55
+ );
56
+ }
package/src/mark.tsx ADDED
@@ -0,0 +1,14 @@
1
+ import type { CSSProperties } from "react";
2
+
3
+ /** Keystone's K on its pear tile, in the brand's own colours whatever surrounds it. */
4
+ export function Mark({ className, style }: { className?: string; style?: CSSProperties }) {
5
+ return (
6
+ <svg className={className} style={style} viewBox="0 0 32 32" role="img" aria-label="Keystone">
7
+ <rect width="32" height="32" fill="#d2d800" />
8
+ <g transform="matrix(1 0 0 0.8 8.891 7.448)" fill="#212515">
9
+ <path d="M2.451 10.658C4.737 10.658 6.591 12.975 6.591 15.834 6.591 18.693 4.737 21.01 2.451 21.011 0.163 21.011-1.691 18.693-1.691 15.834-1.691 12.975 0.163 10.658 2.451 10.658Z" />
10
+ <path d="M13.042 8.842 16.869 20.606H9.932L6.179 9.096H-1.344V-0.307H6.179V8.599L9.283-0.309 16.219-0.31 13.042 8.842Z" />
11
+ </g>
12
+ </svg>
13
+ );
14
+ }
package/src/motion.ts ADDED
@@ -0,0 +1,123 @@
1
+ import { type RefObject, useEffect, useEffectEvent, useState, useSyncExternalStore } from "react";
2
+
3
+ // Motion without a library: what the browser has (CSS, the Web Animations API, observers), and a
4
+ // few hooks that tie it to scroll and to a part coming into view.
5
+
6
+ const REDUCE = "(prefers-reduced-motion: reduce)";
7
+
8
+ function subscribeReduce(onChange: () => void) {
9
+ const query = window.matchMedia(REDUCE);
10
+ query.addEventListener("change", onChange);
11
+ return () => {
12
+ query.removeEventListener("change", onChange);
13
+ };
14
+ }
15
+
16
+ /** Whether the visitor asked for less motion. Movement is dropped; what it showed still shows. */
17
+ export function useReducedMotion(): boolean {
18
+ return useSyncExternalStore(
19
+ subscribeReduce,
20
+ () => window.matchMedia(REDUCE).matches,
21
+ () => false,
22
+ );
23
+ }
24
+
25
+ export const prefersReducedMotion = () => window.matchMedia(REDUCE).matches;
26
+
27
+ /** True once the element is in view (and, with `once: false`, false again when it leaves). */
28
+ export function useInView<T extends Element>(
29
+ ref: RefObject<T | null>,
30
+ {
31
+ once = true,
32
+ margin = "0px 0px -12% 0px",
33
+ threshold = 0,
34
+ }: { once?: boolean; margin?: string; threshold?: number } = {},
35
+ ): boolean {
36
+ const [inView, setInView] = useState(false);
37
+ useEffect(() => {
38
+ const node = ref.current;
39
+ if (!node) return;
40
+ const observer = new IntersectionObserver(
41
+ (entries) => {
42
+ const seen = entries.some((each) => each.isIntersecting);
43
+ if (seen) {
44
+ setInView(true);
45
+ if (once) observer.disconnect();
46
+ } else if (!once) {
47
+ setInView(false);
48
+ }
49
+ },
50
+ { rootMargin: margin, threshold },
51
+ );
52
+ observer.observe(node);
53
+ return () => {
54
+ observer.disconnect();
55
+ };
56
+ }, [ref, once, margin, threshold]);
57
+ return inView;
58
+ }
59
+
60
+ // One scroll listener for the page; each subscriber is told once a frame.
61
+ const listeners = new Set<() => void>();
62
+ let frame = 0;
63
+ function onScroll() {
64
+ if (frame) return;
65
+ frame = requestAnimationFrame(() => {
66
+ frame = 0;
67
+ for (const listener of listeners) listener();
68
+ });
69
+ }
70
+ function subscribeScroll(listener: () => void) {
71
+ if (listeners.size === 0) {
72
+ window.addEventListener("scroll", onScroll, { passive: true });
73
+ window.addEventListener("resize", onScroll);
74
+ }
75
+ listeners.add(listener);
76
+ return () => {
77
+ listeners.delete(listener);
78
+ if (listeners.size === 0) {
79
+ window.removeEventListener("scroll", onScroll);
80
+ window.removeEventListener("resize", onScroll);
81
+ }
82
+ };
83
+ }
84
+
85
+ const clamp01 = (n: number) => Math.min(1, Math.max(0, n));
86
+
87
+ /**
88
+ * How far the page has scrolled through an element, 0 to 1.
89
+ * - `pin`: for a tall block holding a sticky child. 0 as its top meets the window's top, 1 as its
90
+ * bottom meets the window's bottom (the whole time the child is pinned).
91
+ * - `pass`: for any block. 0 as its top enters at the window's bottom, 1 as its bottom leaves at
92
+ * the window's top.
93
+ */
94
+ export function progressOf(node: Element, mode: "pin" | "pass"): number {
95
+ const rect = node.getBoundingClientRect();
96
+ const vh = window.innerHeight;
97
+ if (mode === "pin") {
98
+ const travel = rect.height - vh;
99
+ return travel <= 0 ? (rect.top <= 0 ? 1 : 0) : clamp01(-rect.top / travel);
100
+ }
101
+ return clamp01((vh - rect.top) / (vh + rect.height));
102
+ }
103
+
104
+ /**
105
+ * Runs `onProgress` with an element's scroll progress, once a frame while the page scrolls, and
106
+ * never through React state: write a CSS variable or a style in it, so scrolling renders nothing.
107
+ */
108
+ export function useScrollProgress<T extends HTMLElement>(
109
+ ref: RefObject<T | null>,
110
+ onProgress: (progress: number, node: T) => void,
111
+ mode: "pin" | "pass" = "pin",
112
+ ) {
113
+ const tell = useEffectEvent(onProgress);
114
+ useEffect(() => {
115
+ const node = ref.current;
116
+ if (!node) return;
117
+ const read = () => {
118
+ tell(progressOf(node, mode), node);
119
+ };
120
+ read();
121
+ return subscribeScroll(read);
122
+ }, [ref, mode]);
123
+ }