@cogenta/theme-restaurant 0.3.3 → 0.5.3

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 (138) hide show
  1. package/dist/src/index.d.ts +3 -0
  2. package/dist/src/index.d.ts.map +1 -1
  3. package/dist/src/index.js +3 -0
  4. package/dist/src/index.js.map +1 -1
  5. package/dist/src/render/blocks/accordion.d.ts +7 -0
  6. package/dist/src/render/blocks/accordion.d.ts.map +1 -1
  7. package/dist/src/render/blocks/accordion.js +10 -16
  8. package/dist/src/render/blocks/accordion.js.map +1 -1
  9. package/dist/src/render/blocks/collection-list.d.ts +4 -11
  10. package/dist/src/render/blocks/collection-list.d.ts.map +1 -1
  11. package/dist/src/render/blocks/collection-list.js +96 -96
  12. package/dist/src/render/blocks/collection-list.js.map +1 -1
  13. package/dist/src/render/blocks/cta.d.ts +7 -4
  14. package/dist/src/render/blocks/cta.d.ts.map +1 -1
  15. package/dist/src/render/blocks/cta.js +9 -7
  16. package/dist/src/render/blocks/cta.js.map +1 -1
  17. package/dist/src/render/blocks/embed.d.ts.map +1 -1
  18. package/dist/src/render/blocks/embed.js +30 -28
  19. package/dist/src/render/blocks/embed.js.map +1 -1
  20. package/dist/src/render/blocks/faq.d.ts +13 -1
  21. package/dist/src/render/blocks/faq.d.ts.map +1 -1
  22. package/dist/src/render/blocks/faq.js +15 -11
  23. package/dist/src/render/blocks/faq.js.map +1 -1
  24. package/dist/src/render/blocks/feature-grid.d.ts.map +1 -1
  25. package/dist/src/render/blocks/feature-grid.js +43 -16
  26. package/dist/src/render/blocks/feature-grid.js.map +1 -1
  27. package/dist/src/render/blocks/gallery.d.ts +0 -7
  28. package/dist/src/render/blocks/gallery.d.ts.map +1 -1
  29. package/dist/src/render/blocks/gallery.js +28 -10
  30. package/dist/src/render/blocks/gallery.js.map +1 -1
  31. package/dist/src/render/blocks/hero.d.ts +16 -9
  32. package/dist/src/render/blocks/hero.d.ts.map +1 -1
  33. package/dist/src/render/blocks/hero.js +27 -20
  34. package/dist/src/render/blocks/hero.js.map +1 -1
  35. package/dist/src/render/blocks/logo-strip.d.ts +6 -0
  36. package/dist/src/render/blocks/logo-strip.d.ts.map +1 -1
  37. package/dist/src/render/blocks/logo-strip.js +7 -9
  38. package/dist/src/render/blocks/logo-strip.js.map +1 -1
  39. package/dist/src/render/blocks/logos.d.ts +8 -0
  40. package/dist/src/render/blocks/logos.d.ts.map +1 -1
  41. package/dist/src/render/blocks/logos.js +18 -18
  42. package/dist/src/render/blocks/logos.js.map +1 -1
  43. package/dist/src/render/blocks/media-figure.d.ts +14 -3
  44. package/dist/src/render/blocks/media-figure.d.ts.map +1 -1
  45. package/dist/src/render/blocks/media-figure.js +34 -16
  46. package/dist/src/render/blocks/media-figure.js.map +1 -1
  47. package/dist/src/render/blocks/pricing-table.d.ts.map +1 -1
  48. package/dist/src/render/blocks/pricing-table.js +17 -22
  49. package/dist/src/render/blocks/pricing-table.js.map +1 -1
  50. package/dist/src/render/blocks/prose.d.ts +11 -6
  51. package/dist/src/render/blocks/prose.d.ts.map +1 -1
  52. package/dist/src/render/blocks/prose.js +13 -7
  53. package/dist/src/render/blocks/prose.js.map +1 -1
  54. package/dist/src/render/blocks/quote.d.ts +6 -2
  55. package/dist/src/render/blocks/quote.d.ts.map +1 -1
  56. package/dist/src/render/blocks/quote.js +14 -12
  57. package/dist/src/render/blocks/quote.js.map +1 -1
  58. package/dist/src/render/blocks/stat-counter.d.ts +6 -0
  59. package/dist/src/render/blocks/stat-counter.d.ts.map +1 -1
  60. package/dist/src/render/blocks/stat-counter.js +7 -10
  61. package/dist/src/render/blocks/stat-counter.js.map +1 -1
  62. package/dist/src/render/blocks/stats.d.ts +7 -0
  63. package/dist/src/render/blocks/stats.d.ts.map +1 -1
  64. package/dist/src/render/blocks/stats.js +8 -16
  65. package/dist/src/render/blocks/stats.js.map +1 -1
  66. package/dist/src/render/blocks/testimonial.d.ts +5 -11
  67. package/dist/src/render/blocks/testimonial.d.ts.map +1 -1
  68. package/dist/src/render/blocks/testimonial.js +9 -17
  69. package/dist/src/render/blocks/testimonial.js.map +1 -1
  70. package/dist/src/render/chrome.d.ts.map +1 -1
  71. package/dist/src/render/chrome.js +101 -84
  72. package/dist/src/render/chrome.js.map +1 -1
  73. package/dist/src/render/dish.d.ts +13 -0
  74. package/dist/src/render/dish.d.ts.map +1 -0
  75. package/dist/src/render/dish.js +84 -0
  76. package/dist/src/render/dish.js.map +1 -0
  77. package/dist/src/render/layout.d.ts +23 -0
  78. package/dist/src/render/layout.d.ts.map +1 -0
  79. package/dist/src/render/layout.js +33 -0
  80. package/dist/src/render/layout.js.map +1 -0
  81. package/dist/src/render/menu.d.ts +53 -0
  82. package/dist/src/render/menu.d.ts.map +1 -0
  83. package/dist/src/render/menu.js +99 -0
  84. package/dist/src/render/menu.js.map +1 -0
  85. package/dist/src/render/render-block.d.ts +19 -0
  86. package/dist/src/render/render-block.d.ts.map +1 -1
  87. package/dist/src/render/render-block.js +50 -39
  88. package/dist/src/render/render-block.js.map +1 -1
  89. package/dist/src/render/strings.d.ts +15 -0
  90. package/dist/src/render/strings.d.ts.map +1 -0
  91. package/dist/src/render/strings.js +23 -0
  92. package/dist/src/render/strings.js.map +1 -0
  93. package/dist/src/render/term-archive.d.ts +10 -4
  94. package/dist/src/render/term-archive.d.ts.map +1 -1
  95. package/dist/src/render/term-archive.js +25 -16
  96. package/dist/src/render/term-archive.js.map +1 -1
  97. package/dist/src/render/widget-areas.d.ts +13 -0
  98. package/dist/src/render/widget-areas.d.ts.map +1 -0
  99. package/dist/src/render/widget-areas.js +20 -0
  100. package/dist/src/render/widget-areas.js.map +1 -0
  101. package/dist/theme.config.d.ts +1 -1
  102. package/dist/theme.config.js +2 -2
  103. package/dist/theme.config.js.map +1 -1
  104. package/package.json +5 -5
  105. package/src/index.ts +3 -0
  106. package/src/render/blocks/accordion.ts +18 -47
  107. package/src/render/blocks/collection-list.ts +245 -133
  108. package/src/render/blocks/cta.ts +20 -11
  109. package/src/render/blocks/embed.ts +45 -36
  110. package/src/render/blocks/faq.ts +32 -25
  111. package/src/render/blocks/feature-grid.ts +83 -33
  112. package/src/render/blocks/gallery.ts +39 -21
  113. package/src/render/blocks/hero.ts +41 -34
  114. package/src/render/blocks/logo-strip.ts +27 -25
  115. package/src/render/blocks/logos.ts +34 -43
  116. package/src/render/blocks/media-figure.ts +49 -24
  117. package/src/render/blocks/pricing-table.ts +30 -42
  118. package/src/render/blocks/prose.ts +18 -9
  119. package/src/render/blocks/quote.ts +29 -19
  120. package/src/render/blocks/stat-counter.ts +24 -29
  121. package/src/render/blocks/stats.ts +30 -40
  122. package/src/render/blocks/testimonial.ts +17 -22
  123. package/src/render/chrome.ts +113 -95
  124. package/src/render/dish.ts +195 -0
  125. package/src/render/layout.ts +64 -0
  126. package/src/render/menu.ts +117 -0
  127. package/src/render/render-block.ts +51 -40
  128. package/src/render/strings.ts +44 -0
  129. package/src/render/term-archive.ts +78 -44
  130. package/src/render/widget-areas.ts +23 -0
  131. package/src/styles/archive.css +46 -56
  132. package/src/styles/base.css +803 -550
  133. package/src/styles/blocks.css +723 -641
  134. package/src/styles/menu.css +482 -0
  135. package/src/styles/theme.css +24 -25
  136. package/src/styles/tokens.css +239 -225
  137. package/src/styles/widgets.css +853 -0
  138. package/tokens.json +16 -16
