@spillway-cms/blocks 0.0.0-stage → 0.1.1

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 (100) hide show
  1. package/LICENSE +21 -0
  2. package/dist/ask.d.ts +39 -0
  3. package/dist/ask.js +96 -0
  4. package/dist/ask.js.map +1 -0
  5. package/dist/calendar.d.ts +42 -0
  6. package/dist/calendar.js +96 -0
  7. package/dist/calendar.js.map +1 -0
  8. package/dist/collection.d.ts +89 -0
  9. package/dist/collection.js +304 -0
  10. package/dist/collection.js.map +1 -0
  11. package/dist/config.d.ts +208 -0
  12. package/dist/config.js +563 -0
  13. package/dist/config.js.map +1 -0
  14. package/dist/css.d.ts +1 -0
  15. package/dist/css.js +600 -0
  16. package/dist/css.js.map +1 -0
  17. package/dist/docs-feedback.d.ts +34 -0
  18. package/dist/docs-feedback.js +57 -0
  19. package/dist/docs-feedback.js.map +1 -0
  20. package/dist/examples.d.ts +12 -0
  21. package/dist/examples.js +80 -0
  22. package/dist/examples.js.map +1 -0
  23. package/dist/experiment.d.ts +18 -0
  24. package/dist/experiment.js +20 -0
  25. package/dist/experiment.js.map +1 -0
  26. package/dist/form.d.ts +40 -0
  27. package/dist/form.js +252 -0
  28. package/dist/form.js.map +1 -0
  29. package/dist/gallery.d.ts +36 -0
  30. package/dist/gallery.js +114 -0
  31. package/dist/gallery.js.map +1 -0
  32. package/dist/image.d.ts +41 -0
  33. package/dist/image.js +39 -0
  34. package/dist/image.js.map +1 -0
  35. package/dist/index.d.ts +49 -0
  36. package/dist/index.js +28 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/layouts.d.ts +8 -0
  39. package/dist/layouts.js +81 -0
  40. package/dist/layouts.js.map +1 -0
  41. package/dist/markdown.d.ts +32 -0
  42. package/dist/markdown.js +283 -0
  43. package/dist/markdown.js.map +1 -0
  44. package/dist/marketing.d.ts +53 -0
  45. package/dist/marketing.js +184 -0
  46. package/dist/marketing.js.map +1 -0
  47. package/dist/menu.d.ts +43 -0
  48. package/dist/menu.js +75 -0
  49. package/dist/menu.js.map +1 -0
  50. package/dist/meta.d.ts +14 -0
  51. package/dist/meta.js +183 -0
  52. package/dist/meta.js.map +1 -0
  53. package/dist/module-block.d.ts +29 -0
  54. package/dist/module-block.js +53 -0
  55. package/dist/module-block.js.map +1 -0
  56. package/dist/personalize.d.ts +18 -0
  57. package/dist/personalize.js +32 -0
  58. package/dist/personalize.js.map +1 -0
  59. package/dist/registry-browse.d.ts +31 -0
  60. package/dist/registry-browse.js +97 -0
  61. package/dist/registry-browse.js.map +1 -0
  62. package/dist/registry-gallery.d.ts +22 -0
  63. package/dist/registry-gallery.js +73 -0
  64. package/dist/registry-gallery.js.map +1 -0
  65. package/dist/registry-org.d.ts +22 -0
  66. package/dist/registry-org.js +44 -0
  67. package/dist/registry-org.js.map +1 -0
  68. package/dist/registry-package.d.ts +27 -0
  69. package/dist/registry-package.js +145 -0
  70. package/dist/registry-package.js.map +1 -0
  71. package/dist/registry-publisher.d.ts +20 -0
  72. package/dist/registry-publisher.js +46 -0
  73. package/dist/registry-publisher.js.map +1 -0
  74. package/dist/registry-shared.d.ts +29 -0
  75. package/dist/registry-shared.js +122 -0
  76. package/dist/registry-shared.js.map +1 -0
  77. package/dist/registry-stats.d.ts +15 -0
  78. package/dist/registry-stats.js +42 -0
  79. package/dist/registry-stats.js.map +1 -0
  80. package/dist/registry-types.d.ts +218 -0
  81. package/dist/registry-types.js +29 -0
  82. package/dist/registry-types.js.map +1 -0
  83. package/dist/sanitize.d.ts +37 -0
  84. package/dist/sanitize.js +293 -0
  85. package/dist/sanitize.js.map +1 -0
  86. package/dist/search.d.ts +25 -0
  87. package/dist/search.js +77 -0
  88. package/dist/search.js.map +1 -0
  89. package/dist/shared.d.ts +27 -0
  90. package/dist/shared.js +59 -0
  91. package/dist/shared.js.map +1 -0
  92. package/dist/status-board.d.ts +49 -0
  93. package/dist/status-board.js +81 -0
  94. package/dist/status-board.js.map +1 -0
  95. package/dist/styles.css +1245 -0
  96. package/dist/styles.d.ts +37 -0
  97. package/dist/styles.js +242 -0
  98. package/dist/styles.js.map +1 -0
  99. package/package.json +47 -3
  100. package/README.md +0 -3
