@atomic-ui/blocks 0.7.2 → 0.8.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.
- package/README.md +1 -1
- package/custom-elements.json +1372 -0
- package/dist/{chunk-YWATQR3J.js → chunk-CPOCQURG.js} +7 -1
- package/dist/chunk-CPOCQURG.js.map +1 -0
- package/dist/chunk-PTQDYIC5.js +447 -0
- package/dist/chunk-PTQDYIC5.js.map +1 -0
- package/dist/chunk-YMSFOS3H.js +142 -0
- package/dist/chunk-YMSFOS3H.js.map +1 -0
- package/dist/components/journey.d.ts +106 -0
- package/dist/components/journey.js +9 -0
- package/dist/components/journey.js.map +1 -0
- package/dist/components/site.d.ts +11 -0
- package/dist/components/site.js +1 -1
- package/dist/components/studio.d.ts +430 -0
- package/dist/components/studio.js +19 -0
- package/dist/components/studio.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +26 -4
- package/dist/index.js.map +1 -1
- package/dist/standalone/atomic-ui-blocks.js +893 -677
- package/dist/standalone/atomic-ui-blocks.js.map +4 -4
- package/package.json +3 -3
- package/dist/chunk-YWATQR3J.js.map +0 -1
|
@@ -1,399 +1,611 @@
|
|
|
1
|
-
/* @atomic-ui/blocks version 0.
|
|
2
|
-
import"./atomic-ui.js";import{css as
|
|
3
|
-
.h { margin: 0; color: ${
|
|
4
|
-
.eyebrow { margin: 0; color: var(--impakt-eyebrow, var(--impakt-color-text-eyebrow, ${
|
|
5
|
-
.body { margin: 0; line-height: ${
|
|
6
|
-
`,
|
|
1
|
+
/* @atomic-ui/blocks version 0.8.0, standalone. Load atomic-ui.js from @atomic-ui/ui first, from the same folder. */
|
|
2
|
+
import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.js";import{ImpaktElement as ae,fontSize as Te,fontWeight as be,lineHeight as ot,space as b,spaceAround as gt,t as S,type as ye,iconSvg as lt}from"./atomic-ui.js";var gi=(n,t,e)=>C`<div class=${e} role="heading" aria-level=${n}>${t}</div>`,Ii=Ae`
|
|
3
|
+
.h { margin: 0; color: ${S.textHeading}; font-family: ${S.fontHeading}; font-weight: ${be("bold")}; line-height: ${ot("tight")}; }
|
|
4
|
+
.eyebrow { margin: 0; color: var(--impakt-eyebrow, var(--impakt-color-text-eyebrow, ${S.brand})); ${ye("sm")} font-size: var(--impakt-font-size-eyebrow, var(--impakt-font-size-sm, 0.875rem)); font-family: ${S.fontEyebrow}; font-weight: var(--impakt-font-weight-eyebrow, ${be("semibold")}); letter-spacing: ${S.trackingWide}; text-transform: uppercase; }
|
|
5
|
+
.body { margin: 0; line-height: ${ot("normal")}; max-inline-size: 65ch; }
|
|
6
|
+
`,ct=class extends ae{static{this.properties={eyebrow:{type:String},heading:{type:String},lead:{type:String},level:{type:Number,reflect:!0},imageSrc:{type:String,attribute:"image-src"},imageAlt:{type:String,attribute:"image-alt"},treatment:{type:String,reflect:!0},ratingText:{type:String,attribute:"rating-text"},eyebrowIcon:{type:String,attribute:"eyebrow-icon"},align:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.eyebrow="",this.heading="",this.lead="",this.level=1,this.imageSrc="",this.imageAlt="",this.treatment="split",this.ratingText="",this.eyebrowIcon="none",this.align="start",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...ae.styles,gt,Ii,Ae`
|
|
7
7
|
:host { display: block; container-type: inline-size; }
|
|
8
|
-
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: ${
|
|
8
|
+
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: ${b(8)}; align-items: center; }
|
|
9
9
|
.hero.pictured { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
|
|
10
|
-
.words { display: flex; flex-direction: column; gap: ${
|
|
10
|
+
.words { display: flex; flex-direction: column; gap: ${b(4)}; }
|
|
11
11
|
:host([align='center']) .words { align-items: center; text-align: center; margin-inline: auto; max-inline-size: 48rem; }
|
|
12
|
-
.h { ${
|
|
13
|
-
.body { ${
|
|
14
|
-
@container (max-width: 40rem) { .h { ${
|
|
15
|
-
.actions { display: flex; flex-wrap: wrap; gap: ${
|
|
12
|
+
.h { ${ye("5xl")} letter-spacing: ${S.trackingTight}; text-wrap: balance; }
|
|
13
|
+
.body { ${ye("lg")} color: ${S.textMuted}; text-wrap: pretty; }
|
|
14
|
+
@container (max-width: 40rem) { .h { ${ye("4xl")} } }
|
|
15
|
+
.actions { display: flex; flex-wrap: wrap; gap: ${b(3)} ${b(4)}; align-items: center; margin-block-start: ${b(2)}; }
|
|
16
16
|
:host([align='center']) .actions { justify-content: center; }
|
|
17
|
-
img { display: block; inline-size: 100%; block-size: auto; border-radius: ${
|
|
17
|
+
img { display: block; inline-size: 100%; block-size: auto; border-radius: ${S.radius2xl}; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: ${S.shadowLg}; }
|
|
18
18
|
@container (max-width: 48rem) { .hero.pictured { grid-template-columns: minmax(0, 1fr); } }
|
|
19
19
|
/* Cover: the picture fills the block edge to edge, a scrim keeps the words readable (1.4.3). */
|
|
20
|
-
.cover { position: relative; display: flex; flex-direction: column; justify-content: center; min-block-size: clamp(44rem, 61vw, 55rem); margin-inline: calc(var(--impakt-bleed, 1) * (50% - 50vw)); padding: ${
|
|
20
|
+
.cover { position: relative; display: flex; flex-direction: column; justify-content: center; min-block-size: clamp(44rem, 61vw, 55rem); margin-inline: calc(var(--impakt-bleed, 1) * (50% - 50vw)); padding: ${b(32)} max(${b(8)}, calc(var(--impakt-bleed, 1) * (50vw - 50%))) ${b(24)}; overflow: hidden; color: #fff; --impakt-color-text-heading: #fff; }
|
|
21
21
|
.cover img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
|
|
22
22
|
.cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(18 31 26 / 0.82) 0%, rgb(18 31 26 / 0.42) 55%, rgb(18 31 26 / 0.05) 100%); }
|
|
23
23
|
.cover .words { position: relative; z-index: 1; max-inline-size: 48rem; }
|
|
24
|
-
.cover .eyebrow { display: inline-flex; align-items: center; gap: ${
|
|
24
|
+
.cover .eyebrow { display: inline-flex; align-items: center; gap: ${b(2)}; align-self: flex-start; padding: ${b(2)} ${b(3.5)}; color: #fff; background: rgb(255 255 255 / 0.16); border-radius: 999px; text-transform: none; letter-spacing: 0; }
|
|
25
25
|
.chip-line { position: relative; z-index: 1; block-size: 0; }
|
|
26
|
-
.chip { position: absolute; inset-block-start: ${
|
|
27
|
-
.finder { position: relative; z-index: 1; margin-block-start: ${
|
|
26
|
+
.chip { position: absolute; inset-block-start: ${b(14)}; inset-inline-end: ${b(9)}; display: inline-flex; align-items: center; gap: ${b(2.5)}; padding: ${b(3)} ${b(4.5)}; ${ye("sm")} font-weight: ${be("semibold")}; white-space: nowrap; color: #fff; background: rgb(255 255 255 / 0.16); border-radius: ${S.radiusXl}; }
|
|
27
|
+
.finder { position: relative; z-index: 1; margin-block-start: ${b(12)}; }
|
|
28
28
|
.cover .h { font-size: clamp(3rem, 6.4vw, 5.75rem); line-height: 1; }
|
|
29
29
|
.cover .body { color: rgb(255 255 255 / 0.92); max-inline-size: 40rem; }
|
|
30
30
|
@container (max-width: 64rem) { .chip { display: none; } }
|
|
31
31
|
@container (max-width: 30rem) { .finder { display: none; } }
|
|
32
|
-
@container (max-width: 48rem) { .finder { margin-block-start: ${
|
|
33
|
-
`]}render(){if(this.treatment==="cover"&&this.imageSrc)return
|
|
34
|
-
${this.ratingText?
|
|
32
|
+
@container (max-width: 48rem) { .finder { margin-block-start: ${b(6)}; } .cover { justify-content: flex-end; min-block-size: 43.75rem; padding-block: ${b(32)} ${b(10)}; } .cover::after { background: linear-gradient(180deg, rgb(18 31 26 / 0.1) 0%, rgb(18 31 26 / 0.3) 42%, rgb(18 31 26 / 0.86) 100%); } .cover .h { font-size: 3rem; } }
|
|
33
|
+
`]}render(){if(this.treatment==="cover"&&this.imageSrc)return C`<div class="cover" part="hero">
|
|
34
|
+
${this.ratingText?C`<div class="chip-line"><div class="chip">${lt("star","20px")}${this.ratingText}</div></div>`:G}
|
|
35
35
|
<img src=${this.imageSrc} alt=${this.imageAlt} part="image" />
|
|
36
36
|
<div class="words">
|
|
37
|
-
${this.eyebrow?
|
|
38
|
-
${
|
|
39
|
-
${this.lead?
|
|
37
|
+
${this.eyebrow?C`<p class="eyebrow" part="eyebrow">${this.eyebrowIcon!=="none"?lt(this.eyebrowIcon,"16px"):G}${this.eyebrow}</p>`:G}
|
|
38
|
+
${gi(this.level,this.heading,"h")}
|
|
39
|
+
${this.lead?C`<p class="body">${this.lead}</p>`:G}
|
|
40
40
|
<div class="actions"><slot name="actions"></slot></div>
|
|
41
41
|
</div>
|
|
42
42
|
<div class="finder"><slot name="search"></slot></div>
|
|
43
|
-
</div>`;let t=!!this.imageSrc&&this.align!=="center";return
|
|
43
|
+
</div>`;let t=!!this.imageSrc&&this.align!=="center";return C`<div class="hero ${t?"pictured":""}" part="hero">
|
|
44
44
|
<div class="words">
|
|
45
|
-
${this.eyebrow?
|
|
46
|
-
${
|
|
47
|
-
${this.lead?
|
|
45
|
+
${this.eyebrow?C`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>`:G}
|
|
46
|
+
${gi(this.level,this.heading,"h")}
|
|
47
|
+
${this.lead?C`<p class="body">${this.lead}</p>`:G}
|
|
48
48
|
<div class="actions"><slot name="actions"></slot></div>
|
|
49
49
|
</div>
|
|
50
|
-
${t?
|
|
51
|
-
</div>`}},
|
|
50
|
+
${t?C`<img src=${this.imageSrc} alt=${this.imageAlt} part="image" />`:G}
|
|
51
|
+
</div>`}},dt=class extends ae{static{this.properties={items:{type:Array},columns:{type:String,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},layout:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.items=[],this.columns="three",this.headingLevel=3,this.layout="stacked",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...ae.styles,gt,Ii,Ae`
|
|
52
52
|
:host { display: block; container-type: inline-size; }
|
|
53
|
-
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${
|
|
53
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${b(8)} ${b(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
54
54
|
:host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
55
55
|
:host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
56
|
-
li { display: flex; flex-direction: column; gap: ${
|
|
57
|
-
:host([layout='inline']) li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: ${
|
|
58
|
-
:host([layout='inline']) .words { display: flex; flex-direction: column; gap: ${
|
|
59
|
-
.icon { display: inline-flex; align-items: center; justify-content: center; inline-size: 48px; block-size: 48px; border-radius: ${
|
|
56
|
+
li { display: flex; flex-direction: column; gap: ${b(2)}; }
|
|
57
|
+
:host([layout='inline']) li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: ${b(4)}; align-items: start; }
|
|
58
|
+
:host([layout='inline']) .words { display: flex; flex-direction: column; gap: ${b(1)}; }
|
|
59
|
+
.icon { display: inline-flex; align-items: center; justify-content: center; inline-size: 48px; block-size: 48px; border-radius: ${S.radiusLg}; background: ${S.brandSubtle}; color: ${S.brand}; margin-block-end: ${b(2)}; }
|
|
60
60
|
:host([layout='inline']) .icon { margin: 0; }
|
|
61
|
-
.h { font-size: ${
|
|
62
|
-
.body { color: ${
|
|
61
|
+
.h { font-size: ${Te("lg")}; }
|
|
62
|
+
.body { color: ${S.text}; }
|
|
63
63
|
@container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
64
64
|
@container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
65
|
-
`]}render(){return
|
|
66
|
-
${t.icon?
|
|
67
|
-
<div class="words">${
|
|
68
|
-
</li>`)}</ul>`}},
|
|
65
|
+
`]}render(){return C`<ul part="list">${(this.items??[]).map(t=>C`<li part="item">
|
|
66
|
+
${t.icon?C`<span class="icon">${lt(t.icon,"24px")}</span>`:G}
|
|
67
|
+
<div class="words">${gi(this.headingLevel,t.heading,"h")}${t.text?C`<p class="body">${t.text}</p>`:G}</div>
|
|
68
|
+
</li>`)}</ul>`}},pt=class extends ae{static{this.properties={quote:{type:String},person:{type:String},about:{type:String},imageSrc:{type:String,attribute:"image-src"},size:{type:String,reflect:!0},align:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.quote="",this.person="",this.about="",this.imageSrc="",this.size="md",this.align="start",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...ae.styles,gt,Ae`
|
|
69
69
|
:host { display: block; }
|
|
70
|
-
figure { margin: 0; display: flex; flex-direction: column; gap: ${
|
|
70
|
+
figure { margin: 0; display: flex; flex-direction: column; gap: ${b(4)}; max-inline-size: 48rem; }
|
|
71
71
|
:host([align='center']) figure { margin-inline: auto; align-items: center; text-align: center; }
|
|
72
|
-
blockquote { margin: 0; font-family: ${
|
|
73
|
-
:host([size='lg']) blockquote { font-size: ${
|
|
72
|
+
blockquote { margin: 0; font-family: ${S.fontHeading}; font-size: ${Te("lg")}; line-height: ${ot("normal")}; color: inherit; }
|
|
73
|
+
:host([size='lg']) blockquote { font-size: ${Te("2xl")}; line-height: ${ot("tight")}; }
|
|
74
74
|
blockquote::before { content: '\\201C'; } blockquote::after { content: '\\201D'; }
|
|
75
|
-
figcaption { display: flex; align-items: center; gap: ${
|
|
75
|
+
figcaption { display: flex; align-items: center; gap: ${b(3)}; }
|
|
76
76
|
img { inline-size: 48px; block-size: 48px; border-radius: 50%; object-fit: cover; }
|
|
77
|
-
.name { font-weight: ${
|
|
78
|
-
.detail { color: ${
|
|
79
|
-
`]}render(){return
|
|
77
|
+
.name { font-weight: ${be("semibold")}; }
|
|
78
|
+
.detail { color: ${S.textMuted}; font-size: ${Te("sm")}; }
|
|
79
|
+
`]}render(){return C`<figure part="figure">
|
|
80
80
|
<blockquote part="quote">${this.quote}</blockquote>
|
|
81
|
-
${this.person?
|
|
82
|
-
</figure>`}},
|
|
81
|
+
${this.person?C`<figcaption>${this.imageSrc?C`<img src=${this.imageSrc} alt="" />`:G}<span><span class="name">${this.person}</span>${this.about?C`<br /><span class="detail">${this.about}</span>`:G}</span></figcaption>`:G}
|
|
82
|
+
</figure>`}},ht=class extends ae{static{this.properties={figure:{type:String},label:{type:String},note:{type:String},size:{type:String,reflect:!0},align:{type:String,reflect:!0}}}constructor(){super(),this.figure="",this.label="",this.note="",this.size="md",this.align="start"}static{this.styles=[...ae.styles,Ae`
|
|
83
83
|
:host { display: block; }
|
|
84
|
-
.stat { display: flex; flex-direction: column; gap: ${
|
|
84
|
+
.stat { display: flex; flex-direction: column; gap: ${b(1)}; }
|
|
85
85
|
:host([align='center']) .stat { align-items: center; text-align: center; }
|
|
86
|
-
.value { font-family: ${
|
|
87
|
-
:host([size='lg']) .value { font-size: ${
|
|
86
|
+
.value { font-family: ${S.fontHeading}; font-size: ${Te("3xl")}; font-weight: ${be("bold")}; line-height: 1; color: ${S.textHeading}; }
|
|
87
|
+
:host([size='lg']) .value { font-size: ${Te("5xl")}; }
|
|
88
88
|
:host([size='xl']) .value { font-size: clamp(2.75rem, 6vw, 4rem); }
|
|
89
|
-
.label { font-weight: ${
|
|
90
|
-
.detail { color: ${
|
|
91
|
-
`]}render(){return
|
|
89
|
+
.label { font-weight: ${be("semibold")}; }
|
|
90
|
+
.detail { color: ${S.textMuted}; font-size: ${Te("sm")}; }
|
|
91
|
+
`]}render(){return C`<p class="stat" part="stat" style="margin:0"><span class="value">${this.figure}</span> <span class="label">${this.label}</span>${this.note?C` <span class="detail">${this.note}</span>`:G}</p>`}},mt=class extends ae{static{this.properties={message:{type:String},linkText:{type:String,attribute:"link-text"},href:{type:String}}}constructor(){super(),this.message="",this.linkText="",this.href=""}static{this.styles=[...ae.styles,Ae`
|
|
92
92
|
:host { display: block; }
|
|
93
|
-
.bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: ${
|
|
93
|
+
.bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: ${b(2)} ${b(3)}; padding: ${b(2.5)} ${b(5)}; ${ye("sm")} text-align: center; color: ${S.onBrand}; background: ${S.brand}; }
|
|
94
94
|
:host { margin-inline: calc(var(--impakt-bleed, 1) * (50% - 50vw)); }
|
|
95
|
-
a { display: inline-flex; align-items: center; gap: ${
|
|
96
|
-
`]}render(){return
|
|
95
|
+
a { display: inline-flex; align-items: center; gap: ${b(1)}; min-block-size: ${S.targetMin}; color: inherit; font-weight: ${be("semibold")}; }
|
|
96
|
+
`]}render(){return C`<div class="bar" part="bar"><span>${this.message}</span>${this.linkText&&this.href?C`<a href=${this.href}>${this.linkText}${lt("arrow-right","14px")}</a>`:G}</div>`}},ut=class extends ae{static{this.properties={items:{type:Array},buttonText:{type:String,attribute:"button-text"},action:{type:String},label:{type:String},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.items=[],this.buttonText="Search",this.action="",this.label="Search",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...ae.styles,gt,Ae`
|
|
97
97
|
:host { display: block; container-type: inline-size; }
|
|
98
|
-
form { display: flex; align-items: center; padding: ${
|
|
99
|
-
.field { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${
|
|
100
|
-
label { ${
|
|
101
|
-
select { inline-size: 100%; min-block-size: 28px; padding: 0; font: inherit; ${
|
|
102
|
-
select:focus-visible, button:focus-visible { outline: 2px solid ${
|
|
103
|
-
button { flex: none; min-block-size: 48px; padding: ${
|
|
104
|
-
button:hover { background: ${
|
|
98
|
+
form { display: flex; align-items: center; padding: ${b(3)}; background: ${S.surfaceCard}; color: ${S.text}; border-radius: ${S.radius2xl}; box-shadow: ${S.shadowXl}; }
|
|
99
|
+
.field { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${b(1)}; padding: ${b(1.5)} ${b(5)}; }
|
|
100
|
+
label { ${ye("sm")} color: ${S.textMuted}; }
|
|
101
|
+
select { inline-size: 100%; min-block-size: 28px; padding: 0; font: inherit; ${ye("sm")} font-weight: ${be("semibold")}; color: ${S.text}; background: transparent; border: 0; border-radius: ${S.radiusSm}; cursor: pointer; }
|
|
102
|
+
select:focus-visible, button:focus-visible { outline: 2px solid ${S.brand}; outline-offset: 2px; }
|
|
103
|
+
button { flex: none; min-block-size: 48px; padding: ${b(3)} ${b(6)}; font: inherit; font-weight: ${be("semibold")}; color: ${S.onBrand}; background: ${S.brand}; border: 0; border-radius: ${S.radiusLg}; cursor: pointer; }
|
|
104
|
+
button:hover { background: ${S.brandHover}; }
|
|
105
105
|
@container (max-width: 56rem) { form { flex-wrap: wrap; } .field { flex: 1 1 40%; } button { inline-size: 100%; } }
|
|
106
|
-
@container (max-width: 30rem) { form { flex-direction: column; align-items: stretch; gap: ${
|
|
107
|
-
`]}submit(t){let e=new FormData(t.currentTarget),i={};e.forEach((a,
|
|
108
|
-
${(this.items??[]).map((t,e)=>{let i=this.id_(`field-${e}`),a=String(t.options??"").split(",").map(
|
|
109
|
-
<option value="">${t.placeholder||"Any"}</option>${a.map(
|
|
106
|
+
@container (max-width: 30rem) { form { flex-direction: column; align-items: stretch; gap: ${b(2)}; } .field { flex: none; } }
|
|
107
|
+
`]}submit(t){let e=new FormData(t.currentTarget),i={};e.forEach((a,r)=>{a!==""&&(i[r]=String(a))}),this.dispatchEvent(new CustomEvent("impakt-submit",{detail:{values:i},bubbles:!0,composed:!0})),this.action||t.preventDefault()}render(){return C`<form role="search" aria-label=${this.label} method="get" action=${this.action||G} @submit=${this.submit} part="form">
|
|
108
|
+
${(this.items??[]).map((t,e)=>{let i=this.id_(`field-${e}`),a=String(t.options??"").split(",").map(r=>r.trim()).filter(Boolean);return C`<div class="field"><label for=${i}>${t.label}</label><select id=${i} name=${t.name||t.label.toLowerCase().replace(/[^a-z0-9]+/g,"-")}>
|
|
109
|
+
<option value="">${t.placeholder||"Any"}</option>${a.map(r=>C`<option value=${r}>${r}</option>`)}
|
|
110
110
|
</select></div>`})}
|
|
111
111
|
<button type="submit">${this.buttonText}</button>
|
|
112
|
-
</form>`}};customElements.define("impakt-search-bar",
|
|
112
|
+
</form>`}};customElements.define("impakt-search-bar",ut);customElements.define("impakt-announcement",mt);customElements.define("impakt-hero",ct);customElements.define("impakt-feature-list",dt);customElements.define("impakt-quote",pt);customElements.define("impakt-stat",ht);import{css as ba,html as Me,nothing as bt}from"./atomic-ui.js";import{ImpaktElement as Hi,focusRing as fa,fontSize as Ri,fontWeight as bi,lineHeight as Pi,space as Ne,spaceAround as $a,t as Q,iconSvg as ya}from"./atomic-ui.js";var ft=class extends Hi{static{this.properties={items:{type:Array},columns:{type:String,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},ratio:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.items=[],this.columns="three",this.headingLevel=3,this.ratio="4:3",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...Hi.styles,fa,$a,ba`
|
|
113
113
|
:host { display: block; container-type: inline-size; --ratio: 4 / 3; }
|
|
114
114
|
:host([ratio='16:9']) { --ratio: 16 / 9; }
|
|
115
115
|
:host([ratio='3:2']) { --ratio: 3 / 2; }
|
|
116
116
|
:host([ratio='1:1']) { --ratio: 1 / 1; }
|
|
117
|
-
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${
|
|
117
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${Ne(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
118
118
|
:host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
119
119
|
:host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
120
|
-
li { position: relative; display: flex; flex-direction: column; background: ${
|
|
121
|
-
li.linked:hover { box-shadow: ${
|
|
120
|
+
li { position: relative; display: flex; flex-direction: column; background: ${Q.surfaceCard}; border: ${Q.borderThin} solid ${Q.hairline}; border-radius: ${Q.radiusXl}; box-shadow: ${Q.shadowSm}; overflow: hidden; transition: box-shadow 150ms ease-in-out, transform 150ms ease-in-out; }
|
|
121
|
+
li.linked:hover { box-shadow: ${Q.shadowLg}; transform: translateY(-2px); }
|
|
122
122
|
img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; }
|
|
123
|
-
.words { display: flex; flex-direction: column; gap: ${
|
|
124
|
-
.h { margin: 0; color: ${
|
|
125
|
-
.h a { color: inherit; text-decoration: none; border-radius: ${
|
|
123
|
+
.words { display: flex; flex-direction: column; gap: ${Ne(2)}; padding: ${Ne(5)}; flex: 1; }
|
|
124
|
+
.h { margin: 0; color: ${Q.textHeading}; font-family: ${Q.fontHeading}; font-size: ${Ri("lg")}; font-weight: ${bi("bold")}; line-height: ${Pi("tight")}; }
|
|
125
|
+
.h a { color: inherit; text-decoration: none; border-radius: ${Q.radiusSm}; }
|
|
126
126
|
.h a::after { content: ''; position: absolute; inset: 0; }
|
|
127
127
|
li.linked:hover .h a { text-decoration: underline; text-underline-offset: 0.2em; }
|
|
128
|
-
.body { margin: 0; line-height: ${
|
|
129
|
-
.badge { align-self: flex-start; padding: ${
|
|
130
|
-
.more { margin-block-start: auto; display: inline-flex; align-items: center; gap: ${
|
|
128
|
+
.body { margin: 0; line-height: ${Pi("normal")}; }
|
|
129
|
+
.badge { align-self: flex-start; padding: ${Ne(.5)} ${Ne(2)}; border-radius: ${Q.radius}; font-size: ${Ri("sm")}; font-weight: ${bi("medium")}; background: ${Q.brandSubtle}; color: ${Q.brand}; box-shadow: inset 0 0 0 1px ${Q.hairline}; }
|
|
130
|
+
.more { margin-block-start: auto; display: inline-flex; align-items: center; gap: ${Ne(1)}; color: ${Q.link}; font-weight: ${bi("semibold")}; }
|
|
131
131
|
@container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
132
132
|
@container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
133
|
-
`]}render(){return
|
|
134
|
-
${t.imageSrc?
|
|
133
|
+
`]}render(){return Me`<ul part="list">${(this.items??[]).map(t=>Me`<li class=${t.href?"linked":""} part="card">
|
|
134
|
+
${t.imageSrc?Me`<img src=${t.imageSrc} alt=${t.imageAlt??""} loading="lazy" />`:bt}
|
|
135
135
|
<div class="words">
|
|
136
|
-
${t.badge?
|
|
137
|
-
<div class="h" role="heading" aria-level=${this.headingLevel}>${t.href?
|
|
138
|
-
${t.text?
|
|
139
|
-
${t.href?
|
|
136
|
+
${t.badge?Me`<span class="badge">${t.badge}</span>`:bt}
|
|
137
|
+
<div class="h" role="heading" aria-level=${this.headingLevel}>${t.href?Me`<a href=${t.href}>${t.heading}</a>`:t.heading}</div>
|
|
138
|
+
${t.text?Me`<p class="body">${t.text}</p>`:bt}
|
|
139
|
+
${t.href?Me`<span class="more" aria-hidden="true">${ya("arrow-right","1em")}</span>`:bt}
|
|
140
140
|
</div>
|
|
141
|
-
</li>`)}</ul>`}};customElements.define("impakt-card-grid",
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
</li>`)}</ul>`}};customElements.define("impakt-card-grid",ft);import{css as xa,html as Le,nothing as va}from"./atomic-ui.js";import{ImpaktElement as Ni,focusRing as ka,fontSize as Xe,fontWeight as $t,space as Ve,t as q,token as ji}from"./atomic-ui.js";var Oi=["note","wireframe","component","code","live"],fi=n=>Oi.includes(n),wa=Le`<svg class="arrow" viewBox="0 0 20 12" width="20" height="12" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" focusable="false">
|
|
142
|
+
<path d="M0 6h18M13 1l5 5-5 5" />
|
|
143
|
+
</svg>`,yt=class extends Ni{static{this.properties={stage:{type:String,reflect:!0},label:{type:String},href:{type:String},decorative:{type:Boolean,reflect:!0},track:{type:String},code:{type:Array}}}constructor(){super(),this.stage="live",this.label="",this.href="",this.decorative=!1,this.track="",this.code={}}static{this.styles=[...Ni.styles,ka,xa`
|
|
144
|
+
:host { display: block; inline-size: min(100%, 26rem); --impakt-journey-accent: ${ji("color.accent.default","#e2cc40")}; --impakt-journey-on-accent: ${ji("color.accent.on","#1a1a1a")}; --impakt-journey-ease: cubic-bezier(0.65, 0, 0.35, 1); --impakt-journey-time: 600ms; }
|
|
145
|
+
.frame { position: relative; block-size: 15rem; }
|
|
146
|
+
/* Each plate is one stage's shape. Only its opacity and transform ever change. */
|
|
147
|
+
.plate { position: absolute; box-sizing: border-box; opacity: 0; pointer-events: none; transition: opacity var(--impakt-journey-time) var(--impakt-journey-ease), transform var(--impakt-journey-time) var(--impakt-journey-ease); }
|
|
148
|
+
.bar { inset-inline: 0; inset-block-start: calc(50% - 3rem); block-size: 6rem; }
|
|
149
|
+
.note { inset-inline-start: 12%; inset-block-start: 0.5rem; inline-size: min(14rem, 80%); block-size: 14rem; background: var(--impakt-journey-accent); box-shadow: 0 1.1rem 2.2rem rgb(0 0 0 / 0.18); transform: rotate(-4deg); }
|
|
150
|
+
.wire { background: ${q.surfaceCard}; border: ${q.borderThin} dashed ${q.textMuted}; }
|
|
151
|
+
.wire svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; color: ${q.rule}; }
|
|
152
|
+
.solid { background: var(--impakt-journey-accent); }
|
|
153
|
+
.shadow { box-shadow: 0 0.9rem 1.75rem rgb(0 0 0 / 0.22); }
|
|
154
|
+
.window { inset: 0; padding: ${Ve(5)}; background: ${q.text}; border-radius: ${q.radius}; font-family: ${q.fontMono}; font-size: ${Xe("sm")}; line-height: 1.6; color: color-mix(in srgb, ${q.surfaceCard} 78%, ${q.text}); white-space: pre; overflow: hidden; display: grid; grid-template-rows: 1fr 44px 1fr; }
|
|
155
|
+
.window .before { align-self: end; display: flex; flex-direction: column; }
|
|
156
|
+
.window .after { align-self: start; display: flex; flex-direction: column; }
|
|
157
|
+
.window .rule { display: block; block-size: 0.5em; margin-block: 0.55em; background: currentColor; opacity: 0.35; }
|
|
158
|
+
/* A measuring line above the bar, with a tick at each end. */
|
|
159
|
+
.marks { inset-inline: 0; inset-block-start: calc(50% - 4.5rem); block-size: 0.75rem; border-inline: 1.5px solid ${q.text}; }
|
|
160
|
+
.marks::before { content: ''; position: absolute; inset-inline: 0; inset-block-start: calc(50% - 0.75px); border-block-start: 1.5px solid ${q.text}; }
|
|
161
|
+
|
|
162
|
+
/* A stage that has passed shrinks toward the next shape as it fades; one still to come starts from the last. */
|
|
163
|
+
/* The note flattens without growing wider, so a shape that is not showing never reaches past the block (1.4.10). */
|
|
164
|
+
:host(:not([stage='note'])) .note { transform: rotate(0deg) scale(1, 0.45); }
|
|
165
|
+
:host([stage='note']) .wire { transform: rotate(-4deg) scale(0.6, 1.9); }
|
|
166
|
+
:host(:not([stage='code'])) .window { transform: scale(0.94, 0.5); }
|
|
167
|
+
:host([stage='note']) .note, :host([stage='wireframe']) .wire, :host(:is([stage='component'], [stage='live'])) .solid, :host([stage='code']) .window, :host([stage='component']) .marks, :host([stage='live']) .shadow { opacity: 1; }
|
|
168
|
+
|
|
169
|
+
/* The words. One element at every stage: a link, or a picture of one. */
|
|
170
|
+
.words { position: absolute; inset-inline: 0; inset-block-start: calc(50% - 3rem); box-sizing: border-box; min-block-size: 6rem; display: flex; align-items: center; justify-content: space-between; gap: ${Ve(4)}; padding-inline: ${Ve(8)}; font-family: ${q.fontBody}; font-size: ${Xe("lg")}; font-weight: ${$t("medium")}; line-height: 1.2; color: var(--impakt-journey-on-accent); text-decoration: none; transition: color var(--impakt-journey-time) var(--impakt-journey-ease), transform 180ms cubic-bezier(0.2, 0, 0, 1); }
|
|
171
|
+
.arrow { flex: none; }
|
|
172
|
+
:host([stage='note']) .words { inset-inline: 12% auto; inset-block-start: 0.5rem; inline-size: min(14rem, 80%); min-block-size: 14rem; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: ${Ve(6)}; font-size: ${Xe("2xl")}; font-weight: ${$t("semibold")}; letter-spacing: -0.02em; transform: rotate(-4deg); }
|
|
173
|
+
:host([stage='note']) .arrow { align-self: flex-end; }
|
|
174
|
+
:host([stage='wireframe']) .words { justify-content: center; font-family: ${q.fontMono}; font-size: ${Xe("sm")}; font-weight: ${$t("regular")}; color: ${q.textMuted}; }
|
|
175
|
+
:host([stage='code']) .words { inset-inline: ${Ve(5)}; justify-content: flex-start; min-block-size: 44px; inset-block-start: calc(50% - 22px); padding-inline: 3ch 0; font-family: ${q.fontMono}; font-size: ${Xe("sm")}; font-weight: ${$t("regular")}; color: var(--impakt-journey-code-words, ${q.surfaceCard}); }
|
|
176
|
+
/* Live, it answers a pointer: it lifts when pointed at and sits when pressed. */
|
|
177
|
+
:host([stage='live']) a.words:hover { transform: translateY(-2px); }
|
|
178
|
+
:host([stage='live']) a.words:active { transform: translateY(1px); }
|
|
179
|
+
a.words:focus-visible { outline: none; box-shadow: ${q.focusShadow}; }
|
|
180
|
+
@media (prefers-reduced-motion: reduce) { .plate, .words { transition: none; } :host([stage='live']) a.words:hover, :host([stage='live']) a.words:active { transform: none; } }
|
|
181
|
+
@media (forced-colors: active) {
|
|
182
|
+
.plate { forced-color-adjust: none; }
|
|
183
|
+
.note, .solid { background: Highlight; }
|
|
184
|
+
.marks, .marks::before { border-color: CanvasText; }
|
|
185
|
+
.window { background: Canvas; border: 1px solid CanvasText; color: CanvasText; }
|
|
186
|
+
.wire { background: Canvas; border-color: CanvasText; }
|
|
187
|
+
.words, :host([stage='wireframe']) .words, :host([stage='code']) .words { color: LinkText; forced-color-adjust: none; }
|
|
188
|
+
:host(:is([stage='note'], [stage='component'], [stage='live'])) .words { color: HighlightText; }
|
|
189
|
+
}
|
|
190
|
+
`]}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.watch()}disconnectedCallback(){super.disconnectedCallback(),this.observer?.disconnect(),this.observer=void 0}willUpdate(t){t.has("stage")&&!fi(this.stage)&&(this.stage="live")}updated(t){t.has("track")&&this.watch()}watch(){if(this.observer?.disconnect(),this.observer=void 0,!this.track||!this.isConnected||typeof IntersectionObserver!="function")return;let t;try{t=Array.from(this.ownerDocument.querySelectorAll(this.track)).filter(e=>fi(e.getAttribute("data-journey-stage")))}catch{return}if(t.length){this.observer=new IntersectionObserver(e=>this.crossed(e),{rootMargin:"-50% 0px -50% 0px",threshold:0});for(let e of t)this.observer.observe(e)}}crossed(t){let i=t.find(a=>a.isIntersecting)?.target.getAttribute("data-journey-stage");!fi(i)||i===this.stage||(this.stage=i,this.dispatchEvent(new CustomEvent("impakt-journey-stage",{detail:{stage:i},bubbles:!0,composed:!0})))}lines(t,e){return t?.length?t.map(i=>Le`<span>${i}</span>`):Array.from({length:e},(i,a)=>Le`<span class="rule" style=${`inline-size:${[58,72,44][a%3]}%`}></span>`)}render(){let t=Le`<span>${this.label}</span>${wa}`;return Le`<div class="frame" part="frame" aria-hidden=${this.decorative?"true":va}>
|
|
191
|
+
<span class="plate note" aria-hidden="true"></span>
|
|
192
|
+
<span class="plate bar wire" aria-hidden="true"><svg viewBox="0 0 100 100" preserveAspectRatio="none" fill="none" stroke="currentColor" focusable="false"><path d="M0 0 100 100M0 100 100 0" vector-effect="non-scaling-stroke" /></svg></span>
|
|
193
|
+
<span class="plate bar shadow" aria-hidden="true"></span>
|
|
194
|
+
<span class="plate bar solid" aria-hidden="true"></span>
|
|
195
|
+
<span class="plate window" aria-hidden="true"><span class="before">${this.lines(this.code?.before,3)}</span><span></span><span class="after">${this.lines(this.code?.after,2)}</span></span>
|
|
196
|
+
<span class="plate marks" aria-hidden="true"></span>
|
|
197
|
+
${this.decorative||!this.href?Le`<span class="words" part="button">${t}</span>`:Le`<a class="words" part="button" href=${this.href}>${t}</a>`}
|
|
198
|
+
</div>`}};customElements.define("impakt-journey-button",yt);import{css as Ee,html as k,nothing as U}from"./atomic-ui.js";import{ImpaktElement as J,focusRing as $i,fontSize as _,fontWeight as re,lineHeight as At,lockScroll as Sa,space as z,spaceAround as Mt,t as c,token as Qe,unlockScroll as Fi}from"./atomic-ui.js";var za=k`<svg viewBox="0 0 22 22" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true" focusable="false">
|
|
199
|
+
<path d="M5 17 17 5M8 5h9v9" />
|
|
200
|
+
</svg>`,xt=class extends J{static{this.properties={items:{type:Array},headingLevel:{type:Number,attribute:"heading-level"},start:{type:Number},label:{type:String},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.items=[],this.headingLevel=3,this.start=1,this.label="",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...J.styles,$i,Mt,Ee`
|
|
201
|
+
:host { display: block; container: impakt-work-list / inline-size; }
|
|
202
|
+
ol { list-style: none; margin: 0; padding: 0; border-block-start: ${c.borderThin} solid ${c.text}; }
|
|
203
|
+
li { position: relative; display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto auto; align-items: center; column-gap: ${z(6)}; padding: ${z(5)} ${z(8)}; border-block-end: ${c.borderThin} solid ${c.text}; transition: background-color 140ms ease-out, color 140ms ease-out; }
|
|
204
|
+
.number { font-family: ${c.fontMono}; font-size: ${_("sm")}; font-variant-numeric: tabular-nums; color: ${c.textMuted}; }
|
|
205
|
+
.name { font-family: ${c.fontHeading}; font-size: clamp(2rem, 7cqi, 4.5rem); font-weight: ${re("semibold")}; line-height: 1; letter-spacing: -0.05em; color: ${c.text}; overflow-wrap: anywhere; }
|
|
206
|
+
.name a { color: inherit; text-decoration: none; }
|
|
207
|
+
/* The link is stretched over the row, so the row is one target. */
|
|
208
|
+
.name a::after { content: ''; position: absolute; inset: 0; }
|
|
209
|
+
.name a:focus-visible { outline: none; }
|
|
210
|
+
.name a:focus-visible::after { box-shadow: ${c.focusShadow}; }
|
|
211
|
+
.meta { font-family: ${c.fontMono}; font-size: ${_("sm")}; letter-spacing: ${c.trackingWide}; text-transform: uppercase; color: ${c.textMuted}; }
|
|
212
|
+
.arrow { display: flex; color: ${c.text}; }
|
|
213
|
+
/* Pointed at or focused, the row turns to ink. The card colour on the text colour is a pair every brand already holds at 4.5:1. */
|
|
214
|
+
li:has(a):hover, li:has(a:focus-visible) { background: ${c.text}; }
|
|
215
|
+
li:has(a):hover .name, li:has(a:focus-visible) .name { color: ${c.surfaceCard}; }
|
|
216
|
+
li:has(a):hover :is(.number, .meta), li:has(a:focus-visible) :is(.number, .meta) { color: color-mix(in srgb, ${c.surfaceCard} 78%, ${c.text}); }
|
|
217
|
+
li:has(a):hover .arrow, li:has(a:focus-visible) .arrow { color: ${Qe("color.accent.default","currentColor")}; }
|
|
218
|
+
@container impakt-work-list (max-width: 40rem) {
|
|
219
|
+
li { grid-template-columns: 2rem minmax(0, 1fr) auto; column-gap: ${z(3)}; padding-inline: ${z(4)}; }
|
|
220
|
+
.meta { grid-column: 2; grid-row: 2; margin-block-start: ${z(2)}; }
|
|
221
|
+
.arrow { grid-column: 3; grid-row: 1; }
|
|
222
|
+
}
|
|
223
|
+
@media (forced-colors: active) {
|
|
224
|
+
li:has(a):hover, li:has(a:focus-visible) { background: Canvas; outline: 2px solid Highlight; outline-offset: -2px; }
|
|
225
|
+
li:has(a):hover :is(.name, .number, .meta, .arrow), li:has(a:focus-visible) :is(.name, .number, .meta, .arrow) { color: CanvasText; }
|
|
226
|
+
}
|
|
227
|
+
`]}render(){return k`<ol role="list" part="list" aria-label=${this.label||U}>
|
|
228
|
+
${this.items.map((t,e)=>{let i=String(this.start+e).padStart(2,"0");return k`<li part="row">
|
|
229
|
+
<span class="number" aria-hidden="true">${i}</span>
|
|
230
|
+
<div class="name" part="name" role="heading" aria-level=${this.headingLevel}>
|
|
231
|
+
${t.href?k`<a href=${t.href} part="link">${t.name}</a>`:t.name}
|
|
232
|
+
</div>
|
|
233
|
+
${t.meta?k`<span class="meta" part="meta">${t.meta}</span>`:k`<span></span>`}
|
|
234
|
+
${t.href?k`<span class="arrow">${za}</span>`:k`<span></span>`}
|
|
235
|
+
</li>`})}
|
|
236
|
+
</ol>`}},vt=class extends J{static{this.properties={items:{type:Array},label:{type:String},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.items=[],this.label="",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...J.styles,Mt,Ee`
|
|
237
|
+
:host { display: block; container: impakt-stat-row / inline-size; }
|
|
238
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: ${z(6)}; }
|
|
239
|
+
li { border-block-start: ${c.borderThin} solid ${c.rule}; padding-block-start: ${z(5)}; }
|
|
240
|
+
p { margin: 0; display: flex; flex-direction: column; gap: ${z(2)}; }
|
|
241
|
+
.value { font-family: ${c.fontHeading}; font-size: clamp(2.25rem, 6cqi, 3.25rem); font-weight: ${re("semibold")}; line-height: 1; letter-spacing: -0.04em; color: ${c.textHeading}; }
|
|
242
|
+
.label { font-size: ${_("sm")}; line-height: ${At("normal")}; color: ${c.textMuted}; }
|
|
243
|
+
.note { font-size: ${_("sm")}; color: ${c.textMuted}; }
|
|
244
|
+
`]}render(){return k`<ul role="list" part="list" aria-label=${this.label||U}>
|
|
245
|
+
${this.items.map(t=>k`<li part="stat">
|
|
246
|
+
<p><span class="value" part="value">${t.figure}</span> <span class="label" part="label">${t.label}</span>${t.note?k` <span class="note">${t.note}</span>`:U}</p>
|
|
247
|
+
</li>`)}
|
|
248
|
+
</ul>`}},kt=class extends J{static{this.properties={eyebrow:{type:String},heading:{type:String},lead:{type:String},items:{type:Array},headingLevel:{type:Number,attribute:"heading-level"},open:{type:Array},multiple:{type:Boolean},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.eyebrow="",this.heading="",this.lead="",this.items=[],this.headingLevel=2,this.open=[],this.multiple=!0,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...J.styles,Mt,Ee`
|
|
249
|
+
:host { display: block; container: impakt-faq / inline-size; }
|
|
250
|
+
.head { display: flex; flex-direction: column; gap: ${z(4)}; margin-block-end: ${z(10)}; max-inline-size: 44rem; }
|
|
251
|
+
.eyebrow { margin: 0; font-family: ${c.fontEyebrow}; font-size: ${_("sm")}; color: var(--impakt-eyebrow, ${c.textMuted}); }
|
|
252
|
+
.heading { font-family: ${c.fontHeading}; font-size: clamp(2rem, 6cqi, 3.25rem); font-weight: ${re("semibold")}; line-height: 1.04; letter-spacing: -0.04em; color: ${c.textHeading}; }
|
|
253
|
+
.lead { margin: 0; font-size: ${_("md")}; line-height: ${At("normal")}; color: ${c.textMuted}; }
|
|
254
|
+
impakt-accordion { border-block-start: ${c.borderThin} solid ${c.rule}; }
|
|
255
|
+
`]}render(){let t=this.id_("heading"),e=Math.min(Math.max(this.headingLevel,1),5),i=this.eyebrow||this.heading||this.lead?k`<div class="head" part="head">
|
|
256
|
+
${this.eyebrow?k`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>`:U}
|
|
257
|
+
${this.heading?k`<div id=${t} class="heading" part="heading" role="heading" aria-level=${e}>${this.heading}</div>`:U}
|
|
258
|
+
${this.lead?k`<p class="lead" part="lead">${this.lead}</p>`:U}
|
|
259
|
+
</div>`:U,a=k`<impakt-accordion part="questions" .items=${this.items} .headingLevel=${e+1} .open=${this.open} .multiple=${this.multiple}>
|
|
260
|
+
${this.items.map(r=>k`<slot name=${`panel-${r.id}`} slot=${`panel-${r.id}`}>${r.body}</slot>`)}
|
|
261
|
+
</impakt-accordion>`;return this.heading?k`<section aria-labelledby=${t}>${i}${a}</section>`:k`<div>${i}${a}</div>`}},wt=class extends J{constructor(){super();this.hasFooter=!1;this.open=!1,this.links=[],this.current="",this.brand="",this.home="/",this.label="Menu",this.closeText="Close"}static{this.properties={open:{type:Boolean,reflect:!0},links:{type:Array},current:{type:String},brand:{type:String},home:{type:String},label:{type:String},closeText:{type:String,attribute:"close-text"}}}static{this.styles=[...J.styles,$i,Ee`
|
|
262
|
+
/* The ink colours are taken on the host, because the dialog repaints the text colour for what is inside it. */
|
|
263
|
+
:host { --impakt-menu: ${c.text}; --impakt-menu-on: ${c.surfaceCard}; --impakt-menu-muted: color-mix(in srgb, ${c.surfaceCard} 78%, ${c.text}); --impakt-menu-rule: color-mix(in srgb, ${c.surfaceCard} 18%, ${c.text}); }
|
|
264
|
+
dialog { box-sizing: border-box; display: none; flex-direction: column; inline-size: 100vw; max-inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; margin: 0; padding: 0; border: 0; overflow: auto; background: var(--impakt-menu); color: var(--impakt-menu-on); }
|
|
265
|
+
dialog[open] { display: flex; }
|
|
266
|
+
dialog::backdrop { background: var(--impakt-menu); }
|
|
267
|
+
.bar { display: flex; align-items: center; justify-content: space-between; gap: ${z(4)}; padding: ${z(2)} ${z(4)}; border-block-end: ${c.borderThin} solid var(--impakt-menu-rule); }
|
|
268
|
+
.brand { color: inherit; text-decoration: none; font-family: ${c.fontHeading}; font-size: ${_("md")}; font-weight: ${re("semibold")}; border-radius: ${c.radiusSm}; }
|
|
269
|
+
.close { display: inline-flex; align-items: center; gap: ${z(2)}; min-block-size: 44px; padding: 0 ${z(4)}; font: inherit; font-size: ${_("sm")}; font-weight: ${re("medium")}; color: var(--impakt-menu); background: var(--impakt-menu-on); border: 0; border-radius: ${c.radius}; cursor: pointer; }
|
|
270
|
+
nav { flex: 1; padding: ${z(6)} ${z(5)} 0; }
|
|
271
|
+
ol { list-style: none; margin: 0; padding: 0; }
|
|
272
|
+
li { border-block-end: ${c.borderThin} solid var(--impakt-menu-rule); }
|
|
273
|
+
li a { display: flex; align-items: center; justify-content: space-between; gap: ${z(4)}; padding-block: ${z(4)}; color: inherit; text-decoration: none; font-family: ${c.fontHeading}; font-size: clamp(2.25rem, 12vw, 3.5rem); font-weight: ${re("semibold")}; line-height: 1; letter-spacing: -0.05em; }
|
|
274
|
+
li a:hover .words { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.12em; }
|
|
275
|
+
.number { font-family: ${c.fontMono}; font-size: ${_("sm")}; font-weight: ${re("regular")}; letter-spacing: 0; color: var(--impakt-menu-muted); }
|
|
276
|
+
/*
|
|
277
|
+
* The current page is marked with a square. Its colour stays the menu's own text colour unless a brand sets
|
|
278
|
+
* --impakt-site-menu-current, because an accent is only readable on ink when the brand's ink is dark (1.4.3).
|
|
279
|
+
*/
|
|
280
|
+
a[aria-current] { color: var(--impakt-site-menu-current, var(--impakt-menu-on)); }
|
|
281
|
+
a[aria-current] .words::before { content: ''; display: inline-block; inline-size: 0.28em; block-size: 0.28em; margin-inline-end: 0.22em; vertical-align: 0.18em; background: currentColor; }
|
|
282
|
+
.foot { display: flex; flex-direction: column; gap: ${z(4)}; padding: ${z(8)} ${z(5)} calc(${z(8)} + env(safe-area-inset-bottom)); }
|
|
283
|
+
.foot[hidden] { display: none; }
|
|
284
|
+
/* What is slotted at the foot is read on ink too. */
|
|
285
|
+
::slotted(*) { --impakt-color-text-default: var(--impakt-menu-on); --impakt-color-text-heading: var(--impakt-menu-on); --impakt-color-text-muted: var(--impakt-menu-muted); --impakt-color-text-link: var(--impakt-menu-on); --impakt-color-text-link-hover: var(--impakt-menu-on); color: var(--impakt-menu-on); }
|
|
286
|
+
@media (forced-colors: active) { dialog { border: 1px solid CanvasText; } .close { border: 1px solid ButtonText; } }
|
|
287
|
+
`]}get dialog(){return this.renderRoot.querySelector("dialog")}updated(e){if(!e.has("open"))return;let i=this.dialog;i&&(this.open?(typeof i.showModal=="function"?i.showModal():i.setAttribute("open",""),Sa(this)):(typeof i.close=="function"&&i.open?i.close():i.removeAttribute("open"),Fi(this)))}disconnectedCallback(){super.disconnectedCallback(),Fi(this)}close(){this.open&&(this.open=!1,this.dispatchEvent(new CustomEvent("impakt-close",{bubbles:!0,composed:!0})))}footerChanged(e){this.hasFooter=e.target.assignedNodes().length>0,this.requestUpdate()}render(){return k`<dialog part="dialog" aria-label=${this.label} @cancel=${()=>this.close()} @close=${()=>this.close()}>
|
|
288
|
+
<div class="bar" part="bar">
|
|
289
|
+
${this.brand?k`<a class="brand" href=${this.home||"/"} part="brand">${this.brand}</a>`:k`<span></span>`}
|
|
290
|
+
<button class="close" type="button" part="close" @click=${()=>this.close()}>
|
|
291
|
+
<span>${this.closeText}</span>
|
|
292
|
+
<svg viewBox="0 0 12 12" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" focusable="false"><path d="M1 1l10 10M11 1 1 11" /></svg>
|
|
293
|
+
</button>
|
|
294
|
+
</div>
|
|
295
|
+
<nav aria-label=${this.label} part="nav">
|
|
296
|
+
<ol role="list">
|
|
297
|
+
${(this.links??[]).map((e,i)=>{let a=!!this.current&&e.href===this.current;return k`<li>
|
|
298
|
+
<a href=${e.href} aria-current=${a?"page":U} part="link" @click=${()=>this.close()}>
|
|
299
|
+
<span class="words">${e.label}</span><span class="number" aria-hidden="true">${String(i+1).padStart(2,"0")}</span>
|
|
300
|
+
</a>
|
|
301
|
+
</li>`})}
|
|
302
|
+
</ol>
|
|
303
|
+
</nav>
|
|
304
|
+
<div class="foot" part="footer" ?hidden=${!this.hasFooter}><slot name="footer" @slotchange=${this.footerChanged}></slot></div>
|
|
305
|
+
</dialog>`}},St=class extends J{static{this.properties={eyebrow:{type:String},heading:{type:String},lead:{type:String},points:{type:Array},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.eyebrow="",this.heading="",this.lead="",this.points=[],this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...J.styles,Mt,Ee`
|
|
306
|
+
:host { display: block; container: impakt-offer / inline-size; }
|
|
307
|
+
.offer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${z(12)}; align-items: start; }
|
|
308
|
+
.copy { display: flex; flex-direction: column; align-items: flex-start; gap: ${z(5)}; }
|
|
309
|
+
.eyebrow { margin: 0; font-family: ${c.fontEyebrow}; font-size: ${_("sm")}; color: var(--impakt-eyebrow, ${c.textMuted}); }
|
|
310
|
+
.heading { font-family: ${c.fontHeading}; font-size: clamp(2rem, 6cqi, 3.75rem); font-weight: ${re("semibold")}; line-height: 1; letter-spacing: -0.04em; color: ${c.textHeading}; }
|
|
311
|
+
.lead { margin: 0; max-inline-size: 32rem; font-size: ${_("md")}; line-height: ${At("normal")}; color: ${c.text}; }
|
|
312
|
+
ol { list-style: none; margin: 0; padding: 0; }
|
|
313
|
+
li { display: flex; gap: ${z(5)}; padding-block: ${z(5)}; border-block-start: ${c.borderThin} solid ${c.text}; font-size: ${_("lg")}; font-weight: ${re("medium")}; line-height: 1.2; color: ${c.text}; }
|
|
314
|
+
.number { flex: none; font-family: ${c.fontMono}; font-size: ${_("sm")}; font-weight: ${re("regular")}; line-height: 1.6; }
|
|
315
|
+
@container impakt-offer (max-width: 44rem) { .offer { grid-template-columns: 1fr; gap: ${z(8)}; } }
|
|
316
|
+
`]}render(){let t=Math.min(Math.max(this.headingLevel,1),6);return k`<div class="offer" part="offer">
|
|
317
|
+
<div class="copy">
|
|
318
|
+
${this.eyebrow?k`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>`:U}
|
|
319
|
+
${this.heading?k`<div class="heading" part="heading" role="heading" aria-level=${t}>${this.heading}</div>`:U}
|
|
320
|
+
${this.lead?k`<p class="lead" part="lead">${this.lead}</p>`:U}
|
|
321
|
+
<slot name="actions"></slot>
|
|
322
|
+
</div>
|
|
323
|
+
${(this.points??[]).length?k`<ol role="list" part="points">
|
|
324
|
+
${this.points.map((e,i)=>k`<li><span class="number" aria-hidden="true">${String(i+1).padStart(2,"0")}</span><span>${e}</span></li>`)}
|
|
325
|
+
</ol>`:U}
|
|
326
|
+
</div>`}},zt=class extends J{static{this.properties={heading:{type:String},text:{type:String},meta:{type:String},href:{type:String},linkText:{type:String,attribute:"link-text"},headingLevel:{type:Number,attribute:"heading-level"}}}constructor(){super(),this.heading="",this.text="",this.meta="",this.href="",this.linkText="",this.headingLevel=3}static{this.styles=[...J.styles,$i,Ee`
|
|
327
|
+
:host { display: block; block-size: 100%; }
|
|
328
|
+
article { position: relative; box-sizing: border-box; block-size: 100%; display: flex; flex-direction: column; gap: ${z(4)}; padding: ${z(6)}; background: ${c.surfaceCard}; border: ${c.borderThin} solid ${c.text}; border-radius: ${c.radius}; transition: background-color 140ms ease-out; }
|
|
329
|
+
.meta { margin: 0; font-family: ${c.fontMono}; font-size: ${_("sm")}; letter-spacing: ${c.trackingWide}; text-transform: uppercase; color: ${c.textMuted}; }
|
|
330
|
+
.heading { font-family: ${c.fontHeading}; font-size: ${_("xl")}; font-weight: ${re("semibold")}; line-height: 1.15; letter-spacing: -0.025em; color: ${c.text}; }
|
|
331
|
+
.heading a { color: inherit; text-decoration: none; }
|
|
332
|
+
.heading a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
|
|
333
|
+
.heading a:focus-visible { outline: none; }
|
|
334
|
+
.heading a:focus-visible::after { box-shadow: ${c.focusShadow}; }
|
|
335
|
+
article:has(a):hover .heading { text-decoration: underline; text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
|
|
336
|
+
.text { margin: 0; font-size: ${_("sm")}; line-height: ${At("normal")}; color: ${c.textMuted}; }
|
|
337
|
+
.more { margin-block-start: auto; font-family: ${c.fontMono}; font-size: ${_("sm")}; letter-spacing: ${c.trackingWide}; text-transform: uppercase; color: ${c.text}; }
|
|
338
|
+
@media (forced-colors: active) { article { border-color: CanvasText; } }
|
|
339
|
+
`]}render(){let t=Math.min(Math.max(this.headingLevel,1),6);return k`<article part="card">
|
|
340
|
+
${this.meta?k`<p class="meta" part="meta">${this.meta}</p>`:U}
|
|
341
|
+
<div class="heading" part="heading" role="heading" aria-level=${t}>${this.href?k`<a href=${this.href} part="link">${this.heading}</a>`:this.heading}</div>
|
|
342
|
+
${this.text?k`<p class="text" part="text">${this.text}</p>`:U}
|
|
343
|
+
${this.linkText&&this.href?k`<span class="more" aria-hidden="true">${this.linkText} →</span>`:U}
|
|
344
|
+
</article>`}},Tt=class extends J{static{this.properties={label:{type:String}}}constructor(){super(),this.label=""}static{this.styles=[...J.styles,Ee`
|
|
345
|
+
:host { display: inline-block; position: relative; padding-inline: 0.1em; margin-inline: -0.02em; background: ${Qe("color.accent.default","#e2cc40")}; color: ${Qe("color.accent.on","#1a1a1a")}; outline: 1.5px solid ${Qe("color.accent.on","#1a1a1a")}; outline-offset: -1px; }
|
|
346
|
+
.handle { position: absolute; inline-size: 8px; block-size: 8px; box-sizing: border-box; background: ${c.surfaceCard}; border: 1.5px solid ${Qe("color.accent.on","#1a1a1a")}; }
|
|
347
|
+
.handle:nth-of-type(1) { inset-block-start: -4px; inset-inline-start: -4px; }
|
|
348
|
+
.handle:nth-of-type(2) { inset-block-start: -4px; inset-inline-end: -4px; }
|
|
349
|
+
.handle:nth-of-type(3) { inset-block-end: -4px; inset-inline-start: -4px; }
|
|
350
|
+
.handle:nth-of-type(4) { inset-block-end: -4px; inset-inline-end: -4px; }
|
|
351
|
+
.label { position: absolute; inset-block-start: calc(100% + 8px); inset-inline-start: 0; padding: 3px 7px; white-space: nowrap; font-family: ${c.fontMono}; font-size: 0.6875rem; font-weight: ${re("medium")}; line-height: 1.4; letter-spacing: 0.06em; text-transform: uppercase; color: ${c.surfaceCard}; background: ${c.text}; border-radius: 3px; }
|
|
352
|
+
@media (forced-colors: active) { :host { forced-color-adjust: none; background: Highlight; color: HighlightText; outline-color: HighlightText; } .handle { border-color: HighlightText; background: Canvas; } .label { background: CanvasText; color: Canvas; } }
|
|
353
|
+
`]}render(){return k`<slot></slot><span class="handle" aria-hidden="true"></span><span class="handle" aria-hidden="true"></span><span class="handle" aria-hidden="true"></span><span class="handle" aria-hidden="true"></span>${this.label?k`<span class="label" part="label" aria-hidden="true">${this.label}</span>`:U}`}};customElements.define("impakt-work-list",xt);customElements.define("impakt-stat-row",vt);customElements.define("impakt-faq",kt);customElements.define("impakt-site-menu",wt);customElements.define("impakt-offer",St);customElements.define("impakt-post-card",zt);customElements.define("impakt-highlight",Tt);import{css as he,html as f,nothing as R}from"./atomic-ui.js";import{say as ee,ImpaktElement as Y,focusRing as Nt,targetSize as yi,visuallyHidden as Ta,fontWeight as pe,lineHeight as _i,space as h,spaceAround as xe,t as p,token as Aa,type as B,iconSvg as Ce}from"./atomic-ui.js";var Ma=Aa("color.accent.default","#c8a15a"),Wi=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,Di=he`
|
|
354
|
+
.round { ${yi} display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; padding: 0; color: ${p.text}; background: ${p.surfaceCard}; border: ${p.borderThin} solid ${p.rule}; border-radius: 50%; box-shadow: ${p.shadowSm}; cursor: pointer; transition: box-shadow 120ms ease-in-out, background-color 120ms ease-in-out; }
|
|
355
|
+
.round:hover:not(:disabled) { box-shadow: ${p.shadowMd}; }
|
|
144
356
|
.round:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
|
|
145
|
-
`,
|
|
146
|
-
.eyebrow { margin: 0; color: var(--impakt-eyebrow, var(--impakt-color-text-eyebrow, ${
|
|
147
|
-
.h { margin: 0; color: ${
|
|
148
|
-
.lead { margin: 0; color: ${
|
|
149
|
-
`,
|
|
150
|
-
:host { display: block; container-type: inline-size; --most: 1; --gap: ${
|
|
357
|
+
`,jt=he`
|
|
358
|
+
.eyebrow { margin: 0; color: var(--impakt-eyebrow, var(--impakt-color-text-eyebrow, ${p.brand})); ${B("sm")} font-size: var(--impakt-font-size-eyebrow, var(--impakt-font-size-sm, 0.875rem)); font-family: ${p.fontEyebrow}; font-weight: var(--impakt-font-weight-eyebrow, ${pe("semibold")}); letter-spacing: ${p.trackingWide}; text-transform: uppercase; }
|
|
359
|
+
.h { margin: 0; color: ${p.textHeading}; font-family: ${p.fontHeading}; font-weight: ${pe("bold")}; letter-spacing: ${p.trackingTight}; text-wrap: balance; }
|
|
360
|
+
.lead { margin: 0; color: ${p.textMuted}; text-wrap: pretty; }
|
|
361
|
+
`,Lt=class extends Y{constructor(){super();this.index=0;this.count=0;this.visible=null;this.heading=null;this.paused=!1;this.held=!1;this.label="Slides",this.perView="1",this.arrows="below",this.autoplay=!1,this.seconds=6,this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={label:{type:String},perView:{type:String,reflect:!0,attribute:"per-view"},arrows:{type:String,reflect:!0},autoplay:{type:Boolean,reflect:!0},seconds:{type:Number},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...Y.styles,Nt,xe,Di,he`
|
|
362
|
+
:host { display: block; container-type: inline-size; --most: 1; --gap: ${h(6)}; }
|
|
151
363
|
:host([per-view='2']) { --most: 2; }
|
|
152
364
|
:host([per-view='3']) { --most: 3; }
|
|
153
|
-
.track { --per: var(--most); display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: ${
|
|
365
|
+
.track { --per: var(--most); display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: ${h(1)} ${h(2)}; border-radius: ${p.radiusLg}; }
|
|
154
366
|
.track::-webkit-scrollbar { display: none; }
|
|
155
367
|
::slotted(*) { flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per)); min-inline-size: 0; scroll-snap-align: start; box-sizing: border-box; }
|
|
156
368
|
/* Whole slides only: a slice of the next one reads as content spilling out of the page. */
|
|
157
369
|
@container (max-width: 60rem) { .track { --per: min(var(--most), 2); } }
|
|
158
|
-
@container (max-width: 40rem) { .track { --per: 1; --gap: ${
|
|
159
|
-
.controls { display: flex; align-items: center; justify-content: space-between; gap: ${
|
|
160
|
-
.dots { display: flex; flex-wrap: wrap; gap: ${
|
|
161
|
-
.dot { ${
|
|
162
|
-
.dot span { display: block; inline-size: 8px; block-size: 8px; border-radius: 999px; background: ${
|
|
163
|
-
.dot[aria-current='true'] span { inline-size: 24px; background: ${
|
|
164
|
-
.buttons { display: flex; gap: ${
|
|
370
|
+
@container (max-width: 40rem) { .track { --per: 1; --gap: ${h(4)}; } }
|
|
371
|
+
.controls { display: flex; align-items: center; justify-content: space-between; gap: ${h(4)}; margin-block-start: ${h(4)}; }
|
|
372
|
+
.dots { display: flex; flex-wrap: wrap; gap: ${h(1)}; }
|
|
373
|
+
.dot { ${yi} display: inline-flex; align-items: center; justify-content: center; padding: 0; background: transparent; border: 0; cursor: pointer; border-radius: ${p.radiusSm}; }
|
|
374
|
+
.dot span { display: block; inline-size: 8px; block-size: 8px; border-radius: 999px; background: ${p.rule}; transition: inline-size 150ms ease-in-out, background-color 150ms ease-in-out; }
|
|
375
|
+
.dot[aria-current='true'] span { inline-size: 24px; background: ${p.brand}; }
|
|
376
|
+
.buttons { display: flex; gap: ${h(2)}; }
|
|
165
377
|
section { position: relative; }
|
|
166
|
-
@container (min-width: 40.01rem) { :host([arrows='top']) .buttons { position: absolute; inset-block-end: calc(100% + ${
|
|
167
|
-
.sr-only { ${
|
|
378
|
+
@container (min-width: 40.01rem) { :host([arrows='top']) .buttons { position: absolute; inset-block-end: calc(100% + ${h(4)}); inset-inline-end: 0; } }
|
|
379
|
+
.sr-only { ${Ta} }
|
|
168
380
|
@media (forced-colors: active) { .dot span { background: CanvasText; } .dot[aria-current='true'] span { background: Highlight; } }
|
|
169
|
-
`]}get track(){return this.renderRoot.querySelector(".track")}get slides(){return Array.from(this.children)}get last(){return Math.max(0,this.count-(this.visible??Number(this.perView||1)))}measure(){let e=this.track,i=this.slides[0];if(!e||!i)return;let a=i.getBoundingClientRect().width;if(a<=0)return;let
|
|
381
|
+
`]}get track(){return this.renderRoot.querySelector(".track")}get slides(){return Array.from(this.children)}get last(){return Math.max(0,this.count-(this.visible??Number(this.perView||1)))}measure(){let e=this.track,i=this.slides[0];if(!e||!i)return;let a=i.getBoundingClientRect().width;if(a<=0)return;let r=Number.parseFloat(getComputedStyle(e).columnGap)||0,o=Math.max(1,Math.round((e.clientWidth+r)/(a+r)));if(o===this.visible)return;this.visible=o,this.index=Math.min(this.index,this.last);let l=this.slides[this.index];l&&typeof e.scrollTo=="function"&&e.scrollTo({left:l.offsetLeft-e.offsetLeft,behavior:"auto"}),this.requestUpdate()}onSlots(){let e=this.slides;this.count=e.length,e.forEach((i,a)=>{i.setAttribute("role","group"),i.setAttribute("aria-roledescription",ee("slide")),i.setAttribute("aria-label",ee("{slide} of {slides}",{slide:a+1,slides:e.length}))}),this.measure(),this.requestUpdate()}go(e){let i=Math.min(this.last,Math.max(0,e));this.index=i,this.heading=i,clearTimeout(this.settle),this.settle=setTimeout(()=>{let o=this.heading===null;this.heading=null;let l=this.track,x=this.slides[this.index];!o&&l&&x&&typeof l.scrollTo=="function"&&l.scrollTo({left:x.offsetLeft-l.offsetLeft,behavior:"auto"})},900),this.requestUpdate();let a=this.track,r=this.slides[i];a&&r&&typeof a.scrollTo=="function"&&a.scrollTo({left:r.offsetLeft-a.offsetLeft,behavior:Wi()?"auto":"smooth"})}onScroll(){let e=this.track,i=this.slides;if(!e||!i.length)return;let a=0,r=1/0;if(i.forEach((o,l)=>{let x=Math.abs(o.offsetLeft-e.offsetLeft-e.scrollLeft);x<r&&(r=x,a=l)}),this.heading!==null){a===this.heading&&r<2&&(this.heading=null,clearTimeout(this.settle));return}a!==this.index&&(this.index=Math.min(a,this.last),this.requestUpdate())}onKey(e){e.key==="ArrowRight"&&(e.preventDefault(),this.go(this.index+1)),e.key==="ArrowLeft"&&(e.preventDefault(),this.go(this.index-1))}get canPlay(){return this.autoplay&&!Wi()}restart(){clearInterval(this.timer),this.timer=void 0,!(!this.canPlay||this.paused||this.held)&&(this.timer=setInterval(()=>this.go(this.index>=this.last?0:this.index+1),Math.max(2,this.seconds)*1e3))}hold(e){this.held=e,this.restart()}togglePause(){this.paused=!this.paused,this.restart(),this.requestUpdate()}firstUpdated(){typeof ResizeObserver=="function"&&this.track&&(this.observer=new ResizeObserver(()=>this.measure()),this.observer.observe(this.track))}updated(e){(e.has("autoplay")||e.has("seconds"))&&this.restart(),e.has("perView")&&this.measure()}connectedCallback(){super.connectedCallback(),this.track&&this.observer?.observe(this.track),this.restart()}disconnectedCallback(){super.disconnectedCallback(),this.observer?.disconnect(),clearInterval(this.timer),clearTimeout(this.settle)}render(){let e=Array.from({length:this.last+1},(i,a)=>a);return f`<section aria-roledescription=${ee("carousel")} aria-label=${this.label} part="carousel" @keydown=${this.onKey}
|
|
170
382
|
@mouseenter=${()=>this.hold(!0)} @mouseleave=${()=>this.hold(!1)} @focusin=${()=>this.hold(!0)} @focusout=${()=>this.hold(!1)}>
|
|
171
383
|
<div class="track" part="track" tabindex="0" @scroll=${this.onScroll}><slot @slotchange=${this.onSlots}></slot></div>
|
|
172
384
|
<div class="controls" part="controls">
|
|
173
|
-
<div class="dots">${e.length>1?e.map(i=>
|
|
385
|
+
<div class="dots">${e.length>1?e.map(i=>f`<button class="dot" type="button" aria-label=${ee("Go to slide {slide}",{slide:i+1})} aria-current=${i===this.index?"true":"false"} @click=${()=>this.go(i)}><span></span></button>`):R}</div>
|
|
174
386
|
<div class="buttons">
|
|
175
|
-
${this.canPlay?
|
|
176
|
-
<button class="round" type="button" aria-label=${
|
|
177
|
-
<button class="round" type="button" aria-label=${
|
|
387
|
+
${this.canPlay?f`<button class="round" type="button" aria-label=${ee(this.paused?"Play the slides":"Pause the slides")} @click=${this.togglePause}>${this.paused?Ce("arrow-right","18px"):f`<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><rect x="6" y="5" width="4" height="14" rx="1"/><rect x="14" y="5" width="4" height="14" rx="1"/></svg>`}</button>`:R}
|
|
388
|
+
<button class="round" type="button" aria-label=${ee("Previous slide")} ?disabled=${this.index===0} @click=${()=>this.go(this.index-1)}>${Ce("arrow-left","18px")}</button>
|
|
389
|
+
<button class="round" type="button" aria-label=${ee("Next slide")} ?disabled=${this.index>=this.last} @click=${()=>this.go(this.index+1)}>${Ce("arrow-right","18px")}</button>
|
|
178
390
|
</div>
|
|
179
391
|
</div>
|
|
180
|
-
<p class="sr-only" aria-live="polite">${
|
|
181
|
-
</section>`}};function
|
|
392
|
+
<p class="sr-only" aria-live="polite">${ee("Slide {slide} of {slides}",{slide:this.index+1,slides:this.count})}</p>
|
|
393
|
+
</section>`}};function Ui(n,t,e){let i=n===t-1,a={wide:1,narrow:1,rows:1};if(e==="grid")return i&&(a.wide=t%3?4-t%3:1,a.narrow=t%2?2:1),a;if(n===0)return a;if(t===2)return{wide:2,narrow:2,rows:2};if(t===3)return{...a,wide:2};if(i){let r=(t-5)%4;a.wide=t===4?2:t>5&&r?5-r:1,a.narrow=t%2?1:2}return a}var Et=class extends Y{constructor(){super();this.shown=-1;this.opener=null;this.items=[],this.layout="feature",this.label="Gallery",this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={items:{type:Array},layout:{type:String,reflect:!0},label:{type:String},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...Y.styles,Nt,xe,Di,he`
|
|
182
394
|
:host { display: block; container-type: inline-size; }
|
|
183
|
-
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${
|
|
395
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${h(3)}; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 180px; }
|
|
184
396
|
:host([layout='grid']) ul { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 220px; }
|
|
185
397
|
li { grid-column: span var(--span-wide, 1); grid-row: span var(--span-rows, 1); }
|
|
186
398
|
:host([layout='feature']) li:first-child { grid-column: span 2; grid-row: span 2; }
|
|
187
|
-
.open { position: relative; display: block; inline-size: 100%; block-size: 100%; padding: 0; border: 0; background: ${
|
|
399
|
+
.open { position: relative; display: block; inline-size: 100%; block-size: 100%; padding: 0; border: 0; background: ${p.surfaceInset}; border-radius: ${p.radiusXl}; overflow: hidden; cursor: zoom-in; }
|
|
188
400
|
.open img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform 300ms ease-out; }
|
|
189
401
|
.open:hover img { transform: scale(1.03); }
|
|
190
402
|
@container (max-width: 40rem) { ul, :host([layout='grid']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 130px; } li { grid-column: span var(--span-narrow, 1); } }
|
|
191
403
|
dialog { padding: 0; border: 0; background: transparent; max-inline-size: none; max-block-size: none; inline-size: 100vw; block-size: 100dvh; }
|
|
192
404
|
dialog::backdrop { background: rgb(10 14 12 / 0.9); }
|
|
193
|
-
.stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; block-size: 100%; box-sizing: border-box; padding: ${
|
|
194
|
-
.bar { display: flex; align-items: center; justify-content: space-between; ${
|
|
195
|
-
.middle { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: ${
|
|
196
|
-
.middle img { display: block; margin: auto; max-inline-size: 100%; max-block-size: 100%; object-fit: contain; border-radius: ${
|
|
405
|
+
.stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; block-size: 100%; box-sizing: border-box; padding: ${h(4)}; gap: ${h(3)}; color: #fff; }
|
|
406
|
+
.bar { display: flex; align-items: center; justify-content: space-between; ${B("sm")} }
|
|
407
|
+
.middle { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: ${h(3)}; min-block-size: 0; }
|
|
408
|
+
.middle img { display: block; margin: auto; max-inline-size: 100%; max-block-size: 100%; object-fit: contain; border-radius: ${p.radiusLg}; }
|
|
197
409
|
figure { margin: 0; display: flex; min-block-size: 0; block-size: 100%; }
|
|
198
|
-
.caption { margin: 0; text-align: center; ${
|
|
199
|
-
`]}get dialog(){return this.renderRoot.querySelector("dialog")}open(e,i){this.opener=i.currentTarget,this.shown=e,this.requestUpdate(),this.updateComplete.then(()=>{let a=this.dialog;a&&!a.open&&(typeof a.showModal=="function"?a.showModal():a.setAttribute("open",""))})}close(){let e=this.dialog;e?.open&&(typeof e.close=="function"?e.close():e.removeAttribute("open")),this.onClosed()}onClosed(){this.shown!==-1&&(this.shown=-1,this.requestUpdate(),this.opener?.focus())}step(e){let i=(this.items??[]).length;!i||this.shown<0||(this.shown=(this.shown+e+i)%i,this.requestUpdate())}onKey(e){e.key==="ArrowRight"&&(e.preventDefault(),this.step(1)),e.key==="ArrowLeft"&&(e.preventDefault(),this.step(-1))}render(){let e=this.items??[],i=this.shown>=0?e[this.shown]:void 0;return
|
|
200
|
-
<button class="open" type="button" aria-label=${
|
|
410
|
+
.caption { margin: 0; text-align: center; ${B("sm")} }
|
|
411
|
+
`]}get dialog(){return this.renderRoot.querySelector("dialog")}open(e,i){this.opener=i.currentTarget,this.shown=e,this.requestUpdate(),this.updateComplete.then(()=>{let a=this.dialog;a&&!a.open&&(typeof a.showModal=="function"?a.showModal():a.setAttribute("open",""))})}close(){let e=this.dialog;e?.open&&(typeof e.close=="function"?e.close():e.removeAttribute("open")),this.onClosed()}onClosed(){this.shown!==-1&&(this.shown=-1,this.requestUpdate(),this.opener?.focus())}step(e){let i=(this.items??[]).length;!i||this.shown<0||(this.shown=(this.shown+e+i)%i,this.requestUpdate())}onKey(e){e.key==="ArrowRight"&&(e.preventDefault(),this.step(1)),e.key==="ArrowLeft"&&(e.preventDefault(),this.step(-1))}render(){let e=this.items??[],i=this.shown>=0?e[this.shown]:void 0;return f`<ul aria-label=${this.label} part="list">${e.map((a,r)=>{let o=Ui(r,e.length,this.layout);return f`<li style=${`--span-wide:${o.wide};--span-narrow:${o.narrow};--span-rows:${o.rows}`}>
|
|
412
|
+
<button class="open" type="button" aria-label=${ee("View larger: {picture}",{picture:a.alt})} @click=${l=>this.open(r,l)}><img src=${a.src} alt=${a.alt} loading="lazy" /></button>
|
|
201
413
|
</li>`})}</ul>
|
|
202
414
|
<dialog aria-label=${this.label} @keydown=${this.onKey} @close=${this.onClosed}>
|
|
203
|
-
${i?
|
|
204
|
-
<div class="bar"><span>${this.shown+1} of ${e.length}</span><button class="round" type="button" aria-label=${
|
|
415
|
+
${i?f`<div class="stage">
|
|
416
|
+
<div class="bar"><span>${this.shown+1} of ${e.length}</span><button class="round" type="button" aria-label=${ee("Close")} @click=${this.close}>${Ce("close","18px")}</button></div>
|
|
205
417
|
<div class="middle">
|
|
206
|
-
<button class="round" type="button" aria-label=${
|
|
418
|
+
<button class="round" type="button" aria-label=${ee("Previous picture")} @click=${()=>this.step(-1)}>${Ce("arrow-left","18px")}</button>
|
|
207
419
|
<figure><img src=${i.src} alt=${i.alt} /></figure>
|
|
208
|
-
<button class="round" type="button" aria-label=${
|
|
420
|
+
<button class="round" type="button" aria-label=${ee("Next picture")} @click=${()=>this.step(1)}>${Ce("arrow-right","18px")}</button>
|
|
209
421
|
</div>
|
|
210
422
|
<p class="caption">${i.caption??i.alt}</p>
|
|
211
|
-
</div>`:
|
|
212
|
-
</dialog>`}},
|
|
423
|
+
</div>`:R}
|
|
424
|
+
</dialog>`}},Ct=class extends Y{static{this.properties={heading:{type:String},items:{type:Array},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="",this.items=[],this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...Y.styles,Nt,xe,he`
|
|
213
425
|
:host { display: block; }
|
|
214
|
-
p { margin: 0 0 ${
|
|
215
|
-
ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: ${
|
|
426
|
+
p { margin: 0 0 ${h(6)}; text-align: center; color: ${p.textMuted}; ${B("sm")} font-weight: ${pe("medium")}; }
|
|
427
|
+
ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: ${h(8)} ${h(12)}; }
|
|
216
428
|
img { display: block; block-size: 40px; inline-size: auto; max-inline-size: 160px; object-fit: contain; filter: grayscale(1); opacity: 0.7; transition: filter 200ms ease-in-out, opacity 200ms ease-in-out; }
|
|
217
429
|
li:hover img { filter: none; opacity: 1; }
|
|
218
|
-
a { display: block; border-radius: ${
|
|
219
|
-
`]}render(){return
|
|
220
|
-
<ul part="list">${(this.items??[]).map(t=>
|
|
430
|
+
a { display: block; border-radius: ${p.radiusSm}; }
|
|
431
|
+
`]}render(){return f`${this.heading?f`<p part="heading">${this.heading}</p>`:R}
|
|
432
|
+
<ul part="list">${(this.items??[]).map(t=>f`<li>${t.href?f`<a href=${t.href}><img src=${t.src} alt=${t.alt} /></a>`:f`<img src=${t.src} alt=${t.alt} />`}</li>`)}</ul>`}},Bt=class extends Y{static{this.properties={items:{type:Array},orientation:{type:String,reflect:!0},look:{type:String,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.items=[],this.orientation="horizontal",this.look="numbered",this.headingLevel=3,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...Y.styles,xe,jt,he`
|
|
221
433
|
:host { display: block; container-type: inline-size; }
|
|
222
|
-
ol { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: ${
|
|
223
|
-
li { position: relative; counter-increment: step; display: flex; flex-direction: column; gap: ${
|
|
224
|
-
li::before { content: counter(step); display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; border-radius: 50%; background: ${
|
|
225
|
-
li:not(:last-child)::after { content: ''; position: absolute; inset-block-start: 20px; inset-inline-start: 48px; inset-inline-end: calc(-1 * ${
|
|
226
|
-
.h { ${
|
|
227
|
-
.meta { margin: 0; ${
|
|
228
|
-
.body { margin: 0; color: ${
|
|
434
|
+
ol { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: ${h(6)}; }
|
|
435
|
+
li { position: relative; counter-increment: step; display: flex; flex-direction: column; gap: ${h(2)}; }
|
|
436
|
+
li::before { content: counter(step); display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; border-radius: 50%; background: ${p.brand}; color: ${p.onBrand}; ${B("sm")} font-weight: ${pe("bold")}; position: relative; z-index: 1; margin-block-end: ${h(2)}; }
|
|
437
|
+
li:not(:last-child)::after { content: ''; position: absolute; inset-block-start: 20px; inset-inline-start: 48px; inset-inline-end: calc(-1 * ${h(6)} + 8px); block-size: 2px; background: ${p.rule}; }
|
|
438
|
+
.h { ${B("lg")} letter-spacing: 0; }
|
|
439
|
+
.meta { margin: 0; ${B("sm")} color: ${p.textMuted}; font-family: ${p.fontMono}; letter-spacing: 0.02em; }
|
|
440
|
+
.body { margin: 0; color: ${p.textMuted}; line-height: ${_i("normal")}; text-wrap: pretty; }
|
|
229
441
|
:host([orientation='vertical']) ol { grid-auto-flow: row; }
|
|
230
442
|
:host([orientation='vertical']) li { padding-inline-start: 56px; min-block-size: 56px; }
|
|
231
443
|
:host([orientation='vertical']) li::before { position: absolute; inset-inline-start: 0; inset-block-start: 0; margin: 0; }
|
|
232
|
-
:host([orientation='vertical']) li:not(:last-child)::after { inset-block-start: 48px; inset-block-end: calc(-1 * ${
|
|
444
|
+
:host([orientation='vertical']) li:not(:last-child)::after { inset-block-start: 48px; inset-block-end: calc(-1 * ${h(6)} + 8px); inset-inline-start: 19px; inset-inline-end: auto; inline-size: 2px; block-size: auto; }
|
|
233
445
|
@container (max-width: 40rem) {
|
|
234
446
|
ol { grid-auto-flow: row; }
|
|
235
447
|
li { padding-inline-start: 56px; min-block-size: 56px; }
|
|
236
448
|
li::before { position: absolute; inset-inline-start: 0; inset-block-start: 0; margin: 0; }
|
|
237
|
-
li:not(:last-child)::after { inset-block-start: 48px; inset-block-end: calc(-1 * ${
|
|
449
|
+
li:not(:last-child)::after { inset-block-start: 48px; inset-block-end: calc(-1 * ${h(6)} + 8px); inset-inline-start: 19px; inset-inline-end: auto; inline-size: 2px; block-size: auto; }
|
|
238
450
|
}
|
|
239
|
-
:host([look='ruled']) li { padding-block-start: ${
|
|
451
|
+
:host([look='ruled']) li { padding-block-start: ${h(5)}; border-block-start: 3px solid var(--rule); }
|
|
240
452
|
:host([look='ruled']) li::before, :host([look='ruled']) li::after { display: none; }
|
|
241
|
-
:host([look='ruled']) ol { gap: ${
|
|
453
|
+
:host([look='ruled']) ol { gap: ${h(5)}; }
|
|
242
454
|
/* On a phone the ruled steps become a branch graph: one trunk down the left, and each step a coloured branch off it with a dot. */
|
|
243
455
|
@container (max-width: 40rem) {
|
|
244
456
|
:host([look='ruled']) ol { gap: 0; }
|
|
245
|
-
:host([look='ruled']) li { padding-inline-start: 40px; padding-block: ${
|
|
246
|
-
:host([look='ruled']) li::before { display: block; content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: 2px; block-size: auto; border-radius: 0; margin: 0; background: ${
|
|
247
|
-
:host([look='ruled']) li::after { display: block; content: ''; position: absolute; inset-block: ${
|
|
457
|
+
:host([look='ruled']) li { padding-inline-start: 40px; padding-block: ${h(6)}; min-block-size: 0; border-block-start: 0; }
|
|
458
|
+
:host([look='ruled']) li::before { display: block; content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: 2px; block-size: auto; border-radius: 0; margin: 0; background: ${p.text}; }
|
|
459
|
+
:host([look='ruled']) li::after { display: block; content: ''; position: absolute; inset-block: ${h(3)}; inset-inline-start: 2px; inset-inline-end: auto; inline-size: 12px; block-size: auto; background: radial-gradient(circle at 100% 34px, var(--rule) 4px, transparent 4.5px); border: 2px solid var(--rule); border-inline-start: 0; border-radius: 0 14px 14px 0; }
|
|
248
460
|
}
|
|
249
461
|
@media (forced-colors: active) { li::before { border: 1px solid CanvasText; } li:not(:last-child)::after { background: CanvasText; } :host([look='ruled']) li { border-block-start-color: CanvasText; } }
|
|
250
|
-
`]}render(){return
|
|
251
|
-
${t.meta?
|
|
462
|
+
`]}render(){return f`<ol part="list">${(this.items??[]).map((t,e)=>f`<li part="step" style=${this.look==="ruled"?`--rule:var(--impakt-color-chart-${e%5+1}, var(--impakt-color-brand-default, #1f4ed8))`:R}>
|
|
463
|
+
${t.meta?f`<p class="meta">${t.meta}</p>`:R}
|
|
252
464
|
<div class="h" role="heading" aria-level=${this.headingLevel}>${t.heading}</div>
|
|
253
|
-
${t.text?
|
|
254
|
-
</li>`)}</ol>`}},
|
|
465
|
+
${t.text?f`<p class="body">${t.text}</p>`:R}
|
|
466
|
+
</li>`)}</ol>`}},It=class extends Y{static{this.properties={eyebrow:{type:String},heading:{type:String},lead:{type:String},points:{type:Array},level:{type:Number,reflect:!0},imageSrc:{type:String,attribute:"image-src"},imageAlt:{type:String,attribute:"image-alt"},imageSide:{type:String,reflect:!0,attribute:"image-side"},insetSrc:{type:String,attribute:"inset-src"},insetAlt:{type:String,attribute:"inset-alt"},ratio:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.eyebrow="",this.heading="",this.lead="",this.points=[],this.level=2,this.imageSrc="",this.imageAlt="",this.imageSide="end",this.insetSrc="",this.insetAlt="",this.ratio="4:3",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...Y.styles,xe,jt,he`
|
|
255
467
|
:host { display: block; container-type: inline-size; --ratio: 4 / 3; }
|
|
256
468
|
:host([ratio='1:1']) { --ratio: 1 / 1; }
|
|
257
469
|
:host([ratio='3:2']) { --ratio: 3 / 2; }
|
|
258
470
|
:host([ratio='16:9']) { --ratio: 16 / 9; }
|
|
259
|
-
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${
|
|
471
|
+
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${h(16)}; align-items: center; }
|
|
260
472
|
:host([image-side='start']) .picture { order: -1; }
|
|
261
|
-
.words { display: flex; flex-direction: column; gap: ${
|
|
262
|
-
.h { ${
|
|
263
|
-
.lead { ${
|
|
264
|
-
ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: ${
|
|
265
|
-
li { display: flex; gap: ${
|
|
266
|
-
.tick { flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 24px; block-size: 24px; border-radius: 50%; background: ${
|
|
267
|
-
.actions { display: flex; flex-wrap: wrap; gap: ${
|
|
268
|
-
img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; border-radius: ${
|
|
473
|
+
.words { display: flex; flex-direction: column; gap: ${h(4)}; }
|
|
474
|
+
.h { ${B("4xl")} }
|
|
475
|
+
.lead { ${B("lg")} }
|
|
476
|
+
ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: ${h(3)}; }
|
|
477
|
+
li { display: flex; gap: ${h(3)}; align-items: flex-start; line-height: ${_i("normal")}; }
|
|
478
|
+
.tick { flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 24px; block-size: 24px; border-radius: 50%; background: ${p.brandSubtle}; color: ${p.brand}; }
|
|
479
|
+
.actions { display: flex; flex-wrap: wrap; gap: ${h(3)} ${h(4)}; align-items: center; margin-block-start: ${h(2)}; }
|
|
480
|
+
img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; border-radius: ${p.radius2xl}; box-shadow: ${p.shadowXl}; }
|
|
269
481
|
.picture { position: relative; }
|
|
270
482
|
.picture.has-inset { padding-block-end: 8%; padding-inline-end: 4%; }
|
|
271
|
-
.inset { position: absolute; inset-block-end: 0; inset-inline-end: 0; inline-size: 42%; aspect-ratio: 10 / 7; border: 6px solid ${
|
|
483
|
+
.inset { position: absolute; inset-block-end: 0; inset-inline-end: 0; inline-size: 42%; aspect-ratio: 10 / 7; border: 6px solid ${p.surfaceCard}; border-radius: ${p.radiusXl}; box-sizing: border-box; }
|
|
272
484
|
@container (max-width: 48rem) {
|
|
273
|
-
.split { grid-template-columns: minmax(0, 1fr); gap: ${
|
|
485
|
+
.split { grid-template-columns: minmax(0, 1fr); gap: ${h(8)}; }
|
|
274
486
|
:host([image-side='start']) .picture { order: 0; }
|
|
275
|
-
.h { ${
|
|
487
|
+
.h { ${B("3xl")} }
|
|
276
488
|
}
|
|
277
|
-
`]}render(){return
|
|
489
|
+
`]}render(){return f`<div class="split" part="split">
|
|
278
490
|
<div class="words">
|
|
279
|
-
${this.eyebrow?
|
|
491
|
+
${this.eyebrow?f`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>`:R}
|
|
280
492
|
<div class="h" role="heading" aria-level=${this.level}>${this.heading}</div>
|
|
281
|
-
${this.lead?
|
|
282
|
-
${this.points?.length?
|
|
493
|
+
${this.lead?f`<p class="lead">${this.lead}</p>`:R}
|
|
494
|
+
${this.points?.length?f`<ul>${this.points.map(t=>f`<li><span class="tick">${Ce("check","14px")}</span><span>${t}</span></li>`)}</ul>`:R}
|
|
283
495
|
<div class="actions"><slot name="actions"></slot></div>
|
|
284
496
|
</div>
|
|
285
|
-
${this.imageSrc?
|
|
286
|
-
</div>`}},
|
|
497
|
+
${this.imageSrc?f`<div class="picture ${this.insetSrc?"has-inset":""}"><img src=${this.imageSrc} alt=${this.imageAlt} loading="lazy" part="image" />${this.insetSrc?f`<img class="inset" src=${this.insetSrc} alt=${this.insetAlt} loading="lazy" />`:R}</div>`:R}
|
|
498
|
+
</div>`}},Ht=class extends Y{static{this.properties={heading:{type:String},lead:{type:String},tone:{type:String,reflect:!0},align:{type:String,reflect:!0},imageSrc:{type:String,attribute:"image-src"},imageAlt:{type:String,attribute:"image-alt"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="",this.lead="",this.tone="brand",this.align="split",this.imageSrc="",this.imageAlt="",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...Y.styles,xe,jt,he`
|
|
287
499
|
:host { display: block; container-type: inline-size; }
|
|
288
|
-
.panel { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: ${
|
|
289
|
-
:host([tone='subtle']) .panel { background: ${
|
|
290
|
-
:host([tone='brand']) .panel { background: ${
|
|
500
|
+
.panel { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: ${h(8)}; padding: ${h(16)}; border-radius: ${p.radius2xl}; background: ${p.surfaceCard}; box-shadow: ${p.shadowSm}, inset 0 0 0 1px ${p.hairline}; }
|
|
501
|
+
:host([tone='subtle']) .panel { background: ${p.surfaceSubtle}; box-shadow: none; }
|
|
502
|
+
:host([tone='brand']) .panel { background: ${p.brand}; color: ${p.onBrand}; box-shadow: ${p.shadowLg}; }
|
|
291
503
|
/* Only the words take the light colours: a button in the actions keeps its own. */
|
|
292
|
-
:host([tone='brand']) .words { --impakt-color-text-heading: ${
|
|
504
|
+
:host([tone='brand']) .words { --impakt-color-text-heading: ${p.onBrand}; --impakt-color-text-default: ${p.onBrand}; --impakt-color-text-muted: ${p.onBrand}; --impakt-color-text-link: ${p.onBrand}; }
|
|
293
505
|
/* A soft glow in the corner, so a flat colour has some depth. Decoration only. */
|
|
294
|
-
:host([tone='brand']) .panel::before { content: ''; position: absolute; inset-block-start: -40%; inset-inline-end: -10%; inline-size: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, ${
|
|
506
|
+
:host([tone='brand']) .panel::before { content: ''; position: absolute; inset-block-start: -40%; inset-inline-end: -10%; inline-size: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, ${p.onBrand} 18%, transparent), transparent); pointer-events: none; }
|
|
295
507
|
.photo { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
296
508
|
.panel.pictured { min-block-size: 26rem; color: #fff; background: #12211a; --impakt-color-text-heading: #fff; }
|
|
297
509
|
.panel.pictured::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(18 31 26 / 0.8) 0%, rgb(18 31 26 / 0.1) 75%); }
|
|
298
510
|
.panel.pictured .words, .panel.pictured .actions { z-index: 1; }
|
|
299
511
|
@container (max-width: 48rem) { .panel.pictured { justify-content: flex-end; } .panel.pictured::after { background: linear-gradient(180deg, rgb(18 31 26 / 0.15) 0%, rgb(18 31 26 / 0.85) 100%); } }
|
|
300
|
-
.words { position: relative; display: flex; flex-direction: column; gap: ${
|
|
301
|
-
.h { ${
|
|
302
|
-
.lead { ${
|
|
303
|
-
.actions { position: relative; flex: none; display: flex; flex-wrap: wrap; gap: ${
|
|
512
|
+
.words { position: relative; display: flex; flex-direction: column; gap: ${h(3)}; max-inline-size: 40rem; }
|
|
513
|
+
.h { ${B("4xl")} }
|
|
514
|
+
.lead { ${B("lg")} }
|
|
515
|
+
.actions { position: relative; flex: none; display: flex; flex-wrap: wrap; gap: ${h(3)}; }
|
|
304
516
|
:host([align='stacked']) .panel { flex-direction: column; align-items: flex-start; justify-content: center; }
|
|
305
517
|
:host([align='center']) .panel { flex-direction: column; text-align: center; }
|
|
306
518
|
:host([align='center']) .words { align-items: center; }
|
|
307
|
-
@container (max-width: 48rem) { .panel { flex-direction: column; align-items: flex-start; padding: ${
|
|
519
|
+
@container (max-width: 48rem) { .panel { flex-direction: column; align-items: flex-start; padding: ${h(8)} ${h(6)}; } .h { ${B("3xl")} } :host([align='center']) .panel { align-items: center; } }
|
|
308
520
|
@media (forced-colors: active) { .panel { border: 1px solid CanvasText; } }
|
|
309
|
-
`]}render(){return
|
|
310
|
-
${this.imageSrc?
|
|
521
|
+
`]}render(){return f`<div class="panel ${this.imageSrc?"pictured":""}" part="panel">
|
|
522
|
+
${this.imageSrc?f`<img class="photo" src=${this.imageSrc} alt=${this.imageAlt} />`:R}
|
|
311
523
|
<div class="words">
|
|
312
524
|
<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>
|
|
313
|
-
${this.lead?
|
|
525
|
+
${this.lead?f`<p class="lead">${this.lead}</p>`:R}
|
|
314
526
|
</div>
|
|
315
527
|
<div class="actions"><slot name="actions"></slot></div>
|
|
316
|
-
</div>`}},
|
|
528
|
+
</div>`}},qi=n=>f`<span class="stars" role="img" aria-label=${ee("Rated {rating} out of 5",{rating:n})}>${[1,2,3,4,5].map(t=>f`<svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true" fill=${t<=n?"currentColor":"none"} stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M12 3.5l2.6 5.4 5.9.7-4.4 4 1.2 5.8L12 16.5l-5.3 2.9 1.2-5.8-4.4-4 5.9-.7z"/></svg>`)}</span>`,La=n=>n.split(/\s+/).filter(t=>/^[A-Za-z]/.test(t)&&t.toLowerCase()!=="and").slice(0,2).map(t=>t[0].toUpperCase()).join(""),Rt=class extends Y{static{this.properties={summary:{type:String},rating:{type:Number},items:{type:Array},columns:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.summary="",this.rating=void 0,this.items=[],this.columns="three",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...Y.styles,xe,he`
|
|
317
529
|
:host { display: block; container-type: inline-size; }
|
|
318
|
-
.top { display: flex; align-items: center; gap: ${
|
|
319
|
-
.stars { display: inline-flex; gap: 2px; color: ${
|
|
320
|
-
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${
|
|
530
|
+
.top { display: flex; align-items: center; gap: ${h(3)}; margin-block-end: ${h(6)}; ${B("sm")} font-weight: ${pe("medium")}; }
|
|
531
|
+
.stars { display: inline-flex; gap: 2px; color: ${Ma}; }
|
|
532
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${h(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
321
533
|
:host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
322
|
-
li { display: flex; flex-direction: column; gap: ${
|
|
323
|
-
blockquote { margin: 0; flex: 1; ${
|
|
324
|
-
.who { display: flex; align-items: center; gap: ${
|
|
325
|
-
.face { flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; border-radius: 50%; overflow: hidden; background: ${
|
|
534
|
+
li { display: flex; flex-direction: column; gap: ${h(4)}; padding: ${h(6)}; background: ${p.surfaceCard}; border-radius: ${p.radiusXl}; box-shadow: ${p.shadowSm}, inset 0 0 0 1px ${p.hairline}; }
|
|
535
|
+
blockquote { margin: 0; flex: 1; ${B("md")} text-wrap: pretty; }
|
|
536
|
+
.who { display: flex; align-items: center; gap: ${h(3)}; }
|
|
537
|
+
.face { flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; border-radius: 50%; overflow: hidden; background: ${p.brandSubtle}; color: ${p.brand}; ${B("sm")} font-weight: ${pe("bold")}; }
|
|
326
538
|
.face img { inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
327
|
-
.name { font-weight: ${
|
|
328
|
-
.about { color: ${
|
|
539
|
+
.name { font-weight: ${pe("semibold")}; ${B("sm")} }
|
|
540
|
+
.about { color: ${p.textMuted}; ${B("sm")} }
|
|
329
541
|
@container (max-width: 56rem) { ul, :host([columns='two']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
330
|
-
`]}render(){return
|
|
331
|
-
<ul part="list">${(this.items??[]).map(t=>
|
|
332
|
-
${t.rating?
|
|
542
|
+
`]}render(){return f`${this.summary||this.rating?f`<p class="top" part="summary" style="margin-block-start:0">${this.rating?qi(Math.round(this.rating)):R}<span>${this.summary}</span></p>`:R}
|
|
543
|
+
<ul part="list">${(this.items??[]).map(t=>f`<li part="review">
|
|
544
|
+
${t.rating?qi(t.rating):R}
|
|
333
545
|
<blockquote>${t.quote}</blockquote>
|
|
334
|
-
<div class="who"><span class="face" aria-hidden="true">${t.avatarSrc?
|
|
335
|
-
</li>`)}</ul>`}},
|
|
546
|
+
<div class="who"><span class="face" aria-hidden="true">${t.avatarSrc?f`<img src=${t.avatarSrc} alt="" />`:La(t.person)}</span><span><span class="name">${t.person}</span>${t.about?f`<br /><span class="about">${t.about}</span>`:R}</span></div>
|
|
547
|
+
</li>`)}</ul>`}},Pt=class extends Y{constructor(){super();this.done=!1;this.heading="",this.lead="",this.label="Email address",this.buttonText="Sign up",this.smallPrint="",this.doneText="Thank you. You\u2019re on the list.",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={heading:{type:String},lead:{type:String},label:{type:String},buttonText:{type:String,attribute:"button-text"},smallPrint:{type:String,attribute:"small-print"},doneText:{type:String,attribute:"done-text"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...Y.styles,Nt,xe,jt,he`
|
|
336
548
|
:host { display: block; container-type: inline-size; }
|
|
337
|
-
.wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${
|
|
338
|
-
.words { display: flex; flex-direction: column; gap: ${
|
|
339
|
-
.h { ${
|
|
340
|
-
form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: ${
|
|
341
|
-
label { grid-column: 1 / -1; ${
|
|
342
|
-
input { min-block-size: 44px; box-sizing: border-box; inline-size: 100%; padding: ${
|
|
343
|
-
button { ${
|
|
344
|
-
button:hover { background: ${
|
|
345
|
-
.note { grid-column: 1 / -1; margin: ${
|
|
346
|
-
.done { margin: 0; ${
|
|
549
|
+
.wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${h(8)}; align-items: center; }
|
|
550
|
+
.words { display: flex; flex-direction: column; gap: ${h(2)}; }
|
|
551
|
+
.h { ${B("2xl")} }
|
|
552
|
+
form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: ${h(1)} ${h(3)}; }
|
|
553
|
+
label { grid-column: 1 / -1; ${B("sm")} font-weight: ${pe("semibold")}; }
|
|
554
|
+
input { min-block-size: 44px; box-sizing: border-box; inline-size: 100%; padding: ${h(2.5)} ${h(3)}; font: inherit; color: ${p.text}; background: ${p.surfaceCard}; border: ${p.borderThin} solid ${p.border}; border-radius: ${p.radiusLg}; box-shadow: ${p.shadowXs}; }
|
|
555
|
+
button { ${yi} min-block-size: 44px; padding: ${h(2)} ${h(5)}; font: inherit; ${B("sm")} font-weight: ${pe("semibold")}; color: ${p.onBrand}; background: ${p.brand}; border: 0; border-radius: ${p.radiusLg}; box-shadow: ${p.shadowXs}; cursor: pointer; }
|
|
556
|
+
button:hover { background: ${p.brandHover}; }
|
|
557
|
+
.note { grid-column: 1 / -1; margin: ${h(1)} 0 0; color: ${p.textMuted}; ${B("sm")} }
|
|
558
|
+
.done { margin: 0; ${B("md")} font-weight: ${pe("semibold")}; }
|
|
347
559
|
@container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); } }
|
|
348
|
-
`]}submit(e){e.preventDefault();let i=e.currentTarget;if(typeof i.reportValidity=="function"&&!i.reportValidity())return;let a=i.querySelector("input").value.trim();this.dispatchEvent(new CustomEvent("impakt-submit",{detail:{email:a},bubbles:!0,composed:!0})),this.done=!0,this.requestUpdate()}render(){let e=this.id_("email");return
|
|
560
|
+
`]}submit(e){e.preventDefault();let i=e.currentTarget;if(typeof i.reportValidity=="function"&&!i.reportValidity())return;let a=i.querySelector("input").value.trim();this.dispatchEvent(new CustomEvent("impakt-submit",{detail:{email:a},bubbles:!0,composed:!0})),this.done=!0,this.requestUpdate()}render(){let e=this.id_("email");return f`<div class="wrap" part="wrap">
|
|
349
561
|
<div class="words">
|
|
350
|
-
${this.heading?
|
|
351
|
-
${this.lead?
|
|
562
|
+
${this.heading?f`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:R}
|
|
563
|
+
${this.lead?f`<p class="lead">${this.lead}</p>`:R}
|
|
352
564
|
</div>
|
|
353
|
-
<div aria-live="polite">${this.done?
|
|
565
|
+
<div aria-live="polite">${this.done?f`<p class="done">${this.doneText}</p>`:f`<form @submit=${this.submit}>
|
|
354
566
|
<label for=${e}>${this.label}</label>
|
|
355
567
|
<input id=${e} type="email" name="email" autocomplete="email" required />
|
|
356
568
|
<button type="submit">${this.buttonText}</button>
|
|
357
|
-
${this.smallPrint?
|
|
569
|
+
${this.smallPrint?f`<p class="note">${this.smallPrint}</p>`:R}
|
|
358
570
|
</form>`}</div>
|
|
359
|
-
</div>`}};customElements.define("impakt-carousel",
|
|
571
|
+
</div>`}};customElements.define("impakt-carousel",Lt);customElements.define("impakt-gallery",Et);customElements.define("impakt-logo-cloud",Ct);customElements.define("impakt-steps",Bt);customElements.define("impakt-media-split",It);customElements.define("impakt-cta-banner",Ht);customElements.define("impakt-reviews",Rt);customElements.define("impakt-newsletter",Pt);import{css as Je,html as I,nothing as K}from"./atomic-ui.js";import{say as ve,pageLocale as Ea,ImpaktElement as me,focusRing as Ke,targetSize as Yi,fontWeight as Z,space as m,spaceAround as Dt,t as s,type as W,iconSvg as Be}from"./atomic-ui.js";var Ot=class extends me{static{this.properties={imageSrc:{type:String,attribute:"image-src"},imageAlt:{type:String,attribute:"image-alt"},plots:{type:Array},hint:{type:String},selectedPlot:{type:String,attribute:"selected-plot"},panel:{type:String,reflect:!0},plotWord:{type:String,attribute:"plot-word"},actionText:{type:String,attribute:"action-text"},availableText:{type:String,attribute:"available-text"},reservedText:{type:String,attribute:"reserved-text"},soldText:{type:String,attribute:"sold-text"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.imageSrc="",this.imageAlt="",this.plots=[],this.hint="Choose a plot to see its price and availability.",this.selectedPlot="",this.panel="beside",this.plotWord="Plot",this.actionText="View this home",this.availableText="Available",this.reservedText="Reserved",this.soldText="Sold",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...me.styles,Ke,Dt,Je`
|
|
360
572
|
:host { display: block; container-type: inline-size; }
|
|
361
|
-
.wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: ${
|
|
362
|
-
.plan { position: relative; overflow: hidden; border-radius: ${
|
|
573
|
+
.wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: ${m(6)}; align-items: start; }
|
|
574
|
+
.plan { position: relative; overflow: hidden; border-radius: ${s.radius2xl}; background: ${s.surfaceSubtle}; box-shadow: ${s.shadowMd}; line-height: 0; }
|
|
363
575
|
.plan img { inline-size: 100%; block-size: auto; }
|
|
364
|
-
.pin { position: absolute; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; inline-size: 34px; block-size: 34px; margin: -17px 0 0 -17px; padding: 0; font: inherit; ${
|
|
576
|
+
.pin { position: absolute; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; inline-size: 34px; block-size: 34px; margin: -17px 0 0 -17px; padding: 0; font: inherit; ${W("xs")} line-height: 1; font-weight: ${Z("bold")}; color: ${s.onBrand}; background: ${s.brand}; border: 2px solid ${s.surfaceCard}; border-radius: 50%; box-shadow: ${s.shadowMd}; cursor: pointer; transition: transform 120ms ease-in-out; }
|
|
365
577
|
.pin:hover { transform: scale(1.12); }
|
|
366
|
-
.pin.reserved { color: ${
|
|
367
|
-
.pin.sold { color: ${
|
|
368
|
-
.pin[aria-pressed='true'] { transform: scale(1.22); box-shadow: ${
|
|
369
|
-
.panel { display: flex; flex-direction: column; gap: ${
|
|
370
|
-
.hint { margin: 0; color: ${
|
|
371
|
-
.name { margin: 0; font-family: ${
|
|
372
|
-
.sub { margin: 0; color: ${
|
|
373
|
-
.price { margin: 0; ${
|
|
374
|
-
.status { align-self: flex-start; padding: ${
|
|
375
|
-
.status.reserved { color: ${
|
|
376
|
-
.status.sold { color: ${
|
|
377
|
-
.go { ${
|
|
378
|
-
.go:hover { background: ${
|
|
379
|
-
.legend { display: flex; flex-wrap: wrap; gap: ${
|
|
380
|
-
.legend li { display: inline-flex; align-items: center; gap: ${
|
|
381
|
-
.key { box-sizing: border-box; inline-size: 14px; block-size: 14px; background: ${
|
|
382
|
-
.key.reserved { background: ${
|
|
383
|
-
.key.sold { background: ${
|
|
384
|
-
:host { --plan-card: var(--impakt-solid-card, ${
|
|
578
|
+
.pin.reserved { color: ${s.text}; background: ${s.warningSubtle}; border-color: ${s.warning}; border-style: dashed; }
|
|
579
|
+
.pin.sold { color: ${s.textMuted}; background: ${s.surfaceCard}; border-color: ${s.border}; border-radius: ${s.radius}; }
|
|
580
|
+
.pin[aria-pressed='true'] { transform: scale(1.22); box-shadow: ${s.shadowLg}, 0 0 0 3px ${s.brand}; }
|
|
581
|
+
.panel { display: flex; flex-direction: column; gap: ${m(3)}; padding: ${m(6)}; background: ${s.surfaceCard}; border-radius: ${s.radius2xl}; box-shadow: ${s.shadowSm}, 0 0 0 1px color-mix(in srgb, ${s.text} 6%, transparent); }
|
|
582
|
+
.hint { margin: 0; color: ${s.textMuted}; }
|
|
583
|
+
.name { margin: 0; font-family: ${s.fontHeading}; ${W("2xl")} font-weight: ${Z("bold")}; color: ${s.textHeading}; }
|
|
584
|
+
.sub { margin: 0; color: ${s.textMuted}; }
|
|
585
|
+
.price { margin: 0; ${W("xl")} font-weight: ${Z("semibold")}; }
|
|
586
|
+
.status { align-self: flex-start; padding: ${m(.5)} ${m(2.5)}; ${W("xs")} font-weight: ${Z("semibold")}; color: ${s.successText}; background: ${s.successSubtle}; border-radius: 999px; }
|
|
587
|
+
.status.reserved { color: ${s.warningText}; background: ${s.warningSubtle}; }
|
|
588
|
+
.status.sold { color: ${s.text}; background: ${s.surfaceSubtle}; }
|
|
589
|
+
.go { ${Yi} display: inline-flex; align-items: center; justify-content: center; gap: ${m(2)}; padding: ${m(2)} ${m(4)}; ${W("sm")} font-weight: ${Z("semibold")}; color: ${s.onBrand}; text-decoration: none; background: ${s.brand}; border-radius: ${s.radiusLg}; }
|
|
590
|
+
.go:hover { background: ${s.brandHover}; }
|
|
591
|
+
.legend { display: flex; flex-wrap: wrap; gap: ${m(4)}; margin: ${m(3)} 0 0; padding: 0; list-style: none; ${W("sm")} color: ${s.textMuted}; }
|
|
592
|
+
.legend li { display: inline-flex; align-items: center; gap: ${m(2)}; }
|
|
593
|
+
.key { box-sizing: border-box; inline-size: 14px; block-size: 14px; background: ${s.brand}; border: 2px solid ${s.surfaceCard}; border-radius: 50%; outline: 1px solid color-mix(in srgb, currentColor 55%, transparent); }
|
|
594
|
+
.key.reserved { background: ${s.warningSubtle}; border: 2px dashed ${s.warning}; }
|
|
595
|
+
.key.sold { background: ${s.surfaceCard}; border: 2px solid ${s.border}; border-radius: 3px; }
|
|
596
|
+
:host { --plan-card: var(--impakt-solid-card, ${s.surfaceCard}); --plan-text: var(--impakt-solid-text, ${s.text}); --plan-heading: var(--impakt-solid-heading, ${s.text}); --plan-muted: var(--impakt-solid-muted, ${s.textMuted}); }
|
|
385
597
|
:host([panel='over']) .panel { background: var(--plan-card); color: var(--plan-text); --impakt-color-surface-card: var(--plan-card); --impakt-color-text-default: var(--plan-text); --impakt-color-text-heading: var(--plan-heading); --impakt-color-text-muted: var(--plan-muted); }
|
|
386
|
-
@container (min-width: 44.01rem) { :host([panel='over']) .wrap { position: relative; grid-template-columns: minmax(0, 1fr); } :host([panel='over']) .panel { position: absolute; inset-block-start: 32%; inset-inline-end: ${
|
|
598
|
+
@container (min-width: 44.01rem) { :host([panel='over']) .wrap { position: relative; grid-template-columns: minmax(0, 1fr); } :host([panel='over']) .panel { position: absolute; inset-block-start: 32%; inset-inline-end: ${m(8)}; inline-size: 22.5rem; box-sizing: border-box; box-shadow: ${s.shadowXl}; } }
|
|
387
599
|
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } }
|
|
388
|
-
`]}willUpdate(t){(t.has("selectedPlot")||t.has("plots"))&&this.selectedPlot&&!this.chosen&&(this.chosen=this.plots.find(e=>String(e.number)===this.selectedPlot))}word(t){return t==="sold"?this.soldText:t==="reserved"?this.reservedText:this.availableText}choose(t){this.chosen=t,this.requestUpdate(),this.dispatchEvent(new CustomEvent("impakt-select",{detail:{plot:t},bubbles:!0,composed:!0}))}renderPanel(){let t=this.chosen;if(!t)return
|
|
600
|
+
`]}willUpdate(t){(t.has("selectedPlot")||t.has("plots"))&&this.selectedPlot&&!this.chosen&&(this.chosen=this.plots.find(e=>String(e.number)===this.selectedPlot))}word(t){return t==="sold"?this.soldText:t==="reserved"?this.reservedText:this.availableText}choose(t){this.chosen=t,this.requestUpdate(),this.dispatchEvent(new CustomEvent("impakt-select",{detail:{plot:t},bubbles:!0,composed:!0}))}renderPanel(){let t=this.chosen;if(!t)return I`<p class="hint">${this.hint}</p>`;let e=t.status??"available";return I`<span class="status ${e}">${this.word(e)}</span>
|
|
389
601
|
<p class="name">${this.plotWord} ${t.number}</p>
|
|
390
|
-
${t.name||t.beds?
|
|
391
|
-
${t.price?
|
|
392
|
-
${t.href&&e!=="sold"?
|
|
602
|
+
${t.name||t.beds?I`<p class="sub">${[t.name,t.beds].filter(Boolean).join(" \xB7 ")}</p>`:K}
|
|
603
|
+
${t.price?I`<p class="price">${t.price}</p>`:K}
|
|
604
|
+
${t.href&&e!=="sold"?I`<a class="go" href=${t.href}>${this.actionText}${Be("arrow-right","16px")}</a>`:K}`}render(){return I`<div class="wrap" part="wrap">
|
|
393
605
|
<div>
|
|
394
606
|
<div class="plan" part="plan">
|
|
395
607
|
<img src=${this.imageSrc} alt=${this.imageAlt} />
|
|
396
|
-
${this.plots.map(t=>{let e=t.status??"available",i=[`${this.plotWord} ${t.number}`,t.name,this.word(e),t.price].filter(Boolean).join(", ");return
|
|
608
|
+
${this.plots.map(t=>{let e=t.status??"available",i=[`${this.plotWord} ${t.number}`,t.name,this.word(e),t.price].filter(Boolean).join(", ");return I`<button class="pin ${e}" type="button" style="left:${Number(t.x)}%;top:${Number(t.y)}%" aria-label=${i} aria-pressed=${String(this.chosen===t)} @click=${()=>this.choose(t)}>${t.number}</button>`})}
|
|
397
609
|
</div>
|
|
398
610
|
<ul class="legend">
|
|
399
611
|
<li><span class="key"></span>${this.availableText}</li>
|
|
@@ -402,318 +614,318 @@ import"./atomic-ui.js";import{css as ye,html as L,nothing as W}from"./atomic-ui.
|
|
|
402
614
|
</ul>
|
|
403
615
|
</div>
|
|
404
616
|
<div class="panel" part="panel" aria-live="polite">${this.renderPanel()}</div>
|
|
405
|
-
</div>`}};function
|
|
617
|
+
</div>`}};function Gi(n,t,e){let i=e*12;if(n<=0||i<=0)return 0;let a=t/100/12;return a===0?n/i:n*a/(1-(1+a)**-i)}var Ft=class extends me{static{this.properties={heading:{type:String},price:{type:Number},depositPercent:{type:Number,attribute:"deposit-percent"},rate:{type:Number},years:{type:Number},currency:{type:String},smallPrint:{type:String,attribute:"small-print"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="What would it cost each month?",this.price=385e3,this.depositPercent=10,this.rate=4.5,this.years=30,this.currency="GBP",this.smallPrint="This is an estimate, not a mortgage offer. Your home may be repossessed if you do not keep up repayments on your mortgage.",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...me.styles,Ke,Dt,Je`
|
|
406
618
|
:host { display: block; container-type: inline-size; }
|
|
407
|
-
.wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); overflow: hidden; background: ${
|
|
408
|
-
.inputs { display: flex; flex-direction: column; gap: ${
|
|
409
|
-
.h { margin: 0; font-family: ${
|
|
410
|
-
label { display: flex; justify-content: space-between; gap: ${
|
|
411
|
-
.read { font-weight: ${
|
|
412
|
-
input[type='number'] { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${
|
|
413
|
-
input[type='range'] { inline-size: 100%; min-block-size: 24px; margin: 0; accent-color: ${
|
|
414
|
-
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${
|
|
415
|
-
.result { display: flex; flex-direction: column; justify-content: center; gap: ${
|
|
416
|
-
.caption { margin: 0; ${
|
|
417
|
-
output { display: block; font-family: ${
|
|
418
|
-
dl { display: grid; gap: ${
|
|
419
|
-
dl div { display: flex; justify-content: space-between; gap: ${
|
|
619
|
+
.wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); overflow: hidden; background: ${s.surfaceCard}; border-radius: ${s.radius2xl}; box-shadow: ${s.shadowMd}, 0 0 0 1px color-mix(in srgb, ${s.text} 6%, transparent); }
|
|
620
|
+
.inputs { display: flex; flex-direction: column; gap: ${m(5)}; padding: ${m(8)}; }
|
|
621
|
+
.h { margin: 0; font-family: ${s.fontHeading}; ${W("2xl")} font-weight: ${Z("bold")}; color: ${s.textHeading}; }
|
|
622
|
+
label { display: flex; justify-content: space-between; gap: ${m(3)}; ${W("sm")} font-weight: ${Z("semibold")}; margin-block-end: ${m(1.5)}; }
|
|
623
|
+
.read { font-weight: ${Z("regular")}; color: ${s.textMuted}; }
|
|
624
|
+
input[type='number'] { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${m(2)} ${m(3)}; font: inherit; color: ${s.text}; background: ${s.surfaceCard}; border: ${s.borderThin} solid ${s.border}; border-radius: ${s.radiusLg}; }
|
|
625
|
+
input[type='range'] { inline-size: 100%; min-block-size: 24px; margin: 0; accent-color: ${s.brand}; }
|
|
626
|
+
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${m(4)}; }
|
|
627
|
+
.result { display: flex; flex-direction: column; justify-content: center; gap: ${m(2)}; padding: ${m(8)}; color: ${s.onBrand}; background: ${s.brand}; }
|
|
628
|
+
.caption { margin: 0; ${W("sm")} opacity: 0.85; }
|
|
629
|
+
output { display: block; font-family: ${s.fontHeading}; ${W("4xl")} font-weight: ${Z("bold")}; }
|
|
630
|
+
dl { display: grid; gap: ${m(2)}; margin: ${m(4)} 0 0; padding-block-start: ${m(4)}; border-block-start: 1px solid color-mix(in srgb, ${s.onBrand} 25%, transparent); ${W("sm")} }
|
|
631
|
+
dl div { display: flex; justify-content: space-between; gap: ${m(3)}; }
|
|
420
632
|
dt { opacity: 0.85; }
|
|
421
|
-
dd { margin: 0; font-weight: ${
|
|
633
|
+
dd { margin: 0; font-weight: ${Z("semibold")}; }
|
|
422
634
|
/* Muted text is proved against the card colour, not this band, so the small print here is in the text colour (1.4.3). */
|
|
423
|
-
.small { grid-column: 1 / -1; margin: 0; padding: ${
|
|
424
|
-
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .inputs, .result { padding: ${
|
|
425
|
-
`]}money(t){try{return new Intl.NumberFormat(
|
|
635
|
+
.small { grid-column: 1 / -1; margin: 0; padding: ${m(4)} ${m(8)}; ${W("xs")} color: ${s.text}; background: ${s.surfaceSubtle}; }
|
|
636
|
+
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .inputs, .result { padding: ${m(5)}; } .small { padding: ${m(4)} ${m(5)}; } }
|
|
637
|
+
`]}money(t){try{return new Intl.NumberFormat(Ea(this),{style:"currency",currency:this.currency,maximumFractionDigits:0}).format(t)}catch{return String(Math.round(t))}}field(t){return e=>{this[t]=Number(e.target.value)||0}}render(){let t=this.price*this.depositPercent/100,e=Math.max(this.price-t,0),i=Gi(e,this.rate,this.years);return I`<div class="wrap" part="wrap">
|
|
426
638
|
<div class="inputs">
|
|
427
|
-
${this.heading?
|
|
428
|
-
<div><label for=${this.id_("price")}>${
|
|
429
|
-
<div><label for=${this.id_("deposit")}>${
|
|
639
|
+
${this.heading?I`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:K}
|
|
640
|
+
<div><label for=${this.id_("price")}>${ve("Home price")}</label><input id=${this.id_("price")} type="number" min="0" step="1000" inputmode="numeric" .value=${String(this.price)} @input=${this.field("price")} /></div>
|
|
641
|
+
<div><label for=${this.id_("deposit")}>${ve("Deposit")} <span class="read">${this.depositPercent}% · ${this.money(t)}</span></label><input id=${this.id_("deposit")} type="range" min="5" max="60" step="1" .value=${String(this.depositPercent)} @input=${this.field("depositPercent")} /></div>
|
|
430
642
|
<div class="two">
|
|
431
|
-
<div><label for=${this.id_("years")}>${
|
|
432
|
-
<div><label for=${this.id_("rate")}>${
|
|
643
|
+
<div><label for=${this.id_("years")}>${ve("Term")} <span class="read">${ve("{years} years",{years:this.years})}</span></label><input id=${this.id_("years")} type="range" min="5" max="40" step="1" .value=${String(this.years)} @input=${this.field("years")} /></div>
|
|
644
|
+
<div><label for=${this.id_("rate")}>${ve("Interest rate (%)")}</label><input id=${this.id_("rate")} type="number" min="0" max="20" step="0.05" inputmode="decimal" .value=${String(this.rate)} @input=${this.field("rate")} /></div>
|
|
433
645
|
</div>
|
|
434
646
|
</div>
|
|
435
647
|
<div class="result">
|
|
436
|
-
<p class="caption">${
|
|
648
|
+
<p class="caption">${ve("Estimated monthly repayment")}</p>
|
|
437
649
|
<output for=${`${this.id_("price")} ${this.id_("deposit")} ${this.id_("years")} ${this.id_("rate")}`}>${this.money(i)}</output>
|
|
438
650
|
<dl>
|
|
439
|
-
<div><dt>${
|
|
440
|
-
<div><dt>${
|
|
651
|
+
<div><dt>${ve("You would borrow")}</dt><dd>${this.money(e)}</dd></div>
|
|
652
|
+
<div><dt>${ve("Total repayable")}</dt><dd>${this.money(i*this.years*12)}</dd></div>
|
|
441
653
|
</dl>
|
|
442
654
|
</div>
|
|
443
|
-
${this.smallPrint?
|
|
444
|
-
</div>`}},
|
|
445
|
-
.frame { position: relative; overflow: hidden; border-radius: ${
|
|
655
|
+
${this.smallPrint?I`<p class="small">${this.smallPrint}</p>`:K}
|
|
656
|
+
</div>`}},Wt=class extends me{static{this.properties={beforeSrc:{type:String,attribute:"before-src"},beforeAlt:{type:String,attribute:"before-alt"},afterSrc:{type:String,attribute:"after-src"},afterAlt:{type:String,attribute:"after-alt"},beforeLabel:{type:String,attribute:"before-label"},afterLabel:{type:String,attribute:"after-label"},label:{type:String},position:{type:Number},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.beforeSrc="",this.beforeAlt="",this.afterSrc="",this.afterAlt="",this.beforeLabel="Before",this.afterLabel="After",this.label="Compare the two pictures",this.position=50,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...me.styles,Ke,Dt,Je`
|
|
657
|
+
.frame { position: relative; overflow: hidden; border-radius: ${s.radius2xl}; box-shadow: ${s.shadowLg}; line-height: 0; --at: 50%; }
|
|
446
658
|
img { display: block; inline-size: 100%; block-size: auto; }
|
|
447
659
|
.after { position: absolute; inset: 0; block-size: 100%; object-fit: cover; clip-path: inset(0 0 0 var(--at)); }
|
|
448
|
-
.tag { position: absolute; inset-block-start: ${
|
|
449
|
-
.tag.b { inset-inline-start: ${
|
|
450
|
-
.tag.a { inset-inline-end: ${
|
|
451
|
-
.line { position: absolute; inset-block: 0; inset-inline-start: var(--at); inline-size: 2px; margin-inline-start: -1px; background: ${
|
|
452
|
-
.grip { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; display: flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; margin: -22px 0 0 -22px; color: ${
|
|
660
|
+
.tag { position: absolute; inset-block-start: ${m(3)}; padding: ${m(1)} ${m(3)}; ${W("xs")} line-height: 1.4; font-weight: ${Z("semibold")}; color: ${s.text}; background: ${s.surfaceCard}; border-radius: 999px; box-shadow: ${s.shadowSm}; }
|
|
661
|
+
.tag.b { inset-inline-start: ${m(3)}; }
|
|
662
|
+
.tag.a { inset-inline-end: ${m(3)}; }
|
|
663
|
+
.line { position: absolute; inset-block: 0; inset-inline-start: var(--at); inline-size: 2px; margin-inline-start: -1px; background: ${s.surfaceCard}; pointer-events: none; }
|
|
664
|
+
.grip { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; display: flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; margin: -22px 0 0 -22px; color: ${s.text}; background: ${s.surfaceCard}; border-radius: 50%; box-shadow: ${s.shadowMd}; }
|
|
453
665
|
input { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
|
|
454
|
-
.frame:has(input:focus-visible) .grip { box-shadow: ${
|
|
455
|
-
`]}render(){return
|
|
666
|
+
.frame:has(input:focus-visible) .grip { box-shadow: ${s.focusShadow}; }
|
|
667
|
+
`]}render(){return I`<div class="frame" part="frame" style="--at:${this.position}%">
|
|
456
668
|
<img src=${this.beforeSrc} alt=${this.beforeAlt} />
|
|
457
669
|
<img class="after" src=${this.afterSrc} alt=${this.afterAlt} />
|
|
458
670
|
<span class="tag b" aria-hidden="true">${this.beforeLabel}</span>
|
|
459
671
|
<span class="tag a" aria-hidden="true">${this.afterLabel}</span>
|
|
460
|
-
<span class="line"><span class="grip">${
|
|
672
|
+
<span class="line"><span class="grip">${Be("arrow-left","14px")}${Be("arrow-right","14px")}</span></span>
|
|
461
673
|
<input type="range" min="0" max="100" aria-label=${this.label} .value=${String(this.position)} @input=${t=>{this.position=Number(t.target.value)}} />
|
|
462
|
-
</div>`}}
|
|
674
|
+
</div>`}},qt=class extends me{constructor(){super();this.shown=!1;this.check=()=>{let e=window.scrollY>=this.revealAfter;e!==this.shown&&(this.shown=e,this.requestUpdate(),this.clearance(e))};this.label="Quick actions",this.heading="",this.lead="",this.showOn="phones",this.revealAfter=400}static{this.properties={label:{type:String},heading:{type:String},lead:{type:String},showOn:{type:String,reflect:!0,attribute:"show-on"},revealAfter:{type:Number,attribute:"reveal-after"}}}static{this.styles=[...me.styles,Ke,Je`
|
|
463
675
|
:host { display: block; }
|
|
464
|
-
.bar { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 900; display: flex; align-items: center; justify-content: space-between; gap: ${
|
|
676
|
+
.bar { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 900; display: flex; align-items: center; justify-content: space-between; gap: ${m(4)}; padding: ${m(3)} ${m(4)} calc(${m(3)} + env(safe-area-inset-bottom)); background: ${s.surfaceCard}; box-shadow: ${s.shadowXl}, 0 -1px 0 color-mix(in srgb, ${s.text} 8%, transparent); transform: translateY(110%); visibility: hidden; transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), visibility 220ms; }
|
|
465
677
|
.bar.on { transform: none; visibility: visible; }
|
|
466
678
|
.spacer { block-size: 5rem; }
|
|
467
|
-
.h { font-family: ${
|
|
468
|
-
.t { ${
|
|
679
|
+
.h { font-family: ${s.fontHeading}; ${W("md")} font-weight: ${Z("bold")}; color: ${s.textHeading}; }
|
|
680
|
+
.t { ${W("xs")} color: ${s.textMuted}; }
|
|
469
681
|
.words { min-inline-size: 0; }
|
|
470
|
-
.actions { display: flex; flex: none; gap: ${
|
|
682
|
+
.actions { display: flex; flex: none; gap: ${m(2)}; }
|
|
471
683
|
@media (min-width: 48rem) { :host([show-on='phones']) { display: none; } }
|
|
472
|
-
`]}clearance(e){let a=e&&getComputedStyle(this).display!=="none"?`${this.renderRoot.querySelector(".bar")?.getBoundingClientRect().height??80}px`:"",
|
|
684
|
+
`]}clearance(e){let a=e&&getComputedStyle(this).display!=="none"?`${this.renderRoot.querySelector(".bar")?.getBoundingClientRect().height??80}px`:"",r=document.documentElement.style;r.scrollPaddingBlockEnd=a,a?r.setProperty("--impakt-bottom-bar",a):r.removeProperty("--impakt-bottom-bar")}connectedCallback(){super.connectedCallback(),window.addEventListener("scroll",this.check,{passive:!0}),this.check()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("scroll",this.check),this.clearance(!1)}render(){return I`<div class="spacer"></div>
|
|
473
685
|
<section class="bar ${this.shown?"on":""}" part="bar" aria-label=${this.label}>
|
|
474
686
|
<div class="words">
|
|
475
|
-
${this.heading?
|
|
476
|
-
${this.lead?
|
|
687
|
+
${this.heading?I`<div class="h">${this.heading}</div>`:K}
|
|
688
|
+
${this.lead?I`<div class="t">${this.lead}</div>`:K}
|
|
477
689
|
</div>
|
|
478
690
|
<div class="actions"><slot name="actions"></slot></div>
|
|
479
|
-
</section>`}},
|
|
691
|
+
</section>`}},_t=class extends me{static{this.properties={heading:{type:String},address:{type:String},hours:{type:String},phone:{type:String},mapSrc:{type:String,attribute:"map-src"},mapAlt:{type:String,attribute:"map-alt"},directionsText:{type:String,attribute:"directions-text"},directionsHref:{type:String,attribute:"directions-href"},nearby:{type:Array},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="",this.address="",this.hours="",this.phone="",this.mapSrc="",this.mapAlt="",this.directionsText="Get directions",this.directionsHref="",this.nearby=[],this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...me.styles,Ke,Dt,Je`
|
|
480
692
|
:host { display: block; container-type: inline-size; }
|
|
481
|
-
.wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; background: ${
|
|
693
|
+
.wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; background: ${s.surfaceCard}; border-radius: ${s.radius2xl}; box-shadow: ${s.shadowMd}, 0 0 0 1px color-mix(in srgb, ${s.text} 6%, transparent); }
|
|
482
694
|
.wrap.solo { grid-template-columns: minmax(0, 1fr); }
|
|
483
|
-
.map { min-block-size: 16rem; background: ${
|
|
695
|
+
.map { min-block-size: 16rem; background: ${s.surfaceSubtle}; }
|
|
484
696
|
.map img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
485
|
-
.info { display: flex; flex-direction: column; gap: ${
|
|
486
|
-
.h { margin: 0; font-family: ${
|
|
487
|
-
.row { display: flex; gap: ${
|
|
488
|
-
.row svg { flex: none; margin-block-start: ${
|
|
489
|
-
.row a { display: inline-flex; align-items: center; min-block-size: ${
|
|
490
|
-
a { color: ${
|
|
491
|
-
ul { display: grid; gap: ${
|
|
492
|
-
li { display: flex; justify-content: space-between; gap: ${
|
|
493
|
-
li span:last-child { color: ${
|
|
494
|
-
.go { ${
|
|
495
|
-
.go:hover { background: ${
|
|
496
|
-
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .info { padding: ${
|
|
497
|
-
`]}render(){let t=this.directionsHref||(this.address?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(this.address)}`:"");return
|
|
498
|
-
${this.mapSrc?
|
|
697
|
+
.info { display: flex; flex-direction: column; gap: ${m(3)}; padding: ${m(8)}; }
|
|
698
|
+
.h { margin: 0; font-family: ${s.fontHeading}; ${W("2xl")} font-weight: ${Z("bold")}; color: ${s.textHeading}; }
|
|
699
|
+
.row { display: flex; gap: ${m(3)}; margin: 0; white-space: pre-line; }
|
|
700
|
+
.row svg { flex: none; margin-block-start: ${m(.5)}; color: ${s.brand}; }
|
|
701
|
+
.row a { display: inline-flex; align-items: center; min-block-size: ${s.targetMin}; margin-block-start: -2px; }
|
|
702
|
+
a { color: ${s.link}; }
|
|
703
|
+
ul { display: grid; gap: ${m(1.5)}; margin: ${m(1)} 0; padding: ${m(3)} 0 0; list-style: none; border-block-start: 1px solid color-mix(in srgb, ${s.text} 10%, transparent); ${W("sm")} }
|
|
704
|
+
li { display: flex; justify-content: space-between; gap: ${m(3)}; }
|
|
705
|
+
li span:last-child { color: ${s.textMuted}; text-align: end; }
|
|
706
|
+
.go { ${Yi} align-self: flex-start; display: inline-flex; align-items: center; gap: ${m(2)}; padding: ${m(2)} ${m(4)}; ${W("sm")} font-weight: ${Z("semibold")}; color: ${s.onBrand}; text-decoration: none; background: ${s.brand}; border-radius: ${s.radiusLg}; }
|
|
707
|
+
.go:hover { background: ${s.brandHover}; }
|
|
708
|
+
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .info { padding: ${m(5)}; } }
|
|
709
|
+
`]}render(){let t=this.directionsHref||(this.address?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(this.address)}`:"");return I`<div class="wrap ${this.mapSrc?"":"solo"}" part="wrap">
|
|
710
|
+
${this.mapSrc?I`<div class="map"><img src=${this.mapSrc} alt=${this.mapAlt} /></div>`:K}
|
|
499
711
|
<div class="info">
|
|
500
|
-
${this.heading?
|
|
501
|
-
${this.address?
|
|
502
|
-
${this.hours?
|
|
503
|
-
${this.phone?
|
|
504
|
-
${this.nearby.length?
|
|
505
|
-
${t?
|
|
712
|
+
${this.heading?I`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:K}
|
|
713
|
+
${this.address?I`<p class="row">${Be("map-pin","20px")}<span>${this.address}</span></p>`:K}
|
|
714
|
+
${this.hours?I`<p class="row">${Be("clock","20px")}<span>${this.hours}</span></p>`:K}
|
|
715
|
+
${this.phone?I`<p class="row">${Be("phone","20px")}<a href=${`tel:${this.phone.replace(/\s+/g,"")}`}>${this.phone}</a></p>`:K}
|
|
716
|
+
${this.nearby.length?I`<ul>${this.nearby.map(e=>I`<li><span>${e.place}</span><span>${e.distance}</span></li>`)}</ul>`:K}
|
|
717
|
+
${t?I`<a class="go" href=${t}>${this.directionsText}${Be("arrow-right","16px")}</a>`:K}
|
|
506
718
|
</div>
|
|
507
|
-
</div>`}};customElements.define("impakt-site-plan",
|
|
508
|
-
.card { background: ${
|
|
509
|
-
.h { margin: 0; font-family: ${
|
|
510
|
-
.btn { display: inline-flex; justify-content: center; align-items: center; min-block-size: 44px; padding: ${
|
|
511
|
-
.btn:hover { background: ${
|
|
512
|
-
.btn.quiet { color: ${
|
|
513
|
-
.small { margin: 0; ${
|
|
514
|
-
.visually-hidden { ${
|
|
515
|
-
`,
|
|
719
|
+
</div>`}};customElements.define("impakt-site-plan",Ot);customElements.define("impakt-mortgage-calculator",Ft);customElements.define("impakt-before-after",Wt);customElements.define("impakt-sticky-bar",qt);customElements.define("impakt-location-card",_t);import{css as je,html as $,nothing as P}from"./atomic-ui.js";import{say as M,pageLocale as Vi,ImpaktElement as se,focusRing as tt,targetSize as Ca,visuallyHidden as Ba,fontWeight as X,space as u,spaceAround as Oe,t as d,type as O}from"./atomic-ui.js";var it=je`
|
|
720
|
+
.card { background: ${d.surfaceCard}; border-radius: ${d.radiusXl}; box-shadow: ${d.shadowSm}, 0 0 0 1px ${d.hairline}; }
|
|
721
|
+
.h { margin: 0; font-family: ${d.fontHeading}; ${O("2xl")} font-weight: ${X("bold")}; color: ${d.textHeading}; }
|
|
722
|
+
.btn { display: inline-flex; justify-content: center; align-items: center; min-block-size: 44px; padding: ${u(2.5)} ${u(5)}; font: inherit; font-weight: ${X("semibold")}; color: ${d.onBrand}; text-decoration: none; background: ${d.brand}; border: 0; border-radius: ${d.radiusLg}; cursor: pointer; }
|
|
723
|
+
.btn:hover { background: ${d.brandHover}; }
|
|
724
|
+
.btn.quiet { color: ${d.link}; background: transparent; box-shadow: inset 0 0 0 ${d.borderThin} ${d.border}; }
|
|
725
|
+
.small { margin: 0; ${O("xs")} color: ${d.textMuted}; }
|
|
726
|
+
.visually-hidden { ${Ba} }
|
|
727
|
+
`,Ut=(n,t="GBP",e=0)=>{try{return new Intl.NumberFormat(Vi(),{style:"currency",currency:t,maximumFractionDigits:e,minimumFractionDigits:e}).format(n)}catch{return String(Math.round(n))}},Yt=class extends se{static{this.properties={heading:{type:String},plans:{type:Array},rows:{type:Array},buttonText:{type:String,attribute:"button-text"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="Compare cover",this.plans=[],this.rows=[],this.buttonText="Choose",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...se.styles,tt,Ca,Oe,it,je`
|
|
516
728
|
:host { display: block; container-type: inline-size; }
|
|
517
|
-
.h { margin-block-end: ${
|
|
518
|
-
.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: ${
|
|
519
|
-
.plan { position: relative; display: flex; flex-direction: column; gap: ${
|
|
520
|
-
.plan.top { box-shadow: 0 0 0 2px ${
|
|
521
|
-
.badge { position: absolute; inset-block-start: 0; inset-inline-start: 50%; transform: translate(-50%, -50%); padding: ${
|
|
522
|
-
.name { margin: 0; ${
|
|
523
|
-
.price { margin: 0; font-family: ${
|
|
524
|
-
.period { ${
|
|
525
|
-
.note { margin: 0; ${
|
|
526
|
-
ul { flex: 1; margin: 0; padding: ${
|
|
527
|
-
li { display: flex; gap: ${
|
|
528
|
-
li[data-has='false'] { color: ${
|
|
529
|
-
.mark { flex-shrink: 0; inline-size: 1.25em; font-weight: ${
|
|
530
|
-
li[data-has='true'] .mark { color: ${
|
|
531
|
-
@container (max-width: 40rem) { .grid { grid-template-columns: minmax(0, 1fr); gap: ${
|
|
532
|
-
`]}has(t,e){return t.includes.split(",").map(i=>i.trim().toLowerCase()).includes(e.label.trim().toLowerCase())}choose(t,e){this.dispatchEvent(new CustomEvent("impakt-select",{detail:{plan:t},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault()}render(){return
|
|
533
|
-
${this.heading
|
|
729
|
+
.h { margin-block-end: ${u(5)}; }
|
|
730
|
+
.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: ${u(4)}; }
|
|
731
|
+
.plan { position: relative; display: flex; flex-direction: column; gap: ${u(3)}; padding: ${u(6)}; }
|
|
732
|
+
.plan.top { box-shadow: 0 0 0 2px ${d.brand}, ${d.shadowMd}; }
|
|
733
|
+
.badge { position: absolute; inset-block-start: 0; inset-inline-start: 50%; transform: translate(-50%, -50%); padding: ${u(1)} ${u(3)}; border-radius: 999px; ${O("xs")} font-weight: ${X("bold")}; color: ${d.onBrand}; background: ${d.brand}; white-space: nowrap; }
|
|
734
|
+
.name { margin: 0; ${O("lg")} font-weight: ${X("bold")}; color: ${d.text}; }
|
|
735
|
+
.price { margin: 0; font-family: ${d.fontHeading}; ${O("3xl")} font-weight: ${X("bold")}; color: ${d.text}; }
|
|
736
|
+
.period { ${O("sm")} font-weight: ${X("regular")}; color: ${d.textMuted}; }
|
|
737
|
+
.note { margin: 0; ${O("sm")} color: ${d.textMuted}; }
|
|
738
|
+
ul { flex: 1; margin: 0; padding: ${u(3)} 0 0; list-style: none; display: grid; gap: ${u(2)}; border-block-start: 1px solid ${d.rule}; align-content: start; }
|
|
739
|
+
li { display: flex; gap: ${u(2)}; ${O("sm")} }
|
|
740
|
+
li[data-has='false'] { color: ${d.textMuted}; }
|
|
741
|
+
.mark { flex-shrink: 0; inline-size: 1.25em; font-weight: ${X("bold")}; text-align: center; }
|
|
742
|
+
li[data-has='true'] .mark { color: ${d.successText}; }
|
|
743
|
+
@container (max-width: 40rem) { .grid { grid-template-columns: minmax(0, 1fr); gap: ${u(6)}; } }
|
|
744
|
+
`]}has(t,e){return t.includes.split(",").map(i=>i.trim().toLowerCase()).includes(e.label.trim().toLowerCase())}choose(t,e){this.dispatchEvent(new CustomEvent("impakt-select",{detail:{plan:t},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault()}render(){return $`
|
|
745
|
+
${this.heading?$`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:P}
|
|
534
746
|
<div class="grid" style=${`--cols: ${Math.max(1,this.plans.length)}`}>
|
|
535
|
-
${this.plans.map(t
|
|
536
|
-
${t.badge
|
|
747
|
+
${this.plans.map(t=>$`<section class="card plan ${t.badge?"top":""}" aria-labelledby=${this.id_(`n-${t.id}`)}>
|
|
748
|
+
${t.badge?$`<span class="badge">${t.badge}</span>`:P}
|
|
537
749
|
<h3 class="name" id=${this.id_(`n-${t.id}`)}>${t.name}</h3>
|
|
538
|
-
<p class="price">${t.price}${t.period
|
|
539
|
-
${t.note
|
|
540
|
-
<ul>${this.rows.map(e=>{let i=this.has(t,e);return
|
|
541
|
-
${t.href
|
|
750
|
+
<p class="price">${t.price}${t.period?$` <span class="period">${t.period}</span>`:P}</p>
|
|
751
|
+
${t.note?$`<p class="note">${t.note}</p>`:P}
|
|
752
|
+
<ul>${this.rows.map(e=>{let i=this.has(t,e);return $`<li data-has=${String(i)}><span class="mark" aria-hidden="true">${i?"\u2713":"\u2013"}</span><span>${e.label}<span class="visually-hidden">: ${M(i?"included":"not included")}</span></span></li>`})}</ul>
|
|
753
|
+
${t.href?$`<a class="btn ${t.badge?"":"quiet"}" href=${t.href} @click=${e=>this.choose(t,e)}>${this.buttonText}<span class="visually-hidden"> ${t.name}</span></a>`:$`<button class="btn ${t.badge?"":"quiet"}" type="button" @click=${e=>this.choose(t,e)}>${this.buttonText}<span class="visually-hidden"> ${t.name}</span></button>`}
|
|
542
754
|
</section>`)}
|
|
543
|
-
</div>`}};function
|
|
755
|
+
</div>`}};function Qi(n,t){let e=/(?:youtube\.com\/(?:watch\?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{6,})/.exec(n),i=t&&!/^en\b/i.test(t)?`&hl=${encodeURIComponent(t.split("-")[0])}&cc_lang_pref=${encodeURIComponent(t.split("-")[0])}`:"";if(e)return`https://www.youtube-nocookie.com/embed/${e[1]}?autoplay=1&rel=0${i}`;let a=/vimeo\.com\/(?:video\/)?(\d+)/.exec(n);return a?`https://player.vimeo.com/video/${a[1]}?autoplay=1&dnt=1`:null}var Ze=class extends se{static{this.properties={videoSrc:{type:String,attribute:"video-src"},label:{type:String},posterSrc:{type:String,attribute:"poster-src"},captionsSrc:{type:String,attribute:"captions-src"},transcriptHref:{type:String,attribute:"transcript-href"},playText:{type:String,attribute:"play-text"},ratio:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.videoSrc="",this.label="Video",this.posterSrc="",this.captionsSrc="",this.transcriptHref="",this.playText="Play video",this.ratio="16:9",this.playing=!1,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...se.styles,tt,Oe,it,je`
|
|
544
756
|
:host { display: block; }
|
|
545
|
-
.frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: ${
|
|
757
|
+
.frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: ${d.radiusXl}; background: #111; }
|
|
546
758
|
:host([ratio='4:3']) .frame { aspect-ratio: 4 / 3; }
|
|
547
759
|
:host([ratio='1:1']) .frame { aspect-ratio: 1; }
|
|
548
760
|
:host([ratio='9:16']) .frame { aspect-ratio: 9 / 16; max-inline-size: 420px; }
|
|
549
761
|
iframe, video, img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border: 0; object-fit: cover; }
|
|
550
762
|
.play { position: absolute; inset: 0; display: grid; place-items: center; inline-size: 100%; padding: 0; color: #fff; background: linear-gradient(transparent 40%, rgb(0 0 0 / 0.55)); border: 0; cursor: pointer; }
|
|
551
|
-
.disc { display: grid; place-items: center; inline-size: 72px; block-size: 72px; border-radius: 50%; background: ${
|
|
763
|
+
.disc { display: grid; place-items: center; inline-size: 72px; block-size: 72px; border-radius: 50%; background: ${d.brand}; box-shadow: ${d.shadowLg}; }
|
|
552
764
|
/* Held inside the frame at both edges, so loosened or long words wrap rather than run out of it (1.4.12). */
|
|
553
|
-
.label { position: absolute; inset-inline: ${
|
|
554
|
-
.foot { margin: ${
|
|
555
|
-
.foot a { color: ${
|
|
765
|
+
.label { position: absolute; inset-inline: ${u(5)}; inset-block-end: ${u(4)}; ${O("lg")} font-weight: ${X("semibold")}; text-align: start; }
|
|
766
|
+
.foot { margin: ${u(2)} 0 0; ${O("sm")} }
|
|
767
|
+
.foot a { color: ${d.link}; }
|
|
556
768
|
.empty { display: grid; place-items: center; block-size: 100%; color: #ccc; }
|
|
557
|
-
`]}render(){let t=
|
|
769
|
+
`]}render(){let t=Qi(this.videoSrc,Vi(this)),e;return this.videoSrc?t&&this.playing?e=$`<iframe src=${t} title=${this.label} allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allowfullscreen></iframe>`:t?e=$`${this.posterSrc?$`<img src=${this.posterSrc} alt="" />`:P}
|
|
558
770
|
<button class="play" type="button" @click=${()=>{this.playing=!0}}>
|
|
559
771
|
<span class="disc" aria-hidden="true"><svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg></span>
|
|
560
772
|
<span class="label">${this.playText}<span class="visually-hidden">: ${this.label}</span></span>
|
|
561
|
-
</button>`:e
|
|
773
|
+
</button>`:e=$`<video controls preload="metadata" poster=${this.posterSrc||P} aria-label=${this.label}>
|
|
562
774
|
<source src=${this.videoSrc} />
|
|
563
|
-
${this.captionsSrc
|
|
564
|
-
</video>`:e
|
|
565
|
-
${this.transcriptHref
|
|
775
|
+
${this.captionsSrc?$`<track kind="captions" src=${this.captionsSrc} srclang="en" label="English" default />`:P}
|
|
776
|
+
</video>`:e=$`<div class="empty">${M("Add a video address")}</div>`,$`<div class="frame" part="frame">${e}</div>
|
|
777
|
+
${this.transcriptHref?$`<p class="foot"><a href=${this.transcriptHref}>${M("Read the transcript")}<span class="visually-hidden">${M(" of {video}",{video:this.label})}</span></a></p>`:P}`}},Xi={mortgage:{heading:"Your home may be repossessed",text:"Your home may be repossessed if you do not keep up repayments on your mortgage."},"secured-loan":{heading:"Think carefully before securing other debts against your home",text:"Your home may be repossessed if you do not keep up repayments on a mortgage or any other debt secured on it."},investment:{heading:"Capital at risk",text:"The value of investments can go down as well as up, and you may get back less than you put in."},insurance:{heading:"Important information",text:"Read the policy documents to check the cover suits your needs. Limits and exclusions apply."},custom:{heading:"",text:""}},Gt=class extends se{static{this.properties={kind:{type:String,reflect:!0},heading:{type:String},text:{type:String},firm:{type:String},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.kind="mortgage",this.heading="",this.text="",this.firm="",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...se.styles,Oe,je`
|
|
566
778
|
:host { display: block; }
|
|
567
|
-
.box { padding: ${
|
|
568
|
-
:host([kind='insurance']) .box { border-color: ${
|
|
569
|
-
strong { display: block; margin-block-end: ${
|
|
570
|
-
p { margin: 0; color: ${
|
|
779
|
+
.box { padding: ${u(5)}; border-inline-start: 6px solid ${d.warning}; border-radius: ${d.radiusLg}; background: ${d.warningSubtle}; }
|
|
780
|
+
:host([kind='insurance']) .box { border-color: ${d.info}; background: ${d.infoSubtle}; }
|
|
781
|
+
strong { display: block; margin-block-end: ${u(1)}; ${O("md")} color: ${d.text}; }
|
|
782
|
+
p { margin: 0; color: ${d.text}; }
|
|
571
783
|
/* Muted text is proved against the card colour, not the notice's, so the firm's line is in the text colour (1.4.3). */
|
|
572
|
-
.firm { margin-block-start: ${
|
|
573
|
-
`]}render(){let t
|
|
574
|
-
${e
|
|
575
|
-
${i
|
|
576
|
-
${this.firm
|
|
577
|
-
</aside>`}},
|
|
784
|
+
.firm { margin-block-start: ${u(3)}; ${O("sm")} color: ${d.text}; }
|
|
785
|
+
`]}render(){let t=Xi[this.kind]??Xi.custom,e=this.heading||(t.heading?M(t.heading):""),i=this.text||(t.text?M(t.text):"");return $`<aside class="box" part="box" aria-label=${e||M("Important information")}>
|
|
786
|
+
${e?$`<strong>${e}</strong>`:P}
|
|
787
|
+
${i?$`<p>${i}</p>`:P}
|
|
788
|
+
${this.firm?$`<p class="firm">${this.firm}</p>`:P}
|
|
789
|
+
</aside>`}},ke={standard:[{from:0,rate:0},{from:125e3,rate:2},{from:25e4,rate:5},{from:925e3,rate:10},{from:15e5,rate:12}],firstTime:[{from:0,rate:0},{from:3e5,rate:5}],firstTimeLimit:5e5,additionalSurcharge:5};function xi(n,t,e=0){let i=0;return t.forEach((a,r)=>{let o=t[r+1]?.from??1/0;n>a.from&&(i+=(Math.min(n,o)-a.from)*(a.rate+e)/100)}),Math.round(i)}function Ji(n,t){return n<=0?0:t==="first-time"&&n<=ke.firstTimeLimit?xi(n,ke.firstTime):t==="additional"?n<4e4?0:xi(n,ke.standard,ke.additionalSurcharge):xi(n,ke.standard)}var Ki=je`
|
|
578
790
|
:host { display: block; container-type: inline-size; }
|
|
579
791
|
.wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); overflow: hidden; }
|
|
580
|
-
.inputs { display: flex; flex-direction: column; gap: ${
|
|
581
|
-
label, legend { display: block; ${
|
|
792
|
+
.inputs { display: flex; flex-direction: column; gap: ${u(5)}; padding: ${u(8)}; }
|
|
793
|
+
label, legend { display: block; ${O("sm")} font-weight: ${X("semibold")}; margin-block-end: ${u(1.5)}; padding: 0; }
|
|
582
794
|
fieldset { margin: 0; padding: 0; border: 0; }
|
|
583
|
-
.choices { display: flex; flex-wrap: wrap; gap: ${
|
|
584
|
-
.choices label { display: inline-flex; align-items: center; gap: ${
|
|
585
|
-
.choices input { accent-color: ${
|
|
586
|
-
input[type='number'] { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${
|
|
587
|
-
.result { display: flex; flex-direction: column; justify-content: center; gap: ${
|
|
588
|
-
.caption { margin: 0; ${
|
|
589
|
-
output { display: block; font-family: ${
|
|
590
|
-
.line { margin: 0; ${
|
|
591
|
-
.foot { grid-column: 1 / -1; padding: ${
|
|
795
|
+
.choices { display: flex; flex-wrap: wrap; gap: ${u(2)}; }
|
|
796
|
+
.choices label { display: inline-flex; align-items: center; gap: ${u(2)}; margin: 0; padding: ${u(2)} ${u(3)}; font-weight: ${X("regular")}; border: ${d.borderThin} solid ${d.border}; border-radius: ${d.radiusLg}; cursor: pointer; }
|
|
797
|
+
.choices input { accent-color: ${d.brand}; }
|
|
798
|
+
input[type='number'] { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${u(2)} ${u(3)}; font: inherit; color: ${d.text}; background: ${d.surfaceCard}; border: ${d.borderThin} solid ${d.border}; border-radius: ${d.radiusLg}; }
|
|
799
|
+
.result { display: flex; flex-direction: column; justify-content: center; gap: ${u(2)}; padding: ${u(8)}; color: ${d.onBrand}; background: ${d.brand}; }
|
|
800
|
+
.caption { margin: 0; ${O("sm")} opacity: 0.85; }
|
|
801
|
+
output { display: block; font-family: ${d.fontHeading}; ${O("4xl")} font-weight: ${X("bold")}; }
|
|
802
|
+
.line { margin: 0; ${O("sm")} }
|
|
803
|
+
.foot { grid-column: 1 / -1; padding: ${u(4)} ${u(8)}; background: ${d.surfaceSubtle}; }
|
|
592
804
|
/* Muted text is proved against the card colour, not this band, so the small print here is in the text colour (1.4.3). */
|
|
593
|
-
.foot .small { color: ${
|
|
594
|
-
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .inputs, .result { padding: ${
|
|
595
|
-
`,
|
|
805
|
+
.foot .small { color: ${d.text}; }
|
|
806
|
+
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .inputs, .result { padding: ${u(5)}; } .foot { padding: ${u(4)} ${u(5)}; } }
|
|
807
|
+
`,Xt=class extends se{static{this.properties={heading:{type:String},price:{type:Number},buyer:{type:String},smallPrint:{type:String,attribute:"small-print"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="How much stamp duty would you pay?",this.price=385e3,this.buyer="first-time",this.smallPrint="Based on Stamp Duty Land Tax rates in England and Northern Ireland from 1 April 2025. Scotland and Wales have their own taxes. Check what you would pay on GOV.UK.",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...se.styles,tt,Oe,it,Ki]}render(){let t=Ji(this.price,this.buyer),e=this.price>0?t/this.price*100:0,i=[["first-time",M("First home")],["mover",M("Moving home")],["additional",M("Second home")]];return $`<div class="card wrap" part="wrap">
|
|
596
808
|
<div class="inputs">
|
|
597
|
-
${this.heading
|
|
598
|
-
<div><label for=${this.id_("price")}>${
|
|
809
|
+
${this.heading?$`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:P}
|
|
810
|
+
<div><label for=${this.id_("price")}>${M("Price of the home (\xA3)")}</label>
|
|
599
811
|
<input id=${this.id_("price")} type="number" min="0" step="1000" inputmode="numeric" .value=${String(this.price)} @input=${a=>{this.price=Number(a.target.value)||0}} /></div>
|
|
600
|
-
<fieldset><legend>${
|
|
601
|
-
${i.map(([a,
|
|
812
|
+
<fieldset><legend>${M("Are you buying")}</legend><div class="choices">
|
|
813
|
+
${i.map(([a,r])=>$`<label><input type="radio" name=${this.id_("buyer")} .checked=${this.buyer===a} @change=${()=>{this.buyer=a}} />${r}</label>`)}
|
|
602
814
|
</div></fieldset>
|
|
603
815
|
</div>
|
|
604
816
|
<div class="result" aria-live="polite">
|
|
605
|
-
<p class="caption">${
|
|
606
|
-
<output for=${this.id_("price")}>${
|
|
607
|
-
<p class="line">${t?
|
|
608
|
-
${this.buyer==="first-time"&&this.price>
|
|
817
|
+
<p class="caption">${M("Stamp duty to pay")}</p>
|
|
818
|
+
<output for=${this.id_("price")}>${Ut(t)}</output>
|
|
819
|
+
<p class="line">${t?M("About {rate}% of the price",{rate:e.toFixed(1)}):M("Nothing to pay at this price")}</p>
|
|
820
|
+
${this.buyer==="first-time"&&this.price>ke.firstTimeLimit?$`<p class="line">${M("First-time buyer relief stops above {limit}, so the usual rates apply.",{limit:Ut(ke.firstTimeLimit)})}</p>`:P}
|
|
609
821
|
</div>
|
|
610
|
-
${this.smallPrint
|
|
611
|
-
</div>`}},
|
|
612
|
-
<input id=${this.id_(i)} type="number" min="0" step="1000" inputmode="numeric" .value=${String(this[i])} @input=${this.field(i)} /></div>`;return
|
|
822
|
+
${this.smallPrint?$`<div class="foot"><p class="small">${this.smallPrint}</p></div>`:P}
|
|
823
|
+
</div>`}},Vt=class extends se{static{this.properties={heading:{type:String},income:{type:Number},secondIncome:{type:Number,attribute:"second-income"},deposit:{type:Number},timesIncome:{type:Number,attribute:"times-income"},smallPrint:{type:String,attribute:"small-print"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="How much could you borrow?",this.income=45e3,this.secondIncome=0,this.deposit=3e4,this.timesIncome=4.5,this.smallPrint="This is a guide, not a mortgage offer. What a lender offers depends on your circumstances. Your home may be repossessed if you do not keep up repayments on your mortgage.",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...se.styles,tt,Oe,it,Ki]}field(t){return e=>{this[t]=Number(e.target.value)||0}}render(){let t=Math.max(0,(this.income+this.secondIncome)*this.timesIncome),e=(i,a)=>$`<div><label for=${this.id_(i)}>${a}</label>
|
|
824
|
+
<input id=${this.id_(i)} type="number" min="0" step="1000" inputmode="numeric" .value=${String(this[i])} @input=${this.field(i)} /></div>`;return $`<div class="card wrap" part="wrap">
|
|
613
825
|
<div class="inputs">
|
|
614
|
-
${this.heading
|
|
615
|
-
${e("income",
|
|
616
|
-
${e("secondIncome",
|
|
617
|
-
${e("deposit",
|
|
826
|
+
${this.heading?$`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:P}
|
|
827
|
+
${e("income",M("Your yearly income before tax (\xA3)"))}
|
|
828
|
+
${e("secondIncome",M("A second person\u2019s income, if buying together (\xA3)"))}
|
|
829
|
+
${e("deposit",M("Your deposit (\xA3)"))}
|
|
618
830
|
</div>
|
|
619
831
|
<div class="result" aria-live="polite">
|
|
620
|
-
<p class="caption">${
|
|
621
|
-
<output>${
|
|
622
|
-
<p class="line">${
|
|
832
|
+
<p class="caption">${M("You could borrow about")}</p>
|
|
833
|
+
<output>${Ut(t)}</output>
|
|
834
|
+
<p class="line">${M("With your deposit, that\u2019s a home of about {amount}.",{amount:Ut(t+this.deposit)})}</p>
|
|
623
835
|
</div>
|
|
624
|
-
${this.smallPrint
|
|
625
|
-
</div>`}},
|
|
626
|
-
Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",this.buttonText="Ask for a call back",this.doneText="Thanks. We\u2019ll call you at the time you chose.",this.headingLevel=2,this.sent=!1,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...
|
|
836
|
+
${this.smallPrint?$`<div class="foot"><p class="small">${this.smallPrint}</p></div>`:P}
|
|
837
|
+
</div>`}},et=class extends se{static{this.properties={heading:{type:String},phone:{type:String},hours:{type:String},email:{type:String},callbackHeading:{type:String,attribute:"callback-heading"},buttonText:{type:String,attribute:"button-text"},doneText:{type:String,attribute:"done-text"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="Talk to us",this.phone="0800 000 0000",this.hours=`Monday to Friday, 9am to 6pm
|
|
838
|
+
Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",this.buttonText="Ask for a call back",this.doneText="Thanks. We\u2019ll call you at the time you chose.",this.headingLevel=2,this.sent=!1,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...se.styles,tt,Oe,it,je`
|
|
627
839
|
:host { display: block; container-type: inline-size; }
|
|
628
|
-
.wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${
|
|
629
|
-
.phone { display: inline-block; margin: ${
|
|
630
|
-
.hours { margin: 0; white-space: pre-line; color: ${
|
|
631
|
-
.email { display: inline-flex; align-items: center; min-block-size: ${
|
|
632
|
-
form { display: grid; gap: ${
|
|
633
|
-
.sub { margin: 0; ${
|
|
634
|
-
label { display: block; ${
|
|
635
|
-
input, select { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${
|
|
636
|
-
.done { margin: 0; padding: ${
|
|
637
|
-
@container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); padding: ${
|
|
638
|
-
`]}submit(t){t.preventDefault();let e=new FormData(t.target),i={name:String(e.get("name")??""),phone:String(e.get("phone")??""),when:String(e.get("when")??"")};this.dispatchEvent(new CustomEvent("impakt-submit",{detail:i,bubbles:!0,composed:!0})),this.sent=!0}render(){return
|
|
840
|
+
.wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${u(6)}; padding: ${u(8)}; }
|
|
841
|
+
.phone { display: inline-block; margin: ${u(3)} 0; font-family: ${d.fontHeading}; ${O("3xl")} font-weight: ${X("bold")}; color: ${d.link}; text-decoration: none; }
|
|
842
|
+
.hours { margin: 0; white-space: pre-line; color: ${d.textMuted}; }
|
|
843
|
+
.email { display: inline-flex; align-items: center; min-block-size: ${d.targetMin}; margin-block-start: ${u(3)}; color: ${d.link}; overflow-wrap: anywhere; }
|
|
844
|
+
form { display: grid; gap: ${u(3)}; padding: ${u(5)}; border-radius: ${d.radiusLg}; background: ${d.surfaceInset}; }
|
|
845
|
+
.sub { margin: 0; ${O("lg")} font-weight: ${X("bold")}; color: ${d.text}; }
|
|
846
|
+
label { display: block; ${O("sm")} font-weight: ${X("semibold")}; margin-block-end: ${u(1)}; }
|
|
847
|
+
input, select { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${u(2)} ${u(3)}; font: inherit; color: ${d.text}; background: ${d.surfaceCard}; border: ${d.borderThin} solid ${d.border}; border-radius: ${d.radiusLg}; }
|
|
848
|
+
.done { margin: 0; padding: ${u(5)}; border-radius: ${d.radiusLg}; background: ${d.successSubtle}; color: ${d.successText}; font-weight: ${X("semibold")}; }
|
|
849
|
+
@container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); padding: ${u(5)}; } }
|
|
850
|
+
`]}submit(t){t.preventDefault();let e=new FormData(t.target),i={name:String(e.get("name")??""),phone:String(e.get("phone")??""),when:String(e.get("when")??"")};this.dispatchEvent(new CustomEvent("impakt-submit",{detail:i,bubbles:!0,composed:!0})),this.sent=!0}render(){return $`<div class="card wrap" part="wrap">
|
|
639
851
|
<div>
|
|
640
|
-
${this.heading
|
|
641
|
-
${this.phone
|
|
642
|
-
${this.hours
|
|
643
|
-
${this.email
|
|
852
|
+
${this.heading?$`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:P}
|
|
853
|
+
${this.phone?$`<a class="phone" href=${`tel:${this.phone.replace(/[^\d+]/g,"")}`}>${this.phone}</a>`:P}
|
|
854
|
+
${this.hours?$`<p class="hours">${this.hours}</p>`:P}
|
|
855
|
+
${this.email?$`<a class="email" href=${`mailto:${this.email}`}>${this.email}</a>`:P}
|
|
644
856
|
</div>
|
|
645
|
-
${this.callbackHeading?this.sent
|
|
857
|
+
${this.callbackHeading?this.sent?$`<p class="done" role="status">${this.doneText}</p>`:$`<form @submit=${this.submit} aria-labelledby=${this.id_("cb")}>
|
|
646
858
|
<p class="sub" id=${this.id_("cb")}>${this.callbackHeading}</p>
|
|
647
|
-
<div><label for=${this.id_("name")}>${
|
|
648
|
-
<div><label for=${this.id_("tel")}>${
|
|
649
|
-
<div><label for=${this.id_("when")}>${
|
|
859
|
+
<div><label for=${this.id_("name")}>${M("Your name")}</label><input id=${this.id_("name")} name="name" autocomplete="name" required /></div>
|
|
860
|
+
<div><label for=${this.id_("tel")}>${M("Phone number")}</label><input id=${this.id_("tel")} name="phone" type="tel" autocomplete="tel" required /></div>
|
|
861
|
+
<div><label for=${this.id_("when")}>${M("Best time to call")}</label><select id=${this.id_("when")} name="when"><option value="Morning">${M("Morning")}</option><option value="Afternoon">${M("Afternoon")}</option><option value="Evening">${M("Evening")}</option></select></div>
|
|
650
862
|
<button class="btn" type="submit">${this.buttonText}</button>
|
|
651
|
-
</form>`:
|
|
652
|
-
</div>`}};
|
|
863
|
+
</form>`:P}
|
|
864
|
+
</div>`}};Ze.createProperty("playing",{state:!0});et.createProperty("sent",{state:!0});customElements.define("impakt-plan-comparison",Yt);customElements.define("impakt-video",Ze);customElements.define("impakt-regulatory-notice",Gt);customElements.define("impakt-stamp-duty-calculator",Xt);customElements.define("impakt-affordability-calculator",Vt);customElements.define("impakt-contact-block",et);import{css as Ia,html as F,nothing as le,unsafeCSS as Zi}from"./atomic-ui.js";import{ImpaktElement as ea,pageLocale as ta,say as D,focusRing as Ha,targetSize as ia,visuallyHidden as aa,fontSize as vi,fontWeight as Ie,space as T,spaceAround as Ra,t as y,type as He,toneOf as Qt}from"./atomic-ui.js";var Jt=n=>n.reduce((t,e)=>t+e,0),ra=(n,t)=>n.find(e=>typeof e.below=="number"&&t<e.below)??n.at(-1);function Kt(n,t,e){let i=n.flatMap(l=>(t[l.id]??[]).flatMap(x=>l.choices.filter(v=>v.id===x))),a=Jt(i.map(l=>l.cost??0)),r=Jt(i.map(l=>l.weeks??0));for(let l of i)a*=l.costFactor??1,r*=l.weeksFactor??1;let o=(ra(e.teams,a)?.engineers??1)+Jt(i.map(l=>l.engineers??0));return{cost:a,low:Math.round(a*e.low),high:Math.round(a*e.high),weeks:Math.max(e.minWeeks,Math.round(r)),engineers:o,way:ra(e.ways,a)?.text??""}}function sa(n,t){let e=n.map(a=>typeof a.share=="number"?Math.max(1,Math.round(t*a.share)):0),i=Math.max(1,t-Jt(e));return n.map((a,r)=>typeof a.share=="number"?e[r]:i)}var Zt=class extends ea{constructor(){super();this.at=0;this.answers={};this.tip="";this.copied="";this.started=!1;this.questions=[],this.teams=[],this.ways=[],this.phases=[],this.low=.85,this.high=1.25,this.minWeeks=1,this.currency="GBP",this.unit=1,this.intro="",this.budgetLabel="Indicative budget",this.resultHeading="Your estimate",this.teamText="{n} engineers",this.teamTextOne="1 engineer",this.note="",this.contactHref="",this.sendLabel="Send this to us",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={questions:{type:Array},teams:{type:Array},ways:{type:Array},phases:{type:Array},low:{type:Number},high:{type:Number},minWeeks:{type:Number,attribute:"min-weeks"},currency:{type:String},unit:{type:Number},intro:{type:String},budgetLabel:{type:String,attribute:"budget-label"},resultHeading:{type:String,attribute:"result-heading"},teamText:{type:String,attribute:"team-text"},teamTextOne:{type:String,attribute:"team-text-one"},note:{type:String},contactHref:{type:String,attribute:"contact-href"},sendLabel:{type:String,attribute:"send-label"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...ea.styles,Ra,Ha,Ia`
|
|
653
865
|
:host { display: block; container-type: inline-size; }
|
|
654
866
|
[hidden] { display: none !important; }
|
|
655
|
-
.wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: ${
|
|
656
|
-
.mono { font-family: ${
|
|
657
|
-
.sr-only { ${
|
|
867
|
+
.wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: ${T(10)}; align-items: start; }
|
|
868
|
+
.mono { font-family: ${y.fontMono}; font-size: ${vi("xs")}; letter-spacing: 0.04em; text-transform: uppercase; color: ${y.textMuted}; margin: 0; }
|
|
869
|
+
.sr-only { ${aa} }
|
|
658
870
|
|
|
659
|
-
.progress { display: grid; gap: ${
|
|
871
|
+
.progress { display: grid; gap: ${T(2)}; margin-block-end: ${T(6)}; }
|
|
660
872
|
.bar { block-size: 4px; border-radius: 2px; background: color-mix(in srgb, currentColor 12%, transparent); overflow: hidden; }
|
|
661
|
-
.bar i { display: block; block-size: 100%; background: ${
|
|
873
|
+
.bar i { display: block; block-size: 100%; background: ${y.brand}; transition: inline-size 300ms ease; }
|
|
662
874
|
|
|
663
875
|
fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
|
|
664
|
-
legend { padding: 0; margin-block-end: ${
|
|
665
|
-
.q { margin: 0; font-family: ${
|
|
666
|
-
.hint { margin: 0 0 ${
|
|
876
|
+
legend { padding: 0; margin-block-end: ${T(2)}; }
|
|
877
|
+
.q { margin: 0; font-family: ${y.fontHeading}; font-weight: ${Ie("bold")}; ${He("3xl")} letter-spacing: ${y.trackingTight}; color: ${y.textHeading}; outline: none; }
|
|
878
|
+
.hint { margin: 0 0 ${T(6)}; color: ${y.textMuted}; }
|
|
667
879
|
|
|
668
|
-
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${
|
|
880
|
+
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${T(3)}; }
|
|
669
881
|
.choices.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
670
|
-
.choice { position: relative; display: grid; gap: ${
|
|
671
|
-
.choice:hover { border-color: ${
|
|
672
|
-
.choice input { ${
|
|
673
|
-
.choice:has(input:checked) { border-color: ${
|
|
674
|
-
.choice:has(input:focus-visible) { box-shadow: ${
|
|
675
|
-
.many .choice { padding: ${
|
|
676
|
-
.label { font-weight: ${
|
|
677
|
-
.small { ${
|
|
882
|
+
.choice { position: relative; display: grid; gap: ${T(1)}; align-content: start; padding: ${T(4)}; border: ${y.borderThin} solid ${y.border}; border-radius: ${y.radiusLg}; background: ${y.surfaceCard}; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
|
|
883
|
+
.choice:hover { border-color: ${y.borderStrong}; }
|
|
884
|
+
.choice input { ${aa} }
|
|
885
|
+
.choice:has(input:checked) { border-color: ${y.brand}; box-shadow: inset 0 0 0 1px ${y.brand}; background: ${y.brandSubtle}; }
|
|
886
|
+
.choice:has(input:focus-visible) { box-shadow: ${y.focusShadow}; }
|
|
887
|
+
.many .choice { padding: ${T(3)}; }
|
|
888
|
+
.label { font-weight: ${Ie("semibold")}; }
|
|
889
|
+
.small { ${He("sm")} color: ${y.textMuted}; }
|
|
678
890
|
/* A tick for a picked feature, drawn in the corner. */
|
|
679
|
-
.many .choice:has(input:checked)::after { content: '✓'; position: absolute; inset-block-start: ${
|
|
891
|
+
.many .choice:has(input:checked)::after { content: '✓'; position: absolute; inset-block-start: ${T(2)}; inset-inline-end: ${T(3)}; color: ${y.brand}; font-weight: ${Ie("bold")}; }
|
|
680
892
|
|
|
681
|
-
.scale { display: grid; gap: ${
|
|
682
|
-
.scale input { inline-size: 100%; accent-color: ${
|
|
683
|
-
.ticks { display: flex; justify-content: space-between; ${
|
|
684
|
-
.ticks span[aria-current] { color: ${
|
|
893
|
+
.scale { display: grid; gap: ${T(3)}; }
|
|
894
|
+
.scale input { inline-size: 100%; accent-color: ${y.brand}; ${ia} }
|
|
895
|
+
.ticks { display: flex; justify-content: space-between; ${He("sm")} color: ${y.textMuted}; }
|
|
896
|
+
.ticks span[aria-current] { color: ${y.text}; font-weight: ${Ie("semibold")}; }
|
|
685
897
|
.now { margin: 0; }
|
|
686
898
|
|
|
687
|
-
.nav { display: flex; gap: ${
|
|
688
|
-
button, .send { ${
|
|
689
|
-
.primary, .send { background: ${
|
|
690
|
-
.primary:hover, .send:hover { background: ${
|
|
691
|
-
.secondary { background: transparent; color: ${
|
|
692
|
-
.secondary:hover { background: ${
|
|
899
|
+
.nav { display: flex; gap: ${T(3)}; margin-block-start: ${T(8)}; }
|
|
900
|
+
button, .send { ${ia} display: inline-flex; align-items: center; justify-content: center; gap: ${T(2)}; padding: ${T(2.5)} ${T(5)}; border-radius: ${y.radiusLg}; font: inherit; font-weight: ${Ie("semibold")}; cursor: pointer; text-decoration: none; border: ${y.borderThin} solid transparent; }
|
|
901
|
+
.primary, .send { background: ${y.brand}; color: ${y.onBrand}; }
|
|
902
|
+
.primary:hover, .send:hover { background: ${y.brandHover}; }
|
|
903
|
+
.secondary { background: transparent; color: ${y.text}; border-color: ${y.borderStrong}; }
|
|
904
|
+
.secondary:hover { background: ${y.surfaceSubtle}; }
|
|
693
905
|
|
|
694
|
-
.panel { position: sticky; inset-block-start: ${
|
|
906
|
+
.panel { position: sticky; inset-block-start: ${T(6)}; overflow: hidden; isolation: isolate; padding: ${T(8)}; border-radius: ${y.radiusXl}; background: ${y.surfaceCard}; box-shadow: ${y.shadowMd}; display: grid; gap: ${T(2)}; }
|
|
695
907
|
/* The glow behind the budget grows as the product does. */
|
|
696
|
-
.glow { position: absolute; z-index: -1; inset-block-start: -40%; inset-inline-end: -30%; inline-size: 120%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, ${
|
|
697
|
-
.range { margin: 0; font-family: ${
|
|
698
|
-
.weeks { margin: 0; ${
|
|
699
|
-
.tip { margin: ${
|
|
908
|
+
.glow { position: absolute; z-index: -1; inset-block-start: -40%; inset-inline-end: -30%; inline-size: 120%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, ${Zi(Qt(1,0))} 45%, transparent), color-mix(in srgb, ${Zi(Qt(2,1))} 25%, transparent) 45%, transparent 70%); transform: scale(var(--s, 0.7)); transform-origin: 70% 30%; transition: transform 500ms cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
|
|
909
|
+
.range { margin: 0; font-family: ${y.fontHeading}; font-weight: ${Ie("bold")}; font-size: ${vi("5xl")}; line-height: 1; letter-spacing: ${y.trackingTight}; color: ${y.textHeading}; }
|
|
910
|
+
.weeks { margin: 0; ${He("lg")} }
|
|
911
|
+
.tip { margin: ${T(4)} 0 0; padding-block-start: ${T(4)}; border-block-start: 1px solid color-mix(in srgb, currentColor 15%, transparent); color: ${y.textMuted}; }
|
|
700
912
|
|
|
701
|
-
.result { display: grid; gap: ${
|
|
702
|
-
.summary { margin: 0; ${
|
|
913
|
+
.result { display: grid; gap: ${T(6)}; }
|
|
914
|
+
.summary { margin: 0; ${He("xl")} text-wrap: pretty; }
|
|
703
915
|
.phases { display: flex; gap: 3px; block-size: 14px; border-radius: 7px; overflow: hidden; }
|
|
704
916
|
.phases i { display: block; }
|
|
705
|
-
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: ${
|
|
706
|
-
.legend li { display: inline-flex; align-items: center; gap: ${
|
|
917
|
+
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: ${T(2)} ${T(5)}; }
|
|
918
|
+
.legend li { display: inline-flex; align-items: center; gap: ${T(2)}; }
|
|
707
919
|
.legend li::before { content: ''; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--c); }
|
|
708
|
-
dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${
|
|
709
|
-
dt { margin: 0 0 ${
|
|
710
|
-
dd { margin: 0; font-weight: ${
|
|
711
|
-
.actions { display: flex; flex-wrap: wrap; gap: ${
|
|
712
|
-
.note { margin: 0; ${
|
|
713
|
-
.status { margin: 0; ${
|
|
920
|
+
dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${T(4)}; }
|
|
921
|
+
dt { margin: 0 0 ${T(1)}; }
|
|
922
|
+
dd { margin: 0; font-weight: ${Ie("semibold")}; }
|
|
923
|
+
.actions { display: flex; flex-wrap: wrap; gap: ${T(3)}; }
|
|
924
|
+
.note { margin: 0; ${He("sm")} color: ${y.textMuted}; }
|
|
925
|
+
.status { margin: 0; ${He("sm")} }
|
|
714
926
|
|
|
715
927
|
@container (max-width: 48rem) {
|
|
716
|
-
.wrap { grid-template-columns: minmax(0, 1fr); gap: ${
|
|
928
|
+
.wrap { grid-template-columns: minmax(0, 1fr); gap: ${T(8)}; }
|
|
717
929
|
/* Not sticky once the panel is under the questions, but still the glow's containing block, so the panel clips it
|
|
718
930
|
and it never widens the page (1.4.10). */
|
|
719
931
|
.panel { position: relative; inset-block-start: auto; }
|
|
@@ -721,141 +933,145 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
721
933
|
}
|
|
722
934
|
@container (max-width: 30rem) {
|
|
723
935
|
.choices { grid-template-columns: minmax(0, 1fr); }
|
|
724
|
-
.range { font-size: ${
|
|
936
|
+
.range { font-size: ${vi("4xl")}; }
|
|
725
937
|
}
|
|
726
938
|
@media (forced-colors: active) {
|
|
727
939
|
.choice:has(input:checked) { outline: 3px solid Highlight; }
|
|
728
940
|
.bar i, .phases i, .legend li::before { background: CanvasText !important; }
|
|
729
941
|
.glow { display: none; }
|
|
730
942
|
}
|
|
731
|
-
`]}reset(){this.answers=Object.fromEntries((this.questions??[]).map(e=>{let i=(e.start??[]).filter(a=>e.choices.some(
|
|
943
|
+
`]}reset(){this.answers=Object.fromEntries((this.questions??[]).map(e=>{let i=(e.start??[]).filter(a=>e.choices.some(r=>r.id===a));return e.kind==="many"?[e.id,i]:[e.id,[i[0]??e.choices[0]?.id].filter(a=>!!a)]})),this.at=0,this.tip="",this.copied=""}willUpdate(e){(e.has("questions")||!this.started)&&(this.reset(),this.started=!0)}get rules(){return{low:this.low,high:this.high,minWeeks:this.minWeeks,teams:this.teams??[],ways:this.ways??[]}}money(e){try{return new Intl.NumberFormat(ta(this),{style:"currency",currency:this.currency||"GBP",notation:"compact",maximumFractionDigits:0}).format(e*(this.unit||1))}catch{return String(e*(this.unit||1))}}listOf(e){try{return new Intl.ListFormat(ta(this),{type:"conjunction"}).format(e)}catch{return e.join(", ")}}weeksWord(e){return e===1?D("{n} week",{n:e}):D("{n} weeks",{n:e})}get most(){let e=this.questions??[],i=Object.fromEntries(e.map(a=>{if(a.kind==="many")return[a.id,a.choices.map(o=>o.id)];let r=[...a.choices].sort((o,l)=>(l.cost??0)*(l.costFactor??1)-(o.cost??0)*(o.costFactor??1))[0];return[a.id,r?[r.id]:[]]}));return Kt(e,i,this.rules).high||1}summaryOf(e){let i=this.questions??[],a=i.find(g=>g.kind==="one"),r=a?a.choices.find(g=>g.id===this.answers[a.id]?.[0]):void 0,o=i.filter(g=>g.kind==="many"&&g.inSummary!==!1).flatMap(g=>(this.answers[g.id]??[]).map(Se=>{let $e=g.choices.find(nt=>nt.id===Se);return $e?$e.phrase||$e.label:Se})),l=r?r.phrase||r.label:"",x=l?o.length?D("You are building {thing} with {list}.",{thing:l,list:this.listOf(o)}):D("You are building {thing}.",{thing:l}):"",v=D("Expect {range} and about {weeks} to a first release.",{range:this.rangeOf(e),weeks:this.weeksWord(e.weeks)});return x?`${x} ${v}`:v}rangeOf(e){return D("{low} to {high}",{low:this.money(e.low),high:this.money(e.high)})}teamOf(e){return e===1?this.teamTextOne:this.teamText.replace("{n}",String(e))}pick(e,i,a){let r=this.answers[e.id]??[];this.answers={...this.answers,[e.id]:e.kind==="many"?a?[...r.filter(o=>o!==i.id),i.id]:r.filter(o=>o!==i.id):[i.id]},a&&i.tip&&(this.tip=i.tip),this.requestUpdate()}go(e){let i=(this.questions??[]).length;this.at=Math.max(0,Math.min(i,e)),this.copied="",this.requestUpdate(),this.updateComplete.then(()=>this.renderRoot.querySelector(".current .q")?.focus({preventScroll:!0}))}result(){let e=Kt(this.questions??[],this.answers,this.rules);return{low:e.low*(this.unit||1),high:e.high*(this.unit||1),weeks:e.weeks,engineers:e.engineers,way:e.way,summary:this.textOf(e),answers:this.answers}}textOf(e){let i=[this.summaryOf(e),`${this.teamOf(e.engineers)}.`];e.way&&i.push(`${e.way}.`);let a=(this.questions??[]).filter(o=>o.short&&o.kind!=="many").map(o=>{let l=o.choices.find(x=>x.id===this.answers[o.id]?.[0]);return l?`${o.short}: ${l.label}.`:""}).filter(Boolean),r=(this.questions??[]).filter(o=>o.short&&o.kind==="many"&&o.inSummary===!1).map(o=>{let l=(this.answers[o.id]??[]).map(x=>o.choices.find(v=>v.id===x)?.label??x);return l.length?`${o.short}: ${this.listOf(l)}.`:""}).filter(Boolean);return[...i,...r,...a].join(" ")}send(e){let i=this.result();try{sessionStorage.setItem("impakt.estimate",i.summary)}catch{}this.dispatchEvent(new CustomEvent("impakt-estimate",{detail:i,bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault()}async copy(){let e=this.result().summary;try{await navigator.clipboard.writeText(e),this.copied=D("Summary copied.")}catch{this.copied=D("Copying is blocked here. Select the summary above instead.")}this.requestUpdate()}heading(e){let i=Math.min(Math.max(this.headingLevel||2,2),6);return F`<div class="q" role="heading" aria-level=${i} tabindex="-1">${e}</div>`}renderQuestion(e,i){let a=this.answers[e.id]??[],r=i===this.at;if(e.kind==="scale"){let l=Math.max(0,e.choices.findIndex(v=>v.id===a[0])),x=e.choices[l];return F`<fieldset class=${r?"current":""} ?hidden=${!r}>
|
|
732
944
|
<legend>${this.heading(e.heading)}</legend>
|
|
733
|
-
${e.hint?
|
|
945
|
+
${e.hint?F`<p class="hint">${e.hint}</p>`:le}
|
|
734
946
|
<div class="scale">
|
|
735
|
-
<input type="range" min="0" max=${Math.max(0,e.choices.length-1)} step="1" .value=${String(l)} aria-label=${e.heading} aria-valuetext=${
|
|
736
|
-
@input=${
|
|
737
|
-
<div class="ticks" aria-hidden="true">${e.choices.map((
|
|
738
|
-
${
|
|
947
|
+
<input type="range" min="0" max=${Math.max(0,e.choices.length-1)} step="1" .value=${String(l)} aria-label=${e.heading} aria-valuetext=${x?.label??""}
|
|
948
|
+
@input=${v=>{let g=e.choices[Number(v.target.value)];g&&this.pick(e,g,!0)}}>
|
|
949
|
+
<div class="ticks" aria-hidden="true">${e.choices.map((v,g)=>F`<span aria-current=${g===l?"true":le}>${v.label}</span>`)}</div>
|
|
950
|
+
${x?.hint?F`<p class="now">${x.hint}</p>`:le}
|
|
739
951
|
</div>
|
|
740
|
-
</fieldset>`}let
|
|
952
|
+
</fieldset>`}let o=e.kind==="many";return F`<fieldset class=${r?"current":""} ?hidden=${!r}>
|
|
741
953
|
<legend>${this.heading(e.heading)}</legend>
|
|
742
|
-
${e.hint?
|
|
743
|
-
<div class="choices ${
|
|
744
|
-
${e.choices.map(l=>
|
|
745
|
-
<input type=${
|
|
746
|
-
@change=${
|
|
954
|
+
${e.hint?F`<p class="hint">${e.hint}</p>`:le}
|
|
955
|
+
<div class="choices ${o?"many":""}">
|
|
956
|
+
${e.choices.map(l=>F`<label class="choice">
|
|
957
|
+
<input type=${o?"checkbox":"radio"} name=${`${this.uid}-${e.id}`} value=${l.id} .checked=${a.includes(l.id)}
|
|
958
|
+
@change=${x=>this.pick(e,l,x.target.checked)}>
|
|
747
959
|
<span class="label">${l.label}</span>
|
|
748
|
-
${l.hint?
|
|
960
|
+
${l.hint?F`<span class="small">${l.hint}</span>`:le}
|
|
749
961
|
</label>`)}
|
|
750
962
|
</div>
|
|
751
|
-
</fieldset>`}renderResult(e){let i=
|
|
963
|
+
</fieldset>`}renderResult(e){let i=sa(this.phases??[],e.weeks),a=this.at===(this.questions??[]).length;return F`<div class="result ${a?"current":""}" ?hidden=${!a}>
|
|
752
964
|
${this.heading(this.resultHeading)}
|
|
753
965
|
<p class="summary">${this.summaryOf(e)}</p>
|
|
754
|
-
${(this.phases??[]).length?
|
|
755
|
-
<div class="phases" aria-hidden="true">${(this.phases??[]).map((
|
|
756
|
-
<ul class="legend">${(this.phases??[]).map((
|
|
966
|
+
${(this.phases??[]).length?F`
|
|
967
|
+
<div class="phases" aria-hidden="true">${(this.phases??[]).map((r,o)=>F`<i style=${`flex-grow:${i[o]};background:${Qt(void 0,o)}`}></i>`)}</div>
|
|
968
|
+
<ul class="legend">${(this.phases??[]).map((r,o)=>F`<li style=${`--c:${Qt(void 0,o)}`}>${r.label} <b>${this.weeksWord(i[o])}</b></li>`)}</ul>`:le}
|
|
757
969
|
<dl>
|
|
758
|
-
<div><dt class="mono">${
|
|
759
|
-
${e.way?
|
|
970
|
+
<div><dt class="mono">${D("Your team")}</dt><dd>${this.teamOf(e.engineers)}</dd></div>
|
|
971
|
+
${e.way?F`<div><dt class="mono">${D("Way of working")}</dt><dd>${e.way}</dd></div>`:le}
|
|
760
972
|
</dl>
|
|
761
973
|
<div class="actions">
|
|
762
|
-
${this.contactHref?
|
|
763
|
-
<button type="button" class="secondary" @click=${()=>this.copy()}>${
|
|
764
|
-
<button type="button" class="secondary" @click=${()=>{this.reset(),this.go(0)}}>${
|
|
974
|
+
${this.contactHref?F`<a class="send" href=${this.contactHref} @click=${r=>this.send(r)}>${this.sendLabel} <span aria-hidden="true">→</span></a>`:le}
|
|
975
|
+
<button type="button" class="secondary" @click=${()=>this.copy()}>${D("Copy summary")}</button>
|
|
976
|
+
<button type="button" class="secondary" @click=${()=>{this.reset(),this.go(0)}}>${D("Start again")}</button>
|
|
765
977
|
</div>
|
|
766
978
|
<p class="status" role="status">${this.copied}</p>
|
|
767
|
-
${this.note?
|
|
768
|
-
</div>`}render(){let e=this.questions??[],i=e.length,a=
|
|
979
|
+
${this.note?F`<p class="note">${this.note}</p>`:le}
|
|
980
|
+
</div>`}render(){let e=this.questions??[],i=e.length,a=Kt(e,this.answers,this.rules),r=this.at>=i,o=(.6+Math.min(1,a.high/this.most)*1.1).toFixed(2);return F`<div class="wrap">
|
|
769
981
|
<div>
|
|
770
982
|
<div class="progress">
|
|
771
|
-
<p class="mono">${
|
|
772
|
-
<div class="bar" aria-hidden="true"><i style=${`inline-size:${i?
|
|
983
|
+
<p class="mono">${r?this.resultHeading:D("Step {step} of {steps}",{step:this.at+1,steps:i})}</p>
|
|
984
|
+
<div class="bar" aria-hidden="true"><i style=${`inline-size:${i?r?100:(this.at+1)/(i+1)*100:0}%`}></i></div>
|
|
773
985
|
</div>
|
|
774
|
-
${e.map((l,
|
|
986
|
+
${e.map((l,x)=>this.renderQuestion(l,x))}
|
|
775
987
|
${this.renderResult(a)}
|
|
776
|
-
${
|
|
777
|
-
${this.at>0?
|
|
778
|
-
<button type="button" class="primary" @click=${()=>this.go(this.at+1)}>${this.at===i-1?
|
|
988
|
+
${r?le:F`<div class="nav">
|
|
989
|
+
${this.at>0?F`<button type="button" class="secondary" @click=${()=>this.go(this.at-1)}>${D("Back")}</button>`:le}
|
|
990
|
+
<button type="button" class="primary" @click=${()=>this.go(this.at+1)}>${this.at===i-1?D("See my estimate"):D("Next")} <span aria-hidden="true">→</span></button>
|
|
779
991
|
</div>`}
|
|
780
992
|
</div>
|
|
781
|
-
<aside class="panel" part="panel" style=${`--s:${
|
|
993
|
+
<aside class="panel" part="panel" style=${`--s:${o}`}>
|
|
782
994
|
<div class="glow" aria-hidden="true"></div>
|
|
783
995
|
<p class="mono">${this.budgetLabel}</p>
|
|
784
996
|
<p class="range" aria-live="polite" aria-atomic="true">${this.rangeOf(a)}</p>
|
|
785
|
-
<p class="weeks">${
|
|
997
|
+
<p class="weeks">${D("About {weeks} to a first release",{weeks:this.weeksWord(a.weeks)})}</p>
|
|
786
998
|
<p class="tip" aria-live="polite">${this.tip||this.intro}</p>
|
|
787
999
|
</aside>
|
|
788
|
-
</div>`}};customElements.define("impakt-estimator",
|
|
1000
|
+
</div>`}};customElements.define("impakt-estimator",Zt);import{css as wi,html as L,nothing as te}from"./atomic-ui.js";import{ImpaktElement as _e,focusRing as Si,hideOn as Pa,fontSize as We,fontWeight as Fe,space as N,t as ne,type as at,toneOf as ki}from"./atomic-ui.js";var Na=[0,1,2,3,4],qe=ne.fontMono,ei=class extends _e{static{this.properties={brand:{type:String},logoSrc:{type:String,attribute:"logo-src"},logoAlt:{type:String,attribute:"logo-alt"},home:{type:String},badge:{type:String},meta:{type:String},links:{type:Array},label:{type:String},menuText:{type:String,attribute:"menu-text"},status:{type:String},statusMeta:{type:String,attribute:"status-meta"},statusTone:{type:String,attribute:"status-tone"},actionText:{type:String,attribute:"action-text"},actionHref:{type:String,attribute:"action-href"}}}constructor(){super(),this.brand="",this.logoSrc="",this.logoAlt="",this.home="/",this.badge="",this.meta="",this.links=[],this.label="Main",this.menuText="Menu",this.status="",this.statusMeta="",this.statusTone="success",this.actionText="",this.actionHref=""}static{this.styles=[..._e.styles,Si,wi`
|
|
789
1001
|
:host { display: block; container-type: inline-size; }
|
|
790
|
-
.bar { display: flex; align-items: center; gap: ${
|
|
791
|
-
.start { display: flex; align-items: center; gap: ${
|
|
1002
|
+
.bar { display: flex; align-items: center; gap: ${N(6)}; }
|
|
1003
|
+
.start { display: flex; align-items: center; gap: ${N(3)}; flex: none; }
|
|
792
1004
|
.middle { flex: 1 1 8rem; min-inline-size: 0; display: flex; align-items: center; justify-content: center; }
|
|
793
1005
|
.middle ::slotted(*) { flex: 1 1 auto; min-inline-size: 0; }
|
|
794
1006
|
slot { display: contents; }
|
|
795
|
-
.brand { display: inline-flex; align-items: center; min-block-size: ${
|
|
1007
|
+
.brand { display: inline-flex; align-items: center; min-block-size: ${ne.targetMin}; color: inherit; text-decoration: none; font-family: ${ne.fontHeading}; font-weight: ${Fe("semibold")}; ${at("2xl")} letter-spacing: -0.02em; line-height: 1; border-radius: ${ne.radiusSm}; }
|
|
796
1008
|
.brand img { display: block; block-size: 32px; inline-size: auto; }
|
|
797
|
-
.chip { display: inline-flex; align-items: center; gap: ${
|
|
1009
|
+
.chip { display: inline-flex; align-items: center; gap: ${N(1)}; padding: 2px ${N(2)}; border-radius: ${ne.radius}; background: color-mix(in srgb, currentColor 7%, transparent); font-family: ${qe}; font-size: ${We("xs")}; }
|
|
798
1010
|
.chip svg { inline-size: 12px; block-size: 12px; }
|
|
799
|
-
.meta { font-family: ${
|
|
1011
|
+
.meta { font-family: ${qe}; font-size: ${We("xs")}; opacity: 0.72; }
|
|
800
1012
|
.middle impakt-nav { flex: 1 1 8rem; }
|
|
801
|
-
.end { display: flex; align-items: center; gap: ${
|
|
1013
|
+
.end { display: flex; align-items: center; gap: ${N(3)}; flex: none; }
|
|
802
1014
|
.end:empty, .start:empty { display: none; }
|
|
803
|
-
.status { display: inline-flex; align-items: center; gap: ${
|
|
1015
|
+
.status { display: inline-flex; align-items: center; gap: ${N(2)}; padding: ${N(1)} ${N(3)}; border: ${ne.borderThin} solid ${ne.border}; border-radius: 999px; background: ${ne.surfaceCard}; font-family: ${qe}; font-size: ${We("xs")}; white-space: nowrap; }
|
|
804
1016
|
.status .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }
|
|
805
1017
|
.status .hash { opacity: 0.72; }
|
|
806
|
-
@container (max-width: 56rem) { .chip, .meta, .status { display: none; } .bar { gap: ${
|
|
807
|
-
`]}act(){this.dispatchEvent(new CustomEvent("impakt-action",{bubbles:!0,composed:!0}))}render(){let t=this.logoSrc?
|
|
1018
|
+
@container (max-width: 56rem) { .chip, .meta, .status { display: none; } .bar { gap: ${N(3)}; } }
|
|
1019
|
+
`]}act(){this.dispatchEvent(new CustomEvent("impakt-action",{bubbles:!0,composed:!0}))}render(){let t=this.logoSrc?L`<img src=${this.logoSrc} alt=${this.logoAlt||this.brand} />`:L`${this.brand}`;return L`<div class="bar" part="bar">
|
|
808
1020
|
<div class="start"><slot name="start">
|
|
809
|
-
${this.brand||this.logoSrc?
|
|
810
|
-
${this.badge?
|
|
811
|
-
${this.meta?
|
|
1021
|
+
${this.brand||this.logoSrc?L`<a class="brand" href=${this.home||"/"} part="brand">${t}</a>`:te}
|
|
1022
|
+
${this.badge?L`<span class="chip" part="badge"><svg viewBox="0 0 14 14" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="3.5" cy="3" r="1.5"/><circle cx="3.5" cy="11" r="1.5"/><circle cx="10.5" cy="4.5" r="1.5"/><path d="M3.5 4.5v5M10.5 6c0 2.5-3 2.5-6 4"/></svg>${this.badge}</span>`:te}
|
|
1023
|
+
${this.meta?L`<span class="meta" part="meta">${this.meta}</span>`:te}
|
|
812
1024
|
</slot></div>
|
|
813
|
-
<div class="middle"><slot name="middle">${(this.links??[]).length?
|
|
1025
|
+
<div class="middle"><slot name="middle">${(this.links??[]).length?L`<impakt-nav align="center" size="sm" .links=${this.links} .label=${this.label} .menuText=${this.menuText}></impakt-nav>`:te}</slot></div>
|
|
814
1026
|
<div class="end"><slot name="end">
|
|
815
|
-
${this.status?
|
|
816
|
-
${this.actionText?
|
|
1027
|
+
${this.status?L`<span class="status" part="status" style=${`--tone:${ki(this.statusTone,0)}`}><span class="dot" aria-hidden="true"></span>${this.status}${this.statusMeta?L` <span class="hash">${this.statusMeta}</span>`:te}</span>`:te}
|
|
1028
|
+
${this.actionText?L`<impakt-button variant="primary" icon-after="arrow-right" href=${this.actionHref||te} @click=${this.act}>${this.actionText}</impakt-button>`:te}
|
|
817
1029
|
</slot></div>
|
|
818
|
-
</div>`}},
|
|
1030
|
+
</div>`}},ti=class extends _e{static{this.properties={text:{type:String},src:{type:String},alt:{type:String},href:{type:String},size:{type:String,reflect:!0},hideOn:{type:String,reflect:!0,attribute:"hide-on"}}}constructor(){super(),this.text="",this.src="",this.alt="",this.href="/",this.size="md",this.hideOn="never"}static{this.styles=[..._e.styles,Si,Pa,wi`
|
|
819
1031
|
:host { display: inline-flex; align-items: center; flex: none; }
|
|
820
|
-
a { color: inherit; text-decoration: none; font-family: ${
|
|
821
|
-
:host([size='sm']) a { ${
|
|
1032
|
+
a { color: inherit; text-decoration: none; font-family: ${ne.fontHeading}; font-weight: ${Fe("semibold")}; letter-spacing: -0.02em; line-height: 1; border-radius: ${ne.radiusSm}; }
|
|
1033
|
+
:host([size='sm']) a { ${at("xl")} } :host([size='md']) a { ${at("2xl")} } :host([size='lg']) a { ${at("3xl")} }
|
|
822
1034
|
img { display: block; block-size: 32px; inline-size: auto; }
|
|
823
|
-
@media (max-width: 40rem) { :host([size='md']) a, :host([size='lg']) a { ${
|
|
824
|
-
`]}render(){return
|
|
1035
|
+
@media (max-width: 40rem) { :host([size='md']) a, :host([size='lg']) a { ${at("xl")} } }
|
|
1036
|
+
`]}render(){return L`<a href=${this.href||"/"} part="link">${this.src?L`<img src=${this.src} alt=${this.alt||this.text||this.textContent?.trim()||""} />`:L`<slot>${this.text}</slot>`}</a>`}},ii=class extends _e{static{this.properties={brand:{type:String},brandSize:{type:String,reflect:!0,attribute:"brand-size"},log:{type:Array},columns:{type:Array},columnsOnPhone:{type:String,attribute:"columns-on-phone",reflect:!0},legal:{type:String},stripe:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}}}constructor(){super(),this.brand="",this.brandSize="lg",this.log=[],this.columns=[],this.columnsOnPhone="shown",this.legal="",this.stripe=!1,this.headingLevel=2}static{this.styles=[..._e.styles,Si,wi`
|
|
825
1037
|
/* The page frame's footer band gives the colours; this sits flush with its foot so the stripe meets the edge. */
|
|
826
|
-
:host { display: block; container-type: inline-size; position: relative; padding-block: ${
|
|
827
|
-
.top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: ${
|
|
828
|
-
.brand { margin: 0; font-family: ${
|
|
1038
|
+
:host { display: block; container-type: inline-size; position: relative; padding-block: ${N(8)} ${N(4)}; margin-block-end: calc(-1 * ${N(8)}); }
|
|
1039
|
+
.top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: ${N(10)}; }
|
|
1040
|
+
.brand { margin: 0; font-family: ${ne.fontHeading}; font-weight: ${Fe("bold")}; font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -0.03em; }
|
|
1041
|
+
/* The name as a wordmark across the whole footer, under the columns. */
|
|
1042
|
+
:host([brand-size='display']) .top { grid-template-columns: 1fr; }
|
|
1043
|
+
:host([brand-size='display']) .top > div:first-child { order: 2; }
|
|
1044
|
+
:host([brand-size='display']) .brand { font-weight: ${Fe("semibold")}; font-size: clamp(3rem, 27cqi, 24rem); line-height: 0.9; letter-spacing: -0.06em; overflow-wrap: anywhere; }
|
|
829
1045
|
ul { list-style: none; margin: 0; padding: 0; }
|
|
830
|
-
.log { margin-block-start: ${
|
|
831
|
-
.log li { display: flex; align-items: center; gap: ${
|
|
1046
|
+
.log { margin-block-start: ${N(8)}; display: grid; gap: ${N(3)}; font-family: ${qe}; font-size: ${We("sm")}; }
|
|
1047
|
+
.log li { display: flex; align-items: center; gap: ${N(3)}; opacity: 0.72; }
|
|
832
1048
|
.log li:first-child { opacity: 1; }
|
|
833
1049
|
.log .dot { flex: none; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--tone); }
|
|
834
|
-
.log .code { margin-inline-end: ${
|
|
835
|
-
.columns { display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: ${
|
|
836
|
-
.h { margin: 0 0 ${
|
|
837
|
-
.columns ul { display: grid; gap: ${
|
|
838
|
-
a { color: inherit; text-decoration: none; font-weight: ${
|
|
1050
|
+
.log .code { margin-inline-end: ${N(3)}; }
|
|
1051
|
+
.columns { display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: ${N(8)}; }
|
|
1052
|
+
.h { margin: 0 0 ${N(4)}; font-family: ${qe}; font-size: ${We("xs")}; font-weight: ${Fe("medium")}; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.72; }
|
|
1053
|
+
.columns ul { display: grid; gap: ${N(3)}; }
|
|
1054
|
+
a { color: inherit; text-decoration: none; font-weight: ${Fe("medium")}; border-radius: ${ne.radiusSm}; }
|
|
839
1055
|
a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
|
|
840
|
-
.legal { margin: ${
|
|
1056
|
+
.legal { margin: ${N(16)} 0 0; font-family: ${qe}; font-size: ${We("xs")}; opacity: 0.72; }
|
|
841
1057
|
.stripe { position: absolute; inset-inline: -100vmax; inset-block-end: 0; block-size: 6px; display: flex; }
|
|
842
1058
|
.stripe span { flex: 1; }
|
|
843
1059
|
@container (max-width: 48rem) { .top { grid-template-columns: 1fr; } .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
844
1060
|
@container (max-width: 40rem) { :host([columns-on-phone='hidden']) .columns { display: none; } }
|
|
845
1061
|
@media (forced-colors: active) { :host { border-block-start: 1px solid CanvasText; } .log .dot { border: 1px solid CanvasText; } }
|
|
846
|
-
`]}heading(t){let e=Math.min(Math.max(this.headingLevel||2,2),4);return e===3?
|
|
1062
|
+
`]}heading(t){let e=Math.min(Math.max(this.headingLevel||2,2),4);return e===3?L`<h3 class="h">${t}</h3>`:e===4?L`<h4 class="h">${t}</h4>`:L`<h2 class="h">${t}</h2>`}render(){let t=this.log??[];return L`<div part="footer">
|
|
847
1063
|
<div class="top">
|
|
848
1064
|
<div>
|
|
849
|
-
${this.brand?
|
|
850
|
-
${t.length?
|
|
1065
|
+
${this.brand?L`<p class="brand" part="brand">${this.brand}</p>`:te}
|
|
1066
|
+
${t.length?L`<ul class="log" part="log">${t.map((e,i)=>L`<li style=${`--tone:${ki(e.tone??(i===0?"success":"accent"),i)}`}><span class="dot" aria-hidden="true"></span><span>${e.meta?L`<span class="code">${e.meta}</span>`:te}${e.text}</span></li>`)}</ul>`:te}
|
|
851
1067
|
</div>
|
|
852
1068
|
<div class="columns" part="columns" style=${`--count:${Math.max(1,(this.columns??[]).length)}`}>
|
|
853
|
-
${(this.columns??[]).map(e=>
|
|
1069
|
+
${(this.columns??[]).map(e=>L`<div>${this.heading(e.heading)}<ul>${(e.links??[]).map(i=>L`<li><a href=${i.href}>${i.label}</a></li>`)}</ul></div>`)}
|
|
854
1070
|
</div>
|
|
855
1071
|
</div>
|
|
856
|
-
${this.legal?
|
|
857
|
-
${this.stripe?
|
|
858
|
-
</div>`}};customElements.define("impakt-site-header",
|
|
1072
|
+
${this.legal?L`<p class="legal" part="legal">${this.legal}</p>`:te}
|
|
1073
|
+
${this.stripe?L`<div class="stripe" aria-hidden="true">${Na.map(e=>L`<span style=${`background:${ki(void 0,e)}`}></span>`)}</div>`:te}
|
|
1074
|
+
</div>`}};customElements.define("impakt-site-header",ei);customElements.define("impakt-wordmark",ti);customElements.define("impakt-site-footer",ii);import{html as De,css as ja,nothing as zi}from"./atomic-ui.js";import{say as na,ImpaktElement as oa,fontSize as Oa,fontWeight as Fa,space as we,t as Ti,token as ai}from"./atomic-ui.js";var ri=n=>Math.min(1,Math.max(0,n)),si=class extends oa{constructor(){super();this.paused=!1;this.frame=0;this.started=0;this.reduced=!1;this.seekFrom=0;this.seekTo=0;this.seekStart=0;this.seekMs=0;this.onScroll=()=>{(this.drive==="view"||this.drive==="page")&&this.schedule()};this.tick=e=>{if(this.frame=0,this.seekMs){this.seekStart||(this.seekStart=e);let i=Math.min(1,(e-this.seekStart)/this.seekMs),a=i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2;this.progress=this.seekFrom+(this.seekTo-this.seekFrom)*a,i<1?this.schedule():this.seekMs=0;return}if(this.drive==="view"){let i=this.getBoundingClientRect(),a=window.innerHeight||1;this.progress=ri(-i.top/Math.max(1,i.height-a))}else if(this.drive==="page"){let i=document.documentElement;this.progress=ri(window.scrollY/Math.max(1,i.scrollHeight-(window.innerHeight||0)))}else this.drive==="loop"&&!this.paused&&!this.reduced&&(this.started||(this.started=e-this.progress*this.duration*1e3),this.progress=(e-this.started)/(this.duration*1e3)%1,this.schedule())};this.togglePause=()=>this.setPaused(!this.paused);this.drive="view",this.layout="stage",this.length=3,this.duration=8,this.label="Animation",this.progress=0,this.controls="below",this.bleed=!1,this.hideOn="never"}static{this.properties={drive:{type:String,reflect:!0},layout:{type:String,reflect:!0},length:{type:Number},duration:{type:Number},label:{type:String},progress:{type:Number},controls:{type:String,reflect:!0},bleed:{type:Boolean,reflect:!0},hideOn:{type:String,reflect:!0,attribute:"hide-on"}}}static{this.styles=[...oa.styles,ja`
|
|
859
1075
|
:host {
|
|
860
1076
|
display: block;
|
|
861
1077
|
position: relative;
|
|
@@ -869,7 +1085,7 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
869
1085
|
}
|
|
870
1086
|
:host([layout='split']) .frame {
|
|
871
1087
|
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
872
|
-
gap: ${
|
|
1088
|
+
gap: ${we(8)};
|
|
873
1089
|
}
|
|
874
1090
|
.stage {
|
|
875
1091
|
position: sticky;
|
|
@@ -894,34 +1110,34 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
894
1110
|
}
|
|
895
1111
|
.controls {
|
|
896
1112
|
display: flex;
|
|
897
|
-
gap: ${
|
|
1113
|
+
gap: ${we(3)};
|
|
898
1114
|
align-items: center;
|
|
899
1115
|
justify-content: center;
|
|
900
|
-
padding-block: ${
|
|
1116
|
+
padding-block: ${we(3)};
|
|
901
1117
|
}
|
|
902
1118
|
:host([bleed]) { margin-inline: calc(50% - 50vw); }
|
|
903
1119
|
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }
|
|
904
1120
|
@media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none; } }
|
|
905
1121
|
/* Over the stage, the controls float at its foot, above the layers and clear of its edges. */
|
|
906
|
-
.stage > .controls { position: absolute; inset-inline: ${
|
|
1122
|
+
.stage > .controls { position: absolute; inset-inline: ${we(6)}; inset-block-end: ${we(6)}; z-index: 2; padding: 0; }
|
|
907
1123
|
.stage > .controls ::slotted(*) { box-shadow: 0 12px 32px rgb(16 19 23 / 14%); border-radius: 16px; background: var(--impakt-color-surface-card, #fff); }
|
|
908
1124
|
/* A control takes the row, so a graph scrubber spans the stage; a narrower one centres itself. */
|
|
909
1125
|
.controls ::slotted(*) { flex: 1 1 auto; min-width: 0; }
|
|
910
1126
|
.pause {
|
|
911
|
-
min-width: ${
|
|
912
|
-
min-height: ${
|
|
913
|
-
padding: ${
|
|
914
|
-
border-radius: ${
|
|
915
|
-
border: 1px solid ${
|
|
916
|
-
background: ${
|
|
917
|
-
color: ${
|
|
918
|
-
font-size: ${
|
|
919
|
-
font-weight: ${
|
|
1127
|
+
min-width: ${ai("target.min","24px")};
|
|
1128
|
+
min-height: ${ai("target.min","24px")};
|
|
1129
|
+
padding: ${we(2)} ${we(4)};
|
|
1130
|
+
border-radius: ${ai("radius.full","9999px")};
|
|
1131
|
+
border: 1px solid ${Ti.border};
|
|
1132
|
+
background: ${Ti.surfaceCard};
|
|
1133
|
+
color: ${Ti.text};
|
|
1134
|
+
font-size: ${Oa("sm")};
|
|
1135
|
+
font-weight: ${Fa("medium")};
|
|
920
1136
|
cursor: pointer;
|
|
921
1137
|
}
|
|
922
1138
|
.pause:focus-visible {
|
|
923
1139
|
outline: none;
|
|
924
|
-
box-shadow: ${
|
|
1140
|
+
box-shadow: ${ai("focus.ring.shadow","0 0 0 2px #fff, 0 0 0 4px #1a1a1a")};
|
|
925
1141
|
}
|
|
926
1142
|
@media (max-width: 48rem) {
|
|
927
1143
|
:host([layout='split']) .frame {
|
|
@@ -939,7 +1155,7 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
939
1155
|
.stage {
|
|
940
1156
|
position: relative;
|
|
941
1157
|
height: auto;
|
|
942
|
-
gap: ${
|
|
1158
|
+
gap: ${we(6)};
|
|
943
1159
|
}
|
|
944
1160
|
/* With less motion the layers are shown one after another, so every
|
|
945
1161
|
state the scene would have moved through can still be seen. */
|
|
@@ -947,17 +1163,17 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
947
1163
|
grid-area: auto;
|
|
948
1164
|
}
|
|
949
1165
|
}
|
|
950
|
-
`]}connectedCallback(){super.connectedCallback();try{this.reduced=window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{this.reduced=!1}window.addEventListener("scroll",this.onScroll,{passive:!0,capture:!0}),window.addEventListener("resize",this.onScroll),this.schedule()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("scroll",this.onScroll,{capture:!0}),window.removeEventListener("resize",this.onScroll),this.frame&&cancelAnimationFrame(this.frame),this.frame=0}updated(e){e.has("length")&&this.style.setProperty("--impakt-scene-length",String(this.length)),e.has("progress")&&this.publish(),e.has("drive")&&(this.started=0,this.schedule())}seek(e,i=0){if(i<=0||this.reduced){this.progress=
|
|
1166
|
+
`]}connectedCallback(){super.connectedCallback();try{this.reduced=window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{this.reduced=!1}window.addEventListener("scroll",this.onScroll,{passive:!0,capture:!0}),window.addEventListener("resize",this.onScroll),this.schedule()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("scroll",this.onScroll,{capture:!0}),window.removeEventListener("resize",this.onScroll),this.frame&&cancelAnimationFrame(this.frame),this.frame=0}updated(e){e.has("length")&&this.style.setProperty("--impakt-scene-length",String(this.length)),e.has("progress")&&this.publish(),e.has("drive")&&(this.started=0,this.schedule())}seek(e,i=0){if(i<=0||this.reduced){this.progress=ri(e);return}this.seekFrom=this.progress,this.seekTo=ri(e),this.seekStart=0,this.seekMs=i,this.schedule()}schedule(){!this.frame&&typeof requestAnimationFrame=="function"&&(this.frame=requestAnimationFrame(this.tick))}publish(){this.style.setProperty("--impakt-scene-progress",this.progress.toFixed(4)),this.dispatchEvent(new CustomEvent("impakt-scene-progress",{detail:{progress:this.progress},bubbles:!0,composed:!0}))}setPaused(e){this.paused!==e&&(this.paused=e,this.started=0,this.schedule(),this.requestUpdate())}pause(){this.setPaused(!0)}render(){let e=this.drive==="loop",i=this.controls==="over"&&!this.reduced,a=De`<div class="controls" part="controls">
|
|
951
1167
|
<slot name="controls"></slot>
|
|
952
|
-
${e&&!this.reduced?
|
|
953
|
-
${this.paused?
|
|
954
|
-
</button>`:
|
|
955
|
-
</div>`,
|
|
1168
|
+
${e&&!this.reduced?De`<button class="pause" type="button" aria-pressed=${this.paused?"true":"false"} @click=${this.togglePause}>
|
|
1169
|
+
${this.paused?na("Play {name}",{name:this.label}):na("Pause {name}",{name:this.label})}
|
|
1170
|
+
</button>`:zi}
|
|
1171
|
+
</div>`,r=De`<div class="stage" part="stage"><slot name="stage"></slot>${i?a:zi}</div>`;return De`
|
|
956
1172
|
<div class="frame" part="frame" role="region" aria-label=${this.label}>
|
|
957
|
-
${this.layout==="split"?
|
|
1173
|
+
${this.layout==="split"?De`<div class="content" part="content"><slot></slot></div>${r}`:De`${r}<div class="content" part="content"><slot></slot></div>`}
|
|
958
1174
|
</div>
|
|
959
|
-
${i?
|
|
960
|
-
`}};customElements.define("impakt-scene",
|
|
1175
|
+
${i?zi:a}
|
|
1176
|
+
`}};customElements.define("impakt-scene",si);import{html as ue,css as Wa}from"./atomic-ui.js";import{say as la,ImpaktElement as ca,visuallyHidden as qa,fontSize as Ai,fontWeight as da,space as ie,t as j,token as fe}from"./atomic-ui.js";var Mi={brand:"var(--impakt-color-brand-default, #1f4ed8)",accent:"var(--impakt-color-accent-default, #c8a15a)",info:"var(--impakt-color-status-info-default, #1f4ed8)",success:"var(--impakt-color-status-success-default, #047857)",warning:"var(--impakt-color-status-warning-default, #b45309)",danger:"var(--impakt-color-status-danger-default, #c8102e)"},ni=class extends ca{constructor(){super();this.scene=null;this.onProgress=e=>{this.value=e.detail.progress};this.onInput=e=>{let i=Number(e.target.value)/1e3;this.value=i,this.scene?.seek(i)};this.label="Scene progress",this.stops=[],this.look="buttons",this.hint="",this.value=0}static{this.properties={label:{type:String},stops:{type:Array},look:{type:String,reflect:!0},hint:{type:String},value:{type:Number,state:!0}}}static{this.styles=[...ca.styles,Wa`
|
|
961
1177
|
:host {
|
|
962
1178
|
display: block;
|
|
963
1179
|
width: 100%;
|
|
@@ -966,71 +1182,71 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
966
1182
|
}
|
|
967
1183
|
.wrap {
|
|
968
1184
|
display: grid;
|
|
969
|
-
gap: ${
|
|
970
|
-
padding: ${
|
|
971
|
-
border-radius: ${
|
|
972
|
-
background: ${
|
|
973
|
-
box-shadow: ${
|
|
974
|
-
border: 1px solid ${
|
|
1185
|
+
gap: ${ie(2)};
|
|
1186
|
+
padding: ${ie(3)} ${ie(4)};
|
|
1187
|
+
border-radius: ${fe("radius.xl","16px")};
|
|
1188
|
+
background: ${j.surfaceCard};
|
|
1189
|
+
box-shadow: ${fe("shadow.lg","0 10px 15px -3px rgba(0,0,0,.1)")};
|
|
1190
|
+
border: 1px solid ${j.border};
|
|
975
1191
|
}
|
|
976
1192
|
input {
|
|
977
1193
|
width: 100%;
|
|
978
|
-
min-height: ${
|
|
979
|
-
accent-color: ${
|
|
1194
|
+
min-height: ${fe("target.min","24px")};
|
|
1195
|
+
accent-color: ${j.brand};
|
|
980
1196
|
margin: 0;
|
|
981
1197
|
}
|
|
982
1198
|
.stops {
|
|
983
1199
|
position: relative;
|
|
984
1200
|
display: flex;
|
|
985
1201
|
flex-wrap: wrap;
|
|
986
|
-
gap: ${
|
|
1202
|
+
gap: ${ie(2)};
|
|
987
1203
|
list-style: none;
|
|
988
1204
|
margin: 0;
|
|
989
1205
|
padding: 0;
|
|
990
1206
|
}
|
|
991
1207
|
button {
|
|
992
|
-
min-height: ${
|
|
993
|
-
padding: ${
|
|
994
|
-
border-radius: ${
|
|
995
|
-
border: 1px solid ${
|
|
1208
|
+
min-height: ${fe("target.min","24px")};
|
|
1209
|
+
padding: ${ie(1)} ${ie(3)};
|
|
1210
|
+
border-radius: ${fe("radius.full","9999px")};
|
|
1211
|
+
border: 1px solid ${j.border};
|
|
996
1212
|
background: transparent;
|
|
997
|
-
color: ${
|
|
998
|
-
font-size: ${
|
|
999
|
-
font-weight: ${
|
|
1213
|
+
color: ${j.textMuted};
|
|
1214
|
+
font-size: ${Ai("xs")};
|
|
1215
|
+
font-weight: ${da("medium")};
|
|
1000
1216
|
cursor: pointer;
|
|
1001
1217
|
}
|
|
1002
1218
|
button[aria-current='true'] {
|
|
1003
|
-
color: ${
|
|
1004
|
-
border-color: ${
|
|
1219
|
+
color: ${j.text};
|
|
1220
|
+
border-color: ${j.text};
|
|
1005
1221
|
}
|
|
1006
1222
|
.sr-only {
|
|
1007
|
-
${
|
|
1223
|
+
${qa}
|
|
1008
1224
|
}
|
|
1009
1225
|
/* The graph look: the code of where you are, the line of stops, where you are. */
|
|
1010
1226
|
:host([look='graph']) { max-width: none; }
|
|
1011
|
-
.graph { display: grid; grid-template-columns: minmax(8rem, auto) minmax(0, 1fr) auto; gap: ${
|
|
1012
|
-
.mono { font-family: ${
|
|
1227
|
+
.graph { display: grid; grid-template-columns: minmax(8rem, auto) minmax(0, 1fr) auto; gap: ${ie(6)}; align-items: center; padding: ${ie(4)} ${ie(6)}; border-radius: ${fe("radius.xl","16px")}; background: ${j.surfaceCard}; box-shadow: ${fe("shadow.lg","0 10px 15px -3px rgba(0,0,0,.1)")}; border: 1px solid ${j.border}; }
|
|
1228
|
+
.mono { font-family: ${j.fontMono}; font-size: ${Ai("xs")}; letter-spacing: 0.04em; }
|
|
1013
1229
|
.head { display: grid; gap: 2px; }
|
|
1014
|
-
.head .k { color: ${
|
|
1015
|
-
.head .code { font-size: ${
|
|
1016
|
-
.head .note { color: ${
|
|
1230
|
+
.head .k { color: ${j.textMuted}; text-transform: uppercase; }
|
|
1231
|
+
.head .code { font-size: ${Ai("md")}; color: ${j.text}; }
|
|
1232
|
+
.head .note { color: ${j.textMuted}; }
|
|
1017
1233
|
.line { position: relative; block-size: 48px; }
|
|
1018
|
-
.track, .fill { position: absolute; inset-inline: 0; inset-block-start: 14px; block-size: 3px; border-radius: 3px; background: ${
|
|
1234
|
+
.track, .fill { position: absolute; inset-inline: 0; inset-block-start: 14px; block-size: 3px; border-radius: 3px; background: ${j.border}; opacity: 0.5; }
|
|
1019
1235
|
.fill { opacity: 1; background: none; display: flex; overflow: hidden; }
|
|
1020
1236
|
.fill span { block-size: 100%; }
|
|
1021
|
-
.dot { position: absolute; inset-block-start: 15px; inline-size: 14px; block-size: 14px; translate: -50% -50%; border-radius: 50%; border: 2px solid var(--c); background: ${
|
|
1237
|
+
.dot { position: absolute; inset-block-start: 15px; inline-size: 14px; block-size: 14px; translate: -50% -50%; border-radius: 50%; border: 2px solid var(--c); background: ${j.surfaceCard}; padding: 0; min-height: 0; cursor: pointer; }
|
|
1022
1238
|
.dot[data-passed] { background: var(--c); }
|
|
1023
1239
|
.dot[aria-current='true'] { inline-size: 24px; block-size: 24px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
|
|
1024
|
-
.dot-label { position: absolute; inset-block-start: 30px; translate: -50% 0; white-space: nowrap; color: ${
|
|
1025
|
-
.dot-label[data-current] { color: ${
|
|
1240
|
+
.dot-label { position: absolute; inset-block-start: 30px; translate: -50% 0; white-space: nowrap; color: ${j.textMuted}; text-transform: uppercase; pointer-events: none; }
|
|
1241
|
+
.dot-label[data-current] { color: ${j.text}; font-weight: ${da("bold")}; }
|
|
1026
1242
|
.line input { position: absolute; inset: 0 0 auto; block-size: 30px; opacity: 0; cursor: grab; }
|
|
1027
1243
|
.line input:focus-visible { opacity: 1; }
|
|
1028
|
-
.where { display: grid; gap: ${
|
|
1029
|
-
.chip { display: inline-flex; align-items: center; gap: ${
|
|
1244
|
+
.where { display: grid; gap: ${ie(2)}; justify-items: end; }
|
|
1245
|
+
.chip { display: inline-flex; align-items: center; gap: ${ie(2)}; padding: ${ie(1)} ${ie(3)}; border-radius: ${fe("radius.full","9999px")}; border: 1px solid ${j.border}; color: ${j.text}; text-transform: uppercase; }
|
|
1030
1246
|
.chip::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--c); }
|
|
1031
|
-
.hint { color: ${
|
|
1247
|
+
.hint { color: ${j.textMuted}; text-transform: uppercase; }
|
|
1032
1248
|
/* Muted by colour, not opacity, so the code keeps its contrast (1.4.3). */
|
|
1033
|
-
.chip .meta { color: ${
|
|
1249
|
+
.chip .meta { color: ${j.textMuted}; }
|
|
1034
1250
|
@media (max-width: 48rem) {
|
|
1035
1251
|
.graph { grid-template-columns: minmax(0, 1fr); }
|
|
1036
1252
|
.where { justify-items: start; }
|
|
@@ -1039,29 +1255,29 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
1039
1255
|
button:focus-visible,
|
|
1040
1256
|
input:focus-visible {
|
|
1041
1257
|
outline: none;
|
|
1042
|
-
box-shadow: ${
|
|
1258
|
+
box-shadow: ${fe("focus.ring.shadow","0 0 0 2px #fff, 0 0 0 4px #1a1a1a")};
|
|
1043
1259
|
}
|
|
1044
|
-
`]}connectedCallback(){super.connectedCallback(),this.scene=this.closest("impakt-scene"),this.scene?.addEventListener("impakt-scene-progress",this.onProgress),this.scene&&(this.value=this.scene.progress)}disconnectedCallback(){super.disconnectedCallback(),this.scene?.removeEventListener("impakt-scene-progress",this.onProgress),this.scene=null}goTo(e){this.scene?.seek(e.at,600)}nearest(){let e=-1,i=1/0;return this.stops.forEach((a,
|
|
1260
|
+
`]}connectedCallback(){super.connectedCallback(),this.scene=this.closest("impakt-scene"),this.scene?.addEventListener("impakt-scene-progress",this.onProgress),this.scene&&(this.value=this.scene.progress)}disconnectedCallback(){super.disconnectedCallback(),this.scene?.removeEventListener("impakt-scene-progress",this.onProgress),this.scene=null}goTo(e){this.scene?.seek(e.at,600)}nearest(){let e=-1,i=1/0;return this.stops.forEach((a,r)=>{let o=Math.abs(a.at-this.value);o<i&&(i=o,e=r)}),e}renderGraph(e,i){let a=e,r=[...this.stops??[]].sort((v,g)=>v.at-g.at);a=r.indexOf(this.stops[a]);let o=v=>{let g=v?.tone??"brand";return typeof g=="number"?`var(--impakt-color-chart-${g}, ${Mi.brand})`:Mi[g]??Mi.brand},l=r[a]??r[0],x=r.map((v,g)=>{let Se=g===0?0:r[g-1].at,$e=Math.min(v.at,this.value);return{width:Math.round(Math.max(0,$e-Se)*1e4)/100,c:o(v)}});return ue`<div class="graph" part="wrap">
|
|
1045
1261
|
<div class="head mono" aria-hidden="true">
|
|
1046
1262
|
<span class="k">HEAD</span>
|
|
1047
1263
|
<span class="code">${l?.meta??l?.label??""}</span>
|
|
1048
|
-
${l?.note?
|
|
1264
|
+
${l?.note?ue`<span class="note">${l.note}</span>`:null}
|
|
1049
1265
|
</div>
|
|
1050
1266
|
<div class="line">
|
|
1051
1267
|
<div class="track"></div>
|
|
1052
|
-
<div class="fill" aria-hidden="true">${
|
|
1053
|
-
${
|
|
1054
|
-
<button type="button" class="dot" style=${`left:${
|
|
1055
|
-
<span class="sr-only">${
|
|
1268
|
+
<div class="fill" aria-hidden="true">${x.map(v=>ue`<span style=${`width:${v.width}%;background:${v.c}`}></span>`)}</div>
|
|
1269
|
+
${r.map((v,g)=>ue`
|
|
1270
|
+
<button type="button" class="dot" style=${`left:${v.at*100}%;--c:${o(v)}`} ?data-passed=${v.at<=this.value+1e-4} aria-current=${g===a?"true":"false"} @click=${()=>this.goTo(v)}>
|
|
1271
|
+
<span class="sr-only">${la("Go to {name}",{name:v.label})}</span>
|
|
1056
1272
|
</button>
|
|
1057
|
-
<span class="dot-label mono" style=${`left:${
|
|
1273
|
+
<span class="dot-label mono" style=${`left:${v.at*100}%`} ?data-current=${g===a} aria-hidden="true">${v.label}</span>`)}
|
|
1058
1274
|
<input type="range" min="0" max="1000" step="1" .value=${String(Math.round(this.value*1e3))} aria-label=${this.label} aria-valuetext=${i} @input=${this.onInput} />
|
|
1059
1275
|
</div>
|
|
1060
1276
|
<div class="where" aria-hidden="true">
|
|
1061
|
-
${l?
|
|
1062
|
-
${this.hint?
|
|
1277
|
+
${l?ue`<span class="chip mono" style=${`--c:${o(l)}`}>${l.label}${l.meta?ue` <span class="meta">${l.meta}</span>`:null}</span>`:null}
|
|
1278
|
+
${this.hint?ue`<span class="hint mono">${this.hint}</span>`:null}
|
|
1063
1279
|
</div>
|
|
1064
|
-
</div>`}render(){let e=this.nearest(),i=e>=0?this.stops[e].label:`${Math.round(this.value*100)}%`;return this.look==="graph"?this.renderGraph(e,i):
|
|
1280
|
+
</div>`}render(){let e=this.nearest(),i=e>=0?this.stops[e].label:`${Math.round(this.value*100)}%`;return this.look==="graph"?this.renderGraph(e,i):ue`
|
|
1065
1281
|
<div class="wrap" part="wrap">
|
|
1066
1282
|
<input
|
|
1067
1283
|
type="range"
|
|
@@ -1073,73 +1289,73 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
1073
1289
|
aria-valuetext=${i}
|
|
1074
1290
|
@input=${this.onInput}
|
|
1075
1291
|
/>
|
|
1076
|
-
${this.stops.length?
|
|
1077
|
-
${this.stops.map((a,
|
|
1078
|
-
<button type="button" aria-current=${
|
|
1079
|
-
<span aria-hidden="true">${a.label}</span><span class="sr-only">${
|
|
1292
|
+
${this.stops.length?ue`<ul class="stops" part="stops">
|
|
1293
|
+
${this.stops.map((a,r)=>ue`<li>
|
|
1294
|
+
<button type="button" aria-current=${r===e?"true":"false"} @click=${()=>this.goTo(a)}>
|
|
1295
|
+
<span aria-hidden="true">${a.label}</span><span class="sr-only">${la("Go to {name}",{name:a.label})}</span>
|
|
1080
1296
|
</button>
|
|
1081
1297
|
</li>`)}
|
|
1082
1298
|
</ul>`:null}
|
|
1083
1299
|
</div>
|
|
1084
|
-
`}};customElements.define("impakt-scrubber",
|
|
1085
|
-
.h { margin: 0; color: var(--impakt-heading, ${
|
|
1300
|
+
`}};customElements.define("impakt-scrubber",ni);import{css as Re,html as w,nothing as ce,svg as rt}from"./atomic-ui.js";import{say as oe,ImpaktElement as ge,focusRing as _a,visuallyHidden as Da,fontSize as Ue,fontWeight as Ci,space as E,spaceAround as st,t as H,type as Ua,iconSvg as Ya,toneOf as Ei,TONE as pa}from"./atomic-ui.js";function Bi(n,t){let e=()=>{n.setAttribute("shown",""),t?.()};if(typeof IntersectionObserver!="function")return e(),()=>{};let i=new IntersectionObserver(a=>{a.some(r=>r.isIntersecting)&&(e(),i.disconnect())},{threshold:.25});return i.observe(n),()=>i.disconnect()}var ha=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,hi=Re`.mono { font-family: ${H.fontMono}; font-size: ${Ue("xs")}; letter-spacing: 0.04em; }`,Ga=(n,t,e)=>{switch(Math.min(Math.max(n||3,2),6)){case 2:return w`<h2 class=${e}>${t}</h2>`;case 4:return w`<h4 class=${e}>${t}</h4>`;case 5:return w`<h5 class=${e}>${t}</h5>`;case 6:return w`<h6 class=${e}>${t}</h6>`;default:return w`<h3 class=${e}>${t}</h3>`}},mi=Re`
|
|
1301
|
+
.h { margin: 0; color: var(--impakt-heading, ${H.textHeading}); font-family: ${H.fontHeading}; font-weight: ${Ci("bold")}; letter-spacing: ${H.trackingTight}; text-wrap: balance; }
|
|
1086
1302
|
.body { margin: 0; color: inherit; opacity: 0.8; text-wrap: pretty; }
|
|
1087
1303
|
.meta { margin: 0; color: inherit; opacity: 0.72; text-transform: uppercase; }
|
|
1088
|
-
.sr-only { ${
|
|
1089
|
-
`,
|
|
1304
|
+
.sr-only { ${Da} }
|
|
1305
|
+
`,oi=class extends ge{constructor(){super();this.raf=0;this.label="",this.heading="",this.text="",this.beforeSrc="",this.beforeAlt="",this.afterSrc="",this.afterAlt="",this.items=[],this.href="",this.headingLevel=3,this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={label:{type:String},heading:{type:String},text:{type:String},beforeSrc:{type:String,attribute:"before-src"},beforeAlt:{type:String,attribute:"before-alt"},afterSrc:{type:String,attribute:"after-src"},afterAlt:{type:String,attribute:"after-alt"},items:{type:Array},href:{type:String},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...ge.styles,st,hi,mi,Re`
|
|
1090
1306
|
:host { display: block; }
|
|
1091
|
-
article { display: flex; flex-direction: column; gap: ${
|
|
1092
|
-
.media { border-radius: ${
|
|
1307
|
+
article { display: flex; flex-direction: column; gap: ${E(3)}; }
|
|
1308
|
+
.media { border-radius: ${H.radiusXl}; overflow: clip; background: ${H.surfaceInset}; }
|
|
1093
1309
|
.media img { display: block; inline-size: 100%; aspect-ratio: 5 / 3; object-fit: cover; }
|
|
1094
1310
|
impakt-before-after { display: block; }
|
|
1095
|
-
.h { font-size: ${
|
|
1311
|
+
.h { font-size: ${Ue("3xl")}; }
|
|
1096
1312
|
.h a { color: inherit; text-decoration: none; }
|
|
1097
1313
|
.h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
|
|
1098
|
-
.h a:focus-visible { outline: none; box-shadow: ${
|
|
1099
|
-
ul { list-style: none; margin: ${
|
|
1100
|
-
li { display: grid; grid-template-columns: 1.25em minmax(0, 1fr); gap: ${
|
|
1101
|
-
li[data-change='added'] { background: ${
|
|
1102
|
-
li[data-change='removed'] { background: ${
|
|
1103
|
-
li[data-change='same'] { color: ${
|
|
1104
|
-
.sign { font-weight: ${
|
|
1105
|
-
`]}wipe(e){let i=this.renderRoot.querySelector("impakt-before-after");if(!i)return;if(cancelAnimationFrame(this.raf),
|
|
1106
|
-
${e?
|
|
1107
|
-
${this.label?
|
|
1108
|
-
${this.heading?
|
|
1109
|
-
${this.text?
|
|
1110
|
-
${(this.items??[]).length?
|
|
1111
|
-
</article>`}},
|
|
1314
|
+
.h a:focus-visible { outline: none; box-shadow: ${H.focusShadow}; border-radius: ${H.radiusSm}; }
|
|
1315
|
+
ul { list-style: none; margin: ${E(1)} 0 0; padding: 0; display: grid; gap: ${E(1)}; }
|
|
1316
|
+
li { display: grid; grid-template-columns: 1.25em minmax(0, 1fr); gap: ${E(2)}; padding: ${E(1)} ${E(3)}; border-radius: ${H.radius}; }
|
|
1317
|
+
li[data-change='added'] { background: ${H.successSubtle}; color: ${H.successText}; }
|
|
1318
|
+
li[data-change='removed'] { background: ${H.dangerSubtle}; color: ${H.dangerText}; }
|
|
1319
|
+
li[data-change='same'] { color: ${H.textMuted}; }
|
|
1320
|
+
.sign { font-weight: ${Ci("bold")}; }
|
|
1321
|
+
`]}wipe(e){let i=this.renderRoot.querySelector("impakt-before-after");if(!i)return;if(cancelAnimationFrame(this.raf),ha()){i.position=e;return}let a=i.position??Li,r=performance.now(),o=x=>x<.5?4*x*x*x:1-Math.pow(-2*x+2,3)/2,l=x=>{let v=Math.min(1,(x-r)/450);i.position=a+(e-a)*o(v),v<1&&(this.raf=requestAnimationFrame(l))};this.raf=requestAnimationFrame(l)}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this.raf)}render(){let e=this.beforeSrc&&this.afterSrc,i=this.href?w`<a href=${this.href}>${this.heading}</a>`:this.heading,a={added:"+",removed:"\u2212",same:" "},r={added:oe("Added"),removed:oe("Removed"),same:oe("Kept")};return w`<article part="card">
|
|
1322
|
+
${e?w`<div class="media" @pointerenter=${o=>o.pointerType==="mouse"&&this.wipe(0)} @pointerleave=${o=>o.pointerType==="mouse"&&this.wipe(Li)}><impakt-before-after .position=${Li} .beforeSrc=${this.beforeSrc} .beforeAlt=${this.beforeAlt} .afterSrc=${this.afterSrc} .afterAlt=${this.afterAlt} .beforeLabel=${oe("Before")} .afterLabel=${oe("Shipped")} .label=${oe("Compare {name} before and after",{name:this.heading})}></impakt-before-after></div>`:this.afterSrc||this.beforeSrc?w`<div class="media"><img src=${this.afterSrc||this.beforeSrc} alt=${this.afterSrc?this.afterAlt:this.beforeAlt} loading="lazy" /></div>`:ce}
|
|
1323
|
+
${this.label?w`<p class="meta mono">${this.label}</p>`:ce}
|
|
1324
|
+
${this.heading?Xa(this.headingLevel,i):ce}
|
|
1325
|
+
${this.text?w`<p class="body">${this.text}</p>`:ce}
|
|
1326
|
+
${(this.items??[]).length?w`<ul class="mono" part="diff">${this.items.map(o=>w`<li data-change=${o.change}><span class="sign" aria-hidden="true">${a[o.change]??" "}</span><span><span class="sr-only">${r[o.change]??""}: </span>${o.text}</span></li>`)}</ul>`:ce}
|
|
1327
|
+
</article>`}},li=class extends ge{static{this.properties={items:{type:Array},columns:{type:String,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.items=[],this.columns="two",this.headingLevel=3,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...ge.styles,st,Re`
|
|
1112
1328
|
:host { display: block; container-type: inline-size; }
|
|
1113
|
-
ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${
|
|
1329
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${E(12)} ${E(10)}; }
|
|
1114
1330
|
:host([columns='one']) ul { grid-template-columns: minmax(0, 1fr); }
|
|
1115
1331
|
:host([columns='three']) ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
1116
1332
|
@container (max-width: 44rem) { ul, :host([columns='three']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
1117
|
-
`]}render(){let t=typeof location>"u"?"":location.pathname.replace(/\/$/,""),e=(this.items??[]).filter(i=>!i.href||i.href.replace(/\/$/,"")!==t);return
|
|
1333
|
+
`]}render(){let t=typeof location>"u"?"":location.pathname.replace(/\/$/,""),e=(this.items??[]).filter(i=>!i.href||i.href.replace(/\/$/,"")!==t);return w`<ul part="list">${e.map(i=>{let a=i.heading??i.title??"";return w`<li><impakt-release-card
|
|
1118
1334
|
.label=${i.label??""} .heading=${a} .text=${i.text??""} .href=${i.href??""}
|
|
1119
|
-
.beforeSrc=${i.beforeSrc??""} .beforeAlt=${i.beforeAlt||
|
|
1120
|
-
.afterSrc=${i.afterSrc??""} .afterAlt=${i.afterAlt||
|
|
1121
|
-
.items=${i.items??[]} .headingLevel=${this.headingLevel}></impakt-release-card></li>`})}</ul>`}},
|
|
1335
|
+
.beforeSrc=${i.beforeSrc??""} .beforeAlt=${i.beforeAlt||oe("{name} as a wireframe",{name:a})}
|
|
1336
|
+
.afterSrc=${i.afterSrc??""} .afterAlt=${i.afterAlt||oe("{name} as it shipped",{name:a})}
|
|
1337
|
+
.items=${i.items??[]} .headingLevel=${this.headingLevel}></impakt-release-card></li>`})}</ul>`}},Li=42;function Xa(n,t){let e=Math.min(Math.max(n||3,2),6);return e===2?w`<h2 class="h">${t}</h2>`:e===4?w`<h4 class="h">${t}</h4>`:e===5?w`<h5 class="h">${t}</h5>`:e===6?w`<h6 class="h">${t}</h6>`:w`<h3 class="h">${t}</h3>`}var ci=class extends ge{constructor(){super();this.unwatch=()=>{};this.items=[],this.trunk="",this.headingLevel=3,this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={items:{type:Array},trunk:{type:String},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...ge.styles,st,hi,mi,Re`
|
|
1122
1338
|
:host { display: block; container-type: inline-size; --trunk: color-mix(in srgb, currentColor 70%, transparent); }
|
|
1123
1339
|
ul { list-style: none; margin: 0; padding: 0; position: relative; }
|
|
1124
1340
|
ul::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 11px; inline-size: 3px; border-radius: 3px; background: var(--trunk); }
|
|
1125
|
-
li { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); padding-block: ${
|
|
1341
|
+
li { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); padding-block: ${E(6)}; }
|
|
1126
1342
|
.graph { position: relative; }
|
|
1127
|
-
.graph svg { position: absolute; inset-block-start: -${
|
|
1128
|
-
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${
|
|
1129
|
-
.path { margin: 0 0 ${
|
|
1130
|
-
.h { font-size: ${
|
|
1343
|
+
.graph svg { position: absolute; inset-block-start: -${E(6)}; inset-inline-start: 0; inline-size: 96px; block-size: calc(100% + ${E(12)}); overflow: visible; }
|
|
1344
|
+
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${E(4)} ${E(10)}; align-items: start; }
|
|
1345
|
+
.path { margin: 0 0 ${E(2)}; opacity: 0.72; }
|
|
1346
|
+
.h { font-size: ${Ue("3xl")}; line-height: 1.05; }
|
|
1131
1347
|
.h a { color: inherit; text-decoration: none; }
|
|
1132
1348
|
.h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
|
|
1133
|
-
.h a:focus-visible { outline: none; box-shadow: ${
|
|
1134
|
-
.detail { display: flex; flex-direction: column; gap: ${
|
|
1349
|
+
.h a:focus-visible { outline: none; box-shadow: ${H.focusShadow}; border-radius: ${H.radiusSm}; }
|
|
1350
|
+
.detail { display: flex; flex-direction: column; gap: ${E(3)}; padding-block-start: ${E(1)}; }
|
|
1135
1351
|
.tags { margin: 0; opacity: 0.7; text-transform: uppercase; }
|
|
1136
|
-
.end { position: relative; display: flex; align-items: center; gap: ${
|
|
1352
|
+
.end { position: relative; display: flex; align-items: center; gap: ${E(3)}; padding-block-start: ${E(4)}; }
|
|
1137
1353
|
.end::before { content: ''; inline-size: 16px; block-size: 16px; margin-inline-start: 5px; border-radius: 50%; background: currentColor; }
|
|
1138
1354
|
@container (max-width: 44rem) {
|
|
1139
1355
|
li { grid-template-columns: 56px minmax(0, 1fr); }
|
|
1140
1356
|
.graph svg { inline-size: 56px; }
|
|
1141
1357
|
.row { grid-template-columns: minmax(0, 1fr); }
|
|
1142
|
-
.h { font-size: ${
|
|
1358
|
+
.h { font-size: ${Ue("2xl")}; }
|
|
1143
1359
|
}
|
|
1144
1360
|
/* Branch draw: each branch opens down from the trunk, 120 ms after the one above, then its dot pops. */
|
|
1145
1361
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -1148,29 +1364,29 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
1148
1364
|
:host([shown]) .graph svg { clip-path: inset(0); }
|
|
1149
1365
|
:host([shown]) .graph circle { transform: scale(1); }
|
|
1150
1366
|
}
|
|
1151
|
-
`]}connectedCallback(){super.connectedCallback(),this.unwatch=
|
|
1367
|
+
`]}connectedCallback(){super.connectedCallback(),this.unwatch=Bi(this)}disconnectedCallback(){super.disconnectedCallback(),this.unwatch()}render(){let e=i=>rt`<svg viewBox="0 0 96 200" preserveAspectRatio="none" aria-hidden="true" focusable="false">
|
|
1152
1368
|
<path d="M12 0 C12 40 60 30 60 70 L60 120 C60 160 12 160 12 200" fill="none" stroke=${i} stroke-width="3" vector-effect="non-scaling-stroke" />
|
|
1153
1369
|
<circle cx="60" cy="86" r="8" fill=${i} />
|
|
1154
|
-
</svg>`;return
|
|
1155
|
-
<div class="graph">${e(
|
|
1370
|
+
</svg>`;return w`<ul part="list">${(this.items??[]).map((i,a)=>w`<li part="item" style=${`--i:${a}`}>
|
|
1371
|
+
<div class="graph">${e(Ei(i.tone,a))}</div>
|
|
1156
1372
|
<div>
|
|
1157
|
-
${i.path?
|
|
1373
|
+
${i.path?w`<p class="path mono">${i.path}</p>`:ce}
|
|
1158
1374
|
<div class="row">
|
|
1159
|
-
${
|
|
1375
|
+
${Ga(this.headingLevel,i.href?w`<a href=${i.href}>${i.heading}</a>`:i.heading,"h")}
|
|
1160
1376
|
<div class="detail">
|
|
1161
|
-
${i.text?
|
|
1162
|
-
${i.tags?.length?
|
|
1377
|
+
${i.text?w`<p class="body">${i.text}</p>`:ce}
|
|
1378
|
+
${i.tags?.length?w`<p class="tags mono">${i.tags.join(" \xB7 ")}</p>`:ce}
|
|
1163
1379
|
</div>
|
|
1164
1380
|
</div>
|
|
1165
1381
|
</div>
|
|
1166
1382
|
</li>`)}</ul>
|
|
1167
|
-
${this.trunk?
|
|
1383
|
+
${this.trunk?w`<p class="end mono" part="trunk">${this.trunk}</p>`:ce}`}},di=class extends ge{constructor(){super();this.unwatch=()=>{};this.counted=null;this.items=[],this.summary="",this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={items:{type:Array},summary:{type:String},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...ge.styles,st,hi,mi,Re`
|
|
1168
1384
|
:host { display: block; container-type: inline-size; }
|
|
1169
|
-
.summary { display: inline-flex; align-items: center; gap: ${
|
|
1170
|
-
.summary::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: ${
|
|
1385
|
+
.summary { display: inline-flex; align-items: center; gap: ${E(2)}; margin: 0 0 ${E(6)}; padding: ${E(1)} ${E(3)}; border-radius: ${H.radiusXl}; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
|
|
1386
|
+
.summary::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: ${H.success}; }
|
|
1171
1387
|
/* The rows share one grid, so the figure column fits the widest figure and every row lines up. */
|
|
1172
|
-
ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 32px max-content minmax(0, 1fr) auto; column-gap: ${
|
|
1173
|
-
li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding-block: ${
|
|
1388
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 32px max-content minmax(0, 1fr) auto; column-gap: ${E(6)}; }
|
|
1389
|
+
li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding-block: ${E(5)}; border-block-end: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
|
|
1174
1390
|
/* Checks run: each tick pops in, 150 ms after the one above. */
|
|
1175
1391
|
@media (prefers-reduced-motion: no-preference) {
|
|
1176
1392
|
.tick { transform: scale(0); transition: transform 600ms cubic-bezier(.34, 1.56, .64, 1) calc(var(--i, 0) * 150ms); }
|
|
@@ -1178,28 +1394,28 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
1178
1394
|
}
|
|
1179
1395
|
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
1180
1396
|
/* A passed check is a filled disc with a tick cut out of it, as a CI run shows one. */
|
|
1181
|
-
.tick { display: inline-flex; align-items: center; justify-content: center; inline-size: 26px; block-size: 26px; border-radius: 50%; background: ${
|
|
1182
|
-
.figure { margin: 0; font-family: ${
|
|
1183
|
-
.label { margin: 0; ${
|
|
1397
|
+
.tick { display: inline-flex; align-items: center; justify-content: center; inline-size: 26px; block-size: 26px; border-radius: 50%; background: ${H.success}; color: var(--impakt-color-status-success-on, #fff); }
|
|
1398
|
+
.figure { margin: 0; font-family: ${H.fontHeading}; font-weight: ${Ci("bold")}; font-size: ${Ue("5xl")}; line-height: 1; letter-spacing: ${H.trackingTight}; white-space: nowrap; }
|
|
1399
|
+
.label { margin: 0; ${Ua("xl")} }
|
|
1184
1400
|
.status { margin: 0; opacity: 0.72; }
|
|
1185
1401
|
@container (max-width: 40rem) {
|
|
1186
1402
|
ul { grid-template-columns: 28px minmax(0, 1fr); }
|
|
1187
|
-
li { row-gap: ${
|
|
1403
|
+
li { row-gap: ${E(1)}; }
|
|
1188
1404
|
.label, .status { grid-column: 2; }
|
|
1189
|
-
.figure { font-size: ${
|
|
1405
|
+
.figure { font-size: ${Ue("4xl")}; }
|
|
1190
1406
|
}
|
|
1191
|
-
`]}connectedCallback(){super.connectedCallback(),this.unwatch=
|
|
1192
|
-
<ul part="list">${(this.items??[]).map((i,a)=>
|
|
1193
|
-
<span class="tick" aria-hidden="true">${
|
|
1407
|
+
`]}connectedCallback(){super.connectedCallback(),this.unwatch=Bi(this,()=>this.run())}disconnectedCallback(){super.disconnectedCallback(),this.unwatch()}run(){if(ha())return;let e=this.items??[],i=performance.now(),a=r=>{this.counted=e.map((o,l)=>Math.min(1,Math.max(0,(r-i-l*150)/1200))),this.requestUpdate(),this.counted.some(o=>o<1)?requestAnimationFrame(a):this.counted=null};requestAnimationFrame(a)}render(){let e=(i,a)=>{let r=this.counted?.[a],o=/^(\d+)(.*)$/.exec(i);if(r===void 0||r>=1||!o)return w`${i}`;let l=1-Math.pow(1-r,3);return w`<span aria-hidden="true">${Math.round(Number(o[1])*l)}${o[2]}</span><span class="sr-only">${i}</span>`};return w`${this.summary?w`<p class="summary mono" part="summary">${this.summary}</p>`:ce}
|
|
1408
|
+
<ul part="list">${(this.items??[]).map((i,a)=>w`<li part="item" style=${`--i:${a}`}>
|
|
1409
|
+
<span class="tick" aria-hidden="true">${Ya("check","16px")}</span>
|
|
1194
1410
|
<p class="figure">${e(i.figure,a)}</p>
|
|
1195
1411
|
<p class="label">${i.label}</p>
|
|
1196
|
-
${i.status?
|
|
1197
|
-
</li>`)}</ul>`}},
|
|
1412
|
+
${i.status?w`<p class="status mono">${i.status}</p>`:w`<span></span>`}
|
|
1413
|
+
</li>`)}</ul>`}},pi=class extends ge{constructor(){super();this.unwatch=()=>{};this.lanes=[],this.marks=[],this.span=20,this.unit="",this.every=2,this.release="",this.releaseAt=0,this.label="",this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={lanes:{type:Array},marks:{type:Array},span:{type:Number},unit:{type:String},every:{type:Number},release:{type:String},releaseAt:{type:Number,attribute:"release-at"},label:{type:String},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...ge.styles,_a,st,hi,mi,Re`
|
|
1198
1414
|
:host { display: block; }
|
|
1199
1415
|
/* On a narrow screen the graph scrolls sideways, so the scroller takes focus and the arrow keys move it (2.1.1). */
|
|
1200
|
-
figure { margin: 0; overflow-x: auto; border-radius: ${
|
|
1416
|
+
figure { margin: 0; overflow-x: auto; border-radius: ${H.radiusSm}; }
|
|
1201
1417
|
svg { display: block; inline-size: 100%; min-inline-size: 640px; block-size: auto; overflow: visible; }
|
|
1202
|
-
text { font-family: ${
|
|
1418
|
+
text { font-family: ${H.fontMono}; font-size: 12px; fill: currentColor; }
|
|
1203
1419
|
.faint { opacity: 0.5; }
|
|
1204
1420
|
/* A lane's label keeps a band of the page colour around it, so a line crossing it stays legible. */
|
|
1205
1421
|
.halo { paint-order: stroke; stroke: var(--impakt-color-surface-card, #fff); stroke-width: 5px; stroke-linejoin: round; }
|
|
@@ -1208,22 +1424,22 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
1208
1424
|
svg { clip-path: inset(0 100% 0 0); transition: clip-path 1400ms cubic-bezier(.25, 1, .5, 1); }
|
|
1209
1425
|
:host([shown]) svg { clip-path: inset(0 -40px 0 0); }
|
|
1210
1426
|
}
|
|
1211
|
-
`]}connectedCallback(){super.connectedCallback(),this.unwatch=
|
|
1212
|
-
<svg viewBox="0 0 ${1200} ${
|
|
1213
|
-
<line x1=${24} y1=${
|
|
1214
|
-
<path d="M${1168} ${
|
|
1215
|
-
${l.map((
|
|
1216
|
-
<path d="M${
|
|
1217
|
-
<circle cx=${
|
|
1218
|
-
<text x=${
|
|
1427
|
+
`]}connectedCallback(){super.connectedCallback(),this.unwatch=Bi(this)}disconnectedCallback(){super.disconnectedCallback(),this.unwatch()}render(){let r=this.span>0?this.span:20,o=A=>24+Math.min(Math.max(A,0),r)/r*1116,l=this.lanes??[],x=52,v=40+(l.length+1)*x+40,g=40,Se=A=>g+(A+1)*x,$e=[];for(let A=0;A<=r;A+=Math.max(1,this.every||2))$e.push(A);let nt=A=>l.findIndex(V=>A>=V.from&&A<=V.to),ma=A=>(this.marks??[]).some(V=>nt(V.at)===A),ui=this.unit||oe("wk"),ua=this.label||oe("Project timeline"),ga=l.map(A=>`${A.label}: ${oe("{unit} {from} to {to}",{unit:ui,from:A.from,to:A.to})}`).join("; ");return w`<figure part="figure" tabindex="0">
|
|
1428
|
+
<svg viewBox="0 0 ${1200} ${v}" role="img" aria-label=${`${ua}. ${ga}${this.release?`. ${oe("{name} at {unit} {at}",{name:this.release,unit:ui,at:this.releaseAt})}`:""}`}>
|
|
1429
|
+
<line x1=${24} y1=${g} x2=${1180} y2=${g} stroke="currentColor" stroke-width="3" stroke-linecap="round" />
|
|
1430
|
+
<path d="M${1168} ${g-7} L${1180} ${g} L${1168} ${g+7}" fill="none" stroke="currentColor" stroke-width="3" />
|
|
1431
|
+
${l.map((A,V)=>{let Pe=Ei(A.tone,V),de=Se(V),ze=o(A.from),Ye=o(A.to),Ge=Math.min(36,(Ye-ze)/3);return rt`<g>
|
|
1432
|
+
<path d="M${ze} ${g} C${ze} ${(g+de)/2} ${ze+Ge} ${de} ${ze+Ge*1.6} ${de} L${Ye-Ge*1.6} ${de} C${Ye-Ge} ${de} ${Ye} ${(g+de)/2} ${Ye} ${g}" fill="none" stroke=${Pe} stroke-width="3" />
|
|
1433
|
+
<circle cx=${ze} cy=${g} r="7" fill=${Pe} />
|
|
1434
|
+
<text x=${ze+Ge*1.6} y=${ma(V)?de-10:de+20} class="halo" style=${`fill:${Pe}`}>${A.label}</text>
|
|
1219
1435
|
</g>`})}
|
|
1220
|
-
${(this.marks??[]).map(
|
|
1221
|
-
${this.release?
|
|
1222
|
-
<circle cx=${
|
|
1223
|
-
<rect x=${
|
|
1224
|
-
<text x=${
|
|
1225
|
-
</g>`:
|
|
1226
|
-
${
|
|
1436
|
+
${(this.marks??[]).map(A=>{let V=nt(A.at),Pe=V>=0?Se(V):g,de=V>=0?Ei(l[V].tone,V):"currentColor";return rt`<g><circle cx=${o(A.at)} cy=${Pe} r="6" fill="var(--impakt-color-surface-card, #fff)" stroke=${de} stroke-width="3" /><text x=${o(A.at)} y=${Pe+22} text-anchor="middle" class="faint">${A.label}</text></g>`})}
|
|
1437
|
+
${this.release?rt`<g>
|
|
1438
|
+
<circle cx=${o(this.releaseAt)} cy=${g} r="10" fill=${pa.success} />
|
|
1439
|
+
<rect x=${o(this.releaseAt)-8} y=${g-36} rx="4" width=${this.release.length*7.6+16} height="22" fill=${pa.success} />
|
|
1440
|
+
<text x=${o(this.releaseAt)} y=${g-21} style="fill:var(--impakt-color-surface-card, #fff)">${this.release}</text>
|
|
1441
|
+
</g>`:ce}
|
|
1442
|
+
${$e.map(A=>rt`<text x=${o(A)} y=${v-10} text-anchor="middle" class="faint">${ui} ${A}</text>`)}
|
|
1227
1443
|
</svg>
|
|
1228
|
-
</figure>`}};customElements.define("impakt-release-card",
|
|
1444
|
+
</figure>`}};customElements.define("impakt-release-card",oi);customElements.define("impakt-release-list",li);customElements.define("impakt-branch-list",ci);customElements.define("impakt-check-list",di);customElements.define("impakt-branch-timeline",pi);export{Vt as ImpaktAffordabilityCalculator,mt as ImpaktAnnouncement,Wt as ImpaktBeforeAfter,ci as ImpaktBranchList,pi as ImpaktBranchTimeline,ft as ImpaktCardGrid,Lt as ImpaktCarousel,di as ImpaktCheckList,et as ImpaktContactBlock,Ht as ImpaktCtaBanner,Zt as ImpaktEstimator,kt as ImpaktFaq,dt as ImpaktFeatureList,Et as ImpaktGallery,ct as ImpaktHero,Tt as ImpaktHighlight,yt as ImpaktJourneyButton,_t as ImpaktLocationCard,Ct as ImpaktLogoCloud,It as ImpaktMediaSplit,Ft as ImpaktMortgageCalculator,Pt as ImpaktNewsletter,St as ImpaktOffer,Yt as ImpaktPlanComparison,zt as ImpaktPostCard,pt as ImpaktQuote,Gt as ImpaktRegulatoryNotice,oi as ImpaktReleaseCard,li as ImpaktReleaseList,Rt as ImpaktReviews,si as ImpaktScene,ni as ImpaktScrubber,ut as ImpaktSearchBar,ii as ImpaktSiteFooter,ei as ImpaktSiteHeader,wt as ImpaktSiteMenu,Ot as ImpaktSitePlan,Xt as ImpaktStampDutyCalculator,ht as ImpaktStat,vt as ImpaktStatRow,Bt as ImpaktSteps,qt as ImpaktStickyBar,Ze as ImpaktVideo,ti as ImpaktWordmark,xt as ImpaktWorkList,Oi as JOURNEY_STAGES,ke as SDLT,Qi as embedOf,Kt as estimate,Ui as gallerySpan,Gi as monthlyPayment,sa as phaseWeeks,Ji as stampDuty};
|
|
1229
1445
|
//# sourceMappingURL=atomic-ui-blocks.js.map
|