@@ -1,17 +1,21 @@
1
- import { blockHeadingTag, h, heading, renderRichText, } from '@cogenta/theme-kit';
1
+ import { h, nestedHeadingTag, renderRichText, } from '@cogenta/theme-kit';
2
+ import { section, sectionHead } from '../layout.js';
2
3
  /**
3
- * `<details>`/`<summary>` — zero bytes of JavaScript. Kept visually distinct
4
- * from `accordion` (this theme's own "Hours & location"): each question
5
- * carries a small serif numeral rather than the plus/minus mark, the
6
- * "questions before you book" register of a restaurant's own FAQ.
4
+ * Questions before a visit (a table for eight, a child's plate, a dog in the
5
+ * room), in two columns on a wide screen: the title on the first four, and
6
+ * the questions on the last eight, each under a hairline.
7
+ *
8
+ * Every answer is a `<details>`: it opens without a script and is found by
9
+ * the browser's own search. The question sits in a real heading inside the
10
+ * summary, so a screen reader's heading list still reaches every one of
11
+ * them. The plus that turns into a minus is two hairlines drawn by the
12
+ * stylesheet, not a glyph.
7
13
  */
8
- function renderItem(item, ctx, index) {
9
- const number = String(index + 1).padStart(2, '0');
10
- return h('li', { class: 'cg-faq__item' }, h('details', { class: 'cg-faq__details' }, h('summary', { class: 'cg-faq__question' }, h('span', { class: 'cg-faq__index', 'aria-hidden': 'true' }, number), h('span', { class: 'cg-faq__question-text' }, item.question)), h('div', { class: 'cg-faq__answer' }, renderRichText(ctx, item.answer))));
14
+ export function answerItem(item, ctx, blockName, titled) {
15
+ return h('li', { class: 'cr-answers__item' }, h('details', { class: 'cr-answers__details' }, h('summary', { class: 'cr-answers__summary' }, h(nestedHeadingTag(blockName, titled), { class: 'cr-answers__question' }, item.question), h('span', { class: 'cr-answers__mark', 'aria-hidden': 'true' })), h('div', { class: 'cr-answers__answer' }, renderRichText(ctx, item.answer))));
11
16
  }
12
17
  export function renderFaq(block, ctx) {
13
- return h('section', { class: 'cg-faq', 'data-block': 'faq' }, block.title === undefined
14
- ? null
15
- : heading(blockHeadingTag('faq') ?? 'h2', { class: 'cg-faq__title', 'data-field': 'title' }, block.title), h('ul', { class: 'cg-faq__items' }, block.items.map((item, index) => renderItem(item, ctx, index))));
18
+ const titled = block.title !== undefined;
19
+ return section('section', 'faq', 'cr-answers', { 'data-titled': String(titled) }, 'div', sectionHead('faq', block.title), h('ul', { class: 'cr-answers__items' }, block.items.map((item) => answerItem(item, ctx, 'faq', titled))));
16
20
  }
17
21
  //# sourceMappingURL=faq.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"faq.js","sourceRoot":"","sources":["../../../../src/render/blocks/faq.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAEf,CAAC,EACD,OAAO,EAEP,cAAc,GACf,MAAM,oBAAoB,CAAA;AAE3B;;;;;GAKG;AACH,SAAS,UAAU,CAA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E,mBAAmB,EAAE,EAC9B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAChE,CACF,CAAA;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature-grid.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/feature-grid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAGL,KAAK,WAAW,EAKhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AA8B3B,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAmB1F"}
1
+ {"version":3,"file":"feature-grid.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/feature-grid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,iBAAiB,CAAA;AACpE,OAAO,EACL,KAAK,WAAW,EAKhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AAuE3B,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA8B1F"}
@@ -1,24 +1,51 @@
1
- import { blockHeadingTag, h, heading, href, nestedHeadingTag, renderIcon, } from '@cogenta/theme-kit';
1
+ import { h, heading, href, nestedHeadingTag, renderIcon, } from '@cogenta/theme-kit';
2
+ import { section, sectionHead } from '../layout.js';
2
3
  /**
3
- * A row of three centred columns, each topped by a thin circular icon mark —
4
- * the "how we cook" / "what makes this kitchen" convention, never a boxed
5
- * feature card.
4
+ * Two readings of the same block, chosen by its content rather than by a
5
+ * setting:
6
+ *
7
+ * - **A ruled table**, when no item names an icon. The items are facts a
8
+ * guest looks up (lunch, dinner, the address, the metro stop; a supplier
9
+ * and what they bring), so they are set like the back of a menu card: the
10
+ * title of the table on the first four columns, then one row per item under
11
+ * a hairline, its name in the serif on the left and its sentence on the
12
+ * right. A name with a link is an arrow link.
13
+ * - **Ruled columns**, when an item names an icon this theme can draw: a
14
+ * small line icon, the name, its sentence, each column under a hairline.
15
+ * Never a tinted tile behind an icon, never a card.
6
16
  */
7
- function renderItem(item, ctx, tag) {
8
- const title = item.link === undefined
9
- ? heading(tag, { class: 'cg-craft__title' }, item.title)
10
- : heading(tag, { class: 'cg-craft__title' }, h('a', { class: 'cg-craft__link', href: href(ctx, item.link) }, item.title));
17
+ function hasIcons(block) {
18
+ return block.items.some((item) => item.icon !== undefined);
19
+ }
20
+ function name(item, ctx, className) {
21
+ return item.link === undefined
22
+ ? item.title
23
+ : h('a', { class: `cr-arrow-link ${className}`, href: href(ctx, item.link) }, item.title);
24
+ }
25
+ /**
26
+ * In a table the link belongs to the value a guest acts on (the telephone
27
+ * number, the address), not to its label: "Telephone" is a heading, the
28
+ * number is what they tap. A row with no sentence links its label instead.
29
+ */
30
+ function row(item, ctx, titled) {
31
+ const label = heading(nestedHeadingTag('featureGrid', titled), { class: 'cr-table__label' }, item.text === undefined ? name(item, ctx, 'cr-table__link') : item.title);
32
+ if (item.text === undefined)
33
+ return h('li', { class: 'cr-table__row' }, label);
34
+ return h('li', { class: 'cr-table__row' }, label, h('p', { class: 'cr-table__text' }, item.link === undefined
35
+ ? item.text
36
+ : h('a', { class: 'cr-table__value-link', href: href(ctx, item.link) }, item.text)));
37
+ }
38
+ function column(item, ctx, titled) {
11
39
  const icon = item.icon === undefined
12
40
  ? null
13
- : (renderIcon(item.icon, { className: 'cg-craft__glyph' }) ??
14
- h('span', { class: 'cg-craft__mark-fallback', 'data-icon': item.icon }));
15
- return h('li', { class: 'cg-craft__item' }, icon === null ? null : h('span', { class: 'cg-craft__mark', 'aria-hidden': 'true' }, icon), title, item.text === undefined ? null : h('p', { class: 'cg-craft__text' }, item.text));
41
+ : renderIcon(item.icon, { className: 'cr-columns__icon', size: 22 });
42
+ return h('li', { class: 'cr-columns__item' }, icon, heading(nestedHeadingTag('featureGrid', titled), { class: 'cr-columns__name' }, name(item, ctx, 'cr-columns__link')), item.text === undefined ? null : h('p', { class: 'cr-columns__text' }, item.text));
16
43
  }
17
44
  export function renderFeatureGrid(block, ctx) {
18
- const hasTitle = block.title !== undefined;
19
- const itemTag = nestedHeadingTag('featureGrid', hasTitle);
20
- return h('section', { class: 'cg-craft', 'data-block': 'featureGrid' }, hasTitle
21
- ? heading(blockHeadingTag('featureGrid') ?? 'h2', { class: 'cg-craft__title-heading', 'data-field': 'title' }, block.title ?? '')
22
- : null, h('ul', { class: 'cg-craft__items' }, block.items.map((item) => renderItem(item, ctx, itemTag))));
45
+ const titled = block.title !== undefined;
46
+ if (!hasIcons(block)) {
47
+ return section('section', 'featureGrid', 'cr-table', { 'data-titled': String(titled) }, 'div', sectionHead('featureGrid', block.title), h('ul', { class: 'cr-table__rows' }, block.items.map((item) => row(item, ctx, titled))));
48
+ }
49
+ return section('section', 'featureGrid', 'cr-columns', { 'data-titled': String(titled), 'data-count': String(Math.min(block.items.length, 4)) }, 'div', sectionHead('featureGrid', block.title), h('ul', { class: 'cr-columns__items' }, block.items.map((item) => column(item, ctx, titled))));
23
50
  }
24
51
  //# sourceMappingURL=feature-grid.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature-grid.js","sourceRoot":"","sources":["../../../../src/render/blocks/feature-grid.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAGf,CAAC,EACD,OAAO,EACP,IAAI,EACJ,gBAAgB,EAEhB,UAAU,GACX,MAAM,oBAAoB,CAAA;AAE3B;;;;GAIG;AACH,SAAS,UAAU,CAAC,IAAiB,EAAE,GAAkB,EAAE,GAAe;IACxE,MAAM,KAAK,GACT,IAAI,CAAC,IAAI,KAAK,SAAS;QACrB,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,IAAI,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AK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CACrD,CACF,CAAA;AACH,CAAC"}
@@ -1,11 +1,4 @@
1
1
  import type { GalleryBlock } from '@cogenta/blocks';
2
2
  import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
3
- /**
4
- * Ships **no JavaScript**. `layout: 'masonry'` (the dining-room gallery this
5
- * theme's own blueprint seeds) is a CSS multi-column flow — `column-count`
6
- * with `break-inside: avoid` on each tile — which needs no measurement pass
7
- * a script would otherwise have to do; `grid`/`carousel` keep the same
8
- * zero-JS scroll-snapping list every other layout in this theme uses.
9
- */
10
3
  export declare function renderGallery(block: GalleryBlock, ctx: RenderContext): HtmlElement;
11
4
  //# sourceMappingURL=gallery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/gallery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEnF;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA6BlF"}
1
+ {"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/gallery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAoBnF,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAoClF"}
@@ -1,20 +1,38 @@
1
1
  import { h, image } from '@cogenta/theme-kit';
2
+ import { section } from '../layout.js';
2
3
  /**
3
- * Ships **no JavaScript**. `layout: 'masonry'` (the dining-room gallery this
4
- * theme's own blueprint seeds) is a CSS multi-column flow — `column-count`
5
- * with `break-inside: avoid` on each tile — which needs no measurement pass
6
- * a script would otherwise have to do; `grid`/`carousel` keep the same
7
- * zero-JS scroll-snapping list every other layout in this theme uses.
4
+ * Photographs of plates and of the room, in the three layouts contract B
5
+ * names:
6
+ *
7
+ * - `grid`: a band of dish photographs, every one cropped to the same 4:5
8
+ * portrait, four across on a wide screen (three when the count divides by
9
+ * three, so a row is never left with one picture), two on a phone.
10
+ * - `masonry`: three columns of pictures at their own proportions.
11
+ * - `carousel`: a row of 4:5 crops that scrolls sideways, with native scroll
12
+ * snapping. It is a focusable, labelled region so the row can be scrolled
13
+ * from the keyboard; no script drives it.
8
14
  */
15
+ function columnsFor(count) {
16
+ if (count <= 2)
17
+ return count;
18
+ return count % 3 === 0 ? 3 : 4;
19
+ }
9
20
  export function renderGallery(block, ctx) {
10
- const items = h('ul', { class: 'cg-gallery__items' }, block.items.map((item) => h('li', { class: 'cg-gallery__item' }, image(ctx, item.media, { sizes: '(min-width: 48rem) 22rem, 60vw' }))));
11
- return h('section', { class: 'cg-gallery', 'data-block': 'gallery', 'data-layout': block.layout }, block.layout === 'carousel'
21
+ const carousel = block.layout === 'carousel';
22
+ const columns = columnsFor(block.items.length);
23
+ const items = block.items.map((item) => h('li', { class: 'cr-gallery__item' }, image(ctx, item.media, {
24
+ className: 'cr-gallery__image',
25
+ sizes: block.layout === 'grid'
26
+ ? `(min-width: 64rem) ${Math.round(90 / Math.max(columns, 1))}vw, 50vw`
27
+ : '(min-width: 64rem) 30vw, 80vw',
28
+ })));
29
+ return section('div', 'gallery', 'cr-gallery', { 'data-layout': block.layout, 'data-columns': String(columns) }, 'div', carousel
12
30
  ? h('div', {
13
- class: 'cg-gallery__viewport',
31
+ class: 'cr-gallery__viewport',
14
32
  role: 'region',
15
33
  'aria-label': ctx.t('gallery.carousel'),
16
34
  tabindex: '0',
17
- }, items)
18
- : items);
35
+ }, h('ul', { class: 'cr-gallery__items' }, items))
36
+ : h('ul', { class: 'cr-gallery__items' }, items));
19
37
  }
