@cogenta/theme-portfolio 1.1.3 → 1.3.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.
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +10 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/render/blocks/accordion.d.ts.map +1 -1
- package/dist/src/render/blocks/accordion.js +10 -18
- package/dist/src/render/blocks/accordion.js.map +1 -1
- package/dist/src/render/blocks/collection-list.d.ts +0 -20
- package/dist/src/render/blocks/collection-list.d.ts.map +1 -1
- package/dist/src/render/blocks/collection-list.js +59 -66
- package/dist/src/render/blocks/collection-list.js.map +1 -1
- package/dist/src/render/blocks/cta.d.ts +4 -4
- package/dist/src/render/blocks/cta.d.ts.map +1 -1
- package/dist/src/render/blocks/cta.js +15 -10
- package/dist/src/render/blocks/cta.js.map +1 -1
- package/dist/src/render/blocks/embed.d.ts.map +1 -1
- package/dist/src/render/blocks/embed.js +16 -31
- package/dist/src/render/blocks/embed.js.map +1 -1
- package/dist/src/render/blocks/faq.d.ts.map +1 -1
- package/dist/src/render/blocks/faq.js +12 -17
- package/dist/src/render/blocks/faq.js.map +1 -1
- package/dist/src/render/blocks/feature-grid.d.ts.map +1 -1
- package/dist/src/render/blocks/feature-grid.js +26 -23
- package/dist/src/render/blocks/feature-grid.js.map +1 -1
- package/dist/src/render/blocks/gallery.d.ts +0 -14
- package/dist/src/render/blocks/gallery.d.ts.map +1 -1
- package/dist/src/render/blocks/gallery.js +29 -21
- package/dist/src/render/blocks/gallery.js.map +1 -1
- package/dist/src/render/blocks/hero.d.ts +8 -8
- package/dist/src/render/blocks/hero.d.ts.map +1 -1
- package/dist/src/render/blocks/hero.js +17 -18
- package/dist/src/render/blocks/hero.js.map +1 -1
- package/dist/src/render/blocks/logo-strip.d.ts.map +1 -1
- package/dist/src/render/blocks/logo-strip.js +9 -14
- package/dist/src/render/blocks/logo-strip.js.map +1 -1
- package/dist/src/render/blocks/logos.d.ts.map +1 -1
- package/dist/src/render/blocks/logos.js +14 -19
- package/dist/src/render/blocks/logos.js.map +1 -1
- package/dist/src/render/blocks/media-figure.d.ts +8 -12
- package/dist/src/render/blocks/media-figure.d.ts.map +1 -1
- package/dist/src/render/blocks/media-figure.js +20 -20
- package/dist/src/render/blocks/media-figure.js.map +1 -1
- package/dist/src/render/blocks/pricing-table.d.ts.map +1 -1
- package/dist/src/render/blocks/pricing-table.js +17 -20
- package/dist/src/render/blocks/pricing-table.js.map +1 -1
- package/dist/src/render/blocks/prose.d.ts +10 -9
- package/dist/src/render/blocks/prose.d.ts.map +1 -1
- package/dist/src/render/blocks/prose.js +29 -10
- package/dist/src/render/blocks/prose.js.map +1 -1
- package/dist/src/render/blocks/quote.d.ts +5 -12
- package/dist/src/render/blocks/quote.d.ts.map +1 -1
- package/dist/src/render/blocks/quote.js +9 -15
- package/dist/src/render/blocks/quote.js.map +1 -1
- package/dist/src/render/blocks/stat-counter.d.ts.map +1 -1
- package/dist/src/render/blocks/stat-counter.js +10 -12
- package/dist/src/render/blocks/stat-counter.js.map +1 -1
- package/dist/src/render/blocks/stats.d.ts.map +1 -1
- package/dist/src/render/blocks/stats.js +7 -15
- package/dist/src/render/blocks/stats.js.map +1 -1
- package/dist/src/render/blocks/testimonial.d.ts +4 -14
- package/dist/src/render/blocks/testimonial.d.ts.map +1 -1
- package/dist/src/render/blocks/testimonial.js +9 -18
- package/dist/src/render/blocks/testimonial.js.map +1 -1
- package/dist/src/render/chrome.d.ts.map +1 -1
- package/dist/src/render/chrome.js +93 -90
- package/dist/src/render/chrome.js.map +1 -1
- package/dist/src/render/layout.d.ts +61 -0
- package/dist/src/render/layout.d.ts.map +1 -0
- package/dist/src/render/layout.js +134 -0
- package/dist/src/render/layout.js.map +1 -0
- package/dist/src/render/project.d.ts +27 -0
- package/dist/src/render/project.d.ts.map +1 -0
- package/dist/src/render/project.js +82 -0
- package/dist/src/render/project.js.map +1 -0
- package/dist/src/render/render-block.d.ts +17 -7
- package/dist/src/render/render-block.d.ts.map +1 -1
- package/dist/src/render/render-block.js +47 -34
- package/dist/src/render/render-block.js.map +1 -1
- package/dist/src/render/term-archive.d.ts +0 -11
- package/dist/src/render/term-archive.d.ts.map +1 -1
- package/dist/src/render/term-archive.js +36 -24
- package/dist/src/render/term-archive.js.map +1 -1
- package/dist/src/render/widget-areas.d.ts +14 -0
- package/dist/src/render/widget-areas.d.ts.map +1 -0
- package/dist/src/render/widget-areas.js +21 -0
- package/dist/src/render/widget-areas.js.map +1 -0
- package/dist/src/render/work.d.ts +37 -0
- package/dist/src/render/work.d.ts.map +1 -0
- package/dist/src/render/work.js +49 -0
- package/dist/src/render/work.js.map +1 -0
- package/dist/theme.config.d.ts +4 -7
- package/dist/theme.config.d.ts.map +1 -1
- package/dist/theme.config.js +6 -9
- package/dist/theme.config.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +10 -1
- package/src/render/blocks/accordion.ts +22 -42
- package/src/render/blocks/collection-list.ts +83 -137
- package/src/render/blocks/cta.ts +24 -12
- package/src/render/blocks/embed.ts +39 -47
- package/src/render/blocks/faq.ts +24 -33
- package/src/render/blocks/feature-grid.ts +38 -41
- package/src/render/blocks/gallery.ts +34 -28
- package/src/render/blocks/hero.ts +31 -28
- package/src/render/blocks/logo-strip.ts +18 -20
- package/src/render/blocks/logos.ts +22 -43
- package/src/render/blocks/media-figure.ts +28 -20
- package/src/render/blocks/pricing-table.ts +31 -32
- package/src/render/blocks/prose.ts +38 -13
- package/src/render/blocks/quote.ts +18 -18
- package/src/render/blocks/stat-counter.ts +19 -37
- package/src/render/blocks/stats.ts +18 -33
- package/src/render/blocks/testimonial.ts +16 -22
- package/src/render/chrome.ts +99 -97
- package/src/render/layout.ts +177 -0
- package/src/render/project.ts +140 -0
- package/src/render/render-block.ts +49 -45
- package/src/render/term-archive.ts +92 -70
- package/src/render/widget-areas.ts +25 -0
- package/src/render/work.ts +124 -0
- package/src/styles/archive.css +61 -21
- package/src/styles/base.css +763 -648
- package/src/styles/blocks.css +697 -1093
- package/src/styles/theme.css +22 -10
- package/src/styles/tokens.css +174 -252
- package/src/styles/widgets.css +948 -0
- package/src/styles/work.css +405 -0
- package/tokens.json +19 -19
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, heading, href, nestedHeadingTag, } from '@cogenta/theme-kit';
|
|
2
|
+
import { section, sectionHead } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* classic failure of WCAG 2.4.4, and the block carries no label field to
|
|
6
|
-
* write one anyway.
|
|
4
|
+
* Services, disciplines, principles or clients, set as a typographic list
|
|
5
|
+
* rather than as cards with icons. Two forms, chosen from the data itself:
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
7
|
+
* - **rows**, when any item carries a sentence: each item a ruled row, its
|
|
8
|
+
* name in the display width on the left and the sentence beside it. A
|
|
9
|
+
* linked item links its name, drawn as an arrow link.
|
|
10
|
+
* - **names**, when no item does: a list of names in columns, the way a
|
|
11
|
+
* studio lists its clients.
|
|
12
|
+
*
|
|
13
|
+
* An item's `icon` is not drawn: a studio's list of services is words, and a
|
|
14
|
+
* pictogram beside each would be decoration. The value stays in the content
|
|
15
|
+
* for a theme that wants it.
|
|
15
16
|
*/
|
|
16
|
-
function renderItem(item, ctx, tag) {
|
|
17
|
-
const
|
|
18
|
-
?
|
|
19
|
-
:
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
function renderItem(item, ctx, tag, form) {
|
|
18
|
+
const name = item.link === undefined
|
|
19
|
+
? item.title
|
|
20
|
+
: h('a', { class: 'cg-arrow-link cg-list__link', href: href(ctx, item.link) }, item.title);
|
|
21
|
+
// A name in a list of names is an item, not a section of the page: only a
|
|
22
|
+
// row with its own sentence earns a heading in the outline.
|
|
23
|
+
if (form === 'names')
|
|
24
|
+
return h('li', { class: 'cg-list__item cg-list__name' }, name);
|
|
25
|
+
return h('li', { class: 'cg-list__item' }, heading(tag, { class: 'cg-list__name' }, name), item.text === undefined ? null : h('p', { class: 'cg-list__text' }, item.text));
|
|
22
26
|
}
|
|
23
27
|
export function renderFeatureGrid(block, ctx) {
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
: null, h('ul', { class: 'cg-features__items' }, block.items.map((item) => renderItem(item, ctx, itemTag))));
|
|
28
|
+
const titled = block.title !== undefined;
|
|
29
|
+
const tag = nestedHeadingTag('featureGrid', titled);
|
|
30
|
+
const form = block.items.some((item) => item.text !== undefined) ? 'rows' : 'names';
|
|
31
|
+
return section('section', 'featureGrid', 'cg-list cg-split', { 'data-form': form, 'data-titled': titled ? 'true' : 'false' }, 'div', sectionHead('featureGrid', block.title), h('ul', { class: 'cg-list__items', 'data-count': String(block.items.length) }, block.items.map((item) => renderItem(item, ctx, tag, form))));
|
|
29
32
|
}
|
|
30
33
|
//# 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,
|
|
1
|
+
{"version":3,"file":"feature-grid.js","sourceRoot":"","sources":["../../../../src/render/blocks/feature-grid.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,CAAC,EACD,OAAO,EACP,IAAI,EACJ,gBAAgB,GAEjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;;;;;;;;GAaG;AACH,SAAS,UAAU,CACjB,IAAiB,EACjB,GAAkB,EAClB,GAAe,EACf,IAAsB;IAEtB,MAAM,IAAI,GACR,IAAI,CAAC,IAAI,KAAK,SAAS;QACrB,CAAC,CAAC,IAAI,CAAC,K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AE,KAAK,CAAC,KAAK,CAAC,EACvC,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EACrE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAC5D,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
import type { GalleryBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
-
/**
|
|
4
|
-
* The carousel ships **no JavaScript**. It is a scroll-snapping list, which
|
|
5
|
-
* gives touch swiping, trackpad scrolling and — because the list is focusable
|
|
6
|
-
* and labelled — arrow-key scrolling, with none of the failure modes of a
|
|
7
|
-
* scripted carousel: no auto-advance to fight (WCAG 2.2.2), no focus stolen
|
|
8
|
-
* from an off-screen slide, and it still works before hydration.
|
|
9
|
-
*
|
|
10
|
-
* Every tile carries a decorative index badge (`aria-hidden`, a CSS counter)
|
|
11
|
-
* — a numbered contact sheet rather than a plain image wall, and never a
|
|
12
|
-
* second name for the picture a screen reader would announce.
|
|
13
|
-
*
|
|
14
|
-
* A focusable scrollable region needs an accessible name, or a screen reader
|
|
15
|
-
* announces an unlabelled tab stop; that is WCAG 2.4.3 and 4.1.2 both.
|
|
16
|
-
*/
|
|
17
3
|
export declare function renderGallery(block: GalleryBlock, ctx: RenderContext): HtmlElement;
|
|
18
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;
|
|
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;AAuBnF,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAoClF"}
|
|
@@ -1,30 +1,38 @@
|
|
|
1
1
|
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
* The
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* scripted carousel: no auto-advance to fight (WCAG 2.2.2), no focus stolen
|
|
7
|
-
* from an off-screen slide, and it still works before hydration.
|
|
4
|
+
* The sequence of pictures a case study is made of. Every picture keeps its
|
|
5
|
+
* own shape: a poster stays a poster, a spread stays a spread. The layout the
|
|
6
|
+
* editor chose decides the rhythm:
|
|
8
7
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
8
|
+
* - `grid`: a sequence of three places on twelve columns, a large picture
|
|
9
|
+
* across seven columns beside a smaller one across five set to the same
|
|
10
|
+
* bottom line, then one across the whole container.
|
|
11
|
+
* - `masonry`: two columns (three on a wide screen) at each picture's own
|
|
12
|
+
* shape.
|
|
13
|
+
* - `carousel`: one row at a single height that scrolls and snaps, focusable
|
|
14
|
+
* and labelled; touch, trackpad and arrow keys are all native. No script.
|
|
15
15
|
*/
|
|
16
|
+
function sizesFor(layout, place) {
|
|
17
|
+
if (layout === 'carousel')
|
|
18
|
+
return '(min-width: 64rem) 40rem, 80vw';
|
|
19
|
+
if (layout === 'masonry')
|
|
20
|
+
return '(min-width: 64rem) 30rem, 50vw';
|
|
21
|
+
if (place === 3)
|
|
22
|
+
return '(min-width: 96rem) 92rem, 100vw';
|
|
23
|
+
return place === 1 ? '(min-width: 64rem) 54rem, 100vw' : '(min-width: 64rem) 38rem, 100vw';
|
|
24
|
+
}
|
|
16
25
|
export function renderGallery(block, ctx) {
|
|
17
|
-
const items = h('ul', { class: 'cg-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, block.layout === 'carousel'
|
|
26
|
+
const items = h('ul', { class: 'cg-pictures__items', 'data-count': String(block.items.length) }, block.items.map((item, index) => {
|
|
27
|
+
const place = (index % 3) + 1;
|
|
28
|
+
return h('li', { class: 'cg-pictures__item', 'data-place': String(place) }, image(ctx, item.media, {
|
|
29
|
+
className: 'cg-pictures__image',
|
|
30
|
+
sizes: sizesFor(block.layout, place),
|
|
31
|
+
}));
|
|
32
|
+
}));
|
|
33
|
+
return section('div', 'gallery', 'cg-pictures', { 'data-layout': block.layout }, 'div', block.layout === 'carousel'
|
|
26
34
|
? h('div', {
|
|
27
|
-
class: 'cg-
|
|
35
|
+
class: 'cg-pictures__viewport',
|
|
28
36
|
role: 'region',
|
|
29
37
|
'aria-label': ctx.t('gallery.carousel'),
|
|
30
38
|
tabindex: '0',
|
|
@@ -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;
|
|
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,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;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d,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,15 +1,15 @@
|
|
|
1
1
|
import type { HeroBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
* The hero carries the page's `h1`
|
|
5
|
-
*
|
|
4
|
+
* The statement. `hero` carries the page's own `h1` (contract B), and on a
|
|
5
|
+
* studio's home page that heading is what the studio says it does, set very
|
|
6
|
+
* large in the display width across eleven columns. The eyebrow is a small
|
|
7
|
+
* line above it in the text face, never a badge. The subtitle drops to the
|
|
8
|
+
* right half of the grid, so the opening is asymmetric by construction; the
|
|
9
|
+
* actions follow it as underlined words.
|
|
6
10
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* headline that overflows its own column on wide screens (`blocks.css` gives
|
|
10
|
-
* it a fluid `clamp()`), and the media is offset into the title's own
|
|
11
|
-
* negative margin rather than sitting in a tidy second column — the overlap
|
|
12
|
-
* is what makes this a poster, not a slide.
|
|
11
|
+
* A photograph or a film, when there is one, runs under the words across the
|
|
12
|
+
* whole container at 16:9: the one image above the fold, loaded eagerly.
|
|
13
13
|
*/
|
|
14
14
|
export declare function renderHero(block: HeroBlock, ctx: RenderContext): HtmlElement;
|
|
15
15
|
//# 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;
|
|
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;AAG3B;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAkC5E"}
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
import { actionList, blockHeadingTag, h, heading, image, } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
* The hero carries the page's `h1`
|
|
4
|
-
*
|
|
4
|
+
* The statement. `hero` carries the page's own `h1` (contract B), and on a
|
|
5
|
+
* studio's home page that heading is what the studio says it does, set very
|
|
6
|
+
* large in the display width across eleven columns. The eyebrow is a small
|
|
7
|
+
* line above it in the text face, never a badge. The subtitle drops to the
|
|
8
|
+
* right half of the grid, so the opening is asymmetric by construction; the
|
|
9
|
+
* actions follow it as underlined words.
|
|
5
10
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* headline that overflows its own column on wide screens (`blocks.css` gives
|
|
9
|
-
* it a fluid `clamp()`), and the media is offset into the title's own
|
|
10
|
-
* negative margin rather than sitting in a tidy second column — the overlap
|
|
11
|
-
* is what makes this a poster, not a slide.
|
|
11
|
+
* A photograph or a film, when there is one, runs under the words across the
|
|
12
|
+
* whole container at 16:9: the one image above the fold, loaded eagerly.
|
|
12
13
|
*/
|
|
13
14
|
export function renderHero(block, ctx) {
|
|
14
15
|
const tag = blockHeadingTag('hero') ?? 'h1';
|
|
15
|
-
return
|
|
16
|
+
return section('section', 'hero', 'cg-statement', { 'data-media': block.media === undefined ? 'none' : 'image' }, 'div', block.eyebrow === undefined
|
|
16
17
|
? null
|
|
17
|
-
: h('p', { class: 'cg-
|
|
18
|
+
: h('p', { class: 'cg-statement__eyebrow', 'data-field': 'eyebrow' }, block.eyebrow), heading(tag, { class: 'cg-statement__title', 'data-field': 'title' }, block.title), block.subtitle === undefined && (block.actions === undefined || block.actions.length === 0)
|
|
18
19
|
? null
|
|
19
|
-
: h('
|
|
20
|
+
: h('div', { class: 'cg-statement__aside' }, block.subtitle === undefined
|
|
21
|
+
? null
|
|
22
|
+
: h('p', { class: 'cg-statement__subtitle', 'data-field': 'subtitle' }, block.subtitle), actionList(ctx, block.actions, ctx.t('hero.actions'))), block.media === undefined
|
|
20
23
|
? null
|
|
21
|
-
: h('div', { class: 'cg-
|
|
22
|
-
|
|
23
|
-
// so the only one that must not be lazy: lazy-loading the LCP element
|
|
24
|
-
// is a measured Lighthouse regression, not a theoretical one.
|
|
25
|
-
image(ctx, block.media, {
|
|
26
|
-
className: 'cg-hero__image',
|
|
24
|
+
: h('div', { class: 'cg-statement__media' }, image(ctx, block.media, {
|
|
25
|
+
className: 'cg-statement__image',
|
|
27
26
|
loading: 'eager',
|
|
28
|
-
sizes: '(min-width:
|
|
27
|
+
sizes: '(min-width: 96rem) 92rem, 100vw',
|
|
29
28
|
})));
|
|
30
29
|
}
|
|
31
30
|
//# 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;
|
|
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;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CAAC,KAAgB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G,EAAE,KAAK,CAAC,KAAK,EAAE;YACtB,SAAS,EAAE,qBAAqB;YAChC,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,iCAAiC;SACzC,CAAC,CACH,CACN,CAAA;AACH,CAAC"}
|
|
@@ -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;
|
|
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;AAkBnF,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAgBtF"}
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The image's own alt text (set once, in the media library) is what names
|
|
9
|
-
* each mark, same as `logos.ts` falls back to when a link is absent — never
|
|
10
|
-
* invented here, which is why `image` is called with no `altFrom`.
|
|
4
|
+
* A line of marks between two hairlines: the caption in the first three
|
|
5
|
+
* columns, the marks along the rest of the row at one height. `logoStrip`
|
|
6
|
+
* carries no name per mark, so each image's own alt text (set once, in the
|
|
7
|
+
* media library) names it. In the dark scheme the row sits on a light plate
|
|
8
|
+
* for the same reason `logos` does.
|
|
11
9
|
*/
|
|
12
10
|
function renderItem(item, ctx) {
|
|
13
|
-
return h('li', { class: 'cg-
|
|
14
|
-
className: 'cg-logostrip__image',
|
|
15
|
-
variant: { fit: 'contain' },
|
|
16
|
-
}));
|
|
11
|
+
return h('li', { class: 'cg-credits__item' }, image(ctx, item.media, { className: 'cg-credits__image', variant: { fit: 'contain' } }));
|
|
17
12
|
}
|
|
18
13
|
export function renderLogoStrip(block, ctx) {
|
|
19
|
-
return
|
|
14
|
+
return section('div', 'logoStrip', 'cg-credits', { 'data-captioned': block.caption === undefined ? 'false' : 'true' }, 'div', block.caption === undefined
|
|
20
15
|
? null
|
|
21
|
-
: h('
|
|
16
|
+
: h('p', { class: 'cg-credits__caption', 'data-field': 'caption' }, block.caption), h('ul', { class: 'cg-credits__items' }, block.logos.map((item) => renderItem(item, ctx))));
|
|
22
17
|
}
|
|
23
18
|
//# 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;
|
|
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;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,IAAmB,EAAE,GAAkB;IACzD,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,CACxF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAqB,EAAE,GAAkB;IACvE,OAAO,OAAO,CACZ,KAAK,EACL,WAAW,EACX,YAAY,EACZ,EAAE,gBAAgB,EAAE,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,EACpE,KAAK,EACL,KAAK,CAAC,OAAO,KAAK,SAAS;QACzB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,EACpF,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,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":"logos.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,
|
|
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,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AA0BnF,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAc9E"}
|
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { section, sectionHead } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* is
|
|
7
|
-
*
|
|
8
|
-
* Rendered as a single-row ledger rather than a grid of tiles — a running
|
|
9
|
-
* mono index beside each mark, in a desaturated register that resolves to
|
|
10
|
-
* full ink only on hover or focus (`blocks.css`), which is the theme's own
|
|
11
|
-
* take on the "selected clients" strip.
|
|
4
|
+
* Marks of clients or partners, each on its own plate in a ruled grid, the
|
|
5
|
+
* name under the plate in the caption size. The plate stays light in the dark
|
|
6
|
+
* scheme, so a dark wordmark drawn for white paper is never lost on black.
|
|
7
|
+
* The organisation's name is the image's accessible name when the media
|
|
8
|
+
* entity has none, and a mark with a URL links it.
|
|
12
9
|
*/
|
|
13
|
-
function renderItem(item, ctx
|
|
14
|
-
const
|
|
15
|
-
className: 'cg-
|
|
10
|
+
function renderItem(item, ctx) {
|
|
11
|
+
const mark = image(ctx, item.media, {
|
|
12
|
+
className: 'cg-marks__image',
|
|
16
13
|
altFrom: item.name,
|
|
17
14
|
variant: { fit: 'contain' },
|
|
18
15
|
});
|
|
19
|
-
return h('li', { class: 'cg-
|
|
20
|
-
?
|
|
21
|
-
: h('a', { class: 'cg-
|
|
16
|
+
return h('li', { class: 'cg-marks__item' }, item.url === undefined
|
|
17
|
+
? h('div', { class: 'cg-marks__plate' }, mark)
|
|
18
|
+
: h('a', { class: 'cg-marks__plate', href: item.url, rel: 'noopener noreferrer' }, mark), h('p', { class: 'cg-marks__name' }, item.name));
|
|
22
19
|
}
|
|
23
20
|
export function renderLogos(block, ctx) {
|
|
24
|
-
return
|
|
25
|
-
? null
|
|
26
|
-
: heading(blockHeadingTag('logos') ?? 'h2', { class: 'cg-logos__title', 'data-field': 'title' }, block.title), h('ul', { class: 'cg-logos__items' }, block.items.map((item, index) => renderItem(item, ctx, index))));
|
|
21
|
+
return section('section', 'logos', 'cg-marks', { 'data-count': String(block.items.length) }, 'div', sectionHead('logos', block.title), h('ul', { class: 'cg-marks__items' }, block.items.map((item) => renderItem(item, ctx))));
|
|
27
22
|
}
|
|
28
23
|
//# sourceMappingURL=logos.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logos.js","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"logos.js","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,IAAc,EAAE,GAAkB;IACpD,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE;QAClC,SAAS,EAAE,iBAAiB;QAC5B,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,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,IAAI,CAAC;QAC9C,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,qBAAqB,EAAE,EAAE,IAAI,CAAC,EAC1F,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAC/C,CAAA;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAE,GAAkB;IAC/D,OAAO,OAAO,CACZ,SAAS,EACT,OAAO,EACP,UAAU,EACV,EAAE,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAC5C,KAAK,EACL,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,EACjC,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CACjD,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import type { MediaFigureBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* An image placed on the grid by its alignment, square-cornered, with a
|
|
5
|
+
* small caption under it on the image's own left edge and the credit after
|
|
6
|
+
* the caption. Alignment is how a case study gets its rhythm of large and
|
|
7
|
+
* small pictures:
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* `align` is written as a data attribute, never as a class: contract B's
|
|
15
|
-
* values are `start`/`end`, an intent that mirrors in right-to-left
|
|
16
|
-
* locales, and the skin decides what it means.
|
|
9
|
+
* - `center` (the default): columns 3 to 10.
|
|
10
|
+
* - `start`: the first seven columns. `end`: the last seven.
|
|
11
|
+
* - `wide`: the whole container.
|
|
12
|
+
* - `full`: edge to edge, the caption returning to the grid.
|
|
17
13
|
*/
|
|
18
14
|
export declare function renderMediaFigure(block: MediaFigureBlock, ctx: RenderContext): HtmlElement;
|
|
19
15
|
//# 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;
|
|
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;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA2C1F"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { aspectRatio, h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* An image placed on the grid by its alignment, square-cornered, with a
|
|
5
|
+
* small caption under it on the image's own left edge and the credit after
|
|
6
|
+
* the caption. Alignment is how a case study gets its rhythm of large and
|
|
7
|
+
* small pictures:
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* `align` is written as a data attribute, never as a class: contract B's
|
|
14
|
-
* values are `start`/`end`, an intent that mirrors in right-to-left
|
|
15
|
-
* locales, and the skin decides what it means.
|
|
9
|
+
* - `center` (the default): columns 3 to 10.
|
|
10
|
+
* - `start`: the first seven columns. `end`: the last seven.
|
|
11
|
+
* - `wide`: the whole container.
|
|
12
|
+
* - `full`: edge to edge, the caption returning to the grid.
|
|
16
13
|
*/
|
|
17
14
|
export function renderMediaFigure(block, ctx) {
|
|
18
15
|
const ratio = aspectRatio(block.ratio);
|
|
16
|
+
const align = block.align ?? 'center';
|
|
19
17
|
const hasCaption = block.caption !== undefined || block.credit !== undefined;
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
'data-block': 'mediaFigure',
|
|
23
|
-
'data-align': block.align ?? 'center',
|
|
18
|
+
return section('div', 'mediaFigure', 'cg-figure', {
|
|
19
|
+
'data-align': align,
|
|
24
20
|
style: ratio === undefined ? undefined : `--cg-ratio:${ratio}`,
|
|
25
|
-
}, h('div', { class: 'cg-figure__frame' }, image(ctx, block.media, {
|
|
26
|
-
className: 'cg-
|
|
27
|
-
sizes:
|
|
21
|
+
}, 'figure', h('div', { class: 'cg-figure__frame' }, image(ctx, block.media, {
|
|
22
|
+
className: 'cg-figure__image',
|
|
23
|
+
sizes: align === 'full'
|
|
24
|
+
? '100vw'
|
|
25
|
+
: align === 'wide'
|
|
26
|
+
? '(min-width: 96rem) 92rem, 100vw'
|
|
27
|
+
: '(min-width: 64rem) 56rem, 100vw',
|
|
28
28
|
})), hasCaption
|
|
29
29
|
? h('figcaption', { class: 'cg-figure__caption' }, block.caption === undefined
|
|
30
30
|
? null
|
|
31
|
-
: h('span', { class: 'cg-
|
|
31
|
+
: h('span', { class: 'cg-figure__caption-text', 'data-field': 'caption' }, block.caption), block.credit === undefined
|
|
32
32
|
? null
|
|
33
33
|
: h('span', { class: 'cg-figure__credit', 'data-field': 'credit' }, block.credit))
|
|
34
34
|
: null);
|
|
@@ -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;
|
|
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;AAChG,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E,mBAAmB,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,CACpF;QACH,CAAC,CAAC,IAAI,CACT,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,
|
|
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,EAGL,KAAK,WAAW,EAIhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AA2C3B,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAe5F"}
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import { actionLink,
|
|
1
|
+
import { actionLink, h, heading, nestedHeadingTag, } from '@cogenta/theme-kit';
|
|
2
|
+
import { section, sectionHead } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Fees or engagements, set as the columns of a ruled table rather than as
|
|
5
|
+
* cards: each tier opens on a hairline, its name in the text face, the price
|
|
6
|
+
* in the display width with tabular numerals and the interval after it, what
|
|
7
|
+
* it includes as a list divided by hairlines, and its action at the foot. The
|
|
8
|
+
* tier the editor highlighted opens on a heavy rule in ink instead, and its
|
|
9
|
+
* action is the filled one; the others keep their words underlined.
|
|
8
10
|
*/
|
|
9
11
|
function renderTier(tier, ctx, tag) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
'data-highlighted': tier.highlighted === true ? 'true' : undefined,
|
|
13
|
-
'aria-current': tier.highlighted === true ? 'true' : undefined,
|
|
14
|
-
}, heading(tag, { class: 'cg-pricing__name' }, tier.name), h('p', { class: 'cg-pricing__price' }, tier.price, tier.interval === undefined
|
|
12
|
+
const highlighted = tier.highlighted === true;
|
|
13
|
+
return h('li', { class: 'cg-fees__tier', 'data-highlighted': highlighted ? 'true' : undefined }, heading(tag, { class: 'cg-fees__name' }, tier.name), h('p', { class: 'cg-fees__price' }, h('span', { class: 'cg-fees__amount' }, tier.price), tier.interval === undefined ? null : h('span', { class: 'cg-fees__interval' }, tier.interval)), tier.features.length === 0
|
|
15
14
|
? null
|
|
16
|
-
: h('
|
|
15
|
+
: h('ul', { class: 'cg-fees__features' }, tier.features.map((feature) => h('li', { class: 'cg-fees__feature' }, feature))), tier.action === undefined
|
|
17
16
|
? null
|
|
18
|
-
: h('
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
: h('div', { class: 'cg-fees__action' }, actionLink(ctx, {
|
|
18
|
+
...tier.action,
|
|
19
|
+
emphasis: tier.action.emphasis ?? (highlighted ? 'primary' : 'secondary'),
|
|
20
|
+
})));
|
|
21
21
|
}
|
|
22
22
|
export function renderPricingTable(block, ctx) {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
return h('section', { class: 'cg-block cg-pricing', 'data-block': 'pricingTable' }, hasTitle
|
|
26
|
-
? heading(blockHeadingTag('pricingTable') ?? 'h2', { class: 'cg-pricing__title', 'data-field': 'title' }, block.title ?? '')
|
|
27
|
-
: null, h('ul', { class: 'cg-pricing__tiers' }, block.tiers.map((tier) => renderTier(tier, ctx, tierTag))));
|
|
23
|
+
const tierTag = nestedHeadingTag('pricingTable', block.title !== undefined);
|
|
24
|
+
return section('section', 'pricingTable', 'cg-fees', { 'data-count': String(Math.min(block.tiers.length, 4)) }, 'div', sectionHead('pricingTable', block.title), h('ul', { class: 'cg-fees__tiers' }, block.tiers.map((tier) => renderTier(tier, ctx, tierTag))));
|
|
28
25
|
}
|
|
29
26
|
//# sourceMappingURL=pricing-table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing-table.js","sourceRoot":"","sources":["../../../../src/render/blocks/pricing-table.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,
|
|
1
|
+
{"version":3,"file":"pricing-table.js","sourceRoot":"","sources":["../../../../src/render/blocks/pricing-table.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EAGV,CAAC,EACD,OAAO,EACP,gBAAgB,GAEjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,IAAiB,EAAE,GAAkB,EAAE,GAAe;IACxE,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,KAAK,IAAI,CAAA;IAC7C,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,EAChF,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EACnD,CAAC,CACC,GAAG,EACH,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EACnD,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAC9F,EACD,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QACxB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,mBAAmB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