baseline-foundry 0.1.4 → 0.1.6

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 (82) hide show
  1. package/README.md +17 -9
  2. package/config/experiments/ibm-plex-engine-smoke.json +1 -1
  3. package/config/experiments/ubuntu-engine-smoke.json +1 -1
  4. package/config/foundation-theme.json +1 -1
  5. package/config/tiers/app.json +6 -6
  6. package/config/tiers/documentation.json +2 -2
  7. package/config/tiers/editorial.json +1 -1
  8. package/config/tiers/os.json +6 -6
  9. package/dist/baseline-grid-overlay.js +2 -2
  10. package/dist/build.js +4 -4
  11. package/dist/code-snippet.js +1 -1
  12. package/dist/css-app-tier.js +16 -5
  13. package/dist/css-components/article-pagination.js +9 -8
  14. package/dist/css-components/button-actions.js +24 -4
  15. package/dist/css-components/cards-options.js +8 -8
  16. package/dist/css-components/chip-badge-status.d.ts +0 -3
  17. package/dist/css-components/chip-badge-status.js +57 -10
  18. package/dist/css-components/content-card.d.ts +7 -7
  19. package/dist/css-components/content-card.js +17 -16
  20. package/dist/css-components/control-row.d.ts +1 -1
  21. package/dist/css-components/control-row.js +1 -1
  22. package/dist/css-components/document-navigation.js +66 -29
  23. package/dist/css-components/editorial-content.js +1 -1
  24. package/dist/css-components/interactive-feedback.js +50 -28
  25. package/dist/css-components/interactive-tables.js +13 -8
  26. package/dist/css-components/legacy-navigation.d.ts +0 -1
  27. package/dist/css-components/legacy-navigation.js +108 -32
  28. package/dist/css-components/linked-logo-site-layout.d.ts +3 -3
  29. package/dist/css-components/linked-logo-site-layout.js +17 -20
  30. package/dist/css-components/list-tree.js +21 -19
  31. package/dist/css-components/list.js +9 -7
  32. package/dist/css-components/logo-media.d.ts +6 -6
  33. package/dist/css-components/logo-media.js +38 -27
  34. package/dist/css-components/navigation-layout.js +6 -8
  35. package/dist/css-components/panel.js +12 -12
  36. package/dist/css-components/search-box-and-filter.d.ts +0 -1
  37. package/dist/css-components/search-box-and-filter.js +18 -19
  38. package/dist/css-components/sites-editorial-ports.d.ts +3 -4
  39. package/dist/css-components/sites-editorial-ports.js +61 -29
  40. package/dist/css-components/sites-foundation.js +15 -19
  41. package/dist/css-components/sites-rich-lists.d.ts +5 -5
  42. package/dist/css-components/sites-rich-lists.js +26 -36
  43. package/dist/css-components/static-content-ports.d.ts +3 -3
  44. package/dist/css-components/static-content-ports.js +51 -37
  45. package/dist/css-components/tab-section.d.ts +3 -3
  46. package/dist/css-components/tab-section.js +34 -26
  47. package/dist/css-components/table.js +4 -7
  48. package/dist/css-components/tabs-choice-breadcrumbs.js +25 -21
  49. package/dist/css-components/tiered-list-equal-height-row.js +10 -10
  50. package/dist/css-components.js +243 -124
  51. package/dist/css-grid.d.ts +1 -1
  52. package/dist/css-grid.js +18 -8
  53. package/dist/css.js +94 -18
  54. package/dist/experiments/ibm-plex-engine-smoke/styles.css +1005 -563
  55. package/dist/experiments/ibm-plex-engine-smoke/surfaces.json +2 -2
  56. package/dist/experiments/ibm-plex-engine-smoke/tokens.json +1 -1
  57. package/dist/in-page-navigation.js +1 -1
  58. package/dist/presets/app-tier/styles.css +1046 -593
  59. package/dist/presets/app-tier/surfaces.json +17 -17
  60. package/dist/presets/app-tier/tokens.json +7 -7
  61. package/dist/presets/prose/styles.css +1036 -587
  62. package/dist/presets/prose/surfaces.json +17 -17
  63. package/dist/presets/prose/tokens.json +1 -1
  64. package/dist/resizable-aside.js +12 -4
  65. package/dist/styles.css +1036 -587
  66. package/dist/surfaces.json +17 -17
  67. package/dist/tiers/app/styles.css +1046 -593
  68. package/dist/tiers/app/surfaces.json +17 -17
  69. package/dist/tiers/app/tokens.json +7 -7
  70. package/dist/tiers/documentation/styles.css +1037 -588
  71. package/dist/tiers/documentation/surfaces.json +17 -17
  72. package/dist/tiers/documentation/tokens.json +2 -2
  73. package/dist/tiers/editorial/styles.css +1036 -587
  74. package/dist/tiers/editorial/surfaces.json +17 -17
  75. package/dist/tiers/editorial/tokens.json +1 -1
  76. package/dist/tiers/os/styles.css +1042 -593
  77. package/dist/tiers/os/surfaces.json +17 -17
  78. package/dist/tiers/os/tokens.json +7 -7
  79. package/dist/tokens.json +1 -1
  80. package/dist/types.d.ts +1 -1
  81. package/docs/publishing.md +1 -1
  82. package/package.json +2 -2