20
38
  //# sourceMappingURL=gallery.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../../../src/render/blocks/gallery.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AAEnF;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,KAAmB,EAAE,GAAkB;IACnE,MAAM,KAAK,GAAG,CAAC,CACb,IAAI,EACJ,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACvB,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,gCAAgC,EAAE,CAAC,CACpE,CACF,CACF,CAAA;IAED,OAAO,CAAC,CACN,SAAS,EACT,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,CAAC,MAAM,EAAE,EAC7E,KAAK,CAAC,MAAM,KAAK,UAAU;QACzB,CAAC,CAAC,CAAC,CACC,KAAK,EACL;YACE,KAAK,EAAE,sBAAsB;YAC7B,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC;YACvC,QAAQ,EAAE,GAAG;SACd,EACD,KAAK,CACN;QACH,CAAC,CAAC,KAAK,CACV,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../../../src/render/blocks/gallery.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AACnF,OAAO,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G;SACd,EACD,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,KAAK,CAAC,CAC/C;QACH,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,KAAK,CAAC,CACnD,CAAA;AACH,CAAC"}
@@ -1,16 +1,23 @@
1
1
  import type { HeroBlock } from '@cogenta/blocks';
2
2
  import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
3
3
  /**
4
- * The full-bleed dining-room hero: the media (when present) fills the whole
5
- * band, a gradient scrim sits between it and the copy so the centred text
6
- * stays legible over a photo of any tone, and the eyebrow/title/subtitle are
7
- * centred — the "elegant restaurant homepage" convention (Divi/Astra
8
- * "Restaurant") rather than the left-aligned marketing hero the other
9
- * built-in themes use.
4
+ * The opening of a page: the photograph of the room across the whole width
5
+ * of the window, then the name of the place set large and light in the
6
+ * display serif, on the page's own ground.
10
7
  *
11
- * The scrim is a CSS gradient composed from `--cg-scrim` (itself derived
12
- * from the skin's own ink, see `tokens.css`), never a literal colour: a
13
- * skin with a lighter ink still gets a scrim tuned to it.
8
+ * The words sit under the picture, never on it. A headline laid over a
9
+ * photograph needs a veil to stay legible on every picture an editor may
10
+ * choose, and a veil over a dining room is exactly what makes it look like
11
+ * every other restaurant template; set on the paper, the name is legible in
12
+ * both schemes whatever the photograph, and the room stays as it was lit.
13
+ *
14
+ * Name on the first eight columns, its baseline shared with the subtitle and
15
+ * the action on the last four. An eyebrow, when there is one, is a line of
16
+ * small capitals above the name, never a badge. Without media the block is
17
+ * the name row alone.
18
+ *
19
+ * The image is the only one on a page loaded eagerly: it is above the fold
20
+ * by construction.
14
21
  */
