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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/README.md +47 -67
  2. package/fonts/gt-america-300-italic.woff2 +0 -0
  3. package/fonts/gt-america-300.woff2 +0 -0
  4. package/fonts/gt-america-400-italic.woff2 +0 -0
  5. package/fonts/gt-america-400.woff2 +0 -0
  6. package/fonts/gt-america-500.woff2 +0 -0
  7. package/fonts/gt-america-extended-300.woff2 +0 -0
  8. package/fonts/gt-america-extended-400.woff2 +0 -0
  9. package/fonts/gt-america-extended-500.woff2 +0 -0
  10. package/fonts/gt-america-extended-700.woff2 +0 -0
  11. package/fonts/gt-america-mono-300.woff2 +0 -0
  12. package/fonts/gt-america-mono-500.woff2 +0 -0
  13. package/fonts/pp-kyoto-vf.woff2 +0 -0
  14. package/package.json +46 -203
  15. package/src/base.css +300 -0
  16. package/src/fonts.css +131 -0
  17. package/src/hue.ts +17 -0
  18. package/src/icon.tsx +56 -0
  19. package/src/mark.tsx +14 -0
  20. package/src/motion.ts +123 -0
  21. package/src/parts/chip.css +84 -0
  22. package/src/parts/chip.tsx +40 -0
  23. package/src/parts/composer.css +195 -0
  24. package/src/parts/composer.tsx +220 -0
  25. package/src/parts/cx.ts +2 -0
  26. package/src/parts/faq.css +77 -0
  27. package/src/parts/faq.tsx +25 -0
  28. package/src/parts/footer.css +51 -0
  29. package/src/parts/footer.tsx +27 -0
  30. package/src/parts/nav.css +180 -0
  31. package/src/parts/nav.tsx +101 -0
  32. package/src/parts/photo.css +15 -0
  33. package/src/parts/photo.tsx +24 -0
  34. package/src/parts/plans.css +89 -0
  35. package/src/parts/plans.tsx +56 -0
  36. package/src/parts/prose.css +86 -0
  37. package/src/parts/prose.tsx +49 -0
  38. package/src/parts/shape.css +47 -0
  39. package/src/parts/shape.tsx +68 -0
  40. package/src/parts/split.tsx +49 -0
  41. package/src/parts/stamp.css +85 -0
  42. package/src/parts/stamp.tsx +36 -0
  43. package/src/parts/work-card.css +51 -0
  44. package/src/parts/work-card.tsx +40 -0
  45. package/src/set.css +439 -0
  46. package/src/styles.css +20 -0
  47. package/src/tokens/color.css +471 -0
  48. package/src/tokens/roles.css +12 -0
  49. package/src/tokens/type.css +11 -0
  50. package/src/wordmark.tsx +34 -0
  51. package/AGENTS.md +0 -192
  52. package/assets/media/brand/ks-lockup.svg +0 -13
  53. package/assets/media/brand/ks-logomark.svg +0 -4
  54. package/assets/media/brand/ks-wordmark-inline.svg +0 -13
  55. package/assets/media/brand/ks-wordmark.svg +0 -11
  56. package/assets/media/fonts/gt-standard-standard-vf.woff2 +0 -0
  57. package/assets/media/fonts/pp-kyoto-variable-upright-vf.woff2 +0 -0
  58. package/base.css +0 -113
  59. package/css-vars.d.ts +0 -10
  60. package/grid/engine.css +0 -367
  61. package/grid/field-hash.ts +0 -31
  62. package/grid/field.tsx +0 -48
  63. package/grid/gates.cjs +0 -35
  64. package/grid/region.tsx +0 -97
  65. package/icons.tsx +0 -1282
  66. package/index.css +0 -89
  67. package/lib/autoplay-gate.ts +0 -88
  68. package/lib/focus-trap.ts +0 -42
  69. package/lib/grader.ts +0 -123
  70. package/lib/legal-data.ts +0 -1
  71. package/lib/legal.ts +0 -41
  72. package/lib/noise.tsx +0 -114
  73. package/lib/phone.ts +0 -294
  74. package/lib/render-boundary.tsx +0 -27
  75. package/lib/scroll-lock.ts +0 -25
  76. package/lib/swipe.ts +0 -124
  77. package/lib/use-active-section.ts +0 -43
  78. package/lib/use-count-up.ts +0 -26
  79. package/lib/use-grader-search.ts +0 -143
  80. package/lib/use-popover.ts +0 -30
  81. package/lib/use-video-carousel.ts +0 -271
  82. package/media.ts +0 -558
  83. package/primitives/breadcrumb.css +0 -51
  84. package/primitives/breadcrumb.tsx +0 -46
  85. package/primitives/business-picker.css +0 -135
  86. package/primitives/business-picker.tsx +0 -298
  87. package/primitives/button-inline.css +0 -52
  88. package/primitives/button-inline.tsx +0 -38
  89. package/primitives/buttons.css +0 -551
  90. package/primitives/buttons.tsx +0 -330
  91. package/primitives/case-study-button.css +0 -71
  92. package/primitives/case-study-button.tsx +0 -28
  93. package/primitives/case-study-card.css +0 -318
  94. package/primitives/case-study-card.tsx +0 -116
  95. package/primitives/chip.css +0 -127
  96. package/primitives/chip.tsx +0 -53
  97. package/primitives/closer-row.css +0 -14
  98. package/primitives/closer-row.tsx +0 -22
  99. package/primitives/cta-row.css +0 -41
  100. package/primitives/cta-row.tsx +0 -39
  101. package/primitives/disclosure.css +0 -302
  102. package/primitives/disclosure.tsx +0 -277
  103. package/primitives/faq-question.css +0 -220
  104. package/primitives/faq-question.tsx +0 -55
  105. package/primitives/field.css +0 -279
  106. package/primitives/field.tsx +0 -376
  107. package/primitives/footer-item.css +0 -72
  108. package/primitives/footer-item.tsx +0 -42
  109. package/primitives/glyph-toggle.css +0 -62
  110. package/primitives/glyph-toggle.tsx +0 -42
  111. package/primitives/grader-menu.tsx +0 -84
  112. package/primitives/grader.css +0 -369
  113. package/primitives/grader.tsx +0 -285
  114. package/primitives/keystone-score.css +0 -156
  115. package/primitives/keystone-score.tsx +0 -204
  116. package/primitives/modal.css +0 -194
  117. package/primitives/modal.tsx +0 -204
  118. package/primitives/month-range.css +0 -80
  119. package/primitives/month-range.tsx +0 -183
  120. package/primitives/notice.css +0 -39
  121. package/primitives/notice.tsx +0 -56
  122. package/primitives/persona-card.css +0 -374
  123. package/primitives/persona-card.tsx +0 -74
  124. package/primitives/picture.css +0 -11
  125. package/primitives/picture.tsx +0 -41
  126. package/primitives/plan-card.css +0 -398
  127. package/primitives/plan-card.tsx +0 -153
  128. package/primitives/prose.css +0 -164
  129. package/primitives/prose.tsx +0 -194
  130. package/primitives/ramps.css +0 -77
  131. package/primitives/report-nav.css +0 -382
  132. package/primitives/report-nav.tsx +0 -353
  133. package/primitives/report.css +0 -601
  134. package/primitives/report.tsx +0 -357
  135. package/primitives/skeleton.css +0 -82
  136. package/primitives/skeleton.tsx +0 -56
  137. package/primitives/slider.css +0 -179
  138. package/primitives/slider.tsx +0 -69
  139. package/primitives/slug.css +0 -87
  140. package/primitives/slug.tsx +0 -37
  141. package/primitives/status.css +0 -427
  142. package/primitives/status.tsx +0 -323
  143. package/primitives/strip.css +0 -40
  144. package/primitives/surface.css +0 -88
  145. package/primitives/surface.tsx +0 -100
  146. package/primitives/table.css +0 -227
  147. package/primitives/table.tsx +0 -122
  148. package/primitives/tabs.css +0 -85
  149. package/primitives/tabs.tsx +0 -122
  150. package/primitives/tag.css +0 -46
  151. package/primitives/tag.tsx +0 -33
  152. package/primitives/text.css +0 -127
  153. package/primitives/toc.css +0 -65
  154. package/primitives/toc.tsx +0 -42
  155. package/primitives/tooltip.css +0 -56
  156. package/primitives/tooltip.tsx +0 -103
  157. package/rules/design-system.md +0 -154
  158. package/rules/grid-and-layout.md +0 -166
  159. package/scripts/generate-exports.mjs +0 -61
  160. package/scripts/generate-type-css.mjs +0 -130
  161. package/sections/faq-island.tsx +0 -102
  162. package/sections/faq.css +0 -213
  163. package/sections/faq.tsx +0 -46
  164. package/sections/footer-nav.tsx +0 -95
  165. package/sections/footer-signature.css +0 -223
  166. package/sections/footer-signature.tsx +0 -127
  167. package/sections/footer.css +0 -735
  168. package/sections/footer.tsx +0 -286
  169. package/sections/gallery-overlay.css +0 -213
  170. package/sections/gallery-overlay.tsx +0 -267
  171. package/sections/landing-benefits.css +0 -59
  172. package/sections/landing-benefits.tsx +0 -81
  173. package/sections/landing-closer.css +0 -23
  174. package/sections/landing-closer.tsx +0 -26
  175. package/sections/landing-hero.css +0 -80
  176. package/sections/landing-hero.tsx +0 -69
  177. package/sections/landing-quote.css +0 -19
  178. package/sections/landing-quote.tsx +0 -30
  179. package/sections/landing-sample.ts +0 -66
  180. package/sections/landing.css +0 -45
  181. package/sections/landing.tsx +0 -69
  182. package/sections/load-orchestrator.tsx +0 -43
  183. package/sections/load.css +0 -138
  184. package/sections/nav-desktop.css +0 -530
  185. package/sections/nav-desktop.tsx +0 -155
  186. package/sections/nav-menu.css +0 -57
  187. package/sections/nav-menu.tsx +0 -112
  188. package/sections/nav-mobile.css +0 -571
  189. package/sections/nav-mobile.tsx +0 -222
  190. package/sections/nav.css +0 -127
  191. package/sections/nav.tsx +0 -394
  192. package/sections/site-chat-data.ts +0 -16
  193. package/sections/site-chat-open.tsx +0 -25
  194. package/sections/site-chat.tsx +0 -67
  195. package/site-links.ts +0 -41
  196. package/site.ts +0 -2
  197. package/themes/inverted.css +0 -139
  198. package/tokens/fonts.css +0 -38
  199. package/tokens/motion.css +0 -150
  200. package/tokens/primitives.css +0 -163
  201. package/tokens/semantic.css +0 -159
  202. package/tokens/type-styles.json +0 -145
  203. package/tokens/type.css +0 -1548
  204. package/widgets.css +0 -78
