@keystone-sites/marketing-design-system 1.0.4 → 1.0.5

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/index.css CHANGED
@@ -44,6 +44,7 @@
44
44
  @import "./primitives/case-study-button.css" layer(primitives);
45
45
  @import "./primitives/field.css" layer(primitives);
46
46
  @import "./primitives/slug.css" layer(primitives);
47
+ @import "./primitives/breadcrumb.css" layer(primitives);
47
48
  @import "./primitives/picture.css" layer(primitives);
48
49
  @import "./primitives/ramps.css" layer(primitives);
49
50
  @import "./primitives/closer-row.css" layer(primitives);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keystone-sites/marketing-design-system",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Keystone's marketing design system: tokens, the tick grid, type, primitives, site chrome, and the landing kit. Source-shipped CSS and TSX for Next.js consumers.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -99,6 +99,8 @@
99
99
  "./grid/field": "./grid/field.tsx",
100
100
  "./grid/gates.cjs": "./grid/gates.cjs",
101
101
  "./grid/region": "./grid/region.tsx",
102
+ "./primitives/breadcrumb.css": "./primitives/breadcrumb.css",
103
+ "./primitives/breadcrumb": "./primitives/breadcrumb.tsx",
102
104
  "./primitives/button-inline.css": "./primitives/button-inline.css",
103
105
  "./primitives/button-inline": "./primitives/button-inline.tsx",
104
106
  "./primitives/buttons.css": "./primitives/buttons.css",
@@ -0,0 +1,51 @@
1
+ /* Breadcrumb (1184:51690). Material in every band: an 8px bg/400
2
+ square, then the trail, every part 8 apart. Links hold the slug's
3
+ text/400, the separator the lightgray/600 hairline, and the current
4
+ page a step darker in text/300. */
5
+
6
+ .crumbs {
7
+ --crumbs-mark: 8px;
8
+ display: flex;
9
+ align-items: center;
10
+ gap: var(--space-md);
11
+ margin: var(--space-none);
12
+ color: var(--color-text-400);
13
+ }
14
+ .crumbs-mark {
15
+ flex: none;
16
+ width: var(--crumbs-mark);
17
+ height: var(--crumbs-mark);
18
+ background: var(--color-bg-400);
19
+ }
20
+ .crumbs-list {
21
+ display: flex;
22
+ flex-wrap: wrap;
23
+ align-items: center;
24
+ gap: var(--space-md);
25
+ min-width: 0;
26
+ margin: var(--space-none);
27
+ padding: var(--space-none);
28
+ list-style: none;
29
+ }
30
+ .crumbs-item {
31
+ display: flex;
32
+ align-items: center;
33
+ gap: var(--space-md);
34
+ }
35
+ /* The separator is paint, not text, so a screen reader reads the trail
36
+ as a list of links. */
37
+ .crumbs-item + .crumbs-item::before {
38
+ content: "/" / "";
39
+ color: var(--color-bg-600);
40
+ }
41
+ .crumbs-current {
42
+ color: var(--color-text-300);
43
+ }
44
+ .crumbs a {
45
+ color: inherit;
46
+ text-decoration: none;
47
+ }
48
+ .crumbs a:focus-visible {
49
+ outline: none;
50
+ box-shadow: 0 0 0 var(--ring-w) var(--color-bg-300);
51
+ }
@@ -0,0 +1,46 @@
1
+ /** Breadcrumb: the slug's mark before a trail of links back up the site
2
+ * (ks-MarketingSite breadcrumb 1184:51690). Material, like the slug:
3
+ * text-xs-medium at fixed px in every band. A last item without an
4
+ * `href` is the current page. Styles live in breadcrumb.css. */
5
+
6
+ export interface Crumb {
7
+ label: string;
8
+ href?: string;
9
+ }
10
+
11
+ export function Breadcrumb({
12
+ items,
13
+ label = "Breadcrumb",
14
+ className,
15
+ }: {
16
+ items: readonly Crumb[];
17
+ /** The navigation landmark's name. */
18
+ label?: string;
19
+ className?: string;
20
+ }) {
21
+ return (
22
+ <nav
23
+ className={
24
+ className
25
+ ? `type type-fixed ts-text-xs-medium crumbs ${className}`
26
+ : "type type-fixed ts-text-xs-medium crumbs"
27
+ }
28
+ aria-label={label}
29
+ >
30
+ <i className="crumbs-mark" aria-hidden="true" />
31
+ <ol className="crumbs-list">
32
+ {items.map((item, i) => (
33
+ <li key={`${i}-${item.label}`} className="crumbs-item">
34
+ {item.href ? (
35
+ <a href={item.href}>{item.label}</a>
36
+ ) : (
37
+ <span className="crumbs-current" aria-current="page">
38
+ {item.label}
39
+ </span>
40
+ )}
41
+ </li>
42
+ ))}
43
+ </ol>
44
+ </nav>
45
+ );
46
+ }
@@ -29,8 +29,9 @@
29
29
  width: calc(var(--_u) * var(--_w));