@@ -1 +1 @@
1
- export declare function gridCss(): string;
1
+ export declare function gridCss(appScopes?: string[]): string;
package/dist/css-grid.js CHANGED
@@ -1,13 +1,18 @@
1
- export function gridCss() {
1
+ export function gridCss(appScopes = [":where(.bf-theme.bf-tier-app)"]) {
2
2
  const spanRule = (span, indent = "") => `${indent}:where(.bf-theme) :where(.bf-grid) > :where(.bf-span-${span}) { grid-column: auto / span ${span}; }`;
3
+ const appPageSelectors = appScopes.map(scope => `${scope} :where(.bf-page)`).join(",\n");
4
+ const appGutterSelectors = [...new Set([...appScopes, ":where(.bf-theme.bf-tier-app)"])].join(",\n ");
5
+ const appPageRule = appPageSelectors
6
+ ? `${appPageSelectors} {\n max-inline-size: none;\n}`
7
+ : "";
3
8
  const baseSpans = [1, 2, 4].map(span => spanRule(span)).join("\n");
4
9
  const mediumSpans = [1, 2, 4, 8].map(span => spanRule(span, " ")).join("\n");
5
10
  const largeSpans = [1, 2, 4, 8, 16].map(span => spanRule(span, " ")).join("\n");
6
11
  return `/* ------------------------------------------------------------------ */
7
12
  /* Gutter and margin escalation — viewport-based, all tiers */
8
13
  /* Grid spec v0.3 §2.3: gutters set by global viewport breakpoint. */
9
- /* Baseline Foundry models the spec's 460px x-small row as part of the */
10
- /* default <620px bracket because the values do not change at 460px. */
14
+ /* Baseline Foundry models the spec's 28.75rem x-small row as part of the */
15
+ /* default <38.75rem bracket because the values do not change at 28.75rem. */
11
16
  /* ------------------------------------------------------------------ */
12
17
 
13
18
  :where(.bf-theme) {
@@ -31,7 +36,7 @@ export function gridCss() {
31
36
  --bf-page-margin: 2rem;
32
37
  }
33
38
 
34
- :where(.bf-theme.bf-tier-app) {
39
+ ${appGutterSelectors} {
35
40
  --bf-grid-gap-inline: 1.5rem;
36
41
  --bf-grid-gap-block: 1.5rem;
37
42
  }
@@ -78,9 +83,7 @@ export function gridCss() {
78
83
  margin-inline-start: 0;
79
84
  }
80
85
 
81
- :where(.bf-theme.bf-tier-app) :where(.bf-page) {
82
- max-inline-size: none;
83
- }
86
+ ${appPageRule}
84
87
 
85
88
  :where(.bf-theme) :where(.bf-panel-content, .bf-accordion-panel) :where(.bf-fixed-width) {
86
89
  padding-inline: 0;
@@ -90,6 +93,13 @@ export function gridCss() {
90
93
  padding-inline: 0;
91
94
  }
92
95
 
96
+ /* A page is the outer grid row and therefore owns its horizontal gutter.
97
+ * Fixed-width regions nested anywhere inside it retain their cap and
98
+ * centering behavior without introducing a second page inset. */
99
+ :where(.bf-theme) :where(.bf-page) :where(.bf-fixed-width) {
100
+ padding-inline: 0;
101
+ }
102
+
93
103
  /* ------------------------------------------------------------------ */
94
104
  /* Grid base — 4 columns, all tiers */
95
105
  /* ------------------------------------------------------------------ */
@@ -111,7 +121,7 @@ export function gridCss() {
111
121
 
112
122
  :where(.bf-theme) :where(.bf-grid.is-guide) > * {
113
123
  background: color-mix(in srgb, var(--bf-color-accent) 18%, var(--bf-color-background-default));
114
- box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bf-color-accent) 50%, var(--bf-color-rule));
124
+ box-shadow: inset 0 0 0 0.0625rem color-mix(in srgb, var(--bf-color-accent) 50%, var(--bf-color-rule));
115
125
  min-block-size: calc(var(--bf-baseline) * 4);
116
126
  }
117
127
 
package/dist/css.js CHANGED
@@ -148,6 +148,20 @@ export function generateFoundryCss(tokens, options = {}) {
148
148
  const roleRules = Object.entries(tokens.roles)
149
149
  .map(([roleName, token]) => textRule(roleName, selectorsForRole(roleName), token, baselineUnit, EXTRA_STYLES_BY_ROLE[roleName] ?? ""))
150
150
  .join("\n");
151
+ const semanticMetricFlushSelectors = Object.keys(tokens.roles).flatMap(roleName => {
152
+ if (roleName === "body")
153
+ return ["p"];
154
+ if (/^h[1-6]$/.test(roleName))
155
+ return [roleName];
156
+ if (roleName === "meta")
157
+ return ["figcaption"];
158
+ return [];
159
+ });
160
+ const metricFlushTextSelectors = [...new Set([
161
+ "blockquote",
162
+ ...semanticMetricFlushSelectors,
163
+ ...Object.keys(tokens.roles).map(roleName => `.bf-${roleName}`)
164
+ ])].join(", ");
151
165
  const capEngineDemo = `/* DEMO ONLY — Cap-derived nudges are unreliable (ascender ≠ cap height).\n The approximation (line-height + 1cap) / 2 drifts at larger sizes.\n Kept as a reference for why metrics-derived nudges are used instead. */\n` +
152
166
  Object.entries(tokens.roles)
153
167
  .map(([roleName, token]) => capEngineDemoRule(selectorsForRole(roleName), token))
@@ -210,7 +224,7 @@ ${generateBaselineGridThemeOverrideCss()}
210
224
  :where(.bf-theme) :where(a) {
211
225
  color: var(--bf-color-link);
212
226
  text-decoration: none;
213
- text-decoration-thickness: 1px;
227
+ text-decoration-thickness: 0.0625rem;
214
228
  text-underline-offset: 0.12em;
215
229
  }
216
230
 
@@ -223,8 +237,22 @@ ${generateBaselineGridThemeOverrideCss()}
223
237
  }
224
238
 
225
239
  :where(.bf-theme) :where(a:focus-visible) {
226
- outline: 2px solid var(--bf-color-focus);
227
- outline-offset: 2px;
240
+ outline: 0.125rem solid var(--bf-color-focus);
241
+ outline-offset: 0.125rem;
242
+ }
243
+
244
+ /* Standalone anchors need the same metric-owned text box as adjacent body
245
+ * controls. Raw anchors remain inline so prose links still participate in the
246
+ * surrounding line box. */
247
+ :where(.bf-theme) :where(a.bf-text-link) {
248
+ display: inline-block;
249
+ font-family: var(--bf-body-font-family);
250
+ font-size: var(--bf-body-font-size);
251
+ font-style: var(--bf-body-font-style);
252
+ font-weight: var(--bf-body-font-weight);
253
+ line-height: var(--bf-body-line-height);
254
+ margin-block: 0 var(--bf-body-margin-bottom);
255
+ padding-block: var(--bf-body-nudge-start) 0;
228
256
  }
229
257
 
230
258
  :where(.bf-theme) :where(code) {
@@ -235,7 +263,7 @@ ${generateBaselineGridThemeOverrideCss()}
235
263
  :where(.bf-theme) :where(.bf-page) {
236
264
  margin-inline: auto;
237
265
  max-inline-size: var(--bf-content-max-width);
238
- padding-inline: max(var(--bf-page-margin), var(--bf-content-padding-inline));
266
+ padding-inline: var(--bf-page-margin);
239
267
  }
240
268
 
241
269
  :where(.bf-theme) :where(.bf-page.is-fill) {
@@ -318,7 +346,14 @@ ${generateBaselineGridThemeOverrideCss()}
318
346
  }
319
347
 
320
348
  :where(.bf-theme) :where(.bf-stack.is-flush) {
321
- --bf-stack-space: 0px;
349
+ --bf-stack-space: 0rem;
350
+ }
351
+
352
+ /* A metric-flush stack is an explicit relationship between adjacent text
353
+ * roles. It retains the outer role nudges while cancelling only the preceding
354
+ * end compensation and following start nudge; no guessed negative gap is used. */
355
+ :where(.bf-theme) :where(.bf-stack.is-metric-flush) {
356
+ --bf-stack-space: 0rem;
322
357
  }
323
358
 
324
359
  :where(.bf-theme) :where(.bf-stack.is-extra-dense) {
@@ -346,10 +381,19 @@ ${generateBaselineGridThemeOverrideCss()}
346
381
  }
347
382
 
348
383
  :where(.bf-theme) :where(.bf-cluster) {
384
+ --bf-cluster-space: var(--bf-space-2);
349
385
  align-items: flex-start;
350
386
  display: flex;
351
387
  flex-wrap: wrap;
352
- gap: var(--bf-space-2);
388
+ gap: var(--bf-cluster-space);
389
+ }
390
+
391
+ :where(.bf-theme) :where(.bf-cluster.is-dense) {
392
+ --bf-cluster-space: var(--bf-space-1);
393
+ }
394
+
395
+ :where(.bf-theme) :where(.bf-cluster.is-nowrap) {
396
+ flex-wrap: nowrap;
353
397
  }
354
398
 
355
399
  :where(.bf-theme) :where(.bf-cluster.is-split) {
@@ -364,14 +408,48 @@ ${generateBaselineGridThemeOverrideCss()}
364
408
 
365
409
  ${roleRules}
366
410
 
411
+ :where(.bf-theme) .bf-stack.is-metric-flush > :where(${metricFlushTextSelectors}):has(+ :where(${metricFlushTextSelectors})) {
412
+ margin-block-end: 0;
413
+ }
414
+
415
+ :where(.bf-theme) .bf-stack.is-metric-flush > :where(${metricFlushTextSelectors}) + :where(${metricFlushTextSelectors}) {
416
+ padding-block-start: 0;
417
+ }
418
+
367
419
  ${capEngineDemo}
368
420
 
369
421
  :where(.bf-theme) :where(ul, ol) {
370
422
  margin-bottom: 0;
423
+ padding-block-end: 0;
424
+ }
425
+
426
+ :where(.bf-theme) :where(.bf-prose ol) {
427
+ padding-inline-start: calc(var(--bf-leading-mark-group-inset) + var(--bf-leading-mark-offset) - (var(--bf-leading-mark-size) * 0.5));
428
+ }
429
+
430
+ :where(.bf-theme) :where(.bf-prose ol > li) {
431
+ padding-inline-start: calc(var(--bf-leading-mark-size) * 0.5);
432
+ }
433
+
434
+ :where(.bf-theme) :where(.bf-prose ul) {
435
+ list-style: none;
436
+ padding-inline-start: var(--bf-leading-mark-group-inset);
437
+ }
438
+
439
+ :where(.bf-theme) :where(.bf-prose ul > li) {
440
+ padding-inline-start: var(--bf-leading-mark-offset);
441
+ position: relative;
371
442
  }
372
443
 
373
- :where(.bf-theme) :where(.bf-prose ul, .bf-prose ol) {
374
- padding-inline-start: var(--bf-space-4);
444
+ :where(.bf-theme) :where(.bf-prose ul > li)::before {
445
+ background: currentColor;
446
+ block-size: var(--bf-list-marker-dot-size);
447
+ border-radius: 50%;
448
+ content: "";
449
+ inline-size: var(--bf-list-marker-dot-size);
450
+ inset-block-start: calc(var(--bf-tick-box-offset) + ((var(--bf-leading-mark-size) - var(--bf-list-marker-dot-size)) * 0.5));
451
+ inset-inline-start: calc((var(--bf-leading-mark-size) - var(--bf-list-marker-dot-size)) * 0.5);
452
+ position: absolute;
375
453
  }
376
454
 
377
455
  :where(.bf-theme) :where(.bf-prose li) {
@@ -381,39 +459,37 @@ ${capEngineDemo}
381
459
  }
382
460
 
383
461
  :where(.bf-theme) :where(.bf-prose blockquote) {
384
- border-inline-start: 1px solid var(--bf-color-rule);
385
- color: var(--bf-color-muted);
462
+ color: var(--bf-color-text-default);
386
463
  font-family: ${roleFontFamilyVar("body", body.fontStack)};
387
464
  font-size: ${roleFontSizeVar("body", body.fontSize)};
388
465
  font-style: ${roleFontStyleVar("body", body.fontStyle ?? "normal")};
389
466
  font-weight: ${roleFontWeightVar("body", body.fontWeight ?? 400)};
390
467
  line-height: ${roleLineHeightVar("body", body.lineHeight)};
391
468
  margin-bottom: ${roleMarginBottomVar("body", baselineCompensation(body.nudgeTop, baselineUnit))};
392
- max-inline-size: calc(var(--bf-measure) + var(--bf-space-4));
469
+ max-inline-size: var(--bf-measure);
393
470
  padding-block-end: 0rem;
394
471
  padding-block-start: ${roleNudgeStartVar("body", body.nudgeTop)};
395
- padding-inline-start: var(--bf-space-3);
396
472
  }
397
473
 
398
- :where(.bf-theme) :where(.bf-rule, .bf-prose hr) {
474
+ :where(.bf-theme) :where(hr) {
399
475
  background: var(--bf-color-rule);
400
- block-size: 1px;
476
+ block-size: 0.0625rem;
401
477
  border: 0;
402
478
  inline-size: 100%;
403
479
  /* Reserve one half-rem rhythm step after the rule, including its */
404
480
  /* thickness, so borderless content does not touch the divider. */
405
- margin: 0 0 calc(0.5rem - 1px);
481
+ margin: 0 0 calc(0.5rem - 0.0625rem);
406
482
  }
407
483
 
408
484
  /* Highlight rules share the same scalable emphasis-bar geometry as active
409
485
  * navigation, tabs, notifications, and document-navigation markers. */
410
- :where(.bf-theme) :where(.bf-rule.is-highlighted, .bf-prose hr.is-highlighted) {
486
+ :where(.bf-theme) :where(hr.is-highlighted) {
411
487
  block-size: var(--bf-bar-thickness);
412
488
  margin-block-end: calc(0.5rem - var(--bf-bar-thickness));
413
489
  }
414
490
 
415
491
  :where(.bf-theme) :where(.bf-token-row) {
416
- border-top: 1px solid var(--bf-color-rule);
492
+ border-top: 0.0625rem solid var(--bf-color-rule);
417
493
  display: grid;
418
494
  gap: var(--bf-space-1);
419
495
  padding-top: var(--bf-space-2);
@@ -426,6 +502,6 @@ ${capEngineDemo}
426
502
 
427
503
  ${componentsCss(tokens, themeSurfaces)}
428
504
 
429
- ${gridCss()}${presetCss}
505
+ ${gridCss(appScopes)}${presetCss}
430
506
  `;
431
507
  }