baseline-foundry 0.1.3 → 0.1.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.
Files changed (84) hide show
  1. package/README.md +577 -553
  2. package/config/experiments/ibm-plex-engine-smoke.json +115 -115
  3. package/config/experiments/ubuntu-engine-smoke.json +115 -115
  4. package/config/foundation-theme.json +110 -110
  5. package/config/tiers/app.json +116 -116
  6. package/config/tiers/documentation.json +116 -116
  7. package/config/tiers/editorial.json +116 -116
  8. package/config/tiers/os.json +116 -116
  9. package/dist/baseline-grid-overlay.js +43 -43
  10. package/dist/build.js +4 -4
  11. package/dist/code-snippet.js +1 -1
  12. package/dist/css-app-tier.js +78 -73
  13. package/dist/css-components/article-pagination.js +141 -140
  14. package/dist/css-components/button-actions.js +181 -161
  15. package/dist/css-components/cards-options.js +176 -176
  16. package/dist/css-components/chip-badge-status.d.ts +0 -3
  17. package/dist/css-components/chip-badge-status.js +174 -159
  18. package/dist/css-components/content-card.d.ts +7 -7
  19. package/dist/css-components/content-card.js +498 -497
  20. package/dist/css-components/control-row.d.ts +1 -1
  21. package/dist/css-components/control-row.js +15 -15
  22. package/dist/css-components/cta-figure-aspect.js +120 -120
  23. package/dist/css-components/document-navigation.js +427 -390
  24. package/dist/css-components/editorial-content.js +42 -42
  25. package/dist/css-components/icon.js +72 -72
  26. package/dist/css-components/interactive-feedback.js +239 -217
  27. package/dist/css-components/interactive-tables.js +160 -155
  28. package/dist/css-components/legacy-navigation.d.ts +8 -0
  29. package/dist/css-components/legacy-navigation.js +816 -0
  30. package/dist/css-components/linked-logo-site-layout.d.ts +3 -3
  31. package/dist/css-components/linked-logo-site-layout.js +177 -180
  32. package/dist/css-components/list-tree.js +96 -94
  33. package/dist/css-components/list.js +9 -7
  34. package/dist/css-components/logo-media.d.ts +6 -6
  35. package/dist/css-components/logo-media.js +218 -207
  36. package/dist/css-components/navigation-layout.js +144 -144
  37. package/dist/css-components/panel.js +148 -144
  38. package/dist/css-components/search-box-and-filter.d.ts +0 -1
  39. package/dist/css-components/search-box-and-filter.js +263 -264
  40. package/dist/css-components/sites-editorial-ports.d.ts +3 -4
  41. package/dist/css-components/sites-editorial-ports.js +279 -247
  42. package/dist/css-components/sites-foundation.js +142 -146
  43. package/dist/css-components/sites-rich-lists.d.ts +5 -5
  44. package/dist/css-components/sites-rich-lists.js +339 -349
  45. package/dist/css-components/static-content-ports.d.ts +3 -3
  46. package/dist/css-components/static-content-ports.js +200 -186
  47. package/dist/css-components/tab-section.d.ts +3 -3
  48. package/dist/css-components/tab-section.js +93 -85
  49. package/dist/css-components/table.js +76 -75
  50. package/dist/css-components/tabs-choice-breadcrumbs.js +307 -303
  51. package/dist/css-components/tiered-list-equal-height-row.js +271 -271
  52. package/dist/css-components.js +1881 -2554
  53. package/dist/css-grid.d.ts +1 -1
  54. package/dist/css-grid.js +183 -173
  55. package/dist/css.js +317 -241
  56. package/dist/experiments/ibm-plex-engine-smoke/styles.css +894 -538
  57. package/dist/experiments/ibm-plex-engine-smoke/surfaces.json +2 -2
  58. package/dist/experiments/ibm-plex-engine-smoke/tokens.json +1 -1
  59. package/dist/in-page-navigation.js +1 -1
  60. package/dist/presets/app-tier/styles.css +928 -568
  61. package/dist/presets/app-tier/surfaces.json +17 -17
  62. package/dist/presets/app-tier/tokens.json +7 -7
  63. package/dist/presets/prose/styles.css +919 -562
  64. package/dist/presets/prose/surfaces.json +17 -17
  65. package/dist/presets/prose/tokens.json +1 -1
  66. package/dist/resizable-aside.js +12 -4
  67. package/dist/styles.css +919 -562
  68. package/dist/surfaces.json +17 -17
  69. package/dist/tiers/app/styles.css +928 -568
  70. package/dist/tiers/app/surfaces.json +17 -17
  71. package/dist/tiers/app/tokens.json +7 -7
  72. package/dist/tiers/documentation/styles.css +920 -563
  73. package/dist/tiers/documentation/surfaces.json +17 -17
  74. package/dist/tiers/documentation/tokens.json +2 -2
  75. package/dist/tiers/editorial/styles.css +919 -562
  76. package/dist/tiers/editorial/surfaces.json +17 -17
  77. package/dist/tiers/editorial/tokens.json +1 -1
  78. package/dist/tiers/os/styles.css +925 -568
  79. package/dist/tiers/os/surfaces.json +17 -17
  80. package/dist/tiers/os/tokens.json +7 -7
  81. package/dist/tokens.json +1 -1
  82. package/dist/types.d.ts +1 -1
  83. package/docs/publishing.md +31 -14
  84. package/package.json +119 -108
