@cogenta/theme-entreprise 1.1.3 → 1.4.0

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 (115) hide show
  1. package/dist/src/index.d.ts +1 -0
  2. package/dist/src/index.d.ts.map +1 -1
  3. package/dist/src/index.js +1 -0
  4. package/dist/src/index.js.map +1 -1
  5. package/dist/src/render/blocks/accordion.d.ts.map +1 -1
  6. package/dist/src/render/blocks/accordion.js +12 -15
  7. package/dist/src/render/blocks/accordion.js.map +1 -1
  8. package/dist/src/render/blocks/collection-list.d.ts +5 -7
  9. package/dist/src/render/blocks/collection-list.d.ts.map +1 -1
  10. package/dist/src/render/blocks/collection-list.js +61 -32
  11. package/dist/src/render/blocks/collection-list.js.map +1 -1
  12. package/dist/src/render/blocks/cta.d.ts +6 -6
  13. package/dist/src/render/blocks/cta.d.ts.map +1 -1
  14. package/dist/src/render/blocks/cta.js +12 -12
  15. package/dist/src/render/blocks/cta.js.map +1 -1
  16. package/dist/src/render/blocks/embed.d.ts.map +1 -1
  17. package/dist/src/render/blocks/embed.js +22 -27
  18. package/dist/src/render/blocks/embed.js.map +1 -1
  19. package/dist/src/render/blocks/faq.d.ts.map +1 -1
  20. package/dist/src/render/blocks/faq.js +13 -16
  21. package/dist/src/render/blocks/faq.js.map +1 -1
  22. package/dist/src/render/blocks/feature-grid.d.ts.map +1 -1
  23. package/dist/src/render/blocks/feature-grid.js +22 -22
  24. package/dist/src/render/blocks/feature-grid.js.map +1 -1
  25. package/dist/src/render/blocks/gallery.d.ts +7 -8
  26. package/dist/src/render/blocks/gallery.d.ts.map +1 -1
  27. package/dist/src/render/blocks/gallery.js +16 -14
  28. package/dist/src/render/blocks/gallery.js.map +1 -1
  29. package/dist/src/render/blocks/hero.d.ts +13 -8
  30. package/dist/src/render/blocks/hero.d.ts.map +1 -1
  31. package/dist/src/render/blocks/hero.js +27 -17
  32. package/dist/src/render/blocks/hero.js.map +1 -1
  33. package/dist/src/render/blocks/logo-strip.d.ts.map +1 -1
  34. package/dist/src/render/blocks/logo-strip.js +14 -11
  35. package/dist/src/render/blocks/logo-strip.js.map +1 -1
  36. package/dist/src/render/blocks/logos.d.ts.map +1 -1
  37. package/dist/src/render/blocks/logos.js +21 -12
  38. package/dist/src/render/blocks/logos.js.map +1 -1
  39. package/dist/src/render/blocks/media-figure.d.ts +10 -6
  40. package/dist/src/render/blocks/media-figure.d.ts.map +1 -1
  41. package/dist/src/render/blocks/media-figure.js +18 -13
  42. package/dist/src/render/blocks/media-figure.js.map +1 -1
  43. package/dist/src/render/blocks/pricing-table.d.ts.map +1 -1
  44. package/dist/src/render/blocks/pricing-table.js +15 -11
  45. package/dist/src/render/blocks/pricing-table.js.map +1 -1
  46. package/dist/src/render/blocks/prose.d.ts +9 -3
  47. package/dist/src/render/blocks/prose.d.ts.map +1 -1
  48. package/dist/src/render/blocks/prose.js +11 -4
  49. package/dist/src/render/blocks/prose.js.map +1 -1
  50. package/dist/src/render/blocks/quote.d.ts +10 -10
  51. package/dist/src/render/blocks/quote.d.ts.map +1 -1
  52. package/dist/src/render/blocks/quote.js +14 -13
  53. package/dist/src/render/blocks/quote.js.map +1 -1
  54. package/dist/src/render/blocks/stat-counter.d.ts.map +1 -1
  55. package/dist/src/render/blocks/stat-counter.js +11 -13
  56. package/dist/src/render/blocks/stat-counter.js.map +1 -1
  57. package/dist/src/render/blocks/stats.d.ts.map +1 -1
  58. package/dist/src/render/blocks/stats.js +12 -13
  59. package/dist/src/render/blocks/stats.js.map +1 -1
  60. package/dist/src/render/blocks/testimonial.d.ts +9 -9
  61. package/dist/src/render/blocks/testimonial.d.ts.map +1 -1
  62. package/dist/src/render/blocks/testimonial.js +15 -14
  63. package/dist/src/render/blocks/testimonial.js.map +1 -1
  64. package/dist/src/render/chrome.d.ts +3 -1
  65. package/dist/src/render/chrome.d.ts.map +1 -1
  66. package/dist/src/render/chrome.js +71 -46
  67. package/dist/src/render/chrome.js.map +1 -1
  68. package/dist/src/render/layout.d.ts +26 -0
  69. package/dist/src/render/layout.d.ts.map +1 -0
  70. package/dist/src/render/layout.js +51 -0
  71. package/dist/src/render/layout.js.map +1 -0
  72. package/dist/src/render/render-block.d.ts.map +1 -1
  73. package/dist/src/render/render-block.js +23 -2
  74. package/dist/src/render/render-block.js.map +1 -1
  75. package/dist/src/render/term-archive.d.ts +8 -6
  76. package/dist/src/render/term-archive.d.ts.map +1 -1
  77. package/dist/src/render/term-archive.js +22 -16
  78. package/dist/src/render/term-archive.js.map +1 -1
  79. package/dist/src/render/widget-areas.d.ts +13 -0
  80. package/dist/src/render/widget-areas.d.ts.map +1 -0
  81. package/dist/src/render/widget-areas.js +20 -0
  82. package/dist/src/render/widget-areas.js.map +1 -0
  83. package/dist/theme.config.js +2 -2
  84. package/dist/theme.config.js.map +1 -1
  85. package/package.json +5 -5
  86. package/src/index.ts +1 -0
  87. package/src/render/blocks/accordion.ts +32 -27
  88. package/src/render/blocks/collection-list.ts +103 -53
  89. package/src/render/blocks/cta.ts +27 -28
  90. package/src/render/blocks/embed.ts +46 -43
  91. package/src/render/blocks/faq.ts +25 -21
  92. package/src/render/blocks/feature-grid.ts +42 -35
  93. package/src/render/blocks/gallery.ts +21 -16
  94. package/src/render/blocks/hero.ts +40 -28
  95. package/src/render/blocks/logo-strip.ts +26 -16
  96. package/src/render/blocks/logos.ts +33 -17
  97. package/src/render/blocks/media-figure.ts +22 -14
  98. package/src/render/blocks/pricing-table.ts +26 -15
  99. package/src/render/blocks/prose.ts +18 -4
  100. package/src/render/blocks/quote.ts +18 -14
  101. package/src/render/blocks/stat-counter.ts +25 -20
  102. package/src/render/blocks/stats.ts +31 -21
  103. package/src/render/blocks/testimonial.ts +22 -18
  104. package/src/render/chrome.ts +84 -49
  105. package/src/render/layout.ts +67 -0
  106. package/src/render/render-block.ts +24 -1
  107. package/src/render/term-archive.ts +54 -50
  108. package/src/render/widget-areas.ts +23 -0
  109. package/src/styles/archive.css +137 -38
  110. package/src/styles/base.css +553 -426
  111. package/src/styles/blocks.css +1343 -1010
  112. package/src/styles/theme.css +18 -24
  113. package/src/styles/tokens.css +166 -192
  114. package/src/styles/widgets.css +914 -0
  115. package/tokens.json +17 -17