package/dist/css.js ADDED
@@ -0,0 +1,600 @@
1
+ /**
2
+ * The complete stylesheet for the core blocks, as a string so the server can
3
+ * inline it and so the build can emit `styles.css` from one source of truth.
4
+ *
5
+ * Conventions:
6
+ * - every class is prefixed `sw-`
7
+ * - colours, fonts, radius and width come from theme variables the server sets
8
+ * on `:root` (`--sw-color-primary`, `--sw-color-text`, `--sw-color-bg`,
9
+ * `--sw-font-body`, `--sw-font-heading`, `--sw-radius`, `--sw-max-width`),
10
+ * each with a fallback so the CSS works on its own
11
+ * - mobile first; breakpoints at 640px and 900px
12
+ * - no external fonts, no images, no JavaScript
13
+ */
14
+ import { MARKETING_CSS } from './marketing.js';
15
+ import { calendarCss } from './calendar.js';
16
+ import { galleryCss } from './gallery.js';
17
+ import { searchCss } from './search.js';
18
+ import { askCss } from './ask.js';
19
+ import { menuBlockCss } from './menu.js';
20
+ import { collectionCss } from './collection.js';
21
+ import { FORM_CSS } from './form.js';
22
+ import { sharedCss } from './shared.js';
23
+ import { islandCss } from './personalize.js';
24
+ import { registrySharedCss } from './registry-shared.js';
25
+ import { registryBrowseCss } from './registry-browse.js';
26
+ import { registryPackageCss } from './registry-package.js';
27
+ import { registryStatsCss } from './registry-stats.js';
28
+ import { themeGalleryCss } from './registry-gallery.js';
29
+ import { publisherProfileCss } from './registry-publisher.js';
30
+ import { orgProfileCss } from './registry-org.js';
31
+ import { docsFeedbackCss } from './docs-feedback.js';
32
+ import { moduleBlockCss } from './module-block.js';
33
+ import { statusBoardCss } from './status-board.js';
34
+ export const blockCss = `/* Spillway core blocks. Generated from packages/blocks/src/css.ts; do not edit by hand. */
35
+
36
+ /* Defaults only: :where() keeps them at zero specificity, so the theme's :root tokens win wherever this sheet comes. */
37
+ :where(:root) {
38
+ --sw-color-primary: #1d4ed8;
39
+ --sw-color-text: #111827;
40
+ --sw-color-bg: #ffffff;
41
+ --sw-font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
42
+ --sw-font-heading: inherit;
43
+ --sw-radius: 8px;
44
+ --sw-max-width: 1120px;
45
+
46
+ /* Derived tokens. Blocks use these; themes override the ones above. */
47
+ --sw-color-muted: color-mix(in srgb, var(--sw-color-text, #111827) 68%, var(--sw-color-bg, #ffffff));
48
+ --sw-color-border: color-mix(in srgb, var(--sw-color-text, #111827) 14%, var(--sw-color-bg, #ffffff));
49
+ --sw-color-surface: color-mix(in srgb, var(--sw-color-text, #111827) 4%, var(--sw-color-bg, #ffffff));
50
+ --sw-color-primary-contrast: #ffffff;
51
+ --sw-focus-ring: 0 0 0 3px var(--sw-color-bg, #ffffff), 0 0 0 6px var(--sw-color-primary, #1d4ed8);
52
+ --sw-space-1: 0.5rem;
53
+ --sw-space-2: 1rem;
54
+ --sw-space-3: 1.5rem;
55
+ --sw-space-4: 2.5rem;
56
+ --sw-space-5: 4rem;
57
+ --sw-space-6: 6rem;
58
+ /* The padding above and below a block: --sw-space-3 on phones, --sw-space-4 from 640px. */
59
+ --sw-block-pad: var(--sw-space-3);
60
+ }
61
+ @media (min-width: 640px) {
62
+ :where(:root) { --sw-block-pad: var(--sw-space-4); }
63
+ }
64
+
65
+ /* ---------- Page ---------- */
66
+
67
+ .sw-page {
68
+ box-sizing: border-box;
69
+ margin: 0;
70
+ color: var(--sw-color-text, #111827);
71
+ background: var(--sw-color-bg, #ffffff);
72
+ font-family: var(--sw-font-body, system-ui, sans-serif);
73
+ font-size: 1.0625rem;
74
+ line-height: 1.6;
75
+ -webkit-font-smoothing: antialiased;
76
+ text-rendering: optimizeLegibility;
77
+ }
78
+ .sw-page *,
79
+ .sw-page *::before,
80
+ .sw-page *::after {
81
+ box-sizing: inherit;
82
+ }
83
+ .sw-page img,
84
+ .sw-page iframe,
85
+ .sw-page video {
86
+ max-width: 100%;
87
+ }
88
+ /* Element defaults sit in :where() so any block class outranks them: a plain ".sw-page p" used to cancel the margin of every
89
+ classed paragraph (a hero's subtitle, a call to action's text) and ".sw-page h3" the size of every card title. */
90
+ .sw-page :where(h1, h2, h3, h4) {
91
+ margin: 0;
92
+ font-family: var(--sw-font-heading, inherit);
93
+ font-weight: 700;
94
+ line-height: 1.15;
95
+ letter-spacing: -0.015em;
96
+ overflow-wrap: anywhere;
97
+ }
98
+ .sw-page :where(h1) { font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); }
99
+ .sw-page :where(h2) { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); }
100
+ .sw-page :where(h3) { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem); }
101
+ .sw-page :where(h4) { font-size: 1.15rem; }
102
+ /* Blocks inside an article (a layout field with placement "inline"): the article's title is the H1, so the blocks' headings
103
+ step down a size and never outsize it. Same specificity as the rules above, so block classes still win. */
104
+ :where(.sw-article-with-blocks) .sw-page :where(h2) { font-size: clamp(1.35rem, 1.15rem + 1vw, 1.75rem); }
105
+ :where(.sw-article-with-blocks) .sw-page :where(h3) { font-size: clamp(1.15rem, 1.05rem + .5vw, 1.35rem); }
106
+ .sw-page :where(p) { margin: 0; }
107
+ /* No stranded last words: headings balance their lines, running text avoids a one-word last line. */
108
+ .sw-page :where(h1, h2, h3, h4) { text-wrap: balance; }
109
+ .sw-page :where(p, li, blockquote, figcaption) { text-wrap: pretty; }
110
+ /* Buttons are links too; :where() keeps this rule from outranking the button classes (it used to paint a primary button's label in the primary color). */
111
+ .sw-page a:where(:not(.sw-button)) {
112
+ color: var(--sw-color-primary, #1d4ed8);
113
+ text-decoration: underline;
114
+ text-underline-offset: 0.15em;
115
+ border-radius: 2px;
116
+ }
117
+ .sw-page a:where(:not(.sw-button)):hover { text-decoration-thickness: 2px; }
118
+ .sw-page a:focus-visible,
119
+ .sw-page button:focus-visible,
120
+ .sw-page .sw-button:focus-visible {
121
+ outline: none;
122
+ box-shadow: var(--sw-focus-ring);
123
+ }
124
+
125
+ /* Shared container. Blocks are full-bleed sections; the inner container is capped. */
126
+ .sw-container {
127
+ width: 100%;
128
+ max-width: var(--sw-max-width, 1120px);
129
+ margin-inline: auto;
130
+ padding-inline: var(--sw-space-2);
131
+ }
132
+ @media (min-width: 640px) {
133
+ .sw-container { padding-inline: var(--sw-space-3); }
134
+ }
135
+ .sw-container--narrow { max-width: min(var(--sw-max-width, 1120px), 720px); }
136
+ .sw-container--wide { max-width: min(calc(var(--sw-max-width, 1120px) * 1.25), 1400px); }
137
+
138
+ .sw-block { padding-block: var(--sw-block-pad, 1.5rem); }
139
+ /* Two blocks on the page background share one gap instead of adding theirs up. */
140
+ .sw-block + .sw-block { padding-top: 0; }
141
+ /* A block after one with its own background (a hero; a band, from its style) keeps its top padding, so its content does
142
+ not start flush against the color. A hero keeps its own padding wherever it is. */
143
+ .sw-hero + .sw-block { padding-top: var(--sw-block-pad, 1.5rem); }
144
+ .sw-block + .sw-hero { padding-top: var(--sw-space-5); }
145
+ .sw-block + .sw-hero--large { padding-top: var(--sw-space-6); }
146
+
147
+ /* Alignment helpers */
148
+ .sw-align-left { text-align: left; }
149
+ .sw-align-center { text-align: center; }
150
+ .sw-align-right { text-align: right; }
151
+ .sw-align-center > .sw-actions,
152
+ .sw-align-center > .sw-container > .sw-actions,
153
+ .sw-align-center > .sw-container > .sw-hero__inner > .sw-actions { justify-content: center; }
154
+ .sw-align-right > .sw-actions,
155
+ .sw-align-right > .sw-container > .sw-actions { justify-content: flex-end; }
156
+
157
+ /* ---------- Buttons ---------- */
158
+
159
+ .sw-button {
160
+ display: inline-flex;
161
+ align-items: center;
162
+ justify-content: center;
163
+ gap: 0.5em;
164
+ min-height: 2.75rem;
165
+ padding: 0.65em 1.35em;
166
+ border: 2px solid transparent;
167
+ border-radius: var(--sw-radius, 8px);
168
+ font: inherit;
169
+ font-weight: 600;
170
+ line-height: 1.2;
171
+ text-decoration: none;
172
+ cursor: pointer;
173
+ transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
174
+ }
175
+ .sw-button:hover { text-decoration: none; }
176
+ .sw-button--primary {
177
+ background: var(--sw-color-primary, #1d4ed8);
178
+ border-color: var(--sw-color-primary, #1d4ed8);
179
+ color: var(--sw-color-primary-contrast, #ffffff);
180
+ }
181
+ .sw-button--primary:hover {
182
+ background: color-mix(in srgb, var(--sw-color-primary, #1d4ed8) 85%, #000000);
183
+ border-color: color-mix(in srgb, var(--sw-color-primary, #1d4ed8) 85%, #000000);
184
+ }
185
+ .sw-button--secondary {
186
+ background: transparent;
187
+ border-color: currentColor;
188
+ color: var(--sw-color-primary, #1d4ed8);
189
+ }
190
+ .sw-button--secondary:hover {
191
+ background: color-mix(in srgb, var(--sw-color-primary, #1d4ed8) 10%, transparent);
192
+ }
193
+ .sw-actions {
194
+ display: flex;
195
+ flex-wrap: wrap;
196
+ gap: var(--sw-space-2);
197
+ margin-top: var(--sw-space-3);
198
+ }
199
+ .sw-button-block .sw-actions { margin-top: 0; }
200
+ /* A text link: the label alone, underlined, for the least important action in a row. */
201
+ .sw-button--link {
202
+ min-height: 0;
203
+ padding-inline: 0;
204
+ background: transparent;
205
+ border-color: transparent;
206
+ color: var(--sw-color-primary, #1d4ed8);
207
+ text-decoration: underline;
208
+ text-underline-offset: 0.15em;
209
+ }
210
+ .sw-button--link:hover { text-decoration-thickness: 2px; }
211
+
212
+ /* ---------- Hero ---------- */
213
+
214
+ .sw-hero {
215
+ position: relative;
216
+ isolation: isolate;
217
+ padding-block: var(--sw-space-5);
218
+ background: var(--sw-color-surface);
219
+ }
220
+ .sw-hero--large { padding-block: var(--sw-space-6); }
221
+ .sw-hero--image {
222
+ color: #ffffff;
223
+ --sw-color-muted: rgba(255, 255, 255, 0.92);
224
+ --sw-color-text: #ffffff;
225
+ background-size: cover;
226
+ background-position: center;
227
+ }
228
+ .sw-hero--image::before {
229
+ content: "";
230
+ position: absolute;
231
+ inset: 0;
232
+ z-index: -1;
233
+ background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.6));
234
+ }
235
+ .sw-hero__bg {
236
+ position: absolute;
237
+ inset: 0;
238
+ z-index: -2;
239
+ width: 100%;
240
+ height: 100%;
241
+ object-fit: cover;
242
+ object-position: center;
243
+ }
244
+ .sw-hero--image .sw-button--secondary { color: #ffffff; }
245
+ .sw-hero--image a { color: inherit; }
246
+ .sw-hero__inner { max-width: 48rem; }
247
+ .sw-hero.sw-align-center .sw-hero__inner { margin-inline: auto; }
248
+ .sw-hero__eyebrow {
249
+ display: inline-block;
250
+ margin-bottom: var(--sw-space-2);
251
+ /* Sentence case at normal tracking: tracked caps above a big headline is the stock template hero. */
252
+ font-size: 1rem;
253
+ font-weight: 600;
254
+ color: var(--sw-color-primary, #1d4ed8);
255
+ }
256
+ .sw-hero--image .sw-hero__eyebrow { color: inherit; }
257
+ .sw-hero__title { font-size: clamp(2.25rem, 1.5rem + 3.5vw, 3.75rem); }
258
+ .sw-hero--large .sw-hero__title { font-size: clamp(2.5rem, 1.6rem + 4.5vw, 4.5rem); }
259
+ .sw-hero__subtitle {
260
+ max-width: 36em;
261
+ margin-top: var(--sw-space-2);
262
+ font-size: clamp(1.1rem, 1rem + 0.6vw, 1.35rem);
263
+ color: var(--sw-color-muted);
264
+ }
265
+
266
+ /* ---------- Heading ---------- */
267
+
268
+ .sw-heading { padding-block: var(--sw-space-2); }
269
+ .sw-block + .sw-heading { padding-top: var(--sw-space-2); }
270
+ .sw-hero + .sw-heading { padding-top: var(--sw-block-pad, 1.5rem); }
271
+ /* A heading that opens the page gets a block's top padding, not the small gap it keeps after another block. */
272
+ .sw-heading:first-child { padding-top: var(--sw-block-pad, 1.5rem); }
273
+
274
+ /* ---------- Text ---------- */
275
+
276
+ /* Text lines up with the headings and cards around it; the measure is capped, and alignment moves the column. */
277
+ .sw-text .sw-prose { max-width: 36em; }
278
+ .sw-text.sw-align-center .sw-prose { margin-inline: auto; }
279
+ .sw-text.sw-align-right .sw-prose { margin-left: auto; }
280
+ .sw-text .sw-prose > * + * { margin-top: 1em; }
281
+ .sw-text--lead .sw-prose { font-size: 1.25rem; line-height: 1.55; }
282
+ .sw-prose h1, .sw-prose h2, .sw-prose h3, .sw-prose h4 { margin-top: 1.5em; }
283
+ .sw-prose h1:first-child, .sw-prose h2:first-child, .sw-prose h3:first-child, .sw-prose h4:first-child { margin-top: 0; }
284
+ .sw-prose ul, .sw-prose ol { padding-left: 1.4em; }
285
+ /* Bullets and numbers even where a stylesheet resets lists (the admin's, which the page builder's canvas carries, or a theme's). */
286
+ .sw-prose :is(ul, ol) { list-style: revert; }
287
+ .sw-prose li + li { margin-top: 0.35em; }
288
+ .sw-prose blockquote {
289
+ margin: 1.5em 0;
290
+ padding-left: 1em;
291
+ border-left: 3px solid var(--sw-color-primary, #1d4ed8);
292
+ color: var(--sw-color-muted);
293
+ }
294
+ .sw-prose code {
295
+ overflow-wrap: anywhere;
296
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
297
+ font-size: 0.92em;
298
+ padding: 0.1em 0.35em;
299
+ border-radius: 4px;
300
+ background: var(--sw-color-surface);
301
+ }
302
+ .sw-prose pre {
303
+ overflow-x: auto;
304
+ padding: var(--sw-space-2);
305
+ border-radius: var(--sw-radius, 8px);
306
+ background: var(--sw-color-surface);
307
+ }
308
+ .sw-prose pre code { padding: 0; background: none; }
309
+ .sw-prose hr { border: 0; border-top: 1px solid var(--sw-color-border); margin: 2em 0; }
310
+ .sw-prose table { width: 100%; border-collapse: collapse; }
311
+ /* A wide table scrolls on its own on a phone instead of pushing the page sideways. */
312
+ @media (max-width: 639.98px) {
313
+ .sw-prose table { display: block; max-width: 100%; overflow-x: auto; }
314
+ }
315
+ /* Code samples and tables take a tab stop so a keyboard can scroll them (keyboardScrollable); show where focus is. */
316
+ .sw-prose pre:focus-visible,
317
+ .sw-prose table:focus-visible { outline: 2px solid var(--sw-color-primary); outline-offset: 2px; }
318
+ .sw-prose th, .sw-prose td { padding: 0.5em 0.75em; border-bottom: 1px solid var(--sw-color-border); text-align: left; }
319
+
320
+ /* ---------- Image ---------- */
321
+
322
+ .sw-image__figure { margin: 0; }
323
+ .sw-image__img {
324
+ display: block;
325
+ width: 100%;
326
+ height: auto;
327
+ }
328
+ .sw-image--rounded .sw-image__img { border-radius: var(--sw-radius, 8px); }
329
+ .sw-image__placeholder {
330
+ aspect-ratio: 16 / 9;
331
+ background: repeating-linear-gradient(45deg, var(--sw-color-surface) 0 12px, var(--sw-color-border) 12px 14px);
332
+ }
333
+ .sw-image__caption {
334
+ margin-top: var(--sw-space-1);
335
+ font-size: 0.9rem;
336
+ color: var(--sw-color-muted);
337
+ }
338
+
339
+ /* ---------- Columns ---------- */
340
+
341
+ .sw-columns__grid {
342
+ display: grid;
343
+ gap: var(--sw-space-3);
344
+ grid-template-columns: 1fr;
345
+ }
346
+ .sw-column { min-width: 0; }
347
+ .sw-column > .sw-block { padding-block: 0; }
348
+ .sw-column > .sw-block + .sw-block { padding-top: var(--sw-space-2); }
349
+ .sw-column .sw-container { padding-inline: 0; }
350
+ @media (min-width: 640px) {
351
+ .sw-columns--2 .sw-columns__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
352
+ .sw-columns--3 .sw-columns__grid,
353
+ .sw-columns--4 .sw-columns__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
354
+ }
355
+ @media (min-width: 900px) {
356
+ .sw-columns--3 .sw-columns__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
357
+ .sw-columns--4 .sw-columns__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
358
+ }
359
+ @media (min-width: 640px) {
360
+ .sw-columns--2.sw-columns--wide-left .sw-columns__grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
361
+ .sw-columns--2.sw-columns--wide-right .sw-columns__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
362
+ }
363
+ .sw-columns--gap-s .sw-columns__grid { gap: var(--sw-space-2); }
364
+ .sw-columns--gap-l .sw-columns__grid { gap: var(--sw-space-5); }
365
+ .sw-columns--valign-center .sw-columns__grid { align-items: center; }
366
+ .sw-columns--valign-bottom .sw-columns__grid { align-items: end; }
367
+
368
+ /* ---------- Section ---------- */
369
+
370
+ /* A band that holds other blocks. The blocks inside share its container: no second gutter, and one gap between them. */
371
+ .sw-section__body > .sw-block { padding-block: 0; }
372
+ .sw-section__body > .sw-block + .sw-block { padding-top: var(--sw-space-3); }
373
+ .sw-section__body .sw-container { max-width: none; padding-inline: 0; }
374
+ .sw-block.sw-section--filled { padding-block: var(--sw-space-4); }
375
+ @media (min-width: 640px) {
376
+ .sw-block.sw-section--filled { padding-block: var(--sw-space-5); }
377
+ }
378
+ .sw-section--filled + .sw-block { padding-top: var(--sw-block-pad, 1.5rem); }
379
+ .sw-section--bg-surface { background: var(--sw-color-surface); }
380
+ .sw-section--bg-primary { background: var(--sw-color-primary, #1d4ed8); }
381
+ .sw-section--bg-secondary { background: var(--sw-color-secondary, #334155); }
382
+ .sw-section--bg-dark { background: var(--sw-color-neutral-900, #111827); }
383
+ .sw-section--on-dark {
384
+ color: #ffffff;
385
+ --sw-color-text: #ffffff;
386
+ --sw-color-muted: rgba(255, 255, 255, 0.92);
387
+ --sw-color-border: rgba(255, 255, 255, 0.28);
388
+ }
389
+ /* Two classes on the section and two on the card, so these beat a Cards style from Brand (three classes) whatever the order. */
390
+ .sw-section--on-dark a:where(:not(.sw-button)),
391
+ .sw-section--on-dark .sw-button--secondary,
392
+ .sw-section--on-dark .sw-button--link,
393
+ .sw-section.sw-section--on-dark .sw-card .sw-card__more { color: inherit; }
394
+ .sw-section.sw-section--on-dark .sw-cards .sw-card { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.28); color: inherit; }
395
+ .sw-section--bg-primary .sw-button--primary {
396
+ background: var(--sw-color-primary-contrast, #ffffff);
397
+ border-color: var(--sw-color-primary-contrast, #ffffff);
398
+ color: var(--sw-color-primary, #1d4ed8);
399
+ }
400
+
401
+ /* ---------- Call to action ---------- */
402
+
403
+ .sw-cta__box {
404
+ padding: var(--sw-space-4) var(--sw-space-3);
405
+ text-align: center;
406
+ }
407
+ .sw-cta--band {
408
+ background: var(--sw-color-primary, #1d4ed8);
409
+ color: var(--sw-color-primary-contrast, #ffffff);
410
+ --sw-color-muted: rgba(255, 255, 255, 0.92);
411
+ }
412
+ .sw-cta--band .sw-cta__box { padding-inline: 0; }
413
+ .sw-cta--band .sw-button--primary {
414
+ background: var(--sw-color-primary-contrast, #ffffff);
415
+ border-color: var(--sw-color-primary-contrast, #ffffff);
416
+ color: var(--sw-color-primary, #1d4ed8);
417
+ }
418
+ .sw-cta--band .sw-button--primary:hover { background: rgba(255, 255, 255, 0.9); }
419
+ .sw-cta--card .sw-cta__box {
420
+ border: 1px solid var(--sw-color-border);
421
+ border-radius: var(--sw-radius, 8px);
422
+ background: var(--sw-color-surface);
423
+ }
424
+ .sw-cta__title { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.25rem); }
425
+ .sw-cta__text {
426
+ max-width: 40rem;
427
+ margin: var(--sw-space-2) auto 0;
428
+ color: var(--sw-color-muted);
429
+ }
430
+ .sw-cta .sw-actions { justify-content: center; }
431
+
432
+ /* ---------- Cards ---------- */
433
+
434
+ .sw-cards__grid {
435
+ display: grid;
436
+ gap: var(--sw-space-3);
437
+ grid-template-columns: 1fr;
438
+ list-style: none;
439
+ margin: 0;
440
+ padding: 0;
441
+ }
442
+ @media (min-width: 640px) {
443
+ .sw-cards__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
444
+ }
445
+ @media (min-width: 900px) {
446
+ .sw-cards--3 .sw-cards__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
447
+ .sw-cards--4 .sw-cards__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
448
+ }
449
+ .sw-card {
450
+ display: flex;
451
+ flex-direction: column;
452
+ overflow: hidden;
453
+ border: 1px solid var(--sw-color-border);
454
+ border-radius: var(--sw-radius, 8px);
455
+ background: var(--sw-color-bg, #ffffff);
456
+ }
457
+ .sw-card__image {
458
+ display: block;
459
+ width: 100%;
460
+ aspect-ratio: 16 / 9;
461
+ object-fit: cover;
462
+ }
463
+ .sw-card__body {
464
+ flex: 1;
465
+ display: flex;
466
+ flex-direction: column;
467
+ gap: var(--sw-space-1);
468
+ padding: var(--sw-space-3);
469
+ }
470
+ .sw-card__title { font-size: 1.25rem; }
471
+ .sw-card__title a { color: inherit; text-decoration: none; }
472
+ .sw-card__title a::after { content: ""; position: absolute; inset: 0; }
473
+ .sw-card--link { position: relative; transition: border-color 120ms ease, transform 120ms ease; }
474
+ .sw-card--link:hover { border-color: var(--sw-color-primary, #1d4ed8); }
475
+ .sw-card--link:focus-within { box-shadow: var(--sw-focus-ring); }
476
+ .sw-card__text { color: var(--sw-color-muted); }
477
+ .sw-card__more {
478
+ margin-top: auto;
479
+ padding-top: var(--sw-space-1);
480
+ font-weight: 600;
481
+ color: var(--sw-color-primary, #1d4ed8);
482
+ }
483
+
484
+ /* ---------- Spacer and divider ---------- */
485
+
486
+ .sw-spacer { padding: 0; }
487
+ .sw-spacer--s { height: var(--sw-space-2); }
488
+ .sw-spacer--m { height: var(--sw-space-4); }
489
+ .sw-spacer--l { height: var(--sw-space-5); }
490
+ .sw-spacer--xl { height: var(--sw-space-6); }
491
+ .sw-divider { padding-block: var(--sw-space-2); }
492
+ .sw-divider__rule {
493
+ margin: 0;
494
+ border: 0;
495
+ border-top: 1px solid var(--sw-color-border);
496
+ }
497
+
498
+ /* ---------- Embed ---------- */
499
+
500
+ .sw-embed__frame {
501
+ position: relative;
502
+ width: 100%;
503
+ aspect-ratio: 16 / 9;
504
+ overflow: hidden;
505
+ border-radius: var(--sw-radius, 8px);
506
+ background: var(--sw-color-surface);
507
+ }
508
+ .sw-embed__frame iframe,
509
+ .sw-embed__frame video,
510
+ .sw-embed__frame embed,
511
+ .sw-embed__frame object {
512
+ position: absolute;
513
+ inset: 0;
514
+ width: 100%;
515
+ height: 100%;
516
+ border: 0;
517
+ }
518
+ .sw-embed__caption {
519
+ margin-top: var(--sw-space-1);
520
+ font-size: 0.9rem;
521
+ color: var(--sw-color-muted);
522
+ }
523
+ /* An embed waiting for consent: the notice takes the frame's place until the visitor allows it. */
524
+ .sw-embed__frame:has(iframe[data-sw-consent-src]) { display: none; }
525
+ .sw-embed__consent {
526
+ display: grid;
527
+ place-content: center;
528
+ justify-items: center;
529
+ gap: var(--sw-space-2);
530
+ aspect-ratio: 16 / 9;
531
+ padding: var(--sw-space-3);
532
+ text-align: center;
533
+ border: 1px dashed var(--sw-color-border);
534
+ border-radius: var(--sw-radius, 8px);
535
+ background: var(--sw-color-surface);
536
+ }
537
+ .sw-embed__consent-text { margin: 0; max-width: 46ch; }
538
+ .sw-embed__consent-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; justify-content: center; align-items: center; }
539
+ .sw-embed__consent-link { color: var(--sw-color-primary); }
540
+ @media (max-width: 640px) { .sw-embed__consent { aspect-ratio: auto; } }
541
+
542
+ ${collectionCss}
543
+ ${calendarCss}
544
+ ${galleryCss}
545
+ ${searchCss}
546
+ ${askCss}
547
+ ${menuBlockCss}
548
+ /* ---------- Regions (Structure, Placements) ----------
549
+ Blocks placed above the content, beside it in a sidebar, or below it. The main column comes first in the document; from
550
+ 900 px the sidebars sit beside it, below that they follow it. Inside the grid the page's own containers drop their gutter. */
551
+ .sw-with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; max-width: var(--sw-max-width, 1120px); margin-inline: auto; padding-inline: 1rem; }
552
+ .sw-with-sidebar .sw-region-main .sw-container { padding-inline: 0; max-width: none; }
553
+ .sw-with-sidebar > .sw-region { padding-block: 2.5rem 1rem; min-width: 0; }
554
+ .sw-with-sidebar > .sw-region .sw-container { padding-inline: 0; }
555
+ .sw-with-sidebar > .sw-region .sw-block { padding-block: 0 1.75rem; }
556
+ :where(.sw-with-sidebar > .sw-region) .sw-page :where(h2) { font-size: 1.15rem; }
557
+ @media (min-width: 900px) {
558
+ .sw-with-sidebar--right { grid-template-columns: minmax(0, 1fr) 17rem; grid-template-areas: "main right"; gap: 3rem; }
559
+ .sw-with-sidebar--left { grid-template-columns: 15rem minmax(0, 1fr); grid-template-areas: "left main"; gap: 3rem; }
560
+ .sw-with-sidebar--left.sw-with-sidebar--right { grid-template-columns: 14rem minmax(0, 1fr) 15rem; grid-template-areas: "left main right"; gap: 2.5rem; }
561
+ .sw-with-sidebar .sw-region-main { grid-area: main; }
562
+ .sw-with-sidebar .sw-region--sidebar-left { grid-area: left; }
563
+ .sw-with-sidebar .sw-region--sidebar-right { grid-area: right; }
564
+ }
565
+ ${FORM_CSS}
566
+ ${sharedCss}
567
+ ${islandCss}
568
+ ${registrySharedCss}
569
+ ${registryBrowseCss}
570
+ ${registryPackageCss}
571
+ ${registryStatsCss}
572
+ ${themeGalleryCss}
573
+ ${publisherProfileCss}
574
+ ${orgProfileCss}
575
+ ${docsFeedbackCss}
576
+ ${moduleBlockCss}
577
+ ${statusBoardCss}
578
+ /* ---------- Space above and below ---------- */
579
+
580
+ /* Set per block in the page builder (Space above, Space below). An explicit step wins over the automatic rhythm, the
581
+ hero's and the section's own padding and a style's, so it carries !important; Auto adds no class. */
582
+ .sw-space-above-none { padding-top: 0 !important; }
583
+ .sw-space-above-s { padding-top: var(--sw-space-2) !important; }
584
+ .sw-space-above-m { padding-top: var(--sw-space-4) !important; }
585
+ .sw-space-above-l { padding-top: var(--sw-space-5) !important; }
586
+ .sw-space-above-xl { padding-top: var(--sw-space-6) !important; }
587
+ .sw-space-below-none { padding-bottom: 0 !important; }
588
+ .sw-space-below-s { padding-bottom: var(--sw-space-2) !important; }
589
+ .sw-space-below-m { padding-bottom: var(--sw-space-4) !important; }
590
+ .sw-space-below-l { padding-bottom: var(--sw-space-5) !important; }
591
+ .sw-space-below-xl { padding-bottom: var(--sw-space-6) !important; }
592
+
593
+ /* ---------- Reduced motion ---------- */
594
+
595
+ ${MARKETING_CSS}
596
+ @media (prefers-reduced-motion: reduce) {
597
+ .sw-page * { transition: none !important; }
598
+ }
599
+ `;
600
+ //# sourceMappingURL=css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.js","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,CAAC,MAAM,QAAQ,GAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4f9B,aAAa;EACb,WAAW;EACX,UAAU;EACV,SAAS;EACT,MAAM;EACN,YAAY;;;;;;;;;;;;;;;;;;EAkBZ,QAAQ;EACR,SAAS;EACT,SAAS;EACT,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB;EAClB,gBAAgB;EAChB,eAAe;EACf,mBAAmB;EACnB,aAAa;EACb,eAAe;EACf,cAAc;EACd,cAAc;;;;;;;;;;;;;;;;;;EAkBd,aAAa;;;;CAId,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * DocsFeedback: "Was this page helpful?" at the end of a documentation page. Two submit buttons (Yes, No)
3
+ * and an optional comment post to a form the site defines (`docs_feedback` by default) through the Form
4
+ * block's public submit path, with the page path and the documented version as hidden fields. No personal
5
+ * data is asked for; the forms module's honeypot, time-to-submit rule and rate limit apply like for any form.
6
+ *
7
+ * Server-safe: a plain HTML form that works without JavaScript (the server answers with a redirect back to
8
+ * the page and `?form=<key>&sent=1`, which the block reads to show the thanks line). The server resolves
9
+ * `formKey`'s existence, the page path and the CSP nonce before render; without a resolved form the block
10
+ * renders a placeholder so the editor still shows where it sits.
11
+ */
12
+ import type { ComponentConfig } from '@puckeditor/core';
13
+ export interface DocsFeedbackProps {
14
+ /** The key of the form that stores the answers (fields: helpful, comment, page, version). */
15
+ formKey: string;
16
+ question: string;
17
+ yesLabel: string;
18
+ noLabel: string;
19
+ commentLabel: string;
20
+ thanksText: string;
21
+ /** The documented version, recorded with every answer (the docs kit fills it at import time). */
22
+ version: string;
23
+ /** Resolved by the server; never stored. */
24
+ resolved?: {
25
+ path: string;
26
+ sent: boolean;
27
+ error: boolean;
28
+ } | null;
29
+ nonce?: string;
30
+ }
31
+ /** Runs once per page: when the browser has fetch, posts the answer in place and shows the thanks line without leaving the page. */
32
+ export declare const DOCS_FEEDBACK_SCRIPT = "(function(){var fs=document.querySelectorAll('form[data-sw-docs-feedback]:not([data-sw-bound])');\nfor(var i=0;i<fs.length;i++)bind(fs[i]);\nfunction bind(f){f.setAttribute('data-sw-bound','1');var t=f.querySelector('input[name=\"_t\"]');if(t)t.value=String(Date.now());\nvar p=f.querySelector('input[name=\"_page\"]');if(p)p.value=location.href;var pg=f.querySelector('input[name=\"page\"]');if(pg&&!pg.value)pg.value=location.pathname;\nvar done=function(ok){var s=f.querySelector('[data-sw-docs-status]');if(!s)return;s.hidden=false;s.textContent=ok?f.getAttribute('data-sw-thanks'):'Something went wrong. Please try again.';var b=f.querySelector('.sw-docs-feedback__body');if(b&&ok)b.hidden=true};\nvar clicked=null;var btns=f.querySelectorAll('button[name=\"helpful\"]');for(var k=0;k<btns.length;k++)btns[k].addEventListener('click',function(e){clicked=e.currentTarget});\nf.addEventListener('submit',function(ev){if(!window.fetch)return;ev.preventDefault();var o={};var els=f.querySelectorAll('input,textarea');for(var j=0;j<els.length;j++){if(els[j].name)o[els[j].name]=els[j].value}if(clicked)o.helpful=clicked.value;\nfor(var m=0;m<btns.length;m++)btns[m].disabled=true;\nfetch(f.getAttribute('action'),{method:'POST',credentials:'same-origin',headers:{'Content-Type':'application/json','Accept':'application/json'},body:JSON.stringify(o)})\n.then(function(r){done(r.ok);if(!r.ok)for(var m=0;m<btns.length;m++)btns[m].disabled=false}).catch(function(){HTMLFormElement.prototype.submit.call(f)})})}})();";
33
+ export declare const docsFeedbackComponent: ComponentConfig<DocsFeedbackProps>;
34
+ export declare const docsFeedbackCss = "/* ---------- Docs feedback ---------- */\n\n.sw-docs-feedback { padding: var(--sw-space-3) 0 var(--sw-space-4); }\n.sw-docs-feedback__form { padding: var(--sw-space-3); border: 1px solid var(--sw-color-border); border-radius: var(--sw-radius, 8px); background: var(--sw-color-surface); }\n.sw-docs-feedback__question { margin: 0 0 var(--sw-space-2); font-weight: 600; }\n.sw-docs-feedback__comment { display: grid; gap: 0.35rem; margin-bottom: var(--sw-space-2); font-size: 0.9rem; color: var(--sw-color-muted); }\n.sw-docs-feedback__comment textarea { width: 100%; padding: 0.55rem 0.7rem; font: inherit; color: var(--sw-color-text); background: var(--sw-color-bg); border: 1px solid var(--sw-color-border); border-radius: var(--sw-radius, 8px); resize: vertical; }\n.sw-docs-feedback__comment textarea:focus-visible { outline: none; border-color: var(--sw-color-primary); box-shadow: var(--sw-focus-ring); }\n.sw-docs-feedback__buttons { display: flex; gap: var(--sw-space-1); flex-wrap: wrap; }\n.sw-docs-feedback__buttons button { font: inherit; cursor: pointer; }\n.sw-docs-feedback__buttons button[disabled] { opacity: 0.6; cursor: progress; }\n.sw-docs-feedback__status { margin: 0; font-weight: 500; }\n.sw-docs-feedback__status[hidden], .sw-docs-feedback__body[hidden] { display: none; }\n.sw-docs-feedback__placeholder { padding: var(--sw-space-2); border: 1px dashed var(--sw-color-border); border-radius: var(--sw-radius, 8px); color: var(--sw-color-muted); font-size: 0.9rem; text-align: center; }\n";