15
22
  export declare function renderHero(block: HeroBlock, ctx: RenderContext): HtmlElement;
16
23
  //# sourceMappingURL=hero.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hero.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/hero.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAGL,KAAK,WAAW,EAIhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAkC5E"}
1
+ {"version":3,"file":"hero.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/hero.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAc,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAG/F;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAyC5E"}
@@ -1,32 +1,39 @@
1
- import { actionList, blockHeadingTag, h, heading, image, } from '@cogenta/theme-kit';
1
+ import { actionList, h, image } from '@cogenta/theme-kit';
2
+ import { optionalText } from '../layout.js';
2
3
  /**
3
- * The full-bleed dining-room hero: the media (when present) fills the whole
4
- * band, a gradient scrim sits between it and the copy so the centred text
5
- * stays legible over a photo of any tone, and the eyebrow/title/subtitle are
6
- * centred — the "elegant restaurant homepage" convention (Divi/Astra
7
- * "Restaurant") rather than the left-aligned marketing hero the other
8
- * built-in themes use.
4
+ * The opening of a page: the photograph of the room across the whole width
5
+ * of the window, then the name of the place set large and light in the
6
+ * display serif, on the page's own ground.
9
7
  *
10
- * The scrim is a CSS gradient composed from `--cg-scrim` (itself derived
11
- * from the skin's own ink, see `tokens.css`), never a literal colour: a
12
- * skin with a lighter ink still gets a scrim tuned to it.
8
+ * The words sit under the picture, never on it. A headline laid over a
9
+ * photograph needs a veil to stay legible on every picture an editor may
10
+ * choose, and a veil over a dining room is exactly what makes it look like
11
+ * every other restaurant template; set on the paper, the name is legible in
12
+ * both schemes whatever the photograph, and the room stays as it was lit.
13
+ *
14
+ * Name on the first eight columns, its baseline shared with the subtitle and
15
+ * the action on the last four. An eyebrow, when there is one, is a line of
16
+ * small capitals above the name, never a badge. Without media the block is
17
+ * the name row alone.
18
+ *
19
+ * The image is the only one on a page loaded eagerly: it is above the fold
20
+ * by construction.
13
21
  */