@@ -13,4 +13,5 @@ export * from './render/blocks/stats.js';
13
13
  export * from './render/chrome.js';
14
14
  export * from './render/render-block.js';
15
15
  export * from './render/term-archive.js';
16
+ export * from './render/widget-areas.js';
16
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA"}
package/dist/src/index.js CHANGED
@@ -13,4 +13,5 @@ export * from './render/blocks/stats.js';
13
13
  export * from './render/chrome.js';
14
14
  export * from './render/render-block.js';
15
15
  export * from './render/term-archive.js';
16
+ export * from './render/widget-areas.js';
16
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/accordion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAEL,KAAK,WAAW,EAGhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AAkC3B,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAiBtF"}
1
+ {"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/accordion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAEL,KAAK,WAAW,EAGhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AAgC3B,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAwBtF"}
@@ -1,24 +1,21 @@
1
1
  import { blockHeadingTag, h, heading, renderRichText, } from '@cogenta/theme-kit';
2
+ import { ordinal, section } from '../layout.js';
2
3
  /**
3
- * `blocks@2.0` (RFC 0001). Reuses `faq`'s zero-JS `<details>`/`<summary>`
4
- * mechanics — expanding, keyboard operation and the expanded state
5
- * announced to assistive technology all come from the browser — but with a
6
- * markup vocabulary and class names of its own (`cg-panels`, not
7
- * `cg-faq`) so the two blocks can diverge visually later without one
8
- * depending on the other: "accordion" and "frequently asked question" are
9
- * different editorial intents even where the underlying question/answer
10
- * shape coincides.
4
+ * `blocks@2.0` (RFC 0001). The same zero-JavaScript `<details>`/`<summary>`
5
+ * mechanics as `faq`, laid out for a different intent: a specification or a
6
+ * method in numbered steps, across the full grid. The title sits above the
7
+ * list rather than beside it, each row carries its ordinal in the left
8
+ * column, and the open panel's text lines up with the question it answers.
11
9
  *
12
- * Where `faq` numbers its rows, this one reads as a stack of bordered
13
- * panels with a rotating chevron mark, closer to a features/specification
14
- * accordion than a support page.
10
+ * Class names are its own (`cg-accordion`, not `cg-faq`) so the two blocks
11
+ * can diverge without one depending on the other.
15
12
  */