@@ -1 +1 @@
1
- export declare function gridCss(): string;
1
+ export declare function gridCss(appScopes?: string[]): string;
package/dist/css-grid.js CHANGED
@@ -1,179 +1,189 @@
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
- return `/* ------------------------------------------------------------------ */
7
- /* Gutter and margin escalation — viewport-based, all tiers */
8
- /* 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. */
11
- /* ------------------------------------------------------------------ */
12
-
13
- :where(.bf-theme) {
14
- --bf-grid-gap-inline: 1rem;
15
- --bf-grid-gap-block: 1rem;
16
- --bf-page-margin: 1rem;
17
- }
18
-
19
- @media (width >= 38.75rem) {
20
- :where(.bf-theme) {
21
- --bf-grid-gap-inline: 1.5rem;
22
- --bf-grid-gap-block: 1.5rem;
23
- --bf-page-margin: 1.5rem;
24
- }
25
- }
26
-
27
- @media (width >= 64.75rem) {
28
- :where(.bf-theme) {
29
- --bf-grid-gap-inline: 2rem;
30
- --bf-grid-gap-block: 2rem;
31
- --bf-page-margin: 2rem;
32
- }
33
-
34
- :where(.bf-theme.bf-tier-app) {
35
- --bf-grid-gap-inline: 1.5rem;
36
- --bf-grid-gap-block: 1.5rem;
37
- }
38
-
39
- :where(.bf-theme) :where(.bf-application),
40
- :where(.bf-theme):where(.bf-application) {
41
- --bf-grid-gap-inline: 1.5rem;
42
- --bf-grid-gap-block: 1.5rem;
43
- }
44
- }
45
-
46
- /* ------------------------------------------------------------------ */
47
- /* Container query contexts */
48
- /* */
49
- /* All tiers use container queries for column switching. In editorial */
50
- /* and docs, .bf-page is the single grid container — centered and */
51
- /* capped at --bf-content-max-width — so the container width mirrors */
52
- /* the viewport (spec §3: "viewport-based grid"). In app tier, */
53
- /* .bf-page is fluid (no max-width) and multiple concurrent containers */
54
- /* can each establish their own grid context (spec §5). */
55
- /* ------------------------------------------------------------------ */
56
-
57
- :where(.bf-theme) :where(.bf-page, .bf-grid-scope, .bf-section, .bf-strip, .bf-fixed-width, .bf-panel-content, .bf-accordion-panel, .bf-main, .bf-aside),
58
- :where(.bf-theme):where(.bf-page, .bf-grid-scope, .bf-section, .bf-strip, .bf-fixed-width, .bf-panel-content, .bf-accordion-panel, .bf-main, .bf-aside) {
59
- container-type: inline-size;
60
- }
61
-
62
- /* ------------------------------------------------------------------ */
63
- /* Page-level layout */
64
- /* Editorial/docs: centered + max-width (spec §3.2) */
65
- /* App: fluid edge-to-edge (spec §5.2) */
66
- /* ------------------------------------------------------------------ */
67
-
68
- :where(.bf-theme) :where(.bf-fixed-width) {
69
- margin-inline: auto;
70
- max-inline-size: var(--bf-content-max-width);
71
- padding-inline: max(var(--bf-page-margin), var(--bf-content-padding-inline));
72
- width: 100%;
73
- }
74
-
75
- /* Keep a capped content row at the logical start of a wider panel. */
76
- :where(.bf-theme) :where(.bf-fixed-width.is-start-aligned) {
77
- margin-inline-end: auto;
78
- margin-inline-start: 0;
79
- }
80
-
81
- :where(.bf-theme.bf-tier-app) :where(.bf-page) {
82
- max-inline-size: none;
83
- }
84
-
85
- :where(.bf-theme) :where(.bf-panel-content, .bf-accordion-panel) :where(.bf-fixed-width) {
86
- padding-inline: 0;
87
- }
88
-
89
- :where(.bf-theme) :where(.bf-grid) :where(.bf-fixed-width) {
90
- padding-inline: 0;
91
- }
92
-
93
- /* ------------------------------------------------------------------ */
94
- /* Grid base — 4 columns, all tiers */
95
- /* ------------------------------------------------------------------ */
96
-
97
- :where(.bf-theme) :where(.bf-grid) {
98
- --bf-grid-columns: 4;
99
- display: grid;
100
- /* bf-grid keeps row-gap at 0; the block token stays available for */
101
- /* two-dimensional layouts and other structural layout-gap cases. */
102
- gap: 0 var(--bf-grid-gap-inline);
103
- grid-template-columns: repeat(var(--bf-grid-columns), minmax(0, 1fr));
104
- }
105
-
106
- :where(.bf-theme) :where(ul.bf-grid, ol.bf-grid) {
107
- list-style: none;
108
- margin: 0;
109
- padding: 0;
110
- }
111
-
112
- :where(.bf-theme) :where(.bf-grid.is-guide) > * {
113
- 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));
115
- min-block-size: calc(var(--bf-baseline) * 4);
116
- }
117
-
118
- :where(.bf-theme) :where(.bf-grid) > * {
119
- grid-column: auto / span var(--bf-grid-columns);
120
- min-inline-size: 0;
121
- }
122
-
123
- :where(.bf-theme) :where(.bf-grid.bf-grid.is-controls) {
124
- container-type: inline-size;
125
- gap: var(--bf-field-gap);
126
- }
127
-
128
- :where(.bf-theme) :where(.bf-grid.bf-grid.is-controls) > :where(.bf-grid-item.is-control, .bf-grid-item.is-control-pair) {
129
- grid-column: auto / span 4;
130
- }
131
-
132
- ${baseSpans}
133
-
134
- /* ------------------------------------------------------------------ */
135
- /* Container-based column switching — all tiers */
136
- /* Editorial/docs containers are .bf-page (centered, max-width), so */
137
- /* container width tracks viewport. App containers can be any layout */
138
- /* region (panels, drawers, main area). */
139
- /* ------------------------------------------------------------------ */
140
-
141
- @container (width >= 38.75rem) {
142
- :where(.bf-theme) :where(.bf-grid) {
143
- --bf-grid-columns: 8;
144
- }
145
-
146
- :where(.bf-theme) :where(.bf-grid.bf-grid.is-controls) > :where(.bf-grid-item.is-control) {
147
- grid-column: auto / span 2;
148
- }
149
-
150
- :where(.bf-theme) :where(.bf-grid.bf-grid.is-controls) > :where(.bf-grid-item.is-control-pair) {
151
- grid-column: auto / span 4;
152
- }
153
-
154
- ${mediumSpans}
155
- }
156
-
157
- @container (width >= 105.0625rem) {
158
- :where(.bf-theme) :where(.bf-grid) {
159
- --bf-grid-columns: 16;
160
- }
161
-
162
- :where(.bf-theme) :where(.bf-grid.bf-grid.is-controls) > :where(.bf-grid-item.is-control) {
163
- grid-column: auto / span 4;
164
- }
165
-
166
- :where(.bf-theme) :where(.bf-grid.bf-grid.is-controls) > :where(.bf-grid-item.is-control-pair) {
167
- grid-column: auto / span 8;
168
- }
169
-
170
- ${largeSpans}
171
- }
172
-
173
- /* Full span follows every generated numbered-span rule so normal cascade
174
- * order is sufficient; consumers never need cascade escalation. */
175
- :where(.bf-theme) :where(.bf-grid) > :where(.bf-span-full) {
176
- grid-column: 1 / -1;
177
- }
11
+ return `/* ------------------------------------------------------------------ */
12
+ /* Gutter and margin escalation — viewport-based, all tiers */
13
+ /* Grid spec v0.3 §2.3: gutters set by global viewport breakpoint. */
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. */
16
+ /* ------------------------------------------------------------------ */
17
+
18
+ :where(.bf-theme) {
19
+ --bf-grid-gap-inline: 1rem;
20
+ --bf-grid-gap-block: 1rem;
21
+ --bf-page-margin: 1rem;
22
+ }
23
+
24
+ @media (width >= 38.75rem) {
25
+ :where(.bf-theme) {
26
+ --bf-grid-gap-inline: 1.5rem;
27
+ --bf-grid-gap-block: 1.5rem;
28
+ --bf-page-margin: 1.5rem;
29
+ }
30
+ }
31
+
32
+ @media (width >= 64.75rem) {
33
+ :where(.bf-theme) {
34
+ --bf-grid-gap-inline: 2rem;
35
+ --bf-grid-gap-block: 2rem;
36
+ --bf-page-margin: 2rem;
37
+ }
38
+
39
+ ${appGutterSelectors} {
40
+ --bf-grid-gap-inline: 1.5rem;
41
+ --bf-grid-gap-block: 1.5rem;
42
+ }
43
+
44
+ :where(.bf-theme) :where(.bf-application),
45
+ :where(.bf-theme):where(.bf-application) {
46
+ --bf-grid-gap-inline: 1.5rem;
47
+ --bf-grid-gap-block: 1.5rem;
48
+ }
49
+ }
50
+
51
+ /* ------------------------------------------------------------------ */
52
+ /* Container query contexts */
53
+ /* */
54
+ /* All tiers use container queries for column switching. In editorial */
55
+ /* and docs, .bf-page is the single grid container — centered and */
56
+ /* capped at --bf-content-max-width — so the container width mirrors */
57
+ /* the viewport (spec §3: "viewport-based grid"). In app tier, */
58
+ /* .bf-page is fluid (no max-width) and multiple concurrent containers */
59
+ /* can each establish their own grid context (spec §5). */
60
+ /* ------------------------------------------------------------------ */
61
+
62
+ :where(.bf-theme) :where(.bf-page, .bf-grid-scope, .bf-section, .bf-strip, .bf-fixed-width, .bf-panel-content, .bf-accordion-panel, .bf-main, .bf-aside),
63
+ :where(.bf-theme):where(.bf-page, .bf-grid-scope, .bf-section, .bf-strip, .bf-fixed-width, .bf-panel-content, .bf-accordion-panel, .bf-main, .bf-aside) {
64
+ container-type: inline-size;
65
+ }
66
+
67
+ /* ------------------------------------------------------------------ */
68
+ /* Page-level layout */
69
+ /* Editorial/docs: centered + max-width (spec §3.2) */
70
+ /* App: fluid edge-to-edge (spec §5.2) */
71
+ /* ------------------------------------------------------------------ */
72
+
73
+ :where(.bf-theme) :where(.bf-fixed-width) {
74
+ margin-inline: auto;
75
+ max-inline-size: var(--bf-content-max-width);
76
+ padding-inline: max(var(--bf-page-margin), var(--bf-content-padding-inline));
77
+ width: 100%;
78
+ }
79
+
80
+ /* Keep a capped content row at the logical start of a wider panel. */
81
+ :where(.bf-theme) :where(.bf-fixed-width.is-start-aligned) {
82
+ margin-inline-end: auto;
83
+ margin-inline-start: 0;
84
+ }
85
+
86
+ ${appPageRule}
87
+
88
+ :where(.bf-theme) :where(.bf-panel-content, .bf-accordion-panel) :where(.bf-fixed-width) {
89
+ padding-inline: 0;
90
+ }
91
+
92
+ :where(.bf-theme) :where(.bf-grid) :where(.bf-fixed-width) {
93
+ padding-inline: 0;
94
+ }
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
+
103
+ /* ------------------------------------------------------------------ */
104
+ /* Grid base — 4 columns, all tiers */
105
+ /* ------------------------------------------------------------------ */
106
+
107
+ :where(.bf-theme) :where(.bf-grid) {
108
+ --bf-grid-columns: 4;
109
+ display: grid;
110
+ /* bf-grid keeps row-gap at 0; the block token stays available for */
111
+ /* two-dimensional layouts and other structural layout-gap cases. */
112
+ gap: 0 var(--bf-grid-gap-inline);
113
+ grid-template-columns: repeat(var(--bf-grid-columns), minmax(0, 1fr));
114
+ }
115
+
116
+ :where(.bf-theme) :where(ul.bf-grid, ol.bf-grid) {
117
+ list-style: none;
118
+ margin: 0;
119
+ padding: 0;
120
+ }
121
+
122
+ :where(.bf-theme) :where(.bf-grid.is-guide) > * {
123
+ background: color-mix(in srgb, var(--bf-color-accent) 18%, var(--bf-color-background-default));
124
+ box-shadow: inset 0 0 0 0.0625rem color-mix(in srgb, var(--bf-color-accent) 50%, var(--bf-color-rule));
125
+ min-block-size: calc(var(--bf-baseline) * 4);
126
+ }
127
+
128
+ :where(.bf-theme) :where(.bf-grid) > * {
129
+ grid-column: auto / span var(--bf-grid-columns);
130
+ min-inline-size: 0;
131
+ }
132
+
133
+ :where(.bf-theme) :where(.bf-grid.bf-grid.is-controls) {
134
+ container-type: inline-size;
135
+ gap: var(--bf-field-gap);
136
+ }
137
+
138
+ :where(.bf-theme) :where(.bf-grid.bf-grid.is-controls) > :where(.bf-grid-item.is-control, .bf-grid-item.is-control-pair) {
139
+ grid-column: auto / span 4;
140
+ }
141
+
142
+ ${baseSpans}
143
+
144
+ /* ------------------------------------------------------------------ */
145
+ /* Container-based column switching — all tiers */
146
+ /* Editorial/docs containers are .bf-page (centered, max-width), so */
147
+ /* container width tracks viewport. App containers can be any layout */
148
+ /* region (panels, drawers, main area). */
149
+ /* ------------------------------------------------------------------ */
150
+
151
+ @container (width >= 38.75rem) {
152
+ :where(.bf-theme) :where(.bf-grid) {
153
+ --bf-grid-columns: 8;
154
+ }
155
+
156
+ :where(.bf-theme) :where(.bf-grid.bf-grid.is-controls) > :where(.bf-grid-item.is-control) {
157
+ grid-column: auto / span 2;
158
+ }
159
+
160
+ :where(.bf-theme) :where(.bf-grid.bf-grid.is-controls) > :where(.bf-grid-item.is-control-pair) {
161
+ grid-column: auto / span 4;
162
+ }
163
+
164
+ ${mediumSpans}
165
+ }
166
+
167
+ @container (width >= 105.0625rem) {
168
+ :where(.bf-theme) :where(.bf-grid) {
169
+ --bf-grid-columns: 16;
170
+ }
171
+
172
+ :where(.bf-theme) :where(.bf-grid.bf-grid.is-controls) > :where(.bf-grid-item.is-control) {
173
+ grid-column: auto / span 4;
174
+ }
175
+
176
+ :where(.bf-theme) :where(.bf-grid.bf-grid.is-controls) > :where(.bf-grid-item.is-control-pair) {
177
+ grid-column: auto / span 8;
178
+ }
179
+
180
+ ${largeSpans}
181
+ }
182
+
183
+ /* Full span follows every generated numbered-span rule so normal cascade
184
+ * order is sufficient; consumers never need cascade escalation. */
185
+ :where(.bf-theme) :where(.bf-grid) > :where(.bf-span-full) {
186
+ grid-column: 1 / -1;
187
+ }
178
188
  `;
179
189
  }