14
22
  export function renderHero(block, ctx) {
15
- const tag = blockHeadingTag('hero') ?? 'h1';
23
+ const actions = actionList(ctx, block.actions, ctx.t('hero.actions'));
24
+ const hasAside = block.subtitle !== undefined || actions !== null;
16
25
  return h('section', {
17
- class: 'cg-hero',
26
+ class: 'cr-section cr-hero',
18
27
  'data-block': 'hero',
19
- 'data-has-media': block.media === undefined ? 'false' : 'true',
28
+ 'data-media': block.media === undefined ? 'false' : 'true',
20
29
  }, block.media === undefined
21
30
  ? null
22
- : h('div', { class: 'cg-hero__media' }, image(ctx, block.media, {
23
- className: 'cg-hero__image',
31
+ : h('figure', { class: 'cr-hero__media' }, image(ctx, block.media, {
32
+ className: 'cr-hero__image',
24
33
  loading: 'eager',
25
34
  sizes: '100vw',
26
- }), h('div', { class: 'cg-hero__scrim', 'aria-hidden': 'true' })), h('div', { class: 'cg-hero__body' }, block.eyebrow === undefined
27
- ? null
28
- : h('p', { class: 'cg-hero__eyebrow', 'data-field': 'eyebrow' }, block.eyebrow), heading(tag, { class: 'cg-hero__title', 'data-field': 'title' }, block.title), block.subtitle === undefined
29
- ? null
30
- : h('p', { class: 'cg-hero__subtitle', 'data-field': 'subtitle' }, block.subtitle), actionList(ctx, block.actions, ctx.t('hero.actions'))));
35
+ })), h('div', { class: 'cr-container cr-hero__inner' }, h('div', { class: 'cr-hero__heading' }, optionalText('p', 'cr-hero__eyebrow', block.eyebrow, { 'data-field': 'eyebrow' }), h('h1', { class: 'cr-hero__title', 'data-field': 'title' }, block.title)), hasAside
36
+ ? h('div', { class: 'cr-hero__aside' }, optionalText('p', 'cr-hero__subtitle', block.subtitle, { 'data-field': 'subtitle' }), actions)
37
+ : null));
31
38
  }