16
- function renderItem(item, ctx) {
17
- return h('li', { class: 'cg-panels__item' }, h('details', { class: 'cg-panels__details' }, h('summary', { class: 'cg-panels__question' }, h('span', { class: 'cg-panels__question-text' }, item.question), h('span', { class: 'cg-panels__chevron', 'aria-hidden': 'true' })), h('div', { class: 'cg-panels__answer' }, renderRichText(ctx, item.answer))));
13
+ function renderItem(item, index, ctx) {
14
+ return h('li', { class: 'cg-accordion__item' }, h('details', { class: 'cg-accordion__details' }, h('summary', { class: 'cg-accordion__question' }, h('span', { class: 'cg-accordion__index', 'aria-hidden': 'true' }, ordinal(index)), h('span', { class: 'cg-accordion__question-text' }, item.question), h('span', { class: 'cg-toggle-mark', 'aria-hidden': 'true' })), h('div', { class: 'cg-accordion__answer' }, renderRichText(ctx, item.answer))));
18
15
  }
19
16
  export function renderAccordion(block, ctx) {
20
- return h('section', { class: 'cg-panels', 'data-block': 'accordion' }, block.title === undefined
17
+ return section('section', 'accordion', 'cg-accordion', {}, 'div', block.title === undefined
21
18
  ? null
22
- : heading(blockHeadingTag('accordion') ?? 'h2', { class: 'cg-panels__title', 'data-field': 'title' }, block.title), h('ul', { class: 'cg-panels__items' }, block.items.map((item) => renderItem(item, ctx))));
19
+ : h('div', { class: 'cg-head' }, heading(blockHeadingTag('accordion') ?? 'h2', { class: 'cg-head__title', 'data-field': 'title' }, block.title)), h('ol', { class: 'cg-accordion__items' }, block.items.map((item, index) => renderItem(item, index, ctx))));
23
20
  }
24
21
  //# sourceMappingURL=accordion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../../../src/render/blocks/accordion.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAEf,CAAC,EACD,OAAO,EAEP,cAAc,GACf,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;;;;;GAaG;AACH,SAAS,UAAU,CAAC,IAAmB,EAAE,GAAkB;IACzD,OAA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,EAAE,KAAK,EAAE,qBAAqB,EAAE,EAChC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAC/D,CACF,CAAA;AACH,CAAC"}
@@ -1,13 +1,11 @@
1
1
  import type { CollectionListBlock } from '@cogenta/blocks';
2
2
  import { buildCollectionListQuery, type ContentEntry, type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
3
3
  /**
4
- * The only block of the seventeen that reads data at render time — contract B
5
- * marks it `runtime: 'server'` for that reason. The read is *not* done
6
- * here: `query` builds the request from the block's own fields
7
- * (`@cogenta/theme-kit`'s `buildCollectionListQuery`, shared across every
8
- * theme), the caller awaits `ctx.content.list(...)` before rendering
9
- * starts, and this function stays a pure function of the entries handed to
10
- * it.
4
+ * The only block of the seventeen that reads data at render time (contract B
5
+ * marks it `runtime: 'server'`). The read is not done here: `query` builds
6
+ * the request from the block's own fields, the caller awaits
7
+ * `ctx.content.list(...)` before rendering starts, and this function stays a
8
+ * pure function of the entries handed to it.
11
9
  */
12
10
  export { buildCollectionListQuery as query };
13
11
  export declare function renderCollectionList(block: CollectionListBlock, ctx: RenderContext, entries: readonly ContentEntry[]): HtmlElement;
@@ -1 +1 @@
1
- {"version":3,"file":"collection-list.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/collection-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAEL,wBAAwB,EACxB,KAAK,YAAY,EAOjB,KAAK,WAAW,EAIhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;GAQG;AACH,OAAO,EAAE,wBAAwB,IAAI,KAAK,EAAE,CAAA;AAkD5C,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,mBAAmB,EAC1B,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,SAAS,YAAY,EAAE,GAC/B,WAAW,CAuCb"}
1
+ {"version":3,"file":"collection-list.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/collection-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAEL,wBAAwB,EACxB,KAAK,YAAY,EAOjB,KAAK,WAAW,EAIhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AAG3B;;;;;;GAMG;AACH,OAAO,EAAE,wBAAwB,IAAI,KAAK,EAAE,CAAA;AAkG5C,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,mBAAmB,EAC1B,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,SAAS,YAAY,EAAE,GAC/B,WAAW,CA0Cb"}
@@ -1,51 +1,80 @@
1
1
  import { blockHeadingTag, buildCollectionListQuery, entryDate, entryExcerpt, entryHref, entryImage, entryTitle, h, heading, nestedHeadingTag, renderImageSource, } from '@cogenta/theme-kit';
2
+ import { arrow, monthYear, ordinal, section } from '../layout.js';
2
3
  /**
3
- * The only block of the seventeen that reads data at render time — contract B
4
- * marks it `runtime: 'server'` for that reason. The read is *not* done
5
- * here: `query` builds the request from the block's own fields
6
- * (`@cogenta/theme-kit`'s `buildCollectionListQuery`, shared across every
7
- * theme), the caller awaits `ctx.content.list(...)` before rendering
8
- * starts, and this function stays a pure function of the entries handed to
9
- * it.
4
+ * The only block of the seventeen that reads data at render time (contract B
5
+ * marks it `runtime: 'server'`). The read is not done here: `query` builds
6
+ * the request from the block's own fields, the caller awaits
7
+ * `ctx.content.list(...)` before rendering starts, and this function stays a
8
+ * pure function of the entries handed to it.
10
9
  */
11
10
  export { buildCollectionListQuery as query };
12
11
  /**
13
- * A card in every layout: a 16:9 cover on top (`entryImage`, the same
14
- * `coverImage`/`cover`/… convention every entry-carrying block on this site
15
- * reads), then title and excerpt below it — the "services/insights card"
16
- * register a B2B site's listing pages use, replacing the previous ledger
17
- * row (a date rail beside plain text, no visual at all). An entry with no
18
- * image still renders a complete card; the cover slot is simply absent
19
- * rather than a placeholder box standing in for one.
12
+ * Three designed layouts, one markup per entry:
13
+ *
14
+ * - `list` is the case-study register: alternating rows, the picture on
15
+ * seven columns and the text on four, swapping sides from one row to the
16
+ * next. An entry with no picture becomes a typographic row (title left,
17
+ * summary right) under the same hairline, never a row with a hole in it.
18
+ * - `grid` is an editorial index in three columns: a 3:2 picture, a hairline,
19
+ * the title in the display serif and its summary. No card border, no lift
20
+ * on hover.
21
+ * - `carousel` is the grid's item in a scroll-snapping, focusable row.
22
+ *
23
+ * The picture link is hidden from assistive technology and from the tab
24
+ * order: it goes where the title link goes, and one link per entry is what
25
+ * a keyboard or screen reader user should meet.
20
26
  */
21
- function renderCover(entry, ctx) {
22
- const cover = entryImage(entry, ctx);
23
- if (cover === undefined)
27
+ function renderPicture(entry, ctx, url) {
28
+ const picture = entryImage(entry, ctx);
29
+ if (picture === undefined)
24
30
  return null;
25
- return h('span', { class: 'cg-list__cover' }, renderImageSource(cover, { className: 'cg-list__cover-image', loading: 'lazy' }));
31
+ return h('a', { class: 'cg-entry__media', href: url, tabindex: '-1', 'aria-hidden': 'true' }, renderImageSource(picture, {
32
+ className: 'cg-entry__image',
33
+ loading: 'lazy',
34
+ sizes: '(min-width: 64rem) 55vw, 100vw',
35
+ }));
26
36
  }
27
- function renderEntry(entry, ctx, tag) {
28
- const date = entryDate(entry);
37
+ function renderEntry(entry, index, ctx, tag) {
38
+ const url = entryHref(entry, ctx);
29
39
  const excerpt = entryExcerpt(entry);
30
- return h('li', { class: 'cg-list__row' }, renderCover(entry, ctx), h('div', { class: 'cg-list__body' }, heading(tag, { class: 'cg-list__title' }, h('a', { class: 'cg-list__link', href: entryHref(entry, ctx) }, entryTitle(entry, ctx))), excerpt === undefined ? null : h('p', { class: 'cg-list__excerpt' }, excerpt), date === undefined
40
+ // Only a declared publication date is shown: `entryDate` falls back to
41
+ // `createdAt`, and the day a record was typed in is not a date a reader of
42
+ // a case study or a practice page is owed.
43
+ const iso = typeof entry.publishedAt === 'string' ? entryDate(entry) : undefined;
44
+ const date = iso === undefined ? null : monthYear(iso, ctx.locale);
45
+ const picture = renderPicture(entry, ctx, url);
46
+ return h('li', { class: 'cg-entry', 'data-media': picture === null ? 'none' : 'present' }, picture, h('div', { class: 'cg-entry__body' }, h('p', { class: 'cg-entry__meta' }, h('span', { class: 'cg-entry__index', 'aria-hidden': 'true' }, ordinal(index)), iso === undefined || date === null
31
47
  ? null
32
- : h('time', { class: 'cg-list__date', datetime: date }, new Intl.DateTimeFormat(ctx.locale, { month: 'short', day: '2-digit' }).format(new Date(date)))));
48
+ : h('time', { class: 'cg-entry__date', datetime: iso }, date)),
49
+ // The title is the link, and the arrow sits inline after its last word
50
+ // inside the same link: a bare arrow on a line of its own reads as a
51
+ // placeholder, not as a way into the case study.
52
+ heading(tag, { class: 'cg-entry__title' }, h('a', { class: 'cg-entry__link', href: url }, h('span', { class: 'cg-entry__link-text' }, entryTitle(entry, ctx)), h('span', { class: 'cg-entry__arrow', 'aria-hidden': 'true' }, arrow()))), excerpt === undefined ? null : h('p', { class: 'cg-entry__excerpt' }, excerpt), renderKeyFigure(entry)));
53
+ }
54
+ /**
55
+ * The one number a case study is remembered by, when the entry declares it
56
+ * (`keyFigure`, and `keyFigureLabel` for what it measures): set large under
57
+ * the summary, as a result on a data sheet. An entry without it renders
58
+ * exactly as before.
59
+ */
60
+ function renderKeyFigure(entry) {
61
+ const value = entry.keyFigure;
62
+ if (typeof value !== 'string' || value.trim() === '')
63
+ return null;
64
+ const label = typeof entry.keyFigureLabel === 'string' ? entry.keyFigureLabel : undefined;
65
+ return h('p', { class: 'cg-entry__figure' }, h('span', { class: 'cg-entry__figure-value' }, value), label === undefined ? null : h('span', { class: 'cg-entry__figure-label' }, label));
33
66
  }
34
67
  export function renderCollectionList(block, ctx, entries) {
35
68
  const hasTitle = block.title !== undefined;
36
69
  const entryTag = nestedHeadingTag('collectionList', hasTitle);
37
70
  const items = entries.length === 0
38
- ? h('p', { class: 'cg-list__empty' }, ctx.t('collection.empty'))
39
- : h('ul', { class: 'cg-list__items' }, entries.map((entry) => renderEntry(entry, ctx, entryTag)));
40
- return h('section', {
41
- class: 'cg-list',
42
- 'data-block': 'collectionList',
43
- 'data-layout': block.layout,
44
- }, hasTitle
45
- ? heading(blockHeadingTag('collectionList') ?? 'h2', { class: 'cg-list__title-heading', 'data-field': 'title' }, block.title ?? '')
46
- : null, block.layout === 'carousel'
71
+ ? h('p', { class: 'cg-collection__empty' }, ctx.t('collection.empty'))
72
+ : h(block.layout === 'list' ? 'ol' : 'ul', { class: 'cg-collection__items', 'data-count': String(entries.length) }, entries.map((entry, index) => renderEntry(entry, index, ctx, entryTag)));
73
+ return section('section', 'collectionList', 'cg-collection', { 'data-layout': block.layout }, 'div', hasTitle
74
+ ? h('div', { class: 'cg-head' }, heading(blockHeadingTag('collectionList') ?? 'h2', { class: 'cg-head__title', 'data-field': 'title' }, block.title ?? ''))
75
+ : null, block.layout === 'carousel' && entries.length > 0
47
76
  ? h('div', {
48
- class: 'cg-list__viewport',
77
+ class: 'cg-collection__viewport',
49
78
  role: 'region',
50
79
  'aria-label': block.title ?? ctx.t('collection.carousel'),
51
80
  tabindex: '0',
@@ -1 +1 @@
1
- {"version":3,"file":"collection-list.js","sourceRoot":"","sources":["../../../../src/render/blocks/collection-list.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,wBAAwB,EAExB,SAAS,EACT,YAAY,EACZ,SAAS,EACT,UAAU,EACV,UAAU,EAGV,CAAC,EACD,OAAO,EACP,gBAAgB,EAEhB,iBAAiB,GAClB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;GAQG;AACH,OAAO,EAAE,wBAAwB,IAAI,KAAK,EAAE,CAAA;AAE5C;;;;;;;;GAQG;AACH,SAAS,WAAW,CAAC,KAAmB,EAAE,GAAkB;IAC1D,MAAM,KAAK,GAAG,UAAU,CAAC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AE,GAAG;SACd,EACD,KAAK,CACN;QACH,CAAC,CAAC,KAAK,CACV,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"collection-list.js","sourceRoot":"","sources":["../../../../src/render/blocks/collection-list.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,wBAAwB,EAExB,SAAS,EACT,YAAY,EACZ,SAAS,EACT,UAAU,EACV,UAAU,EAGV,CAAC,EACD,OAAO,EACP,gBAAgB,EAEhB,iBAAiB,GAClB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEjE;;;;;;GAMG;AACH,OAAO,EAAE,wBAAwB,IAAI,KAAK,EAAE,CAAA;AAE5C;;;;;;;;;;;;;;;GAeG;AACH,SAAS,aAAa,CAAC,KAAmB,EAAE,GAAkB,EAAE,GAAW;IACzE,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACtC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,IAAI,CAAA;IACtC,OAAO,CAAC,CACN,GAAG,EACH,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,EAC9E,iBAAiB,CAAC,OAAO,EAAE;QACzB,SAAS,EAAE,iBAAiB;QAC5B,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,gCAAgC;KACxC,CAAC,CACH,CAAA;AACH,CAAC;AAED,SAAS,WAAW,CAClB,KAAmB,EACnB,KAAa,EACb,GAAkB,EAClB,GAAe;IAEf,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACjC,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IACnC,uEAAuE;IACvE,2EAA2E;IAC3E,2CAA2C;IAC3C,MAAM,GAAG,GAAG,OAAO,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HtmlElement, type RenderContext } from '@cogenta/theme-kit';
3
3
  /**
4
- * A full-width flat band, not a garish sales strip: the ask on the left and
5
- * the action on the right, separated by a vertical rule on wide screens —
6
- * the layout a serious B2B site uses for "talk to us", never centred copy
7
- * stacked above a button. `.cg-banner__inner` re-centres the ask/action
8
- * pair to the page's own measure while the flat tinted fill itself goes
9
- * edge to edge (`blocks.css`).
4
+ * The ink band: the one dark plane on a light page, edge to edge.
5
+ *
6
+ * The ask is set in the display serif across the left eight columns, the
7
+ * supporting line beneath it, and the actions sit in the right-hand columns
8
+ * on the band's baseline. In dark mode the band becomes the raised ink
9
+ * surface between two hairlines, so it keeps its role without inverting.
10
10
  */
11
11
  export declare function renderCta(block: CtaBlock, ctx: RenderContext): HtmlElement;
12
12
  //# sourceMappingURL=cta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cta.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/cta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAGL,KAAK,WAAW,EAGhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA6B1E"}
1
+ {"version":3,"file":"cta.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/cta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAGL,KAAK,WAAW,EAGhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AAG3B;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA2B1E"}
@@ -1,19 +1,19 @@
1
1
  import { actionList, blockHeadingTag, h, heading, } from '@cogenta/theme-kit';
2
+ import { section } from '../layout.js';
2
3
  /**
3
- * A full-width flat band, not a garish sales strip: the ask on the left and
4
- * the action on the right, separated by a vertical rule on wide screens —
5
- * the layout a serious B2B site uses for "talk to us", never centred copy
6
- * stacked above a button. `.cg-banner__inner` re-centres the ask/action
7
- * pair to the page's own measure while the flat tinted fill itself goes
8
- * edge to edge (`blocks.css`).
4
+ * The ink band: the one dark plane on a light page, edge to edge.
5
+ *
6
+ * The ask is set in the display serif across the left eight columns, the
7
+ * supporting line beneath it, and the actions sit in the right-hand columns
8
+ * on the band's baseline. In dark mode the band becomes the raised ink
9
+ * surface between two hairlines, so it keeps its role without inverting.
9
10
  */
10
11
  export function renderCta(block, ctx) {
11
- return h('section', { class: 'cg-banner', 'data-block': 'cta' }, h('div', { class: 'cg-banner__inner' }, h('div', { class: 'cg-banner__content' }, heading(blockHeadingTag('cta') ?? 'h2', { class: 'cg-banner__title', 'data-field': 'title' }, block.title), block.text === undefined
12
+ return section('section', 'cta', 'cg-cta', {}, 'div', h('div', { class: 'cg-cta__copy' }, heading(blockHeadingTag('cta') ?? 'h2', { class: 'cg-cta__title', 'data-field': 'title' }, block.title), block.text === undefined
12
13
  ? null
13
- : h('p', { class: 'cg-banner__text', 'data-field': 'text' }, block.text)), h('div', { class: 'cg-banner__actions' },
14
- // `actions` is required and non-empty for a `cta`, so the list is
15
- // always rendered; the null branch stays reachable only through
16
- // invalid data.
17
- actionList(ctx, block.actions, block.title))));
14
+ : h('p', { class: 'cg-cta__text', 'data-field': 'text' }, block.text)), h('div', { class: 'cg-cta__actions' },
15
+ // `actions` is required and non-empty for a `cta`; the null branch is
16
+ // reachable only through invalid data.
17
+ actionList(ctx, block.actions, block.title)));
18
18
  }
19
19
  //# sourceMappingURL=cta.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cta.js","sourceRoot":"","sources":["../../../../src/render/blocks/cta.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,eAAe,EAEf,CAAC,EACD,OAAO,GA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,EACL,EAAE,KAAK,EAAE,cAAc,EAAE,EACzB,OAAO,CACL,eAAe,CAAC,KAAK,CAAC,IAAI,IAAI,EAC9B,EAAE,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,EACjD,KAAK,CAAC,KAAK,CACZ,EACD,KAAK,CAAC,IAAI,KAAK,SAAS;QACtB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CACxE,EACD,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,iBAAiB,EAAE;IAC5B,sEAAsE;IACtE,uCAAuC;IACvC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAC5C,CACF,CAAA;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"embed.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/embed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAe,KAAK,WAAW,EAAK,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AA4EzF,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAqC9E"}
1
+ {"version":3,"file":"embed.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/embed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAe,KAAK,WAAW,EAAK,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AA2EzF,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAyC9E"}
@@ -1,20 +1,19 @@
1
1
  import { aspectRatio, h } from '@cogenta/theme-kit';
2
+ import { section } from '../layout.js';
2
3
  /**
3
4
  * Nothing here contacts a third party before the visitor has consented.
4
5
  *
5
- * When `consentRequired` is true the block renders a self-contained card and
6
- * an outbound link — no `<iframe>`, no `<script>`, no preconnect, no poster
7
- * image fetched from the provider. An embed that "only" loads a thumbnail
8
- * has already handed the visitor's IP address and a cookie to the provider,
9
- * which is the exact transfer consent was supposed to gate.
6
+ * When `consentRequired` is true the block renders a notice and an outbound
7
+ * link: no `<iframe>`, no `<script>`, no preconnect, no poster fetched from
8
+ * the provider. An embed that "only" loads a thumbnail has already handed
9
+ * the visitor's IP address to the provider, which is the transfer consent
10
+ * was supposed to gate.
10
11
  *
11
- * The theme ships no consent *button*, because it ships no JavaScript:
12
- * granting consent is a site-wide decision that belongs to the consent
13
- * layer, not to a block. Until that layer exists, the card is the honest
14
- * rendering — it says what would be loaded and lets the visitor go there
15
- * deliberately. The card is framed the same way `mediaFigure` and `gallery`
16
- * are (a thin bordered plate with a small provider tag), so the three read
17
- * as one family of "media placeholder" treatments.
12
+ * The theme ships no consent button, because it ships no JavaScript:
13
+ * granting consent is a site-wide decision for the consent layer, not a
14
+ * block. The notice is the honest rendering until that layer exists. It
15
+ * holds the same eight central columns and the same ratio the frame would,
16
+ * so the page does not reflow when consent is later granted.
18
17
  */
19
18
  /** `null` means "this provider has no embeddable frame we trust". */
20
19
  function frameSource(provider, rawUrl) {
@@ -25,7 +24,7 @@ function frameSource(provider, rawUrl) {
25
24
  switch (provider) {
26
25
  case 'youtube': {
27
26
  // `youtube-nocookie.com` is the privacy-preserving host, and the only
28
- // one this theme will point an iframe at.
27
+ // one this theme points an iframe at.
29
28
  const id = url.hostname.endsWith('youtu.be')
30
29
  ? segments[0]
31
30
  : (url.searchParams.get('v') ?? segments[1]);
@@ -49,12 +48,12 @@ function frameSource(provider, rawUrl) {
49
48
  return `https://w.soundcloud.com/player/?url=${encodeURIComponent(rawUrl)}`;
50
49
  default:
51
50
  // bluesky, mastodon, other: a post embed is a script tag, which this
52
- // theme does not load. The link card is the rendering.
51
+ // theme does not load. The notice is the rendering.
53
52
  return null;
54
53
  }
55
54
  }
56
- function consentCard(block, ctx, reason) {
57
- return h('div', { class: 'cg-embed__placeholder' }, h('p', { class: 'cg-embed__provider', 'aria-hidden': 'true' }, block.provider), h('p', { class: 'cg-embed__notice' }, reason), h('a', {
55
+ function consentNotice(block, ctx, reason) {
56
+ return h('div', { class: 'cg-embed__notice' }, h('p', { class: 'cg-embed__provider', 'aria-hidden': 'true' }, block.provider), h('p', { class: 'cg-embed__reason' }, reason), h('a', {
58
57
  class: 'cg-embed__link',
59
58
  href: ctx.link(block.url),
60
59
  rel: 'noopener noreferrer nofollow',
@@ -62,31 +61,27 @@ function consentCard(block, ctx, reason) {
62
61
  }
63
62
  export function renderEmbed(block, ctx) {
64
63
  const source = block.consentRequired ? null : frameSource(block.provider, block.url);
65
- // Video providers are 16:9 unless the editor framed them otherwise;
66
- // without a ratio the frame would collapse and shift the layout as it
67
- // loads.
64
+ // Video providers are 16:9 unless the editor framed them otherwise; without
65
+ // a ratio the frame would collapse and shift the layout as it loads.
68
66
  const ratio = aspectRatio(block.ratio) ?? '16 / 9';
69
- return h('div', {
70
- class: 'cg-embed',
71
- 'data-block': 'embed',
67
+ return section('div', 'embed', 'cg-embed', {
72
68
  'data-provider': block.provider,
73
69
  'data-consent': block.consentRequired ? 'required' : 'not-required',
74
70
  style: `--cg-ratio:${ratio}`,
75
- }, source === null
76
- ? consentCard(block, ctx, block.consentRequired
71
+ }, 'div', h('div', { class: 'cg-embed__frame-box' }, source === null
72
+ ? consentNotice(block, ctx, block.consentRequired
77
73
  ? ctx.t('embed.consentRequired', { provider: block.provider })
78
74
  : ctx.t('embed.unsupported', { provider: block.provider }))
79
75
  : h('iframe', {
80
76
  class: 'cg-embed__frame',
81
77
  src: source,
82
78
  // An iframe with no accessible name is announced as "frame" and
83
- // nothing else. WCAG 4.1.2, and the single most common embed
84
- // defect.
79
+ // nothing else (WCAG 4.1.2).
85
80
  title: ctx.t('embed.title', { provider: block.provider }),
86
81
  loading: 'lazy',
87
82
  referrerpolicy: 'strict-origin-when-cross-origin',
88
83
  allow: 'accelerometer; clipboard-write; encrypted-media; picture-in-picture; fullscreen',
89
84
  allowfullscreen: true,
90
- }));
85
+ })));
91
86
  }
92
87
  //# sourceMappingURL=embed.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"embed.js","sourceRoot":"","sources":["../../../../src/render/blocks/embed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAoB,CAAC,EAAsB,MAAM,oBAAoB,CAAA;AAEzF;;;;;;;;;;;;;;;;GAgBG;AAEH,qEAAqE;AACrE,SAAS,WAAW,CAAC,QAAgC,EAAE,MAAc;IACnE,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC7B,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IAC7B,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,EAAE,CAAC,CAAA;IAE5E,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,SAAS,EAAE,CAAC;YACf,sEAAsE;YACtE,0CAA0C;YAC1C,MAAM,EAAE,GAAG,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;gBAC1C,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACb,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;YAC9C,OAAO,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,0CAA0C,EAAE,EAAE,CAAA;QAChG,CAAC;QACD,KAAK,OAAO,EAAE,CAAC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EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC9D,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAC7D;QACH,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;YACV,KAAK,EAAE,iBAAiB;YACxB,GAAG,EAAE,MAAM;YACX,gEAAgE;YAChE,6BAA6B;YAC7B,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;YACzD,OAAO,EAAE,MAAM;YACf,cAAc,EAAE,iCAAiC;YACjD,KAAK,EACH,iFAAiF;YACnF,eAAe,EAAE,IAAI;SACtB,CAAC,CACP,CACF,CAAA;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"faq.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/faq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAW,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAEL,KAAK,WAAW,EAGhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AAmC3B,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAiB1E"}
1
+ {"version":3,"file":"faq.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/faq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAW,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAEL,KAAK,WAAW,EAGhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AAgC3B,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAwB1E"}
@@ -1,25 +1,22 @@
1
1
  import { blockHeadingTag, h, heading, renderRichText, } from '@cogenta/theme-kit';
2
+ import { section } from '../layout.js';
2
3
  /**
3
- * `<details>`/`<summary>` rather than a scripted accordion: expanding,
4
- * keyboard operation, and the expanded state announced to assistive
5
- * technology all come from the browser, at zero bytes of JavaScript.
6
- *
7
- * Each row carries a numeral (`01`, `02`, …) ahead of the question — the
8
- * same indexing language `featureGrid` uses — and the disclosure affordance
9
- * is a plus/minus mark drawn from two CSS borders, not an icon font.
4
+ * Two columns: the title holds the left four and stays in view while the
5
+ * questions, on the right eight, scroll past it. Each question is a row
6
+ * between hairlines with a plus that turns into a minus when open.
10
7
  *
11
- * The question is plain text inside `<summary>`, never a heading: a heading
12
- * nested in a `<summary>` renders inconsistently across screen readers, and
13
- * the questions are already reachable as a list under the block's own
14
- * heading.
8
+ * `<details>`/`<summary>` rather than a scripted accordion: expanding,
9
+ * keyboard operation and the expanded state announced to assistive
10
+ * technology all come from the browser, at zero bytes of JavaScript. The
11
+ * question is plain text inside `<summary>`, never a heading: a heading
12
+ * nested in a `<summary>` is announced inconsistently across screen readers.
15
13
  */
16
- function renderItem(item, ctx, index) {
17
- const number = String(index + 1).padStart(2, '0');
18
- 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
+ function renderItem(item, ctx) {
15
+ return h('li', { class: 'cg-faq__item' }, h('details', { class: 'cg-faq__details' }, h('summary', { class: 'cg-faq__question' }, h('span', { class: 'cg-faq__question-text' }, item.question), h('span', { class: 'cg-toggle-mark', 'aria-hidden': 'true' })), h('div', { class: 'cg-faq__answer' }, renderRichText(ctx, item.answer))));
19
16
  }
20
17
  export function renderFaq(block, ctx) {
21
- return h('section', { class: 'cg-faq', 'data-block': 'faq' }, block.title === undefined
18
+ return section('section', 'faq', 'cg-faq', { 'data-titled': block.title === undefined ? 'false' : 'true' }, 'div', block.title === undefined
22
19
  ? null
23
- : 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))));
20
+ : h('div', { class: 'cg-head cg-head--aside cg-head--sticky' }, heading(blockHeadingTag('faq') ?? 'h2', { class: 'cg-head__title', 'data-field': 'title' }, block.title)), h('ul', { class: 'cg-faq__items' }, block.items.map((item) => renderItem(item, ctx))));
24
21
  }
25
22
  //# 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;;;;;;;;;;;;;GAaG;AACH,SAAS,UAAU,CAAC,IAAa,EAAE,GAAkB,EAAE,KAAa;IAClE,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IACjD,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,cAAc,EAAE,EACzB,CAAC,CACC,SAAS,EACT,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,CAAC,CACC,SAAS,EACT,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,EACpE,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAC7D,EACD,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CACxE,CACF,CAA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AAE,CAAC,CAC9D,EACD,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CACxE,CACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAe,EAAE,GAAkB;IAC3D,OAAO,OAAO,CACZ,SAAS,EACT,KAAK,EACL,QAAQ,EACR,EAAE,aAAa,EAAE,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,EAC/D,KAAK,EACL,KAAK,CAAC,KAAK,KAAK,SAAS;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,wCAAwC,EAAE,EACnD,OAAO,CACL,eAAe,CAAC,KAAK,CAAC,IAAI,IAAI,EAC9B,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,EAClD,KAAK,CAAC,KAAK,CACZ,CACF,EACL,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,eAAe,EAAE,EAC1B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CACjD,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;AA0C3B,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,EAGL,KAAK,WAAW,EAKhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AA2C3B,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA0B1F"}
@@ -1,33 +1,33 @@
1
- import { blockHeadingTag, h, heading, href, nestedHeadingTag, renderIcon, } from '@cogenta/theme-kit';
1
+ import { blockHeadingTag, h, heading, href, nestedHeadingTag, } from '@cogenta/theme-kit';
2
+ import { arrow, ordinal, section } from '../layout.js';
2
3
  /**
3
- * This theme's "our services" section — a card grid, each card led by a
4
- * real inline glyph (`renderIcon`) inside a flat, accent-tinted square, the
5
- * B2B "capability card" register a consultancy or software vendor's
6
- * services page uses, replacing the numbered ledger rows this block used to
7
- * render (a plain list read as a table of contents, not as a services
8
- * pitch a visitor scans in one pass).
4
+ * A numbered list of capabilities, ruled by hairlines: `01` to `06`, each
5
+ * row a name in the display serif and a short description beside it.
9
6
  *
10
- * Capped at three columns on a wide screen — a six-item grid staying 3×2
11
- * rather than drifting to four columns plus two orphans, the same
12
- * discipline `theme-saas`'s own `featureGrid` holds.
7
+ * This is how a consultancy presents its practices, and deliberately not a
8
+ * grid of identical cards with icon tiles. The block's own title holds the
9
+ * left four columns (and stays in view while the list scrolls past it on a
10
+ * wide screen); the list takes the right eight.
13
11
  *
14
- * As in every other theme, the item's title carries the link so the link's
15
- * accessible name is the feature's own name (WCAG 2.4.4) — the block has no
16
- * separate label field to write a "learn more" with anyway.
12
+ * `icon` is stored by contract B as a symbol name, and this theme chooses not
13
+ * to draw it: in a numbered, typographic list an icon is decoration, and the
14
+ * ordinal already does the work of marking each row.
15
+ *
16
+ * A row with a link is clickable as a whole, but the link itself stays on the
17
+ * item's title, so its accessible name is the practice's own name
18
+ * (WCAG 2.4.4).
17
19
  */
18
- function renderItem(item, ctx, tag) {
20
+ function renderItem(item, index, ctx, tag) {
19
21
  const title = item.link === undefined
20
- ? heading(tag, { class: 'cg-service__title' }, item.title)
21
- : heading(tag, { class: 'cg-service__title' }, h('a', { class: 'cg-service__link', href: href(ctx, item.link) }, item.title));
22
- return h('li', { class: 'cg-service' }, item.icon === undefined
23
- ? null
24
- : h('span', { class: 'cg-service__icon', 'data-icon': item.icon, 'aria-hidden': 'true' }, renderIcon(item.icon)), title, item.text === undefined ? null : h('p', { class: 'cg-service__text' }, item.text));
22
+ ? heading(tag, { class: 'cg-practice__title' }, item.title)
23
+ : heading(tag, { class: 'cg-practice__title' }, h('a', { class: 'cg-practice__link', href: href(ctx, item.link) }, item.title, arrow()));
24
+ return h('li', { class: 'cg-practice', 'data-linked': item.link === undefined ? undefined : 'true' }, h('span', { class: 'cg-practice__index', 'aria-hidden': 'true' }, ordinal(index)), title, item.text === undefined ? null : h('p', { class: 'cg-practice__text' }, item.text));
25
25
  }
26
26
  export function renderFeatureGrid(block, ctx) {
27
27
  const hasTitle = block.title !== undefined;
28
28
  const itemTag = nestedHeadingTag('featureGrid', hasTitle);
29
- return h('section', { class: 'cg-services', 'data-block': 'featureGrid' }, hasTitle
30
- ? heading(blockHeadingTag('featureGrid') ?? 'h2', { class: 'cg-services__title', 'data-field': 'title' }, block.title ?? '')
31
- : null, h('ul', { class: 'cg-services__items' }, block.items.map((item) => renderItem(item, ctx, itemTag))));
29
+ return section('section', 'featureGrid', 'cg-practices', { 'data-titled': hasTitle ? 'true' : 'false' }, 'div', hasTitle
30
+ ? h('div', { class: 'cg-head cg-head--aside' }, heading(blockHeadingTag('featureGrid') ?? 'h2', { class: 'cg-head__title', 'data-field': 'title' }, block.title ?? ''))
31
+ : null, h('ol', { class: 'cg-practices__items' }, block.items.map((item, index) => renderItem(item, index, ctx, itemTag))));
32
32
  }
33
33
  //# sourceMappingURL=feature-grid.js.map