30
30
  }
31
31
 
32
- /* The box paints the band and body; the popular plan's hard shadow
33
- belongs to it, and the tag hangs from its edges beneath both. */
32
+ /* The box paints the band and body. The popular plan's hard shadow is
33
+ a layer above the tag, so where the tag hangs past the box (lg) the
34
+ shadow falls across it (1127:14285: content-wrapper over most-popular). */
34
35
  .plan-box {
35
36
  position: relative;
36
37
  isolation: isolate;
@@ -38,8 +39,13 @@
38
39
  display: flex;
39
40
  flex-direction: column;
40
41
  }
41
- .plan[data-plan="growth"] .plan-box {
42
+ .plan[data-plan="growth"] .plan-box::after {
43
+ content: "";
44
+ position: absolute;
45
+ inset: 0;
46
+ z-index: 2;
42
47
  box-shadow: var(--shadow-hard-square);
48
+ pointer-events: none;
43
49
  }
44
50
 
45
51
  /* ---- band ---- */
@@ -68,33 +74,28 @@
68
74
  --lh-rd2: var(--lh-rm);
69
75
  }
70
76
 
71
- /* Nine bordered cells; each cell draws its own line, as the design
72
- does, so interior lines are two pixels. Cells 4 and 8 are circles. */
77
+ /* The motif holds its designed footprint; the art carries the centred
78
+ stroke's extra pixel past the right and bottom edges, so every line
79
+ lands on a whole pixel. The size keyword picks the md or lg art. */
73
80
  .plan-motif {
74
81
  flex: none;
75
- display: grid;
76
- grid-template-columns: repeat(3, 1fr);
77
- grid-template-rows: repeat(3, 1fr);
78
82
  width: calc(var(--_u) * var(--_motif));
79
83
  height: calc(var(--_u) * var(--_motif));
80
84
  --_motif: 48;
81
85
  }