32
39
  //# sourceMappingURL=hero.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hero.js","sourceRoot":"","sources":["../../../../src/render/blocks/hero.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,eAAe,EAEf,CAAC,EACD,OAAO,EACP,KAAK,GAEN,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,UAAU,CAAC,KAAgB,EAAE,GAAkB;IAC7D,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,IAAI,CAAA;IAC3C,OAAO,CAAC,CACN,SAAS,EACT;QACE,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE,MAAM;QACpB,gBAAgB,EAAE,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;KAC/D,EACD,KAAK,CAAC,KAAK,KAAK,SAAS;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE;YACtB,SAAS,EAAE,gBAAgB;YAC3B,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,OAAO;SACf,CAAC,EACF,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,CAC7D,EACL,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,eAAe,EAAE,EAC1B,KAAK,CAAC,OAAO,KAAK,SAAS;QACzB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,EACjF,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE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KAAK,CAAC,KAAK,EAAE;YACtB,SAAS,EAAE,gBAAgB;YAC3B,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,OAAO;SACf,CAAC,CACH,EACL,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,6BAA6B,EAAE,EACxC,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,YAAY,CAAC,GAAG,EAAE,kBAAkB,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,EACjF,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CACzE,EACD,QAAQ;QACN,CAAC,CAAC,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,YAAY,CAAC,GAAG,EAAE,mBAAmB,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC,EACpF,OAAO,CACR;QACH,CAAC,CAAC,IAAI,CACT,CACF,CAAA;AACH,CAAC"}
@@ -1,4 +1,10 @@
1
1
  import type { LogoStripBlock } from '@cogenta/blocks';
2
2
  import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
3
+ /**
4
+ * The lighter row of marks: the caption at the caption size on the first
5
+ * three columns, the marks spread along one line across the rest, small and
6
+ * evenly spaced. No links, by contract B; each mark is named by its own alt
7
+ * text from the media library.
8
+ */
3
9
  export declare function renderLogoStrip(block: LogoStripBlock, ctx: RenderContext): HtmlElement;
4
10
  //# sourceMappingURL=logo-strip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logo-strip.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logo-strip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAgBnF,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAiBtF"}
1
+ {"version":3,"file":"logo-strip.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logo-strip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGnF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA0BtF"}
@@ -1,16 +1,14 @@
1
1
  import { h, image } from '@cogenta/theme-kit';
2
+ import { section } from '../layout.js';
2
3
  /**
3
- * `blocks@2.0` (RFC 0001). The lighter-weight "as seen in" row next to
4
- * `logos`: no per-logo name or link, so no accessible-name field to
5
- * require — each image's own alt text (set once, in the media library)
6
- * names it, exactly as `logos` falls back to when a link is absent.
4
+ * The lighter row of marks: the caption at the caption size on the first
5
+ * three columns, the marks spread along one line across the rest, small and
6
+ * evenly spaced. No links, by contract B; each mark is named by its own alt
7
+ * text from the media library.
7
8
  */
8
- function renderItem(item, ctx) {
9
- return h('li', { class: 'cg-press-strip__item' }, image(ctx, item.media, { className: 'cg-press-strip__image', variant: { fit: 'contain' } }));
10
- }
11
9
  export function renderLogoStrip(block, ctx) {
12
- return h('figure', { class: 'cg-press-strip', 'data-block': 'logoStrip' }, h('ul', { class: 'cg-press-strip__items' }, block.logos.map((item) => renderItem(item, ctx))), block.caption === undefined
10
+ return section('div', 'logoStrip', 'cr-strip', { 'data-captioned': String(block.caption !== undefined) }, 'div', block.caption === undefined
13
11
  ? null
14
- : h('figcaption', { class: 'cg-press-strip__caption', 'data-field': 'caption' }, block.caption));
12
+ : h('p', { class: 'cr-strip__caption', 'data-field': 'caption' }, block.caption), h('ul', { class: 'cr-strip__items' }, block.logos.map((logo) => h('li', { class: 'cr-strip__item' }, h('span', { class: 'cr-marks__plate' }, image(ctx, logo.media, { className: 'cr-marks__image', sizes: '10rem' }))))));
15
13
  }