package/grid/engine.css DELETED
@@ -1,367 +0,0 @@
1
- /* Container-query grid engine. Bands and interpolation weights read the
2
- same page-container width. `--t` is fluid structural geometry; `--c`
3
- is fixed material geometry. Literal 1px values are lattice hairlines.
4
-
5
- Bands. Five anchors where a Figma frame exists: rm 384 · rs 576 · rt 768 ·
6
- rd1 960 · rd2 1344 (tick 32 · 48 · 64 · 80 · 112). Gates open at the
7
- midpoints and are written by band name: `@container (--rs)`, `(--rt)`,
8
- `(--rd1)`, `(--rd2)` (widths live once in grid/gates.cjs), always on
9
- `.site-root`, never `@media`. Base CSS is the 384 design; each gate
10
- overrides upward. Above 1344 the tick
11
- caps and the 1344 design renders exact; gutters paint the side fields.
12
- JS that needs the band measures the container, never `matchMedia`.
13
- Light mode only.
14
-
15
- Every dimension is one of three kinds:
16
- - structure (columns, section heights, exposure regions, footprints)
17
- is written in `--t` and is fluid by construction;
18
- - type and spacing come from tokens;
19
- - material (buttons, icons, marks, control inners) is fixed px per
20
- size variant and never band-aware; the section picks the variant.
21
- A px value that secretly encodes structure breaks fit between anchors.
22
-
23
- Laws:
24
- - Flow frames. A section or text block declares its designed rows as
25
- `min-height: calc(var(--t) * k)`, never `height`; only tick blocks
26
- (k·t media frames, controls) keep `height`. Blocks stack in normal
27
- flow with `margin-top` offsets; a bottom-anchored block is
28
- `margin-top: auto`. Text wraps inside `max-width`, never `width`.
29
- A gap derived by subtraction floors with `max()` at a spacing token.
30
- - Line-inclusive boxes. A bordered box whose edge sits on the lattice
31
- is `k·t + 1px` so its border lands on the line's pixel; `k·t` exactly
32
- doubles the hairline.
33
- - Content clears the lattice: flowed content never touches a tick line
34
- and keeps half a tick before the next block; when copy needs room the
35
- frame grows and the painted lattice rides with it (`gy` anchors to the
36
- section top, `gyb` to its bottom, both to stretch).
37
- - Absolute positioning only for media fills, the exposure vocabulary
38
- (`--gx/--gy/--gyb`), overlay chrome, and true escapes from flow
39
- (viewport-fixed controls). Ordinary content is grid or flex order.
40
- - Lattice paint per section band is one of three states, declared in a
41
- comment above the region map: unpainted, bookend (paint stops one
42
- full tick before photography and resumes one tick after), or seated
43
- (cells are the grid). A line painted through off-grid media is a defect.
44
- - Nothing overflows at 384; touch targets are 44px; no hover-only states.
45
-
46
- `npm run test:visual` shoots every route at every anchor and gate. */
47
-
48
- /* The container reads content width so anchors stay pixel-exact with scrollbars. */
49
- .site-root {
50
- container-type: inline-size;
51
- }
52
-
53
- /* ---- tick, cell, line, and per-band interpolation weights ---- */
54
-
55
- .page {
56
- position: relative;
57
- /* Keeps the negative-z side field above the page background. */
58
- isolation: isolate;
59
- /* The tick caps at 112px so wide layouts preserve the 1344 anchor. */
60
- --t: min(calc(100cqw / 12), 112px);
61
- --c: var(--space-xl);
62
- --line: var(--color-border-000);
63
-
64
- /* Whole-pixel centering prevents fuzzy lattice lines at 1× DPR. */
65
- --page-x: max(0px, round(down, calc((100cqw - 1344px) / 2), 1px));
66
- width: calc(12 * var(--t));
67
- margin-left: var(--page-x);
68
-
69
- /* The base band interpolates 384→576 and extrapolates below 384. */
70
- --wA: calc((48px - var(--t)) / 16);
71
- --wB: calc((var(--t) - 32px) / 16);
72
- /* Type multiplies these px weights by its unitless design sizes
73
- directly (primitives/text.css); no unit-stripping trig, which iOS
74
- Safari has resolved wrongly. */
75
- }
76
-
77
- /* Midpoint gates select the nearest anchor. Compressed slices zoom type
78
- and containers together so wraps and clearances remain stable. */
79
-
80
- @container (--rs) {
81
- .page {
82
- /* compressed rs: the 576 design zooming down */
83
- --wA: calc(var(--t) / 48);
84
- --wB: 0px;
85
- }
86
- }
87
- @container (min-width: 576px) {
88
- .page {
89
- --wA: calc((64px - var(--t)) / 16);
90
- --wB: calc((var(--t) - 48px) / 16);
91
- }
92
- }
93
-
94
- @container (--rt) {
95
- .page {
96
- /* compressed rt: the 768 design zooming down */
97
- --wA: calc(var(--t) / 64);
98
- --wB: 0px;
99
- }
100
- }
101
- @container (min-width: 768px) {
102
- .page {
103
- --wA: calc((80px - var(--t)) / 16);
104
- --wB: calc((var(--t) - 64px) / 16);
105
- }
106
- }
107
-
108
- @container (--rd1) {
109
- .page {
110
- /* compressed rd1: the 960 design zooming down */
111
- --wA: calc(var(--t) / 80);
112
- --wB: 0px;
113
- }
114
- }
115
- @container (min-width: 960px) {
116
- .page {
117
- --wA: calc((112px - var(--t)) / 32);
118
- --wB: calc((var(--t) - 80px) / 32);
119
- }
120
- }
121
-
122
- @container (--rd2) {
123
- .page {
124
- /* One rule covers the compressed slice, anchor, and capped wide range. */
125
- --wA: 0px;
126
- --wB: calc(var(--t) / 112);
127
- }
128
- }
129
-
130
- /* ---- page skeleton ---- */
131
-
132
- /* isolation is load-bearing: it gives each section its own stacking
133
- context so the overlay can sit at z-index -1 inside the section —
134
- above the page background, below all flow content. */
135
- .sec {
136
- position: relative;
137
- isolation: isolate;
138
- display: flex;
139
- flex-direction: column;
140
- align-items: flex-start;
141
- }
142
-
143
- /* Flow budget: a block that owns its designed rows (`--budget`, a
144
- length in ticks) and grows past them only when its content does. The
145
- trailing half tick keeps overgrown content clear of the next block;
146
- inside the budget it is slack. Sections stack flow-budget blocks and
147
- tick blocks (fixed `k·t` media frames) in normal flow, so an anchor
148
- renders the designed rows exactly and a narrower or taller-wrapping
149
- render pushes later blocks down instead of colliding. */
150
- .flow-budget {
151
- position: relative;
152
- box-sizing: border-box;
153
- min-height: var(--budget);
154
- padding-bottom: calc(var(--t) / 2);
155
- }
156
-
157
- /* ---- selective exposure overlay ---- */
158
-
159
- .gx {
160
- position: absolute;
161
- inset: 0;
162
- z-index: -1;
163
- pointer-events: none;
164
- }
165
-
166
- /* Exposure region: outer rectangle drawn by its own border, sized
167
- line-inclusively (k·t + 1px) so the far border lands on the same pixel
168
- as the next lattice line. Interior lines are real 1px children at
169
- k·t − 1px offsets — same pixel geometry as the border (children measure
170
- from the padding box, inside the 1px border). */
171
- .grid-region {
172
- position: absolute;
173
- border: 1px solid var(--line);
174
- left: calc(var(--t) * var(--gx));
175
- top: calc(var(--t) * var(--gy));
176
- width: calc(var(--t) * var(--gw) + 1px);
177
- height: calc(var(--t) * var(--gh) + 1px);
178
- }
179
- .grid-region i {
180
- position: absolute;
181
- background: var(--line);
182
- }
183
- .grid-region i.v {
184
- top: 0;
185
- bottom: 0;
186
- width: 1px;
187
- left: calc(var(--t) * var(--n) - 1px);
188
- }
189
- .grid-region i.h {
190
- left: 0;
191
- right: 0;
192
- height: 1px;
193
- top: calc(var(--t) * var(--n) - 1px);
194
- }
195
-
196
- /* Bottom-anchored region: `--gyb` rows count up from the section's
197
- bottom edge, minus the line-inclusive pixel, so the exposure follows a
198
- flow section that grows with its copy. */
199
- .grid-region.gb {
200
- top: auto;
201
- bottom: calc(var(--t) * var(--gyb) - 1px);
202
- }
203
- /* Stretched region: both edges set, height follows the section, and
204
- interior rows past the grown height are clipped. */
205
- .grid-region.gs {
206
- bottom: calc(var(--t) * var(--gyb) - 1px);
207
- height: auto;
208
- overflow: hidden;
209
- }
210
-
211
- /* Ornament shapes: filled squares use bg/200, circles add radius, and
212
- outlined circles omit the fill. */
213
- .f-cell {
214
- display: block;
215
- width: 100%;
216
- height: 100%;
217
- box-sizing: border-box;
218
- border: 1px solid var(--line);
219
- }
220
- .f-cell.fill {
221
- background: var(--color-bg-200);
222
- }
223
- .f-cell.round {
224
- border-radius: var(--radius-full);
225
- }
226
-
227
- /* Ornament cell: paints between lattice and content (z-index 0 inside the
228
- isolated section), never intercepts the pointer. */
229
- .decor {
230
- position: absolute;
231
- z-index: 0;
232
- pointer-events: none;
233
- display: grid;
234
- place-items: center;
235
- left: calc(var(--t) * var(--gx));
236
- top: calc(var(--t) * var(--gy));
237
- width: calc(var(--t) + 1px);
238
- height: calc(var(--t) + 1px);
239
- }
240
- .decor.gb {
241
- top: auto;
242
- bottom: calc(var(--t) * var(--gyb) - 1px);
243
- }
244
-
245
- /* ---- wide-viewport side fields ---- */
246
-
247
- /* The field spans wide gutters behind sections and clips partial outer
248
- columns. Dedicated classes keep it outside region animations. */
249
- .gfield {
250
- position: absolute;
251
- top: 0;
252
- bottom: 0;
253
- left: calc(0px - var(--page-x));
254
- width: 100cqw;
255
- z-index: -1;
256
- pointer-events: none;
257
- overflow: clip;
258
- display: none;
259
- }
260
- @container (min-width: 1345px) {
261
- .gfield {
262
- display: block;
263
- }
264
- }
265
-
266
- /* Strips stretch with the page; inner borders share the page edge pixels. */
267
- .gf-strip {
268
- position: absolute;
269
- top: 0;
270
- bottom: 0;
271
- box-sizing: border-box;
272
- width: calc(12 * var(--t) + 1px);
273
- border: 1px solid var(--line);
274
- }
275
- .gf-strip.gf-w {
276
- right: calc(100% - var(--page-x) - 1px);
277
- }
278
- .gf-strip.gf-e {
279
- left: calc(var(--page-x) + 12 * var(--t));
280
- }
281
- .gf-strip i {
282
- position: absolute;
283
- background: var(--line);
284
- }
285
- .gf-strip i.v {
286
- top: 0;
287
- bottom: 0;
288
- width: 1px;
289
- left: calc(var(--t) * var(--n) - 1px);
290
- }
291
- .gf-strip i.h {
292
- left: 0;
293
- right: 0;
294
- height: 1px;
295
- top: calc(var(--t) * var(--n) - 1px);
296
- }
297
-
298
- /* A populated field cell: the .decor geometry, hosting the standing
299
- .f-cell ornament shapes — its own class so no choreography or audit
300
- selector ever collects it. */
301
- .gf-cell {
302
- position: absolute;
303
- pointer-events: none;
304
- display: grid;
305
- place-items: center;
306
- left: calc(var(--t) * var(--gx));
307
- top: calc(var(--t) * var(--gy));
308
- width: calc(var(--t) + 1px);
309
- height: calc(var(--t) + 1px);
310
- }
311
- .decor.gb {
312
- top: auto;
313
- bottom: calc(var(--t) * var(--gyb) - 1px);
314
- }
315
-
316
- /* ---- band gating: rm (base) · rs · rt · rd1 · rd2 ---- */
317
- /* Exactly one band class is visible at any width. */
318
-
319
- .rs,
320
- .rt,
321
- .rd1,
322
- .rd2 {
323
- display: none;
324
- }
325
- @container (--rs) {
326
- .rm { display: none; }
327
- .rs { display: block; }
328
- }
329
- @container (--rt) {
330
- .rs { display: none; }
331
- .rt { display: block; }
332
- }
333
- @container (--rd1) {
334
- .rt { display: none; }
335
- .rd1 { display: block; }
336
- }
337
- @container (--rd2) {
338
- .rd1 { display: none; }
339
- .rd2 { display: block; }
340
- }
341
-
342
- /* Compound gating for .decor: the .decor
343
- display:grid above outranks the generic band gating by order, so decors
344
- carry their own. Any absolutely-positioned vocabulary added after the
345
- generic gating rules needs the same treatment. */
346
- .decor.rs,
347
- .decor.rt,
348
- .decor.rd1,
349
- .decor.rd2 {
350
- display: none;
351
- }
352
- @container (--rs) {
353
- .decor.rm { display: none; }
354
- .decor.rs { display: grid; }
355
- }
356
- @container (--rt) {
357
- .decor.rs { display: none; }
358
- .decor.rt { display: grid; }
359
- }
360
- @container (--rd1) {
361
- .decor.rt { display: none; }
362
- .decor.rd1 { display: grid; }
363
- }
364
- @container (--rd2) {
365
- .decor.rd1 { display: none; }
366
- .decor.rd2 { display: grid; }
367
- }
@@ -1,31 +0,0 @@
1
- /** A coordinate-only hash keeps side-field ornaments deterministic across
2
- * server renders and viewport growth. Density is 4%; shapes follow a
3
- * 2:1:1 outlined-circle, filled-square, filled-circle mix. */
4
-
5
- /** Rendered columns per strip: covers gutters up to 12 whole cells a
6
- * side (a 4032px container at the 112px capped tick); wider viewports
7
- * show paper past the strip. */
8
- export const FIELD_COLS = 12;
9
-
10
- /** Rendered rows per strip: covers the tallest rd2 page (the 74t case
11
- * study) plus drawer growth, clipped to the live page height. A page
12
- * outgrowing this fails the devtools' field-coverage check loudly. */
13
- export const FIELD_ROWS = 96;
14
-
15
- /** 1 = west strip · 2 = east strip. */
16
- export type FieldSide = 1 | 2;
17
-
18
- /** The `.f-cell` class list for the ornament at (side, col, row), or
19
- * null for the (common) empty cell. `col` counts outward from the page
20
- * edge (1 = adjacent); `row` is the zero-based global page row. */
21
- export function fieldCellClass(side: FieldSide, col: number, row: number): string | null {
22
- let h =
23
- (Math.imul(col, 0x9e3779b1) ^ Math.imul(row, 0x85ebca6b) ^ Math.imul(side, 0xc2b2ae35)) >>> 0;
24
- h = Math.imul(h ^ (h >>> 15), 0x27d4eb2f) >>> 0;
25
- h = (h ^ (h >>> 15)) >>> 0;
26
- const v = h % 1000;
27
- if (v >= 40) return null;
28
- const s = v % 4;
29
- // 0,1 → outlined circle · 2 → filled square · 3 → filled circle
30
- return s === 2 ? "f-cell fill" : s === 3 ? "f-cell fill round" : "f-cell round";
31
- }
package/grid/field.tsx DELETED
@@ -1,48 +0,0 @@
1
- /** Wide viewports paint deterministic lattice fields in the side gutters.
2
- * Their dedicated classes keep page-wide region animations from catching
3
- * them. Real 1px lines remain in global page phase as the page grows. */
4
-
5
- import { FIELD_COLS, FIELD_ROWS, fieldCellClass, type FieldSide } from "./field-hash";
6
-
7
- function Strip({ side }: { side: FieldSide }) {
8
- const lines = [];
9
- for (let n = 1; n < FIELD_COLS; n++) {
10
- lines.push(<i key={`v${n}`} className="v" style={{ "--n": n }} />);
11
- }
12
- for (let n = 1; n < FIELD_ROWS; n++) {
13
- lines.push(<i key={`h${n}`} className="h" style={{ "--n": n }} />);
14
- }
15
-
16
- const cells = [];
17
- for (let col = 1; col <= FIELD_COLS; col++) {
18
- for (let row = 0; row < FIELD_ROWS; row++) {
19
- const shape = fieldCellClass(side, col, row);
20
- if (!shape) continue;
21
- // strip-local column: outward col 1 is the cell adjacent to the
22
- // page edge — rightmost in the west strip, leftmost in the east
23
- const gx = side === 1 ? FIELD_COLS - col : col - 1;
24
- cells.push(
25
- <div key={`c${col}-${row}`} className="gf-cell" style={{ "--gx": gx, "--gy": row }}>
26
- <span className={shape} />
27
- </div>,
28
- );
29
- }
30
- }
31
-
32
- return (
33
- <div className={`gf-strip ${side === 1 ? "gf-w" : "gf-e"}`}>
34
- {lines}
35
- {cells}
36
- </div>
37
- );
38
- }
39
-
40
- /** Mounted before each page's sections. */
41
- export function GridField() {
42
- return (
43
- <div className="gfield" aria-hidden="true">
44
- <Strip side={1} />
45
- <Strip side={2} />
46
- </div>
47
- );
48
- }
package/grid/gates.cjs DELETED
@@ -1,35 +0,0 @@
1
- /** The band gates, named once. `@container (--rt)` in any stylesheet becomes
2
- * `@container (min-width: 665px)` at build time; container queries cannot
3
- * read custom properties, so this is the one preprocessing step in the
4
- * cascade. Wired in postcss.config.mjs. Bands: rm 384 · rs 576 · rt 768 ·
5
- * rd1 960 · rd2 1344; a gate is the midpoint that opens the next band. */
6
-
7
- const GATES = {
8
- rs: "(min-width: 470px)",
9
- rt: "(min-width: 665px)",
10
- rd1: "(min-width: 860px)",
11
- rd2: "(min-width: 1130px)",
12
- /* Compound gates are parenthesised so they compose: `(--rt-only) or (--rd2)`. */
13
- "rt-only": "((min-width: 665px) and (max-width: 859.98px))",
14
- "rd1-only": "((min-width: 860px) and (max-width: 1129.98px))",
15
- "below-rs": "(max-width: 469px)",
16
- "below-rt": "(max-width: 664px)",
17
- "below-rd1": "(max-width: 859px)",
18
- };
19
-
20
- const plugin = () => ({
21
- postcssPlugin: "keystone-gates",
22
- AtRule: {
23
- container(rule) {
24
- rule.params = rule.params.replace(/\(--([\w-]+)\)/g, (match, name) => {
25
- const gate = GATES[name];
26
- if (!gate) throw rule.error(`Unknown gate ${match}; see design-system/grid/gates.cjs`);
27
- return gate;
28
- });
29
- },
30
- },
31
- });
32
- plugin.postcss = true;
33
-
34
- module.exports = plugin;
35
- module.exports.GATES = GATES;
package/grid/region.tsx DELETED
@@ -1,97 +0,0 @@
1
- /** Server-safe exposure regions. Real 1px lattice lines render before
2
- * hydration. Geometry uses ticks; `gy` counts rows from the section top,
3
- * `gyb` counts rows from the section bottom, and `band` gates
4
- * visibility. A region with both edges stretches between them so the
5
- * exposure follows a flow section that grows with its copy. */
6
-
7
- import type { CSSProperties } from "react";
8
-
9
- export type GridBand = "rm" | "rs" | "rt" | "rd1" | "rd2";
10
-
11
- /* Interior rows drawn past a stretched region's designed rows; the
12
- region clips whatever its grown height does not reach. */
13
- const STRETCH_SLACK_ROWS = 16;
14
-
15
- interface RegionGeometry {
16
- band: GridBand;
17
- gx: number;
18
- /** Rows from the section top to the region's top edge. */
19
- gy?: number;
20
- /** Rows from the section bottom to the region's bottom edge. */
21
- gyb?: number;
22
- gw?: number;
23
- /** Designed rows; a stretched region uses it only for its line count. */
24
- gh?: number;
25
- }
26
-
27
- interface GridRegionProps extends RegionGeometry {
28
- className?: string;
29
- }
30
-
31
- type Anchor = "top" | "bottom" | "stretch";
32
-
33
- function anchorOf(gy: number | undefined, gyb: number | undefined): Anchor {
34
- if (gy !== undefined && gyb !== undefined) return "stretch";
35
- if (gyb !== undefined) return "bottom";
36
- return "top";
37
- }
38
-
39
- const ANCHOR_CLASS: Record<Anchor, string> = { top: "", bottom: " gb", stretch: " gs" };
40
-
41
- function geometryStyle({ gx, gy, gyb, gw, gh }: Omit<RegionGeometry, "band">): CSSProperties {
42
- return {
43
- "--gx": gx,
44
- ...(gy !== undefined && { "--gy": gy }),
45
- ...(gyb !== undefined && { "--gyb": gyb }),
46
- ...(gw !== undefined && { "--gw": gw }),
47
- ...(gh !== undefined && { "--gh": gh }),
48
- };
49
- }
50
-
51
- /** Exposure region: bordered rectangle plus its interior lattice lines. */
52
- export function GridRegion({ band, gx, gy, gyb, gw = 1, gh = 1, className }: GridRegionProps) {
53
- const anchor = anchorOf(gy, gyb);
54
- const rows = anchor === "stretch" ? gh + STRETCH_SLACK_ROWS : gh;
55
- const lines = [];
56
- for (let n = 1; n < gw; n++) {
57
- lines.push(<i key={`v${n}`} className="v" style={{ "--n": n }} />);
58
- }
59
- for (let n = 1; n < rows; n++) {
60
- lines.push(<i key={`h${n}`} className="h" style={{ "--n": n }} />);
61
- }
62
- const geometry =
63
- anchor === "stretch"
64
- ? { gx, gy, gyb, gw }
65
- : anchor === "bottom"
66
- ? { gx, gyb, gw, gh }
67
- : { gx, gy: gy ?? 0, gw, gh };
68
- return (
69
- <div
70
- className={`grid-region ${band}${ANCHOR_CLASS[anchor]}${className ? ` ${className}` : ""}`}
71
- style={geometryStyle(geometry)}
72
- >
73
- {lines}
74
- </div>
75
- );
76
- }
77
-
78
- /** Ornament cell: hosts decoration between lattice and content. Set
79
- * `gy` to count from the section top or `gyb` from its bottom. */
80
- export function GridDecor({
81
- band,
82
- gx,
83
- gy,
84
- gyb,
85
- children,
86
- }: Pick<RegionGeometry, "band" | "gx" | "gy" | "gyb"> & { children?: React.ReactNode }) {
87
- const fromBottom = gyb !== undefined;
88
- return (
89
- <div
90
- className={`decor ${band}${fromBottom ? " gb" : ""}`}
91
- style={geometryStyle(fromBottom ? { gx, gyb } : { gx, gy: gy ?? 0 })}
92
- aria-hidden="true"
93
- >
94
- {children}
95
- </div>
96
- );
97
- }