82
- .plan-motif i {
86
+ .plan-motif-art {
83
87
  display: block;
84
- box-sizing: border-box;
85
- border: 1px solid var(--_motif-line);
88
+ width: calc(var(--_u) * (var(--_motif) + 1));
89
+ height: calc(var(--_u) * (var(--_motif) + 1));
86
90
  }
87
- .plan-motif i:nth-child(4),
88
- .plan-motif i:nth-child(8) {
89
- border-radius: var(--radius-full);
91
+ .plan-motif-art[data-motif="lg"] {
92
+ display: none;
90
93
  }
91
- .plan[data-plan="starter"] .plan-motif i:nth-child(7),
92
- .plan[data-plan="growth"] .plan-motif i:nth-child(2),
93
- .plan[data-plan="growth"] .plan-motif i:nth-child(3),
94
- .plan[data-plan="growth"] .plan-motif i:nth-child(6),
95
- .plan[data-plan="growth"] .plan-motif i:nth-child(7),
96
- .plan[data-plan="scale"] .plan-motif i:not(:nth-child(4)):not(:nth-child(8)) {
97
- background: var(--_motif-fill);
94
+ .plan-motif-art path {
95
+ stroke: var(--_motif-line);
96
+ }
97
+ .plan-motif-art path[data-fill] {
98
+ fill: var(--_motif-fill);
98
99
  }
99
100
 
100
101
  /* ---- body ---- */
@@ -117,6 +118,11 @@
117
118
  --_offer-px: 20;
118
119
  --_offer-pb: 0;
119
120
  }
121
+ /* A tagged card pins its description clear of the tag under the band
122
+ (sm 1170:31779); md restates its own width, lg lets it run. */
123
+ .plan:has(.plan-tag) {
124
+ --_desc-w: calc(var(--_u) * 198);
125
+ }
120
126
  .plan-desc {
121
127
  margin: var(--space-none);
122
128
  color: var(--color-text-400);
@@ -226,12 +232,13 @@
226
232
  --lh-rd2: var(--lh-rm);
227
233
  }
228
234
 
229
- /* The tag hangs from the box's bottom edge (sm, lg) or the band's (md),
230
- behind the box so only its overhang shows; its 4/8 padding sits the
231
- label two pixels high, as drawn. */
235
+ /* The tag hangs from the band's bottom edge over the body (sm 1170:31803,
236
+ md 1170:31613), bevelled by its inner shadow; on lg it hangs from the
237
+ box's bottom edge beneath the popular shadow (1130:18285). Its 4/8
238
+ padding sits the label two pixels high, as drawn. */
232
239
  .plan-tag {
233
240
  position: absolute;
234
- z-index: -1;
241
+ z-index: 1;
235
242
  top: var(--_tag-top);
236
243
  right: calc(var(--_u) * var(--_tag-right));
237
244
  display: inline-flex;
@@ -242,9 +249,11 @@
242
249
  background: var(--_tag-bg);
243
250
  color: var(--color-base-white);
244
251
  border-radius: 0 0 calc(var(--_u) * 6) calc(var(--_u) * 6);
252
+ box-shadow: var(--_tag-bevel);
245
253
  white-space: nowrap;
246
- --_tag-top: 100%;
254
+ --_tag-top: calc(var(--_u) * 80);
247
255
  --_tag-right: 16;
256
+ --_tag-bevel: inset 0 calc(var(--_u) * 4) 0 0 var(--color-alpha-black-05);
248
257
  --font: var(--ts-text-xs-medium-font);
249
258
  --ls: var(--ts-text-xs-medium-ls);
250
259
  --opsz: var(--ts-text-xs-medium-opsz);
@@ -323,11 +332,18 @@
323
332
  .plan-motif {
324
333
  --_motif: 64;
325
334
  }
335
+ .plan-motif-art[data-motif="md"] {
336
+ display: none;
337
+ }
338
+ .plan-motif-art[data-motif="lg"] {
339
+ display: block;
340
+ }
326
341
  .plan-offer {
327
342
  --_offer-px: 24;
328
343
  --_offer-pb: 32;
329
344
  }
330
345
  .plan-desc {
346
+ --_desc-w: none;
331
347
  --font: var(--ts-text-lg-light-font);
332
348
  --ls: var(--ts-text-lg-light-ls);
333
349
  --opsz: var(--ts-text-lg-light-opsz);
@@ -350,6 +366,10 @@
350
366
  .plan-items {
351
367
  --_items-gap: 16;
352
368
  }
369
+ .plan-tag {
370
+ --_tag-top: 100%;
371
+ --_tag-bevel: none;
372
+ }
353
373
  }
354
374
 
355
375
  /* ---- hue table (data-plan) ---- */
@@ -17,7 +17,8 @@ export interface Plan {
17
17
  /** Shown above the list when the plan builds on another. */
18
18
  lead?: string;
19
19
  items: string[];
20
- /** Hanging tag under the card; only the popular plan has one. */
20
+ /** Tag hung under the band (sm, md) or the card (lg); only the
21
+ * popular plan has one. */
21
22
  tag?: string;
22
23
  }
23
24
 
@@ -32,9 +33,74 @@ interface PlanCardProps {
32
33
  size?: PlanCardSize;
33
34
  }
34
35
 
35
- /** 3 × 3 cells (pricing-card-motif-2, 1127:15960); the plan's CSS
36
- * table names which cells fill. Cells 4 and 8 are circles in every plan. */
37
- const MOTIF_CELLS = [1, 2, 3, 4, 5, 6, 7, 8, 9] as const;
36
+ /** pricing-card-motif-2 (1127:15960), exported from the md (1170:28997)
37
+ * and lg (1131:18463) variants; sm and md cards both mount the md
38
+ * motif. Cells run row by row; 4 and 8 are circles in every plan.
39
+ * Strokes are centred on the cell lines, so the art is one pixel wider
40
+ * than its footprint. */
41
+ const MOTIF = {
42
+ md: {
43
+ box: 49,
44
+ cells: [
45
+ "M0.5 0.5H16.5V16.5H0.5V0.5Z",
46
+ "M16.5 0.5H32.5V16.5H16.5V0.5Z",
47
+ "M32.5 0.5H48.5V16.5H32.5V0.5Z",
48
+ "M0.5 24.5C0.5 20.0817 4.08172 16.5 8.5 16.5V16.5C12.9183 16.5 16.5 20.0817 16.5 24.5V24.5C16.5 28.9183 12.9183 32.5 8.5 32.5V32.5C4.08172 32.5 0.5 28.9183 0.5 24.5V24.5Z",
49
+ "M16.5 16.5H32.5V32.5H16.5V16.5Z",
50
+ "M32.5 16.5H48.5V32.5H32.5V16.5Z",
51
+ "M0.5 32.5H16.5V48.5H0.5V32.5Z",
52
+ "M16.5 40.5C16.5 36.0817 20.0817 32.5 24.5 32.5V32.5C28.9183 32.5 32.5 36.0817 32.5 40.5V40.5C32.5 44.9183 28.9183 48.5 24.5 48.5V48.5C20.0817 48.5 16.5 44.9183 16.5 40.5V40.5Z",
53
+ "M32.5 32.5H48.5V48.5H32.5V32.5Z",
54
+ ],
55
+ },
56
+ lg: {
57
+ box: 65,
58
+ cells: [
59
+ "M0.5 0.5H21.8333V21.8333H0.5V0.5Z",
60
+ "M21.8335 0.5H43.1668V21.8333H21.8335V0.5Z",
61
+ "M43.1665 0.5H64.4998V21.8333H43.1665V0.5Z",
62
+ "M0.5 32.4999C0.5 26.6089 5.27563 21.8333 11.1667 21.8333V21.8333C17.0577 21.8333 21.8333 26.6089 21.8333 32.4999V32.4999C21.8333 38.391 17.0577 43.1666 11.1667 43.1666V43.1666C5.27563 43.1666 0.5 38.391 0.5 32.4999V32.4999Z",
63
+ "M21.8335 21.8333H43.1668V43.1666H21.8335V21.8333Z",
64
+ "M43.1665 21.8333H64.4998V43.1666H43.1665V21.8333Z",
65
+ "M0.5 43.1667H21.8333V64.5001H0.5V43.1667Z",
66
+ "M21.8335 53.8334C21.8335 47.9424 26.6091 43.1667 32.5002 43.1667V43.1667C38.3912 43.1667 43.1668 47.9424 43.1668 53.8334V53.8334C43.1668 59.7245 38.3912 64.5001 32.5002 64.5001V64.5001C26.6091 64.5001 21.8335 59.7245 21.8335 53.8334V53.8334Z",
67
+ "M43.1665 43.1667H64.4998V64.5001H43.1665V43.1667Z",
68
+ ],
69
+ },
70
+ } as const;
71
+
72
+ /** Filled cells per plan, 1-based as in the motif's `cells=` variants. */
73
+ const MOTIF_FILLED: Record<PlanId, readonly number[]> = {
74
+ starter: [7],
75
+ growth: [2, 3, 6, 7],
76
+ scale: [1, 2, 3, 5, 6, 7, 9],
77
+ };
78
+
79
+ function PlanMotif({ plan }: { plan: PlanId }) {
80
+ const filled = MOTIF_FILLED[plan];
81
+ return (
82
+ <span className="plan-motif" aria-hidden="true">
83
+ {(["md", "lg"] as const).map((size) => {
84
+ const { box, cells } = MOTIF[size];
85
+ return (
86
+ <svg
87
+ key={size}
88
+ className="plan-motif-art"
89
+ data-motif={size}
90
+ width={box}
91
+ height={box}
92
+ viewBox={`0 0 ${box} ${box}`}
93
+ fill="none"
94
+ >
95
+ {cells.map((d, i) => (
96
+ <path key={d} d={d} data-fill={filled.includes(i + 1) || undefined} />
97
+ ))}
98
+ </svg>
99
+ );
100
+ })}
101
+ </span>
102
+ );
103
+ }
38
104
 
39
105
  const CHROME: Record<Plan["id"], "gray" | "teal" | "blue"> = {
40
106
  starter: "gray",
@@ -48,11 +114,7 @@ export function PlanCard({ plan, size }: PlanCardProps) {
48
114
  <div className="plan-box">
49
115
  <header className="plan-band">
50
116
  <h3 className="type plan-name">{plan.name}</h3>
51
- <span className="plan-motif" aria-hidden="true">
52
- {MOTIF_CELLS.map((n) => (
53
- <i key={n} />
54
- ))}
55
- </span>
117
+ <PlanMotif plan={plan.id} />
56
118
  </header>
57
119
  <div className="plan-body">
58
120
  <div className="plan-offer">
@@ -15,11 +15,16 @@
15
15
  }
16
16
  .tag[data-size="md"] { --tag-size: md; }
17
17
  .tag[data-size="sm"] { --tag-size: sm; }
18
+ /* The teal chip tints a step deeper than the status ramp's teal fill
19
+ (1184:51697, color/teal/300); every other hue matches its ramp. */
20
+ .tag[data-hue="teal"] {
21
+ --_fill: var(--color-teal-300);
22
+ }
18
23
 
19
24
  /* The label sits one pixel high in its box (3 over, 4 under), as drawn. */
20
25
  .tag-body {
21
26
  display: block;
22
- padding: var(--_pt) var(--space-sm) var(--_pb);
27
+ padding: var(--_pt) var(--space-md) var(--_pb);
23
28
  }
24
29
  @container style(--tag-size: md) {
25
30
  .tag-body {