16
14
  //# sourceMappingURL=logo-strip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logo-strip.js","sourceRoot":"","sources":["../../../../src/render/blocks/logo-strip.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AAEnF;;;;;GAKG;AACH,SAAS,UAAU,CAAC,IAAmB,EAAE,GAAkB;IACzD,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,sBAAsB,EAAE,EACjC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,uBAAuB,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,CAC5F,CAAA;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAqB,EAAE,GAAkB;IACvE,OAAO,CAAC,CACN,QAAQ,EACR,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,EACtD,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAClC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CACjD,EACD,KAAK,CAAC,OAAO,KAAK,SAAS;QACzB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,yBAAyB,EAAE,YAAY,EAAE,SAAS,EAAE,EAC7D,KAAK,CAAC,OAAO,CACd,CACN,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"logo-strip.js","sourceRoot":"","sources":["../../../../src/render/blocks/logo-strip.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAAqB,EAAE,GAAkB;IACvE,OAAO,OAAO,CACZ,KAAK,EACL,WAAW,EACX,UAAU,EACV,EAAE,gBAAgB,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,EAAE,EACzD,KAAK,EACL,KAAK,CAAC,OAAO,KAAK,SAAS;QACzB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,EAClF,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACvB,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,CAAC,CACC,MAAM,EACN,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CACzE,CACF,CACF,CACF,CACF,CAAA;AACH,CAAC"}
@@ -1,4 +1,12 @@
1
1
  import type { LogosBlock } from '@cogenta/blocks';
2
2
  import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
3
+ /**
4
+ * Guides, publications, the growers' cooperative: their marks along one
5
+ * ruled row, each set small and in its own colours. A mark drawn for paper
6
+ * sits on a pale plate in the dark scheme so it never disappears.
7
+ *
8
+ * The organisation's name is the mark's accessible name when the media
9
+ * library has no alt text for it, and the link's own name when it links out.
10
+ */
3
11
  export declare function renderLogos(block: LogosBlock, ctx: RenderContext): HtmlElement;
4
12
  //# sourceMappingURL=logos.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logos.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAEL,KAAK,WAAW,EAIhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AA2B3B,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAiB9E"}
1
+ {"version":3,"file":"logos.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGnF;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA+B9E"}
@@ -1,23 +1,23 @@
1
- import { blockHeadingTag, h, heading, image, } from '@cogenta/theme-kit';
1
+ import { h, image } from '@cogenta/theme-kit';
2
+ import { section, sectionHead } from '../layout.js';
2
3
  /**
3
- * "Featured in" / press mentions, held back to a quiet grayscale until
4
- * hovered — contract B says the organisation's name **is** the accessible
5
- * name of the link, so the logo image carries it as `alt` text when the
6
- * media entity has none, and no visually hidden duplicate is added.
4
+ * Guides, publications, the growers' cooperative: their marks along one
5
+ * ruled row, each set small and in its own colours. A mark drawn for paper
6
+ * sits on a pale plate in the dark scheme so it never disappears.
7
+ *
8
+ * The organisation's name is the mark's accessible name when the media
9
+ * library has no alt text for it, and the link's own name when it links out.
7
10
  */
8
- function renderItem(item, ctx) {
9
- const logo = image(ctx, item.media, {
10
- className: 'cg-press__logo',
11
- altFrom: item.name,
12
- variant: { fit: 'contain' },
13
- });
14
- return h('li', { class: 'cg-press__item' }, item.url === undefined
15
- ? logo
16
- : h('a', { class: 'cg-press__link', href: ctx.link(item.url), rel: 'noopener noreferrer' }, logo));
17
- }
18
11
  export function renderLogos(block, ctx) {
19
- return h('section', { class: 'cg-press', 'data-block': 'logos' }, block.title === undefined
20
- ? null
21
- : heading(blockHeadingTag('logos') ?? 'h2', { class: 'cg-press__title', 'data-field': 'title' }, block.title), h('ul', { class: 'cg-press__items' }, block.items.map((item) => renderItem(item, ctx))));
12
+ return section('section', 'logos', 'cr-marks', {}, 'div', sectionHead('logos', block.title), h('ul', { class: 'cr-marks__items' }, block.items.map((item) => {
13
+ const mark = image(ctx, item.media, {
14
+ className: 'cr-marks__image',
15
+ altFrom: item.name,
16
+ sizes: '10rem',
17
+ });
18
+ return h('li', { class: 'cr-marks__item' }, item.url === undefined
19
+ ? h('span', { class: 'cr-marks__plate' }, mark)
20
+ : h('a', { class: 'cr-marks__plate', href: item.url, rel: 'noopener noreferrer' }, mark));
21
+ })));
22
22
  }
23
23
  //# sourceMappingURL=logos.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logos.js","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAEf,CAAC,EACD,OAAO,EACP,KAAK,GAEN,MAAM,oBAAoB,CAAA;AAE3B;;;;;GAKG;AACH,SAAS,UAAU,CAAC,IAAc,EAAE,GAAkB;IACpD,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE;QAClC,SAAS,EAAE,gBAAgB;QAC3B,OAAO,EAAE,IAAI,CAAC,IAAI;QAClB,OAAO,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE;KAC5B,CAAC,CAAA;IACF,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,IAAI,CAAC,GAAG,KAAK,SAAS;QACpB,CAAC,CAAC,IAAI;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K,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACvB,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE;YAClC,SAAS,EAAE,iBAAiB;YAC5B,OAAO,EAAE,IAAI,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO;SACf,CAAC,CAAA;QACF,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,IAAI,CAAC,GAAG,KAAK,SAAS;YACpB,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,IAAI,CAAC;YAC/C,CAAC,CAAC,CAAC,CACC,GAAG,EACH,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,qBAAqB,EAAE,EACxE,IAAI,CACL,CACN,CAAA;IACH,CAAC,CAAC,CACH,CACF,CAAA;AACH,CAAC"}
@@ -1,9 +1,20 @@
1
1
  import type { MediaFigureBlock } from '@cogenta/blocks';
2
2
  import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
3
3
  /**
4
- * A thin hairline frame around the image, a small italic caption beneath —
5
- * the restrained, "printed menu insert" treatment consistent with this
6
- * theme's gallery and embed placeholder.
4
+ * A photograph and its caption.
5
+ *
6
+ * `align` is an editorial intent, read as a layout:
7
+ *
8
+ * - `start` / `end`: the room-and-story split. The photograph takes seven
9
+ * columns on its side and the caption, set in the serif italic at the lead
10
+ * size, takes the other four, so a caption reads as a line from the house
11
+ * beside the picture.
12
+ * - `center`: eight columns, set in from the left edge.
13
+ * - `wide` (and no value): the whole container.
14
+ * - `full`: the whole window, edge to edge.
15
+ *
16
+ * The ratio crops from the middle, or from the media's own focal point; the
17
+ * corners stay square and the picture casts no shadow.
7
18
  */
8
19
  export declare function renderMediaFigure(block: MediaFigureBlock, ctx: RenderContext): HtmlElement;
9
20
  //# sourceMappingURL=media-figure.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"media-figure.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/media-figure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAe,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEhG;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA8B1F"}
1
+ {"version":3,"file":"media-figure.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/media-figure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAe,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGhG;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA2C1F"}
@@ -1,24 +1,42 @@
1
1
  import { aspectRatio, h, image } from '@cogenta/theme-kit';
2
+ import { section } from '../layout.js';
2
3
  /**
3
- * A thin hairline frame around the image, a small italic caption beneath —
4
- * the restrained, "printed menu insert" treatment consistent with this
5
- * theme's gallery and embed placeholder.
4
+ * A photograph and its caption.
5
+ *
6
+ * `align` is an editorial intent, read as a layout:
7
+ *
8
+ * - `start` / `end`: the room-and-story split. The photograph takes seven
9
+ * columns on its side and the caption, set in the serif italic at the lead
10
+ * size, takes the other four, so a caption reads as a line from the house
11
+ * beside the picture.
12
+ * - `center`: eight columns, set in from the left edge.
13
+ * - `wide` (and no value): the whole container.
14
+ * - `full`: the whole window, edge to edge.
15
+ *
16
+ * The ratio crops from the middle, or from the media's own focal point; the
17
+ * corners stay square and the picture casts no shadow.
6
18
  */
7
19
  export function renderMediaFigure(block, ctx) {
20
+ const align = block.align ?? 'wide';
21
+ const split = align === 'start' || align === 'end';
8
22
  const ratio = aspectRatio(block.ratio);
9
- const hasCaption = block.caption !== undefined || block.credit !== undefined;
10
- return h('figure', {
11
- class: 'cg-plate',
12
- 'data-block': 'mediaFigure',
13
- 'data-align': block.align ?? 'center',
14
- style: ratio === undefined ? undefined : `--cg-ratio:${ratio}`,
15
- }, h('div', { class: 'cg-plate__frame' }, image(ctx, block.media, {
16
- className: 'cg-plate__media',
17
- sizes: '(min-width: 48rem) 42rem, 100vw',
18
- })), hasCaption
19
- ? h('figcaption', { class: 'cg-plate__caption' }, block.caption, block.credit === undefined
23
+ const caption = block.caption === undefined && block.credit === undefined
24
+ ? null
25
+ : h('figcaption', { class: 'cr-figure__caption' }, block.caption === undefined
20
26
  ? null
21
- : h('span', { class: 'cg-plate__credit', 'data-field': 'credit' }, block.credit))
22
- : null);
27
+ : h('span', { class: 'cr-figure__text', 'data-field': 'caption' }, block.caption), block.credit === undefined
28
+ ? null
29
+ : h('span', { class: 'cr-figure__credit', 'data-field': 'credit' }, block.credit));
30
+ return section('div', 'mediaFigure', 'cr-figure', { 'data-align': align, 'data-layout': split ? 'split' : 'single' }, 'figure', h('div', {
31
+ class: 'cr-figure__frame',
32
+ style: ratio === undefined ? undefined : `aspect-ratio:${ratio}`,
33
+ }, image(ctx, block.media, {
34
+ className: 'cr-figure__image',
35
+ sizes: align === 'full'
36
+ ? '100vw'
37
+ : split
38
+ ? '(min-width: 64rem) 55vw, 100vw'
39
+ : '(min-width: 90rem) 86rem, 100vw',
40
+ })), caption);
23
41
  }
24
42
  //# sourceMappingURL=media-figure.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"media-figure.js","sourceRoot":"","sources":["../../../../src/render/blocks/media-figure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AAEhG;;;;GAIG;AACH,MAAM,UAAU,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KAAK,MAAM;YACd,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,KAAK;gBACL,CAAC,CAAC,gCAAgC;gBAClC,CAAC,CAAC,iCAAiC;KAC1C,CAAC,CACH,EACD,OAAO,CACR,CAAA;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pricing-table.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/pricing-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAIL,KAAK,WAAW,EAIhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AA4C3B,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAmB5F"}
1
+ {"version":3,"file":"pricing-table.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/pricing-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAEL,KAAK,WAAW,EAIhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AAsC3B,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAe5F"}